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
7,100
Formal Guarantees on the Robustness of a Classifier against Adversarial Manipulation Matthias Hein and Maksym Andriushchenko Department of Mathematics and Computer Science Saarland University, Saarbrücken Informatics Campus, Germany Abstract Recent work has shown that state-of-the-art classifiers are quite brittle, in the sense that a small adversarial change of an originally with high confidence correctly classified input leads to a wrong classification again with high confidence. This raises concerns that such classifiers are vulnerable to attacks and calls into question their usage in safety-critical systems. We show in this paper for the first time formal guarantees on the robustness of a classifier by giving instance-specific lower bounds on the norm of the input manipulation required to change the classifier decision. Based on this analysis we propose the Cross-Lipschitz regularization functional. We show that using this form of regularization in kernel methods resp. neural networks improves the robustness of the classifier with no or small loss in prediction performance. 1 Introduction The problem of adversarial manipulation of classifiers has been addressed initially in the area of spam email detection, see e.g. [5, 16]. The goal of the spammer is to manipulate the spam email (the input of the classifier) in such a way that it is not detected by the classifier. In deep learning the problem was brought up in the seminal paper by [24]. They showed for state-ofthe-art deep neural networks, that one can manipulate an originally correctly classified input image with a non-perceivable small transformation so that the classifier now misclassifies this image with high confidence, see [7] or Figure 3 for an illustration. This property calls into question the usage of neural networks and other classifiers showing this behavior in safety critical systems, as they are vulnerable to attacks. On the other hand this also shows that the concepts learned by a classifier are still quite far away from the visual perception of humans. Subsequent research has found fast ways to generate adversarial samples with high probability [7, 12, 19] and suggested to use them during training as a form of data augmentation to gain more robustness. However, it turns out that the so-called adversarial training does not settle the problem as one can yet again construct adversarial examples for the final classifier. Interestingly, it has recently been shown that there exist universal adversarial changes which when applied lead, for every image, to a wrong classification with high probability [17]. While one needs access to the neural network model for the generation of adversarial changes, it has been shown that adversarial manipulations generalize across neural networks [18, 15, 14], which means that neural network classifiers can be attacked even as a black-box method. The most extreme case has been shown recently [15], where they attack the commercial system Clarifai, which is a black-box system as neither the underlying classifier nor the training data are known. Nevertheless, they could successfully generate adversarial images with an existing network and fool this commercial system. This emphasizes that there are indeed severe security issues with modern neural networks. While countermeasures have been proposed [8, 7, 26, 18, 12, 2], none of them provides a guarantee 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. of preventing this behavior [3]. One might think that generative adversarial neural networks should be resistant to this problem, but it has recently been shown [13] that they can also be attacked by adversarial manipulation of input images. In this paper we show for the first time instance-specific formal guarantees on the robustness of a classifier against adversarial manipulation. That means we provide lower bounds on the norm of the change of the input required to alter the classifier decision or said otherwise: we provide a guarantee that the classifier decision does not change in a certain ball around the considered instance. We exemplify our technique for two widely used family of classifiers: kernel methods and neural networks. Based on the analysis we propose a new regularization functional, which we call Cross-Lipschitz Regularization. This regularization functional can be used in kernel methods and neural networks. We show that using Cross-Lipschitz regularization improves both the formal guarantees of the resulting classifier (lower bounds) as well as the change required for adversarial manipulation (upper bounds) while maintaining similar prediction performance achievable with other forms of regularization. While there exist fast ways to generate adversarial samples [7, 12, 19] without constraints, we provide algorithms based on the first order approximation of the classifier which generate adversarial samples satisfying box constraints in O(d log d), where d is the input dimension. 2 Formal Robustness Guarantees for Classifiers In the following we consider the multi-class setting for K classes and d features where one has a classifier f : Rd →RK and a point x is classified via c = arg max j=1,...,K fj(x). We call a classifier robust at x if small changes of the input do not alter the decision. Formally, the problem can be described as follows [24]. Suppose that the classifier outputs class c for input x, that is fc(x) > fj(x) for j ̸= c (we assume the decision is unique). The problem of generating an input x + δ such that the classifier decision changes, can be formulated as min δ∈Rd ∥δ∥p , s.th. max l̸=c fl(x + δ) ≥fc(x + δ) and x + δ ∈C, (1) where C is a constraint set specifying certain requirements on the generated input x + δ, e.g., an image has to be in [0, 1]d. Typically, the optimization problem (1) is non-convex and thus intractable. The so generated points x + δ are called adversarial samples. Depending on the p-norm the perturbations have different characteristics: for p = ∞the perturbations are small and affect all features, whereas for p = 1 one gets sparse solutions up to the extreme case that only a single feature is changed. In [24] they used p = 2 which leads to more spread but still localized perturbations. The striking result of [24, 7] was that for most instances in computer vision datasets, the change δ necessary to alter the decision is astonishingly small and thus clearly the label should not change. However, we will see later that our new regularizer leads to robust classifiers in the sense that the required adversarial change is so large that now also the class label changes (we have found the correct decision boundary), see Fig 3. Already in [24] it is suggested to add the generated adversarial samples as a form of data augmentation during the training of neural networks in order to achieve robustness. This is denoted as adversarial training. Later on fast ways to approximately solve (1) were proposed in order to speed up the adversarial training process [7, 12, 19]. However, in this way, given that the approximation is successful, that is arg max j fj(x + δ) ̸= c, one gets just upper bounds on the perturbation necessary to change the classifier decision. Also it was noted early on, that the final classifier achieved by adversarial training is again vulnerable to adversarial samples [7]. Robust optimization has been suggested as a measure against adversarial manipulation [12, 21] which effectively boils down to adversarial training in practice. It is thus fair to say that up to date no mechanism exists which prevents the generation of adversarial samples nor can defend against it [3]. In this paper we focus instead on robustness guarantees, that is we show that the classifier decision does not change in a small ball around the instance. Thus our guarantees hold for any method to generate adversarial samples or input transformations due to noise or sensor failure etc. Such formal guarantees are in our point of view absolutely necessary when a classifier becomes part of a safety-critical technical system such as autonomous driving. In the following we will first show how one can achieve such a guarantee and then explicitly 2 derive bounds for kernel methods and neural networks. We think that such formal guarantees on robustness should be investigated further and it should become standard to report them for different classifiers alongside the usual performance measures. 2.1 Formal Robustness Guarantee against Adversarial Manipulation The following guarantee holds for any classifier which is continuously differentiable with respect to the input in each output component. It is instance-specific and depends to some extent on the confidence in the decision, at least if we measure confidence by the relative difference fc(x)−maxj̸=c fj(x) as it is typical for the cross-entropy loss and other multi-class losses. In the following we use the notation Bp(x, R) = {y ∈Rd | ∥x −y∥p ≤R}. Theorem 2.1. Let x ∈Rd and f : Rd →RK be a multi-class classifier with continuously differentiable components and let c = arg max j=1,...,K fj(x) be the class which f predicts for x. Let q ∈R be defined as 1 p + 1 q = 1, then for all δ ∈Rd with ∥δ∥p ≤max R>0 min   min j̸=c fc(x) −fj(x) max y∈Bp(x,R) ∥∇fc(y) −∇fj(y)∥q , R   := α, it holds c = arg max j=1,...,K fj(x + δ), that is the classifier decision does not change on Bp(x, α). Note that the bound requires in the denominator a bound on the local Lipschitz constant of all cross terms fc −fj, which we call local cross-Lipschitz constant in the following. However, we do not require to have a global bound. The problem with a global bound is that the ideal robust classifier is basically piecewise constant on larger regions with sharp transitions between the classes. However, the global Lipschitz constant would then just be influenced by the sharp transition zones and would not yield a good bound, whereas the local bound can adapt to regions where the classifier is approximately constant and then yields good guarantees. In [24, 4] they suggest to study the global Lipschitz constant1 of each fj, j = 1, . . . , K. A small global Lipschitz constant for all fj implies a good bound as ∥∇fj(y) −∇fc(y)∥q ≤∥∇fj(y)∥q + ∥∇fc(y)∥q , (2) but the converse does not hold. As discussed below it turns out that our local estimates are significantly better than the suggested global estimates which implies also better robustness guarantees. In turn we want to emphasize that our bound is tight, that is the bound is attained, for linear classifiers fj(x) = ⟨wj, x⟩, j = 1, . . . , K. It holds ∥δ∥p = min j̸=c ⟨wc −wj, x⟩ ∥wc −wj∥q . In Section 4 we refine this result for the case when the input is constrained to [0, 1]d. In general, it is possible to integrate constraints on the input by simply doing the maximum over the intersection of Bp(x, R) with the constraint set e.g. [0, 1]d for gray-scale images. 2.2 Evaluation of the Bound for Kernel Methods Next, we discuss how the bound can be evaluated for different classifier models. For simplicity we restrict ourselves to the case p = 2 (which implies q = 2) and leave the other cases to future work. We consider the class of kernel methods, that is the classifier has the form fj(x) = n X r=1 αjrk(xr, x), where (xr)n r=1 are the n training points, k : Rd ×Rd →R is a positive definite kernel function and α ∈RK×n are the trained parameters e.g. of a SVM. The goal is to upper bound the 1The Lipschitz constant L wrt to p-norm of a piecewise continuously differentiable function is given as L = supx∈Rd ∥∇f(x)∥q. Then it holds, |f(x) −f(y)| ≤L ∥x −y∥p. 3 term maxy∈B2(x,R) ∥∇fj(y) −∇fc(y)∥2 for this classifier model. A simple calculation shows 0 ≤∥∇fj(y) −∇fc(y)∥2 2 = n X r,s=1 (αjr −αcr)(αjs −αcs) ⟨∇yk(xr, y), ∇yk(xs, y)⟩ (3) It has been reported that kernel methods with a Gaussian kernel are robust to noise. Thus we specialize now to this class, that is k(x, y) = e−γ∥x−y∥2 2. In this case ⟨∇yk(xr, y), ∇yk(xs, y)⟩= 4γ2 ⟨y −xr, y −xs⟩e−γ∥xr−y∥2 2e−γ∥xs−y∥2 2. We derive the following bound Proposition 2.1. Let βr = αjr −αcr, r = 1, . . . , n and define M = min n ∥2x−xr−xs∥2 2 , R o and S = ∥2x −xr −xs∥2. Then maxy∈B2(x,R) ∥∇fj(y) −∇fc(y)∥2 ≤2γ n X r,s=1 βrβs≥0 βrβs h max{⟨x −xr, x −xs⟩+ RS + R2, 0}e−γ ∥x−xr∥2 2+∥x−xs∥2 2−2MS+2M 2 + min{⟨x −xr, x −xs⟩+ RS + R2, 0}e−γ ∥x−xr∥2 2+∥x−xs∥2 2+2RS+2R2i + n X r,s=1 βrβs<0 βrβs h max{⟨x −xr, x −xs⟩−MS + M 2, 0}e−γ ∥x−xr∥2 2+∥x−xs∥2 2+2RS+2R2 + min{⟨x −xr, x −xs⟩−MS + M 2, 0}e−γ ∥x−xr∥2 2+∥x−xs∥2 2−2MS+2M 2i! 1 2 While the bound leads to non-trivial estimates as seen in Section 5, the bound is not very tight. The reason is that the sum is bounded elementwise, which is quite pessimistic. We think that better bounds are possible but have to postpone this to future work. 2.3 Evaluation of the Bound for Neural Networks We derive the bound for a neural network with one hidden layer. In principle, the technique we apply below can be used for arbitrary layers but the computational complexity increases rapidly. The problem is that in the directed network topology one has to consider almost each path separately to derive the bound. Let U be the number of hidden units and w, u are the weight matrices of the output resp. input layer. We assume that the activation function σ is continuously differentiable and assume that the derivative σ′ is monotonically increasing. Our prototype activation function we have in mind and which we use later on in the experiment is the differentiable approximation, σα(x) = 1 α log(1 + eαx) of the ReLU activation function σReLU(x) = max{0, x}. Note that limα→∞σα(x) = σReLU(x) and σ′ α(x) = 1 1+e−αx . The output of the neural network can be written as fj(x) = U X r=1 wjr σ  d X s=1 ursxs  , j = 1, . . . , K, where for simplicity we omit any bias terms, but it is straightforward to consider also models with bias. A direct computation shows that ∥∇fj(y) −∇fc(y)∥2 2 = U X r,m=1 (wjr −wcr)(wjm −wcm)σ′(⟨ur, y⟩)σ′(⟨um, y⟩) d X l=1 urluml, (4) where ur ∈Rd is the r-th row of the weight matrix u ∈RU×d. The resulting bound is given in the following proposition. 4 Proposition 2.2. Let σ be a continuously differentiable activation function with σ′ monotonically increasing. Define βrm = (wjr −wcr)(wjm −wcm) Pd l=1 urluml. Then maxy∈B2(x,R) ∥∇fj(y) −∇fc(y)∥2 ≤ h U X r,m=1 max{βrm, 0}σ′⟨ur, x⟩+ R ∥ur∥2  σ′⟨um, x⟩+ R ∥um∥2  + min{βrm, 0}σ′⟨ur, x⟩−R ∥ur∥2  σ′⟨um, x⟩−R ∥um∥2 i 1 2 As discussed above the global Lipschitz bounds of the individual classifier outputs, see (2), lead to an upper bound of our desired local cross-Lipschitz constant. In the experiments below our local bounds on the Lipschitz constant are up to 8 times smaller, than what one would achieve via the global Lipschitz bounds of [24]. This shows that their global approach is much too rough to get meaningful robustness guarantees. 3 The Cross-Lipschitz Regularization Functional We have seen in Section 2 that if max j̸=c max y∈Bp(x,R) ∥∇fc(y) −∇fj(y)∥q , (5) is small and fc(x) −fj(x) is large, then we get good robustness guarantees. The latter property is typically already optimized in a multi-class loss function. We consider for all methods in this paper the cross-entropy loss so that the differences in the results only come from the chosen function class (kernel methods versus neural networks) and the chosen regularization functional. The cross-entropy loss L : {1, . . . , K} × RK →R is given as L(y, f(x)) = −log  efy(x) PK k=1 efk(x)  = log  1 + K X k̸=y efk(x)−fy(x) . In the latter formulation it becomes apparent that the loss tries to make the difference fy(x) −fk(x) as large as possible for all k = 1, . . . , K. As our goal are good robustness guarantees it is natural to consider a proxy of the quantity in (5) for regularization. We define the Cross-Lipschitz Regularization functional as Ω(f) = 1 nK2 n X i=1 K X l,m=1 ∥∇fl(xi) −∇fm(xi)∥2 2 , (6) where the (xi)n i=1 are the training points. The goal of this regularization functional is to make the differences of the classifier functions at the data points as constant as possible. In total by minimizing 1 n n X i=1 L yi, f(xi)  + λΩ(f), (7) over some function class we thus try to maximize fc(xi) −fj(xi) and at the same time keep ∥∇fl(xi) −∇fm(xi)∥2 2 small uniformly over all classes. This automatically enforces robustness of the resulting classifier. It is important to note that this regularization functional is coherent with the loss as it shares the same degrees of freedom, that is adding the same function g to all outputs: f ′ j(x) = fj(x) + g(x) leaves loss and regularization functional invariant. This is the main difference to [4], where they enforce the global Lipschitz constant to be smaller than one. 3.1 Cross-Lipschitz Regularization in Kernel Methods In kernel methods one uses typically the regularization functional induced by the kernel which is given as the squared norm of the function, f(x) = Pn i=1 αik(xi, x), in the corresponding 5 reproducing kernel Hilbert space Hk, ∥f∥2 Hk = Pn i,j=1 αiαjk(xi, xj). In particular, for translation invariant kernels one can make directly a connection to penalization of derivatives of the function f via the Fourier transform, see [20]. However, penalizing higher-order derivatives is irrelevant for achieving robustness. Given the kernel expansion of f, one can write the Cross-Lipschitz regularization function as Ω(f) = 1 nK2 n X i,j=1 K X l,m=1 n X r,s=1 (αlr −αmr)(αls −αms) ⟨∇yk(xr, xi), ∇yk(xs, xi)⟩ Ωis convex in α ∈RK×n as k′(xr, xs) = ⟨∇yk(xr, xi), ∇yk(xs, xi)⟩is a positive definite kernel for any xi and with the convex cross-entropy loss the learning problem in (7) is convex. 3.2 Cross-Lipschitz Regularization in Neural Networks The standard way to regularize neural networks is weight decay; that is, the squared Euclidean norm of all weights is added to the objective. More recently dropout [22], which can be seen as a form of stochastic regularization, has been introduced. Dropout can also be interpreted as a form of regularization of the weights [22, 10]. It is interesting to note that classical regularization functionals which penalize derivatives of the resulting classifier function are not typically used in deep learning, but see [6, 11]. As noted above we restrict ourselves to one hidden layer neural networks to simplify notation, that is, fj(x) = PU r=1 wjr σ Pd s=1 ursxs  , j = 1, . . . , K. Then we can write the Cross-Lipschitz regularization as Ω(f) = 2 nK2 U X r,s=1  K X l=1 wlrwls − K X l=1 wlr K X m=1 wms  n X i,j=1 σ′(⟨ur, xi⟩)σ′(⟨us, xi⟩) d X l=1 urlusl which leads to an expression which can be fast evaluated using vectorization. Obviously, one can also implement the Cross-Lipschitz Regularization also for all standard deep networks. 4 Box Constrained Adversarial Sample Generation The main emphasis of this paper are robustness guarantees without resorting to particular ways how to generate adversarial samples. On the other hand while Theorem 2.1 gives lower bounds on the required input transformation, efficient ways to approximately solve the adversarial sample generation in (1) are helpful to get upper bounds on the required change. Upper bounds allow us to check how tight our derived lower bounds are. As all of our experiments will be concerned with images, it is reasonable that our adversarial samples are also images. However, up to our knowledge, the current main techniques to generate adversarial samples [7, 12, 19] integrate box constraints by clipping the results to [0, 1]d. We provide in the following fast algorithms to generate adversarial samples which lie in [0, 1]d. The strategy is similar to [12], where they use a linear approximation of the classifier to derive adversarial samples with respect to different norms. Formally, fj(x + δ) ≈fj(x) + ⟨∇fj(x), δ⟩, j = 1, . . . , K. Assuming that the linear approximation holds, the optimization problem (1) integrating box constraints for changing class c into j becomes minδ∈Rd ∥δ∥p (8) sbj. to: fj(x) −fc(x) ≥⟨∇fc(x) −∇fj(x), δ⟩ 0 ≤xj + δj ≤1 In order to get the minimal adversarial sample we have to solve this for all j ̸= c and take the one with minimal ∥δ∥p. This yields the minimal adversarial change for linear classiifers. Note that (8) is a convex optimization problem, which can be reduced to a one-parameter problem in the dual. This allows to derive the following result (proofs and algorithms are in the supplement). Proposition 4.1. Let p ∈{1, 2, ∞}, then (8) can be solved in O(d log d) time. For nonlinear classifiers a change of the decision is not guaranteed and thus we use later on a binary search with a variable c instead of fc(x) −fj(x). 6 5 Experiments The goal of the experiments is the evaluation of the robustness of the resulting classifiers and not necessarily state-of-the-art results in terms of test error. In all cases we compute the robustness guarantees from Theorem 2.1 (lower bound on the norm of the minimal change required to change the classifier decision), where we optimize over R using binary search, and adversarial samples with the algorithm for the 2-norm from Section 4 (upper bound on the norm of the minimal change required to change the classifier decision), where we do a binary search in the classifier output difference in order to find a point on the decision boundary. Additional experiments can be found in the supplementary material. Kernel methods: We optimize the cross-entropy loss once with the standard regularization (Kernel-LogReg) and with Cross-Lipschitz regularization (Kernel-CL). Both are convex optimization problems and we use L-BFGS to solve them. We use the Gaussian kernel k(x, y) = e−γ∥x−y∥2 where γ = α ρ2 KNN40 and ρKNN40 is the mean of the 40 nearest neighbor distances on the training set and α ∈{0.5, 1, 2, 4}. We show the results for MNIST (60000 training and 10000 test samples). However, we have checked that parameter selection using a subset of 50000 images from the training set and evaluating on the rest yields indeed the parameters which give the best test errors when trained on the full set. The regularization parameter is chosen in λ ∈{10−k|k ∈{5, 6, 7, 8}} for Kernel-SVM and λ ∈{10−k | k ∈{0, 1, 2, 3}} for our Kernel-CL. The results of the optimal parameters are given in the following table and the performance of all parameters is shown in Figure 1. Note that due to the high computational complexity we could evaluate the robustness guarantees only for the optimal parameters. avg. ∥·∥2 avg.∥·∥2 test adv. rob. error samples guar. No Reg. 2.23% 2.39 0.037 (λ = 0) K-SVM 1.48% 1.91 0.058 K-CL 1.44% 3.12 0.045 Figure 1: Kernel Methods: Cross-Lipschitz regularization achieves both better test error and robustness against adversarial samples (upper bounds, larger is better) compared to the standard regularization. The robustness guarantee is weaker than for neural networks but this is most likely due to the relatively loose bound. Neural Networks: Before we demonstrate how upper and lower bounds improve using cross-Lipschitz regularization, we first want to highlight the importance of the usage of the local cross-Lipschitz constant in Theorem 2.1 for our robustness guarantee. Local versus global Cross-Lipschitz constant: While no robustness guarantee has been proven before, it has been discussed in [24] that penalization of the global Lipschitz constant should improve robustness, see also [4]. For that purpose they derive the Lipschitz constants of several different layers and use the fact that the Lipschitz constant of a composition of functions is upper bounded by the product of the Lipschitz constants of the functions. In analogy, this would mean that the term supy∈B(x,R) ∥∇fc(y) −∇fj(y)∥2, which we have upper bounded in Proposition 2.2, in the denominator in Theorem 2.1 could be replaced2 by the global Lipschitz constant of g(x) := fc(x) −fj(x). which is given as supy∈Rd ∥∇g(x)∥2 = supx̸=y |g(x)−g(y)| ∥x−y∥2 . We have with ∥U∥2,2 being the largest singular value of U, |g(x) −g(y)| = ⟨wc −wj, σ(Ux) −σ(Uy)⟩≤∥wc −wj∥2 ∥σ(Ux) −σ(Uy)∥2 ≤∥wc −wj∥2 ∥U(x −y)∥2 ≤∥wc −wj∥2 ∥U∥2,2 ∥x −y∥2 , where we used that σ is contractive as σ′(z) = 1 1+e−αz and thus we get sup y∈Rd ∥∇fc(x) −∇fj(x)∥2 ≤∥wc −wj∥2 ∥U∥2,2 . 2Note that then the optimization of R in Theorem 2.1 would be unnecessary. 7 MNIST (plain) CIFAR10 (plain) None Dropout Weight Dec. Cross Lip. None Dropout Weight Dec. Cross Lip. 0.69 0.48 0.68 0.21 0.22 0.13 0.24 0.17 Table 1: We show the average ratio αglobal αlocal of the robustness guarantees αglobal, αlocal from Theorem 2.1 on the test data for MNIST and CIFAR10 and different regularizers. The guarantees using the local Cross-Lipschitz constant are up to eight times better than with the global one. The advantage is clearly that this global Cross-Lipschitz constant can just be computed once and by using it in Theorem 2.1 one can evaluate the guarantees very quickly. However, it turns out that one gets significantly better robustness guarantees by using the local Cross-Lipschitz constant in terms of the bound derived in Proposition 2.2 instead of the just derived global Lipschitz constant. Note that the optimization over R in Theorem 2.1 is done using a binary search, noting that the bound of the local Lipschitz constant in Proposition 2.2 is monotonically decreasing in R. We have the following comparison in Table 1. We want to highlight that the robustness guarantee with the global Cross-Lipschitz constant was always worse than when using the local Cross-Lipschitz constant across all regularizers and data sets. Table 1 shows that the guarantees using the local Cross-Lipschitz can be up to eight times better than for the global one. As these are just one hidden layer networks, it is obvious that robustness guarantees for deep neural networks based on the global Lipschitz constants will be too coarse to be useful. Experiments: We use a one hidden layer network with 1024 hidden units and the softplus activation function with α = 10. Thus the resulting classifier is continuously differentiable. We compare three different regularization techniques: weight decay, dropout and our CrossLipschitz regularization. Training is done with SGD. For each method we have adapted the learning rate (two per method) and regularization parameters (4 per method) so that all methods achieve good performance. We do experiments for MNIST and CIFAR10 in three settings: plain, data augmentation and adversarial training. The exact settings of the parameters and the augmentation techniques are described in the supplementary material.The results for MNIST are shown in Figure 2 and the results for CIFAR10 are in the supplementary material.For MNIST there is a clear trend that our Cross-Lipschitz regularization improves the robustness of the resulting classifier while having competitive resp. better test error. It is surprising that data augmentation does not lead to more robust models. However, adversarial training improves the guarantees as well as adversarial resistance. For CIFAR10 the picture is mixed, our CL-Regularization performs well for the augmented task in test error and upper bounds but is not significantly better in the robustness guarantees. The problem might be that the overall bad performance due to the simple model is preventing a better behavior. Data augmentation leads to better test error but the robustness properties (upper and lower bounds) are basically unchanged. Adversarial training slightly improves performance compared to the plain setting and improves upper and lower bounds in terms of robustness. We want to highlight that our guarantees (lower bounds) and the upper bounds from the adversarial samples are not too far away. Illustration of adversarial samples: we take one test image from MNIST and apply the adversarial generation from Section 4 wrt to the 2-norm to generate the adversarial samples for the different kernel methods and neural networks (plain setting), where we use for each method the parameters leading to best test performance. All classifiers change their originally correct decision to a “wrong” one. It is interesting to note that for Cross-Lipschitz regularization (both kernel method and neural network) the “adversarial” sample is really at the decision boundary between 1 and 8 (as predicted) and thus the new decision is actually correct. This effect is strongest for our Kernel-CL, which also requires the strongest modification to generate the adversarial sample. The situation is different for neural networks, where the classifiers obtained from the two standard regularization techniques are still vulnerable, as the adversarial sample is still clearly a 1 for dropout and weight decay. Outlook Formal guarantees on machine learning systems are becoming increasingly more important as they are used in safety-critical systems. We think that there should be more 8 Adversarial Resistance (Upper Bound) Robustness Guarantee (Lower Bound) wrt to L2-norm wrt to L2-norm Figure 2: Neural Networks, Left: Adversarial resistance wrt to L2-norm on MNIST. Right: Average robustness guarantee wrt to L2-norm on MNIST for different neural networks (one hidden layer, 1024 HU) and hyperparameters. The Cross-Lipschitz regularization leads to better robustness with similar or better prediction performance. Top row: plain MNIST, Middle: Data Augmentation, Bottom: Adv. Training research on robustness guarantees (lower bounds), whereas current research is focused on new attacks (upper bounds). We have argued that our instance-specific guarantees using our local Cross-Lipschitz constant is more effective than using a global one and leads to lower bounds which are up to 8 times better. A major open problem is to come up with tight lower bounds for deep networks. Original, Class 1 K-SVM, Pred:7, ∥δ∥2 = 1.2 K-CL, Pred:8, ∥δ∥2 = 3.5 NN-WD, Pred:8, ∥δ∥2 = 1.2 NN-DO, Pred:7, ∥δ∥2 = 1.1 NN-CL, Pred:8, ∥δ∥2 = 2.6 Figure 3: Top left: original test image, for each classifier we generate the corresponding adversarial sample which changes the classifier decision (denoted as Pred). Note that for Cross-Lipschitz regularization this new decision makes (often) sense, whereas for the neural network models (weight decay/dropout) the change is so small that the new decision is clearly wrong. 9 References [1] M. Abadi, A. Agarwal, P. Barham, E. Brevdo, Z. Chen, C. Citro, G. S. Corrado, A. Davis, J. Dean, M. Devin, S. Ghemawat, I. J. Goodfellow, A. Harp, G. Irving, M. Isard, Y. Jia, R. Józefowicz, L. Kaiser, M. Kudlur, J. Levenberg, D. Mané, R. Monga, S. Moore, D. G. Murray, C. Olah, M. Schuster, J. Shlens, B. Steiner, I. Sutskever, K. Talwar, P. A. Tucker, V. Vanhoucke, V. Vasudevan, F. B. Viégas, O. Vinyals, P. Warden, M. Wattenberg, M. Wicke, Y. Yu, and X. Zheng. Tensorflow: Large-scale machine learning on heterogeneous distributed systems, 2016. [2] O. Bastani, Y. Ioannou, L. Lampropoulos, D. Vytiniotis, A. Nori, and A. Criminisi. Measuring neural net robustness with constraints. In NIPS, 2016. [3] N. Carlini and D. Wagner. Adversarial examples are not easily detected: Bypassing ten detection methods. In ACM Workshop on Artificial Intelligence and Security, 2017. [4] M. Cisse, P. Bojanowksi, E. Grave, Y. Dauphin, and N. Usunier. Parseval networks: Improving robustness to adversarial examples. In ICML, 2017. [5] N. Dalvi, P. Domingos, Mausam, S. Sanghai, and D. Verma. Adversarial classification. In KDD, 2004. [6] H. Drucker and Y. Le Cun. Double backpropagation increasing generalization performance. In IJCNN, 1992. [7] I. J. Goodfellow, J. Shlens, and C. Szegedy. Explaining and harnessing adversarial examples. In ICLR, 2015. [8] S. Gu and L. Rigazio. Towards deep neural network architectures robust to adversarial examples. In ICLR Workshop, 2015. [9] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In CVPR, pages 770–778, 2016. [10] D. P. Helmbold and P. Long. On the inductive bias of dropout. Journal of Machine Learning Research, 16:3403–3454, 2015. [11] S. Hochreiter and J. Schmidhuber. Simplifying neural nets by discovering flat minima. In NIPS, 1995. [12] R. Huang, B. Xu, D. Schuurmans, and C. Szepesvari. Learning with a strong adversary. In ICLR, 2016. [13] J. Kos, I. Fischer, and D. Song. Adversarial examples for generative models. In ICLR Workshop, 2017. [14] A. Kurakin, I. J. Goodfellow, and S. Bengio. Adversarial examples in the physical world. In ICLR Workshop, 2017. [15] Y. Liu, X. Chen, C. Liu, and D. Song. Delving into transferable adversarial examples and black-box attacks. In ICLR, 2017. [16] D. Lowd and C. Meek. Adversarial learning. In KDD, 2005. [17] S.M. Moosavi-Dezfooli, A. Fawzi, O. Fawzi, and P. Frossard. Universal adversarial perturbations. In CVPR, 2017. [18] N. Papernot, P. McDonald, X. Wu, S. Jha, and A. Swami. Distillation as a defense to adversarial perturbations against deep networks. In IEEE Symposium on Security & Privacy, 2016. [19] P. Frossard S.-M. Moosavi-Dezfooli, A. Fawzi. Deepfool: a simple and accurate method to fool deep neural networks. In CVPR, pages 2574–2582, 2016. [20] B. Schölkopf and A. J. Smola. Learning with Kernels. MIT Press, Cambridge, MA, 2002. [21] U. Shaham, Y. Yamada, and S. Negahban. Understanding adversarial training: Increasing local stability of neural nets through robust optimization. In NIPS, 2016. [22] N. Srivastava, G. Hinton, A. Krizhevsky, I. Sutskever, and R. Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. Journal of Machine Learning Research, 15:1929–1958, 2014. 10 [23] J. Stallkamp, M. Schlipsing, J. Salmen, and C. Igel. Man vs. computer: Benchmarking machine learning algorithms for traffic sign recognition. Neural Networks, 32:323–332, 2012. [24] C. Szegedy, W. Zaremba, I. Sutskever, J. Bruna, D. Erhan, I. Goodfellow, and R. Fergus. Intriguing properties of neural networks. In ICLR, pages 2503–2511, 2014. [25] S. Zagoruyko and N. Komodakis. Wide residual networks. In BMVC, pages 87.1–87.12. [26] S. Zheng, Y. Song, T. Leung, and I. J. Goodfellow. Improving the robustness of deep neural networks via stability training. In CVPR, 2016. 11
2017
584
7,101
Collapsed variational Bayes for Markov jump processes Jiangwei Pan∗† Department of Computer Science Duke University panjiangwei@gmail.com Boqian Zhang∗ Department of Statistics Purdue University zhan1977@purdue.edu Vinayak Rao Department of Statistics Purdue University varao@purdue.edu Abstract Markov jump processes are continuous-time stochastic processes widely used in statistical applications in the natural sciences, and more recently in machine learning. Inference for these models typically proceeds via Markov chain Monte Carlo, and can suffer from various computational challenges. In this work, we propose a novel collapsed variational inference algorithm to address this issue. Our work leverages ideas from discrete-time Markov chains, and exploits a connection between these two through an idea called uniformization. Our algorithm proceeds by marginalizing out the parameters of the Markov jump process, and then approximating the distribution over the trajectory with a factored distribution over segments of a piecewise-constant function. Unlike MCMC schemes that marginalize out transition times of a piecewise-constant process, our scheme optimizes the discretization of time, resulting in significant computational savings. We apply our ideas to synthetic data as well as a dataset of check-in recordings, where we demonstrate superior performance over state-of-the-art MCMC methods. 1 Markov jump processes Markov jump processes (MJPs) (Çinlar, 1975) are stochastic processes that generalize discrete-time discrete-state Markov chains to continuous-time. MJPs find wide application in fields like biology, chemistry and ecology, where they are used to model phenomena like the evolution of population sizes (Opper and Sanguinetti, 2007), gene-regulation Boys et al. (2008), or the state of a computing network Xu and Shelton (2010). A realization of an MJP is a random piecewise-constant function of time, transitioning between a set of states, usually of finite cardinality N (see Figure 1, left). This stochastic process is parametrized by an N ×1 distribution π giving the initial distribution over states, and an N × N rate matrix A governing the dynamics of the process. The off-diagonal element Aij (i ̸= j) gives the rate of transitioning from state i to j, and these elements determine the diagonal element Aii according to the relation Aii = −P i̸=j Aij. Thus, the rows of A sum to 0, and the negative of the diagonal element Aii gives the total rate of leaving state i. Simulating a trajectory from an MJP over an interval [0, T] follows what is called the Gillespie algorithm (Gillespie, 1977): 1. First, at time t = 0, sample an initial state s0 from π. 2. From here onwards, upon entering a new state i, sample the time of the next transition from an exponential with rate |Aii|, and then a new state j ̸= i with probability proportional to Aij. These latter two steps are repeated until the end of the interval, giving a piecewise-constant trajectory consisting of a sequence of holds and jumps. Note that under this formulation, it is impossible for the system to make self-transition, these are effectively absorbed into the rate parameters Aii. ∗Equal contribution †Now at Facebook 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. Figure 1: (left) a realization of an MJP, (right) sampling a path via uniformization. Bayesian inference for MJPs: In practical applications, one only observes the MJP trajectory S(t) indirectly through a noisy observation process. Abstractly, this forms a hidden Markov model problem, now in continuous time. For instance, the states of the MJP could correspond to different states of a gene-network, and rather than observing these directly, one only has noisy gene-expression level measurements. Alternately, each state i can have an associated emission rate λi, and rather than directly observing S(t) or λS(t), one observes a realization of a Poisson process with intensity λS(t). The Poisson events could correspond to mutation events on a strand of DNA, with position indexed by t (Fearnhead and Sherlock, 2006). In this work, we consider a dataset of users logging their activity into the social media website FourSquare, with each ‘check-in’ consisting of a time and a location. We model each user with an MJP, with different states having different distributions over check-in locations. Given a sequence of user check-ins, one is interested in quantities like the latent state of the user, various clusters of check-in locations, and the rate at which users transition from one state to another. We describe this problem and the dataset in more detail in our experiments. In typical situations, the parameters π and A are themselves unknown, and it is necessary to learn these, along with the latent MJP trajectory, from the observed data. A Bayesian approach places a prior over these parameters and uses the observed data to obtain a posterior distribution. A simple and convenient prior over A is a Dirichlet-Gamma prior: this places a Dirichlet prior over π, and models the off-diagonal elements Aij as draws from a Gamma(a, b) distribution. The negative diagonal element |Aii| is then just the sum of the corresponding elements from the same row, and is marginally distributed as a Gamma((N −1)a, b) variable. This prior is convenient in the context of MCMC sampling, allowing a Gibbs sampler that alternately samples (π, A) given a MJP trajectory S(t), and then a new trajectory S(t) given A and the observations. The first step is straightforward: given an MJP trajectory, the Dirichlet-Gamma prior is conjugate, resulting in a simple Dirichlet-Gamma posterior (but see Fearnhead and Sherlock (2006) and the next section for a slight generalization that continues to be conditionally conjugate). Similarly, recent developments in MCMC inference have made the second step fairly standard and efficient, see Rao and Teh (2014); Hajiaghayi et al. (2014). Despite its computational simplicity, this Gibbs sampler comes at a price: it can mix slowly due to coupling between S(t) and A. Alternate approaches like particle MCMC (Andrieu et al., 2010) do not exploit the MJP stucture, resulting in low acceptance rates, and estimates with high variance. These challenges associated with MCMC raise the need for new techniques for Bayesian inference. Here, we bring recent ideas from variational Bayes towards posterior inference for MJPs, proposing a novel and efficient collapsed variational algorithm that marginalizes out the parameter A, thereby addressing the issue of slow mixing. Our algorithm adaptively finds regions of low and high transition activity, rather than integrating these out. In our experiments, we show that these can bring significant computational benefits. Our algorithm is based on an alternate approach to sampling an MJP trajectory called uniformization (Jensen, 1953), which we describe next. 2 Uniformization Given a rate matrix A, choose an Ω> max |Aii|, and sample a set of times from a Poisson process with intensity Ω. These form a random discretization of time, giving a set of candidate transition times (Figure 1, top right). Next sample a piecewise-constant trajectory by running a discrete-time Markov chain over these times, with Markov transition matrix given by B = (I + 1 ΩA), and with initial distribution π. It is easy to verify that B is a valid transition matrix with at least one non-zero diagonal element. This allows the discrete-time system to move back to the same state, something impossible under the original MJP. In fact as Ωincreases the probability of self-transitions increases; however at the same time, a large Ωimplies a large number of Poisson-distributed candidate times. Thus the self-transitions serve to discard excess candidate times, and one can show (Jensen, 1953; Rao and Teh, 2014) that after discarding the self-transitions, the resulting distribution over trajectories is identical to an MJP with rate matrix A for any Ω≥max |Aii| (Figure 1, bottom right). Rao and Teh (2012) describe a generalization, where instead of a single Ω, each state i has its own dominating rate Ωi > |Aii|. The transition matrix B is now defined as Bii = 1 + Aii/Ωi, and 2 Bij = Aij/Ωi, for all i, j ∈(1, . . . , N), i ̸= j. Now, on entering state i, one proposes the the next candidate transition time from a rate-Ωi exponential, and then samples the next state from Bi. As before, self-transitions amount to rejecting the opportunity to leave state i. Large Ωi result in more candidate transition times, but more self-transitions. Rao and Teh (2012) show that these two effects cancel out, and the resulting path, after discarding self-transitions is a sample from an MJP. An alternate prior on the parameters of an MJP: We use uniformization to formulate a novel prior distribution over the parameters of an MJP; this will facilitate our later variational Bayes algorithm. Consider Ai, the ith row of the rate matrix A. This is specified by the diagonal element Aii, and the vector Bi := 1 |Aii|(Ai1, · · · , Ai,i−1, 0, Ai,i+1, · · · , AiN). Recall that the latter is a probability vector, giving the probability of the next state after i. In Fearnhead and Sherlock (2006), the authors place a Gamma prior on |Aii|, and what is effectively, a Dirichlet(α, · · · , 0, · · · , α) prior on Bi (although they treat Bi as an N −1-component vector by ignoring the 0 at position i). We place a Dirichlet(a, · · · , a0, · · · , a) prior on Bi for all i. Such Bi’s allow self-transitions, and form the rows of the transition matrix B from uniformization. Note that under uniformization, the row Ai is uniquely specified by the pair (Ω, Bi) via the relationship Ai = Ω(Bi −1i), where 1i is the indicator for i. We complete our specification by placing a Gamma prior over Ω. Note that since the rows of A sum to 0, and the rows of B sum to 1, both matrices are completely determined by N(N −1) elements. On the other hand, our specification has N(N −1) + 1 random variables, the additional term arising because of the prior over Ω. Given A, Ωplays no role in the generative process defined by Gillespie’s algorithm, although it is an important parameter in MCMC inference algorithms based on uniformization. In our situation, B represents transition probabilities conditioned on there being a transition, and now Ωdoes carry information about A, namely the distribution over event times. Later, we will look at the implied marginal distribution over A. First however, we consider the generalized uniformization scheme of Rao and Teh (2012). Here we have N additional parameters, Ω1 to ΩN. Again, under our model, we place Gamma priors over these Ωi’s, and Dirichlet priors on the rows of the transition matrix B. Note that in Rao and Teh (2014, 2012), Ωis set to 2 maxi |Aii|. From the identity B = I + 1 ΩA, it follows that under any prior over A, with probability 1, the smallest diagonal element of B is 1/2. Our specification avoids such a constrained prior over B, instead introducing an additional random variable Ω. Indeed, our approach is equivalent to a prior over (Ω, A), with Ω= k maxi Aii for some random k. We emphasize that the choice of this prior over k does not effect the generative model, only the induced inference algorithms such as Rao and Teh (2014) or our proposed algorithm. To better understand the implied marginal distribution over A, consider the representation of Rao and Teh (2012), with independent Gamma priors over the Ωi’s. We have the following result: Proposition 1. Place independent Dirichlet priors on the rows of B as above, and independent Gamma((N −1)a+a0, b) priors on the Ωi. Then, the associated matrix A has off-diagonal elements that are marginally Gamma(a, b)-distributed, and negative-diagonal elements that are marginally Gamma((N −1)a, b)-distributed, with the rows of A adding to 0 almost surely. The proposition is a simple consequence of the Gamma-Dirichlet calculus: first observe that the collection of variables ΩiBij is a vector of independent Gamma(a, b) variables. Noting that Aij = ΩiBij, we have that the off-diagonal elements of A are independent Gamma(a, b)s, for i ̸= j. Our proof is complete when we notice that the rows of A sum to 0, and that the sum of independent Gamma variables is still Gamma-distributed, with scale parameter equal to the sum of the scales. It is also easy to see that given A, the Ωi is set by Ωi = |Aii| + ωi, where ωi ∼Gamma(a0, b). In this work, we will simply matters by scaling all rows by a single, shared Ω. This will result in a vector of Aij’s each marginally distributed as a Gamma variable, but now positively correlated due to the common Ω. We will see that this simplification does not affect the accuracy of our method. In fact, as our variational algorithm will maintain just a point estimate for Ω, so that its effect on the correlation between the Aii’s is negligible. 3 Variational inference for MJPs Given noisy observations X of an MJP, we are interested in the posterior p(S(t), A|X). Following the earlier section, we choose an augmented representation, where we replace A with the pair (B, Ω). Similarly, we represent the MJP trajectory S(t) with the pair (T, U), where T is the set of candidate transition times, and U (with |U| = |T|), is the set of states at these times. For our variational 3 algorithm, we will integrate out the Markov transition matrix B, working instead with the marginal distribution p(T, U, Ω). Such a collapsed representation avoids issues that plague MCMC and VB approaches, where coupling between trajectory and transition matrix slows down mixing/convergence. The distribution p(T, U, Ω) is still intractable however, and as is typical in variational algorithms, we will make a factorial approximation p(T, U, Ω) ≈q(T, U)q(Ω). Writing q(T, U) = q(U|T)q(T), we shall also restrict q(T) to a delta-function: q(T) = δ ˆT (T) for some ˆT. In this way, finding the ‘best’ approximating q(T) within this class amounts to finding a ‘best’ discretization of time. This approach of optimizing over a time-discretization is in contrast to MCMC schemes that integrate out the time discretization, and has a two advantages: Simplified computation: Searching over time-discretization can be significantly more efficient than integrating it out. This is especially true when a trajectory involves bursts of transitions interspersed with long periods of inactivity, where schemes like Rao and Teh (2014) can be quite inefficient. Better interpretability: A number of applications use MJPs as tools to segment a time interval into inhomogeneous segments. A full distribution over such an object can be hard to deal with. Following work on variational inference for discrete-time Markov chains (Wang and Blunsom, 2013), we will approximate q(U|T) factorially as q(U|T) = Q|T | t=1 q(ut). Finally, since we fix q(T) to a delta function, we will also restrict q(Ω) to a delta function, only representing uncertainty in the MJP parameters via the marginalized transition matrix B. We emphasize that even though we optimize over time discretizations, we still maintain posterior uncertainty of the MJP state. Thus our variational approximation represents a distribution over piecewise-constant trajectories as a single discretization of time, with a probability vector over states for each time segment (Figure 2). Such an approximation does not involve too much loss of information, while being more convenient than a full distribution over trajectories, or a set of sample paths. While optimizing over trajectories, our algorithm attempts to find segments where the distribution over states is reasonably constant, if not it will refine a segment into two smaller ones. Our overall variational inference algorithm then involves minimizing the Kullback-Liebler distance between this posterior approximation and the true posterior. We do this in a coordinate-wise manner: 1) Updating q(U|T) = Q|T | t=1 q(ut): Given a discretization T, and an Ω, uniformization tells us that inference over U is just inference for a discrete-time hidden Markov model. We adapt the approach of Wang and Blunsom (2013) to update q(U). Assume the observations X follow an exponential family likelihood with parameter Cs for state s: p(xl t|St = s) = exp(φ(xl t)T Cs)h(xl t)/Z(Cs), where Z is the normalization constant, and xl t is the l-th observation observed in between [Tt, Tt+1). Then for a sequence of |T| observations, we have p(X, U|B, C) ∝ |T | Y t=0 But,ut+1 nt Y l=1 exp(φ(xl t)T Cut)h(xl t)/Z(cut) =   S Y i=1 S Y j=1 B#ij ij   S Y i=1 exp(¯φT i Ci)( |T | Y t=0 nt Y l=1 h(xl t) Z(Cut)) Here nt is the number of observations in [Tt, Tt+1) and #ij is the number of transitions from state i to j, and ˜φt = Pnt l=1 φ(xl t) and ¯φi = P t,s.t. ut=i ˜φt. Placing Dirichlet(α) priors on the rows of B, and an appropriate conjugate prior on C, we have p(X, U, B, C) ∝=   S Y i=1 Γ(Sα) S Y j=1 B#ij+α−1 ij Γ(α)   S Y i=1 exp(CT i (¯φi + β))( |T | Y t=0 nt Y l=1 h(xl t) Z(Cut)). Integrating out B and C, and writing #i for the number of visits to state i, we have: p(X, U) ∝=   S Y i=1 Γ(Sα) Γ(#i + α) S Y j=1 Γ(#ij + α) Γ(α)   S Y i=1 ¯Zi(¯φi + β). Then, p(ut = k|·) ∝ (#¬t ut−1,k + α)δt k(#¬t k,ut−1 + δt−1,t+1 k + α)δt k (#¬t k + α)δt k · ¯Zk(¯φ¬t k + ¯φk(Xt) + β) Standard calculations for variational inference give the solution to q(ut) = argmin KL(q(U, T, Ω)∥p(U, T, Ω|X)) as q(ut) = Eq¬t[log p(ut|·)], We then have the update 4 Figure 2: (left) Merging to time segments. (right) splitting a time segment. Horizontal arrows are VB messages. rule: q(ut = k) ∝ Eq¬t[#¬t ut−1,k + α]Eq¬t[#¬t k,ut−1 + δt−1,t+1 k + α] Eq¬t[#¬t ut−1,k + Sα]Eq¬t[#¬t k,ut−1 + δt−1,t+1 k + α] · Eq¬t ¯Zk(¯φ¬t k + ¯φk(Xt) + β) Eq¬t ¯Zk(¯φ¬t k + β) For the special case of multinomial observations, we refer to Wang and Blunsom (2013). 2) Updating q(T): We perform a greedy search over the space of time-discretizations by making local stochastic updates to the current T. Every iteration, we first scan the current T to find a beneficial merge (Figure 2, left): go through the transition times in sequential or random order, merge with the next time interval, compute the variational lower bound under this discretization, and accept if it results in an improvement. This eliminates unnecessary transitions times, reducing fragmentation of the segmentation, and the complexity of the learnt model. Calculating the variational bound for the new time requires merging the probability vectors associated with the two time segments into a new one. One approach is to initialize this vector to some arbitrary quantity, run step 1 till the q’s converge, and use the updated variational bound to accept or reject this proposal. Rather than taking this time-consuming approach, we found it adequate to set the new q to a convex combination to the old q’s, each weighted by the length of their corresponding interval length. In our experiments, we found that this performed comparably at a much lower computational cost. If no merge is found, we then try to find a beneficial split. Again, go through the time segments in some order, now splitting each interval into two. After each split, compare the likelihood before and after the split, and accept (and return) if the improvement exceeds a threshold. Again, such a split requires computing probability vectors for the newly created segments. Now, we assign each segment the same vector as the original segment (plus some noise to break symmetry). We then run one pass of step 1, updating the q’s on either side of the new segment, and then updating the q’s in the two segments. We consider two interval splitting schemes, bisection and random-splitting. Overall, our approach is related to split-merge approaches for variational inference in nonparametric Bayesian models Hughes et al. (2015); these too maintain and optimize point estimates of complex, combinatorial objects, instead maintaining uncertainty over quantities like cluster assignment. In our real-world check-in applications, we consider a situation where there is not just one MJP trajectory, but a number of trajectories corresponding to different users. In this situation, we take a stochastic variational Bayes approach, picking a random user and following the steps outlined earlier. Updating q(Ω): With a Gamma(a1, a2) prior over Ω, the posterior over Ωis also Gamma, and we could set Ωto the MAP. We found this greedy approach unstable sometimes, instead using a partial update, with the new Ωequal to the mean of the old value and the MAP value. Writing s for the total number of transition times in all m trajectories, this gives us Ωnew = (Ωold +(a1 +s)/(a2 +m))/2. 4 Experiments We present qualitative and quantitative experiments using synthetic and real datasets to demonstrate the accuracy and efficiency of our variational Bayes (VB) algorithm. We mostly focus on comparisons with the MCMC algorithms from Rao and Teh (2014) and Rao and Teh (2012). Datasets. We use a dataset of check-in sequences from 8967 FourSquare users in the year 2011, originally collected by Gao et al. (2012) for studying location-based social networks. Each check-in has a time stamp and a location (latitude and longitude), with users having 191 check-in records on average. We only consider check-ins inside a rectangle containing the United States and parts of Mexico and Canada (see Figure 3, left), and randomly select 200 such sequences for our experiments. We partition the space into a 40×40 grid, and define the observation distribution of each MJP state as a categorical distribution over the grid cells. See Pan et al. (2016) for more details on this application. We also use two synthetic datasets in our experiments, with observations in a 5 × 5 grid. For the first dataset, we fix Ω= 20 and construct a transition matrix B for 5 states with B(i, i) = 0.8, 5 Figure 3: (left) check-ins of 500 users. (right-top) heatmap of emission matrices; (right-bottom) true and inferred trajectories: the y-values are perturbed for clarity. time 0 0.2 0.4 0.6 0.8 1 MJP state 0 2 4 6 true trajectory inferred trajectory (VB) Observations time 0 0.2 0.4 0.6 0.8 1 MJP state 0 2 4 6 true trajectory inferred trajectory (VB) Observations time 0 0.2 0.4 0.6 0.8 1 MJP state 0 2 4 6 8 10 12 time 0 0.2 0.4 0.6 0.8 1 MJP state 0 2 4 6 8 10 12 iteration 0 50 100 150 200 log-probability -38 -36 -34 -32 -30 -28 -160 -150 -140 -130 -120 Figure 4: (left,middle) posterior distribution over states of two trajectories in second synthetic dataset; (right) evolution of log p(T | Ω, X) in the VB algorithm for two sample sequences B(i, 5) = 0.19, B(5, 5) = 0, and B(5, i) = 0.25 for i ∈[1, 4]. By construction, these sequences can contain many short time intervals at state 5, and longer time intervals at other states. We set the observation distribution of state i to have 0.2 probability on grid cells in the i-th row and 0 probability otherwise. For the second synthetic dataset, we use 10 states and draw both the transition probabilities of B and the observation probabilities from Dirichlet(1) distribution. Given (Ω, B), we sample 50 sequences, each containing 100 evenly spaced observations. Hyperparameters: For VB on synthetic datasets we place a Gamma(20, 2) prior on Ω, and Dirichlet(2) priors on the transition probabilities and the observation probabilities, while on the check-in data, a Gamma(6, 1), a Dirichlet(0.1) and a Dirichlet(0.01) are placed. For MCMC on synthetic datasets, we place a Gamma(2, 0.2) and a Dirichlet(0.1) for the rate matrix, while on the check-in data, a Gamma(1, 1) and a Dirichlet(0.1) are placed. Visualization: We run VB on the first synthetic dataset for 200 iterations, after which we use the posterior expected counts of observations in each state to infer the output emission probabilities (see Figure 3(top-right)). We then relabel the states under the posterior to best match the true state (our likelihood is invariant to state labels); Figure 3(bottom-right) shows the true and MAP MJP trajectories of two sample sequences in the synthetic dataset. Our VB algorithm recovers the trajectories well, although it is possible to miss some short “bumps”. MCMC also performs well in this case, although as we will show, it is significantly more expensive. The inferred posteriors of trajectories have more uncertainty for the second synthetic dataset. Figure 4 (left and middle) visualizes the posterior distributions of two hidden trajectories with darker regions for higher probabilities. The ability to maintain posterior uncertainty about the trajectory information Figure 5: reconstruction error of MCMC and VB (using random and even splitting) for the (left) first and (right) the second synthetic dataset. The random split scheme is in blue , even split scheme is in red , and VB random split scheme with true omega in orange. MCMC is in black. 1.6 1.7 1.8 1.9 2.0 0 500 1000 1500 2000 running time (seconds) reconstruction error 2.3 2.4 2.5 2.6 2.7 0 500 1000 1500 2000 running time (seconds) reconstruction error 6 0 10 20 30 0 10 20 30 # of transitions # of trajectories 0 5 10 15 0 10 20 30 # of transitions # of trajectories 0 250 500 750 1000 0 10 20 30 # of transitions # of trajectories 0 10 20 30 0 10 20 30 # of transitions # of trajectories 0 5 10 15 20 0 10 20 30 # of transitions # of trajectories 0 200 400 0 10 20 30 # of transitions # of trajectories Figure 6: Synthetic dataset 1(top) and 2(bottom): Histogram of number of transitions using VB with (left) random splitting; (middle) even spliting; (right) using MCMC. Figure 7: histogram of number of transitions using (left) VB and (middle) MCMC; (right) transition times of 10 users using VB # of transitions 0 5 10 15 # of trajectories 0 20 40 60 80 100 120 # of transitions 0 20 40 60 80 # of trajectories 0 10 20 30 40 50 time 0 0.2 0.4 0.6 0.8 1 trajectory id 0 2 4 6 8 10 is important in real world applications, and is something that k-means-style approximate inference algorithms (Huggins et al., 2015) ignore. Inferred trajectories for real-world data. We run the VB algorithm on the check-in data using 50 states for 200 iterations. Modeling such data with MJPs will recover MJP states corresponding to cities or areas of dense population/high check-in activity. We investigate several aspects about the MJP trajectories inferred by the algorithm. Figure 4(right) shows the evolution of log p(T | Ω, X) (up to constant factor) of two sample trajectories. This value is used to determine whether a merge or split is beneficial in our VB algorithm. It has an increasing trend for most sequences in the dataset, but can sometimes decrease as the trajectory discretization evolves. This is expected, since our stochastic algorithm maintains a pseudo-bound. Figure 6 shows similar results for the synthetic datasets. Normally, we expect a user to switch areas of check-in activity only a few times in a year. Indeed, Figure 7 (left) shows the histogram of the number of transition times across all trajectories, and the majority of trajectories have 3 or less transitions. We also plot the actual transition times of 10 random trajectories (right). In contrast, MCMC tends to produce more transitions, many of which are redundant. This is a side effect of uniformization in MCMC sampling, which requires a homogeneously dense Poisson distributed trajectory discretization at every iteration. Running time vs. reconstruction error. We measure the quality of the inferred posterior distributions of trajectories using a reconstruction task on the check-in data. We randomly select 100 test sequences, and randomly hold out half of the observations in each test sequence. The training data consists of the observations that are not held out, i.e., 100 full sequences and 100 half sequences. We run our VB algorithm on this training data for 200 iterations. After each iteration, we reconstruct the held-out observations as follows: given a held-out observation at time t on test sequence τ, using the maximum-likelihood grid cell to represent each state, we compute the expected grid distance between the true and predicted observations using the estimated posterior q(ut). The reconstruction error for τ is computed by averaging the grid distances over all held-out observations in τ. The overall reconstruction error is the average reconstruction error over all test sequences. Similarly, we run the MCMC algorithm on the training data for 1000 iterations, and compute the overall reconstruction error after every 10 iterations, using the last 300 iterations to approximate the posterior distribution of the MJP trajectories. We also run an improved variant of the MCMC algorithm, where we use the generalized uniformization scheme Rao and Teh (2012) with different Ωi for each state. This allows coarser discretizations for some states and typically runs faster per iteration. 7 running time (seconds) 0 200 400 600 800 1000 1200 reconstruction error 0 2 4 6 8 10 VB iteration 50 MCMC iteration 200 improved MCMC iteration 200 running time (seconds) 0 200 400 600 800 1000 1200 reconstruction error 0 2 4 6 8 10 VB random split VB even split 0 1000 2000 3000 4000 0 1 2 3 4 VB random split VB even split MCMC reconstruction error running time (seconds) Figure 8: (left) reconstruction error of VB and MCMC algorithms; (middle) reconstruction error using random and even splitting; (right) reconstruction error for more iterations 0 10 20 30 40 0.5 1.0 1.5 2.0 2.5 jump state 0 10 20 30 40 1 2 3 4 5 jump state 0 10 20 30 40 1 2 3 4 5 jump state Figure 9: Posterior distribution over states of three trajectories in checkin dataset. Figure 8(left) shows the evolution of reconstruction error during the algorithms. The error using VB plateaus much more quickly than the MCMC algorithms. The error gap between MCMC and VB is because of slow mixing of the paths and parameters, as a result of the coupling between latent states and observations as well as modeling approximations. Although the improved MCMC takes less time per iteration, it is not more effective for reconstruction in this experiment. Figure 5 shows similar results for the synthetic datasets. Figure 9 visualizes the posterior distributions of three hidden trajectories with darker shades for higher probabilities. We have chosen to split each time interval randomly in our VB algorithm. Another possibility is to simply split it evenly. Figure 8(middle) compares the reconstruction error of the two splitting schemes. Random splitting has lower error since it produces more successful splits; on the other hand, the running time is smaller with even splitting due to fewer transitions in the inferred trajectories. In Figure 8(right), we resampled the training set and the testing set and ran the experiment for longer. It shows that the error gap between VB and MCMC is closing. Related and future work: Posterior inference for MJPs has primarily been carried out via MCMC Hobolth and Stone (2009); Fearnhead and Sherlock (2006); Bladt and Sørensen (2005); Metzner et al. (2007). The state-of-the-art MCMC approach is the scheme of Rao and Teh (2014, 2012), both based on uniformization. Other MCMC approaches center around particle MCMC Andrieu et al. (2010), e.g. Hajiaghayi et al. (2014). There have also been a few deterministic approaches to posterior inference. The earliest variational approach is from Opper and Sanguinetti (2007), although they consider a different problem from ours, viz. structured MJPs with interacting MJPs (e.g. population sizes of a predator and prey species, or gene networks). They then use a mean-field posterior approximation where these processes are assumed independent. Our algorithm focuses on a single, simple MJP, and an interesting extension is to put the two schemes together for systems of coupled MJPs. Finally a recent paper Huggins et al. (2015) that studies the MJP posterior using a small-variance asymptotic limit. This approach, which generalizes k-means type algorithms to MJPs however provides only point estimates of the MJP trajectory and parameters, and cannot represent posterior uncertainty. Additionally, it still involves coupling between the MJP parameters and trajectory, an issue we bypass with our collapsed algorithm. There are a number of interesting extensions worth studying. First is to consider more structured variational approximations (Wang and Blunsom, 2013), than the factorial approximations we considered here. Also of interest are extensions to more complex MJPs, with infinite state-spaces (Saeedi and Bouchard-Côté, 2011) or structured state-spaces (Opper and Sanguinetti, 2007). It is also interesting to look at different extensions of the schemes we proposed in this paper: different choices of splitmerge proposals, and more complicated posterior approximations of the parameter Ω. Finally, it is instructive to use other real-world datasets to compare our approaches with more traditional MCMC approaches. 8 References Andrieu, C., Doucet, A., and Holenstein, R. (2010). Particle Markov chain Monte Carlo methods. Journal of the Royal Statistical Society Series B, 72(3):269–342. Bladt, M. and Sørensen, M. (2005). Statistical inference for discretely observed Markov jump processes. Journal of the Royal Statistical Society: B, 67(3):395–410. Boys, R. J., Wilkinson, D. J., and Kirkwood, T. B. L. (2008). Bayesian inference for a discretely observed stochastic kinetic model. Statistics and Computing, 18(2):125–135. Çinlar, E. (1975). Introduction to Stochastic Processes. Prentice Hall. Fearnhead, P. and Sherlock, C. (2006). An exact Gibbs sampler for the Markov-modulated Poisson process. Journal Of The Royal Statistical Society Series B, 68(5):767–784. Gao, H., Tang, J., and Liu, H. (2012). gscorr: Modeling geo-social correlations for new check-ins on locationbased social networks. In Proc. of the 21st ACM conf. on Information and knowledge management. ACM. Gillespie, D. T. (1977). Exact stochastic simulation of coupled chemical reactions. J. Phys. Chem., 81(25):2340– 2361. Hajiaghayi, M., Kirkpatrick, B., Wang, L., and Bouchard-Côté, A. (2014). Efficient Continuous-Time Markov Chain Estimation. In International Conference on Machine Learning (ICML), volume 31, pages 638–646. Hobolth, A. and Stone, E. (2009). Simulation from endpoint-conditioned, continuous-time Markov chains on a finite state space, with applications to molecular evolution. Ann Appl Stat, 3(3):1204. Huggins, J. H., Narasimhan, K., Saeedi, A., and Mansinghka, V. K. (2015). Jump-means: Small-variance asymptotics for Markov jump processes. In Proceedings of the 32nd International Conference on Machine Learning, ICML 2015, Lille, France, 6-11 July 2015, pages 693–701. Hughes, M. C., Stephenson, W. T., and Sudderth, E. B. (2015). Scalable adaptation of state complexity for nonparametric hidden Markov models. In NIPS 28, pages 1198–1206. Jensen, A. (1953). Markoff chains as an aid in the study of Markoff processes. Skand. Aktuarietiedskr., 36:87–91. Metzner, P., Horenko, I., and Schütte, C. (2007). Generator estimation of Markov jump processes based on incomplete observations nonequidistant in time. Phys. Rev. E, 76. Opper, M. and Sanguinetti, G. (2007). Variational inference for Markov jump processes. In NIPS 20. Pan, J., Rao, V., Agarwal, P., and Gelfand, A. (2016). Markov-modulated marked poisson processes for check-in data. In International Conference on Machine Learning, pages 2244–2253. Rao, V. and Teh, Y. W. (2014). Fast MCMC sampling for Markov jump processes and extensions. Journal of Machine Learning Research, 13. Rao, V. A. and Teh, Y. W. (2012). MCMC for continuous-time discrete-state systems. In Bartlett, P., Pereira, F., Burges, C., Bottou, L., and Weinberger, K., editors, Advances in Neural Information Processing Systems 25, pages 710–718. Saeedi, A. and Bouchard-Côté, A. (2011). Priors over Recurrent Continuous Time Processes. In NIPS 24. Wang, P. and Blunsom, P. (2013). Collapsed variational Bayesian inference for hidden Markov models. In AISTATS. Xu, J. and Shelton, C. R. (2010). Intrusion detection using continuous time Bayesian networks. Journal of Artificial Intelligence Research, 39:745–774. 9
2017
585
7,102
Is the Bellman residual a bad proxy? Matthieu Geist1, Bilal Piot2,3 and Olivier Pietquin 2,3 1 Université de Lorraine & CNRS, LIEC, UMR 7360, Metz, F-57070 France 2 Univ. Lille, CNRS, Centrale Lille, Inria, UMR 9189 - CRIStAL, F-59000 Lille, France 3 Now with Google DeepMind, London, United Kingdom matthieu.geist@univ-lorraine.fr bilal.piot@univ-lille1.fr, olivier.pietquin@univ-lille1.fr Abstract This paper aims at theoretically and empirically comparing two standard optimization criteria for Reinforcement Learning: i) maximization of the mean value and ii) minimization of the Bellman residual. For that purpose, we place ourselves in the framework of policy search algorithms, that are usually designed to maximize the mean value, and derive a method that minimizes the residual ∥T∗vπ −vπ∥1,ν over policies. A theoretical analysis shows how good this proxy is to policy optimization, and notably that it is better than its value-based counterpart. We also propose experiments on randomly generated generic Markov decision processes, specifically designed for studying the influence of the involved concentrability coefficient. They show that the Bellman residual is generally a bad proxy to policy optimization and that directly maximizing the mean value is much better, despite the current lack of deep theoretical analysis. This might seem obvious, as directly addressing the problem of interest is usually better, but given the prevalence of (projected) Bellman residual minimization in value-based reinforcement learning, we believe that this question is worth to be considered. 1 Introduction Reinforcement Learning (RL) aims at estimating a policy π close to the optimal one, in the sense that its value, vπ (the expected discounted return), is close to maximal, i.e ∥v∗−vπ∥is small (v∗ being the optimal value), for some norm. Controlling the residual ∥T∗vθ −vθ∥(where T∗is the optimal Bellman operator and vθ a value function parameterized by θ) over a class of parameterized value functions is a classical approach in value-based RL, and especially in Approximate Dynamic Programming (ADP). Indeed, controlling this residual allows controlling the distance to the optimal value function: generally speaking, we have that ∥v∗−vπvθ ∥≤ C 1 −γ ∥T∗vθ −vθ∥, (1) with the policy πvθ being greedy with respect to vθ [17, 19]. Some classical ADP approaches actually minimize a projected Bellman residual, ∥Π(T∗vθ −vθ)∥, where Π is the operator projecting onto the hypothesis space to which vθ belongs: Approximate Value Iteration (AVI) [11, 9] tries to minimize this using a fixed-point approach, vθk+1 = ΠT∗vθk, and it has been shown recently [18] that Least-Squares Policy Iteration (LSPI) [13] tries to minimize it using a Newton approach1. Notice that in this case (projected residual), there is no general performance bound2 for controlling ∥v∗−vπvθ ∥. 1(Exact) policy iteration actually minimizes ∥T∗v −v∥using a Newton descent [10]. 2With a single action, this approach reduces to LSTD (Least-Squares Temporal Differences) [5], that can be arbitrarily bad in an off-policy setting [20]. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. Despite the fact that (unprojected) residual approaches come easily with performance guarantees, they are not extensively studied in the (value-based) literature (one can mention [3] that considers a subgradient descent or [19] that frames the norm of the residual as a delta-convex function). A reason for this is that they lead to biased estimates when the Markovian transition kernel is stochastic and unknown [1], which is a rather standard case. Projected Bellman residual approaches are more common, even if not introduced as such originally (notable exceptions are [16, 18]). An alternative approach consists in maximizing directly the mean value Eν[vπ(S)] for a userdefined state distribution ν, this being equivalent to directly minimizing ∥v∗−vπ∥1,ν, see Sec. 2. This suggests defining a class of parameterized policies and optimizing over them, which is the predominant approach in policy search3 [7]. This paper aims at theoretically and experimentally studying these two approaches: maximizing the mean value (related algorithms operate on policies) and minimizing the residual (related algorithms operate on value functions). In that purpose, we place ourselves in the context of policy search algorithms. We adopt this position because we could derive a method that minimizes the residual ∥T∗vπ −vπ∥1,ν over policies and compare to other methods that usually maximize the mean value. On the other hand, adapting ADP methods so that they maximize the mean value is way harder4. This new approach is presented in Sec. 3, and we show theoretically how good this proxy. In Sec. 4, we conduct experiments on randomly generated generic Markov decision processes to compare both approaches empirically. The experiments are specifically designed to study the influence of the involved concentrability coefficient. Despite the good theoretical properties of the Bellman residual approach, it turns out that it only works well if there is a good match between the sampling distribution and the discounted state occupancy distribution induced by the optimal policy, which is a very limiting requirement. In comparison, maximizing the mean value is rather insensitive to this issue and works well whatever the sampling distribution is, contrary to what suggests the sole related theoretical bound. This study thus suggests that maximizing the mean value, although it doesn’t provide easy theoretical analysis, is a better approach to build efficient and robust RL algorithms. 2 Background 2.1 Notations Let ∆X be the set of probability distributions over a finite set X and Y X the set of applications from X to the set Y . By convention, all vectors are column vectors, except distributions (for left multiplication). A Markov Decision Process (MDP) is a tuple {S, A, P, R, γ}, where S is the finite state space5, A is the finite action space, P ∈(∆S)S×A is the Markovian transition kernel (P(s′|s, a) denotes the probability of transiting to s′ when action a is applied in state s), R ∈RS×A is the bounded reward function (R(s, a) represents the local benefit of doing action a in state s) and γ ∈(0, 1) is the discount factor. For v ∈RS, we write ∥v∥1,ν = P s∈S ν(s)|v(s)| the ν-weighted ℓ1-norm of v. Notice that when the function v ∈RS is componentwise positive, that is v ≥0, the ν-weighted ℓ1-norm of v is actually its expectation with respect to ν: if v ≥0, then ∥v∥1,ν = Eν[v(S)] = νv. We will make an intensive use of this basic property in the following. A stochastic policy π ∈(∆A)S associates a distribution over actions to each state. The policy-induced reward and transition kernels, Rπ ∈RS and Pπ ∈(∆S)S, are defined as Rπ(s) = Eπ(.|s)[R(s, A)] and Pπ(s′|s) = Eπ(.|s)[P(s′|s, A)]. The quality of a policy is quantified by the associated value function vπ ∈RS: vπ(s) = E[ X t≥0 γtRπ(St)|S0 = s, St+1 ∼Pπ(.|St)]. 3A remarkable aspect of policy search is that it does not necessarily rely on the Markovian assumption, but this is out of the scope of this paper (residual approaches rely on it, through the Bellman equation). Some recent and effective approaches build on policy search, such as deep deterministic policy gradient [15] or trust region policy optimization [23]. Here, we focus on the canonical mean value maximization approach. 4Approximate linear programming could be considered as such but is often computationally intractable [8, 6]. 5This choice is done for ease and clarity of exposition, the following results could be extended to continuous state and action spaces. 2 The value vπ is the unique fixed point of the Bellman operator Tπ, defined as Tπv = Rπ + γPπv for any v ∈RS. Let define the second Bellman operator T∗as, for any v ∈RS, T∗v = maxπ∈(∆A)S Tπv. A policy π is greedy with respect to v ∈RS, denoted π ∈G(v) if Tπv = T∗v. There exists an optimal policy π∗that satisfies componentwise vπ∗≥vπ, for all π ∈(∆A)S. Moreover, we have that π∗∈G(v∗), with v∗being the unique fixed point of T∗. Finally, for any distribution µ ∈∆S, the γ-weighted occupancy measure induced by the policy π when the initial state is sampled from µ is defined as dµ,π = (1 −γ)µ X t≥0 γtP t π = (1 −γ)µ(I −γPπ)−1 ∈∆S. For two distributions µ and ν, we write ∥µ ν ∥∞the smallest constant C satisfying, for all s ∈S, µ(s) ≤Cν(s). This quantity measures the mismatch between the two distributions. 2.2 Maximizing the mean value Let P be a space of parameterized stochastic policies and let µ be a distribution of interest. The optimal policy has a higher value than any other policy, for any state. If the MDP is too large, satisfying this condition is not reasonable. Therefore, a natural idea consists in searching for a policy such that the associated value function is as close as possible to the optimal one, in expectation, according to a distribution of interest µ. More formally, this means minimizing ∥v∗−v∥1,µ = Eµ[v∗(S) −vπ(S)] ≥0. The optimal value function being unknown, one cannot address this problem directly, but it is equivalent to maximizing Eµ[vπ(S)]. This is the basic principle of many policy search approaches: max π∈P Jν(π) with Jν(π) = Eν[vπ(S)] = νvπ. Notice that we used a sampling distribution ν here, possibly different from the distribution of interest µ. Related algorithms differ notably by the considered criterion (e.g., it can be the mean reward rather than the γ-discounted cumulative reward considered here) and by how the corresponding optimization problem is solved. We refer to [7] for a survey on that topic. Contrary to ADP, the theoretical efficiency of this family of approaches has not been studied a lot. Indeed, as far as we know, there is a sole performance bound for maximizing the mean value. Theorem 1 (Scherrer and Geist [22]). Assume that the policy space P is stable by stochastic mixture, that is ∀π, π′ ∈P, ∀α ∈(0, 1), (1−α)π +απ′ ∈P. Define the ν-greedy-complexity of the policy space P as Eν(P) = max π∈P min π′∈P dν,π(T∗vπ −Tπ′vπ). Then, any policy π that is an ϵ-local optimum of Jν, in the sense that ∀π′ ∈Π, lim α→0 νv(1−α)π+απ′ −νvπ α ≤ϵ, enjoys the following global performance guarantee: µ(v∗−vπ) ≤ 1 (1 −γ)2 dµ,π∗ ν ∞ (Eν(P) + ϵ) . This bound (as all bounds of this kind) has three terms: an horizon term, a concentrability term and an error term. The term 1 1−γ is the average optimization horizon. This concentrability coefficient (∥dµ,π∗/ν∥∞) measures the mismatch between the used distribution ν and the γ-weighted occupancy measure induced by the optimal policy π∗when the initial state is sampled from the distribution of interest µ. This tells that if µ is the distribution of interest, one should optimize Jdµ,π∗, which is not feasible, π∗being unknown (in this case, the coefficient is equal to 1, its lower bound). This coefficient can be arbitrarily large: consider the case where µ concentrates on a single starting state (that is µ(s0) = 1 for a given state s0) and such that the optimal policy leads to other states (that is, dµ,π∗(s0) < 1), the coefficient is then infinite. However, it is also the best concentrability coefficient according to [21], that provides a theoretical and empirical comparison of Approximate Policy Iteration (API) schemes. The error term is Eν(P) + ϵ, where Eν(P) measures the capacity of 3 the policy space to represent the policies being greedy with respect to the value of any policy in P and ϵ tells how the computed policy π is close to a local optimum of Jν. There exist other policy search approches, based on ADP rather than on maximizing the mean value, such as Conservative Policy Iteration (CPI) [12] or Direct Policy Iteration (DPI) [14]. The bound of Thm. 1 matches the bounds of DPI or CPI. Actually, CPI can be shown to be a boosting approach maximizing the mean value. See the discussion in [22] for more details. However, this bound is also based on a very strong assumption (stability by stochastic mixture of the policy space) which is not satisfied by all commonly used policy parameterizations. 3 Minimizing the Bellman residual Direct maximization of the mean value operates on policies, while residual approaches operate on value functions. To study these two optimization criteria together, we introduce a policy search method that minimizes a residual. As noted before, we do so because it is much simpler than introducing a value-based approach that maximizes the mean value. We also show how good this proxy is to policy optimization. Although this algorithm is new, it is not claimed to be a core contribution of the paper. Yet it is clearly a mandatory step to support the comparison between optimization criteria. 3.1 Optimization problem We propose to search a policy in P that minimizes the following Bellman residual: min π∈P Jν(π) with Jν(π) = ∥T∗vπ −vπ∥1,ν. Notice that, as for the maximization of the mean value, we used a sampling distribution ν, possibly different from the distribution of interest µ. From the basic properties of the Bellman operator, for any policy π we have that T∗vπ ≥vπ. Consequently, the ν-weighted ℓ1-norm of the residual is indeed the expected Bellman residual: Jν(π) = Eν[[T∗vπ](S) −vπ(S)] = ν(T∗vπ −vπ). Therefore, there is naturally no bias problem for minimizing a residual here, contrary to other residual approaches [1]. This is an interesting result on its own, as removing the bias in value-based residual approaches is far from being straightforward. This results from the optimization being done over policies and not over values, and thus from vπ being an actual value (the one of the current policy) obeying to the Bellman equation6. Any optimization method can be envisioned to minimize Jν. Here, we simply propose to apply a subgradient descent (despite the lack of convexity). Theorem 2 (Subgradient of Jν). Recall that given the considered notations, the distribution νPG(vπ) is the state distribution obtained by sampling the initial state according to ν, applying the action being greedy with respect to vπ and following the dynamics to the next state. This being said, the subgradient of Jν is given by −∇Jν(π) = 1 1 −γ X s,a dν,π(s) −γdνPG(vπ),π(s)  π(a|s)∇ln π(a|s)qπ(s, a), with qπ(s, a) = R(s, a) + γ P s′∈S P(s′|s, a)vπ(s′) the state-action value function. Proof. The proof relies on basic (sub)gradient calculus, it is given in the appendix. There are two terms in the negative subgradient −∇Jν: the first one corresponds to the gradient of Jν, the second one (up to the multiplication by −γ) is the gradient of JνPG(vπ) and acts as a kind of correction. This subgradient can be estimated using Monte Carlo rollouts, but doing so is harder than for classic policy search (as it requires additionally sampling from νPG(vπ), which requires estimating 6The property T∗v ≥v does not hold if v is not the value function of a given policy, as in value-based approaches. 4 the state-action value function). Also, this gradient involves computing the maximum over actions (as it requires sampling from νPG(vπ), that comes from explicitly considering the Bellman optimality operator), which prevents from extending easily this approach to continuous actions, contrary to classic policy search. Thus, from an algorithmic point of view, this approach has drawbacks. Yet, we do not discuss further how to efficiently estimate this subgradient since we introduced this approach for the sake of comparison to standard policy search methods only. For this reason, we will consider an ideal algorithm in the experimental section where an analytical computation of the subgradient is possible, see Sec. 4. This will place us in an unrealistically good setting, which will help focusing on the main conclusions. Before this, we study how good this proxy is to policy optimization. 3.2 Analysis Theorem 3 (Proxy bound for residual policy search). We have that ∥v∗−vπ∥1,µ ≤ 1 1 −γ dµ,π∗ ν ∞ Jν(π) = 1 1 −γ dµ,π∗ ν ∞ ∥T∗vπ −vπ∥1,ν. Proof. The proof can be easily derived from the analyses of [12], [17] or [22]. We detail it for completeness in the appendix. This bound shows how controlling the residual helps in controlling the error. It has a linear dependency on the horizon and the concentrability coefficient is the best one can expect (according to [21]). It has the same form has the bounds for value-based residual minimization [17, 19] (see also Eq. (1)). It is even better due to the involved concentrability coefficient (the ones for value-based bounds are worst, see [21] for a comparison). Unfortunately, this bound is hardly comparable to the one of Th. 1, due to the error terms. In Th. 3, the error term (the residual) is a global error (how good is the residual as a proxy), whereas in Th. 1 the error term is mainly a local error (how small is the gradient after minimizing the mean value). Notice also that Th. 3 is roughly an intermediate step for proving Th. 1, and that it applies to any policy (suggesting that searching for a policy that minimizes the residual makes sense). One could argue that a similar bound for mean value maximization would be something like: if Jµ(π) ≥α, then ∥v∗−vπ∥1,µ ≤µv∗−α. However, this is an oracle bound, as it depends on the unknown solution v∗. It is thus hardly exploitable. The aim of this paper is to compare these two optimization approaches to RL. At a first sight, maximizing directly the mean value should be better (as a more direct approach). If the bounds of Th. 1 and 3 are hardly comparable, we can still discuss the involved terms. The horizon term is better (linear instead of quadratic) for the residual approach. Yet, an horizon term can possibly be hidden in the residual itself. Both bounds imply the same concentrability coefficient, the best one can expect. This is a very important term in RL bounds, often underestimated: as these coefficients can easily explode, minimizing an error makes sense only if it’s not multiplied by infinity. This coefficient suggests that one should use dµ,π∗as the sampling distribution. This is rarely reasonable, while using instead directly the distribution of interest is more natural. Therefore, the experiments we propose on the next section focus on the influence of this concentrability coefficient. 4 Experiments We consider Garnet problems [2, 4]. They are a class of randomly built MDPs meant to be totally abstract while remaining representative of the problems that might be encountered in practice. Here, a Garnet G(|S|, |A|, b) is specified by the number of states, the number of actions and the branching factor. For each (s, a) couple, b different next states are chosen randomly and the associated probabilities are set by randomly partitioning the unit interval. The reward is null, except for 10% of states where it is set to a random value, uniform in (1, 2). We set γ = 0.99. For the policy space, we consider a Gibbs parameterization: P = {πw : πw(a|s) ∝ew⊤φ(s,a)}. The features are also randomly generated, F(d, l). First, we generate binary state-features ϕ(s) of dimension d, such that l components are set to 1 (the others are thus 0). The positions of the 1’s are 5 selected randomly such that no two states have the same feature. Then, the state-action features, of dimension d|A|, are classically defined as φ(s, a) = (0 . . . 0 ϕ(s) 0 . . . 0)⊤, the position of the zeros depending on the action. Notice that in general this policy space is not stable by stochastic mixture, so the bound for policy search does not formally apply. We compare classic policy search (denoted as PS(ν)), that maximizes the mean value, and residual policy search (denoted as RPS(ν)), that minimizes the mean residual. We optimize the relative objective functions with a normalized gradient ascent (resp. normalized subgradient descent) with a constant learning rate α = 0.1. The gradients are computed analytically (as we have access to the model), so the following results represent an ideal case, when one can do an infinite number of rollouts. Unless said otherwise, the distribution µ ∈∆S of interest is the uniform distribution. 4.1 Using the distribution of interest First, we consider ν = µ. We generate randomly 100 Garnets G(30, 4, 2) and 100 features F(8, 3). For each Garnet-feature couple, we run both algorithms for T = 1000 iterations. For each algorithm, we measure two quantities: the (normalized) error ∥v∗−vπ∥1,µ ∥v∗∥1,µ (notice that as rewards are positive, we have ∥v∗∥1,µ = µv∗) and the Bellman residual ∥T∗vπ −vπ∥1,µ, where π depends on the algorithm and on the iteration. We show the results (mean±standard deviation) on Fig. 1. 0 200 400 600 800 1000 number of iterations 0.0 0.2 0.4 0.6 0.8 ∥v∗−vπ∥1,µ · ∥v∗∥−1 1,µ a. Error for PS(µ). 0 200 400 600 800 1000 number of iterations 0.0 0.2 0.4 0.6 0.8 ∥v∗−vπ∥1,µ · ∥v∗∥−1 1,µ b. Error for RPS(µ). 0 200 400 600 800 1000 number of iterations 0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 ∥T∗vπ −vπ∥1,µ c. Residual for PS(µ). 0 200 400 600 800 1000 number of iterations 0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 ∥T∗vπ −vπ∥1,µ d. Residual for RPS(µ). Figure 1: Results on the Garnet problems, when ν = µ. Fig. 1.a shows that PS(µ) succeeds in decreasing the error. This was to be expected, as it is the criterion it optimizes. Fig. 1.c shows how the residual of the policies computed by PS(µ) evolves. By comparing this to Fig. 1.a, it can be observed that the residual and the error are not necessarily correlated: the error can decrease while the residual increases, and a low error does not necessarily involves a low residual. Fig. 1.d shows that RPS(µ) succeeds in decreasing the residual. Again, this is not surprising, as it is the optimized criterion. Fig. 1.b shows how the error of the policies computed by RPS(µ) evolves. Comparing this to Fig. 1.d, it can be observed that decreasing the residual lowers the error: this is consistent with the bound of Thm. 3. Comparing Figs. 1.a and 1.b, it appears clearly that RPS(µ) is less efficient than PS(µ) for decreasing the error. This might seem obvious, as PS(µ) directly optimizes the criterion of interest. However, when comparing the errors and the residuals for each method, it can be observed that they are not necessarily correlated. Decreasing the residual lowers the error, but one can have a low error with a high residual and vice versa. As explained in Sec. 1, (projected) residual-based methods are prevalent for many reinforcement learning approaches. We consider a policy-based residual rather than a value-based one to ease the comparison, but it is worth studying the reason for such a different behavior. 4.2 Using the ideal distribution The lower the concentrability coefficient ∥dµ,π∗ ν ∥∞is, the better the bounds in Thm. 1 and 3 are. This coefficient is minimized for ν = dµ,π∗. This is an unrealistic case (π∗is unknown), but since we work with known MDPs we can compute this quantity (the model being known), for the sake of a complete empirical analysis. Therefore, PS(dµ,π∗) and RPS(dµ,π∗) are compared in Fig. 2. We highlight the fact that the errors and the residuals shown in this figure are measured respectively to the distribution of interest µ, and not the distribution dµ,π∗used for the optimization. 6 0 200 400 600 800 1000 number of iterations 0.0 0.2 0.4 0.6 0.8 ∥v∗−vπ∥1,µ · ∥v∗∥−1 1,µ a. Error for PS(dµ,π∗). 0 200 400 600 800 1000 number of iterations 0.0 0.2 0.4 0.6 0.8 ∥v∗−vπ∥1,µ · ∥v∗∥−1 1,µ b. Error for RPS(dµ,π∗). 0 200 400 600 800 1000 number of iterations 0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 ∥T∗vπ −vπ∥1,µ c. Residual for PS(dµ,π∗). 0 200 400 600 800 1000 number of iterations 0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 ∥T∗vπ −vπ∥1,µ d. Residual for RPS(dµ,π∗). Figure 2: Results on the Garnet problems, when ν = dµ,π∗. Fig. 2.a shows that PS(dµ,π∗) succeeds in decreasing the error ∥v∗−vπ∥1,µ. However, comparing Fig. 2.a to Fig. 1.a, there is no significant gain in using ν = dµ,π∗instead of ν = µ. This suggests that the dependency of the bound in Thm. 1 on the concentrability coefficient is not tight. Fig. 2.c shows how the corresponding residual evolves. Again, there is no strong correlation between the residual and the error. Fig. 2.d shows how the residual ∥T∗vπ −vπ∥1,µ evolves for RPS(dµ,π∗). It is not decreasing, but it is not what is optimized (the residual ∥T∗vπ −vπ∥1,dµ,π∗, not shown, decreases indeed, in a similar fashion than Fig. 1.d). Fig. 2.b shows how the related error evolves. Compared to Fig. 2.a, there is no significant difference. The behavior of the residual is similar for both methods (Figs. 2.c and 2.d). Overall, this suggests that controlling the residual (RPS) allows controlling the error, but that this requires a wise choice for the distribution ν. On the other hand, controlling directly the error (PS) is much less sensitive to this. In other words, this suggests a stronger dependency of the residual approach to the mismatch between the sampling distribution and the discounted state occupancy measure induced by the optimal policy. 4.3 Varying the sampling distribution This experiment is designed to study the effect of the mismatch between the distributions. We sample 100 Garnets G(30, 4, 2), as well as associated feature sets F(8, 3). The distribution of interest is no longer the uniform distribution, but a measure that concentrates on a single starting state of interest s0: µ(s0) = 1. This is an adverserial case, as it implies that ∥dµ,π∗ µ ∥∞= ∞: the branching factor being equal to 2, the optimal policy π∗cannot concentrate on s0. The sampling distribution is defined as being a mixture between the distribution of interest and the ideal distribution. For α ∈[0, 1], να is defined as να = (1 −α)µ + αdµ,π∗. It is straightforward to show that in this case the concentrability coefficient is indeed 1 α (with the convention that 1 0 = ∞): dµ,π∗ να ∞ = max  dµ,π∗(s0) (1 −α) + αdµ,π∗(s0); 1 α  = 1 α. For each MDP, the learning (for PS(να) and RPS(να)) is repeated, from the same initial policy, by setting α = 1 k, for k ∈[1; 25]. Let πt,x be the policy learnt by algorithm x (PS or RPS) at iteration t, the integrated error (resp. integrated residual) is defined as 1 T T X t=1 ∥v∗−vπt,x∥1,µ ∥v∗∥1,µ (resp. 1 T T X t=1 ∥T∗vπt,x −vπt,x∥1,µ). Notice that here again, the integrated error and residual are defined with respect to µ, the distribution of interest, and not να, the sampling distribution used for optimization. We get an integrated error (resp. residual) for each value of α = 1 k, and represent it as a function of k = ∥dµ,π∗ να ∥∞, the concentrability coefficient. Results are presented in Fig. 3, that shows these functions averaged across the 100 randomly generated MDPs (mean±standard deviation as before, minimum and maximum values are shown in dashed line). Fig. 3.a shows the integrated error for PS(να). It can be observed that the mismatch between measures has no influence on the efficiency of the algorithm. Fig. 3.b shows the same thing for RPS(να). The integrated error increases greatly as the mismatch between the sampling measure and the ideal one 7 0 5 10 15 20 25 concentrability coefficient 0.0 0.2 0.4 0.6 0.8 1.0 integrated error a. Integrated error for PS(να). 0 5 10 15 20 25 concentrability coefficient 0.0 0.2 0.4 0.6 0.8 1.0 integrated error b. Integrated error for RPS(να). 0 5 10 15 20 25 concentrability coefficient 0.0 0.5 1.0 1.5 integrated residual c. Integrated residual for PS(να). 0 5 10 15 20 25 concentrability coefficient 0.0 0.5 1.0 1.5 integrated residual d. Integrated residual for RPS(να). Figure 3: Results for the sampling distribution να. increases (the value to which the error saturates correspond to no improvement over the initial policy). Comparing both figures, it can be observed that RPS performs as well as PS only when the ideal distribution is used (this corresponds to a concentrability coefficient of 1). Fig. 3.c and 3.d show the integrated residual for each algorithm. It can be observed that RPS consistently achieves a lower residual than PS. Overall, this suggests that using the Bellman residual as a proxy is efficient only if the sampling distribution is close to the ideal one, which is difficult to achieve in general (the ideal distribution dµ,π∗being unknown). On the other hand, the more direct approach consisting in maximizing the mean value is much more robust to this issue (and can, as a consequence, be considered directly with the distribution of interest). One could argue that the way we optimize the considered objective function is rather naive (for example, considering a constant learning rate). But this does not change the conclusions of this experimental study, that deals with how the error and the Bellman residual are related and with how the concentrability influences each optimization approach. This point is developed in the appendix. 5 Conclusion The aim of this article was to compare two optimization approaches to reinforcement learning: minimizing a Bellman residual and maximizing the mean value. As said in Sec. 1, Bellman residuals are prevalent in ADP. Notably, value iteration minimizes such a residual using a fixed-point approach and policy iteration minimizes it with a Newton descent. On another hand, maximizing the mean value (Sec. 2) is prevalent in policy search approaches. As Bellman residual minimization methods are naturally value-based and mean value maximization approaches policy-based, we introduced a policy-based residual minimization algorithm in order to study both optimization problems together. For the introduced residual method, we proved a proxy bound, better than value-based residual minimization. The different nature of the bounds of Th. 1 and 3 made the comparison difficult, but both involve the same concentrability coefficient, a term often underestimated in RL bounds. Therefore, we compared both approaches empirically on a set of randomly generated Garnets, the study being designed to quantify the influence of this concentrability coefficient. From these experiments, it appears that the Bellman residual is a good proxy for the error (the distance to the optimal value function) only if, luckily, the concentrability coefficient is small for the considered MDP and the distribution of interest, or one can afford a change of measure for the optimization problem, such that the sampling distribution is close to the ideal one. Regarding this second point, one can change to a measure different from the ideal one, dµ,π∗(for example, using for ν a uniform distribution when the distribution of interest concentrates on a single state would help), but this is difficult in general (one should know roughly where the optimal policy will lead to). Conversely, maximizing the mean value appears to be insensitive to this problem. This suggests that the Bellman residual is generally a bad proxy to policy optimization, and that maximizing the mean value is more likely to result in efficient and robust reinforcement learning algorithms, despite the current lack of deep theoretical analysis. This conclusion might seems obvious, as maximizing the mean value is a more direct approach, but this discussion has never been addressed in the literature, as far as we know, and we think it to be important, given the prevalence of (projected) residual minimization in value-based RL. 8 References [1] András Antos, Csaba Szepesvári, and Rémi Munos. Learning near-optimal policies with Bellman-residual minimization based fitted policy iteration and a single sample path. Machine Learning, 71(1):89–129, 2008. [2] TW Archibald, KIM McKinnon, and LC Thomas. On the generation of Markov decision processes. Journal of the Operational Research Society, pages 354–361, 1995. [3] Leemon C. Baird. Residual Algorithms: Reinforcement Learning with Function Approximation. In International Conference on Machine Learning (ICML), pages 30–37, 1995. [4] Shalabh Bhatnagar, Richard S Sutton, Mohammad Ghavamzadeh, and Mark Lee. Natural actor-critic algorithms. Automatica, 45(11):2471–2482, 2009. [5] Steven J. Bradtke and Andrew G. Barto. Linear Least-Squares algorithms for temporal difference learning. Machine Learning, 22(1-3):33–57, 1996. [6] Daniela Pucci de Farias and Benjamin Van Roy. The linear programming approach to approximate dynamic programming. Operations research, 51(6):850–865, 2003. [7] Marc Peter Deisenroth, Gerhard Neumann, Jan Peters, et al. A Survey on Policy Search for Robotics. Foundations and Trends in Robotics, 2(1-2):1–142, 2013. [8] Vijay V. Desai, Vivek F. Farias, and Ciamac C. Moallemi. Approximate dynamic programming via a smoothed linear program. Oper. Res., 60(3):655–674, May 2012. [9] Damien Ernst, Pierre Geurts, and Louis Wehenkel. Tree-Based Batch Mode Reinforcement Learning. Journal of Machine Learning Research, 6:503–556, 2005. [10] Jerzy A Filar and Boleslaw Tolwinski. On the Algorithm of Pollatschek and Avi-ltzhak. Stochastic Games And Related Topics, pages 59–70, 1991. [11] Geoffrey Gordon. Stable Function Approximation in Dynamic Programming. In International Conference on Machine Learning (ICML), 1995. [12] Sham Kakade and John Langford. Approximately optimal approximate reinforcement learning. In International Conference on Machine Learning (ICML), 2002. [13] Michail G. Lagoudakis and Ronald Parr. Least-squares policy iteration. Journal of Machine Learning Research, 4:1107–1149, 2003. [14] Alessandro Lazaric, Mohammad Ghavamzadeh, and Rémi Munos. Analysis of a classificationbased policy iteration algorithm. In International Conference on Machine Learning (ICML), 2010. [15] Timothy P Lillicrap, Jonathan J Hunt, Alexander Pritzel, Nicolas Heess, Tom Erez, Yuval Tassa, David Silver, and Daan Wierstra. Continuous control with deep reinforcement learning. In International Conference on Learning Representations (ICLR), 2016. [16] Hamid R Maei, Csaba Szepesvári, Shalabh Bhatnagar, and Richard S Sutton. Toward off-policy learning control with function approximation. In International Conference on Machine Learning (ICML), 2010. [17] Rémi Munos. Performance bounds in ℓp-norm for approximate value iteration. SIAM journal on control and optimization, 46(2):541–561, 2007. [18] Julien Pérolat, Bilal Piot, Matthieu Geist, Bruno Scherrer, and Olivier Pietquin. Softened Approximate Policy Iteration for Markov Games. In International Conference on Machine Learning (ICML), 2016. [19] Bilal Piot, Matthieu Geist, and Olivier Pietquin. Difference of Convex Functions Programming for Reinforcement Learning. In Advances in Neural Information Processing Systems (NIPS), 2014. 9 [20] Bruno Scherrer. Should one compute the Temporal Difference fix point or minimize the Bellman Residual? The unified oblique projection view. In International Conference on Machine Learning (ICML), 2010. [21] Bruno Scherrer. Approximate Policy Iteration Schemes: A Comparison. In International Conference on Machine Learning (ICML), pages 1314–1322, 2014. [22] Bruno Scherrer and Matthieu Geist. Local Policy Search in a Convex Space and Conservative Policy Iteration as Boosted Policy Search. In European Conference on Machine Learning and Principles and Practice of Knowledge Discovery in Databases (ECML/PKDD), 2014. [23] John Schulman, Sergey Levine, Pieter Abbeel, Michael Jordan, and Philipp Moritz. Trust region policy optimization. In International Conference on Machine Learning (ICML), 2015. 10
2017
586
7,103
Efficient Use of Limited-Memory Accelerators for Linear Learning on Heterogeneous Systems Celestine D¨unner IBM Research - Zurich Switzerland cdu@zurich.ibm.com Thomas Parnell IBM Research - Zurich Switzerland tpa@zurich.ibm.com Martin Jaggi EPFL Switzerland martin.jaggi@epfl.ch Abstract We propose a generic algorithmic building block to accelerate training of machine learning models on heterogeneous compute systems. Our scheme allows to efficiently employ compute accelerators such as GPUs and FPGAs for the training of large-scale machine learning models, when the training data exceeds their memory capacity. Also, it provides adaptivity to any system’s memory hierarchy in terms of size and processing speed. Our technique is built upon novel theoretical insights regarding primal-dual coordinate methods, and uses duality gap information to dynamically decide which part of the data should be made available for fast processing. To illustrate the power of our approach we demonstrate its performance for training of generalized linear models on a large-scale dataset exceeding the memory size of a modern GPU, showing an order-of-magnitude speedup over existing approaches. 1 Introduction As modern compute systems rapidly increase in size, complexity and computational power, they become less homogeneous. Today’s systems exhibit strong heterogeneity at many levels: in terms of compute parallelism, memory size and access bandwidth, as well as communication bandwidth between compute nodes (e.g., computers, mobile phones, server racks, GPUs, FPGAs, storage nodes etc.). This increasing heterogeneity of compute environments is posing new challenges for the development of efficient distributed algorithms. That is to optimally exploit individual compute resources with very diverse characteristics without suffering from the I/O cost of exchanging data between them. Unit A ⚙ Unit B ⚙⚙⚙⚙ Figure 1: Compute units A, B with different memory size, bandwidth and compute power. In this paper, we focus on the task of training large scale machine learning models in such heterogeneous compute environments and propose a new generic algorithmic building block to efficiently distribute the workload between heterogeneous compute units. Assume two compute units, denoted A and B, which differ in compute power as well as memory capacity as illustrated in Figure 1. The computational power of unit A is smaller and its memory capacity is larger relative to its peer unit B (i.e., we assume that the training data fits into the memory of A, but not into B’s). Hence, on the computationally more powerful unit B, only part of the data can be processed at any given time. The two units, A and B, are able to communicate with each other over some interface, however there is cost associated with doing so. This generic setup covers many essential elements of modern machine learning systems. A typical example is that of accelerator units, such as a GPUs or FPGAs, augmenting traditional computers 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. or servers. While such devices can offer a significant increase in computational power due to their massively parallel architectures, their memory capacity is typically very limited. Another example can be found in hierarchical memory systems where data in the higher level memory can be accessed and hence processed faster than data in the – typically larger – lower level memory. Such memory systems are spanning from fast on-chip caches on one extreme to slower hard drives on the other extreme. The core question we address in this paper is the following: How can we efficiently distribute the workload between heterogeneous units A and B in order to accelerate large scale learning? The generic algorithmic building block we propose systematically splits the overall problem into two workloads, a more data-intensive but less compute-intensive part for unit A and a more computeintensive but less data-intensive part for B. These workloads are then executed in parallel, enabling full utilization of both resources while keeping the amount of necessary communication between the two units minimal. Such a generic algorithmic building block is useful much more widely than just for training on two heterogeneous compute units – it can serve as a component of larger training algorithms or pipelines thereof. In a distributed training setting, our scheme allows each individual node to locally benefit from its own accelerator, therefore speeding up the overall task on a cluster, e.g., as part of [14] or another distributed algorithm. Orthogonal to such a horizontal application, our scheme can also be used as a building block vertically integrated in a system, serving the efficiency of several levels of the memory hierarchy of a given compute node. Related Work. The most popular existing approach to deal with memory limitations is to process data in batches. For example, for the special case of SVMs, [16] splits data samples into blocks which are then loaded and processed sequentially (on B), in the setting of limited RAM and the full data residing on disk. This approach enables contiguous chunks of data to be loaded which is beneficial in terms of I/O overhead; it however treats samples uniformly. The same holds for [15] where blocks to be loaded are selected randomly. Later, in [2, 7] it is proposed to selectively load and keep informative samples in memory in order to reduce disk access, but this approach is specific to support vectors and is unable to theoretically quantify the possible speedup. In this work, we propose a novel, theoretically-justified scheme to efficiently deal with memory limitations in the heterogeneous two-unit setting illustrated in Figure 1. Our scheme can be applied to a broad class of machine learning problems, including generalized linear models, empirical risk minimization problems with a strongly convex regularizer, such as SVM, as well as sparse models, such as Lasso. In contrast to the related line of research [16, 2, 7], our scheme is designed to take full advantage of both compute resources A and B for training, by systematically splitting the workload among A and B in order to adapt to their specific properties and to the available bandwidth between them. At the heart of our approach lies a smart data selection scheme using coordinate-wise duality gaps as selection criteria. Our theory will show that our selection scheme provably improves the convergence rate of training overall, by explicitly quantifying the benefit over uniform sampling. In contrast, existing work [2, 7] only showed that the linear convergence rate on SVMs is preserved asymptotically, but not necessarily improved. A different line of related research is steepest coordinate selection. It is known that steepest coordinate descent can converge much faster than uniform [8] for single coordinate updates on smooth objectives, however it typically does not perform well for general convex problems, such as those with L1 regularization. In our work, we overcome this issue by using the generalized primal-dual gaps [4] which do extend to L1 problems. Related to this notion, [3, 9, 11] have explored the use of similar information as an adaptive measure of importance, in order to adapt the sampling probabilities of coordinate descent. Both this line of research as well as steepest coordinate descent [8] are still limited to single coordinate updates, and cannot be readily extended to arbitrary accuracy updates on a larger subset of coordinates (performed per communication round) as required in our heterogeneous setting. Contributions. The main contributions of this work are summarized as follows: • We analyze the per-iteration-improvement of primal-dual block coordinate descent and how it depends on the selection of the active coordinate block at that iteration. Further, we extend the convergence theory to arbitrary approximate updates on the coordinate subsets. We propose a novel dynamic selection scheme for blocks of coordinates, which relies on coordinate-wise duality gaps, and precisely quantify the speedup of the convergence rate over uniform sampling. 2 • Our theoretical findings result in a scheme for learning in heterogeneous compute environments which is easy to use, theoretically justified and versatile in that it can be adapted to given resource constraints, such as memory, computation and communication. Furthermore our scheme enables parallel execution between, and also within, two heterogeneous compute units. • For the example of joint training in a CPU plus GPU environment – which is very challenging for data-intensive work loads – we demonstrate a more than 10× speed-up over existing methods for limited-memory training. 2 Learning Problem For the scope of this work we focus on the training of convex generalized linear models of the form min α∈Rn O(α) := f(Aα) + g(α) (1) where f is a smooth function and g(α) = P i gi(αi) is separable, α ∈Rn describes the parameter vector and A = [a1, a2, . . . , an] ∈Rd×n the data matrix with column vectors ai ∈Rd. This setting covers many prominent machine learning problems, including generalized linear models as used for regression, classification and feature selection. To avoid confusion, it is important to distinguish the two main application classes: On one hand, we cover empirical risk minimization (ERM) problems with a strongly convex regularizer such as L2-regularized SVM – where α then is the dual variable vector and f is the smooth regularizer conjugate, as in SDCA [13]. On the other hand, we also cover the class of sparse models such as Lasso or ERM with a sparse regularizer – where f is the data-fit term and g takes the role of the non-smooth regularizer, so α are the original primal parameters. Duality Gap. Through the perspective of Fenchel-Rockafellar duality, one can, for any primaldual solution pair (α, w), define the non-negative duality gap for (1) as gap(α; w) := f(Aα) + g(α) + f ∗(w) + g∗(−A⊤w) (2) where the functions f ∗, g∗in (2) are defined as the convex conjugate1 of their corresponding counterparts f, g [1]. Let us consider parameters w that are optimal relative to a given α, i.e., w := w(α) = ∇f(Aα), (3) which implies f(Aα) + f ∗(w) = ⟨Aα, w⟩. In this special case, the duality gap (2) simplifies and becomes separable over the columns ai of A and the corresponding parameter weights αi given w. We will later exploit this property to quantify the suboptimality of individual coordinates. gap(α) = X i∈[n] gapi(αi), where gapi(αi) := w⊤aiαi + gi(αi) + g∗ i (−a⊤ i w). (4) Notation. For the remainder of the paper we use v[P] to denote a vector v with non-zero entries only for the coordinates i ∈P ⊆[n] = {1, . . . , n}. Similarly we write A[P] to denote the matrix A composing only of columns indexed by i ∈P. 3 Approximate Block Coordinate Descent The theory we present in this section serves to derive a theoretical framework for our heterogeneous learning scheme presented in Section 4. Therefore, let us consider the generic block minimization scheme described in Algorithm 1 to train generalized linear models of the form (1). 3.1 Algorithm Description In every round t, of Algorithm 1, a block P of m coordinates of α is selected according to an arbitrary selection rule. Then, an update is computed on this block of coordinates by optimizing arg min ∆α[P]∈Rn O(α + ∆α[P]) (5) where an arbitrary solver can be used to find this update. This update is not necessarily perfectly optimal but of a relative accuracy θ, in the following sense of approximation quality: 1For h : Rd →R the convex conjugate is defined as h∗(v) := supu∈Rd v⊤u −h(u). 3 Algorithm 1 Approximate Block CD 1: Initialize α(0) := 0 2: for t = 0, 1, 2, ... do 3: select a subset P with |P| = m 4: ∆α[P] ←θ-approx. solution to (5) 5: α(t+1) := α(t) + ∆α[P] 6: end for Algorithm 2 DUHL 1: Initialize α(0) := 0, z := 0 2: for t = 0, 1, 2, ... 3: determine P according to (13) 4: refresh memory B to contain A[P]. 5: on B do: 6: ∆α[P] ←θ-approx. solution to (12) 7: in parallel on A do: 8: while B not finished 9: sample j ∈[n] 10: update zj := gapj(α(t) j ) 11: α(t+1) := α(t) + ∆α[P] Definition 1 (θ-Approximate Update). The block update ∆α[P] is θ-approximate iff ∃θ ∈[0, 1] : O(α + ∆α[P]) ≤θO(α + ∆α⋆ [P]) + (1 −θ)O(α) (6) where ∆α⋆ [P] ∈arg min∆α[P]∈Rn O(α + ∆α[P]). 3.2 Convergence Analysis In order to derive a precise convergence rate for Algorithm 1 we build on the convergence analysis of [4, 13]. We extend their analysis of stochastic coordinate descent in two ways: 1) to a block coordinate scheme with approximate coordinate updates, and 2) to explicitly cover the importance of each selected coordinate, as opposed to uniform sampling. We define ρt,P := 1 m P j∈P gapj(α(t) j ) 1 n P j∈[n] gapj(α(t) j ) (7) which quantifies how much the coordinates i ∈P of α(t) contribute to the global duality gap (2). Thus giving a measure of suboptimality for these coordinates. In Algorithm 1 an arbitrary selection scheme (deterministic or randomized) can be applied and our theory will explain how the convergence of Algorithm 1 depends on the selection through the distribution of ρt,P. That is, for strongly convex functions gi, we found that the per-step improvement in suboptimality is proportional to ρt,P of the specific coordinate block P being selected at that iteration t: ϵ(t+1) ≤(1 −ρt,Pθc) ϵ(t) (8) where ϵ(t) := O(α(t)) −O(α⋆) measures the suboptimality of α(t) and c > 0 is a constant which will be specified in the following theorem. A similar dependency on ρt,P can also be shown for non-strongly convex functions gi, leading to our two main convergence results for Algorithm 1: Theorem 1. For Algorithm 1 running on (1) where f is L-smooth and gi is µ-strongly convex with µ > 0 for all i ∈[n], it holds that EP[ϵ(t) | α(0)] ≤  1 −ηP m n µ σL + µ t ϵ(0) (9) where σ := ∥A[P]∥2 op and ηP := mint θ EP[ρt,P | α(t)]. Expectations are over the choice of P. That is, for strongly convex gi, Algorithm 1 has a linear convergence rate. This was shown before in [13, 4] for the special case of exact coordinate updates. In strong contrast to earlier coordinate descent analyses which build on random uniform sampling, our theory explicitly quantifies the impact of the sampling scheme on the convergence through ρt,P. This allows one to benefit from smart selection and provably improve the convergence rate by taking advantage of the inhomogeneity of the duality gaps. The same holds for non-strongly convex functions gi: 4 Theorem 2. For Algorithm 1 running on (1) where f is L-smooth and gi has B-bounded support for all i ∈[n], it holds that EP[ϵ(t) | α(0)] ≤ 1 ηPm 2γn2 2n + t −t0 (10) with γ := 2LB2σ where σ := ∥A[P]∥2 op and t ≥t0 = max  0, n m log 2ηmϵ(0) nγ  where ηP := mint θ EP[ρt,P | α(t)]. Expectations are over the choice of P. Remark 1. Note that for uniform selection, our proven convergence rates for Algorithm 1 recover classical primal-dual coordinate descent [4, 13] as a special case, where in every iteration a single coordinate is selected and each update is solved exactly, i.e., θ = 1. In this case ρt,P measures the contribution of a single coordinate to the duality gap. For uniform sampling, EP[ρt,P | α(t)] = 1 and hence ηP = 1 which recovers [4, Theorems 8 and 9]. 3.3 Gap-Selection Scheme The convergence results of Theorems 1 and 2 suggest that the optimal rule for selecting the block of coordinates P in step 3 of Algorithm 1, leading to the largest improvement in that step, is the following: P := arg max P⊂[n]:|P|=m X j∈P gapj α(t) j  . (11) This scheme maximizes ρt,P at every iterate. Furthermore, the selection scheme (11) guarantees ρt,P ≥1 which quantifies the relative gain over random uniform sampling. In contrast to existing importance sampling schemes [17, 12, 5] which assign static probabilities to individual coordinates, our selection scheme (11) is dynamic and adapts to the current state α(t) of the algorithm, similar to that used in [9, 11] in the standard non-heterogeneous setting. 4 Heterogeneous Training In this section we build on the theoretical insight of the previous section to tackle the main objective of this work: How can we efficiently distribute the workload between two heterogeneous compute units A and B to train a large-scale machine learning problem where A and B fulfill the following two assumptions: Assumption 1 (Difference in Memory Capacity). Compute unit A can fit the whole dataset in its memory and compute unit B can only fit a subset of the data. Hence, B only has access to A[P], a subset P of m columns of A, where m is determined by the memory size of B. Assumption 2 (Difference in Computational Power). Compute unit B can access and process data faster than compute unit A. 4.1 DUHL: A Duality Gap-Based Heterogeneous Learning Scheme We propose a duality gap-based heterogeneous learning scheme, henceforth referring to as DUHL, for short. DUHL is designed for efficient training on heterogeneous compute resources as described above. The core idea of DUHL is to identify a block P of coordinates which are most relevant to improving the model at the current stage of the algorithm, and have the corresponding data columns, A[P], residing locally in the memory of B. Compute unit B can then exploit its superior compute power by using an appropriate solver to locally find a block coordinate update ∆α[P]. At the same time, compute unit A, is assigned the task of updating the block P of important coordinates as the algorithm proceeds and the iterates change. Through this split of workloads DUHL enables full utilization of both compute units A and B. Our scheme, summarized in Algorithm 2, fits the theoretical framework established in the previous section and can be viewed as an instance of Algorithm 1, implementing a time-delayed version of the duality gap-based selection scheme (11). Local Subproblem. In the heterogeneous setting compute unit B only has access to its local data A[P] and some current state v := Aα ∈Rd in order to compute a block update ∆α[P] in Step 4 of Algorithm 1. While for quadratic functions f this information is sufficient to optimize (5), for non-quadratic functions f we consider the following modified local optimization problem instead: arg min ∆α[P]∈Rn f(v) + ⟨∇f(v), A∆α[P]⟩+ L 2 ∥A∆α[P]∥2 2 + X i∈P gi((α + ∆α[P])i). (12) 5 Figure 2: Illustration of one round of DUHL as described in Algorithm 2. It can be shown that the convergence guarantees of Theorems 1 and 2 similarly hold if the block coordinate update in Step 4 of Algorithm 1 is computed on (12) instead of (5) (see Appendix C for more details). A Time-Delayed Gap Measure. Motivated by our theoretical findings, we use the duality gap as a measure of importance for selecting which coordinates unit B is working on. However, a scheme as suggested in (11) is not suitable for our purpose since it requires knowledge of the duality gaps (4) for every coordinate i at a given iterate α(t). For our scheme this would imply a computationally expensive selection step at the beginning of every round which has to be performed in sequence to the update step. To overcome this and enable parallel execution of the two workloads on A and B, we propose to introduce a gap memory. This is an n-dimensional vector z where zi measures the importance of coordinate αi. We have zi := gap(α(t′) i ) where t′ ∈[0, t] and the different elements of z are allowed to be based on different, possibly stale iterates α(t′). Thus, the entries of z can be continuously updated during the course of the algorithm. Then, at the beginning of every round the new block P is chosen based on the current state of z as follows: P := arg max P⊂[n]:|P|=m X j∈P zj. (13) In DUHL, keeping z up to date is the job of compute unit A. Hence, while B is computing a block coordinate update ∆α[P], A updates z by randomly sampling from the entire training data. Then, as soon as B is done, the current state of z is used to determine P for the next round and data columns on B are replaced if necessary. The parallel execution of the two workloads during a single round of DUHL is illustrated in Figure 2. Note, that the freshness of the gap-memory z depends on the relative compute power of A versus B, as well as θ which controls the amount of time spent computing on unit B in every round. In Section 5.2 we will experimentally investigate the effect of staleness of the values zi on the convergence behavior of our scheme. 5 Experimental Results For our experiments we have implemented DUHL for the particular use-case where A corresponds to a CPU with attached RAM and B corresponds to a GPU – A and B communicate over the PCIe bus. We use an 8-core Intel Xeon E5 x86 CPU with 64GB of RAM which is connected over PCIe Gen3 to an NVIDIA Quadro M4000 GPU which has 8GB of RAM. GPUs have recently experience a widespread adoption in machine learning systems and thus this hardware scenario is timely and highly relevant. In such a setting we wish to apply DUHL to efficiently populate the GPU memory and thereby making this part of the data available for fast processing. GPU solver. In order to benefit from the enormous parallelism offered by GPUs and fulfill Assumption 2, we need a local solver capable of exploiting the power of the GPU. Therefore, we have chosen to implement the twice parallel, asynchronous version of stochastic coordinate descent 6 (a) (b) Figure 3: Validation of faster convergence: (a) theoretical quantity ρt,P (orange), versus the practically observed speedup (green) – both relative to the random scheme baseline, (b) convergence of gap selection compared to random selection. (a) (b) Figure 4: Effect of stale entries in the gap memory of DUHL: (a) number of rounds needed to reach suboptimality 10−4 for different update frequencies compared to o-DUHL, (b) the number of data columns that are replaced per round for update frequency of 5%. (TPA-SCD) that has been proposed in [10] for solving ridge regression. In this work we have generalized the implementation further so that it can be applied in a similar manner to solve the Lasso, as well as the SVM problem. For more details about the algorithm and how to generalize it we refer the reader to Appendix D. 5.1 Algorithm Behavior Firstly, we will use the publicly available epsilon dataset from the LIBSVM website (a fully dense dataset with 400’000 samples and 2’000 features) to study the convergence behavior of our scheme. For the experiments in this section we assume that the GPU fits 25% of the training data, i.e., m = n 4 and show results for training the sparse Lasso as well as the ridge regression model. For the Lasso case we have chosen the regularizer to obtain a support size of ∼12% and we apply the coordinatewise Lipschitzing trick [4] to the L1-regularizer in order to allow the computation of the duality gaps. For computational details we refer the reader to Appendix E. Validation of Faster Convergence. From our theory in Section 3.2 we expect that during any given round t of Algorithm 1, the relative gain in convergence rate of one sampling scheme over the other should be quantified by the ratio of the corresponding values of ηt,P := θρt,P (for the respective block of coordinates processed in this round). To verify this, we trained a ridge regression model on the epsilon dataset implementing a) the gap-based selection scheme, (11), and b) random selection, fixing θ for both schemes. Then, in every round t of our experiment, we record the value of ρt,P as defined in (7) and measure the relative gain in convergence rate of the gap-based scheme over the random scheme. In Figure 3(a) we plot the effective speedup of our scheme, and observe that this speedup almost perfectly matches the improvement predicted by our theory as measured by ρt,P - we observe an average deviation of 0.42. Both speedup numbers are calculated relative to plain random selection. In Figure 3(b) we see that the gap-based selection can achieve a remarkable 10× improvement in convergence over the random reference scheme. When running on sparse problems instead of ridge regression, we have observed ρt,P of the oracle scheme converging to n m within only a few iterations if the support of the problem is smaller than m and fits on the GPU. Effect of Gap-Approximation. In this section we study the effect of using stale, inconsistent gapmemory entries for selection on the convergence of DUHL. While the freshness of the memory entries is, in reality, determined by the relative compute power of unit B over unit A and the relative accuracy θ, in this experiment we artificially vary the number of gap updates performed during each round while keeping θ fixed. We train the Lasso model and show, in Figure 4(a), the number of rounds needed to reach a suboptimality of 10−4, as a function of the number of gap entries updated per round. As a reference we show o-DUHL which has access to an oracle providing the true duality gaps. We observe that our scheme is quite robust to stale gap values and can achieve performance within a factor of two over the oracle scheme up to an average delay of 20 iterations. As the update frequency decreases we observed that the convergence slows down in the initial rounds because the algorithm needs more rounds until the active set of the sparse problem is correctly detected. 7 (d) Lasso (e) SVM (f) ridge regression Figure 5: Performance results of DUHL on the 30GB ImageNet dataset. I/O cost (top) and convergence behavior (bottom) for Lasso, SVM and ridge regression. Reduced I/O operations. The efficiency of our scheme regarding I/O operations is demonstrated in Figure 4(b), where we plot the number of data columns that are replaced on B in every round of Algorithm 2. Here the Lasso model is trained assuming a gap update frequency of 5%. We observe that the number of required I/O operations of our scheme is decreasing over the course of the algorithm. When increasing the freshness of the gap memory entries we could see the number of swaps go to zero faster. 5.2 Reference Schemes In the following we compare the performance of our scheme against four reference schemes. We compare against the most widely-used scheme for using a GPU to accelerate training when the data does not fit into the memory of the GPU, that is the sequential block selection scheme presented in [16]. Here the data columns are split into blocks of size m which are sequentially put on the GPU and operated on (the data is efficiently copied to the GPU as a contiguous memory block). We also compare against importance sampling as presented in [17], which we refer to as IS. Since probabilities assigned to individual data columns are static we cannot use them as importance measures in a deterministic selection scheme. Therefore, in order to apply importance sampling in the heterogeneous setting, we non-uniformly sample m data-columns to reside inside the GPU memory in every round of Algorithm 2 and have the CPU determine the new set in parallel. As we will see, data column norms often come with only small variance, in particular for dense datasets. Therefore, importance sampling often fails to give a significant gain over uniformly random selection. Additionally, we compare against a single-threaded CPU implementation of a stochastic coordinate descent solver to demonstrate that with our scheme, the use of a GPU in such a setting indeed yields a significant speedup over a basic CPU implementation despite the high I/O cost of repeatedly copying data on and off the GPU memory. To the best of our knowledge, we are the first to demonstrate this. For all competing schemes, we use TPA-SCD as the solver to efficiently compute the block update ∆α[P] on the GPU. The accuracy θ of the block update computed in every round is controlled by the number of randomized passes of TPA-SCD through the coordinates of the selected block P. For a fair comparison we optimize this parameter for the individual schemes. 5.3 Performance Analysis of DUHL For our large-scale experiments we use an extended version of the Kaggle Dogs vs. Cats ImageNet dataset as presented in [6], where we additionally double the number of samples, while using single precision floating point numbers. The resulting dataset is fully dense and consists of 40’000 samples and 200’704 features, resulting in over 8 billion non-zero elements and a data size of 30GB. Since the memory capacity of our GPU is 8GB, we can put ∼25% of the data on the GPU. We will show 8 results for training a sparse Lasso model, ridge regression as well as linear L2-regularized SVM. For Lasso we choose the regularization to achieve a support size of 12%, whereas for SVM the regularizer was chosen through cross-validation. For all three tasks, we compare the performance of DUHL to sequential block selection, random selection, selection through importance sampling (IS) all on GPU, as well as a single-threaded CPU implementation. In Figure 5(d) and 5(e) we demonstrate that for Lasso as well as SVM, DUHL converges 10× faster than any reference scheme. This gain is achieved by improved convergence – quantified through ρt,P – as well as through reduced I/O cost, as illustrated in the top plots of Figure 5, which show the number of data columns replaced per round. The results in Figure 5(f) show that the application of DUHL is not limited to sparse problems and SVMs. Even for ridge regression DUHL significantly outperforms all the reference scheme considered in this study. 6 Conclusion We have presented a novel theoretical analysis of block coordinate descent, highlighting how the performance depends on the coordinate selection. These results prove that the contribution of individual coordinates to the overall duality gap is indicative of their relevance to the overall model optimization. Using this measure we develop a generic scheme for efficient training in the presence of high performance resources of limited memory capacity. We propose DUHL, an efficient gap memory-based strategy to select which part of the data to make available for fast processing. On a large dataset which exceeds the capacity of a modern GPU, we demonstrate that our scheme outperforms existing sequential approaches by over 10× for Lasso and SVM models. Our results show that the practical gain matches the improved convergence predicted by our theory for gap-based sampling under the given memory and communication constraints, highlighting the versatility of the approach. References [1] Heinz H Bauschke and Patrick L Combettes. Convex Analysis and Monotone Operator Theory in Hilbert Spaces. CMS Books in Mathematics. Springer New York, New York, NY, 2011. [2] Kai-Wei Chang and Dan Roth. Selective block minimization for faster convergence of limited memory large-scale linear models. In Proceedings of the 17th ACM SIGKDD international conference on Knowledge Discovery and Data Mining, pages 699–707, New York, USA, August 2011. ACM. [3] Dominik Csiba, Zheng Qu, and Peter Richt´arik. Stochastic Dual Coordinate Ascent with Adaptive Probabilities. In ICML 2015 - Proceedings of the 32th International Conference on Machine Learning, February 2015. [4] Celestine D¨unner, Simone Forte, Martin Tak´ac, and Martin Jaggi. Primal-Dual Rates and Certificates. In Proceedings of the 33th International Conference on Machine Learning (ICML) - Volume 48, pages 783–792, 2016. [5] Olivier Fercoq and Peter Richt´arik. Optimization in High Dimensions via Accelerated, Parallel, and Proximal Coordinate Descent. SIAM Review, 58(4):739–771, January 2016. [6] Christina Heinze, Brian McWilliams, and Nicolai Meinshausen. DUAL-LOCO: Distributing Statistical Estimation Using Random Projections. In AISTATS - Proceedings of the th International Conference on Artificial Intelligence and Statistics, pages 875–883, 2016. [7] Shin Matsushima, SVN Vishwanathan, and Alex J Smola. Linear support vector machines via dual cached loops. In Proceedings of the 18th ACM SIGKDD international conference on Knowledge discovery and data mining, pages 177–185, New York, USA, 2012. ACM Press. [8] Julie Nutini, Mark Schmidt, Issam Laradji, Michael Friedlander, and Hoyt Koepke. Coordinate Descent Converges Faster with the Gauss-Southwell Rule Than Random Selection. In ICML 2015 - Proceedings of the 32th International Conference on Machine Learning, pages 1632–1641, 2015. [9] Anton Osokin, Jean-Baptiste Alayrac, Isabella Lukasewitz, Puneet K. Dokania, and Simon LacosteJulien. Minding the gaps for block frank-wolfe optimization of structured svms. In Proceedings of the 33rd International Conference on Machine Learning (ICML) - Volume 48, pages 593–602. JMLR.org, 2016. [10] Thomas Parnell, Celestine D¨unner, Kubilay Atasu, Manolis Sifalakis, and Haris Pozidis. Large-Scale Stochastic Learning using GPUs. In Proceedings of the 6th International Workshop on Parallel and Distributed Computing for Large Scale Machine Learning and Big Data Analytics (IPDPSW), IEEE, 2017. 9 [11] Dmytro Perekrestenko, Volkan Cevher, and Martin Jaggi. Faster Coordinate Descent via Adaptive Importance Sampling. In AISTATS - Artificial Intelligence and Statistics, pages 869–877. April 2017. [12] Zheng Qu and Peter Richt´arik. Coordinate descent with arbitrary sampling I: algorithms and complexity. Optimization Methods and Software, 31(5):829–857, April 2016. [13] Shai Shalev-Shwartz and Tong Zhang. Stochastic dual coordinate ascent methods for regularized loss. J. Mach. Learn. Res., 14(1):567–599, February 2013. [14] Virginia Smith, Simone Forte, Chenxin Ma, Martin Tak´aˇc, Michael I Jordan, and Martin Jaggi. CoCoA: A General Framework for Communication-Efficient Distributed Optimization. arXiv, November 2016. [15] Ian En-Hsu Yen, Shan-Wei Lin, and Shou-De Lin. A dual augmented block minimization framework for learning with limited memory. In C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett, editors, Advances in Neural Information Processing Systems 28, pages 3582–3590. Curran Associates, Inc., 2015. [16] Hsiang-Fu Yu, Cho-Jui Hsieh, Kai-Wei Chang, and Chih-Jen Lin. Large Linear Classification When Data Cannot Fit in Memory. ACM Transactions on Knowledge Discovery from Data, 5(4):1–23, February 2012. [17] Peilin Zhao and Tong Zhang. Stochastic Optimization with Importance Sampling for Regularized Loss Minimization. In ICML 2015 - Proceedings of the 32th International Conference on Machine Learning, pages 1–9, 2015. 10
2017
587
7,104
Noise-Tolerant Interactive Learning Using Pairwise Comparisons Yichong Xu*, Hongyang Zhang*, Kyle Miller†, Aarti Singh*, and Artur Dubrawski† *Machine Learning Department, Carnegie Mellon University, USA †Auton Lab, Carnegie Mellon University, USA {yichongx, hongyanz, aarti, awd}@cs.cmu.edu, mille856@andrew.cmu.edu Abstract We study the problem of interactively learning a binary classifier using noisy labeling and pairwise comparison oracles, where the comparison oracle answers which one in the given two instances is more likely to be positive. Learning from such oracles has multiple applications where obtaining direct labels is harder but pairwise comparisons are easier, and the algorithm can leverage both types of oracles. In this paper, we attempt to characterize how the access to an easier comparison oracle helps in improving the label and total query complexity. We show that the comparison oracle reduces the learning problem to that of learning a threshold function. We then present an algorithm that interactively queries the label and comparison oracles and we characterize its query complexity under Tsybakov and adversarial noise conditions for the comparison and labeling oracles. Our lower bounds show that our label and total query complexity is almost optimal. 1 Introduction Given high costs of obtaining labels for big datasets, interactive learning is gaining popularity in both practice and theory of machine learning. On the practical side, there has been an increasing interest in designing algorithms capable of engaging domain experts in two-way queries to facilitate more accurate and more effort-efficient learning systems (c.f. [26, 31]). On the theoretical side, study of interactive learning has led to significant advances such as exponential improvement of query complexity over passive learning under certain conditions (c.f. [5, 6, 7, 15, 19, 27]). While most of these approaches to interactive learning fix the form of an oracle, e.g., the labeling oracle, and explore the best way of querying, recent work allows for multiple diverse forms of oracles [12, 13, 16, 33]. The focus of this paper is on this latter setting, also known as active dual supervision [4]. We investigate how to recover a hypothesis h that is a good approximator of the optimal classifier h∗, in terms of expected 0/1 error PrX[h(X) ̸= h∗(X)], given limited access to labels on individual instances X ∈X and pairwise comparisons about which one of two given instances is more likely to belong to the +1/-1 class. Our study is motivated by important applications where comparisons are easier to obtain than labels, and the algorithm can leverage both types of oracles to improve label and total query complexity. For example, in material design, synthesizing materials for specific conditions requires expensive experimentation, but with an appropriate algorithm we can leverage expertize of material scientists, for whom it may be hard to accurately assess the resulting material properties, but who can quickly compare different input conditions and suggest which ones are more promising. Similarly, in clinical settings, precise assessment of each individual patient’s health status can be difficult, expensive and/or risky (e.g. it may require application of invasive sensors or diagnostic surgeries), but comparing relative statuses of two patients at a time may be relatively easy and accurate. In both these scenarios we may have access to a modest amount of individually labeled data, but the bulk of more accessible training information is available via pairwise comparisons. There are many other examples where 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. Refine Sampling Space Request Batch Learn Classifier Labeling Oracle                       Figure 1: Explanation of work flow of ADGAC-based algorithms. Left: Procedure of typical active learning algorithms. Right: Procedure of our proposed ADGAC-based interactive learning algorithm which has access to both pairwise comparison and labeling oracles. Table 1: Comparison of various methods for learning of generic hypothesis class (Omitting log(1/ε) factors). Label Noise Work # Label # Query Tolcomp Tsybakov (κ) [18] ˜O  1 ε 2κ−2 dθ  ˜O  1 ε 2κ−2 dθ  N/A Tsybakov (κ) Ours ˜O  1 ε 2κ−2 ˜O  1 ε 2κ−2 θ + dθ  O(ε2κ) Adversarial (ν = O(ε)) [19] ˜O(dθ) ˜O(dθ) N/A Adversarial (ν = O(ε)) Ours ˜O(1) ˜O(dθ) O(ε2) humans find it easier to perform pairwise comparisons rather than providing direct labels, including content search [17], image retrieval [31], ranking [21], etc. Despite many successful applications of comparison oracles, many fundamental questions remain. One of them is how to design noise-tolerant, cost-efficient algorithms that can approximate the unknown target hypothesis to arbitrary accuracy while having access to pairwise comparisons. On one hand, while there is theoretical analysis on the pairwise comparisons concerning the task of learning to rank [3, 22], estimating ordinal measurement models [28] and learning combinatorial functions [11], much remains unknown how to extend these results to more generic hypothesis classes. On the other hand, although we have seen great progress on using single or multiple oracles with the same form of interaction [9, 16], classification using both comparison and labeling queries remains an interesting open problem. Independently of our work, Kane et al. [23] concurrently analyzed a similar setting of learning to classify using both label and comparison queries. However, their algorithms work only in the noise-free setting. Our Contributions: Our work addresses the aforementioned issues by presenting a new algorithm, Active Data Generation with Adversarial Comparisons (ADGAC), which learns a classifier with both noisy labeling and noisy comparison oracles. • We analyze ADGAC under Tsybakov (TNC) [30] and adversarial noise conditions for the labeling oracle, along with the adversarial noise condition for the comparison oracle. Our general framework can augment any active learning algorithm by replacing the batch sampling in these algorithms with ADGAC. Figure 1 presents the work flow of our framework. • We propose A2-ADGAC algorithm, which can learn an arbitrary hypothesis class. The label complexity of the algorithm is as small as learning a threshold function under both TNC and adversarial noise condition, independently of the structure of the hypothesis class. The total query complexity improves over previous best-known results under TNC which can only access the labeling oracle. • We derive Margin-ADGAC to learn the class of halfspaces. This algorithm has the same label and total query complexity as A2-ADGAC, but is computationally efficient. • We present lower bounds on total query complexity for any algorithm that can access both labeling and comparison oracles, and a noise tolerance lower bound for our algorithms. These lower bounds demonstrate that our analysis is nearly optimal. An important quantity governing the performance of our algorithms is the adversarial noise level of comparisons: denote by Tolcomp(ε, δ, A) the adversarial noise tolerance level of comparisons that guarantees an algorithm A to achieve an error of ε, with probability at least 1 −δ. Table 1 compares our results with previous work in terms of label complexity, total query complexity, and Tolcomp for generic hypothesis class C with error ε. We see that our results significantly improve over prior 2 Table 2: Comparison of various methods for learning of halfspaces (Omitting log(1/ε) factors). Label Noise Work # Label # Query Tolcomp Efficient? Massart [8] ˜O(d) ˜O(d) N/A No Massart [5] poly(d) poly(d) N/A Yes Massart Ours ˜O(1) ˜O(d) O(ε2) Yes Tsybakov (κ) [19] ˜O( 1 ε 2κ−2 dθ) ˜O( 1 ε 2κ−2 dθ) N/A No Tsybakov (κ) Ours ˜O  1 ε 2κ−2 ˜O  1 ε 2κ−2 + d  O(ε2κ) Yes Adversarial (ν = O(ε)) [34] ˜O(d) ˜O(d) N/A No Adversarial (ν = O(ε)) [6] ˜O(d2) ˜O(d2) N/A Yes Adversarial (ν = O(ε)) Ours ˜O(1) ˜O(d) O(ε2) Yes work with the extra comparison oracle. Denote by d the VC-dimension of C and θ the disagreement coefficient. We also compare the results in Table 2 for learning halfspaces under isotropic log-concave distributions. In both cases, our algorithms enjoy small label complexity that is independent of θ and d. This is helpful when labels are very expensive to obtain. Our algorithms also enjoy better total query complexity under both TNC and adversarial noise condition for efficiently learning halfspaces. 2 Preliminaries Notations: We study the problem of learning a classifier h : X →Y = {−1, 1}, where X and Y are the instance space and label space, respectively. Denote by PXY the distribution over X × Y and let PX be the marginal distribution over X. A hypothesis class C is a set of functions h : X →Y. For any function h, define the error of h under distribution D over X × Y as errD(h) = Pr(X,Y )∼D[h(X) ̸= Y ]. Let err(h) = errPXY(h). Suppose that h∗∈C satisfies err(h∗) = infh∈C err(h). For simplicity, we assume that such an h∗exists in class C. We apply the concept of disagreement coefficient from Hanneke [18] for generic hypothesis class in this paper. In particular, for any set V ⊆C, we denote by DIS(V ) = {x ∈X : ∃h1, h2 ∈ V, h1(x) ̸= h2(x)}. The disagreement coefficient is defined as θ = supr>0 Pr[DIS(B(h∗,r))] r , where B(h∗, r) = {h ∈C : PrX∼PX [h(X) ̸= h∗(X)] ≤r}. Problem Setup: We analyze two kinds of noise conditions for the labeling oracle, namely, adversarial noise condition and Tsybakov noise condition (TNC). We formally define them as follows. Condition 1 (Adversarial Noise Condition for Labeling Oracle). Distribution PXY satisfies adversarial noise condition for labeling oracle with parameter ν ≥0, if ν = Pr(X,Y )∼PXY[Y ̸= h∗(X)]. Condition 2 (Tsybakov Noise Condition for Labeling Oracle). Distribution PXY satisfies Tsybakov noise condition for labeling oracle with parameters κ ≥1, µ ≥0, if ∀h : X →{−1, 1}, err(h) − err(h∗) ≥µ PrX∼PX [h(X) ̸= h∗(X)]κ. Also, h∗is the Bayes optimal classifier, i.e., h∗(x) = sign(η(x) −1/2). 1 where η(x) = Pr[Y = 1|X = x]. The special case of κ = 1 is also called Massart noise condition. In the classic active learning scenario, the algorithm has access to an unlabeled pool drawn from PX . The algorithm can then query the labeling oracle for any instance from the pool. The goal is to find an h ∈C such that the error Pr[h(X) ̸= h∗(X)] ≤ε2. The labeling oracle has access to the input x ∈X, and outputs y ∈{−1, 1} according to PXY. In our setting, however, an extra comparison oracle is available. This oracle takes as input a pair of instances (x, x′) ∈X × X, and returns a variable Z(x, x′) ∈{−1, 1}, where Z(x, x′) = 1 indicates that x is more likely to be positive, while Z(x, x′) = −1 otherwise. In this paper, we discuss an adversarial noise condition for the comparison oracle. We discuss about dealing with TNC on the comparison oracle in appendix. Condition 3 (Adversarial Noise Condition for Comparison Oracle). Distribution PXXZ satisfies adversarial noise with parameter ν′ ≥0, if ν′ = Pr[Z(X, X′)(h∗(X) −h∗(X′)) < 0]. 1The assumption that h∗is Bayes optimal classifier can be relaxed if the approximation error of h∗can be quantified under assumptions on the decision boundary (c.f. [15]). 2Note that we use the disagreement Pr[h(X) ̸= h∗(X)] instead of the excess error err(h) −err(h∗) in some of the other literatures. The two conditions can be linked by assuming a two-sided version of Tsybakov noise (see e.g., Audibert 2004). 3 Table 3: Summary of notations. Notation Meaning Notation Meaning C Hypothesis class κ Tsybakov noise level (labeling) X, X Instance & Instance space ν Adversarial noise level (labeling) Y, Y Label & Label space ν′ Adversarial noise level (comparison) Z, Z Comparison & Comparison space errD(h) Error of h on distribution D d VC dimension of C SClabel Label complexity θ Disagreement coefficient SCcomp Comparison complexity h∗ Optimal classifier in C Tollabel Noise tolerance (labeling) g∗ Optimal scoring function Tolcomp Noise tolerance (comparison) Note that we do not make any assumptions on the randomness of Z: Z(X, X′) can be either random or deterministic as long as the joint distribution PXXZ satisfies Condition 3. For an interactive learning algorithm A, given error ε and failure probability δ, let SCcomp(ε, δ, A) and SClabel(ε, δ, A) be the comparison and label complexity, respectively. The query complexity of A is defined as the sum of label and comparison complexity. Similar to the definition of Tolcomp(ε, δ, A), define Tollabel(ε, δ, A) as the maximum ν such that algorithm A achieves an error of at most ε with probability 1 −δ. As a summary, A learns an h such that Pr[h(X) ̸= h∗(X)] ≤ε with probability 1 −δ using SCcomp(ε, δ, A) comparisons and SClabel(ε, δ, A) labels, if ν ≤Tollabel(ε, δ, A) and ν′ ≤Tolcomp(ε, δ, A). We omit the parameters of SCcomp, SClabel, Tolcomp, Tollabel if they are clear from the context. We use O(·) to express sample complexity and noise tolerance, and ˜O(·) to ignore the log(·) terms. Table 3 summarizes the main notations throughout the paper. 3 Active Data Generation with Adversarial Comparisons (ADGAC) The hardness of learning from pairwise comparisons follows from the error of comparison oracle: the comparisons are noisy, and can be asymmetric and intransitive, meaning that the human might give contradicting preferences like x1 ≼x2 ≼x1 or x1 ≼x2 ≼x3 ≼x1 (here ≼is some preference). This makes traditional methods, e.g., defining a function class {h : h(x) = Z(x, ˆx), ˆx ∈X}, fail, because such a class may have infinite VC dimension. In this section, we propose a novel algorithm, ADGAC, to address this issue. Having access to both comparison and labeling oracles, ADGAC generates a labeled dataset by techniques inspired from group-based binary search. We show that ADGAC can be combined with any active learning procedure to obtain interactive algorithms that can utilize both labeling and comparison oracles. We provide theoretical guarantees for ADGAC. 3.1 Algorithm Description To illustrate ADGAC, we start with a general active learning framework in Algorithm 1. Many active learning algorithms can be adapted to this framework, such as A2 [7] and margin-based active algorithms [6, 5]. Here U represents the querying space/disagreement region of the algorithm (i.e., we reject an instance x if x ̸∈U), and V represents a version space consisting of potential classifiers. For example, A2 algorithm can be adapted to Algorithm 1 straightforwardly by keeping U as the sample space and V as the version space. More concretely, A2 algorithm [7] for adversarial noise can be characterized by U0 = X, V0 = C, fV (U, V, W, i) = {h : |W|errW (h) ≤niεi}, fU(U, V, W, i) = DIS(V ), where εi and ni are parameters of the A2 algorithm, and DIS(V ) = {x ∈X : ∃h1, h2 ∈V, h1(x) ̸= h2(x)} is the disagreement region of V . Margin-based active learning [6] can also be fitted into Algorithm 1 by taking V as the halfspace that (approximately) minimizes the hinge loss, and U as the region within the margin of that halfspace. To efficiently apply the comparison oracle, we propose to replace step 4 in Algorithm 1 with a subroutine, ADGAC, that has access to both comparison and labeling oracles. Subroutine 2 describes ADGAC. It takes as input a dataset S and a sampling number k. ADGAC first runs Quicksort algorithm on S using feedback from comparison oracle, which is of form Z(x, x′). Given that the comparison oracle Z(·, ·) might be asymmetric w.r.t. its two arguments, i.e., Z(x, x′) may not equal to Z(x′, x), for each pair (xi, xj), we randomly choose (xi, xj) or (xj, xi) as the input to Z(·, ·). After Quicksort, the algorithm divides the data into multiple groups of size αm = ε| ˜S|, and does 4 Algorithm 1 Active Learning Framework Input: ε, δ, a sequence of ni, functions fU, fV . 1: Initialize U ←U0 ⊆X, V ←V0 ⊆C. 2: for i = 1, 2, ..., log(1/ε) do 3: Sample unlabeled dataset ˜S of size ni. Let S ←{x : x ∈˜S, x ∈U}. 4: Request the labels of x ∈S and obtain W ←{(xi, yi) : xi ∈S}. 5: Update V ←fV (U, V, W, i), U ←fU(U, V, W, i). Output: Any classifier ˆh ∈V . Subroutine 2 Active Data Generation with Adversarial Comparison (ADGAC) Input: Dataset S with |S| = m, n, ε, k. 1: α ←εn 2m. 2: Define preference relation on S according to Z. Run Quicksort on S to rank elements in an increasing order. Obtain a sorted list S = (x1, x2, ..., xm). 3: Divide S into groups of size αm: Si = {x(i−1)αm+1, ..., xiαm}, i = 1, 2, ..., 1/α . 4: tmin ←1, tmax ←1/α. 5: while tmin < tmax do ▷Do binary search 6: t = (tmin + tmax)/2. 7: Sample k points uniformly without replacement from St and obtain the labels Y = {y1, ..., yk}. 8: If Pk i=1 yi ≥0, then tmax = t; else tmin = t + 1. 9: For t′ > t and xi ∈St′, let ˆyi ←1. 10: For t′ < t and xi ∈St′, let ˆyi ←−1. 11: For xi ∈St, let ˆyi be the majority of labeled points in St. Output: Predicted labels ˆy1, ˆy2, ..., ˆym. group-based binary search by sampling k labels from each group and determining the label of each group by majority vote. For active learning algorithm A, let A-ADGAC be the algorithm of replacing step 4 with ADGAC using parameters (Si, ni, εi, ki), where εi, ki are chosen as additional parameters of the algorithm. We establish results for specific A: A2 and margin-based active learning in Sections 4 and 5, respectively. 3.2 Theoretical Analysis of ADGAC Before we combine ADGAC with active learning algorithms, we provide theoretical results for ADGAC. By the algorithmic procedure, ADGAC reduces the problem of labeling the whole dataset S to binary searching a threshold on the sorted list S. One can show that the conflicting instances cannot be too many within each group Si, and thus binary search performs well in our algorithm. We also use results in [3] to give an error estimate of Quicksort. We have the following result based on the above arguments. Theorem 4. Suppose that Conditions 2 and 3 hold for κ ≥ 1, ν′ ≥ 0, and n = Ω  1 ε 2κ−1 log(1/δ)  . Assume a set ˜S with | ˜S| = n is sampled i.i.d. from PX and S ⊆˜S is an arbitrary subset of ˜S with |S| = m. There exist absolute constants C1, C2, C3 such that if we run Subroutine 2 with ε < C1, ν′ ≤C2ε2κδ, k = k(1)(ε, δ) := C3 log  log(1/ε) δ  1 ε 2κ−2, it will output a labeling of S such that |{xi ∈S : ˆyi ̸= h∗(xi)}| ≤εn, with probability at least 1 −δ. The expected number of comparisons required is O(m log m), and the number of sample-label pairs required is SClabel(ε, δ) = ˜O  log m εn  log(1/δ) 1 ε 2κ−2 . Similarly, we analyze ADGAC under adversarial noise condition w.r.t. labeling oracle with ν = O(ε). Theorem 5. Suppose that Conditions 1 and 3 hold for ν, ν′ ≥0, and n = Ω 1 ε log(1/δ)  . Assume a set ˜S with | ˜S| = n is sampled i.i.d. from PX and S ⊆˜S is an arbitrary subset of ˜S with |S| = m. There exist absolute constants C1, C2, C3, C4 such that if we run Subroutine 2 with ε < C1, ν′ ≤C2ε2δ, k = k(2)(ε, δ) := C3 log  log(1/ε) δ  , and ν ≤C4ε, it will output a labeling 5 of S such that |{xi ∈S : ˆyi ̸= h∗(xi)}| ≤εn, with probability at least 1 −δ. The expected number of comparisons required is O(m log m), and the number of sample-label pairs required is SClabel(ε, δ) = O  log m εn  log  log(1/ε) δ  . Proof Sketch. We call a pair (xi, xj) an inverse pair if Z(xi, xj) = −1, h∗(xi) = 1, h∗(xj) = −1, and an anti-sort pair if h∗(xi) = 1, h∗(xj) = −1, and i < j. We show that the expectation of inverse pairs is n(n −1)ε∗. By the results in [3] the numbers of inverse pairs and anti-sort pairs have the same expectation, and the actual number of anti-sort pairs can be bounded by Markov’s inequality. Then we show that the majority label of each group must be all -1 starting from beginning the list, and changes to all 1 at some point of the list. With a careful choice of k, we may obtain the true majority with k labels under Tsybakov noise; we will thus end up in the turning point of the list. The error is then bounded by the size of groups. See appendix for the complete proof. Theorems 4 and 5 show that ADGAC gives a labeling of dataset with arbitrary small error using label complexity independent of the data size. Moreover, ADGAC is computationally efficient since it only involves binary search. These nice properties of ADGAC lead to improved query complexity when we combine ADGAC with other active learning algorithms. 4 A2-ADGAC: Learning of Generic Hypothesis Class In this section, we combine ADGAC with A2 algorithm to learn a generic hypothesis class. We use the framework in Algorithm 1: let A2-ADGAC be the algorithm that replaces step 4 in Algorithm 1 with ADGAC of parameters (S, ni, εi, ki), where ni, εi, ki are parameters to be specified later. Under TNC, we have the following result. Theorem 6. Suppose that Conditions 2 and 3 hold, and h∗(x) = sign(η(x) −1/2). There exist global constants C1, C2 such that if we run A2-ADGAC with ε < C1, δ, ν′ ≤Tolcomp(ε, δ) = C2ε2κδ, εi = 2−(i+2), ni = Ω  1 εi (d log(1/ε)) +  1 εi 2κ−1 log(1/δ)  , ki = k(1)  εi, δ 4 log(1/ε)  with k(1) specified in Theorem 4, with probability at least 1 −δ, the algorithm will return a classifier ˆh with Pr[ˆh(X) ̸= h∗(X)] ≤ε with comparison and label complexity E[SCcomp] = ˜O θ log2 1 ε  log(dθ)  d log 1 ε  + 1 ε 2κ−2 log(1/δ) !! , SClabel = ˜O log 1 ε  log  min 1 ε, θ  log(1/δ) 1 ε 2κ−2! . The dependence on log2(1/ε) in SCcomp can be reduced to log(1/ε) under Massart noise. We can prove a similar result for adversarial noise condition. Theorem 7. Suppose that Conditions 1 and 3 hold. There exist global constants C1, C2, C3 such that if we run A2-ADGAC with ε < C1, δ, ν′ ≤Tolcomp(ε, δ) = C2ε2δ, ν ≤Tollabel(ε, δ) = C3ε, εi = 2−(i+2), ni = ˜Ω  1 εi d log  1 εi  log(1/δ)  , ki = k(2)  εi, δ 4 log(1/ε)  with k(2) specified in Theorem 5, with probability at least 1−δ, the algorithm will return a classifier ˆh with Pr[ˆh(X) ̸= h∗(X)] ≤ε with comparison and label complexity E[SCcomp] = ˜O  θd log(θd) log  1 εi  log(1/δ)  , SClabel = ˜O  log 1 ε  log  min 1 ε, θ  log(1/δ)  . Proof of Theorems 6 and 7 uses Theorem 4 and Theorem 5 with standard manipulations in VC theory. Theorems 6 and 7 show that having access to even a biased comparison function can reduce the problem of learning a classifier in high-dimensional space to that of learning a threshold classifier in one-dimensional space as the label complexity matches that of actively learning a threshold classifier. Given the fact that comparisons are usually easier to obtain, A2-ADGAC will save a lot in practice due to its small label complexity. More importantly, we improve the total query complexity under TNC by separating the dependence on d and ε; The query complexity is now the sum of the two terms instead of the product of them. This observation shows the power of pairwise comparisons for learning classifiers. Such small label/query complexity is impossible without access to a comparison 6 oracle, since query complexity with only labeling oracle is at least Ω  d 1 ε 2κ−2 and Ω d log 1 ε  under TNC and adversarial noise conditions, respectively [19]. Our results also matches the lower bound of learning with labeling and comparison oracles up to log factors (see Section 6). We note that Theorems 6 and 7 require rather small Tolcomp, equal to O(ε2κδ) and O(ε2δ), respectively. We will show in Section 6.3 that it is necessary to require Tolcomp = O(ε2) in order to obtain a classifier of error ε, if we restrict the use of labeling oracle to only learning a threshold function. Such restriction is able to reach the near-optimal label complexity as specified in Theorems 6 and 7. 5 Margin-ADGAC: Learning of Halfspaces In this section, we combine ADGAC with margin-based active learning [6] to efficiently learn the class of halfspaces. Before proceeding, we first mention a naive idea of utilizing comparisons: we can i.i.d. sample pairs (x1, x2) from PX × PX , and use Z(x1, x2) as the label of x1 −x2, where Z is the feedback from comparison oracle. However, this method cannot work well in our setting without additional assumption on the noise condition for the labeling Z(x1, x2). Before proceeding, we assume that PX is isotropic log-concave on Rd; i.e., PX has mean 0, covariance I and the logarithm of its density function is a concave function [5, 6]. The hypothesis class of halfspaces can be represented as C = {h : h(x) = sign(w · x), w ∈Rd}. Denote by h∗(x) = sign(w∗· x) for some w∗∈Rd. Define lτ(w, x, y) = max (1 −y(w · x)/τ, 0) and lτ(w, W) = 1 |W | P (x,y)∈W lτ(w, x, y) as the hinge loss. The expected hinge loss of w is Lτ(w, D) = Ex∼D[lτ(w, x, sign(w∗· x))]. Margin-based active learning [6] is a concrete example of Algorithm 1 by taking V as (a singleton set of) the hinge loss minimizer, while taking U as the margin region around that minimizer. More concretely, take U0 = X and V0 = {w0} for some w0 such that θ(w0, w∗) ≤π/2. The algorithm works with constants M ≥2, κ < 1/2 and a set of parameters ri, τi, bi, zi that equal to Θ(M −i) (see proof in Appendix for formal definition of these parameters). V always contains a single hypothesis. Suppose V = {wi−1} in iteration i −1. Let vi satisfies lτi(vi, W) ≤minv:∥v−wi−1∥2≤ri,∥v∥2≤1 lτi(v, W) + κ/8, where wi is the content of V in iteration i. We also have fV (V, W, i) = {wi} = n vi ∥vi∥2 o and fU(U, V, W, i) = {x : |wi · x| ≤bi}. Let Margin-ADGAC be the algorithm obtained by replacing the sampling step in margin-based active learning with ADGAC using parameters (S, ni, εi, ki), where ni, εi, ki are additional parameters to be specified later. We have the following results under TNC and adversarial noise conditions, respectively. Theorem 8. Suppose that Conditions 2 and 3 hold, and h∗(x) = sign(w∗· x) = sign(η(x) −1/2). There are settings of M, κ, ri, τi, bi, εi, ki, and constants C1, C2 such that for all ε ≤C1, ν′ ≤ Tolcomp(ε, δ) = C2ε2κδ, if we run Margin-ADGAC with w0 such that θ(w0, w∗) ≤π/2, and ni = ˜O  1 εi d log3(dk/δ) + 1 ε 2κ−1 log(1/δ)  , it finds ˆw such that Pr[sign( ˆw · X) ̸= sign(w∗· X)] ≤ε with probability at least 1 −δ. The comparison and label complexity are E[SCcomp] = ˜O log2(1/ε) d log4(d/δ) + 1 ε 2κ−2 log(1/δ) !! , SClabel = ˜O log(1/ε) log(1/δ) 1 ε 2κ−2! . The dependence on log2(1/ε) in SCcomp can be reduced to log(1/ε) under Massart noise. Theorem 9. Suppose that Conditions 1 and 3 hold. There are settings of M, κ, ri, τi, bi, εi, ki, and constants C1, C2, C3 such that for all ε ≤C1, ν′ ≤Tolcomp(ε, δ) = C2ε2κδ, ν ≤Tolcomp(ε, δ) = C3ε, if we run Margin-ADGAC with ni = ˜O  1 εi d log3(dk/δ)  and w0 such that θ(w0, w∗) ≤π/2, it finds ˆw such that Pr[sign( ˆw · X) ̸= sign(w∗· X)] ≤ε with probability at least 1 −δ. The comparison and label complexity are E[SCcomp] = ˜O log(1/ε) d log4(d/δ)  , SClabel = ˜O (log(1/ε) log(1/δ)) . The proofs of Theorems 8 and 9 are different from the conventional analysis of margin-based active learning in two aspects: a) Since we use labels generated by ADGAC, which is not independently 7 sampled from the distribution PXY, we require new techniques that can deal with adaptive noises; b) We improve the results of [6] over the dependence of d by new Rademacher analysis. Theorems 8 and 9 enjoy better label and query complexity than previous results (see Table 2). We mention that while Yan and Zhang [32] proposed a perceptron-like algorithm with label complexity as small as ˜O(d log(1/ε)) under Massart and adversarial noise conditions, their algorithm works only under uniform distributions over the instance space. In contrast, our algorithm Margin-ADGAC works under broad log-concave distributions. The label and total query complexity of Margin-ADGAC improves over that of traditional active learning. The lower bounds in Section 6 show the optimality of our complexity. 6 Lower Bounds In this section, we give lower bounds on learning using labeling and pairwise comparison. In Section 6.1, we give a lower bound on the optimal label complexity SClabel. In Section 6.2 we use this result to give a lower bound on the total query complexity, i.e., the sum of comparison and label complexity. Our two methods match these lower bounds up to log factors. In Section 6.3, we additionally give an information-theoretic bound on Tolcomp, which matches our algorithms in the case of Massart and adversarial noise. Following from [19, 20], we assume that there is an underlying score function g∗such that h∗(x) = sign(g∗(x)). Note that g∗does not necessarily have relation with η(x); We only require that g∗(x) represents how likely a given x is positive. For instance, in digit recognition, g∗(x) represents how an image looks like a 7 (or 9); In the clinical setting, g∗(x) measures the health condition of a patient. Suppose that the distribution of g∗(X) is continuous, i.e., the probability density function exists and for every t ∈R, Pr[g∗(X) = t] = 0. 6.1 Lower Bound on Label Complexity The definition of g∗naturally induces a comparison oracle Z with Z(x, x′) = sign(g∗(x) −g∗(x′)). We note that this oracle is invariant to shifting w.r.t. g∗, i.e., g∗and g∗+t lead to the same comparison oracle. As a result, we cannot distinguish g∗from g∗+ t without labels. In other words, pairwise comparisons do not help in improving label complexity when we are learning a threshold function on R, where all instances are in the natural order. So the label complexity of any algorithm is lower bounded by that of learning a threshold classifier, and we formally prove this in the following theorem. Theorem 10. For any algorithm A that can access both labeling and comparison oracles, sufficiently small ε, δ, and any score function g that takes at least two values on X, there exists a distribution PXY satisfying Condition 2 such that the optimal function is in the form of h∗(x) = sign(g(x) + t) for some t ∈R and SClabel(ε, δ, A) = Ω  (1/ε)2κ−2 log(1/δ)  . (1) If PXY satisfies Condition 1 with ν = O(ε), SClabel satisfies (1) with κ = 1. The lower bound in Theorem 10 matches the label complexity of A2-ADGAC and Margin-ADGAC up to a log factor. So our algorithm is near-optimal. 6.2 Lower Bound on Total Query Complexity We use Theorem 10 to give lower bounds on the total query complexity of any algorithm which can access both comparison and labeling oracles. Theorem 11. For any algorithm A that can access both labeling and comparison oracles, and sufficiently small ε, δ, there exists a distribution PXY satisfying Condition 2, such that SCcomp(ε, δ, A) + SClabel(ε, δ, A) = Ω  (1/ε)2κ−2 log(1/δ) + d log(1/ε)  . (2) If PXY satisfies Condition 1 with ν = O(ε), SCcomp + SClabel satisfies (2) with κ = 1. The first term of (2) follows from Theorem 10, whereas the second term follows from transforming a lower bound of active learning with access to only the labeling oracle. The lower bounds in Theorem 11 match the performance of A2-ADGAC and Margin-ADGAC up to log factors. 6.3 Adversarial Noise Tolerance of Comparisons Note that label queries are typically expensive in practice. Thus it is natural to ask the following question: what is the minimal requirement on ν′, given that we are only allowed to have access to minimal label complexity as in Theorem 10? We study this problem in this section. More concretely, 8 we study the requirement on ν′ when we learn a threshold function using labels. Suppose that the comparison oracle gives feedback using a scoring function ˆg, i.e., Z(x, x′) = sign(ˆg(x) −ˆg(x′)), and has error ν′. We give a sharp minimax bound on the risk of the optimal classifier in the form of h(x) = sign(ˆg(x) −t) for some t ∈R below. Theorem 12. Suppose that min{Pr[h∗(X) = 1], Pr[h∗(X) = −1]} ≥ √ ν′ and both ˆg(X) and g∗(X) have probability density functions. If ˆg(X) induces an oracle with error ν′, then we have mint maxˆg,g∗Pr[sign(ˆg(X) −t) ̸= h∗(X)] = √ ν′. The proof is technical and omitted. By Theorem 12, we see that the condition of ν′ = ε2 is necessary if labels from g∗are only used to learn a threshold on ˆg. This matches our choice of ν′ under Massart and adversarial noise conditions for labeling oracle (up to a factor of δ). 7 Conclusion We presented a general algorithmic framework, ADGAC, for learning with both comparison and labeling oracles. We proposed two variants of the base algorithm, A2-ADGAC and Margin-ADGAC, to facilitate low query complexity under Tsybakov and adversarial noise conditions. The performance of our algorithms matches lower bounds for learning with both oracles. Our analysis is relevant to a wide range of practical applications where it is easier, less expensive, and/or less risky to obtain pairwise comparisons than labels. There are multiple directions for future works. One improvement over our work is to show complexity bounds for excess risk err(h) −err(h∗) instead of Pr[h ̸= h∗]. Also, our bound on comparison complexity is in expectation due to limits of quicksort; deriving concentration inequalities on the comparison complexity would be helpful. Also, an adaptive algorithm that applies to different levels of noise w.r.t. labels and comparisons would be interesting; i.e., use labels when comparisons are noisy and use comparisons when labels are noisy. Other directions include using comparisons (or more broadly, rankings) for other ML tasks like regression or matrix completion. Acknowledgments This research is supported in part by AFRL grant FA8750-17-2-0212. We thank Chicheng Zhang for insightful ideas on improving results in [6] using Rademacher complexity. References [1] S. Agarwal and P. Niyogi. Stability and generalization of bipartite ranking algorithms. In Annual Conference on Learning Theory, pages 32–47, 2005. [2] S. Agarwal and P. Niyogi. Generalization bounds for ranking algorithms via algorithmic stability. Journal of Machine Learning Research, 10:441–474, 2009. [3] N. Ailon and M. Mohri. An efficient reduction of ranking to classification. arXiv preprint arXiv:0710.2889, 2007. [4] J. Attenberg, P. Melville, and F. Provost. A unified approach to active dual supervision for labeling features and examples. In Machine Learning and Knowledge Discovery in Databases, pages 40–55. Springer, 2010. [5] P. Awasthi, M.-F. Balcan, N. Haghtalab, and H. Zhang. Learning and 1-bit compressed sensing under asymmetric noise. In Annual Conference on Learning Theory, pages 152–192, 2016. [6] P. Awasthi, M.-F. Balcan, and P. M. Long. The power of localization for efficiently learning linear separators with noise. Journal of the ACM, 63(6):50, 2017. [7] M.-F. Balcan, A. Beygelzimer, and J. Langford. Agnostic active learning. In Proceedings of the 23rd international conference on Machine learning, pages 65–72. ACM, 2006. [8] M.-F. Balcan, A. Broder, and T. Zhang. Margin based active learning. In Annual Conference On Learning Theory, pages 35–50, 2007. [9] M.-F. Balcan and S. Hanneke. Robust interactive learning. In COLT, pages 20–1, 2012. [10] M.-F. Balcan and P. M. Long. Active and passive learning of linear separators under log-concave distributions. In Annual Conference on Learning Theory, pages 288–316, 2013. [11] M.-F. Balcan, E. Vitercik, and C. White. Learning combinatorial functions from pairwise comparisons. arXiv preprint arXiv:1605.09227, 2016. [12] M.-F. Balcan and H. Zhang. Noise-tolerant life-long matrix completion via adaptive sampling. In Advances in Neural Information Processing Systems, pages 2955–2963, 2016. [13] A. Beygelzimer, D. J. Hsu, J. Langford, and C. Zhang. Search improves label for active learning. In Advances in Neural Information Processing Systems, pages 3342–3350, 2016. [14] S. Boucheron, O. Bousquet, and G. Lugosi. Theory of classification: A survey of some recent advances. ESAIM: probability and statistics, 9:323–375, 2005. [15] R. M. Castro and R. D. Nowak. Minimax bounds for active learning. IEEE Transactions on Information Theory, 54(5):2339–2353, 2008. 9 [16] O. Dekel, C. Gentile, and K. Sridharan. Selective sampling and active learning from single and multiple teachers. Journal of Machine Learning Research, 13:2655–2697, 2012. [17] J. Fürnkranz and E. Hüllermeier. Preference learning and ranking by pairwise comparison. In Preference learning, pages 65–82. Springer, 2010. [18] S. Hanneke. Adaptive rates of convergence in active learning. In COLT. Citeseer, 2009. [19] S. Hanneke. Theory of active learning, 2014. [20] S. Hanneke and L. Yang. Surrogate losses in passive and active learning. arXiv preprint arXiv:1207.3772, 2012. [21] R. Heckel, N. B. Shah, K. Ramchandran, and M. J. Wainwright. Active ranking from pairwise comparisons and the futility of parametric assumptions. arXiv preprint arXiv:1606.08842, 2016. [22] K. G. Jamieson and R. Nowak. Active ranking using pairwise comparisons. In Advances in Neural Information Processing Systems, pages 2240–2248, 2011. [23] D. M. Kane, S. Lovett, S. Moran, and J. Zhang. Active classification with comparison queries. arXiv preprint arXiv:1704.03564, 2017. [24] A. Krishnamurthy. Interactive Algorithms for Unsupervised Machine Learning. PhD thesis, Carnegie Mellon University, 2015. [25] L. Lovász and S. Vempala. The geometry of logconcave functions and sampling algorithms. Random Structures & Algorithms, 30(3):307–358, 2007. [26] S. Maji and G. Shakhnarovich. Part and attribute discovery from relative annotations. International Journal of Computer Vision, 108(1-2):82–96, 2014. [27] S. Sabato and T. Hess. Interactive algorithms: from pool to stream. In Annual Conference On Learning Theory, pages 1419–1439, 2016. [28] N. B. Shah, S. Balakrishnan, J. Bradley, A. Parekh, K. Ramchandran, and M. Wainwright. When is it better to compare than to score? arXiv preprint arXiv:1406.6618, 2014. [29] N. Stewart, G. D. Brown, and N. Chater. Absolute identification by relative judgment. Psychological review, 112(4):881, 2005. [30] A. B. Tsybakov. Optimal aggregation of classifiers in statistical learning. Annals of Statistics, pages 135–166, 2004. [31] C. Wah, G. Van Horn, S. Branson, S. Maji, P. Perona, and S. Belongie. Similarity comparisons for interactive fine-grained categorization. In IEEE Conference on Computer Vision and Pattern Recognition, pages 859–866, 2014. [32] S. Yan and C. Zhang. Revisiting perceptron: Efficient and label-optimal active learning of halfspaces. arXiv preprint arXiv:1702.05581, 2017. [33] L. Yang and J. G. Carbonell. Cost complexity of proactive learning via a reduction to realizable active learning. Technical report, CMU-ML-09-113, 2009. [34] C. Zhang and K. Chaudhuri. Beyond disagreement-based agnostic active learning. In Advances in Neural Information Processing Systems, pages 442–450, 2014. 10
2017
588
7,105
Near-Optimal Edge Evaluation in Explicit Generalized Binomial Graphs Sanjiban Choudhury The Robotics Institute Carnegie Mellon University sanjiban@cmu.edu Shervin Javdani The Robotics Institute Carnegie Mellon University sjavdani@cmu.edu Siddhartha Srinivasa The Robotics Institute Carnegie Mellon University siddh@cs.cmu.edu Sebastian Scherer The Robotics Institute Carnegie Mellon University basti@cs.cmu.edu Abstract Robotic motion-planning problems, such as a UAV flying fast in a partially-known environment or a robot arm moving around cluttered objects, require finding collision-free paths quickly. Typically, this is solved by constructing a graph, where vertices represent robot configurations and edges represent potentially valid movements of the robot between these configurations. The main computational bottlenecks are expensive edge evaluations to check for collisions. State of the art planning methods do not reason about the optimal sequence of edges to evaluate in order to find a collision free path quickly. In this paper, we do so by drawing a novel equivalence between motion planning and the Bayesian active learning paradigm of decision region determination (DRD). Unfortunately, a straight application of existing methods requires computation exponential in the number of edges in a graph. We present BISECT, an efficient and near-optimal algorithm to solve the DRD problem when edges are independent Bernoulli random variables. By leveraging this property, we are able to significantly reduce computational complexity from exponential to linear in the number of edges. We show that BISECT outperforms several state of the art algorithms on a spectrum of planning problems for mobile robots, manipulators, and real flight data collected from a full scale helicopter. Open-source code and details can be found here: https://github.com/sanjibac/matlab_learning_collision_checking 1 Introduction Motion planning, the task of computing collision-free motions for a robotic system from a start to a goal configuration, has a rich and varied history [23]. Up until now, the bulk of the prominent research has focused on the development of tractable planning algorithms with provable worst-case performance guarantees such as computational complexity [3], probabilistic completeness [24] or asymptotic optimality [20]. In contrast, analysis of the expected performance of these algorithms on the real world planning problems a robot encounters has received considerably less attention, primarily due to the lack of standardized datasets or robotic platforms. However, recent advances in affordable sensors and actuators have enabled mass deployment of robots that navigate, interact and collect real data. This motivates us to examine the following question: “How can we design planning algorithms that, subject to on-board computation constraints, maximize their expected performance on the actual distribution of problems that a robot encounters?” This paper addresses a class of robotic motion planning problems where path evaluation is expensive. For example, in robot arm planning [12], evaluation requires expensive geometric intersection 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. (a) (b) || && ⇥ enabled ⇥ && X tcas eq ⇥ intent not known X ! tcas eq X 1 || && ⇥ enabled ⇥ && X tcas eq ⇥ intent not known X ! tcas eq X 1 || && ⇥ enabled ⇥ && X tcas eq ⇥ intent not known X ! tcas eq X 1 || && ⇥ enabled ⇥ && X tcas eq ⇥ intent not known X ! tcas eq X 1 Figure 1: The feasible path identification problem (a) The explicit graph contains dynamically feasible maneuvers [27] for a UAV flying fast, with a set candidate paths. The map shows the distribution of edge validity for the graph. (b) Given a distribution over edges, our algorithm checks an edge, marks it as invalid (red) or valid (green), and updates its belief. We continue until a feasible path is identified as free. We aim to minimize the number of expensive edge evaluations. computations. In UAV path planning [9], evaluation must be done online with limited computational resources (Fig. 1). State of the art planning algorithms [11] first compute a set of unevaluated paths quickly, and then evaluate them sequentially to find a valid path. Oftentimes, candidate paths share common edges. Hence, evaluation of a small number of edges can provide information about the validity of many candidate paths simultaneously. Methods that check paths sequentially, however, do not reason about these common edges. This leads us naturally to the feasible path identification problem - given a library of candidate paths, identify a valid path while minimizing the cost of edge evaluations. We assume access to a prior distribution over edge validity, which encodes how obstacles are distributed in the environment (Fig. 1(a)). As we evaluate edges and observe outcomes, the uncertainty of a candidate path collapses. Our first key insight is that this problem is equivalent to decision region determination (DRD) [19, 5]) - given a set of tests (edges), hypotheses (validity of edges), and regions (paths), the objective is to drive uncertainty into a single decision region. This linking enables us to leverage existing methods in Bayesian active learning for robotic motion planning. Chen et al. [5] provide a method to solve this problem by maximizing an objective function that satisfies adaptive submodularity [15] - a natural diminishing returns property that endows greedy policies with near-optimality guarantees. Unfortunately, naively applying this algorithm requires O 2E computation to select an edge to evaluate, where E is the number of edges in all paths. We define the Bern-DRD problem, which leverages additional structure in robotic motion planning by assuming edges are independent Bernoulli random variables 1, and regions correspond to sets of edges evaluating to true. We propose Bernoulli Subregion Edge Cutting (BISECT), which provides a greedy policy to select candidate edges in O (E). We prove our surrogate objective also satisfies adaptive submodularity [15], and provides the same bounds as Chen et al. [5] while being more efficient to compute. We make the following contributions: 1. We show a novel equivalence between feasible path identification and the DRD problem, linking motion planning to Bayesian active learning. 2. We develop BISECT, a near-optimal algorithm for the special case of Bernoulli tests, which selects tests in O (E) instead of O 2E . 3. We demonstrate the efficacy of our algorithm on a spectrum of planning problems for mobile robots, manipulators, and real flight data collected from a full scale helicopter. 1Generally, edges in this graph are correlated, as edges in collision are likely to have neighbours in collision. Unfortunately, even measuring this correlation is challenging, especially in the high-dimensional non-linear configuration space of robot arms. Assuming independent edges is a common simplification [23, 25, 7, 2, 11] 2 2 Problem Formulation 2.1 Planning as Feasible Path Identification on Explicit Graphs Let G = (V, E) be an explicit graph that consists of a set of vertices V and edges E. Given a pair of start and goal vertices, (vs, vg) ∈V , a search algorithm computes a path ξ ⊆E - a connected sequence of valid edges. To ascertain the validity of an edge, it invokes an evaluation function Eval : E →{0, 1}. We address applications where edge evaluation is expensive, i.e., the computational cost c(e) of computing Eval(e) is significantly higher than regular search operations2. We define a world as an outcome vector o ∈{0, 1}|E| which assigns to each edge a boolean validity when evaluated, i.e. Eval(e) = o(e). We assume that the outcome vector is sampled from an independent Bernoulli distribution P(o), giving rise to a Generalized Binomial Graph (GBG) [13]. We make a second simplification to the problem - from that of search to that of identification. Instead of searching G online for a path, we frame the problem as identifying a valid path from a library of ‘good’ candidate paths Ξ = (ξ1, ξ2, . . . , ξm). The candidate set of paths Ξ is constructed offline, while being cognizant of P(o), and can be verified to ensure that all paths have acceptable solution quality when valid. 3 Hence we care about completeness with respect to Ξ instead of G. We wish to design an adaptive edge selector Select(o) which is a decision tree that operates on a world o, selects an edge for evaluation and branches on its outcome. The total cost of edge evaluation is c(Select(o)). Our objective is to minimize the cost required to find a valid path: min Eo∈P (o) [c(Select(o))] s.t ∀o, ∃ξ : Y e∈ξ o(e) = 1 , ξ ⊆Select(o) (1) 2.2 Decision Region Determination with Independent Bernoulli Tests We now define an equivalent problem - decision region determination with independent Bernoulli tests (Bern-DRD). Define a set of tests T = {1, . . . , n}, where the outcome of each test is a Bernoulli random variable Xt ∈{0, 1}, P(Xt = xt) = θxt t (1 −θt)1−xt. We define a set of hypotheses h ∈H, where each is an outcome vector h ∈{0, 1}T mapping all tests t ∈T to outcomes h(t). We define a set of regions {Ri}m i=1, each of which is a subset of tests R ⊆T . A region is determined to be valid if all tests in that region evaluate to true, which has probability P(R) = Q t∈R P(Xt = 1). If a set of tests A ⊆T are performed, let the observed outcome vector be denoted by xA ∈{0, 1}|A|. Let the version space H(xA) be the set of hypotheses consistent with observation vector xA, i.e. H(xA) = {h ∈H | ∀t ∈A, h(t) = xA(t)}. We define a policy π as a mapping from observation vector xA to tests. A policy terminates when it shows that at least one region is valid, or all regions are invalid. Let xT ∈{0, 1}T be the ground truth - the outcome vector for all tests. Denote the observation vector of a policy π given ground truth xT as xA (π, xT ). The expected cost of a policy π is c(π) = ExT [c(xA (π, xT )] where c(xA) is the cost of all tests t ∈A. The objective is to compute a policy π∗with minimum cost that ensures at least one region is valid, i.e. π∗∈arg min π c(π) s.t ∀xT , ∃Rd : P(Rd | xA (π, xT )) = 1 (2) Note that we can cast problem (1) to (2) by setting E = T and Ξ = {Ri}m i=1. That is, driving uncertainty into a region is equivalent to identification of a valid path (Fig. 2). This casting enables us to leverage efficient algorithms with near-optimality guarantees for motion planning. 3 Related Work The computational bottleneck in motion planning varies with problem domain and that has led to a plethora of planning techniques ([23]). When vertex expansions are a bottleneck, A* [17] is optimally efficient while techniques such as partial expansions [28] address graph searches with large branching factors. The problem class we examine, that of expensive edge evaluation, has inspired a variety of 2It is assumed that c(e) is modular and non-zero. It can scale with edge length. 3Refer to supplementary on various methods to construct a library of good candidate paths 3 R1 R2 R3 R1 R2 R3 R1 R2 R3 ⇠1 ⇠2 ⇠3 ⇠1 ⇠2 ⇠3 ⇠1 ⇠2 ⇠3 (a) (b) (c) Figure 2: Equivalence between the feasible path identification problem and Bern-DRD. A path ξi is equivalent to a region Ri over valid hypotheses (blue dots). Tests eliminate hypotheses and the algorithm terminates when uncertainty is pushed into a region (R1) and the corresponding path (ξ1) is determined to be valid. ‘lazy’ approaches. The Lazy Probabilistic Roadmap (PRM) algorithm [1] only evaluates edges on the shortest path while Fuzzy PRM [26] evaluates paths that minimize probability of collision. The Lazy Weighted A* (LWA*) algorithm [8] delays edge evaluation in A* search and is reflected in similar techniques for randomized search [14, 6]. An approach most similar in style to ours is the LazyShortestPath (LazySP) framework [11] which examines the problem of which edges to evaluate on the shortest path. Instead of the finding the shortest path, our framework aims to efficiently identify a feasible path in a library of ‘good’ paths. Our framework is also similar to the Anytime Edge Evaluation (AEE*) framework [25] which deals with edge evaluation on a GBG. However, our framework terminates once a single feasible path is found while AEE* continues to evaluation in order to minimize expected cumulative sub-optimality bound. Similar to Choudhury et al. [7] and Burns and Brock [2], we leverage priors on the distribution of obstacles to make informed planning decisions. We draw a novel connection between motion planning and optimal test selection which has a wide-spread application in medical diagnosis [21] and experiment design [4]. Optimizing the ideal metric, decision theoretic value of information [18], is known to be NPPP complete [22]. For hypothesis identification (known as the Optimal Decision Tree (ODT) problem), Generalized Binary Search (GBS) [10] provides a near-optimal policy. For disjoint region identification (known as the Equivalence Class Determination (ECD) problem), EC2 [16] provides a near-optimal policy. When regions overlap (known as the Decision Region Determination (DRD) problem), HEC [19] provides a near-optimal policy. The DIRECT algorithm [5], a computationally more efficient alternative to HEC, forms the basis of our approach. 4 The Bernoulli Subregion Edge Cutting Algorithm The DRD problem in general is addressed by the Decision Region Edge Cutting (DIRECT) [5] algorithm. The intuition behind the method is as follows - as tests are performed, hypotheses inconsistent with test outcomes are pruned away. Hence, tests should be incentivized to push the probability mass over hypotheses into any region as fast as possible. Chen et al. [5] derive a surrogate objective function that provides such an incentive by creating separate sub-problems for each region and combining them in a Noisy-OR fashion such that quickly solving any one sub-problem suffices. Importantly, this objective is adaptive submodular [15] - greedily maximizing such an objective results in a near-optimal policy. We adapt the framework of DIRECT to address the Bern-DRD problem. We first provide a modification to the EC2 sub-problem objective which is simpler to compute when the distribution over hypotheses is non-uniform, while providing the same guarantees. Unfortunately, naively applying DIRECT requires O 2T  computation per sub-problem. For the special case of independent Bernoulli tests, we present a more efficient Bernoulli Subregion Edge Cutting (BISECT) algorithm, which computes each subproblem in O (T ) time. We provide a brief exposition deferring to the supplementary for detailed derivations. 4.1 A simple subproblem: One region versus all Following Chen et al. [5], we define a ‘one region versus all’ subproblem, the solution of which helps address the Bern-DRD. Given a single region, the objective is to either push the version space to that region, or collapse it to a single hypothesis. We view a region R as a version space RH ⊆H 4 consistent with its constituent tests. We define this subproblem over a set of disjoint subregions Si. Let the hypotheses in the target region RH be S1. Every other hypothesis h ∈RH is defined as its own subregion Si, i > 1, where RH is a set of hypothesis where a region is not valid. Determining which subregion is valid falls under the framework of Equivalence Class Determination (ECD), (a special case of the DRD problem) and can be solved efficiently by the EC2 algorithm (Golovin et al. [16]). This objective defines a graph with nodes as subregions and edges between distinct subregions, where the weight of an edge is the product of probabilities of subregions. As tests are performed and outcomes are received, the version space shrinks, and probabilities of different subregions are driven to 0. This has the effect of decreasing the total weight of edges. Importantly, the problem is solved i.f.f. the weight of all edges is zero. The weight over the set of subregions is: w[16]({Si}) = X j̸=k P(Sj)P(Sk) (3) When hypotheses have uniform weight, this can be computed efficiently for the ‘one region versus all’ subproblem. Let P(S1) = P i>1 P(Si): w[16]({Si}) = P(S1)P(S1) + P(S1)  P(S1) −1 |H|  (4) For non-uniform prior however, this quantity is more difficult to compute. We modify this objective slightly, adding self-edges on subregions Si, i > 1, enabling more efficient computation while still maintaining the same guarantees: wEC({Si}) = P(S1)( X i̸=1 P(Si)) + ( X i̸=1 P(Si))( X j≥1 P(Sj)) = P(S1)P(S1) + P(S1)2 = P(RH)(P(RH) + P(RH)) (5) For region R, let the relevant version space be HR(xA) = {h ∈H | ∀t ∈A ∩R, h(t) = xA(t)}. The set of all hypotheses in RH consistent with relevant outcomes in xA is given by RH ∩HR(xA). The terms P(RH ∩HR(xA)) and P(RH ∩HR(xA)) allows us to quantify the progress made on determining region validity. Naively computing these terms would require computing all hypotheses and assigning them to correct subregions, thus requiring a runtime of O 2T  . However, for the special case of Bernoulli tests, we can reduce this to O (T ) as we can see from the expression wEC({Si}∩HR(xA)) =  1 − Y i∈(R∩A) I(Xi = 1) Y j∈(R\A) θj   Y k∈R∩A θxA(k) k (1 −θk)1−xA(k) !2 (6) We can further reduce this to O (1) when iteratively updated (see supplementary for derivations). We now define a criterion that incentivizes removing edges quickly and has theoretical guarantees. Let fEC(xA) be the weight of edges removed on observing outcome vector xA. This is evaluated as fEC(xA) = 1 −wEC({Si} ∩HR(xA)) wEC({Si}) = 1 − 1 − Q i∈(R∩A) I(Xi = 1) Q j∈(R\A) θj !  Q k∈R∩A θxA(k) k (1 −θk)1−xA(k) 2 1 −Q i∈R θi (7) Lemma 1. The expression fEC(xA) is strongly adaptive monotone and adaptive submodular. 4.2 Solving the Bern-DRD problem using BISECT We now return to Bern-DRD problem (2) where we have multiple regions {R1, . . . , Rm} that overlap. Each region Rr is associated with an objective f r EC(xA) for solving the ‘one region versus all’ problem. Since solving any one such subproblem suffices, we combine them in a Noisy-OR 5 Algorithm 1: Decision Region Determination with Independent Bernoulli Test({Ri}m i=1 , θ, xT ) 1 A ←∅; 2 while (∄Ri, P(Ri|xA) = 1) and (∃Ri, P(Ri|xA) > 0) do 3 Tcand ←SelectCandTestSet(xA) ; ▷Using either (10) or (12) 4 t∗←SelectTest(Tcand, θ, xA) ; ▷Using either (11),(13),(14),(15) or (16) 5 A ←A ∪t∗; 6 xt∗←xT (t∗) ; ▷Observe outcome for selected test formulation by defining an objective fDRD(xA) = 1 − m Q r=1 (1 −f r EC(xA)) [5] which evaluates to 1 − m Y r=1        1 − Q i∈(Rr∩A) I(Xi = 1) Q j∈(Rr\A) θj ! Q k∈Rr∩A θxA(k) k (1 −θk)1−xA(k) !2 1 −Q i∈Rr θi        (8) Since fDRD(xA) = 1 iff f r EC(xA) = 1 for at least one r, we define the following surrogate problem to Bern-DRD π∗∈arg min π c(π) s.t ∀xT : fDRD(xA (π, xT )) ≥1 (9) The surrogate problem has a structure that allows greedy policies to have near-optimality guarantees Lemma 2. The expression fDRD(xA) is strongly adaptive monotone and adaptive submodular. Theorem 1. Let m be the number of regions, ph min the minimum prior probability of any hypothesis, πDRD be the greedy policy and π∗with the optimal policy. Then c(πDRD) ≤c(π∗)(2m log 1 ph min +1). We now describe the BISECT algorithm. Algorithm 1 shows the framework for a general decision region determination algorithm. In order to specify BISECT, we need to define two options - a candidate test set selection function SelectCandTestSet(xA) and a test selection function SelectTest(Tcand, θ, xA). The unconstrained version of BISECT implements SelectCandTestSet(xA) to return the set of all tests Tcand that contains only unevaluated tests belonging to active regions Tcand = ( m [ i=1 {Ri | P(Ri|xA) > 0} ) \ A (10) We now examine the BISECT test selection rule SelectTest(Tcand, θ, xA) t∗∈arg max t∈Tcand 1 c(t)Ext   m Y r=1  1 − Y i∈(Rr∩A) I(Xi = 1) Y j∈(Rr\A) θj   −   m Y r=1  1 − Y i∈(Rr∩A∪t) I(Xi = 1) Y j∈(Rr\A∪t) θj    (θxt t (1 −θt)1−xt) 2 m P k=1 I(t∈Rk)   (11) The intuition behind this update is that tests are selected to squash the probability of regions not being valid. It also additionally incentivizes selection of tests on which multiple regions overlap. 4.3 Adaptively constraining test selection to most likely region We observe in our experiments that the surrogate (8) suffers from a slow convergence problem fDRD(xA) takes a long time to converge to 1 when greedily optimized. To alleviate the convergence problem, we introduce an alternate candidate selection function SelectCandTestSet(xA) that assigns to Tcand the set of all tests that belong to the most likely region TmaxP which is evaluated as follows (we will refer to this variant as MAXPROBREG) TmaxP = ( arg max Ri=(R1,R2,...,Rm) P(Ri|xA) ) \ A (12) 6 Applying the constraint in (12) leads to a dramatic improvement for any test selection policy as we will show in Sec. 5.2. The following theorem offers a partial explanation Theorem 2. A policy that greedily latches to a region according the the posterior conditioned on the region outcomes has a near-optimality guarantee of 4 w.r.t the optimal region evaluation sequence. Applying the constraint in (12) implies we are no longer greedily optimizing fDRD(xA). However, the following theorem bounds the sub-optimality of this policy. Theorem 3. Let pmin = mini P(Ri), ph min = minh∈H P(h) and l = maxi |Ri|. The policy using (12) has a suboptimality of α  2m log  1 ph min  + 1  where α ≤  1 −max  (1 −pmin)2, p 2 l min −1 . 5 Experiments We evaluate BISECT on a collection of datasets spanning across a spectrum of synthetic problems and real-world planning applications. The synthetic problems are created by randomly selecting problem parameters to test the general applicability of BISECT. The motion planning datasets range from simplistic yet insightful 2D problems to more realistic high dimension problems as encountered by an UAV or a robot arm. The 7D arm planning dataset is obtained from a high fidelity simulation as shown in Fig. 4(a). Finally, we test BISECT on experimental data collected from a full scale helicopter flying that has to avoid unmapped wires at high speed as it comes into land as shown in Fig. 4(b). Refer to supplementary for exhaustive details on experiments and additional results. Open-source code and details can be found here: https://github.com/sanjibac/matlab_learning_collision_checking 5.1 Heuristic approaches to solving the Bern-DRD problem We propose a collection of competitive heuristics that can also be used to solve the Bern-DRD problem. These heuristics are various SelectTest(Tcand, θ, xA) policies in the framework of Alg. 1. To simplify the setting, we assume unit cost c(t) = 1 although it would be possible to extend these to nonuniform setting. The first heuristic RANDOM selects a test by sampling uniform randomly t∗∈Tcand (13) We adopt our next heuristic MAXTALLY from Dellin and Srinivasa [11] where the test belonging to most regions is selected. It uses the following criteria, which exhibits a ‘fail-fast’ characteristic t∗∈arg max t∈Tcand m X i=1 I (t ∈Ri, P(Ri|xA) > 0) (14) The next policy SETCOVER selects tests that maximize the expected number of ‘covered’ tests, i.e. if a selected test is in collision, how many other tests does it remove from consideration. t∗∈arg max t∈Tcand (1 −θt) ( m [ i=1 {Ri | P(Ri|xA) > 0} − m [ j=1  Rj P(Rj|, xA, Xt=0) > 0 ) \ {A ∪{t}} (15) Theorem 4. SETCOVER is a near-optimal policy for the problem of optimally checking all regions. The last heuristic is derived from a classic heuristic in decision theory: myopic value of information (Howard [18]). MVOI greedily chooses the test that maximizes the change in the probability mass of the most likely region. This test selection works only with SelectCandTestSet(xA) = TmaxP. t∗∈arg max t∈TmaxP (1 −θt) max i=1,...,m P(Ri | xA, Xt = 0) (16) We also evaluate against state of the art LAZYSP [11] planner which explicitly minimizes collision checking effort while trying to guarantee optimality. We ran two variants of LazySP. The first variant is the vanilla unconstrained algorithm that searches for the shortest path on the entire graph, collision checks the path and repeats. The second variant is constrained to the library of paths used by all other baselines. 5.2 Analysis of results Table 1 shows the evaluation cost of all algorithms on various datasets normalized w.r.t BISECT. The two numbers are lower and upper 95% confidence intervals - hence it conveys how much fractionally poorer are algorithms w.r.t BISECT. The best performance on each dataset is highlighted. We present a set of observations to interpret these results. O 1. BISECT has a consistently competitive performance across all datasets. 7 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 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 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 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 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 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 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 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 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 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 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 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 MVoI (|A| : 28) SetCover (|A| : 30) MaxTally (|A| : 29) BiSECt (|A| : 20) Figure 3: Performance (number of evaluated edges) of all algorithms on 2D geometric planning. Snapshots, at start, interim and final stages respectively, show evaluated valid edges (green), invalid edges (red) and the final path (magenta). The utility of edges as computed by algorithms is shown varying from low (black) to high (cream). (a) (b) Wires in real flight … Region 1: Single edge with low probability Region 2: Many edges with high probability (c) Figure 4: (a) A 7D arm has to perform pick and place tasks at high speed in a table with clutter. (b) Experimental data from a full-scale helicopter that has to react quickly to avoid unmapped wires detected by the sensor. BISECT (given an informative prior) checks a small number of edges around the detected wire and identifies a path. (c) Scenario where regions have size disparity. Unconstrained BISECT significantly outperforms other algorithms on such a scenario. Table 1 shows that on 13 out of the 14 datasets, BISECT is at par with the best. On 7 of those it is exclusively the best. O 2. The MAXPROBREG variant improves the performance of all algorithms on most datasets Table 1 shows that this is true on 12 datasets. The impact is greatest on RANDOM on the 2D Forest dataset performance improves from (19.45, 27.66) to (0.13, 0.30). However, this is not true in general. On datasets with large disparity in region sizes as illustrated in Fig. 4(c), unconstrained BISECT significantly outperforms other algorithms. In such scenarios, MAXPROBREG latches on to the most probable path which also happens to have a large number of edges. It performs poorly on instances where this region is invalid, while the other region containing a single edge is valid. Unconstrained BISECT prefers to evaluate the single edge belonging to region 1 before proceeding to evaluate region 2, performing optimally on those instances. Hence, the myopic nature of MAXPROBREG is the reason behind its poor performance. O 3. On planning problems, BISECT strikes a trade-off between the complimentary natures of MAXTALLY and MVOI. 8 Table 1: Normalized evaluation cost - (lower, upper) bound of 95% confidence interval LAZYSP MVOI RANDOM MAXTALLY SETCOVER BISECT Unconstrained Unconstrained Unconstrained Unconstrained Unconstrained Constrained MaxProbReg MaxProbReg MaxProbReg MaxProbReg Synthetic Bernoulli Test: Variation across region overlap Small (4.18, 6.67) (3.49, 5.23) (1.77, 3.01) (1.42, 2.36) m : 100 (0.00, 0.08) (0.12, 0.29) (0.12, 0.25) (0.18, 0.40) (0.00, 0.00) Medium (3.27, 4.40) (3.04, 4.30) (3.55, 4.67) (1.77, 2.64) m : 500 (0.00, 0.00) (0.05, 0.25) (0.14, 0.24) (0.14, 0.33) (0.00, 0.00) Large (2.86, 4.26) (2.62, 3.85) (2.94, 3.71) (1.33, 1.81) m : 1e3 (−0.11, 0.00) (0.00, 0.28) (0.06, 0.26) (0.09, 0.22) (0.00, 0.00) 2D Geometric Planning: Variation across environments Forest (10.8, 14.3) (19.5, 27.7) (4.68, 6.55) (3.53, 5.07) (1.90, 2.46) (1.38, 2.51) (0.03, 0.18) (0.13, 0.30) (0.09, 0.18) (0.00, 0.09) (0.00, 0.00) OneWall (6.96, 11.3) (13.4, 17.8) (4.12, 4.89) (1.36, 2.11) (0.76, 1.20) (0.16, 0.55) (0.045, 0.21) (0.11, 0.42) (0.00, 0.12) (0.14, 0.29) (0.00, 0.00) TwoWall (18.9, 25.6) (13.8, 16.6) (2.76, 3.93) (2.07, 2.94) (0.91, 1.44) (−0.17, 0.01) (0.00, 0.09) (0.33, 0.51) (0.10, 0.20) (0.00, 0.00) (0.00, 0.00) 2D Geometric Planning: Variation across region size OneWall (5.82, 12.1) (12.1, 16.0) (4.47, 5.13) (2.00, 3.41) (0.94, 1.42) m : 300 (0.00, 0.57) (0.00, 0.17) (0.12, 0.42) (0.06, 0.24) (0.00, 0.38) (0.00, 0.00) OneWall (5.43, 10.02) (13.3, 16.8) (2.18, 3.77) (1.04, 1.62) (0.41, 0.91) m : 858 (−0.03, 0.45) (0.00, 0.14) (0.09, 0.27) (−0.04, 0.08) (0.00, 0.14) (0.00, 0.00) Non-holonomic Path Planning: Variation across environments Forest (1.97, 3.81) (22.4, 29.7) (9.79, 11.14) (2.63, 5.28) (1.54, 2.46) (0.15, 0.47) (0.09, 0.18) (0.46, 0.79) (0.25, 0.38) (0.00, 0.00) (0.00, 0.00) OneWall (0.97, 2.45) (13.0, 15.8) (8.40, 11.47) (3.72, 4.54) (3.28, 3.78) (0.02, 0.51) (−0.11, 0.11) (0.00, 0.12) (0.21, 0.28) (−0.11, 0.11) (0.00, 0.00) 7D Arm Planning: Variation across environments Table (0.97, 1.59) (15.1, 19.4) (4.80, 6.98) (1.36, 2.17) (0.32, 0.67) (0.24, 0.72) (0.28, 0.54) (0.13, 0.31) (0.00, 0.04) (0.00, 0.11) (0.00, 0.00) Clutter (0.28, 1.19) (7.92, 9.85) (3.96, 6.44) (1.42, 2.07) (1.23, 1.75) (0.00, 0.38) (0.02, 0.20) (0.14, 0.36) (0.00, 0.00) (0.00, 0.11) (0.00, 0.00) Datasets with large disparity in region sizes Synth. (6.50, 8.00) (5.50, 6.50) (3.00, 3.50) (0.00, 0.00) (T : 10) (3.00, 3.50) (3.00, 4.50) (5.00, 7.50) (3.00, 3.50) (3.00, 3.50) 2D Plan (9.50, 11.3) (2.80, 6.10) (6.60, 10.5) (0.00, 0.00) (m : 2) (6.60, 10.5) (6.90, 10.8) (6.80, 8.30) (6.60, 10.5) (7.30, 11.2) We examine this in the context of 2D planning as shown in Fig. 3. MAXTALLY selects edges belonging to many paths which is useful for path elimination but does not reason about the event when the edge is not in collision. MVOI selects edges to eliminate the most probable path but does not reason about how many paths a single edge can eliminate. BISECT switches between these behaviors thus achieving greater efficiency than both heuristics. O 4. BISECT checks informative edges in collision avoidance problems encountered a helicopter Fig. 4(b) shows the efficacy of BISECT on experimental flight data from a helicopter avoiding wire. 6 Conclusion In this paper, we addressed the problem of identification of a feasible path from a library while minimizing the expected cost of edge evaluation given priors on the likelihood of edge validity. We showed that this problem is equivalent to a decision region determination problem where the goal is to select tests (edges) that drive uncertainty into a single decision region (a valid path). We proposed BISECT, and efficient and near-optimal algorithm that solves this problem by greedily optimizing a surrogate objective.We validated BISECT on a spectrum of problems against state of the art heuristics and showed that it has a consistent performance across datasets. This works serves as a first step towards importing Bayesian active learning approaches into the domain of motion planning. 9 Acknowledgments We would like to acknowledge the support from ONR grant N000141310821. We would like to thank Shushman Choudhury for insightful discussions and the 7D arm planning datasets. We would like to thank Oren Salzaman, Mohak Bhardwaj, Vishal Dugar and Paloma Sodhi for feedback on the paper. References [1] Robert Bohlin and Lydia E Kavraki. Path planning using lazy prm. In ICRA, 2000. [2] Brendan Burns and Oliver Brock. Sampling-based motion planning using predictive models. In ICRA, 2005. [3] John F Canny. The complexity of robot motion planning. 1988. [4] Kathryn Chaloner and Isabella Verdinelli. Bayesian experimental design: A review. Statistical Science, pages 273–304, 1995. [5] Yuxin Chen, Shervin Javdani, Amin Karbasi, J. Andrew (Drew) Bagnell, Siddhartha Srinivasa, and Andreas Krause. Submodular surrogates for value of information. In AAAI, 2015. [6] Sanjiban Choudhury, Jonathan D. Gammell, Timothy D. Barfoot, Siddhartha Srinivasa, and Sebastian Scherer. Regionally accelerated batch informed trees (rabit*): A framework to integrate local information into optimal path planning. In ICRA, 2016. [7] Shushman Choudhury, Christopher M Dellin, and Siddhartha S Srinivasa. Pareto-optimal search over configuration space beliefs for anytime motion planning. In IROS, 2016. [8] Benjamin Cohen, Mike Phillips, and Maxim Likhachev. Planning single-arm manipulations with n-arm robots. In Eigth Annual Symposium on Combinatorial Search, 2015. [9] Hugh Cover, Sanjiban Choudhury, Sebastian Scherer, and Sanjiv Singh. Sparse tangential network (spartan): Motion planning for micro aerial vehicles. In ICRA. IEEE, 2013. [10] Sanjoy Dasgupta. Analysis of a greedy active learning strategy. In NIPS, 2004. [11] Christopher M Dellin and Siddhartha S Srinivasa. A unifying formalism for shortest path problems with expensive edge evaluations via lazy best-first search over paths with edge selectors. In ICAPS, 2016. [12] Christopher M Dellin, Kyle Strabala, G Clark Haynes, David Stager, and Siddhartha S Srinivasa. Guided manipulation planning at the darpa robotics challenge trials. In Experimental Robotics, 2016. [13] Alan Frieze and Michał Karo´nski. Introduction to random graphs. Cambridge Press, 2015. [14] Jonathan D. Gammell, Siddhartha S. Srinivasa, and Timothy D. Barfoot. Batch Informed Trees: Samplingbased optimal planning via heuristically guided search of random geometric graphs. In ICRA, 2015. [15] Daniel Golovin and Andreas Krause. Adaptive submodularity: Theory and applications in active learning and stochastic optimization. Journal of Artificial Intelligence Research, 2011. [16] Daniel Golovin, Andreas Krause, and Debajyoti Ray. Near-optimal bayesian active learning with noisy observations. In NIPS, 2010. [17] Peter E Hart, Nils J Nilsson, and Bertram Raphael. A formal basis for the heuristic determination of minimum cost paths. IEEE Trans. on Systems Science and Cybernetics, 1968. [18] Ronald A Howard. Information value theory. IEEE Tran. Systems Science Cybernetics, 1966. [19] Shervin Javdani, Yuxin Chen, Amin Karbasi, Andreas Krause, J. Andrew (Drew) Bagnell, and Siddhartha Srinivasa. Near optimal bayesian active learning for decision making. In AISTATS, 2014. [20] Sertac Karaman and Emilio Frazzoli. Sampling-based algorithms for optimal motion planning. The International Journal of Robotics Research, 30(7):846–894, 2011. [21] Igor Kononenko. Machine learning for medical diagnosis: History, state of the art and perspective. Artificial Intelligence in Medicine, 2001. [22] Andreas Krause and Carlos Guestrin. Optimal value of information in graphical models. Journal of Artificial Intelligence Research, 35:557–591, 2009. 10 [23] S. M. LaValle. Planning Algorithms. Cambridge University Press, Cambridge, U.K., 2006. [24] Steven M LaValle and James J Kuffner Jr. Randomized kinodynamic planning. IJRR, 2001. [25] Venkatraman Narayanan and Maxim Likhachev. Heuristic search on graphs with existence priors for expensive-to-evaluate edges. In ICAPS, 2017. [26] Christian L Nielsen and Lydia E Kavraki. A 2 level fuzzy prm for manipulation planning. In IROS, 2000. [27] Mihail Pivtoraiko, Ross A Knepper, and Alonzo Kelly. Differentially constrained mobile robot motion planning in state lattices. Journal of Field Robotics, 2009. [28] Takayuki Yoshizumi, Teruhisa Miura, and Toru Ishida. A* with partial expansion for large branching factor problems. In AAAI/IAAI, pages 923–929, 2000. 11
2017
589
7,106
Neural Variational Inference and Learning in Undirected Graphical Models Volodymyr Kuleshov Stanford University Stanford, CA 94305 kuleshov@cs.stanford.edu Stefano Ermon Stanford University Stanford, CA 94305 ermon@cs.stanford.edu Abstract Many problems in machine learning are naturally expressed in the language of undirected graphical models. Here, we propose black-box learning and inference algorithms for undirected models that optimize a variational approximation to the log-likelihood of the model. Central to our approach is an upper bound on the logpartition function parametrized by a function q that we express as a flexible neural network. Our bound makes it possible to track the partition function during learning, to speed-up sampling, and to train a broad class of hybrid directed/undirected models via a unified variational inference framework. We empirically demonstrate the effectiveness of our method on several popular generative modeling datasets. 1 Introduction Many problems in machine learning are naturally expressed in the language of undirected graphical models. Undirected models are used in computer vision [1], speech recognition [2], social science [3], deep learning [4], and other fields. Many fundamental machine learning problems center on undirected models [5]; however, inference and learning in this class of distributions give rise to significant computational challenges. Here, we attempt to tackle these challenges via new variational inference and learning techniques aimed at undirected probabilistic graphical models p. Central to our approach is an upper bound on the log-partition function of p parametrized by a an approximating distribution q that we express as a flexible neural network [6]. Our bound is tight when q = p and is convex in the parameters of q for interesting classes of q. Most interestingly, it leads to a lower bound on the log-likelihood function log p, which enables us to fit undirected models in a variational framework similar to black-box variational inference [7]. Our approach offers a number of advantages over previous methods. First, it enables training undirected models in a black-box manner, i.e. we do not need to know the structure of the model to compute gradient estimators (e.g., as in Gibbs sampling); rather, our estimators only require evaluating a model’s unnormalized probability. When optimized jointly over q and p, our bound also offers a way to track the partition function during learning [8]. At inference-time, the learned approximating distribution q may be used to speed-up sampling from the undirected model by initializing an MCMC chain (or it may itself provide samples). Furthermore, our approach naturally integrates with recent variational inference methods [6, 9] for directed graphical models. We anticipate that our approach will be most useful in automated probabilistic inference systems [10]. As a practical example for how our methods can be used, we study a broad class of hybrid directed/undirected models and show how they can be trained in a unified black-box neural variational inference framework. Hybrid models like the ones we consider have been popular in the early deep learning literature [4, 11] and take inspiration from the principles of neuroscience [12]. They also 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. possess a higher modeling capacity for the same number of variables; quite interestingly, we identify settings in which such models are also easier to train. 2 Background Undirected graphical models. Undirected models form one of the two main classes of probabilistic graphical models [13]. Unlike directed Bayesian networks, they may express more compactly relationships between variables when the directionality of a relationship cannot be clearly defined (e.g., as in between neighboring image pixels). In this paper, we mainly focus on Markov random fields (MRFs), a type of undirected model corresponding to a probability distribution of the form pθ(x) = ˜pθ(x)/Z(θ), where ˜pθ(x) = exp(θ · x) is an unnormalized probability (also known as energy function) with parameters θ, and Z(θ) = R ˜pθ(x)dx is the partition function, which is essentially a normalizing constant. Our approach also admits natural extensions to conditional random field (CRF) undirected models. Importance sampling. In general, the partition function of an MRF is often an intractable integral over ˜p(x). We may, however, rewrite it as I := Z x ˜pθ(x)dx = Z x ˜pθ(x) q(x) q(x)dx = Z x w(x)q(x)dx, (1) where q is a proposal distribution. Integral I can in turn be approximated by a Monte-Carlo estimate ˆI := 1 n Pn i=1 w(xi), where xi ∼q. This approach, called importance sampling [14], may reduce the variance of an estimator and help compute intractable integrals. The variance of an importance sampling estimate ˆI has a closed-form expression: 1 n Eq(x)[w(x)2] −I2 . By Jensen’s inequality, it equals 0 when p = q. Variational inference. Inference in undirected models is often intractable. Variational approaches approximate this process by optimizing the evidence lower bound log Z(θ) ≥max q Eq(x) [log ˜pθ(x) −log q(x)] over a distribution q(x); this amounts to finding a q that approximates p in terms of KL(q||p). Ideal q’s should be expressive, easy to optimize over, and admit tractable inference procedures. Recent work has shown that neural network-based models possess many of these qualities [15, 16, 17]. Auxiliary-variable deep generative models. Several families of q have been proposed to ensure that the approximating distribution is sufficiently flexible to fit p. This work makes use of a class of distributions q(x, a) = q(x|a)q(a) that contain auxiliary variables a [18, 19]; these are latent variables that make the marginal q(x) multimodal, which in turn enables it to approximate more closely a multimodal target distribution p(x). 3 Variational Bounds on the Partition Function This section introduces a variational upper bound on the partition function of an undirected graphical model. We analyze its properties and discuss optimization strategies. In the next section, we use this bound as an objective for learning undirected models. 3.1 A Variational Upper Bound on Z(θ) We start with the simple observation that the variance of an importance sampling estimator (1) of the partition function naturally yields an upper bound on Z(θ): Eq(x)  ˜p(x)2 q(x)2  ≥Z(θ)2. (2) As mentioned above, this bound is tight when q = p. Hence, it implies a natural algorithm for computing Z(θ): minimize (2) over q in some family Q. 2 We immediately want to emphasize that this algorithm will not be directly applicable to highly peaked and multimodal distributions ˜p (such as an Ising model near its critical point). If q is initially very far from ˜p, Monte Carlo estimates will tend to under-estimate the partition function. However, in the context of learning p, we may expect a random initialization of ˜p to be approximately uniform; we may thus fit an initial q to this well-behaved distribution, and as we gradually learn or anneal p, q should be able to track p and produce useful estimates of the gradients of ˜p and of Z(θ). Most importantly, these estimates are black-box and do not require knowing the structure of ˜p to compute. We will later confirm that our intuition is correct via experiments. 3.2 Properties of the Bound Convexity properties. A notable feature of our objective is that if q is an exponential family with parameters φ, the bound is jointly log-convex in θ and φ. This lends additional credibility to the bound as an optimization objective. If we choose to further parametrize φ by a neural net, the resulting non-convexity will originate solely from the network, and not from our choice of loss function. To establish log-convexity, it suffices to look at ˜pθ(x)2/q(x) for one x, since the sum of log-convex functions is log-convex. Note that log ˜pθ(x)2 q(x) = 2θT x −log qφ(x). One can easily check that a non-negative concave function is also log-concave; since q is in the exponential family, the second term is convex, and our claim follows. Importance sampling. Minimizing the bound on Z(θ) may be seen as a form of adaptive importance sampling, where the proposal distribution q is gradually adjusted as more samples are taken [14, 20]. This provides another explanation for why we need q ≈p; note that when q = p, the variance is zero, and a single sample computes the partition function, demonstrating that the bound is indeed tight. This also suggests the possibility of taking 1 n Pn i=1 ˜p(xi) q(xi) as an estimate of the partition function, with the xi being all the samples that have been collected during the optimization of q. χ2-divergence minimization. Observe that optimizing (2) is equivalent to minimizing Eq (˜p−q)2 q2 , which is the χ2-divergence, a type of α-divergence with α = 2 [21, 22]. This connections highlights the variational nature of our approach and potentially suggests generalizations to other divergences. Moreover, many interesting properties of the bound can be easily established from this interpretation, such as convexity in terms of q, ˜p (in functional space). 3.3 Auxiliary-Variable Approximating Distributions A key part of our approach is the choice of approximating family Q: it needs to be expressive, easy to optimize over, and admit tractable inference procedures. In particular, since ˜p(x) may be highly multi-modal and peaked, q(x) should ideally be equally complex. Note that unlike earlier methods that parametrized conditional distributions q(z|x) over hidden variables z (e.g. variational autoencoders [15]), our setting does not admit a natural conditioning variable, making the task considerably more challenging. Here, we propose to address these challenges via an approach based on auxiliary-variable approximations [18]: we introduce a set of latent variables a into q(x, a) = q(x|a)q(a) making the marginal q(x) multi-modal. Computing the marginal q(x) may no longer be tractable; we therefore apply the variational principle one more time and introduce an additional relaxation of the form Eq(a,x) p(a|x)2˜p(x)2 q(x|a)2q(a)2  ≥Eq(x)  ˜p(x)2 q(x)2  ≥Z(θ)2, (3) where, p(a|x) is a probability distribution over a that lifts ˜p to the joint space of (x, a). To establish the first inequality, observe that Eq(a,x) p(a|x)2˜p(x)2 q(x|a)2q(a)2  = Eq(x)q(a|x) p(a|x)2˜p(x)2 q(a|x)2q(x)2  = Eq(x)  ˜p(x)2 q(x)2 · Eq(a|x) p(a|x)2 q(a|x)2  . The factor Eq(a|x)  p(a|x)2 q(a|x)2  is an instantiation of bound (2) for the distribution p(a|x), and is therefore lower-bounded by 1. 3 This derivation also sheds light on the role of p(a|x): it is an approximating distribution for the intractable posterior q(a|x). When p(a|x) = q(a|x), the first inequality in (3) is tight, and we are optimizing our initial bound. 3.3.1 Instantiations of the Auxiliary-Variable Framework The above formulation is sufficiently general to encompass several different variational inference approaches. Either could be used to optimize our objective, although we focus on the latter, as it admits the most flexible approximators for q(x). Non-parametric variational inference. First, as suggested by Gershman et al. [23], we may take q to be a uniform mixture of K exponential families: q(x) = PK k=1 1 K qk(x; φk). This is equivalent to letting a be a categorical random variable with a fixed, uniform prior. The qk may be either Gaussians or Bernoulli, depending on whether x is discrete or continuous. This choice of q lets us potentially model arbitrarily complex p given enough components. Note that for distributions of this form it is easy to compute the marginal q(x) (for small K), and the bound in (3) may not be needed. MCMC-based variational inference. Alternatively, we may set q(a|x) to be an MCMC transition operator T(x′|x) (or a sequence of operators) as in Salimans et al. [24]. The prior q(a) may be set to a flexible distribution, such as normalizing flows [25] or another mixture distribution. This gives a distribution of the form q(x, a) = T(x|a)q(a). (4) For example, if T(x|a) is a Restricted Boltzmann Machine (RBM; Smolensky [26]), the Gibbs sampling operator T(x′|x) has a closed form that can be used to compute importance samples. This is in contrast to vanilla Gibbs sampling, where there is no closed form density for weighting samples. The above approach also has similarities to persistent contrastive divergence (PCD; Tieleman and Hinton [27]), a popular approach for training RBM models, in which samples are taken from a Gibbs chain that is not reset during learning. The distribution q(a) may be thought of as a parametric way of representing a persistent distribution from which samples are taken throughout learning; like the PCD Gibbs chain, it too tracks the target probability p during learning. Auxiliary-variable neural networks. Lastly, we may also parametrize q(a|x) by an flexible function approximator such as a neural network [18]. More concretely, we set q(a) to a simple continuous prior (e.g. normal or uniform) and set qφ(x|a) to an exponential family distribution whose natural parameters are parametrized by a neural net. For example, if x is continuous, we may set q(x|a) = N(µ(a), σ(a)I), as in a variational auto-encoder. Since the marginal q(x) is intractable, we use the variational bound (3) and parametrize the approximate posterior p(a|x) with a neural network. For example, if a ∼N(0, 1), we may again set p(a|x) = N(µ(x), σ(x)I). 3.4 Optimization In the rest of the paper, we focus on the auxiliary-variable neural network approach for optimizing bound (3). This approach affords us the greatest modeling flexibility and allows us to build on previous neural variational inference approaches. The key challenge with this choice of representation is optimizing (3) with respect to the parameters φ, φ of p, q. Here, we follow previous work on black-box variational inference [6, 7] and compute Monte Carlo estimates of the gradient of our neural network architecture. The gradient with respect to p has the form 2Eq ˜p(x,a) q(x,a)2 ∇φ˜p(x, a) and can be estimated directly via Monte Carlo. We use the score function estimator to compute the gradient of q, which can be written as −Eq(x,a) ˜p(x,a)2 q(x,a)2 ∇φ log q(x, a) and estimated again using Monte Carlo samples. In the case of a non-parametric variational approximation PK k=1 1 K qk(x; φk), the gradient has a simple expression ∇φkEq ˜p(x)2 q(x)2 = −Eqk h ˜p(x)2 q(x)2 dk(x) i , where dk(x) is the difference of x and its expectation under qk. 4 Note also that if our goal is to compute the partition function, we may collect all intermediary samples for computing the gradient and use them as regular importance samples. This may be interpreted as a form of adaptive sampling [20]. Variance reduction. A well-known shortcoming of the score function gradient estimator is its high variance, which significantly slows down optimization. We follow previous work [6] and introduce two variance reduction techniques to mitigate this problem. We first use a moving average ¯b of ˜p(x)2/q(x)2 to center the learning signal. This leads to a gradient estimate of the form Eq(x)( ˜p(x)2 q(x)2 −¯b)∇φ log q(x); this yields the correct gradient by well known properties of the score function [7]. Furthermore, we use variance normalization, a form of adaptive step size. More specifically, we keep a running average ¯σ2 of the variance of the ˜p(x)2/q(x)2 and use a normalized form g′ = g/ max(1, ¯σ2) of the original gradient g. Note that unlike the standard evidence lower bound, we cannot define a sample-dependent baseline, as we are not conditioning on any sample. Likewise, many advanced gradient estimators [9] do not apply in our setting. Developing better variance reduction techniques for this setting is likely to help scale the method to larger datasets. 4 Neural Variational Learning of Undirected Models Next, we turn our attention to the problem of learning the parameters of an MRF. Given data D = {x(i)}n i=1, our training objective is the log-likelihood log p(D|θ) := 1 n n X i=1 log pθ(x(i)) = 1 n n X i=1 θT x(i) −log Z(θ). (5) We can use our earlier bound to upper bound the log-partition function by log  Ex∼q ˜pθ(x)2 q(x)2  . By our previous discussion, this expression is convex in θ, φ if q is an exponential family distribution. The resulting lower bound on the log-likelihood may be optimized jointly over θ, φ; as discussed earlier, by training p and q jointly, the two distributions may help each other. In particular, we may start learning at an easy θ (where p is not too peaked) and use q to slowly track p, thus controlling the variance in the gradient. Linearizing the logarithm. Since the log-likelihood contains the logarithm of the bound (2), our Monte Carlo samples will produce biased estimates of the gradient. We did not find this to pose problems in practice; however, to ensure unbiased gradients one may further linearize the log using the identity log(x) ≤ax −log(a) −1, which is tight for a = 1/x. Together with our bound on the log-partition function, this yields log p(D|θ) ≥max θ,q 1 n n X i=1 θT x(i) −1 2  aEx∼q ˜pθ(x)2 qψ(x)2 −log(a) −1  . (6) This expression is convex in each of (θ, φ) and a, but is not jointly convex. However, it is straightforward to show that equation (6) and its unlinearized version have a unique point satisfying first-order stationarity conditions. This may be done by writing out the KKT conditions of both problems and using the fact that a∗= (Ex∼q ˜pθ(x)2 q(x)2 )−1 at the optimum. See Gopal and Yang [28] for more details. 4.1 Variational Inference and Learning in Hybrid Directed/Undirected Models We apply our framework to a broad class of hybrid directed/undirected models and show how they can be trained in a unified variational inference framework. The models we consider are best described as variational autoencoders with a Restricted Boltzmann Machine (RBM; Smolensky [26]) prior. More formally, they are latent-variable distributions of the form p(x, z) = p(x|z)p(z), where p(x|z) is an exponential family whose natural parameters are parametrized by a neural network as a function of z, and p(z) is an RBM. The latter is an undirected latent variable model with hidden variables h and unnormalized log-probability log ˜p(z, h) = zT Wh + bT z + cT h, where W, b, c are parameters. 5 We train the model using two applications of the variational principle: first, we apply the standard evidence lower bound with an approximate posterior r(z|x); then, we apply our lower bound on the RBM log-likelihood log p(z), which yields the objective log p(x) ≥Er(z|x) [log p(x|z) + log ˜p(z) + log B(˜p, q) −log r(z|x)] . (7) Here, B denotes our bound (3) on the partition function of p(z) parametrized with q. Equation (7) may be optimized using standard variational inference techniques; the terms r(z|x) and p(x|z) do not appear in B and their gradients may be estimated using REINFORCE and standard Monte Carlo, respectively. The gradients of ˜p(z) and q(z) are obtained using methods described above. Note also that our approach naturally extends to models with multiple layers of latent directed variables. Such hybrid models are similar in spirit to deep belief networks [11]. From a statistical point of view, a latent variable prior makes the model more flexible and allows it to better fit the data distribution. Such models may also learn structured feature representations: previous work has shown that undirected modules may learn classes of digits, while lower, directed layers may learn to represent finer variation [29]. Finally, undirected models like the ones we study are loosely inspired by the brain and have been studied from that perspective [12]. In particular, the undirected prior has been previously interpreted as an associative memory module [11]. 5 Experiments 5.1 Tracking the Partition Function We start with an experiment aimed at visualizing the importance of tracking the target distribution p using q during learning. 0 5 10 15 20 25 30 35 40 Iteration 20 22 24 26 28 30 32 34 36 logZ True value Our method Loopy BP Gibbs sampling We use Equation 6 to optimize the likelihood of a 5×5 Ising MRF with coupling factor J and unaries chosen randomly in {10−2, −10−2}. We set J = −0.6, sampled 1000 examples from the model, and fit another Ising model to this data. We followed a non-parametric inference approach with a mixture of K = 8 Bernoullis. We optimized (6) using SGD and alternated between ten steps over the φk and one step over θ, a. We drew 100 Monte Carlo samples per qk. Our method converged in about 25 steps over θ. At each iteration we computed log Z via importance sampling. The adjacent figure shows the evolution of log Z during learning. It also plots log Z computed by exact inference, loopy BP, and Gibbs sampling (using the same number of samples). Our method accurately tracks the partition function after about 10 iterations. In particular, our method fares better than the others when J ≈−0.6, which is when the Ising model is entering its phase transition. 5.2 Learning Restricted Boltzmann Machines Next, we use our method to train Restricted Boltzmann Machines (RBMs) on the UCI digits dataset [30], which contains 10,992 8 × 8 images of handwritten digits; we augment this data by moving each image 1px to the left, right, up, and down. We train an RBM with 100 hidden units using ADAM [31] with batch size 100, a learning rate of 3 · 10−4, β1 = 0.9, and β2 = 0.999; we choose q to be a uniform mixture of K = 10 Bernoulli distributions. We alternate between training p and q, performing either 2 or 10 gradient steps on q for each step on p and taking 30 samples from q per step; the gradients of p are estimated via adaptive importance sampling. We compare our method against persistent contrastive divergence (PCD; Tieleman and Hinton [27]), a standard method for training RBMs. The same ADAM settings were used to optimize the model with the PCD gradient. We used k = 3 Gibbs steps and 100 persistent chains. Both PCD and our method were implemented in Theano [32]. In Figure 1, we plot the true log-likelihood of the model (computed with annealed importance sampling with step size 10−3) as a function of the epoch; we use 10 gradient steps on q for each step on p. Both PCD and our method achieve comparable performance. Interestingly, we may use our 6 Figure 1: Learning curves for an RBM trained with PCD-3 and with neural variational inference on the UCI digits dataset. Log-likelihood was computed using annealed importance sampling. 0 50 100 150 200 250 Epochs 30 28 26 Log-likelihood Persistent contrastive divergence 0 20 40 60 80 100 120 Epochs 30 28 26 Log-likelihood Neural variational inference true predicted Table 1: Test set negative log likelihood on binarized MNIST and Omniglot for VAE and ADGM models with Bernoulli (200 vars) and RBM priors with 64 visible and either 8 or 64 hidden variables. Binarized MNIST Omniglot Model Ber(200) RBM(64,8) RBM(64,64) Ber(200) RBM(64,8) RBM(64,64) VAE 111.9 105.4 102.3 135.1 130.2 128.5 ADGM 107.9 104.3 100.7 136.8 134.4 131.1 approximating distribution q to estimate the log-likelihood via importance sampling. Figure 1 (right) shows that this estimate closely tracks the true log-likelihood; thus, users may periodically query the model for reasonably accurate estimates of the log-likelihood. In our implementation, neural variational inference was approximately eight times slower than PCD; when performing two gradient steps on q, our method was only 50% slower with similar samples and pseudo-likelihood; however log-likelihood estimates were noisier. Annealed importance sampling was always more than order of magnitude slower than neural variational inference. Visualizing the approximating distribution. Next, we trained another RBM model performing two gradient steps for q for each step of p. The adjacent figure shows the mean distribution of each component of the mixture of Bernoullis q; one may distinguish in them the shapes of various digits. This confirms that q indeed approximates p. Speeding up sampling from undirected models. After the model has finished training, we can use the approximating q to initialize an MCMC sampling chain. Since q is a rough approximation of p, the resulting chain should mix faster. To confirm this intuition, we plot in the adjacent figure samples from a Gibbs sampling chain that has been initialized randomly (top), as well as from a chain that was initialized with a sample from q (bottom). The latter method reaches a plausible-looking digit in a few steps, while the former produces blurry samples. 5.3 Learning Hybrid Directed/Undirected Models Next, we use the variational objective (7) to learn two types of hybrid directed/undirected models: a variational autoencoder (VAE) and an auxiliary variable deep generative model (ADGM) [18]. We consider three types of priors: a standard set of 200 uniform Bernoulli variables, an RBM with 64 visible and 8 hidden units, and an RBM with 64 visible and 64 hidden units. In the ADGM, the approximate posterior r(z, u|x) = r(z|u, x)r(u|x) includes auxiliary variables u ∈R10. All the conditional probabilities r(z|u, x), r(u|x), r(z|x), p(x|z) are parametrized with dense neural networks with one hidden layer of size 500. 7 Figure 2: Samples from a deep generative model using different priors over the discrete latent variables z. On the left, the prior p(z) is a Bernoulli distribution (200 vars); on the right, p(z) is an RBM (64 visible and 8 hidden vars). All other parts of the model are held fixed. We train all neural networks for 200 epochs with ADAM (same parameters as above) and neural variational inference (NVIL) with control variates as described in Mnih and Rezende [9]. We parametrize q with a neural network mapping 10-dimensional auxiliary variables a ∈N(0, I) to x via one hidden layer of size 32. We show in Table 1 the test set negative log-likelihoods on the binarized MNIST [33] and 28 × 28 Omniglot [17] datasets; we compute these using 103 Monte Carlo samples and using annealed importance sampling for the 64 × 64 RBM. Overall, adding an RBM prior with as little as 8 latent variables results in significant log-likelihood improvements. Most interestingly, this prior greatly improves sample quality over the discrete latent variable VAE (Figure 2). Whereas the VAE failed to generate correct digits, replacing the prior with a small RBM resulted in smooth MNIST images. We note that both methods were trained with exactly the same gradient estimator (NVIL). We observed similar behavior for the ADGM model. This suggests that introducing the undirected component made the models more expressive and easier to train. 6 Related Work and Discussion Our work is inspired by black-box variational inference [7] for variational autoencoders and related models [15], which involve fitting approximate posteriors parametrized by neural networks. Our work presents analogous methods for undirected models. Popular classes of undirected models include Restricted and Deep Boltzmann Machines [4, 26] as well as Deep Belief Networks [11]. Closest to our work is the discrete VAE model; however, Rolfe [29] seeks to efficiently optimize p(x|z), while the RBM prior p(z) is optimized using PCD; our work optimizes p(x|z) using standard techniques and focuses on p(z). Our bound has also been independently studied in directed models [22]. More generally, our work proposes an alternative to sampling-based learning methods; most variational methods for undirected models center on inference. Our approach scales to small and medium-sized datasets, and is most useful within hybrid directed-undirected generative models. It approaches the speed of the PCD method and offers additional benefits, such as partition function tracking and accelerated sampling. Most importantly, our algorithms are black-box, and do not require knowing the structure of the model to derive gradient or partition function estimators. We anticipate that our methods will be most useful in automated inference systems such as Edward [10]. The scalability of our approach is primarily limited by the high variance of the Monte Carlo estimates of the gradients and the partition function when q does not fit p sufficiently well. In practice, we found that simple metrics such as pseudo-likelihood were effective at diagnosing this problem. When training deep generative models with RBM priors, we noticed that weak q’s introduced mode collapse (but training would still converge). Increasing the complexity of q and using more samples resolved these problems. Finally, we also found that the score function estimator of the gradient of q does not scale well to higher dimensions. Better gradient estimators are likely to further improve our method. 7 Conclusion In summary, we have proposed new variational learning and inference algorithms for undirected models that optimize an upper-bound on the partition function derived from the perspective of 8 importance sampling and χ2 divergence minimization. Our methods allow training undirected models in a black-box manner and will be useful in automated inference systems [10]. Our framework is competitive with sampling methods in terms of speed and offers additional benefits such as partition function tracking and accelerated sampling. Our approach can also be used to train hybrid directed/undirected models using a unified variational framework. Most interestingly, it makes generative models with discrete latent variables both more expressive and easier to train. Acknowledgements. This work is supported by the Intel Corporation, Toyota, NSF (grants 1651565, 1649208, 1522054) and by the Future of Life Institute (grant 2016-158687). References [1] Yongyue Zhang, Michael Brady, and Stephen Smith. Segmentation of brain mr images through a hidden markov random field model and the expectation-maximization algorithm. IEEE transactions on medical imaging, 20(1):45–57, 2001. [2] Jeffrey A Bilmes. Graphical models and automatic speech recognition. In Mathematical foundations of speech and language processing, pages 191–245. Springer, 2004. [3] John Scott. Social network analysis. Sage, 2012. [4] Ruslan Salakhutdinov and Geoffrey Hinton. Deep boltzmann machines. In Artificial Intelligence and Statistics, pages 448–455, 2009. [5] Martin J Wainwright, Michael I Jordan, et al. Graphical models, exponential families, and variational inference. Foundations and Trends R⃝in Machine Learning, 1(1–2):1–305, 2008. [6] Andriy Mnih and Karol Gregor. Neural variational inference and learning in belief networks. arXiv preprint arXiv:1402.0030, 2014. [7] Rajesh Ranganath, Sean Gerrish, and David Blei. Black box variational inference. In Artificial Intelligence and Statistics, pages 814–822, 2014. [8] Guillaume Desjardins, Yoshua Bengio, and Aaron C Courville. On tracking the partition function. In Advances in neural information processing systems, pages 2501–2509, 2011. [9] Andriy Mnih and Danilo J Rezende. Variational inference for monte carlo objectives. arXiv preprint arXiv:1602.06725, 2016. [10] Dustin Tran, Alp Kucukelbir, Adji B Dieng, Maja Rudolph, Dawen Liang, and David M Blei. Edward: A library for probabilistic modeling, inference, and criticism. arXiv preprint arXiv:1610.09787, 2016. [11] Geoffrey E. Hinton, Simon Osindero, and Yee Whye Teh. A fast learning algorithm for deep belief nets. Neural Computation, 18:1527–1554, 2006. [12] Geoffrey E Hinton, Peter Dayan, Brendan J Frey, and Radford M Neal. The" wake-sleep" algorithm for unsupervised neural networks. Science, 268(5214):1158, 1995. [13] Daphne Koller and Nir Friedman. Probabilistic graphical models: principles and techniques. MIT press, 2009. [14] Rajan Srinivasan. Importance sampling: Applications in communications and detection. Springer Science & Business Media, 2013. [15] Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. CoRR, abs/1312.6114, 2013. URL http://arxiv.org/abs/1312.6114. [16] Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In Proceedings of the 31th International Conference on Machine Learning, ICML 2014, Beijing, China, 21-26 June 2014, pages 1278– 1286, 2014. URL http://jmlr.org/proceedings/papers/v32/rezende14.html. [17] Yuri Burda, Roger B. Grosse, and Ruslan Salakhutdinov. Importance weighted autoencoders. CoRR, abs/1509.00519, 2015. URL http://arxiv.org/abs/1509.00519. [18] Lars Maaløe, Casper Kaae Sønderby, Søren Kaae Sønderby, and Ole Winther. Auxiliary deep generative models. arXiv preprint arXiv:1602.05473, 2016. 9 [19] Rajesh Ranganath, Dustin Tran, and David Blei. Hierarchical variational models. In International Conference on Machine Learning, pages 324–333, 2016. [20] Ernest K. Ryu and Stephen P. Boyd. Adaptive importance sampling via stochastic convex programming. Unpublished manuscript, November 2014. [21] Tom Minka et al. Divergence measures and message passing. Technical report, Technical report, Microsoft Research, 2005. [22] Adji B Dieng, Dustin Tran, Rajesh Ranganath, John Paisley, and David M Blei. Variational inference via chi-upper bound minimization. Advances in Neural Information Processing Systems, 2017. [23] Samuel Gershman, Matthew D. Hoffman, and David M. Blei. Nonparametric variational inference. In Proceedings of the 29th International Conference on Machine Learning, ICML 2012, Edinburgh, Scotland, UK, 2012. [24] Tim Salimans, Diederik Kingma, and Max Welling. Markov chain monte carlo and variational inference: Bridging the gap. In Proceedings of the 32nd International Conference on Machine Learning (ICML-15), pages 1218–1226, 2015. [25] Danilo Jimenez Rezende and Shakir Mohamed. Variational inference with normalizing flows. arXiv preprint arXiv:1505.05770, 2015. [26] Paul Smolensky. Information processing in dynamical systems: Foundations of harmony theory. Technical report, DTIC Document, 1986. [27] Tijmen Tieleman and Geoffrey Hinton. Using fast weights to improve persistent contrastive divergence. In Proceedings of the 26th Annual International Conference on Machine Learning, pages 1033–1040. ACM, 2009. [28] Siddharth Gopal and Yiming Yang. Distributed training of large-scale logistic models. In Proceedings of the 30th International Conference on Machine Learning, ICML 2013, Atlanta, GA, USA, pages 289–297, 2013. [29] Jason Tyler Rolfe. Discrete variational autoencoders. arXiv preprint arXiv:1609.02200, 2016. [30] Fevzi Alimoglu, Ethem Alpaydin, and Yagmur Denizhan. Combining multiple classifiers for pen-based handwritten digit recognition. 1996. [31] Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. [32] Frédéric Bastien, Pascal Lamblin, Razvan Pascanu, James Bergstra, Ian Goodfellow, Arnaud Bergeron, Nicolas Bouchard, David Warde-Farley, and Yoshua Bengio. Theano: new features and speed improvements. arXiv preprint arXiv:1211.5590, 2012. [33] Hugo Larochelle and Iain Murray. The neural autoregressive distribution estimator. In AISTATS, volume 1, page 2, 2011. 10
2017
59
7,107
Minimal Exploration in Structured Stochastic Bandits Richard Combes Centrale-Supelec / L2S richard.combes@supelec.fr Stefan Magureanu KTH, EE School / ACL magur@kth.se Alexandre Proutiere KTH, EE School / ACL alepro@kth.se Abstract This paper introduces and addresses a wide class of stochastic bandit problems where the function mapping the arm to the corresponding reward exhibits some known structural properties. Most existing structures (e.g. linear, Lipschitz, unimodal, combinatorial, dueling, ...) are covered by our framework. We derive an asymptotic instance-specific regret lower bound for these problems, and develop OSSB, an algorithm whose regret matches this fundamental limit. OSSB is not based on the classical principle of “optimism in the face of uncertainty” or on Thompson sampling, and rather aims at matching the minimal exploration rates of sub-optimal arms as characterized in the derivation of the regret lower bound. We illustrate the efficiency of OSSB using numerical experiments in the case of the linear bandit problem and show that OSSB outperforms existing algorithms, including Thompson sampling. 1 Introduction Numerous extensions of the classical stochastic MAB problem [30] have been recently investigated. These extensions are motivated by applications arising in various fields including e.g. on-line services (search engines, display ads, recommendation systems, ...), and most often concern structural properties of the mapping of arms to their average rewards. This mapping can for instance be linear [14], convex [2], unimodal [36], Lipschitz [3], or may exhibit some combinatorial structure [10, 29, 35]. In their seminal paper, Lai and Robbins [30] develop a comprehensive theory for MAB problems with unrelated arms, i.e., without structure. They derive asymptotic (as the time horizon grows large) instance-specific regret lower bounds and propose algorithms achieving this minimal regret. These algorithms have then been considerably simplified, so that today, we have a few elementary indexbased1 and yet asymptotically optimal algorithms [18, 26]. Developing a similar comprehensive theory for MAB problems with structure is considerably more challenging. Due to the structure, the rewards observed for a given arm actually provide side-information about the average rewards of other arms2. This side-information should be exploited so as to accelerate as much as possible the process of learning the average rewards. Very recently, instance-specific regret lower bounds and asymptotically optimal algorithms could be derived only for a few MAB problems with finite set of arms and specific structures, namely linear [31], Lipschitz [32] and unimodal [12]. In this paper, we investigate a large class of structured MAB problems. This class extends the classical stochastic MAB problem [30] in two directions: (i) it allows for any arbitrary structure; (ii) it allows different kinds of feedback. More precisely, our generic MAB problem is as follows. 1An algorithm is index-based if the arm selection in each round is solely made comparing the indexes of each arm, and where the index of an arm only depends on the rewards observed for this arm. 2Index-based algorithms cannot be optimal in MAB problems with structure. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. In each round, the decision maker selects an arm from a finite set X. Each arm x ∈X has an unknown parameter θ(x) ∈R, and when this arm is chosen in round t, the decision maker observes a real-valued random variable Y (x, t) with expectation θ(x) and distribution ν(θ(x)). The observations (Y (x, t))x∈X,t≥1 are independent across arms and rounds. If x is chosen, she also receives an unobserved and deterministic3 reward µ(x, θ), where θ = (θ(x))x∈X . The parameter θ lies in a compact set Θ that encodes the structural properties of the problem. The set Θ, the class of distributions ν, and the mapping (x, θ) 7→µ(x, θ) encode the structure of the problem, are known to the decision maker, whereas θ is initially unknown. We denote by xπ(t) the arm selected in round t under algorithm π; this selection is based on previously selected arms and the corresponding observations. Hence the set Π of all possible arm selection rules consists in algorithms π such that for any t ≥1, xπ(t) is Fπ t -measurable where Fπ t is the σ-algebra generated by (xπ(1), Y (xπ(1), 1), . . . , xπ(t−1), Y (xπ(t−1), t−1). The performance of an algorithm π ∈Π is defined through its regret up to round T: Rπ(T, θ) = T max x∈X µ(x, θ) − T X t=1 E(µ(x(t), θ)). The above MAB problem is very generic, as any kind of structure can be considered. In particular, our problem includes classical, linear, unimodal, dueling, and Lipschitz bandit problems as particular examples, see Section 3 for details. Our contributions in this paper are as follows: • We derive a tight instance-specific regret lower bound satisfied by any algorithm for our generic structured MAB problem. • We develop OSSB (Optimal Sampling for Structured Bandits), a simple and yet asymptotically optimal algorithm, i.e., its regret matches our lower bound. OSSB optimally exploits the structure of the problem so as to minimize regret. • We briefly exemplify the numerical performance of OSSB in the case of linear bandits. OSSB outperforms existing algorithms (including Thompson Sampling [2], GLM-UCB [16], and a recently proposed asymptotically optimal algorithm [31]). As noticed in [31], for structured bandits (even for linear bandits), no algorithm based on the principle of optimism (a la UCB) or on that of Thompson sampling can achieve an asymptotically minimal regret. The design of OSSB does not follow these principles, and is rather inspired by the derivation of the regret lower bound. To obtain this bound, we characterize the minimal rates at which sub-optimal arms have to be explored. OSSB aims at sampling sub-optimal arms so as to match these rates. The latter depends on the unknown parameter θ, and so OSSB needs to accurately estimate θ. OSSB hence alternates between three phases: exploitation (playing arms with high empirical rewards), exploration (playing sub-optimal arms at well chosen rates), and estimation (getting to know θ to tune these exploration rates). The main technical contribution of this paper is a finite-time regret analysis of OSSB for any generic structure. In spite of the simplicity the algorithm, its analysis is involved. Not surprisingly, it uses concentration-of-measure arguments, but it also requires to establish that the minimal exploration rates (derived in the regret lower bound) are essentially smooth with respect to the parameter θ. This complication arises due to the (additional) estimation phase of OSSB: the minimal exploration rates should converge as our estimate of θ gets more and more accurate. The remainder of the paper is organized as follows. In the next section, we survey recent results on structured stochastic bandits. In Section 3, we illustrate the versatility of our MAB problem by casting most existing structured bandit problems into our framework. Section 4 is devoted to the derivation of the regret lower bound. In Sections 5 and 6, we present OSSB and provide an upper bound of its regret. Finally Section 7 explores the numerical performance of OSSB in the case of linear structures. 3Usually in MAB problems, the reward is a random variable given as feedback to the decision maker. In our model, the reward is deterministic (as if it was averaged), but not observed as the only observation is Y (x, t) if x is chosen in round t. We will illustrate in Section 3 why usual MAB formulations are specific instances of our model. 2 2 Related work Structured bandits have generated many recent contributions since they find natural applications in the design of computer systems, for instance: recommender systems and information retrieval [28, 11], routing in networks and network optimization [22, 5, 17], and influence maximization in social networks [8]. A large number of existing structures have been investigated, including: linear [14, 34, 1, 31, 27] (linear bandits are treated here as a partial monitoring game), combinatorial [9, 10, 29, 35, 13], Lipschitz [32], unimodal [36, 12]. The results in this paper cover all models considered in the above body of work and are the first that can be applied to problems with any structure in the set of allowed parameters. Here, we focus on generic stochastic bandits with a finite but potentially large number of arms. Both continuous as well as adversarial versions of the problem have been investigated, see survey [6]. The performance of Thompson sampling for generic bandit problems has appeared in the literature [15, 20], however, the recent results in [31] prove that Thompson sampling is not optimal for all structured bandits. Generic structured bandits were treated in [7, 21]. The authors show that the regret of any algorithm must scale as C(θ)ln T when T →∞where C(θ) is the optimal value of a semi-infinite linear program, and propose asymptotically optimal algorithms. However the proposed algorithms are involved and have poor numerical performance, furthermore their performance guarantees are asymptotic, and no finite time analysis is available. To our knowledge, our algorithm is the first which covers completely generic MAB problems, is asymptotically optimal and is amenable to a finite-time regret analysis. Our algorithm is in the same spirit as the DMED algorithm, presented in [24], as well as the algorithm in [31], but is generic enough to be optimal in any structured bandit setting. Similar to DMED, our algorithm relies on repeatedly solving an optimization problem and then exploring according to its solution, thus moving away from the UCB family of algorithms. 3 Examples The class of MAB problems described in the introduction covers most known bandit problems as illustrated in the six following examples. Classical Bandits. The classical MAB problem [33] with Bernoulli rewards is obtained by making the following choices: θ(x) ∈[0, 1]; Θ = [0, 1]|X|; for any a ∈[0, 1], ν(a) is the Bernoulli distribution with mean a; for all x ∈X, µ(x, θ) = θ(x). Linear Bandits. To get finite linear bandit problems [14],[31], in our framework we choose X as a finite subset of Rd; we pick an unknown vector φ ∈Rd and define θ(x) = ⟨φ, x⟩for all x ∈X; the set of possible parameters is Θ = {θ = (⟨φ, x⟩)x∈X , φ ∈Rd}; for any a ∈Rd, ν(a) is a Gaussian distribution with unit variance and centered at a; for all x ∈X, µ(x, θ) = θ(x). Observe that our framework also includes generalized linear bandit problems as those considered in [16]: we just need to define µ(x, θ) = g(θ(x)) for some function g. Dueling Bandits. To model dueling bandits [27] using our framework, the set of arms is X = {(i, j) ∈{1, . . . , d}2}; for any x = (i, j) ∈X, θ(x) ∈[0, 1] denotes the probability that i is better than j with the conventions that θ(i, j) = 1 −θ(j, i) and that θ(i, i) = 1/2; Θ = {θ : ∃i⋆: θ(i⋆, j) > 1/2, ∀j ̸= i⋆} is the set of parameters such there exists a Condorcet winner; for any a ∈[0, 1], ν(a) is the Bernoulli distribution with mean a; finally, we define the rewards as µ((i, j), θ) = 1 2(θ(i⋆, i) + θ(i⋆, j) −1). Note that the best arm is (i⋆, i⋆) and has zero reward. Lipschitz Bandits. For finite Lipschitz bandits [32], the set of arms X is a finite subset of a metric space endowed with a distance ℓ. For any x ∈X, θ(x) is a scalar, and the mapping x 7→θ(x) is Lipschitz continuous with respect to ℓ, and the set of parameters is: Θ = {θ : |θ(x) −θ(y)| ≤ℓ(x, y) ∀x, y ∈X}. As in classical bandits µ(x, θ(x)) = θ(x). The structure is encoded by the distance ℓ, and is an example of local structure so that arms close to each other have similar rewards. Unimodal Bandits. Unimodal bandits [23],[12] are obtained as follows. X = {1, ..., |X|}, θ(x) is a scalar, and µ(x, θ(x)) = θ(x). The added assumption is that x 7→θ(x) is unimodal. Namely, there 3 exists x⋆∈X such that this mapping is stricly incrasing on {1, ..., x⋆} and strictly decreasing on {x⋆, ..., |X|}. Combinatorial bandits. The combinatorial bandit problems with bandit feedback (see [9]) are just particular instances of linear bandits where the set of arms X is a subset of {0, 1}d. Now to model combinatorial problems with semi-bandit feedback, we need a slight extension of the framework described in introduction. More precisely, the set of arms is still a subset of {0, 1}d. The observation Y (x, t) is a d-dimensional r.v. with independent components, with mean θ(x) and distribution ν(θ(x)) (a product distribution). There is an unknown vector φ ∈Rd such that θ(x) = (φ(1)x(1), . . . , φ(d)x(d)), and µ(x, θ) = Pd i=1 φ(i)x(i) (linear reward). With semi-bandit feedback, the decision maker gets detailed information about the various components of the selected arm. 4 Regret Lower Bound To derive regret lower bounds, a strategy consists in restricting the attention to so-called uniformly good algorithms [30]: π ∈Π is uniformly good if Rπ(T, θ) = o(T a) when T →∞for all a > 0 and all θ ∈Θ. A simple change-of-measure argument is then enough to prove that for MAB problems without structure, under any uniformly good algorithm, the number of times that a sub-optimal arm x should be played is greater than ln T/d(θ(x), θ(x⋆)) as the time horizon T grows large, and where x⋆denotes the optimal arm and d(θ(x), θ(x⋆)) is the Kullback-Leibler divergence between the distributions ν(θ(x)) and ν(θ(x⋆)). Refer to [25] for a direct and elegant proof. For our structured MAB problems, we follow the same strategy, and derive constraints on the number of times a sub-optimal arm x is played under any uniformly good algorithm. We show that this number is greater than c(x, θ)ln T asymptotically where the c(x, θ)’s are the solutions of a semi-infinite linear program [19] whose constraints directly depend on the structure of the problem. Before stating our lower bound, we introduce the following notations. For θ ∈Θ, let x⋆(θ) be the optimal arm (we assume that it is unique), and define µ⋆(θ) = µ(x⋆(θ), θ). For any x ∈X, we denote by D(θ, λ, x) the Kullback-Leibler divergence between distributions ν(θ(x)) and ν(λ(x)). Assumption 1 The optimal arm x⋆(θ) is unique. Theorem 1 Let π ∈Π be a uniformly good algorithm. For any θ ∈Θ, we have: lim inf T →∞ Rπ(T, θ) ln T ≥C(θ), (1) where C(θ) is the value of the optimization problem: minimize η(x)≥0 , x∈X X x∈X η(x)(µ⋆(θ) −µ(x, θ)) (2) subject to X x∈X η(x)D(θ, λ, x) ≥1 , ∀λ ∈Λ(θ), (3) where Λ(θ) = {λ ∈Θ : D(θ, λ, x⋆(θ)) = 0, x⋆(θ) ̸= x⋆(λ)}. (4) Let (c(x, θ))x∈X denote the solutions of the semi-infinite linear program (2)-(3). In this program, η(x)ln T indicates the number of times arm x is played. The regret lower bound may be understood as follows. The set Λ(θ) is the set of “confusing” parameters: if λ ∈Λ(θ) then D(θ, λ, x⋆(θ)) = 0 so λ and θ cannot be differentiated by only sampling the optimal arm x⋆(θ). Hence distinguishing θ from λ requires to sample suboptimal arms x ̸= x⋆(θ). Further, since any uniformly good algorithm must identify the best arm with high probability to ensure low regret and x⋆(θ) ̸= x⋆(λ), any algorithm must distinguish these two parameters. The constraint (3) states that for any λ, a uniformly good algorithm should perform a hypothesis test between θ and λ, and P x∈X η(x)D(θ, λ, x) ≥1 is required to ensure there is enough statistical information to perform this test. In summary, for a sub-optimal arm x, c(x, θ)lnT represents the asymptotically minimal number of times x should be sampled. It is noted that this lower bound is instance-specific (it depends on θ), and is attainable as we propose an algorithm which attains it. The proof of Theorem 1 is presented in appendix, and leverages techniques used in the context of controlled Markov chains [21]. 4 Next, we show that with usual structures as those considered in Section 3, the semi-infinite linear program (2)-(3) reduces to simpler optimization problems (e.g. an LP) and can sometimes even be solved explicitly. Simplifying (2)-(3) is important for us, since our proposed asymptotically optimal algorithm requires to solve this program. In the following examples, please refer to Section 3 for the definitions and notations. As mentioned already, the solutions of (2)-(3) for classical MAB is c(x, θ) = 1/d(θ(x), θ(x⋆)). Linear bandits. For this class of problems, [31] recently proved that (2)-(3) was equivalent to the following optimization problem: minimize η(x)≥0 , x∈X X x∈X η(x)(θ(x⋆) −θ(x)) subject to x⊤inv X z∈X η(z)zz⊤ ! x ≤(θ(x⋆) −θ(x))2 2 , ∀x ̸= x⋆. Refer to [31] for the proof of this result, and for insightful discussions. Lipschitz bandits. It can be shown that for Bernoulli rewards (the reward of arm x is θ(x)) (2)-(3) reduces to the following LP [32]: minimize η(x)≥0 , x∈X X x∈X η(x)(θ(x⋆) −θ(x)) subject to X z∈X η(z)d(θ(z), max{θ(z), θ(x⋆) −ℓ(x, z)}) ≥1 , ∀x ̸= x⋆. While the solution is not explicit, the problem reduces to a LP with |X| variables and 2|X| constraints. Dueling bandits. The solution of (2)-(3) is as follows [27]. Assume to simplify that for any i ̸= i⋆, there exists a unique j minimizing µ((i,j),θ) d(θ(i,j),1/2) and such that θ(i, j) < 1/2. Let j(i) denote this index. Then for any x = (i, j), we have c(x, θ) = 1{j = j(i)} d(θ(i, j), 1/2). Unimodal bandits. For such problems, it is shown in [12] that the solution of (2)-(3) is given by: for all x ∈X, c(x, θ) = 1{|x −x⋆| = 1} d(θ(x), θ(x⋆)) . Hence, in unimodal bandits, under an asymptotically optimal algorithm, the sub-optimal arms contributing to the regret (i.e., those that need to be sampled Ω(ln T)) are neighbours of the optimal arm. 5 The OSSB Algorithm In this section we propose OSSB (Optimal Sampling for Structured Bandits), an algorithm that is asymptotically optimal, i.e., its regret matches the lower bound of Theorem 1. OSSB pseudo-code is presented in Algorithm 1, and takes as an input two parameters ε, γ > 0 that control the amount of exploration performed by the algorithm. The design of OSSB is guided by the necessity to explore suboptimal arms as much as prescribed by the solution of the optimization problem (2)-(3), i.e., the sub-optimal arm x should be explored c(x, θ)ln T times. If θ was known, then sampling arm x c(x, θ)ln T times for all x, and then selecting the arm with the largest estimated reward should yield minimal regret. Since θ is unknown, we have to estimate it. Define the empirical averages: m(x, t) = Pt s=1 Y (x, s)1{x(s) = x} max(1, N(x, t)) 5 Algorithm 1 OSSB(ε,γ) s(0) ←0, N(x, 1), m(x, 1) ←0 , ∀x ∈X {Initialization} for t = 1, ..., T do Compute the optimization problem (2)-(3) solution (c(x, m(t)))x∈X where m(t) = (m(x, t))x∈X if N(x, t) ≥c(x, m(t))(1 + γ)ln t, ∀x then s(t) ←s(t −1) x(t) ←x⋆(m(t)) {Exploitation} else s(t) ←s(t −1) + 1 X(t) ←arg minx∈X N(x,t) c(x,m(t)) X(t) ←arg minx∈X N(x, t) if N(X(t), t) ≤εs(t) then x(t) ←X(t) {Estimation} else x(t) ←X(t) {Exploration} end if end if {Update statistics} Select arm x(t) and observe Y (x(t), t) m(x, t + 1) ←m(x, t), ∀x ̸= x(t) , N(x, t + 1) ←N(x, t), ∀x ̸= x(t) m(x(t), t + 1) ←Y (x(t),t)+m(x(t),t)N(x(t),t) N(x(t),t)+1 N(x(t), t + 1) ←N(x(t), t) + 1 end for where x(s) is the arm selected in round s, and N(x, t) = Pt s=1 1{x(s) = x} is the number of times x has been selected up to round t. The key idea of OSSB is to use m(t) = (m(x, t))x∈X as an estimator for θ, and explore arms to match the estimated solution of the optimization problem (2)-(3), so that N(x, t) ≈c(x, m(t))ln t for all x. This should work if we can ensure certainty equivalence, i.e. m(t) →θ(t) when t →∞at a sufficiently fast rate. The OSSB algorithm has three components. More precisely, under OSSB, we alternate between three phases: exploitation, estimation and exploration. In round t, one first attempts to identify the optimal arm. We calculate x⋆(m(x, t)) the arm with the largest empirical reward. If N(x, t) ≥ c(x, m(t))(1 + γ)ln t for all x, we enter the exploitation phase: we have enough information to infer that x⋆(m(x, t)) = x⋆(θ) w.h.p. and we select x(t) = x⋆(m(x, t)). Otherwise, we need to gather more information to identify the optimal arm. We have two goals: (i) make sure that all components of θ are accurately estimated and (ii) make sure that N(x, t) ≈c(x, m(t))ln t for all x. We maintain a counter s(t) of the number of times we have not entered the expoitation phase. We choose between two possible arms, namely the least played arm X(t) and the arm X(t) which is the farthest from satisfying N(x, t) ≥c(x, m(t))ln t. We then consider the number of times X(t) has been selected. If N(X(t), t) is much smaller than s(t), there is a possibility that X(t) has not been selected enough times so that θ(X(t)) is not accurately estimated so we enter the estimation phase, where we select X(t) to ensure that certainty equivalence holds. Otherwise we enter the exploration phase where we select X(t) to explore as dictated by the solution of (2)-(3), since c(x, m(t)) should be close to c(x, θ). Theorem 2 states that OSSB is asymptotically optimal. The complete proof is presented in Appendix, with a sketch of the proof provided in the next section. We prove Theorem 2 for Bernoulli or Subgaussian observations, but the analysis is easily extended to rewards in a 1-parameter exponential family of distributions. While we state an asymptotic result here, we actually perform a finite time analysis of OSSB, and a finite time regret upper bound for OSSB is displayed at the end of next section. Assumption 2 (Bernoulli observations) θ(x) ∈[0, 1] and ν(θ(x)) =Ber(θ(x)) for all x ∈X. Assumption 3 (Gaussian observations) θ(x) ∈R and ν(θ(x)) = N(θ(x), 1) for all x ∈X. 6 Assumption 4 For all x, the mapping (θ, λ) 7→D(x, θ, λ) is continuous at all points where it is not infinite. Assumption 5 For all x, the mapping θ →µ(x, θ) is continuous. Assumption 6 The solution to problem (2)-(3) is unique. Theorem 2 If Assumptions 1, 4, 5 and 6 hold and either Assumption 2 or 3 holds, then under the algorithm π =OSSB(ε, γ) with ε < 1 |X| we have: lim sup T →∞ Rπ(T) ln T ≤C(θ)F(ε, γ, θ), with F a function such that for all θ, we have F(ε, γ, θ) →1 as ε →0 and γ →0. We conclude this section by a remark on the computational complexity of the OSSB algorithm. OSSB requires to solve the optimization problem (2)-(3) in each round. The complexity of solving this problem strongly depends on the problem structure. For general structures, the complexity of this problem is difficult to assess. However for problems exemplified in Section 3, this problem is usually easy to solve. Note that the algorithm proposed in [31] for linear bandits requires to solve (2)-(3) only once, and is hence simpler to implement; its performance however is much worse in practice than that of OSSB as illustrated in Section 7. 6 Finite Time Analysis of OSSB The proof of Theorem 2 is presented in Appendix in detail, and is articulated in four steps. (i) We first notice that the probability of selecting a suboptimal arm during the exploitation phase at some round t is upper bounded by P(P x∈X N(x, t)D(m(t), θ, x) ≥(1 + γ)ln t). Using a concentration inequality on KL-divergences (Lemma 1 in Appendix), we show that this probability is small and the regret caused by the exploitation phase is upper bounded by G(γ, |X|) where G is finite and depends solely on γ and |X|. (ii) The second step, which is the most involved, is to show Lemma 1 stating the solutions of (2)-(3) are continuous. The main difficulty is that the set Λ(θ) is not finite, so that the optimization problem (2)-(3) is not a linear program. The proof strategy is similar to that used to prove Berge’s maximal theorem, the additional difficulty being that the feasible set is not compact, so that Berge’s theorem cannot be applied directly. Using Assumptions 1 and 5, both the value θ 7→C(θ) and the solution θ 7→c(θ) are continuous. Lemma 1 The optimal value of (2)-(3), θ 7→C(θ) is continuous. If (2)-(3) admits a unique solution c(θ) = (c(x, θ))x∈X at θ, then θ 7→c(θ) is continuous at θ. Lemma 1 is in fact interesting in its own right, since optimization problems such as (2)-(3) occur in all bandit problems. (iii) The third step is to upper bound the number of times the solution to (2)-(3) is not well estimated, so that C(m(t)) ≥(1 + κ)C(θ) for some κ > 0. From the previous step this implies that ||m(t) −θ||∞≥δ(κ) for some well-chosen δ(κ) > 0. Using a deviation result (Lemma 2 in Appendix), we show that the expected regret caused by such events is finite and upper bounded by 2|X| εδ2(κ). (vi) Finally a counting argument ensures that the regret incurred when C(θ) ≤C(m(t)) ≤(1 + κ)C(θ) i.e. the solution (2)-(3) is well estimated is upper bounded by (C(θ)(1 + κ) + 2εψ(θ))ln T, where ψ(θ) = |X|||c(θ)||∞ P x∈X (µ⋆(θ) −µ(x, θ)). Putting everything together we obtain the finite-time regret upper bound: Rπ(T) ≤µ⋆(θ)  G(γ, |X|) + 2|X| εδ2(κ)  + (C(θ)(1 + κ) + 2εψ(θ))(1 + γ)ln T. This implies that: lim sup T →∞ Rπ(T) ln T ≤(C(θ)(1 + κ) + 2εψ(θ))(1 + γ). The above holds for all κ > 0, which yields the result. 7 7 Numerical Experiments To assess the efficiency of OSSB, we compare its performance for reasonable time horizons to the state of the art algorithms for linear bandit problems. We considered a linear bandit with Gaussian rewards of unit variance, 81 arms of unit length, d = 3 and 10 parameters θ in [0.2, 0.4]3, generated uniformly at random. In our implementation of OSSB, we use γ = ε = 0 since γ is typically chosen 0 in the literature (see [18]) and the performance of the algorithm does not appear sensitive to the choice of ε. As baselines we select the extension of Thompson Sampling presented in [4](using vt = R p 0.5dln(t/δ), we chose δ = 0.1, R = 1), GLM-UCB (using ρ(t) = p 0.5ln(t)), an extension of UCB [16] and the algorithm presented in [31]. Figure 1 presents the regret of the various algorithms averaged over the 10 parameters. OSSB clearly exhibits the best performance in terms of average regret. 0e+00 2e+04 4e+04 6e+04 8e+04 1e+05 0 1000 2000 3000 4000 5000 Time Average Regret Thompson Sampling (Agrawal et al.) GLM−UCB (Filippi et al.) OSSB Lattimore et al. Figure 1: Regret of various algorithms in the linear bandit setting with 81 arms and d = 3. Regret is averaged over 10 randomly generated parameters and 100 trials. Colored regions represent the 95% confidence intervals. 8 Conclusion In this paper, we develop a unified solution to a wide class of stochastic structured bandit problems. For the first time, we derive, for these problems, an asymptotic regret lower bound and devise OSSB, a simple and yet asymptotically optimal algorithm. The implementation of OSSB requires that we solve the optimization problem defining the minimal exploration rates of the sub-optimal arms. In the most general case, this problem is a semi-infinite linear program, which can be hard to solve in reasonable time. Studying the complexity of this semi-infinite LP depending on the structural properties of the reward function is an interesting research direction. Indeed any asymptotically optimal algorithm needs to learn the minimal exploration rates of sub-optimal arms, and hence needs to solve this semi-infinite LP. Characterizing the complexity of the latter would thus yield important insights into the trade-off between the complexity of the sequential arm selection algorithms and their regret. Acknowledgments A. Proutiere’s research is supported by the ERC FSA (308267) grant. This work is supported by the French Agence Nationale de la Recherche (ANR), under grant ANR-16-CE40-0002 (project BADASS). 8 References [1] Y. Abbasi-Yadkori, D. Pal, and C. Szepesvari. Improved algorithms for linear stochastic bandits. In NIPS, 2011. [2] A. Agarwal, D. P. Foster, D. J. Hsu, S. M. Kakade, and A. Rakhlin. Stochastic convex optimization with bandit feedback. In NIPS, pages 1035–1043, 2011. [3] R. Agrawal. The continuum-armed bandit problem. SIAM J. Control Optim., 33(6):1926–1951, 1995. [4] S. Agrawal and N. Goyal. Thompson sampling for contextual bandits with linear payoffs. In ICML, 2013. [5] B. Awerbuch and R. Kleinberg. Online linear optimization and adaptive routing. J. Comput. Syst. Sci., 74(1):97–114, 2008. [6] S. Bubeck and N. Cesa-Bianchi. Regret analysis of stochastic and nonstochastic multi-armed bandit problems. Foundations and Trends in Machine Learning, 5(1):1–122, 2012. [7] A. Burnetas and M. Katehakis. Optimal adaptive policies for sequential allocation problems. Advances in Applied Mathematics, 17(2):122–142, 1996. [8] A. Carpentier and M. Valko. Revealing graph bandits for maximizing local influence. In AISTATS, 2016. [9] N. Cesa-Bianchi and G. Lugosi. Combinatorial bandits. J. Comput. Syst. Sci., 78(5):1404–1422, 2012. [10] W. Chen, Y. Wang, and Y. Yuan. Combinatorial multi-armed bandit: General framework and applications. In ICML, 2013. [11] R. Combes, S. Magureanu, A. Proutiere, and C. Laroche. Learning to rank: Regret lower bound and efficient algorithms. In SIGMETRICS, 2015. [12] R. Combes and A. Proutiere. Unimodal bandits: Regret lower bounds and optimal algorithms. In ICML, 2014. [13] R. Combes, S. Talebi, A. Proutiere, and M. Lelarge. Combinatorial bandits revisited. In NIPS, 2015. [14] V. Dani, T. Hayes, and S. Kakade. Stochastic linear optimization under bandit feedback. In COLT, 2008. [15] A. Durand and C. Gagné. Thompson sampling for combinatorial bandits and its application to online feature selection. In Workshops at the Twenty-Eighth AAAI Conference on Artificial Intelligence, 2014. [16] S. Filippi, O. Cappe, A. Garivier, and C. Szepesvári. Parametric bandits: The generalized linear case. In NIPS, pages 586–594, 2010. [17] Y. Gai, B. Krishnamachari, and R. Jain. Combinatorial network optimization with unknown variables: Multi-armed bandits with linear rewards and individual observations. IEEE/ACM Trans. on Networking, 20(5):1466–1478, 2012. [18] A. Garivier and O. Cappé. The KL-UCB algorithm for bounded stochastic bandits and beyond. In COLT, 2011. [19] K. Glashoff and S.-A. Gustafson. Linear Optimization and Approximation. Springer Verlag, Berlin, 1983. [20] A. Gopalan, S. Mannor, and Y. Mansour. Thompson sampling for complex online problems. In ICML, 2014. [21] T. L. Graves and T. L. Lai. Asymptotically efficient adaptive choice of control laws in controlled markov chains. SIAM J. Control and Optimization, 35(3):715–743, 1997. [22] A. György, T. Linder, G. Lugosi, and G. Ottucsák. The on-line shortest path problem under partial monitoring. Journal of Machine Learning Research, 8(10), 2007. [23] U. Herkenrath. The n-armed bandit with unimodal structure. Metrika, 30(1):195–210, 1983. [24] J. Honda and A. Takemura. An asymptotically optimal bandit algorithm for bounded support models. In COLT, 2010. [25] E. Kaufmann, O. Cappé, and A. Garivier. On the complexity of best-arm identification in multi-armed bandit models. Journal of Machine Learning Research, 17(1):1–42, 2016. [26] E. Kaufmann, N. Korda, and R. Munos. Thompson sampling: An asymptotically optimal finite-time analysis. In ALT, 2012. [27] J. Komiyama, J. Honda, H. Kashima, and H. Nakagawa. Regret lower bound and optimal algorithm in dueling bandit problem. In COLT, 2015. [28] B. Kveton, Z. Wen, A. Ashkan, and C. Szepesvari. Cascading bandits: Learning to rank in the cascade model. In NIPS, 2015. [29] B. Kveton, Z. Wen, A. Ashkan, and C. Szepesvari. Tight regret bounds for stochastic combinatorial semi-bandits. In AISTATS, 2015. [30] T. L. Lai and H. Robbins. Asymptotically efficient adaptive allocation rules. Advances in Applied Mathematics, 6(1):4–22, 1985. [31] T. Lattimore and C. Szepesvari. The end of optimism? an asymptotic analysis of finite-armed linear bandits. AISTATS, 2016. [32] S. Magureanu, R. Combes, and A. Proutiere. Lipschitz bandits: Regret lower bounds and optimal algorithms. COLT, 2014. [33] H. Robbins. Some aspects of the sequential design of experiments. In Herbert Robbins Selected Papers, pages 169–177. Springer, 1985. [34] P. Rusmevichientong and J. Tsitsiklis. Linearly parameterized bandits. Math. Oper. Res., 35(2), 2010. [35] Z. Wen, A. Ashkan, H. Eydgahi, and B. Kveton. Efficient learning in large-scale combinatorial semi-bandits. In ICML, 2015. [36] J. Yu and S. Mannor. Unimodal bandits. In ICML, 2011. 9
2017
590
7,108
Learning Efficient Object Detection Models with Knowledge Distillation Guobin Chen1,2 Wongun Choi1 Xiang Yu1 Tony Han2 Manmohan Chandraker1,3 1NEC Labs America 2University of Missouri 3University of California, San Diego Abstract Despite significant accuracy improvement in convolutional neural networks (CNN) based object detectors, they often require prohibitive runtimes to process an image for real-time applications. State-of-the-art models often use very deep networks with a large number of floating point operations. Efforts such as model compression learn compact models with fewer number of parameters, but with much reduced accuracy. In this work, we propose a new framework to learn compact and fast object detection networks with improved accuracy using knowledge distillation [20] and hint learning [34]. Although knowledge distillation has demonstrated excellent improvements for simpler classification setups, the complexity of detection poses new challenges in the form of regression, region proposals and less voluminous labels. We address this through several innovations such as a weighted cross-entropy loss to address class imbalance, a teacher bounded loss to handle the regression component and adaptation layers to better learn from intermediate teacher distributions. We conduct comprehensive empirical evaluation with different distillation configurations over multiple datasets including PASCAL, KITTI, ILSVRC and MS-COCO. Our results show consistent improvement in accuracy-speed trade-offs for modern multi-class detection models. 1 Introduction Recent years have seen tremendous increase in the accuracy of object detection, relying on deep convolutional neural networks (CNNs). This has made visual object detection an attractive possibility for domains ranging from surveillance to autonomous driving. However, speed is a key requirement in many applications, which fundamentally contends with demands on accuracy. Thus, while advances in object detection have relied on increasingly deeper architectures, they are associated with an increase in computational expense at runtime. But it is also known that deep neural networks are over-parameterized to aid generalization. Thus, to achieve faster speeds, some prior works explore new structures such as fully convolutional networks, or lightweight models with fewer channels and small filters [22,25]. While impressive speedups are obtained, they are still far from real-time, with careful redesign and tuning necessary for further improvements. Deeper networks tend to have better performance under proper training, since they have ample network capacity. Tasks such as object detection for a few categories might not necessarily need that model capacity. In that direction, several works in image classification use model compression, whereby weights in each layer are decomposed, followed by layer-wise reconstruction or fine-tuning to recover some of the accuracy [9, 26, 41, 42]. This results in significant speed-ups, but there is often a gap between the accuracies of original and compressed models, which is especially large when using compressed models for more complex problems such as object detection. On the other hand, seminal works on knowledge distillation show that a shallow or compressed model trained to mimic the behavior of a deeper or more complex model can recover some or all of the accuracy 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. drop [3,20,34]. However, those results are shown only for problems such as classification, using simpler networks without strong regularization such as dropout. Applying distillation techniques to multi-class object detection, in contrast to image classification, is challenging for several reasons. First, the performance of detection models suffers more degradation with compression, since detection labels are more expensive and thereby, usually less voluminous. Second, knowledge distillation is proposed for classification assuming each class is equally important, whereas that is not the case for detection where the background class is far more prevalent. Third, detection is a more complex task that combines elements of both classification and bounding box regression. Finally, an added challenge is that we focus on transferring knowledge within the same domain (images of the same dataset) with no additional data or labels, as opposed other works that might rely on data from other domains (such as high-quality and low-quality image domains, or image and depth domains). To address the above challenges, we propose a method to train fast models for object detection with knowledge distillation. Our contributions are four-fold: • We propose an end-to-end trainable framework for learning compact multi-class object detection models through knowledge distillation (Section 3.1). To the best of our knowledge, this is the first successful demonstration of knowledge distillation for the multi-class object detection problem. • We propose new losses that effectively address the aforementioned challenges. In particular, we propose a weighted cross entropy loss for classification that accounts for the imbalance in the impact of misclassification for background class as opposed to object classes (Section 3.2), a teacher bounded regression loss for knowledge distillation (Section 3.3) and adaptation layers for hint learning that allows the student to better learn from the distribution of neurons in intermediate layers of the teacher (Section 3.4). • We perform comprehensive empirical evaluation using multiple large-scale public benchmarks. Our study demonstrates the positive impact of each of the above novel design choices, resulting in significant improvement in object detection accuracy using compressed fast networks, consistently across all benchmarks (Sections 4.1 – 4.3). • We present insights into the behavior of our framework by relating it to the generalization and under-fitting problems (Section 4.4). 2 Related Works CNNs for Detection. Deformable Part Model (DPM) [14] was the dominant detection framework before the widespread use of Convolutional Neural Networks (CNNs). Following the success of CNNs in image classification [27], Girshick et al. proposed RCNN [24] that uses CNN features to replace handcrafted ones. Subsequently, many CNN based object detection methods have been proposed, such as Spatial Pyramid Pooling (SPP) [19], Fast R-CNN [13], Faster-RCNN [32] and R-FCN [29], that unify various steps in object detection into an end-to-end multi-category framework. Model Compression. CNNs are expensive in terms of computation and memory. Very deep networks with many convolutional layers are preferred for accuracy, while shallower networks are also widely used where efficiency is important. Model compression in deep networks is a viable approach to speed up runtime while preserving accuracy. Denil et al. [9] demonstrate that neural networks are often over-parametrized and removing redundancy is possible. Subsequently, various methods [5,7, 10,15,17,30] have been proposed to accelerate the fully connected layer. Several methods based on low-rank decomposition of the convolutional kernel tensor [10,23,28] are also proposed to speed up convolutional layers. To compress the whole network, Zhang et al. [41,42] present an algorithm using asymmetric decomposition and additional fine-tuning. In similar spirit, Kim et al. [26] propose one-shot whole network compression that achieves around 1.8 times improvement in runtime without significant drop in accuracy. We will use methods presented in [26] in our experiments. Besides, a pruning based approach has been proposed [18] but it is challenging to achieve runtime speed-up with a conventional GPU implementation. Additionally, both weights and input activations can be the quantized( [18]) and binarized ( [21,31]) to lower the computationally expensive. Knowledge Distillation. Knowledge distillation is another approach to retain accuracy with model compression. Bucila et al. [3] propose an algorithm to train a single neural network by mimicking the output of an ensemble of models. Ba and Caruana [2] adopt the idea of [3] to compress deep 2 Soft Label Detection Detection L2 Loss Teacher Hint Student Guided SoftMax & SmoothL1 Loss Hint Ground Truth Classification Regression Classification Regression Weighted Cross Entropy Loss Distillation Ground Truth Label Bounded Regression Loss Adaptation Back Propagation Figure 1: The proposed learning skeme on visual object detection task using Faster-RCNN, which mainly consists of region proposal network (RPN) and region classification network(RCN). The two networks both use multi-task loss to jointly learn the classifier and bounding-box regressor. We employ the final output of the teacher’s RPN and RCN as the distillation targets, and apply the intermediate layer outputs as hint. Red arrows indicate the backpropagation pathways. networks into shallower but wider ones, where the compressed model mimics the ‘logits’. Hinton et al. [20] propose knowledge distillation as a more general case of [3], which applies the prediction of the teacher model as a ‘soft label’, further proposing temperature cross entropy loss instead of L2 loss. Romero et al. [34] introduce a two-stage strategy to train deep networks. In their method, the teacher’s middle layer provides ‘hint’ to guide the training of the student model. Other researchers [16,38] explore distillation for transferring knowledge between different domains, such as high-quality and low-quality images, or RGB and depth images. In a draft manuscript concurrent with our work, Shen et al. [36] consider the effect of distillation and hint frameworks in learning a compact object detection model. However, they formulate the detection problem as a binary classification task applied to pedestrians, which might not scale well to the more general multi-category object detection setup. Unlike theirs, our method is designed for multi-category object detection. Further, while they use external region proposals, we demonstrate distillation and hint learning for both the region proposal and classification components of a modern end-to-end object detection framework [32]. 3 Method In this work, we adopt the Faster-RCNN [32] as the object detection framework. Faster-RCNN is composed of three modules: 1) A shared feature extraction through convolutional layers, 2) a region proposal network (RPN) that generates object proposals, and 3) a classification and regression network (RCN) that returns the detection score as well as a spatial adjustment vector for each object proposal. Both the RCN and RPN use the output of 1) as features, RCN also takes the result of RPN as input. In order to achieve highly accurate object detection results, it is critical to learn strong models for all the three components. 3.1 Overall Structure We learn strong but efficient student object detectors by using the knowledge of a high capacity teacher detection network for all the three components. Our overall learning framework is illustrated in Figure 1. First, we adopt the hint based learning [34] (Sec.3.4) that encourages the feature representation of a student network is similar to that of the teacher network. Second, we learn stronger classification modules in both RPN and RCN using the knowledge distillation framework [3,20]. In order to handle severe category imbalance issue in object detection, we apply weighted cross entropy loss for the distillation framework. Finally, we transfer the teacher’s regression output as a form of upper bound, that is, if the student’s regression output is better than that of teacher, no additional loss is applied. 3 Our overall learning objective can be written as follows: LRCN = 1 N X i LRCN cls + λ 1 N X j LRCN reg LRPN = 1 M X i LRPN cls + λ 1 M X j LRPN reg L = LRPN + LRCN + γLHint (1) where N is the batch-size for RCN and M for RPN. Here, Lcls denotes the classifier loss function that combines the hard softmax loss using the ground truth labels and the soft knowledge distillation loss [20] of (2). Further, Lreg is the bounding box regression loss that combines smoothed L1 loss [13] and our newly proposed teacher bounded L2 regression loss of (4). Finally, Lhint denotes the hint based loss function that encourages the student to mimic the teacher’s feature response, expressed as (6). In the above, λ and γ are hyper-parameters to control the balance between different losses. We fix them to be 1 and 0.5, respectively, throughout the experiments. 3.2 Knowledge Distillation for Classification with Imbalanced Classes Conventional use of knowledge distillation has been proposed for training classification networks, where predictions of a teacher network are used to guide the training of a student model. Suppose we have dataset {xi, yi}, i = 1, 2, ..., n where xi ∈I is the input image and yi ∈Y is its class label. Let t be the teacher model, with Pt = softmax( Zt T ) its prediction and Zt the final score output. Here, T is a temperature parameter (normally set to 1). Similarly, one can define Ps = softmax( Zs T ) for the student network s. The student s is trained to optimize the following loss function: Lcls = µLhard(Ps, y) + (1 −µ)Lsoft(Ps, Pt) (2) where Lhard is the hard loss using ground truth labels used by Faster-RCNN, Lsoft is the soft loss using teacher’s prediction and µ is the parameter to balance the hard and soft losses. It is known that a deep teacher can better fit to the training data and perform better in test scenarios. The soft labels contain information about the relationship between different classes as discovered by teacher. By learning from soft labels, the student network inherits such hidden information. In [20], both hard and soft losses are the cross entropy losses. But unlike simpler classification problems, the detection problem needs to deal with a severe imbalance across different categories, that is, the background dominates. In image classification, the only possible errors are misclassifications between ‘foreground’ categories. In object detection, however, failing to discriminate between background and foreground can dominate the error, while the frequency of having misclassification between foreground categories is relatively rare. To address this, we adopt class-weighted cross entropy as the distillation loss: Lsoft(Ps, Pt) = − X wcPt log Ps (3) where we use a larger weight for the background class and a relatively small weight for other classes. For example, we use w0 = 1.5 for the background class and wi = 1 for all the others in experiments on the PASCAL dataset. When Pt is very similar to the hard label, with probability for one class very close to 1 and most others very close to 0, the temperature parameter T is introduced to soften the output. Using higher temperature will force t to produce softer labels so that the classes with near-zero probabilities will not be ignored by the cost function. This is especially pertinent to simpler tasks, such as classification on small datasets like MNIST. But for harder problems where the prediction error is already high, a larger value of T introduces more noise which is detrimental to learning. Thus, lower values of T are used in [20] for classification on larger datasets. For even harder problems such as object detection, we find using no temperature parameter at all (equivalent to T = 1) in the distillation loss works the best in practice (see supplementary material for an empirical study). 3.3 Knowledge Distillation for Regression with Teacher Bounds In addition to the classification layer, most modern CNN based object detectors [26,29,32,33] also use bounding-box regression to adjust the location and size of the input proposals. Often, learning a 4 good regression model is critical to ensure good object detection accuracy [13]. Unlike distillation for discrete categories, the teacher’s regression outputs can provide very wrong guidance toward the student model, since the real valued regression outputs are unbounded. In addition, the teacher may provide regression direction that is contradictory to the ground truth direction. Thus, instead of using the teacher’s regression output directly as a target, we exploit it as an upper bound for the student to achieve. The student’s regression vector should be as close to the ground truth label as possible in general, but once the quality of the student surpasses that of the teacher with a certain margin, we do not provide additional loss for the student. We call this the teacher bounded regression loss, Lb, which is used to formulate the regression loss, Lreg, as follows: Lb(Rs, Rt, y) = ∥Rs −y∥2 2 , if ∥Rs −y∥2 2 + m > ∥Rt −y∥2 2 0, otherwise Lreg = LsL1(Rs, yreg) + νLb(Rs, Rt, yreg), (4) where m is a margin, yreg denotes the regression ground truth label, Rs is the regression output of the student network, Rt is the prediction of teacher network and ν is a weight parameter (set as 0.5 in our experiments). Here, LsL1 is the smooth L1 loss as in [13]. The teacher bounded regression loss Lb only penalizes the network when the error of the student is larger than that of the teacher. Note that although we use L2 loss inside Lb, any other regression loss such as L1 and smoothed L1 can be combined with Lb. Our combined loss encourages the student to be close to or better than teacher in terms of regression, but does not push the student too much once it reaches the teacher’s performance. 3.4 Hint Learning with Feature Adaptation Distillation transfers knowledge using only the final output. In [34], Romero et al. demonstrate that using the intermediate representation of the teacher as hint can help the training process and improve the final performance of the student. They use the L2 distance between feature vectors V and Z: LHint(V, Z) = ∥V −Z∥2 2 (5) where Z represent the intermediate layer we selected as hint in the teacher network and V represent the output of the guided layer in the student network. We also evaluate the L1 loss: LHint(V, Z) = ∥V −Z∥1 (6) While applying hint learning, it is required that the number of neurons (channels, width and height) should be the same between corresponding layers in the teacher and student. In order to match the number of channels in the hint and guided layers, we add an adaptation after the guided layer whose output size is the same as the hint layer. The adaptation layer matches the scale of neuron to make the norm of feature in student close to teacher’s. A fully connected layer is used as adaptation layer when both hint and guided layers are also fully connected layers. When the hint and guided layers are convolutional layers, we use 1 × 1 convolutions to save memory. Interestingly, we find that having an adaptation layer is important to achieve effective knowledge transferring even when the number of channels in the hint and guided layers are the same (see Sec. 4.3). The adaptation layer can also match the difference when the norms of features in hint and guided layers are different. When the hint or guided layer is convolutional and the resolution of hint and guided layers differs (for examples, VGG16 and AlexNet), we follow the padding trick introduced in [16] to match the number of outputs. 4 Experiments In this section, we first introduce teacher and student CNN models and datasets that are used in the experiments. The overall results on various datasets are shown in Sec.4.1. We apply our methods to smaller networks and lower quality inputs in Sec.4.2. Sec.4.3 describes ablation studies for three different components, namely classification/regression, distillation and hint learning. Insights obtained for distillation and hint learning are discussed in Sec.4.4. We refer the readers to supplementary material for further details. Datasets We evaluate our method on several commonly used public detection datasets, namely, KITTI [12], PASCAL VOC 2007 [11], MS COCO [6] and ImageNet DET benchmark (ILSVRC 2014) [35]. Among them, KITTI and PASCAL are relatively small datasets that contain less object 5 Student Model Info Teacher PASCAL COCO@.5 COCO@[.5,.95] KITTI ILSVRC Tucker 11M / 47ms 54.7 25.4 11.8 49.3 20.6 AlexNet 57.6 (+2.9) 26.5 (+1.2) 12.3 (+0.5) 51.4 (+2.1) 23.6 (+1.3) VGGM 58.2 (+3.5) 26.4 (+1.1) 12.2 (+0.4) 51.4 (+2.1) 23.9 (+1.6) VGG16 59.4 (+4.7) 28.3 (+2.9) 12.6 (+0.8) 53.7 (+4.4) 24.4 (+2.1) AlexNet 62M / 74ms 57.2 32.5 15.8 55.1 27.3 VGGM 59.2 (+2.0) 33.4 (+0.9) 16.0 (+0.2) 56.3 (+1.2) 28.7 (+1.4) VGG16 60.1 (+2.9) 35.8 (+3.3) 16.9 (+1.1) 58.3 (+3.2) 30.1 (+2.8) VGGM 80M / 86ms 59.8 33.6 16.1 56.7 31.1 VGG16 63.7 (+3.9) 37.2 (+3.6) 17.3 (+1.2) 58.6 (+2.3) 34.0 (+2.9) VGG16 138M / 283ms 70.4 45.1 24.2 59.2 35.6 Table 1: Comparison of student models associated with different teacher models across four datasets, in terms of mean Average Precision (mAP). Rows with blank (-) teacher indicate the model is without distillation, serving as baselines. The second column reports the number of parameters and speed (per image, on GPU). categories and labeled images, whereas MS COCO and ILSVRC 2014 are large scale datasets. Since KITTI and ILSVRC 2014 do not provide ground-truth annotation for test sets, we use the training/validation split introduced by [39] and [24] for analysis. For all the datasets, we follow the PASCAL VOC convention to evaluate various models by reporting mean average precision (mAP) at IoU = 0.5 . For MS COCO dataset, besides the PASCAL VOC metric, we also report its own metric, which evaluates mAP averaged for IoU ∈[0.5 : 0.05 : 0.95] (denoted as mAP[.5, .95]). Models The teacher and student models defined in our experiments are standard CNN architectures, which consist of regular convolutional layers, fully connected layers, ReLU, dropout layers and softmax layers. We choose several popular CNN architectures as our teacher/student models, namely, AlexNet [27], AlexNet with Tucker Decomposition [26], VGG16 [37] and VGGM [4]. We use two different settings for the student and teacher pairs. In the first set of experiments, we use a smaller network (that is, less parameters) as the student and use a larger one for the teacher (for example, AlexNet as student and VGG16 as teacher). In the second set of experiments, we use smaller input image size for the student model and larger input image size for the teacher, while keeping the network architecture the same. 4.1 Overall Performance Table1 shows mAP for four student models on four object detection databases, with different architectures for teacher guidance. For student models without teacher’s supervision, we train them to the best numbers we could achieve. Not surprisingly, larger or deeper models with more parameters perform better than smaller or shallower models, while smaller models run faster than larger ones. The performance of student models improves significantly with distillation and hint learning over all different pairs and datasets, despite architectural differences between teacher and student. With a fixed scale (number of parameters) of a student model, training from scratch or fine-tuning on its own is not an optimal choice. Getting aid from a better teacher yields larger improvements approaching the teacher’s performance. A deeper model as teacher leads to better student performance, which suggests that the knowledge transferred from better teachers is more informative. Notice that the Tucker model trained with VGG16 achieves significantly higher accuracy than the Alexnet in the PASCAL dataset, even though the model size is about 5 times smaller. The observation may support the hypothesis that CNN based object detectors are highly over-parameterized. On the contrary, when the size of dataset is much larger, it becomes much harder to outperform more complicated models. This suggests that it is worth having even higher capacity models for such large scale datasets. Typically, when evaluating efficiency, we get 3 times faster from VGG16 as teacher to AlexNet as student on KITTI dataset. For more detailed runtimes, please refer to supplementary material. Further, similar to [38], we investigate another student-teacher mode: the student and teacher share exactly the same network structure, while the input for student is down-scaled and the input for teacher remains high resolution. Recent works [1] report that image resolution critically affects object detection performance. On the other hand, downsampling the input size quadratically reduces convolutional resources and speeds up computation. In Table 2, by scaling input sizes to half in 6 High-res teacher Low-res baseline Low-res distilled student mAP Speed mAP Speed mAP Speed AlexNet 57.2 1,205 / 74 ms 53.2 726 / 47 ms 56.7(+3.5) 726 / 47 ms Tucker 54.7 663 / 41 ms 48.6 430 / 29 ms 53.5(+4.9) 430 / 29 ms Table 2: Comparison of high-resolution teacher model (trained on images with 688 pixels) and low-resolution student model (trained on 344 pixels input), on PASCAL. We report mAP and speed (both CPU and GPU) of different models. The speed of low-resolution models are about 2 times faster than the corresponding high-resolution models, while achieving almost the same accuracy when our distillation method is used. FLOPS(%) 20 25 30 37.5 45 Finetune 30.3 49.3 51.4 54.7 55.2 Distillation 35.5(+5.2) 55.4(+6.1) 56.8(+5.4) 59.4(+4.7) 59.5(+4.3) Table 3: Compressed AlexNet performance evaluated on PASCAL. We compare the model fine-tuned with the ground truth and the model trained with our full method. We vary the compression ratio by FLOPS. PASCAL VOC dataset for the student and using the original resolution for the teacher, we get almost the same accuracy as the high-resolution teacher while being about two times faster1. 4.2 Speed-Accuracy Trade off in Compressed Models It is feasible to select CNN models from a wide range of candidates to strike a balance between speed and accuracy. However, off-the-shelf CNN models still may not meet one’s computational requirements. Designing new models is one option. But it often requires significant labor towards design and training. More importantly, trained models are often designed for specific tasks, but speed and accuracy trade-offs may change when facing a different task, whereby one may as well train a new model for the new task. In all such situations, distillation becomes an attractive option. To understand the speed-accuracy trade off in object detection with knowledge distillation, we vary the compression ratio (the ranks of weight matrices) of Alexnet with Tucker decomposition. We measure the compression ratio using FLOPS of the CNN. Experiments in Table 3 show that the accuracy drops dramatically when the network is compressed too much, for example, when compressed size is 20% of original, accuracy drops from 57.2% to only 30.3%. However, for the squeezed networks, our distillation framework is able to recover large amounts of the accuracy drop. For instance, for 37.5% compression, the original squeezed net only achieves 54.7%. In contrast, our proposed method lifts it up to 59.4% with a deep teacher (VGG16), which is even better than the uncompressed AlexNet model 57.2%. 4.3 Ablation Study As shown in Table 4, we compare different strategies for distillation and hint learning to highlight the effectiveness of our proposed novel losses. We choose VGG16 as the teacher model and Tucker as our student model for all the experiments in this section. Other choices reflect similar trends. Recall that proposal classification and bounding box regression are the two main tasks in the Faster-RCNN framework. Traditionally, classification is associated with cross entropy loss, denoted as CLS in Table 4, while bounding box regression is regularized with L2 loss, denoted as L2. To prevent the classes with small probability being ignored by the objective function, soft label with high temperature, also named weighted cross entropy loss, is proposed for the proposal classification task in Sec.3.2. We compare the weighted cross entropy loss defined in (3), denoted as CLS-W in Table 4, with the standard cross entropy loss (CLS), to achieve slightly better performance on both PASCAL and KITTI datasets. For bounding box regression, directly parroting to teacher’s output will suffer from labeling noise. An improvement is proposed through (4) in Sec.3.3, where the teacher’s prediction is used as a boundary to guide the student. Such strategy, denoted as L2-B in Table 4, improves over L2 by 1.3%. Note that a 1% improvement in object detection task is considered very significant, especially on large-scale datasets with voluminous number of images. 1Ideally, the convolutional layers should be about 4 times faster. However, due to the loading overhead and the non-proportional consumption from other layers, this speed up drops to around 2 times faster. 7 Baseline L2 L2-B CLS CLS-W Hints Hints-A L2-B+CLS-W L2-B+CLS-W+Hints-A PASCAL 54.7 54.6 55.9 57.4 57.7 56.9 58 58.4 59.4 KITTI 49.3 48.5 50.1 50.8 51.3 50.3 52.1 51.7 53.7 Table 4: The proposed method component comparison, i.e., bounded L2 for regression (L2-B, Sec.3.3) and weighted cross entropy for classification (CLS-W, Sec.3.2) with respect to traditional methods, namely, L2 and cross entropy (CLS). Hints learning w/o adaptation layer (Hints-A and Hints) are also compared. All comparisons take VGG16 as the teacher and Tucker as the student, with evaluations on PASCAL and KITTI. Baseline Distillation Hint Distillation + Hint PASCAL Trainval 79.6 78.3 80.9 83.5 Test 54.7 58.4 58 59.4 COCO Train 45.3 45.4 47.1 49.6 Val 25.4 26.1 27.8 28.3 Table 5: Performance of distillation and hint learning on different datasets with Tucker and VGG16 pair. Moreover, we find that the adaptation layer proposed in Sec.3.4 is critical for hint learning. Even if layers from teacher and student models have the same number of neurons, they are almost never in the same feature space. Otherwise, setting the student’s subsequent structure to be the same as teacher’s, the student would achieve identical results as the teacher. Thus, directly matching a student layer to a teacher layer [2,3] is unlikely to perform well. Instead, we propose to add an adaptation layer to transfer the student layer feature space to the corresponding teacher layer feature space. Thereby, penalizing the student feature from the teacher feature is better-defined since they lie in the same space, which is supported by the results in Table 4. With adaptation layer, hint learning (Hint-A) shows a 1.1% advantage over the traditional method (Hint). Our proposed overall method (L2-B+CLS-W+Hint-A) outperforms the one without adaptive hint learning (L2-B+CLS-W) by 1.0%, which again suggests the significant advantage of hint learning with adaptation. 4.4 Discussion In this section, we provide further insights into distillation and hint learning. Table 5 compares the accuracy of Tucker model learned with VGG16 on the trainval and testing split of the PASCAL and COCO datasets. In general, distillation mostly improves the generalization capability of student, while hint learning helps improving both the training and testing accuracy. Distillation improves generalization: Similarly to the image classification case discussed in [20], there also exists structural relationship among the labels in object detection task. For example, ‘Car’ shares more common visual characteristics with ‘Truck’ than with ’Person’. Such structural information is not available in the ground truth annotations. Thus, injecting such relational information learned with a high capacity teacher model to a student will help generalization capability of the detection model. The result of applying the distillation only shows consistent testing accuracy improvement in Table 5. Hint helps both learning and generalization: We notice that the “under-fitting” is a common problem in object detection even with CNN based models (see low training accuracy of the baselines). Unlike simple classification cases, where it is easy to achieve (near) perfect training accuracy [40], the training accuracy of the detectors is still far from being perfect. It seems the learning algorithm is suffering from the saddle point problem [8]. On the contrary, the hint may provide an effective guidance to avoid the problem by directly having a guidance at an intermediate layer. Thereby, the model learned with hint learning achieves noticeable improvement in both training and testing accuracy. Finally, by combining both distillation and hint learning, both training and test accuracies are improved significantly compared to the baseline. Table 5 empirically verifies consistent trends on both the PASCAL and MS COCO datasets for object detection. We believe that our methods can also be extended to other tasks that also face similar generalization or under-fitting problems. 5 Conclusion We propose a novel framework for learning compact and fast CNN based object detectors with the knowledge distillation. Highly complicated detector models are used as a teacher to guide the learning process of efficient student models. Combining the knowledge distillation and hint 8 framework together with our newly proposed loss functions, we demonstrate consistent improvements over various experimental setups. Notably, the compact models trained with our learning framework execute significantly faster than the teachers with almost no accuracy compromises at PASCAL dataset. Our empirical analysis reveals the presence of under-fitting issue in object detector learning, which could provide good insights to further advancement in the field. Acknowledgments This work was conducted as part of Guobin Chen’s internship at NEC Labs America in Cupertino. References [1] K. Ashraf, B. Wu, F. N. Iandola, M. W. Moskewicz, and K. Keutzer. Shallow networks for high-accuracy road object-detection. CoRR, abs/1606.01561, 2016. 6 [2] J. Ba and R. Caruana. Do deep nets really need to be deep? In Advances in neural information processing systems, pages 2654–2662, 2014. 2, 8 [3] C. Bucilua, R. Caruana, and A. Niculescu-Mizil. Model compression. In Proceedings of the 12th ACM SIGKDD international conference on Knowledge discovery and data mining, pages 535–541. ACM, 2006. 2, 3, 8 [4] K. Chatfield, K. Simonyan, A. Vedaldi, and A. Zisserman. Return of the devil in the details: Delving deep into convolutional nets. arXiv preprint arXiv:1405.3531, 2014. 6 [5] W. Chen, J. T. Wilson, S. Tyree, K. Q. Weinberger, and Y. Chen. Compressing neural networks with the hashing trick. CoRR, abs/1504.04788, 2015. 2 [6] X. Chen, H. Fang, T. Lin, R. Vedantam, S. Gupta, P. Dollár, and C. L. Zitnick. Microsoft coco captions: Data collection and evaluation server. arXiv:1504.00325, 2015. 5 [7] Y. Cheng, F. X. Yu, R. S. Feris, S. Kumar, A. Choudhary, and S.-F. Chang. An exploration of parameter redundancy in deep networks with circulant projections. In Proceedings of the IEEE International Conference on Computer Vision, pages 2857–2865, 2015. 2 [8] Y. N. Dauphin, R. Pascanu, C. Gulcehre, K. Cho, S. Ganguli, and Y. Bengio. Identifying and attacking the saddle point problem in high-dimensional non-convex optimization. In Advances in neural information processing systems, pages 2933–2941, 2014. 8 [9] M. Denil, B. Shakibi, L. Dinh, N. de Freitas, et al. Predicting parameters in deep learning. In Advances in Neural Information Processing Systems, pages 2148–2156, 2013. 1, 2 [10] E. L. Denton, W. Zaremba, J. Bruna, Y. LeCun, and R. Fergus. Exploiting linear structure within convolutional networks for efficient evaluation. In Advances in Neural Information Processing Systems, pages 1269–1277, 2014. 2 [11] M. Everingham, L. Van Gool, C. K. Williams, J. Winn, and A. Zisserman. The pascal visual object classes (voc) challenge. International journal of computer vision, 88(2):303–338, 2010. 5 [12] A. Geiger, P. Lenz, and R. Urtasun. Are we ready for autonomous driving? the kitti vision benchmark suite. In Computer Vision and Pattern Recognition (CVPR), 2012 IEEE Conference on, pages 3354–3361. IEEE, 2012. 5 [13] R. Girshick. Fast r-cnn. In Proceedings of the IEEE International Conference on Computer Vision, pages 1440–1448, 2015. 2, 4, 5 [14] R. B. Girshick, P. F. Felzenszwalb, and D. McAllester. Discriminatively trained deformable part models, release 5, 2012. 2 [15] Y. Gong, L. Liu, M. Yang, and L. Bourdev. Compressing deep convolutional networks using vector quantization. arXiv preprint arXiv:1412.6115, 2014. 2 [16] S. Gupta, J. Hoffman, and J. Malik. Cross modal distillation for supervision transfer. arXiv preprint arXiv:1507.00448, 2015. 3, 5 [17] S. Han, X. Liu, H. Mao, J. Pu, A. Pedram, M. A. Horowitz, and W. J. Dally. Eie: efficient inference engine on compressed deep neural network. arXiv preprint arXiv:1602.01528, 2016. 2 [18] S. Han, H. Mao, and W. J. Dally. Deep compression: Compressing deep neural network with pruning, trained quantization and huffman coding. CoRR, abs/1510.00149, 2015. 2 [19] K. He, X. Zhang, S. Ren, and J. Sun. Spatial pyramid pooling in deep convolutional networks for visual recognition. In European Conference on Computer Vision, pages 346–361. Springer, 2014. 2 [20] G. Hinton, O. Vinyals, and J. Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015. 1, 2, 3, 4, 8 [21] I. Hubara, M. Courbariaux, D. Soudry, R. El-Yaniv, and Y. Bengio. Binarized neural networks. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett, editors, Advances in Neural Information Processing Systems 29, pages 4107–4115. Curran Associates, Inc., 2016. 2 [22] F. N. Iandola, M. W. Moskewicz, K. Ashraf, S. Han, W. J. Dally, and K. Keutzer. Squeezenet: Alexnet-level accuracy with 50x fewer parameters and <1mb model size. CoRR, abs/1602.07360, 2016. 1 9 [23] M. Jaderberg, A. Vedaldi, and A. Zisserman. Speeding up convolutional neural networks with low rank expansions. arXiv preprint arXiv:1405.3866, 2014. 2 [24] R. J. T. JitendraMalik. Rich feature hierarchies for accurate object detection and semantic segmentation. 2, 6 [25] K. Kim, Y. Cheon, S. Hong, B. Roh, and M. Park. PVANET: deep but lightweight neural networks for real-time object detection. CoRR, abs/1608.08021, 2016. 1 [26] Y.-D. Kim, E. Park, S. Yoo, T. Choi, L. Yang, and D. Shin. Compression of deep convolutional neural networks for fast and low power mobile applications. arXiv preprint arXiv:1511.06530, 2015. 1, 2, 4, 6 [27] A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. In F. Pereira, C. J. C. Burges, L. Bottou, and K. Q. Weinberger, editors, Advances in Neural Information Processing Systems 25, pages 1097–1105. Curran Associates, Inc., 2012. 2, 6 [28] V. Lebedev, Y. Ganin, M. Rakhuba, I. Oseledets, and V. Lempitsky. Speeding-up convolutional neural networks using fine-tuned cp-decomposition. arXiv preprint arXiv:1412.6553, 2014. 2 [29] Y. Li, K. He, J. Sun, et al. R-fcn: Object detection via region-based fully convolutional networks. In Advances in Neural Information Processing Systems, pages 379–387, 2016. 2, 4 [30] A. Novikov, D. Podoprikhin, A. Osokin, and D. P. Vetrov. Tensorizing neural networks. In Advances in Neural Information Processing Systems, pages 442–450, 2015. 2 [31] M. Rastegari, V. Ordonez, J. Redmon, and A. Farhadi. Xnor-net: Imagenet classification using binary convolutional neural networks. In European Conference on Computer Vision, pages 525–542. Springer, 2016. 2 [32] S. Ren, K. He, R. Girshick, and J. Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. In Advances in neural information processing systems, pages 91–99, 2015. 2, 3, 4 [33] S. Ren, K. He, R. Girshick, X. Zhang, and J. Sun. Object detection networks on convolutional feature maps. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2016. 4 [34] A. Romero, N. Ballas, S. E. Kahou, A. Chassang, C. Gatta, and Y. Bengio. Fitnets: Hints for thin deep nets. arXiv preprint arXiv:1412.6550, 2014. 1, 2, 3, 5 [35] O. Russakovsky, J. Deng, H. Su, J. Krause, S. Satheesh, S. Ma, Z. Huang, A. Karpathy, A. Khosla, M. Bernstein, A. C. Berg, and L. Fei-Fei. ImageNet Large Scale Visual Recognition Challenge. International Journal of Computer Vision (IJCV), 115(3):211–252, 2015. 5 [36] J. Shen, N. Vesdapunt, V. N. Boddeti, and K. M. Kitani. In teacher we trust: Learning compressed models for pedestrian detection. arXiv preprint arXiv:1612.00478, 2016. 3 [37] K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. 6 [38] J.-C. Su and S. Maji. Cross quality distillation. arXiv preprint arXiv:1604.00433, 2016. 3, 6 [39] Y. Xiang, W. Choi, Y. Lin, and S. Savarese. Data-driven 3d voxel patterns for object category recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1903–1911, 2015. 6 [40] C. Zhang, S. Bengio, M. Hardt, B. Recht, and O. Vinyals. Understanding deep learning requires rethinking generalization. arXiv preprint arXiv:1611.03530, 2016. 8 [41] X. Zhang, J. Zou, K. He, and J. Sun. Accelerating very deep convolutional networks for classification and detection. 2015. 1, 2 [42] X. Zhang, J. Zou, X. Ming, K. He, and J. Sun. Efficient and accurate approximations of nonlinear convolutional networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1984–1992, 2015. 1, 2 10
2017
591
7,109
Learning Chordal Markov Networks via Branch and Bound Kari Rantanen HIIT, Dept. Comp. Sci., University of Helsinki Antti Hyttinen HIIT, Dept. Comp. Sci., University of Helsinki Matti Järvisalo HIIT, Dept. Comp. Sci., University of Helsinki Abstract We present a new algorithmic approach for the task of finding a chordal Markov network structure that maximizes a given scoring function. The algorithm is based on branch and bound and integrates dynamic programming for both domain pruning and for obtaining strong bounds for search-space pruning. Empirically, we show that the approach dominates in terms of running times a recent integer programming approach (and thereby also a recent constraint optimization approach) for the problem. Furthermore, our algorithm scales at times further with respect to the number of variables than a state-of-the-art dynamic programming algorithm for the problem, with the potential of reaching 20 variables and at the same time circumventing the tight exponential lower bounds on memory consumption of the pure dynamic programming approach. 1 Introduction Graphical models offer a versatile and theoretically solid framework for various data analysis tasks [1, 30, 17]. In this paper we focus on the structure learning task for chordal Markov networks (or chordal/triangulated Markov random fields or decomposable graphs), a central class of undirected graphical models [7, 31, 18, 17]. This problem, chordal Markov network structure learning (CMSL), is computationally notoriously challenging; e.g., finding a maximum likelihood chordal Markov network with bounded structure complexity (clique size) is known to be NP-hard [23]. Several Markov chain Monte Carlo (MCMC) approaches have been proposed for this task in the literature [19, 27, 10, 11]. Here we take on the challenge of developing a new exact algorithmic approach for finding an optimal chordal Markov network structure in the score-based setting. Underlining the difficulty of this challenge, first exact algorithms for CMSL have only recently been proposed [6, 12, 13, 14], and generally do no scale up to 20 variables. Specifically, the constraint optimization approach introduced in [6] does not scale up to 10 variables within hours. A similar approach was also taken in [16] in the form of a direct integer programming encoding for CMSL, but was not empirically evaluated in an exact setting. Comparably better performance, scaling up to 10 (at most 15) variables, is exhibited by the integer programming approach implemented in the GOBNILP system [2], extending the core approach of GOBNILP to CMSL by enforcing additional constraints. The true state-of-the-art exact algorithm for CMSL, especially when the clique size of the networks to be learned is not restricted, is Junctor, implementing a dynamic programming approach [13]. The method is based on recursive characterization of clique trees and storing in memory the scores of already-solved subproblems. Due to its nature, the algorithm has to iterate through every single solution candidate, although its effective memoization technique helps to avoid revisiting solution candidates [13]. As typical for dynamic programming algorithms, the worst-case and best-case performance coincide: Junctor is guaranteed to use Ω(4n) time and Ω(3n) space. In this work, we develop an alternative exact algorithm for CMSL. While a number of branchand-bound algorithms have been proposed in the past for Bayesian network structure learning 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. (BNSL) [25, 28, 20, 29, 26], to the best of our knowledge our approach constitutes the first non-trivial branch-and-bound approach for CMSL. Our core search routine takes advantage of similar ideas as a recently proposed approach for optimally solving BNSL [29], and, on the other hand, like GOBNILP, uses the tight connection between BNSL and CMSL by searching over the space of chordal Markov network structures via considering decomposable directed acyclic graphs. Central to the efficiency of our approach is the integration of dynamic programming over Bayesian network structures for obtaining strong bounds for effectively pruning the search space during search, as well as problem-specific dynamic programming for efficiently implementing domain filtering during search. Furthermore, we establish a condition which enables symmetry breaking for noticeably pruning the search space over which we perform branch and bound. In comparison with Junctor, a key benefit of our approach is the potential of avoiding worst-case behavior, especially in terms of memory usage, based on using strong bounds to rule out provably non-optimal solutions from consideration during search. Empirically, we show the approach dominates the integer programming approach of GOBNILP [2], and thereby also the constraint optimization approach [6, 12]. Furthermore, our algorithm scales at times further in terms of the number of variables than the DP-based approach implemented in Junctor [13], with the potential of reaching 20 variables within hours and at the same time circumventing the tight exponential lower bounds on memory consumption of the pure dynamic programming approach, which is witnessed also in practice by noticeably lower memory consumption.1 2 Chordal Markov Network Structure Learning A Markov network structure is represented by an undirected graph Gu = (V, Eu), where V = {v1, . . . , vn} is the set of vertices and Eu the set of undirected edges. This structure represents independencies vi ⊥⊥vj|S according to the undirected separation property: vi and vj are separated given set S if and only if all paths between them go through a vertex in set S. The undirected graph is chordal iff every (undirected) cycle of length greater than three contains a chord, i.e., an edge between two non-consecutive vertices in the cycle. Figure 1 a) shows an example. Here we focus on the task of finding a chordal graph U that maximizes posterior probability P(Gu|D) = P(D|Gu)P(Gu)/P(D), where D denotes the i.i.d. data set. As we assume a uniform prior over chordal graphs, this boils down to maximizing the marginal likelihood P(D|Gu). Dawid et al. have shown that the marginal likelihood P(D|Gu) for chordal Markov networks can be calculated using a clique tree representation [7, 9]. A clique C is a fully connected subset of vertices. A clique tree for an undirected graph Gu is an undirected tree such that I. S i Ci = V , II. if {vℓ, vk} ∈Eu, then either {vℓ, vk} ⊆Ck or {vℓ, vk} ⊆Cℓ, and III. the running intersection property holds: whenever vk ∈Ci and vk ∈Cj, then vk is also in every clique on the unique path between Ci and Cj. The separators are the intersections of adjacent cliques in a clique tree. Figure 1 b) shows an example. The marginal likelihood factorizes according to the clique tree: P(D|U) = Q i P(Ci)/ Q j P(Sj) (assuming positivity and that the prior factorizes) [6]. The marginal likelihood P(S) for a set S of random variables can be calculated with suitable priors; in this paper we consider discrete data using a Dirichlet prior. If we denote s(S) = log P(S), CMSL can be cast as maximizing P Ci s(Ci) −P Sj s(Sj). For example, the marginal log-likelihood of the graph in Figure 1 a) can be calculated using the clique tree presentation in Figure 1 b) as s({v1, v6}) + s({v1, v5}) + s({v1, v2, v3}) + s( v2, v3, v4}) −s({v1}) −s({v1}) −s({v2, v3}). In this paper, we view the chordal Markov network structure learning problem from the viewpoint of directed graphs, making use of the fact that for each chordal Markov network structure there are equivalent directed graph structures [15, 7], which we call here decomposable DAGs. A decomposable DAG is a DAG G = (V, E) such that the set of directed edges E ⊂V × V does not include any immoralities, i.e., structures of the form vi →vk ←vj with no edges between vi and vj. Due to lack of immoralities, the d-separation property on a decomposable DAG corresponds exactly to the separation property on the chordal undirected graph (the skeleton of the decomposable DAG). Thus, decomposable graphs represent distributions that are representable by Markov and by 1Extended discussion and empirical results are available in [21]. 2 a) v5 v1 v3 v2 v4 v6 b) {v1, v5} {v1, v6} {v1, v2, v3} {v2, v3, v4} {v1} {v1} {v2, v3} c) v5 v1 v3 v2 v4 v6 Figure 1: Three views on chordal Markov network structures: a) chordal undirected graph, b) clique tree, (c) decomposable DAG. Bayesian networks. Figure 1 c) shows a corresponding decomposable DAG for the chordal undirected graph in a). Note that the decomposable DAG may not be unique; for example, v2 →v3 can be directed also in the opposite direction. The score of the decomposable DAG can be calculated as s(v1, ∅)+s(v5, {v1})+s(v6, {v1})+s(v2, {v1})+s(v3, {v1, v2})+s(v4, {v2, v3}), where s(vi, S) are the local scores for BNSL using e.g. a Dirichlet prior. Because these local scores s(·, ·) correspond to s(·) through s(vi, S) = s({vi, S}) −s(S) (and s(∅) = 0), we find that this BNSL scoring gives the same result as the clique tree based scoring rule. Thus CMSL can also be cast as the optimization problem of finding a graph in arg max G∈G X vi∈V s(vi, paG(vi)), where G denotes the class of decomposable DAGs. (This formulation is used also in the GOBNILP system [2].) The optimal chordal Markov network structure is the skeleton of the optimal G. This problem is notoriously computationally difficult in practice, emphasized by the fact that standard score-pruning [3, 8] used for BNSL is not generally applicable in the context of CMSL as it will often prevent finding the true optimum: pruning parent sets for vertices often circumvents other vertices achieving high scoring parents sets (as immoralities would be induced). 3 Hybrid Branch and Bound for CMSL In this section we present details on our branch-and-bound approach to CMSL. We start with an overview of the search algorithm, and then detail how we apply symmetry breaking and make use of dynamic programming to dynamically update variable domains, i.e., for computing parent set choices during search, and to obtain tight bounds for pruning the search tree. 3.1 Branch and Bound over Ordered Decomposable DAGs The search is performed over the space of ordered decomposable DAGs. While in general the order of the vertices of a DAG can be ambiguous, this notion allows for differentiating the exact order of the vertices, and allows for pruning the search space by identifying symmetries (see Section 3.2). Definition 1. G = (V, E, π) is an ordered decomposable DAG if and only if (V, E) is a decomposable DAG and π : {1...n} →{1...n} a total order over V such that (vi, vj) ∈E only if π−1(i) < π−1(j) for all vi, vj ∈V . Partial solutions during search are hence ordered decomposable DAGs, which are extended by adding a parent set choice (v, P), i.e., adding the new vertex v and edges from each of its parents in P to v. Definition 2. Let G = (V, E, π) be an ordered decomposable DAG. Given vk /∈V and P ⊆V , we say that the ordered decomposable DAG G′ = (V ′, E′, π′) is G with the parent set choice (vk, P) if the following conditions hold. 1. V ′ = V ∪{vk} 2. E′ = E ∪S v′∈P {(v′, vk)}. 3. We have π′(i) = π(i) for all i = 1...|V |, and π′(|V | + 1) = k. Algorithm 1 represents the core functionality of the branch and bound. The recursive function takes two arguments: the remaining vertices of the problem instance, U, and the current partial solution G = (V, E, π). In addition we keep stored a best lower bound solution G∗, which is the 3 Algorithm 1 The core branch-and-bound search. 1: function BRANCHANDBOUND(U, G = (V, E, π)) 2: if U = ∅and s(G∗) < s(G) then G∗←G ▷Update LB if improved. 3: if this branch cannot improve LB then return ▷Backtrack 4: for (vi, P) ∈PARENTSETCHOICES(U, G) do ▷Iterate the current parent set choices. 5: Let G′ = (V ′, E′, π′) be G with the parent set choice (vi, P). 6: BRANCHANDBOUND(U \ {vi}, G′) ▷Continue the search. highest-scoring solution that has been found so far. Thus, at the end of the search, G∗is an optimal solution. During the search we use G∗for bounding as further detailed in Section 3.3. In the loop on line 4 we branch with all the parent set choices that we have deemed necessary to try during the search. The method PARENTSETCHOICES(U, G) and the related symmetry breaking are explained in Section 3.2. We sort the parent set choices into decreasing order based on their score, so that (v, P) is tried before (v′, P ′) if s(v, P) > s(v′, P ′), where v, v′ ∈U and P, P ′ ⊆V . This is done to focus the search first to the most promising branches for finding an optimal solution. When U = ∅, we have PARENTSETCHOICES(U, G) = ∅, and so the current branch gets terminated. 3.2 Dynamic Branch Selection, Parent Set Pruning, and Symmetry Breaking We continue by proposing symmetry breaking for the space of ordered decomposable DAGs, and propose a dynamic programming approach for dynamic parent set pruning during search. We start with symmetry breaking. In terms of our branch-and-bound approach to CMSL, symmetry breaking is a vital part of the search, as there can be exponentially many decomposable DAGs which correspond to a single undirected chordal graph; for example, the edges of a complete graph can be directed arbitrarily without the resulting DAG containing any immoralities. Hence symmetry breaking in terms of pruning out symmetric solution candidates during search has potential for noticeably speeding up search. Chickering [4, 5] showed how so-called covered edges can be used to detect equivalencies between Bayesian network structures. Later van Beek and Hoffmann [29] implemented covered edge based symmetry breaking in their BNSL approach. Here we introduce the concept of preferred vertex orders, which generalizes covered edges for CMSL based on the decomposability of the solution graphs. Definition 3. Let G = (V, E, π) be an ordered decomposable DAG. A pair vi, vj ∈V violates the preferred vertex order in G if the following conditions hold. 1. i > j. 2. paG(vi) ⊆paG(vj). 3. There is a path from vi to vj in G. Theorem 1 states that for any (partial) solution (i.e., an ordered decomposable DAG), there always exists an equivalent solution that does not contain any violations of the preferred vertex order. Mapping to practice, this theorem allows for very effectively pruning out all symmetric solutions but the one not violating the preferred vertex order within our branch-and-bound approach. A detailed proof is provided in Appendix A. Theorem 1. Let G = (V, E, π) be an ordered decomposable DAG. There exists an ordered decomposable DAG G′ = (V, E′, π′) that is equivalent to G, but where for all vi, vj ∈V the pair (vi, vj) does not violate the preferred vertex order in G′. It follows from Theorem 1 that for each solution (ordered decomposable DAG) there exists an equivalent solution where the lexicographically smallest vertex is a source. Thus we can fix it as the first vertex in the order at the beginning of the search. Similarly as in [29] for BNSL, we define the depths of vertices as follows. Definition 4. Let G = (V, E, π) be an ordered decomposable DAG. The depth of v ∈V in G is d(G, v) = ( 0 if paG(v) = ∅, max v′∈paG(v) d(G, v′) + 1 otherwise. 4 The depths of G are ordered if for all vi, vj ∈V , where π−1(i) < π−1(j), the following hold. 1. d(G, vi) ≤d(G, vj), and 2. If d(G, vi) = d(G, vj), then i < j. Note that "violating the preferred vertex order" concerns the order in which the vertices are in the underlying DAG, whereas "depths are ordered" concerns the order by which a solution was constructed. We use the former to prune whole solution candidates from the search space, and the latter to ensure that no solution candidate is seen twice during search. We also propose a dynamic programming approach to branch selection and parent set pruning during search, based on the following definition of valid parent sets. Definition 5. Let G = (V, E, π) be an ordered decomposable DAG. Given vk /∈V and P ⊆V , let G′ = (V ′, E′, π′) be G with the parent set choice (vk, P). The parent set choice (vk, P) is valid for G if the following hold. 1. For all vi, vj ∈P we have either (vi, vj) ∈E or (vj, vi) ∈E. 2. For all vi ∈V , the pair (vi, vk) does not violate the preferred vertex order in G′. 3. The depths of G′ are ordered. Given a partial solution G = (V, E, π), a vertex v /∈V , and a subset P ⊆V , the function GETSUPERSETS in Algorithm 2 represents a dynamic programming method for determining valid parent set choices (v, P ′) for G where P ′ ⊇P. An advantage of this formulation is that invalidating conditions for a parent set, such as immoralities or violations of the preferred vertex order, automatically hold for all the supersets of the parent set; this is applied on line 6 to avoid unnecessary branching. On line 8 we require that a parent set P is added to the list only if none of its valid supersets P ′ ∈C have a higher score. This pruning technique is based on the observation that P ′ provides all the same moralizing edges as P, and therefore it is sufficient to only consider the parent set choice (v, P ′) in the search when s(v, P) ≤s(v, P ′). Given the set of remaining vertices U, the function PARENTSETCHOICES in Algorithm 2 constructs all the available parent set choices for the current partial solution G = (V, E, π). The collection M(G, vi) contains the subset-minimal parent sets for vertex vi ∈U that satisfy the 3rd condition of Definition 5. If V = ∅, then M(G, vi) = {∅}. Otherwise, let k be the maximum depth of the vertices in G. Now M(G, vi) contains the subset-minimal parent sets that would insert vi on depth k + 1. In addition, if i > j for all vj ∈V where d(G, vj) = k, then M(G, vi) also contains the subset-minimal parent sets that would insert vi on depth k. Note that the cardinality of any parent set in M(G, vi) is at most one. 3.3 Computing Tight Bounds by Harnessing Dynamic Programming for BNSL To obtain tight bounds during search, we make use of the fact that the score of the optimal BN structures for the BNSL instance with same scores as in the CMSL instance at hand is guaranteed to give an upper bound on the optimal solutions to the CMSL instance. To compute an optimal BN structure, we use a variant of a standard dynamic programming algorithm by Silander and Myllymäki [22]. While there are far more efficient algorithms for BNSL [2, 32, 29], we use BNSL DP for obtaining an upper bound during the branch-and-bound search under the current partial Algorithm 2 Constructing parent set choices via dynamic programming. 1: function PARENTSETCHOICES(U, G = (V, E, π)) 2: return S v∈U S M∈M(G,v) GETSUPERSETS(v, G, M) 3: function GETSUPERSETS(v, G = (V, E, π), P) 4: Let C = ∅ 5: for v′ ∈V \ P \ {v} do 6: if (v, P ′) is a valid parent set choice for G with some P ′ ⊇P ∪{v′} then 7: C ←C ∪GETSUPERSETS(v, G, P ∪{v′}) 8: if (v, P) is valid parent set choice for G and s(v, P) > s(v, P ′) for all P ′ ∈C then 9: C ←C ∪{(v, P)} 10: return C 5 CMSL solution (i.e., under the current branch). Specifically, before the actual branch and bound, we precompute a DP table which stores, for each subset of vertices V ′ ⊂V of the problem instance, the score of the so-called BN extensions of V ′, i.e., the optimal BN structures over U = V \ V ′ where we additionally allow the vertices in U to also take parents from V ′. This guarantees that the BN extensions are compatible with the vertex order in the current branch of the branch-and-bound search tree, and thereby the sum of the score of the current partial CMSL solution over V ′ and the score of the optimal BN extensions of V ′ is a valid upper bound. By spending O(n · 2n) time in the beginning of the branch and bound for computing the scores of optimal BN extensions of every V ′ ⊂V , we can then look up these scores during branch and bound in O(1) time. With the DP table, it takes only low polynomial time to construct the optimal BN structure over the set of all vertices [22], i.e., a BN extension of ∅. Thus, we can obtain an initial lower bound solution G∗for the branch and bound as follows. 1. Construct the optimal BN structure for the vertices of the problem instance 2. Try to make the BN decomposable by heuristically adding or removing edges. 3. Let G∗be the highest-scoring decomposable DAG from step 2. However, the upper bounds obtained via BNSL can be at times can be quite weak when the network structures contain many immoralities. For this reason, in Algorithm 3, we introduce an additional method for computing the upper bounds, taking immoralities “relaxedly” into consideration. The algorithm takes four inputs: A fixed partial solution G = (V, E, π), a list of vertices A that we have assigned during the upper bound computation, a list of remaining vertices U, and an integer d ≥0 which dictates the maximum recursion depth. As a fallback option, on line 3 we return the optimal BN score for the remaining vertices if the maximum recursion depth is reached. On line 4 we construct the collection of sets P that are the maximal sets that any vertex can take as parent set during the upper bound computation. The sets in P take immoralities relaxedly into consideration: For any vi, vj ∈V , we have {vi, vj} ⊆P for some P ∈P if and only if (vi, vj) ∈E or (vj, vi) ∈E. That is, when choosing parent sets during the upper bound computation, we allow immoralities to appear, as long as they are not between vertices of the fixed partial solution. In the loop on line 6, we iterate through each vertex v ∈U that is still remaining, and find its highestscoring relaxedly-moral parent set according to P. Note that given any P ′ ∈P, we can find the highest-scoring parent set P ⊆P ′ in O(1) time when the scores are stored in a segment tree. For information about constructing such data structure, see [22]. Thus line 7 takes O(|V |) time to execute. Finally, on line 8 of the loop, we split the problem into subproblems to see which parent set choice (v, P) provides the highest local upper bound u to be returned. Algorithm 3 requires O((n −m) · m · 2n−m) time, where m = |V | is the number of vertices in the partial solution and n the number of vertices in the problem instance, assuming that the BN extensions and the segment trees have been precomputed. (In the empirical evaluation, the total runtimes of our branch-and-bound approach include these computations.) The collections P can exist implicitly. We use the upper bounds within branch and bound as follows. Let G = (V, E, π) be the current partial solution, let U be the set of remaining vertices, and let b be the score of optimal BN extensions of V . We can close the current branch if s(G∗) ≥s(G) + b. Otherwise, we can close the branch if s(G∗) ≥s(G) + UPPERBOUND(G, ∅, U, d) for some d > 0. Our implementation uses d = 10. Algorithm 3 Computing upper bounds for a partial solution via dynamic programming. 1: function UPPERBOUND(G = (V, E, π), A, U, d) 2: if U = ∅then return 0 3: if d = 0 then return the score of optimal BN extensions of V ∪A 4: Let P = S v∈V {{v} ∪paG(v) ∪A} 5: Let u ←−∞ 6: for v ∈U do 7: Let P = arg max P ⊆P ′∈P s(v, P) 8: u ←max(u, s(v, P) + UPPERBOUND(G, A ∪{v}, U \ {v}, d −1)) 9: return u 6 4 Empirical Evaluation We implemented the branch-and-bound algorithm in C++, and refer to this prototype as BBMarkov. We compare the performance of BBMarkov to that of GOBNILP (the newest development version [24] at the time of publication, using IBM CPLEX version 12.7.1 as the internal IP solver) as a state-ofthe-art BNSL system implementing a integer programming branch-and-cut approach to CMSL by ruling out non-chordal graphs, and Junctor, implementing a state-of-the-art DP approach to CMSL. We used a total of 54 real-world datasets used as standard benchmarks for exact approaches [32, 29]. For investigating scalability of the algorithms in terms of the number of variables n, we obtained from each dataset several benchmark instances by restricting to the first n variables for increasing values of n. We did not impose a bound on the treewidth of the chordal graphs of interest, i.e., the size of candidate parent sets was not limited. We used the BDeu score with equivalent sample size 1. As standard practice in benchmarking exact structure learning algorithms, we focus on comparing the running times of the considered approaches on precomputed input CMSL instances. The experiments were run under Debian GNU/Linux on 2.83-GHz Intel Xeon E5440 nodes with 32-GB RAM. Figure 2 compares BBMarkov to GOBNILP and Junctor under a 1-h per-instance time limit, with different numbers n of variables distinguished using different point styles. BBMarkov clearly dominates GOBNILP in runtime performance (Fig. 2 left); instances for n > 15 are not shown as GOBNILP was unable to solve them. Compared to Junctor (Fig. 2 middle, Table 1), BBMarkov exhibits complementary performance. Junctor is noticeably strong on several datasets and lower values of n, and exhibits fewer timeouts. For a fixed n, Junctor’s runtimes have a very low variance independent of the dataset, which is due to the Ω(4n) (both worst-case and best-case) runtime guarantee. However, BBMarkov shows potential for scaling up for larger n than Junctor: at n = 17 Junctor’s runtimes are very close to 1 h on all instances, while BBMarkov’s bounds rule out at times very effectively non-optimal solutions, resulting in noticeable lower runtimes on specific datasets with increasing n. This is show-cased in Table 1 on the right, highlighting some of the best-case performance of BBMarkov using per-instance time limit of 24 h for both BBMarkov and Junctor. 10MB 100MB 1GB 10GB 25GB 8 9 11 13 15 17 19 Memory usage Number of variables Junctor BBMarkov Figure 3: Memory usage In terms of how the various search techniques implemented in BBMarkov contribute to the running times of BBMarkov, we observed that the running times for obtaining BNSL-based bounds (via the use of exact BN dynamic programming and segment trees) tend to be only a small fraction of the overall running times. For example, at n = 20, these computations take less than minute in total. Most of the time in the search is typically used in the optimization loop and in computing the tighter upper bounds that take immoralities "relaxedly" into consideration. While computing the tighter bounds is more expensive than computing the exact BNs at the beginning of search, the tighter bounds often pay off in terms of overall running times as branches can be closed earlier during search. Another benefit of BBMarkov compared to Junctor is the observed lower memory consumption (Figure 3). Junctor’s Ω(3n) memory <1s 1m >1h <1s 1m >1h Run time of GOBNILP Run time of BBMarkov n=15 n=14 n=13 n=12 n=11 <1s 1m >1h <1s 1m >1h Run time of Junctor Run time of BBMarkov <1s 1m >1h <1s 1m >1h To find an optimal solution To find and prove the solution n=17 n=16 n=15 n=14 n=13 Figure 2: Per-instance runtime comparisons. Left: BBMarkov vs GOBNILP. Middle: BBMarkov vs Junctor. Right: BBMarkov time to finding vs BBMarkov time to proving an optimal solution. 7 Table 1: BBMarkov v Junctor. Left: smaller datasets and for different sample sizes on the Water dataset. Right: Examples of best-case performance of BBMarkov. to: timeout, mo: memout. Running times (s) Dataset n BBMarkov Junctor Wine 13 <1 (<1) 6 Adult 14 58 (35) 29 Letter 16 >3600 (>3600) 592 Voting 17 281 (207) 3050 Zoo 17 >3600 (>3600) 2690 Water100 17 100 (49) 2580 Water1000 17 2731 (279) 2592 Water10000 17 >3600 (>3600) 2928 Tumor 18 610 (268) 12019 Running times (s) Dataset n BBMarkov Junctor Alarm 17 268 (62) 2724 18 1462 (315) 12477 19 10274 (2028) 52130 20 49610 (50) mo Heart 17 41 (22) 3007 18 162 (85) 11179 19 1186 (698) 50296 20 15501 (13845) mo Hailfinder500 17 225 (108) 2588 18 2543 (1348) 12422 19 13749 (6418) 53108 20 33503 (25393) mo Water100 18 590 (244) 12244 19 6581 (6187) 52575 20 61152 (54806) mo usage results consistently in running out on memory for n ≥20. At n = 19, BBMarkov uses on average approx. 1 GB of memory, while Junctor uses close to 30 GB. A further benefit of BBMarkov is its ability to provide “anytime” solutions during search. In fact, the bounds obtained during search result at times in finding optimal solutions relatively fast: Figure 2 right shows the ratio of time needed to find an optimal solution (x-axis) from time needed to terminate search, i.e., to find a solution and prove its optimality (y-axis), and in Table 1, with the time needed to find an optimal solution given in parentheses. 5 Conclusions We introduced a new branch-and-bound approach to learning optimal chordal Markov network structures, i.e., decomposable graphs. In addition to core branch-and-bound search, the approach integrates dynamic programming for obtaining tight bounds and effective variable domain pruning during search. In terms of practical performance, the approach has the potential of reaching 20 variables within hours of runtime, at which point the competing native dynamic programming approach Junctor runs out of memory on standard modern computers. When approaching 20 variables, our approach is approximately 30 times as memory-efficient as Junctor. Furthermore, in contrast to Junctor, the approach is “anytime” as solutions can be obtained already before finishing search. Efficient parallelization of the approach is a promising direction for future work. Acknowledgments The authors gratefully acknowledge financial support from the Academy of Finland under grants 251170 COIN Centre of Excellence in Computational Inference Research, 276412, 284591, 295673, and 312662; and the Research Funds of the University of Helsinki. A Proofs We give a proof for Theorem 1, central in enabling effective symmetric breaking in our branch-andbound approach. We start with a definition and lemma towards the proof. Definition 6. Let V = {v1, ..., vn} be a set of vertices and let π and π′ be some total orders over V . Let k = mini,π(i)̸=π′(i) i be the first difference between the orders. If no such difference exists, we denote π = π′. Otherwise we denote π < π′ if and only if π(k) < π′(k). Lemma 1. Let G = (V, E, π) be an ordered decomposable DAG. If there are vi, vj ∈V such that the pair (vi, vj) violates the preferred vertex order in G, then there exists an ordered decomposable DAG G′ = (V, E′, π′), where 1. G′ belongs to the same equivalence class with G, 2. the pair (vi, vj) does not violate the preferred vertex order in G′, and 3. π < π′. 8 Proof. We begin by defining a directed clique tree C = (V, E) over G. Given vk ∈V , let Ck = paG(vk) ∪{vk} be the clique defined by vk in G. The vertices of C are these cliques; we also add an empty set as a clique to make sure the cliques form a tree (and not a forest). Formally, V = {Ck | vk ∈V } ∪{∅}. Given vk ∈V , where paG(vk) ̸= ∅, let φk = argmaxvℓ∈paG(vk)π−1(ℓ) denote the parent of vk in G that is in the least significant position in π. Now, the edges of C are E = {(∅, Ck) | Ck = {vk}, vk ∈V } ∪{(Cℓ, Ck) | vℓ= φk, Ck ̸= {vk}, vk ∈V }. In words, if vk ∈V is a source vertex in G (i.e., Ck = {vk}), then the parent of Ck is ∅in C. Otherwise (i.e., Ck ̸= {vk}) the parent of Ck is Cℓ, where vℓis the closest vertex to vk in order π that satisfies Cℓ∩paG(vk) ̸= ∅. We see that all the requirements for clique trees hold for C: I. S C∈V C = V , II. if {vℓ, vk} ∈E, then either {vℓ, vk} ⊆Ck or {vℓ, vk} ⊆Cℓ, and III. due to the decomposability of G, we have Ca ∩Cc ⊆Cb on any path from Ca to Cc through Cb (the running intersection property). Now assume that there are vi, vj ∈V such that the pair (vi, vj) violates the preferred vertex order in G; that is, we have i > j, paG(vi) ⊆paG(vj) and a path from vi to vj in G. This means that there is a path from Ci to Cj in C as well. Let P ∈V be the parent vertex of Ci in C. We see that Cj exists in a subtree T of C that is separated from rest of C by P, and where Ci is the root vertex. Let T ′ be a new clique tree that is like T , but redirected so that Cj is the root vertex of T ′. Let C′ be a new clique tree that is like C, but T is replaced with T ′. We show that C′ is a valid clique tree. First of all, the vertices (cliques) of C′ are exactly the same as in C, so C′ clearly satisfies the requirements I and II. As for the requirement III, consider the non-trivial case where Ca, Cb ∈C have a path from Ca to Cb through Ci in C. This means vi /∈Ca (due to the way C was constructed), and so we get Ca ∩Cb ⊆Ci →Ca ∩Cb ⊆Ci \ {vi} →Ca ∩Cb ⊆paG(vi) ⊆ Def. 3 (2) paG(vj) ⊆Cj. Therefore the running intersection property holds for C′. Let ˆπ be the total order by which C′ is ordered. Let G′ = (V, E′, ˆπ) be a new ordered decomposable DAG that is equivalent to G, but where the edges E′ are arranged to follow the order ˆπ. Finally, we see that G′ satisfies the conditions of the theorem: 1. The cliques of G′ are identical to that of G, so G′ belongs to the same equivalence class with G. 2. We have ˆπ−1(j) < ˆπ−1(i), and therefore there is no path from vi to vj in G′. Thus the pair (vi, vj) does not violate the preferred vertex order in G′. 3. Let o = π−1(i). We have ˆπ(o) = j < i = π(o). Furthermore, the change from T to T ′ in C′ did not affect any vertex whose position was earlier than o. Therefore ˆπ(k) = π(k) for all k = 1...(o −1). This implies ˆπ < π. Proof of Theorem 1. Consider the following procedure for finding G′. 1. Select vi, vj ∈V where the pair (vi, vj) violates the preferred vertex order in G. If there are no such vertices, assign G′ ←G and terminate. 2. Let π be the total order of the vertices of G. Construct an ordered decomposable DAG ˆG = (V, ˆE, π′) such that I. the pair (vi, vj) does not violate the preferred vertex order in ˆG, II. ˆG belongs to the same equivalent class with G, and III. π′ < π. By Lemma 1, ˆG can be constructed from G. 3. Assign G ←ˆG and return to step 1. It is clear that when the procedure terminates, G′ belongs to same equivalence class with G and there are no violations of the preferred vertex order in G′. We also see that the total order of G (i.e., π) is lexicographically strictly decreasing every time the step 3 is reached. There are finite amount of possible permutations (total orders) and therefore the procedure converges. The existence of this procedure and its correctness proves that G′ exists. 9 References [1] Haley J. Abel and Alun Thomas. Accuracy and computational efficiency of a graphical modeling approach to linkage disequilibrium estimation. Statistical Applications in Genetics and Molecular Biology, 143(10.1), 2017. [2] Mark Bartlett and James Cussens. Integer linear programming for the Bayesian network structure learning problem. Artificial Intelligence, 244:258–271, 2017. [3] Cassio P. de Campos and Qiang Ji. Efficient structure learning of Bayesian networks using constraints. Journal of Machine Learning Research, 12:663–689, 2011. [4] David Maxwell Chickering. A transformational characterization of equivalent Bayesian network structures. In Proc. UAI, pages 87–98. Morgan Kaufmann, 1995. [5] David Maxwell Chickering. Learning equivalence classes of Bayesian network structures. Journal of Machine Learning Research, 2:445–498, 2002. [6] Jukka Corander, Tomi Janhunen, Jussi Rintanen, Henrik J. Nyman, and Johan Pensar. Learning chordal Markov networks by constraint satisfaction. In Proc. NIPS, pages 1349–1357, 2013. [7] A. Philip Dawid and Steffen L. Lauritzen. Hyper Markov laws in the statistical analysis of decomposable graphical models. Annals of Statistics, 21(3):1272–1317, 09 1993. [8] Cassio P. de Campos and Qiang Ji. Properties of Bayesian Dirichlet scores to learn Bayesian network structures. In Proc. AAAI, pages 431–436. AAAI Press, 2010. [9] Petros Dellaportas and Jonathan J. Forster. Markov chain Monte Carlo model determination for hierarchical and graphical log-linear models. Biometrika, 86(3):615–633, 1999. [10] Paolo Giudici and Peter J. Green. Decomposable graphical Gaussian model determination. Biometrika, 86(4):785, 1999. [11] Peter J. Green and Alun Thomas. Sampling decomposable graphs using a Markov chain on junction trees. Biometrika, 100(1):91, 2013. [12] Tomi Janhunen, Martin Gebser, Jussi Rintanen, Henrik Nyman, Johan Pensar, and Jukka Corander. Learning discrete decomposable graphical models via constraint optimization. Statistics and Computing, 27(1):115–130, 2017. [13] Kustaa Kangas, Mikko Koivisto, and Teppo M. Niinimäki. Learning chordal Markov networks by dynamic programming. In Proc. NIPS, pages 2357–2365, 2014. [14] Kustaa Kangas, Teppo Niinimäki, and Mikko Koivisto. Averaging of decomposable graphs by dynamic programming and sampling. In Proc. UAI, pages 415–424. AUAI Press, 2015. [15] Daphne Koller and Nir Friedman. Probabilistic graphical models: principles and techniques. MIT press, 2009. [16] K. S. Sesh Kumar and Francis R. Bach. Convex relaxations for learning bounded-treewidth decomposable graphs. In Proc. ICML, volume 28 of JMLR Workshop and Conference Proceedings, pages 525–533. JMLR.org, 2013. [17] Steffen L. Lauritzen and David J. Spiegelhalter. Local computations with probabilities on graphical structures and their application to expert systems. In Glenn Shafer and Judea Pearl, editors, Readings in Uncertain Reasoning, pages 415–448. Morgan Kaufmann Publishers Inc., 1990. [18] Gérard Letac and Hélène Massam. Wishart distributions for decomposable graphs. The Annals of Statistics, 35(3):1278–1323, 2007. [19] David Madigan, Jeremy York, and Denis Allard. Bayesian graphical models for discrete data. International Statistical Review/Revue Internationale de Statistique, pages 215–232, 1995. 10 [20] Brandon M. Malone and Changhe Yuan. A depth-first branch and bound algorithm for learning optimal Bayesian networks. In GKR 2013 Revised Selected Papers, volume 8323 of Lecture Notes in Computer Science, pages 111–122. Springer, 2014. [21] Kari Rantanen. Learning score-optimal chordal Markov networks via branch and bound. Master’s thesis, University of Helsinki, Finland, 2017. [22] Tomi Silander and Petri Myllymäki. A simple approach for finding the globally optimal Bayesian network structure. In Proc. UAI, pages 445–452. AUAI Press, 2006. [23] Nathan Srebro. Maximum likelihood bounded tree-width Markov networks. Artificial Intelligence, 143(1):123 – 138, 2003. [24] Milan Studený and James Cussens. Towards using the chordal graph polytope in learning decomposable models. International Journal of Approximate Reasoning, 88:259–281, 2017. [25] Joe Suzuki. Learning Bayesian belief networks based on the Minimum Description Length principle: An efficient algorithm using the B&B technique. In Proc. ICML, pages 462–470. Morgan Kaufmann, 1996. [26] Joe Suzuki and Jun Kawahara. Branch and Bound for regular Bayesian network structure learning. In Proc. UAI. AUAI Press, 2017. [27] Claudia Tarantola. MCMC model determination for discrete graphical models. Statistical Modelling, 4(1):39–61, 2004. [28] Jin Tian. A branch-and-bound algorithm for MDL learning Bayesian networks. In Proc. UAI, pages 580–588. Morgan Kaufmann, 2000. [29] Peter van Beek and Hella-Franziska Hoffmann. Machine learning of Bayesian networks using constraint programming. In Proc. CP, volume 9255 of Lecture Notes in Computer Science, pages 429–445. Springer, 2015. [30] Claudio J. Verzilli, Nigel Stallard, and John C. Whittaker. Bayesian graphical models for genomewide association studies. The American Journal of Human Genetics, 79(1):100–112, 2006. [31] Ami Wiesel, Yonina C. Eldar, and Alfred O. Hero III. Covariance estimation in decomposable Gaussian graphical models. IEEE Transactions on Signal Processing, 58(3):1482–1492, 2010. [32] Changhe Yuan and Brandon M. Malone. Learning optimal Bayesian networks: A shortest path perspective. Journal of Artificial Intelligence Research, 48:23–65, 2013. 11
2017
592
7,110
Efficient Optimization for Linear Dynamical Systems with Applications to Clustering and Sparse Coding Wenbing Huang1,3, Mehrtash Harandi2, Tong Zhang2 Lijie Fan3, Fuchun Sun3, Junzhou Huang1 1 Tencent AI Lab. ; 2 Data61, CSIRO and Australian National University, Australia; 3 Department of Computer Science and Technology, Tsinghua University, Tsinghua National Lab. for Information Science and Technology (TNList); 1{helendhuang, joehhuang}@tencent.com 2{mehrtash.harandi@data61.csiro.au, tong.zhang@anu.edu.cn} 3{flj14@mails, fcsun@mail}.tsinghua.edu.cn Abstract Linear Dynamical Systems (LDSs) are fundamental tools for modeling spatiotemporal data in various disciplines. Though rich in modeling, analyzing LDSs is not free of difficulty, mainly because LDSs do not comply with Euclidean geometry and hence conventional learning techniques can not be applied directly. In this paper, we propose an efficient projected gradient descent method to minimize a general form of a loss function and demonstrate how clustering and sparse coding with LDSs can be solved by the proposed method efficiently. To this end, we first derive a novel canonical form for representing the parameters of an LDS, and then show how gradient-descent updates through the projection on the space of LDSs can be achieved dexterously. In contrast to previous studies, our solution avoids any approximation in LDS modeling or during the optimization process. Extensive experiments reveal the superior performance of the proposed method in terms of the convergence and classification accuracy over state-of-the-art techniques. 1 Introduction Learning from spatio-temporal data is an active research area in computer vision, signal processing and robotics. Examples include dynamic texture classification [1], video action recognition [2, 3, 4] and robotic tactile sensing [5]. One kind of the popular models for analyzing spatio-temporal data is Linear Dynamical Systems (LDSs) [1]. Specifically, LDSs apply parametric equations to model the spatio-temporal data. The optimal system parameters learned from the input are employed as the descriptor of each spatio-temporal sequence. The benefits of applying LDSs are two-fold: 1. LDSs are generative models and their parameters are learned in an unsupervised manner. This makes LDSs suitable choices for not only classification but also interpolation/extrapolation/generation of spatio-temporal sequences [1, 6, 7]; 2. Unlike vectorial ARMA models [8], LDSs are less prone to the curse of dimensionality as a result of their lower-dimensional state space [9]. Clustering [10] and coding [5] LDSs are two fundamental problems that motivate this work. The clustering task is to group LDS models based on some given similarity metrics. The problem of coding, especially sparse coding, is to identify a dictionary of LDSs along their associated sparse codes to best reconstruct a collection of LDSs. Given a set of LDSs, the key problems of clustering and sparse coding are computing the mean and finding the LDS atoms, respectively, both of which are not easy tasks by any measure. Due to an infinite number of equivalent transformations for 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. the system parameters [1], the space of LDSs is non-Euclidean. This in turn makes the direct use of traditional techniques (e.g., conventional sparse solvers) inapplicable. To get around the difficulties induced by the non-Euclidean geometry, previous studies (e.g., [11, 12, 13, 5]) resort to various approximations, either in modeling or during optimization. For instance, the authors in [11] approximated the clustering mean by finding the closest sample under a certain embedding. As we will see in our experiments, involving approximations into the solutions exhibits inevitable limitations to the algorithmic performance. This paper develops a gradient-based method to solve the clustering and sparse coding tasks efficiently without any approximation involved. To this end, we reformulate the optimization problems for these two different tasks and then unify them into one common problem by making use of the kernel trick. However, there exist several challenges to address this common problem efficiently. The first challenge comes from the aforementioned invariance property on the LDS parameters. To attack this challenge, we introduce a novel canonical form of the system parameters that is insensitive to the equivalent changes. The second challenge comes from the fact that the optimization problem of interest requires solving Discrete Lyapunov Equations (DLEs). At first glance, such a dependency makes backpropagating the gradients through DLEs more complicated. Interestingly, we prove that the gradients can be exactly derived by solving another DLE in the end, which makes our optimization much simpler and more efficient. Finally, as suggested by [14], the LDS parameters, i.e., the transition and measurement matrices require to be stable and orthogonal, respectively. Under our canonical representation, the stability constraint is reduced to the bound constraint. We then make use of the Cayley-transformation [15] to maintain orthogonality and perform the bound-normalization to accomplish stability. Clustering and sparse coding can be combined with high-level pooling frameworks (e.g., bag-of-systems [11] and spatial-temporal-pyramid-matching [16]) for classifying dynamic textures. Our experiments on such kind of data demonstrate that the proposed methods outperform state-of-the-art techniques in terms of the convergence and classification accuracy. 2 Related Work LDS modeling. In the literature, various non-Euclidean metrics have been proposed to measure the distances between LDSs, such as Kullback-Leibler divergence [17], Chernoff distance [18], Binet-Cauchy kernel [19] and group distance [14]. This paper follows the works in [20, 21, 11, 12] to represent an LDS by making use of the extended observability subspace; comparing LDSs is then achieved by measuring the subspace angles [22]. Clustering LDSs. In its simplest form, clustering LDSs can be achieved by alternating between two sub-processes: 1) assigning LDSs to the closest clusters using a similarity measure; 2) computing the mean of the LDSs within the same cluster. However, as the space of LDSs is non-Euclidean, computing means on this space is not straightforward. In [12], the authors embedded LDSs into a finite Grassmann manifold by representing each LDS with its finite observability subspace and then cluster LDSs on that manifold. In contrast, our method applies the extended observability subspace to represent LDSs. In this way, not only the fully temporal evolution of the input sequence is taken into account, but also and as will be shown shortly, the computational cost is reduced. The solution proposed by [11] also represent LDSs with extended observability subspaces; but it approximates the mean by finding a sample that is closest to the mean using the concept of Multidimensional Scaling (MDS). Instead, our method finds the system tuple of the exact mean for the given group of LDSs without relying on any approximation. Afsari et al. [14] cluster LDSs by first aligning the parameters of LDSs in their equivalence space. However, the method of Afsari et al. is agnostic to the joint behavior of transition and measurement matrices and treat them independently. Other related studies include probabilistic framework for clustering LDSs [23, 24]. Sparse Coding with LDSs. Combining sparse coding with LDS modeling could further promote the classification performance [13]. However, similar to the clustering task, the non-Euclidean structure makes it hard to formulate the reconstruction objective and update the dictionary atoms on the space of LDSs. To address this issue, [13] embedded LDSs into the space of symmetric matrices by representing each LDS with its finite observability subspace. With this embedding, dictionary learning can be performed in the Euclidean space. In [5], the authors employ the extended observability subspaces as the LDS descriptors; however, to update the dictionary, the authors enforce symmetric constraints on the the transition matrices. Different from previous studies, our model 2 works on the the original LDS model and does not enforce any additional constraint to the transition matrices. To sum up, in contrast to previous studies [12, 11, 14, 13, 5], this paper solves the clustering and sparse coding problems in a novel way regarding the following aspects. First, we unify the optimizing objective functions for both clustering and sparse coding; Second, we avoid any additional constraints (e.g. symmetric transition in [5] and finite observability in [12, 13]) for the solution; Finally, we propose a canonical formulation of the LDS tuple to facilitate the optimization. 3 LDS Modeling LDSs describe time series through the following model [1]:  y(t) = y + Cx(t) + w(t) x(t + 1) = Ax(t) + Bv(t), (1) with Rm×τ ∋Y = [y(1), · · · , y(τ)] and Rn×τ ∋X = [x(1), · · · , x(τ)] representing the observed variables and the hidden states of the system, respectively. Furthermore, y ∈Rm is the mean of Y ; A ∈Rn×n is the transition matrix of the model; B ∈Rn×nv (nv ≤n) is the noise transformation matrix; C ∈Rm×n is the measurement matrix; v(t) ∼N(0, Inv) and w(t) ∼N(0, Ω) denoting the process and measurement noise components, respectively. We also assume that n ≪m and C has full rank. Overall, generating the observed variables is governed by the parameters Θ = {x(1), y, A, B, C, Ω}. System Identification. The system parameters A and C of Eq. (1) describe the dynamics and spatial patterns of the input sequence, respectively [11]. Therefore, the tuple (A, C) is a desired descriptor for spatio-temporal data. Finding the optimal tuple (A, C) is known as system identification. A popular and efficient method for system identification is proposed in [1]. This method requires the columns of C to be orthogonal, i.e., C is a point on the Stiefel manifold defined as ST(m, n) = {C ∈ Rm×n|CTC = In}. The transition matrix A obtained by the method of [1] is not naturally stable. An LDS is stable if its spectral radius, i.e. the maximum eigenvalue of its transition matrix denoted by ρ(A) is less than one. To obtain a stable transition matrix, [5] propose a soft-normalization technique which is our choice in this paper. Therefore, we are interested in the LDS tuple with the constraints, C = {CTC = In, ρ(A) < 1}. (2) Equivalent Representation. Studying Eq. (1) shows that the output of the system remains unchanged under linear transformations of the state basis [1]. More specifically, an LDS has an equivalent class of representations, i.e., (A, C) ∼ (P T AP , CP ) (3) for any P ∈O(n)1. For simplicity, the equivalence in Eq.(3) is called as P-equivalence. Obviously comparing LDSs through Euclidean distance between the associated tuples is inaccurate as a result of P-equivalence. To circumvent this difficulty, a family of approaches apply the extended observability subspace to represent an LDS [20, 21, 11, 5]. Below, we briefly review this topic. Extended Observability Subspace. The expected output sequence of Eq. (1) [12] is calculated as [E[y(1)]; E[y(2)]; E[y(3)]; · · · ] = [C; CA; CA2; · · · ]x(1) = O∞(A, C)x(1), (4) where O∞(A, C) ∈R∞×n is called as the extended observability matrix of the LDS associated to (A, C). Let S(A, C) denote the extended observability subspace spanned by the columns of O∞(A, C). Obviously, the extended observability subspace is invariant to P-equivalence, i.e., S(A, C) = S(P TAP , CP ). In addition, the extended observability subspace is capable of containing the fully temporal evolution of the input sequence as observed from Eq. (4). 4 Our Approach In this section, we first unify the optimizations for clustering and sparse coding with LDSs by making use of the kernel functions. Next, we present our method to address this optimization problem. 1In general, (A, C) ∼(P −1AP , CP ) for P ∈GL(n) with GL(n) denoting non-singular n×n matrices. Since we are interested in orthogonal measurement matrices (i.e., C ∈ST(m, n)), the equivalent class takes the form described in Eq. (3). 3 4.1 Problem Formulation We recall that each LDS is represented by its extended observability subspace. Clustering or sparse coding in the space of extended observability subspaces is not straightforward because the underlying geometry is non-Euclidean. Our idea here is to implicitly map the subspaces to a Reproducing Kernel Hilbert Space (RKHS). For better readability, we simplify the subspace induced by S(Ai, Ci) as Si in the rest of this section if no ambiguity is caused. We denote the implicit mapping defined by a positive definite kernel k(S1, S2) = φ(S1)Tφ(S2) as φ : S 7→H. Various kernels [25, 19, 5] based on extended observability subspaces have been proposed to measure the similarity between LDSs. Though the proposed method is general in nature, in the rest of the paper we employ the projection kernel [5] due to its simplicity. The projection kernel is defined as kp(S1, S2) = Tr(G−1 11 G12G−1 22 G21), (5) where Tr(·) computes the trace and the product matrices Gij = OT ∞(Ai, Ci)O∞(Aj, Cj) = P∞ t=0(AT i )tCT i CjAt j, for i, j ∈{1, 2} are obtained by solving the following DLE AT i GijAj −Gij = −CT i Cj. (6) The solution of DLE exists and is unique when both Ai and Aj are stable [22]. DLE can be solved by a numerical algorithm with the computational complexity of O(n3) [26], where n is the hidden dimension and is usually very small (see Eq. (1)). Clustering. As discussed before, the key of clustering is to compute the mean for the given set of LDSs. While several works [12, 11, 14] have been developed for computing the mean, none of their solutions are derived in the kernel form. The mean defined by the implicit mapping is min Am,Cm 1 N N X i ∥φ(Sm) −φ(Si)∥2 s.t. (Am, Cm) ∈C, (7) where Sm is the mean subspace and Si are data subspaces. Removing the terms that are independent from Sm (e.g., φ(Sm)Tφ(Sm) = 1) leads to min Am,Cm −2 N N X i k(Sm, Si) s.t. (Am, Cm) ∈C. (8) Sparse Coding. The problem of sparse coding in the RKHS is written as [13] min {A′ j,C′ j}J j=1 1 N N X i ∥φ(Si) − J X j=1 zi,jφ(S′ j)∥2 + λ∥zi∥1, s.t. (A′ j, C′ j) ∈C, j = 1, · · · , J; (9) where {Si}N i=1 are the data subspaces; {S′j}J j=1 are the dictionary subspaces; zi,j is the sparse code of data Si over atom S′j; RJ ∈zi = [zi,1; · · · ; zi,J] and λ is the sparsity factor. Eq. (9) shares the same form as those in [13, 5]; however, here we apply the extended observability subspaces and perform no additional constraint on the transition matrices. To perform sparse coding, we alternative between the two phases: 1) computing the sparse codes given LDS dictionary, which is similar to the conventional sparse coding task [13]; 2) optimizing each dictionary atom with the codes fixed. Specifically, updating the r-th atom with other atoms fixed gives the kernel formulation of the objective as Γr = 1 N N X i −zi,rk(S′ r, Si) + J X j=1,j̸=r zi,rzi,jk(S′ r, S′ j). (10) Common Problem. Clearly, Eq. (8) and (10) have the common form as min A,C 1 N N X i=1 βik(S(A, C), S(Ai, Ci)) s.t. (A, C) ∈C. (11) Here, (A, C) is the LDS tuple to be identified; {(Ai, Ci)}N i=1 are given LDSs; {βi}N i=1 are the task-dependent coefficients (are specified in Eq. (8) and Eq. (10)). To minimize (11), we resort to the Projected Gradient Descent (PGD) method. Note that the solution space in (11) is redundant due to the invariance induced by P-equivalence (Eq. (3)). We thus devise a canonical representation of the system tuple (see Theorem 1). The canonical form not only confines the search space but also simplifies the stability constraint to a bound constraint. We then compute the gradients with respect to the system tuple by backpropagating the gradients through DLEs (see Theorem 4). Finally, we project the gradients to feasible regions of the system tuples via Caylay-transformation (Eq. (16-17) and bound-normalization (Eq. (18)). We now present the details. 4 4.2 Canonical Representation Theorem 1. For any given LDS, the system tuple (A, C) ∈Rn×n × Rm×n and all its equivalent representations have the canonical form (ΛV , U), where U ∈ST(m, n), V ∈O(n) and Λ ∈ Rn×n is diagonal with the diagonal elements arranged in a descend order, i.e. λ1 ≥λ2 ≥· · · ≥λn2. Remark 2. The proof of Theorem 1 (presented in the supplementary material) requires the SVD decomposition that is not necessarily unique [27], thus the canonical form of a system tuple is not unique. Even so, the free dimensionality of the canonical space (i.e., mn) is less than that of the original tuples (i.e., mn + n(n−1) 2 ) within the feasible region of C. This is due to the invariance induced by P-equivalence (Eq. (3)) if one optimizes (11) in the original form of the system tuple. Remark 3. It is easy to see that the stability (i.e., ρ(A) < 1) translates into the constraint |λi| < 1 in the canonical representation with λi being the i-th diagonal element of Λ. As such, problem (11) can be cast as min Λ,V ,U 1 N N X i=1 βik(S(ΛV , U), S(Ai, Ci)), s.t. V TV = In; U TU = In; |λi| < 1, i = 1, · · · , n. (12) A feasible solution of (11) can be obtained by minimizing (12) and the stability constraint in (11) is reduced to a bound constraint in (12). The canonical form derived from Theorem 1 is central to our methods. It is because with the canonical form, we can simplify the stability constraint to a bound one, thus making the solution simpler and more efficient. We note that even with conditions on one single LDS, optimizing the original form of A with the stability constraint is tedious (e.g., [7] and we note that the tasks addressed in our paper are more complicated where far more than one LDS are required to optimize). Furthermore, the canonical form enables us to reduce the redundancy of the LDS tuple (see Remark 3). To be specific, with canonical form, one needs to update only n singular values rather than the entire A matrix. Also optimization with the canonical representations avoids numerical instabilities related to equivalent classes, thus facilitating the optimization. 4.3 Passing Gradients Through DLEs According to the definition of the projection kernel, to obtain k(S(A, C), S(Ai, Ci)) for (11) (note that in the canonical form A = ΛV and C = U), computing the product-matrices Gi = P∞ t=0(AT)tCTCiAt i are required. To compute the gradients of the objective in (11) shown by Γ w.r.t. the tuple Θ = (A, C), we make use of the chain rule in the vectorized form as ∂Γ ∂Θ : = X i ∂Γ ∂Gi : ∂Gi : ∂Θ : . (13) While computing ∂Γ ∂Gi: is straightforward, deriving ∂Gi: ∂Θ: is non-trivial as the values of the productmatrices Gi are obtained by an infinite summation. The following theorem proves that the gradients are derived by solving an induced DLE. Theorem 4. Let the extended observability matrices of two LDSs (A1, C1) and (A2, C2) be O1 and O2, respectively. Furthermore, let G12 = OT 1 O2 = P∞ t=0(AT 1 )tCT 1 C2At 2 be the product-matrix between O1 and O2. Given the gradient of the objective function with respect to the product-matrix ∂Γ ∂G12 .= H, the gradients with respect to the system parameters are ∂Γ ∂A1 = G12A2RT 12, ∂Γ ∂C1 = C2RT 12, ∂Γ ∂A2 = GT 12A1R12, ∂Γ ∂C2 = C1R12, (14) where R12 is obtained by solving the following DLE A1R12AT 2 −R12 + H = 0. (15) 2All the proofs of the theorems in this paper are provided in the supplementary material. 5 4.4 Constraint-Aware Updates We cannot preserve the orthogonality of V , U and the stability of Λ if we use conventional gradientdescent methods to update the parameters Λ, V , U of (12). Optimization on the space of orthogonal matrices is a well-studied problem [15]. Here, we employ the Cayley transformation [15] to maintain orthogonality for V and U. In particular, we update V by V = V −τLV (I2n + τ 2RT V LV )−1RT V V , (16) where LV = [∇V , V ] and RV = [V , −∇V ], ∇V is the gradient of the objective w.r.t. V , and τ is the learning rate. Similarly, to update U, we use U = U −τLU(I2n + τ 2RT ULU)−1RT UU, (17) where LU = [∇U, U] and RU = [U, −∇U]. As shown in [15], the Cayley transform follows the descent curve, thus updating V by Eq. (16) and U by Eq. (17) decreases the objective for sufficiently small τ. To accomplish stability, we apply the following bound normalization on Λ, i.e., λk = ε max(ε, |λk −τ∇λk|)(λk −τ∇λk), (18) where λk is the k-th diagonal element of Λ; ∇λk denotes the gradient w.r.t. λk; and ε < 1 is a threshold (we set ε = 0.99 in all of our experiments in this paper). From the above, we immediately have the following result, Theorem 5. The update direction in Eq. (18) is a descent direction. The authors in [5] constrain the eigenvalues of the transition matrix to be in (−1, 1) using a Sigmoid function. However, the Sigmoid function is easier to saturate and its gradient will vanish when λk is close to the bound. In contrast, Eq. (18) does not suffer from this issue. For reader’s convenience, all the aforementioned details for optimizing (11) are summarized in Algorithm 1. The full details about how to use Algorithm 1 to solve clustering and sparse coding are provided in the supplementary material. Algorithm 1 The PGD method to optimize problem (11) Input: The given tuples {(Ai, Cj)}; the initialization of (A, C); and the learning rate τ; According to Theorem 1, compute the canonical formulations of {(Ai, Ci)}N i=1 and (A, C) as {(Λi, V i, U i)}N i=1 and (Λ, V , U), respectively; for t = 1 to maxIter do Compute the gradients according to Theorem 4: ∇Λ, ∇V , ∇U; Update V : V = V −τLV (I2n + τ 2RT V LV )−1RT V V with LV and RV defined in Eq. (16); Update U: U = U −τLU(I2n + τ 2RT ULU)−1RT UU with LU and RU defined in Eq. (17); Update Λ: λk = ε max(ε,|λk−τ∇λk|)(λk −τ∇λk); end for Output: the system tuple (Λ, V , U). 4.5 Extensions for Other Kernels The proposed solution is general in nature and can be used with other kernel functions such as the Martin kernel [25] and Binet-Cauchy kernel [19]. The Martin kernel is defined as km (A1, C1), (A2, C2)  = det  G−1 11 G12G−1 22 G21  , (19) with Gij as in Eq.(5). The determinant version of the Binet-Cauchy kernel is defined as kb (A1, C1), (A2, C2)  = det  C1MCT 2  , (20) where M satisfies e−λbA1MAT 2 −M = −x1(1)xT 2 (1), λb is the exponential discounting rate, and x1(1), x2(1) are the initial hidden states of the two compared LDSs. Both the Martin kernel and Binet-Cauchy kernel are computed by DLEs. Thus, Theorem 4 can be employed to compute the gradients w.r.t. the system tuple for them. 6 5 Experiments In this section, we first compare the performance of our proposed method (see Algorithm 1), called as PGD, with previous state-of-the-art methods for the task of clustering and sparse coding using the DynTex++ [28] dataset. We then evaluate the classification accuracies of various state-of-the-art methods with PGD on two video datasets, namely the YUPENN [29] and the DynTex [30] datasets. The above datasets have been widely used in evaluating LDS-based algorithms in the literature, and their details are presented in the supplementary material. In all experiments, the hidden order of LDS (n in Eq. (1)) is fixed to 10. To learn an LDS dictionary, we use the sparsity factor of 0.1 (λ in Eq.(9)). The LDS tuples for all input sequences are learned by the method in [1] and the transition matrices are stabilized by the soft-normalization technique in [5]. 5.1 Models Comparison This experiment uses the DynTex++ datasets. We extract the histogram of LBP from Three Orthogonal Planes (LBP-TOP) [31] by splitting each video into sub-videos of length 8, with a 6-frame overlap. The LBP-TOP features are fed to LDSs to identify the system parameters. For clustering, we compare our PGD with the MDS method with the Martin Kernel [11] and the Align algorithm [14]. For sparse coding, two related methods are compared: Grass [13] and LDSST [5]. We follow [13] and use 3-step observability matrices for the Grass method (hence Grass-3 below). In LDSST, the transition matrices are enforced to be symmetric. All algorithms are randomly initialized and the average results over 10 times are reported. 4 8 16 32 64 128 NumberOfClusters 0 0.2 0.4 0.6 0.8 Purity PGD Align MDS 4 8 16 32 64 128 NumberOfClusters 0 200 400 600 Time Per Epoch PGD Align MDS Figure 1: The clustering performance of the MDS, Align and PGD algorithms with varying number of clusters on DynTex++. 5.1.1 Clustering To evaluate the clustering performance, we apply the purity metric [32], which is given by p = 1 N P k maxi ci,k, where ci,k counts the number of samples from i-th class in k-th cluster; N is the number of the data. A higher purity means a better performance. For the Align algorithm, we varied the learning rate when optimizing the aligning matrices and chose the value that delivered the best performance. For our PGD algorithm, we selected the learning rate as 0.1 for Λ and V and 1 for U. Fig. 1 reports the clustering performance of the compared methods. Our method consistently outperforms both MDS and Align methods over various number of clusters. We also report the running time for one epoch of each algorithm in Fig. 1. Here, one epoch means one update of the clustering centers through all data samples. Fig. 1 shows that PGD performs faster that both the MDS and Align algorithms, probably because the MDS method recomputes the kernel-matrix for the embedding at each epoch and the Align algorithm calculates the aligning distance in an iterative way. 5.1.2 Sparse Coding In this experiment, we used half of samples from DynTex++ for training the dictionary and the other half for testing. As the objective of (11) is in a sum-minimize form, we can employ the stochastic version of Algorithm 1 to optimize (11) for large-scale dataset. This can be achieved by sampling a mini-batch to update the system tuple at each iteration. Therefore, in addition to the full batch version, we also carried out the stochastic PGD with the mini-bach of size 128, which is denoted as PGD-128. The learning rates of both full PGD and PGD-128 were selected as 0.1 for Λ and V and 1 for U, and their values were decreased by half every 10 epoch. Different from PGD, the Grass and LDSST methods require the whole dataset in hand for learning the dictionary at each epoch, and thus they can not support the update via mini-batches. 7 10 100 1000 10000 Time (s) -1.5 -1 -0.5 0 Testing NR PGD-full PGD-128 LDSST Grass-3 (a) J = 4 10 100 1000 10000 50000 Time (s) -1 -0.8 -0.6 -0.4 -0.2 0 Testing NR PGD-full PGD-128 LDSST Grass-3 (b) J = 8 10 100 1000 10000 50000 Time (s) -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0 Testing NR PGD-full PGD-128 LDSST Grass-3 (c) J = 16 Figure 2: Testing reconstruction errors of Grass-3, LDSST, PGD-full and PGD-128 with different dictionary sizes on DynTex++. The PGD-128 method converges much faster than other counterparts. Although Grass-3 converges to a bit smaller error than PGD-128 when J = 4 (see (a)), it performs worse than PGD-128 when the value of J is increasing (see (b) and (c)). It is unfair to directly compare the reconstruction errors (Eq. (9)) of different methods, since their values are calculated by different metrics. Therefore, we make use of the normalized reconstruction error defined as NR = Rt−Rinit Rinit , where Rinit and Rt are corresponded to the reconstruction errors at the initial step and the t-th epoch, respectively. Fig. 2 shows the normalized reconstruction errors on testing set of PGDs, Grass-3 and the LDSST method during the learning process for various dictionary sizes. PGD-128 converges to lower errors than PGD-full on all experiments, indicating that the stochastic sampling strategy is helpful to escaping from the poor local minima. PGD-128 consistently outperforms both Grass-3 and LDSST in terms of the learning speed and the final error. The computational complexities of updating one dictionary atom for the Grass and the LDSST method are O((J + N)L2n2m2)) and O((J + N)n2m2)), respectively. Here, J is the dictionary size, N is the number of data, and n and m are LDS parameters defined in Eq. (1). In contrast, PGD requires to calculate the projected gradients of the canonical tuples which scales to only O((J + N)n2m). As shown in Fig. 2, PGD is more than 50 times faster than the Grass-3 and LDSST methods per epoch. 5.2 Video Classification Classifying YUPENN or DynTex videos is challenging as the videos are recoded under various viewpoints and scales. To deliver robust features, we implement two kinds of high-level pooling frameworks: Bag-of-Systems (BoS) [11] and Spatial-Temporal-Pyramid-Matching (STPM) [16]3. In particular, 1) BoS is performed with the clustering methods, i.e., MDS, Align and PGD. The BoS framework models the local spatio-temporal blocks with LDSs and then clusters the LDS descriptors to obtain the codewords; 2)The STPM framework works in conjunction with the sparse coding approaches (i.e., Grass-3, LDSST and the PGD methods). Unlike BoS that represents a video by unordered local descriptors, STPM partitions a video into segments under different scales (2-level scales are considered here) and concatenates all local descriptors for each segment to form a vectorized representation. The codewords are provided by learning a dictionary. For the BoS methods, we apply the nonlinear SVM as the classifier where the radial basis kernel with χ2 distance [33] is employed; while for the STPM methods, we utilize linear SVM for classification. Table 1: Mean classification accuracies (percentage) on the YUPENN and DynTex datasets. Datasets References +BoS +STPM MDS Align PGD Grass-3 LDSST PGD YUPENN 85 [10] 83.3 82.1 84.1 91.6 90.7 93.6 DynTex 59.5 62.7 65.4 75.1 75.1 76.5 YUPENN. The non-overlapping spatio-temporal blocks of size 8 × 8 × 25 were sampled from the videos. The number of the codewords for all BoS and STPM methods was set to 128. We sampled 50 blocks from each video to learn the codewords for the MDS, Align, Grass-3 and LDSST methods. For PGD, we updated the codewords by mini-batches. To maintain the diversity within each mini-batch, a 3 In the experiments, we consider the projection kernel as defined in Eq. (5). We have also conducted additional experiments by considering a new kernel, namely the Martin kernel (Eq. (19)). The results are provided in the supplementary material. 8 hierarchical approach was used. In particular, at each iteration, we first randomly sampled 20 videos from the dataset and then sampled 4 blocks from each of the videos, leading to a mini-batch of size N ′ = 80. The learning rates were set as 0.5 for Λ and V and 5 for U, and their values were decreased by half every 10 epochs. The test protocol is the leave-one-video-out as suggested in [29], leading to a total of 420 trials. Table 1 shows that the STPM methods achieve better accuracies than the BoS approaches; within the same pooling framework, our PGD always outperforms other compared models. For the probabilistic clustering method [10], the result on YUPENN is 85% reported in Table 1. Note that in [10], a richer number of dictionary has been applied. DynTex. For the Dyntex dataset, the spatio-temporal blocks of size 16 × 16 × 50 were sampled in a non-overlapping way. The number of the codewords for all methods was chosen as 64. We applied the same sampling strategy as that on YUPENN to learn the codewords for all compared methods. As shown in Table 1, the proposed method is superior compared to the studied models with both BoS and STPM coding strategies. 6 Conclusion We propose an efficient Projected-Gradient-Decent (PGD) method to optimize problem (11). Our algorithm can be used to perform clustering and sparse coding with LDSs. In contrast to previous studies, our solution avoids any approximation in LDS modeling or during the optimization process. Extensive experiments on clustering and sparse coding verify the effectiveness of the proposed method in terms of the convergence performance and learning speed. We also explore the combination of PGD with two high-level pooling frameworks, namely Bag-of-Systems (BoS) and Spatial-TemporalPyramid-Matching for video classification. The experimental results demonstrate that our PGD method outperforms state-of-the-art methods consistently. Acknowledgments This research was supported in part by the National Science Foundation of China (NSFC) (Grant No: 91420302, 91520201,61210013 and 61327809), the NSFC and the German Research of Foundation (DFG) in project Crossmodal Learning (Grant No: NSFC 61621136008/ DFG TRR-169), and the National High-Tech Research and Development Plan under Grant 2015AA042306. Besides, Tong Zhang was supported by Australian Research Council’s Discovery Projects funding scheme (project DP150104645). References [1] Gianfranco Doretto, Alessandro Chiuso, Ying Nian Wu, and Stefano Soatto. Dynamic textures. International Journal of Computer Vision (IJCV), 51(2):91–109, 2003. [2] Tae-Kyun Kim and Roberto Cipolla. Canonical correlation analysis of video volume tensors for action categorization and detection. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 31(8):1415–1428, 2009. [3] Chuang Gan, Naiyan Wang, Yi Yang, Dit-Yan Yeung, and Alex G Hauptmann. Devnet: A deep event network for multimedia event detection and evidence recounting. In CVPR, pages 2568–2577. [4] Chuang Gan, Ting Yao, Kuiyuan Yang, Yi Yang, and Tao Mei. You lead, we exceed: Labor-free video concept learning by jointly exploiting web videos and images. In CVPR, pages 923–932, 2016. [5] Wenbing Huang, Fuchun Sun, Lele Cao, Deli Zhao, Huaping Liu, and Mehrtash Harandi. Sparse coding and dictionary learning with linear dynamical systems. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR). IEEE, 2016. [6] Sajid M Siddiqi, Byron Boots, and Geoffrey J Gordon. A constraint generation approach to learning stable linear dynamical systems. In Advances in Neural Information Processing Systems (NIPS), 2007. [7] Wenbing Huang, Lele Cao, Fuchun Sun, Deli Zhao, Huaping Liu, and Shanshan Yu. Learning stable linear dynamical systems with the weighted least square method. In Proceedings of the International Joint Conference on Artificial Intelligence (IJCAI), 2016. [8] Søren Johansen. Likelihood-based inference in cointegrated vector autoregressive models. Oxford University Press on Demand, 1995. 9 [9] Bijan Afsari and René Vidal. Distances on spaces of high-dimensional linear stochastic processes: A survey. In Geometric Theory of Information, pages 219–242. Springer, 2014. [10] Adeel Mumtaz, Emanuele Coviello, Gert RG Lanckriet, and Antoni B Chan. A scalable and accurate descriptor for dynamic textures using bag of system trees. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 37(4):697–712, 2015. [11] Avinash Ravichandran, Rizwan Chaudhry, and Rene Vidal. Categorizing dynamic textures using a bag of dynamical systems. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 35(2):342–353, 2013. [12] Pavan Turaga, Ashok Veeraraghavan, Anuj Srivastava, and Rama Chellappa. Statistical computations on Grassmann and Stiefel manifolds for image and video-based recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 33(11):2273–2286, 2011. [13] Mehrtash Harandi, Richard Hartley, Chunhua Shen, Brian Lovell, and Conrad Sanderson. Extrinsic methods for coding and dictionary learning on Grassmann manifolds. International Journal of Computer Vision (IJCV), 114(2):113–136, 2015. [14] Bijan Afsari, Rizwan Chaudhry, Avinash Ravichandran, and René Vidal. Group action induced distances for averaging and clustering linear dynamical systems with applications to the analysis of dynamic scenes. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 2208–2215. IEEE, 2012. [15] Zaiwen Wen and Wotao Yin. A feasible method for optimization with orthogonality constraints. Mathematical Programming, 142(1-2):397–434, 2013. [16] Jianchao Yang, Kai Yu, Yihong Gong, and Thomas Huang. Linear spatial pyramid matching using sparse coding for image classification. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 1794–1801. IEEE, 2009. [17] Antoni B Chan and Nuno Vasconcelos. Probabilistic kernels for the classification of auto-regressive visual processes. In IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR), volume 1, pages 846–851. IEEE, 2005. [18] Franco Woolfe and Andrew Fitzgibbon. Shift-invariant dynamic texture recognition. In European Conference on Computer Vision (ECCV), pages 549–562. Springer, 2006. [19] SVN Vishwanathan, Alexander J Smola, and René Vidal. Binet-Cauchy kernels on dynamical systems and its application to the analysis of dynamic scenes. International Journal of Computer Vision (IJCV), 73(1):95–119, 2007. [20] Payam Saisan, Gianfranco Doretto, Ying Nian Wu, and Stefano Soatto. Dynamic texture recognition. In IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR), volume 2, pages II–58. IEEE, 2001. [21] Antoni B Chan and Nuno Vasconcelos. Classifying video with kernel dynamic textures. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 1–6. IEEE, 2007. [22] Katrien De Cock and Bart De Moor. Subspace angles between ARMA models. Systems & Control Letters, 46(4):265–270, 2002. [23] Antoni B. Chan, Emanuele Coviello, and Gert RG Lanckriet. Clustering dynamic textures with the hierarchical EM algorithm. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 2022–2029. IEEE, 2010. [24] Antoni B. Chan, Emanuele Coviello, and Gert RG Lanckriet. Clustering dynamic textures with the hierarchical EM algorithm for modeling video. 35(7):1606–1621, 2013. [25] Richard J Martin. A metric for ARMA processes. IEEE Transactions on Signal Processing, 48(4):1164– 1170, 2000. [26] A Barraud. A numerical algorithm to solve aˆ{T} xa-x= q. IEEE Transactions on Automatic Control, 22(5):883–885, 1977. [27] Dan Kalman. A singularly valuable decomposition: the svd of a matrix. The college mathematics journal, 27(1):2–23, 1996. [28] Bernard Ghanem and Narendra Ahuja. Maximum margin distance learning for dynamic texture recognition. In European Conference on Computer Vision (ECCV), pages 223–236. Springer, 2010. 10 [29] Konstantinos G Derpanis, Matthieu Lecce, Kostas Daniilidis, and Richard P Wildes. Dynamic scene understanding: The role of orientation features in space and time in scene classification. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 1306–1313. IEEE, 2012. [30] Renaud Péteri, Sándor Fazekas, and Mark J. Huiskes. DynTex : a Comprehensive Database of Dynamic Textures. Pattern Recognition Letters, doi: 10.1016/j.patrec.2010.05.009, 2010. http://projects.cwi.nl/dyntex/. [31] Guoying Zhao and Matti Pietikainen. Dynamic texture recognition using local binary patterns with an application to facial expressions. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 29(6):915–928, 2007. [32] Anna Huang. Similarity measures for text document clustering. In Proceedings of the sixth new zealand computer science research student conference (NZCSRSC2008), Christchurch, New Zealand, pages 49–56, 2008. [33] Richard O Duda, Peter E Hart, and David G Stork. Pattern classification. John Wiley & Sons, 2012. 11
2017
593
7,111
Deep Subspace Clustering Networks Pan Ji∗ University of Adelaide Tong Zhang∗ Australian National University Hongdong Li Australian National University Mathieu Salzmann EPFL - CVLab Ian Reid University of Adelaide Abstract We present a novel deep neural network architecture for unsupervised subspace clustering. This architecture is built upon deep auto-encoders, which non-linearly map the input data into a latent space. Our key idea is to introduce a novel self-expressive layer between the encoder and the decoder to mimic the “selfexpressiveness” property that has proven effective in traditional subspace clustering. Being differentiable, our new self-expressive layer provides a simple but effective way to learn pairwise affinities between all data points through a standard backpropagation procedure. Being nonlinear, our neural-network based method is able to cluster data points having complex (often nonlinear) structures. We further propose pre-training and fine-tuning strategies that let us effectively learn the parameters of our subspace clustering networks. Our experiments show that our method significantly outperforms the state-of-the-art unsupervised subspace clustering techniques. 1 Introduction In this paper, we tackle the problem of subspace clustering [42] – a sub-field of unsupervised learning – which aims to cluster data points drawn from a union of low-dimensional subspaces in an unsupervised manner. Subspace clustering has become an important problem as it has found various applications in computer vision, e.g., image segmentation [50, 27], motion segmentation [17, 9], and image clustering [14, 10]. For example, under Lambertian reflectance, the face images of one subject obtained with a fixed pose and varying lighting conditions lie in a low-dimensional subspace of dimension close to nine [2]. Therefore, one can employ subspace clustering to group images of multiple subjects according to their respective subjects. Most recent works on subspace clustering [49, 6, 10, 23, 46, 26, 16, 52] focus on clustering linear subspaces. However, in practice, the data do not necessarily conform to linear subspace models. For instance, in the example of face image clustering, reflectance is typically non-Lambertian and the pose of the subject often varies. Under these conditions, the face images of one subject rather lie in a non-linear subspace (or sub-manifold). A few works [5, 34, 35, 51, 47] have proposed to exploit the kernel trick [40] to address the case of non-linear subspaces. However, the selection of different kernel types is largely empirical, and there is no clear reason to believe that the implicit feature space corresponding to a predefined kernel is truly well-suited to subspace clustering. In this paper, by contrast, we introduce a novel deep neural network architecture to learn (in an unsupervised manner) an explicit non-linear mapping of the data that is well-adapted to subspace clustering. To this end, we build our deep subspace clustering networks (DSC-Nets) upon deep auto-encoders, which non-linearly map the data points to a latent space through a series of encoder ∗Authors contributed equally to this work 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. layers. Our key contribution then consists of introducing a novel self-expressive layer – a fully connected layer without bias and non-linear activations – at the junction between the encoder and the decoder. This layer encodes the “self-expressiveness” property [38, 9] of data drawn from a union of subspaces, that is, the fact that each data sample can be represented as a linear combination of other samples in the same subspace. To the best of our knowledge, our approach constitutes the first attempt to directly learn the affinities (through combination coefficients) between all data points within one neural network. Furthermore, we propose effective pre-training and fine-tuning strategies to learn the parameters of our DSC-Nets in an unsupervised manner and with a limited amount of data. We extensively evaluate our method on face clustering, using the Extended Yale B [21] and ORL [39] datasets, and on general object clustering, using COIL20 [31] and COIL100 [30]. Our experiments show that our DSC-Nets significantly outperform the state-of-the-art subspace clustering methods. 2 Related Work Subspace Clustering. Over the years, many methods have been developed for linear subspace clustering. In general, these methods consist of two steps: the first and also most crucial one aims to estimate an affinity for every pair of data points to form an affinity matrix; the second step then applies normalized cuts [41] or spectral clustering [32] using this affinity matrix. The resulting methods can then be roughly divided into three categories [42]: factorization methods [7, 17, 44, 29, 16], higher-order model based methods [49, 6, 33, 37], and self-expressiveness based methods [9, 24, 26, 46, 15, 12, 22, 52]. In essence, factorization methods build the affinity matrix by factorizing the data matrix, and methods based on higher-order models estimate the affinities by exploiting the residuals of local subspace model fitting. Recently, self-expressiveness based methods, which seek to express the data points as a linear combination of other points in the same subspace, have become the most popular ones. These methods build the affinity matrix using the matrix of combination coefficients. Compared to factorization techniques, self-expressiveness based methods are often more robust to noise and outliers when relying on regularization terms to account for data corruptions. They also have the advantage over higher-order model based methods of considering connections between all data points rather than exploiting local models, which are often suboptimal. To handle situations where data points do not exactly reside in a union of linear subspaces, but rather in non-linear ones, a few works [34, 35, 51, 47] have proposed to replace the inner product of the data matrix with a pre-defined kernel matrix (e.g., polynomial kernel and Gaussian RBF kernel). There is, however, no clear reason why such kernels should correspond to feature spaces that are well-suited to subspace clustering. By contrast, here, we propose to explicitly learn one that is. Auto-Encoders. Auto-encoders (AEs) can non-linearly transform data into a latent space. When this latent space has lower dimension than the original one [13], this can be viewed as a form of non-linear PCA. An auto-encoder typically consists of an encoder and a decoder to define the data reconstruction cost. With the success of deep learning [20], deep (or stacked) AEs have become popular for unsupervised learning. For instance, deep AEs have proven useful for dimensionality reduction [13] and image denoising [45]. Recently, deep AEs have also been used to initialize deep embedding networks for unsupervised clustering [48]. A convolutional version of deep AEs was also applied to extract hierarchical features and to initialize convolutional neural networks (CNNs) [28]. There has been little work in the literature combining deep learning with subspace clustering. To the best of our knowledge, the only exception is [36], which first extracts SIFT [25] or HOG [8] features from the images and feeds them to a fully connected deep auto-encoder with a sparse subspace clustering (SSC) [10] prior. The final clustering is then obtained by applying k-means or SSC on the learned auto-encoder features. In essence, [36] can be thought of as a subspace clustering method based on k-means or SSC with deep auto-encoder features. Our method significantly differs from [36] in that our network is designed to directly learn the affinities, thanks to our new self-expressive layer. 3 Deep Subspace Clustering Networks (DSC-Nets) Our deep subspace clustering networks leverage deep auto-encoders and the self-expressiveness property. Before introducing our networks, we first discuss this property in more detail. 2 Figure 1: Deep Convolutional Auto-Encoder: The input xi is mapped to zi through an encoder, and then reconstructed as ˆxi through a decoder. We use shaded circles to denote data vectors and shaded squares to denote the channels after convolution or deconvolution. We do not enforce the weights of the corresponding encoder and decoder layers to be coupled (or the same). 3.1 Self-Expressiveness Given data points {xi}i=1,··· ,N drawn from multiple linear subspaces {Si}i=1,··· ,K, one can express a point in a subspace as a linear combination of other points in the same subspace. In the literature [38, 9], this property is called self-expressiveness. If we stack all the points xi into columns of a data matrix X, the self-expressiveness property can be simply represented as one single equation, i.e., X = XC, where C is the self-representation coefficient matrix. It has been shown in [15] that, under the assumption that the subspaces are independent, by minimizing certain norms of C, C is guaranteed to have a block-diagonal structure (up to certain permutations), i.e., cij ̸= 0 iff point xi and point xj lie in the same subspace. So we can leverage the matrix C to construct the affinity matrix for spectral clustering. Mathematically, this idea is formalized as the optimization problem min C ∥C∥p s.t. X = XC, (diag(C) = 0) , (1) where ∥· ∥p represents an arbitrary matrix norm, and the optional diagonal constraint on C prevents trivial solutions for sparsity inducing norms, such as the ℓ1 norm. Various norms for C have been proposed in the literature, e.g., the ℓ1 norm in Sparse Subspace Clustering (SSC) [9, 10], the nuclear norm in Low Rank Representation (LRR) [24, 23] and Low Rank Subspace Clustering (LRSC) [11, 43], and the Frobenius norm in Least-Squares Regression (LSR) [26] and Efficient Dense Subspace Clustering (EDSC) [15]. To account for data corruptions, the equality constraint in (1) is often relaxed as a regularization term, leading to min C ∥C∥p + λ 2 ∥X −XC∥2 F s.t. (diag(C) = 0) . (2) Unfortunately, the self-expressiveness property only holds for linear subspaces. While kernel based methods [34, 35, 51, 47] aim to tackle the non-linear case, it is not clear that pre-defined kernels yield implicit feature spaces that are well-suited for subspace clustering. In this work, we aim to learn an explicit mapping that makes the subspaces more separable. To this end, and as discussed below, we propose to build our networks upon deep auto-encoders. 3.2 Self-Expressive Layer in Deep Auto-Encoders Our goal is to train a deep auto-encoder, such as the one depicted by Figure 1, such that its latent representation is well-suited to subspace clustering. To this end, we introduce a new layer that encodes the notion of self-expressiveness. Specifically, let Θ denote the auto-encoder parameters, which can be decomposed into encoder parameters Θe and decoder parameters Θd. Furthermore, let ZΘe denote the output of the encoder, i.e., the latent representation of the data matrix X. To encode self-expressiveness, we introduce a new loss function defined as L(Θ, C) = 1 2∥X −ˆXΘ∥2 F + λ1∥C∥p + λ2 2 ∥ZΘe −ZΘeC∥2 F s.t. (diag(C) = 0) , (3) where ˆXΘ represents the data reconstructed by the auto-encoder. To minimize (3), we propose to leverage the fact that, as discussed below, C can be thought of as the parameters of an additional network layer, which lets us solve for Θ and C jointly using backpropagation.1 1Note that one could also alternate minimization between Θ and C. However, since the loss is non-convex, this would not provide better convergence guarantees and would require investigating the influence of the number of steps in the optimization w.r.t. Θ on the clustering results. 3 Figure 2: Deep Subspace Clustering Networks: As an example, we show a deep subspace clustering network with three convolutional encoder layers, one self-expressive layer, and three deconvolutional decoder layer. During training, we first pre-train the deep auto-encoder without the self-expressive layer; we then fine-tune our entire network using this pre-trained model for initialization. Specifically, consider the self-expressiveness term in (3), ∥ZΘe −ZΘeC∥2 F . Since each data point zi (in the latent space) is approximated by a weighted linear combination of other points {zj}j=1,··· ,N (optionally, j ̸= i) with weights cij, this linear operation corresponds exactly to a set of linear neurons without non-linear activations. Therefore, if we take each zi as a node in the network, we can then represent the self-expressiveness term with a fully-connected linear layer, which we call the self-expressive layer. The weights of the self-expressive layer correspond to the matrix C in (3), which are further used to construct affinities between all data points. Therefore, our self-expressive layer essentially lets us directly learn the affinity matrix via the network. Moreover, minimizing ∥C∥p simply translates to adding a regularizer to the weights of the self-expressive layer. In this work, we consider two kinds of regularizations on C: (i) the ℓ1 norm, resulting in a network denoted by DSC-Net-L1; (ii) the ℓ2 norm, resulting in a network denoted by DSC-Net-L2. For notational consistency, let us denote the parameters of the self-expressive layer (which are just the elements of C) as Θs. As can be seen from Figure 2, we then take the input to the decoder part of our network to be the transformed latent representation ZΘeΘs. This lets us re-write our loss function as ˜L(˜Θ) = 1 2∥X −ˆX ˜Θ∥2 F + λ1∥Θs∥p + λ2 2 ∥ZΘe −ZΘeΘs∥2 F s.t. (diag(Θs) = 0) , (4) where the network parameters ˜Θ now consist of encoder parameters Θe, self-expressive layer parameters Θs, and decoder parameters Θd, and where the reconstructed data ˆX is now a function of {Θe, Θs, Θd} rather than just {Θe, Θd} in (3). 3.3 Network Architecture Our network consists of three parts, i.e., stacked encoders, a self-expressive layer, and stacked decoders. The overall network architecture is shown in Figure 2. In this paper, since we focus on image clustering problems, we advocate the use of convolutional auto-encoders that have fewer parameters than the fully connected ones and are thus easier to train. Note, however, that fullyconnected auto-encoders are also compatible with our self-expressive layer. In the convolutional layers, we use kernels with stride 2 in both horizontal and vertical directions, and rectified linear unit (ReLU) [19] for the non-linear activations. Given N images to be clustered, we use all the images in a single batch. Each input image is mapped by the convolutional encoder layers to a latent vector (or node) zi, represented as a shaded circle in Figure 2. In the self-expressive layer, the nodes are fully connected using linear weights without bias and non-linear activations. The latent vectors are then mapped back to the original image space via the deconvolutional decoder layers. For the ith encoder layer with ni channels of kernel size ki × ki, the number of weight parameters is k2 i ni−1ni, with n0 = 1. Since the encoders and decoders have symmetric structures, their total number of parameters is P i 2k2 i ni−1ni plus the number of bias parameters P i 2ni −n1 + 1. For N input images, the number of parameters for the self-expressive layer is N 2. For example, if we have 4 Figure 3: From the parameters of the self-expressive layer, we construct an affinity matrix, which we use to perform spectral clustering to get the final clusters. Best viewed in color. three encoder layers with 10, 20, and 30 channels, respectively, and all convolutional kernels are of size 3×3, then the number of parameters for encoders and decoders is P3 i=1 2(k2 i ni−1 +1)ni −n1 +1 = 14671. If we have 1000 input images, then the number of parameters in the self-expressive layer is 106. Therefore, the network parameters are typically dominated by those of the self-expressive layer. 3.4 Training Strategy Since the size of datasets for unsupervised subspace clustering is usually limited (e.g., in the order of thousands of images), our networks remain of a tractable size. However, for the same reason, it also remains difficult to directly train a network with millions of parameters from scratch. To address this, we design the pre-training and fine-tuning strategies described below. Note that this also allows us to avoid the trivial all-zero solution while minimizing the loss (4). As illustrated in Figure 2, we first pre-train the deep auto-encoder without the self-expressive layer on all the data we have. We then use the trained parameters to initialize the encoder and decoder layers of our network. After this, in the fine-tuning stage, we build a big batch using all the data to minimize the loss ˜L(Θ) defined in (4) with a gradient descent method. Specifically, we use Adam [18], an adaptive momentum based gradient descent method, to minimize the loss, where we set the learning rate to 1.0 × 10−3 in all our experiments. Since we always use the same batch in each training epoch, our optimization strategy is rather a deterministic momentum based gradient method than a stochastic gradient method. Note also that, since we only have access to images for training and not to cluster labels, our training strategy is unsupervised (or self-supervised). Once the network is trained, we can use the parameters of the self-expressive layer to construct an affinity matrix for spectral clustering [32], as illustrated in Figure 3. Although such an affinity matrix could in principle be computed as |C| + |CT |, over the years, researchers in the field have developed many heuristics to improve the resulting matrix. Since there is no globally-accepted solution for this step in the literature, we make use of the heuristics employed by SSC [10] and EDSC [15]. Due to the lack of space, we refer the reader to the publicly available implementation of SSC and Section 5 of [15], as well as to the TensorFlow implementation of our algorithm 2 for more detail. 4 Experiments We implemented our method in Python with Tensorflow-1.0 [1], and evaluated it on four standard datasets, i.e., the Extended Yale B and ORL face image datasets, and the COIL20/100 object image datasets. We compare our methods against the following baselines: Low Rank Representation (LRR) [23], Low Rank Subspace Clustering (LRSC) [43], Sparse Subspace Clustering (SSC) [10], Kernel Sparse Subspace Clustering (KSSC) [35], SSC by Orthogonal Matching Pursuit (SSCOMP) [53], Efficient Dense Subspace Clustering (EDSC) [15], SSC with the pre-trained convolutional auto-encoder features (AE+SSC), and EDSC with the pre-trained convolutional auto-encoder features (AE+EDSC). For all the baselines, we used the source codes released by the authors and tuned the parameters by grid search to the achieve best results on each dataset. Since the code for the deep subspace clustering method of [36] is not publicly available, we are only able to provide a comparison 2https://github.com/panji1990/Deep-subspace-clustering-networks 5 (a) Extended Yale B (b) ORL (c) COIL20 and COIL100 Figure 4: Sample images from Extended Yale B, ORL , COIL20 and COIL100. layers encoder-1 encoder-2 encoder-3 self-expressive decoder-1 decoder-2 decoder-3 kernel size 5 × 5 3 × 3 3 × 3 – 3 × 3 3 × 3 5 × 5 channels 10 20 30 – 30 20 10 parameters 260 1820 5430 5914624 5420 1810 251 Table 1: Network settings for Extended Yale B. against this approach on Extended Yale B and COIL20, for which the results are provided in [36]. Note that this comparison already clearly shows the benefits of our approach. For all quantitative evaluations, we make use of the clustering error rate, defined as err % = # of wrongly clustered points total # of points × 100% . (5) 4.1 Extended Yale B Dataset The Extended Yale B dataset [21] is a popular benchmark for subspace clustering. It consists of 38 subjects, each of which is represented with 64 face images acquired under different illumination conditions (see Figure 4(a) for sample images from this dataset). Following the experimental setup of [10], we down-sampled the original face images from 192 × 168 to 42 × 42 pixels, which makes it computationally feasible for the baselines [10, 23]. In each experiment, we pick K ∈ {10, 15, 20, 25, 30, 35, 38} subjects (each subject with 64 face images) to test the robustness w.r.t. an increasing number of clusters. Taking all possible combinations of K subjects out of 38 would result in too many experimental trials. To get a manageable size of experiments, we first number the subjects from 1 to 38 and then take all possible K consecutive subjects. For example, in the case of 10 subjects, we take all the images from subject 1 −10, 2 −11, · · · , 29 −38, giving rise to 29 experimental trials. We experimented with different architectures for the convolutional layers of our network, e.g., different network depths and number of channels. While increasing these values increases the representation power of the network, it also increases the number of network parameters, thus requiring larger training datasets. Since the size of Extended Yale B is quite limited, with only 2432 images, we found having three-layer encoders and decoders with [10, 20, 30] channels to be a good trade-off for this dataset. The detailed network settings are described in Table 1. In the fine-tuning phase, since the number of epochs required for gradient descent increases as the number of subjects K increases, we defined the number of epochs for DSC-Net-L1 as 160 + 20K and for DSC-Net-L2 as 50 + 25K. We set the regularization parameters to λ1 = 1.0, λ2 = 1.0 × 10 K 10 −3. The clustering performance of different methods for different numbers of subjects is provided in Table 2. For the experiments with K subjects, we report the mean and median errors of 39 −K experimental trials. From these results, we can see that the performance of most of the baselines decreases dramatically as the number of subjects K increases. By contrast, the performance of our deep subspace clustering methods, DSC-Net-L1 and DSC-Net-L2, remains relatively stable w.r.t. the number of clusters. Specifically, our DSC-Net-L2 achieves 2.67% error rate for 38 subjects, which is only around 1/5 of the best performing baseline EDSC. We also observe that using the pre-trained auto-encoder features does not necessarily improve the performance of SSC and EDSC, which confirms the benefits of our joint optimization of all parameters in one network. The results of [36] on this dataset for 38 subjects was reported to be 92.08 ± 2.42% in terms of clustering accuracy, or equivalently 7.92 ± 2.42% in terms of clustering error, which is worse than both our methods – DSC-Net-L1 and DSC-Net-L2. We further notice that DSC-Net-L1 performs slightly worse than DSC-Net-L2 in the current experimental settings. We conjecture that this is due to the difficulty in optimization introduced by the ℓ1 norm as it is non-differentiable at zero. 6 Method LRR LRSC SSC AE+ SSC KSSC SSCOMP EDSC AE+ EDSC DSCNet-L1 DSCNet-L2 10 subjects Mean 22.22 30.95 10.22 17.06 14.49 12.08 5.64 5.46 2.23 1.59 Median 23.49 29.38 11.09 17.75 15.78 8.28 5.47 6.09 2.03 1.25 15 subjects Mean 23.22 31.47 13.13 18.65 16.22 14.05 7.63 6.70 2.17 1.69 Median 23.49 31.64 13.40 17.76 17.34 14.69 6.41 5.52 2.03 1.72 20 subjects Mean 30.23 28.76 19.75 18.23 16.55 15.16 9.30 7.67 2.17 1.73 Median 29.30 28.91 21.17 16.80 17.34 15.23 10.31 6.56 2.11 1.80 25 subjects Mean 27.92 27.81 26.22 18.72 18.56 18.89 10.67 10.27 2.53 1.75 Median 28.13 26.81 26.66 17.88 18.03 18.53 10.84 10.22 2.19 1.81 30 subjects Mean 37.98 30.64 28.76 19.99 20.49 20.75 11.24 11.56 2.63 2.07 Median 36.82 30.31 28.59 20.00 20.94 20.52 11.09 10.36 2.81 2.19 35 subjects Mean 41.85 31.35 28.55 22.13 26.07 20.29 13.10 13.28 3.09 2.65 Median 41.81 31.74 29.04 21.74 25.92 20.18 13.10 13.21 3.10 2.64 38 subjects Mean 34.87 29.89 27.51 25.33 27.75 24.71 11.64 12.66 3.33 2.67 Median 34.87 29.89 27.51 25.33 27.75 24.71 11.64 12.66 3.33 2.67 Table 2: Clustering error (in %) on Extended Yale B. The lower the better. layers encoder-1 encoder-2 encoder-3 self-expressive decoder-1 decoder-2 decoder-3 kernel size 5 × 5 3 × 3 3 × 3 – 3 × 3 3 × 3 5 × 5 channels 5 3 3 – 3 3 5 parameters 130 138 84 160000 84 140 126 Table 3: Network settings for ORL. 4.2 ORL Dataset The ORL dataset [39] is composed of 400 human face images, with 40 subjects each having 10 samples. Following [4], we down-sampled the original face images from 112 × 92 to 32 × 32. For each subject, the images were taken under varying lighting conditions with different facial expressions (open / closed eyes, smiling / not smiling) and facial details (glasses / no glasses)(see Figure 4(b) for sample images). Compared to Extended Yale B, this dataset is more challenging for subspace clustering because (i) the face subspaces have more non-linearity due to varying facial expressions and details; (ii) the dataset size is much smaller (400 vs. 2432). To design a trainable deep auto-encoder on 400 images, we reduced the number of network parameters by decreasing the number of channels in each encoder and decoder layer. The resulting network is specified in Table 3. Since we already verified the robustness of our method to the number of clusters in the previous experiment, here, we only provide results for clustering all 40 subjects. In this setting, we set λ1 = 1 and λ2 = 0.2 and run 700 epochs for DSC-Net-L2 and 1500 epochs for DSC-Net-L1 during fine-tuning. Note that, since the size of this dataset is small, we can even use the whole data as a single batch in pre-training. We found this to be numerically more stable and converge faster than stochastic gradient descent using randomly sampled mini-batches. Figure 5(a) shows the error rates of the different methods, where different colors denote different subspace clustering algorithms and the length of the bars reflects the error rate. Since there are much fewer samples per subject, all competing methods perform worse than on Extended Yale B. Note that both EDSC and SSC achieve moderate clustering improvement by using the features of pre-trained convolutional auto-encoders, but their error rates are still around twice as high as those of our methods. 4.3 COIL20 and COIL100 Datasets The previous experiments both target face clustering. To show the generality of our algorithm, we also evaluate it on the COIL object image datasets – COIL20 [31] and COIL100 [30]. COIL20 consists of 1440 gray-scale image samples, distributed over 20 objects such as duck and car model (see sample images in Figure 4(c)). Similarly, COIL100 consists of 7200 images distributed over 100 objects. Each object was placed on a turntable against a black background, and 72 images were taken at pose intervals of 5 degrees. Following [3], we down-sampled the images to 32 × 32. In contrast with the previous human face datasets, in which faces are well aligned and have similar structures, the object images from COIL20 and COIL100 are more diverse, and even samples from 7 (a) ORL (b) COIL20 (c) COIL100 Figure 5: Subspace clustering error (in %) on the ORL, COIL20 and COIL100 datasets. Different colors indicate different methods. The height of the bars encodes the error, so the lower the better. COIL20 COIL100 layers encoder-1 self-expressive decoder-1 encoder-1 self-expressive decoder-1 kernel size 3 × 3 – 3 × 3 5 × 5 – 5 × 5 channels 15 – 15 50 – 50 parameters 150 2073600 136 1300 51840000 1251 Table 4: Network settings for COIL20 and COIL100. the same object differ from each other due to the change of viewing angle. This makes these datasets challenging for subspace clustering techniques. For these datasets, we used shallower networks with one encoder layer, one self-expressive layer, and one decoder layer. For COIL20, we set the number of channels to 15 and the kernel size to 3 × 3. For COIL100, we increased the number of channels to 50 and the kernel size to 5 × 5. The settings for both networks are provided in Table 4. Note that with these network architectures, the dimension of the latent space representation zi increases by a factor of 15/4 for COIL20 (as the spatial resolution of each channel shrinks to 1/4 of the input image after convolutions with stride 2, and we have 15 channels) and 50/4 for COIL100. Thus our networks perform dimensionality lifting rather than dimensionality reduction. This, in some sense, is similar to the idea of Hilbert space mapping in kernel methods [40], but with the difference that, in our case, the mapping is explicit, via the neural network. In our experiments, we found that these shallow, dimension-lifting networks performed better than deep, bottle-neck ones on these datasets. While it is also possible to design deep, dimension-lifting networks, the number of channels has to increase by a factor of 4 after each layer to compensate for the resolution loss. For example, if we want the latent space dimension to increase by a factor of 15/4, we need 15 · 4 channels in the second layer for a 2-layer encoder, 15 · 42 channels in the third layer for a 3-layer encoder, and so forth. In the presence of limited data, this increasing number of parameters makes training less reliable. In our fine-tuning stage, we ran 30 epochs (COIL20) / 100 epochs (COIL100) for DSC-Net-L1 and 30 epochs (COIL20) / 120 epochs (COIL100) for DSC-Net-L2, and set the regularization parameters to λ1 = 1, λ2 = 150/30 (COIL20/COIL100). Figure 5(b) and (c) depict the error rates of the different methods on clustering 20 classes for COIL20 and 100 classes for COIL100, respectively. Note that, in both cases, our DSC-Net-L2 achieves the lowest error rate. In particular, for COIL20, we obtain an error of 5.14%, which is roughly 1/3 of the error rate of the best-performing baseline AE+EDSC. The results of [36] on COIL20 were reported to be 14.24 ± 4.70% in terms of clustering error, which is also much higher than ours. 5 Conclusion We have introduced a deep auto-encoder framework for subspace clustering by developing a novel self-expressive layer to harness the "self-expressiveness" property of a union of subspaces. Our deep subspace clustering network allows us to directly learn the affinities between all data points with a single neural network. Furthermore, we have proposed pre-training and fine-tuning strategies to train our network, demonstrating the ability to handle challenging scenarios with small-size datasets, such as the ORL dataset. Our experiments have demonstrated that our deep subspace clustering methods provide significant improvement over the state-of-the-art subspace clustering solutions in terms of clustering accuracy on several standard datasets. 8 Acknowledgements This research was supported by the Australian Research Council (ARC) through the Centre of Excellence in Robotic Vision, CE140100016, and through Laureate Fellowship FL130100102 to IDR. TZ was supported by the ARC’s Discovery Projects funding scheme (project DP150104645). References [1] M. Abadi, A. Agarwal, P. Barham, E. Brevdo, Z. Chen, C. Citro, G. S. Corrado, A. Davis, J. Dean, M. Devin, et al. Tensorflow: Large-scale machine learning on heterogeneous distributed systems. arXiv:1603.04467, 2016. [2] R. Basri and D. W. Jacobs. Lambertian reflectance and linear subspaces. TPAMI, 25(2):218–233, 2003. [3] D. Cai, X. He, J. Han, and T. Huang. Graph regularized nonnegative matrix factorization for data representation. TPAMI, 33(8):1548–1560, 2011. [4] D. Cai, X. He, Y. Hu, J. Han, and T. Huang. Learning a spatially smooth subspace for face recognition. In CVPR, pages 1–7. IEEE, 2007. [5] G. Chen, S. Atev, and G. Lerman. Kernel spectral curvature clustering (KSCC). In ICCV Workshops, pages 765–772. IEEE, 2009. [6] G. Chen and G. Lerman. Spectral curvature clustering (SCC). IJCV, 81(3):317–330, 2009. [7] J. Costeira and T. Kanade. A multibody factorization method for independently moving objects. IJCV, 29(3):159–179, 1998. [8] N. Dalal and B. Triggs. Histograms of oriented gradients for human detection. In CVPR 2005, pages 886–893. IEEE, 2005. [9] E. Elhamifar and R. Vidal. Sparse subspace clustering. In CVPR, pages 2790–2797, 2009. [10] E. Elhamifar and R. Vidal. Sparse subspace clustering: Algorithm, theory, and applications. TPAMI, 35(11):2765–2781, 2013. [11] P. Favaro, R. Vidal, and A. Ravichandran. A closed form solution to robust subspace estimation and clustering. In CVPR, pages 1801–1807. IEEE, 2011. [12] J. Feng, Z. Lin, H. Xu, and S. Yan. Robust subspace segmentation with block-diagonal prior. In CVPR, pages 3818–3825, 2014. [13] G. E. Hinton and R. R. Salakhutdinov. Reducing the dimensionality of data with neural networks. Science, 313(5786):504–507, 2006. [14] J. Ho, M.-H. Yang, J. Lim, K.-C. Lee, and D. Kriegman. Clustering appearances of objects under varying illumination conditions. In CVPR, volume 1, pages 11–18. IEEE, 2003. [15] P. Ji, M. Salzmann, and H. Li. Efficient dense subspace clustering. In WACV, pages 461–468. IEEE, 2014. [16] P. Ji, M. Salzmann, and H. Li. Shape interaction matrix revisited and robustified: Efficient subspace clustering with corrupted and incomplete data. In ICCV, pages 4687–4695, 2015. [17] K.-i. Kanatani. Motion segmentation by subspace separation and model selection. In ICCV, volume 2, pages 586–591. IEEE, 2001. [18] D. Kingma and J. Ba. Adam: A method for stochastic optimization. arXiv:1412.6980, 2014. [19] A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pages 1097–1105, 2012. [20] Y. LeCun, Y. Bengio, and G. Hinton. Deep learning. Nature, 521(7553):436–444, 2015. [21] K.-C. Lee, J. Ho, and D. J. Kriegman. Acquiring linear subspaces for face recognition under variable lighting. TPAMI, 27(5):684–698, 2005. [22] C.-G. Li and R. Vidal. Structured sparse subspace clustering: A unified optimization framework. In CVPR, pages 277–286, 2015. [23] G. Liu, Z. Lin, S. Yan, J. Sun, Y. Yu, and Y. Ma. Robust recovery of subspace structures by low-rank representation. TPAMI, 35(1):171–184, 2013. [24] G. Liu, Z. Lin, and Y. Yu. Robust subspace segmentation by low-rank representation. In ICML, pages 663–670, 2010. [25] D. G. Lowe. Distinctive image features from scale-invariant keypoints. IJCV, 60(2):91–110, 2004. [26] C.-Y. Lu, H. Min, Z.-Q. Zhao, L. Zhu, D.-S. Huang, and S. Yan. Robust and efficient subspace segmentation via least squares regression. In ECCV, pages 347–360. Springer, 2012. [27] Y. Ma, H. Derksen, W. Hong, and J. Wright. Segmentation of multivariate mixed data via lossy data coding and compression. TPAMI, 29(9), 2007. [28] J. Masci, U. Meier, D. Cire¸san, and J. Schmidhuber. Stacked convolutional auto-encoders for hierarchical feature extraction. Artificial Neural Networks and Machine Learning–ICANN 2011, pages 52–59, 2011. [29] Q. Mo and B. A. Draper. Semi-nonnegative matrix factorization for motion segmentation with missing data. In ECCV, pages 402–415. Springer, 2012. [30] S. A. Nene, S. K. Nayar, and H. Murase. Columbia object image library (COIL-100). Technical Report CUCS-006-96, 1996. 9 [31] S. A. Nene, S. K. Nayar, and H. Murase. Columbia object image library (COIL-20). Technical Report CUCS-005-96, 1996. [32] A. Y. Ng, M. I. Jordan, Y. Weiss, et al. On spectral clustering: Analysis and an algorithm. In NIPS, volume 14, pages 849–856, 2001. [33] P. Ochs and T. Brox. Higher order motion models and spectral clustering. In CVPR, 2012. [34] V. M. Patel, H. Van Nguyen, and R. Vidal. Latent space sparse subspace clustering. In ICCV, pages 225–232, 2013. [35] V. M. Patel and R. Vidal. Kernel sparse subspace clustering. In ICIP, pages 2849–2853. IEEE, 2014. [36] X. Peng, S. Xiao, J. Feng, W.-Y. Yau, and Z. Yi. Deep subspace clustering with sparsity prior. In IJCAI, 2016. [37] P. Purkait, T.-J. Chin, H. Ackermann, and D. Suter. Clustering with hypergraphs: the case for large hyperedges. In ECCV, pages 672–687. Springer, 2014. [38] S. R. Rao, R. Tron, R. Vidal, and Y. Ma. Motion segmentation via robust subspace separation in the presence of outlying, incomplete, or corrupted trajectories. In CVPR, pages 1–8. IEEE, 2008. [39] F. S. Samaria and A. C. Harter. Parameterisation of a stochastic model for human face identification. In Applications of Computer Vision, 1994., Proceedings of the Second IEEE Workshop on, pages 138–142. IEEE, 1994. [40] J. Shawe-Taylor and N. Cristianini. Kernel methods for pattern analysis. Cambridge university press, 2004. [41] J. Shi and J. Malik. Normalized cuts and image segmentation. TPAMI, 22(8):888–905, 2000. [42] R. Vidal. Subspace clustering. IEEE Signal Processing Magazine, 28(2):52–68, 2011. [43] R. Vidal and P. Favaro. Low rank subspace clustering (LRSC). Pattern Recognition Letters, 43:47–61, 2014. [44] R. Vidal, R. Tron, and R. Hartley. Multiframe motion segmentation with missing data using powerfactorization and GPCA. IJCV, 79(1):85–105, 2008. [45] 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. JMLR, 11(Dec):3371– 3408, 2010. [46] Y.-X. Wang, H. Xu, and C. Leng. Provable subspace clustering: When LRR meets SSC. In Advances in Neural Information Processing Systems, pages 64–72, 2013. [47] S. Xiao, M. Tan, D. Xu, and Z. Y. Dong. Robust kernel low-rank representation. IEEE transactions on neural networks and learning systems, 27(11):2268–2281, 2016. [48] J. Xie, R. Girshick, and A. Farhadi. Unsupervised deep embedding for clustering analysis. In ICML, 2016. [49] J. Yan and M. Pollefeys. A general framework for motion segmentation: Independent, articulated, rigid, non-rigid, degenerate and non-degenerate. In ECCV, pages 94–106. Springer, 2006. [50] A. Y. Yang, J. Wright, Y. Ma, and S. S. Sastry. Unsupervised segmentation of natural images via lossy data compression. CVIU, 110(2):212–225, 2008. [51] M. Yin, Y. Guo, J. Gao, Z. He, and S. Xie. Kernel sparse subspace clustering on symmetric positive definite manifolds. In CVPR, pages 5157–5164, 2016. [52] C. You, C.-G. Li, D. P. Robinson, and R. Vidal. Oracle based active set algorithm for scalable elastic net subspace clustering. In CVPR, pages 3928–3937, 2016. [53] C. You, D. Robinson, and R. Vidal. Scalable sparse subspace clustering by orthogonal matching pursuit. In CVPR, pages 3918–3927, 2016. 10
2017
594
7,112
Robust Estimation of Neural Signals in Calcium Imaging Hakan Inan 1 inanh@stanford.edu Murat A. Erdogdu 2,3 erdogdu@cs.toronto.edu Mark J. Schnitzer 1,4 mschnitz@stanford.edu 1Stanford University 2Microsoft Research 3Vector Institute 4Howard Hughes Medical Institute Abstract Calcium imaging is a prominent technology in neuroscience research which allows for simultaneous recording of large numbers of neurons in awake animals. Automated extraction of neurons and their temporal activity from imaging datasets is an important step in the path to producing neuroscience results. However, nearly all imaging datasets contain gross contaminating sources which could originate from the technology used, or the underlying biological tissue. Although past work has considered the effects of contamination under limited circumstances, there has not been a general framework treating contamination and its effects on the statistical estimation of calcium signals. In this work, we proceed in a new direction and propose to extract cells and their activity using robust statistical estimation. Using the theory of M-estimation, we derive a minimax optimal robust loss, and also find a simple and practical optimization routine for this loss with provably fast convergence. We use our proposed robust loss in a matrix factorization framework to extract the neurons and their temporal activity in calcium imaging datasets. We demonstrate the superiority of our robust estimation approach over existing methods on both simulated and real datasets. 1 Introduction Calcium imaging has become an indispensable tool in systems neuroscience research. It allows simultaneous imaging of the activity of very large ensembles of neurons in awake and even freely behaving animals [3, 4, 6]. It relies on fluorescence imaging of intracellular calcium activity reported by genetically encoded calcium indicators. A crucial task for a neuroscientist working with calcium imaging is to extract signals (i.e. temporal traces and spatial footprints of regions of interest) from the imaging dataset. This allows abstraction of useful information from a large dataset in a highly compressive manner, losing little to no information. Automating this process is highly desirable, as manual extraction of cells and their activities in large-scale datasets is prohibitively laborious, and prone to flawed outcomes. A variety of methods have been proposed for automated signal extraction in calcium imaging datasets, including the ones based on matrix factorization [13, 14, 15, 16], and image segmentation [1, 10]. Some of these tools were tailored to two-photon calcium imaging, for which signal-to-noise ratio is typically high, and the fluorescence background is fairly stable [3], whereas some targeted one-photon and microendoscopic calcium imaging [4, 5], which are often characterized by low SNR and large background fluctuations. Interestingly, least squares estimation has been a predominant paradigm among previous methods; yet there is no previous work addressing statistically the generic nature of calcium imaging datasets, which includes non-gaussian noise, non-cell background activity (e.g. neuropil), and overlapping cells not captured by algorithms (out-of-focus or foreground). As a consequence, the impact of such impurities inherent in calcium imaging on the accuracy of extracted signals has not been thoroughly investigated previously. This lack of focus on signal accuracy is worrisome as cell extraction is a fairly early step in the research pipeline, and flawed signals may lead to incorrect scientific outcomes. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. In this work, we propose an approach which takes into account the practical nature of calcium imaging, and solves the signal extraction problem through robust estimation. First, we offer a mathematical abstraction of imaging datasets, and arrive at an estimator which is minimax robust, in the sense that is prevalent in the field of robust estimation. We then use this M-estimator to solve a matrix factorization problem, jointly yielding the temporal and spatial components of the extracted signals. The main insight behind our robust estimation framework is that the signals present in imaging data are the superposition of many positive amplitude sources, and a lower amplitude noise component which could be well modeled by a normal distribution. That the majority of the components is positive stems from the fact that the underlying signals in calcium imaging are all made up of photons, and they elicit activity above a baseline as opposed to fluctuating around it. However, not all positive sources are cells that could be extracted by an algorithm (some could be neuropil, other noise, or non-captured cells); hence we model them as generic gross non-negative contamination sources. By using the machinery of robust estimation [7], we propose an M-estimator which is asymptotically minimax optimal for our setting. We also propose a fast fixed-point optimization routine for solving our robust estimation problem. We show local linear convergence guarantees for our routine, and we demonstrate numerically that it converges very fast while only having the same per-step cost with gradient descent. The fast optimizer allows for very fast automated cell extraction in large-scale datasets. Further, since the final form for our loss function is simple and optimization only depends on matrix algebra, it is highly amenable to GPU implementation providing additional improvements. We validate our robust estimation-based cell extraction algorithm on both synthetic and real datasets. We show that our method offers large accuracy improvements over non-robust techniques in realistic settings, which include classical scenarios such as overlapping cells and neuropil contamination. Particularly, our method significantly outperforms methods with non-robust reconstruction routines in metrics such as signal fidelity and crosstalk, which are crucial for steps subsequent to cell extraction. 2 M-Estimation under Gross Non-negative Contamination In this section, we introduce our signal estimation machinery, based on the literature of robust M-estimation. The theory of M-estimation is well-developed for symmetric and certain asymmetric contamination regimes [2, 7, 9, 12]; however the existing theory does not readily suggest an optimal estimator suitable for finding the kind of signals present in fluorescence imaging of calcium in the brain. We first motivate and introduce a simple mathematical abstraction for this new regime, and then derive a minimax optimal M-estimator. 2.1 Noise Model & Mathematical Setting For simplicity, we consider the setting of location estimation, which straightforwardly generalizes to multivariate regression. Considering the nature of contamination in calcium imaging datasets, we base our noise model on the following observation: The signal background is dominated by the baseline activity which is well modeled by a normal distribution. This type of noise stems from the random arrivals of photons from the background in the imaging setup governed by a poisson process; this distribution very rapidly converges to a normal distribution. However, the signal background also contains other sources of noise such as neuropil activity, out-of-focus cells, and residual activity of overlapping cells not accounted for by the cell extraction method. The latter kind of contamination is very distinct from a normal-type noise; it is non-negative (or above the signal baseline), its characteristics are rather irregular and it may take on arbitrarily large values. Consequently, we model the data generation through an additive noise source which is normally distributed 1 −ϵ fraction of the time, and free to be any positive value greater than a threshold otherwise: yi = β∗+ σi (1) σi ∼ N(0, 1), w.p. 1 −ϵ Hα, w.p. ϵ (2) Hα ∈Hα = {All distributions with support [α, ∞)}, α ≥0. 2 loss, a b Figure 1: One-sided Huber. (a) loss function of one-sided Huber (ρ) and its derivative (ψ) for κ = 2. (b) One-sided Huber yields lower MSE compared to other known M-estimators under the distribution which causes the worst-case variance for any given estimator (for ϵ = 0.1). In above, β∗is the true parameter, and is corrupted additively as in (1); σi is a standard normal with 1 −ϵ probability, and distributed according to an unknown distribution Hα with probability ϵ. In the spirit of full generality, we allow Hα to be any probability distribution with support greater than a set value α; particularly, it could be nonzero at arbitrarily large values. Therefore, ϵ could be interpreted as the gross contamination level. The parameter α could be interpreted as the minimum observed value of the positive contamination, although its exact value is insignificant outside our theoretical analysis. We denote the full noise distribution by FHα, subscripted by Hα. Given the observations {yi}n i=1, we estimate the true parameter β∗with ˆβ by considering an equivariant M-estimator as follows ˆβ = argmin β n X i=1 ρ(yi −β). (3) Typically, M-estimators are characterized by ψ ≜ρ′. In this paper, we are going to consider ψ’s with specific properties that allow for efficient optimization and more general theoretical guarantees. Let’s define a set Ψ = {ψ | ψ is non-decreasing} . If we choose an estimator ψ ∈Ψ, finding a point estimate ˆβ through (3) becomes equivalent to solving the first order condition: n X i=1 ψ(yi −ˆβ) = 0. (4) This is simply because the members of Ψ correspond to convex loss functions. Our focus is on such functions since they are typically easier to optimize, and offer global optimality guarantees. 2.2 One-Sided Huber Estimator and its Asymptotic Minimax Optimality We are interested in finding an M-estimator for our noise model which is robust to the variation in the noise distribution (Hα in particular) in the sense of minimizing the worst-case deviation from the true parameter, as measured by the mean squared error. We first introduce our proposed estimator, and then show that it is exactly optimal in the aforementioned minimax sense. Definition 1 (One-sided Huber). Define an estimator ψ0 as follows: ψ0(y, κ) = y, if y < κ κ, if y ≥κ, (5) where κ is defined in terms of the contamination level, ϵ, according to Φ(κ) + g(κ) κ = 1 (1 −ϵ), with Φ(·) and g(·) denoting the distribution and the density functions for a standard normal variable, respectively. We shall refer to ψ0 as one-sided Huber, and denote with ρ0(·, κ) its loss function (see Figure 1 for visualization). Clearly, ψ0 ∈Ψ, and therefore the loss function ρ0 is convex. Under the data generation model introduced in the previous section, we can now state an asymptotic minimax result for ψ0. 3 Algorithm 1 Fast Solver for one-sided Huber Loss function fp_solve(X, Y, k, δ) // X = [x1, . . . , xn]T , Y = [y1, . . . , yn]T 1. Compute: X+ = (XT X)−1XT , βLS = X+Y 2. Initialize β(0) at random, set t = 0. 3. while β(t+1) −β(t)∥2 ≥δ do β(t+1) = βLS −X+ max(0, Y −Xβ(t) −κ) t ←t + 1. 4. end while return β(t). Proposition 2.1. One-sided Huber ψ0 yields an asymptotically unbiased M-estimator for FHκ = {(1 −ϵ)Φ + ϵHκ}. Further, ψ0 minimizes the worst case asymptotic variance in FHκ , i.e. ψ0 = arg inf ψ∈Ψ sup F ∈FHκ V (ψ, F). A proof for Proposition 2.1 is given in the supplementary material. Proposition 2.1 establishes that that one-sided Huber estimator has zero bias as long as the non-zero contamination is sufficiently larger than zero, and it also achieves the best worst-case asymptotic variance. We would like to offer a discussion for a comparison between one-sided Huber and some other popular M-estimators, such as the sample mean (ℓ2 loss), the sample median (ℓ1 loss), Huber [7], and the sample quantile. First of all, the sample mean, the sample median, and Huber estimators all have symmetric loss functions and therefore suffer from bias. This is particularly detrimental for the sample mean and leads to unbounded MSE as the gross contamination tends to very large values. The bias problem may be eliminated using a quantile estimator whose quantile level is set according to ϵ. However, this estimator has higher asymptotic variance than the one-sided Huber. We present in Figure 1b comparison of empirical mean square errors for different estimators under the noise distribution which causes the worst asymptotic variance among distributions in FHκ 1. The MSEs of the sample mean and the sample median quickly become dominated by their bias with increasing n2. Although the quantile estimator was set up to be unbiased, its MSE (or equivalently, variance) is greater than the one-sided Huber. These results corroborate the theoretical properties of one-sided Huber, and affirm it as a good fit for our setting. Although we have not come across a previous study of one-sided Huber estimator in this context, we should note that it is related to the technique in [11], where samples are assumed to be nonnegative, and in the sample mean estimator summands are shrunk when they are above a certain threshold (this technique is called winsorizing). However, their model and application are quite different than what we consider in this paper. 2.3 Generalization to Regression Setting Here we introduce the regression setting which we will use for the remainder of the paper. We observe {yi, xi}n i=1, where xi ∈Rp could be either fixed or random, and yi’s are generated according to yi = ⟨xi, β∗⟩+ σg i + σh i , where β∗∈Rp is the true parameter, and σh i and σg i are as previously defined. We estimate β∗with ˆβ = argmin β fκ(β) := n X i=1 ρ0(yi −⟨xi, β⟩, κ). (6) Classical M-estimation theory establishes –under certain regularity conditions– that the minimax optimality in Section 2.2 carries over to regression; we refer reader to [8] for details. 3 Fast Fixed-point Solver for One-Sided Huber Loss We are interested in solving the robust regression problem in (6) in the large-scale setting due to the large field of view and length of most calcium imaging recordings. Hence, the solver for our problem 1Refer to the proof of Proposition 2.1 for the form of this distribution. 2We omit Huber in this comparison since its MSE is also bias-dominated. 4 Algorithm 2 Tractable and Robust Automated Cell Extraction function EXTRACT(M, N, κ, δ) 1. Initialize S(0), T(0), set t = 0. 2. for t=1 to N do T(t+1) = fp_solve_nonneg(S(t), M, κ, δ) S(t+1) = fp_solve_nonneg(T(t)T , MT , κ, δ)T S(t+1), T(t+1) = remove_redundant  S(t+1), T(t+1) 3. end for return S(t), T(t). should ideally be tractable for large n and also give as accurate an output as possible. To this end, we propose a fixed point optimization method (Algorithm 1), which has a step cost equal to that of gradient descent, while converging to the optimum at rates more similar to Newton’s method. The following proposition establishes the convergence of our solver. Proposition 3.1. Let β∗be the fixed point of Algorithm 1 for the problem (6), and let λmax and λmin > 0 denote the extreme eigenvalues of Pn i=1 xixT i , and let maxi ∥xi∥≤k. Assume that for a subset of indeces s ⊂{1, 2, ..., n}, ∃∆s > 0 such that yi −⟨xi, β∗⟩≤κ −∆s and denote the extreme eigenvalues of P i∈s xixT i by γmax and γmin > 0 satisfying λmaxγmax/λ2 min < 2. If the initial point β0 is close to the true minimizer, i.e., ∥β0 −β∗∥2 ≤k/∆s, then Algorithm 1 converges linearly, fκ(βt) −fκ(β∗) ≤  1 −2 γmin λmax + γmaxγmin λ2 min t  fκ(β0) −fκ(β∗)  . (7) A proof for Proposition 3.1 is given in the supplementary material. Our solver is second order in nature3, hence its convergence behavior should be close to that of Newton’s method. However, there is one caveat: the second derivative of the one-sided Huber loss is not continuous. Therefore, one cannot expect to achieve a quadratic rate of convergence; this issue is commonly encountered in M-estimation. Nevertheless, Algorithm 1 converges very fast in practice. We compare our solver to Newton’s method and gradient descent by simulating a regression setting where we synthesize a 100 x 100 movie frame (Y) with 100 neurons (see Section 5 for details). Then, given the ground truth cell images (X), we optimize for the fluorescence traces for the single frame (β) using the three algorithms. For our fixed-point solver, we use κ = 1. For gradient descent, we set the step size to the reciprocal of the largest eigenvalue of the hessian (while not taking into account the time taken to compute it). Results are shown in Figure 2. Our solver has close convergence behavior to that of Newton’s method, while taking much less time to achieve the same accuracy due to its small per-step cost. We would like to also note that estimating the entire matrix of fluorescence traces (or cell images) does not require any modification of Algorithm 1; hence, in practice estimating entire matrices of components at once does not cause much computational burden. For Newton’s method, every frame (or every pixel) requires a separate hessian; runtime in this case scales at least linearly. 4 Robust Automated Cell Extraction We now introduce our proposed method for automated cell extraction via robust estimation. Our method is based on a matrix factorization framework, where we model the imaging data as the matrix product of a spatial and a temporal matrix with additive noise: M = ST + Σ. In above, M ∈RdS×dT is the movie matrix, S ∈RdS×m + and T ∈Rm×dT + are the nonnegative spatial and temporal matrices, respectively. Σ ∈RdS×dT is meant to model the normal noise corrupted with non-negative contamination, and Σij has the same distribution with σ in (2) (up to the noise standard deviation). Our main contribution in this work is that we offer a method which estimates S and T using the one-sided Huber estimator, which provides the optimal robustness against the non-negative contamination inherent in calcium imaging, as discussed in Section 2. 3Interested reader is referred to the supplementary material for a more rigorous argument. 5 0 10 20 30 40 50 iteration Optimality gap fixed point newton gradient descent 10 10 10 10 10 10 10 -12 -10 -8 -6 -4 -2 0 b 0 0.05 0.1 0.15 time (sec) 10 10 10 10 10 10 10 -12 -10 -8 -6 -4 -2 0 Optimality gap fixed point newton gradient descent a Figure 2: Our fixed point solver converges to the optimum with similar rates with Newton’s method, while being more computationally efficient. (a) Optimality gap versus absolute time. (b) Optimality gap versus number of iterations. Fixed point solver achieves the same accuracy with a notably faster speed compared to Newton’s method and gradient descent. Our cell extraction algorithm starts by computing initial estimates for the matrices S and T. This is done by (1) detecting a cell peak from the time maximum of the movie one cell at a time (2) solving for the current cell’s spatial and the temporal components using the one-sided Huber estimator (3) repeating until a stopping criterion is reached. We detail this step in the supplementary material. After initial guesses for S and T are computed, the main update algorithm proceeds in a straightforward manner, where multiple alternating robust regression steps are performed using the one-sided Huber loss. At each step, new estimates of S and T are computed based on M and the current estimate of the other matrix. For computing the estimates, we use the fast fixed-point algorithm derived in Section 3. However, since we constrain S and T to be nonnegative matrices, the fixed-point solver cannot be used without constraints that enforce non-negativity. To this end, we combine our solver with the alternating directions method of multipliers(ADMM), a dual ascent method which solves for multiple objectives by consensus. We call the combined solver fp_solve_nonneg(). Note that, due to the symmetry between the two alternating steps, we use the same solver for computing both S and T. We do minimal post-processing at the end of each step to remove redundant components. Specifically, we identify and remove near duplicate components in S or T, and we then eliminate components which have converged to zero. We repeat these steps alternatingly for a desired number of steps N. Selection of κ depends on the positive contamination level; nevertheless, we have observed that precise tuning of κ is not necessary in practice. A range of [0.5, 1] times the standard deviation of the normally distributed noise is reasonable for κ for most practices. One should note, however, that although the robust estimator has favorable mis-specification bias, it might become significant under crucially low SNR conditions. For instance, setting a small κ in such cases will likely lead to detrimental under-estimation. On the other hand, setting high κ values decreases the estimator robustness ( this makes the loss function approach the ℓ2 loss). Consequently, the advantage of robust estimation is expected to diminish in extremely low SNR regimes. Our algorithm has a highly favorable runtime in practice owing to the simplicity of its form. Furthermore, since the solver we use relies on basic matrix operations, we were able to produce a GPU implementation, allowing for further reduction in runtime. Comparison of our GPU implementation to other algorithms in their canonical forms naturally causes bias; therefore, we defer our runtime comparison results to the supplementary material. From here on, we shall call our algorithm EXTRACT. 5 Experiments In this section, we perform experiments on both simulated and real data in order to establish the improved signal accuracy obtained using EXTRACT. We represent the signal accuracy with two quantities: (1) signal fidelity, which measures how closely a temporal (fluorescence trace) or spatial (cell image) signal matches its underlying ground truth, and (2) signal crosstalk, which quantifies interference from other sources, or noise. We primarily focus on temporal signals since they typically 6 0.2 0.4 0.6 0.8 1 false positive rate 0.2 0.4 0.6 0.8 1 true positive rate EXTRACT, AUC = 0.99 CNMF, AUC = 0.92 a Example cases of cells with non-captured neighbors ROC curve by varying event detection threshold Mean area under the ROC curve for when initialized with X fraction of true cells b c d Example maximum projection image iter 1 iter 2 iter 3 iter 1 iter 2 iter 3 iter 1 iter 2 iter 3 iter 1 iter 2 iter 3 iter 1 iter 2 iter 3 iter 1 iter 2 iter 3 iter 1 iter 2 iter 3 iter 1 iter 2 iter 3 0.8 0.85 0.9 0.95 1 X=0.8 X=0.6 X=0.4 X=0.2 EXTRACT CNMF Figure 3: Performance comparison of EXTRACT vs. CNMF for movies with overlapping image sources. (a) Examples where a captured cell (circled in white) is overlapping with non-captured neighbors (circled in red). Ground truth traces are shown in black. EXTRACT finds images and traces that match closely with the ground truth, where CNMF admits notable crosstalk from neighbors both in its found cell images and traces.(b) An example maximum projection of an imaging movie in time. (c) An example ROC curve for X=0.4, computed by varying event detection threshold and averaging TPR and FPR over single cells for each threshold. (d) Mean area under the ROC curve computed over 20 experiments for each initial fraction of true cells, X, and each iteration. EXTRACT consistently outperforms CNMF, with the performance lead becoming significant for lower X. Error bars are 1 s.e.m. represent the entirety of the calcium movie for the steps subsequent to cell extraction. As opposed to using simple correlation based metrics, we compute true and false positive detection rates based on estimated calcium events found via simple amplitude thresholding. We then present receiver operating characteristics (ROC) based metrics. We compare EXTRACT to the two dominantly used cell extraction methods: CNMF [15], and spatio-temporal ICA [13], the latter of which we will simply refer to as ICA. Both methods are matrix factorization methods like EXTRACT; CNMF estimates its temporal and spatial matrices alternatingly, and jointly estimates traces and its underlying calcium event peaks, and ICA finds a single unmixing matrix which is then applied to the singular value decomposition (SVD) of the movie to jointly obtain traces and images. CNMF uses quadratic reconstruction loss with ℓ1 penalty, whereas ICA uses a linear combination of movie data guided by high order pixel statistics for reconstruction; hence they both can be considered as non-robust estimation techniques. Simulated data. For simulated movies, we use a field of view of size 50 by 50 pixels, and produce data with 1000 time frames. We simulate 30 neurons with gaussian shaped images with standard deviations drawn from [3, 4.8] uniformly. We simulate the fluorescence traces using a Poisson process with rate 0.01 convolved with an exponential kernel with a time constant of 10 frames. We corrupt the movie with independent and normally distributed noise whose power is matched to the power of the neural activity so that average pixel-wise SNR in cell regions is 1. We have re-run our experiments with different SNR levels in order to establish the independence of our key results from noise level; we report them in the supplementary material. 5.1 Crosstalk between cells for robust vs. non-robust methods As a first experiment, we demonstrate consequences of a common phenomenon, namely cells with overlapping spatial weights. Overlapping cells do not pose a significant problem when their spatial components are correctly estimated; however, in reality, estimated images typically do not perfectly match their underlying excitation, or some overlapping cells might not even be captured by the extraction algorithm. In the latter two cases, crosstalk becomes a major issue, causing captured cells to carry false calcium activity in their fluorescence traces. We try to reproduce the aforementioned scenarios by simulating movies, and initializing the algorithms of interest with a fraction of the ground truth cells. Our aim is to set up a controlled environment to (1) quantitatively investigate the crosstalk in the captured cell traces due to missing cells, (2) observe the effect of alternating estimation on the final accuracy of estimates. In this case, the outputs of 7 a b d TRUE CNMF ICA EXTRACT c Example fluorescence traces ROC curve by varying event detection threshold Mean area under the ROC curve Cell finding statistics 0.2 0.4 0.6 0.8 1 false positive rate 0.2 0.4 0.6 0.8 1 true positive rate EXTRACT, AUC = 0.96 CNMF, AUC = 0.91 ICA, AUC = 0.88 0.92 0.96 0.91 0.95 0.90 0.90 w/o neuropil Recall Precision F1 0.87 0.87 0.81 0.82 0.79 0.79 w/neuropil 0.92 0.94 0.90 0.86 0.82 0.80 0.85 0.9 0.95 1 w/o neuropil w/neuropil EXTRACT CNMF ICA Figure 4: EXTRACT outperforms other algorithms in the existence of neuropil contamination. (a) Example traces from algorithm outputs overlaid on the ground truth traces. EXTRACT produces traces closest to the ground truth, admitting significantly less crosstalk compared to others. (b) An example ROC curve for an instance with neuropil. (c) Mean area under the curve computed over 15 experiments, and separately for with and without neuropil. EXTRACT shows better performance, and its performance is the most robust against neuropil contamination. (d) Average cell finding statistics over 15 experiments, computed separately for with and without neuropil. EXTRACT achieves better competitive performance especially when there is neuropil contamination. alternating estimation algorithms should deteriorate through the iteration loop since they estimate their components based on imperfect estimates of each other. We select EXTRACT and CNMF for this experiment since they are both alternating estimation algorithms. We initialize the algorithms with 4 different fractions of ground truth cells: X = {0.2, 0.4, 0.6, 0.8}. We carry out 20 experiments for each X, and we perform a 3 alternating estimation iterations for each algorithm. This number was chosen with the consideration that CNMF canonically performs 2 iterations on its initialized components. We report results for 6 iterations in the supplementary material. At the end of each iteration, we detect calcium events from the algorithms’ fluorescence traces, and match them with the ground truth spikes to compute event true positive rate (TPR) and event false positive rate (FPR). Figure 3 summarizes the results of this experiment. At the end of the 3 iterations, EXTRACT produces images and traces that are visually closer to ground truth in the existence of non-captured neighboring cells with overlapping images (Figure 3a). Figure 3c shows the ROC curve from one instance of the experiment, computed by varying the threshold amplitude for detecting calcium events, and plotting FPR against TPR for each threshold. We report quantitative performance by the area under the ROC curve (AUC). We average the AUCs over all the experiments performed for each condition, and report it separately for each iteration in Figure 3d. EXTRACT outperforms CNMF uniformly, and the performance gap becomes pronounced with very low fraction of initially provided cells. This boost in the signal accuracy over non-robust estimators (e.g. ones with quadratic penalty) stands to validate our proposed robust estimator and its underlying model assumptions. 5.2 Cell extraction with neuropil contamination In most calcium imaging datasets, data is contaminated with non-cellular calcium activity caused by neuropil. This may interfere with cell extraction by contaminating the cell traces, and by making it difficult to accurately locate spatial components of cells. We study the effect of such contamination by simulating neural data and combining it with neuropil activity extracted from real two-photon imaging datasets. For this experiment, we use EXTRACT, CNMF and ICA. In order for a fair comparison, we initialize all algorithms with the same set of initial estimates. We choose to use the greedy initializer of CNMF to eliminate any competitive advantage EXTRACT might have due to using its native initializer. We perform 15 experiments with no neuropil, and 15 with added neuropil. We match the variance of the neuropil activity to that of the gaussian noise while keeping SNR constant. For each experiment, we compute (1) cell trace statistics based on the ROC curve as previously described, (2) cell finding statistics based on precision, recall, and F1 metrics. EXTRACT produces qualitatively more accurate fluorescence traces (Figure 4a), and it outperforms both CNMF and ICA quantitatively (Figure 4b,c), with the performance gap becoming more significant in the existence of neuropil contamination. Further, EXTRACT yields more true cells than the other methods with less false positives when there is neuropil (Figure 4d). 8 0 10 20 30 40 time (seconds) ICA CNMF EXTRACT EXTRACT CNMF ICA a b N=476 N=272 N=329 Figure 5: EXTRACT better estimates neural signals in microendoscopic single-photon imaging data. (a) The manually classified "good" cells for all 3 algorithms overlaid on the maximum of the imaging movie in time. Letter N refers to the total good cell count. (b) The fluorescence traces of the 3 algorithms belonging to the same cell. The cell has significantly low SNR compared to a neighbor cell which is also captured by all the methods. The time frames with arrows pointing to them are shown with the snapshot of the cell (circled in green) and its surrounding area. EXTRACT correctly assigns temporal activity to the cell of interest, while other algorithms register false calcium activity from the neighboring cell. 5.3 Cell extraction from microendoscopic single-photon imaging data Data generated using microendoscopic single-photon calcium imaging could be quite challenging due to low SNR, and fluctuating background (out of focus fluorescence activity etc.). We put EXTRACT to test in this data regime, using an imaging dataset recorded from the dorsal CA1 region of the mouse hippocampus [17], an area known to have high cell density. We compare EXTRACT with CNMF and ICA. For this experiment, the output of each algorithm was checked by human annotators and cells were manually classified to be true cells or false positives judging from the match of their temporal signal to the activity in the movie. EXTRACT successfully extracts the majority of the cells apparent in the maximum image of the movie in time dimension, and is able to capture highly overlapping cells (Figure 5a). EXTRACT also accurately estimates the temporal activity. Figure 5b shows an instance of a dim cell with a high SNR neighboring cell, both of which are captured by all three algorithms. While CNMF and ICA both falsely show activity when the neighbor is active, EXTRACT trace seems immune to this type of contamination and is silent at such instants. 6 Conclusion We presented an automated cell extraction algorithm for calcium imaging which uses a novel robust estimator. We arrived at our estimator by defining a generic data model and optimizing its worst-case performance. We proposed a fast solver for our estimation problem, which allows for tractable cell extraction in practice. As we have demonstrated in our experiments, our cell extraction algorithm, EXTRACT, is a powerful competitor for the existing methods, performing well under different imaging modalities due to its generic nature. 9 Acknowledgements We gratefully acknowledge support from DARPA and technical assistance from Biafra Ahanonu, Lacey Kitch, Yaniv Ziv, Elizabeth Otto and Margaret Carr. References [1] N. J. Apthorpe, A. J. Riordan, R. E. Aguilar, J. Homann, Y. Gu, D. W. Tank, and H. S. Seung12. Automatic neuron detection in calcium imaging data using convolutional networks. arXiv preprint arXiv:1606.07372, 2016. [2] J. R. Collins. Robust estimation of a location parameter in the presence of asymmetry. The Annals of Statistics, pages 68–85, 1976. [3] W. Denk, J. H. Strickler, W. W. Webb, et al. Two-photon laser scanning fluorescence microscopy. Science, 248(4951):73–76, 1990. [4] B. A. Flusberg, A. Nimmerjahn, E. D. Cocker, E. A. Mukamel, R. P. Barretto, T. H. Ko, L. D. Burns, J. C. Jung, and M. J. Schnitzer. High-speed, miniaturized fluorescence microscopy in freely moving mice. Nature methods, 5(11):935, 2008. [5] K. K. Ghosh, L. D. Burns, E. D. Cocker, A. Nimmerjahn, Y. Ziv, A. El Gamal, and M. J. Schnitzer. Miniaturized integration of a fluorescence microscope. Nature methods, 8(10):871– 878, 2011. [6] F. Helmchen and W. Denk. Deep tissue two-photon microscopy. Nature methods, 2(12):932–940, 2005. [7] P. J. Huber. Robust estimation of a location parameter. The Annals of Mathematical Statistics, 35(1):73–101, 1964. [8] P. J. Huber. Robust regression: asymptotics, conjectures and monte carlo. The Annals of Statistics, pages 799–821, 1973. [9] L. A. Jaeckel. Robust estimates of location: Symmetry and asymmetric contamination. The Annals of Mathematical Statistics, pages 1020–1034, 1971. [10] P. Kaifosh, J. D. Zaremba, N. B. Danielson, and A. Losonczy. Sima: Python software for analysis of dynamic fluorescence imaging data. Frontiers in neuroinformatics, 8:80, 2014. [11] P. Kokic and P. Bell. Optimal winsorizing cutoffs for a stratified finite population estimator. Journal of Official Statistics, 10(4):419, 1994. [12] R. D. Martin and R. H. Zamar. Efficiency-constrained bias-robust estimation of location. The Annals of Statistics, pages 338–354, 1993. [13] E. A. Mukamel, A. Nimmerjahn, and M. J. Schnitzer. Automated analysis of cellular signals from large-scale calcium imaging data. Neuron, 63(6):747–760, 2009. [14] M. Pachitariu, A. M. Packer, N. Pettit, H. Dalgleish, M. Hausser, and M. Sahani. Extracting regions of interest from biological images with convolutional sparse block coding. In Advances in Neural Information Processing Systems, pages 1745–1753, 2013. [15] E. A. Pnevmatikakis, D. Soudry, Y. Gao, T. A. Machado, J. Merel, D. Pfau, T. Reardon, Y. Mu, C. Lacefield, W. Yang, et al. Simultaneous denoising, deconvolution, and demixing of calcium imaging data. Neuron, 89(2):285–299, 2016. [16] P. Zhou, S. L. Resendez, G. D. Stuber, R. E. Kass, and L. Paninski. Efficient and accurate extraction of in vivo calcium signals from microendoscopic video data. arXiv preprint arXiv:1605.07266, 2016. [17] Y. Ziv, L. D. Burns, E. D. Cocker, E. O. Hamel, K. K. Ghosh, L. J. Kitch, A. El Gamal, and M. J. Schnitzer. Long-term dynamics of ca1 hippocampal place codes. Nature neuroscience, 16(3):264–266, 2013. 10
2017
595
7,113
Fast-Slow Recurrent Neural Networks Asier Mujika Department of Computer Science ETH Zürich, Switzerland asierm@ethz.ch Florian Meier Department of Computer Science ETH Zürich, Switzerland meierflo@inf.ethz.ch Angelika Steger Department of Computer Science ETH Zürich, Switzerland steger@inf.ethz.ch Abstract Processing sequential data of variable length is a major challenge in a wide range of applications, such as speech recognition, language modeling, generative image modeling and machine translation. Here, we address this challenge by proposing a novel recurrent neural network (RNN) architecture, the Fast-Slow RNN (FSRNN). The FS-RNN incorporates the strengths of both multiscale RNNs and deep transition RNNs as it processes sequential data on different timescales and learns complex transition functions from one time step to the next. We evaluate the FS-RNN on two character level language modeling data sets, Penn Treebank and Hutter Prize Wikipedia, where we improve state of the art results to 1.19 and 1.25 bits-per-character (BPC), respectively. In addition, an ensemble of two FS-RNNs achieves 1.20 BPC on Hutter Prize Wikipedia outperforming the best known compression algorithm with respect to the BPC measure. We also present an empirical investigation of the learning and network dynamics of the FS-RNN, which explains the improved performance compared to other RNN architectures. Our approach is general as any kind of RNN cell is a possible building block for the FS-RNN architecture, and thus can be flexibly applied to different tasks. 1 Introduction Processing, modeling and predicting sequential data of variable length is a major challenge in the field of machine learning. In recent years, recurrent neural networks (RNNs) [34, 32, 39, 41] have been the most popular tool to approach this challenge. RNNs have been successfully applied to improve state of the art results in complex tasks like language modeling and speech recognition. A popular variation of RNNs are long short-term memories (LSTMs) [18], which have been proposed to address the vanishing gradient problem [16, 5, 17]. LSTMs maintain constant error flow and thus are more suitable to learn long-term dependencies compared to standard RNNs. Our work contributes to the ongoing debate on how to interconnect several RNN cells with the goals of promoting the learning of long-term dependencies, favoring efficient hierarchical representations of information, exploiting the computational advantages of deep over shallow networks and increasing computational efficiency of training and testing. In deep RNN architectures, RNNs or LSTMs are stacked layer-wise on top of each other [9, 20, 11]. The additional layers enable the network to learn complex input to output relations and encourage a efficient hierarchical representation of information. In these architectures, the hidden states of all the hierarchical layers are updated once per time step (by one time step we refer to the time between two consecutive input elements). In multiscale RNN architectures [35, 9, 25, 6], the operation on different timescales is enforced 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. by updating the higher layers less frequently, which further encourages an efficient hierarchical representation of information. Updating higher layers in fewer time steps leads to computationally efficient implementations and gives rise to short gradient paths that favor the learning of long-term dependencies. In deep transition RNN architectures, intermediate sequentially connected layers are interposed between two consecutive hidden states in order to increase the depth of the transition function from one time step to the next, as for example in deep transition networks [31] or Recurrent Highway Networks (RHN) [43]. The intermediate layers enable the network to learn complex nonlinear transition functions. Thus, the model exploits the fact that deep models can represent some functions exponentially more efficiently than shallow models [4]. We interpret these networks as several RNN cells that update a single hidden state sequentially. Observe that any RNN cell can be used to build a deep transition RNN by connecting several of these cells sequentially. Here, we propose the Fast-Slow RNN (FS-RNN) architecture, a novel way of interconnecting RNN cells, that combines advantages of multiscale RNNs and deep transition RNNs. The architecture consists of k sequentially connected RNN cells in the lower hierarchical layer and one RNN cell in the higher hierarchical layer, see Figure 1 and Section 3. Therefore, the hidden state of the lower layer is updated k times per time step, whereas the hidden state of the higher layer is updated only once per time step. We evaluate the FS-RNN on two standard character level language modeling data sets, namely Penn Treebank and Hutter Prize Wikipedia. Additionally, following [31], we present an empirical analysis that reveals advantages of the FS-RNN architecture over other RNN architectures. The main contributions of this paper are: • We propose the FS-RNN as a novel RNN architecture. • We improve state of the art results on the Penn Treebank and Hutter Prize Wikipedia data sets. • We surpass the BPC performance of the best known text compression algorithm evaluated on Hutter Prize Wikipedia by using an ensemble of two FS-RNNs. • We show empirically that the FS-RNN incorporates strengths of both multiscale RNNs and deep transition RNNs, as it stores long-term dependencies efficiently and it adapts quickly to unexpected input. • We provide our code in the following URL https://github.com/amujika/Fast-Slow-LSTM. 2 Related work In the following, we review the work that relates to our approach in more detail. First, we focus on deep transition RNNs and multiscale RNNs since these two architectures are the main sources of inspiration for the FS-RNN architecture. Then, we discuss how our approach differs from these two architectures. Finally, we review other approaches that address the issue of learning long-term dependencies when processing sequential data. Pascanu et al. [31] investigated how a RNN can be converted into a deep RNN. In standard RNNs, the transition function from one hidden state to the next is shallow, that is, the function can be written as one linear transformation concatenated with a point wise non-linearity. The authors added intermediate layers to increase the depth of the transition function, and they found empirically that such deeper architectures boost performance. Since deeper architectures are more difficult to train, they equip the network with skip connections, which give rise to shorter gradient paths (DT(S)-RNN, see [31]). Following a similar line of research, Zilly et al. [43] further increased the transition depth between two consecutive hidden states. They used highway layers [38] to address the issue of training deep architectures. The resulting RHN [43] achieved state of the art results on the Penn Treebank and Hutter Prize Wikipedia data sets. Furthermore, a vague similarity to deep transition networks can be seen in adaptive computation [12], where an LSTM cell learns how many times it should update its state after receiving the input to produce the next output. Multiscale RNNs are obtained by stacking multiple RNNs with decreasing order of update frequencies on top of each other. Early attempts proposed such architectures for sequential data compression [35], where the higher layer is only updated in case of prediction errors of the lower layer, and for sequence classification [9], where the higher layers are updated with a fixed smaller frequency. More recently, Koutnik et al. [25] proposed the Clockwork RNN, in which the hidden units are divided into 2 f F1 f F2 f Fk f S hF2 t hF1 t hFk t hFk−1 t hFk t−1 hS t hS t−1 xt yt · · · Figure 1: Diagram of a Fast-Slow RNN with k Fast cells. Observe that only the second Fast cell receives the input from the Slow cell. several modules, of which the i-th module is only updated every 2i-th time-step. General advantages of this multiscale RNN architecture are improved computational efficiency, efficient propagation of long-term dependencies and flexibility in allocating resources (units) to the hierarchical layers. Multiscale RNNs have been applied for speech recognition in [3], where the slower operating RNN pools information over time and the timescales are fixed hyperparameters as in Clockwork RNNs. In [36], multiscale RNNs are applied to make context-aware query suggestions. In this case, explicit hierarchical boundary information is provided. Chung et al. [6] presented a hierarchical multiscale RNN (HM-RNN) that discovers the latent hierarchical structure of the sequence without explicitly given boundary information. If a parametrized boundary detector indicates the end of a segment, then a summarized representation of the segment is fed to the upper layer and the state of the lower layer is reset [6]. Our FS-RNN architectures borrows elements from both deep transition RNNs and multiscale RNNs. The lower hierarchical layer is a deep transition RNN, that updates the hidden state several times per time step, whereas the higher hierarchical layer updates the hidden state only once per time step. Many approaches aim at solving the problem of learning long-term dependencies in sequential data. A very popular one is to use external memory cells that can be accessed and modified by the network, see Neural Turing Machines [13], Memory Networks [40] and Differentiable Neural Computer [14]. Other approaches focus on different optimization techniques rather than network architectures. One attempt is Hessian Free optimization [29], a second order training method that achieved good results on RNNs. The use of different optimization techniques can improve learning in a wide range of RNN architectures and therefore, the FS-RNN may also benefit from it. 3 Fast-Slow RNN We propose the FS-RNN architecture, see Figure 1. It consists of k sequentially connected RNN cells F1, . . . , Fk on the lower hierarchical layer and one RNN cell S on the higher hierarchical layer. We call F1, . . . , Fk the Fast cells, S the Slow cell and the corresponding hierarchical layers the Fast and Slow layer, respectively. S receives input from F1 and feeds its state to F2. F1 receives the sequential input data xt, and Fk outputs the predicted probability distribution yt of the next element of the sequence. Intuitively, the Fast cells are able to learn complex transition functions from one time step to the next one. The Slow cell gives rise to shorter gradient paths between sequential inputs that are distant in time, and thus, it facilitates the learning of long-term dependencies. Therefore, the FS-RNN architecture incorporates advantages of deep transition RNNs and of multiscale RNNs, see Section 2. Since any kind of RNN cell can be used as building block for the FS-RNN architecture, we state the formal update rules of the FS-RNN for arbitrary RNN cells. We define a RNN cell Q to be a differentiable function f Q(h, x) that maps a hidden state h and an additional input x to a new hidden state. Note that x can be input data or input from a cell in a higher or lower hierarchical layer. If a cell does not receive an additional input, then we will omit x. The following equations define the FS-RNN architecture for arbitrary RNN cells F1, . . . , Fk and S. 3 hF1 t = f F1(hFk t−1, xt) hS t = f S(hS t−1, hF1 t ) hF2 t = f F2(hF1 t , hS t ) hFi t = f Fi(hFi−1 t ) for 3 ≤i ≤k The output yt is computed as an affine transformation of hFk t . It is possible to extend the FS-RNN architecture in order to further facilitate the learning of long-term dependencies by adding hierarchical layers, each of which operates on a slower timescale than the ones below, resembling clockwork RNNs [25]. However, for the tasks considered in Section 4, we observed that this led to overfitting the training data even when applying regularization techniques and reduced the performance at test time. Therefore, we will not further investigate this extension of the model in this paper, even though it might be beneficial for other tasks or larger data sets. In the experiments in Section 4, we use LSTM cells as building blocks for the FS-RNN architecture. For completeness, we state the update function f Q for an LSTM Q. The state of an LSTM is a pair (ht, ct), consisting of the hidden state and the cell state. The function f Q maps the previous state and input (ht−1, ct−1, xt) to the next state (ht, ct) according to    ft it ot gt   = W Q h ht−1 + W Q x xt + bQ ct = σ(ft) ⊙ct−1 + σ(it) ⊙tanh(gt) ht = σ(ot) ⊙tanh(ct) , where ft, it and ot are commonly referred to as forget, input and output gates, and gt are the new candidate cell states. Moreover, W Q h , W Q x and bQ are the learnable parameters, σ denotes the sigmoid function, and ⊙denotes the element-wise multiplication. 4 Experiments For the experiments, we consider the Fast-Slow LSTM (FS-LSTM) that is a FS-RNN, where each RNN cell is a LSTM cell. The FS-LSTM is evaluated on two character level language modeling data sets, namely Penn Treebank and Hutter Prize Wikipedia, which will be referred to as enwik8 in this section. The task consists of predicting the probability distribution of the next character given all the previous ones. In Section 4.1, we compare the performance of the FS-LSTM with other approaches. In Section 4.2, we empirically compare the network dynamics of different RNN architectures and show the FS-LSTM combines the benefits of both, deep transition RNNs and multiscale RNNs. 4.1 Performance on Penn Treebank and Hutter Prize Wikipedia The FS-LSTM achieves 1.19 BPC and 1.25 BPC on the Penn Treebank and enwik8 data sets, respectively. These results are compared to other approaches in Table 1 and Table 2 (the baseline LSTM results without citations are taken from [44] for Penn Treebank and from [15] for enwik8). For the Penn Treebank, the FS-LSTM outperforms all previous approaches with significantly less parameters than the previous top approaches. We did not observe any improvement when increasing the model size, probably due to overfitting. In the enwik8 data set, the FS-LSTM surpasses all other neural approaches. Following [13], we compare the results with text compression algorithms using the BPC measure. An ensemble of two FS-LSTM models (1.20 BPC) outperforms cmix (1.23 BPC) [24], the current best text compression algorithm on enwik8 [27]. However, a fair comparison is difficult. Compression algorithms are usually evaluated by the final size of the compressed data set including the decompressor size. For character prediction models, the network size is usually not taken into account and the performance is measured on the test set. We remark that as the FS-LSTM is evaluated on the test set, it should achieve similar performance on any part of the English Wikipedia. 4 Table 1: BPC on Penn Treebank Model BPC Param Count Zoneout LSTM [2] 1.27 2-Layers LSTM 1.243 6.6M HM-LSTM [6] 1.24 HyperLSTM - small [15] 1.233 5.1M HyperLSTM [15] 1.219 14.4M NASCell - small [44] 1.228 6.6M NASCell [44] 1.214 16.3M FS-LSTM-2 (ours) 1.190 7.2M FS-LSTM-4 (ours) 1.193 6.5M The FS-LSTM-2 and FS-LSTM-4 model consist of two and four cells in the Fast layer, respectively. The FS-LSTM-4 model outperforms the FS-LSTM-2 model, but its processing time for one time step is 25% higher than the one of the FS-LSTM-2. Adding more cells to the Fast layer could further improve the performance as observed for RHN [43], but would increase the processing time, because the cell states are computed sequentially. Therefore, we did not further increase the number of Fast cells. The model is trained to minimize the cross-entropy loss between the predictions and the training data. Formally, the loss function is defined as L = −1 n Pn i=1 log pθ(xi|x1, . . . , xi−1), where pθ(xi|x1, . . . , xi−1) is the probability that a model with parameters θ assigns to the next character xi given all the previous ones. The model is evaluated by the BPC measure, which uses the binary logarithm instead of the natural logarithm in the loss function. All the hyperparameters used for the experiments are summarized in Table 3. We regularize the FS-LSTM with dropout [37]. In each time step, a different dropout mask is applied for the non-recurrent connections [42], and Zoneout [2] is applied for the recurrent connections. The network is trained with minibatch gradient descent using the Adam optimizer [23]. If the gradients have norm larger than 1 they are normalized to 1. Truncated backpropagation through time (TBPTT) [34, 10] is used to approximate the gradients, and the final hidden state is passed to the next sequence. The learning rate is divided by a factor 10 for the last 20 epochs in the Penn Treebank experiments, and it is divided by a factor 10 whenever the validation error does not improve in two consecutive epochs in the enwik8 experiments. The forget bias of every LSTM cell is initialized to 1, and all weight matrices are initialized to orthogonal matrices. Layer normalization [1] is applied to the cell and to each gate separately. The network with the smallest validation error is evaluated on the test set. The two data sets that we use for evaluation are: Penn Treebank [28] The dataset is a collection of Wall Street Journal articles written in English. It only contains 10000 different words, all written in lower-case, and rare words are replaced with "< unk >". Following [30], we split the data set into train, validation and test sets consisting of 5.1M, 400K and 450K characters, respectively. Hutter Prize Wikipedia [19] This dataset is also known as enwik8 and it consists of "raw" Wikipedia data, that is, English articles, tables, XML data, hyperlinks and special characters. The data set contains 100M characters with 205 unique tokens. Following [7], we split the data set into train, validation and test sets consisting of 90M, 5M and 5M characters, respectively. 4.2 Comparison of network dynamics of different architectures We compare the FS-LSTM architecture with the stacked-LSTM and the sequential-LSTM architectures, depicted in Figure 2, by investigating the network dynamics. In order to conduct a fair comparison we chose the number of parameters to roughly be the same for all three models. The FS-LSTM consists of one Slow and four Fast LSTM cells of 450 units each. The stacked-LSTM consists of five LSTM cells stacked on top of each other consisting of 375 units each, which will be 5 Table 2: BPC on enwik8 Model BPC Param Count LSTM, 2000 units 1.461 18M Layer Norm LSTM, 1800 units 1.402 14M HyperLSTM [15] 1.340 27M HM-LSTM [6] 1.32 35M Surprisal-driven Zoneout [33] 1.31 64M ByteNet [22] 1.31 RHN - depth 5 [43] 1.31 23M RHN - depth 10 [43] 1.30 21M Large RHN - depth 10 [43] 1.27 46M FS-LSTM-2 (ours) 1.290 27M FS-LSTM-4 (ours) 1.277 27M Large FS-LSTM-4 (ours) 1.245 47M 2 × Large FS-LSTM-4 (ours) 1.198 2 × 47M cmix v13 [24] 1.225 Table 3: Hyperparameters for the character-level language model experiments. Penn Treebank enwik8 FS-LSTM-2 FS-LSTM-4 FS-LSTM-2 FS-LSTM-4 Large FS-LSTM-4 Non-recurrent dropout 0.35 0.35 0.2 0.2 0.25 Cell zoneout 0.5 0.5 0.3 0.3 0.3 Hidden zoneout 0.1 0.1 0.05 0.05 0.05 Fast cell size 700 500 900 730 1200 Slow cell size 400 400 1500 1500 1500 TBPTT length 150 150 150 150 100 Minibatch size 128 128 128 128 128 Input embedding size 128 128 256 256 256 Initial Learning rate 0.002 0.002 0.001 0.001 0.001 Epochs 200 200 35 35 50 referred to as Stacked-1, ... , Stacked-5, from bottom to top. The sequential-LSTM consists of five sequentially connected LSTM cells of 500 units each. All three models require roughly the same time to process one time step. The models are trained on enwik8 for 20 epochs with minibatch gradient descent using the Adam optimizer [23] without any regularization, but layer normalization [1] is applied on the cell states of the LSTMs. The hyperparameters are not optimized for any of the three models. We repeat each experiment 5 times and report the mean and standard deviation. The experiments suggest that the FS-LSTM architecture favors the learning of long-term dependencies (Figure 3), enforces hidden cell states to change at different rates (Figure 4) and facilitates a quick adaptation to unexpected inputs (Figure 5). Moreover, the FS-LSTM achieves a mean performance of 1.49 BPC with a standard deviation of 0.007 BPC and outperforms the stacked-LSTM (mean 1.60 BPC, standard deviation 0.022 BPC ) and the sequential-LSTM (mean 1.58 BPC, standard deviation 0.008 BPC ). In Figure 3, we asses the ability to capture long-term dependencies by investigating the effect of the cell state on the loss at later time points, following [2]. We measure the effect of the cell state at time t −k on the loss at time t by the gradient ∥∂Lt ∂ct−k ∥. This gradient is the largest for the Slow 6 f 1 f 5 h5 t h5 t−1 h1 t h1 t−1 xt yt ... (a) Stacked f 1 f 2 f 5 ht ht−1 xt yt · · · (b) Sequential Figure 2: Diagram of (a) stacked-LSTM and (b) sequential-LSTM with 5 cells each. 0 20 40 60 80 100 k 0.0 0.2 0.4 0.6 0.8 1.0 Gradient norm 0 20 40 60 80 100 k FS-Fast FS-Slow Sequential Stacked-4 Stacked-5 Stacked-1 Stacked-2 Stacked-3 Stacked-4 Stacked-5 Figure 3: Long-term effect of the cell states on the loss function. The average value of ∂Lt ∂ct−k , which is the effect of the cell state at time t −k on the loss function at time t, is plotted against k for the different layers in the three RNN architectures. The shaded area shows the standard deviation. For the sequential-LSTM only the first cell is considered. LSTM, and it is small and steeply decaying as k increases for the Fast LSTM. Evidently, the Slow cell captures long-term dependencies, whereas the Fast cell only stores short-term information. In the stacked-LSTM, the gradients decrease from the top layer to the bottom layer, which can be explained by the vanishing gradient problem. The small, steeply decaying gradients of the sequential-LSTM indicate that it is less capable to learn long-term dependencies than the other two models. Figure 4 gives further evidence that the FS-LSTM stores long-term dependencies efficiently in the Slow LSTM cell. It shows that among all the layers of the three RNN architectures, the cell states of the Slow LSTM change the least from one time step to the next. The highest change is observed for the cells of the sequential model followed by the Fast LSTM cells. In Figure 5, we investigate whether the FS-LSTM quickly adapts to unexpected characters, that is, whether it performs well on the subsequent ones. In text modeling, the initial character of a word has the highest entropy, whereas later characters in a word are usually less ambiguous [10]. Since the first character of a word is the most difficult one to predict, the performance at the following positions should reflect the ability to adapt to unexpected inputs. While the prediction qualities at the first position are rather close for all three models, the FS-LSTM outperforms the stacked-LSTM and sequential-LSTM significantly on subsequent positions. It is possible that new information is incorporated quickly in the Fast layer, because it only stores short-term information, see Figure 3. 7 Sequential Fast-Slow Stacked 0.0 0.2 0.4 0.6 0.8 1.0 Rate of change Sequential FS-Fast FS-Slow Stacked-1 Stacked-2 Stacked-3 Stacked-4 Stacked-5 Figure 4: Rate of change of the cell states from one time step to the next. We plot 1 n Pn i=1(ct,i − ct−1,i)2 averaged over all time steps, where ct,i is the value of the ith unit at time step t, for the different layers of the three RNN architectures. The error bars show the standard deviation. For the sequential-LSTM only the first cell is considered. 2 4 6 8 10 character position 0.5 1.0 1.5 2.0 2.5 BPC 2 4 6 8 10 character position 0.90 0.92 0.94 0.96 0.98 1.00 1.02 Relative loss Fast-Slow Sequential Stacked Figure 5: Bits-per-character at each character position. The left panel shows the average bits-percharacter at each character positions in the test set. The right panel shows the average relative loss with respect to the stacked-LSTM at each character position. The shaded area shows the standard deviation. For this Figure, a word is considered to be a sequence of lower-case letters of length at least 2 in-between two spaces. 5 Conclusion In this paper, we have proposed the FS-RNN architecture. Up to our knowledge, it is the first architecture that incorporates ideas of both multiscale and deep transition RNNs. The FS-RNN architecture improved state of the art results on character level language modeling evaluated on the Penn Treebank and Hutter Prize Wikipedia data sets. An ensemble of two FS-RNNs achieves better BPC performance than the best known compression algorithm. Further experiments provided evidence that the Slow cell enables the network to learn long-term dependencies, while the Fast cells enable the network to quickly adapt to unexpected inputs and learn complex transition functions from one time step to the next. Our FS-RNN architecture provides a general framework for connecting RNN cells as any type of RNN cell can be used as building block. Thus, there is a lot of flexibility in applying the architecture to different tasks. For instance using RNN cells with good long-term memory, like EURNNs [21] or NARX RNNs [26, 8], for the Slow cell might boost the long-term memory of the FS-RNN 8 architecture. Therefore, the FS-RNN architecture might improve performance in many different applications. Acknowledgments We thank Julian Zilly for many helpful discussions. References [1] Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E. Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016. [2] Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E. Hinton. Zoneout: Regularizing rnns by randomly preserving hidden activations. arXiv preprint arXiv:1607.06450, 2016. [3] Dzmitry Bahdanau, Jan Chorowski, Dmitriy Serdyuk, Philemon Brakel, and Yoshua Bengio. End-to-end attention-based large vocabulary speech recognition. Acoustics, Speech and Signal Processing (ICASSP), 2016 IEEE International Conference, 2016. [4] Yoshua Bengio et al. Learning deep architectures for ai. Foundations and trends R⃝in Machine Learning, 2(1):1–127, 2009. [5] Yoshua Bengio, Patrice Simard, and Paolo Frasconi. Learning long-term dependencies with gradient descent is difficult. IEEE transactions on neural networks, 5(2):157–166, 1994. [6] Junyoung Chung, Sungjin Ahn, and Yoshua Bengio. Hierarchical multiscale recurrent neural networks. arXiv preprint arXiv:1609.01704, 2016. [7] Junyoung Chung, Caglar Gülçehre, Kyunghyun Cho, and Yoshua Bengio. Gated feedback recurrent neural networks. In ICML, pages 2067–2075, 2015. [8] Robert DiPietro, Nassir Navab, and Gregory D. Hager. Revisiting narx recurrent neural networks for long-term dependencies, 2017. [9] Salah El Hihi and Yoshua Bengio. Hierarchical recurrent neural networks for long-term dependencies. In Nips, volume 409, 1995. [10] Jeffrey L. Elman. Finding structure in time. COGNITIVE SCIENCE, 14:179–211, 1990. [11] Alex Graves. Generating sequences with recurrent neural networks. arXiv preprint arXiv:1308.0850, 2013. [12] Alex Graves. Adaptive computation time for recurrent neural networks. arXiv preprint arXiv:1603.08983, 2016. [13] Alex Graves, Greg Wayne, and Ivo Danihelka. Neural turing machines. arXiv preprint arXiv:1410.5401, 2014. [14] Alex Graves, Greg Wayne, Malcolm Reynolds, Tim Harley, Ivo Danihelka, Agnieszka Grabska-Barwi´nska, Sergio Gómez Colmenarejo, Edward Grefenstette, Tiago Ramalho, John Agapiou, et al. Hybrid computing using a neural network with dynamic external memory. Nature, 538(7626):471–476, 2016. [15] David Ha, Andrew Dai, and Quoc V. Le. Hypernetworks. arXiv preprint arXiv:1611.01578, 2016. [16] Sepp Hochreiter. Untersuchungen zu dynamischen neuronalen Netzen. PhD thesis, diploma thesis, institut für informatik, lehrstuhl prof. brauer, technische universität münchen, 1991. [17] Sepp Hochreiter. The vanishing gradient problem during learning recurrent neural nets and problem solutions. International Journal of Uncertainty, Fuzziness and Knowledge-Based Systems, 6(02):107–116, 1998. [18] Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8):1735–1780, 1997. [19] Marcus Hutter. The human knowledge compression contest. http://prize.hutter1.net, 2012. [20] Herbert Jaeger. Discovering multiscale dynamical features with hierarchical echo state networks. Technical report, Jacobs University Bremen, 2007. [21] Li Jing, Yichen Shen, Tena Dubˇcek, John Peurifoy, Scott Skirlo, Yann LeCun, Max Tegmark, and Marin Soljaˇci´c. Tunable efficient unitary neural networks (eunn) and their application to rnns, 2016. [22] Nal Kalchbrenner, Lasse Espeholt, Karen Simonyan, Aaron van den Oord, Alex Graves, and Koray Kavukcuoglu. Neural machine translation in linear time. arXiv preprint arXiv:1610.10099, 2016. [23] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. [24] Bryon Knoll. Cmix. http://www.byronknoll.com/cmix.html, 2017. Accessed: 2017-05-18. 9 [25] Jan Koutník, Klaus Greff, Faustino Gomez, and Jürgen Schmidhuber. A clockwork rnn. arXiv preprint arXiv:1603.08983, 2016. [26] Tsungnan Lin, Bill G Horne, Peter Tino, and C Lee Giles. Learning long-term dependencies in narx recurrent neural networks. IEEE Transactions on Neural Networks, 7(6):1329–1338, 1996. [27] Matt Mahoney. Large text compression benchmark. http://mattmahoney.net/dc/text.html, 2017. Accessed: 2017-05-18. [28] Mitchell P. Marcus, Mary Ann Marcinkiewicz, and Beatrice Santorini. Building a large annotated corpus of english: The penn treebank. Comput. Linguist., 19(2):313–330, June 1993. [29] James Martens and Ilya Sutskever. Learning recurrent neural networks with hessian-free optimization. In Proceedings of the 28th International Conference on Machine Learning (ICML-11), pages 1033–1040, 2011. [30] Tomá˘s Mikolov, Ilya Sutskever, Anoop Deoras, Hai-Son Le, Kombrink Stefan, and Jan ˘Cernocký. Subword language modeling with neural networks. preprint: http://www.fit.vutbr.cz/ imikolov/rnnlm/char.pdf, 2012. [31] Razvan Pascanu, Caglar Gulcehre, Kyunghyun Cho, and Yoshua Bengio. How to construct deep recurrent neural networks. arXiv preprint arXiv:1312.6026, 2013. [32] AJ Robinson and Frank Fallside. The utility driven dynamic error propagation network. University of Cambridge Department of Engineering, 1987. [33] Kamil Rocki, Tomasz Kornuta, and Tegan Maharaj. Surprisal-driven zoneout. arXiv preprint arXiv:1610.07675, 2016. [34] David E Rumelhart, Geoffrey E Hinton, and Ronald J Williams. Learning representations by backpropagating errors. Cognitive modeling, 5(3):1, 1988. [35] Jürgen Schmidhuber. Learning complex, extended sequences using the principle of history compression. Neural Computation, 4(2):234–242, 1992. [36] Alessandro Sordoni, Yoshua Bengio, Hossein Vahabi, Christina Lioma, Jakob Grue Simonsen, and JianYun Nie. A hierarchical recurrent encoder-decoder for generative context-aware query suggestion. In Proceedings of the 24th ACM International on Conference on Information and Knowledge Management, pages 553–562. ACM, 2015. [37] Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. J. Mach. Learn. Res., 15(1):1929–1958, January 2014. [38] Rupesh Kumar Srivastava, Klaus Greff, and Jürgen Schmidhuber. Highway networks. arXiv preprint arXiv:1505.00387, 2015. [39] Paul J Werbos. Generalization of backpropagation with application to a recurrent gas market model. Neural networks, 1(4):339–356, 1988. [40] Jason Weston, Sumit Chopra, and Antoine Bordes. Memory networks. arXiv preprint arXiv:1410.3916, 2014. [41] Ronald J Williams. Complexity of exact gradient computation algorithms for recurrent neural networks. Technical report, Technical Report Technical Report NU-CCS-89-27, Boston: Northeastern University, College of Computer Science, 1989. [42] Wojciech Zaremba, Ilya Sutskever, and Oriol Vinyals. Recurrent neural network regularization. arXiv preprint arXiv:1409.2329, 2014. [43] Julian Georg Zilly, Rupesh Kumar Srivastava, Jan Koutník, and Jürgen Schmidhuber. Recurrent highway networks. arXiv preprint arXiv:1607.03474, 2016. [44] Barret Zoph and Quoc V. Le. Neural architecture search with reinforcement learning. arXiv preprint arXiv:1611.01578, 2016. 10
2017
596
7,114
PredRNN: Recurrent Neural Networks for Predictive Learning using Spatiotemporal LSTMs Yunbo Wang School of Software Tsinghua University wangyb15@mails.tsinghua.edu.cn Mingsheng Long∗ School of Software Tsinghua University mingsheng@tsinghua.edu.cn Jianmin Wang School of Software Tsinghua University jimwang@tsinghua.edu.cn Zhifeng Gao School of Software Tsinghua University gzf16@mails.tsinghua.edu.cn Philip S. Yu School of Software Tsinghua University psyu@uic.edu Abstract The predictive learning of spatiotemporal sequences aims to generate future images by learning from the historical frames, where spatial appearances and temporal variations are two crucial structures. This paper models these structures by presenting a predictive recurrent neural network (PredRNN). This architecture is enlightened by the idea that spatiotemporal predictive learning should memorize both spatial appearances and temporal variations in a unified memory pool. Concretely, memory states are no longer constrained inside each LSTM unit. Instead, they are allowed to zigzag in two directions: across stacked RNN layers vertically and through all RNN states horizontally. The core of this network is a new Spatiotemporal LSTM (ST-LSTM) unit that extracts and memorizes spatial and temporal representations simultaneously. PredRNN achieves the state-of-the-art prediction performance on three video prediction datasets and is a more general framework, that can be easily extended to other predictive learning tasks by integrating with other architectures. 1 Introduction As a key application of predictive learning, generating images conditioned on given consecutive frames has received growing interests in machine learning and computer vision communities. To learn representations of spatiotemporal sequences, recurrent neural networks (RNN) [17, 27] with the Long Short-Term Memory (LSTM) [9] have been recently extended from supervised sequence learning tasks, such as machine translation [22, 2], speech recognition [8], action recognition [28, 5] and video captioning [5], to this spatiotemporal predictive learning scenario [21, 16, 19, 6, 25, 12]. 1.1 Why spatiotemporal memory? In spatiotemporal predictive learning, there are two crucial aspects: spatial correlations and temporal dynamics. The performance of a prediction system depends on whether it is able to memorize relevant structures. However, to the best of our knowledge, the state-of-the-art RNN/LSTM predictive learning methods [19, 21, 6, 12, 25] focus more on modeling temporal variations (such as the object moving trajectories), with memory states being updated repeatedly over time inside each LSTM unit. Admittedly, the stacked LSTM architecture is proved powerful for supervised spatiotemporal learning ∗Corresponding author: Mingsheng Long 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. (such as video action recognition [5, 28]). Two conditions are met in this scenario: (1) Temporal features are strong enough for classification tasks. In contrast, fine-grained spatial appearances prove to be less significant; (2) There are no complex visual structures to be modeled in the expected outputs so that spatial representations can be highly abstracted. However, spatiotemporal predictive leaning does not satisfy these conditions. Here, spatial deformations and temporal dynamics are equally significant to generating future frames. A straightforward idea is that if we hope to foretell the future, we need to memorize as many historical details as possible. When we recall something happened before, we do not just recall object movements, but also recollect visual appearances from coarse to fine. Motivated by this, we present a new recurrent architecture called Predictive RNN (PredRNN), which allows memory states belonging to different LSTMs to interact across layers (in conventional RNNs, they are mutually independent). As the key component of PredRNN, we design a novel Spatiotemporal LSTM (ST-LSTM) unit. It models spatial and temporal representations in a unified memory cell and convey the memory both vertically across layers and horizontally over states. PredRNN achieves the state-of-the-art prediction results on three video datasets. It is a general and modular framework for predictive learning and is not limited to video prediction. 1.2 Related work Recent advances in recurrent neural network models provide some useful insights on how to predict future visual sequences based on historical observations. Ranzato et al. [16] defined a RNN architecture inspired from language modeling, predicting the frames in a discrete space of patch clusters. Srivastava et al. [21] adapted the sequence to sequence LSTM framework. Shi et al. [19] extended this model to further extract visual representations by exploiting convolutions in both input-to-state and state-to-state transitions. This Convolutional LSTM (ConvLSTM) model has become a seminal work in this area. Subsequently, Finn et al. [6] constructed a network based on ConvLSTMs that predicts transformations on the input pixels for next-frame prediction. Lotter et al. [12] presented a deep predictive coding network where each ConvLSTM layer outputs a layer-specific prediction at each time step and produces an error term, which is then propagated laterally and vertically in the network. However, in their settings, the predicted next frame always bases on the whole previous ground truth sequence. By contrast, we predict sequence from sequence, which is obviously more challenging. Patraucean et al. [15] and Villegas et al. [25] brought optical flow into RNNs to model short-term temporal dynamics, which is inspired by the two-stream CNNs [20] designed for action recognition. However, the optical flow images are hard to use since they would bring in high additional computational costs and reduce the prediction efficiency. Kalchbrenner et al. [10] proposed a Video Pixel Network (VPN) that estimates the discrete joint distribution of the raw pixel values in a video using the well-established PixelCNNs [24]. But it suffers from high computational complexity. Besides the above RNN architectures, other deep architectures are involved to solve the visual predictive learning problem. Oh et al. [14] defined a CNN-based action conditional autoencoder model to predict next frames in Atari games. Mathieu et al. [13] successfully employed generative adversarial networks [7, 4] to preserve the sharpness of the predicted frames. In summary, these existing visual prediction models yield different shortcomings due to different causes. The RNN-based architectures [21, 16, 19, 6, 25, 12] model temporal structures with LSTMs, but their predicted images tend to blur due to a loss of fine-grained visual appearances. In contrast, CNN-based networks [13, 14] predict one frame at a time and generate future images recursively, which are prone to focus on spatial appearances and relatively weak in capturing long-term motions. In this paper, we explore a new RNN framework for predictive learning and present a novel LSTM unit for memorizing spatiotemporal information simultaneously. 2 Preliminaries 2.1 Spatiotemporal predictive learning Suppose we are monitoring a dynamical system (e.g. a video clip) of P measurements over time, where each measurement (e.g. a RGB channel) is recorded at all locations in a spatial region represented by an M × N grid (e.g. video frames). From the spatial view, the observation of these P measurements at any time can be represented by a tensor X ∈RP ×M×N. From the temporal view, the observations over T time steps form a sequence of tensors X1, X2, . . . , XT . The spatiotemporal predictive learning problem is to predict the most probable length-K sequence in the future given the 2 previous length-J sequence including the current observation: b Xt+1, . . . , b Xt+K = arg max Xt+1,...,Xt+K p (Xt+1, . . . , Xt+K|Xt−J+1, . . . , Xt) . (1) Spatiotemporal predictive learning is an important problem, which could find crucial and high-impact applications in various domains: video prediction and surveillance, meteorological and environmental forecasting, energy and smart grid management, economics and finance prediction, etc. Taking video prediction as an example, the measurements are the three RGB channels, and the observation at each time step is a 3D video frame of RGB image. Another example is radar-based precipitation forecasting, where the measurement is radar echo values and the observation at every time step is a 2D radar echo map that can be visualized as an RGB image. 2.2 Convolutional LSTM Compared with standard LSTMs, the convolutional LSTM (ConvLSTM) [19] is able to model the spatiotemporal structures simultaneously by explicitly encoding the spatial information into tensors, overcoming the limitation of vector-variate representations in standard LSTM where the spatial information is lost. In ConvLSTM, all the inputs X1, . . . , Xt, cell outputs C1, . . . , Ct, hidden state H1, . . . , Ht, and gates it, ft, gt, ot are 3D tensors in RP ×M×N, where the first dimension is either the number of measurement (for inputs) or the number of feature maps (for intermediate representations), and the last two dimensions are spatial dimensions (M rows and N columns). To get a better picture of the inputs and states, we may imagine them as vectors standing on a spatial grid. ConvLSTM determines the future state of a certain cell in the M × N grid by the inputs and past states of its local neighbors. This can easily be achieved by using convolution operators in the state-to-state and input-to-state transitions. The key equations of ConvLSTM are shown as follows: gt = tanh(Wxg ∗Xt + Whg ∗Ht−1 + bg) it = σ(Wxi ∗Xt + Whi ∗Ht−1 + Wci ⊙Ct−1 + bi) ft = σ(Wxf ∗Xt + Whf ∗Ht−1 + Wcf ⊙Ct−1 + bf) Ct = ft ⊙Ct−1 + it ⊙gt ot = σ(Wxo ∗Xt + Who ∗Ht−1 + Wco ⊙Ct + bo) Ht = ot ⊙tanh(Ct), (2) where σ is sigmoid activation function, ∗and ⊙denote the convolution operator and the Hadamard product respectively. If the states are viewed as the hidden representations of moving objects, then a ConvLSTM with a larger transitional kernel should be able to capture faster motions while one with a smaller kernel can capture slower motions [19]. The use of the input gate it, forget gate ft, output gate ot, and input-modulation gate gt controls information flow across the memory cell Ct. In this way, the gradient will be prevented from vanishing quickly by being trapped in the memory. The ConvLSTM network adopts the encoder-decoder RNN architecture that is proposed in [23] and extended to video prediction in [21]. For a 4-layer ConvLSTM encoder-decoder network, input frames are fed into the the first layer and future video sequence is generated at the fourth one. In this process, spatial representations are encoded layer-by-layer, with hidden states being delivered from bottom to top. However, the memory cells that belong to these four layers are mutually independent and updated merely in time domain. Under these circumstances, the bottom layer would totally ignore what had been memorized by the top layer at the previous time step. Overcoming these drawbacks of this layer-independent memory mechanism is important to the predictive learning of video sequences. 3 PredRNN In this section, we give detailed descriptions of the predictive recurrent neural network (PredRNN). Initially, this architecture is enlightened by the idea that a predictive learning system should memorize both spatial appearances and temporal variations in a unified memory pool. By doing this, we make the memory states flow through the whole network along a zigzag direction. Then, we would like to go a step further to see how to make the spatiotemporal memory interact with the original long short-term memory. Thus we make explorations on the memory cell, memory gate and memory fusion mechanisms inside LSTMs/ConvLSTMs. We finally derive a novel Spatiotemporal LSTM (ST-LSTM) unit for PredRNN, which is able to deliver memory states both vertically and horizontally. 3 3.1 Spatiotemporal memory flow Mt−1 l=2,Ht−1 l=2 Mt−1 l=1,Ht−1 l=1 Mt−1 l=3,Ht−1 l=3 Mt−1 l=4,Ht−1 l=4 Mt l=1,Ht l=1 Mt l=2,Ht l=2 Mt l=3,Ht l=3 Mt l=4,Ht l=4 Mt+1 l=4,Ht+1 l=4 Mt+1 l=3,Ht+1 l=3 Mt+1 l=2,Ht+1 l=2 Mt+1 l=1,Ht+1 l=1 W1 W1 W2 W2 W3 W3 W4 W4 Xt ˆXt+1 Ht l=3 Ht l=2 Ht l=1 Ct l=1,Ht l=1 Ct−1 l=1,Ht−1 l=1 Ct l=2,Ht l=2 Ct−1 l=2,Ht−1 l=2 Ct l=3,Ht l=3 Ct−1 l=3,Ht−1 l=3 Ct−1 l=4,Ht−1 l=4 Ct l=4,Ht l=4 W1 W1 W1 W1 W1 W1 W2 W2 W2 W2 W2 W2 W3 W3 W3 W3 W3 W3 W4 W4 W4 W4 W4 W4 ˆXt+1 ˆXt+2 ˆXt Xt Xt+1 Xt−1 Mt−2 l=4,Ht−2 l=4 Figure 1: Left: The convolutional LSTM network with a spatiotemporal memory flow. Right: The conventional ConvLSTM architecture. The orange arrows denote the memory flow direction for all memory cells. For generating spatiotemporal predictions, we initially exploit convolutional LSTMs (ConvLSTM) [19] as basic building blocks. Stacked ConvLSTMs extract highly abstract features layer-by-layer and then make predictions by mapping them back to the pixel value space. In the conventional ConvLSTM architecture, as illustrated in Figure 1 (right), the cell states are constrained inside each ConvLSTM layer and be updated only horizontally. Information is conveyed upwards only by hidden states. Such a temporal memory flow is reasonable in supervised learning, because according to the study of the stacked convolutional layers, the hidden representations can be more and more abstract and class-specific from the bottom layer upwards. However, we suppose in predictive learning, detailed information in raw input sequence should be maintained. If we want to see into the future, we need to learn from representations extracted at different-level convolutional layers. Thus, we apply a unified spatiotemporal memory pool and alter RNN connections as illustrated in Figure 1 (left). The orange arrows denote the feed-forward directions of LSTM memory cells. In the left figure, a unified memory is shared by all LSTMs which is updated along a zigzag direction. The key equations of the convolutional LSTM unit with a spatiotemporal memory flow are shown as follows: gt = tanh(Wxg ∗Xt1{l=1} + Whg ∗Hl−1 t + bg) it = σ(Wxi ∗Xt1{l=1} + Whi ∗Hl−1 t + Wmi ⊙Ml−1 t + bi) ft = σ(Wxf ∗Xt1{l=1} + Whf ∗Hl−1 t + Wmf ⊙Ml−1 t + bf) Ml t = ft ⊙Ml−1 t + it ⊙gt ot = σ(Wxo ∗Xt1{l=1} + Who ∗Hl−1 t + Wmo ⊙Ml t + bo) Hl t = ot ⊙tanh(Ml t). (3) The input gate, input modulation gate, forget gate and output gate no longer depend on the hidden states and cell states from the previous time step at the same layer. Instead, as illustrated in Figure 1 (left), they rely on hidden states Hl−1 t and cell states Ml−1 t (l ∈{1, ..., L}) that are updated by the previous layer at current time step. Specifically, the bottom LSTM unit receives state values from the top layer at the previous time step: for l = 1, Hl−1 t = HL t−1, Ml−1 t = ML t−1. The four layers in this figure have different sets of input-to-state and state-to-state convolutional parameters, while they maintain a spatiotemporal memory cell and update its states separately and repeatedly as the information flows through the current node. Note that in the revised ConvLSTM network with a spatiotemporal memory in Figure 1, we replace the notation for memory cell from C to M to emphasize that it flows in the zigzag direction instead of the horizontal direction. 4 3.2 Spatiotemporal LSTM Input Gate Output Gate Forget Gate Input Modulation Gate Standard Temporal Memory gt it ft ot Mt l−1 Ct l Ct−1 l ′ft Mt l Spatiotemporal Memory ⊗ ′it ′gt Ht l Ht−1 l Xt ⊗ ⊗ ⊗ ⊗ ˆXt+1 ˆXt+2 ˆXt Xt Xt+1 Xt−1 Mt l=3 Mt l=2 Mt l=1 Ht l=3 Ht l=2 Ht l=1 Ht l=1 Ht l=2 Ht l=3 Ct l=1 Ct l=2 Ct l=3 Ct l=4,Ht l=4 W1 W2 W3 W4 W1 W2 W3 W4 W1 W2 W3 W4 Mt−1 l=4 Mt l=4 Figure 2: ST-LSTM (left) and PredRNN (right). The orange circles in the ST-LSTM unit denotes the differences compared with the conventional ConvLSTM. The orange arrows in PredRNN denote the spatiotemporal memory flow, namely the transition path of spatiotemporal memory Ml t in the left. However, dropping the temporal flow in the horizontal direction is prone to sacrificing temporal coherency. In this section, we present the predictive recurrent neural network (PredRNN), by replacing convolutional LSTMs with a novel spatiotemporal long short-term memory (ST-LSTM) unit (see Figure 2). In the architecture presented in the previous subsection, the spatiotemporal memory cells are updated in a zigzag direction, and information is delivered first upwards across layers then forwards over time. This enables efficient flow of spatial information, but is prone to vanishing gradient since the memory needs to flow a longer path between distant states. With the aid of ST-LSTMs, our PredRNN model in Figure 2 enables simultaneous flows of both standard temporal memory and the proposed spatiotemporal memory. The equations of ST-LSTM are shown as follows: gt = tanh(Wxg ∗Xt + Whg ∗Hl t−1 + bg) it = σ(Wxi ∗Xt + Whi ∗Hl t−1 + bi) ft = σ(Wxf ∗Xt + Whf ∗Hl t−1 + bf) Cl t = ft ⊙Cl t−1 + it ⊙gt g′ t = tanh(W′ xg ∗Xt + Wmg ∗Ml−1 t + b′ g) i′ t = σ(W′ xi ∗Xt + Wmi ∗Ml−1 t + b′ i) f ′ t = σ(W′ xf ∗Xt + Wmf ∗Ml−1 t + b′ f) Ml t = f ′ t ⊙Ml−1 t + i′ t ⊙g′ t ot = σ(Wxo ∗Xt + Who ∗Hl t−1 + Wco ∗Cl t + Wmo ∗Ml t + bo) Hl t = ot ⊙tanh(W1×1 ∗[Cl t, Ml t]). (4) Two memory cells are maintained: Cl t is the standard temporal cell that is delivered from the previous node at t −1 to the current time step within each LSTM unit. Ml t is the spatiotemporal memory we described in the current section, which is conveyed vertically from the l −1 layer to the current node at the same time step. For the bottom ST-LSTM layer where l = 1, Ml−1 t = ML t−1, as described in the previous subsection. We construct another set of gate structures for Ml t, while maintaining the original gates for Cl t in standard LSTMs. At last, the final hidden states of this node rely on the fused spatiotemporal memory. We concatenate these memory derived from different directions together and then apply a 1 × 1 convolution layer for dimension reduction, which makes the hidden state Hl t of the same dimensions as the memory cells. Different from simple memory concatenation, the ST-LSTM unit uses a shared output gate for both memory types to enable seamless memory fusion, which can effectively model the shape deformations and motion trajectories in the spatiotemporal sequences. 5 4 Experiments Our model is demonstrated to achieve the state-of-the-art performance on three video prediction datasets including both synthetic and natural video sequences. Our PredRNN model is optimized with a L1 + L2 loss (other losses have been tried, but L1 + L2 loss works best). All models are trained using the ADAM optimizer [11] with a starting learning rate of 10−3. The training process is stopped after 80, 000 iterations. Unless otherwise specified, the batch size of each iteration is set to 8. All experiments are implemented in TensorFlow [1] and conducted on NVIDIA TITAN-X GPUs. 4.1 Moving MNIST dataset Implementation We generate Moving MNIST sequences with the method described in [21]. Each sequence consists of 20 consecutive frames, 10 for the input and 10 for the prediction. Each frame contains two or three handwritten digits bouncing inside a 64 × 64 grid of image. The digits were chosen randomly from the MNIST training set and placed initially at random locations. For each digit, we assign a velocity whose direction is randomly chosen by a uniform distribution on a unit circle, and whose amplitude is chosen randomly in [3, 5). The digits bounce-off the edges of image and occlude each other when reaching the same location. These properties make it hard for a model to give accurate predictions without learning the inner dynamics of the movement. With digits generated quickly on the fly, we are able to have infinite samples size in the training set. The test set is fixed, consisting of 5,000 sequences. We sample digits from the MNIST test set, assuring the trained model has never seen them before. Also, the model trained with two digits is tested on another Moving MNIST dataset with three digits. Such a test setup is able to measure PredRNN’s generalization and transfer ability, because no frames containing three digits are given throughout the training period. As a strong competitor, we include the latest state-of-the-art VPN model [10]. We find it hard to reproduce VPN’s experimental results on Moving MNIST since it is not open source, thus we adopt its baseline version that uses CNNs instead of PixelCNNs as its decoder and generate each frame in one pass. We observe that the total number of hidden states has a strong impact on the final accuracy of PredRNN. After a number of trials, we present a 4-layer architecture with 128 hidden states in each layer, which yields a high prediction accuracy using reasonable training time and memory footprint. Table 1: Results of PredRNN with spatiotemporal memory M, PredRNN with ST-LSTMs, and state-of-the-art models. We report per-frame MSE and Cross-Entropy (CE) of generated sequences averaged across the Moving MNIST test sets. Lower MSE or CE denotes better prediction accuracy. Model MNIST-2 MNIST-2 MNIST-3 (CE/frame) (MSE/frame) (MSE/frame) FC-LSTM [21] 483.2 118.3 162.4 ConvLSTM (128 × 4) [19] 367.0 103.3 142.1 CDNA [6] 346.6 97.4 138.2 DFN [3] 285.2 89.0 130.5 VPN baseline [10] 110.1 70.0 125.2 PredRNN with spatiotemporal memory M 118.5 74.0 118.2 PredRNN + ST-LSTM (128 × 4) 97.0 56.8 93.4 Results As an ablation study, PredRNN only with a zigzag memory flow reduces the per-frame MSE to 74.0 on the Moving MNIST-2 test set (see Table 1). By replacing convolutional LSTMs with ST-LSTMs, we further decline the sequence MSE from 74.0 down to 56.8. The corresponding frame-by-frame quantitative comparisons are presented in Figure 3. Compared with VPN, our model turns out to be more accurate for long-term predictions, especially on Moving MNIST-3. We also use per-frame cross-entropy likelihood as another evaluation metric on Moving MNIST-2. PredRNN with ST-LSTMs significantly outperforms all previous methods, while PredRNN with spatiotemporal memory M performs comparably with VPN baseline. A qualitative comparison of predicted video sequences is given in Figure 4. Though VPN’s generated frames look a bit sharper, its predictions gradually deviate from the correct trajectories, as illustrated in the first example. Moreover, for those sequences that digits are overlapped and entangled, VPN has difficulties in separating these digits clearly while maintaining their individual shapes. For example, 6 in the right figure, digit “8” loses its left-side pixels and is predicted as “3” after overlapping. Other baseline models suffer from a severer blur effect, especially for longer future time steps. By contrast, PredRNN’s results are not only sharp enough but also more accurate for long-term motion predictions. time steps 1 2 3 4 5 6 7 8 9 10 Mean Square Error 0 20 40 60 80 100 120 140 ConvLSTM CDNA DFN VPN baseline PredRNN + ST-LSTM (a) MNIST-2 time steps 1 2 3 4 5 6 7 8 9 10 Mean Square Error 20 40 60 80 100 120 140 160 180 ConvLSTM CDNA DFN VPN baseline PredRNN + ST-LSTM (b) MNIST-3 Figure 3: Frame-wise MSE comparisons of different models on the Moving MNIST test sets. Input frames Ground truth PredRNN ConvLSTM CDNA VPN baseline Figure 4: Prediction examples on the Moving MNIST-2 test set. 4.2 KTH action dataset Implementation The KTH action dataset [18] contains six types of human actions (walking, jogging, running, boxing, hand waving and hand clapping) performed several times by 25 subjects in four different scenarios: outdoors, outdoors with scale variations, outdoors with different clothes and indoors. All video clips were taken over homogeneous backgrounds with a static camera in 25fps frame rate and have a length of four seconds in average. To make the results comparable, we adopt the experiment setup in [25] that video frames are resized into 128 × 128 pixels and all videos are divided with respect to the subjects into a training set (persons 1-16) and a test set (persons 17-25). All models, including PredRNN as well as the baselines, are trained on the training set across all six action categories by generating the subsequent 10 frames from the last 10 observations, while the the presented prediction results in Figure 5 and Figure 6 are obtained on the test set by predicting 20 time steps into the future. We sample sub-clips using a 20-frame-wide sliding window with a stride of 1 on the training set. As for evaluation, we broaden the sliding window to 30-frame-wide and set the stride to 3 for running and jogging, while 20 for the other categories. Sub-clips for running, jogging, and walking are manually trimmed to ensure humans are always present in the frame sequences. In the end, we split the database into a training set of 108,717 sequences and a test set of 4,086 sequences. Results We use the Peak Signal to Noise Ratio (PSNR) and the Structural Similarity Index Measure (SSIM) [26] as metrics to evaluate the prediction results and provide frame-wise quantitative comparisons in Figure 5. A higher value denotes a better prediction performance. The value of SSIM ranges between -1 and 1, and a larger score means a greater similarity between two images. PredRNN consistently outperforms the comparison models. Specifically, the Predictive Coding Network [12] always exploits the whole ground truth sequence before the current time step to predict the next 7 frame. Thus, it cannot make sequence predictions. Here, we make it predict the next 20 frames by feeding the 10 ground truth frames and the recursively generated frames in all previous time steps. The performance of MCnet [25] deteriorates quickly for long-term predictions. Residual connections of MCnet convey the CNN features of the last frame to the decoder and ignore the previous frames, which emphasizes the spatial appearances while weakens temporal variations. By contrast, results of PredRNN in both metrics remain stable over time, only with a slow and reasonable decline. Figure 6 visualizes a sample video sequence from the KTH test set. The ConvLSTM network [19] generates blurred future frames, since it fails to memorize the detailed spatial representations. MCnet [25] produces sharper images but is not able to forecast the movement trajectory accurately. Thanks to ST-LSTMs, PredRNN memorizes detailed visual appearances as well as long-term motions. It outperforms all baseline models and shows superior predicting power both spatially and temporally. time steps 2 4 6 8 10 12 14 16 18 20 Peak Signal Noise Ratio 20 25 30 35 ConvLSTM MCnet + Res. Predictive Coding Network PredRNN + ST-LSTMs (a) Frame-wise PSNR time steps 2 4 6 8 10 12 14 16 18 20 Structural Similarity 0.6 0.7 0.8 0.9 1 ConvLSTM MCnet + Res. Predictive Coding Network PredRNN + ST-LSTMs (b) Frame-wise SSIM Figure 5: Frame-wise PSNR and SSIM comparisons of different models on the KTH action test set. A higher score denotes a better prediction accuracy. t=3 t=6 t=9 t=12 t=15 t=18 t=21 t=24 t=27 PredRNN ConvLSTM MCnet + Res. t=30 Input sequence Ground truth and predictions Predictive Coding Network Figure 6: KTH prediction samples. We predict 20 frames into the future by observing 10 frames. 4.3 Radar echo dataset Predicting the shape and movement of future radar echoes is a real application of predictive learning and is the foundation of precipitation nowcasting. It is a more challenging task because radar echoes are not rigid. Also, their speeds are not as fixed as moving digits, their trajectories are not as periodical as KTH actions, and their shapes may accumulate, dissipate or change rapidly due to the complex atmospheric environment. Modeling spatial deformation is significant for the prediction of this data. 8 Implementation We first collect the radar echo dataset by adapting the data handling method described in [19]. Our dataset consists of 10,000 consecutive radar observations, recorded every 6 minutes in Guangzhou, China. For preprocessing, we first map the radar intensities to pixel values, and represent them as 100 × 100 gray-scale images. Then we slice the consecutive images with a 20-frame-wide sliding window. Thus, each sequence consists of 20 frames, 10 for the input, and 10 for forecasting. The total 9,600 sequences are split into a training set of 7,800 samples and a test set of 1,800 samples. The PredRNN model consists of two ST-LSTM layers with 128 hidden states each. The convolution filters inside ST-LSTMs are set to 3 × 3. After prediction, we transform the resulted echo intensities into colored radar maps, as shown in Figure 7, and then calculate the amount of precipitation at each grid cell of these radar maps using Z-R relationships. Since it would bring in an additional systematic error to rainfall prediction and makes final results misleading, we do not take them into account in this paper, but only compare the predicted echo intensity with the ground truth. Results Two baseline models are considered. The ConvLSTM network [19] is the first architecture that models sequential radar maps with convolutional LSTMs, but its predictions tend to blur and obviously inaccurate (see Figure 7). As a strong competitor, we also include the latest state-of-the-art VPN model [10]. The PixelCNN-based VPN predicts an image pixel by pixel recursively, which takes around 15 minutes to generate a radar map. Given that precipitation nowcasting has a high demand on real-time computing, we trade off both prediction accuracy and computation efficiency and adopt VPN’s baseline model that uses CNNs as its decoders and generates each frame in one pass. Table 2 shows that the prediction error of PredRNN is significantly lower than VPN baseline. Though VPN generates more accurate radar maps for the near future, it suffers from a rapid decay for the long term. Such a phenomenon results from a lack of strong LSTM layers to model spatiotemporal variations. Furthermore, PredRNN takes only 1/5 memory space and training time as VPN baseline. Table 2: Quantitative results of different methods on the radar echo dataset. Model MSE/frame Training time/100 batches Memory usage ConvLSTM [19] 68.0 105 s 1756 MB VPN baseline [10] 60.7 539 s 11513 MB PredRNN 44.2 117 s 2367 MB PredRNN ConvLSTM VPN baseline Input frames Ground truth Figure 7: A prediction example on the radar echo test set. 5 Conclusions In this paper, we propose a novel end-to-end recurrent network named PredRNN for spatiotemporal predictive learning that models spatial deformations and temporal variations simultaneously. Memory states zigzag across stacked LSTM layers vertically and through all time states horizontally. Furthermore, we introduce a new spatiotemporal LSTM (ST-LSTM) unit with a gate-controlled dual memory structure as the key building block of PredRNN. Our model achieves the state-of-the-art performance on three video prediction datasets including both synthetic and natural video sequences. 9 Acknowledgments This work was supported by the National Key R&D Program of China (2016YFB1000701), National Natural Science Foundation of China (61772299, 61325008, 61502265, 61672313) and TNList Fund. References [1] M. Abadi, A. Agarwal, P. Barham, E. Brevdo, Z. Chen, C. Citro, G. S. Corrado, A. Davis, J. Dean, M. Devin, et al. Tensorflow: Large-scale machine learning on heterogeneous distributed systems. arXiv preprint arXiv:1603.04467, 2016. [2] K. Cho, B. Van Merriënboer, D. Bahdanau, and Y. Bengio. On the properties of neural machine translation: Encoder-decoder approaches. arXiv preprint arXiv:1409.1259, 2014. [3] B. De Brabandere, X. Jia, T. Tuytelaars, and L. Van Gool. Dynamic filter networks. In NIPS, 2016. [4] E. L. Denton, S. Chintala, R. Fergus, et al. Deep generative image models using a laplacian pyramid of adversarial networks. In NIPS, pages 1486–1494, 2015. [5] J. Donahue, L. Anne Hendricks, S. Guadarrama, M. Rohrbach, S. Venugopalan, K. Saenko, and T. Darrell. Long-term recurrent convolutional networks for visual recognition and description. In CVPR, pages 2625–2634, 2015. [6] C. Finn, I. Goodfellow, and S. Levine. Unsupervised learning for physical interaction through video prediction. In NIPS, 2016. [7] I. J. Goodfellow, J. Pougetabadie, M. Mirza, B. Xu, D. Wardefarley, S. Ozair, A. Courville, and Y. Bengio. Generative adversarial networks. NIPS, 3:2672–2680, 2014. [8] A. Graves and N. Jaitly. Towards end-to-end speech recognition with recurrent neural networks. In ICML, pages 1764–1772, 2014. [9] S. Hochreiter and J. Schmidhuber. Long short-term memory. Neural computation, 9(8):1735–1780, 1997. [10] N. Kalchbrenner, A. v. d. Oord, K. Simonyan, I. Danihelka, O. Vinyals, A. Graves, and K. Kavukcuoglu. Video pixel networks. In ICML, 2017. [11] D. Kingma and J. Ba. Adam: A method for stochastic optimization. In ICLR, 2015. [12] W. Lotter, G. Kreiman, and D. Cox. Deep predictive coding networks for video prediction and unsupervised learning. In International Conference on Learning Representations (ICLR), 2017. [13] M. Mathieu, C. Couprie, and Y. LeCun. Deep multi-scale video prediction beyond mean square error. In ICLR, 2016. [14] J. Oh, X. Guo, H. Lee, R. L. Lewis, and S. Singh. Action-conditional video prediction using deep networks in atari games. In NIPS, pages 2863–2871, 2015. [15] V. Patraucean, A. Handa, and R. Cipolla. Spatio-temporal video autoencoder with differentiable memory. In ICLR Workshop, 2016. [16] M. Ranzato, A. Szlam, J. Bruna, M. Mathieu, R. Collobert, and S. Chopra. Video (language) modeling: a baseline for generative models of natural videos. arXiv preprint arXiv:1412.6604, 2014. [17] D. E. Rumelhart, G. E. Hinton, and R. J. Williams. Learning representations by back-propagating errors. Cognitive modeling, 5(3):1, 1988. [18] C. Schuldt, I. Laptev, and B. Caputo. Recognizing human actions: a local svm approach. In International Conference on Pattern Recognition, pages 32–36 Vol.3, 2004. [19] X. Shi, Z. Chen, H. Wang, D.-Y. Yeung, W.-K. Wong, and W.-c. Woo. Convolutional lstm network: A machine learning approach for precipitation nowcasting. In NIPS, pages 802–810, 2015. [20] K. Simonyan and A. Zisserman. Two-stream convolutional networks for action recognition in videos. In NIPS, pages 568–576, 2014. [21] N. Srivastava, E. Mansimov, and R. Salakhutdinov. Unsupervised learning of video representations using lstms. In ICML, 2015. [22] I. Sutskever, J. Martens, and G. E. Hinton. Generating text with recurrent neural networks. In ICML, pages 1017–1024, 2011. [23] I. Sutskever, O. Vinyals, and Q. V. Le. Sequence to sequence learning with neural networks. NIPS, 4:3104–3112, 2014. [24] A. van den Oord, N. Kalchbrenner, L. Espeholt, O. Vinyals, A. Graves, et al. Conditional image generation with pixelcnn decoders. In NIPS, pages 4790–4798, 2016. [25] R. Villegas, J. Yang, S. Hong, X. Lin, and H. Lee. Decomposing motion and content for natural video sequence prediction. In International Conference on Learning Representations (ICLR), 2017. [26] Z. Wang, A. C. Bovik, H. R. Sheikh, and E. P. Simoncelli. Image quality assessment: from error visibility to structural similarity. TIP, 13(4):600, 2004. [27] P. J. Werbos. Backpropagation through time: what it does and how to do it. Proceedings of the IEEE, 78(10):1550–1560, 1990. [28] J. Yue-Hei Ng, M. Hausknecht, S. Vijayanarasimhan, O. Vinyals, R. Monga, and G. Toderici. Beyond short snippets: Deep networks for video classification. In CVPR, pages 4694–4702, 2015. 10
2017
597
7,115
Dual Discriminator Generative Adversarial Nets Tu Dinh Nguyen, Trung Le, Hung Vu, Dinh Phung Deakin University, Geelong, Australia Centre for Pattern Recognition and Data Analytics {tu.nguyen, trung.l, hungv, dinh.phung}@deakin.edu.au Abstract We propose in this paper a novel approach to tackle the problem of mode collapse encountered in generative adversarial network (GAN). Our idea is intuitive but proven to be very effective, especially in addressing some key limitations of GAN. In essence, it combines the Kullback-Leibler (KL) and reverse KL divergences into a unified objective function, thus it exploits the complementary statistical properties from these divergences to effectively diversify the estimated density in capturing multi-modes. We term our method dual discriminator generative adversarial nets (D2GAN) which, unlike GAN, has two discriminators; and together with a generator, it also has the analogy of a minimax game, wherein a discriminator rewards high scores for samples from data distribution whilst another discriminator, conversely, favoring data from the generator, and the generator produces data to fool both two discriminators. We develop theoretical analysis to show that, given the maximal discriminators, optimizing the generator of D2GAN reduces to minimizing both KL and reverse KL divergences between data distribution and the distribution induced from the data generated by the generator, hence effectively avoiding the mode collapsing problem. We conduct extensive experiments on synthetic and real-world large-scale datasets (MNIST, CIFAR-10, STL-10, ImageNet), where we have made our best effort to compare our D2GAN with the latest state-of-the-art GAN’s variants in comprehensive qualitative and quantitative evaluations. The experimental results demonstrate the competitive and superior performance of our approach in generating good quality and diverse samples over baselines, and the capability of our method to scale up to ImageNet database. 1 Introduction Generative models are a subarea of research that has been rapidly growing in recent years, and successfully applied in a wide range of modern real-world applications (e.g., see chapter 20 in [9]). Their common approach is to address the density estimation problem where one aims to learn a model distribution pmodel that approximates the true, but unknown, data distribution pdata. Methods in this approach deal with two fundamental problems. First, the learning behaviors and performance of generative models depend on the choice of objective functions to train them [29, 15]. The most widely-used objective, considered the de-facto standard one, is to follow the principle of maximum likelihood estimate that seeks model parameters to maximize the likelihood of training data. This is equivalent to minimizing the Kullback-Leibler (KL) divergence between data and model distributions: DKL (pdata∥pmodel ). It has been observed that this minimization tends to result in pmodel that covers multiple modes of pdata, but may produce completely unseen and potentially undesirable samples [29]. By contrast, another approach is to swap the arguments and instead, minimize: DKL (pmodel ∥pdata), which is usually referred to as the reverse KL divergence [23, 11, 15, 29]. It is observed that optimization towards the reverse KL divergence criteria mimics the mode-seeking process where pmodel concentrates on a single mode of pdata while ignoring other modes, known as the problem of mode collapse. These behaviors are well-studied in [29, 15, 11]. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. The second problem is the choice of formulation for the density function of pmodel [9]. One might choose to define an explicit density function, and then straightforwardly follow maximum likelihood framework to estimate the parameters. Another idea is to estimate the data distribution using an implicit density function, without the need for analytical forms of pmodel (e.g., see [11] for further discussions). One of the most notably pioneered class of the latter is the generative adversarial network (GAN) [10], an expressive generative model that is capable of producing sharp and realistic images for natural scenes. Different from most generative models that maximize data likelihood or its lower bound, GAN takes a radical approach that simulates a game between two players: a generator G that generates data by mapping samples from a noise space to the input space; and a discriminator D that acts as a classifier to distinguish real samples of a dataset from fake samples produced by the generator G. Both G and D are parameterized via neural networks, thus this method can be categorized into the family of deep generative models or generative neural models [9]. The optimization of GAN formulates a minimax problem, wherein given an optimal D, the learning objective turns into finding G that minimizes the Jensen-Shannon divergence (JSD): DJS (pdata∥pmodel). The behavior of JSD minimization has been empirically proven to be more similar to reverse KL than to KL divergence [29, 15]. This, however, leads to the aforementioned issue of mode collapse, which is indeed a notorious failure of GAN [11] where the generator only produces similarly looking images, yielding a low entropy distribution with poor variety of samples. Recent attempts have been made to solve the mode collapsing problem by improving the training of GAN. One idea is to use the minibatch discrimination trick [27] to allow the discriminator to detect samples that are unusually similar to other generated samples. Although this heuristics helps to generate visually appealing samples very quickly, it is computationally expensive, thus normally used in the last hidden layer of discriminator. Another approach is to unroll the optimization of discriminator by several steps to create a surrogate objective for the update of generator during training [20]. The third approach is to train many generators that discover different modes of the data [14]. Alternatively, around the same time, there are various attempts to employ autoencoders as regularizers or auxiliary losses to penalize missing modes [5, 31, 4, 30]. These models can avoid the mode collapsing problem to a certain extent, but at the cost of computational complexity with the exception of DFM in [31], rendering them unscalable up to ImageNet, a large-scale and challenging visual dataset. Addressing these challenges, we propose a novel approach to both effectively avoid mode collapse and efficiently scale up to very large datasets (e.g., ImageNet). Our approach combines the KL and reverse KL divergences into a unified objective function, thus it exploits the complementary statistical properties from these divergences to effectively diversify the estimated density in capturing multi-modes. We materialize our idea using GAN’s framework, resulting in a novel generative adversarial architecture containing three players: a discriminator D1 that rewards high scores for data sampled from pdata rather than generated from the generator distribution pG whilst another discriminator D2, conversely, favoring data from pG rather pdata, and a generator G that generates data to fool both two discriminators. We term our proposed model dual discriminator generative adversarial network (D2GAN). It turns out that training D2GAN shares the same minimax problem as in GAN, which can be solved by alternatively updating the generator and discriminators. We provide theoretical analysis showing that, given G, D1 and D2 with enough capacity, i.e., in the nonparametric limit, at the optimal points, the training criterion indeed results in the minimal distance between data and model distribution with respect to both their KL and reverse KL divergences. This helps the model place fair distribution of probability mass across the modes of the data generating distribution, thus allowing one to recover the data distribution and generate diverse samples using the generator in a single shot. In addition, we further introduce hyperparameters to stabilize the learning and control the effect of each divergence. We conduct extensive experiments on one synthetic dataset and four real-world large-scale datasets (MNIST, CIFAR10, STL-10, ImageNet) of very different nature. Since evaluating generative models is notoriously hard [29], we have made our best effort to adopt a number of evaluation metrics from literature to quantitatively compare our proposed model with the latest state-of-the-art baselines whenever possible. The experimental results reveal that our method is capable of improving the diversity while keeping good quality of generated samples. More importantly, our proposed model can be scaled up to train on the large-scale ImageNet database, obtain a competitive variety score and generate reasonably good quality images. 2 In short, our main contributions are: (i) a novel generative adversarial model that encourages the diversity of samples produced by the generator; (ii) a theoretical analysis to prove that our objective is optimized towards minimizing both KL and reverse KL divergence and has a global optimum where pG = pdata; and (iii) a comprehensive evaluation on the effectiveness of our proposed method using a wide range of quantitative criteria on large-scale datasets. 2 Generative Adversarial Nets We first review the generative adversarial network (GAN) that was introduced in [10] to formulate a game of two players: a discriminator D and a generator G. The discriminator, D (x), takes a point x in data space and computes the probability that x is sampled from data distribution Pdata, rather than generated by the generator G. At the same time, the generator first maps a noise vector z drawn from a prior P (z) to the data space, obtaining a sample G (z) that resembles the training data, and then uses this sample to challenge the discriminator. The mapping G (z) induces a generator distribution PG in data domain with probability density function pG (x). Both G and D are parameterized by neural networks (see Fig. 1a for an illustration) and learned by solving the following minimax optimization: min G max D J (G, D) = Ex∼Pdata(x) [log (D (x))] + Ez∼Pz [log (1 −D (G (z)))] The learning follows an iterative procedure wherein the discriminator and generator are alternatively updated. Given a fixed G, the maximization subject to D results in the optimal discriminator D⋆(x) = pdata(x) pdata(x)+pG(x) , whilst given this optimal D⋆, the minimization of G turns into minimizing the Jensen-Shannon (JS) divergence between the data and model distributions: DJS (Pdata∥PG) [10]. At the Nash equilibrium of a game, the model distribution recovers the data distribution exactly: PG = Pdata, thus the discriminator D now fails to differentiate real or fake data as D (x) = 0.5, ∀x. (a) GAN. (b) D2GAN. Figure 1: An illustration of the standard GAN and our proposed D2GAN. Since the JS divergence has been empirically proven to have the same nature as that of the reverse KL divergence [29, 15, 11], GAN suffers from the model collapsing problem, and thus its generated data samples have low level of diversity [20, 5]. 3 Dual Discriminator Generative Adversarial Nets To tackle GAN’s problem of mode collapse, in what follows we present our main contribution of a framework that seeks an approximated distribution to effectively cover many modes of the multimodal data. Our intuition is based on GAN, but we formulate a three-player game that consists of two different discriminators D1 and D2, and one generator G. Given a sample x in data space, D1 (x) rewards a high score if x is drawn from the data distribution Pdata, and gives a low score if generated from the model distribution PG. In contrast, D2 (x) returns a high score for x generated from PG whilst giving a low score for a sample drawn from Pdata. Unlike GAN, the scores returned by our discriminators are values in R+ rather than probabilities in [0, 1]. Our generator G performs a similar role to that of GAN, i.e., producing data mapped from a noise space to synthesize the real data and then fool both two discriminators D1 and D2. All three players are parameterized by neural networks wherein D1 and D2 do not share their parameters. We term our proposed model dual discriminator generative adversarial network (D2GAN). Fig. 1b shows an illustration of D2GAN. 3 More formally, D1, D2 and G now play the following three-player minimax optimization game: min G max D1,D2 J (G, D1, D2) = α × Ex∼Pdata [log D1 (x)] + Ez∼Pz [−D1 (G (z))] + Ex∼Pdata [−D2 (x)] + β × Ez∼Pz [log D2 (G (z))] (1) wherein we have introduced hyperparameters 0 < α, β ≤1 to serve two purposes. The first is to stabilize the learning of our model. As the output values of two discriminators are positive and unbounded, D1 (G (z)) and D2 (x) in Eq. (1) can become very large and have exponentially stronger impact on the optimization than log D1 (x) and log D2 (G (z)) do, rendering the learning unstable. To overcome this issue, we can decrease α and β, in effect making the optimization penalize D1 (G (z)) and D2 (x), thus helping to stabilize the learning. The second purpose of introducing α and β is to control the effect of KL and reverse KL divergences on the optimization problem. This will be discussed in the following part once we have the derivation of our optimal solution. Similar to GAN [10], our proposed network can be trained by alternatively updating D1, D2 and G. We refer to the supplementary material for the pseudo-code of learning parameters for D2GAN. 3.1 Theoretical analysis We now provide formal theoretical analysis of our proposed model, that essentially shows that, given G, D1 and D2 are of enough capacity, i.e., in the nonparametric limit, at the optimal points, G can recover the data distributions by minimizing both KL and reverse KL divergences between model and data distributions. We first consider the optimization problem with respect to (w.r.t) discriminators given a fixed generator. Proposition 1. Given a fixed G, maximizing J (G, D1, D2) yields to the following closed-form optimal discriminators D⋆ 1, D⋆ 2: D⋆ 1 (x) = αpdata (x) pG (x) and D⋆ 2 (x) = βpG (x) pdata (x) Proof. According to the induced measure theorem [12], two expectations are equal: Ez∼Pz [f (G (z))] = Ex∼PG [f (x)] where f (x) = −D1 (x) or f (x) = log D2 (x). The objective function can be rewritten as below: J (G, D1, D2) = α × Ex∼Pdata [log D1 (x)] + Ex∼PG [−D1 (x)] + Ex∼Pdata [−D2 (x)] + β × Ex∼PG [log D2 (x)] = ˆ x [αpdata (x) log D1 (x) −pGD1 (x) −pdata (x) D2 (x) + βpG log D2 (x)] dx Considering the function inside the integral, given x, we maximize this function w.r.t two variables D1, D2 to find D⋆ 1 (x) and D⋆ 2 (x). Setting the derivatives w.r.t D1 and D2 to 0, we gain: αpdata (x) D1 −pG (x) = 0 and βpG (x) D2 −pdata (x) = 0 (2) The second derivatives: −αpdata(x)/D2 1 and −βpG(x)/D2 2 are non-positive, thus verifying that we have obtained the maximum solution and concluding the proof. Next, we fix D1 = D⋆ 1, D2 = D⋆ 2 and find the optimal solution G⋆for the generator G. Theorem 2. Given D⋆ 1, D⋆ 2, at the Nash equilibrium point (G⋆, D⋆ 1, D⋆ 2) for minimax optimization problem of D2GAN, we have the following form for each component: J (G⋆, D⋆ 1, D⋆ 2) = α (log α −1) + β (log β −1) D⋆ 1 (x) = α and D⋆ 2 (x) = β, ∀x at pG⋆= pdata Proof. Substituting D⋆ 1, D⋆ 2 from Eq. (2) into the objective function in Eq. (1) of the minimax problem, we gain: J (G, D⋆ 1, D⋆ 2) = α × Ex∼Pdata  log α + log pdata (x) pG (x)  −α ˆ x pG (x) pdata (x) pG (x) dx −β ˆ x pdata pG (x) pdata (x)dx + β × Ex∼PG  log β + log pG (x) pdata (x)  = α (log α −1) + β (log β −1) + αDKL (Pdata∥PG) + βDKL (PG∥Pdata) (3) 4 where DKL (Pdata∥PG) and DKL (PG∥Pdata) is the KL and reverse KL divergences between data and model (generator) distributions, respectively. These divergences are always nonnegative and only zero when two distributions are equal: pG⋆= pdata. In other words, the generator induces a distribution pG⋆that is identical to the data distribution pdata, and two discriminators now fail to recognize the real or fake samples since they return the same score of 1 for both samples. This concludes the proof. The loss of generator in Eq. (3) becomes an upper bound when the discriminators are not optimal. This loss shows that increasing α promotes the optimization towards minimizing the KL divergence DKL (Pdata∥PG), thus helping the generative distribution cover multiple modes, but may include potentially undesirable samples; whereas increasing β encourages the minimization of the reverse KL divergence DKL (PG∥Pdata), hence enabling the generator capture a single mode better, but may miss many modes. By empirically adjusting these two hyperparameters, we can balance the effect of two divergences, and hence effectively avoid the mode collapsing issue. 3.2 Connection to f-GAN Next we point out the relations between our proposed D2GAN and f-GAN – the model extends the Jensen-Shannon divergence (JSD) of GAN to more general divergences, specifically f-divergences [23]. A divergence in the f-divergence family has the following form: Df (P∥Q) = ˆ X q (x) f q (x) p (x)  dx where f : R+ →R is a convex, lower-semicontinuous function satisfying f (1) = 0. This function has a convex conjugate function f ∗, also known as Fenchel conjugate [13] : f ∗(t) = supu∈domf {ut −f (u)}. The function f ∗is again convex and lower-semicontinuous. Considering P the true distribution and Q the generator distribution, we resemble the learning problem in GAN by minimizing the f-divergence between P and Q. Based on the variational lower bound of f-divergence proposed by Nguyen et al. [22], the objective function of f-GAN can be derived as follows: min θ max φ F (θ, φ) = Ex∼P [gf (Vφ (x))] + Ex∼Qθ [−f ∗(gf (Vφ (x)))] where Q is parameterized by θ (as the generator in GAN), Vφ : X →R is a function parameterized by φ (as the discriminator in GAN) and gf : R →domf ∗is an output activation function (i.e., the discriminator’s decision function) specific to the f-divergence used. Using appropriate functions gf and f ∗(see Tab. 2 in [23]), we recover the minimization of corresponding divergences such as JSD in GAN, KL (associated with discriminator D1) and reverse KL (associated with discriminator D2) of our D2GAN. The f-GAN, however, only considers a single divergence. On the other hand, our proposed method combines KL and reserve KL divergences. Our idea is conceived upon pondering the advantages and disadvantages of these two divergences in covering multiple modes of data. Combining them into a unified objective function as in Eq. (3) helps us reversely engineer to finally obtain the optimization game in Eq. (1) that can be efficiently formulated and solved using the principle of GAN. 4 Experiments In this section, we conduct comprehensive experiments to demonstrate the capability of improving mode coverage and the scalability of our proposed model on large-scale datasets. We use a synthetic 2D dataset for both visual and numerical verification, and four datasets of increasing diversity and size for numerical verification. We have made our best effort to compare the results of our method with those of the latest state-of-the-art GAN’s variants by replicating experimental settings in the original work whenever possible. For each experiment, we refer to the supplementary material for model architectures and additional results. Common points are: i) discriminators’ outputs with softplus activations :f (x) = ln (1 + ex), i.e., positive version of ReLU; (ii) Adam optimizer [16] with learning rate 0.0002 and the first-order momentum 0.5; (iii) minibatch size of 64 samples for training both generator and discriminators; (iv) Leaky ReLU with the slope of 0.2; and (v) weights initialized from an isotropic Gaussian: N (0, 0.01) 5 GAN Unrolled GAN D2GAN Symmetric KL-div Step 0 5000 10000 15000 20000 25000 0.0 5.0 10.0 15.0 20.0 25.0 30.0 (a) Symmetric KL divergence. GAN Unrolled GAN D2GAN Wasserstein estimate 0.0 0.5 1.0 1.5 2.0 2.5 0 5000 10000 15000 20000 25000 Step 3.0 (b) Wasserstein distance. (c) Evolution of data (in blue) generated from GAN (top row), UnrolledGAN (middle row) and our D2GAN (bottom row) on 2D data of 8 Gaussians. Data sampled from the true mixture are red. Figure 2: The comparison of standard GAN, UnrolledGAN and our D2GAN on 2D synthetic dataset. and zero biases. Our implementation is in TensorFlow [1] and we have published a version for reference1. We now present our experiments on synthetic data followed by those on large-scale real-world datasets. 4.1 Synthetic data In the first experiment, we reuse the experimental design proposed in [20] to investigate how well our D2GAN can deal with multiple modes in the data. More specifically, we sample training data from a 2D mixture of 8 Gaussian distributions with a covariance matrix 0.02I and means arranged in a circle of zero centroid and radius 2.0. Data in these low variance mixture components are separated by an area of very low density. The aim is to examine properties such as low probability regions and low separation of modes. We use a simple architecture of a generator with two fully connected hidden layers and discriminators with one hidden layer of ReLU activations. This setting is identical, thus ensures a fair comparison with UnrolledGAN2 [20]. Fig. 2c shows the evolution of 512 samples generated by our models and baselines through time. It can be seen that the regular GAN generates data collapsing into a single mode hovering around the valid modes of data distribution, thus reflecting the mode collapse in GAN. At the same time, UnrolledGAN and D2GAN distribute data around all 8 mixture components, and hence demonstrating the abilities to successfully learn multimodal data in this case. At the last steps, our D2GAN captures data modes more precisely than UnrolledGAN as, in each mode, the UnrolledGAN generates data that concentrate only on several points around the mode’s centroid, thus seems to produce fewer samples than D2GAN whose samples fairly spread out the entire mode. Next we further quantitatively compare the quality of generated data. Since we know the true distribution pdata in this case, we employ two measures, namely symmetric KL divergence and Wasserstein distance. These measures compute the distance between the normalized histograms of 10,000 points generated from our D2GAN, UnrolledGAN and GAN to true pdata. Figs. 2a and 2b again clearly demonstrate the superiority of our approach over GAN and UnrolledGAN w.r.t both distances (lower is better); notably with Wasserstein metric, the distance from ours to the true distribution almost reduces to zero. These figures also demonstrate the stability of our D2GAN (red curves) during training as it is much less fluctuating compared with GAN (green curves) and UnrolledGAN (blue curves). 4.2 Real-world datasets We now examine the performance of our proposed method on real-world datasets with increasing diversities and sizes. For networks containing convolutional layers, we closely follow the DCGAN’s design [24]. We use strided convolutions for discriminators and fractional-strided convolutions for generator instead of pooling layers. Batch normalization is applied for each layer, except the 1https://github.com/tund/D2GAN 2We obtain the code of UnrolledGAN for 2D data from the link authors provided in [20]. 6 generator output layer and the discriminator input layers. We also use Leaky ReLU activations for discriminators, and use ReLU for generator, except its output is tanh since we rescale the pixel intensities into the range of [-1, 1] before feeding images to our model. Only one difference is that, for our model, initializing the weights from N (0, 0.01) yields slightly better results than from N (0, 0.02). We again refer to the supplementary material for detailed architectures. 4.2.1 Evaluation protocol Evaluating the quality of image produced by generative models is a notoriously challenging due to the variety of probability criteria and the lack of a perceptually meaningful image similarity metric [29]. Even when a model can generate plausible images, it is not useful if those images are visually similar. Therefore, in order to quantify the performance of covering data modes as well as producing high quality samples, we use several different ad-hoc metrics for different experiments to compare with other baselines. First we adopt the Inception score proposed in [27], which are computed by: exp (Ex [DKL (p (y | x) ∥p (y))]), where p (y | x) is the conditional label distribution for image x estimated using a pretrained Inception model [28], and p (y) is the marginal distribution: p (y) ≈ 1/N PN n=1 p (y | xn = G (zn)). This metric rewards good and varied samples, but sometimes is easily fooled by a model that collapses and generates to a very low quality image, thus fails to measure whether a model has been trapped into one bad mode. To address this problem, for labeled datasets, we further recruit the so-called MODE score introduced in [5]: exp (Ex [DKL (p (y | x) ∥˜p (y))] −DKL (p (y) ∥˜p (y))) where ˜p (y) is the empirical distribution of labels estimated from training data. The score can adequately reflect the variety and visual quality of images, which is discussed in [5]. 4.2.2 Handwritten digit images We start with the handwritten digit images – MNIST [19] that consists of 60,000 training and 10,000 testing 28×28 grayscale images of digits from 0 to 9. Following the setting in [5], we first assume that the MNIST has 10 modes, representing connected component in the data manifold, associated with 10 digit classes. We then also perform an extensive grid search of different hyperparameter configurations, wherein our two regularized constants α, β in Eq. (1) are varied in {0.01, 0.05, 0.1, 0.2}. For a fair comparison, we use the same parameter ranges and fully connected layers for our network (c.f. the supplementary material for more details), and adopt results of GAN and mode regularized GAN (Reg-GAN) from [5]. For evaluation, we first train a simple, yet effective 3-layer convolutional nets3 that can obtain 0.65% error on MNIST testing set, and then employ it to predict the label probabilities and compute MODE scores for generated samples. Fig. 3 (left) shows the distributions of MODE scores obtained by three models. Clearly, our proposed D2GAN significantly outperforms the standard GAN and Reg-GAN by achieving scores mostly around the maximum [8.0-9.0]. It is worthy to note that we did not observe substantial differences in the average MODE scores obtained by varying the network size through the parameter searching. We here report the result of the minimal network with the smallest number of layers and hidden units. To study the effect of α and β, we inspect the results obtained by this minimal network with varied α, β in Fig. 3 (right). There is a pattern that, given a fixed α, our D2GAN obtains better MODE score when increasing β to a certain value, after which the score could significantly decrease. MNIST-1K. The standard MNIST data with 10-mode assumption seems to be fairly trivial. Hence, based on this data, we test our proposed model on a more challenging one. We continue following the technique used in [5, 20] to construct a new 1000-class MNIST dataset (MNIST-1K) by stacking three randomly selected digits to form an RGB image with a different digit image in each channel. The resulting data can be assumed to contain 1,000 distinct modes, corresponding to the combinations of digits in 3 channels from 000 to 999. In this experiment, we use a more powerful model with convolutional layers for discriminators and transposed convolutions for the generator. We measure the performance by the number of modes 3Network architecture is similar to https://github.com/fchollet/keras/blob/master/examples/mnist_cnn.py. 7                                                                          Figure 3: Distributions of MODE scores (left) and average MODE scores (right) with varied α, β. for which the model generated at least one in total 25,600 samples, and the reverse KL divergence between the model distribution (i.e., the label distribution predicted by the pretrained MNIST classifier used in the previous experiment) and the expected data distribution. Tab. 1 reports the results of our D2GAN compared with those of GAN, UnrolledGAN taken from [20], DCGAN and Reg-GAN from [5]. Our proposed method again clearly demonstrates the superiority over baselines by covering all modes and achieving the best distance that is close to zero. Table 1: Numbers of modes covered and reverse KL divergence between model and data distributions. Model GAN [20] UnrolledGAN [20] DCGAN [5] Reg-GAN [5] D2GAN # modes covered 628.0±140.9 817.4±37.9 849.6±62.7 955.5±18.7 1000.0±0.00 DKL (model∥data) 2.58±0.75 1.43±0.12 0.73±0.09 0.64±0.05 0.08±0.01 4.2.3 Natural scene images We now extend our experiments to investigate the scalability of our proposed method on much more challenging large-scale image databases from natural scenes. We use three widely-adopted datasets: CIFAR-10 [17], STL-10 [6] and ImageNet [26]. CIFAR-10 is a well-studied dataset of 50,000 32×32 training images of 10 classes: airplane, automobile, bird, cat, deer, dog, frog, horse, ship, and truck. STL-10, a subset of ImageNet, contains about 100,000 unlabeled 96×96 images, which is more diverse than CIFAR-10, but less so than the full ImageNet. We rescale all images down 3 times and train our networks on 32×32 resolution. ImageNet is a very large database of about 1.2 million natural images from 1,000 classes, normally used as the most challenging benchmark to validate the scalability of deep models. We follow the preprocessing in [18], except subsampling to 32×32 resolution. We use the code provided in [27] to compute the Inception score for 10 independent partitions of 50,000 generated samples. Table 2: Inception scores on CIFAR-10. Model Score Real data 11.24±0.16 WGAN [2] 3.82±0.06 MIX+WGAN [3] 4.04±0.07 Improved-GAN [27] 4.36±0.04 ALI [8] 5.34±0.05 BEGAN [4] 5.62 MAGAN [30] 5.67 DCGAN [24] 6.40±0.05 DFM [31] 7.72±0.13 D2GAN 7.15±0.07                           Figure 4: Inception scores on STL-10 and ImageNet. Tab. 2 and Fig. 4 show the Inception scores on CIFAR-10, STL-10 and ImageNet datasets obtained by our model and baselines collected from recent work in literature. It is worthy to note that we only compare with methods trained in a completely unsupervised manner without label information. As the result, there exist 8 baselines on CIFAR-10 whilst only DCGAN [24] and denoising feature matching (DFM) [31] are available on STL-10 and ImageNet. We use our own TensorFlow implementation of DCGAN with the same network architecture with our model for fair comparisons. In all 3 experiments, the D2GAN fails to beat the DFM, but outperforms other baselines by large margins. The lower results compared with DFM suggest that using autoencoders for matching high-level features appears 8 to be an effective way to encourage the diversity. This technique is compatible with our method, thus integrating it could be a promising avenue for our future work. Two discriminators D1 and D2 have almost identical architectures, thus they potentially can share parameters in many different schemes. We explore this direction by creating two version of our D2GAN with the same hyperparameter setting. The first version shares all parameters of D1 and D2 except the last (output) layer. This model has failed because the discriminator now contains much fewer parameters, rendering it unable to capture two inverse ratios of two density functions. The second one shares all parameters of D1 and D2 except the last two layers. This version performed better than the previous one, and could obtain promising Inception scores (7.01 on CIFAR10, 7.44 on STL10 and 7.81 on ImageNet), but these results are still worse than those of our proposed model without sharing parameters. Finally, we show several samples generated by our proposed model trained on these three datasets in Fig. 5. Samples are fair random draws, not cherry-picked. It can be seen that our D2GAN is able to produce visually recognizable images of cars, trucks, boats, horses on CIFAR-10. The objects are getting harder to recognize, but the shapes of airplanes, cars, trucks and animals still can be identified on STL-10, and images with various backgrounds such as sky, underwater, mountain, forest are shown on ImageNet. This confirms the diversity of samples generated by our model. (a) CIFAR-10. (b) STL-10. (c) ImageNet. Figure 5: Samples generated by our proposed D2GAN trained on natural image datasets. Due to the space limit, please refer to the supplementary material for larger plot. 5 Conclusion To summarize, we have introduced a novel approach to combine Kullback-Leibler (KL) and reverse KL divergences in a unified objective function of the density estimation problem. Our idea is to exploit the complementary statistical properties of two divergences to improve both the quality and diversity of samples generated from the estimator. To that end, we propose a novel framework based on generative adversarial nets (GANs), which formulates a minimax game of three players: two discriminators and one generator, thus termed dual discriminator GAN (D2GAN). Given two discriminators fixed, the learning of generator moves towards optimizing both KL and reverse KL divergences simultaneously, and thus can help avoid mode collapse, a notorious drawback of GANs. We have established extensive experiments to demonstrate the effectiveness and scalability of our proposed approach using synthetic and large-scale real-world datasets. Compared with the latest state-of-the-art baselines, our model is more scalable, can be trained on the large-scale ImageNet dataset, and obtains Inception scores lower than those of the combination of denoising autoencoder and GAN (DFM), but significantly higher than the others. Finally, we note that our method is orthogonal and could integrate techniques in those baselines such as semi-supervised learning [27], conditional architectures [21, 7, 25] and autoencoder [5, 31]. Acknowledgments. This work was partially supported by the Australian Research Council (ARC) Discovery Grant Project DP160109394. 9 References [1] Martín Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dan Mané, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viégas, Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. TensorFlow: Large-scale machine learning on heterogeneous systems, 2015. Software available from tensorflow.org. 4 [2] Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein gan. arXiv preprint arXiv:1701.07875, 2017. 2 [3] Sanjeev Arora, Rong Ge, Yingyu Liang, Tengyu Ma, and Yi Zhang. Generalization and equilibrium in generative adversarial nets (gans). arXiv preprint arXiv:1703.00573, 2017. 2 [4] David Berthelot, Tom Schumm, and Luke Metz. Began: Boundary equilibrium generative adversarial networks. arXiv preprint arXiv:1703.10717, 2017. 1, 2 [5] Tong Che, Yanran Li, Athul Paul Jacob, Yoshua Bengio, and Wenjie Li. Mode regularized generative adversarial networks. arXiv preprint arXiv:1612.02136, 2016. 1, 2, 4.2.1, 4.2.2, 4.2.2, 1, 5 [6] Adam Coates, Andrew Y Ng, and Honglak Lee. An analysis of single-layer networks in unsupervised feature learning. In International Conference on Artificial Intelligence and Statistics (AISTATS), pages 215–223, 2011. 4.2.3 [7] Emily L Denton, Soumith Chintala, Rob Fergus, et al. Deep generative image models using a laplacian pyramid of adversarial networks. In Advances in neural information processing systems (NIPS), pages 1486–1494, 2015. 5 [8] Vincent Dumoulin, Ishmael Belghazi, Ben Poole, Alex Lamb, Martin Arjovsky, Olivier Mastropietro, and Aaron Courville. Adversarially learned inference. arXiv preprint arXiv:1606.00704, 2016. 2 [9] Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep Learning. MIT Press, 2016. http://www.deeplearningbook.org. 1 [10] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Z. Ghahramani, M. Welling, C. Cortes, N. D. Lawrence, and K. Q. Weinberger, editors, Advances in 27th Neural Information Processing Systems (NIPS), pages 2672–2680. Curran Associates, Inc., 2014. 1, 2, 3 [11] Ian J. Goodfellow. NIPS 2016 tutorial: Generative adversarial networks. CoRR, 2017. 1, 2 [12] Somesh Das Gupta and Jun Shao. Mathematical statistics, 2000. 3.1 [13] Jean-Baptiste Hiriart-Urruty and Claude Lemaréchal. Fundamentals of convex analysis. Springer Science & Business Media, 2012. 3.2 [14] Quan Hoang, Tu Dinh Nguyen, Trung Le, and Dinh Phung. Multi-generator gernerative adversarial nets. arXiv preprint arXiv:1708.02556, 2017. 1 [15] Ferenc Huszár. How (not) to train your generative model: Scheduled sampling, likelihood, adversary? arXiv preprint arXiv:1511.05101, 2015. 1, 2 [16] Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. 4 [17] Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Computer Science Department, University of Toronto, Tech. Rep, 1(4), 2009. 4.2.3 10 [18] Alex Krizhevsky, Ilya Sutskever, and Geoff Hinton. ImageNet classification with deep convolutional neural networks. In Proceedings of the 26th Annual Conference on Neural Information Processing Systems (NIPS), volume 2, pages 1097–1105, Lake Tahoe, United States, December 3–6 2012. printed;. 4.2.3 [19] Yann Lecun, Corinna Cortes, and Christopher J.C. Burges. The MNIST database of handwritten digits. 1998. 4.2.2 [20] Luke Metz, Ben Poole, David Pfau, and Jascha Sohl-Dickstein. Unrolled generative adversarial networks. arXiv preprint arXiv:1611.02163, 2016. 1, 2, 4.1, 2, 4.2.2, 1 [21] Mehdi Mirza and Simon Osindero. Conditional generative adversarial nets. arXiv preprint arXiv:1411.1784, 2014. 5 [22] XuanLong Nguyen, Martin J Wainwright, and Michael I Jordan. Estimating divergence functionals and the likelihood ratio by convex risk minimization. IEEE Transactions on Information Theory, 56(11):5847–5861, 2010. 3.2 [23] Sebastian Nowozin, Botond Cseke, and Ryota Tomioka. f-gan: Training generative neural samplers using variational divergence minimization. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett, editors, Advances in Neural Information Processing Systems 29, pages 271–279. Curran Associates, Inc., 2016. 1, 3.2 [24] Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015. 4.2, 2, 4.2.3 [25] Scott Reed, Zeynep Akata, Xinchen Yan, Lajanugen Logeswaran, Bernt Schiele, and Honglak Lee. Generative adversarial text to image synthesis. In Proceedings of The 33rd International Conference on Machine Learning (ICML), volume 3, 2016. 5 [26] Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, Alexander C. Berg, and Li Fei-Fei. ImageNet Large Scale Visual Recognition Challenge. International Journal of Computer Vision (IJCV), 115(3):211–252, 2015. 4.2.3 [27] Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training gans. In Advances in Neural Information Processing Systems (NIPS), pages 2226–2234, 2016. 1, 4.2.1, 4.2.3, 2, 5 [28] Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 2818–2826, 2016. 4.2.1 [29] Lucas Theis, Aäron van den Oord, and Matthias Bethge. A note on the evaluation of generative models. arXiv preprint arXiv:1511.01844, 2015. 1, 2, 4.2.1 [30] Ruohan Wang, Antoine Cully, Hyung Jin Chang, and Yiannis Demiris. Magan: Margin adaptation for generative adversarial networks. arXiv preprint arXiv:1704.03817, 2017. 1, 2 [31] D Warde-Farley and Y Bengio. Improving generative adversarial networks with denoising feature matching. ICLR submissions, 8, 2017. 1, 2, 4.2.3, 5 11
2017
598
7,116
Beyond Parity: Fairness Objectives for Collaborative Filtering Sirui Yao Department of Computer Science Virginia Tech Blacksburg, VA 24061 ysirui@vt.edu Bert Huang Department of Computer Science Virginia Tech Blacksburg, VA 24061 bhuang@vt.edu Abstract We study fairness in collaborative-filtering recommender systems, which are sensitive to discrimination that exists in historical data. Biased data can lead collaborative-filtering methods to make unfair predictions for users from minority groups. We identify the insufficiency of existing fairness metrics and propose four new metrics that address different forms of unfairness. These fairness metrics can be optimized by adding fairness terms to the learning objective. Experiments on synthetic and real data show that our new metrics can better measure fairness than the baseline, and that the fairness objectives effectively help reduce unfairness. 1 Introduction This paper introduces new measures of unfairness in algorithmic recommendation and demonstrates how to optimize these metrics to reduce different forms of unfairness. Recommender systems study user behavior and make recommendations to support decision making. They have been widely applied in various fields to recommend items such as movies, products, jobs, and courses. However, since recommender systems make predictions based on observed data, they can easily inherit bias that may already exist. To address this issue, we first formalize the problem of unfairness in recommender systems and identify the insufficiency of demographic parity for this setting. We then propose four new unfairness metrics that address different forms of unfairness. We compare our fairness measures with non-parity on biased, synthetic training data and prove that our metrics can better measure unfairness. To improve model fairness, we provide five fairness objectives that can be optimized, each adding unfairness penalties as regularizers. Experimenting on real and synthetic data, we demonstrate that each fairness metric can be optimized without much degradation in prediction accuracy, but that trade-offs exist among the different forms of unfairness. We focus on a frequently practiced approach for recommendation called collaborative filtering, which makes recommendations based on the ratings or behavior of other users in the system. The fundamental assumption behind collaborative filtering is that other users’ opinions can be selected and aggregated in such a way as to provide a reasonable prediction of the active user’s preference [7]. For example, if a user likes item A, and many other users who like item A also like item B, then it is reasonable to expect that the user will also like item B. Collaborative filtering methods would predict that the user will give item B a high rating. With this approach, predictions are made based on co-occurrence statistics, and most methods assume that the missing ratings are missing at random. Unfortunately, researchers have shown that sampled ratings have markedly different properties from the users’ true preferences [21, 22]. Sampling is heavily influenced by social bias, which results in more missing ratings in some cases than others. This non-random pattern of missing and observed rating data is a potential source of unfairness. For the purpose of improving recommendation accuracy, there are collaborative filtering models 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. [2, 21, 25] that use side information to address the problem of imbalanced data, but in this work, to test the properties and effectiveness of our metrics, we focus on the basic matrix-factorization algorithm first. Investigating how these other models could reduce unfairness is one direction for future research. Throughout the paper, we consider a running example of unfair recommendation. We consider recommendation in education, and unfairness that may occur in areas with current gender imbalance, such as science, technology, engineering, and mathematics (STEM) topics. Due to societal and cultural influences, fewer female students currently choose careers in STEM. For example, in 2010, women accounted for only 18% of the bachelor’s degrees awarded in computer science [3]. The underrepresentation of women causes historical rating data of computer-science courses to be dominated by men. Consequently, the learned model may underestimate women’s preferences and be biased toward men. We consider the setting in which, even if the ratings provided by students accurately reflect their true preferences, the bias in which ratings are reported leads to unfairness. The remainder of the paper is organized as follows. First, we review previous relevant work in Section 2. In Section 3, we formalize the recommendation problem, and we introduce four new unfairness metrics and give justifications and examples. In Section 4, we show that unfairness occurs as data gets more imbalanced, and we present results that successfully minimize each form of unfairness. Finally, Section 5 concludes the paper and proposes possible future work. 2 Related Work As machine learning is being more widely applied in modern society, researchers have begun identifying the criticality of algorithmic fairness. Various studies have considered algorithmic fairness in problems such as supervised classification [20, 23, 28]. When aiming to protect algorithms from treating people differently for prejudicial reasons, removing sensitive features (e.g., gender, race, or age) can help alleviate unfairness but is often insufficient. Features are often correlated, so other unprotected attributes can be related to the sensitive features and therefore still cause the model to be biased [17, 29]. Moreover, in problems such as collaborative filtering, algorithms do not directly consider measured features and instead infer latent user attributes from their behavior. Another frequently practiced strategy for encouraging fairness is to enforce demographic parity, which is to achieve statistical parity among groups. The goal is to ensure that the overall proportion of members in the protected group receiving positive (or negative) classifications is identical to the proportion of the population as a whole [29]. For example, in the case of a binary decision ˆY ∈{0, 1} and a binary protected attribute A ∈{0, 1}, this constraint can be formalized as [9] Pr{ ˆY = 1|A = 0} = Pr{ ˆY = 1|A = 1} . (1) Kamishima et al. [13–17] evaluate model fairness based on this non-parity unfairness concept, or try to solve the unfairness issue in recommender systems by adding a regularization term that enforces demographic parity. The objective penalizes the differences among the average predicted ratings of user groups. However, demographic parity is only appropriate when preferences are unrelated to the sensitive features. In tasks such as recommendation, user preferences are indeed influenced by sensitive features such as gender, race, and age [4, 6]. Therefore, enforcing demographic parity may significantly damage the quality of recommendations. To address the issue of demographic parity, Hardt et al. [9] propose to measure unfairness with the true positive rate and true negative rate. This idea encourages what they refer to as equal opportunity and no longer relies on the implicit assumption of demographic parity that the target variable is independent of sensitive features. They propose that, in a binary setting, given a decision ˆY ∈{0, 1}, a protected attribute A ∈{0, 1}, and the true label Y ∈{0, 1}, the constraints are equivalent to [9] Pr{ ˆY = 1|A = 0, Y = y} = Pr{ ˆY = 1|A = 1, Y = y}, y ∈{0, 1} . (2) This constraint upholds fairness and simultaneously respects group differences. It penalizes models that only perform well on the majority groups. This idea is also the basis of the unfairness metrics we propose for recommendation. Our running example of recommendation in education is inspired by the recent interest in using algorithms in this domain [5, 24, 27]. Student decisions about which courses to study can have 2 significant impacts on their lives, so the usage of algorithmic recommendation in this setting has consequences that will affect society for generations. Coupling the importance of this application with the issue of gender imbalance in STEM [1] and challenges in retention of students with backgrounds underrepresented in STEM [8, 26], we find this setting a serious motivation to advance scientific understanding of unfairness—and methods to reduce unfairness—in recommendation. 3 Fairness Objectives for Collaborative Filtering This section introduces fairness objectives for collaborative filtering. We begin by reviewing the matrix factorization method. We then describe the various fairness objectives we consider, providing formal definitions and discussion of their motivations. 3.1 Matrix Factorization for Recommendation We consider the task of collaborative filtering using matrix factorization [19]. We have a set of users indexed from 1 to m and a set of items indexed from 1 to n. For the ith user, let gi be a variable indicating which group the ith user belongs to. For example, it may indicate whether user i identifies as a woman, a man, or with a non-binary gender identity. For the jth item, let hj indicate the item group that it belongs to. For example, hj may represent a genre of a movie or topic of a course. Let rij be the preference score of the ith user for the jth item. The ratings can be viewed as entries in a rating matrix R. The matrix-factorization formulation builds on the assumption that each rating can be represented as the product of vectors representing the user and item. With additional bias terms for users and items, this assumption can be summarized as follows: rij ≈p⊤ i qj + ui + vj , (3) where pi is a d-dimensional vector representing the ith user, qj is a d-dimensional vector representing the jth item, and ui and vj are scalar bias terms for the user and item, respectively. The matrixfactorization learning algorithm seeks to learn these parameters from observed ratings X, typically by minimizing a regularized, squared reconstruction error: J(P , Q, u, v) = λ 2 ||P ||2 F + ||Q||2 F  + 1 |X| X (i,j)∈X (yij −rij)2 , (4) where u and v are the vectors of bias terms, || · ||F represents the Frobenius norm, and yij = p⊤ i qj + ui + vj. (5) Strategies for minimizing this non-convex objective are well studied, and a general approach is to compute the gradient and use a gradient-based optimizer. In our experiments, we use the Adam algorithm [18], which combines adaptive learning rates with momentum. 3.2 Unfair Recommendations from Underrepresentation In this section, we describe a process through which matrix factorization leads to unfair recommendations, even when rating data accurately reflects users’ true preferences. Such unfairness can occur with imbalanced data. We identify two forms of underrepresentation: population imbalance and observation bias. We later demonstrate that either leads to unfair recommendation, and both forms together lead to worse unfairness. In our discussion, we use a running example of course recommendation, highlighting effects of underrepresentation in STEM education. Population imbalance occurs when different types of users occur in the dataset with varied frequencies. For example, we consider four types of users defined by two aspects. First, each individual identifies with a gender. For simplicity, we only consider binary gender identities, though in this example, it would also be appropriate to consider men as one gender group and women and all non-binary gender identities as the second group. Second, each individual is either someone who enjoys and would excel in STEM topics or someone who does and would not. Population imbalance occurs in STEM education when, because of systemic bias or other societal problems, there may be significantly fewer women who succeed in STEM (WS) than those who do not (W), and because of converse societal 3 unfairness, there may be more men who succeed in STEM (MS) than those who do not (M). This four-way separation of user groups is not available to the recommender system, which instead may only know the gender group of each user, but not their proclivity for STEM. Observation bias is a related but distinct form of data imbalance, in which certain types of users may have different tendencies to rate different types of items. This bias is often part of a feedback loop involving existing methods of recommendation, whether by algorithms or by humans. If an individual is never recommended a particular item, they will likely never provide rating data for that item. Therefore, algorithms will never be able to directly learn about this preference relationship. In the education example, if women are rarely recommended to take STEM courses, there may be significantly less training data about women in STEM courses. We simulate these two types of data bias with two stochastic block models [11]. We create one block model that determines the probability that an individual in a particular user group likes an item in a particular item group. The group ratios may be non-uniform, leading to population imbalance. We then use a second block model to determine the probability that an individual in a user group rates an item in an item group. Non-uniformity in the second block model will lead to observation bias. Formally, let matrix L ∈[0, 1]|g|×|h| be the block-model parameters for rating probability. For the ith user and the jth item, the probability of rij = +1 is L(gi,hj), and otherwise rij = −1. Morever, let O ∈[0, 1]|g|×|h| be such that the probability of observing rij is O(gi,hj). 3.3 Fairness Metrics In this section, we present four new unfairness metrics for preference prediction, all measuring a discrepancy between the prediction behavior for disadvantaged users and advantaged users. Each metric captures a different type of unfairness that may have different consequences. We describe the mathematical formulation of each metric, its justification, and examples of consequences the metric may indicate. We consider a binary group feature and refer to disadvantaged and advantaged groups, which may represent women and men in our education example. The first metric is value unfairness, which measures inconsistency in signed estimation error across the user types, computed as Uval = 1 n n X j=1  Eg [y]j −Eg [r]j  −  E¬g [y]j −E¬g [r]j  , (6) where Eg [y]j is the average predicted score for the jth item from disadvantaged users, E¬g [y]j is the average predicted score for advantaged users, and Eg [r]j and E¬g [r]j are the average ratings for the disadvantaged and advantaged users, respectively. Precisely, the quantity Eg [y]j is computed as Eg [y]j := 1 |{i : ((i, j) ∈X) ∧gi}| X i:((i,j)∈X)∧gi yij , (7) and the other averages are computed analogously. Value unfairness occurs when one class of user is consistently given higher or lower predictions than their true preferences. If the errors in prediction are evenly balanced between overestimation and underestimation or if both classes of users have the same direction and magnitude of error, the value unfairness becomes small. Value unfairness becomes large when predictions for one class are consistently overestimated and predictions for the other class are consistently underestimated. For example, in a course recommender, value unfairness may manifest in male students being recommended STEM courses even when they are not interested in STEM topics and female students not being recommended STEM courses even if they are interested in STEM topics. The second metric is absolute unfairness, which measures inconsistency in absolute estimation error across user types, computed as Uabs = 1 n n X j=1 Eg [y]j −Eg [r]j − E¬g [y]j −E¬g [r]j . (8) Absolute unfairness is unsigned, so it captures a single statistic representing the quality of prediction for each user type. If one user type has small reconstruction error and the other user type has large 4 reconstruction error, one type of user has the unfair advantage of good recommendation, while the other user type has poor recommendation. In contrast to value unfairness, absolute unfairness does not consider the direction of error. For example, if female students are given predictions 0.5 points below their true preferences and male students are given predictions 0.5 points above their true preferences, there is no absolute unfairness. Conversely, if female students are given ratings that are off by 2 points in either direction while male students are rated within 1 point of their true preferences, absolute unfairness is high, while value unfairness may be low. The third metric is underestimation unfairness, which measures inconsistency in how much the predictions underestimate the true ratings: Uunder = 1 n n X j=1 max{0, Eg [r]j −Eg [y]j} −max{0, E¬g [r]j −E¬g [y]j} . (9) Underestimation unfairness is important in settings where missing recommendations are more critical than extra recommendations. For example, underestimation could lead to a top student not being recommended to explore a topic they would excel in. Conversely, the fourth new metric is overestimation unfairness, which measures inconsistency in how much the predictions overestimate the true ratings: Uover = 1 n n X j=1 max{0, Eg [y]j −Eg [r]j} −max{0, E¬g [y]j −E¬g [r]j} . (10) Overestimation unfairness may be important in settings where users may be overwhelmed by recommendations, so providing too many recommendations would be especially detrimental. For example, if users must invest large amounts of time to evaluate each recommended item, overestimating essentially costs the user time. Thus, uneven amounts of overestimation could cost one type of user more time than the other. Finally, a non-parity unfairness measure based on the regularization term introduced by Kamishima et al. [17] can be computed as the absolute difference between the overall average ratings of disadvantaged users and those of advantaged users: Upar = |Eg [y] −E¬g [y]| . Each of these metrics has a straightforward subgradient and can be optimized by various subgradient optimization techniques. We augment the learning objective by adding a smoothed variation of a fairness metric based on the Huber loss [12], where the outer absolute value is replaced with the squared difference if it is less than 1. We solve for a local minimum, i.e, min P ,Q,u,v J(P , Q, u, v) + U . (11) The smoothed penalty helps reduce discontinuities in the objective, making optimization more efficient. It is also straightforward to add a scalar trade-off term to weight the fairness against the loss. In our experiments, we use equal weighting, so we omit the term from Eq. (11). 4 Experiments We run experiments on synthetic data based on the simulated course-recommendation scenario and real movie rating data [10]. For each experiment, we investigate whether the learning objectives augmented with unfairness penalties successfully reduce unfairness. 4.1 Synthetic Data In our synthetic experiments, we generate simulated course-recommendation data from a block model as described in Section 3.2. We consider four user groups g ∈{W, WS, M, MS} and three item groups h ∈{Fem, STEM, Masc}. The user groups can be thought of as women who do not enjoy STEM topics (W), women who do enjoy STEM topics (WS), men who do not enjoy STEM topics (M), and men who do (MS). The item groups can be thought of as courses that tend to appeal to most 5 U O P O+P 0.00 0.02 0.04 0.06 0.08 0.10 0.12 0.14 Error U O P O+P 0.000 0.005 0.010 0.015 0.020 0.025 0.030 0.035 0.040 Value U O P O+P 0.00 0.01 0.02 0.03 0.04 Absolute U O P O+P 0.0000 0.0025 0.0050 0.0075 0.0100 0.0125 0.0150 0.0175 0.0200 Under U O P O+P 0.000 0.005 0.010 0.015 0.020 Over U O P O+P 0.00 0.05 0.10 0.15 0.20 0.25 Parity Figure 1: Average unfairness scores for standard matrix factorization on synthetic data generated from different underrepresentation schemes. For each metric, the four sampling schemes are uniform (U), biased observations (O), biased populations (P), and both biases (O+P). The reconstruction error and the first four unfairness metrics follow the same trend, while non-parity exhibits different behavior. women (Fem), STEM courses, and courses that tend to appeal to most men (Masc). Based on these groups, we consider the rating block model L =   Fem STEM Masc W 0.8 0.2 0.2 WS 0.8 0.8 0.2 MS 0.2 0.8 0.8 M 0.2 0.2 0.8   . (12) We also consider two observation block models: one with uniform observation probability across all groups Ouni = [0.4]4×3 and one with unbalanced observation probability inspired by how students are often encouraged to take certain courses Obias =   Fem STEM Masc W 0.6 0.2 0.1 WS 0.3 0.4 0.2 MS 0.1 0.3 0.5 M 0.05 0.5 0.35   . (13) We define two different user group distributions: one in which each of the four groups is exactly a quarter of the population, and an imbalanced setting where 0.4 of the population is in W, 0.1 in WS, 0.4 in MS, and 0.1 in M. This heavy imbalance is inspired by some of the severe gender imbalances in certain STEM areas today. For each experiment, we select an observation matrix and user group distribution, generate 400 users and 300 items, and sample preferences and observations of those preferences from the block models. Training on these ratings, we evaluate on the remaining entries of the rating matrix, comparing the predicted rating against the true expected rating, 2L(gi,hj) −1. 4.1.1 Unfairness from different types of underrepresentation Using standard matrix factorization, we measure the various unfairness metrics under the different sampling conditions. We average over five random trials and plot the average score in Fig. 1. We label the settings as follows: uniform user groups and uniform observation probabilities (U), uniform groups and biased observation probabilities (O), biased user group populations and uniform observations (P), and biased populations and biased observations (P+O). The statistics demonstrate that each type of underrepresentation contributes to various forms of unfairness. For all metrics except parity, there is a strict order of unfairness: uniform data is the most 6 Table 1: Average error and unfairness metrics for synthetic data using different fairness objectives. The best scores and those that are statistically indistinguishable from the best are printed in bold. Each row represents a different unfairness penalty, and each column is the measured metric on the expected value of unseen ratings. Unfairness Error Value Absolute Underestimation Overestimation Non-Parity None 0.317 ± 1.3e-02 0.649 ± 1.8e-02 0.443 ± 2.2e-02 0.107 ± 6.5e-03 0.544 ± 2.0e-02 0.362 ± 1.6e-02 Value 0.130 ± 1.0e-02 0.245 ± 1.4e-02 0.177 ± 1.5e-02 0.063 ± 4.1e-03 0.199 ± 1.5e-02 0.324 ± 1.2e-02 Absolute 0.205 ± 8.8e-03 0.535 ± 1.6e-02 0.267 ± 1.3e-02 0.135 ± 6.2e-03 0.400 ± 1.4e-02 0.294 ± 1.0e-02 Under 0.269 ± 1.6e-02 0.512 ± 2.3e-02 0.401 ± 2.4e-02 0.060 ± 3.5e-03 0.456 ± 2.3e-02 0.357 ± 1.6e-02 Over 0.130 ± 6.5e-03 0.296 ± 1.2e-02 0.172 ± 1.3e-02 0.074 ± 6.0e-03 0.228 ± 1.1e-02 0.321 ± 1.2e-02 Non-Parity 0.324 ± 1.3e-02 0.697 ± 1.8e-02 0.453 ± 2.2e-02 0.124 ± 6.9e-03 0.573 ± 1.9e-02 0.251 ± 1.0e-02 fair; biased observations is the next most fair; biased populations is worse; and biasing the populations and observations causes the most unfairness. The squared rating error also follows this same trend. In contrast, non-parity behaves differently, in that it is heavily amplified by biased observations but seems unaffected by biased populations. Note that though non-parity is high when the observations are imbalanced, because of the imbalance in the observations, one should actually expect non-parity in the labeled ratings, so it a high non-parity score does not necessarily indicate an unfair situation. The other unfairness metrics, on the other hand, describe examples of unfair behavior by the rating predictor. These tests verify that unfairness can occur with imbalanced populations or observations, even when the measured ratings accurately represent user preferences. 4.1.2 Optimization of unfairness metrics As before, we generate rating data using the block model under the most imbalanced setting: The user populations are imbalanced, and the sampling rate is skewed. We provide the sampled ratings to the matrix factorization algorithms and evaluate on the remaining entries of the expected rating matrix. We again use two-dimensional vectors to represent the users and items, a regularization term of λ = 10−3, and optimize for 250 iterations using the full gradient. We generate three datasets each and measure squared reconstruction error and the six unfairness metrics. The results are listed in Table 1. For each metric, we print in bold the best average score and any scores that are not statistically significantly distinct according to paired t-tests with threshold 0.05. The results indicate that the learning algorithm successfully minimizes the unfairness penalties, generalizing to unseen, held-out user-item pairs. And reducing any unfairness metric does not lead to a significant increase in reconstruction error. The complexity of computing the unfairness metrics is similar to that of the error computation, which is linear in the number of ratings, so adding the fairness term approximately doubles the training time. In our implementation, learning with fairness terms takes longer because loops and backpropagation introduce extra overhead. For example, with synthetic data of 400 users and 300 items, it takes 13.46 seconds to train a matrix factorization model without any unfairness term and 43.71 seconds for one with value unfairness. While optimizing each metric leads to improved performance on itself (see the highlighted entries in Table 1), a few trends are worth noting. Optimizing any of our new unfairness metrics almost always reduces the other forms of unfairness. An exception is that optimizing absolute unfairness leads to an increase in underestimation. Value unfairness is closely related to underestimation and overestimation, since optimizing value unfairness is even more effective at reducing underestimation and overestimation than directly optimizing them. Also, optimizing value and overestimation are more effective in reducing absolute unfairness than directly optimizing it. Finally, optimizing parity unfairness leads to increases in all unfairness metrics except absolute unfairness and parity itself. These relationships among the metrics suggest a need for practitioners to decide which types of fairness are most important for their applications. 4.2 Real Data We use the Movielens Million Dataset [10], which contains ratings (from 1 to 5) by 6,040 users of 3,883 movies. The users are annotated with demographic variables including gender, and the movies are each annotated with a set of genres. We manually selected genres that feature different forms of 7 Table 2: Gender-based statistics of movie genres in Movielens data. Romance Action Sci-Fi Musical Crime Count 325 425 237 93 142 Ratings per female user 54.79 52.00 31.19 15.04 17.45 Ratings per male user 36.97 82.97 50.46 10.83 23.90 Average rating by women 3.64 3.45 3.42 3.79 3.65 Average rating by men 3.55 3.45 3.44 3.58 3.68 Table 3: Average error and unfairness metrics for movie-rating data using different fairness objectives. Unfairness Error Value Absolute Underestimation Overestimation Non-Parity None 0.887 ± 1.9e-03 0.234 ± 6.3e-03 0.126 ± 1.7e-03 0.107 ± 1.6e-03 0.153 ± 3.9e-03 0.036 ± 1.3e-03 Value 0.886 ± 2.2e-03 0.223 ± 6.9e-03 0.128 ± 2.2e-03 0.102 ± 1.9e-03 0.148 ± 4.9e-03 0.041 ± 1.6e-03 Absolute 0.887 ± 2.0e-03 0.235 ± 6.2e-03 0.124 ± 1.7e-03 0.110 ± 1.8e-03 0.151 ± 4.2e-03 0.023 ± 2.7e-03 Under 0.888 ± 2.2e-03 0.233 ± 6.8e-03 0.128 ± 1.8e-03 0.102 ± 1.7e-03 0.156 ± 4.2e-03 0.058 ± 9.3e-04 Over 0.885 ± 1.9e-03 0.234 ± 5.8e-03 0.125 ± 1.6e-03 0.112 ± 1.9e-03 0.148 ± 4.1e-03 0.015 ± 2.0e-03 Non-Parity 0.887 ± 1.9e-03 0.236 ± 6.0e-03 0.126 ± 1.6e-03 0.110 ± 1.7e-03 0.152 ± 3.9e-03 0.010 ± 1.5e-03 gender imbalance and only consider movies that list these genres. Then we filter the users to only consider those who rated at least 50 of the selected movies. The genres we selected are action, crime, musical, romance, and sci-fi. We selected these genres because they each have a noticeable gender effect in the data. Women rate musical and romance films higher and more frequently than men. Women and men both score action, crime, and sci-fifilms about equally, but men rate these film much more frequently. Table 2 lists these statistics in detail. After filtering by genre and rating frequency, we have 2,953 users and 1,006 movies in the dataset. We run five trials in which we randomly split the ratings into training and testing sets, train each objective function on the training set, and evaluate each metric on the testing set. The average scores are listed in Table 3, where bold scores again indicate being statistically indistinguishable from the best average score. On real data, the results show that optimizing each unfairness metric leads to the best performance on that metric without a significant change in the reconstruction error. As in the synthetic data, optimizing value unfairness leads to the most decrease on under- and overestimation. Optimizing non-parity again causes an increase or no change in almost all the other unfairness metrics. 5 Conclusion In this paper, we discussed various types of unfairness that can occur in collaborative filtering. We demonstrate that these forms of unfairness can occur even when the observed rating data is correct, in the sense that it accurately reflects the preferences of the users. We identify two forms of data bias that can lead to such unfairness. We then demonstrate that augmenting matrix-factorization objectives with these unfairness metrics as penalty functions enables a learning algorithm to minimize each of them. Our experiments on synthetic and real data show that minimization of these forms of unfairness is possible with no significant increase in reconstruction error. We also demonstrate a combined objective that penalizes both overestimation and underestimation. Minimizing this objective leads to small unfairness penalties for the other forms of unfairness. Using this combined objective may be a good approach for practitioners. However, no single objective was the best for all unfairness metrics, so it remains necessary for practitioners to consider precisely which form of fairness is most important in their application and optimize that specific objective. Future Work While our work in this paper focused on improving fairness among users so that the model treats different groups of users fairly, we did not address fair treatment of different item groups. The model could be biased toward certain items, e.g., performing better at prediction for some items than others in terms of accuracy or over- and underestimation. Achieving fairness for both users and items may be important when considering that the items may also suffer from discrimination or bias, for example, when courses are taught by instructors with different demographics. Our experiments demonstrate that minimizing empirical unfairness generalizes, but this generalization is dependent on data density. When ratings are especially sparse, the empirical fairness does not 8 always generalize well to held-out predictions. We are investigating methods that are more robust to data sparsity in future work. Moreover, our fairness metrics assume that users rate items according to their true preferences. This assumption is likely to be violated in real data, since ratings can also be influenced by various environmental factors. E.g., in education, a student’s rating for a course also depends on whether the course has an inclusive and welcoming learning environment. However, addressing this type of bias may require additional information or external interventions beyond the provided rating data. Finally, we are investigating methods to reduce unfairness by directly modeling the two-stage sampling process we used to generate synthetic, biased data. We hypothesize that by explicitly modeling the rating and observation probabilities as separate variables, we may be able to derive a principled, probabilistic approach to address these forms of data imbalance. References [1] D. N. Beede, T. A. Julian, D. Langdon, G. McKittrick, B. Khan, and M. E. Doms. Women in STEM: A gender gap to innovation. U.S. Department of Commerce, Economics and Statistics Administration, 2011. [2] A. Beutel, E. H. Chi, Z. Cheng, H. Pham, and J. Anderson. Beyond globally optimal: Focused learning for improved recommendations. In Proceedings of the 26th International Conference on World Wide Web, pages 203–212. International World Wide Web Conferences Steering Committee, 2017. [3] S. Broad and M. McGee. Recruiting women into computer science and information systems. Proceedings of the Association Supporting Computer Users in Education Annual Conference, pages 29–40, 2014. [4] O. Chausson. Who watches what? Assessing the impact of gender and personality on film preferences. http://mypersonality.org/wiki/doku.php?id=movie_tastes_and_personality, 2010. [5] M.-I. Dascalu, C.-N. Bodea, M. N. Mihailescu, E. A. Tanase, and P. Ordoñez de Pablos. Educational recommender systems and their application in lifelong learning. Behaviour & Information Technology, 35(4):290–297, 2016. [6] T. N. Daymont and P. J. Andrisani. Job preferences, college major, and the gender gap in earnings. Journal of Human Resources, pages 408–428, 1984. [7] M. D. Ekstrand, J. T. Riedl, J. A. Konstan, et al. Collaborative filtering recommender systems. Foundations and Trends in Human-Computer Interaction, 4(2):81–173, 2011. [8] A. L. Griffith. Persistence of women and minorities in STEM field majors: Is it the school that matters? Economics of Education Review, 29(6):911–922, 2010. [9] M. Hardt, E. Price, N. Srebro, et al. Equality of opportunity in supervised learning. In Advances in Neural Information Processing Systems, pages 3315–3323, 2016. [10] F. M. Harper and J. A. Konstan. The Movielens datasets: History and context. ACM Transactions on Interactive Intelligent Systems (TiiS), 5(4):19, 2016. [11] P. W. Holland and S. Leinhardt. Local structure in social networks. Sociological Methodology, 7:1–45, 1976. [12] P. J. Huber. Robust estimation of a location parameter. The Annals of Mathematical Statistics, pages 73–101, 1964. [13] T. Kamishima, S. Akaho, H. Asoh, and J. Sakuma. Enhancement of the neutrality in recommendation. In Decisions@ RecSys, pages 8–14, 2012. [14] T. Kamishima, S. Akaho, H. Asoh, and J. Sakuma. Efficiency improvement of neutralityenhanced recommendation. In Decisions@ RecSys, pages 1–8, 2013. [15] T. Kamishima, S. Akaho, H. Asoh, and J. Sakuma. Correcting popularity bias by enhancing recommendation neutrality. In RecSys Posters, 2014. 9 [16] T. Kamishima, S. Akaho, H. Asoh, and I. Sato. Model-based approaches for independenceenhanced recommendation. In Data Mining Workshops (ICDMW), 2016 IEEE 16th International Conference on, pages 860–867. IEEE, 2016. [17] T. Kamishima, S. Akaho, and J. Sakuma. Fairness-aware learning through regularization approach. In 11th International Conference on Data Mining Workshops (ICDMW), pages 643–650. IEEE, 2011. [18] D. Kingma and J. Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. [19] Y. Koren, R. Bell, and C. Volinsky. Matrix factorization techniques for recommender systems. Computer, 42(8), 2009. [20] K. Lum and J. Johndrow. A statistical framework for fair predictive algorithms. arXiv preprint arXiv:1610.08077, 2016. [21] B. Marlin, R. S. Zemel, S. Roweis, and M. Slaney. Collaborative filtering and the missing at random assumption. arXiv preprint arXiv:1206.5267, 2012. [22] B. M. Marlin and R. S. Zemel. Collaborative prediction and ranking with non-random missing data. In Proceedings of the third ACM conference on Recommender systems, pages 5–12. ACM, 2009. [23] D. Pedreshi, S. Ruggieri, and F. Turini. Discrimination-aware data mining. In Proceedings of the 14th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 560–568. ACM, 2008. [24] C. V. Sacin, J. B. Agapito, L. Shafti, and A. Ortigosa. Recommendation in higher education using data mining techniques. In Educational Data Mining, 2009. [25] S. Sahebi and P. Brusilovsky. It takes two to tango: An exploration of domain pairs for crossdomain collaborative filtering. In Proceedings of the 9th ACM Conference on Recommender Systems, pages 131–138. ACM, 2015. [26] E. Smith. Women into science and engineering? Gendered participation in higher education STEM subjects. British Educational Research Journal, 37(6):993–1014, 2011. [27] N. Thai-Nghe, L. Drumond, A. Krohn-Grimberghe, and L. Schmidt-Thieme. Recommender system for predicting student performance. Procedia Computer Science, 1(2):2811–2819, 2010. [28] M. B. Zafar, I. Valera, M. Gomez Rodriguez, and K. P. Gummadi. Fairness constraints: Mechanisms for fair classification. arXiv preprint arXiv:1507.05259, 2017. [29] R. Zemel, Y. Wu, K. Swersky, T. Pitassi, and C. Dwork. Learning fair representations. In Proceedings of the 30th International Conference on Machine Learning, pages 325–333, 2013. 10
2017
599
7,117
On clustering network-valued data Soumendu Sundar Mukherjee Department of Statistics University of California, Berkeley Berkeley, California 94720, USA soumendu@berkeley.edu Purnamrita Sarkar Department of Statistics and Data Sciences University of Texas, Austin Austin, Texas 78712, USA purna.sarkar@austin.utexas.edu Lizhen Lin Department of Applied and Computational Mathematics and Statistics Univeristy of Notre Dame Notre Dame, Indiana 46556, USA lizhen.lin@nd.edu Abstract Community detection, which focuses on clustering nodes or detecting communities in (mostly) a single network, is a problem of considerable practical interest and has received a great deal of attention in the research community. While being able to cluster within a network is important, there are emerging needs to be able to cluster multiple networks. This is largely motivated by the routine collection of network data that are generated from potentially different populations. These networks may or may not have node correspondence. When node correspondence is present, we cluster networks by summarizing a network by its graphon estimate, whereas when node correspondence is not present, we propose a novel solution for clustering such networks by associating a computationally feasible feature vector to each network based on trace of powers of the adjacency matrix. We illustrate our methods using both simulated and real data sets, and theoretical justifications are provided in terms of consistency. 1 Introduction A network, which is used to model interactions or communications among a set of agents or nodes, is arguably among one of the most common and important representations for modern complex data. Networks are ubiquitous in many scientific fields, ranging from computer networks, brain networks and biological networks, to social networks, co-authorship networks and many more. Over the past few decades, great advancement has been made in developing models and methodologies for inference of networks. There are a range of probabilistic models for networks, starting from the relatively simple Erdös-Rényi model [12], stochastic blockmodels and their extensions [15, 17, 6], to infinite dimensional graphons [28, 13]. These models are often used for community detection, i.e. clustering the nodes in a network. Various community detection algorithms or methods have been proposed, including modularity-based methods [21], spectral methods [25], likelihood-based methods [8, 11, 7, 4], and optimization-based approaches like those based on semidefinite programming [5], etc. The majority of the work in the community detection literature including the above mentioned ones focus on finding communities among the nodes in a single network. While this is still a very important problem with many open questions, there is an emerging need to be able to detect clusters among multiple network-valued objects, where a network itself is a 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. fundamental unit of data. This is largely motivated by the routine collection of populations or subpopulations of network-valued data objects. Technological advancement and the explosion of complex data in many domains has made this a somewhat common practice. There has been some notable work on graph kernels in the Computer Science literature [27, 26]. In these works the goal is to efficiently compute different types of kernel based similarity measures (or their approximations) between networks. In contrast, we ask the following statistical questions. Can we cluster networks consistently from a mixture of graphons, when 1) there is node correspondence and 2) when there isn’t? The first situation arises, for example, when one has a network evolving over time, or multiple instances of a network between well-defined objects. If one thinks of them as random samples from a mixture of graphons, then can we cluster them? We propose a simple and general algorithm to address this question, which operates by first obtaining a graphon estimate of each of the networks, constructing a distance matrix between those graphon estimates, and then performing spectral clustering on the distance matrix. We call this algorithm Network Clustering based on Graphon Estimates (NCGE). The second situation arises when one is interested in global properties of a network. This setting is closer to that of graph kernels. Say we have co-authorship networks from Computer Science and High Energy Physics. Are these different types of networks? There has been a lot of empirical and algorithmic work on featurizing networks or computing kernels between networks. But most of these features require expensive computation. We propose a simple feature based on traces of powers of the adjacency matrix for this purpose which is very cheap to compute as it involves only matrix multiplication. We cluster the networks based on these features and call this method Network Clustering based on Log Moments (NCLM). We provide some theoretical guarantees for our algorithms in terms of consistency, in addition to extensive simulations and real data examples. The simulation results show that NCGE clearly outperform the naive yet popular method of clustering (vectorized) adjacency matrices in various settings. We also show that, in absence of node correspondence, NCLM is consistently better and faster than methods which featurize networks with different global statistics and graphlet kernels. We also apply NCLM to separate out a mixed bag of real world networks, like co-authorship networks form different domains and ego networks. The rest of the paper is organized as follows. In Section 2 we briefly describe graphonestimation methods and other related work. Next, in Section 3 we formally describe our setup and introduce our algorithms. Section 4.1 contains some theory for these algorithms. In Section 5 we provide simulations and real data examples. We conclude with a discussion in Section 6. 2 Related work The focus of this paper is on 1) clustering networks which have node correspondence based on estimating the underlying graphon and 2) clustering networks without node correspondence based on global properties of the networks. In this section we first cite two methods of obtaining graphon estimates, which we will use in our first algorithm. Second, we cite existing work that summarizes a network using different statistics and compares those to obtain a measure of similarity. A prominent estimator of graphons is the so called Universal Singular Value Thresholding (USVT) estimator proposed by [9]. The main idea behind USVT is to essentially estimate the low rank structure of the population matrix by thresholding the singular values of the observed matrix at an universal cutoff, and then use retained singular values and the corresponding singular vectors to construct an estimate of the population matrix. Another recent work [29] proposes a novel, statistically consistent and computationally efficient approach for estimating the link probability matrix by neighborhood smoothing. Typically for large networks USVT is a lot more scalable than the neighborhood-smoothing approach. There are several other methods for graphon estimation, e.g., by fitting a stochastic blockmodel [24]. These methods can also be used in our algorithm. 2 In [10], a graph-based method for change-point detection is proposed, where an independent sequence of observations are considered. These are generated i.i.d. under the null hypothesis, whereas under the alternative, after a change point, the underlying distribution changes. The goal is to find this change point. The observations can be high-dimensional vectors or even networks, with the latter bearing some resemblance with our first framework. This can be viewed as clustering the observations into “past” and “future”. We remark here that our graphon-estimation based clustering algorithm suggests an alternative method for change point detection in networks, namely by looking at the second eigenvector of the distance matrix between estimated graphons. Another related work is due to [14] which aims to extend the classical large sample theory to model network-valued objects. For comparing global properties of networks, there have been many interesting works that featurize networks, see, for instance, [3]. In the Computer Science literature, graph kernels have gained much attention [27, 26]. In these works the goal is to efficiently compute different types of kernel based similarity measures (exact or approximate) between networks. 3 A framework for clustering networks Let G be a binary random network or graph with n nodes. Denote by A its adjacency matrix, which is an n by n symmetric matrix with binary entries. That is, Aij = Aji ∈ {0, 1}, 1 ≤i < j ≤n, where Aij = 1 if there is an observed edge between nodes i and j, and Aij = 0 otherwise. All the diagonal elements of A are structured to be zero (i.e. Aii = 0). We assume the following random Bernoulli model with Aij | Pij ∼Bernoulli(Pij), i < j, (1) where Pij = P(Aij = 1) is the probability of link formation between nodes i and j. We denote the link probability matrix as P = ((Pij)). The edge probabilities are often modeled using the so-called graphons. A graphon f is a nonnegative bounded, measurable symmetric function f : [0, 1]2 →[0, 1]. Given such an f, one can use the model Pij = f(ξi, ξj), (2) where ξi, ξj are i.i.d. uniform random variables on (0, 1). In fact, any (infinite) exchangeable network arises in this way (by Aldous-Hoover representation [2, 16]). Our current work focuses on the problem of clustering networks. Unlike in a traditional setup, where one observes a single network (with potentially growing number of nodes) and the goal often is to cluster the nodes, here we observe multiple networks and are interested in clustering these networks viewed as fundamental data units. 3.1 Node correspondence present A simple and natural model for this is what we call the graphon mixture model for obvious reasons: there are only K (fixed) underlying graphons f1, . . . , fK giving rise to link probability matrices Π1, . . . , ΠK and we observe T networks sampled i.i.d. from the mixture model Pmix(A) = K X i=1 qiPΠi(A), (3) where the qi’s are the mixing proportions and PP (A) = Q u<v P Auv uv (1 −Puv)1−Auv is the probability of observing the adjacency matrix A when the link probability matrix is given by P. Consider n nodes, and T independent networks Ai, i ∈[T], which define edges between these n nodes. We propose the following simple and general algorithm (Algorithm 1) for clustering them. 3 Algorithm 1 Network Clustering based on Graphon Estimates (NCGE) 1: Graphon estimation. Given A1, . . . , AT , estimate their corresponding link probability matrices P1, . . . , PT using any one of the ‘blackbox’ algorithms such as USVT ([9]), the neighborhood smoothing approach by [29] etc. Call these estimates ˆP1, . . . , ˆPT . 2: Forming a distance matrix. Compute the T by T distance matrix ˆD with ˆDij = ∥ˆPi −ˆPj∥F , where ∥· ∥F is the Frobenius norm. 3: Clustering. Apply the spectral clustering algorithm to the distance matrix ˆD. We will from now on denote the above algorithm with the different graphon estimation (‘blackbox’) approaches as follows: the algorithm with USVT as blackbox will be denoted by CL-USVT and the one with the neighborhood smoothing method as blackbox will be denoted by CL-NBS. We will compare these two algorithms with the CL-NAIVE method which does not estimate the underlying graphon, but clusters vectorized adjacency matrices directly (in the spirit of [10]). 3.2 Node correspondence absent We use certain graph statistics to construct a feature vector. The basic statistics we choose are the trace of powers of the adjacency matrix, suitably normalized and we call them graph moments: mk(A) = trace(A/n)k. (4) These statistics are related to various path/subgraph counts. For example, m2(A) is the normalized count of the total number of edges, m3(A) is the normalized triangle count of A. Higher order moments are actually counts of closed walks (or directed circuits). The reason we use graph moments instead of subgraph counts is that the latter are quite difficult to compute and present day algorithms work only for subgraphs up to size 5. On the contrary, graph moments are easy to compute as they only involve matrix multiplication. While it may seem that this is essentially the same as comparing the eigenspectrum, it is not clear how many eigenvalues one should use. Even if one could estimate the number of large eigenvalues using an USVT type estimator, the length is different for different networks. The trace takes into account the relative magnitudes of the eigenvalues naturally. In fact, we tried (see Section 5) using the top few eigenvalues as the sole features, but the results were not as satisfactory as using mk. We now present our second algorithm (Algorithm 2). In step 2 below we take d to be the standard Euclidean metric. Algorithm 2 Network Clustering based on Log Moments (NCLM) 1: Moment calculation. For each network Ai, i ∈[T] and a positive integer J, compute the feature vector gJ(Ai) := (log m1(Ai), log m2(Ai), . . . , log mJ(Ai)). 2: Forming a distance matrix. For some metric d, set ˆDij = d(gJ(Ai), gJ(Aj)). 3: Clustering. Apply the spectral clustering algorithm to the distance matrix ˆD. Note: The rationale behind taking a logarithm of the graph moments is that if we have two graphs with the same degree density but different sizes, then the degree density will not play any role in the the distance (which is necessary because the degree density will subdue any other differences otherwise). The parameter J counts, in some sense, the effective number of eigenvalues we are using. 4 Theory We will only mention our main results and discuss some of the consequences here. All the proofs and further details can be found in the supplementary article [1]. 4 4.1 Results on NCGE We can think of ˆDij as estimating Dij = ∥Pi −Pj∥F . Theorem 4.1. Suppose D = ((Dij)) has rank K. Let V (resp. ˆV ) be the T × K matrix whose columns correspond to the leading K eigenvectors (corresponding to the K largest-inmagnitude eigenvalues) of D (resp. ˆD). Let γ = γ(K, n, T) be the K-th smallest eigenvalue value of D in magnitude. Then there exists an orthogonal matrix ˆO such that ∥ˆV ˆO −V ∥2 F ≤64T γ2 X i ∥ˆPi −Pi∥2 F . Corollary 4.2. Assume for some absolute constants α, β > 0 the following holds for each i ∈[T]: ∥ˆPi −Pi∥2 F n2 ≤Cin−α(log n)β, (5) either in expectation or with high probability (≥1 −ϵi,n). Then in expectation or with high probability (≥1 −P i ϵi,n) we have that ∥ˆV ˆO −V ∥2 F ≤64CT T 2n2−α(log n)β γ2 , (6) where CT = maxi≤i≤T Ci. If there are K (fixed, not growing with T) underlying graphons, then the constant CT does not depend on T. Table 1 reports values of α, β for various graphon estimation procedures (under assumptions on the underlying graphons, that are described in the supplementary article [1]). Table 1: Values of α, β for various graphon estimation procedures. Procedure USVT NBS Minimax rate α 1/3 1/2 1 β 0 1/2 1 While it is hard to obtain an explicit lower bound on γ in general, let us consider a simple equal weight mixture of two graphons to illustrate the relationship between γ and separation between graphons. Let the distance between the population graphons be dn. Then we have D = Z  0 dn dn 0  ZT , where the i-th row of the binary matrix Z has a single one at position l if network Ai is sampled from Πl. The nonzero eigenvalues of this matrix are Tnd/2 and −Tnd/2. Thus in this case γ = Tnd/2. As a result (6) becomes ∥ˆV ˆO −V ∥2 F ≤256CT n−α(log n)β d2 . (7) Let us look at a more specific case of blockmodels with the same number (= m) of clusters of equal sizes (= n/m) to gain some insight into d. Let C be a n × m binary matrix of memberships such that Cib = 1 if node i within a blockmodel comes from cluster b. Consider two blockmodels Π1 = CB1CT with B1 = (p −q)Im + qEm and Π2 = CB2CT with B2 = (p′ −q′)Im + q′Em, where Im is the identity matrix of order m (here the only difference between the models come from link formation probabilities within/between blocks, the blocks remaining the same). In this case d2 = ∥Π1 −Π2∥2 F n2 = 1 m(p −p′)2 +  1 −1 m  (q −q′)2. The bound (6) can be turned into a bound on the proportion of “misclustered” networks, defined appropriately. There are several ways to define misclustered nodes in the context of community detection in stochastic blockmodels that are easy to analyze with spectral clustering (see, e.g., [25, 18]). These definitions work in our context too. For example, if we 5 use Definition 4 of [25] and denote by M the set of misclustered networks, then from the proof of their Theorem 1, we have |M| ≤8mT ∥ˆV ˆO −V ∥2 F , where mT = maxj=1,...,K(ZT Z)jj is the maximum number of networks coming from any of the graphons. 4.2 Results on NCLM We first establish concentration of trace(Ak). The proof uses Talagrand’s concentration inequality, which requires additional results on Lipschitz continuity and convexity. This is obtained via decomposing A 7→trace(Ak) into a linear combination of convex-Lipschitz functions. Theorem 4.3 (Concentration of moments). Let A be the adjacency matrix of a random graph with link-probability matrix P. Then for any k. Let ψk(A) := n k √ 2mk(A). Then P(|ψk(A) −Eψk(A)| > t) ≤4 exp(−(t −4 √ 2)2/16). As a consequence of this, we can show that gJ(A) concentrates around ¯gJ(A) := (log Em2(A), . . . , log EmJ(A)). Theorem 4.4 (Concentration of gJ(A)). Let EA = ρS, where ρ ∈(0, 1), mini,j Sij = Ω(1), and P i,j Sij = n2. Then ∥¯gJ(A)∥= Θ(J3/2 log(1/ρ)), and for any 0 < δ < 1 satisfying δJ log(1/ρ) = Ω(1), we have P(∥gJ(A) −¯gJ(A)∥≥δJ3/2 log(1/ρ)) ≤JC1e−C2n2ρ2J. We expect that ¯gJ will be a good population level summary for many models. In general, it is hard to show an explicit separation result for ¯gJ. However, in simple models, we can do explicit computations to show separation. For example, in a two parameter blockmodel B = (p−q)Im+qEm, with equal block sizes, we have Em2(A) = (p/m+(m−1)q/m)(1+o(1)), Em3(A) = (p3/m2 + (m −1)pq2/m2 + (m −1)(m −2)q3/6m2)(1 + o(1)) and so on. Thus we see that if m = 2, then ¯g2 should be able to distinguish between such blockmodels (i.e. different p, q). Note: After this paper was submitted, we came to know of a concurrent work [20] that provides a topological/combinatorial perspective on the expected graph moments Emk(A). Theorem 1 in [20] shows that under some mild assumptions on the model (satisfied, for example, by generalized random graphs with bounded kernels as long as the average degree grows to infinity), Etrace(Ak) = E(# of closed k-walks) will be asymptotic to E(# of closed k-walks that trace out a k-cycle) plus 1{k even}E(# of closed k-walks that trace out a (k/2+1)tree). For even k, if the degree grows fast enough, k-cycles tend to dominate, whereas for sparser graphs trees tend to dominate. From this and our concentration results, we can expect NCLM to be able to tell apart graphs which are different in terms the counts of these simpler closed k-walks. Incidentally, the authors of [20] also show that the expected count of closed non-backtracking walks of length k is dominated by walks tracing out k-cycles. Thus if one uses counts of closed non-backtracking k-walks (i.e. moments of the non-backtracking matrix) instead of just closed k-walks as features, one would expect similar performance on denser networks, but in sparser settings it may lead to improvements because of the absence of the non-informative trees in lower order even moments. 5 Simulation study and data analysis In this section, we describe the results of our experiments with simulated and real data to evaluate the performance of NCGE and NCLM. We measure performance in terms of clustering error which is the minimum normalized hamming distance between the estimated label vector and all K! permutations of the true label assignment. Clustering accuracy is one minus clustering error. 6 Node correspondence present: We provide two simulated data experiments1 for clustering networks with node correspondence. In each experiment twenty 150-node networks were generated from a mixture of two graphons, 13 networks from the first and the other 7 from the second. We also used a scalar multiplier with the graphons to ensure that the networks are not too dense. The average degree for all these experiments were around 20-25. We report the average error bars from a few random runs. First we generate a mixture of graphons from two blockmodels, with probability matrices (pi −qi)Im + qiEm with i ∈{1, 2}. We use p2 = p1(1 + ϵ) and q2 = q1(1 + ϵ) and measure clustering accuracy as the multiplicative error ϵ is increased from 0.05 to 0.15. We compare CL-USVT, CL-NBS and CL-NAIVE and the results are summarized in Figure 1(A). We have observed two things. First, CL-USVT and CL-NBS start distinguishing the graphons better as ϵ increases (as the theory suggests). Second, the naive approach does not do a good job even when ϵ increases. Figure 1: We show the behavior of the three algorithms when ϵ increases, when the underlying network is generated from (A) a blockmodel, and (B) a smooth graphon. (A) (B) In the second simulation, we generate the networks from two smooth graphons Π1 and Π2, where Π2 = Π1(1 + ϵ) (here Π1 corresponds to the graphon 3 appearing in Table 1 of [29]). As is seen from Figure 1(B), here also CL-USVT and CL-NBS outperform the naive algorithm by a huge margin. Also, CL-NBS is consistently better than CL-USVT, which shows that the accuracy of the graphon estimation procedure is important (for example, USVT is known to perform worse as the network becomes sparser). Node correspondence absent: We show the efficacy of our approach via two sets of experiments. We compare our log-moment based method NCLM with three other methods. The first is Graphlet Kernels [26] with 3, 4 and 5 graphlets, denoted by GK3, GK4 and GK5 respectively. In the second method, we use six different network-based statistics to summarize each graph; these statistics are the algebraic connectivity, the local and global clustering coefficients [23], the distance distribution [19] for 3 hops, the Pearson correlation coefficient [22] and the rich-club metric [30]. We also compare against graphs summarized by the top J eigenvalues of A/n (TopEig). These are detailed in the supplementary article [1]. For each distance matrix ˆD we compute with NCLM, GraphStats and TopEig, we calculate a similarity matrix K = exp(−t ˆD) where t is chosen as the value, within a range, which maximizes the relative eigengap (λK(K) −λK+1(K))/λK+1(K). It would be interesting to have a data dependent range for t. For each matrix K we calculate the top few eigenvectors, say N many, and do K-means on them to get the final clustering. We use N = K; however, for GK3, GK4, and GK5, we had to use a smaller N which boosted their clustering accuracy. First we construct four sets of parameters for the two parameter blockmodel (also known as the planted partition model): Θ1 = {p = 0.1, q = 0.05, K = 2, ρ = 0.6}, Θ2 = {p = 0.1, q = 1Code used in this paper is publicly available at https://github.com/soumendu041/ clustering-network-valued-data. 7 0.05, K = 2, ρ = 1}, Θ3 = {p = 0.1, q = 0.05, K = 8, ρ = 0.6}, and Θ4 = {p = 0.2, q = 0.1, K = 8, ρ = 0.6}. Note that the first two settings differ only in the density parameter ρ. The second two settings differ in the within and across cluster probabilities. The first two and second two differ in K. For each parameter setting we generate two sets of 20 graphs, one with n = 500 and the other with n = 1000. For choosing J, we calculate the moments for a large J; compute a kernel similarity matrix for each choice of J and report the one with largest relative eigengap between the Kth and (K + 1)th eigenvalue. We show these plots in the supplementary article [1]. We see that the eigengap increases and levels offafter a point. However, as J increases, the computation time increases, so there is a trade-off. We report the accuracy of J = 5, whereas J = 8 also returns the same in 48 seconds. Table 2: Error of 6 different methods on the simulated networks. NCLM (J = 5) GK3 GK4 GK5 GraphStats (J = 6) TopEig (J = 5) Error 0 0.5 0.36 0.26 0.37 0.18 Time (s) 25 14 16 38 94 8 We see that NCLM performs the best. For GK3, GK4 and GK5, if one uses the top two eigenvectors, and clusters those into 4 groups (since there are four parameter settings), the errors are respectively 0.08, 0.025 and 0.03. This means that, for clustering, one needs to estimate the effective rank of the graphlet kernels as well. TopEig performs better than GraphStats, which has trouble separating out Θ2 and Θ4. Note: Intuitively one would expect that, if there is node correspondence between the graphs, clustering based on graphon estimates would work better, because it aims to estimate the underlying probabilistic model for comparison. However, in our experiments we found that a properly tuned NCLM matched the performance of NCGE. This is probably because a properly tuned NCLM captures the global features that distinguish two graphons. We leave it for future work to compare their performance theoretically. Real Networks: We cluster about fifty real world networks. We use 11 co-authorship networks between 15,000 researchers from the High Energy Physics corpus of the arXiv, 11 co-authorship networks with 21,000 nodes from Citeseer (which had Machine Learning in their abstracts), 17 co-authorship networks (each with about 3000 nodes) from the NIPS conference and finally 10 Facebook ego networks2. The average degrees vary between 0.2 to 0.4 for co-authorship networks and are around 10 for the ego networks. Each co-authorship network is dynamic, i.e. a node corresponds to an author in that corpus and this node index is preserved in the different networks over time. The ego networks are different in that sense, since each network is the subgraph of Facebook induced by the neighbors of a given central or “ego” node. The sizes of these networks vary between 350 to 4000. Table 3: Clustering error of 6 different methods on a collection of real world networks consisting of co-authorship networks from Citeseer, High Energy Physics (HEP-Th) corpus of arXiv, NIPS and ego networks from Facebook. NCLM (J = 8) GK3 GK4 GK5 GraphStats (J = 8) TopEig (J = 30) Error 0.1 0.6 0.6 0.6 0.16 0.32 Time (s) 2.7 45 50 60 765 14 Table 3 summarizes the performance of different algorithms and their running time to compute distance between the graphs. We use the different sources of networks as labels, i.e. HEP-Th will be one cluster, etc. We explore different choices of J, and see that the best performance is from NCLM, with J = 8, followed closely by GraphStats. TopEig (J in this case is where the eigenspectra of the larger networks have a knee) and the graph kernels do not perform very well. GraphStats take 765 seconds to complete, whereas NCLM finishes in 2.7 seconds. This is because the networks are large but extremely sparse, and so calculation of matrix powers is comparatively cheap. 2https://snap.stanford.edu/data/egonets-Facebook.html 8 Figure 2: Kernel matrix for NCLM on 49 real networks. In Figure 2, we plot the kernel similarity matrix obtained using NCLM on the real networks (higher the value, more similar the points are). The first 11 networks are from HEP-Th, whereas the next 11 are from Citeseer. The next 16 are from NIPS and the remaining ones are the ego networks from Facebook. First note that {HEP-Th, Citeseer}, NIPS and Facebook are well separated. However, HEP-Th and Citeseer are hard to separate out. This is also verified by the bad performance of TopEig in separating out the first two (shown in Section 5). However, in Figure 2, we can see that the Citeseer networks are different from HEP-Th in the sense that they are not as strongly connected inside as HEP-Th. 6 Discussion We consider the problem of clustering network-valued data for two settings, both of which are prevalent in practice. In the first setting, different network objects have node correspondence. This includes clustering brain networks obtained from FMRI data where each node corresponds to a specific region in the brain, or co-authorship networks between a set of authors where the connections vary from one year to another. In the second setting, node correspondence is not present, e.g., when one wishes to compare different types of networks: co-authorship networks, Facebook ego networks, etc. One may be interested in seeing if co-authorship networks are more “similar” to each other than ego or friendship networks. We present two algorithms for these two settings based on a simple general theme: summarize a network into a possibly high dimensional feature vector and then cluster these feature vectors. In the first setting, we propose NCGE, where each network is represented using its graphon-estimate. We can use a variety of graphon estimation algorithms for this purpose. We show that if the graphon estimation is consistent, then NCGE can cluster networks generated from a finite mixture of graphons in a consistent way, if those graphons are sufficiently different. In the second setting, we propose to represent a network using an easy-to-compute summary statistic, namely the vector of the log-traces of the first few powers of a suitably normalized version of the adjacency matrix. We call this method NCLM and show that the summary statistic concentrates around its expectation, and argue that this expectation should be able to separate networks generated from different models. Using simulated and real data experiments we show that NCGE is vastly superior to the naive but often-used method of comparing adjacency matrices directly, and NCLM outperforms most computationally expensive alternatives for differentiating networks without node correspondence. In conclusion, we believe that these methods will provide practitioners with a powerful and computationally tractable tool for comparing network-structured data in a range of disciplines. 9 Acknowledgments We thank Professor Peter J. Bickel for helpful discussions. SSM was partially supported by NSF-FRG grant DMS-1160319 and a Loéve Fellowship. PS was partially supported by NSF grant DMS 1713082. LL was partially supported by NSF grants IIS 1663870, DMS 1654579 and a DARPA grant N-66001-17-1-4041. References [1] Supplement to “On clustering network-valued data”. 2017. [2] David J. Aldous. Representations for partially exchangeable arrays of random variables. Journal of Multivariate Analysis, 11(4):581 – 598, 1981. [3] S. et al Aliakbary. Learning an integrated distance metric for comparing structure of complex networks. Chaos, 25(2):177–214, 2015. [4] Arash A Amini, Aiyou Chen, Peter J Bickel, Elizaveta Levina, et al. Pseudo-likelihood methods for community detection in large sparse networks. The Annals of Statistics, 41(4):2097–2122, 2013. [5] Arash A Amini and Elizaveta Levina. On semidefinite relaxations for the block model. arXiv preprint arXiv:1406.5647, 2014. [6] Brian Ball, Brian Karrer, and MEJ Newman. Efficient and principled method for detecting communities in networks. Physical Review E, 84(3):036103, 2011. [7] Peter Bickel, David Choi, Xiangyu Chang, Hai Zhang, et al. Asymptotic normality of maximum likelihood and its variational approximation for stochastic blockmodels. The Annals of Statistics, 41(4):1922–1943, 2013. [8] Peter J. Bickel and Aiyou Chen. A nonparametric view of network models and newman girvan and other modularities. Proceedings of the National Academy of Sciences of the Unites States of America, 106(50):21068–21073, 2009. [9] Sourav Chatterjee. Matrix estimation by universal singular value thresholding. Ann. Statist., 43(1):177–214, 02 2015. [10] Hao Chen and Nancy Zhang. Graph-based change-point detection. Ann. Statist., 43(1):139–176, 02 2015. [11] David S Choi, Patrick J Wolfe, and Edoardo M Airoldi. Stochastic blockmodels with a growing number of classes. Biometrika, page asr053, 2012. [12] Paul Erdős and Alfréd Rényi. On random graphs i. Publicationes Mathematicae (Debrecen), 6:290–297, 1959 1959. [13] Chao Gao, Yu Lu, and Harrison H. Zhou. Rate-optimal graphon estimation. Ann. Statist., 43(6):2624–2652, 12 2015. [14] C. E. Ginestet, P. Balanchandran, S. Rosenberg, and E. D. Kolaczyk. Hypothesis Testing For Network Data in Functional Neuroimaging. ArXiv e-prints, July 2014. [15] Paul W Holland, Kathryn Blackmond Laskey, and Samuel Leinhardt. Stochastic blockmodels: First steps. Social networks, 5(2):109–137, 1983. [16] D.N. Hoover. Relations on probability spaces and arrays of random variables. Technical report, Institute of Advanced Study, Princeton., 1979. [17] Brian Karrer and M. E. J. Newman. Stochastic blockmodels and community structure in networks. Phys. Rev. E, 83:016107, Jan 2011. [18] Jing Lei, Alessandro Rinaldo, et al. Consistency of spectral clustering in stochastic block models. The Annals of Statistics, 43(1):215–237, 2015. 10 [19] Priya Mahadevan, Dmitri Krioukov, Kevin Fall, and Amin Vahdat. Systematic topology analysis and generation using degree correlations. SIGCOMM Comput. Commun. Rev., 36(4):135–146, August 2006. [20] Pierre-André G Maugis, Sofia C Olhede, and Patrick J Wolfe. Topology reveals universal features for network comparison. arXiv preprint arXiv:1705.05677, 2017. [21] M. E. J. Newman. Modularity and community structure in networks. Proceedings of the National Academy of Sciences, 103(23):8577–8582, 2006. [22] Mark E. Newman. Assortative mixing in networks. Phys. Rev. Lett., 89(20):208701, 2002. [23] M.E.J. Newman. The structure and function of complex networks. SIAM review, 45(2):167–256, 2003. [24] Sofia C. Olhede and Patrick J. Wolfe. Network histograms and universality of blockmodel approximation. Proceedings of the National Academy of Sciences of the Unites States of America, 111(41):14722–14727, 2014. [25] Karl Rohe, Sourav Chatterjee, and Bin Yu. Spectral clustering and the high-dimensional stochastic block model. Annals of Statistics, 39:1878–1915, 2011. [26] N. Shervashidze, SVN. Vishwanathan, TH. Petri, K. Mehlhorn, and KM. Borgwardt. Efficient graphlet kernels for large graph comparison. In JMLR Workshop and Conference Proceedings Volume 5: AISTATS 2009, pages 488–495, Cambridge, MA, USA, April 2009. Max-Planck-Gesellschaft, MIT Press. [27] S. V. N. Vishwanathan, Nicol N. Schraudolph, Risi Kondor, and Karsten M. Borgwardt. Graph kernels. J. Mach. Learn. Res., 11:1201–1242, August 2010. [28] P. J. Wolfe and S. C. Olhede. Nonparametric graphon estimation. ArXiv e-prints, September 2013. [29] Y. Zhang, E. Levina, and J. Zhu. Estimating network edge probabilities by neighborhood smoothing. ArXiv e-prints, September 2015. [30] Shi Zhou and Raul J. Mondragón. The rich club phenomenon in the internet topology. IEEE Communications Letters, 8(3):180–182, 2004. 11
2017
6
7,118
Aggressive Sampling for Multi-class to Binary Reduction with Applications to Text Classification Bikash Joshi Univ. Grenoble Alps, LIG Grenoble, France bikash.joshi@imag.fr Massih-Reza Amini Univ. Grenoble Alps, LIG Grenoble, France massih-reza.amini@imag.fr Ioannis Partalas Expedia EWE Geneva, Switzerland ipartalas@expedia.com Franck Iutzeler Univ. Grenoble Alps, LJK Grenoble, France franck.iutzeler@imag.fr Yury Maximov Los Alamos National Laboratory and Skolkovo IST, USA and Moscow, Russia yury@lanl.gov Abstract We address the problem of multi-class classification in the case where the number of classes is very large. We propose a double sampling strategy on top of a multi-class to binary reduction strategy, which transforms the original multi-class problem into a binary classification problem over pairs of examples. The aim of the sampling strategy is to overcome the curse of long-tailed class distributions exhibited in majority of large-scale multi-class classification problems and to reduce the number of pairs of examples in the expanded data. We show that this strategy does not alter the consistency of the empirical risk minimization principle defined over the double sample reduction. Experiments are carried out on DMOZ and Wikipedia collections with 10,000 to 100,000 classes where we show the efficiency of the proposed approach in terms of training and prediction time, memory consumption, and predictive performance with respect to state-of-the-art approaches. 1 Introduction Large-scale multi-class or extreme classification involves problems with extremely large number of classes as it appears in text repositories such as Wikipedia, Yahoo! Directory (www.dir.yahoo.com), or Directory Mozilla DMOZ (www.dmoz.org); and it has recently evolved as a popular branch of machine learning with many applications in tagging, recommendation and ranking. The most common and popular baseline in this case is the one-versus-all approach (OVA) [18] where one independent binary classifier is learned per class. Despite its simplicity, this approach suffers from two main limitations; first, it becomes computationally intractable when the number of classes grow large, affecting at the same time the prediction. Second, it suffers from the class imbalance problem by construction.Recently, two main approaches have been studied to cope with these limitations. The first one, broadly divided in tree-based and embedding-based methods, have been proposed with the aim of reducing the effective space of labels in order to control the complexity of the learning problem. Tree-based methods [4, 3, 6, 7, 9, 21, 5, 15] rely on binary tree structures where each leaf corresponds to a class and inference is performed by traversing the tree from top to bottom; a binary classifier being used at each node to determine the child node to develop. These methods have logarithmic time complexity with the drawback that it is a challenging task to find a balanced tree structure which can partition the class labels. Further, even though different heuristics have been developed to address the unbalanced problem, these methods suffer from the drawback that they have to make several decisions prior to reaching a final category, which leads to error propagation and 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. thus a decrease in accuracy. On the other hand, label embedding approaches [11, 5, 19] first project the label-matrix into a low-dimensional linear subspace and then use an OVA classifier. However, the low-rank assumption of the label-matrix is generally transgressed in the extreme multi-class classification setting, and these methods generally lead to high prediction error.The second type of approaches aim at reducing the original multi-class problem into a binary one by first expanding the original training set using a projection of pairs of observations and classes into a low dimensional dyadic space, and then learning a single classifier to separate between pairs constituted with examples and their true classes and pairs constituted with examples with other classes [1, 28, 16]. Although prediction in the new representation space is relatively fast, the construction of the dyadic training observations is generally time consuming and prevails over the training and prediction times. Contributions. In this paper, we propose a scalable multi-class classification method based on an aggressive double sampling of the dyadic output prediction problem. Instead of computing all possible dyadic examples, our proposed approach consists first in drawing a new training set of much smaller size from the original one by oversampling the most small size classes and by sub-sampling the few big size classes in order to avoid the curse of long-tailed class distributions common in the majority of large-scale multi-class classification problems [2]. The second goal is to reduce the number of constructed dyadic examples. Our reduction strategy brings inter-dependency between the pairs containing the same observation and its true class in the original training set. Thus, we derive new generalization bounds using local fractional Rademacher complexity showing that even with a shift in the original class distribution and also the inter-dependency between the pairs of example, the empirical risk minimization principle over the transformation of the sampled training set remains consistent. We validate our approach by conducting a series of experiments on subsets of DMOZ and the Wikipedia collections with up to 100,000 target categories. 2 A doubly-sampled multi-class to binary reduction strategy We address the problem of monolabel multi-class classification defined on joint space X × Y where X ⊆Rd is the input space and Y = {1, . . . , K} .= [K] the output space, made of K classes. Elements of X × Y are denoted as xy = (x, y). Furthermore, we assume the training set S = (xyi i )m i=1 is made of m i.i.d examples/class pairs distributed according to a fixed but unknown probability distribution D, and we consider a class of predictor functions G = {g : X × Y →R}. We define the instantaneous loss for predictor g ∈G on example xy as: e(g, xy) = 1 K −1 X y′∈Y\{y} 1g(xy)≤g(xy′), (1) where 1π is the indicator function equal to 1 if the predicate π is true and 0 otherwise. Compared to the classical multi-class error, e′(g, xy) = 1y̸=argmaxy′∈Y g(xy′), the loss of (1) estimates the average number of classes, given any input data, that get a greater scoring by g than the correct class. The loss (1) is hence a ranking criterion, and the multi-class SVM of [29] and AdaBoost.MR [24] optimize convex surrogate functions of this loss. It is also used in label ranking [12]. Our objective is to find a function g ∈G with a small expected risk R(g) = Exy∼D [e(g, xy)], by minimizing the empirical error defined as the average number of training examples xyi i ∈S which, in mean, are scored lower than xy′ i , for y′ ∈Y\{yi} : ˜Rm(g, S) = 1 m m X i=1 e(g, xyi i ) = 1 m(K −1) m X i=1 X y′∈Y\{yi} 1g(x yi i )−g(xy′ i )≤0. (2) 2.1 Binary reduction based on dyadic representations of examples and classes In this work, we consider prediction functions of the form g = f ◦φ, where φ : X × Y →Rp is a projection of the input and the output space into a joint feature space of dimension p; and f ∈F = {f : Rp →R} is a function that measures the adequacy between an observation x and a class y using their corresponding representation φ(xy). The projection function φ is applicationdependent and it can either be learned [28], or defined using some heuristics [27, 16]. 2 Further, consider the following dyadic transformation T(S) =  zj = φ(xk i ), φ(xyi i )  , ˜yj = −1  if k < yi zj = φ(xyi i ), φ(xk i )  , ˜yj = +1  elsewhere  j .=(i−1)(K−1)+k , (3) where j = (i −1)(K −1) + k with i ∈[m], k ∈[K −1]; that expands a K-class labeled set S of size m into a binary labeled set T(S) of size N = m(K −1) (e.g. Figure 1 over a toy problem). With the class of functions H = {h : Rp × Rp →R; (φ(xy), φ(xy′)) 7→f(φ(xy)) −f(φ(xy′)), f ∈F}, (4) the empirical loss (Eq. (2)) can be rewritten as : ˜RT (S)(h) = 1 N N X j=1 1˜yjh(zj)≤0. (5) Hence, the minimization of Eq. (5) over the transformation T(S) of a training set S S xy1 1 xy2 2 xy3 3 xy4 4 T (z1 = (φ(xy1 1 ), φ(xy2 1 )), +1) (z2 = (φ(xy1 1 ), φ(xy3 1 )), +1) (z3 = (φ(xy1 1 ), φ(xy4 1 )), +1) (z4 = (φ(xy1 2 ), φ(xy2 2 )), −1) (z5 = (φ(xy2 2 ), φ(xy3 2 )), +1) (z6 = (φ(xy2 2 ), φ(xy4 2 )), +1) (z7 = (φ(xy1 3 ), φ(xy3 3 )), −1) (z8 = (φ(xy2 3 ), φ(xy3 3 )), −1) (z9 = (φ(xy3 3 ), φ(xy4 3 )), +1) (z10 = (φ(xy1 4 ), φ(xy4 4 )), −1) (z11 = (φ(xy2 4 ), φ(xy4 4 )), −1) (z12 = (φ(xy3 4 ), φ(xy4 4 )), −1) Figure 1: A toy example depicting the transformation T (Eq. (3)) applied to a training set S of size m = 4 and K = 4. defines a binary classification over the pairs of dyadic examples. However, this binary problem takes as examples dependent random variables, as for each original example xy ∈S, the K −1 pairs in {(φ(xy), φ(xy′)); ˜y} ∈T(S) all depend on xy. In [16] this problem is studied by bounding the generalization error associated to (5) using the fractional Rademacher complexity proposed in [25]. In this work, we derive a new generalization bounds based on Local Rademacher Complexities introduced in [22] that implies second-order (i.e. variance) information inducing faster convergence rates (Theorem 1). Our analysis relies on the notion of graph covering introduced in [14] and defined as : Definition 1 (Exact proper fractional cover of G, [14]). Let G = (V, E) be a graph. C = {(Ck, ωk)}k∈[J], for some positive integer J, with Ck ⊆V and ωk ∈[0, 1] is an exact proper fractional cover of G, if: i) it is proper: ∀k, Ck is an independent set, i.e., there is no connections between vertices in Ck; ii) it is an exact fractional cover of G: ∀v ∈V, P k:v∈Ck ωk = 1. The weight W(C) of C is given by: W(C) .= P k∈[J] ωk and the minimum weight χ∗(G) = minC∈K(G) W(C) over the set K(G) of all exact proper fractional covers of G is the fractional chromatic number of G. From this statement, [14] extended Hoeffding’s inequality and proposed large deviation bounds for sums of dependent random variables which was the precursor of new generalisation bounds, including a Talagrand’s type inequality for empirical processes in the dependent case presented in [22]. Figure 2: The dependency graph G = {1, . . . , 12} corresponding to the toy problem of Figure 1, where dependent nodes are connected with vertices in blue double-line. The exact proper fractional cover C1, C2 and C3 is shown in dashed. The fractional chromatic number is in this case χ∗(G) = K −1 = 3. With the classes of functions G and H introduced previously, consider the parameterized family Hr which, for r > 0, is defined as: Hr = {h : h ∈H, V[h] .= Vz,˜y[1˜yh(z)] ≤r}, where V denotes the variance. The fractional Rademacher complexity introduced in [25] entails our analysis : RT (S)(H) .= 2 N Eξ X k∈[K−1] ωkECksup h∈H X α∈Ck zα∈T (S) ξαh(zα), with (ξi)N i=1 a sequence of independent Rademacher variables verifying P(ξn = 1) = P(ξn=−1) = 1 2. If other is not specified explicitly we assume below all ωk = 1. Our first result that bounds the generalization error of a function h ∈H; R(h) = ET (S)[ ˜RT (S)(h)], with respect to its empirical error ˜RT (S)(h) over a transformed training set, T(S), and the fractional Rademacher complexity, RT (S)(H), is stated below. 3 Theorem 1. Let S = (xyi i )m i=1 ∈(X × Y)m be a dataset of m examples drawn i.i.d. according to a probability distribution D over X × Y and T(S) = ((zi, ˜yi))N i=1 the transformed set obtained as in Eq. (3). Then for any 1 > δ > 0 and 0/1 loss ℓ: {−1, +1} × R →[0, 1], with probability at least (1 −δ) the following generalization bound holds for all h ∈Hr : R(h) ≤˜RT (S)(h) + RT (S)(ℓ◦Hr) + 5 2 q RT (S)(ℓ◦Hr) + rr 2  s log 1 δ m + 25 48 log 1 δ m . The proof is provided in the supplementary material, and it relies on the idea of splitting up the sum (5) into several parts, each part being a sum of independent variables. 2.2 Aggressive Double Sampling Even-though the previous multi-class to binary transformation T with a proper projection function φ allows to redefine the learning problem in a dyadic feature space of dimension p ≪d, the increased number of examples can lead to a large computational overhead. In order to cope with this problem, we propose a (π, κ)-double subsampling of T(S), which first aims to balance the presence of classes by constructing a new training set Sπ from S with probabilities π = (πk)K k=1. Algorithm: (π, κ)-DS Input: Labeled training set S = (xyi i )m i=1 initialization: Sπ ←∅; Tκ(Sπ) ←∅; for k = 1..K do Draw randomly a set Sπk of examples of class k from S with probability πk; Sπ ←Sπ ∪Sπk; forall xy ∈Sπ do Draw uniformly a set Yxy of κ classes from Y\{y} ▷κ ≪K; forall k ∈Yxy do if k < y then Tκ(Sπ) ←Tκ(Sπ) ∪ z = φ(xk), φ(xy)  , ˜y = −1  ; else Tκ(Sπ) ←Tκ(Sπ) ∪ z = φ(xy), φ(xk)  , ˜y = +1  ; return Tκ(Sπ) The idea here is to overcome the curse of long-tailed class distributions exhibited in majority of large-scale multiclass classification problems [2] by oversampling the most small size classes and by subsampling the few big size classes in S. The hyperparameters π are formally defined as ∀k, πk = P(xy ∈ Sπ|xy ∈S). In practice we set them inversely proportional to the size of each class in the original training set; ∀k, πk ∝1/µk where µk is the proportion of class k in S. The second aim is to reduce the number of dyadic examples controlled by the hyperparameter κ. The pseudo-code of this aggressive double sampling procedure, referred to as (π, κ)-DS, is depicted above and it is composed of two main steps. 1. For each class k ∈{1, . . . , K}, draw randomly a set Sπk of examples from S of that class with probability πk, and let Sπ = K [ k=1 Sπk; 2. For each example xy in Sπ, draw uniformly κ adversarial classes in Y\{y}. After this double sampling, we apply the transformation T defined as in Eq. (3), leading to a set Tκ(Sπ) of size κ|Sπ| ≪N. In Section 3, we will show that this procedure practically leads to dramatic improvements in terms of memory consumption, computational complexity, and a higher multi-class prediction accuracy when the number of classes is very large. The empirical loss over the transformation of the new subsampled training set Sπ of size M, outputted by the (π, κ)-DS algorithm is : ˜RTκ(Sπ)(h) = 1 κM X (˜yα,zα)∈Tκ(Sπ) 1˜yαh(zα)≤0 = 1 κM X xy∈Sπ X y′∈Yxy 1g(xy)−g(xy′)≤0, (6) which is essentially the same empirical risk as the one defined in Eq. (2) but taken with respect to the training set outputted by the (π, κ)-DS algorithm. Our main result is the following theorem which bounds the generalization error of a function h ∈H learned by minimizing ˜RTκ(Sπ). 4 Theorem 2. Let S = (xyi i )m i=1 ∈(X × Y)m be a training set of size m i.i.d. according to a probability distribution D over X × Y, and T(S) = ((zi, ˜yi))N i=1the transformed set obtained with the transformation function T defined as in Eq. (3). Let Sπ ⊆S, |Sπ| = M, be a training set outputted by the algorithm (π, κ)-DS and T(Sπ) ⊆T(S) its corresponding transformation. Then for any 1 > δ > 0 with probability at least (1 −δ) the following risk bound holds for all h ∈H : R(h) ≤α ˜RTκ(Sπ)(h) + αRTκ(Sπ)(ℓ◦H) + α s (K −1) log 2 δ 2Mκ + s 2α log 4K δ β(m −1) + 7β log 4K δ 3(m −1) . Furthermore, for all functions in the class Hr, we have the following generalization bound that holds with probability at least (1 −δ) : R(h) ≤α ˜RTκ(Sπ)(h) + αRTκ(Sπ)(ℓ◦Hr) + s 2α log 4K δ β(m −1) + 7β log 4K δ 3(m −1) + 5α 2 q RTκ(Sπ)(ℓ◦Hr) + rr 2  s (K −1) log 2 δ Mκ + 25α 48 log 2 δ M , where ℓ: {−1, +1} × R →[0, 1] 0/1 is an instantaneous loss, and α = maxy: 1≤y≤K ηy/πy, β = maxy: 1≤y≤K 1/πy and ηy > 0 is the proportion of class y in S. The proof is provided in the supplementary material. This theorem hence paves the way for the consistency of the empirical risk minimization principle [26, Th. 2.1, p. 38] defined over the double sample reduction strategy we propose. 2.3 Prediction with Candidate Selection The prediction is carried out in the dyadic feature space, by first considering the pairs constituted by a test observation and all the classes, and then choosing the class that leads to the highest score by the learned classifier. Algorithm: Prediction with Candidate Selection Algorithm Input: Unlabeled test set T ; Learned function f ∗: Rp →R; initialization: Ω←∅; forall x ∈T do Select Yx ⊆Y candidate set of q nearest-centroid classes; Ω←Ω∪argmaxk∈Yx f ∗(φ(xk)) ; return predicted classes Ω In the large scale scenario, computing the feature representations for all classes may require a huge amount of time. To overcome this problem we sample over classes by choosing just those that are the nearest to a test example, based on its distance with class centroids. Here we propose to consider class centroids as the average of vectors within that class. Note that class centroids are computed once in the preliminary projection of training examples and classes in the dyadic feature space and thus represent no additional computation at this stage. The algorithm above presents the pseudocode of this candidate based selection strategy 1. 3 Experiments In this section, we provide an empirical evaluation of the proposed reduction approach with the (π, κ)DS sampling strategy for large-scale multi-class classification of document collections. First, we present the mapping φ : X × Y →Rp. Then, we provide a statistical and computational comparison of our method with state-of-the-art large-scale approaches on popular datasets. 3.1 a Joint example/class representation for text classification The particularity of text classification is that documents are represented in a vector space induced by the vocabulary of the corresponding collection [23]. Hence each class can be considered as a megadocument, constituted by the concatenation of all of the documents in the training set belonging to it, 1The number of classes pre-selected can be tuned to offer a prediction time/accuracy tradeoff if the prediction time is more critical. 5 Features in the joint example/class representation representation φ(xy). 1. X t∈y∩x log(1 + yt) 2. X t∈y∩x log  1 + lS Ft  3. X t∈y∩x It 4. X t∈y∩x yt |y|.It 5. X t∈y∩x log  1 + yt |y|  6. X t∈y∩x log  1 + yt |y|.It  7. X t∈y∩x log  1 + yt |y|. lS Ft  8. X t∈y∩x 1 9. d(xy, centroid(y)) 10. BM25 = P t∈y∩x It. 2×yt yt+(0.25+0.75·len(y)/avg(len(y)) Table 1: Joint example/class representation for text classification, where t ∈y ∩x are terms that are present in both the class y’s mega-document and document x. V represents the set of distinct terms within S, and xt is the frequency of term t in x, yt = P x∈y xt, |y| = P t∈V yt, Ft = P x∈S xt, lS = P t∈V St. Finally, It is the inverse document frequency of term t, len(y) is number of terms of documents in class y, and avg(len(y)) is the average of document lengths for all the classes. and simple feature mapping of examples and classes can be defined over their common words. Here we used p = 10 features inspired from learning to rank [17] by resembling a class and a document to respectively a document and a query (Table 1). All features except feature 9, that is the distance of an example x to the centroid of all examples of a particular class y, are classical. In addition to its predictive interest, the latter is also used in prediction for performing candidate preselection. Note that for other large-scale multi-class classification applications like recommendation with extremely large number of offer categories or image classification, a same kind of mapping can either be learned or defined using their characteristics [27, 28]. 3.2 Experimental Setup Datasets. We evaluate the proposed method using popular datasets from the Large Scale Hierarchical Text Classification challenge (LSHTC) 1 and 2 [20]. These datasets are provided in a pre-processed format using stop-word removal and stemming. Various characteristics of these datesets including the statistics of train, test and heldout are listed in Table 2. Since, the datasets used in LSHTC2 challenge were in multi-label format, we converted them to multi-class format by replicating the instances belonging to different class labels. Also, for the largest dataset (WIKI-large) used in LSHTC2 challenge, we used samples with 50,000 and 100,000 classes. The smaller dataset of LSHTC2 challenge is named as WIKI-Small, whereas the two 50K and 100K samples of large dataset are named as WIKI-50K and WIKI-100K in our result section. Datasets # of classes, K Train Size Test Size Heldout Size Dimension, d LSHTC1 12294 126871 31718 5000 409774 DMOZ 27875 381149 95288 34506 594158 WIKI-Small 36504 796617 199155 5000 380078 WIKI-50K 50000 1102754 276939 5000 951558 WIKI-100K 100000 2195530 550133 5000 1271710 Table 2: Characteristics of the datasets used in our experiments Baselines. We compare the proposed approach,2 denoted as the sampling strategy by (π, κ)-DS, with popular baselines listed below: • OVA: LibLinear [10] implementation of one-vs-all SVM. • M-SVM: LibLinear implementation of multi-class SVM proposed in [8]. • RecallTree [9]: A recent tree based multi-class classifier implemented in Vowpal Wabbit. 2Source code and datasets can be found in the following repository https://github.com/bikash617/AggressiveSampling-for-Multi-class-to-BinaryReduction 6 Data OVA M-SVM RecallTree FastXML PfastReXML PD-Sparse (π, κ)-DS LSHTC1 train time 23056s 48313s 701s 8564s 3912s 5105s 321s m = 163589 predict time 328s 314s 21s 339s 164s 67s 544s d = 409774 total memory 40.3G 40.3G 122M 470M 471M 10.5G 2G K = 12294 Accuracy 44.1% 36.4% 18.1% 39.3% 39.8% 45.7% 37.4% MaF1 27.4% 18.8% 3.8% 21.3% 22.4% 27.7% 26.5% DMOZ train time 180361s 212356s 2212s 14334s 15492s 63286s 1060s m = 510943 predict time 2797s 3981s 47s 424s 505s 482s 2122s d = 594158 total memory 131.9G 131.9G 256M 1339M 1242M 28.1G 5.3G K = 27875 Accuracy 37.7% 32.2% 16.9% 33.4% 33.7% 40.8% 27.8% MaF1 22.2% 14.3% 1.75% 15.1% 15.9% 22.7% 20.5% WIKI-Small train time 212438s >4d 1610s 10646s 21702s 16309s 1290s m = 1000772 predict time 2270s NA 24s 453s 871s 382s 2577s d = 380078 total memory 109.1G 109.1G 178M 949M 947M 12.4G 3.6G K = 36504 Accuracy 15.6% NA 7.9% 11.1% 12.1% 15.6% 21.5% MaF1 8.8 % NA <1% 4.6% 5.63% 9.91% 13.3% WIKI-50K train time NA NA 4188s 30459s 48739s 41091s 3723s m = 1384693 predict time NA NA 45s 1110s 2461s 790s 4083s d = 951558 total memory 330G 330G 226M 1327M 1781M 35G 5G K = 50000 Accuracy NA NA 17.9% 25.8% 27.3% 33.8% 33.4% MaF1 NA NA 5.5% 14.6% 16.3% 23.4% 24.5% WIKI-100K train time NA NA 8593s 42359s 73371s 155633s 9264s m = 2750663 predict time NA NA 90s 1687s 3210s 3121s 20324s d = 1271710 total memory 1017G 1017G 370M 2622M 2834M 40.3G 9.8G K = 100000 Accuracy NA NA 8.4% 15% 16.1% 22.2% 25% MaF1 NA NA 1.4% 8% 9% 15.1% 17.8% Table 3: Comparison of the result of various baselines in terms of time, memory, accuracy, and macro F1-measure • FastXML [21]: An extreme multi-class classification method which performs partitioning in the feature space for faster prediction. • PfastReXML [13]: Tree ensemble based extreme classifier for multi-class and multilabel problems. • PD-Sparse [30]: A recent approach which uses multi-class loss with ℓ1-regularization. Referring to the work [30], we did not consider other recent methods SLEEC [5] and LEML [31] in our experiments, since they have been shown to be consistently outperformed by the above mentioned state-of-the-art approaches. Platform and Parameters. In all of our experiments, we used a machine with an Intel Xeon 2.60GHz processor with 256 GB of RAM. Each of these methods require tuning of various hyper-parameters that influence their performance. For each methods, we tuned the hyperparameters over a heldout set and used the combination which gave best predictive performance. The list of used hyperparameters for the results we obtained are reported in the supplementary material (Appendix B). Evaluation Measures. Different approaches are evaluated over the test sets using accuracy and the macro F1 measure (MaF1), which is the harmonic average of macro precision and macro recall; higher MaF1thus corresponds to better performance. As opposed to accuracy, macro F1 measure is not affected by the class imbalance problem inherent to multi-class classification, and is commonly used as a robust measure for comparing predictive performance of classification methods. 4 Results The parameters of the datasets along with the results for compared methods are shown in Table 3. The results are provided in terms of train and predict times, total memory usage, and predictive performance measured with accuracy and macro F1-measure (MaF1). For better visualization and comparison, we plot the same results as bar plots in Fig. 3 keeping only the best five methods while comparing the total runtime and memory usage. First, we observe that the tree based approaches (FastXML, PfastReXML and RecallTree) have worse predictive performance compared to the other methods. This is due to the fact that the prediction error made at the top-level of the tree cannot be corrected at lower levels, also known as cascading effect. Even though they have lower runtime and memory usage, they suffer from this side effect. For large scale collections (WIKI-Small, WIKI-50K and WIKI-100K), the solvers with competitive predictive performance are OVA, M-SVM, PD-Sparse and (π, κ)-DS. However, standard OVA and 7 0 45 90 135 180 Time (min.) LSHTC1 0 300 600 900 1200 DMOZ 0 150 300 450 WIKI-Small 0 300 600 900 1200 WIKI-50K 0 1000 2000 3000 WIKI-100K 0 4 8 12 Total Memory (GB) 0 10 20 30 0.0 2.5 5.0 7.5 10.0 0 12 24 36 0 14 28 42 0 15 30 45 Accuracy (%) 0 15 30 45 0 15 30 45 0 15 30 45 0 15 30 45 0 10 20 30 MaF (%) 0 10 20 30 0 10 20 30 0 10 20 30 0 10 20 30 RecallTree FastXML PfastReXML PD-Sparse Proposed (π, κ)-DS Figure 3: Comparisons in Total (Train and Test) Time (min.), Total Memory usage (GB), and MaF1 of the five best performing methods on LSHTC1, DMOZ, WIKI-Small, WIKI-50K and WIKI-100K. M-SVM have a complexity that grows linearly with K thus the total runtime and memory usage explodes on those datasets, making them impossible. For instance, on Wiki large dataset sample of 100K classes, the memory consumption of both approaches exceeds the Terabyte and they take several days to complete the training. Furthermore, on this data set and the second largest Wikipedia collection (WIKI-50K and WIKI-100K) the proposed approach is highly competitive in terms of Time, Total Memory and both performance measures comparatively to all the other approaches. These results suggest that the method least affected by long-tailed class distributions is (π, κ)-DS, mainly because of two reasons: first, the sampling tends to make the training set balanced and second, the reduced binary dataset contains similar number of positive and negative examples. Hence, for the proposed approach, there is an improvement in both accuracy and MaF1 measures. The recent PD-Sparse method also enjoys a competitive predictive performance but it requires to store intermediary weight vectors during optimization which prevents it from scaling well. The PD-Sparse solver provides an option for hashing leading to fewer memory usage during training which we used in the experiments; however, the memory usage is still significantly high for large datasets and at the same time this option slows down the training process considerably. In overall, among the methods with competitive predictive performance, (π, κ)-DS seems to present the best runtime and memory usage; its runtime is even competitive with most of tree-based methods, leading it to provide the best compromise among the compared methods over the three time, memory and performance measures. 5 Conclusion We presented a new method for reducing a multiclass classification problem to binary classification. We employ similarity based feature representation for class and examples and a double sampling stochastic scheme for the reduction process. Even-though the sampling scheme shifts the distribution of classes and that the reduction of the original problem to a binary classification problem brings inter-dependency between the dyadic examples; we provide generalization error bounds suggesting that the Empirical Risk Minimization principle over the transformation of the sampled training set still remains consistent. Furthermore, the characteristics of the algorithm contribute for its excellent performance in terms of memory usage and total runtime and make the proposed approach highly suitable for large class scenario. Acknowledgments This work has been partially supported by the LabEx PERSYVAL-Lab (ANR-11-LABX-0025-01) funded by the French program Investissement d’avenir, and by the U.S. Department of Energy’s Office of Electricity as part of the DOE Grid Modernization Initiative. 8 References [1] Naoki Abe, Bianca Zadrozny, and John Langford. An iterative method for multi-class cost-sensitive learning. In Proceedings of the 10th ACM SIGKDD, KDD ’04, pages 3–11, 2004. [2] Rohit Babbar, Cornelia Metzig, Ioannis Partalas, Eric Gaussier, and Massih R. Amini. On power law distributions in large-scale taxonomies. SIGKDD Explorations, 16(1), 2014. [3] Samy Bengio, Jason Weston, and David Grangier. Label embedding trees for large multi-class tasks. In Advances in Neural Information Processing Systems, pages 163–171, 2010. [4] Alina Beygelzimer, John Langford, and Pradeep Ravikumar. Error-correcting tournaments. In Proceedings of the 20th International Conference on Algorithmic Learning Theory, ALT’09, pages 247–262, 2009. [5] Kush Bhatia, Himanshu Jain, Purushottam Kar, Manik Varma, and Prateek Jain. Sparse local embeddings for extreme multi-label classification. In Advances in Neural Information Processing Systems, pages 730–738, 2015. [6] Anna Choromanska, Alekh Agarwal, and John Langford. Extreme multi class classification. In NIPS Workshop: eXtreme Classification, submitted, 2013. [7] Anna Choromanska and John Langford. Logarithmic time online multiclass prediction. CoRR, abs/1406.1822, 2014. [8] Koby Crammer and Yoram Singer. On the algorithmic implementation of multiclass kernel-based vector machines. J. Mach. Learn. Res., 2:265–292, 2002. [9] Hal Daume III, Nikos Karampatziakis, John Langford, and Paul Mineiro. Logarithmic time one-againstsome. arXiv preprint arXiv:1606.04988, 2016. [10] Rong-En Fan, Kai-Wei Chang, Cho-Jui Hsieh, Xiang-Rui Wang, and Chih-Jen Lin. Liblinear: A library for large linear classification. J. Mach. Learn. Res., 9:1871–1874, 2008. [11] Daniel J Hsu, Sham M Kakade, John Langford, and Tong Zhang. Multi-label prediction via compressed sensing. In Advances in Neural Information Processing Systems 22 (NIPS), pages 772–780, 2009. [12] Eyke Hüllermeier and Johannes Fürnkranz. On minimizing the position error in label ranking. In Machine Learning: ECML 2007, pages 583–590. Springer, 2007. [13] Himanshu Jain, Yashoteja Prabhu, and Manik Varma. Extreme multi-label loss functions for recommendation, tagging, ranking & other missing label applications. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 935–944. ACM, 2016. [14] S. Janson. Large deviations for sums of partly dependent random variables. Random Structures and Algorithms, 24(3):234–248, 2004. [15] Kalina Jasinska and Nikos Karampatziakis. Log-time and log-space extreme classification. arXiv preprint arXiv:1611.01964, 2016. [16] Bikash Joshi, Massih-Reza Amini, Ioannis Partalas, Liva Ralaivola, Nicolas Usunier, and Éric Gaussier. On binary reduction of large-scale multiclass classification problems. In Advances in Intelligent Data Analysis XIV - 14th International Symposium, IDA 2015, pages 132–144, 2015. [17] Tie-Yan Liu, Jun Xu, Tao Qin, Wenying Xiong, and Hang Li. Letor: Benchmark dataset for research on learning to rank for information retrieval. In Proceedings of SIGIR 2007 workshop on learning to rank for information retrieval, pages 3–10, 2007. [18] Ana Carolina Lorena, André C. Carvalho, and João M. Gama. A review on the combination of binary classifiers in multiclass problems. Artif. Intell. Rev., 30(1-4):19–37, 2008. [19] Paul Mineiro and Nikos Karampatziakis. Fast label embeddings via randomized linear algebra. In Machine Learning and Knowledge Discovery in Databases - European Conference, ECML PKDD 2015, Porto, Portugal, September 7-11, 2015, Proceedings, Part I, pages 37–51, 2015. [20] I. Partalas, A. Kosmopoulos, N. Baskiotis, T. Artieres, G. Paliouras, E. Gaussier, I. Androutsopoulos, M.-R. Amini, and P. Galinari. LSHTC: A Benchmark for Large-Scale Text Classification. ArXiv e-prints, March 2015. [21] Yashoteja Prabhu and Manik Varma. Fastxml: A fast, accurate and stable tree-classifier for extreme multi-label learning. In Proceedings of the 20th ACM SIGKDD international conference on Knowledge discovery and data mining, pages 263–272. ACM, 2014. [22] Liva Ralaivola and Massih-Reza Amini. Entropy-based concentration inequalities for dependent variables. In Proceedings of the 32nd International Conference on Machine Learning, ICML 2015, Lille, France, 6-11 July 2015, pages 2436–2444, 2015. [23] G. Salton, A. Wong, and C. S. Yang. A vector space model for automatic indexing. Commun. ACM, 18(11):613–620, November 1975. 9 [24] Robert E Schapire and Yoram Singer. Improved boosting algorithms using confidence-rated predictions. Machine learning, 37(3):297–336, 1999. [25] Nicolas Usunier, Massih-Reza Amini, and Patrick Gallinari. Generalization error bounds for classifiers trained with interdependent data. In Advances in Neural Information Processing Systems 18 (NIPS), pages 1369–1376, 2005. [26] Vladimir N. Vapnik. Statistical Learning Theory. Wiley-Interscience, 1998. [27] Maksims Volkovs and Richard S. Zemel. Collaborative ranking with 17 parameters. In Advances in Neural Information Processing Systems 25, pages 2294–2302, 2012. [28] Jason Weston, Samy Bengio, and Nicolas Usunier. Wsabie: Scaling up to large vocabulary image annotation. In Proceedings of the International Joint Conference on Artificial Intelligence, IJCAI, 2011. [29] Jason Weston and Chris Watkins. Multi-class support vector machines. Technical report, Technical Report CSD-TR-98-04, Department of Computer Science, Royal Holloway, University of London, 1998. [30] Ian EH Yen, Xiangru Huang, Kai Zhong, Pradeep Ravikumar, and Inderjit S Dhillon. Pd-sparse: A primal and dual sparse approach to extreme multiclass and multilabel classification. In Proceedings of the 33nd International Conference on Machine Learning, 2016. [31] Hsiang-Fu Yu, Prateek Jain, Purushottam Kar, and Inderjit Dhillon. Large-scale multi-label learning with missing labels. In International Conference on Machine Learning, pages 593–601, 2014. 10
2017
60
7,119
Multitask Spectral Learning of Weighted Automata Guillaume Rabusseau ∗ McGill University Borja Balle † Amazon Research Cambridge Joelle Pineau‡ McGill University Abstract We consider the problem of estimating multiple related functions computed by weighted automata (WFA). We first present a natural notion of relatedness between WFAs by considering to which extent several WFAs can share a common underlying representation. We then introduce the novel model of vector-valued WFA which conveniently helps us formalize this notion of relatedness. Finally, we propose a spectral learning algorithm for vector-valued WFAs to tackle the multitask learning problem. By jointly learning multiple tasks in the form of a vector-valued WFA, our algorithm enforces the discovery of a representation space shared between tasks. The benefits of the proposed multitask approach are theoretically motivated and showcased through experiments on both synthetic and real world datasets. 1 Introduction One common task in machine learning consists in estimating an unknown function f : X →Y from a training sample of input-output data {(xi, yi)}N i=1 where each yi ≃f(xi) is a (possibly noisy) estimate of f(xi). In multitask learning, the learner is given several such learning tasks f1, · · · , fm. It has been shown, both experimentally and theoretically, that learning related tasks simultaneously can lead to better performances relative to learning each task independently (see e.g. [1, 7], and references therein). Multitask learning has proven particularly useful when few data points are available for each task, or when it is difficult or costly to collect data for a target task while much data is available for related tasks (see e.g. [28] for an example in healthcare). In this paper, we propose a multitask learning algorithm for the case where the input space X consists of sequence data. Many tasks in natural language processing, computational biology, or reinforcement learning, rely on estimating functions mapping sequences of observations to real numbers: e.g. inferring probability distributions over sentences in language modeling or learning the dynamics of a model of the environment in reinforcement learning. In this case, the function f to infer from training data is defined over the set Σ∗of strings built on a finite alphabet Σ. Weighted finite automata (WFA) are finite state machines that allow one to succinctly represent such functions. In particular, WFAs can compute any probability distribution defined by a hidden Markov model (HMM) [13] and can model the transition and observation behavior of partially observable Markov decision processes [26]. A recent line of work has led to the development of spectral methods for learning HMMs [17], WFAs [2, 4] and related models, offering an alternative to EM based algorithms with the benefits of being computationally efficient and providing consistent estimators. Spectral learning algorithms have led to competitive results in the fields of natural language processing [12, 3] and robotics [8]. We consider the problem of multitask learning for WFAs. As a motivational example, consider a natural language modeling task where one needs to make predictions in different contexts (e.g. online chat vs. newspaper articles) and has access to datasets in each of them; it is natural to expect that basic grammar is shared across the datasets and that one could benefit from simultaneously ∗guillaume.rabusseau@mail.mcgill.ca †pigem@amazon.co.uk ‡jpineau@cs.mcgill.ca 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. learning these tasks. The notion of relatedness between tasks can be expressed in different ways; one common assumption in multitask learning is that the multiple tasks share a common underlying representation [6, 11]. In this paper, we present a natural notion of shared representation between functions defined over strings and we propose a learning algorithm that encourages the discovery of this shared representation. Intuitively, our notion of relatedness captures to which extent several functions can be computed by WFAs sharing a joint forward feature map. In order to formalize this notion of relatedness, we introduce the novel model of vector-valued WFA (vv-WFA) which generalizes WFAs to vector-valued functions and offer a natural framework to formalize the multitask learning problem. Given m tasks f1, · · · , fm : Σ∗→R, we consider the function ⃗f = [f1, · · · , fm] : Σ∗→Rm whose output for a given input string x is the m-dimensional vector having entries fi(x) for i = 1, · · · , m. We show that the notion of minimal vv-WFA computing ⃗f exactly captures our notion of relatedness between tasks and we prove that the dimension of such a minimal representation is equal to the rank of a flattening of the Hankel tensor of ⃗f (Theorem 3). Leveraging this result, we design a spectral learning algorithm for vv-WFAs which constitutes a sound multitask learning algorithm for WFAs: by learning ⃗f in the form of a vv-WFA, rather than independently learning a WFA for each task fi, we implicitly enforce the discovery of a joint feature space shared among all tasks. After giving a theoretical insight on the benefits of this multitask approach (by leveraging a recent result on asymmetric bounds for singular subspace estimation [9]), we conclude by showcasing these benefits with experiments on both synthetic and real world data. Related work. Multitask learning for sequence data has previously received limited attention. In [16], mixtures of Markov chains are used to model dynamic user profiles. Tackling the multitask problem with nonparametric Bayesian methods is investigated in [15] to model related time series with Beta processes and in [23] to discover relationships between related datasets using nested Dirichlet process and infinite HMMs. Extending recurrent neural networks to the multitask setting has also recently received some interest (see e.g. [21, 22]). To the best of our knowledge, this paper constitutes the first attempt to tackle the multitask problem for the class of functions computed by general WFAs. 2 Preliminaries We first present notions on weighted automata, spectral learning of weighted automata and tensors. We start by introducing some notation. We denote by Σ∗the set of strings on a finite alphabet Σ. The empty string is denoted by λ and the length of a string x by |x|. For any integer k we let [k] = {1, 2, · · · , k}. We use lower case bold letters for vectors (e.g. v ∈Rd1), upper case bold letters for matrices (e.g. M ∈Rd1×d2) and bold calligraphic letters for higher order tensors (e.g. T ∈Rd1×d2×d3). The ith row (resp. column) of a matrix M will be denoted by Mi,: (resp. M:,i). This notation is extended to slices of a tensor in the straightforward way. Given a matrix M ∈Rd1×d2, we denote by M† its Moore-Penrose pseudo-inverse and by vec(M) ∈Rd1d2 its vectorization. Weighted finite automaton. A weighted finite automaton (WFA) with n states is a tuple A = (α, {Aσ}σ∈Σ, ω) where α, ω ∈Rn are the initial and final weights vectors respectively, and Aσ ∈ Rn×n is the transition matrix for each symbol σ ∈Σ. A WFA computes a function fA : Σ∗→R defined for each word x = x1x2 · · · xk ∈Σ∗by fA(x) = α⊤Ax1Ax2 · · · Axkω. By letting Ax = Ax1Ax2 · · · Axk for any word x = x1x2 · · · xk ∈Σ∗we will often use the shorter notation fA(x) = α⊤Axω. A WFA A with n states is minimal if its number of states is minimal, i.e. any WFA B such that fA = fB has at least n states. A function f : Σ∗→R is recognizable if it can be computed by a WFA. In this case the rank of f is the number of states of a minimal WFA computing f, if f is not recognizable we let rank(f) = ∞. Hankel matrix. The Hankel matrix Hf ∈RΣ∗×Σ∗associated with a function f : Σ∗→R is the infinite matrix with entries (Hf)u,v = f(uv) for u, v ∈Σ∗. The spectral learning algorithm for WFAs relies on the following fundamental relation between the rank of f and the rank of Hf. Theorem 1. [10, 14] For any function f : Σ∗→R, rank(f) = rank(Hf). Spectral learning. Showing that the rank of the Hankel matrix is upper bounded by the rank of f is easy: given a WFA A = (α, {Aσ}σ∈Σ, ω) with n states, we have the rank n factorization Hf = PS where the matrices P ∈RΣ∗×n and S ∈Rn×Σ∗are defined by Pu,: = α⊤Au and S:,v = Avω for 2 all u, v ∈Σ∗. The converse is more tedious to show but its proof is constructive, in the sense that it allows one to build a WFA computing f from any rank n factorization of Hf. This construction is the cornerstone of the spectral learning algorithm and is given in the following corollary. Corollary 2. [4, Lemma 4.1] Let f : Σ∗→R be a recognizable function with rank n, let H ∈ RΣ∗×Σ∗be its Hankel matrix, and for each σ ∈Σ let Hσ ∈RΣ∗×Σ∗be defined by Hσ u,v = f(uσv) for all u, v ∈Σ∗. Then, for any P ∈RΣ∗×n, S ∈Rn×Σ∗such that H = PS, the WFA A = (α, {Aσ}σ∈Σ, ω) where α⊤= Pλ,:, ω = S:,λ, and Aσ = P†HσS† is a minimal WFA for f. In practice, finite sub-blocks of the Hankel matrices are used. Given finite sets of prefixes and suffixes P, S ⊂Σ∗, let HP,S, {Hσ P,S}σ∈Σ be the finite sub-blocks of H whose rows (resp. columns) are indexed by prefixes in P (resp. suffixes in S). One can show that if P and S are such that λ ∈P ∩S and rank(H) = rank(HP,S), then the previous corollary still holds, i.e. a minimal WFA computing f can be recovered from any rank n factorization of HP,S. The spectral method thus consists in estimating the matrices HP,S, Hσ P,S from training data (using e.g. empirical frequencies if f is stochastic), finding a low-rank factorization of HP,S (using e.g. SVD) and constructing a WFA approximating f using Corollary 2. Tensors. We make a sporadic use of tensors in this paper, we thus introduce the few necessary definitions and notations; more details can be found in [18]. A 3rd order tensor T ∈Rd1×d2×d3 can be seen as a multidimensional array (T i1,i2,i3 : i1 ∈[d1], i2 ∈[d2], , i3 ∈[d3]). The mode-n fibers of T are the vectors obtained by fixing all indices except the nth one, e.g. T :,i2,i3 ∈Rd1. The nth mode flattening of T is the matrix having the mode-n fibers of T for columns and is denoted by e.g. T (1) ∈Rd1×d2d3. The mode-1 matrix product of a tensor T ∈Rd1×d2×d3 and a matrix X ∈Rm×d1 is a tensor of size m × d2 × d3 denoted by T ×1 X and defined by the relation Y = T ×1 X ⇔Y(1) = XT (1); the mode-n product for n = 2, 3 is defined similarly. 3 Vector-Valued WFAs for Multitask Learning In this section, we present a notion of relatedness between WFAs that we formalize by introducing the novel model of vector-valued weighted automaton. We then propose a multitask learning algorithm for WFAs by designing a spectral learning algorithm for vector-valued WFAs. A notion of relatedness between WFAs. The basic idea behind our approach emerges from interpreting the computation of a WFA as a linear model in some feature space. Indeed, the computation of a WFA A = (α, {Aσ}σ∈Σ, ω) with n states on a word x ∈Σ∗can be seen as first mapping x to an n-dimensional feature vector through a compositional feature map φ : Σ∗→Rn, and then applying a linear form in the feature space to obtain the final value fA(x) = ⟨φ(x), ω⟩. The feature map is defined by φ(x)⊤= α⊤Ax for all x ∈Σ∗and it is compositional in the sense that for any x ∈Σ∗ and any σ ∈Σ we have φ(xσ)⊤= φ(x)⊤Aσ. We will say that such a feature map is minimal if the linear space V ⊂Rn spanned by the vectors {φ(x)}x∈Σ∗is of dimension n. Theorem 1 implies that the dimension of V is actually equal to the rank of fA, showing that the notion of minimal feature map naturally coincides with the notion of minimal WFA. A notion of relatedness between WFAs naturally arises by considering to which extent two (or more) WFAs can share a joint feature map φ. More precisely, consider two recognizable functions f1, f2 : Σ∗→R of rank n1 and n2 respectively, with corresponding feature maps φ1 : Σ∗→Rn1 and φ2 : Σ∗→Rn2. Then, a joint feature map for f1 and f2 always exists and is obtained by considering the direct sum φ1 ⊕φ2 : Σ∗→Rn1+n2 that simply concatenates the feature vectors φ1(x) and φ2(x) for any x ∈Σ∗. However, this feature map may not be minimal, i.e. there may exist another joint feature map of dimension n < n1 + n2. Intuitively, the smaller this minimal dimension n is the more related the two tasks are, with the two extremes being on the one hand n = n1 + n2 where the two tasks are independent, and on the other hand e.g. n = n1 where one of the (minimal) feature maps φ1, φ2 is sufficient to predict both tasks. Vector-valued WFA. We now introduce a computational model for vector-valued functions on strings that will help formalize this notion of relatedness between WFAs. 3 Definition 1. A d-dimensional vector-valued weighted finite automaton (vv-WFA) with n states is a tuple A = (α, {Aσ}σ∈Σ, Ω) where α ∈Rn is the initial weights vector, Ω∈Rn×d is the matrix of final weights, and Aσ ∈Rn×n is the transition matrix for each symbol σ ∈Σ. A vv-WFA computes a function ⃗fA : Σ∗→Rd defined by ⃗fA(x) = α⊤Ax1Ax2 · · · AxkΩ for each word x = x1x2 · · · xk ∈Σ∗. We extend the notions of recognizability, minimality and rank of a WFA in the straightforward way: a function ⃗f : Σ∗→Rd is recognizable if it can be computed by a vv-WFA, a vv-WFA is minimal if its number of states is minimal, and the rank of ⃗f is the number of states of a minimal vv-WFA computing ⃗f. A d-dimensional vv-WFA can be seen as a collection of d WFAs that all share their initial vectors and transition matrices but have different final vectors. Alternatively, one could take a dual approach and define vv-WFAs as a collection of WFAs sharing transitions and final vectors4. vv-WFAs and relatedness between WFAs. We now show how the vv-WFA model naturally captures the notion of relatedness presented above. Recall that this notion intends to capture to which extent two recognizable functions f1, f2 : Σ∗→R, of ranks n1 and n2 respectively, can share a joint forward feature map φ : Σ∗→Rn satisfying f1(x) = ⟨φ(x), ω1⟩and f2(x) = ⟨φ(x), ω2⟩for all x ∈Σ∗, for some ω1, ω2 ∈Rn. Consider the vector-valued function ⃗f = [f1, f2] : Σ∗→R2 defined by ⃗f(x) = [f1(x), f2(x)] for all x ∈Σ∗. It can easily be seen that the minimal dimension of a shared forward feature map between f1 and f2 is exactly the rank of ⃗f, i.e. the number of states of a minimal vv-WFA computing ⃗f. This notion of relatedness can be generalized to more than two functions by considering ⃗f = [f1, · · · , fm] for m different recognizable functions f1, · · · , fm of respective ranks n1, · · · , nm. In this setting, it is easy to check that the rank of ⃗f lies between max(n1, · · · , nm) and n1 + · · · + nm; smaller values of this rank leads to a smaller dimension of the minimal forward feature map and thus, intuitively, to more closely related tasks. We now formalize this measure of relatedness between recognizable functions. Definition 2. Given m recognizable functions f1, · · · , fm, we define their relatedness measure by τ(f1, · · · , fm) = 1 −(rank(⃗f) −maxi rank(fi))/ P i rank(fi) where ⃗f = [f1, · · · , fm]. One can check that this measure of relatedness takes its values in (0, 1]. We say that tasks are maximally related when their relatedness measure is 1 and independent when it is minimal. Observe that the rank R of a vv-WFA does not give enough information to determine whether one set of tasks is more related than another: the degree of relatedness depends on the relation between R and the ranks of each individual task. The relatedness parameter τ circumvents this issue by measuring where R stands between the maximum rank over the different tasks and the sum of their ranks. Example 1. Let Σ = {a, b, c} and let |x|σ denotes the number of occurrences of σ in x for any σ ∈Σ. Consider the functions defined by f1(x) = 0.5|x|a + 0.5|x|b, f2(x) = 0.3|x|b −0.6|x|c and f3(x) = |x|c for all x ∈Σ∗. It is easy to check that rank(f1) = rank(f2) = 4 and rank(f3) = 2. Moreover, f2 and f3 are maximally related (indeed rank([f2, f3]) = 4 = rank(f2) thus τ(f2, f3) = 1), f1 and f3 are independent (indeed τ(f1, f3) = 2/3 is minimal since rank([f1, f3]) = 6 = rank(f1) + rank(f3)), and f1 and f2 are related but not maximally related (since 4 = rank(f1) = rank(f2) < rank([f1, f2]) = 6 < rank(f1) + rank(f2) = 8). Spectral learning of vv-WFAs. We now design a spectral learning algorithm for vv-WFAs. Given a function ⃗f : Σ∗→Rd, we define its Hankel tensor H ∈RΣ∗×d×Σ∗by Hu,:,v = ⃗f(uv) for all u, v ∈Σ∗. We first show in Theorem 3 (whose proof can be found in the supplementary material) that the fundamental relation between the rank of a function and the rank of its Hankel matrix can naturally be extended to the vector-valued case. Compared with Theorem 1, the Hankel matrix is now replaced by the mode-1 flattening H(1) of the Hankel tensor (which can be obtained by concatenating the matrices H:,i,: along the horizontal axis). Theorem 3 (Vector-valued Fliess Theorem). Let ⃗f : Σ∗→Rd and let H be its Hankel tensor. Then rank(⃗f) = rank(H(1)). 4Both definitions performed similarly in multitask experiments on the dataset used in Section 5.2, we thus chose multiple final vectors as a convention. 4 Similarly to the scalar-valued case, this theorem can be leveraged to design a spectral learning algorithm for vv-WFAs. The following corollary (whose proof can be found in the supplementary material) shows how a vv-WFA computing a recognizable function ⃗f : Σ∗→Rd of rank n can be recovered from any rank n factorization of its Hankel tensor. Corollary 4. Let ⃗f : Σ∗→Rd be a recognizable function with rank n, let H ∈RΣ∗×d×Σ∗be its Hankel tensor, and for each σ ∈Σ let Hσ ∈RΣ∗×d×Σ∗be defined by Hσ u,:,v = ⃗f(uσv) for all u, v ∈Σ∗. Then, for any P ∈RΣ∗×n and S ∈Rn×d×Σ∗such that H = S ×1 P, the vv-WFA A = (α, {Aσ}σ∈Σ, Ω) defined by α⊤= Pλ,:, Ω= S:,:,λ, and Aσ = P†Hσ (1)(S(1))† is a minimal vv-WFA computing ⃗f. Similarly to the scalar-valued case, one can check that the previous corollary also holds for any finite sub-tensors HP,S, {Hσ P,S}σ∈Σ of H indexed by prefixes and suffixes in P, S ⊂Σ∗, whenever P and S are such that λ ∈P ∩S and rank(H(1)) = rank((HP,S)(1)); we will call such a basis (P, S) complete. The spectral learning algorithm for vv-WFAs then consists in estimating these Hankel tensors from training data and using Corollary 4 to recover a vv-WFA approximating the target function. Of course a noisy estimate of the Hankel tensor ˆ H will not be of low rank and the factorization ˆ H = S ×1 P should only be performed approximately in order to counter the presence of noise. In practice a low rank approximation of ˆ H(1) is obtained using truncated SVD. Multitask learning of WFAs. Let us now go back to the multitask learning problem and let f1, · · · fm : Σ∗→R be multiple functions we wish to infer in the form of WFAs. The spectral learning algorithm for vv-WFAs naturally suggests a way to tackle this multitask problem: by learning ⃗f = [f1, · · · , fm] in the form of a vv-WFA, rather than independently learning a WFA for each task fi, we implicitly enforce the discovery of a joint forward feature map shared among all tasks. We will now see how a further step can be added to this learning scheme to enforce more robustness to noise. The motivation for this additional step comes from the observation that even though a d-dimensional vv-WFA A = (α, {Aσ}σ∈Σ, Ω) may be minimal, the corresponding scalar-valued WFAs Ai = ⟨α, {Aσ}σ∈Σ, Ω:,i⟩for i ∈[d] may not be. Suppose for example that A1 is not minimal. This implies that some part of its state space does not contribute to the function f1 but comes from asking for a rich enough state representation that can predict other tasks as well. Moreover, when one learns a vv-WFA from noisy estimates of the Hankel tensors, the rank R approximation ˆ H(1) ≃PS(1) somehow annihilates the noise contained in the space orthogonal to the top R singular vectors of ˆ H(1), but when the WFA A1 has rank R1 < R we intuitively see that there is still a subspace of dimension R −R1 containing only irrelevant features. In order to circumvent this issue, we would like to project down the (scalar-valued) WFAs Ai down to their true dimensions, intuitively enforcing each predictor to use as few features as possible for each task, and thus annihilating the noise lying in the corresponding irrelevant subspaces. To achieve this we will make use of the following proposition that explicits the projections needed to obtain minimal scalar-valued WFAs from a given vv-WFA (the proof is given in the supplementary material). Proposition 1. Let ⃗f : Σ∗ →Rd be a function computed by a minimal vv-WFA A = (α, {Aσ}σ∈Σ, Ω) with n states and let P, S ⊆Σ∗be a complete basis for ⃗f. For any i ∈[d], let fi : Σ∗→R be defined by fi(x) = ⃗f(x)i for all x ∈Σ∗and let ni denote the rank of fi. Let P ∈RP×n be defined by Px,: = α⊤Ax for all x ∈P and, for i ∈[d], let Hi ∈RP×S be the Hankel matrix of fi and let Hi = UiDiV⊤ i be its thin SVD (i.e. Di ∈Rni×ni). Then, for any i ∈[d], the WFA Ai = ⟨αi, {Aσ i }σ∈Σ}, ωi⟩defined by α⊤ i = α⊤P†Ui, ωi = U⊤ i PΩ:,i and Aσ i = U⊤ i PAσP†Ui for each σ ∈Σ, is a minimal WFA computing fi. Given noisy estimates ˆ H, { ˆ Hσ}σ∈Σ of the Hankel tensors of a function ⃗f and estimates R of the rank of ⃗f and Ri of the ranks of the fi’s, the first step of the learning algorithm consists in applying Corollary 4 to the factorization ˆ H(1) ≃U(DV⊤) obtained by truncated SVD to get a 5 vv-WFA A approximating ⃗f. Then, Proposition 1 can be used to project down each WFA Ai by estimating Ui with the top Ri left singular vectors of ˆ H:,i,:. The overall procedure for our Multi-Task Spectral Learning (MT-SL) is summarized in Algorithm 1 where lines 1-3 correspond to the vv-WFA estimation while lines 4-7 correspond to projecting down the corresponding scalar-valued WFAs. To further motivate the projection step, let us consider the case when m tasks are completely unrelated, and each of them requires n states. Single-task learning would lead to a model with O |Σ|mn2 parameters, while the multi-task learning approach would return a larger model of size O |Σ|(mn)2 ; the projection step eliminates such redundancy. Algorithm 1 MT-SL: Spectral Learning of vector-valued WFA for multitask learning Input: Empirical Hankel tensors ˆ H, { ˆ Hσ}σ∈Σ of size P × m × S for the target function ⃗f = [f1, · · · , fm] (where P, S are subsets of Σ∗both containing λ), a common rank R, and task specific ranks Ri for i ∈[m]. Output: WFAs Ai approximating fi for each i ∈[d]. 1: Compute the rank R truncated SVD ˆ H(1) ≃UDV⊤. 2: Let A = (α, {Aσ}σ∈Σ, Ω) be the vv-WFA defined by α⊤= Uλ,:, , Ω= U⊤( ˆ H:,:,λ) and Aσ = U⊤ˆ Hσ (1)( ˆ H(1))†U for each σ ∈Σ. 3: for i = 1 to m do 4: Compute the rank Ri truncated SVD ˆ H:,i,: ≃UiDiV⊤ i . 5: Let Ai = ⟨U⊤ i Uα, {U⊤ i UAσU⊤Ui}σ∈Σ, U⊤ i UΩ:,i⟩ 6: end for 7: return A1, · · · , Am. 4 Theoretical Analysis Computational complexity. The computational cost of the classical spectral learning algorithm (SL) is in O N + R|P||S| + R2|P||Σ|  where the first term corresponds to estimating the Hankel matrices from a sample of size N, the second one to the rank R truncated SVD, and the third one to computing the transition matrices Aσ. In comparison, the computational cost of MT-SL is in O mN + (mR + P i Ri)|P||S| + (mR2 + P i R2 i )|P||Σ|  , showing that the increase in complexity is essentially linear in the number of tasks m. Robustness in subspace estimation. In order to give some theoretical insights on the potential benefits of MT-SL, let us consider the simple case where the tasks are maximally related with common rank R = R1 = · · · = Rm. Let ˆH1, · · · , ˆHm ∈RP×S be the empirical Hankel matrices for the m tasks and let Ei = ˆHi −Hi be the error terms, where Hi is the true Hankel matrix for the ith task. Then the flattening ˆH = ˆ H(1) ∈R|P|×m|S| (resp. H = H(1)) can be obtained by stacking the matrices ˆHi (resp. Hi) along the horizontal axis. Consider the problem of learning the first task. One key step of both SL and MT-SL resides in estimating the left singular subspace of H1 and H respectively from their noisy estimates. When the tasks are maximally related, this space U is the same for H and H1, · · · , Hm and we intuitively see that the benefits of MT-SL will stem from the fact that the SVD of ˆH should lead to a more accurate estimation of U than the one only relying on ˆH1. It is also intuitive to see that since the Hankel matrices ˆHi have been stacked horizontally, the estimation of the right singular subspace might not benefit from performing SVD on ˆH. However, classical results on singular subspace estimation (see e.g. [29, 20]) provide uniform bounds for both left and right singular subspaces (i.e. bounds on the maximum of the estimation errors for the left and right spaces). To circumvent this issue, we use a recent result on rate optimal asymmetric perturbation bounds for left and right singular spaces [9] to obtain the following theorem relating the ratio between the dimensions of a matrix to the quality of the subspace estimation provided by SVD (the proof can be found in the supplementary material). Theorem 5. Let M ∈Rd1×d2 be of rank R and let ˆM = M + E where E is a random noise term such that vec(E) ∥E∥F follows a uniform distribution on the unit sphere in Rd1d2. Let ΠU, Π ˆU ∈Rd1×d1 6 be the matrices of the orthogonal projections onto the space spanned by the top R left singular vectors of M and ˆM respectively. Let δ > 0, let α = sR(M) be the smallest non-zero singular value of M and suppose that ∥E∥F ≤ α/2. Then, with probability at least 1 −δ, ∥ΠU −Π ˆU∥F ≤4   s (d1 −R)R + 2 log(1/δ) d1d2 ∥E∥F α + ∥E∥2 F α2  . A few remarks on this theorem are in order. First, the Frobenius norm between the projection matrices measures the distance between the two subspaces (it is in fact proportional to the classical sin-theta distance between subspaces). Second, the assumption ∥E∥F ≤α/2 corresponds to the magnitude of the noise being small compared to the magnitude of M (and in particular it implies ∥E∥F α < 1); this is a reasonable and common assumption in subspace identification problems, see e.g. [30]. Lastly, as d2 grows the first term in the upper bound becomes irrelevant and the error is dominated by the quadratic term, which decreases with ∥E∥F faster than classical results. Intuitively this tells us that there is a first regime where growing d2 (i.e. adding more tasks) is beneficial, until the point where the quadratic term dominates (and where the bound becomes somehow independent of d2). Going back to the power of MT-SL to leverage information from related tasks, let E ∈R|P|×m|S| be the matrix obtained by stacking the noise matrices Ei along the horizontal axis. If we assume that the entries of the error terms Ei are i.i.d. from e.g. a normal distribution, we can apply the previous proposition to the left singular subspaces of ˆ H(1) and H(1). One can check that in this case we have ∥E∥2 F = Pm i=1 ∥Ei∥2 F and α2 = sR(H)2 ≥Pm i=1 sR(Hi)2 (since R = R1 = · · · = Rm when tasks are maximally related). Thus, if the norms of the noise terms Ei are roughly the same, and so are the smallest non-zero singular values of the matrices Hi, we get ∥E∥F α ≤O (∥E1∥F /sR(H1)). Hence, given enough tasks, the estimation error of the left singular subspace of H1 in the multitask setting (i.e. by performing SVD on ˆ H(1)) is intuitively in O ∥E1∥2 F /sR(H1)2 while it is only in O (∥E1∥F /sR(H1)) when relying solely on ˆH1, which shows the potential benefits of MT-SL. Indeed, as the amount of training data increases the error in the estimated matrices decreases, thus T = ∥E1∥F /sR(H1) goes to 0 and an error of order O T 2 decays faster than one of order O (T). 5 Experiments We evaluate the performance of the proposed multitask learning method (MT-SL) on both synthetic and real world data. We use two performance metrics: perplexity per character on a test set T, which is defined by perp(h) = 2−1 M P x∈T log(h(x)) where M is the number of symbols in the test set and h is the hypothesis, and word error rate (WER) which measures the proportion of mis-predicted symbols averaged over all prefixes in the test set (when the most likely symbol is predicted). Both experiments are in a stochastic setting, i.e. the functions to be learned are probability distributions, and explore the regime where the learner has access to a small training sample drawn from the target task, while larger training samples are available for related tasks. We compare MT-SL with the classical spectral learning method (SL) for WFAs (note that SL has been extensively compared to EM and n-gram in the literature, see e.g. [4] and [5] and references therein). For both methods the prefix set P (resp. suffix set S) is chosen by taking the 1, 000 most frequent prefixes (resp. suffixes) in the training data of the target task, and the values of the ranks are chosen using a validation set. 5.1 Synthetic Data We first assess the validity of MT-SL on synthetic data. We randomly generated stochastic WFAs using the process used for the PAutomaC competition [27] with symbol sparsity 0.4 and transition sparsity 0.15, for an alphabet Σ of size 10. We generated related WFAs5 sharing a joint feature 5More precisely, we first generate a probabilistic automaton (PA) AS = (αS, {Aσ S}σ∈Σ, ωS) with dS states. Then, for each task i = 1, · · · , m we generate a second PA AT = (αT , {Aσ T }σ∈Σ, ωT ) with dT states and a random vector ω ∈[0, 1]dS+dT . Both PAs are generated using the process described in [27]. The task fi is then obtained as the distribution computed by the stochastic WFA ⟨αS ⊕αT , {Aσ S ⊕Aσ T }σ∈Σ, ˜ω⟩with ˜ω = ω/Z where the constant Z is chosen such that P x∈Σ∗fi(x) = 1. 7 102 103 train size 3 4 5 6 7 perplexity dS = 10, dT = 0 102 103 0.35 0.40 0.45 0.50 word error rate 102 103 train size 3 4 5 6 perplexity dS = 10, dT = 5 true model SL MT-SL, 2 tasks MT-SL, 4 tasks MT-SL, 8 tasks 102 103 0.40 0.45 0.50 0.55 word error rate 102 103 train size 2.5 3.0 3.5 4.0 4.5 perplexity dS = 10, dT = 10 102 103 0.45 0.50 0.55 0.60 0.65 word error rate Figure 1: Comparison (on synthetic data) between the spectral learning algorithm (SL) and our multitask algorithm (MT-SL) for different numbers of tasks and different degrees of relatedness between the tasks: dS is the dimension of the space shared by all tasks and dT the one of the task-specific space (see text for details). space of dimension dS = 10 and each having a task specific feature space of dimension dT , i.e. for m tasks f1, · · · , fm each WFA computing fi has rank dS + dT and the vv-WFA computing ⃗f = [f1, · · · , fm] has rank dS + mdT . We generated 3 sets of WFAs for different task specific dimensions dT = 0, 5, 10. The learner had access to training samples of size 5, 000 drawn from each related tasks f2, · · · , fm and a training sample of sizes ranging from 50 to 5, 000 drawn from the target task f1. Results on a test set of size 1, 000 averaged over 10 runs are reported in Figure 1. For both evaluation measures, when the task specific dimension is small compared to the dimension of the joint feature space, i.e. dT = 0, 5, MT-SL clearly outperforms SL that only relies on the target task data. Moreover, increasing the number of related tasks tends to improve the performances of MT-SL. However, when dS = dT = 10, MT-SL performs similarly in terms of perplexity and WER, showing that the multitask approach offers no benefits when the tasks are too loosely related. Additional experimental results for the case of totally unrelated tasks (dS = 0, dT = 10) as well as comparisons with MT-SL without the projection step (i.e. without lines 4-7 of Algorithm 1) are presented in the supplementary material. 5.2 Real Data We evaluate MT-SL on 33 languages from the Universal Dependencies (UNIDEP) 1.4 treebank [24], using the 17-tag universal Part of Speech (PoS) tagset. This dataset contains sentences from various languages where each word is annotated with Google universal PoS tags [25], and thus can be seen as a collection of samples drawn from 33 distributions over strings on an alphabet of size 17. For each language, the available data is split between a training, a validation and a test set (80%, 10%, 10%). For each language and for various sizes of training samples, we compare independently learning the target task with SL against using MT-SL to exploit training data from related tasks. We tested two ways of selecting the related tasks: (1) all other languages are used and (2) for each language we selected the 4 closest languages w.r.t. the distance between the subspaces spanned by the top 50 left singular vectors of their Hankel matrices6. We compare MT-SL against SL (using only the training data for the target task) and against a naive baseline where all data from different tasks are bagged together and used as a training set for SL (SL-bagging). We also include the results obtained using MT-SL without the projection step (MTSL-noproj). We report the average relative improvement of MT-SL, SL-bagging and MT-SL-noproj w.r.t. SL over all languages in Table 1, e.g. for perplexity we report 100 · (psl −pmt)/psl where psl (resp. pmt) is the perplexity obtained by SL (resp. MT-SL) on the test set. We see that the multitask approach leads to improved results for both metrics, that the benefits tend to be greater for small training sizes, and that restricting the number of auxiliary tasks is overall beneficial. To give a 6The common basis (P, S) for these Hankel matrices is chosen by taking the union of the 100 most frequent prefixes and suffixes in each training sample. 8 Table 1: Average relative improvement with respect to single task spectral learning (SL) of the multitask approach (with and without the projection step: MT-SL and MT-SL-noproj) and the bagging baseline (SL-bagging) on the UNIDEP dataset. (a) Perplexity average relative improvement (in %). Training size 100 500 1000 5000 all available data Related tasks: all other languages MT-SL 7.0744 ( ±7.76) 3.6666 ( ±5.22) 3.2879 ( ±5.17) 3.4187 ( ±5.57) 3.1574 ( ±5.48) MT-SL-noproj 2.9884 ( ±9.82) 2.2469 ( ±7.49) 0.8509 ( ±7.41) 1.1658 ( ±6.59) 0.6958 ( ±6.38) SL-bagging −19.00 ( ±29.1) −13.32 ( ±22.4) −10.65 ( ±19.7) −5.371 ( ±14.6) −2.630 ( ±13.0) Related tasks: 4 closest languages MT-SL 6.0069 ( ±6.76) 4.3670 ( ±5.83) 4.4049 ( ±5.50) 2.9689 ( ±5.87) 2.8229 ( ±5.90) MT-SL-noproj 4.5732 ( ±8.78) 2.9421 ( ±7.83) 2.4549 ( ±7.15) 2.2166 ( ±6.82) 2.1451 ( ±6.52) SL-bagging −18.41 ( ±28.4) −12.73 ( ±22.0) −10.34 ( ±20.1) −3.086 ( ±12.7) 0.1926 ( ±10.2) (b) WER average relative improvement (in %). Training size 100 500 1000 5000 all available data Related tasks: all other languages MT-SL 1.4919 (±2.37) 1.3786 (±2.94) 1.2281 (±2.62) 1.4964 (±2.70) 1.4932 (±2.77) MT-SL-noproj −5.763 (±6.82) −9.454 (±8.95) −9.197 (±7.25) −9.201 (±6.02) −9.600 (±5.55) SL-bagging −3.067 (±10.8) −6.998 (±11.6) −7.788 (±9.88) −8.791 (±9.54) −8.611 (±9.74) Related tasks: 4 closest languages MT-SL 2.0883 (±3.26) 1.5175 (±2.87) 1.2961 (±2.57) 1.3080 (±2.55) 1.2160 (±2.31) MT-SL-noproj −4.139 (±5.10) −5.841 (±6.29) −5.399 (±6.26) −5.526 (±4.93) −5.556 (±4.90) SL-bagging 0.3372 (±7.80) −3.045 (±8.12) −3.822 (±7.33) −4.350 (±6.90) −3.588 (±7.06) concrete example, on the Basque task with a training set of size 500, the WER was reduced from ∼76% for SL to ∼70% using all other languages as related tasks, and to ∼65% using the 4 closest tasks (Finnish, Polish, Czech and Indonesian). Overall, both SL-bagging and MT-SL-noproj obtain worst performance than MT-SL (though MT-SL-noproj still outperforms SL in terms are perplexity while SL-bagging performs almost always worse than SL). Detailed results on all languages, along with the list of closest languages used for method (2), are reported in the supplementary material. 6 Conclusion We introduced the novel model of vector-valued WFA that allowed us to define a notion of relatedness between recognizable functions and to design a multitask spectral learning algorithm for WFAs (MTSL). The benefits of MT-SL have been theoretically motivated and showcased on both synthetic and real data experiments. In future works, we plan to apply MT-SL in the context of reinforcement learning and to identify other areas of machine learning where vv-WFAs could prove to be useful. It would also be interesting to investigate a weighted approach such as the one presented in [19] for classical spectral learning; this could prove useful to handle the case where the amount of available training data differs greatly between tasks. Acknowledgments G. Rabusseau acknowledges support of an IVADO postdoctoral fellowship. B. Balle completed this work while at Lancaster University. We thank NSERC and CIFAR for their financial support. 9 References [1] Andreas Argyriou, Theodoros Evgeniou, and Massimiliano Pontil. Multi-task feature learning. In NIPS, pages 41–48, 2007. [2] Raphaël Bailly, François Denis, and Liva Ralaivola. Grammatical inference as a principal component analysis problem. In ICML, pages 33–40, 2009. [3] Borja Balle. Learning Finite-State Machines: Algorithmic and Statistical Aspects. PhD thesis, Universitat Politècnica de Catalunya, 2013. [4] Borja Balle, Xavier Carreras, Franco M Luque, and Ariadna Quattoni. Spectral learning of weighted automata. Machine learning, 96(1-2):33–63, 2014. [5] Borja Balle, William L. Hamilton, and Joelle Pineau. Methods of moments for learning stochastic languages: Unified presentation and empirical comparison. In ICML, pages 1386–1394, 2014. [6] Jonathan Baxter et al. A model of inductive bias learning. Journal of Artifical Intelligence Research, 12(149-198):3, 2000. [7] Shai Ben-David and Reba Schuller. Exploiting task relatedness for multiple task learning. In Learning Theory and Kernel Machines, pages 567–580. Springer, 2003. [8] Byron Boots, Sajid M. Siddiqi, and Geoffrey J. Gordon. Closing the learning-planning loop with predictive state representations. International Journal of Robotics Research, 30(7):954–966, 2011. [9] T Tony Cai and Anru Zhang. Rate-optimal perturbation bounds for singular subspaces with applications to high-dimensional statistics. arXiv preprint arXiv:1605.00353, 2016. [10] Jack W. Carlyle and Azaria Paz. Realizations by stochastic finite automata. Journal of Computer and System Sciences, 5(1):26–40, 1971. [11] Rich Caruana. Multitask learning. In Learning to learn, pages 95–133. Springer, 1998. [12] Shay B. Cohen, Karl Stratos, Michael Collins, Dean P. Foster, and Lyle H. Ungar. Experiments with spectral learning of latent-variable pcfgs. In NAACL-HLT, pages 148–157, 2013. [13] François Denis and Yann Esposito. On rational stochastic languages. Fundamenta Informaticae, 86(1, 2):41–77, 2008. [14] Michel Fliess. Matrices de Hankel. Journal de Mathématiques Pures et Appliquées, 53(9):197–222, 1974. [15] Emily Fox, Michael I Jordan, Erik B Sudderth, and Alan S Willsky. Sharing features among dynamical systems with beta processes. In NIPS, pages 549–557, 2009. [16] Mark A Girolami and Ata Kabán. Simplicial mixtures of markov chains: Distributed modelling of dynamic user profiles. In NIPS, volume 16, pages 9–16, 2003. [17] Daniel J. Hsu, Sham M. Kakade, and Tong Zhang. A spectral algorithm for learning hidden markov models. In COLT, 2009. [18] Tamara G Kolda and Brett W Bader. Tensor decompositions and applications. SIAM review, 51(3):455–500, 2009. [19] Alex Kulesza, Nan Jiang, and Satinder Singh. Low-rank spectral learning with weighted loss functions. In AISTATS, 2015. [20] Ren-Cang Li. Relative perturbation theory: II. eigenspace and singular subspace variations. SIAM Journal on Matrix Analysis and Applications, 20(2):471–492, 1998. [21] Pengfei Liu, Xipeng Qiu, and Xuanjing Huang. Recurrent neural network for text classification with multi-task learning. In IJCAI, pages 2873–2879, 2016. [22] Minh-Thang Luong, Quoc V Le, Ilya Sutskever, Oriol Vinyals, and Lukasz Kaiser. Multi-task sequence to sequence learning. arXiv preprint arXiv:1511.06114, 2015. [23] Kai Ni, Lawrence Carin, and David Dunson. Multi-task learning for sequential data via ihmms and the nested dirichlet process. In ICML, pages 689–696, 2007. [24] Joakim Nivre, Zeljko Agi´c, Lars Ahrenberg, et al. Universal dependencies 1.4, 2016. LINDAT/CLARIN digital library at the Institute of Formal and Applied Linguistics, Charles University. [25] Slav Petrov, Dipanjan Das, and Ryan McDonald. A universal part-of-speech tagset. arXiv preprint arXiv:1104.2086, 2011. [26] Michael Thon and Herbert Jaeger. Links between multiplicity automata, observable operator models and predictive state representations: a unified learning framework. Journal of Machine Learning Research, 16:103–147, 2015. [27] Sicco Verwer, Rémi Eyraud, and Colin De La Higuera. Results of the pautomac probabilistic automaton learning competition. In ICGI, pages 243–248, 2012. [28] Boyu Wang, Joelle Pineau, and Borja Balle. Multitask generalized eigenvalue program. In AAAI, pages 2115–2121, 2016. [29] Per-Åke Wedin. Perturbation bounds in connection with singular value decomposition. BIT Numerical Mathematics, 12(1):99–111, 1972. [30] Laurent Zwald and Gilles Blanchard. On the convergence of eigenspaces in kernel principal component analysis. In NIPS, pages 1649–1656, 2006. 10
2017
600
7,120
A simple neural network module for relational reasoning Adam Santoro∗ adamsantoro@google.com David Raposo∗ draposo@google.com David G.T. Barrett barrettdavid@google.com Mateusz Malinowski mateuszm@google.com Razvan Pascanu razp@google.com Peter Battaglia peterbattaglia@google.com Timothy Lillicrap DeepMind London, United Kingdom countzero@google.com Abstract Relational reasoning is a central component of generally intelligent behavior, but has proven difficult for neural networks to learn. In this paper we describe how to use Relation Networks (RNs) as a simple plug-and-play module to solve problems that fundamentally hinge on relational reasoning. We tested RN-augmented networks on three tasks: visual question answering using a challenging dataset called CLEVR, on which we achieve state-of-the-art, super-human performance; textbased question answering using the bAbI suite of tasks; and complex reasoning about dynamic physical systems. Then, using a curated dataset called Sort-ofCLEVR we show that powerful convolutional networks do not have a general capacity to solve relational questions, but can gain this capacity when augmented with RNs. Thus, by simply augmenting convolutions, LSTMs, and MLPs with RNs, we can remove computational burden from network components that are not well-suited to handle relational reasoning, reduce overall network complexity, and gain a general ability to reason about the relations between entities and their properties. 1 Introduction The ability to reason about the relations between entities and their properties is central to generally intelligent behavior (Figure 1) [10, 7]. Consider a child proposing a race between the two trees in the park that are furthest apart: the pairwise distances between every tree in the park must be inferred and compared to know where to run. Or, consider a reader piecing together evidence to predict the culprit in a murder-mystery novel: each clue must be considered in its broader context to build a plausible narrative and solve the mystery. Symbolic approaches to artificial intelligence are inherently relational [16, 5]. Practitioners define the relations between symbols using the language of logic and mathematics, and then reason about these relations using a multitude of powerful methods, including deduction, arithmetic, and algebra. But symbolic approaches suffer from the symbol grounding problem and are not robust to small ∗Equal contribution. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. What is the size of the brown sphere? Non-relational question: Original Image: Relational question: Are there any rubber things that have the same size as the yellow metallic cylinder? Figure 1: An illustrative example from the CLEVR dataset of relational reasoning. An image containing four objects is shown alongside non-relational and relational questions. The relational question requires explicit reasoning about the relations between the four objects in the image, whereas the non-relational question requires reasoning about the attributes of a particular object. task and input variations [5]. Other approaches, such as those based on statistical learning, build representations from raw data and often generalize across diverse and noisy conditions [12]. However, a number of these approaches, such as deep learning, often struggle in data-poor problems where the underlying structure is characterized by sparse but complex relations [3, 11]. Our results corroborate these claims, and further demonstrate that seemingly simple relational inferences are remarkably difficult for powerful neural network architectures such as convolutional neural networks (CNNs) and multi-layer perceptrons (MLPs). Here, we explore “Relation Networks” (RN) as a general solution to relational reasoning in neural networks. RNs are architectures whose computations focus explicitly on relational reasoning [18]. Although several other models supporting relation-centric computation have been proposed, such as Graph Neural Neworks, Gated Graph Sequence Neural Netoworks, and Interaction Networks, [20, 13, 2], RNs are simpler, more exclusively focused on general relation reasoning, and easier to integrate within broader architectures. Moreover, RNs require minimal oversight to construct their input, and can be applied successfully to tasks even when provided with relatively unstructured inputs coming from CNNs and LSTMs. We applied an RN-augmented architecture to CLEVR [7], a recent visual question answering (QA) dataset on which state-of-the-art approaches have struggled due to the demand for rich relational reasoning. Our networks vastly outperformed the best generally-applicable visual QA architectures, and achieve state-of-the-art, super-human performance. RNs also solve CLEVR from state descriptions, highlighting their versatility in regards to the form of their input. We also applied an RN-based architecture to the bAbI text-based QA suite [22] and solved 18/20 of the subtasks. Finally, we trained an RN to make challenging relational inferences about complex physical systems and motion capture data. The success of RNs across this set of substantially dissimilar task domains is testament to the general utility of RNs for solving problems that require relation reasoning. 2 Relation Networks An RN is a neural network module with a structure primed for relational reasoning. The design philosophy behind RNs is to constrain the functional form of a neural network so that it captures the core common properties of relational reasoning. In other words, the capacity to compute relations is baked into the RN architecture without needing to be learned, just as the capacity to reason about spatial, translation invariant properties is built-in to CNNs, and the capacity to reason about sequential dependencies is built into recurrent neural networks. In its simplest form the RN is a composite function: RN(O) = fφ  X i,j gθ(oi, oj)  , (1) 2 where the input is a set of “objects” O = {o1, o2, ..., on}, oi ∈Rm is the ith object, and fφ and gθ are functions with parameters φ and θ, respectively. For our purposes, fφ and gθ are MLPs, and the parameters are learnable synaptic weights, making RNs end-to-end differentiable. We call the output of gθ a “relation”; therefore, the role of gθ is to infer the ways in which two objects are related, or if they are even related at all. RNs have three notable strengths: they learn to infer relations, they are data efficient, and they operate on a set of objects – a particularly general and versatile input format – in a manner that is order invariant. RNs learn to infer relations The functional form in Equation 1 dictates that an RN should consider the potential relations between all object pairs. This implies that an RN is not necessarily privy to which object relations actually exist, nor to the actual meaning of any particular relation. Thus, RNs must learn to infer the existence and implications of object relations. In graph theory parlance, the input can be thought of as a complete and directed graph whose nodes are objects and whose edges denote the object pairs whose relations should be considered. Although we focus on this “all-to-all” version of the RN throughout this paper, this RN definition can be adjusted to consider only some object pairs. Similar to Interaction Networks [2], to which RNs are related, RNs can take as input a list of only those pairs that should be considered, if this information is available. This information could be explicit in the input data, or could perhaps be extracted by some upstream mechanism. RNs are data efficient RNs use a single function gθ to compute each relation. This can be thought of as a single function operating on a batch of object pairs, where each member of the batch is a particular object-object pair from the same object set. This mode of operation encourages greater generalization for computing relations, since gθ is encouraged not to over-fit to the features of any particular object pair. Consider how an MLP would learn the same function. An MLP would receive all objects from the object set simultaneously as its input. It must then learn and embed n2 (where n is the number of objects) identical functions within its weight parameters to account for all possible object pairings. This quickly becomes intractable as the number of objects grows. Therefore, the cost of learning a relation function n2 times using a single feedforward pass per sample, as in an MLP, is replaced by the cost of n2 feedforward passes per object set (i.e., for each possible object pair in the set) and learning a relation function just once, as in an RN. RNs operate on a set of objects The summation in Equation 1 ensures that the RN is invariant to the order of objects in its input, respecting the property that sets are order invariant. Although we used summation, other commutative operators – such as max, and average pooling – can be used instead. 3 Tasks We applied RN-augmented networks to a variety of tasks that hinge on relational reasoning. To demonstrate the versatility of these networks we chose tasks from a number of different domains, including visual QA, text-based QA, and dynamic physical systems. 3.1 CLEVR In visual QA a model must learn to answer questions about an image (Figure 1). This is a challenging problem domain because it requires high-level scene understanding [1, 14]. Architectures must perform complex relational reasoning – spatial and otherwise – over the features in the visual inputs, language inputs, and their conjunction. However, the majority of visual QA datasets require reasoning in the absence of fully specified word vocabularies, and perhaps more perniciously, a vast and complicated knowledge of the world that is not available in the training data. They also contain ambiguities and exhibit strong linguistic biases that allow a model to learn answering strategies that exploit those biases, without reasoning about the visual input [1, 15, 19]. To control for these issues, and to distill the core challenges of visual QA, the CLEVR visual QA dataset was developed [7]. CLEVR contains images of 3D-rendered objects, such as spheres and cylinders (Figure 2). Each image is associated with a number of questions that fall into different 3 categories. For example, query attribute questions may ask “What is the color of the sphere?”, while compare attribute questions may ask “Is the cube the same material as the cylinder?”. For our purposes, an important feature of CLEVR is that many questions are explicitly relational in nature. Remarkably, powerful QA architectures [24] are unable to solve CLEVR, presumably because they cannot handle core relational aspects of the task. For example, as reported in the original paper a model comprised of ResNet-101 image embeddings with LSTM question processing and augmented with stacked attention modules vastly outperformed other models at an overall performance of 68.5% (compared to 52.3% for the next best, and 92.6% human performance) [7]. However, for compare attribute and count questions (i.e., questions heavily involving relations across objects), the model performed little better than the simplest baseline, which answered questions solely based on the probability of answers in the training set for a given question category (Q-type baseline). We used two versions of the CLEVR dataset: (i) the pixel version, in which images were represented in standard 2D pixel form. (ii) a state description version, in which images were explicitly represented by state description matrices containing factored object descriptions. Each row in the matrix contained the features of a single object – 3D coordinates (x, y, z); color (r, g, b); shape (cube, cylinder, etc.); material (rubber, metal, etc.); size (small, large, etc.). When we trained our models, we used either the pixel version or the state description version, depending on the experiment, but not both together. 3.2 Sort-of-CLEVR To explore our hypothesis that the RN architecture is better suited to general relational reasoning as compared to more standard neural architectures, we constructed a dataset similar to CLEVR that we call “Sort-of-CLEVR”2. This dataset separates relational and non-relational questions. Sort-of-CLEVR consists of images of 2D colored shapes along with questions and answers about the images. Each image has a total of 6 objects, where each object is a randomly chosen shape (square or circle). We used 6 colors (red, blue, green, orange, yellow, gray) to unambiguously identify each object. Questions are hard-coded as fixed-length binary strings to reduce the difficulty involved with natural language question-word processing, and thereby remove any confounding difficulty with language parsing. For each image we generated 10 relational questions and 10 non-relational questions. Examples of relational questions are: “What is the shape of the object that is farthest from the gray object?”; and “How many objects have the same shape as the green object?”. Examples of non-relational questions are: “What is the shape of the gray object?”; and “Is the blue object on the top or bottom of the scene?”. The dataset is also visually simple, reducing complexities involved in image processing. 3.3 bAbI bAbI is a pure text-based QA dataset [22]. There are 20 tasks, each corresponding to a particular type of reasoning, such as deduction, induction, or counting. Each question is associated with a set of supporting facts. For example, the facts “Sandra picked up the football” and “Sandra went to the office” support the question “Where is the football?” (answer: “office”). A model succeeds on a task if its performance surpasses 95%. Many memory-augmented neural networks have reported impressive results on bAbI. When training jointly on all tasks using 10K examples per task, Memory Networks pass 14/20, DNC 16/20, Sparse DNC 19/20, and EntNet 16/20 (the authors of EntNets report state-of-the-art at 20/20; however, unlike previously reported results this was not done with joint training on all tasks, where they instead achieve 16/20) [23, 4, 17, 6]. 3.4 Dynamic physical systems We developed a dataset of simulated physical mass-spring systems using the MuJoCo physics engine [21]. Each scene contained 10 colored balls moving on a table-top surface. Some of the balls moved independently, free to collide with other balls and the barrier walls. Other randomly selected ball pairs were connected by invisible springs or a rigid constraint. These connections prevented the balls from moving independently, due to the force imposed through the connections. Input data consisted of state descriptions matrices, where each ball was represented as a row in a matrix with features 2The “Sort-of-CLEVR” dataset will be made publicly available online 4 representing the rgb color values of each object and their spatial coordinates (x and y) across 16 sequential time steps. The introduction of random links between balls created an evolving physical system with a variable number “systems” of connected balls (where “systems” refers to connected graphs with balls as nodes and connections between balls as edges). We defined two separate tasks: 1) infer the existence or absence of connections between balls when only observing their color and coordinate positions across multiple sequential frames, and 2) count the number of systems on the table-top, again when only observing each ball’s color and coordinate position across multiple sequential frames. Both of these tasks involve reasoning about the relative positions and velocities of the balls to infer whether they are moving independently, or whether their movement is somehow dependent on the movement of other balls through invisible connections. For example, if the distance between two balls remains similar across frames, then it can be inferred that there is a connection between them. The first task makes these inferences explicit, while the second task demands that this reasoning occur implicitly, which is much more difficult. For further information on all tasks, including videos of the dynamic systems, see the supplementary information. 4 Models In their simplest form RNs operate on objects, and hence do not explicitly operate on images or natural language. A central contribution of this work is to demonstrate the flexibility with which relatively unstructured inputs, such as CNN or LSTM embeddings, can be considered as a set of objects for an RN. As we describe below, we require minimal oversight in factorizing the RN’s input into a set of objects. small + -MLP ... ... ... ... is sphere what size Final CNN feature maps RN LSTM object -MLP Conv. What size is the cylinder that is left of the brown metal thing that is left of the big sphere? * Object pair with question Element-wise sum Figure 2: Visual QA architecture. Questions are processed with an LSTM to produce a question embedding, and images are processed with a CNN to produce a set of objects for the RN. Objects (three examples illustrated here in yellow, red, and blue) are constructed using feature-map vectors from the convolved image. The RN considers relations across all pairs of objects, conditioned on the question embedding, and integrates all these relations to answer the question. Dealing with pixels We used a CNN to parse pixel inputs into a set of objects. The CNN took images of size 128 × 128 and convolved them through four convolutional layers to k feature maps of size d × d, where k is the number of kernels in the final convolutional layer. We remained agnostic as to what particular image features should constitute an object. So, after convolving the image, each of the d2 k-dimensional cells in the d × d feature maps was tagged with a coordinate (from the range (−1, 1) for each of the x- and y-coordinates)3 indicating its relative spatial position, and was treated as an object for the RN (see Figure 2). This means that an “object” could comprise the background, a particular physical object, a texture, conjunctions of physical objects, etc., which affords the model great flexibility in the learning process. 3We also experimented without this tagging, and achieved performance of 88% on the validation set. 5 Conditioning RNs with question embeddings The existence and meaning of an object-object relation should be question dependent. For example, if a question asks about a large sphere, then the relations between small cubes are probably irrelevant. So, we modified the RN architecture such that gθ could condition its processing on the question: a = fφ(P i,j gθ(oi, oj, q)). To get the question embedding q, we used the final state of an LSTM that processed question words. Question words were assigned unique integers, which were then used to index a learnable lookup table that provided embeddings to the LSTM. At each time-step, the LSTM received a single word embedding as input, according to the syntax of the English-encoded question. Dealing with state descriptions We can provide state descriptions directly into the RN, since state descriptions are pre-factored object representations. Question processing can proceed as before: questions pass through an LSTM using a learnable lookup embedding for individual words, and the final state of the LSTM is concatenated to each object-pair. Dealing with natural language For the bAbI suite of tasks the natural language inputs must be transformed into a set of objects. This is a distinctly different requirement from visual QA, where objects were defined as spatially distinct regions in convolved feature maps. So, we first took the 20 sentences in the support set that were immediately prior to the probe question. Then, we tagged these sentences with labels indicating their relative position in the support set, and processed each sentence word-by-word with an LSTM (with the same LSTM acting on each sentence independently). We note that this setup invokes minimal prior knowledge, in that we delineate objects as sentences, whereas previous bAbI models processed all word tokens from all support sentences sequentially. It’s unclear how much of an advantage this prior knowledge provides, since period punctuation also unambiguously delineates sentences for the token-by-token processing models. The final state of the sentence-processing-LSTM is considered to be an object. Similar to visual QA, a separate LSTM produced a question embedding, which was appened to each object pair as input to the RN. Our model was trained on the joint version of bAbI (all 20 tasks simultaneously), using the full dataset of 10K examples per task. Model configuration details For the CLEVR-from-pixels task we used: 4 convolutional layers each with 24 kernels, ReLU non-linearities, and batch normalization; 128 unit LSTM for question processing; 32 unit word-lookup embeddings; four-layer MLP consisting of 256 units per layer with ReLU non-linearities for gθ; and a three-layer MLP consisting of 256, 256 (with 50% dropout), and 29 units with ReLU non-linearities for fφ. The final layer was a linear layer that produced logits for a softmax over the answer vocabulary. The softmax output was optimized with a cross-entropy loss function using the Adam optimizer with a learning rate of 2.5e−4. We used size 64 mini-batches and distributed training with 10 workers synchronously updating a central parameter server. The configurations for the other tasks are similar, and can be found in the supplementary information. We’d like to emphasize the simplicity of our overall model architecture compared to the visual QA architectures used on CLEVR thus far, which use ResNet or VGG embeddings, sometimes with fine-tuning, very large LSTMs for language encoding, and further processing modules, such as stacked or iterative attention, or large fully connected layers (upwards of 4000 units, often) [7]. 5 Results 5.1 CLEVR from pixels Our model achieved state-of-the-art performance on CLEVR at 95.5%, exceeding the best model trained only on the pixel images and questions at the time of the dataset’s publication by 27%, and surpassing human performance in the task (see Table 1 and Figure 3). These results – in particular, those obtained in the compare attribute and count categories – are a testament to the ability of our model to do relational reasoning. In fact, it is in these categories that state-of-the-art models struggle most. Furthermore, the relative simplicity of the network components used in our model suggests that the difficulty of the CLEVR task lies in its relational reasoning demands, not on the language or the visual processing. Many CLEVR questions involve computing and comparing more than one relation; for example, consider the question: “There is a big thing on the right side of the big rubber cylinder that is behind 6 Model Overall Count Exist Compare Numbers Query Attribute Compare Attribute Human 92.6 86.7 96.6 86.5 95.0 96.0 Q-type baseline 41.8 34.6 50.2 51.0 36.0 51.3 LSTM 46.8 41.7 61.1 69.8 36.8 51.8 CNN+LSTM 52.3 43.7 65.2 67.1 49.3 53.0 CNN+LSTM+SA 68.5 52.2 71.1 73.5 85.3 52.3 CNN+LSTM+SA* 76.6 64.4 82.7 77.4 82.6 75.4 CNN+LSTM+RN 95.5 90.1 97.8 93.6 97.9 97.1 * Our implementation, with optimized hyperparameters and trained end-to-end using the same CNN as in our RN model. We also tagged coordinates, which did not improve performance. Table 1: Results on CLEVR from pixels. Performances of our model (RN) and previously reported models [8], measured as accuracy on the test set and broken down by question category. the large cylinder to the right of the tiny yellow rubber thing; What is its shape?”, which has three spatial relations (“right side”, “behind”, “right of”). On such questions, our model achieves 93% performance, indicating that the model can handle complex relational reasoning. Results using privileged training information A more recent study reports overall performance of 96.9% on CLEVR, but uses additional supervisory signals on the functional programs used to generate the CLEVR questions [8]. It is not possible for us to directly compare this to our work since we do not use these additional supervision signals. Nonetheless, our approach greatly outperforms a version of their model that was not trained with these extra signals, and even a version of their model trained using 9K ground-truth programs. Thus, RNs can achieve very competitive, and even super-human results under much weaker and more natural assumptions, and even in situations when functional programs are unavailable. equal less than more than exist count overall query size query shape query material query color compare size compare shape compare material compare color Human LSTM CNN+LSTM CNN+LSTM+SA CNN+LSTM+RN Q-type baseline Accuracy Accuracy 0.0 0.25 0.5 0.75 1.0 0.0 0.25 0.5 0.75 1.0 compare attribute query attribute compare numbers Figure 3: Results on CLEVR from pixels. The RN-augmented model outperformed all other models and exhibited super-human performance overall. In particular, it solved “compare attribute” questions, which trouble all other models because they heavily depend on relational reasoning. 5.2 CLEVR from state descriptions To demonstrate that the RN is robust to the form of its input, we trained our model on the state description matrix version of the CLEVR dataset. The model achieved an accuracy of 96.4%. This result demonstrates the generality of the RN module, showing its capacity to learn and reason about object relations while being agnostic to the kind of inputs it receives – i.e., to the particular representation of the object features to which it has access. Therefore, RNs are not necessarily 7 restricted to visual problems, and can thus be applied in very different contexts, and to different tasks that require relational reasoning. 5.3 Sort-of-CLEVR from pixels The results so far led us to hypothesize that the difficulty in solving CLEVR lies in its heavy emphasis on relational reasoning, contrary to previous claims that the difficulty lies in question parsing [9]. However, the questions in the CLEVR dataset are not categorized based on the degree to which they may be relational, making it hard to assess our hypothesis. Therefore, we use the Sort-of-CLEVR dataset which we explicitly designed to seperate out relational and non-relational questions (see Section 3.2). We find that a CNN augmented with an RN achieves an accuracy above 94% for both relational and non-relational questions. However, a CNN augmented with an MLP only reached this performance on the non-relational questions, plateauing at 63% on the relational questions. This strongly indicates that models lacking a dedicated relational reasoning component struggle, or may even be completely incapable of solving tasks that require very simple relational reasoning. Augmenting these models with a relational module, like the RN, is sufficient to overcome this hurdle. A simple “closest-to” or “furthest-from” relation is particularly revealing of a CNN+MLP’s lack of general reasoning capabilities (52.3% success). For these relations a model must gauge the distances between each object, and then compare each of these distances. Moreover, depending on the images, the relevant distance could be quite small in magnitude, or quite large, further increasing the combinatoric difficulty of this task. 5.4 bAbI Our model succeeded on 18/20 tasks. Notably, it succeeded on the basic induction task (2.1% total error), which proved difficult for the Sparse DNC (54%), DNC (55.1%), and EntNet (52.1%). Also, our model did not catastrophically fail in any of the tasks: for the 2 tasks that it failed (the “two supporting facts”, and “three supporting facts” tasks), it missed the 95% threshold by 3.1% and 11.5%, respectively. We also note that the model we evaluated was chosen based on overall performance on a withheld validation set, using a single seed. That is, we did not run multiple replicas with the best hyperparameter settings (as was done in other models, such as the Sparse DNC, which demonstrated performance fluctuations with a standard deviation of more than ±3 tasks passed for the best choice of hyperparameters). 5.5 Dynamic physical systems Finally, we trained our model on two tasks requiring reasoning about the dynamics of balls moving along a surface. In the connection inference task, our model correctly classified all the connections in 93% of the sample scenes in the test set. In the counting task, the RN achieved similar performance, reporting the correct number of connected systems for 95% of the test scene samples. In comparison, an MLP with comparable number of parameters was unable to perform better than chance for both tasks. Moreover, using this task to learn to infer relations results in transfer to unseen motion capture data, where RNs predict the connections between body joints of a walking human (see Supplementary Material for experimental details and example videos). 6 Discussion and Conclusions RNs are powerful, versatile, and simple neural network modules with the capacity for relational reasoning. The performance of RN-augmented networks on CLEVR is especially notable; they significantly improve upon current general purpose, state-of-the-art models (upwards of 25%), indicating that previous architectures lacked a fundamental, general capacity to reason about relations. Moreover, these results unveil an important distinction between the often confounded notions of processing and reasoning. Powerful visual QA architectures contain components, such as ResNets, which are highly capable visual processors capable of detecting complicated textures and forms. However, as demonstrated by CLEVR, they lack an ability to reason about the features they detect. 8 RNs can easily exploit foreknowledge of the relations that should be computed for a particular task. Indeed, especially in circumstances with strong computational constraints, bounding the otherwise quadratic complexity of the number of relations could be advantageous. Attentional mechanisms could reduce the number of objects fed as input to the RN, and hence reduce the number of relations that need to be considered. Or, using an additional down-sampling convolutional or pooling layer could further reduce the number of objects provided as input to the RN; indeed, max-pooling to 4 × 4 feature maps reduces the total number of objects, and hence computed relations, and results in 87% performance on the validation set. RNs have a flexible input format: a set of objects. Our results show that, strikingly, the set of objects does not need to be cleverly pre-factored. RNs learn to deal with “object” representations provided by CNNs and LSTMs, presumably by influencing the content and form of the object representations via the gradients they propagate. In future work it would be interesting to apply RNs to relational reasoning across highly abstract entities (for example, decisions in hierarchical reinforcement learning tasks). Relation reasoning is a central component of generally intelligent behavior, and so, we expect the RN to be a simple-to-use, useful and widely used neural module. Acknowledgments We would like to thank Murray Shanahan, Ari Morcos, Scott Reed, Daan Wierstra, and many others on the DeepMind team, for critical feedback and discussions. 9 References [1] Stanislaw Antol, Aishwarya Agrawal, Jiasen Lu, Margaret Mitchell, Dhruv Batra, C Lawrence Zitnick, and Devi Parikh. Vqa: Visual question answering. In ICCV, 2015. [2] Peter Battaglia, Razvan Pascanu, Matthew Lai, Danilo Jimenez Rezende, et al. Interaction networks for learning about objects, relations and physics. In NIPS, 2016. [3] Marta Garnelo, Kai Arulkumaran, and Murray Shanahan. Towards deep symbolic reinforcement learning. arXiv:1609.05518, 2016. [4] Alex Graves, Greg Wayne, Malcolm Reynolds, Tim Harley, Ivo Danihelka, Agnieszka Grabska-Barwi´nska, Sergio Gómez Colmenarejo, Edward Grefenstette, Tiago Ramalho, John Agapiou, et al. Hybrid computing using a neural network with dynamic external memory. Nature, 2016. [5] Stevan Harnad. The symbol grounding problem. Physica D: Nonlinear Phenomena, 42(1-3):335–346, 1990. [6] Mikael Henaff, Jason Weston, Arthur Szlam, Antoine Bordes, and Yann LeCun. Tracking the world state with recurrent entity networks. In ICLR, 2017. [7] Justin Johnson, Bharath Hariharan, Laurens van der Maaten, Li Fei-Fei, C Lawrence Zitnick, and Ross Girshick. Clevr: A diagnostic dataset for compositional language and elementary visual reasoning. In CVPR, 2017. [8] Justin Johnson, Bharath Hariharan, Laurens van der Maaten, Judy Hoffman, Li Fei-Fei, C Lawrence Zitnick, and Ross Girshick. Inferring and executing programs for visual reasoning. arXiv:1705.03633, 2017. [9] Kushal Kafle and Christopher Kanan. An analysis of visual question answering algorithms. arXiv:1703.09684, 2017. [10] Charles Kemp and Joshua B Tenenbaum. The discovery of structural form. Proceedings of the National Academy of Sciences, 105(31):10687–10692, 2008. [11] Brenden M Lake, Tomer D Ullman, Joshua B Tenenbaum, and Samuel J Gershman. Building machines that learn and think like people. arXiv:1604.00289, 2016. [12] Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, 521(7553):436–444, 2015. [13] Yujia Li, Daniel Tarlow, Marc Brockschmidt, and Richard Zemel. Gated graph sequence neural networks. ICLR, 2016. [14] Mateusz Malinowski and Mario Fritz. A multi-world approach to question answering about real-world scenes based on uncertain input. In NIPS, 2014. [15] Mateusz Malinowski, Marcus Rohrbach, and Mario Fritz. Ask your neurons: A deep learning approach to visual question answering. arXiv:1605.02697, 2016. [16] Allen Newell. Physical symbol systems. Cognitive science, 4(2):135–183, 1980. [17] Jack Rae, Jonathan J Hunt, Ivo Danihelka, Timothy Harley, Andrew W Senior, Gregory Wayne, Alex Graves, and Tim Lillicrap. Scaling memory-augmented neural networks with sparse reads and writes. In NIPS, 2016. [18] David Raposo, Adam Santoro, David Barrett, Razvan Pascanu, Timothy Lillicrap, and Peter Battaglia. Discovering objects and their relations from entangled scene representations. arXiv:1702.05068, 2017. [19] Mengye Ren, Ryan Kiros, and Richard Zemel. Image question answering: A visual semantic embedding model and a new dataset. In NIPS, 2015. [20] Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele Monfardini. The graph neural network model. IEEE Transactions on Neural Networks, 2009. [21] Emanuel Todorov, Tom Erez, and Yuval Tassa. Mujoco: A physics engine for model-based control. In IROS, 2012. [22] Jason Weston, Antoine Bordes, Sumit Chopra, and Tomas Mikolov. Towards ai-complete question answering: A set of prerequisite toy tasks. arXiv:1502.05698, 2015. [23] Jason Weston, Sumit Chopra, and Antoine Bordes. Memory networks. In ICLR, 2015. [24] Zichao Yang, Xiaodong He, Jianfeng Gao, Li Deng, and Alex Smola. Stacked attention networks for image question answering. In CVPR, 2016. 10
2017
601
7,121
Toward Robustness against Label Noise in Training Deep Discriminative Neural Networks Arash Vahdat D-Wave Systems Inc. Burnaby, BC, Canada avahdat@dwavesys.com Abstract Collecting large training datasets, annotated with high-quality labels, is costly and time-consuming. This paper proposes a novel framework for training deep convolutional neural networks from noisy labeled datasets that can be obtained cheaply. The problem is formulated using an undirected graphical model that represents the relationship between noisy and clean labels, trained in a semisupervised setting. In our formulation, the inference over latent clean labels is tractable and is regularized during training using auxiliary sources of information. The proposed model is applied to the image labeling problem and is shown to be effective in labeling unseen images as well as reducing label noise in training on CIFAR-10 and MS COCO datasets. 1 Introduction The availability of large annotated data collections such as ImageNet [1] is one of the key reasons why deep convolutional neural networks (CNNs) have been successful in the image classification problem. However, collecting training data with such high-quality annotation is very costly and time consuming. In some applications, annotators are required to be trained before identifying classes in data, and feedback from many annotators is aggregated to reduce labeling error. On the other hand, many inexpensive approaches for collecting labeled data exist, such as data mining on social media websites, search engines, querying fewer annotators per instance, or the use of amateur annotators instead of experts. However, all these low-cost approaches have one common side effect: label noise. This paper tackles the problem of training deep CNNs for the image labeling task from datapoints with noisy labels. Most previous work in this area has focused on modeling label noise for multiclass classification1 using a directed graphical model similar to Fig. 1.a. It is typically assumed that the clean labels are hidden during training, and they are marginalized by enumerating all possible classes. These techniques cannot be extended to the multilabel classification problem, where exponentially many configurations exist for labels, and the explaining-away phenomenon makes inference over latent clean labels difficult. We propose a conditional random field (CRF) [2] model to represent the relationship between noisy and clean labels, and we show how modern deep CNNs can gain robustness against label noise using our proposed structure. We model the clean labels as latent variables during training, and we design our structure such that the latent variables can be inferred efficiently. The main challenge in modeling clean labels as latent is the lack of semantics on latent variables. In other words, latent variables may not semantically correspond to the clean labels when the joint probability of clean and noisy labels is parameterized such that latent clean labels can take any 1Each sample is assumed to belong to only one class. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. xxx ˆyyy yyy (a) xxx ˆyyy yyy hhh (b) Figure 1: a) The general directed graphical model used for modeling noisy labels. xxx, ˆyyy, yyy represent a data instance, its clean label, and its noisy label, respectively. b) We represent the interactions between clean and noisy labels using an undirected graphical model with hidden binary random variables (hhh). configuration. To solve this problem, most previous work relies on either carefully initializing the conditionals [3], fine-tuning the model on the noisy set after pretraining on a clean set [4], or regularizing the transition parameters [5]. In contrast, we inject semantics to the latent variables by formulating the training problem as a semi-supervised learning problem, in which the model is trained using a large set of noisy training examples and a small set of clean training examples. To overcome the problem of inferring clean labels, we introduce a novel framework equipped with an auxiliary distribution that represents the relation between noisy and clean labels while relying on information sources different than the image content. This paper makes the following contributions: i) A generic CRF model is proposed for training deep neural networks that is robust against label noise. The model can be applied to both multiclass and multilabel classification problems, and it can be understood as a robust loss layer, which can be plugged into any existing network. ii) We propose a novel objective function for training the deep structured model that benefits from sources of information representing the relation between clean and noisy labels. iii) We demonstrate that the model outperforms previous techniques. 2 Previous Work Learning from Noisy Labels: Learning discriminative models from noisy-labeled data is an active area of research. A comprehensive overview of previous work in this area can be found in [6]. Previous research on modeling label noise can be grouped into two main groups: class-conditional and class-and-instance-conditional label noise models. In the former group, the label noise is assumed to be independent of the instance, and the transition probability from clean classes to the noisy classes is modeled. For example, class conditional models for binary classification problems are considered in [7, 8] whereas multiclass counterparts are targeted in [9, 5]. In the class-and-instance-conditional group, label noise is explicitly conditioned on each instance. For example, Xiao et al. [3] developed a model in which the noisy observed annotation is conditioned on binary random variables indicating if an instance’s label is mistaken. Reed et al. [10] fixes noisy labels by “bootstrapping” on the labels predicted by a neural network. These techniques are all applied to either binary or multiclass classification problems in which marginalization over classes is possible. Among methods proposed for noise-robust training, Misra et al. [4] target the image multilabeling problem but model the label noise for each label independently. In contrast, our proposed CRF model represents the relation between all noisy and clean labels while the inference over latent clean labels is still tractable. Many works have focused on semi-supervised learning using a small clean dataset combined with noisy labeled data, typically obtained from the web. Zhu et al. [11] used a pairwise similarity measure to propagate labels from labeled dataset to unlabeled one. Fergus et al. [12] proposed a graph-based label propagation, and Chen and Gupta [13] employed the weighted cross entropy loss. Recently Veit et al. [14] proposed a multi-task network containing i) a regression model that maps noisy labels and image features to clean labels ii) an image classification model that labels input. However, the model in this paper is trained using a principled objective function that regularizes the inference model using extra sources of information without the requirement for oversampling clean instances. Deep Structured Models: Conditional random fields (CRFs) [2] are discriminative undirected graphical models, originally proposed for modeling sequential and structured data. Recently, they have shown state-of-the-art results in segmentation [15, 16] when combined with deep neural networks [17, 18, 19]. The main challenge in training deep CNN-CRFs is how to do inference and back-propagate gradients of the loss function through the inference. Previous approaches have focused on mean-field 2 approximation [16, 20], belief propagation [21, 22], unrolled inference [23, 24], and sampling [25]. The CNN-CRFs used in this work are extensions of hidden CRFs introduced in [26, 27]. 3 Robust Discriminative Neural Network Our goal in this paper is to train deep neural networks given a set of noisy labeled data and a small set of cleaned data. A datapoint (an image in our case) is represented by xxx, and its noisy annotation by a binary vector yyy = {y1, y2, . . . , yN} ∈YN, where yi ∈{0, 1} indicates whether the ith label is present in the noisy annotation. We are interested in inferring a set of clean labels for each datapoint. The clean labels may be defined on a set different than the set of noisy labels. This is typically the case in the image annotation problem where noisy labels obtained from user tags are defined over a large set of textual tags (e.g., “cat”, “kitten, “kitty”, “puppy”, “pup”, etc.), whereas clean labels are defined on a small set of representative labels (e.g., “cat”, “dog”, etc.). In this paper, the clean label is represented by a stochastic binary vector ˆyyy = {ˆy1, ˆy2, . . . , ˆyC} ∈YC. We use the CRF model shown in Fig. 1.b. In our formulation, both ˆyyy and yyy may conditionally depend on the image xxx. The link between ˆyyy and yyy captures the correlations between clean and noisy labels. These correlations help us infer latent clean labels when only the noisy labels are observed. Since noisy labels are defined over a large set of overlapping (e.g., “cat” and “pet”) or co-occurring (e.g., “road” and “car”) entities, p(yyy|ˆyyy,xxx) may have a multimodal form. To keep the inference simple and still be able to model these correlations, we introduce a set of hidden binary variables represented by hhh ∈H. In this case, the correlations between components of yyy are modeled through hhh. These hidden variables are not connected to ˆyyy in order to keep the CRF graph bipartite. The CRF model shown in Fig. 1.b defines the joint probability distribution of yyy, ˆyyy, and hhh conditioned on xxx using a parameterized energy function Eθθθ : YN × YC × H × X →R. The energy function assigns a potential score Eθθθ(yyy, ˆyyy,hhh,xxx) to the configuration of (yyy, ˆyyy,hhh,xxx), and is parameterized by a parameter vector θθθ. This conditional probability distribution is defined using a Boltzmann distribution: pθθθ(yyy, ˆyyy,hhh|xxx) = 1 Zθθθ(xxx) exp(−Eθθθ(yyy, ˆyyy,hhh,xxx)) (1) where Zθθθ(xxx) is the partition function defined by Zθθθ(xxx) = X yyy∈YN X ˆyyy∈YC X hhh∈H exp(−Eθθθ(yyy, ˆyyy,hhh,xxx)). The energy function in Fig. 1.b is defined by the quadratic function: Eθθθ(yyy, ˆyyy,hhh,xxx) = −aaaT φφφ(xxx)ˆyyy −bbbT φφφ(xxx)yyy −cccThhh −ˆyyyTW W Wyyy −hhhTW ′ W ′ W ′yyy (2) where the vectors aaaφφφ(xxx), bbbφφφ(xxx), ccc are the bias terms and the matrices W W W and W ′ W ′ W ′ are the pairwise interactions. In our formulation, the bias terms on the clean and noisy labels are functions of input xxx and are defined using a deep CNN parameterized by φφφ. The deep neural network together with the introduced CRF forms our CNN-CRF model, parameterized by θθθ = {φφφ,ccc,W W W,W ′ W ′ W ′}. Note that in order to regularize W W W and W ′ W ′ W ′, these matrices are not a function of xxx. The structure of this graph is designed such that the conditional distribution pθθθ(ˆyyy,hhh|yyy,xxx) takes a simple factorial distribution that can be calculated analytically given θθθ using: pθθθ(ˆyyy,hhh|yyy,xxx) = Q i pθθθ(ˆyi|yyy,xxx) Q j pθθθ(hj|yyy) where pθθθ(ˆyi = 1|yyy,xxx) = σ(aaaφφφ(xxx)(i) +W W W (i,:)yyy), pθθθ(hj|yyy) = σ(ccc(j) +W W W ′ (j,:)yyy), in which σ(u) = 1 1+exp(−u) is the logistic function, and aaaφφφ(xxx)(i) or W W W (i,:) indicate the ith element and row in the corresponding vector or matrix respectively. 3.1 Semi-Supervised Learning Approach The main challenge here is how to train the parameters of the CNN-CRF model defined in Eq. 1. To tackle this problem, we define the training problem as a semi-supervised learning problem where clean labels are observed in a small subset of a larger training set annotated with noisy labels. In this case, one can form an objective function by combining the marginal data likelihood defined on both the fully labeled clean set and noisy labeled set, and using the maximum likelihood method to learn the parameters of the model. Assume that DN = {(xxx(n),yyy(n))} and DC = {(xxx(c), ˆyyy(c),yyy(c))} are two disjoint sets representing the noisy labeled and clean labeled training datasets respectively. In the 3 maximum likelihood method, the parameters are trained by maximizing the marginal log likelihood: max θθθ 1 |DN| X n log pθθθ(yyy(n)|xxx(n)) + 1 |DC| X c log pθθθ(yyy(c), ˆyyy(c)|xxx(c)) (3) where pθθθ(yyy(n)|xxx(n)) = P yyy,hhh pθθθ(yyy(n),yyy,hhh|xxx(n)) and pθθθ(yyy(c), ˆyyy(c)|xxx(c)) = P hhh pθθθ(yyy(c), ˆyyy(c),hhh|xxx(c)). Due to the marginalization of hidden variables in log terms, the objective function cannot be analytically optimized. A common approach to optimizing the log marginals is to use the stochastic maximum likelihood method which is also known as persistent contrastive divergence (PCD) [28, 29, 25]. The stochastic maximum likelihood method, or equivalently PCD, can be fundamentally viewed as an Expectation-Maximization (EM) approach to training. The EM algorithm maximizes the variational lower bound that is formed by subtracting the Kullback–Leibler (KL) divergence between a variational approximating distribution q and the true conditional distribution from the log marginal probability. For example, consider the bound for the first term in the objective function: log pθθθ(yyy|xxx) ≥ log pθθθ(yyy|xxx) −KL[q(ˆyyy,hhh|yyy,xxx)||pθθθ(ˆyyy,hhh|yyy,xxx)] (4) = Eq(ˆyyy,hhh|yyy,xxx)[log pθθθ(yyy, ˆyyy,hhh|xxx)] −Eq(ˆyyy,hhh|yyy,xxx)[log q(ˆyyy,hhh|yyy,xxx)] = Uθθθ(xxx,yyy). (5) If the incremental EM approach[30] is taken for training the parameters θθθ, the lower bound Uθθθ(xxx,yyy) is maximized over the noisy training set by iterating between two steps. In the Expectation step (E step), θθθ is fixed and the lower bound is optimized with respect to the conditional distribution q(ˆyyy,hhh|yyy,xxx). Since this distribution is only present in the KL term in Eq. 4, the lower bound is maximized simply by setting q(ˆyyy,hhh|yyy,xxx) to the analytic pθθθ(ˆyyy,hhh|yyy,xxx). In the Maximization step (M step), q is fixed, and the bound is maximized with respect to the model parameters θθθ, which occurs only in the first expectation term in Eq. 5. This expectation can be written as Eq(ˆyyy,hhh|yyy,xxx)[−Eθθθ(yyy, ˆyyy,hhh,xxx)] −log Zθθθ(xxx), which is maximized by updating θθθ in the direction of its gradient, computed using −Eq(ˆyyy,hhh|xxx,yyy)[ ∂ ∂θθθ Eθθθ(yyy, ˆyyy,hhh,xxx)] + Ep(yyy,ˆyyy,hhh|xxx)[ ∂ ∂θθθ Eθθθ(yyy, ˆyyy,hhh,xxx)]. Noting that q(ˆyyy,hhh|yyy,xxx) is set to pθθθ(ˆyyy,hhh|yyy,xxx) in the E step, it becomes clear that the M step is equivalent to the parameter updates in PCD. 3.2 Semi-Supervised Learning Regularized by Auxiliary Distributions The semi-supervised approach infers the latent variables using the conditional q(ˆyyy,hhh|yyy,xxx) = pθθθ(ˆyyy,hhh|yyy,xxx). However, at the beginning of training when the model’s parameters are not trained yet, sampling from the conditional distributions p(ˆyyy,hhh|yyy,xxx) does not necessarily generate the clean labels accurately. The problem is more severe with the strong representation power of CNN-CRFs, as they can easily fit to poor conditional distributions that occur at the beginning of training. That is why the impact of the noisy set on training must be reduced by oversampling clean instances [14, 3]. In contrast, there may exist auxiliary sources of information that can be used to extract the relationship between noisy and clean labels. For example, non-image-related sources may be formed from semantic relatedness of labels [31]. We assume that, in using such sources, we can form an auxiliary distribution paux(yyy, ˆyyy,hhh) representing the joint probability of noisy and clean labels and some hidden binary states. Here, we propose a framework to use this distribution to train parameters in the semisupervised setting by guiding the variational distribution to infer the clean labels more accurately. To do so, we add a new regularization term in the lower bound that penalizes the variational distribution for being different from the conditional distribution resulting from the auxiliary distribution as follows: log pθθθ(yyy|xxx) ≥U aux θθθ (xxx,yyy) = log pθθθ(yyy|xxx)−KL[q(ˆyyy,hhh|yyy,xxx)||pθθθ(ˆyyy,hhh|yyy,xxx)]−αKL[q(ˆyyy,hhh|yyy,xxx)||paux(ˆyyy,hhh|yyy)] where α is a non-negative scalar hyper-parameter that controls the impact of the added KL term. Setting α = 0 recovers the original variational lower bound defined in Eq. 4 whereas α →∞forces the variational distribution q to ignore the pθθθ(ˆyyy,hhh|yyy,xxx) term. A value between these two extremes makes the inference distribution intermediate between pθθθ(ˆyyy,hhh|yyy,xxx) and paux(ˆyyy,hhh|yyy). Note that this new lower bound is actually looser than the original bound. This may be undesired if we were actually interested in predicting noisy labels. However, our goal is to predict clean labels, and the proposed framework benefits from the regularization that is imposed on the variational distribution. Similar ideas have been explored in the posterior regularization approach [32]. Similarly, we also define a new lower bound on the second log marginal in Eq. 3 by: log pθθθ(yyy, ˆyyy|xxx) ≥Laux θθθ (xxx,yyy, ˆyyy) = log pθθθ(yyy, ˆyyy|xxx) −KL[q(hhh|yyy)||pθθθ(hhh|yyy)] −αKL[q(hhh|yyy)||paux(hhh|yyy)]. 4 Auxiliary Distribution: In this paper, the auxiliary joint distribution paux(yyy, ˆyyy,hhh) is modeled by an undirected graphical model in a special form of a restricted Boltzmann machine (RBM), and is trained on the clean training set. The structure of the RBM is similar to the CRF model shown in Fig. 1.b with the fundamental difference that parameters of the model do not depend on xxx: paux(yyy, ˆyyy,hhh) = 1 Zaux exp(−Eaux(yyy, ˆyyy,hhh)) (6) where the energy function is defined by the quadratic function: Eaux(yyy, ˆyyy,hhh) = −aaaT auxˆyyy −bbbT auxyyy −cccT auxhhh −ˆyyyTW W W auxyyy −hhhTW ′ W ′ W ′ auxyyy (7) and Zaux is the partition function, defined similarly to the CRF’s partition function. The number of hidden variables is set to 200 and the parameters of this generative model are trained using the PCD algorithm [28], and are fixed while the CNN-CRF model is being trained. 3.3 Training Robust CNN-CRF In training, we seek θθθ that maximizes the proposed lower bounds on the noisy and clean training sets: max θθθ 1 |DN| X n Uaux θθθ (xxx(n),yyy(n)) + 1 |DC| X c Laux θθθ (xxx(c),yyy(c), ˆyyy(c)). (8) The optimization problem is solved in a two-step iterative procedure as follows: E step: The objective function is optimized with respect to q(ˆyyy,hhh|yyy,xxx) for a fixed θθθ. For Uaux θθθ (xxx,yyy), this is done by solving the following problem: min q KL[q(ˆyyy,hhh|yyy,xxx)||pθθθ(ˆyyy,hhh|yyy,xxx)] + αKL[q(ˆyyy,hhh|yyy,xxx)||paux(ˆyyy,hhh|yyy)]. (9) The weighted average of KL terms above is minimized with respect to q when: q(ˆyyy,hhh|yyy,xxx) ∝[pθθθ(ˆyyy,hhh|yyy,xxx) · pα aux(ˆyyy,hhh|yyy)]( 1 α+1 ) , (10) which is a weighted geometric mean of the true conditional distribution and auxiliary distribution. Given the factorial structure of these distributions, q(ˆyyy,hhh|yyy,xxx) is also a factorial distribution: q(ˆyi = 1|yyy,xxx) = σ  1 α + 1(aaaφφφ(xxx)(i) + W W W (i,:)yyy + αaaaaux(i) + αW W W aux(i,:)yyy)  q(hj = 1|yyy) = σ  1 α + 1(ccc(j) + W W W ′ (j,:)yyy + αcccaux(j) + αW W W ′ aux(j,:)yyy)  . Optimizing Laux θθθ (xxx,yyy, ˆyyy) w.r.t q(hhh|yyy) gives a similar factorial result: q(hhh|yyy) ∝[pθθθ(hhh|yyy) · pα aux(hhh|yyy)]( 1 α+1 ) . (11) M step: Holding q fixed, the objective function is optimized with respect to θθθ. This is achieved by updating θθθ in the direction of the gradient of Eq(ˆyyy,hhh|xxx,yyy)[log pθθθ(yyy, ˆyyy,hhh|xxx)], which is: ∂ ∂θθθUaux θθθ (xxx,yyy) = ∂ ∂θθθEq(ˆyyy,hhh|xxx,yyy)[log pθθθ(yyy, ˆyyy,hhh|xxx)] = −Eq(ˆyyy,hhh|xxx,yyy)[ ∂ ∂θθθEθθθ(yyy, ˆyyy,hhh,xxx)] + Ep(yyy,ˆyyy,hhh|xxx)[ ∂ ∂θθθEθθθ(yyy, ˆyyy,hhh,xxx)], (12) where the first expectation (the positive phase) is defined under the variational distribution q and the second expectation (the negative phase) is defined under the CRF model p(yyy, ˆyyy,hhh|xxx). With the factorial form of q, the first expectation is analytically tractable. The second expectation is estimated by PCD [28, 29, 25]. This approach requires maintaining a set of particles for each training instance that are used for seeding the Markov chains at each iteration of training. The gradient of the lower bound on the clean set is defined similarly: ∂ ∂θθθLaux θθθ (xxx,yyy, ˆyyy) = ∂ ∂θθθEq(hhh|yyy)[log pθθθ(yyy, ˆyyy,hhh|xxx)] = −Eq(hhh|yyy)[ ∂ ∂θθθEθθθ(yyy, ˆyyy,hhh,xxx)] + Ep(yyy,ˆyyy,hhh|xxx)[ ∂ ∂θθθEθθθ(yyy, ˆyyy,hhh,xxx)] (13) 5 with the minor difference that in the positive phase the clean label ˆyyy is given for each instance and the variational distribution is defined over only the hidden variables. Scheduling ααα: Instead of setting α to a fixed value during training, it is set to a very large value at the beginning of training and is slowly decreased to smaller values. The rationale behind this is that at the beginning of training, when pθθθ(ˆyyy,hhh|yyy,xxx) cannot predict the clean labels accurately, it is intuitive to rely more on pretrained paux(ˆyyy,hhh|yyy) when inferring the latent variables. As training proceeds we shift the variational distribution q more toward the true conditional distribution. Algorithm 1 summarizes the learning procedure proposed for training our CRF-CNN. The training is done end-to-end for both CNN and CRF parameters together. In the test time, samples generated by Gibbs sampling from pθθθ(yyy, ˆyyy,hhh|xxx) for the test image xxx are used to compute the marginal pθθθ(ˆyyy|xxx). Algorithm 1: Train robust CNN-CRF with simple gradient descent Input : Noisy dataset DN and clean dataset DC, auxiliary distribution paux(yyy, ˆyyy,hhh), a learning rate parameter ε and a schedule for α Output :Model parameters: θθθ = {φφφ,ccc,W W W,W ′ W ′ W ′} Initialize model parameters while Stopping criteria is not met do foreach minibatch {(xxx(n),yyy(n)), (xxx(c), ˆyyy(c),yyy(c))} = getMinibatch(DN, DC) do Compute q(ˆyyy,hhh|yyy(n),xxx(n)) by Eq.10 for each noisy instance Compute q(hhh|yyy(c)) by Eq. 11 for each clean instance Do Gibbs sweeps to sample from the current pθθθ(yyy, ˆyyy,hhh|xxx(·)) for each clean/noisy instance (mn, mc) ←(# noisy instances in minibatch, # clean instances in minibatch) θθθ ←θθθ + ε 1 mn P n ∂ ∂θθθ Uaux θθθ (xxx(n),yyy(n))  + 1 mc P c ∂ ∂θθθ Laux θθθ (xxx(c),yyy(c), ˆyyy(c)) by Eq.12 and 13 end end 4 Experiments In this section, we examine the proposed robust CNN-CRF model for the image labeling problem. 4.1 Microsoft COCO Dataset The Microsoft COCO 2014 dataset is one of the largest publicly available datasets that contains both noisy and clean object labels. Created from challenging Flickr images, it is annotated with 80 object categories as well as captions describing the images. Following [4], we use the 1000 most common words in the captions as the set of noisy labels. We form a binary vector of this length for each image representing the words present in the caption. We use 73 object categories as the set of clean labels, and form binary vectors indicating whether the object categories are present in the image. We follow the same 87K/20K/20K train/validation/test split as [4], and use mean average precision (mAP) measure over these 73 object categories as the performance assessment. Finally, we use 20% of the training data as the clean labeled training set (DC). The rest of data was used as the noisy training set (DN), in which clean labels were ignored in training. Network Architectures: We use the implementation of ResNet-50 [33] and VGG-16 [34] in TensorFlow as the neural networks that compute the bias coefficients in the energy function of our CRF (Eq. 2). These two networks are applied in a fully convolutional setting to each image. Their features in the final layer are pooled in the spatial domain using an average pooling operation, and these are passed through a fully connected linear layer to generate the bias terms. VGG-16 is used intentionally in order to compare our method directly with [4] that uses the same network. ResNet-50 experiments enable us to examine how our model works with other modern architectures. Misra et al. [4] have reported results when the images were upsampled to 565 pixels. Using upsampled images improves the performance significantly, but they make cross validation significantly slower. Here, we report our results for image sizes of both 224 (small) and 565 pixels (large). Parameters Update: The parameters of all the networks were initialized from ImageNet-trained models that are provided in TensorFlow. The other terms in the energy function of our CRF were all 6 xxx ˆyyy (a) Clean xxx yyy (b) Noisy xxx ˆyyy yyy (c) No link xxx ˆyyy yyy (d) CRF w/o hhh xxx ˆyyy yyy hhh (e) CRF w/ hhh xxx ˆyyy yyy hhh (f) CRF w/o xxx −yyy Figure 2: Visualization of different variations of the model examined in the experiments. initialized to zero. Our gradient estimates can be high variance as they are based on a Monte Carlo estimate. For training, we use Adam [35] updates that are shown to be robust against noisy gradients. The learning rate and epsilon for the optimizer are set to (0.001, 1) and (0.0003, 0.1) respectively in VGG-16 and ResNet-50. We anneal α from 40 to 5 in 11 epochs. Sampling Overhead: Fifty Markov chains per datapoint are maintained for PCD. In each iteration of the training, the chains are retrieved for the instances in the current minibatch, and 100 iterations of Gibbs sampling are applied for negative phase samples. After parameter updates, the final state of chains is stored in memory for the next epoch. Note that we are only required to store the state of the chains for either (ˆyyy,hhh) or yyy. In this experiment, since the size of hhh is 200, the former case is more memory efficient. Storing persistent chains in this dataset requires only about 1 GB of memory. In ResNet-50, sampling increases the training time only by 16% and 8% for small and large images respectively. The overhead is 9% and 5% for small and large images in VGG-16. Baselines: Our proposed method is compared against several baselines visualized in Fig. 2: • Cross entropy loss with clean labels: The networks are trained using cross entropy loss with the all clean labels. This defines a performance upper bound for each network. • Cross entropy loss with noisy labels: The model is trained using only noisy labels. Then, predictions on the noisy labels are mapped to clean labels using the manual mapping in [4]. • No pairwise terms: All the pairwise terms are removed and the model is trained using analytic gradients without any sampling using our proposed objective function in Eq. 8. • CRF without hidden: W W W is trained but W W W ′ is omitted from the model. • CRF with hidden: Both W W W and W W W ′ are present in the model. • CRF without xxx −yyy link: Same as the previous model but bbb is not a function of xxx. • CRF without xxx −yyy link (α = 0 α = 0 α = 0): Same as the previous model but trained with α = 0. The experimental results are reported in Table 1 under “Caption Labels.” A performance increase is observed after adding each component to the model. However, removing the xxx −yyy link generally improves the performance significantly. This may be because removing this link forces the model to rely on ˆyyy and its correlations with yyy for predicting yyy on the noisy labeled set. This can translate to better recognition of clean labels. Last but not least, the CRF model with no xxx −yyy connection trained using α = 0 performed very poorly on this dataset. This demonstrates the importance of the introduced regularization in training. 4.2 Microsoft COCO Dataset with Flickr Tags The images in the COCO dataset were originally gathered and annotated from the Flickr website. This means that these image have actual noisy Flickr tags. To examine the performance of our model on actual noisy labels, we collected these tags for the COCO images using Flickr’s public API. Similar to the previous section, we used the 1024 most common tags as the set of noisy labels. We observed that these tags have significantly more noise compared to the noisy labels in the previous section; therefore, it is more challenging to predict clean labels from them using the auxiliary distribution. In this section, we only examine the ResNet-50 architecture for both small and large image sizes. The different baselines introduced in the previous section are compared against each other in Table 1 under “Flickr Tags.” Auxiliary Distribution vs. Variational Distribution: As the auxiliary distribution paux is fixed, and the variational distribution q is updated using Eq. 10 in each iteration, a natural question is how 7 Table 1: The performance of different baselines on the COCO dataset in terms of mAP (%). Caption Labels (Sec. 4.1) Flickr Tags (Sec. 4.2) ResNet-50 VGG-16 ResNet-50 Baseline Small Large Small Large Small Large Cross entropy loss w/ clean 68.57 78.38 71.99 75.50 68.57 78.38 Cross entropy loss w/ noisy 56.88 64.13 58.59 62.75 No pairwise link 63.67 73.19 66.18 71.78 58.01 67.84 CRF w/o hidden 64.26 73.23 67.73 71.78 59.04 67.22 CRF w/ hidden 65.73 74.04 68.35 71.92 59.19 67.33 CRF w/o xxx −yyy link 66.61 75.00 69.89 73.16 60.97 67.57 CRF w/o xxx −yyy link (α = 0) 48.53 56.53 56.76 56.39 47.25 58.74 Misra et al. [4] 66.8 Fang et al. [36] reported in [4] 63.7 q differs from paux. Since, we have access to the clean labels in the COCO dataset, we examine the accuracy of q in terms of predicting clean labels on the noisy training set (DN) using the mAP measurement at the beginning and end of training the CRF-CNN model (ResNet-50 on large images). We observed that at the beginning of training, when α is big, q is almost equal to paux, which obtains 49.4% mAP on this set. As training iterations proceed, the accuracy of q increases to 69.4% mAP. Note that the 20.0% gain in terms of mAP is very significant, and it demonstrates that combining the auxiliary distribution with our proposed CRF can yield a significant performance gain in inferring latent clean labels. In other words, our proposed model is capable of cleaning the noisy labels and proposing more accurate labels on the noisy set as training continues. Please refer to our supplementary material for a qualitative comparison between q and paux. 4.3 CIFAR-10 Dataset We also apply our proposed learning framework to the object classification problem in the CIFAR-10 dataset. This dataset contains images of 10 objects resized to 32x32-pixel images. We follow the settings in [9] and we inject synthesized noise to the original labels in training. Moreover, we implement the forward and backward losses proposed in [9] and we use them to train ResNet [33] of depth 32 with the ground-truth noise transition matrix. Here, we only train the variant of our model shown in Fig. 2.c that can be trained analytically. For the auxiliary distribution, we trained a simple linear multinomial logistic regression representing the conditional paux(ˆyyy|yyy) with no hidden variables (hhh) . We trained this distribution such that the output probabilities match the ground-truth noise transition matrix. We trained all models for 200 epochs. For our model, we anneal α from 8 to 1 in 10 epochs. Similar to the previous section, we empirically observed that it is better to stop annealing α before it reaches zero. Here, to compare our method with the previous work, we do not work in a semi-supervised setting, and we assume that we have access only to the noisy training dataset. Our goal for this experiment is to demonstrate that a simple variant of our model can be used for training from images with only noisy labels and to show that our model can clean the noisy labels. To do so, we report not only the average accuracy on the clean test dataset, but also the recovery accuracy. The recovery accuracy for our method is defined as the accuracy of q in predicting the clean labels in the noisy training set at the end of learning. For the baselines, we measure the accuracy of the trained neural network p(ˆyyy|xxx) on the same set. The results are reported in Table 2. Overall, our method achieves slightly better prediction accuracy on the CIFAR-10 dataset than the baselines. And, in terms of recovering clean labels on the noisy training set, our model significantly outperforms the baselines. Examples of the recovered clean labels are visualized for the CIFAR-10 experiment in the supplementary material. 5 Conclusion We have proposed a general undirected graphical model for modeling label noise in training deep neural networks. We formulated the problem as a semi-supervised learning problem, and we proposed a novel objective function equipped with a regularization term that helps our variational distribution 8 Table 2: Prediction and recovery accuracy of different baselines on the CIFAR-10 dataset. Prediction Accuracy (%) Recovery Accuracy (%) Noise (%) 10 20 30 40 50 10 20 30 40 50 Cross entropy loss 91.2 90.0 89.1 87.1 80.2 94.1 92.4 89.6 85.2 74.6 Backward [9] 87.4 87.4 84.6 76.5 45.6 88.0 87.4 84.0 75.3 44.0 Forward [9] 90.9 90.3 89.4 88.4 80.0 94.6 93.6 92.3 91.1 83.1 Our model 91.6 91.0 90.6 89.4 84.3 97.7 96.4 95.1 93.5 88.1 infer latent clean labels more accurately using auxiliary sources of information. Our model not only predicts clean labels on unseen instances more accurately, but also recovers clean labels on noisy training sets with a higher precision. We believe the ability to clean noisy annotations is a very valuable property of our framework that will be useful in many application domains. Acknowledgments The author thanks Jason Rolfe, William Macready, Zhengbing Bian, and Fabian Chudak for their helpful discussions and comments. This work would not be possible without the excellent technical support provided by Mani Ranjbar and Oren Shklarsky. References [1] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. ImageNet: A large-scale hierarchical image database. In Computer Vision and Pattern Recognition (CVPR), 2009. [2] J. Lafferty, A. McCallum, and F. Pereira. Conditional random fields: Probabilistic models for segmenting and labeling sequence data. In International Conference on Machine Learning (ICML), 2001. [3] Tong Xiao, Tian Xia, Yi Yang, Chang Huang, and Xiaogang Wang. Learning from massive noisy labeled data for image classification. In Computer Vision and Pattern Recognition (CVPR), 2015. [4] Ishan Misra, C. Lawrence Zitnick, Margaret Mitchell, and Ross Girshick. Seeing through the human reporting bias: Visual classifiers from noisy human-centric labels. In CVPR, 2016. [5] Sainbayar Sukhbaatar, Joan Bruna, Manohar Paluri, Lubomir Bourdev, and Rob Fergus. Training convolutional networks with noisy labels. arXiv preprint arXiv:1406.2080, 2014. [6] B. Frenay and M. Verleysen. Classification in the presence of label noise: A survey. IEEE Transactions on Neural Networks and Learning Systems, 25(5):845–869, 2014. [7] Nagarajan Natarajan, Inderjit S. Dhillon, Pradeep K. Ravikumar, and Ambuj Tewari. Learning with noisy labels. In Advances in neural information processing systems, pages 1196–1204, 2013. [8] Volodymyr Mnih and Geoffrey E. Hinton. Learning to label aerial images from noisy data. In International Conference on Machine Learning (ICML), pages 567–574, 2012. [9] Giorgio Patrini, Alessandro Rozza, Aditya Menon, Richard Nock, and Lizhen Qu. Making neural networks robust to label noise: A loss correction approach. In Computer Vision and Pattern Recognition, 2017. [10] Scott Reed, Honglak Lee, Dragomir Anguelov, Christian Szegedy, Dumitru Erhan, and Andrew Rabinovich. Training deep neural networks on noisy labels with bootstrapping. arXiv preprint arXiv:1412.6596, 2014. [11] Xiaojin Zhu, John Lafferty, and Zoubin Ghahramani. Combining active learning and semi-supervised learning using Gaussian fields and harmonic functions. In ICML, 2003. [12] Rob Fergus, Yair Weiss, and Antonio Torralba. Semi-supervised learning in gigantic image collections. In Advances in neural information processing systems, pages 522–530, 2009. [13] Xinlei Chen and Abhinav Gupta. Webly supervised learning of convolutional networks. In International Conference on Computer Vision (ICCV), 2015. [14] Andreas Veit, Neil Alldrin, Gal Chechik, Ivan Krasin, Abhinav Gupta, and Serge Belongie. Learning from noisy large-scale datasets with minimal supervision. arXiv preprint arXiv:1701.01619, 2017. [15] Guosheng Lin, Chunhua Shen, Anton van den Hengel, and Ian Reid. Efficient piecewise training of deep structured models for semantic segmentation. In Computer Vision and Pattern Recognition (CVPR), 2016. 9 [16] Shuai Zheng, Sadeep Jayasumana, Bernardino Romera-Paredes, Vibhav Vineet, Zhizhong Su, Dalong Du, Chang Huang, and Philip HS Torr. Conditional random fields as recurrent neural networks. In International Conference on Computer Vision (ICCV), 2015. [17] Jian Peng, Liefeng Bo, and Jinbo Xu. Conditional neural fields. In Advances in neural information processing systems, pages 1419–1427, 2009. [18] Thierry Artieres et al. Neural conditional random fields. In Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics, pages 177–184, 2010. [19] Rohit Prabhavalkar and Eric Fosler-Lussier. Backpropagation training for multilayer conditional random field based phone recognition. In Acoustics Speech and Signal Processing (ICASSP), 2010 IEEE International Conference on, pages 5534–5537. IEEE, 2010. [20] Philipp Krähenbühl and Vladlen Koltun. Efficient inference in fully connected CRFs with Gaussian edge potentials. In Advances in Neural Information Processing Systems (NIPS), pages 109–117, 2011. [21] Liang-Chieh Chen, Alexander G. Schwing, Alan L. Yuille, and Raquel Urtasun. Learning deep structured models. In ICML, pages 1785–1794, 2015. [22] Alexander G. Schwing and Raquel Urtasun. Fully connected deep structured networks. arXiv preprint arXiv:1503.02351, 2015. [23] Zhiwei Deng, Arash Vahdat, Hexiang Hu, and Greg Mori. Structure inference machines: Recurrent neural networks for analyzing relations in group activity recognition. In CVPR, 2016. [24] Stephane Ross, Daniel Munoz, Martial Hebert, and J. Andrew Bagnell. Learning message-passing inference machines for structured prediction. In Computer Vision and Pattern Recognition (CVPR), 2011. [25] Alexander Kirillov, Dmitrij Schlesinger, Shuai Zheng, Bogdan Savchynskyy, Philip HS Torr, and Carsten Rother. Joint training of generic CNN-CRF models with stochastic optimization. arXiv preprint arXiv:1511.05067, 2015. [26] Ariadna Quattoni, Sybor Wang, Louis-Philippe Morency, Morency Collins, and Trevor Darrell. Hidden conditional random fields. IEEE transactions on pattern analysis and machine intelligence, 29(10), 2007. [27] Laurens Maaten, Max Welling, and Lawrence K. Saul. Hidden-unit conditional random fields. In International Conference on Artificial Intelligence and Statistics, pages 479–488, 2011. [28] Tijmen Tieleman. Training restricted Boltzmann machines using approximations to the likelihood gradient. In Proceedings of the 25th international conference on Machine learning, pages 1064–1071. ACM, 2008. [29] Laurent Younes. Parametric inference for imperfectly observed Gibbsian fields. Probability theory and related fields, 1989. [30] Radford M. Neal and Geoffrey E. Hinton. A view of the em algorithm that justifies incremental, sparse, and other variants. In Learning in graphical models. 1998. [31] Marcus Rohrbach, Michael Stark, György Szarvas, Iryna Gurevych, and Bernt Schiele. What helps where– and why? Semantic relatedness for knowledge transfer. In Computer Vision and Pattern Recognition (CVPR), 2010. [32] Kuzman Ganchev, Jennifer Gillenwater, Ben Taskar, et al. Posterior regularization for structured latent variable models. Journal of Machine Learning Research, 2010. [33] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Computer Vision and Pattern Recognition, 2016. [34] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. [35] Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. [36] Hao Fang, Saurabh Gupta, Forrest Iandola, Rupesh K. Srivastava, Li Deng, Piotr Dollár, Jianfeng Gao, Xiaodong He, Margaret Mitchell, John C Platt, et al. From captions to visual concepts and back. In Conference on Computer Vision and Pattern Recognition, 2015. 10
2017
602
7,122
Stochastic Mirror Descent in Variationally Coherent Optimization Problems Zhengyuan Zhou Stanford University zyzhou@stanford.edu Panayotis Mertikopoulos Univ. Grenoble Alpes, CNRS, Inria, LIG panayotis.mertikopoulos@imag.fr Nicholas Bambos Stanford University bambos@stanford.edu Stephen Boyd Stanford University boyd@stanford.edu Peter Glynn Stanford University glynn@stanford.edu Abstract In this paper, we examine a class of non-convex stochastic optimization problems which we call variationally coherent, and which properly includes pseudo-/quasiconvex and star-convex optimization problems. To solve such problems, we focus on the widely used stochastic mirror descent (SMD) family of algorithms (which contains stochastic gradient descent as a special case), and we show that the last iterate of SMD converges to the problem’s solution set with probability 1. This result contributes to the landscape of non-convex stochastic optimization by clarifying that neither pseudo-/quasi-convexity nor star-convexity is essential for (almost sure) global convergence; rather, variational coherence, a much weaker requirement, suffices. Characterization of convergence rates for the subclass of strongly variationally coherent optimization problems as well as simulation results are also presented. 1 Introduction The stochastic mirror descent (SMD) method and its variants[1, 7, 8] is arguably one of the most widely used family of algorithms in stochastic optimization – convex and non-convex alike. Starting with the orginal work of [16], the convergence of SMD has been studied extensively in the context of convex programming (both stochastic and deterministic), saddle-point problems, and monotone variational inequalities. Some of the most important contributions in this domain are due to Nemirovski et al. [15], Nesterov [18] and Xiao [23], who provided tight convergence bounds for the ergodic average of SMD in stochastic/online convex programs, variational inequalities, and saddle-point problems. These results were further boosted by recent work on extra-gradient variants of the algorithm [11, 17], and the ergodic relaxation of [8] where the independence assumption on the gradient samples is relaxed and is replaced by a mixing distribution that converges in probability to a well-defined limit. However, all these works focus exclusively on the algorithm’s ergodic average (also known as timeaverage), a mode of convergence which is strictly weaker than the convergence of the algorithm’s last iterate. In addition, most of the analysis focuses on establishing convergence "in expectation" and then leveraging sophisticated martingale concentration inequalities to derive "large deviations" results that hold true with high probability. Last (but certainly not least), the convexity of the objective plays a crucial role: thanks to the monotonicity of the gradient, it is possible to exploit regret-like bounds and transform them to explicit convergence rates.1 1For the role of variational monotonicity in the context of convex programming, see also [22]. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. By contrast, the gradient operator of the non-convex programs studied in this paper does not satisfy any reasonable monotonicity property (such as quasi-/pseudo-monotonicity, monotonicity-plus, or any of the standard variants encountered in the theory of variational inequalities [9]. Furthermore, given that there is no inherent averaging in the algorithm’s last iterate, it is not possible to employ a regret-based analysis such as the one yielding convergence in convex programs. Instead, to establish convergence, we use the stochastic approximation method of Benaïm and Hirsch [2, 3] to compare the evolution of the SMD iterates to the flow of a mean, underlying dynamical system.2 By a judicious application of martingale limit theory, we then exploit variational coherence to show that the last iterate of SMD converges with probability 1, recovering in the process a large part of the convergence analysis of the works mentioned above. Our Contributions. We consider a class of non-convex optimization problems, which we call variationally coherent and which strictly includes convex, pseudo/quasi-convex and star-convex optimization problems. For this class of optimization problems, we show that the last iterate of SMD with probability 1 to a global minimum under i.i.d. gradient samples. To the best of our knowledge, this strong convergence guarantee (almost sure of the last iterate of SMD) is not known even for stochastic convex problems. As such, this results contributes to the landscape of non-convex stochastic optimization by making clear that neither pseudo-/quasi-convexity nor star-convexity is essential for global convergence; rather, variational coherence, a much weaker requirement, suffices. Our analysis leverages the Lyapunov properties of the Fenchel coupling [14], a primal-dual divergence measure that quantifies the distance between primal (decision) variables and dual (gradient) variables, and which serves as an energy function to establish recurrence of SMD (Theorem 3.4). Building on this recurrence, we consider an ordinary differential equation (ODE) approximation of the SMD scheme and, drawing on various results from the theory of stochastic approximation and variational analysis, we connect the solution of this ODE to the last iterate of SMD. In so doing, we establish the algorithm’s convergence with probability 1 from any initial condition (Thereom 4.4) and, to complete the circle, we also provide a convergence rate estimate for the subclass of strongly variationally coherent optimization problems. Importantly, although the ODE approximation of discrete-time Robbins–Monro algorithms has been widely studied in control and stochastic optimization [10, 13], converting the convergence guarantees of the ODE solution back to the discrete-time process is a fairly subtle affair that must be done on an case-by-case basis. Further, even if such conversion goes through, the results typically have the nature of convergence-in-distribution: almost sure convergence is much harder to obtain [5]. 2 Setup and Preliminaries Let X be a convex compact subset of a d-dimensional real space V with norm ∥·∥. Throughout this paper, we focus on the stochastic optimization problem minimize g(x), subject to x ∈X, (Opt) where the objective function g: X →R is of the form g(x) = E[G(x; ξ)] (2.1) for some random function G: X × Ξ →R defined on an underlying (complete) probability space (Ξ, F, P). We make the following assumptions regarding (Opt): Assumption 1. G(x, ξ) is continuously differentiable in x for almost all ξ ∈Ξ. Assumption 2. ∇G(x; ξ) has bounded second moments and is Lipschitz continuous in the mean: E[∥∇G(x; ξ)∥2 ∗] < ∞for all x ∈X and E[∇G(x; ξ)] is Lipschitz on X.3 Assumption 1 is a token regularity assumption which can be relaxed to account for nonsmooth objectives by using subgradient devices (as opposed to gradients). However, this would make 2For related approaches based on the theory of dynamical systems, see [21] and [12]. 3In the above, gradients are treated as elements of the dual space V∗of V and ∥v∥∗= sup{⟨v, x⟩: ∥x∥≤1} denotes the dual norm of v ∈V∗. We also note that ∇G(x; ξ) refers to the gradient of G(x; ξ) with respect to x; since Ξ need not have a differential structure, there is no danger of confusion. 2 the presentation significantly more cumbersome, so we stick with smooth objectives throughout. Assumption 2 is also standard in the stochastic optimization literature: it holds trivially if ∇G is uniformly Lipschitz (another commonly used condition) and, by the dominated convergence theorem, it further implies that g is smooth and ∇g(x) = ∇E[G(x; ξ)] = E[∇G(x; ξ)] is Lipschitz continuous. As a result, the solution set X ∗= arg min g (2.2) of (Opt) is closed and nonempty (by the compactness of X and the continuity of g). Remark 2.1. An important special case of (Opt) is when G(x; ξ) = g(x)+⟨ζ, x⟩for some V∗-valued random vector ζ such that E[ζ] = 0 and E[∥ζ∥2 ∗] < ∞. This gives ∇G(x; ξ) = ∇g(x) + ζ, so (Opt) can also be seen as a model for deterministic optimization problems with noisy gradient observations. 2.1 Variational Coherence With all this at hand, we now define the class of variationally coherent optimization problems: Definition 2.1. We say that (Opt) is variationally coherent if ⟨∇g(x), x −x∗⟩≥0 for all x ∈X, x∗∈X ∗, (VC) with equality if and only if x ∈X ∗. Remark 2.2. (VC) can be interpreted in two ways. First, as stated, it is a non-random condition for g, so it applies equally well to deterministic optimization problems (with or without noisy gradient observations). Alternatively, by the dominated convergence theorem, (VC) can be written as: E[⟨∇G(x; ξ), x −x∗⟩] ≥0. (2.3) In this form, it can be interpreted as saying that G is variationally coherent “on average”, without any individual realization thereof satisfying (VC). Remark 2.3. Importantly, (VC) does not have to be stated in terms of the solution set of (Opt). Indeed, assume that C is a nonempty subset of X such that ⟨∇g(x), x −p⟩≥0 for all x ∈X, p ∈C, (2.4) with equality if and only if x ∈C. Then, as the next lemma (see appendix) indicates, C = arg min g: Lemma 2.2. Suppose that (2.4) holds for some nonempty subset C of X. Then C is closed, convex, and it consists precisely of the global minimizers of g. Corollary 2.3. If (Opt) is variationally coherent, arg min g is convex and compact. Remark 2.4. All the results given in this paper also carry through for λ-variationally coherent optimization problems, a further generalization of variational coherence. More precisely, we say that (Opt) is λ-variationally coherent if there exists a (component-wise) positive vector λ ∈Rd such that d X i=1 λi ∂g ∂xi (xi −x∗ i ) ≥0 for all x ∈X, x∗∈X ∗, (2.5) with equality if and only if x ∈X ∗. For simplicity, our analysis will be carried out in the “vanilla" variational coherence framework, but one should keep in mind that the results to following also hold for λ-coherent problems. 2.2 Examples of Variational Coherence Example 2.1 (Convex programs). If g is convex, ∇g is a monotone operator [19], i.e. ⟨∇g(x) −∇g(x′), x −x′⟩≥0 for all x, x′ ∈X. (2.6) By the first-order optimality conditions for g, we have ⟨g(x∗), x −x∗⟩≥0 for all x ∈X. Hence, by monotonicity, we get ⟨∇g(x), x −x∗⟩≥⟨∇g(x∗), x −x∗⟩≥0 for all x ∈X, x∗∈X ∗. (2.7) By convexity, it follows that ⟨∇g(x), x −x∗⟩< 0 whenever x∗∈X ∗and x ∈X \ X ∗, so equality holds in (2.7) if and only if x ∈X ∗. 3 Example 2.2 (Pseudo/Quasi-convex programs). The previous example shows that variational coherence is a weaker and more general notion than convexity and/or operator monotonicity. In fact, as we show below, the class of variationally coherent problems also contains all pseudo-convex programs, i.e. when ⟨∇g(x), x′ −x⟩≥0 =⇒g(x′) ≥g(x), (PC) for all x, x′ ∈X. In this case, we have: Proposition 2.4. If g is pseudo-convex, (Opt) is variationally coherent. Proof. Take x∗∈X ∗and x ∈X \ X ∗, and assume ad absurdum that ⟨∇g(x), x −x∗⟩≤0. By (PC), this implies that g(x∗) ≥g(x), contradicting the choice of x and x∗. We thus conclude that ⟨∇g(x), x −x∗⟩> 0 for all x∗∈X ∗, x ∈X \ X ∗; since ⟨∇g(x), x −x∗⟩≤0 if x ∈X ∗, our claim follows by continuity. ■ We recall that every convex function is pseudo-convex, and every pseudo-convex function is quasiconvex (i.e. its sublevel sets are convex). Both inclusions are proper, but the latter is fairly thin: Proposition 2.5. Suppose that g is quasi-convex and non-degenerate, i.e. ⟨g(x), z⟩̸= 0 for all nonzero z ∈TC(x), x ∈X \ X ∗, (2.8) where TC(x) is the tangent cone vertexed at x. Then, g is pseudo-convex (and variationally coherent). Proof. This follows from the following characterization of quasi-convex functions [6]: g is quasiconvex if and only if g(x′) ≤g(x) implies that ⟨∇g(x), x′ −x⟩≤0. By contraposition, this yields the strict part of (PC), i.e. g(x′) > g(x) whenever ⟨∇g(x), x′ −x⟩> 0. To complete the proof, if ⟨∇g(x), x′ −x⟩= 0 and x ∈X ∗, (PC) is satisfied trivially; otherwise, if ⟨∇g(x), x′ −x⟩= 0 but x ∈X \ X ∗, (2.8) implies that x′ −x = 0, so g(x′) = g(x) and (PC) is satisfied as an equality. ■ The non-degeneracy condition (2.8) is satisfied by every quasi-convex function after an arbitrarily small perturbation leaving its minimum set unchanged. By this token, Propositions 2.4 and 2.5 imply that essentially all quasi-convex programs are also variationally coherent. Example 2.3 (Star-convex programs). If g is star-convex, then ⟨∇g(x), x −x∗⟩≥g(x) −g(x∗) for all x ∈X, x∗∈X ∗. This is easily seen to be a special case of variational coherence because ⟨∇g(x), x −x∗⟩≥g(x) −g(x∗) ≥0, with the last inequality strict unless x ∈X ∗. Note that star-convex functions contain convex functions as a subclass (but not necessarily pseudo/quasi-convex functions). Example 2.4 (Beyond quasi-/star-convexity). A simple example of a function that is variationally coherent without being quasi-convex or star-convex is given by: g(x) = 2 d X i=1 √ 1 + xi, x ∈[0, 1]d. (2.9) When d ≥2, it is easy to see g is not quasi-convex: for instance, taking d = 2, x = (0, 1) and x′ = (1, 0) yields g(x/2 + x′/2) = 2 √ 6 > 2 √ 2 = max{g(x), g(x′)}, so g is not quasiconvex. It is also instantly clear this function is not star-convex even when d = 1 (in which case it is a concave function). On the other hand, to estabilish (VC), simply note that X ∗= {0} and ⟨∇g(x), x −0⟩= Pd i=1 xi/√1 + xi > 0 for all x ∈[0, 1]d\{0}. For a more elaborate example of a variationally coherent problem that is not quasi-convex, see Figure 2. 2.3 Stochastic Mirror Descent To solve (Opt), we focus on the widely used family of algorithms known as stochastic mirror descent (SMD), formally given in Algorithm 1.4 Heuristically, the main idea of the method is as follows: At each iteration, the algorithm takes as input an independent and identically distributed (i.i.d.) sample 4Mirror descent dates back to the original work of Nemirovski and Yudin [16]. More recent treatments include [1, 8, 15, 18, 20] and many others; the specific variant of SMD that we are considering here is most closely related to Nesterov’s “dual averaging” scheme [18]. 4 X ⊆V Y = V∗ Q Y0 Y1 Y2 −α1∇G(X0; ξ1) −α2∇G(X1; ξ2) X0 X1 X2 Q Q Q Figure 1: Schematic representation of stochastic mirror descent (Algorithm 1). of the gradient of G at the algorithm’s current state. Subsequently, the method takes a step along this stochastic gradient in the dual space Y ≡V∗of V (where gradients live), the result is “mirrored” back to the problem’s feasible region X to obtain a new solution candidate, and the process repeats. In pseudocode form, we have: Algorithm 1 Stochastic mirror descent (SMD) Require: Initial score variable Y0 1: n ←0 2: repeat 3: Xn = Q(Yn) 4: Yn+1 = Yn −αn+1∇G(Xn, ξn+1) 5: n ←n + 1 6: until end 7: return solution candidate Xn In the above representation, the key elements of SMD (see also Fig. 1) are: 1. The “mirror map” Q: Y →X that outputs a solution candidate Xn ∈X as a function of the auxiliary score variable Yn ∈Y. In more detail, the algorithm’s mirror map Q is defined as Q(y) = arg max x∈X {⟨y, x⟩−h(x)}, (2.10) where h(x) is a strongly convex function that plays the role of a regularizer. Different choices of the regularizer h yields different specific algorithm. Due to space limitation, we mention in passing two well-known examples: When h(x) = 1 2∥x∥2 2 (i.e. Euclidean regularizer), mirror descent becomes gradient descent. When h(x) = Pd i=1 xi log xi (i.e. entropic regularizer), mirror descent becomes exponential gradient (aka exponential weights). 2. The step-size sequence αn > 0, chosen to satisfy the “ℓ2 −ℓ1” summability condition: ∞ X n=1 α2 n < ∞, ∞ X n=1 αn = ∞. (2.11) 3. A sequence of i.i.d. gradient samples ∇G(x; ξn+1).5 3 Recurrence of SMD In this section, we characterize an interesting recurrence phenomenon that will be useful later for establishing global convergence. Intuitively speaking, for a variationally coherent program of the 5The specific indexing convention for ξn has been chosen so that Yn and Xn are both adapted to the natural filtration Fn of ξn. 5 general form(Opt), any neighborhood of X ∗will almost surely be visited by iterates Xn infinitely often. Note that this already implies that at least a subsequence of iterates converges to global minima almost surely. To that end, we first define an important divergence measure between a primal variable x and a dual variable y, called Fenchel coupling, that plays an indispensable role of an energy function. Definition 3.1. Let h: X →R be a regularizer with respect to ∥· ∥that is K-strongly convex. 1. The convex conjugate function h∗: Rn →R of h is defined as: h∗(y) = max x∈X {⟨x, y⟩−h(x)}. 2. The mirror map Q: Rn →X associated with the regularizer h is defined as: Q(y) = arg max x∈X {⟨x, y⟩−h(x)}. 3. The Fenchel coupling F : X × Rn →R is defined as: F(x, y) = h(x) −⟨x, y⟩+ h∗(y). Note that the naming of Fenchel coupling is natural as it consists of all the terms in the well-known Fenchel’s inequality: h(x) + h∗(y) ≥⟨x, y⟩. The Fenchel’s inequality says that Fenchel coupling is always non-negative. As indicated by part 1 of the following lemma, a stronger result can be obtained. We state the two key properties Fenchel coupling next. Lemma 3.2. Let h: X →R be a K-strongly convex regularizer on X. Then: 1. F(x, y) ≥1 2K∥Q(y) −x∥2, ∀x ∈X, ∀y ∈Rn. 2. F(x, ˜y) ≤F(x, y) + ⟨˜y −y, Q(y) −x⟩+ 1 2K ∥˜y −y∥2 ∗, ∀x ∈X, ∀˜y, y ∈Rn. We assume that we are working with mirror maps that are regular in the following weak sense:6 Assumption 3. The mirror map Q is regular: if Q(yn) →x, then F(x, yn) →0. Definition 3.3. Given a point x ∈X, a set S ⊂X and a norm ∥· ∥. 1. Define the point-to-set normed distance and Fenchel coupling distance respectively as: dist(x, S) ≜infs∈S ∥x −s∥and F(S, y) = infs∈S F(s, y). 2. Given ε > 0, define B(S, ε) ≜{x ∈X | dist(x, S) < ε}. 3. Given δ > 0, define ˜B(S, δ) ≜{Q(y) | F(S, y) < δ}. We then have the following recurrence result for a variationally coherent optimization problem Opt. Theorem 3.4. Under Assumptions 1–3, for any ε > 0, δ > 0 and any Xn, the (random) iterates Xn generated in Algorithm 1 enter both B(X ∗, ε) and ˜B(X ∗, δ) infinitely often almost surely. 4 Global Convergence Results 4.1 Deterministic Convergence When a perfect gradient ∇g(x) is available (in Line 4 of Algorithm 1), SMD recovers its deterministic counterpart: mirror descent (Algorithm 2). We first characterize global convergence in this case. 6Mirror maps induced by many common regularizers are regular, including the Euclidean regularizer and the entropic regularizer. 6 - -    - -           Figure 2: Convergence of stochastic mirror descent for the mean objective g(r, θ) = (2 + cos θ/2 + cos(4θ))r2(5/3 −r) expressed in polar coordinates over the unit ball (r ≤1). In the left subfigure, we have plotted the graph of g; the plot to the right superimposes a typical SMD trajectory over the contours of g. Algorithm 2 Mirror descent (MD) Require: Initial score variable y0 1: n ←0 2: repeat 3: xn = Q(yn) 4: xn+1 = xn −αn+1∇g(xn) 5: n ←n + 1 6: until end 7: return solution candidate xn Theorem 4.1. Consider an optimization problem Opt that is variationally coherent. Let xn be the iterates generated by MD. Under Assumption 3, limt→∞dist(xn, X ∗) = 0, for any y0. Remark 4.1. Here we do not require ∇g(x) to be Lipschitz continuous. If ∇g(x) is indeed (locally) Lipschitz continuous, then Theorem 4.1 follows directly from Theorem 4.4. Otherwise, Theorem 4.1 requires a different argument, briefly outlined as follows. Theorem 3.4 implies that (in the special case of perfect gradient), iterates xn generated from MD enter B(X ∗, ε) infinitely often. Now, by exploiting the properties of Fenchel coupling on a finer-grained level (compared to only using it to establish recurrence), we can establish that for any ε-neighborhood B(X ∗, ε), after a certain number of iterations, once the iterate xn enters B(X ∗, ε), it will never exit. Convergence therefore follows. 4.2 Stochastic Almost Sure Convergence We begin with minimal mathematical preliminaries [4] needed that will be needed. Definition 4.2. A semiflow Φ on a metric space (M, d) is a continuous map Φ : R+ × M →M: (t, x) →Φt(x), such that the semi-group properties hold: Φ0 = identity, Φt+s = Φt ◦Φs for all (t, s) ∈R+ × R+. Definition 4.3. Let Φ be a semiflow on the metric space (M, d). A continuous function s : R+ →M is an asymptotic pseudotrajectory (APT) for Φ if for every T > 0, the following holds: lim t→∞sup 0≤h≤T d(s(t + h), Φh(s(t))) = 0. (4.1) We are now ready to state the convergence result. See Figure 2 for a simulation example. Theorem 4.4. Consider an optimization problem Opt that is variationally coherent. Let Xn be the iterates generated by SMD (Algorithm 1). Under Assumptions 1–3, if ∇g(x) is locally Lipschitz continuous on X, then dist(xn, X ∗) →0 almost surely as t →∞, irrespective of Y0. 7 Remark 4.2. The proof is rather involved and contains several ideas. To enhance the intuition and understanding, we outline the main steps here, each of which will be proved in detail in the appendix. To simplify the notation, we assume there is a unique optimal (i.e. X ∗is a singleton set). The proof is identical in the multiple minima case, provide we replace x∗by X ∗and use the point-to-set distance. 1. We consider the following ODE approximation of SMD: ˙y = v(x), x = Q(y), where v(x) = −∇g(x). We verify that the ODE admits a unique solution for y(t) for any initial condition. Consequently, this solution induces a semiflow7, which we denote Φt(y): it is the state at time t given it starts at y initially. Note that we have used y as the initial point (as opposed to y0) to indicate that the semiflow representing the solution trajectory should be viewed as a function of the initial point y. 2. We now relate the iterates generated by SMD to the above ODE’s solution. Connect linearly the SMD iterates Y1, Y2, . . . , Yk, . . . at times 0, α1, α1 +α2, . . . , Pk−1 i=0 αi, . . . respectively to form a continuous, piecewise affine (random) curve Y (t). We then show that Y (t) is almost surely an asymptotic pseudotrajectory of the semi-flow Φ induced by the above ODE. 3. Having characterized the relation between the SMD trajectory (affine interpolation of the discrete SMD iterates) and the ODE trajectory (the semi-flow), we now turn to studying the latter (the semiflow given by the ODE trajectory). A desirable property of Φt(y) is that the distance F(x∗, Φt(y)) between the optimal solution x∗and the dual variable Φt(y) (as measured by Fenchel coupling) can never increase as a function of t. We refer to this as the monotonicity property of Fenchel coupling under the ODE trajectory, to be contrasted to the discrete-time dynamics, where such monotonicity is absent (even when perfect information on the gradient is available). More formally, we show that ∀y, ∀0 ≤s ≤t, F(x∗, Φs(y)) ≥F(x∗, Φt(y)). (4.2) 4. Continuing on the previous point, not only the distance F(x∗, Φt(y)) can never increase as t increases, but also, provided that Φt(y) is not too close to x∗, F(x∗, Φt(y)) will decrease no slower than linearly. This suggests that either Φt(y) is already close to x∗(and hence x(t) = Q(Φt(y)) is close to x∗), or their distance will be decreased by a meaningful amount in (at least) the ensuing short time-frame. We formalize this discussion as follows: ∀ε > 0, ∀y, ∃s > 0, F(x∗, Φs(y)) ≤max{ε 2, F(x∗, y) −ε 2}. (4.3) 5. Now consider an arbitrary fixed horizon T. If at time t, F(x∗, Φ0(Y (t))) is small, then by the monotonicity property in Claim 3, F(x∗, Φh(Y (t))) will remain small on the entire interval h ∈[0, T]. Since Y (t) is an asymptotic pseudotrajectory of Φ (Claim 2), Y (t + h) and Φh(Y (t)) should be very close for h ∈[0, T], at least for t large enough. This means that F(x∗, Y (t + h)) should also be small on the entire interval h ∈[0, T]. This can be made precise as follows: ∀ε, T > 0, ∃τ(ε, T) > 0 such that ∀t ≥τ, ∀h ∈[0, T]: F(x∗, Y (t + h)) < F(x∗, Φh(Y (t))) + ε 2, a.s.. (4.4) 6. Finally, we are ready to put the above pieces together. Claim 5 gives us a way to control the amount by which the two Fenchel coupling functions differ on the interval [0, T]. Claim 3 and Claim 4 together allow us to extend such control over successive intervals [T, 2T), [2T, 3T), . . . , thereby establishing that, at least for t large enough, if F(x∗, Y (t)) is small, then F(x∗, Y (t + h)) will remains small ∀h > 0. As it turns out, this means that after long enough time, if xn ever visits ˜B(x∗, ε), it will (almost surely) be forever trapped inside the neighborhood twice that size (i.e. ˜B(x∗, 2ε)). Since Theorem 3.4 ensures that xn visits ˜B(x∗, ε) infinitively often (almost surely), the hypothesis is guaranteed to be true. Consequently, this leads to the following claim: ∀ε > 0, ∃τ0 (a positive integer), such that: F(x∗, Y (τ0 + h)) < ε, ∀h ∈[0, ∞), a.s.. (4.5) 7A crucial point to note is that since C may not be invertible, there may not exist a unique solution for x(t). 8 △ △ △ △ △ △ △△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△△ △△△ △△△△△△△ △△△△△△ △ △△ △△△ △△△△△△△ △△△△△△ △ △△△△ △△△△△△ △ △△ △△ △ △△ △ △△ △ △ △ ◇ ◇ ◇ ◇ ◇ ◇ ◇ ◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇ △   ◇           -                 Figure 3: SMD run on the objective function of Fig. 2 with γn ∝n−1/2 and Gaussian random noise with standard deviation about 150% the mean value of the gradient. Due to the lack of convexity, the algorithm’s last iterate converges much faster than its ergodic average. To conclude, Equation (4.5) implies that F(x∗, Yn) →0, a.s. as t →∞, where the SMD iterates Yn are values at integer time points of the affine trajectory Y (τ). Per Statement 1 in Lemma 3.2, this gives ∥Q(Yn) −x∗∥→0, a.s. as t →∞, thereby establishing that Xn = Q(Yn) →x∗, a.s.. 4.3 Convergence Rate Analysis At the level of generality at which (VC) has been stated, it is unlikely that any convergence rate can be obtained, because unlike in the convex case, one has no handle on measuring the progress of mirror descent updates (recall that in (VC), only non-negativity is guaranteed for the inner product). Consequently, we focus here on the class of strongly coherent problems (a generalization of strongly convex problems) and derive a O(1/ √ T) convergence rate in terms of the squared distance to a solution of (Opt). Definition 4.5. We say that g is c-strongly variationally coherent (or c-strongly coherent for short) if, for some x∗∈X, we have: ⟨∇g(x), x −x∗⟩≥c 2∥x −x∗∥2 for all x ∈X. (4.6) Theorem 4.6. If (Opt) is c-strongly coherent, then ∥¯xT −x∗∥2 ≤2 c F (x∗,y0)+ B 2K PT n=0 γ2 n PT n=0 γn , where ¯xT = PT n=0 γnxn PT n=0 γn , K is the strong convexity coefficient of h and B = maxx∈X ∥∇g(x)∥2 ∗. The proof of Theorem 4.6 is given in the supplement. We mention a few implications of Theorem 4.6. First, in a strongly coherent optimization problem, if γn = 1 √n, then ∥¯xT −x∗∥2 = O( log T √ T ) (note that here ℓ2 −ℓ1 summability is not required for global convergence). By appropriately choosing the step-size sequence, one can further shave off the log T term above and obtain an O(1/ √ T) convergence rate. This rate matches existing rates when applying gradient descent to strongly convex functions, although strongly variational coherence is a strict superset of strong convexity. Finally, note that even though we have characterized the rates in the mirror descent (i.e. perfect gradient case), one can easily obtain a mean O(1/ √ T) rate in the stochastic case by using a similar argument. This discussion is omitted due to space limitation. We end the section (and the paper) with an interesting observation from the simulation shown in Figure 3. The rate characterized in Theorem 4.6 is with respect to the ergodic average of the mirror descent iterates, while global convergence results established in Theorem 4.1 and Theorem 4.4 are both last iterate convergence. Figure 3 then provides a convergence speed comparison on the function given in Figure 2. It is apparent that the last iterate of SMD (more specifically, stochastic gradient descent) converges much faster than the ergodic average in this non-convex objective. 9 5 Acknowledgments Zhengyuan Zhou is supported by Stanford Graduate Fellowship and would like to thank Yinyu Ye and Jose Blanchet for constructive discussions and feedback. Panayotis Mertikopoulos gratefully acknowledges financial support from the Huawei Innovation Research Program ULTRON and the ANR JCJC project ORACLESS (grant no. ANR–16–CE33–0004–01). References [1] A. BECK AND M. TEBOULLE, Mirror descent and nonlinear projected subgradient methods for convex optimization, Operations Research Letters, 31 (2003), pp. 167–175. [2] M. BENAÏM, Dynamics of stochastic approximation algorithms, in Séminaire de Probabilités XXXIII, J. Azéma, M. Émery, M. Ledoux, and M. Yor, eds., vol. 1709 of Lecture Notes in Mathematics, Springer Berlin Heidelberg, 1999, pp. 1–68. [3] M. BENAÏM AND M. W. HIRSCH, Asymptotic pseudotrajectories and chain recurrent flows, with applications, Journal of Dynamics and Differential Equations, 8 (1996), pp. 141–176. [4] M. BENAÏM AND M. W. HIRSCH, Asymptotic pseudotrajectories and chain recurrent flows, with applications, Journal of Dynamics and Differential Equations, 8 (1996), pp. 141–176. [5] V. S. BORKAR, Stochastic Approximation: A Dynamical Systems Viewpoint, Cambridge University Press and Hindustan Book Agency, 2008. [6] S. BOYD AND L. VANDENBERGHE, Convex Optimization, Berichte über verteilte messysteme, Cambridge University Press, 2004. [7] N. CESA-BIANCHI, P. GAILLARD, G. LUGOSI, AND G. STOLTZ, Mirror descent meets fixed share (and feels no regret), in Advances in Neural Information Processing Systems, 989-997, ed., vol. 25, 2012. [8] J. C. DUCHI, A. AGARWAL, M. JOHANSSON, AND M. I. JORDAN, Ergodic mirror descent, SIAM Journal on Optimization, 22 (2012), pp. 1549–1578. [9] F. FACCHINEI AND J.-S. PANG, Finite-Dimensional Variational Inequalities and Complementarity Problems, Springer Series in Operations Research, Springer, 2003. [10] S. GHADIMI AND G. LAN, Stochastic first-and zeroth-order methods for nonconvex stochastic programming, SIAM Journal on Optimization, 23 (2013), pp. 2341–2368. [11] A. JUDITSKY, A. S. NEMIROVSKI, AND C. TAUVEL, Solving variational inequalities with stochastic mirror-prox algorithm, Stochastic Systems, 1 (2011), pp. 17–58. [12] W. KRICHENE, A. BAYEN, AND P. BARTLETT, Accelerated mirror descent in continuous and discrete time, in NIPS ’15: Proceedings of the 29th International Conference on Neural Information Processing Systems, 2015. [13] H. KUSHNER AND G. YIN, Stochastic Approximation and Recursive Algorithms and Applications, Stochastic Modelling and Applied Probability, Springer New York, 2013. [14] P. MERTIKOPOULOS, Learning in games with continuous action sets and unknown payoff functions. https://arxiv.org/abs/1608.07310, 2016. [15] A. S. NEMIROVSKI, A. JUDITSKY, G. G. LAN, AND A. SHAPIRO, Robust stochastic approximation approach to stochastic programming, SIAM Journal on Optimization, 19 (2009), pp. 1574–1609. [16] A. S. NEMIROVSKI AND D. B. YUDIN, Problem Complexity and Method Efficiency in Optimization, Wiley, New York, NY, 1983. [17] Y. NESTEROV, Dual extrapolation and its applications to solving variational inequalities and related problems, Mathematical Programming, 109 (2007), pp. 319–344. [18] , Primal-dual subgradient methods for convex problems, Mathematical Programming, 120 (2009), pp. 221–259. [19] R. T. ROCKAFELLAR AND R. J. B. WETS, Variational Analysis, vol. 317 of A Series of Comprehensive Studies in Mathematics, Springer-Verlag, Berlin, 1998. [20] S. SHALEV-SHWARTZ, Online learning and online convex optimization, Foundations and Trends in Machine Learning, 4 (2011), pp. 107–194. [21] W. SU, S. BOYD, AND E. J. CANDÈS, A differential equation for modeling Nesterov’s accelerated gradient method: Theory and insights, in NIPS ’14: Proceedings of the 27th International Conference on Neural Information Processing Systems, 2014, pp. 2510–2518. [22] A. WIBISONO, A. C. WILSON, AND M. I. JORDAN, A variational perspective on accelerated methods in optimization, Proceedings of the National Academy of Sciences of the USA, 113 (2016), pp. E7351–E7358. [23] L. XIAO, Dual averaging methods for regularized stochastic learning and online optimization, Journal of Machine Learning Research, 11 (2010), pp. 2543–2596. 10
2017
603
7,123
Polynomial Codes: an Optimal Design for High-Dimensional Coded Matrix Multiplication Qian Yu∗, Mohammad Ali Maddah-Ali†, and A. Salman Avestimehr∗ ∗Department of Electrical Engineering, University of Southern California, Los Angeles, CA, USA † Nokia Bell Labs, Holmdel, NJ, USA Abstract We consider a large-scale matrix multiplication problem where the computation is carried out using a distributed system with a master node and multiple worker nodes, where each worker can store parts of the input matrices. We propose a computation strategy that leverages ideas from coding theory to design intermediate computations at the worker nodes, in order to optimally deal with straggling workers. The proposed strategy, named as polynomial codes, achieves the optimum recovery threshold, defined as the minimum number of workers that the master needs to wait for in order to compute the output. This is the first code that achieves the optimal utilization of redundancy for tolerating stragglers or failures in distributed matrix multiplication. Furthermore, by leveraging the algebraic structure of polynomial codes, we can map the reconstruction problem of the final output to a polynomial interpolation problem, which can be solved efficiently. Polynomial codes provide order-wise improvement over the state of the art in terms of recovery threshold, and are also optimal in terms of several other metrics including computation latency and communication load. Moreover, we extend this code to distributed convolution and show its order-wise optimality. 1 Introduction Matrix multiplication is one of the key building blocks underlying many data analytics and machine learning algorithms. Many such applications require massive computation and storage power to process large-scale datasets. As a result, distributed computing frameworks such as Hadoop MapReduce [1] and Spark [2] have gained significant traction, as they enable processing of data sizes at the order of tens of terabytes and more. As we scale out computations across many distributed nodes, a major performance bottleneck is the latency in waiting for slowest nodes, or “stragglers” to finish their tasks [3]. The current approaches to mitigate the impact of stragglers involve creation of some form of “computation redundancy”. For example, replicating the straggling task on another available node is a common approach to deal with stragglers (e.g., [4]). However, there have been recent results demonstrating that coding can play a transformational role for creating and exploiting computation redundancy to effectively alleviate the impact of stragglers [5, 6, 7, 8, 9]. Our main result in this paper is the development of optimal codes, named polynomial codes, to deal with stragglers in distributed high-dimensional matrix multiplication, which also provides order-wise improvement over the state of the art. More specifically, we consider a distributed matrix multiplication problem where we aim to compute C = A⊺B from input matrices A and B. As shown in Fig. 1, the computation is carried out using a distributed system with a master node and N worker nodes that can each store 1 m fraction of A and 1 n fraction of B, for some parameters m, n ∈N+. We denote the stored submtarices at each 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. worker i ∈{0, . . . , N −1} by ˜Ai and ˜Bi, which can be designed as arbitrary functions of A and B respectively. Each worker i then computes the product ˜A⊺ i ˜Bi and returns the result to the master. . . . . . . . . . Figure 1: Overview of the distributed matrix multiplication framework. Coded data are initially stored distributedly at N workers according to data assignment. Each worker computes the product of the two stored matrices and returns it to the master. By carefully designing the computation strategy, the master can decode given the computing results from a subset of workers, without having to wait for the stragglers (worker 1 in this example). By carefully designing the computation strategy at each worker (i.e. designing ˜Ai and ˜Bi), the master only needs to wait for the fastest subset of workers before recovering output C, hence mitigating the impact of stragglers. Given a computation strategy, we define its recovery threshold as the minimum number of workers that the master needs to wait for in order to compute C. In other words, if any subset of the workers with size no smaller than the recovery threshold finish their jobs, the master is able to compute C. Given this formulation, we are interested in the following main problem. What is the minimum possible recovery threshold for distributed matrix multiplication? Can we find an optimal computation strategy that achieves the minimum recovery threshold, while allowing efficient decoding of the final output at the master node? There have been two computing schemes proposed earlier for this problem that leverage ideas from coding theory. The first one, introduced in [5] and extended in [10], injects redundancy in only one of the input matrices using maximum distance separable (MDS) codes [11] 1. We illustrate this approach, referred to as one dimensional MDS code (1D MDS code), using the example shown in Fig. 2a, where we aim to compute C = A⊺B using 3 workers that can each store half of A and the entire B. The 1D MDS code evenly divides A along the column into two submatrices denoted by A0 and A1, encodes them into 3 coded matrices A0, A1, and A0 + A1, and then assigns them to the 3 workers. This design allows the master to recover the final output given the results from any 2 of the 3 workers, hence achieving a recovery threshold of 2. More generally, one can show that the 1D MDS code achieves a recovery threshold of K1D-MDS ≜N −N n + m = Θ(N). (1) An alternative computing scheme was recently proposed in [10] for the case of m = n, referred to as the product code, which instead injects redundancy in both input matrices. This coding technique has also been proposed earlier in the context of Fault Tolerant Computing in [12, 13]. As demonstrated in Fig. 2b, product code aligns workers in an √ N−by− √ N layout. A is divided along the columns into m submatrices, encoded using an ( √ N, m) MDS code into √ N coded matrices, and then assigned to the √ N columns of workers. Similarly √ N coded matrices of B are created and assigned to the √ N rows. Given the property of MDS codes, the master can decode an entire row after obtaining any m results in that row; likewise for the columns. Consequently, the master can recover the final output using a peeling algorithm, iteratively decoding the MDS codes on rows and columns until the output C is completely available. For example, if the 5 computing results A⊺ 1B0, A⊺ 1B1, (A0 + A1)⊺B1, A⊺ 0(B0 + B1), and A⊺ 1(B0 + B1) are received as demonstrated in Fig. 2b, the master can recover the 1An (n, k) MDS code is a linear code which transforms k raw inputs to n coded outputs, such that from any subset of size k of the outputs, the original k inputs can be recovered. 2 needed results by computing A⊺ 0B1 = (A0 +A1)⊺B1 −A⊺ 1B1 then A⊺ 0B0 = A⊺ 0(B0 +B1)−A⊺ 0B1. In general, one can show that the product code achieves a recovery threshold of Kproduct ≜2(m −1) √ N −(m −1)2 + 1 = Θ( √ N), (2) which significantly improves over K1D-MDS. (a) 1D MDS-code [5] in an example with 3 workers that can each store half of A and the entire B. (b) Product code [10] in an example with 9 workers that can each store half of A and half of B. Figure 2: Illustration of (a) 1D MDS code, and (b) product code. In this paper, we show that quite interestingly, the optimum recovery threshold can be far less than what the above two schemes achieve. In fact, we show that the minimum recovery threshold does not scale with the number of workers (i.e. Θ(1)). We prove this fact by designing a novel coded computing strategy, referred to as the polynomial code, which achieves the optimum recovery threshold of mn, and significantly improves the state of the art. Hence, our main result is as follows. For a general matrix multiplication task C = A⊺B using N workers, where each worker can store 1 m fraction of A and 1 n fraction of B, we propose polynomial codes that achieve the optimum recovery threshold of Kpoly ≜mn = Θ(1). (3) Furthermore, polynomial code only requires a decoding complexity that is almost linear to the input size. The main novelty and advantage of the proposed polynomial code is that, by carefully designing the algebraic structure of the encoded submatrices, we ensure that any mn intermediate computations at the workers are sufficient for recovering the final matrix multiplication product at the master. This in a sense creates an MDS structure on the intermediate computations, instead of only the encoded matrices as in prior works. Furthermore, by leveraging the algebraic structure of polynomial codes, we can then map the reconstruction problem of the final output at the master to a polynomial interpolation problem (or equivalently Reed-Solomon decoding [14]), which can be solved efficiently [15]. This mapping also bridges the rich theory of algebraic coding and distributed matrix multiplication. We prove the optimality of polynomial code by showing that it achieves the information theoretic lower bound on the recovery threshold, obtained by cut-set arguments (i.e., we need at least mn matrix blocks returned from workers to recover the final output, which exactly have size mn blocks). Hence, the proposed polynomial code essentially enables a specific computing strategy such that, from any subset of workers that give the minimum amount of information needed to recover C, the master can successfully decode the final output. As a by-product, we also prove the optimality of polynomial code under several other performance metrics considered in previous literature: computation latency [5, 10], probability of failure given a deadline [9], and communication load [16, 17, 18]. We extend the polynomial code to the problem of distributed convolution [9]. We show that by simply reducing the convolution problem to matrix multiplication and applying the polynomial code, we strictly and unboundedly improve the state of the art. Furthermore, by exploiting the computing structure of convolution, we propose a variation of the polynomial code, which strictly reduces the recovery threshold even further, and achieves the optimum recovery threshold within a factor of 2. Finally, we implement and benchmark the polynomial code on an Amazon EC2 cluster. We measure the computation latency and empirically demonstrate its performance gain under straggler effects. 3 2 System Model, Problem Formulation, and Main Result We consider a problem of matrix multiplication with two input matrices A ∈Fs×r q and B ∈Fs×t q , for some integers r, s, t and a sufficiently large finite field Fq. We are interested in computing the product C ≜A⊺B in a distributed computing environment with a master node and N worker nodes, where each worker can store 1 m fraction of A and 1 n fraction of B, for some parameters m, n ∈N+ (see Fig. 1). We assume at least one of the two input matrices A and B is tall (i.e. s ≥r or s ≥t), because otherwise the output matrix C would be rank inefficient and the problem is degenerated. Specifically, each worker i can store two matrices ˜Ai ∈F s× r m q and ˜Bi ∈F s× t n q , computed based on arbitrary functions of A and B respectively. Each worker can compute the product ˜Ci ≜˜A⊺ i ˜Bi, and return it to the master. The master waits only for the results from a subset of workers, before proceeding to recover the final output C given these products using certain decoding functions.2 2.1 Problem Formulation Given the above system model, we formulate the distributed matrix multiplication problem based on the following terminology: We define the computation strategy as the 2N functions, denoted by f = (f0, f1, ..., fN−1), g = (g0, g1, ..., gN−1), (4) that are used to compute each ˜Ai and ˜Bi. Specifically, ˜Ai = fi(A), ˜Bi = gi(B), ∀i ∈{0, 1, ..., N −1}. (5) For any integer k, we say a computation strategy is k-recoverable if the master can recover C given the computing results from any k workers. We define the recovery threshold of a computation strategy, denoted by k(f, g), as the minimum integer k such that computation strategy (f, g) is k-recoverable. Using the above terminology, we define the following concept: Definition 1. For a distributed matrix multiplication problem of computing A⊺B using N workers that can each store 1 m fraction of A and 1 n fraction of B, we define the optimum recovery threshold, denoted by K∗, as the minimum achievable recovery threshold among all computation strategies, i.e. K∗≜min f,g k(f, g). (6) The goal of this problem is to find the optimum recovery threshold K∗, as well as a computation strategy that achieves such an optimum threshold. 2.2 Main Result Our main result is stated in the following theorem: Theorem 1. For a distributed matrix multiplication problem of computing A⊺B using N workers that can each store 1 m fraction of A and 1 n fraction of B, the minimum recovery threshold K∗is K∗= mn. (7) Furthermore, there is a computation strategy, referred to as the polynomial code, that achieves the above K∗while allowing efficient decoding at the master node, i.e., with complexity equal to that of polynomial interpolation given mn points. Remark 1. Compared to the state of the art [5, 10], the polynomial code provides order-wise improvement in terms of the recovery threshold. Specifically, the recovery thresholds achieved by 1D MDS code [5, 10] and product code [10] scale linearly with N and √ N respectively, while the proposed polynomial code actually achieves a recovery threshold that does not scale with N. Furthermore, polynomial code achieves the optimal recovery threshold. To the best of our knowledge, this is the first optimal design proposed for the distributed matrix multiplication problem. 2Note that we consider the most general model and do not impose any constraints on the decoding functions. However, any good decoding function should have relatively low computation complexity. 4 Remark 2. We prove the optimality of polynomial code using a matching information theoretic lower bound, which is obtained by applying a cut-set type argument around the master node. As a by-product, we can also prove that the polynomial code simultaneously achieves optimality in terms of several other performance metrics, including the computation latency [5, 10], the probability of failure given a deadline [9], and the communication load [16, 17, 18], as discussed in Section 3.4. Remark 3. The polynomial code not only improves the state of the art asymptotically, but also gives strict and significant improvement for any parameter values of N, m, and n (See Fig. 3 for example). Figure 3: Comparison of the recovery thresholds achieved by the proposed polynomial code and the state of the arts (1D MDS code [5] and product code [10]), where each worker can store 1 10 fraction of each input matrix. The polynomial code attains the optimum recovery threshold K∗, and significantly improves the state of the art. Remark 4. As we will discuss in Section 3.2, decoding polynomial code can be mapped to a polynomial interpolation problem, which can be solved in time almost linear to the input size [15]. This is enabled by carefully designing the computing strategies at the workers, such that the computed products form a Reed-Solomon code [19] , which can be decoded efficiently using any polynomial interpolation algorithm or Reed-Solomon decoding algorithm that provides the best performance depending on the problem scenario (e.g., [20]). Remark 5. Polynomial code can be extended to other distributed computation applications involving linear algebraic operations. In Section 4, we focus on the problem of distributed convolution, and show that we can obtain order-wise improvement over the state of the art (see [9]) by directly applying the polynomial code. Furthermore, by exploiting the computing structure of convolution, we propose a variation of the polynomial code that achieves the optimum recovery threshold within a factor of 2. Remark 6. In this work we focused on designing optimal coding techniques to handle stragglers issues. The same technique can also be applied to the fault tolerance computing setting (e.g., within the algorithmic fault tolerance computing framework of [12, 13], where a module can produce arbitrary error results under failure), to improve robustness to failures in computing. Given that the polynomial code produces computing results that are coded by Reed-Solomon code, which has the optimum hamming distance, it allows detecting, or correcting the maximum possible number of module errors. Specifically, polynomial code can robustly detect up to N −mn errors, and correct up to ⌊N−mn 2 ⌋errors. This provides the first optimum code for matrix multiplication under fault tolerance computing. 3 Polynomial Code and Its Optimality In this section, we formally describe the polynomial code and its decoding procedure. We then prove its optimality with an information theoretic converse, which completes the proof of Theorem 1. Finally, we conclude this section with the optimality of polynomial code under other settings. 3.1 Motivating Example We first demonstrate the main idea through a motivating example. Consider a distributed matrix multiplication task of computing C = A⊺B using N = 5 workers that can each store half of the matrices (see Fig. 4). We evenly divide each input matrix along the column side into 2 submatrices: A = [A0 A1], B = [B0 B1]. (8) Given this notation, we essentially want to compute the following 4 uncoded components: C = A⊺B =  A⊺ 0B0 A⊺ 0B1 A⊺ 1B0 A⊺ 1B1  . (9) 5 Figure 4: Example using polynomial code, with 5 workers that can each store half of each input matrix. (a) Computation strategy: each worker i stores A0 +iA1 and B0 +i2B1, and computes their product. (b) Decoding: master waits for results from any 4 workers, and decodes the output using fast polynomial interpolation algorithm. Now we design a computation strategy to achieve the optimum recovery threshold of 4. Suppose elements of A, B are in F7, let each worker i ∈{0, 1, ..., 4} store the following two coded submatrices: ˜Ai = A0 + iA1, ˜Bi = B0 + i2B1. (10) To prove that this design gives a recovery threshold of 4, we need to design a valid decoding function for any subset of 4 workers. We demonstrate this decodability through a representative scenario, where the master receives the computation results from workers 1, 2, 3, and 4, as shown in Figure 4. The decodability for the other 4 possible scenarios can be proved similarly. According to the designed computation strategy, we have   ˜C1 ˜C2 ˜C3 ˜C4  =   10 11 12 13 20 21 22 23 30 31 32 33 40 41 42 43     A⊺ 0B0 A⊺ 1B0 A⊺ 0B1 A⊺ 1B1  . (11) The coefficient matrix in the above equation is a Vandermonde matrix, which is invertible because its parameters 1, 2, 3, 4 are distinct in F7. So one way to recover C is to directly invert equation (11), which proves the decodability. However, directly computing this inverse using the classical inversion algorithm might be expensive in more general cases. Quite interestingly, because of the algebraic structure we designed for the computation strategy (i.e., equation (10)), the decoding process can be viewed as a polynomial interpolation problem (or equivalently, decoding a Reed-Solomon code). Specifically, in this example each worker i returns ˜Ci = ˜A⊺ i ˜Bi = A⊺ 0B0 + iA⊺ 1B0 + i2A⊺ 0B1 + i3A⊺ 1B1, (12) which is essentially the value of the following polynomial at point x = i: h(x) ≜A⊺ 0B0 + xA⊺ 1B0 + x2A⊺ 0B1 + x3A⊺ 1B1. (13) Hence, recovering C using computation results from 4 workers is equivalent to interpolating a 3rddegree polynomial given its values at 4 points. Later in this section, we will show that by mapping the decoding process to polynomial interpolation, we can achieve almost-linear decoding complexity. 3.2 General Polynomial Code Now we present the polynomial code in a general setting that achieves the optimum recovery threshold stated in Theorem 1 for any parameter values of N, m, and n. First of all, we evenly divide each input matrix along the column side into m and n submatrices respectively, i.e., A = [A0 A1 ... Am−1], B = [B0 B1 ... Bn−1], (14) We then assign each worker i ∈{0, 1, ..., N −1} a number in Fq, denoted by xi, and make sure that all xi’s are distinct. Under this setting, we define the following class of computation strategies. 6 Definition 2. Given parameters α, β ∈N, we define the (α, β)-polynomial code as ˜Ai = m−1 X j=0 Ajxjα i , ˜Bi = n−1 X j=0 Bjxjβ i , ∀i ∈{0, 1, ..., N −1}. (15) In an (α, β)-polynomial code, each worker i essentially computes ˜Ci = ˜A⊺ i ˜Bi = m−1 X j=0 n−1 X k=0 A⊺ j Bkxjα+kβ i . (16) In order for the master to recover the output given any mn results (i.e. achieve the optimum recovery threshold), we carefully select the design parameters α and β, while making sure that no two terms in the above formula has the same exponent of x. One such choice is (α, β) = (1, m), i.e, let ˜Ai = m−1 X j=0 Ajxj i, ˜Bi = n−1 X j=0 Bjxjm i . (17) Hence, each worker computes the value of the following degree mn −1 polynomial at point x = xi: h(x) ≜ m−1 X j=0 n−1 X k=0 A⊺ j Bkxj+km, (18) where the coefficients are exactly the mn uncoded components of C. Since all xi’s are selected to be distinct, recovering C given results from any mn workers is essentially interpolating h(x) using mn distinct points. Since h(x) has degree mn −1, the output C can always be uniquely decoded. In terms of complexity, this decoding process can be viewed as interpolating degree mn −1 polynomials of Fq for rt mn times. It is well known that polynomial interpolation of degree k has a complexity of O(k log2 k log log k) [15]. Therefore, decoding polynomial code also only requires a complexity of O(rt log2(mn) log log(mn)). Furthermore, this complexity can be reduced by simply swapping in any faster polynomial interpolation algorithm or Reed-Solomon decoding algorithm. Remark 7. We can naturally extend polynomial code to the scenario where input matrix elements are real or complex numbers. In practical implementation, to avoid handling large elements in the coefficient matrix, we can first quantize input values into numbers of finite digits, embed them into a finite field that covers the range of possible values of the output matrix elements, and then directly apply polynomial code. By embedding into finite fields, we avoid large intermediate computing results, which effectively saves storage and computation time, and reduces numerical errors. 3.3 Optimality of Polynomial Code for Recovery Threshold So far we have constructed a computing scheme that achieves a recovery threshold of mn, which upper bounds K∗. To complete the proof of Theorem 1, here we establish a matching lower bound through an information theoretic converse. We need to prove that for any computation strategy, the master needs to wait for at least mn workers in order to recover the output. Recall that at least one of A and B is a tall matrix. Without loss of generality, assume A is tall (i.e. s ≥r). Let A be an arbitrary fixed full rank matrix and B be sampled from Fs×t q uniformly at random. It is easy to show that C = A⊺B is uniformly distributed on Fr×t q . This means that the master essentially needs to recover a random variable with entropy of H(C) = rt log2 q bits. Note that each worker returns rt mn elements of Fq, providing at most rt mn log2 q bits of information. Consequently, using a cut-set bound around the master, we can show that at least mn results from the workers need to be collected, and thus we have K∗≥mn. Remark 8 (Random Linear Code). We conclude this subsection by noting that, another computation design is to let each worker store two random linear combinations of the input submatrices. Although this design can achieve the optimal recovery threshold with high probability, it creates a large coding overhead and requires high decoding complexity (e.g., O(m3n3 +mnrt) using the classical inversion decoding algorithm). Compared to random linear code, the proposed polynomial code achieves the optimum recovery threshold deterministically, with a significantly lower decoding complexity. 7 3.4 Optimality of Polynomial Code for Other Performance Metrics In the previous subsection, we proved that polynomial code is optimal in terms of the recovery threshold. As a by-product, we can prove that it is also optimal in terms of some other performance metrics. In particular, we consider the following 3 metrics considered in prior works, and formally establish the optimality of polynomial code for each of them. Proofs can be found in Appendix A. Computation latency is considered in models where the computation time Ti of each worker i is a random variable with a certain probability distribution (e.g, [5, 10]). The computation latency is defined as the amount of time required for the master to collect enough information to decode C. Theorem 2. For any computation strategy, the computation latency T is always no less than the latency achieved by polynomial code, denoted by Tpoly. Namely, T ≥Tpoly. (19) Probability of failure given a deadline is defined as the probability that the master does not receive enough information to decode C at any time t [9]. Corollary 1. For any computation strategy, let T denote its computation latency, and let Tpoly denote the computation latency of polynomial code. We have P(T > t) ≥P(Tpoly > t) ∀t ≥0. (20) Corollary 1 directly follows from Theorem 2 since (19) implies (20) . Communication load is another important metric in distributed computing (e.g. [16, 17, 18]), defined as the minimum number of bits needed to be communicated in order to complete the computation. Theorem 3. Polynomial code achieves the minimum communication load for distributed matrix multiplication, which is given by L∗= rt log2 q. (21) 4 Extension to Distributed Convolution We can extend our proposed polynomial code to distributed convolution. Specifically, we consider a convolution task with two input vectors a = [a0 a1 ... am−1], b = [b0 b1 ... bn−1], (22) where all ai’s and bi’s are vectors of length s over a sufficiently large field Fq. We want to compute c ≜a ∗b using a master and N workers. Each worker can store two vectors of length s, which are functions of a and b respectively. We refer to these functions as the computation strategy. Each worker computes the convolution of its stored vectors, and returns it to the master. The master only waits for the fastest subset of workers, before proceeding to decode c. Similar to distributed matrix multiplication, we define the recovery threshold for each computation strategy. We aim to characterize the optimum recovery threshold denoted by K∗ conv, and find computation strategies that closely achieve this optimum threshold, while allowing efficient decoding at the master. Distributed convolution has also been studied in [9], where the coded convolution scheme was proposed. The main idea of the coded convolution scheme is to inject redundancy in only one of the input vectors using MDS codes. The master waits for enough results such that all intermediate values ai ∗bj can be recovered, which allows the final output to be computed. One can show that this coded convolution scheme is in fact equivalent to the 1D MDS-coded scheme proposed in [10]. Consequently, it achieves a recovery threshold of K1D-MDS = N −N n + m. Note that by simply adapting our proposed polynomial code designed for distributed matrix multiplication to distributed convolution, the master can recover all intermediate values ai ∗bj after receiving results from any mn workers, to decode the final output. Consequently, this achieves a recovery threshold of Kpoly = mn, which already strictly and significantly improves the state of the art. In this paper, we take one step further and propose an improved computation strategy, strictly reducing the recovery threshold on top of the naive polynomial code. The result is summarized as follows: 8 Theorem 4. For a distributed convolution problem of computing a ∗b using N workers that can each store 1 m fraction of a and 1 n fraction of b, we can find a computation strategy that achieves a recovery threshold of Kconv-poly ≜m + n −1. (23) Furthermore, this computation strategy allows efficient decoding, i.e., with complexity equal to that of polynomial interpolation given m + n −1 points. We prove Theorem 4 by proposing a variation of the polynomial code, which exploits the computation structure of convolution. This new computing scheme is formally demonstrated in Appendix B. Remark 9. Similar to distributed matrix multiplication, our proposed computation strategy provides orderwise improvement compared to state of the art [9] in various settings. Furthermore, it achieves almost-linear decoding complexity using the fastest polynomial interpolation algorithm or the ReedSolomon decoding algorithm. More recently, we have shown that this proposed scheme achieves the optimum recovery threshold among all computation strategies that are linear functions [21]. Moreover, we characterize Kconv within a factor of 2, as stated in the following theorem and proved in Appendix C. Theorem 5. For a distributed convolution problem, the minimum recovery threshold K∗ conv can be characterized within a factor of 2, i.e.: 1 2Kconv-poly < K∗ conv ≤Kconv-poly. (24) 5 Experiment Results To examine the efficiency of our proposed polynomial code, we implement the algorithm in Python using the mpi4py library and deploy it on an AWS EC2 cluster of 18 nodes, with the master running on a c1.medium instance, and 17 workers running on m1.small instances. The input matrices are randomly generated as two numpy matrices of size 4000 by 4000, and then encoded and assigned to the workers in the preprocessing stage. Each worker stores 1 4 fraction of each input matrix. In the computation stage, each worker computes the product of their assigned matrices, and then returns the result using MPI.Comm.Isend(). The master actively listens to responses from the 17 worker nodes through MPI.Comm.Irecv(), and uses MPI.Request.Waitany() to keep polling for the earliest fulfilled request. Upon receiving 16 responses, the master stops listening and starts decoding the result. To achieve the best performance, we implement an FFT-based algorithm for the Reed-Solomon decoding. 0 5 10 15 20 25 30 35 40 Computation Latency (s) 10-2 10-1 100 CCDF Uncoded Polynomial-Code Figure 5: Comparison of polynomial code and the uncoded scheme. We implement polynomial code and the uncoded scheme using Python and mpi4py library and deploy them on an Amazon EC2 cluster of 18 instances. We measure the computation latency of both algorithms and plot their CCDF. Polynomial code can reduce the tail latency by 37% even taking into account of the decoding overhead. We compare our results with distributed matrix multiplication without coding.3 The uncoded implementation is similar, except that only 16 out of the 17 workers participate in the computation, each of them storing and processing 1 4 fraction of uncoded rows from each input matrix. The master waits for all 16 workers to return, and does not need to perform any decoding algorithm to recover the result. To simulate straggler effects in large-scale systems, we compare the computation latency of these two schemes in a setting where a randomly picked worker is running a background thread which approximately doubles the computation time. As shown in Fig. 5, polynomial code can reduce the tail latency by 37% in this setting, even taking into account of the decoding overhead. 3Due to the EC2 instance request quota limit of 20, 1D MDS code and product code could not be implemented in this setting, which require at least 21 and 26 nodes respectively. 9 6 Acknowledgement This work is in part supported by NSF grants CCF-1408639, NETS-1419632, ONR award N000141612189, NSA grant, and a research gift from Intel. This material is based upon work supported by Defense Advanced Research Projects Agency (DARPA) under Contract No. HR001117C0053. The views, opinions, and/or findings expressed are those of the author(s) and should not be interpreted as representing the official views or policies of the Department of Defense or the U.S. Government. 10 References [1] J. Dean and S. Ghemawat, “MapReduce: Simplified data processing on large clusters,” Sixth USENIX Symposium on Operating System Design and Implementation, Dec. 2004. [2] M. Zaharia, M. Chowdhury, M. J. Franklin, S. Shenker, and I. Stoica, “Spark: cluster computing with working sets,” in Proceedings of the 2nd USENIX HotCloud, vol. 10, p. 10, June 2010. [3] J. Dean and L. A. Barroso, “The tail at scale,” Communications of the ACM, vol. 56, no. 2, pp. 74–80, 2013. [4] M. Zaharia, A. Konwinski, A. D. Joseph, R. H. Katz, and I. Stoica, “Improving MapReduce performance in heterogeneous environments,” OSDI, vol. 8, p. 7, Dec. 2008. [5] K. Lee, M. Lam, R. Pedarsani, D. Papailiopoulos, and K. Ramchandran, “Speeding up distributed machine learning using codes,” e-print arXiv:1512.02673, 2015. [6] S. Li, M. A. Maddah-Ali, and A. S. Avestimehr, “A unified coding framework for distributed computing with straggling servers,” arXiv preprint arXiv:1609.01690, 2016. [7] A. Reisizadehmobarakeh, S. Prakash, R. Pedarsani, and S. Avestimehr, “Coded computation over heterogeneous clusters,” arXiv preprint arXiv:1701.05973, 2017. [8] R. Tandon, Q. Lei, A. G. Dimakis, and N. Karampatziakis, “Gradient coding,” arXiv preprint arXiv:1612.03301, 2016. [9] S. Dutta, V. Cadambe, and P. Grover, “Coded convolution for parallel and distributed computing within a deadline,” arXiv preprint arXiv:1705.03875, 2017. [10] K. Lee, C. Suh, and K. Ramchandran, “High-dimensional coded matrix multiplication,” in 2017 IEEE International Symposium on Information Theory (ISIT), pp. 2418–2422, June 2017. [11] R. Singleton, “Maximum distance q-nary codes,” IEEE Transactions on Information Theory, vol. 10, no. 2, pp. 116–118, 1964. [12] K.-H. Huang and J. A. Abraham, “Algorithm-based fault tolerance for matrix operations,” IEEE Transactions on Computers, vol. C-33, pp. 518–528, June 1984. [13] J.-Y. Jou and J. A. Abraham, “Fault-tolerant matrix arithmetic and signal processing on highly concurrent computing structures,” Proceedings of the IEEE, vol. 74, pp. 732–741, May 1986. [14] F. Didier, “Efficient erasure decoding of reed-solomon codes,” arXiv preprint arXiv:0901.1886, 2009. [15] K. S. Kedlaya and C. Umans, “Fast polynomial factorization and modular composition,” SIAM Journal on Computing, vol. 40, no. 6, pp. 1767–1802, 2011. [16] S. Li, M. A. Maddah-Ali, and A. S. Avestimehr, “Coded MapReduce,” 53rd Annual Allerton Conference on Communication, Control, and Computing, Sept. 2015. [17] S. Li, M. A. Maddah-Ali, Q. Yu, and A. S. Avestimehr, “A fundamental tradeoff between computation and communication in distributed computing,” IEEE Transactions on Information Theory, vol. 64, pp. 109–128, Jan 2018. [18] Q. Yu, S. Li, M. A. Maddah-Ali, and A. S. Avestimehr, “How to optimally allocate resources for coded distributed computing?,” in 2017 IEEE International Conference on Communications (ICC), pp. 1–7, May 2017. [19] R. Roth, Introduction to coding theory. Cambridge University Press, 2006. [20] S. Baktir and B. Sunar, “Achieving efficient polynomial multiplication in fermat fields using the fast fourier transform,” in Proceedings of the 44th annual Southeast regional conference, pp. 549–554, ACM, 2006. [21] Q. Yu, M. A. Maddah-Ali, and A. S. Avestimehr, “Straggler mitigation in distributed matrix multiplication: Fundamental limits and optimal coding,” arXiv preprint arXiv:1801.07487, 2018. 11
2017
604
7,124
From Bayesian Sparsity to Gated Recurrent Nets Hao He Massachusetts Institute of Technology haohe@mit.edu Bo Xin Microsoft Research, Beijing, China jimxinbo@gmail.com Satoshi Ikehata National Institute of Informatics satoshi.ikehata@gmail.com David Wipf Microsoft Research, Beijing, China davidwipf@gmail.com Abstract The iterations of many first-order algorithms, when applied to minimizing common regularized regression functions, often resemble neural network layers with prespecified weights. This observation has prompted the development of learningbased approaches that purport to replace these iterations with enhanced surrogates forged as DNN models from available training data. For example, important NPhard sparse estimation problems have recently benefitted from this genre of upgrade, with simple feedforward or recurrent networks ousting proximal gradient-based iterations. Analogously, this paper demonstrates that more powerful Bayesian algorithms for promoting sparsity, which rely on complex multi-loop majorizationminimization techniques, mirror the structure of more sophisticated long short-term memory (LSTM) networks, or alternative gated feedback networks previously designed for sequence prediction. As part of this development, we examine the parallels between latent variable trajectories operating across multiple time-scales during optimization, and the activations within deep network structures designed to adaptively model such characteristic sequences. The resulting insights lead to a novel sparse estimation system that, when granted training data, can estimate optimal solutions efficiently in regimes where other algorithms fail, including practical direction-of-arrival (DOA) and 3D geometry recovery problems. The underlying principles we expose are also suggestive of a learning process for a richer class of multi-loop algorithms in other domains. 1 Introduction Many practical iterative algorithms for minimizing an energy function Ly(x), parameterized by some vector y, adopt the updating prescription x(t+1) = f(Ax(t) + By), (1) where t is the iteration count, A and B are fixed matrices/filters, and f is a point-wise nonlinear operator. When we treat By as a bias or exogenous input, then the progression of these iterations through time resembles activations passing through the layers (indexed by t) of a deep neural network (DNN) [20, 30, 34, 38]. It then naturally begs the question: If we have access to an ensemble of pairs {y, x∗}, where x∗= arg minx Ly(x), can we train an appropriately structured DNN to produce a minimum of Ly(x) when presented with an arbitrary new y as input? If A and B are fixed for all t, this process can be interpreted as training a recurrent neural network (RNN), while if they vary, a deep feedforward network with independent weights on each layer is a more apt description. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. Although many of our conclusions may ultimately have broader implications, in this work we focus on minimizing the ubiquitous sparse estimation problem Ly(x) = ∥y −Φx∥2 2 + λ∥x∥0, (2) where Φ ∈Rn×m is an overcomplete matrix of feature vectors, ∥· ∥0 is the ℓ0 norm equal to a count of the nonzero elements in a vector, and λ > 0 is a trade-off parameter. Although crucial to many applications [2, 9, 13, 17, 23, 27], solving (2) is NP-hard, and therefore efficient approximations are sought. Popular examples with varying degrees of computational overhead include convex relaxations such as ℓ1-norm regularization [4, 8, 32] and many flavors of iterative hard-thresholding (IHT) [5, 6]. In most cases, these approximate algorithms can be implemented via (1), where A and B are functions of Φ, and the nonlinearity f is, for example, a hard-thresholding operator for IHT or soft-thresholding for convex relaxations. However, the Achilles’ heel of all these approaches is that they will generally not converge to good approximate minimizers of (2) if Φ has columns with a high degree of correlation [5, 8], which is unfortunately often the case in practice [35]. To mitigate the effects of such correlations, we could leverage the aforementioned correspondence with common DNN structures to learn something like a correlation-invariant algorithm or update rules [38], although in this scenario our starting point would be an algorithmic format with known deficiencies. But if our ultimate goal is to learn a new sparse estimation algorithm that efficiently compensates for structure in Φ, then it seems reasonable to invoke iterative algorithms known a priori to handle such correlations directly as our template for learned network layers. One important example is sparse Bayesian learning (SBL) [33], which has been shown to solve (2) using a principled, multiloop majorization-minimization approach [22] even in cases where Φ displays strong correlations [35]. Herein we demonstrate that, when judiciously unfolded, SBL iterations can be formed into variants of long short-term memory (LSTM) cells, one of the more popular recurrent deep neural network architectures [21], or gated extensions thereof [12]. The resulting network dramatically outperforms existing methods in solving (2) with a minimal computational budget. Our high-level contributions can be summarized as follows: • Quite surprisingly, we demonstrate that the SBL objective, which explicitly compensates for correlated dictionaries, can be optimized using iteration structures that map directly to popular LSTM cells despite its radically different origin. This association significantly broadens recent work connecting elementary, one-step iterative sparsity algorithms like (1) with simple recurrent or feedforward deep network architectures [20, 30, 34, 38]. • At its core, any SBL algorithm requires coordinating inner- and outer-loop computations that produce expensive latent posterior variances (or related, derived quantities) and optimized coefficient estimates respectively. Although this process can in principle be accommodated via canonical LSTM cells, such an implementation will enforce that computation of latent variables rigidly map to predefined subnetworks corresponding with various gating structures, ultimately administering a fixed schedule of switching between loops. To provide greater flexibility in coordinating inner- and outer-loops, we propose a richer gated-feedback LSTM structure for sparse estimation. • We achieve state-of-the-art performance on several empirical tasks, including direction-ofarrival (DOA) estimation [28] and 3D geometry recovery via photometric stereo [37]. In these and other cases, our approach produces higher accuracy estimates at a fraction of the computational budget. These results are facilitated by a novel online data generation process. • Although learning-to-learn style approaches [1, 20, 30, 34] have been commonly applied to relatively simple gradient descent optimization templates, this is the first successful attempt we are aware of to learn a complex, multi-loop, majorization-minimization algorithm [22]. We envision that such a strategy can have wide-ranging implications beyond the sparse estimation problems explored herein given that it is often not obvious how to optimally tune loop execution to balance both complexity and estimation accuracy in practice. 2 Connecting SBL and LSTM Networks This section first reviews the basic SBL model, followed an algorithmic characterization of how correlation structure can be handled during sparse estimation. Later we derive specialized SBL update rules that reveal a close association with LSTM cells. 2 2.1 Original SBL Model Given an observed vector y ∈Rn and feature dictionary Φ ∈Rn×m, SBL assumes the Gaussian likelihood model and a parameterized zero-mean Gaussian prior for the unknown coefficients x ∈Rm given by p(y|x) ∝exp h −1 2λ ∥y −Φx∥2 2 i , and p(x; γ) ∝exp  −1 2x⊤Γ−1x  , Γ ≜diag[γ] (3) where λ > 0 is a fixed variance factor and γ denotes a vector of unknown hyperparamters [33]. Because both likelihood and prior are Gaussian, the posterior p(x|y; γ) is also Gaussian, with mean ˆx satisfying ˆx = ΓΦ⊤Σ−1 y y, with Σy ≜ΦΓΦ⊤+ λI. (4) Given the lefthand-side multiplication by Γ in (4), ˆx will have a matching sparsity profile or support pattern as γ, meaning that the locations of zero-valued elements will align or supp[ˆx] = supp[γ]. Ultimately then, the SBL strategy shifts from directly searching for some optimally sparse ˆx, to an optimally sparse γ. For this purpose we marginalize over x (treating it initially as hidden or nuisance data) and then maximize the resulting type-II likelihood function with respect to γ [26]. Conveniently, the resulting convolution-of-Gaussians integral is available in closed-form [33] such that we can equivalently minimize the negative log-likelihood L(γ) = −log Z p(y|x)p(x; γ)dx ≡y⊤Σ−1 y y + log |Σy|. (5) Given an optimal γ so obtained, we can compute the posterior mean estimator ˆx via (4). Equivalently, this same posterior mean estimator can be obtained by an iterative reweighted ℓ1 process described next that exposes subtle yet potent sparsity-promotion mechanisms. 2.2 Iterative Reweighted ℓ1 Implementation Although not originally derived this way, SBL can be implemented using a modified form of iterative reweighted ℓ1-norm optimization that exposes its agency for producing sparse estimates. In general, if we replace the ℓ0 norm from (2) with any smooth approximation g(|x|), where g is a concave, non-decreasing function and | · | applies elementwise, then cost function descent1 can be guaranteed using iterations of the form [36] x(t+1) ←arg min x 1 2∥y −Φx∥2 2 + λ X i w(t) i |xi|, w(t+1) i ←∂g(u)/∂ui|ui= x(t+1) i , ∀i. (6) This process can be viewed as a multi-loop, majorization-minimization algorithm [22] (a generalization of the EM algorithm [15]), whereby the inner-loop involves computing x(t+1) by minimizing a first-order, upper-bounding approximation ∥y −Φx∥2 2 + λ P i w(t) i |xi|, while the outer-loop updates the bound/majorizer itself as parameterized by the weights w(t+1). Obviously, if g(u) = u, then w(t) = 1 for all t, and (6) reduces to the Lasso objective for ℓ1 norm regularized sparse regression [32], and only a single iteration is required. However, one popular non-trivial instantiation of this approach assumes g(u) = P i log (ui + ϵ) with ϵ > 0 a user-defined parameter [10]. The corresponding weights then become w(t+1) i =  x(t+1) i + ϵ −1 , and we observe that once any particular x(t+1) i becomes large, the corresponding weight becomes small and at the next iteration a weaker penalty will be applied. This prevents the overshrinkage of large coefficients, a well-known criticism of ℓ1 norm penalties [16]. In the context of SBL, there is no closed-form w(t+1) i update except in special cases. However, if we allow for additional latent structure, which we later show is akin to the memory unit of LSTM cells, a viable recurrency emerges for computing these weights and elucidating their effectiveness in dealing with correlated dictionaries. In particular we have: Proposition 1. If weights w(t+1) satisfy  w(t+1) i 2 = min z:supp[z]⊆supp[γ(t)] 1 λ∥φi −Φz∥2 2 + X j∈supp[γ(t)] z2 j γ(t+1) j (7) 1Or global convergence to some stationary point with mild additional assumptions [31]. 3 for all i, then the iterations (6), with γ(t+1) j = h w(t) j i−1 x(t+1) j , are guaranteed to reduce or leave unchanged the SBL objective (5). Also, at each iteration, γ(t+1) and x(t+1) will satisfy (4). Unlike the traditional sparsity penalty mentioned above, with SBL we see that the i-th weight w(t+1) i is not dependent solely on the value of the i-th coefficient x(t+1) i , but rather on all the latent hyperparameters γ(t+1) and therefore ultimately prior-iteration weights w(t) as well. Moreover, because the fate of each sparse coefficient is linked together, correlation structure can be properly accounted for in a progressive fashion. More concretely, from (7) it is immediately apparent that if φi ≈φi′ for some indeces i and i′ (meaning a large degree of correlation), then it is highly likely that w(t+1) i ≈w(t+1) i′ . This is simply because the regularized residual error that emerges from solving (7) will tend to be quite similar when φi ≈φi′. In this situation, a suboptimal solution will not be prematurely enforced by weights with large, spurious variance across a correlated group of basis vectors. Instead, weights will differ substantially only when the corresponding columns have meaningful differences relative to the dictionary as a whole, in which case such differences can help to avoid overshrinkage as before. A crucial exception to this perspective occurs when γ(t+1) is highly sparse, or nearly so, in which case there are limited degrees of freedom with which to model even small differences between some φi and φi′. However, such cases can generally only occur when we are in the neighborhood of ideal, maximally sparse solutions by definition [35], when different weights are actually desirable even among correlated columns for resolving the final sparse estimates. 2.3 Revised SBL Iterations Although presumably there are multiple ways such an architecture could be developed, in this section we derive specialized SBL iterations that will directly map to one of the most common RNN structures, namely LSTM networks. With this in mind, the notation we adopt has been intentionally chosen to facilitate later association with LSTM cells. We first define w(t) ≜diag  Φ⊤ λI + ΦΓ(t)Φ⊤−1 Φ  1 2 and ν(t) ≜u(t) + µΦ⊤y −Φu(t) , (8) where Γ(t) ≜diag  γ(t) , u(t) ≜Γ(t)Φ⊤ λI + ΦΓ(t)Φ⊤−1 y, and µ > 0 is a constant. As will be discussed further below, w(t) serves the exact same role as the weights from (7), hence the identical notation. We then partition our revised SBL iterations as so-called gate updates σ(t) in ← h α  γ(t) ⊙  ν(t) −2λw(t)i + , σ(t) f ←β  γ(t) , σ(t) out ←  w(t)−1 , (9) cell updates ¯x(t+1) ←sign h ν(t)i , x(t+1) ←σ(t) f ⊙x(t) + σ(t) in ⊙¯x(t+1), (10) and output updates γ(t+1) ← σ(t) out ⊙ x(t+1) , (11) where the inverse and absolute-value operators are applied element-wise when a vector is the argument, and at least for now, α and β define arbitrary functions. Moreover, ⊙denotes the Hadamard product and [·]+ sets negative values to zero and leaves positive quantities unchanged, also in an element-wise fashion, i.e., it acts just like a rectilinear (ReLU) unit [29]. Note also that the gate and cell updates in isolation can be viewed as computing a first-order, partial solution to the inner-loop weighted ℓ1 optimization problem from (6). Starting from some initial γ(0) and x(0), we will demonstrate in the next section that these computations closely mirror a canonical LSTM network unfolded in time with y acting as a constant input applied at each step. Before doing so however, we must first demonstrate that (8)−(11) indeed serve to reduce the SBL objective. For this purpose we require the following definition: 4 Definition 2. We say that the iterations (8)−(11) satisfy the monotone cell update property if ∥y −Φu(t)∥2 2 + 2λ X i w(t) i |u(t) i | ≥∥y −Φx(t+1)∥2 2 + 2λ X i w(t) i |x(t+1) i |, ∀t. (12) Note that for rather inconsequential technical reasons this definition involves u(t), which can be viewed as a proxy for x(t). We then have the following: Proposition 3. The iterations (8)−(11) will reduce or leave unchanged (5) for all t provided that µ ∈  0, λ/ Φ⊤Φ i and α and β are chosen such that the monotone cell update property holds. In practical terms, the simple selections α(γ) = 1 and β(γ) = 0 will provably satisfy the monotone cell update property (see proof details in the supplementary). However, for additional flexibility, α and β could be selected to implement various forms of momentum, ultimately leading to cell updates akin to the popular FISTA [4] or monotonic FISTA [3] algorithms. In both cases, old values x(t) are precisely mixed with new factors ¯x(t+1) to speed convergence (in the present circumstances, σ(t) f and σ(t) in respectively modulate this mixing process via (10)). Of course the whole point of casting the SBL iterations as an RNN structure to begin with is so that we may ultimately learn these types of functions, without the need for hand-crafting suboptimal iterations up front. 2.4 Correspondences with LSTM Components We will now flesh out how the SBL iterations presented in Section 2.3 display the same structure as a canonical LSTM cell, the only differences being the shape of the nonlinearities, and the exact details of the gate subnetworks. To facilitate this objective, Figure 1 contains a canonical LSTM network structure annotated with SBL-derived quantities. We now walk through these correspondences. First, the exogenous input to the network is the observation vector y, which does not change from time-step to time-step. This is much like the strategy used by feedback networks for obtaining incrementally refined representations [40]. The output at time-step t is γ(t), which serves as the current estimate of the SBL hyperparameters. In contrast, we treat x(t) as the internal LSTM memory cell, or the latent cell state.2 This deference to γ(t) directly mirrors the emphasis SBL places on learning variances per the marginalized cost from (5) while treating x(t) as hidden data, and in some sense flips the coefficient-centric script used in producing (6).3 Proceeding further, γ(t) is fed to four separate layers/subnetworks (represented by yellow boxes in Figure 1): (i) the forget gate σ(t) f , (ii) the input gate σ(t) in , (iii) the output gate σ(t) out, and (iv) the candidate input update ¯x(t). The forget gate computes scaling factors for each element of x(t), with small values of the gate output suggesting that we ‘forget’ the corresponding old cell state elements. Similarly the input gate determines how large we rescale signals from the candidate input update ¯x(t). These two re-weighted quantities are then mixed together to form the new cell state x(t+1). Finally, the output gate modulates how new γ(t+1) are created as scaled versions of the updated cell state. Regarding details of these four subnetworks, based on the update templates from (9) and (10), we immediately observe that the required quantities depend directly on (8). Fortunately, both ν(t) and w(t) can be naturally computed using simple feedforward subnetwork structures.4 These values can either be computed in full (ideal case), or partially to reduce the computational burden. In any event, once obtained, the respective gates and candidate cell input updates can be computed by applying final non-linearities. Note that α and β are treated as arbitrary subnetwork structures at this point that can be learned. 2If we allow for peephole connections [18], it is possible to reverse these roles; however, for simplicity and the most direct mapping to LSTM cells we do not pursue this alternative here. 3Incidently, this association also suggests that the role of hidden cell updates in LSTM networks can be reinterpreted as an analog to the expectation step (or E-step) for estimating hidden data in a suitably structured EM algorithm. 4For w(t) the result of Proposition 1 suggests that these weights can be computed as the solution of a simple regularized regression problem, which can easily be replaced with a small network analogous to that used in [18]; similarly for ν(t). 5 A few cosmetic differences remain between this SBL implementation and a canonical LSTM network. First, the final non-linearity for LSTM gating subnetworks is often a sigmoidal activation, whereas SBL is flexible with the forget gate (via β), while effectively using a ReLU unit for the input gate and an inverse function for the output gate. Moreover, for the candidate cell update subnetwork, SBL replaces the typical tanh nonlinearity with a quantized version, the sign function, and likewise, for the output nonlinearity an absolute value operator (abs) is used. Finally, in terms of internal subnetwork structure, there is some parameter sharing since σ(t) in , σ(t) out, and ¯x(t) are connected via ν(t) and w(t). Of course in all cases we need not necessarily share parameters nor abide by these exact structures. In fact there is nothing inherently optimal about the particular choices used by SBL; rather it is merely that these structures happen to reproduce the successful, yet hand-crafted SBL iterations. But certainly there is potential in replacing such iterations with learned LSTM-like surrogates, at least when provided with access to sufficient training data as in prior attempts to learn sparse estimation algorithms [20, 34, 38]. ! "($) &($) + × × × "($'() &($'() &($'() )* ($) +,Subnetwork Pointwise Operation Vector Transfer Concatenate Copy )./ ($) "0($) )12$ ($) Figure 1: LSTM/SBL Network 10 20 30 40 50 60 70 80 90 100 0 2 4 6 8 10 iteration number w magnitudes 10 20 30 40 50 60 70 80 90 100 0 0.2 0.4 0.6 0.8 1 iteration number x magnitudes Figure 1: References 1 1 Figure 2: SBL Dynamics 3 Extension to Gated Feedback Networks Although SBL iterations can be molded into an LSTM structure as we have shown, there remain hints that the full potential of this association may be presently undercooked. Here we first empirically examine the trajectories of SBL iterations produced via the LSTM-like rules derived in Section 2.3. This process will later serve to unmask certain characteristic dynamics operating across different time scales that are suggestive of a richer class of gated recurrent network structures inspired by sequence prediction tasks [12]. 3.1 Trajectory Analysis of SBL Iterations To begin, Figure 2 displays sample trajectories of w(t) ∈R100 (top) and x(t) ∈R100 (bottom) during execution of (8)−(11) on a simple representative problem, where each colored line represents a different element w(t) i or |x(t) i | respectively. All details of the data generation process, as well as comprehensive attendant analyses, are deferred to the supplementary. To summarize here though, in the top plot the elements of w(t), which represent the non-negative weights forming the outer-loop majorization step from (6) and reflect coarse correlation structure in Φ, converge very quickly (∼3-5 iterations). Moreover, the observed bifurcation of magnitudes ultimately helps to screen many (but not necessarily all) elements of x(t) that are the most likely to be zero in the maximally sparse representation (i.e., a stable, higher weighting value w(t) i is likely to eventually cause x(t) i →0). In contrast, the actual coefficients x(t) themselves converge much more slowly, with final destinations still unclear even after 50+ iterations. Hence w(t) need not be continuously updated after rapid initial convergence, provided that we retain a memory of the optimal value during periods when it is static. This discrepancy in convergence rates occurs in part because, as mentioned previously, the gate and cell updates do not fully solve the inner-loop weighted ℓ1 optimization needed to compute a globally optimal x(t+1) give w(t). Varying the number of inner-loop iterations, meaning additional executions 6 of (8)−(11) with w(t) fixed, is one heuristic for normalizing across different trajectory frequencies, but this requires additional computational overhead, and prior knowledge is needed to micro-manage iteration counts for either efficiency or final estimation quality. With respect to the latter, we conduct additional experiments in the supplementary which reveal that indeed the number of inner-loop updates per outer-loop cycle can affect the quality of sparse solutions, with no discernible rule of thumb for enhancing solution quality.5 For example, navigating around suboptimal local minima could require adaptively adjusting the number inner-loop iterations in subtle, non-obvious ways. We therefore arrive at an unresolved state of affairs: 1. The latent variables which define SBL iterations can potentially follow optimization trajectories with radically different time scales, or both long- and short-term dependencies. 2. But there is no intrinsic mechanism within the SBL framework itself (or most multi-loop optimization problems in general either) for automatically calibrating the differing time scales for optimal performance. These same issues are likely to arise in other non-convex multi-loop optimization algorithms as well. It therefore behooves us to consider a broader family of model structures that can adapt to these scales in a data-dependent fashion. 3.2 Modeling via Gated Feedback Nets In addressing this fundamental problem, we make the following key observation: If the trajectories of various latent variables can be interpreted as activations passing through an RNN with both long- and short-term dependencies, then in developing a pipeline for optimizing such trajectories it makes sense to consider learning deep architectures explicitly designed to adaptively model such characteristic sequences. Interestingly, in the context of sequence prediction, the clockwork RNN (CW-RNN) has been proposed to cope with temporal dependencies engaged across multiple scales [25]. As shown in the supplementary however, the CW-RNN enforces dynamics synced to pre-determined clock rates exactly analogous to the fixed, manual schedule for terminating inner-loops in existing multi-loop iterative algorithms such as SBL. So we are back at our starting point. Fortunately though, the gated feedback RNN (GF-RNN) [12] was recently developed to update the CW-RNN with an additional set of gated connections that, in effect, allow the network to learn its own clock rates. In brief, the GF-RNN involves stacked LSTM layers (or somewhat simpler gated recurrent unit (GRU) layers [11]), that are permitted to communicate bilaterally via additional, data-dependent gates that can open and close on different time-scales. In the context of SBL, this means that we no longer need strain a specialized LSTM structure with the burden of coordinating trajectory dynamics. Instead, we can stack layers that are, at least from a conceptual standpoint, designed to reflect the different dynamics of disparate variable sets such as w(t) or x(t). In doing so, we are then positioned to learn new SBL update rules from training pairs {y, x∗} as described previously. At the very least, this structure should include SBL-like iterations within its capacity, but of course it is also free to explore something even better. 3.3 Network Design and Training Protocol We stack two gated recurrent layers loosely designed to mimic the relatively fast SBL adaptation to basic correlation structure, as well as the slower resolution of final support patterns and coefficient estimates. These layers are formed from either LSTM or GRU base architectures. For the final output layer we adopt a multi-label classification loss for predicting supp[x∗], which is the well-known ‘NPhard’ part of sparse estimation (determining final coefficient amplitudes just requires a simple least squares fit given the correct support pattern). Full network details are deferred to the supplementary, including special modifications to handle complex data as required by DOA applications. For a given dictionary Φ a separate network must be trained via SGD, to which we add a unique extra dimension of randomness via an online stochastic data-generation strategy. In particular, to create samples in each mini-batch, we first generate a vector x∗with random support pattern and nonzero amplitudes. We then compute y = Φx∗+ ϵ, where ϵ is a small Gaussian noise component. This y forms a training input sample, while supp[x∗] represents the corresponding labels. For all 5In brief, these experiments demonstrate a situation where executing either 1, 10, or 1000 inner-loop iterations per outer loop fails to produce the optimal solution, while 100 inner-loop iterations is successful. 7 mini-batches, novel samples are drawn, which we have found boosts performance considerably over the fixed training sets used by current DNN approaches to sparse estimation (see supplementary). 4 Experiments This section presents experiments involving synthetic data and two applications. 0.15 0.2 0.25 0.3 0.35 0.4 0.45 d n 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 correct support recovery Ours-GFLSTM SBL MaxSparseNet ℓ1-norm IHT(all zero) ISTA-Net(all zero) IHT-Net(all zero) (a) Strict Accuracy 0.15 0.2 0.25 0.3 0.35 0.4 0.45 d n 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1 support recovery rate Ours-GFLSTM SBL MaxSparseNet ℓ1-norm IHT(all below 0.6) ISTA-Net(all below 0.6) IHT-Net(all below 0.6) (b) Loose Accuracy 1 2 3 4 5 6 7 8 9 10 models 0 0.1 0.2 0.3 0.4 0.5 0.6 correct support recovery MaxSparseNet GRU-small LSTM-big LSTM-small GRU-big GFGRU-small GFLSTM-small SBL GFGRU-big GFLSTM-big (c) Architecture Comparisons 10 20 30 40 50 60 70 80 SNR(dB) 0 10 20 30 40 50 60 70 chamfer distance SBL Ours-GFLSTM (d) DOA Figure 3: Plots (a), (b), and (c) show sparse recovery results involving synthetic correlated dictionaries. Plot (d) shows Chamfer distance-based errors [7] from the direction-of-arrival (DOA) experiment. 4.1 Evaluations via Synthetic Correlated Dictionaries To reproduce experiments from [38], we generate correlated synthetic features via Φ = Pn i=1 1 i2 uiv⊤ i , where ui ∈Rn and vi ∈Rm are drawn iid from a unit Gaussian distribution, and each column of Φ is subsequently rescaled to unit ℓ2 norm. Ground truth samples x∗have d nonzero elements drawn randomly from U[−0.5, 0.5] excluding the interval [−0.1, 0.1]. We use n=20, m=100, and vary d, with larger values producing a much harder combinatorial estimation problem (exhaustive search is not feasible here). All algorithms are presented with y and attempt to estimate supp[x∗]. We evaluate using strict accuracy, meaning percentage of trials with exact support recovery, and loose accuracy, which quantifies the percentage of true positives among the top n ‘guesses’ (i.e., largest predicted outputs). Figures 3(a) and 3(b) evaluate our model, averaged across 105 trials, against an array of optimizationbased approaches: SBL [33], ℓ1 norm minimization [4], and IHT [5]; and existing learning-based DNN models: an ISTA-inspired network [20], an IHT-inspired network [34], and the best maximal sparsity net (MaxSparseNet) from [38] (detailed settings in the supplementary). With regard to strict accuracy, only SBL is somewhat competitive with our approach and other learning-based models are much worse; however, using loose accuracy our method is far superior than all others. Note that this is the first approach we are aware of in the literature that can convincingly outperform SBL recovering sparse solutions when a heavily correlated dictionary is present, and we hypothesize that this is largely possible because our design principles were directly inspired by SBL itself. To isolate architectural factors affecting performance we conducted ablation studies: (i) with or without gated feedback, (iii) LSTM or GRU cells, and (iii) small or large (4×) model size; for each model type, the small and respectively large versions have roughly the same number of parameters. The supplementary also contains a much broader set of self-comparison tests. Figure 3(c), which shows strict accuracy results with d/n = 0.4, indicates the importance of gated feedback and to a lesser degree network size, while LSTM and GRU cells perform similarly as expected. 4.2 Practical Application I: Direction-of-Arrival (DOA) Estimation DOA estimation is a fundamental problem in sonar/radar processing [28]. Given an array of n omnidirectional sensors with d signal waves impinging upon them, the objective is to estimate the angular direction of the wave sources with respect to the sensors. For certain array geometries and known propagation mediums, estimation of these angles can be mapped directly to solving (2) in the complex domain. In this scenario, the i-th column of Φ represents the sensor array output (a point in Cn) from a hypothetical source with unit strength at angular location θi, and can be computed using wave progagation formula [28]. The entire dictionary can be constructed by concatenating columns associated with angles forming some spacing of interest, e.g., every 1◦across a half circle, and will be highly correlated. Given measurements y ∈Cn, we can solve (2), with λ reflecting the noise level. 8 The indexes of nonzero elements of x∗will then reveal the angular locations/directions of putative sources. Recently SBL-based algorithms have produced state-of-the-art results solving the DOA problem [14, 19, 39], and we compare our approach against SBL here. We apply a typical experimental design from the literature involving a uniform linear array with n = 10 sensors; see supplementary for background and details on how to compute Φ, as well as specifics on how to adapt and train our GFLSTM using complex data. Four sources are then placed in random angular locations, with nonzero coefficients at {±1 ± i}, and we compute measurements y = Φx∗+ ϵ, with ϵ chosen from a complex Gaussian distribution to produce different SNR. Because the nonzero positions in x∗now have physical meaning, we apply the Chamfer distance [7] as the error metric, which quantifies how close we are to true source locations (lower is better). Figure 3(d) displays the results, where our learned network outperforms SBL across a range of SNR values. Table 1: Photometric stereo results Algorithm Average angular error (degrees) Runtime (sec.) Bunny Caesar Bunny Caesar r=10 r=20 r=40 r=10 r=20 r=40 r=10 r=20 r=40 r=10 r=20 r=40 SBL 4.02 1.86 0.50 4.79 2.07 0.34 35.46 22.66 32.20 86.96 64.67 90.48 MaxSparseNet 1.48 1.95 1.20 3.51 2.51 1.18 0.90 0.87 0.92 2.13 2.12 2.20 Ours 1.35 1.55 1.12 2.39 1.80 0.60 0.63 0.67 0.85 1.48 1.70 2.08 4.3 Practical Application II: 3D Geometry Recovery via Photometric Stereo Photometric stereo represents another application domain whereby approximately solving (2) using SBL has recently produced state-of-the-art results [24]. The objective here is to recover the 3D surface normals of a given scene using r images taken from a single camera but with different lighting conditions. Under the assumption that these images can be approximately decomposed into a diffuse Lambertian component and sparse corruptions such as shadows and specular highlights, then surface normals at each pixel can be recovered using (2) to isolate these sparse factors followed by a final least squares post-processing step [24]. In this context, Φ is constructed using the known camera and lighting geometry, and y represents intensity measurements for a given pixel across images projected onto the nullspace of a special transposed lighting matrix (see supplementary for more details and our full experimental design). However, because a sparse regression problem must be computed for every pixel to recovery the full scene geometry, a fast, efficient solver is paramount. We compare our GFLSTM model against both SBL and the MaxSparseNet [38] (both of which outperform other existing methods). Tests are performed using the 32-bit HDR gray-scale images of objects ‘Bunny’ (256 × 256) and ‘Caesar’ (300 × 400) as in [24]. For (very) weakly-supervised training data, we apply the same approach as before, only we use nonzero magnitudes drawn from a Gaussian, with mean and variance loosely tuned to the photometric stereo data, consistent with [38]. Results are shown in Table 1, where we observe in all cases the DNN models are faster by a wide margin, and in the hard cases cases (smaller r) our approach produces the lowest angular error. The only exception is with r = 40; however, this is a quite easy scenario with so many images such that SBL can readily find a near optimal solution, albeit at a high computational cost. See supplementary for error surface visualizations. 5 Conclusion In this paper we have examined the structural similarities between multi-loop iterative algorithms and multi-scale sequence prediction neural networks. This association is suggestive of a learning process for a richer class of algorithms that employ multiple loops and latent states, such as the EM algorithm or general majorization-minimization approaches. For example, in a narrower sense, we have demonstrated that specialized gated recurrent nets carefully patterned to reflect the multi-scale optimization trajectories of multi-loop SBL iterations can lead to a considerable boost in both accuracy and efficiency. Note that simpler first-order, gradient descent-style algorithms can be ineffective when applied to sparsity-promoting energy functions with a combinatorial number of bad local optima and highly concave or non-differentiable surfaces in the neighborhood of minima. Moreover, implementing smoother approximations such as SBL with gradient descent is impractical since each gradient calculation would be prohibitively expensive. Therefore, recent learning-to-learn approaches such as [1] that explicitly rely on gradient calculations are difficult to apply in the present setting. 9 Acknowledgments This work was accomplished while Hao He was an intern at Microsoft Research, Beijing. References [1] M. Andrychowicz, M. Denil, S. Gomez, M.W. Hoffman, D. Pfau, T. Schaul, B. Shillingford, and N. de Freitas. Learning to learn by gradient descent by gradient descent. arXiv:1606.04474, 2016. [2] S. Baillet, J.C. Mosher, and R.M. Leahy. Electromagnetic brain mapping. IEEE Signal Processing Magazine, pages 14–30, Nov. 2001. [3] A. Beck and M. Teboulle. Fast gradient-based algorithms for constrained total variation image denoising and deblurring problems. IEEE Trans. Image Processing, 18(11), 2009. [4] A. Beck and M. Teboulle. A fast iterative shrinkage-thresholding algorithm for linear inverse problems. SIAM J. Imaging Sciences, 2(1), 2009. [5] T. Blumensath and M.E. Davies. Iterative hard thresholding for compressed sensing. Applied and Computational Harmonic Analysis, 27(3), 2009. [6] T. Blumensath and M.E. Davies. Normalized iterative hard thresholding: Guaranteed stability and performance. IEEE J. Selected Topics Signal Processing, 4(2), 2010. [7] G. Borgefors. Distance transformations in arbitrary dimensions. Computer Vision, Graphics, and Image Processing, 27(3):321–345, 1984. [8] E. Candès, J. Romberg, and T. Tao. Robust uncertainty principles: Exact signal reconstruction from highly incomplete frequency information. IEEE Trans. Information Theory, 52(2):489– 509, Feb. 2006. [9] E. Candès and T. Tao. Decoding by linear programming. IEEE Trans. Information Theory, 51(12), 2005. [10] E. Candès, M. Wakin, and S. Boyd. Enhancing sparsity by reweighted ℓ1 minimization. J. Fourier Anal. Appl., 14(5):877–905, 2008. [11] K. Cho, B. van Merrienboer, C. Gulcehre, F. Bougares, H. Schwenk, and Y. Bengio. Learning phrase representations using RNN encoder-decoder for statistical machine translation. Conference on Empirical Methods in Natural Language Processing, 2014. [12] J. Chung, C. Gulcehre, K. Cho, and Y. Bengio. Gated feedback recurrent neural networks. In International Conference on Machine Learning, 2015. [13] S.F. Cotter and B.D. Rao. Sparse channel estimation via matching pursuit with application to equalization. IEEE Trans. on Communications, 50(3), 2002. [14] J. Dai, X. Bao, W. Xu, and C. Chang. Root sparse Bayesian learning for off-grid DOA estimation. IEEE Signal Processing Letters, 24(1), 2017. [15] A.P. Dempster, N.M. Laird, and D.B. Rubin. Maximum likelihood from incomplete data via the EM algorithm. J. Royal Statistical Society, Series B (Methodological), 39(1):1–38, 1977. [16] J. Fan and R. Li. Variable selection via nonconcave penalized likelihood and its oracle properties. J. American Statistical Assoc., 96, 2001. [17] M.A.T. Figueiredo. Adaptive sparseness using Jeffreys prior. NIPS, 2002. [18] F.A. Gers and J. Schmidhuber. Recurrent nets that time and count. International Joint Conference on Neural Networks, 2000. [19] P. Gerstoft, C.F. Mecklenbrauker, A. Xenaki, and S. Nannuru. Multi snapshot sparse Bayesian learning for DOA. IEEE Signal Processing Letters, 23(20), 2016. 10 [20] K. Gregor and Y. LeCun. Learning fast approximations of sparse coding. In ICML, 2010. [21] S. Hochreiter and J. Schmidhuber. Long short-term memory. Neural computation, 9(8), 1997. [22] D.R. Hunter and K. Lange. A tutorial on MM algorithms. American Statistician, 58(1), 2004. [23] S. Ikehata, D.P. Wipf, Y. Matsushita, and K. Aizawa. Robust photometric stereo using sparse regression. In Computer Vision and Pattern Recognition, 2012. [24] S. Ikehata, D.P. Wipf, Y. Matsushita, and K. Aizawa. Photometric stereo using sparse Bayesian regression for general diffuse surfaces,. IEEE Trans. Pattern Analysis and Machine Intelligence, 36(9):1816–1831, 2014. [25] J. Koutnik, K. Greff, F. Gomez, and J. Schmidhuber. A clockwork RNN. International Conference on Machine Learning, 2014. [26] D.J.C. MacKay. Bayesian interpolation. Neural Computation, 4(3):415–447, 1992. [27] D.M. Malioutov, M. Çetin, and A.S. Willsky. Sparse signal reconstruction perspective for source localization with sensor arrays. IEEE Trans. Signal Processing, 53(8), 2005. [28] D.G. Manolakis, V.K. Ingle, and S.M. Kogon. Statistical and Adaptive Signal Processing. McGrall-Hill, Boston, 2000. [29] V. Nair and G. Hinton. Rectified linear units improve restricted Boltzmann machines. International Conference on Machine Learning, 2010. [30] P. Sprechmann, A.M. Bronstein, and G. Sapiro. Learning efficient sparse and low rank models. IEEE Trans. Pattern Analysis and Machine Intelligence, 37(9), 2015. [31] B.K. Sriperumbudu and G.R.G. Lanckriet. A proof of convergence of the concave-convex procedure using Zangwill’s theory. Neural computation, 24, 2012. [32] R. Tibshirani. Regression shrinkage and selection via the lasso. J. of the Royal Statistical Society, 1996. [33] M.E. Tipping. Sparse Bayesian learning and the relevance vector machine. Journal of Machine Learning Research, 1, 2001. [34] Z. Wang, Q. Ling, and T. Huang. Learning deep ℓ0 encoders. AAAI Conference on Artificial Intelligence, 2016. [35] D.P. Wipf. Sparse estimation with structured dictionaries. Advances in Nerual Information Processing 24, 2012. [36] D.P. Wipf and S. Nagarajan. Iterative reweighted ℓ1 and ℓ2 methods for finding sparse solutions. Journal of Selected Topics in Signal Processing (Special Issue on Compressive Sensing), 4(2), April 2010. [37] R.J. Woodham. Photometric method for determining surface orientation from multiple images. Optical Engineering, 19(1), 1980. [38] B. Xin, Y. Wang, W. Gao, and D.P. Wipf. Maximal sparsity with deep networks? Advances in Neural Information Processing Systems 29, 2016. [39] Z. Yang, L. Xie, and C. Zhang. Off-grid direction of arrival estimation using sparse Bayesian inference. IEEE Trans. Signal Processing, 61(1):38–43, 2013. [40] A.R. Zamir, T.L. Wu, L. Sun, W. Shen, J. Malik, and S. Savarese. Feedback networks. arXiv:1612.09508, 2016. 11
2017
605
7,125
Compatible Reward Inverse Reinforcement Learning Alberto Maria Metelli DEIB Politecnico di Milano, Italy albertomaria.metelli@polimi.it Matteo Pirotta SequeL Team Inria Lille, France matteo.pirotta@inria.fr Marcello Restelli DEIB Politecnico di Milano, Italy marcello.restelli@polimi.it Abstract Inverse Reinforcement Learning (IRL) is an effective approach to recover a reward function that explains the behavior of an expert by observing a set of demonstrations. This paper is about a novel model-free IRL approach that, differently from most of the existing IRL algorithms, does not require to specify a function space where to search for the expert’s reward function. Leveraging on the fact that the policy gradient needs to be zero for any optimal policy, the algorithm generates a set of basis functions that span the subspace of reward functions that make the policy gradient vanish. Within this subspace, using a second-order criterion, we search for the reward function that penalizes the most a deviation from the expert’s policy. After introducing our approach for finite domains, we extend it to continuous ones. The proposed approach is empirically compared to other IRL methods both in the (finite) Taxi domain and in the (continuous) Linear Quadratic Gaussian (LQG) and Car on the Hill environments. 1 Introduction Imitation learning aims to learn to perform a task by observing only expert’s demonstrations. We consider the settings where only expert’s demonstrations are given, no information about the dynamics and the objective of the problem is provided (e.g., reward) or ability to query for additional samples. The main approaches solving this problem are behavioral cloning [1] and inverse reinforcement learning [2]. The former recovers the demonstrated policy by learning the state-action mapping in a supervised learning way, while inverse reinforcement learning aims to learn the reward function that makes the expert optimal. Behavioral Cloning (BC) is simple, but its main limitation is the intrinsic goal, i.e., to replicate the observed policy. This task has several limitations: it requires a huge amount of data when the environment (or the expert) is stochastic [3]; it does not provide good generalization or a description of the expert’s goal. On the contrary, Inverse Reinforcement Learning (IRL) accounts for generalization and transferability by directly learning the reward function. This information can be transferred to any new environment in which the features are well defined. As a consequence, IRL allows recovering the optimal policy a posteriori, even under variations of the environment. IRL has received a lot of attention in literature and has succeeded in several applications [e.g., 4, 5, 6, 7, 8]. However, BC and IRL are tightly related by the intrinsic relationship between reward and optimal policy. The reward function defines the space of optimal policies and to recover the reward it is required to observe/recover the optimal policy. The idea of this paper, and of some recent paper [e.g., 9, 8, 3], is to exploit the synergy between BC and IRL. Unfortunately, also IRL approaches present issues. First, several IRL methods require solving the forward problem as part of an inner loop [e.g., 4, 5]. Literature has extensively focused on removing this limitation [10, 11, 9] in order to scale IRL to real-world applications [12, 3, 13]. Second, IRL methods generally require designing the function space by providing features that capture the structure of the reward function [e.g., 4, 14, 5, 10, 15, 9]. This information, provided in addition to expert’s demonstrations, is critical for the success of the IRL approach. The issue of designing the function 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. space is a well-known problem in supervised learning, but it is even more critical in IRL since a wrong choice might prevent the algorithm from finding good solutions to the IRL problem [2, 16], especially when linear reward models are considered. The importance of incorporating feature construction in IRL has been known in literature since a while [4] but, as far as we know, it has been explicitly addressed only in [17]. Recently, IRL literature, by mimicking supervised learning one, has focused on exploiting neural network capability of automatically constructing relevant features out of the provided data [12, 8, 13]. By exploiting a “black-box” approach, these methods do not take advantage of the structure of the underlying Markov decision process (in the phase of feature construction). We present an IRL algorithm that constructs reward features directly from expert’s demonstrations. The proposed algorithm is model-free and does not require solving the forward problem (i.e., finding an optimal policy given a candidate reward function) as an inner step. The Compatible Reward Inverse Reinforcement Learning (CR-IRL) algorithm builds a reward function that is compatible with the expert’s policy. It mixes BC and IRL in order to recover the “optimal” and most “informative” reward function in the space spanned by the recovered features. Inspired by the gradient-minimization IRL approach proposed in [9], we focus on the space of reward functions that makes the policy gradient of the expert vanish. Since a zero gradient is only a necessary condition for optimality, we consider a second order optimality criterion based on the policy Hessian to rank the reward functions and finally select the best one (i.e., the one that penalizes the most a deviation from the expert’s policy). 2 Algorithm Overview A Markov Decision Process (MDP) [18] is defined as M = (S, A, P, R, γ, µ) where S is the state space, A is the action space, P(s′|s, a) is a Markovian transition model that defines the conditional distribution of the next state s′ given the current state s and the current action a, γ ∈[0, 1] is the discount factor, R(s, a) is the expected reward for performing action a in state s and µ is the distribution of the initial state. The optimal policy π∗is the policy that maximizes the discounted sum of rewards E[P+∞ t=0 γtR(st, at)|π, M]. CR-IRL takes as input a parametric policy space ΠΘ = {πθ : θ ∈Θ ⊆Rk} and a set of rewardless trajectories from the expert policy πE, denoted by D =  (sτi,0, aτi,0, . . . , sτi,T (τi), aτi,T (τi)) , where sτi,t is the t-th state in trajectory τi and i = 1, . . . , N. CR-IRL is a non-iterative algorithm that recovers a reward function for which the expert is optimal without requiring to specify a reward function space. It starts building the features {φi} of the value function that are compatible with policy πE, i.e., that make the policy gradient vanish (Phase 1, see Sec. 3). This step requires a parametric representation πθE ∈ΠΘ of the expert’s policy which can be obtained through behavioral cloning.1 The choice of the policy space ΠΘ influences the size of the functional space used by CR-IRL for representing the value function (and the reward function) associated with the expert’s policy. In order to formalize this notion, we introduce the policy rank, a quantity that represents the ability of a parametric policy to reduce the dimensions of the approximation space for the value function of the expert’s policy. Once these value features have been built, they can be transformed into reward features {ψi} (Phase 2 see Sec. 4) by means of the Bellman equation [18] (model-based) or reward shaping [19] (model-free). All the rewards spanned by the features {ψi} satisfy the first-order necessary optimality condition [20], but we are not sure about their nature (minima, maxima or saddle points). The final step is thus to recover a reward function that is maximized by the expert’s policy (Phase 3 see Sec. 5). This is achieved by considering a second-order optimality condition, with the idea that we want the reward function that penalizes the most a deviation from the parameters of the expert’s policy πθE. This criterion is similar in spirit to what done in [2, 4, 14], where the goal is to identify the reward function that makes the expert’s policy better than any other policy by a margin. The algorithmic structure is reported in Alg. 1. IRL literature usually considers two different settings: optimal or sub-optimal expert. This distinction is necessary when a fixed reward space is provided. In fact, the demonstrated behavior may not be optimal under the considered reward space. In this case, the problem becomes somehow not well defined and additional “optimality” criteria are required [16]. This is not the case for CR-IRL that is able to automatically generate the space of reward functions that make the policy gradient vanish, 1We want to stress that our primal objective is to recover the reward function since we aim to explain the motivations that guide the expert and to transfer it, not just to replicate the behavior. As explained in the introduction, we aim to exploit the synergy between BC and IRL. 2 thus containing also reward functions under which the recovered expert’s policy πθE is optimal. In the rest of the paper, we will assume to have a parametric representation of the expert’s policy that we will denote for simplicity by πθ. 3 Expert’s Compatible Value Features In this section, we present the procedure to obtain the set {φi}p i=1 of Expert’s COmpatible Q-features (ECO-Q) that make the policy gradient vanish2 (Phase 1). We start introducing the policy gradient and the associated first-order optimality condition. We will indicate with T the set of all possible trajectories, pθ(τ) the probability density of trajectory τ and R(τ) the γ-discounted trajectory reward defined as R(τ) = PT (τ) t=0 γtR(sτ,t, aτ,t) that, in our settings, is obtained as a linear combination of reward features. Given a policy πθ, the expected γ-discounted return for an infinite horizon MDP is: J(θ) = Z S dπθ µ (s) Z A πθ(a|s)R(s, a)dads = Z T pθ(τ)R(τ)dτ, where dπθ µ is the γ-discounted future state occupancy [21]. If πθ is differentiable w.r.t. the parameter θ, the gradient of the expected reward (policy gradient) [21, 22, 23] is: ∇θJ(θ) = Z S Z A dπθ µ (s, a)∇θ log πθ(a|s)Qπθ(s, a)dads = Z T pθ(τ)∇θ log pθ(τ)R(τ)dτ, (1) where dπθ µ (s, a) = dπθ µ (s)πθ(a|s) is the γ-discounted future state-action occupancy, which represents the expected discounted number of times action a is executed in state s given µ as initial state distribution and following policy πθ. When πθ is an optimal policy in the class of policies ΠΘ = {πθ : θ ∈Θ ⊆Rk} then θ is a stationary point of the expected return and thus ∇θJ(θ) = 0 (first-order necessary conditions for optimality [20]). We assume the space S × A to be a Hilbert space [24] equipped with the weighted inner product:3 ⟨f, g⟩µ,πθ = Z S Z A f(s, a)dπθ µ (s, a)g(s, a)dsda. (2) When πθ is optimal for the MDP, ∇θ log πθ and Qπθ are orthogonal w.r.t. the inner product (2). We can exploit the orthogonality property to build an approximation space for the Q-function. Let Gπθ = {∇θ log πθα : α ∈Rk} the subspace spanned by the gradient of the log-policy πθ. From equation (1) finding an approximation space for the Q-function is equivalent to find the orthogonal complement of the subspace Gπθ, which in turn corresponds to find the null space of the functional: Gπθ[φ] = ⟨∇θ log πθ, φ⟩µ,πθ. (3) We define an Expert’s COmpatible Q-feature as any function φ making the functional (3) null. This space G⊥ πθ := null(Gπθ) represents the Hilbert subspace of the features for the Q-function that are compatible with the policy πθ in the sense that any Q-function optimized by policy πθ can be expressed as a linear combination of those features. Section 3.2 and 3.3 describe how to compute the ECO-Q from samples in finite and continuous MDPs, respectively. The dimension of G⊥ πθ is typically very large since the number k of policy parameters is significantly smaller than the number of state-action pairs. A formal discussion of this issue for finite MDPs is presented in the next section. 3.1 Policy rank The parametrization of the expert’s policy influences the size of G⊥ πθ. Intuition suggests that the larger the number k of the parameters the more the policy is informative to infer the Q-function and so the reward function. This is motivated by the following rationale. Consider representing the expert’s policy using two different policy models such that one model is a superclass of the other one (for instance, assume to use linear models where the features used in the simpler model are a subset of the features used by policies in the other model). All the reward functions that make the policy gradient 2Notice that any linear combination of the ECO-Q also satisfies the first-order optimality condition. 3The inner product as defined is clearly symmetric, positive definite and linear, but there could be state-action pairs never visited, i.e., dπθ µ (s, a) = 0, making ⟨f, f⟩µ,πθ = 0 for non-zero f. To ensure the properties of the inner product, we assume to compute it only on visited state-action pairs. 3 vanish with the rich policy model, do the same with the simpler model, while the vice versa does not hold. This suggests that complex policy models are able to reduce more the space of optimal reward function w.r.t. simpler models. This notion plays an important role for finite MDPs, i.e., MDPs where the state-action space is finite. We formalize the ability of a policy to infer the characteristics of the MDP with the concept of policy rank. Definition 1. Let πθ a policy with k parameters belonging to the class ΠΘ and differentiable in θ. The policy rank is the dimension of the space of the linear combinations of the partial derivatives of πθ w.r.t. θ: rank(πθ) = dim(Γπθ), Γπθ = {∇θπθα : α ∈Rk}. A first important note is that the policy rank depends not only on the policy model ΠΘ but also on the value of the parameters of the policy πθ. So the policy rank is a property of the policy not of the policy model. The following bound on the policy rank holds (the proof can be found in App. A.1). Proposition 1. Given a finite MDP M, let πθ a policy with k parameters belonging to the class ΠΘ and differentiable in θ, then: rank(πθ) ≤min {k, |S||A| −|S|}. From an intuitive point of view this is justified by the fact that πθ(·|s) is a probability distribution. As a consequence, for all s ∈S the probabilities πθ(a|s) must sum up to 1, removing |S| degrees of freedom. This has a relevant impact on the algorithm since it induces a lower bound on the dimension of the orthogonal complement dim(G⊥ πθ) ≥max {|S||A| −k, |S|}, thus even the most flexible policy (i.e., a policy model with a parameter for each state-action pair) cannot determine a unique reward function that makes the expert’s policy optimal, leaving |S| degrees of freedom. It follows that it makes no sense to consider a policy with more than |S||A| −|S| parameters. The generalization capabilities enjoyed by the recovered reward function are deeply related to the choice of the policy model. Complex policies (many parameters) would require finding a reward function that explains the value of all the parameters, resulting in a possible overfitting, whereas a simple policy model (few parameters) would enforce generalization as the imposed constraints are fewer. 3.2 Construction of ECO-Q in Finite MDPs We now develop in details the algorithm to generate ECO-Q in the case of finite MDPs. From now on we will indicate with |D| the number of distinct state-action pairs visited by the expert along the available trajectories. When the state-action space is finite the inner product (2) can be written in matrix notation as: ⟨f, g⟩µ,πθ = f T Dπθ µ g, where f, g and dπθ µ are real vectors with |D| components and Dπθ µ = diag(dπθ µ ). The term ∇θ log πθ is a |D| × k real matrix, thus finding the null space of the functional (3) is equivalent to finding the null space of the matrix ∇θ log πT θ Dπθ µ . This can be done for instance through SVD which allows to obtain a set of orthogonal basis functions Φ. Given that the weight vector dπθ µ (s, a) is usually unknown, it needs to be estimated. Since the policy πθ is known, we need to estimate just dπθ µ (s), as dπθ µ (s, a) = dπθ µ (s)πθ(a|s). A Monte Carlo estimate exploiting the expert’s demonstrations in D is: ˆdπθ µ (s) = 1 N N X i=1 T (τi) X t=0 γt1(sτi,t = s). (4) 3.3 Construction of ECO-Q in Continuous MDPs To extend the previous approach to the continuous domain we assume that the state-action space is equipped with the Euclidean distance. Now we can adopt an approach similar to the one exploited to extend Proto-Value Functions (PVF) [25, 26] to infinite observation spaces [27]. The problem is treated as a discrete one considering only the state-action pairs visited along the collected trajectories. A Nyström interpolation method is used to approximate the value of a feature in a non-visited state-action pair as a weighted mean of the values of the closest k features. The weight of each feature is computed by means of a Gaussian kernel placed over the Euclidean space S × A: K (s, a), (s′, a′)  = exp  − 1 2σ2 S ∥s −s′∥2 2 − 1 2σ2 A ∥a −a′∥2 2  , (5) where σS and σA are respectively the state and action bandwidth. In our setting this approach is fully equivalent to a kernel k-Nearest Neighbors regression. 4 4 Expert’s Compatible Reward Features The set of ECO-Q basis functions allows representing the optimal value function under the policy πθ. In this section, we will show how it is possible to exploit ECO-Q functions to generate basis functions for the reward representation (Phase 2). In principle, we can use the Bellman equation to obtain the reward from the Q-function but this approach requires the knowledge of the transition model (see App. B). The reward can be recovered in a model-free way by exploiting optimality-invariant reward transformations. Reversing the Bellman equation [e.g., 10] allows finding the reward space that generates the estimated Q-function. However, IRL is interested in finding just a reward space under which the expert’s policy is optimal. This problem can be seen as an instance of reward shaping [19] where the authors show that the space of all the reward functions sharing the same optimal policy is given by: R′(s, a) = R(s, a) + γ Z S P(s′|s, a)χ(s′)ds′ −χ(s), where χ(s) is a state-dependent potential function. A smart choice [19] is to set χ = V πθ under which the new reward space is given by the advantage function: R′(s, a) = Qπθ(s, a) −V πθ(s) = Aπθ(s, a). Thus the expert’s advantage function is an admissible reward optimized by the expert’s policy itself. This choice is, of course, related to using Qπθ as reward. However, the advantage function encodes a more local and more transferable information w.r.t. the Q-function. The space of reward features can be recovered through matrix equality Ψ = (I −˜ πθ)Φ, where ˜ πθ is a |D| × |D| matrix obtained from πθ repeating the row of each visited state a number of times equal to the number of distinct actions performed by the expert in that state. Notice that this is a simple linear transformation through the expert’s policy. The specific choice of the state-potential function has the advantage to improve the learning capabilities of any RL algorithm [19]. This is not the only choice of the potential function possible, but it has the advantage of allowing model-free estimation. Once the ECO-R basis functions have been generated, they can be used to feed any IRL algorithm that represents the expert’s reward through a linear combination of basis functions. In the next section, we propose a new method based on the optimization of a second-order criterion that favors reward functions that significantly penalize deviations from the expert’s policy. 5 Reward Selection via Second-Order Criterion Any linear combination of the ECO-R {ψi}p i=1 makes the gradient vanish, however in general this is not sufficient to ensure that the policy parameter θ is a maximum of J(θ). Combinations that lead to minima or saddle points should be discarded. Furthermore, provided that a subset of ECO-R leading to maxima has been selected, we should identify a single reward function in the space spanned by this subset of features (Phase 3). Both these requirements can be enforced by imposing a second-order optimality criterion based on the policy Hessian that is given by [28, 29]: HθJ(θ, ω) = Z T pθ(τ)  ∇θ log pθ(τ)∇θ log pθ(τ)T + Hθ log pθ(τ)  R(τ, ω)dτ, where ω is the reward weight and R(τ, ω) = Pp i=1 ωi PT (τ) t=0 γtψi(sτ,t, aτ,t). In order to retain only maxima we need to impose that the Hessian is negative definite. Furthermore, we aim to find the reward function that best represents the optimal policy parametrization in the sense that even a slight change of the parameters of the expert’s policy induces a significant degradation of the performance. Geometrically this corresponds to find the reward function for which the expected return locally represents the sharpest hyper-paraboloid. These requirements can be enforced using a Semi-Definite Programming (SDP) approach where the objective is to minimize the maximum eigenvalue of the Hessian whose eigenvector corresponds to the direction of minimum curvature (maximum eigenvalue optimality criterion). This problem is not appealing in practice due to its high computational burden. Furthermore, it might be the case that the strict negative definiteness constraint is never satisfied due to blocked-to-zero eigenvalues (for instance in presence of policy parameters that do not affect the policy performance). In these cases, we can consider maximizing an index of the overall concavity. The trace of the Hessian, being the sum of the eigenvalues, can be used for this purpose. This problem can be still defined as a SDP problem (trace optimality criterion). See App. C for details. 5 Input: D =  (sτi,0, aτi,0, . . . , sτi,T (τi), aτi,T (τi)) N i=1 a set of expert’s trajectories and parametric expert’s policy πθ. Output: trace heuristic ECO-R, Rtr−heu. 1. Estimate dπθ µ (s) for the visited state-action pairs using Eq. (4) and compute dπθ µ (s, a) = dπθ µ (s)πθ(a|s). 2. Collect dπθ µ (s, a) in the |D| × |D| diagonal matrix Dπθ µ and ∇θ log πθ(s, a) in the |D| × k matrix ∇θ log πθ. 3. Get the set of ECO-Q by computing the null space of matrix ∇θ log πθ T Dπθ µ through SVD: Φ = null ∇θ log πθ T Dπθ µ  . 4. Get the set of ECO-R by applying reward shaping to the set of ECO-Q: Ψ = (I −˜ πθ)Φ. 5. Apply SVD to orthogonalize Ψ. 6. Estimate the policy Hessian for each ECO-R ψi, i = 1, ...p using equation:a ˆ HθJi(θ) = 1 N N X j=1 ∇θ log pθ(τj)∇θ log pθ(τj)T + Hθ log pθ(τj) ψi(τj) −b  . 7. Discard the ECO-R having indefinite Hessian, switch sign for those having positive semidefinite Hessian, compute the traces of each Hessian and collect them in the vector tr. 8. Compute the trace heuristic ECO-R as: Rtr−heu = Ψω , ω = −tr/∥tr∥2. 9. (Optional) Apply penalization to unexplored state-action pairs. aThe optimal baseline b is provided in [30, 31]. Alg 1: CR-IRL algorithm. Phase 1 Phase 2 Phase 3 Trace optimality criterion, although less demanding w.r.t. the eigenvaluebased one, still displays performance degradation as the number of basis functions increases due to the negative definiteness constraint. Solving the semidefinite programming problem of one of the previous optimality criteria is unfeasible for almost all the real world problems. We are interested in formulating a non-SDP problem, which is a surrogate of the trace optimality criterion, that can be solved more efficiently (trace heuristic criterion). In our framework, the reward function can be expressed as a linear combination of the ECO-R so we can rewrite the Hessian as HθJ(θ, ω) = Pp i=1 ωiHθJi(θ) where Ji(θ) is the expected return considering as reward function ψi. We assume that the ECO-R are orthonormal in order to compare them.4 The main challenge is how to select the weight ω in order to get a (sub-)optimal trace minimizer that preserves the negative semidefinite constraint. From Weyl’s inequality, we get a feasible solution by retaining only the ECO-Rs yielding a semidefinite Hessian and switching sign to those with positive semidefinite Hessian. Our heuristic consists in looking for the weights ω that minimize the trace in this reduced space (in which all ECO-R have a negative semidefinite Hessian). Notice that in this way we can loose the optimal solution since the trace minimizer might assign a non-zero weight to a ECO-R with indefinite Hessian. For brevity, we will indicate with tri = tr(HθJi(θ)) and tr the vector whose components are tri. SDP is no longer needed: min ω ωT tr s.t. ∥ω∥2 2 = 1. (6) The constraint ∥ω∥2 2 = 1 ensures that, when the ECO-R are orthonormal, the resulting ECO-R has Euclidean norm one. This is a convex programming problem with linear objective function and quadratic constraint, the closed form solution can be found with Lagrange multipliers: ωi = − tri ∥tr∥2 (see App. A.2 for the derivation). Refer to Algorithm 1 for a complete overview of CR-IRL (the computational analysis of CR-IRL is reported in App. E). CR-IRL does not assume to know the state space S and the action space A, thus the recovered reward is defined only in the state-action pairs visited by the expert along the trajectories in D. When the state and action spaces are known, we can complete the reward function also for unexplored state-action pairs assigning a penalized reward (e.g., a large negative value), otherwise the penalization can be performed online when the recovered reward is used to solve the forward RL problem. 6 Related Work There has been a surge of recent interest in improving IRL in order to make it more appealing for real-world applications. We highlight the lines of works that are more related to this paper. We start investigating how IRL literature has faced the problem of designing a suitable reward space. Almost all the IRL approaches share the necessity to define a priori a set of handcrafted features, 4A normalization condition is necessary since the magnitude of the trace of a matrix can be arbitrarily changed by multiplying the matrix by a constant. 6 spanning the approximation space of the reward functions. While a good set of basis functions can greatly simplify the IRL problem, a bad choice may significantly harm the performance of any IRL algorithm. The Feature construction for Inverse Reinforcement Learning (FIRL) algorithm [17], as far as we know, is the only approach that explicitly incorporates the feature construction as an inner step. FIRL alternates between optimization and fitting phases. The optimization phase aims to recover a reward function—from the current feature set as a linear projection—such that the associated optimal policy is consistent with the demonstrations. In the fitting phase new features are created (using a regression tree) in order to better explain regions where the old features were too coarse. The method proved to be effective achieving also (features) transfer capabilities. However, FIRL requires the MDP model to solve the forward problem and the complete optimal policy for the fitting step in order to evaluate the consistency with demonstrations. Recent works have indirectly coped with the feature construction problem by exploiting neural networks [12, 3, 13]. Although effective, the black-box approach does not take into account the MDP structure of the problem. RL has extensively investigated the feature construction for the forward problem both for value function [25, 26, 32, 33] and policy [21] features. In this paper, we have followed this line of work mixing concepts deriving from policy and value fields. We have leveraged on the policy gradient theorem and on the associated concept of compatible functions to derive ECO-Q features. First-order necessary conditions have already been used in literature to derive IRL algorithm [9, 34]. However, in both the cases the authors assume a fixed reward space under which it may not be possible to find a reward for which the expert is optimal. Although there are similarities, this paper exploits first-order optimality to recover the reward basis while the “best” reward function is selected according to a second-order criterion. This allows recovering a more robust solution overcoming uncertainty issues raised by the use of the first-order information only. 7 Experimental results We evaluate CR-IRL against some popular IRL algorithms both in discrete and in continuous domains: the Taxi problem (discrete), the Linear Quadratic Gaussian and the Car on the Hill environments (continuous). We provide here the most significant results, the full data are reported in App. D. 7.1 Taxi The Taxi domain is defined in [35]. We assume the expert plays an ϵ-Boltzmann policy with fixed ϵ: πθ,ϵ(a|s) = (1 −ϵ) eθT a ζs P a′∈A eθa′ T ζs + ϵ |A|, where the policy features ζs are the following state features: current location, passenger location, destination location, whether the passenger has already been pick up. This test is meant to compare the learning speed of the reward functions recovered by the considered IRL methods when a Boltzmann policy (ϵ = 0) is trained with REINFORCE [22]. To evaluate the robustness to imperfect experts, we introduce a noise (ϵ) in the optimal policy. Figure 2 shows that CR-IRL, with 100 expert’s trajectories, outperforms the true reward function in terms of convergence speed regardless the exploration level. Behavioral Cloning (BC), obtained by recovering the maximum likelihood ϵ-Boltzmann policy (ϵ = 0, 0.1) from expert’s trajectories, is very susceptible to noise. We compare also the second-order criterion of CR-IRL to single out the reward function with Maximum Entropy IRL (ME-IRL) [6] and Linear Programming Apprenticeship Learning (LPAL) [5] using as reward features the set of ECO-R (comparisons with different sets of features is reported in App. D.2). We can see in Figure 2 that ME-IRL does not perform well when ϵ = 0, since the transition model is badly estimated. The convergence speed remains very slow also for ϵ = 0.1, since ME-IRL does not guarantee that the recovered reward is a maximum of J. LPAL provides as output an apprenticeship policy (not a reward function) and, like BC, is very sensitive to noise and to the quality of the estimated transition model. 7.2 Linear Quadratic Gaussian Regulator We consider the one-dimensional Linear Quadratic Gaussian regulator [36] with an expert playing a Gaussian policy πK(·|s) ∼N(Ks, σ2), where K is the parameter and σ2 is fixed. 7 0 50 100 150 −200 −100 0 iteration average return ϵ = 0 0 50 100 150 −200 −100 0 iteration average return ϵ = 0.1 Reward CR-IRL ME-IRL LPAL BC (ϵ = 0) BC (ϵ = 0.1) Expert Figure 2: Average return of the Taxi problem as a function of the number of iterations of REINFORCE. 0 100 200 300 400 −0.6 −0.4 −0.2 iteration parameter Reward Advantage GIRL-abs-val GIRL-square CR-IRL Expert Figure 3: Parameter value of LQG as a function of the number of iterations of REINFORCE. 0 5 10 15 20 0 0.2 0.4 iteration average return CR-IRL BC Expert Reward Figure 4: Average return of Car on the Hill as a function of the number of FQI iterations. We compare CR-IRL with GIRL [9] using two linear parametrizations of the reward function: R(s, a, ω) = ω1s2 + ω2a2 (GIRL-square) and R(s, a, ω) = ω1|s| + ω2|a| (GIRL-abs-val). Figure 3 shows the parameter (K) value learned with REINFORCE using a Gaussian policy with variance σ2 = 0.01. We notice that CR-IRL, fed with 20 expert’s trajectories, converges closer and faster to the expert’s parameter w.r.t. to the true reward, advantage function and GIRL with both parametrizations. 7.3 Car on the Hill We further experiment CR-IRL in the continuous Car on the Hill domain [37]. We build the optimal policy via FQI [37] and we consider a noisy expert’s policy in which a random action is selected with probability ϵ = 0.1. We exploit 20 expert’s trajectories to estimate the parameters w of a Gaussian policy πw(a|s) ∼N(yw(s), σ2) where the mean yw(s) is a radial basis function network (details and comparison with ϵ = 0.2 in appendix D.4). The reward function recovered by CR-IRL does not necessary need to be used only with policy gradient approaches. Here we compare the average return as a function of the number of iterations of FQI, fed with the different recovered rewards. Figure 4 shows that FQI converges faster to optimal policies when coped with the reward recovered by CR-IRL rather than with the original reward. Moreover, it overcomes the performance of the policy recovered via BC. 8 Conclusions We presented an algorithm, CR-IRL, that leverages on the policy gradient to recover, from a set of expert’s demonstrations, a reward function that explains the expert’s behavior and penalizes deviations. Differently from large part of IRL literature, CR-IRL does not require to specify a priori an approximation space for the reward function. The empirical results show (quite unexpectedly) that the reward function recovered by our algorithm allows learning policies that outperform both behavioral cloning and those obtained with the true reward function (learning speed). Furthermore, the Hessian trace heuristic criterion, when applied to ECO-R, outperforms classic IRL methods. 8 Acknowledgments This research was supported in part by French Ministry of Higher Education and Research, Nord-Pasde-Calais Regional Council and French National Research Agency (ANR) under project ExTra-Learn (n.ANR-14-CE24-0010-01). References [1] Brenna D. Argall, Sonia Chernova, Manuela Veloso, and Brett Browning. A survey of robot learning from demonstration. Robotics and Autonomous Systems, 57(5):469–483, 2009. [2] Andrew Y Ng, Stuart J Russell, et al. Algorithms for inverse reinforcement learning. In ICML, pages 663–670, 2000. [3] Jonathan Ho and Stefano Ermon. Generative adversarial imitation learning. In NIPS, pages 4565–4573, 2016. [4] Pieter Abbeel and Andrew Y Ng. Apprenticeship learning via inverse reinforcement learning. In ICML, page 1. ACM, 2004. [5] Umar Syed, Michael H. Bowling, and Robert E. Schapire. Apprenticeship learning using linear programming. In ICML, volume 307 of ACM International Conference Proceeding Series, pages 1032–1039. ACM, 2008. [6] Brian D Ziebart, Andrew L Maas, J Andrew Bagnell, and Anind K Dey. Maximum entropy inverse reinforcement learning. In AAAI, volume 8, pages 1433–1438. Chicago, IL, USA, 2008. [7] Nathan D. Ratliff, David Silver, and J. Andrew Bagnell. Learning to search: Functional gradient techniques for imitation learning. Autonomous Robots, 27(1):25–53, 2009. [8] Jonathan Ho, Jayesh K. Gupta, and Stefano Ermon. Model-free imitation learning with policy optimization. In ICML, volume 48 of JMLR Workshop and Conference Proceedings, pages 2760–2769. JMLR.org, 2016. [9] Matteo Pirotta and Marcello Restelli. Inverse reinforcement learning through policy gradient minimization. In AAAI, pages 1993–1999, 2016. [10] Edouard Klein, Bilal Piot, Matthieu Geist, and Olivier Pietquin. A cascaded supervised learning approach to inverse reinforcement learning. In ECML/PKDD (1), volume 8188 of Lecture Notes in Computer Science, pages 1–16. Springer, 2013. [11] Bilal Piot, Matthieu Geist, and Olivier Pietquin. Boosted and reward-regularized classification for apprenticeship learning. In AAMAS, pages 1249–1256. IFAAMAS/ACM, 2014. [12] Chelsea Finn, Sergey Levine, and Pieter Abbeel. Guided cost learning: Deep inverse optimal control via policy optimization. In ICML, volume 48 of JMLR Workshop and Conference Proceedings, pages 49–58. JMLR.org, 2016. [13] Todd Hester, Matej Vecerik, Olivier Pietquin, Marc Lanctot, Tom Schaul, Bilal Piot, Andrew Sendonaris, Gabriel Dulac-Arnold, Ian Osband, John Agapiou, Joel Z. Leibo, and Audrunas Gruslys. Learning from demonstrations for real world reinforcement learning. CoRR, abs/1704.03732, 2017. [14] Nathan D. Ratliff, J. Andrew Bagnell, and Martin Zinkevich. Maximum margin planning. In ICML, volume 148 of ACM International Conference Proceeding Series, pages 729–736. ACM, 2006. [15] Julien Audiffren, Michal Valko, Alessandro Lazaric, and Mohammad Ghavamzadeh. Maximum entropy semi-supervised inverse reinforcement learning. In IJCAI, pages 3315–3321. AAAI Press, 2015. [16] Gergely Neu and Csaba Szepesvári. Training parsers by inverse reinforcement learning. Machine Learning, 77(2-3):303–337, 2009. [17] Sergey Levine, Zoran Popovic, and Vladlen Koltun. Feature construction for inverse reinforcement learning. In NIPS, pages 1342–1350. Curran Associates, Inc., 2010. [18] Martin L Puterman. Markov decision processes: Discrete stochastic dynamic programming. 1994. [19] Andrew Y Ng, Daishi Harada, and Stuart Russell. Policy invariance under reward transformations: Theory and application to reward shaping. 99:278–287, 1999. 9 [20] Jorge Nocedal and Stephen J. Wright. Numerical Optimization. Springer Series in Operations Research and Financial Engineering. Springer New York, 2006. [21] Richard S. Sutton, David A. McAllester, Satinder P. Singh, and Yishay Mansour. Policy gradient methods for reinforcement learning with function approximation. In NIPS, pages 1057–1063. The MIT Press, 1999. [22] Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229–256, 1992. [23] Jan Peters and Stefan Schaal. Reinforcement learning of motor skills with policy gradients. Neural Networks, 21(4):682–697, 2008. [24] Wendelin Böhmer, Steffen Grünewälder, Yun Shen, Marek Musial, and Klaus Obermayer. Construction of approximation spaces for reinforcement learning. Journal of Machine Learning Research, 14(1):2067–2118, 2013. [25] Sridhar Mahadevan. Proto-value functions: Developmental reinforcement learning. In ICML, pages 553–560. ACM, 2005. [26] Sridhar Mahadevan and Mauro Maggioni. Proto-value functions: A laplacian framework for learning representation and control in markov decision processes. Journal of Machine Learning Research, 8(Oct):2169–2231, 2007. [27] Sridhar Mahadevan, Mauro Maggioni, Kimberly Ferguson, and Sarah Osentoski. Learning representation and control in continuous markov decision processes. In AAAI, volume 6, pages 1194–1199, 2006. [28] Sham Kakade. A natural policy gradient. In NIPS, pages 1531–1538. MIT Press, 2001. [29] Thomas Furmston and David Barber. A unifying perspective of parametric policy search methods for markov decision processes. In Advances in neural information processing systems, pages 2717–2725, 2012. [30] Giorgio Manganini, Matteo Pirotta, Marcello Restelli, and Luca Bascetta. Following newton direction in policy gradient with parameter exploration. In Neural Networks (IJCNN), 2015 International Joint Conference on, pages 1–8. IEEE, 2015. [31] Simone Parisi, Matteo Pirotta, and Marcello Restelli. Multi-objective reinforcement learning through continuous pareto manifold approximation. Journal Artificial Intelligence Research, 57:187–227, 2016. [32] Ronald Parr, Christopher Painter-Wakefield, Lihong Li, and Michael L. Littman. Analyzing feature generation for value-function approximation. In ICML, volume 227 of ACM International Conference Proceeding Series, pages 737–744. ACM, 2007. [33] Amir Massoud Farahmand and Doina Precup. Value pursuit iteration. In NIPS, pages 1349–1357, 2012. [34] Peter Englert and Marc Toussaint. Inverse kkt–learning cost functions of manipulation tasks from demonstrations. In Proceedings of the International Symposium of Robotics Research, 2015. [35] Thomas G Dietterich. Hierarchical reinforcement learning with the maxq value function decomposition. J. Artif. Intell. Res.(JAIR), 13:227–303, 2000. [36] Peter Dorato, Vito Cerone, and Chaouki Abdallah. Linear Quadratic Control: An Introduction. Krieger Publishing Co., Inc., Melbourne, FL, USA, 2000. [37] Damien Ernst, Pierre Geurts, and Louis Wehenkel. Tree-based batch mode reinforcement learning. Journal of Machine Learning Research, 6(Apr):503–556, 2005. [38] C-L Hwang and Abu Syed Md Masud. Multiple objective decision making-methods and applications: a state-of-the-art survey, volume 164. Springer Science & Business Media, 2012. [39] Jose M. Vidal and José M Vidal. Fundamentals of multiagent systems. 2006. [40] Emre Mengi, E Alper Yildirim, and Mustafa Kilic. Numerical optimization of eigenvalues of hermitian matrix functions. SIAM Journal on Matrix Analysis and Applications, 35(2):699–724, 2014. [41] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2014. 10
2017
606
7,126
Consistent Robust Regression Kush Bhatia∗ University of California, Berkeley kushbhatia@berkeley.edu Prateek Jain Microsoft Research, India prajain@microsoft.com Parameswaran Kamalaruban† EPFL, Switzerland kamalaruban.parameswaran@epfl.ch Purushottam Kar Indian Institute of Technology, Kanpur purushot@cse.iitk.ac.in Abstract We present the first efficient and provably consistent estimator for the robust regression problem. The area of robust learning and optimization has generated a significant amount of interest in the learning and statistics communities in recent years owing to its applicability in scenarios with corrupted data, as well as in handling model mis-specifications. In particular, special interest has been devoted to the fundamental problem of robust linear regression where estimators that can tolerate corruption in up to a constant fraction of the response variables are widely studied. Surprisingly however, to this date, we are not aware of a polynomial time estimator that offers a consistent estimate in the presence of dense, unbounded corruptions. In this work we present such an estimator, called CRR. This solves an open problem put forward in the work of [3]. Our consistency analysis requires a novel two-stage proof technique involving a careful analysis of the stability of ordered lists which may be of independent interest. We show that CRR not only offers consistent estimates, but is empirically far superior to several other recently proposed algorithms for the robust regression problem, including extended Lasso and the TORRENT algorithm. In comparison, CRR offers comparable or better model recovery but with runtimes that are faster by an order of magnitude. 1 Introduction The problem of robust learning involves designing and analyzing learning algorithms that can extract the underlying model despite dense, possibly malicious, corruptions in the training data provided to the algorithm. The problem has been studied in a dizzying variety of models and settings ranging from regression [19], classification [11], dimensionality reduction [4] and matrix completion [8]. In this paper we are interested in the Robust Least Squares Regression (RLSR) problem that finds several applications to robust methods in face recognition and vision [22, 21], and economics [19]. In this problem, we are given a set of n covariates in d dimensions, arranged as a data matrix X = [x1, . . . , xn], and a response vector y ∈Rn. However, it is known apriori that a certain number k of these responses cannot be trusted since they are corrupted. These may correspond to corrupted pixels in visual recognition tasks or untrustworthy measurements in general sensing tasks. Using these corrupted data points in any standard least-squares solver, especially when k = O (n), is likely to yield a poor model with little predictive power. A solution to this is to exclude corrupted ∗Work done in part while Kush was a Research Fellow at Microsoft Research India. †Work done in part while Kamalaruban was interning at Microsoft Research India. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. Table 1: A comparison of different RLSR algorithms and their properties. CRR is the first efficient RLSR algorithm to guarantee consistency in the presence of a constant fraction of corruptions. Paper Breakdown Point Adversary Consistent Technique Wright & Ma, 2010 [21] α →1 Oblivious No L1 regularization Chen & Dalalyan, 2010 [7] α ≥Ω(1) Adaptive No SOCP Chen et al., 2013 [6] α ≥Ω  1 √ d  Adaptive No Robust thresholding Nguyen & Tran, 2013 [16] α →1 Oblivious No L1 regularization Nguyen & Tran, 2013b [17] α →1 Oblivious No L1 regularization McWilliams et al., 2014 [14] α ≥Ω  1 √ d  Oblivious No Weighted subsampling Bhatia et al., 2015 [3] α ≥Ω(1) Adaptive No Hard thresholding This paper α ≥Ω(1) Oblivious Yes Hard thresholding points from consideration. The RLSR problem formalizes this requirement as follows: (bw, bS) = arg min w∈Rp,S⊂[n] |S|=n−k X i∈S (yi −xT i w)2, (1) This formulation seeks to simultaneously extract the set of uncorrupted points and estimate the least-squares solutions over those uncorrupted points. Due to the combinatorial nature of the RLSR formulation (1), solving it directly is challenging and in fact, NP-hard in general [3, 20]. Literature in robust statistics suggests several techniques to solve (1). The most common model assumes a realizable setting wherein there exists a gold model w∗that generates the non-corrupted responses. A vector of corruptions is then introduced to model the corrupted responses i.e. y = XT w∗+ b∗. (2) The goal of RLSR is to recover w∗∈Rd, the true model. The vector b∗∈Rn is a k-sparse vector which takes non-zero values on at most k corrupted samples out of the n total samples, and a zero value elsewhere. A more useful, but challenging model is one in which (mostly heteroscedastic and i.i.d.) Gaussian noise is injected into the responses in addition to the corruptions. y = XT w∗+ b∗+ ϵ. (3) Note that the Gaussian noise vector ϵ is not sparse. In fact, we have ∥ϵ∥0 = n almost surely. 2 Related Works A string of recent works have looked at the RLSR problem in various settings. To facilitate a comparison among these, we set the following benchmarks for RLSR algorithms 1. (Breakdown Point) This is the number of corruptions k that an RLSR algorithm can tolerate is a direct measure of its robustness. This limit is formalized as the breakdown point of the algorithm in statistics literature. The breakdown point k is frequently represented as a fraction α of the total number of data points i.e. k = α · n. 2. (Adversary Model) RLSR algorithms frequently resort to an adversary model to specify how are the corruptions introduced into the regression problem. The strictest is the adaptive adversarial model wherein the adversary is able to view X and w∗(as well as ϵ if Gaussian noise is present) before deciding upon b∗. A weaker model is the oblivious adversarial model wherein the adversary generates a k-sparse vector in complete ignorance of X and w∗(and ϵ). However, the adversary is still free to make arbitrary choices for the location and values of corruptions. 3. (Consistency) RLSR algorithms that are able to operate in the hybrid noise model with sparse adversarial corruptions as well as dense Gaussian noise are more valuable. An RLSR algorithms is said to be consistent if, when invoked in the hybrid noise model on n data points sampled from a distribution with appropriate characteristics, the RLSR algorithm returns an estimate bwn such that limn→∞E [bwn −w∗]2 = 0 (for simplicity, assume a fixed covariate design with the expectation being over random Gaussian noise in the responses). 2 In Table 1, we present a summarized view of existing RLSR techniques and their performance vis-a-vis the benchmarks discussed above. Past work has seen the application of a wide variety of algorithmic techniques to solve this problem, including more expensive methods involving L1 regularization (for example minw,b λw ∥w∥1 +λb ∥b∥1 +∥X⊤w+b−y∥2 2) and second-order cone programs such as [21, 7, 16, 17], as well as more scalable methods such as the robust thresholding and iterative hard thresholding [6, 3]. As the work of [3] shows, L1 regularization and other expensive methods struggle to scale to even moderately sized problems. The adversary models considered by these works is also quite diverse. Half of the works consider an oblivious adversary and the other half brace themselves against an adaptive adversary. The oblivious adversary model, although weaker, can model some important practical situations where there is systematic error in the sensing equipment being used, such as a few pixels in a camera becoming unresponsive. Such errors are surely not random, and hence cannot be modeled as Gaussian noise, but introduce corruptions the final measurement in a manner that is oblivious of the signal actually being sensed, in this case the image being photographed. An important point of consideration is the breakdown point of these methods. Among those cited in Table 1, the works of [21] and [16] obtain the best breakdown points that allow a fraction of points to be corrupted that is arbitrarily close to 1. They require the data to be generated from either an isotropic Gaussian ensemble or be row-sampled from an incoherent orthogonal matrix. Most results mentioned in the table allow a constant fraction of points to be corrupted i.e. allow k = α · n corruptions for some fixed constant α > 0. This is still impressive since it allows a dense subset of data points to be corrupted and yet guarantees recovery. However, as we shall see below, these results cannot guarantee consistency while allowing k = α · n corruptions. We note that we use the term dense to refer to the corruptions in our model since they are a constant fraction of the total available data. Moreover, as we shall see, this constant shall be universal and independent of the ambient dimensionality d. This terminology is used to contrast against some other works which can tolerate only o(n) corruptions which is arguably much sparser. For instance, as we shall see below, the work of [17] can tolerate only o(n/ log n) corruptions if a consistent estimate is expected. The work of [6] also offers a weak guarantee wherein they are only able to tolerate a 1/ √ d fraction of corruptions. However, [6] allow corruptions in covariates as well. However, we note that none of the algorithms listed here, and to the best of our knowledge elsewhere as well, are able to guarantee a consistent solution, irrespective of assumptions on the adversary model. More specifically, none of these methods are able to guarantee exact recovery of w∗, even with n →∞and constant fraction of corruptions α = Ω(1) (i.e. k = Ω(n)) . At best, they guarantee ∥w −w∗∥2 ≤O (σ) when k = Ω(n) where σ is the standard deviation of the white noise (see Equation 3). Thus, their estimation error is of the order of the white noise in the system, even if the algorithm is supplied with an infinite amount of data. This is quite unsatisfactory, given our deep understanding of the consistency guarantees for least squares models. For example, consider the work of [17] which considers a corruption model similar to (3). The work makes deterministic assumptions on the data matrix and proposes the following convex program. min w,b λw ∥w∥1 + λb ∥b∥1 + ∥X⊤w + b −y∥2 2. (4) For Gaussian designs, which we also consider, their results guarantee that for n = O (s log d), ∥bw −w∗∥2 + ∥bb −b∗∥2 ≤O r σ2s log d log n n + r σ2k log n n ! where s is the sparsity index of the regressor w∗. Note that for k = Θ(n), the right hand side behaves as Ω σ√log n  . Thus, the result is unable to ensure limn→∞E [bwn −w∗]2 = 0. We have excluded some classical approaches to the RLSR problem from the table such as [18, 1, 2] which use the Least Median of Squares (LMS) and Least Trimmed Squares (LTS) methods that guaranteed consistency but may require an exponential running time. Our focus is on polynomial time algorithms, more specifically those that are efficient and scalable. We note a recent work [5] in robust stochastic optimization which is able to tolerate a constant fraction of corruptions α →1. However, their algorithms operate in the list-decoding model wherein they output not one, but as many as O  1 1−α  models, of which one (unknown) model is guaranteed to be correct. 3 Recovering Sparse High-dimensional Models: We note that several previous works extend their methods and analyses to handle the case of sparse robust recovery in high-dimensional settings as well, including [3, 7, 17]. A benefit of such extensions is the ability to work even in data starved settings n ≪d if the true model w∗is s-sparse with s ≪d. However, previous works continue to require the number of corruptions to be of the order of k = o(n) or else k = O (n/s) in order to ensure that limn→∞E [bwn −w∗]2 = 0 and cannot ensure consistency if k = O (n). This is evident, for example from the recovery guarantee offered by [17] discussed above, which requires k = o(n/ log n). We do believe our CRR estimator can be adapted to high dimensional settings as well. However, the details are tedious and we reserve them for an expanded version of the paper. 3 Our Contributions In this paper, we remedy the above problem by using a simple and scalable iterative hard-thresholding algorithm called CRR along with a novel two-stage proof technique. Given n covariates that form a Gaussian ensemble, our method in time poly(n, d), outputs an estimate bwn s.t. ∥bwn −w∗∥2 →0 as n →∞(see Theorem 4 for a precise statement). In fact, our method guarantees a nearly optimal error rate of ∥bwn −w∗∥2 ≤σ q d n. It is noteworthy that CRR can tolerate a constant fraction of corruptions i.e. tolerate k = α · n corruptions for some fixed α > 0. We note that although hard thresholding techniques have been applied to the RLSR problem earlier [3, 6], none of those methods are able to guarantee a consistent solution to the problem. Our results hold in the setting where a constant fraction of the responses are corrupted by an oblivious adversary (i.e. the one which corrupts observations without information of the data points themselves). Our algorithm runs in time e O d3 + nd  , where d is the dimensionality of the data. Moreover, as we shall see, our technique makes more efficient use of data than previous hard thresholding methods such as TORRENT [3]. To the best of our knowledge, this is the first efficient and consistent estimator for the RLSR problem in the challenging setting where a constant fraction of the responses may be corrupted in the presence of dense noise. We would like to note that the problem of consistent robust regression is especially challenging because without the assumption of an oblivious adversary, consistent estimation with a constant fraction of corruptions (even for an arbitrarily small constant) may be impossible even when supplied with infinitely many data points. However, by crucially using the restriction of obliviousness on the adversary along with a novel proof technique, we are able to provide a consistent estimator for RLSR with optimal (up to constants) statistical and computational complexity. Discussion on Problem Setting: We clarify that our improvements come at a cost. Our results assume an oblivious adversary whereas several previous works allowed a fully adaptive adversary. Indeed there is no free-lunch: it seems unlikely that consistent estimators are even possible in the face of a fully adaptive adversary who can corrupt a constant fraction of responses since such an adversary can use his power to introduce biased noise into the model in order to defeat any estimator. An oblivious adversary is prohibited from looking at the responses before deciding the corruptions and is thus unable to do the above. Paper Organization: We will begin our discussion by introducing the problem formulation, relevant notation, and tools in Section 4. This is followed by Section 5 where we develop CRR, a near-linear time algorithm that gives consistent estimates for the RLSR problem, which we analyze in Section 6. Finally in Section 7, we present rigorous experimental benchmarking of this algorithm. In Section 8 we offer some clarifications on how the manuscript was modified in response to reviewer comments. 4 Problem Formulation We are given n data points X = [x1, . . . , xn] ∈Rd×n, where xi ∈Rd are the covariates and, for some true model w∗∈Rd, the vector of responses y ∈Rn is generated y = X⊤w∗+ b∗+ ϵ. (5) The responses suffer two kinds of perturbations – dense white noise ϵi ∼N(0, σ2) that is chosen in an i.i.d. fashion independently of the data X and the model w∗, and adversarial corruptions 4 Algorithm 1 CRR: Consistent Robust Regression Input: Covariates X = [x1, . . . , xn], responses y = [y1, . . . , yn]⊤, corruption index k, tolerance ϵ 1: b0 ←0, t ←0, PX ←X⊤(XX⊤)−1X 2: while bt −bt−1 2 > ϵ do 3: bt+1 ←HTk(PXbt + (I −PX)y) 4: t ←t + 1 5: end while 6: return wt ←(XX⊤)−1X(y −bt) in the form of b∗. We assume that b∗is a k∗-sparse vector albeit one with potentially unbounded entries. The constant k∗will be called the corruption index of the problem. We assume the oblivious adversary model where b∗is chosen independently of X, w∗and ϵ. Although there exist works that operate under a fully adaptive adversary [3, 7], none of these works are able to give a consistent estimate, whereas our algorithm CRR does provide a consistent estimate. We also note that existing works are unable to give consistent estimates even in the oblivious adversary model. Our result requires a significantly finer analysis; the standard ℓ2-norm style analysis used by existing works [3, 7] seems incapable of offering a consistent estimation result in the robust regression setting. We will require the notions of Subset Strong Convexity and Subset Strong Smoothness similar to [3] and reproduce the same below. For any set S ⊂[n], let XS := [xi]i∈S ∈Rd×|S| denote the matrix with columns in that set. We define vS for a vector v ∈Rn similarly. λmin(X) and λmax(X) will denote, respectively, the smallest and largest eigenvalues of a square symmetric matrix X. Definition 1 (SSC Property). A matrix X ∈Rd×n is said to satisfy the Subset Strong Convexity Property at level m with constant λm if the following holds: λm ≤min |S|=mλmin(XSX⊤ S ) Definition 2 (SSS Property). A matrix X ∈Rd×n is said to satisfy the Subset Strong Smoothness Property at level m with constant Λm if the following holds: max |S|=mλmax(XSX⊤ S ) ≤Λm. Intuitively speaking, the SSC and SSS properties ensure that the regression problem remains well conditioned, even if restricted to an arbitrary subset of the data points. This allows the estimator to recover the exact model no matter what portion of the data was left uncorrupted by the adversary. We refer the reader to the Appendix A for SSC/SSS bounds for Gaussian ensembles. 5 CRR: A Hard Thresholding Approach to Consistent Robust Regression We now present a consistent method CRR for the RLSR problem. CRR takes a significantly different approach to the problem than previous works. Instead of attempting to exclude data points deemed unclean (as done by the TORRENT algorithm proposed by [3]), CRR focuses on correcting the errors. This allows CRR to work with the entire dataset at all times, as opposed to TORRENT that works with a fraction of the data at any given point of time. To motivate the CRR algorithm, we start with the RLSR formulation minw∈Rp,∥b∥0≤k∗1 2 X⊤w −(y −b) 2 2, and realize that given any estimate bb of the corruption vector, the optimal model with respect to this estimate is given by the expression bw = (XX⊤)−1X(y −bb). Plugging this expression for bw into the formulation allows us to reformulate the RLSR problem. min ∥b∥0≤k∗f(b) = 1 2 ∥(I −PX)(y −b)∥2 2 (6) where PX = X⊤(XX⊤)−1X. This greatly simplifies the problem by casting it as a sparse parameter estimation problem instead of a data subset selection problem (as done by TORRENT). CRR directly 5 optimizes (6) by using a form of iterative hard thresholding. Notice that this approach allows CRR to keep using the entire set of data points at all times, all the while using the current estimate of the parameter b to correct the errors in the observations. At each step, CRR performs the following update: bt+1 = HTk(bt −∇f(bt)), where k is a parameter for CRR. Any value k ≥2k∗suffices to ensure convergence and consistency, as will be clarified in the theoretical analysis. The hard thresholding operator HTk(·) is defined below. Definition 3 (Hard Thresholding). For any v ∈Rn, let the permutation σv ∈Sn order elements of v in descending order of their magnitudes. Then for any k ≤n, we define the hard thresholding operator as bv = HTk(v) where bvi = vi if σ−1 v (i) ≤k and 0 otherwise. We note that CRR functions with a fixed, unit step length, which is convenient in practice as it avoids step length tuning, something most IHT algorithms [12, 13] require. For simplicity of exposition, we will consider only Gaussian ensembles for the RLSR problem i.e. xi ∼N(0, Σ); our proof technique works for general sub-Gaussian ensembles with appropriate distribution dependent parameters. Since CRR interacts with the data only using the projection matrix PX, for Gaussian ensembles, one can assume without loss of generality that the data points are generated from a spherical Gaussian i.e. xi ∼N(0, Id×d). Our analysis will take care of the condition number of the data ensemble whenever it is apparent in the convergence rates. Before moving to present the consistency and convergence guarantees for CRR, we note that Gaussian ensembles are known to satisfy the SSC/SSS properties with high probability. For instance, in the case of the standard Gaussian ensemble, we have SSC/SSS constants of the order of Λm ≤ O mplog n m + √n  and λm ≥n −O  (n −m) q log n n−m + √n  . These results are known from previous works [3, 10] and are reproduced in Appendix A. 6 Consistency Guarantees for CRR Theorem 4. Let xi ∈Rd, 1 ≤i ≤n be generated i.i.d. from a Gaussian distribution, let yi’s be generated using (5) for a fixed w∗, and let σ2 be the noise variance. Also let the number of corruptions k∗be s.t. 2k∗≤k ≤n/10000. Then for any ϵ, δ > 0, with probability at least 1−δ, after O  log ∥b∗∥2 σk+ϵ + log n d  steps, CRR ensures that ∥wt −w∗∥2 ≤ϵ + O  σ √ λmin(Σ) q d n log nd δ  . The above result establishes consistency of the CRR method with an error rate of ˜O(σ p d/n) that is known to be statistically optimal. It is notable that this optimal rate is being ensured in the presence of gross and unbounded outliers. We reiterate that to the best of our knowledge, this is the first instance of a poly-time algorithm being shown to be consistent for the RLSR problem. It is also notable that the result allows the corruption index to be k∗= Ω(n), i.e. allows upto a constant factor of the total number of data points to be arbitrarily corrupted, while ensuring consistency, which existing results [3, 6, 16] do not ensure. We pause a bit to clarify some points regarding the result. Firstly we note that the upper bound on recovery error consists of two terms. The first term is ϵ which can be made arbitrarily small simply by executing the CRR algorithm for several iterations. The second term is more crucial and underscores the consistency properties of CRR. The second term is of the form O  σ p d log(nd)/n  and is easily seen to vanish with n →∞for any constant d, σ. Secondly we note that the result requires k∗≤n/20000 i.e. α ≤1/20000. Although this constant might seem small, we stress that these constants are not the best possible since we preferred analyses that were more accessible. Indeed, in our experiments, we found CRR to be robust to much higher corruption levels than what the Theorem 4 guarantees. Thirdly, we notice that the result requires the CRR to be executed with the corruption index set to a value k ≥2k∗. In practice the value of k can be easily tuned using a simple binary search because of the speed of execution that CRR offers (see Section 7). For our analysis, we will divide CRR’s execution into two phases – a coarse convergence phase and a fine convergence phase. CRR will enjoy a linear rate of convergence in both phases. However, the coarse convergence analysis will only ensure ∥wt −w∗∥2 = O (σ). The fine convergence phase will then use a much more careful analysis of the algorithm to show that in at most O (log n) more 6 iterations, CRR ensures ∥wt −w∗∥2 = ˜O(σ p d/n), thus establishing consistency of the method. Existing methods, such as TORRENT, ensure an error level of O (σ), but no better. As shorthand notation, let λt := (XX⊤)−1X(bt −b∗), g := (I −PX)ϵ, and vt = X⊤λt + g. Let S∗:= supp(b∗) be the true locations of the corruptions and It := supp(bt) ∪supp(b∗). Coarse convergence: Here we establish a result that guarantees that after a certain number of steps T0, CRR identifies the corruption vector with a relatively high accuracy and consequently ensures that wT0 −w∗ 2 ≤O (σ). Lemma 5. For any data matrix X that satisfies the SSC and SSS properties such that 2Λk+k∗ λn < 1, CRR, when executed with k ≥k∗, ensures for any ϵ, δ > 0, with probability at least 1 −δ (over the random Gaussian noise ϵ in the responses – see (3)) that after T0 = O  log ∥b∗∥2 e0+ϵ  steps, bT0 −b∗ 2 ≤3e0 + ϵ, where e0 = O  σ q (k + k∗) log n δ(k+k∗)  for standard Gaussian designs. Using Lemma 12 (see the appendix), we can translate the above result to show that wT0 −w∗ 2 ≤ 0.95σ + ϵ, assuming k∗≤k ≤ n 150. However, Lemma 5 will be more useful in the following fine convergence analysis. Fine convergence: We now show that CRR progresses further at a linear rate to achieve a consistent solution. In Lemma 6, we show that ∥X(bt −b∗)∥2 has a linear decrease for every iteration t > T0 along with a term which is ˜O( √ dn). The proof proceeds by showing that for any fixed λt such that ∥λt∥2 ≤ σ 100, we obtain a linear decrease in ∥λt+1∥2 = ∥(XXT )−1X(bt+1 −b∗)∥2. We then take a union bound over a fine ϵ-net over all possible values of λt to obtain the final result. Lemma 6. Let X = [x1, x2, . . . , xn] be a data matrix consisting of i.i.d. standard normal vectors i.e xi ∼N(0, Id×d), and ϵ ∼N(0, σ2 ·In×n) be a standard normal vector of white noise values drawn independently of X. For any λ ∈Rd such that ∥λ∥2 ≤ σ 100, define bnew = HTk(X⊤λ + ϵ + b∗), znew = bnew −b∗and λnew = (XXT )−1Xznew, where k ≥2k∗, |supp(b∗)| ≤k∗, k∗≤n/10000, and d ≤n/10000. Then, with probability at least 1 −1/n5, for every λ s.t. ∥λ∥2 ≤ σ 100, we have ∥Xznew∥2 ≤.9n∥λ∥2 + 100σ √ d · n log2 n, ∥λnew∥2 ≤.91∥λ∥2 + 110σ r d n log2 n. Putting all these results together establishes Theorem 4. See Appendix B for a detailed proof. Note that while both the coarse/fine stages offer a linear rate of convergence, it is the fine phase that ensures consistency. Indeed, the coarse phase only acts as a sort of good-enough initialization. Several results in non-convex optimization assume a nice initialization “close” to the optimum (alternating minimization, EM etc). In our case, we have a happy situation where the initialization and main algorithms are one and the same. Note that we could have actually used other algorithms e.g. TORRENT to perform initialization as well since TORRENT [3, Theorem 10] essentially offers the same (weak) guarantee as Lemma 5 offers. 7 Experiments Experiments were carried out on synthetically generated linear regression datasets with corruptions. All implementations were done in Matlab and were run on a single core 2.4GHz machine with 8GB RAM. The experiments establish the following: 1) CRR gives consistent estimates of the regression model, especially in situations with a large number of corruptions where the ordinary least squares estimator fails catastrophically, 2) CRR scales better to large datasets than the TORRENT-FC algorithm of [3] (upto 5× faster) and the Extended Lasso algorithm of [17] (upto 20× faster). The main reason behind this speedup is that TORRENT keeps changing its mind on which active set of points it wishes to work with. Consequently, it expends a lot of effort processing each active set. CRR on the other hand does not face such issues since it always works with the entire set of points. Data: The model w∗∈Rd was chosen to be a random unit norm vector. The data was generated as xi ∼N(0, Id). The k∗responses to be corrupted were chosen uniformly at random and the 7 2000 4000 6000 8000 Number of Datapoints n 0 2 4 || w-w*||2 d = 500, σ = 1, k = 600 OLS ex-Lasso TORRENT-FC CRR 100 200 300 400 500 600 Dimensionality d 0 2 4 || w-w*||2 n = 2000, σ = 1, k = 600 OLS ex-Lasso TORRENT-FC CRR 200 300 400 500 600 700 Number of Corruptions k 0 2 4 || w-w*||2 n = 2000, d = 500, σ = 1 OLS ex-Lasso TORRENT-FC CRR 0 0.5 1 1.5 White Noise σ 0 2 4 || w-w*||2 n = 2000, d = 500, k = 600 OLS ex-Lasso TORRENT-FC CRR (a) (b) (c) (d) Figure 1: Variation of recovery error with varying number of data points n, dimensionality d, number of corruptions k∗and white noise variance σ. CRR and TORRENT show better recovery properties than the non-robust OLS on all experiments. Extended Lasso offers comparable or slightly worse recovery in most settings. Figure 1(a) ascertains the e O p 1/n  -consistency of CRR as is shown in the theoretical analysis. 2000 4000 6000 8000 Number of Datapoints n 0 50 100 150 200 250 Time (in sec) d = 1000, σ = 7.5, k = 0.3*n ex-Lasso TORRENT-FC CRR 0 10 20 30 40 Iteration Number 0.85 0.9 0.95 1 Fraction of Corruptions Identified n = 2000 d = 500 k = 0.37*n σ = 0.01 σ = 0.05 σ = 0.1 σ = 0.5 0 10 20 30 40 50 Iteration Number 100 ||bt-b*||2 n = 500 d = 100 k = 0.37*n σ = 0.01 σ = 0.05 σ = 0.1 σ = 0.5 0 10 20 30 40 50 Iteration Number 10-2 100 102 ||bt - b*||2 n = 5000 d = 100 k = 0.37*n σ = 0.01 σ = 0.05 σ = 0.1 σ = 0.5 (a) (b) (c) (d) Figure 2: Figure 2(a) show the average CPU run times of CRR, TORRENT and Extended Lasso with varying sample sizes. CRR can be an order of magnitude faster than TORRENT and Extended Lasso on problems in 1000 dimensions while ensuring similar recovery properties.. Figure 2(b), 2(c) and 2(d) show that CRR eventually not only captures the total mass of corruptions, but also does support recovery of the corrupted points in an accurate manner. With every iteration, CRR improves upon its estimate of b∗and provides cleaner points for estimation of w. CRR is also able to very effectively utilize larger data sets to offer much faster convergence. Notice the visibly faster convergence in Figure 2(d) which uses 10x more points than figure (c). value of the corruptions was sets as b∗ i ∼Unif (10, 20). Responses were then generated as yi = ⟨xi, w∗⟩+ ηi + b∗ i where ηi ∼N(0, σ2). All reported results were averaged over 20 randomly trials. Evaluation Metric: We measure the performance of various algorithms using the standard L2 error: r bw = ∥bw −w∗∥2. For the timing experiments, we deemed an algorithm to converge on an instance if it obtained a model wt such that ∥wt −wt−1∥2 ≤10−4. Baseline Algorithms: CRR was compared to two baselines 1) the Ordinary Least Squares (OLS) estimator which is oblivious of the presence of any corruptions in the responses, 2) the TORRENT algorithm of [3] which is a recently proposed method for performing robust least squares regression, and 3) the Extended Lasso (ex-Lasso) approach of [15] for which we use the FISTA implementation of [23] and choose the regularization paramaters for our model data as mentioned by the authors. Recovery Properties & Timing: CRR, TORRENT and ex-Lasso were found to be competitive, and offered much lower residual errors ∥w −w∗∥2 than the non-robust OLS method when varying dataset size Figure 1(a), dimensionality Figure 1(b), number of corrupted responses Figure 1(c), and magnitude of white noise Figure 1(d). In terms of scaling properties, CRR exhibited faster runtimes than TORRENT-FC as depicted in Figure 2(a). CRR can be upto 5× faster than TORRENT and upto 20× faster than ex-Lasso on problems of 1000 dimensions. Figure 2(a) suggests that executing both TORRENT and ex-Lasso becomes very expensive with an order of magnitude increase in the dimension parameter of the problem while CRR scales gracefully. Also, Figures 2(c) and 2(d) show the variation of ∥bt −b∗∥2 for various values of the noise parameter σ. The plot depicts the fact that as σ →0, CRR is correctly able to identify all the corrupted points and estimate the level of corruption correctly, thereby returning the exact solution w∗. Notice that in Figure 2(d) which utilizes more data points, CRR offers uniformly faster convergence across all white noise levels. Choice of Potential Function: In Lemmata 5 and 6, we show that ∥bt −b∗∥2 decreases with every iteration. Figures 2(c) and (d) back this theoretical statement by showing that CRR’s estimate of b∗ improves with every iteration. Along with estimating the magnitude of b∗, Figure 2(b) shows that CRR is also able to correctly identify the support of the corrupted points with increasing iterations. 8 8 Response to Reviewer Comments We are thankful to the reviewers for their comments aimed at improving the manuscript. Below we offer some clarifications regarding the same. 1. We have fixed all typographical errors pointed out in the reviews. 2. We have included additional references as pointed out in the reviews. 3. We have improved the presentation of the statement of the results to make the theorem and lemma statements more crisp and self contained. 4. We have fixed minor inconsistencies in the figures by executing experiments afresh. 5. We note that CRR’s reduction of the robust recovery problem to sparse recovery is not only novel, but also one that offers impressive speedups in practice over the fully corrective version of the existing TORRENT algorithm [3]. However, note that the reduction to sparse recovery actually hides a sort of “fully-corrective” step wherein the optimal model for a particular corruption estimate is used internally in the formulation. Thus, CRR is implicitly a fully corrective algorithm as well. 6. We agree with the reviewers that further efforts are needed to achieve results with sharper constants. For example, CRR offers robustness upto a breakdown fraction of 1/20000 which, although a constant, nevertheless leaves room for improvement. Having shown for the first time that tolerating a non-trivial, universally constant fraction of corruptions is possible in polynomial time, it is indeed encouraging to study how far can the breakdown point be pushed for various families of algorithms. 7. Our current efforts are aimed at solving the robust sparse recovery problems in high dimensional settings in a statistically consistent manner, as well as extending the consistency properties established in this paper for non-Gaussian, for example fixed, designs. Acknowledgments The authors thank the reviewers for useful comments. PKar is supported by the Deep Singh and Daljeet Kaur Faculty Fellowship and the Research-I Foundation at IIT Kanpur, and thanks Microsoft Research India and Tower Research for research grants. KB gratefully acknowledges the support of the NSF through grant IIS-1619362. References [1] J. Ámos Vi˜sek. The least trimmed squares. Part I: Consistency. Kybernetika, 42:1–36, 2006. [2] J. Ámos Vi˜sek. The least trimmed squares. Part II: √n-consistency. Kybernetika, 42:181–202, 2006. [3] K. Bhatia, P. Jain, and P. Kar. Robust Regression via Hard Thresholding. In Proceedings of the 29th Annual Conference on Neural Information Processing Systems (NIPS), 2015. [4] E. J. Candès, X. Li, and J. Wright. Robust Principal Component Analysis? Journal of the ACM, 58(1):1–37, 2009. [5] M. Charikar, J. Steinhardt, and G. Valiant. Learning from Untrusted Data. arXiv:1611.02315 [cs.LG], 2016. [6] Y. Chen, C. Caramanis, and S. Mannor. Robust Sparse Regression under Adversarial Corruption. In Proceedings of the 30th International Conference on Machine Learning (ICML), 2013. [7] Y. Chen and A. S. Dalalyan. Fused sparsity and robust estimation for linear models with unknown variance. In Proceedings of the 26th Annual Conference on Neural Information Processing Systems (NIPS), 2012. [8] Y. Cherapanamjeri, K. Gupta, and P. Jain. Nearly-optimal Robust Matrix Completion. arXiv:1606.07315 [cs.LG], 2016. [9] F. Cucker and S. Smale. On the Mathematical Foundations of Learning. Bulleting of the American Mathematical Society, 39(1):1–49, 2001. [10] M. A. Davenport, J. N. Laska, P. T. Boufounos, and R. G. Baraniuk. A Simple Proof that Random Matrices are Democratic. Technical Report TREE0906, Rice University, Department of Electrical and Computer Engineering, 2009. 9 [11] J. Feng, H. Xu, S. Mannor, and S. Yan. Robust Logistic Regression and Classification. In Proceedings of the 28th Annual Conference on Neural Information Processing Systems (NIPS), 2014. [12] R. Garg and R. Khandekar. Gradient Descent with Sparsification: An Iterative Algorithm for Sparse Recovery with Restricted Isometry Property. In Proceedings of the 26th International Conference on Machine Learning (ICML), 2009. [13] P. Jain, A. Tewari, and P. Kar. On Iterative Hard Thresholding Methods for High-dimensional M-estimation. In Proceedings of the 28th Annual Conference on Neural Information Processing Systems (NIPS), 2014. [14] B. McWilliams, G. Krummenacher, M. Lucic, and J. M. Buhmann. Fast and Robust Least Squares Estimation in Corrupted Linear Models. In 28th Annual Conference on Neural Information Processing Systems (NIPS), 2014. [15] N. M. Nasrabadi, T. D. Tran, and N. Nguyen. Robust Lasso with Missing and Grossly Corrupted Observations. In Advances in Neural Information Processing Systems, pages 1881–1889, 2011. [16] N. H. Nguyen and T. D. Tran. Exact recoverability from dense corrupted observations via ℓ1-minimization. IEEE transactions on information theory, 59(4):2017–2035, 2013. [17] N. H. Nguyen and T. D. Tran. Robust Lasso With Missing and Grossly Corrupted Observations. IEEE Transaction on Information Theory, 59(4):2036–2058, 2013. [18] P. J. Rousseeuw. Least Median of Squares Regression. Journal of the American Statistical Association, 79(388):871–880, 1984. [19] P. J. Rousseeuw and A. M. Leroy. Robust Regression and Outlier Detection. John Wiley and Sons, 1987. [20] C. Studer, P. Kuppinger, G. Pope, and H. Bölcskei. Recovery of Sparsely Corrupted Signals. IEEE Transaction on Information Theory, 58(5):3115–3130, 2012. [21] J. Wright and Y. Ma. Dense Error Correction via ℓ1 Minimization. IEEE Transactions on Information Theory, 56(7):3540–3560, 2010. [22] J. Wright, A. Y. Yang, A. Ganesh, S. S. Sastry, and Y. Ma. Robust Face Recognition via Sparse Representation. IEEE Transactions on Pattern Analysis and Machine Intelligence, 31(2):210–227, 2009. [23] A. Y. Yang, Z. Zhou, A. G. Balasubramanian, S. S. Sastry, and Y. Ma. Fast ℓ1-minimization algorithms for robust face recognition. IEEE Transactions on Image Processing, 22(8):3234–3246, 2013. 10
2017
607
7,127
Scalable Variational Inference for Dynamical Systems Nico S. Gorbach∗ Dept. of Computer Science ETH Zurich ngorbach@inf.ethz.ch Stefan Bauer∗ Dept. of Computer Science ETH Zurich bauers@inf.ethz.ch Joachim M. Buhmann Dept. of Computer Science ETH Zurich jbuhmann@inf.ethz.ch Abstract Gradient matching is a promising tool for learning parameters and state dynamics of ordinary differential equations. It is a grid free inference approach, which, for fully observable systems is at times competitive with numerical integration. However, for many real-world applications, only sparse observations are available or even unobserved variables are included in the model description. In these cases most gradient matching methods are difficult to apply or simply do not provide satisfactory results. That is why, despite the high computational cost, numerical integration is still the gold standard in many applications. Using an existing gradient matching approach, we propose a scalable variational inference framework which can infer states and parameters simultaneously, offers computational speedups, improved accuracy and works well even under model misspecifications in a partially observable system. 1 Introduction Parameter estimation for ordinary differential equations (ODE’s) is challenging due to the high computational cost of numerical integration. In recent years, gradient matching techniques established themselves as successful tools [e.g. Babtie et al., 2014] to circumvent the high computational cost of numerical integration for parameter and state estimation in ordinary differential equations. Gradient matching is based on minimizing the difference between the interpolated slopes and the time derivatives of the state variables in the ODE’s. First steps go back to spline based methods [Varah, 1982, Ramsay et al., 2007] where in an iterated two-step procedure coefficients and parameters are estimated. Often cubic B-splines are used as basis functions while more advanced approaches [Niu et al., 2016] use kernel functions derived from the ODE’s. An overview of recent approaches with a focus on the application for systems biology is provided in Macdonald and Husmeier [2015]. It is unfortunately not straightforward to extend spline based approaches to include unobserved variables since they usually require full observability of the system. Moreover, these methods critically depend on the estimation of smoothing parameters, which are difficult to estimate when only sparse observations are available. As a solution for both problems, Gaussian process (GP) regression was proposed in Calderhead et al. [2008] and further improved in Dondelinger et al. [2013]. While both Bayesian approaches work very well for fully observable systems, they (opposite to splines) cannot simultaneously infer parameters and unobserved states and perform poorly when only combinations of variables are observed or the differential equations contain unobserved variables. Unfortunately this is the case for most practical applications [e.g. Barenco et al., 2006]. Related work. Archambeau et al. [2008] proposed variational inference to approximate the true process of the dynamical system by a time-varying linear system. Their approach was later signficantly extended [Ruttor et al., 2013, Ruttor and Opper, 2010, Vrettas et al., 2015]. However, similiar to [Lyons et al., 2012] they study parameter estimation in stochastic dynamical systems while our work ∗The first two authors contributed equally to this work. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. focuses on deterministic systems. In addition, they use the Euler-Maruyama discretization, whereas our approach is grid free. Wang and Barber [2014] propose an approach based on a belief network but as discussed in the controversy of mechanistic modelling [Macdonald et al., 2015], this leads to an intrinsic identifiability problem. Our contributions. Our proposal is a scalable variational inference based framework which can infer states and parameters simultaneously, offers significant runtime improvements, improved accuracy and works well even in the case of partially observable systems. Since it is based on simplistic mean-field approximations it offers the opportunity for significant future improvements. We illustrate the potential of our work by analyzing a system of up to 1000 states in less than 400 seconds on a standard Laptop2. 2 Deterministic Dynamical Systems A deterministic dynamical system is represented by a set of K ordinary differential equations (ODE’s) with model parameters θ that describe the evolution of K states x(t) = [x1(t), x2(t), . . . , xK(t)]T such that: ˙x(t) = dx(t) dt = f(x(t), θ). (1) A sequence of observations, y(t), is usually contaminated by some measurement error which we assume to be normally distributed with zero mean and variance for each of the K states, i.e. E ∼N(0, D), with Dik = σ2 kδik. Thus for N distinct time points the overall system may be summarized as: Y = X + E, (2) where X = [x(t1), . . . , x(tN)] = [x1, . . . , xK]T , Y = [y(t1), . . . , y(tN)] = [y1, . . . , yK]T , and xk = [xk(t1), . . . , xk(tN)]T is the k’th state sequence and yk = [yk(t1), . . . , yk(tN)]T are the observations. Given the observations Y and the description of the dynamical system (1), the aim is to estimate both state variables X and parameters θ. While numerical integration can be used for both problems, its computational cost is prohibitive for large systems and motivates the grid free method outlined in section 3. 3 GP based Gradient Matching Gaussian process based gradient matching was originally motivated in Calderhead et al. [2008] and further developed in Dondelinger et al. [2013]. Assuming a Gaussian process prior on state variables such that: p(X | φ) := Y k N(0, Cφk) (3) where Cφk is a covariance matrix defined by a given kernel with hyper-parameters φk, the k-th element of φ, we obtain a posterior distribution over state-variables (from (2)): p(X | Y, φ, σ) = Y k N (µk(yk), Σk) , (4) where µk(yk) := σ−2 k  σ−2 k I + C−1 φk −1 yk and Σ−1 k := σ−2 k I + C−1 φk. Assuming that the covariance function Cφk is differentiable and using the closure property under differentiation of Gaussian processes, the conditional distribution over state derivatives is: p( ˙X | X, φ) = Y k N( ˙xk | mk, Ak), (5) 2All experiments were run on a 2.5 GHz Intel Core i7 Macbook. 2 where the mean and covariance is given by: mk := ′CφkC−1 φkxk, Ak := C′′ φk −′CφkC−1 φkC′ φk, (6) C′′ φk denotes the auto-covariance for each state-derivative with C′ φk and ′Cφk denoting the crosscovariances between the state and its derivative. Assuming additive, normally distributed noise with state-specific error variance γk in (1), we have: p( ˙X | X, θ, γ) = Y k N ( ˙xk | fk(X, θ), γkI) . (7) A product of experts approach, combines the ODE informed distribution of state-derivatives (distribution (7)) with the smoothed distribution of state-derivatives (distribution (5)): p( ˙X | X, θ, φ, γ) ∝p( ˙X | X, φ)p( ˙X | X, θ, γ) (8) The motivation for the product of experts is that the multiplication implies that both the data fit and the ODE response have to be satisfied at the same time in order to achieve a high value of p( ˙X | X, θ, φ, γ). This is contrary to a mixture model, i.e. a normalized addition, where a high value for one expert e.g. overfitting the data while neglecting the ODE response or vice versa, is acceptable. The proposed methodology in Calderhead et al. [2008] is to analytically integrate out ˙X: p(θ|X, φ, γ) = Z−1 θ (X) p(θ) Z p( ˙X|X, φ)p( ˙X|X, θ, γ)d ˙X = Z−1 θ (X) p(θ) Y k N(fk(X, θ)|mk, Λ−1 k ), (9) with Λ−1 k := Ak + γkI and Z−1 θ (X) as the normalization that depends on the states X. Calderhead et al. [2008] infer the parameters θ by first sampling the states (i.e. X ∼p(X | Y, φ, σ)) followed by sampling the parameters given the states (i.e. θ, γ ∼p(θ, γ | X, φ, σ)). In this setup, sampling X is independent of θ, which implies that θ and γ have no influence on the inference of the state variables. The desired feedback loop was closed by Dondelinger et al. [2013] through sampling from the joint posterior of p(θ | X, φ, σ, γ, Y). Since sampling the states only provides their values at discrete time points, Calderhead et al. [2008] and Dondelinger et al. [2013] require the existence of an external ODE solver to obtain continuous trajectories of the state variables. For simplicity, we derived the approach assuming full observability. However, the approach has the advantage (as opposed to splines) that the assumption of full observability can be relaxed to include only observations for combinations of states by replacing (2) with Y = AX + E, where A encodes the linear relationship between observations and states. In addition, unobserved states can be naturally included in the inference by simply using the prior on state variables (3) [Calderhead et al., 2008]. 4 Variational Inference for Gradient Matching by Exploiting Local Linearity in ODE’s For subsequent sections we consider only models of the form (1) with reactions based on mass-action kinetics which are given by: fk(x(t), θ) = X i=1 θki Y j∈Mki xj (10) with Mki ⊆{1, . . . , K} describing the state variables in each factor of the equation i.e. the functions are linear in parameters and contain arbitrary large products of monomials of the states. The motivation for the restriction to this functional class is twofold. First, this formulation includes models which exhibit periodicity as well as high nonlinearity and especially physically realistic reactions in systems biology [Schillings et al., 2015]. 3 Second, the true joint posterior over all unknowns is given by: p(θ, X | Y, φ, γ, σ) = p(θ | X, φ, γ)p(X | Y, φ, σ) = Z−1 θ (X) p(θ) Y k N fk(X, θ) | mk, Λ−1 k  N (xk | µk(Y), Σk) , where the normalization of the parameter posterior (9), Zθ(X), depends on the states X. The dependence is nontrivial and induced by the nonlinear couplings of the states X, which make the inference (e.g. by integration) challenging in the first place. Previous approaches ignore the dependence of Zθ(X) on the states X by setting Zθ(X) equal to one [Dondelinger et al., 2013, equation 20]. We determine Zθ(X) analytically by exploiting the local linearity of the ODE’s as shown in section 4.1 (and section 7 in the supplementary material). More precisely, for mass action kinetics 10, we can rewrite the ODE’s as a linear combination in an individual state or as a linear combination in the ODE parameters3. We thus achieve superior performance over existing gradient matching approaches, as shown in the experimental section 5. 4.1 Mean-field Variational Inference To infer the parameters θ, we want to find the maximum a posteriori estimate (MAP): θ⋆:= argmax θ ln p(θ | Y, φ, γ, σ) = argmax θ ln Z p(θ | X, φ, γ)p(X | Y, φ, σ) | {z } =p(θ,X|Y,φ,γ,σ) dX (11) However, the integral in (11) is intractable in most cases due to the strong couplings induced by the nonlinear ODE’s f which appear in the term p(θ | X, φ, γ) (equation 9). We therefore use mean-field variational inference to establish variational lower bounds that are analytically tractable by decoupling state variables from the ODE parameters as well as decoupling the state variables from each other. Before explaining the mechanism behind mean-field variational inference, we first observe that, due to the model assumption (10), the true conditional distributions p(θ | X, Y, φ, γ, σ) and p(xu | θ, X−u, Y, φ, γ, σ) are Gaussian distributed, where X−u denotes all states excluding state xu (i.e. X−u := {x ∈X | x ̸= xu}). For didactical reasons, we write the true conditional distributions in canonical form: p(θ | X, Y, φ, γ, σ) = h(θ) × exp ηθ(X, Y, φ, γ, σ)T t(θ) −aθ(ηθ(X, Y, φ, γ, σ)  p(xu | θ, X−u, Y, φ, γ, σ) = h(xu) × exp ηu(θ, X−u, Y, φ, γ, σ)T t(xu) −au(ηu(X−u, Y, φ, γ, σ)  (12) where h(·) and a(·) are the base measure and log-normalizer and η(·) and t(·) are the natural parameter and sufficient statistics. The decoupling is induced by designing a variational distribution Q(θ, X) which is restricted to the family of factorial distributions: Q :=  Q : Q(θ, X) = q(θ | λ) Y u q(xu | ψu)  , (13) where λ and ψu are the variational parameters. The particular form of q(θ | λ) and q(xu | ψu) is designed to be in the same exponential family as the true conditional distributions in equation (12): q(θ | λ) := h(θ) exp  λT t(θ) −aθ(λ)  q(xu | ψu) := h(xu) exp  ψT u t(xu) −au(ψu)  3For mass-action kinetics as in (10), the ODE’s are nonlinear in all states but linear in a single state as well as linear in all ODE parameters. 4 To find the optimal factorial distribution we minimize the Kullback-Leibler divergence between the variational and the true posterior distribution: ˆQ : = argmin Q(θ,X)∈Q KL  Q(θ, X) p(θ, X | Y, φ, γ, σ)  = argmin Q(θ,X)∈Q EQ log Q(θ, X) −EQ log p(θ, X | Y, φ, γ, σ) = argmax Q(θ,X)∈Q LQ(λ, ψ) (14) where ˆQ is the proxy distribution and LQ(λ, ψ) is the ELBO (Evidence Lower Bound) terms that depends on the variational parameters λ and ψ. Maximizing ELBO w.r.t. θ is equivalent to maximizing the following lower bound: Lθ(λ) : = EQ log p(θ | X, Y, φ, γ, σ) −EQ log q(θ | λ) = EQηT θ ▽λ aθ(λ) −λT ▽λ aθ(λ), where we substitute the true conditionals given in equation (12) and ▽λ is the gradient operator. Similarly, maximizing ELBO w.r.t. latent state xu, we have: Lx(ψu) : = EQ log p(xu | θ, X−u, Y, φ, γ, σ) −EQ log q(xu | ψu) = EQηT u ▽ψu au(ψu) −ψT u ▽ψu au(ψu) Given the assumptions we made about the true posterior and the variational distribution (i.e. that each true conditional is in an exponential family and that the corresponding variational distribution is in the same exponential family) we can optimize each coordinate in closed form. To maximize ELBO we set the gradient w.r.t. the variational parameters to zero: ▽λLθ(λ) = ▽2 λaθ(λ) (EQηθ −λ) != 0 which is zero when: ˆλ = EQηθ (15) Similarly, the optimal variational parameters of the states are given by: ˆψu = EQηu (16) Since the true conditionals are Gaussian distributed the expectations over the natural parameters are given by: EQηθ =  EQΩ−1 θ rθ −1 2EQΩ−1 θ  , EQηu =  EQΩ−1 u ru −1 2EQΩ−1 u  , (17) where rθ and Ωθ are the mean and covariance of the true conditional distribution over ODE parameters. Similarly, ru and Ωu are the mean and covariance of the true conditional distribution over states. The variational parameters in equation (17) are derived analytically in the supplementary material 7. The coordinate ascent approach (where each step is analytically tractable) for estimating states and parameters is summarized in algorithm 1. Algorithm 1 Mean-field coordinate ascent for GP Gradient Matching 1: Initialization of proxy moments ηu and ηθ. 2: repeat 3: Given the proxy over ODE parameters q(θ | ˆλ), calculate the proxy over individual states q(xu | ˆψu) ∀u ≤n, by computing its moments ˆψu = EQηu. 4: Given the proxy over individual states q(xu | ˆψu), calculate the proxy over ODE parameters q(θ | ˆλ), by computing its moments ˆλ = EQηθ. 5: until convergence of maximum number of iterations is exceeded. Assuming that the maximal number of states for each equation in (10) is constant (which is to the best of our knowledge the case for any reasonable dynamical system), the computational complexity of the algorithm is linear in the states O(N · K) for each iteration. This result is experimentally supported by figure 5 where we analyzed a system of up to 1000 states in less than 400 seconds. 5 5 Experiments In order to provide a fair comparison to existing approaches, we test our approach on two small to medium sized ODE models, which have been extensively studied in the same parameter settings before [e.g. Calderhead et al., 2008, Dondelinger et al., 2013, Wang and Barber, 2014]. Additionally, we show the scalability of our approach on a large-scale partially observable system which has so far been infeasible to analyze with existing gradient matching methods due to the number of unobserved states. 5.1 Lotka-Volterra 0 1 2 time 2 4 6 Population 31 32 33 34 ODE parameters 0 2 4 6 Parameter Value true mean-field GM AGM splines mean-field GM AGM splines 0 100 200 300 400 500 Runtime (seconds) Figure 1: Lotka-Volterra: Given few noisy observations (red stars), simulated with a variance of σ2 = 0.25, the leftmost plot shows the inferred state dynamics using our variational mean-field method (mean-field GM, median runtime 4.7sec). Estimated mean and standard deviation for one random data initialization using our approach are illustrated in the left-center plot. The implemented spline method (splines, median runtime 48sec) was based on Niu et al. [2016] and the adaptive gradient matching (AGM) is the approach proposed by Dondelinger et al. [2013]. Boxplots in the leftmost, right-center and rightmost plot illustrate the variance in the state and parameter estimations over 10 independent datasets. The ODE’s f(X, θ) of the Lotka-Volterra system [Lotka, 1978] is given by: ˙x1 : = θ1x1 −θ2x1x2 ˙x2 : = −θ3x2 + θ4x1x2 1 2 3 4 0 0.5 1 1.5 2 2.5 3 3.5 4 ODE parameters 0 2 4 time 0 1 2 3 4 5 6 7 prey 0 2 4 time 0 0.5 1 1.5 2 2.5 3 3.5 4 predator Figure 2: Lotka-Volterra: Given only observations (red stars) until time t = 2 the state trajectories are inferred including the unobserved time points up to time t = 4. The typical patterns of the Lotka-Volterra system for predator and prey species are recovered. The shaded blue area shows the uncertainty around for the inferred state trajectories. The above system is used to study predator-prey interactions and exhibits periodicity and nonlinearity at the same time. We used the same ODE parameters as in Dondelinger et al. [2013] (i.e. θ1 = 2, θ2 = 1, θ3 = 4, θ4 = 1) to simulate the data over an interval [0, 2] with a sampling interval of 0.1. Predator species (i.e. x1) were initialized to 3 and prey species (i.e. x) were initialized to 5. Mean-field variational inference for gradient matching was performed on a simulated dataset with additive Gaussian noise with variance σ2 = 0.25. The radial basis function kernel was used to capture the covariance between a state at different time points. As shown in figure 1, our method performs significantly better than all other methods at a fraction of the computational cost. The poor performance in accuracy of Niu et al. [2016] can be explained by the significantly lower number of samples and higher noise level, compared to the simpler setting of their experiments. In order to show the potential of our work we decided to follow the more difficult and established experimental settings used in [e.g. Calderhead et al., 2008, Dondelinger et al., 2013, Wang and Barber, 2014]. This illustrates the difficulty of 6 spline based gradient matching methods when only few observations are available. We estimated the smoothing parameter λ in the proposal of Niu et al. [2016] using leave-one-out cross-validation. While their method can in principle achieve the same runtime (e.g. using 10-fold cv) as our method, the performance for parameter estimation is significantly worse already when using leave-one-out cross-validation, where the median parameter estimation over ten independent data initializations is completely off for three out of four parameters (figure 1). Adaptive gradient matching (AGM) [Dondelinger et al., 2013] would eventually converge to the true parameter values but at roughly 100 times the runtime achieves signifcantly worse results in accuracy than our approach (figure 1). In figure 2 we additionally show that the mechanism of the Lotka-Volterra system is correctly inferred even when including unobserved time intervals. 5.2 Protein Signalling Transduction Pathway In the following we only compare with the current state of the art in GP based gradient matching [Dondelinger et al., 2013] since spline methods are in general difficult or inapplicable for partial observable systems. In addition, already in the case of a simpler system and more data points (e.g. figure 1), splines were not competitive (in accuracy) with the approach of Dondelinger et al. [2013]. 0 50 100 time 0 0.5 1 State S 1 2 3 time 0 200 400 State S 0 50 100 time 0 0.5 1 State S 0 50 100 time 0 0.5 1 State S Figure 3: For the noise level of σ2 = 0.1 the leftmost and left-center plot show the performance of Dondelinger et al. [2013](AGM) for inferring the state trajectories of state S. The red curve in all plots is the groundtruth, while the inferred trajectories of AGM are plotted in green (left and left-center plot) and in blue (right and right center) for our approach. While in the scenario of the leftmost and right-center plot observations are available (red stars) and both approaches work well, the approach of Dondelinger et al. [2013](AGM) is significantly off in inferring the same state when it is unobserved but all other parameters remain the same (left-center plot) while our approach infers similar dynamics in both scenarios. The chemical kinetics for the protein signalling transduction pathway is governed by a combination of mass action kinetics and the Michaelis-Menten kinetics: ˙S = −k1 × S −k2 × S × R + k3 × RS ˙dS = k1 × S ˙R = −k2 × S × R + k3 × RS + V × Rpp Km + Rpp ˙ RS = k2 × S × R −k3 × RS −k4 × RS ˙ Rpp = k4 × RS −V × Rpp Km + Rpp For a detailed descripton of the systems with its biological interpretations we refer to Vyshemirsky and Girolami [2008]. While mass-action kinetics in the protein transduction pathway satisfy our constraints on the functional form of the ODE’s 1, the Michaelis-Menten kinetics do not, since they give rise to the ratio of states Rpp Km+Rpp. We therefore define the following latent variables: x1 := S, x2 := dS, x3 := R, x4 := RS, x5 := Rpp Km + Rpp θ1 := k1, θ2 := k2, θ3 := k3, θ4 := k4, θ5 := V The transformation is motivated by the fact that in the new system, all states only appear as monomials, as required in (10). Our variable transformation includes an inherent error (e.g. by replacing 7 ˙ Rpp = k4 × RS −V × Rpp Km+Rpp with ˙x5 = θ4 × x4 −θ5 × x5) but despite such a misspecification, our method estimates four out of five parameters correctly (4). Once more, we use the same ODE parameters as in Dondelinger et al. [2013] i.e. k1 = 0.07, k2 = 0.6, k3 = 0.05, k4 = 0.3, V = 0.017. The data was sampled over an interval [0, 100] with time point samples at t = [0, 1, 2, 4, 5, 7, 10, 15, 20, 30, 40, 50, 60, 80, 100]. Parameters were inferred in two experiments with different standard Gaussian distributed noise with variances σ2 = 0.01 and σ2 = 0.1. Even for a misspecified model, containing a systematic error, the ranking according to parameter values is preserved as indicated in figure 4. While the approach of Dondelinger et al. [2013] converges much slower (again factor 100 in runtime) to the true values of the parameters (for a fully observable system), it is significantly off if state S is unobserved and is more senstitive to the introduction of noise than our approach (figure 3). Our method infers similar dynamics for the fully and partially observable system as shown in figure 3 and remains unchanged in its estimation accuracy after the introduction of unobserved variables (even having its inherent bias) and performs well even in comparison to numerical integration (figure 4). Plots for the additional state dynamics are shown in the supplementary material 6. k1 k2 k3 k4 0 0.1 0.2 0.3 RMSE of ODE Parameters mean-field GM AGM Bayes num. int. k1 k2 k3 k4 0 0.2 0.4 0.6 0.8 RMSE of ODE Parameters mean-field GM AGM Bayes num. int. k1 k2 k3 k4 0 0.2 0.4 0.6 0.8 RMSE of ODE Parameters mean-field GM AGM Bayes num. int. Bayes num. int. mf Figure 4: From the left to the right the plots represent three different inference settings of increasing difficulty using the protein transduction pathway as an example. The left plot shows the results for a fully observable system and a small noise level (σ2 = 0.01). Due to the violation of the functional form assumption our approach has an inherent bias and Dondelinger et al. [2013](AGM) performs better while Bayesian numerical integration (Bayes num. int.) serves as a gold standard and performs best. The middle plot shows the same system with an increased noise level of σ2 = 0.1. Due to many outliers we only show the median over ten independent runs and adjust the scale for the middle and right plot. In the right plot state S was unobserved while the noise level was kept at σ2 = 0.1 (the estimate for k3 of AGM is at 18 and out of the limits of the plot). Initializing numerical integration with our result (Bayes num. int. mf.) achieves the best results and significantly lowers the estimation error (right plot). 5.3 Scalability To show the true scalability of our approach we apply it to the Lorenz 96 system, which consists of equations of the form: fk(x(t), θ) = (xk+1 −xk−2)xk−1 −xk + θ, (18) where θ is a scalar forcing parameter, x−1 = xK−1, x0 = xK and xK+1 = x1 (with K being the number of states in the deterministic system (1)). The Lorenz 96 system can be seen as a minimalistic weather model [Lorenz and Emanuel, 1998] and is often used with an additional diffusion term as a reference model for stochastic systems [e.g. Vrettas et al., 2015]. It offers a flexible framework for increasing the number states in the inference problem and in our experiments we use between 125 to 1000 states. Due to the dimensionality the Lorenz 96 system has so far not been analyzed using gradient matching methods and to additionally increase the difficulty of the inference problem we randomly selected one third of the states to be unobserved. We simulated data setting θ = 8 with an observation noise of σ2 = 1 using 32 equally space observations between zero to four seconds. Due to its scaling properties, our approach is able to infer a system with 1000 states within less than 400 seconds (right plot in figure 5). We can visually conclude that unobserved states are approximately correct inferred and the approximation error is independent of the dimensionality of the problem (right plot in figure 5). 8 0 5 10 15 20 iteration number 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 RMSE for ODE Parameter 0 1 2 3 4 time -4 -2 0 2 4 6 8 Unobserved State 3.5 2.5 2 1.4 RMSE reduction of ODE parameter unobserved state time 125 250 375 500 625 750 875 1000 number of ODEs 500 600 700 800 900 1000 average RMSE of unobs. states 0 100 200 300 400 500 runtime (seconds) Scaling of Mean-field Gradient Matching for Lorenz 96 Figure 5: The left plot shows the improved mechanistic modelling and the reduction of the root median squared error (RMSE) with each iteration of our algorithm. The groundtruth for an unobserved state is plotted in red while the thin gray lines correspond to the inferred state trajectories in each iteration of the algorithm (the first flat thin gray line being the initialisation). The blue line is the inferred state trajectory of the unobserved state after convergence. The right plot shows the scaling of our algorithm with the dimensionality in the states. The red curve is the runtime in seconds wheras the blue curve is corresponding to the RSME (right plot). Due to space limitations, we show additional experiments for various dynamical systems in the fields of fluid dynamics, electrical engineering, system biology and neuroscience only in the supplementary material in section 8. 6 Discussion Numerical integration is a major bottleneck due to its computational cost for large scale estimation of parameters and states e.g. in systems biology. However, it still serves as the gold standard for practical applications. Techniques based on gradient matching offer a computationally appealing and successful shortcut for parameter inference but are difficult to extend to include unobserved variables in the model descripton or are unable to keep their performance level from fully observed systems. However, most real world applications are only partially observed. Provided that state variables appear as monomials in the ODE, we offer a simple, yet powerful inference framework that is scalable, significantly outperforms existing approaches in runtime and accuracy and performs well in the case of sparse observations even for partially observable systems. Many non-linear and periodic ODE’s, e.g. the Lotka-Volterra system, already fulfill our assumptions. The empirically shown robustness of our model to misspecification even in the case of additional partial observability already indicates that a relaxation of the functional form assumption might be possible in future research. Acknowledgements This research was partially supported by the Max Planck ETH Center for Learning Systems and the SystemsX.ch project SignalX. References Cédric Archambeau, Manfred Opper, Yuan Shen, Dan Cornford, and John S Shawe-taylor. Variational inference for diffusion processes. Neural Information Processing Systems (NIPS), 2008. Ann C Babtie, Paul Kirk, and Michael PH Stumpf. Topological sensitivity analysis for systems biology. Proceedings of the National Academy of Sciences, 111(52):18507–18512, 2014. Martino Barenco, Daniela Tomescu, Daniel Brewer, Robin Callard, Jaroslav Stark, and Michael Hubank. Ranked prediction of p53 targets using hidden variable dynamic modeling. Genome biology, 7(3):R25, 2006. 9 Ben Calderhead, Mark Girolami and Neil D. Lawrence. Accelerating bayesian inference over nonliner differential equations with gaussian processes. Neural Information Processing Systems (NIPS), 2008. Frank Dondelinger, Maurizio Filippone, Simon Rogers and Dirk Husmeier. Ode parameter inference using adaptive gradient matching with gaussian processes. International Conference on Artificial Intelligence and Statistics (AISTATS), 2013. Edward N Lorenz and Kerry A Emanuel. Optimal sites for supplementary weather observations: Simulation with a small model. Journal of the Atmospheric Sciences, 55(3):399–414, 1998. Alfred J Lotka. The growth of mixed populations: two species competing for a common food supply. In The Golden Age of Theoretical Ecology: 1923–1940, pages 274–286. Springer, 1978. Simon Lyons, Amos J Storkey, and Simo Särkkä. The coloured noise expansion and parameter estimation of diffusion processes. Neural Information Processing Systems (NIPS), 2012. Benn Macdonald and Dirk Husmeier. Gradient matching methods for computational inference in mechanistic models for systems biology: a review and comparative analysis. Frontiers in bioengineering and biotechnology, 3, 2015. Benn Macdonald, Catherine F. Higham and Dirk Husmeier. Controversy in mechanistic modemodel with gaussian processes. International Conference on Machine Learning (ICML), 2015. Mu Niu, Simon Rogers, Maurizio Filippone, and Dirk Husmeier. Fast inference in nonlinear dynamical systems using gradient matching. International Conference on Machine Learning (ICML), 2016. Jim O Ramsay, Giles Hooker, David Campbell, and Jiguo Cao. Parameter estimation for differential equations: a generalized smoothing approach. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 69(5):741–796, 2007. Andreas Ruttor and Manfred Opper. Approximate parameter inference in a stochastic reactiondiffusion model. AISTATS, 2010. Andreas Ruttor, Philipp Batz, and Manfred Opper. Approximate gaussian process inference for the drift function in stochastic differential equations. Neural Information Processing Systems (NIPS), 2013. Claudia Schillings, Mikael Sunnåker, Jörg Stelling, and Christoph Schwab. Efficient characterization of parametric uncertainty of complex (bio) chemical networks. PLoS Comput Biol, 11(8):e1004457, 2015. Klaas Enno Stephan, Lars Kasper, Lee M Harrison, Jean Daunizeau, Hanneke EM den Ouden, Michael Breakspear, and Karl J Friston. Nonlinear dynamic causal models for fmri. NeuroImage, 42(2):649–662, 08 2008. doi: 10.1016/j.neuroimage.2008.04.262. URL http://www.ncbi. nlm.nih.gov/pmc/articles/PMC2636907/. James M Varah. A spline least squares method for numerical parameter estimation in differential equations. SIAM Journal on Scientific and Statistical Computing, 3(1):28–46, 1982. Michail D Vrettas, Manfred Opper, and Dan Cornford. Variational mean-field algorithm for efficient inference in large systems of stochastic differential equations. Physical Review E, 91(1):012148, 2015. Vladislav Vyshemirsky and Mark A Girolami. Bayesian ranking of biochemical system models. Bioinformatics, 24(6):833–839, 2008. Yali Wang and David Barber. Gaussian processes for bayesian estimation in ordinary differential equations. International Conference on Machine Learning (ICML), 2014. 10
2017
608
7,128
Learning multiple visual domains with residual adapters Sylvestre-Alvise Rebuffi1 Hakan Bilen1,2 Andrea Vedaldi1 1 Visual Geometry Group University of Oxford {srebuffi,hbilen,vedaldi}@robots.ox.ac.uk 2 School of Informatics University of Edinburgh Abstract There is a growing interest in learning data representations that work well for many different types of problems and data. In this paper, we look in particular at the task of learning a single visual representation that can be successfully utilized in the analysis of very different types of images, from dog breeds to stop signs and digits. Inspired by recent work on learning networks that predict the parameters of another, we develop a tunable deep network architecture that, by means of adapter residual modules, can be steered on the fly to diverse visual domains. Our method achieves a high degree of parameter sharing while maintaining or even improving the accuracy of domain-specific representations. We also introduce the Visual Decathlon Challenge, a benchmark that evaluates the ability of representations to capture simultaneously ten very different visual domains and measures their ability to perform well uniformly. 1 Introduction While research in machine learning is often directed at improving the performance of algorithms on specific tasks, there is a growing interest in developing methods that can tackle a large variety of different problems within a single model. In the case of perception, there are two distinct aspects of this challenge. The first one is to extract from a given image diverse information, such as image-level labels, semantic segments, object bounding boxes, object contours, occluding boundaries, vanishing points, etc. The second aspect is to model simultaneously many different visual domains, such as Internet images, characters, glyph, animal breeds, sketches, galaxies, planktons, etc (fig. 1). In this work we explore the second challenge and look at how deep learning techniques can be used to learn universal representations [5], i.e. feature extractors that can work well in several different image domains. We refer to this problem as multiple-domain learning to distinguish it from the more generic multiple-task learning. Multiple-domain learning contains in turn two sub-challenges. The first one is to develop algorithms that can learn well from many domains. If domains are learned sequentially, but this is not a requirement, this is reminiscent of domain adaptation. However, there are two important differences. First, in standard domain adaptation (e.g. [9]) the content of the images (e.g. “telephone”) remains the same, and it is only the style of the images that changes (e.g. real life vs gallery image). Instead in our case a domain shift changes both style and content. Secondly, the difficulty is not just to adapt the model from one domain to another, but to do so while making sure that it still performs well on the original domain, i.e. to learn without forgetting [21]. The second challenge of multiple-domain learning, and our main concern in this paper, is to construct models that can represent compactly all the domains. Intuitively, even though images in different domains may look quite different (e.g. glyph vs. cats), low and mid-level visual primitives may still 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. (a) (b) (c) (d) (e) (f) (g) (h) (i) (j) Figure 1: Visual Decathlon. We explore deep architectures that can learn simultaneously different tasks from very different visual domains. We experiment with ten representative ones: (a) Aircraft, (b) CIFAR-100, (c) Daimler Pedestrians, (d) Describable Textures, (e) German Traffic Signs, (f) ILSVRC (ImageNet) 2012, (g) VGG-Flowers, (h) OmniGlot, (i) SVHN, (j) UCF101 Dynamic Images. be largely shareable. Sharing knowledge between domains should allow to learn compact multivalent representations. Provided that sufficient synergies between domains exist, multivalent representations may even work better than models trained individually on each domain (for a given amount of training data). The primary contribution of this paper (section 3) is to introduce a design for multivalent neural network architectures for multiple-domain learning (section 3 fig. 2). The key idea is reconfigure a deep neural network on the fly to work on different domains as needed. Our construction is based on recent learning-to-learn methods that showed how the parameters of a deep network can be predicted from another [2, 16]. We show that these formulations are equivalent to packing the adaptation parameters in convolutional layers added to the network (section 3). The layers in the resulting parametric network are either domain-agnostic, hence shared between domains, or domain-specific, hence parametric. The domain-specific layers are changed based on the ground-truth domain of the input image, or based on an estimate of the latter obtained from an auxiliary network. In the latter configuration, our architecture is analogous to the learnet of [2]. Based on such general observations, we introduce in particular a residual adapter module and use it to parameterize the standard residual network architecture of [13]. The adapters contain a small fraction of the model parameters (less than 10%) enabling a high-degree of parameter sharing between domains. A similar architecture was concurrently proposed in [31], which also results in the possibility of learning new domains sequentially without forgetting. However, we also show a specific advantage of the residual adapter modules: the ability to modulate adaptation based on the size of the target dataset. Our proposed architectures are thoroughly evaluated empirically (section 5). To this end, our second contribution is to introduce the visual decathlon challenge (fig. 1 and section 4), a new benchmark for multiple-domain learning in image recognition. The challenge consists in performing well simultaneously on ten very different visual classification problems, from ImageNet and SVHN to action classification and describable texture recognition. The evaluation metric, also inspired by the decathlon discipline, rewards models that perform better than strong baselines on all the domains simultaneously. A summary of our finding is contained in section 6. 2 Related Work Our work touches on multi-task learning, learning without forgetting, domain adaptation, and other areas. However, our multiple-domain setup differs in ways that make most of the existing approaches not directly applicable to our problem. Multi-task learning (MTL) looks at developing models that can address different tasks, such as detecting objects and segmenting images, while sharing information and computation among them. Earlier examples of this paradigm have focused on kernel methods [10, 1] and deep neural network (DNN) models [6]. In DNNs, a standard approach [6] is to share earlier layers of the network, training the tasks jointly by means of back-propagation. Caruana [6] shows that sharing network parameters between tasks is beneficial also as a form of regularization, putting additional constraints on the learned representation and thus improving it. MTL in DNNs has been applied to various problems ranging from natural language processing [8, 22], speech recognition [14] to computer vision [41, 42, 4]. Collobert et al. [8] show that semi-supervised learning and multi-task learning can be combined in a DNN model to solve several language processing prediction tasks such as part-of-speech tags, chunks, named entity tags and semantic 2 roles. Huang et al. [14] propose a shared multilingual DNN which shares hidden layers across many languages. Liu et al. [22] combine multiple-domain classification and information retrieval for ranking web search with a DNN. Multi-task DNN models are also reported to achieve performance gains in computer vision problems such as object tracking [41], facial-landmark detection [42], object and part detection [4], a collection of low-level and high-level vision tasks [18]. The main focus of these works is learning a diverse set of tasks in the same visual domain. In contrast, our paper focuses on learning a representation from a diverse set of domains. Our investigation is related to the recent paper of [5], which studied the “size” of the union of different visual domains measured in terms of the capacity of the model required to learn it. The authors propose to absorb different domain in a single neural network by tuning certain parameters in batch and instance normalization layers throughout the architecture; we show that our residual adapter modules, which include the latter as a special case, lead to far superior results. Life-long learning. A particularly important aspect of MTL is the ability of learning multiple tasks sequentially, as in Never Ending Learning [25] and Life-long Learning [38]. Sequential learning typically suffers in fact from forgetting the older tasks, a phenomenon aptly referred to as “catastrophic forgetting” in [11]. Recent work in life-long learning try to address forgetting in two ways. The first one [37, 33] is to freeze the network parameters for the old tasks and learn a new task by adding extra parameters. The second one aims at preserving knowledge of the old tasks by retaining the response of the original network on the new task [21, 30], or by keeping the network parameters of the new task close to the original ones [17]. Our method can be considered as a hybrid of these two approaches, as it can be used to retain the knowledge of previous tasks exactly, while adding a small number of extra parameters for the new tasks. Transfer learning. Sometimes one is interested in maximizing the performance of a model on a target domain. In this case, sequential learning can be used as a form of initialization[29]. This is very common in visual recognition, where most DNN are initialize on the ImageNet dataset and then fine-tuned on a target domain and task. Note, however, that this typically results in forgetting the original domain, a fact that we confirm in the experiments. Domain adaptation. When domains are learned sequentially, our work can be related to domain adaptation. There is a vast literature in domain adaptation, including recent contributions in deep learning such as [12, 39] based on the idea of minimizing domain discrepancy. Long et al. [23] propose a deep network architecture for domain adaptation that can jointly learn adaptive classifiers and transferable features from labeled data in the source domain and unlabeled data in the target domain. There are two important differences with our work: First, in these cases different domains contain the same objects and is only the visual style that changes (e.g. webcam vs. DSLR), whereas in our case the object themselves change. Secondly, domain adaptation is a form of transfer learning, and, as the latter, is concerned with maximizing the performance on the target domain reagardless of potential forgetting. 3 Method Our primary goal is to develop neural network architectures that can work well in a multiple-domain setting. Modern neural networks such as residual networks (ResNet [13]) are known to have very high capacity, and are therefore good candidates to learn from diverse data sources. Furthermore, even when domains look fairly different, they may still share a significant amount of low and mid-level visual patterns. Nevertheless, we show in the experiments (section 5) that learning a ResNet (or a similar model) directly from multiple domains may still not perform well. In order to address this problem, we consider a compact parametric family of neural networks φα : X →V indexed by parameters α. Concretely, X ⊂RH×W ×3 can be a space of RGB images and V = RHv×Wv×Cv a space of feature tensors. φα can then be obtained by taking all but the last classification layer of a standard ResNet model. The parametric feature extractors φα is then used to construct predictors for each domain d as Φd = ψd ◦φαd, where αd are domain-specific parameters and ψd(v) = softmax(Wdv) is a domain-specific linear classifier V →Yd mapping features to image labels. If α comprises all the parameters of the feature extractor φα, this approach reduces to learning independent models for each domain. On the contrary, our goal is to maximize parameter sharing, which we do below by introducing certain network parametrizations. 3 ∗ BN ∗ + BN [·]+ ∗ BN ∗ + BN + [·]+ w1 w2 (αs 1, αb 1) (αs 2, αn 2 ) αw 1 αw 2 (αs′ 1 , αb′ 1 ) (αs′ 2 , αb′ 2 ) Figure 2: Residual adapter modules. The figure shows a standard residual module with the inclusion of adapter modules (in blue). The filter coefficients (w1, w2) are domain-agnostic and contains the vast majority of the model parameters; (α1, α2) contain instead a small number of domain-specific parameters. 3.1 Learning to learn and filter prediction The problem of adapting a neural network dynamically to variations of the input data is similar to the one found in recent approaches to learning to learn. A few authors [34, 16, 2], in particular, have proposed to learn neural networks that predict, in a data-dependent manner, the parameters of another. Formally, we can write αd = Aedx where edx is the indicator vector of the domain dx of image x and A is a matrix whose columns are the parameter vectors αd. As shown later, it is often easy to construct an auxiliary network that can predict d from x, so that the parameter α = ψ(x) can also be expressed as the output of a neural network. If d is known, then ψ(x, d) = αd as before, and if not ψ can be constructed as suggested above or from scratch as done in [2]. The result of this construction is a network φψ(x)(x) whose parameters are predicted by a second network ψ(x). As noted in [2], while this construction is conceptually simple, its implementation is more subtle. Recall that the parameters w of a deep convolutional neural network consist primarily of the coefficients of the linear filters in the convolutional layers. If w = α, then α = ψ(x) would need to predict millions of parameters (or to learn independent models when d is observed). The solution of [2] is to use a low-rank decomposition of the filters, where w = π(w0, α) is a function of a filter basis w0 and α is a small set of tunable parameters. Here we build on the same idea, with some important extensions. First, we note that linearly parametrizing a filter bank is the same as introducing a new, intermediate convolutional layer in the network. Specifically, let Fk ∈RHf ×Wf ×Cf be a basis of K filters of size Hf × Wf operating on Cf input feature channels. Given parameters [αtk] ∈RT ×K, we can express a bank of T filters as linear combinations Gt = PK k=1 αtkFk. Applying the bank to a tensor x and using associativity and linearity of convolution results in G ∗x = PK k=1 α:k(Fk ∗x) = α ∗F ∗x where we interpreted α as a 1 × 1 × T × K filter bank. While [2] used a slightly different low-rank filter decomposition, their parametrization can also be seen as introducing additional filtering layers in the network. An advantage of this parametrization is that it results in a useful decomposition, where part of the convolutional layers contain the domain-agnostic parameters F and the others contain the domainspecific ones αd. As discussed in section 5, this is particularly useful to address the forgetting problem. In the next section we refine these ideas to obtain an effective parametrization of residual networks. 3.2 Residual adapter modules As an example of parametric network, we propose to modify a standard residual network. Recall that a ResNet is a chain gm ◦· · · ◦g1 of residual modules gt. In the simplest variant of the model, each residual module g takes as input a tensor RH×W ×C and produces as output a tensor of the same size using g(x; w) = x + ((w2 ∗·) ◦[·]+ ◦(w1 ∗·))(x). Here w1 and w2 are the coefficients of banks of small linear filters, [z]+ = max{0, z} is the ReLU operator, w ∗z is the convolution of z by the filter bank w, and ◦denotes function composition. Note that, for the addition to make sense, filters must be configured such that the dimensions of the output of the last bank are the same as x. Our goal is to parametrize the ResNet module. As suggested in the previous section, rather than changing the filter coefficients directly, we introduce additional parametric convolutional layers. In fact, we go one step beyond and make them small residual modules in their own right and call them 4 residual adapter modules (blue blocks in fig. 2). These modules have the form: g(x; α) = x + α ∗x. In order to limit the number of domain-specific parameters, α is selected to be a bank of 1 × 1 filters. A major advantage of adopting a residual architecture for the adapter modules is that the adapters reduce to the identity function when their coefficients are zero. When learning the adapters on small domains, this provides a simple way of controlling over-fitting, resulting in substantially improved performance in some cases. Batch normalization and scaling. Batch Normalization (BN) [15] is an important part of very deep neural networks. This module is usually inserted after convolutional layers in order to normalize their outputs and facilitate learning (fig. 2). The normalization operation is followed by rescaling and shift operations s ⊙x + b, where (s, b) are learnable parameters. In our architecture, we incorporate the BN layers into the adapter modules (fig. 2). Furthermore, we add a BN module right before the adapter convolution layer.1 Note that the BN scale and bias parameters are also dataset-dependent – as noted in the experiments, this alone provides a certain degree of model adaptation. Domain-agnostic vs domain-specific parameters. If the residual module of fig. 2 is configured to process an input tensor with C feature channels, and if the domain-agnostic filters w1, w2 are of size h × h × C, then the model has 2(h2C2 + hC) domain-agnostic parameters (including biases in the convolutional layers) and 2(C2 + 5C) domain-specific parameters.2 Hence, there are approximately h2 more domain-agnostic parameters than domain specific ones (usually h2 = 9). 3.3 Sequential learning and avoiding forgetting While in this paper we are not concerned with sequential learning, we have found it to be a good strategy to bootstrap a model when a large number of domains have to be learned. However, the most popular approach to sequential learning, fine-tuning (section 2), is often a poor choice for learning shared representations as it tends to quickly forget the original tasks. The challenge in learning without forgetting is to maintain information about older tasks as new ones are learned (section 2). With respect to forgetting, our adapter modules are similar to the tower model [33] as they preserve the original model exactly: one can pre-train the domain-agnostic parameters w on a large domain such as ImageNet, and then fine-tune only the domain-specific parameters αd for each new domain. Like the tower method, this preserves the original task exactly, but it is far less expensive as it does not require to introduce new feature channels for each new domain (a quadratic cost). Furthermore, the residual modules naturally reduce to the identity function when sufficient shrinking regularization is applied to the adapter weights αw. This allows the adapter to be tuned depending on the availability of data for a target domain, sometimes significantly reducing overfitting. 4 Visual decathlon In this section we introduce a new benchmark, called visual decathlon, to evaluate the performance of algorithms in multiple-domain learning. The goal of the benchmark is to assess whether a method can successfully learn to perform well in several different domains at the same time. We do so by choosing ten representative visual domains, from Internet images to characters, as well as by selecting an evaluation metric that rewards performing well on all tasks. Datasets. The decathlon challenge combines ten well-known datasets from multiple visual domains: FGVC-Aircraft Benchmark [24] contains 10,000 images of aircraft, with 100 images for each of 100 different aircraft model variants such as Boeing 737-400, Airbus A310. CIFAR100 [19] contains 60,000 32 × 32 colour images for 100 object categories. Daimler Mono Pedestrian Classification Benchmark (DPed) [26] consists of 50,000 grayscale pedestrian and non-pedestrian images, cropped and resized to 18 × 36 pixels. Describable Texture Dataset (DTD) [7] is a texture database, consisting of 5640 images, organized according to a list of 47 terms (categories) such as bubbly, cracked, 1While the bias and scale parameters of the latter can be incorporated in the following filter bank, we found it easier to leave them separated from the latter 2Including all bias and scaling vectors; 2(C2 + 3C) if these are absorbed in the filter banks when possible. 5 marbled. The German Traffic Sign Recognition (GTSR) Benchmark [36] contains cropped images for 43 common traffic sign categories in different image resolutions. Flowers102 [28] is a fine-grained classification task which contains 102 flower categories from the UK, each consisting of between 40 and 258 images. ILSVRC12 (ImNet) [32] is the largest dataset in our benchmark contains 1000 categories and 1.2 million images. Omniglot [20] consists of 1623 different handwritten characters from 50 different alphabets. Although the dataset is designed for one-shot learning, we use the dataset for standard multi-class classification task and include all the character categories in train and test splits. The Street View House Numbers (SVHN) [27] is a real-world digit recognition dataset with around 70,000 32 × 32 images. UCF101 [35] is an action recognition dataset of realistic human action videos, collected from YouTube. It contains 13,320 videos for 101 action categories. In order to make this dataset compatible with our benchmark, we convert the videos into images by using the Dynamic Image encoding of [3] which summarizes each video into an image based on a ranking principle. Challenge and evaluation. Each dataset Dd, d = 1, . . . , 10 is formed of pairs (x, y) ∈Dd where x is an image and y ∈{1, . . . , Cd} = Yd is a label. For each dataset, we specify a training, validation and test subsets. The goal is to train the best possible model to address all ten classification tasks using only the provided training and validation data (no external data is allowed). A model Φ is evaluated on the test data, where, given an image x and its ground-truth domain dx label, it has to predict the corresponding label y = Φ(x, dx) ∈Yd. Performance is measured in terms of a single scalar score S determined as in the decathlon discipline. Performing well at this metric requires algorithms to perform well in all tasks, compared to a minimum level of baseline performance for each. In detail, S is computed as follows: S = 10 X d=1 αd max{0, Emax d −Ed}γd, Ed = 1 |Dtest d | X (x,y)∈Dtest d 1{y̸=Φ(x,d)}. (1) where Ed is the average test error for each domain. Emax d the baseline error (section 5), above which no points are scored. The exponent γd ≥1 rewards more reductions of the classification error as this becomes close to zero and is set to γd = 2 for all domains. The coefficient αd is set to 1, 000 (Emax d )−γd so that a perfect result receives a score of 1,000 (10,000 in total). Data preprocessing. Different domains contain a different set of image classes as well as a different number of images. In order to reduce the computational burden, all images have been resized isotropically to have a shorter side of 72 pixels. For some datasets such as ImageNet, this is a substantial reduction in resolution which makes training models much faster (but still sufficient to obtain excellent classification results with baseline models). For the datasets for which there exists training, validation, and test subsets, we keep the original splits. For the rest, we use 60%, 20% and 20% of the data for training, validation, and test respectively. For the ILSVRC12, since the test labels are not available, we use the original validation subset as the test subset and randomly sample a new validation set from their training split. We are planning to make the data and an evaluation server public soon. 5 Experiments In this section we evaluate our method quantitatively against several baselines (section 5.1), investigate the ability of the proposed techniques to learn models for ten very diverse visual domains. Implementation details. In all experiments we choose to use the powerful ResNets [13] as base architectures due to their remarkable performance. In particular, as a compromise of accuracy and speed, we chose the ResNet28 model [40] which consists of three blocks of four residual units. Each residual unit contains 3 × 3 convolutional, BN and ReLU modules (fig. 2). The network accepts 64 × 64 images as input, downscales the spatial dimensions by two at each block and ends with a global average pooling and a classifier layer followed by a softmax. We set the number of filters to 64, 128, 256 for these blocks respectively. Each network is optimized to minimize its cross-entropy loss with stochastic gradient descent. The network is run for 80 epochs and the initial learning rate of 0.1 is lowered to 0.01 and then 0.001 gradually. 6 Model #par. ImNet Airc. C100 DPed DTD GTSR Flwr OGlt SVHN UCF mean S # images 1.3m 7k 50k 30k 4k 40k 2k 26k 70k 9k Scratch 10× 59.87 57.10 75.73 91.20 37.77 96.55 56.30 88.74 96.63 43.27 70.32 1625 Scratch+ 11× 59.67 59.59 76.08 92.45 39.63 96.90 56.66 88.74 96.78 44.17 71.07 1826 Feature extractor 1× 59.67 23.31 63.11 80.33 45.37 68.16 73.69 58.79 43.54 26.80 54.28 544 Finetune 10× 59.87 60.34 82.12 92.82 55.53 97.53 81.41 87.69 96.55 51.20 76.51 2500 LwF [21] 10× 59.87 61.15 82.23 92.34 58.83 97.57 83.05 88.08 96.10 50.04 76.93 2515 BN adapt. [5] ∼1× 59.87 43.05 78.62 92.07 51.60 95.82 74.14 84.83 94.10 43.51 71.76 1363 Res. adapt. 2× 59.67 56.68 81.20 93.88 50.85 97.05 66.24 89.62 96.13 47.45 73.88 2118 Res. adapt. decay 2× 59.67 61.87 81.20 93.88 57.13 97.57 81.67 89.62 96.13 50.12 76.89 2621 Res. adapt. finetune all 2× 59.23 63.73 81.31 93.30 57.02 97.47 83.43 89.82 96.17 50.28 77.17 2643 Res. adapt. dom-pred 2.5× 59.18 63.52 81.12 93.29 54.93 97.20 82.29 89.82 95.99 50.10 76.74 2503 Res. adapt. (large) ∼12× 67.00 67.69 84.69 94.28 59.41 97.43 84.86 89.92 96.59 52.39 79.43 3131 Table 1: Multiple-domain networks. The figure reports the (top-1) classification accuracy (%) of different models on the decathlon tasks and final decathlon score (S). ImageNet is used to prime the network in every case, except for the networks trained from scratch. The model size is the number of parameters w.r.t. the baseline ResNet. The fully-finetuned model, written blue, is used as a baseline to compute the decathlon score. Model Airc. C100 DPed DTD GTSR Flwr OGlt SVHN UCF Finetune 1.1 60.3 3.6 63.1 0.6 80.3 0.7 45.3 1.4 68.1 27.2 73.6 13.4 87.7 0.2 96.6 5.4 51.2 LwF [21] high lr 4.1 61.1 21.0 82.2 23.8 92.3 36.7 58.8 11.5 97.6 34.2 83.1 3.0 88.1 0.2 96.1 18.6 50.0 LwF [21] low lr 38.0 50.6 33.0 80.7 53.3 92.2 47.0 57.2 23.7 96.6 45.7 75.7 21.0 86.0 13.3 94.8 29.0 44.6 Res. adapt. finetune all 59.2 63.7 59.2 81.3 59.2 93.3 59.2 57.0 59.2 97.5 59.2 83.4 59.2 89.8 59.2 96.1 59.2 50.3 Table 2: Pairwise forgetting. Each pair of numbers report the top-1 accuracy (%) on the old task (ImageNet) and a new target task after the network is fully finetuned on the latter. We also show the performance of LwF when it is finetuned on the new task with a high and low learning rate, trading-off forgetting ImageNet and improving the results on the target domain. By comparison, we show the performance of tuning only the residual adapters, which by construction does not result in any performance loss in ImageNet while still achieving very good performance on each target task. 5.1 Results There are two possible extremes. The first one is to learn ten independent models, one for each dataset, and the second one is to learn a single model where all feature extractor parameters are shared between the ten domains. We evaluate next different approaches to learn such models. Pairwise learning. In the first experiment (table 1), we start by learning a ResNet model on ImageNet, and then use different techniques to extend it to the remaining nine tasks, one at a time. Depending on the method, this may produce an overall model comprising ten ResNet architectures, or just one ResNet with a few domain-specific parameters; thus we also report the total number of parameters used, where 1× is the size of a single ResNet (excluding the last classification layer, which can never be shared). As baselines, we evaluate four cases: i) learning an individual ResNet model from scratch for each task, ii) freezing all the parameters of the pre-trained network, using the network as feature extractor and only learn a linear classifier, iii) standard finetuning and iv) applying a reimplementation of the LwF technique of [21] that encourages the fine-tuned network to retain the responses of the original ImageNet model while learning the new task. In terms of accuracy, learning from scratch performs poorly on small target datasets and, by learning 10 independent models, requires 10× parameters in total. Freezing the ImageNet feature extraction is very efficient in terms of parameter sharing (1× parameters in total), preserves the original domain exactly, but generally performs very poorly on the target domain. Full fine-tuning leads to accurate results both for large and small datasets; however, it also forgets the ImageNet domain substantially (table 2), so it still requires learning 10 complete ResNet models for good overall performance. When LwF is run as intended by the original authors [21], is still leads to a noticeable performance drop on the original task, even when learning just two domains (table 2), particularly if the target domain is very different from ImageNet (e.g. Omniglot and SVHN). Still, if one chooses a different trade-off point and allows the method to forget ImageNet more, it can function as a good regularizer that slightly outperforms vanilla fine-tuning overall (but still resulting in a 10× model). 7 Next, we evaluate the effect of sharing the majority of parameters between tasks, whereas still allowing a small number of domain-specific parameters to change. First, we consider specializing only the BN layer scaling and bias parameters, which is equivalent to the approach of [5]. In this case, less than the 0.1% of the model parameters are domain-specific (for the ten domains, this results in a model with 1.01× parameters overall). Hence the model is very similar to the one with the frozen feature extractor; nevertheless, the performances increase very substantially in most cases (e.g. 23.31% →43.05% accuracy on Aircraft). As the next step, we introduce the residual adapter modules, which increase by 11% the number of parameters per domain, resulting in a 2× model. In the pre-training phase, we first pretrain on ImageNet the network with the added modules. Then, we freeze the task agnostic parameters and train the task specific parameters on the different datasets. Differently from vanilla fine-tuning, there is no forgetting in this setting. While most of the parameters are shared, our method is either close or better than full fine-tuning. As a further control, we also train 10 models from scratch with the added parameters (denoted as Scratch+), but do not observe any noticeable performance gain in average, demonstrating that parameters sharing is highly beneficial. We also contrast learning the adapter modules with two values of weight decay (0.002 and 0.005) higher than the default 0.0005. These parameters are obtained after a coarse grid search using cross-validation for each dataset. Using higher decay significantly improves the performance on smaller datasets such as Flowers, whereas the smaller decay is best for larger datasets. This shows both the importance and utility of controlling overfitting in the adaptation process. In practice, there is an almost direct correspondence between the size of the data and which one of these values to use. The optimal decay can be selected via validation, but a rough choice can be performed by simply looking at the dataset size. We also compare to another baseline where we only finetune the last two convolutional layers and freeze the others, which may be thought to be generic. This amounts to having a network with twice the number of total parameters in a vanilla ResNet which is equal to our proposed architecture. This model obtains 64.7% mean accuracy over ten datasets, which is significantly lower than our 73.9%, likely due to overfitting (controlling overfitting is one of the advantages of our technique). Furthermore, we also assess the quality of our adapter without residual connections, which corresponds to the low rank filter parametrization of section 3.1; this approach achieves an accuracy of 70.3%, which is worse than our 73.9%. We also observe that this configuration requires notably more iterations to converge. Hence, the residual architecture for the adapters results in better performances, better control of overfitting, and a faster convergence. End-to-end learning. So far, we have shown that our method, by learning only the adapter modules for each new domain, does not suffer from forgetting. However, for us sequential learning is just a scalable learning strategy. Here, we also show (table 1) that we can further improve the results by fine-tuning all the parameters of the network end-to-end on the ten tasks. We do so by sampling a batch from each dataset in a round robin fashion, allowing each domain to contribute to the shared parameters. A final pass is done on the adapter modules to take into account the change in the shared parameters. Domain prediction. Up to now we assume that the domain of each image is given during test time for all the methods. If this is unavailable, it can be predicted on the fly by means of a small neural-network predictor. We train a light ResNet, which is composed three stacks of two residual networks, half deep as the original net, obtaining 99.8% accuracy in domain prediction, resulting in a barely noticeable drop in the overall multiple-domain challenge (see Res. adapt dom-pred in table 1). Note that similar performance drop would be observed for the other baselines. Decathlon evaluation: overall performance. While so far we have looked at results on individual domain, the Decathlon score eq. (1) can be used to compare performance overall. As baseline error rates in eq. (1), we double the error rates of the fully finetuned networks on each task. In this manner, this 10× model achieves a score of 2,500 points (over 10,000 possible ones, see eq. (1)). The last column of table 1 reports the scores achieved by the other architectures. As intended, the decathlon score favors the methods that perform well overall, emphasizes their consistency rather than just their average accuracy. For instance, although the Res. adapt. model (trained with single decay coefficient for all domains) performs well in terms of average accuracy (73.88%), its decathlon score (2118) is relatively low because the model performs poorly in DTD and Flowers. This also shows that, once the weight decays are configured properly, our model achieves superior performance (2643 points) to all the baselines using only 2× the capacity of a single ResNet. 8 Finally we show that using a higher capacity ResNet28 (12×, ResNet adapt. (large) in table 1), which is comparable to 10 independent networks, significantly improves our results and outperforms the finetuning baseline by 600 point in decathlon score. As a matter of fact, this model outperforms the state-of-the-art [40] (81.2%) by 3.5 points in CIFAR100. In other cases, our performances are in general in line to current state-of-the-art methods. When this is not the case, this is due to reduced image resolution (ImageNet, Flower) or due to the choice of a specific video representation in UCF (dynamic image). 6 Conclusions As machine learning applications become more advanced and pervasive, building data representations that work well for multiple problems will become increasingly important. In this paper, we have introduced a simple architectural element, the residual adapter module, that allows compressing many visual domains in relatively small residual networks, with substantial parameter sharing between them. We have also shown that they allow addressing the forgetting problem, as well as adapting to target domain for which different amounts of training data are available. Finally, we have introduced a new multi-domain learning challenge, the Visual Decathlon, to allow a systematic comparison of algorithms for multiple-domain learning. Acknowledgments: This work acknowledges the support of Mathworks/DTA DFR02620 and ERC 677195IDIU. References [1] A. Argyriou, T. Evgeniou, and M Pontil. Multi-task feature learning. In Proc. NIPS, volume 19, page 41. MIT; 1998, 2007. [2] L. Bertinetto, J. F. Henriques, J. Valmadre, P. Torr, and A. Vedaldi. Learning feed-forward one-shot learners. In Proc. NIPS, pages 523–531, 2016. [3] H. Bilen, B. Fernando, E. Gavves, A. Vedaldi, and S. Gould. Dynamic image networks for action recognition. In Proc. CVPR, 2016. [4] H. Bilen and A. Vedaldi. Integrated perception with recurrent multi-task neural networks. In Proc. NIPS, 2016. [5] H. Bilen and A. Vedaldi. Universal representations: The missing link between faces, text, planktons, and cat breeds. arXiv preprint arXiv:1701.07275, 2017. [6] R. Caruana. Multitask learning. Machine Learning, 28, 1997. [7] M. Cimpoi, S. Maji, I. Kokkinos, S. Mohamed, and A. Vedaldi. Describing textures in the wild. In Proc. CVPR, 2014. [8] R. Collobert and J. Weston. A unified architecture for natural language processing: Deep neural networks with multitask learning. In icml, pages 160–167. ACM, 2008. [9] H. Daumé III. Frustratingly easy domain adaptation. ACL 2007, page 256, 2007. [10] T. Evgeniou and M. Pontil. Regularized multi–task learning. In SIGKDD, pages 109–117. ACM, 2004. [11] R. M. French. Catastrophic forgetting in connectionist networks. Trends in cognitive sciences, 3(4):128–135, 1999. [12] Y. Ganin and V. Lempitsky. Unsupervised domain adaptation by backpropagation. Proc. ICML, 2015. [13] K. He, X. Zhang, S. Ren, and J. Sun. Identity mappings in deep residual networks. In Proc. ECCV, pages 630–645. Springer, 2016. [14] J. T. Huang, J. Li, D. Yu, L. Deng, and Y. Gong. Cross-language knowledge transfer using multilingual deep neural network with shared hidden layers. In ICASSP, pages 7304–7308, 2013. 9 [15] S. Ioffe and C. Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. CoRR, 2015. [16] X. Jia, B. De Brabandere, T. Tuytelaars, and L. Gool. Dynamic filter networks. In Proc. NIPS, pages 667–675, 2016. [17] J. Kirkpatrick, E. Pascanu, N. Rabinowitz, J. Veness, G. Desjardins, A. A. Rusu, K. Milan, J. Quan, T. Ramalho, A. Grabska-Barwinska, et al. Overcoming catastrophic forgetting in neural networks. National Academy of Sciences, 2017. [18] I. Kokkinos. Ubernet: Training auniversal’convolutional neural network for low-, mid-, and high-level vision using diverse datasets and limited memory. Proc. CVPR, 2017. [19] A. Krizhevsky and G. Hinton. Learning multiple layers of features from tiny images. 2009. [20] B. M. Lake, R. Salakhutdinov, and J. B. Tenenbaum. Human-level concept learning through probabilistic program induction. Science, 350(6266):1332–1338, 2015. [21] Z. Li and D. Hoiem. Learning without forgetting. In Proc. ECCV, pages 614–629, 2016. [22] X. Liu, J. Gao, X. He, L. Deng, K. Duh, and Y. Wang. Representation learning using multi-task deep neural networks for semantic classification and information retrieval. In HLT-NAACL, pages 912–921, 2015. [23] M. Long, H. Zhu, J. Wang, and M. I. Jordan. Unsupervised Domain Adaptation with Residual Transfer Networks. In Proc. NIPS, pages 136–144, 2016. [24] S. Maji, J. Kannala, E. Rahtu, M. Blaschko, and A. Vedaldi. Fine-grained visual classification of aircraft. Technical report, 2013. [25] T. Mitchell. Never-ending learning. Technical report, DTIC Document, 2010. [26] S. Munder and D. M. Gavrila. An experimental study on pedestrian classification. PAMI, 28(11):1863–1868, 2006. [27] Y. Netzer, T. Wang, A. Coates, A. Bissacco, B. Wu, and A. Y. Ng. Reading digits in natural images with unsupervised feature learning. In NIPS Workshop on Deep Learning and Unsupervised Feature Learning, 2011. [28] M-E. Nilsback and A. Zisserman. Automated flower classification over a large number of classes. In ICCVGIP, Dec 2008. [29] Ali Sharif Razavian, Hossein Azizpour, Josephine Sullivan, and Stefan Carlsson. CNN features off-the-shelf: an astounding baseline for recognition. In CVPR DeepVision Workshop, 2014. [30] S. A. Rebuffi, A. Kolesnikov, G. Sperl, and C. H. Lampert. icarl: Incremental classifier and representation learning. In Proc. CVPR, 2017. [31] Amir Rosenfeld and John K Tsotsos. Incremental learning through deep adaptation. arXiv preprint arXiv:1705.04228, 2017. [32] O. Russakovsky, J. Deng, H. Su, J. Krause, S. Satheesh, S. Ma, Z. Huang, A. Karpathy, A. Khosla, M. Bernstein, A. C. Berg, and K. Fei-Fei. Imagenet large scale visual recognition challenge, 2014. [33] A. A. Rusu, N. C. Rabinowitz, G. Desjardins, H. Soyer, J. Kirkpatrick, K. Kavukcuoglu, R. Pascanu, and R. Hadsell. Progressive neural networks. arXiv preprint arXiv:1606.04671, 2016. [34] J. Schmidhuber. Learning to control fast-weight memories: An alternative to dynamic recurrent networks. Neural Computation, 4(1):131–139, 1992. [35] K. Soomro, A. R. Zamir, and M. Shah. Ucf101: A dataset of 101 human actions classes from videos in the wild. arXiv preprint arXiv:1212.0402, 2012. [36] J. Stallkamp, M. Schlipsing, J. Salmen, and C. Igel. Man vs. computer: Benchmarking machine learning algorithms for traffic sign recognition. Neural Networks, 32(0):323–332, 2012. [37] A. V. Terekhov, G. Montone, and J. K. O’Regan. Knowledge transfer in deep block-modular neural networks. In Biomimetic and Biohybrid Systems, pages 268–279, 2015. 10 [38] S. Thrun. Lifelong learning algorithms. In Learning to learn, pages 181–209. Springer, 1998. [39] E. Tzeng, J. Hoffman, T. Darrell, and K. Saenko. Simultaneous deep transfer across domains and tasks. In Proc. CVPR, pages 4068–4076, 2015. [40] Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. arXiv preprint arXiv:1605.07146, 2016. [41] T. Zhang, B. Ghanem, S. Liu, and N. Ahuja. Robust visual tracking via structured multi-task sparse learning. IJCV, 101(2):367–383, 2013. [42] Z. Zhang, P. Luo, C. C. Loy, and X. Tang. Facial landmark detection by deep multi-task learning. In Proc. ECCV, 2014. 11
2017
609
7,129
Learning Linear Dynamical Systems via Spectral Filtering Elad Hazan, Karan Singh, Cyril Zhang Department of Computer Science Princeton University Princeton, NJ 08544 {ehazan,karans,cyril.zhang}@cs.princeton.edu Abstract We present an efficient and practical algorithm for the online prediction of discrete-time linear dynamical systems with a symmetric transition matrix. We circumvent the non-convex optimization problem using improper learning: carefully overparameterize the class of LDSs by a polylogarithmic factor, in exchange for convexity of the loss functions. From this arises a polynomial-time algorithm with a near-optimal regret guarantee, with an analogous sample complexity bound for agnostic learning. Our algorithm is based on a novel filtering technique, which may be of independent interest: we convolve the time series with the eigenvectors of a certain Hankel matrix. 1 Introduction Linear dynamical systems (LDSs) are a class of state space models which accurately model many phenomena in nature and engineering, and are applied ubiquitously in time-series analysis, robotics, econometrics, medicine, and meteorology. In this model, the time evolution of a system is explained by a linear map on a finite-dimensional hidden state, subject to disturbances from input and noise. Recent interest has focused on the effectiveness of recurrent neural networks (RNNs), a nonlinear variant of this idea, for modeling sequences such as audio signals and natural language. Central to this field of study is the problem of system identification: given some sample trajectories, output the parameters for an LDS which generalize to predict unseen future data. Viewed directly, this is a non-convex optimization problem, for which efficient algorithms with theoretical guarantees are very difficult to obtain. A standard heuristic for this problem is expectation-maximization (EM), which can find poor local optima in theory and practice. We consider a different approach: we formulate system identification as an online learning problem, in which neither the data nor predictions are assumed to arise from an LDS. Furthermore, we slightly overparameterize the class of predictors, yielding an online convex program amenable to efficient regret minimization. This carefully chosen relaxation, which is our main theoretical contribution, expands the dimension of the hypothesis class by only a polylogarithmic factor. This construction relies upon recent work on the spectral theory of Hankel matrices. The result is a simple and practical algorithm for time-series prediction, which deviates significantly from existing methods. We coin the term wave-filtering for our method, in reference to our relaxation’s use of convolution by wave-shaped eigenvectors. We present experimental evidence on both toy data and a physical simulation, showing our method to be competitive in terms of predictive performance, more stable, and significantly faster than existing algorithms. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. 1.1 Our contributions Consider a discrete-time linear dynamical system with inputs {xt}, outputs {yt}, and a latent state {ht}, which can all be multi-dimensional. With noise vectors {ηt}, {ξt}, the system’s time evolution is governed by the following equations: ht+1 = Aht + Bxt + ηt yt = Cht + Dxt + ξt. If the dynamics A, B, C, D are known, then the Kalman filter [Kal60] is known to estimate the hidden state optimally under Gaussian noise, thereby producing optimal predictions of the system’s response to any given input. However, this is rarely the case – indeed, real-world systems are seldom purely linear, and rarely are their evolution matrices known. We henceforth give a provable, efficient algorithm for the prediction of sequences arising from an unknown dynamical system as above, in which the matrix A is symmetric. Our main theoretical contribution is a regret bound for this algorithm, giving nearly-optimal convergence to the lowest mean squared prediction error (MSE) realizable by a symmetric LDS model: Theorem 1 (Main regret bound; informal). On an arbitrary sequence {(xt, yt)}T t=1, Algorithm 1 makes predictions {ˆyt}T t=1 which satisfy MSE(ˆy1, . . . , ˆyT ) −MSE(ˆy∗ 1, . . . , ˆy∗ T ) ≤˜O poly(n, m, d, log T) √ T  , compared to the best predictions {y∗ t }T t=1 by a symmetric LDS, while running in polynomial time. Note that the signal need not be generated by an LDS, and can even be adversarially chosen. In the less general batch (statistical) setting, we use the same techniques to obtain an analogous sample complexity bound for agnostic learning: Theorem 2 (Batch version; informal). For any choice of ε > 0, given access to an arbitrary distribution D over training sequences {(xt, yt)}T t=1, Algorithm 2, run on N i.i.d. sample trajectories from D, outputs a predictor ˆΘ such that E D  MSE(ˆΘ) −MSE(Θ∗)  ≤ε + ˜O (poly(n, m, d, log T, log 1/ε)) √ N , compared to the best symmetric LDS predictor Θ∗, while running in polynomial time. Typical regression-based methods require the LDS to be strictly stable, and degrade on illconditioned systems; they depend on a spectral radius parameter 1 1−∥A∥. Our proposed method of wave-filtering provably and empirically works even for the hardest case of ∥A∥= 1. Our algorithm attains the first condition number-independent polynomial guarantees in terms of regret (equivalently, sample complexity) and running time for the MIMO setting. Interestingly, our algorithms never need to learn the hidden state, and our guarantees can be sharpened to handle the case when the dimensionality of ht is infinite. 1.2 Related work The modern setting for LDS arose in the seminal work of Kalman [Kal60], who introduced the Kalman filter as a recursive least-squares solution for maximum likelihood estimation (MLE) of Gaussian perturbations to the system. The framework and filtering algorithm have proven to be a mainstay in control theory and time-series analysis; indeed, the term Kalman filter model is often used interchangeably with LDS. We refer the reader to the classic survey [Lju98], and the extensive overview of recent literature in [HMR16]. Ghahramani and Roweis [RG99] suggest using the EM algorithm to learn the parameters of an LDS. This approach, which directly tackles the non-convex problem, is widely used in practice [Mar10a]. However, it remains a long-standing challenge to characterize the theoretical guarantees afforded by EM. We find that it is easy to produce cases where EM fails to identify the correct system. In a recent result of [HMR16], it is shown for the first time that for a restricted class of systems, gradient descent (also widely used in practice, perhaps better known in this setting as backpropagation) 2 guarantees polynomial convergence rates and sample complexity in the batch setting. Their result applies essentially only to the SISO case (vs. multi-dimensional for us), depends polynomially on the spectral gap (as opposed to no dependence for us), and requires the signal to be created by an LDS (vs. arbitrary for us). 2 Preliminaries 2.1 Linear dynamical systems Many different settings have been considered, in which the definition of an LDS takes on many variants. We are interested in discrete time-invariant MIMO (multiple input, multiple output) systems with a finite-dimensional hidden state.1 Formally, our model is given as follows: Definition 2.1. A linear dynamical system (LDS) is a map from a sequence of input vectors x1, . . . , xT ∈Rn to output (response) vectors y1, . . . , yT ∈Rm of the form ht+1 = Aht + Bxt + ηt (1) yt = Cht + Dxt + ξt, (2) where h0, . . . , hT ∈Rd is a sequence of hidden states, A, B, C, D are matrices of appropriate dimension, and ηt ∈Rd, ξt ∈Rm are (possibly stochastic) noise vectors. Unrolling this recursive definition gives the impulse response function, which uniquely determines the LDS. For notational convenience, for invalid indices t ≤0, we define xt, ηt, and ξt to be the zero vector of appropriate dimension. Then, we have: yt = T −1 X i=1 CAi (Bxt−i + ηt−i) + CAth0 + Dxt + ξt. (3) We will consider the (discrete) time derivative of the impulse response function, given by expanding yt−1 −yt by Equation (3). For the rest of this paper, we focus our attention on systems subject to the following restrictions: (i) The LDS is Lyapunov stable: ∥A∥2 ≤1, where ∥·∥2 denotes the operator (a.k.a. spectral) norm. (ii) The transition matrix A is symmetric and positive semidefinite.2 The first assumption is standard: when the hidden state is allowed to blow up exponentially, finegrained prediction is futile. In fact, many algorithms only work when ∥A∥is bounded away from 1, so that the effect of any particular xt on the hidden state (and thus the output) dissipates exponentially. We do not require this stronger assumption. We take a moment to justify assumption (ii), and why this class of systems is still expressive and useful. First, symmetric LDSs constitute a natural class of linearly-observable, linearly-controllable systems with dissipating hidden states (for example, physical systems with friction or heat diffusion). Second, this constraint has been used successfully for video classification and tactile recognition tasks [HSC+16]. Interestingly, though our theorems require symmetric A, our algorithms appear to tolerate some non-symmetric (and even nonlinear) transitions in practice. 2.2 Sequence prediction as online regret minimization A natural formulation of system identification is that of online sequence prediction. At each time step t, an online learner is given an input xt, and must return a predicted output ˆyt. Then, the true response yt is observed, and the predictor suffers a squared-norm loss of ∥yt −ˆyt∥2. Over T rounds, the goal is to predict as accurately as the best LDS in hindsight. 1We assume finite dimension for simplicity of presentation. However, it will be evident that hidden-state dimension has no role in our algorithm, and shows up as ∥B∥F and ∥C∥F in the regret bound. 2The psd constraint on A can be removed by augmenting the inputs xt with extra coordinates (−1)t(xt). We omit this for simplicity of presentation. 3 Note that the learner is permitted to access the history of observed responses {y1, . . . , yt−1}. Even in the presence of statistical (non-adversarial) noise, the fixed maximum-likelihood sequence produced by Θ = (A, B, C, D, h0) will accumulate error linearly as T. Thus, we measure performance against a more powerful comparator, which fixes LDS parameters Θ, and predicts yt by the previous response yt−1 plus the derivative of the impulse response function of Θ at time t. We will exhibit an online algorithm that can compete against the best Θ in this setting. Let ˆy1, . . . , ˆyT be the predictions made by an online learner, and let y∗ 1, . . . , y∗ T be the sequence of predictions, realized by a chosen setting of LDS parameters Θ, which minimize total squared error. Then, we define regret by the difference of total squared-error losses: Regret(T) def = T X t=1 ∥yt −ˆyt∥2 − T X t=1 ∥yt −y∗ t ∥2. This setup fits into the standard setting of online convex optimization (in which a sublinear regret bound implies convergence towards optimal predictions), save for the fact that the loss functions are non-convex in the system parameters. Also, note that a randomized construction (set all xt = 0, and let yt be i.i.d. Bernoulli random variables) yields a lower bound3 for any online algorithm: E [Regret(T)] ≥Ω( √ T). To quantify regret bounds, we must state our scaling assumptions on the (otherwise adversarial) input and output sequences. We assume that the inputs are bounded: ∥xt∥2 ≤Rx. Also, we assume that the output signal is Lipschitz in time: ∥yt −yt−1∥2 ≤Ly. The latter assumption exists to preclude pathological inputs where an online learner is forced to incur arbitrarily large regret. For a true noiseless LDS, Ly is not too large; see Lemma F.5 in the appendix. We note that an optimal ˜O( √ T) regret bound can be trivially achieved in this setting by algorithms such as Hedge [LW94], using an exponential-sized discretization of all possible LDS parameters; this is the online equivalent of brute-force grid search. Strikingly, our algorithms achieve essentially the same regret bound, but run in polynomial time. 2.3 The power of convex relaxations Much work in system identification, including the EM method, is concerned with explicitly finding the LDS parameters Θ = (A, B, C, D, h0) which best explain the data. However, it is evident from Equation 3 that the CAiB terms cause the least-squares (or any other) loss to be non-convex in Θ. Many methods used in practice, including EM and subspace identification, heuristically estimate each hidden state ht, after which estimating the parameters becomes a convex linear regression problem. However, this first step is far from guaranteed to work in theory or practice. Instead, we follow the paradigm of improper learning: in order to predict sequences as accurately as the best possible LDS Θ∗∈H, one need not predict strictly from an LDS. The central driver of our algorithms is the construction of a slightly larger hypothesis class ˆH, for which the best predictor ˆΘ∗is nearly as good as Θ∗. Furthermore, we construct ˆH so that the loss functions are convex under this new parameterization. From this will follow our efficient online algorithm. As a warmup example, consider the following overparameterization: pick some time window τ ≪T, and let the predictions ˆyt be linear in the concatenation [xt, . . . , xt−τ] ∈Rτd. When ∥A∥is bounded away from 1, this is a sound assumption.4 However, in general, this approximation is doomed to either truncate longer-term input-output dependences (short τ), or suffer from overfitting (long τ). Our main theorem uses an overparameterization whose approximation factor ε is independent of ∥A∥, and whose sample complexity scales only as ˜O(polylog(T, 1/ε)). 2.4 Low approximate rank of Hankel matrices Our analysis relies crucially on the spectrum of a certain Hankel matrix, a square matrix whose anti-diagonal stripes have equal entries (i.e. Hij is a function of i + j). An important example is the 3This is a standard construction; see, e.g. Theorem 3.2 in [Haz16]. 4This assumption is used in autoregressive models; see Section 6 of [HMR16] for a theoretical treatment. 4 Hilbert matrix Hn,θ, the n-by-n matrix whose (i, j)-th entry is 1 i+j+θ. For example, H3,−1 = " 1 1/2 1/3 1/2 1/3 1/4 1/3 1/4 1/5 # . This and related matrices have been studied under various lenses for more than a century: see, e.g., [Hil94, Cho83]. A basic fact is that Hn,θ is a positive definite matrix for every n ≥1, θ > −2. The property we are most interested in is that the spectrum of a positive semidefinite Hankel matrix decays exponentially, a difficult result derived in [BT16] via Zolotarev rational approximations. We state these technical bounds in Appendix E. 3 The wave-filtering algorithm Our online algorithm (Algorithm 1) runs online projected gradient descent [Zin03] on the squared loss ft(Mt) def = ∥yt −ˆyt(Mt)∥2. Here, each Mt is a matrix specifying a linear map from featurized inputs ˜Xt to predictions ˆyt. Specifically, after choosing a certain bank of k filters {φj}, ˜Xt ∈Rnk+2n+m consists of convolutions of the input time series with each φj (scaled by certain constants), along with xt−1, xt, and yt−1. The number of filters k will turn out to be polylogarithmic in T. The filters {φj} and scaling factors {σ1/4 j } are given by the top eigenvectors and eigenvalues of the Hankel matrix ZT ∈RT ×T , whose entries are given by Zij := 2 (i + j)3 −(i + j). In the language of Section 2.3, one should think of each Mt as arising from an ˜O(poly(m, n, d, log T))-dimensional hypothesis class ˆH, which replaces the original O((m + n + d)2)-dimensional class H of LDS parameters (A, B, C, D, h0). Theorem 3 gives the key fact that ˆH approximately contains H. Algorithm 1 Online wave-filtering algorithm for LDS sequence prediction 1: Input: time horizon T, filter parameter k, learning rate η, radius parameter RM. 2: Compute {(σj, φj)}k j=1, the top k eigenpairs of ZT . 3: Initialize M1 ∈Rm×k′, where k′ def = nk + 2n + m. 4: for t = 1, . . . , T do 5: Compute ˜X ∈Rk′, with first nk entries ˜X(i,j) := σ1/4 j PT −1 u=1 φj(u)xt−u(i), followed by the 2n + m entries of xt−1, xt, and yt−1. 6: Predict ˆyt := Mt ˜X. 7: Observe yt. Suffer loss ∥yt −ˆyt∥2. 8: Gradient update: Mt+1 ←Mt −2η(yt −ˆyt) ⊗˜X. 9: if ∥Mt+1∥F ≥RM then 10: Perform Frobenius norm projection: Mt+1 ← RM ∥Mt+1∥F Mt+1. 11: end if 12: end for In Section 4, we provide the precise statement and proof of Theorem 1, the main regret bound for Algorithm 1, with some technical details deferred to the appendix. We also obtain analogous sample complexity results for batch learning; however, on account of some definitional subtleties, we defer all discussion of the offline case, including the statement and proof of Theorem 2, to Appendix A. We make one final interesting note here, from which the name wave-filtering arises: when plotted coordinate-wise, our filters {φj} look like the vibrational modes of an inhomogeneous spring (see Figure 1). We provide some insight on this phenomenon (along with some other implementation concerns) in Appendix B. Succinctly: in the scaling limit, (ZT /∥ZT ∥2)T →∞commutes with a certain second-order Sturm-Liouville differential operator D. This allows us to approximate filters with eigenfunctions of D, using efficient numerical ODE solvers. 5 0 200 400 600 800 1000 −0.20 −0.10 0.00 0.10 0.20 φ1 φ3 φ5 φ10 φ15 φ20 (a) 0 200 400 600 800 1000 φ27 φODE(97) (b) 0 200 400 600 800 1000 φODE(500) φODE(5000) (c) Figure 1: (a) The entries of some typical eigenvectors of Z1000, plotted coordinate-wise. (b) φ27 of Z1000 (σ27 ≈10−16) computed with finite-precision arithmetic, along with a numerical solution to the ODE in Appendix B.1 with λ = 97. (c) Some very high-order filters, computed using the ODE, would be difficult to obtain by eigenvector computations. 4 Analysis We first state the full form of the regret bound achieved by Algorithm 1:5 Theorem 1 (Main). On any sequence {(xt, yt)}T t=1, Algorithm 1, with a choice of k = Θ log2 T log(RΘRxLyn)  , RM = Θ(R2 Θ √ k), and η = Θ((R2 xLy log(RΘRxLyn) n √ T log4 T)−1), achieves regret Regret(T) ≤O  R4 Θ R2 x Ly log2(RΘRxLyn) · n √ T log6 T  , competing with LDS predictors (A, B, C, D, h0) with 0 ≼A ≼I and ∥B∥F , ∥C∥F , ∥D∥F , ∥h0∥≤ RΘ. Note that the dimensions m, d do not appear explicitly in this bound, though they typically factor into RΘ. In Section 4.1, we state and prove Theorem 3, the convex relaxation guarantee for the filters, which may be of independent interest. This allows us to approximate the optimal LDS in hindsight (the regret comparator) by the loss-minimizing matrix Mt : ˜X 7→ˆyt. In Section 4.2, we complete the regret analysis using Theorem 3, along with bounds on the diameter and gradient, to conclude Theorem 1. Since the batch analogue is less general (and uses the same ideas), we defer discussion of Algorithm 2 and Theorem 2 to Appendix A. 4.1 Approximate convex relaxation via wave filters Assume for now that h0 = 0; we will remove this at the end, and see that the regret bound is asymptotically the same. Recall (from Section 2.2) that we measure regret compared to predictions obtained by adding the derivative of the impulse response function of an LDS Θ to yt−1. Our approximation theorem states that for any Θ, there is some MΘ ∈ˆH which produces approximately the same predictions. Formally: Theorem 3 (Spectral convex relaxation for symmetric LDSs). Let {ˆyt}T t=1 be the online predictions made by an LDS Θ = (A, B, C, D, h0 = 0). Let RΘ = max{∥B∥F , ∥C∥F , ∥D∥F }. Then, for any ε > 0, with a choice of k = Ω(log T log(RΘRxLynT/ε)), there exists an MΘ ∈Rm×k′ such that T X t=1 ∥MΘ ˜Xt −yt∥2 ≤ T X t=1 ∥ˆyt −yt∥2 + ε. Here, k′ and ˜Xt are defined as in Algorithm 1 (noting that ˜Xt includes the previous ground truth yt−1). 5Actually, for a slightly tighter proof, we analyze a restriction of the algorithm which does not learn the portion M (y), instead always choosing the identity matrix for that block. 6 Proof. We construct this mapping Θ 7→MΘ explicitly. Write MΘ as the block matrix  M (1) M (2) · · · M (k) M (x′) M (x) M (y) , where the blocks’ dimensions are chosen to align with ˜Xt, the concatenated vector h σ1/4 1 (X ∗φ1)t σ1/4 2 (X ∗φ2)t · · · σ1/4 k (X ∗φk)t xt−1 xt yt−1 i , so that the prediction is the block matrix-vector product MΘ ˜Xt = k X j=1 σ1/4 j M (j)(X ∗φj)t + M (x′)xt−1 + M (x)xt + M (y)yt−1. Without loss of generality, assume that A is diagonal, with entries {αl}d l=1.6 Let bl be the l-th row of B, and cl the l-th column of C. Also, we define a continuous family of vectors µ : [0, 1] →RT , with entries µ(α)(i) = (αl −1)αi−1 l . Then, our construction is as follows: • M (j) = Pd l=1 σ−1/4 j ⟨φj, µ(αl)⟩(cl ⊗bl), for each 1 ≤j ≤k. • M (x′) = −D, M (x) = CB + D, M (y) = Im×m. Below, we give the main ideas for why this MΘ works, leaving the full proof to Appendix C. Since M (y) is the identity, the online learner’s task is to predict the differences yt −yt−1 as well as the derivative Θ, which we write here: ˆyt −yt−1 = (CB + D)xt −Dxt−1 + T −1 X i=1 C(Ai −Ai−1)Bxt−i = (CB + D)xt −Dxt−1 + T −1 X i=1 C d X l=1 αi l −αi−1 l  el ⊗el ! Bxt−i = (CB + D)xt −Dxt−1 + d X l=1 (cl ⊗bl) T −1 X i=1 µ(αl)(i) xt−i. (4) Notice that the inner sum is an inner product between each coordinate of the past inputs (xt, xt−1, . . . , xt−T ) with µ(αl) (or a convolution, viewed across the entire time horizon). The crux of our proof is that one can approximate µ(α) using a linear combination of the filters {φj}k j=1. Writing Z := ZT for short, notice that Z = Z 1 0 µ(α) ⊗µ(α) dα, since the (i, j) entry of the RHS is Z 1 0 (α −1)2αi+j−2 dα = 1 i + j −1 − 2 i + j + 1 i + j + 1 = Zij. What follows is a spectral bound for reconstruction error, relying on the low approximate rank of Z: Lemma 4.1. Choose any α ∈[0, 1]. Let ˜µ(α) be the projection of µ(α) onto the k-dimensional subspace of RT spanned by {φj}k j=1. Then, ∥µ(α) −˜µ(α)∥2 ≤ v u u t6 T X j=k+1 σj ≤O  c−k/ log T 0 p log T  , for an absolute constant c0 > 3.4. 6Write the eigendecomposition A = UΛU T . Then, the LDS with parameters ( ˆA, ˆB, ˆC, D, h0) := (Λ, BU, U T C, D, h0) makes the same predictions as the original, with ˆA diagonal. 7 By construction of M (j), MΘ ˜Xt replaces each µ(αl) in Equation (4) with its approximation ˜µ(αl). Hence we conclude that MΘ ˜Xt = yt−1 + (CB + D)xt −Dxt−1 + d X l=1 (cl ⊗bl) T −1 X i=1 ˜µ(αl)(i) xt−i = yt−1 + (ˆyt −yt−1) + ζt = ˆyt + ζt, letting {ζt} denote some residual vectors arising from discarding the subspace of dimension T −k. Theorem 3 follows by showing that these residuals are small, using Lemma 4.1: it turns out that ∥ζt∥is exponentially small in k/ log T, which implies the theorem. 4.2 From approximate relaxation to low regret Let Θ∗∈H denote the best LDS predictor, and let MΘ∗∈ ˆH be its image under the map from Theorem 3, so that total squared error of predictions MΘ∗˜Xt is within ε from that of Θ∗. Notice that the loss functions ft(M) def = ∥yt −M ˜Xt∥2 are quadratic in M, and thus convex. Algorithm 1 runs online gradient descent [Zin03] on these loss functions, with decision set M def = {M ∈Rm×k′ ∥M∥F ≤RM}. Let Dmax := supM,M ′∈M∥M −M ′∥F be the diameter of M, and Gmax := supM∈M, ˜ X∥∇ft(M)∥F be the largest norm of a gradient. We can invoke the classic regret bound: Lemma 4.2 (e.g. Thm. 3.1 in [Haz16]). Online gradient descent, using learning rate Dmax Gmax √ T , has regret RegretOGD(T) def = T X t=1 ft(Mt) −min M∈M T X t=1 ft(M) ≤2GmaxDmax √ T. To finish, it remains to show that Dmax and Gmax are small. In particular, since the gradients contain convolutions of the input by ℓ2 (not ℓ1) unit vectors, special care must be taken to ensure that these do not grow too quickly. These bounds are shown in Section D.2, giving the correct regret of Algorithm 1 in comparison with the comparator M ∗∈ˆH. By Theorem 3, M ∗competes arbitrarily closely with the best LDS in hindsight, concluding the theorem. Finally, we discuss why it is possible to relax the earlier assumption h0 = 0 on the initial hidden state. Intuitively, as more of the ground truth responses {yt} are revealed, the largest possible effect of the initial state decays. Concretely, in Section D.4, we prove that a comparator who chooses a nonzero h0 can only increase the regret by an additive ˜O(log2 T) in the online setting. 5 Experiments In this section, to highlight the appeal of our provable method, we exhibit two minimalistic cases where traditional methods for system identification fail, while ours successfully learns the system. Finally, we note empirically that our method seems not to degrade in practice on certain wellbehaved nonlinear systems. In each case, we use k = 25 filters, and a regularized follow-the-leader variant of Algorithm 1 (see Appendix B.2). 5.1 Synthetic systems: two hard cases for EM and SSID We construct two difficult systems, on which we run either EM or subspace identification7 (SSID), followed by Kalman filtering to obtain predictions. Note that our method runs significantly (>1000 times) faster than this traditional pipeline. In the first example (Figure 2(a), left), we have a SISO system (n = m = 1) and d = 2; all xt, ξt, and ηt are i.i.d. Gaussians, and B⊤= C = [1 1], D = 0. Most importantly, A = diag ([0.999, 0.5]) is ill-conditioned, so that there are long-term dependences between input and output. Observe that although EM and SSID both find reasonable guesses for the system’s dynamics, they turns out to be local optima. Our method learns to predict as well as the best possible LDS. 7Specifically, we use “Deterministic Algorithm 1” from page 52 of [VODM12]. 8 System 1: ill-conditioned SISO −200 −100 0 100 Time series (xt, yt) xt yt 0 100 200 300 400 500 10−3 10−1 101 103 Error ||ˆyt −yt||2 EM SSID ours ˆyt = yt−1 System 2: 10-dimensional MIMO −2 −1 0 1 xt(1) yt(1) 0 200 400 600 800 100010−4 10−2 100 102 EM SSID ours ˆyt = yt−1 (a) Two synthetic systems. For clarity, error plots are smoothed by a median filter. Left: Noisy SISO system with a high condition number; EM and SSID finds a bad local optimum. Right: High-dimensional MIMO system; other methods fail to learn any reasonable model of the dynamics. 0 200 400 600 800 1000 −0.5 0.0 0.5 (xt, yt, ˆyt) xt yt ˆyt (b) Forced pendulum, a physical simulation our method learns in practice, despite a lack of theory. Figure 2: Visualizations of Algorithm 1. All plots: blue = ours, yellow = EM, red = SSID, black = true responses, green = inputs, dotted lines = “guess the previous output” baseline. Horizontal axis is time. The second example (Figure 2(a), right) is a MIMO system (with n = m = d = 10), also with Gaussian noise. The transition matrix A = diag ([0, 0.1, 0.2, . . . , 0.9]) has a diverse spectrum, the observation matrix C has i.i.d. Gaussian entries, and B = In, D = 0. The inputs xt are random block impulses. This system identification problem is high-dimensional and non-convex; it is thus no surprise that EM and SSID consistently fail to converge. 5.2 The forced pendulum: a nonlinear, non-symmetric system We remark that although our algorithm has provable regret guarantees only for LDSs with symmetric transition matrices, it appears in experiments to succeed in learning some non-symmetric (even nonlinear) systems in practice, much like the unscented Kalman filter [WVDM00]. In Figure 2(b), we provide a typical learning trajectory for a forced pendulum, under Gaussian noise and random block impulses. Physical systems like this are widely considered in control and robotics, suggesting possible real-world applicability for our method. 6 Conclusion We have proposed a novel approach for provably and efficiently learning linear dynamical systems. Our online wave-filtering algorithm attains near-optimal regret in theory; and experimentally outperforms traditional system identification in both prediction quality and running time. Furthermore, we have introduced a “spectral filtering” technique for convex relaxation, which uses convolutions by eigenvectors of a Hankel matrix. We hope that this theoretical tool will be useful in tackling more general cases, as well as other non-convex learning problems. Acknowledgments We thank Holden Lee and Yi Zhang for helpful discussions. We especially grateful to Holden for a thorough reading of our manuscript, and for pointing out a way to tighten the result in Lemma C.1. 9 References [Aud14] Koenraad MR Audenaert. A generalisation of mirsky’s singular value inequalities. arXiv preprint arXiv:1410.4941, 2014. [BM02] Peter L Bartlett and Shahar Mendelson. Rademacher and gaussian complexities: Risk bounds and structural results. Journal of Machine Learning Research, 3(Nov):463– 482, 2002. [BT16] Bernhard Beckermann and Alex Townsend. On the singular values of matrices with displacement structure. arXiv preprint arXiv:1609.09494, 2016. [Cho83] Man-Duen Choi. Tricks or treats with the hilbert matrix. The American Mathematical Monthly, 90(5):301–312, 1983. [DHS11] John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning and stochastic optimization. The Journal of Machine Learning Research, 12:2121–2159, 2011. [GH96] Zoubin Ghahramani and Geoffrey E Hinton. Parameter estimation for linear dynamical systems. Technical report, Technical Report CRG-TR-96-2, University of Toronto, Deptartment of Computer Science, 1996. [Gr¨u82] F Alberto Gr¨unbaum. A remark on hilbert’s matrix. Linear Algebra and its Applications, 43:119–124, 1982. [Haz16] Elad Hazan. Introduction to online convex optimization. Foundations and Trends in Optimization, 2(3-4):157–325, 2016. [Hil94] David Hilbert. Ein beitrag zur theorie des legendre’schen polynoms. Acta mathematica, 18(1):155–159, 1894. [HMR16] Moritz Hardt, Tengyu Ma, and Benjamin Recht. Gradient descent learns linear dynamical systems. arXiv preprint arXiv:1609.05191, 2016. [HSC+16] Wenbing Huang, Fuchun Sun, Lele Cao, Deli Zhao, Huaping Liu, and Mehrtash Harandi. Sparse coding and dictionary learning with linear dynamical systems. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3938–3947, 2016. [Kal60] Rudolph Emil Kalman. A new approach to linear filtering and prediction problems. Journal of Basic Engineering, 82.1:35–45, 1960. [KV05] Adam Kalai and Santosh Vempala. Efficient algorithms for online decision problems. Journal of Computer and System Sciences, 71(3):291–307, 2005. [Lju98] Lennart Ljung. System identification: Theory for the User. Prentice Hall, Upper Saddle Riiver, NJ, 2 edition, 1998. [Lju02] Lennart Ljung. Prediction error estimation methods. Circuits, Systems and Signal Processing, 21(1):11–21, 2002. [LW94] Nick Littlestone and Manfred K. Warmuth. The weighted majority algorithm. Information and Computation, 108(2):212–261, 1994. [Mar10a] James Martens. Learning the linear dynamical system with asos. In Johannes Frnkranz and Thorsten Joachims, editors, Proceedings of the 27th International Conference on Machine Learning, pages 743–750. Omnipress, 2010. [Mar10b] James Martens. Learning the linear dynamical system with asos. In Proceedings of the 27th International Conference on Machine Learning, pages 743–750, 2010. [RG99] Sam Roweis and Zoubin Ghahramani. A unifying review of linear gaussian models. Neural computation, 11(2):305–345, 1999. 10 [Sch11] J Schur. Bemerkungen zur theorie der beschr¨ankten bilinearformen mit unendlich vielen ver¨anderlichen. Journal f¨ur die reine und Angewandte Mathematik, 140:1–28, 1911. [Sle78] David Slepian. Prolate spheroidal wave functions, fourier analysis, and uncertainty: The discrete case. Bell Labs Technical Journal, 57(5):1371–1430, 1978. [SS82] Robert H Shumway and David S Stoffer. An approach to time series smoothing and forecasting using the em algorithm. Journal of Time Series Analysis, 3(4):253–264, 1982. [VODM12] Peter Van Overschee and BL De Moor. Subspace Identification for Linear Systems. Springer Science & Business Media, 2012. [WVDM00] Eric A Wan and Rudolph Van Der Merwe. The unscented kalman filter for nonlinear estimation. In Adaptive Systems for Signal Processing, Communications, and Control Symposium 2000. AS-SPCC. The IEEE 2000, pages 153–158. IEEE, 2000. [Zin03] Martin Zinkevich. Online convex programming and generalized infinitesimal gradient ascent. In Proceedings of the 20th International Conference on Machine Learning, pages 928–936, 2003. 11
2017
61
7,130
Incorporating Side Information by Adaptive Convolution Di Kang Debarun Dhar Antoni B. Chan Department of Computer Science City University of Hong Kong {dkang5-c, ddhar2-c}@my.cityu.edu.hk, abchan@cityu.edu.hk Abstract Computer vision tasks often have side information available that is helpful to solve the task. For example, for crowd counting, the camera perspective (e.g., camera angle and height) gives a clue about the appearance and scale of people in the scene. While side information has been shown to be useful for counting systems using traditional hand-crafted features, it has not been fully utilized in counting systems based on deep learning. In order to incorporate the available side information, we propose an adaptive convolutional neural network (ACNN), where the convolution filter weights adapt to the current scene context via the side information. In particular, we model the filter weights as a low-dimensional manifold within the high-dimensional space of filter weights. The filter weights are generated using a learned “filter manifold” sub-network, whose input is the side information. With the help of side information and adaptive weights, the ACNN can disentangle the variations related to the side information, and extract discriminative features related to the current context (e.g. camera perspective, noise level, blur kernel parameters). We demonstrate the effectiveness of ACNN incorporating side information on 3 tasks: crowd counting, corrupted digit recognition, and image deblurring. Our experiments show that ACNN improves the performance compared to a plain CNN with a similar number of parameters. Since existing crowd counting datasets do not contain ground-truth side information, we collect a new dataset with the ground-truth camera angle and height as the side information. 1 Introduction Computer vision tasks often have side information available that is helpful to solve the task. Here we define “side information” as auxiliary metadata that is associated with the main input, and that affects the appearance/properties of the main input. For example, the camera angle affects the appearance of a person in an image (see Fig. 1 top). Even within the same scene, a person’s appearance changes as they move along the ground-plane, due to changes in the relative angles to the camera sensor. Most deep learning methods ignore the side information, since if given enough data, a sufficiently large deep network should be able to learn internal representations that are invariant to the side information. In this paper, we explore how side information can be directly incorporated into deep networks so as to improve their effectiveness. Our motivating application is crowd counting in images, which is challenging due to complicated backgrounds, severe occlusion, low-resolution images, perspective distortion, and different appearances caused by different camera tilt angles. Recent methods are based on crowd density estimation [1], where each pixel in the crowd density map represents the fraction of people in that location, and the crowd count is obtained by integrating over a region in the density map. The current state-of-theart uses convolutional neural networks (CNN) to estimate the density maps [2–4]. Previous works have also shown that using side information, e.g., the scene perspective, helps to improve crowd counting accuracy [5, 6]. In particular, when extracting hand-crafted features (e.g., edge and texture statistics) [5–9] use scene perspective normalization, where a “perspective weight” is applied at each 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. camera angle z images 5x5 filter -10° -20° -30° -40° -50° -65° z=-10° z=-20° z=-30° z=-40° z=-50° z=-65° filter space ℝ5x5 filter manifold Figure 1: (top) changes in people’s appearance due to camera angle, and the corresponding changes in a convolution filter; (bottom) the filter manifold as a function of the camera angle. Best viewed in color. ∗ input maps output maps FC, FC, …, FC convolution auxiliary input filter weights + bias filter manifold network 𝑧 𝑥 ℎ= 𝑓(𝑥∗𝑔𝑧; 𝑤) 𝑔𝑧; 𝑤 Figure 2: The adaptive convolutional layer with filter manifold network (FMN). The FMN uses the auxiliary input to generate the filter weights, which are then convolved with the input maps. pixel location during feature extraction, to adjust for the scale of the object at that location. To handle scale variations, typical CNN-based methods resize the input patch [2] based on the perspective weight, or extract features at different scales via multiple columns [3] or a pyramid of input patches [4]. However, incorporating other types of side information into the CNN is not as straightforward. As a result, all the difficulties due to various contexts, including different backgrounds, occlusion, perspective distortion and different appearances caused by different camera angles are entangled, which may introduce an extra burden on the CNNs during training. One simple solution is to add an extra image channel where each pixel holds the side information [10], which is equivalent to using 1st-layer filter bias terms that change with the side information. However, this may not be the most effective solution when the side information is a high-level property with a complex relationship with the image appearance (e.g., the camera angle). Our solution in this paper is to disentangle the context variations explicitly in the CNN by modifying the filter weights adaptively. We propose an adaptive CNN (ACNN) that uses side information (e.g., the perspective weight) as an auxiliary input to adapt the CNN to different scene contexts (e.g., appearance changes from high/low angle perspectives, and scale changes due to distance). Specifically, we consider the filter weights in each convolutional layer as points on a low-dimensional manifold, which is modeled using a sub-network where the side information is the input and the filter weights are the outputs. The filter manifold is estimated during training, resulting in different convolution filters for each scene context, which disentangles the context variations related to the side information. In the ACNN, the convolutional layers focus only on those features most suitable for the current context specified by the side information, as compared to traditional CNNs that use a fixed set of filters over all contexts. In other words, the feature extractors are tuned for each context. We test the effectiveness of ACNN at incorporating side information on 3 computer vision applications. First, we perform crowd counting from images using an ACNN with the camera parameters (perspective value, or camera tilt angle and height) as side information. Using the camera parameters as side information, ACNN can perform cross-scene counting without a fine-tuning stage. We collect a new dataset covering a wide range of angles and heights, containing people from different viewpoints. Second, we use ACNN for recognition of digit images that are corrupted with salt-and-pepper noise, where the noise level is the side information. Third, we apply ACNN to image deburring, where the blur kernel parameters are the side information. A single ACNN can be trained to deblur images for any setting of the kernel parameters. In contrast, using a standard CNN would require training a separate CNN for each combination of kernel parameters, which is costly if the set of parameter combinations is large. In our experiments, we show that ACNN can more effectively use the side information, as compared to traditional CNNs with similar number of parameters – moving parameters from static layers to adaptive layers yields stronger learning capability and adaptability. The contributions of this paper are three-fold: 1) We propose a method to incorporate the side information directly into CNN by using an adaptive convolutional layer whose weights are generated via a filter manifold sub-network with side information as the input; 2) We test the efficacy of ACNN on a variety of computer vision applications, including crowd counting, corrupted digit recognition, and non-blind image deblurring, and show that ACNN is more effective than traditional CNNs with 2 similar number of parameters. 3) We collect a new crowd counting dataset covering a wide range of viewpoints and its corresponding side information, i.e. camera tilt angle and camera height. 2 Related work 2.1 Adapting neural networks The performance of a CNN is affected if the test set is not from the same data distribution as the training set [2]. A typical approach to adapting a CNN to new data is to select a pre-trained CNN model, e.g. AlexNet [11], VGG-net [12], or ResNet [13] trained on ImageNet, and then fine-tune the model weights for the specific task. [2] adopts a similar strategy – train the model on the whole dataset and then fine-tune using a subset of image patches that are similar to the test scene. Another approach is to adapt the input data cube so that the extracted features and the subsequent classifier/regressor are better matched. [14] proposes a trainable “Spatial Transformer” unit that applies an image transformation to register the input image to a standard form before the convolutional layer. The functional form of the image transformation must be known, and the transformation parameters are estimated from the image. Because it operates directly on the image, [14] is limited to 2D image transformations, which work well for 2D planar surfaces in an image (e.g., text on a flat surface), but cannot handle viewpoint changes of 3D objects (e.g. people). In contrast, our ACNN changes the feature extraction layers based on the current 3D viewpoint, and does not require the geometric transformation to be known. Most related to our work are dynamic convolution [15] and dynamic filter networks [16], which use the input image to dynamically generate the filter weights for convolution. However, their purpose for dynamically generating filters is quite different from ours. [15, 16] focus on image prediction tasks (e.g., predicting the next frame from the previous frames), and the dynamically-generated filters are mainly used to transfer a pixel value in the input image to a new position in the output image (e.g., predicting the movement of pixels between frames). These input-specific filters are suitable for low-level tasks, i.e. the input and the output are both in the same space (e.g., images). But for high-level tasks, dramatically changing features with respect to its input is not helpful for the end-goal of classification or regression. In contrast, our purpose is to include side information into supervised learning (regression and classification), by learning how the discriminative image features and corresponding filters change with respect to the side information. Hence, in our ACNN, the filter weights are generated from an auxiliary input corresponding to the side information. HyperNetworks [17] use relaxed weight-sharing between layers/blocks, where layer weights are generated from a low-dimensional linear manifold. This can improve the expressiveness of RNNs, by changing the weights over time, or reduce the number of learnable parameters in CNNs, by sharing weight bases across layers. Specifically, for CNNs, the weight manifold of the HyperNetwork is shared across layers, and the inputs/embedding vectors of the HyperNetwork are independently learned for every layer during training. The operation of ACNNs is orthogonal to HyperNetworks - in ACNN, the weight manifold is trained independently for each layer, and the input/side information is shared across layers. In addition, our goal is to incorporate the available side information to improve the performance of the CNN models, which is not considered in [17]. Finally, one advantage of [14–17] is that no extra information or label is needed. However, this also means they cannot effectively utilize the available side information, which is common in various computer vision tasks and has been shown to be helpful for traditional hand-crafted features [5]. 2.2 Crowd density maps [1] proposes the concept of an object density map whose integral over any region equals to the number of objects in that region. The spatial distribution of the objects is preserved in the density map, which also makes it useful for detection [18, 19] and tracking [20]. Most of the recent state-of-the-art object counting algorithms adopt the density estimation approach [2–4, 8, 21]. CNN-based methods [2–4] show strong cross-scene prediction capability, due to the learning capacity of CNNs. Specifically, [3] uses a multi-column CNN with different receptive field sizes in order to encourage different columns to capture features at different scales (without input scaling or explicit supervision), while [4] uses a pyramid of input patches, each sent to separate sub-network, to consider multiple scales. [2] introduces an extra fine-tuning stage so that the network can be better adapted to a new scene. In contrast to [2, 3], we propose to use the existing side information (e.g. perspective weight) as an input to adapt the convolutional layers to different scenes. With the adaptive convolutional layers, 3 only the discriminative features suitable for the current context are extracted. Our experiments show that moving parameters from static layers to adaptive layers yields stronger learning capability. 2.3 Image deconvolution Existing works [22–24] demonstrate that CNNs can be used for image deconvolution and restoration. With non-blind deblurring, the blur kernel is known and the goal is to recover the original image. [23] concatenate a deep deconvolution CNN and a denoising CNN to perform deblurring and artifact removal. However, [23] requires a separate network to be trained for each blur kernel family and kernel parameter. [24] trains a multi-layer perceptron to denoise images corrupted by additive white Gaussian (AWG) noise. They incorporate the side information (AWG standard deviation) by simply appending it to the vectorized image patch input. In this paper, we use the kernel parameter as an auxiliary input, and train a single ACNN for a blur kernel family (for all its parameter values), rather than for each parameter separately. During prediction, the “filter-manifold network” uses the auxiliary input to generate the appropriate deblurring filters, without the need for additional training. 3 Adaptive CNN In this section, we introduce the adaptive convolutional layer and the ACNN. 3.1 Adaptive convolutional layer Consider a crowd image dataset containing different viewpoints of people, and we train a separate CNN to predict the density map for each viewpoint. For two similar viewpoints, we expect that the two trained CNNs have similar convolution filter weights, as a person’s appearance varies gradually with the viewpoint (see Fig. 1 top). Hence, as the viewpoint changes smoothly, the convolution filters weights also change smoothly, and thus sweep a low-dimensional manifold within the highdimensional space of filter weights (see Fig. 1 bottom). Following this idea, we use an adaptive convolutional layer, where the convolution filter weights are the outputs of a separate “filter-manifold network” (FMN, see Fig. 2). In the FMN, the side information is an auxiliary input that feeds into fully-connected layers with increasing dimension (similar to the decoder stage of an auto-encoder) with the final layer outputting the convolution filter weights. The FMN output is reshaped into a 4D tensor of convolution filter weights (and bias), and convolved with the input image. Note that in contrast to the traditional convolutional layer, whose filter weights are fixed during the inference stage, the filter weights of an adaptive convolutional layer change with respect to the auxiliary input. Formally, the adaptive convolutional layer is given by h = f(x ∗g(z; w)), where z is the auxiliary input, g(·; w) is the filter manifold network with tunable weights w, x is the input image, and f(·) is the activation function.1 Training the adaptive convolutional layer involves updating the FMN weights w, thus learning the filter manifold as a function of the auxiliary input. During inference, the FMN interpolates along the filter manifold using the auxiliary input, thus adapting the filter weights of the convolutional layer to the current context. Hence adaptation does not require fine-tuning or transfer learning. 3.2 Adaptive CNN for crowd counting We next introduce the ACNN for crowd counting. Density map estimation is not as high-level a task as recognition. Since the upper convolutional layers extract more abstract features, which are not that helpful according to both traditional [1, 5] and deep methods [2, 3], we will not use many convolutional layers. Fig. 3 shows our ACNN for density map estimation using two convolutional stages. The input is an image patch, while the output is the crowd density at the center of the patch. All the convolutional layers use the ReLU activation, and each convolutional layer is followed by a local response normalization layer [11] and a max pooling layer. The auxiliary input for the FMN is the perspective value for the image patch in the scene, or the camera tilt angle and camera height. For the fully-connected stage, we use multi-task learning to improve the training of the feature extractors [2, 25–27]. In particular, the main regression task predicts the crowd density value, while an auxiliary classification task predicts the number of people in the image patch. The adaptive convolutional layer has more parameters than a standard convolutional layer with the same number of filters and the same filter spatial size – the extra parameters are in the layers of the 1To reduce clutter, here we do not show the bias term for the convolution. 4 conv2 (32x9x9) FC3 (1) FC2 (81) FC1 (512) output density auxiliary classification task FC5 (15) FC4 (81) ∗ input image patch (1x33x33) conv1 (32x17x17) auxiliary input: perspective value (1) filter weights (32x1x5x5)+32 (10) (40) (832) FMN1 (10) (40) (25632) FMN2 ∗ filter weights (32x32x5x5)+32 (1) (1) Figure 3: The architecture of our ACNN with adaptive convolutional layers for crowd density estimation. Layer CNN ACNN FMN1 – 34,572 (832) conv1 1,664 (64) 0 (32) FMN2 – 1,051,372 (25,632) conv2 102,464 (64) 0 (32) FC1 2,654,720 (512) 1,327,616 (512) FC2 41,553 (81) 41,553 (81) FC3 82 (1) 82 (1) FC4 419,985 (81) 210,033 (81) FC5 1,312 (15) 1,312 (15) total 3,221,780 2,666,540 Table 1: Comparison of number of parameters in each layer of the ACNN in Fig. 3 and an equivalent CNN. The number in parenthesis is the number of convolution filters, or the number of outputs of the FMN/fully-connected (FC) layer. FMN. However, since the filters themselves adapt to the scene context, an ACNN can be effective with fewer feature channels (from 64 to 32), and the parameter savings can be moved to the FMN (e.g. see Table 1). Hence, if side information is available, a standard CNN can be converted into an ACNN with a similar number of parameters, but with better learning capability. We verify this property in the experiments. Since most of the parameters of the FMN are in its last layer, the FMN has O(LF) parameters, where F is the number of filter parameters in the convolution layer and L is the size of the last hidden layer of the FMN. Hence, for a large number of channels (e.g., 128 in, 512 out), the FMN will be extremely large. One way to handle more channels is to reduce the number of parameters in the FMN, by assuming that sub-blocks in the final weight matrix of the FMN form a manifold, which can be modeled by another FMN (i.e., an FMN-in-FMN). Here, the auxiliary inputs for the sub-block FMNs are generated from another network whose input is the original auxiliary input. 3.3 Adaptive CNN for image deconvolution Our ACNN for image deconvolution is based on the deconvolution CNN proposed in [23]. The ACNN uses the kernel blur parameter (e.g., radius of the disk kernel) as the side information, and consists of three adaptive convolutional layers (see Fig. 4). The ACNN uses 12 filter channels in the first 2 layers, which yields an architecture with similar number of parameters as the standard CNN with 38 filters in [23]. The ACNN consists of two long 1D adaptive convolutional layers: twelve 121×1 vertical 1D filters, followed by twelve 1×121 horizontal 1D filters. The result is passed through a 1×1 adaptive convolutional layer to fuse all the feature maps. The input is the blurred image and the output target is the original image. We use leaky ReLU activations [28] for the first two convolutional layers, and sigmoid activation for the last layer to produce a bounded output as image. Batch normalization layers [29] are used after the convolutional layers. During prediction, the FMN uses kernel parameter auxiliary input to generate the appropriate deblurring filters, without the need for additional training. Hence, the two advantages of using ACNN are: 1) only one network is needed for each blur kernel family, which is useful for kernels with too many parameter combinations to enumerate; 2) by interpolating along the filter manifold, ACNN can work on kernel parameters unseen in the training set. 4 Experiments To show their potential, we evaluate ACNNs on three tasks: crowd counting, digit recognition with salt-and-pepper noise, and image deconvolution (deblurring). In order to make fair comparisons, we compare our ACNN with standard CNNs using traditional convolutional layers, but increase the number of filter channels in the CNN so that they have similar total number of parameters as the ACNN. We also test a CNN with side information included as an extra input channel(s) (denoted as CNN-X), where the side information is replicated in each pixel of the extra channel, as in [10]. For ACNN, each adaptive convolution layer has its own FMN, which is a standard MLP with two hidden layers and a linear output layer. The size of the FMN output layer is the same as the number of filter parameters in its associated convolution layer, and the size of the last hidden layer (e.g., 40 in Fig. 3) was selected so that the ACNN and baseline CNN have roughly equal number of parameters. 5 ∗ input image (3x184x184) auxiliary input: blurring kernel parameter filter weights (12x3x121x1) +12 (4) (8) (4368) FMN1 (4) (8) (17486) FMN2 ∗ filter weights (12x12x1x121) +12 (1) (1) (4) (8) (36) ∗ filter weights (3x12x1x1) (1) FMN3 conv1 (12x184x184) conv2 (12x184x184) output image (3x184x184) Figure 4: ACNN for image deconvolution. The auxiliary input is the radius r of the disk blurring kernel. Method MAE MESA [1] 1.70 Regression forest [21] 1.70 RR [8] 1.24 CNN-patch+RR [2] 1.70 MCNN [3] 1.32 CNN 1.26 CNN-X 1.20 CNN (normalized patch) 1.26 ACNN-v1 1.23 ACNN-v2 1.14 ACNN-v3 0.96 Table 2: Comparison of mean absolute error (MAE) for counting with crowd density estimation methods on the UCSD “max” split. R1 (6.7-13.2) R2 (13.2-17.7) R3 (17.6-22.1) Figure 5: UCSD dataset with 3 bar regions. The range of perspective values are shown in parentheses. Method R1 R2 (unseen) R3 Avg. CNN 1.83 1.06 0.62 1.17 CNN-X 1.33 1.18 0.61 1.04 ACNN-v1 1.47 0.95 0.59 1.00 ACNN-v2 1.22 0.91 0.55 0.89 ACNN-v3 1.15 1.02 0.63 0.93 Table 3: Comparison of MAE on 3 bar regions on the UCSD “max” split. 4.1 Crowd counting experiments For crowd counting, we use two crowd counting datasets: the popular UCSD crowd counting dataset, and our newly collected dataset with camera tilt angle and camera height as side information. 4.1.1 UCSD dataset Refer to Fig. 3 for the ACNN architecture used for the UCSD dataset. The image size is 238×158, and 33×33 patches are used. We test several variations of the ACNN: v1) only the first convolutional layer is adaptive, with 64 filters for both of the convolutional layers; v2) only the last convolutional layer is adaptive, with 64 filters for the first convolutional layer and 30 filters for its second convolutional layer; v3) all the convolutional layers are adaptive, with 32 filters for all layers, which provides maximum adaptability. The side information (auxiliary input) used for the FMN is the perspective value. For comparison, we also test a plain CNN and CNN-X with a similar architecture but using standard convolutional layers with 64 filters in each layer, and another plain CNN with input patch size normalization introduced in [2] (i.e., resizing larger patches for near-camera regions). The numbers of parameters are shown in Table 1. The count predictions in the region-of-interest (ROI) are evaluated using the mean absolute error (MAE) between the predicted count and the ground-truth. We first use the widely adopted protocol of “max” split, which uses 160 frames (frames 601:5:1400) for training, and the remaining parts (frames 1:600, 1401:2000) for testing. The results are listed in Table 2. Our ACNN-v3, using two adaptive convolutional layers, offers maximum adaptability and has the lowest error (0.96 MAE), compared to the equivalent plain CNN and the reference methods. While CNN-X reduces the error compared to CNN, CNN-X still has larger error than ACNN. This demonstrates that the FMN of ACNN is better at incorporating the side information. In addition, using simple input patch size normalization does not improve the performance as effectively as ACNN. Examples of the learned filter manifolds are shown in Fig. 6. We also tested using 1 hidden layer in the FMN, and obtained worse errors for each version of ACNN (1.74, 1.15, and 1.20, respectively). Using only one hidden layer limits the ability to well model the filter manifold. In the next experiment we test the effect of the side information within the same scene. The ROI of UCSD is further divided into three bar regions of the same height (see Fig. 5). The models are trained only on R1 and R3 from the training set, and tested on all three regions of the test set separately. The results are listed in Table 3. After disentangling the variations due to perspective value, the performance on R1 has been significantly improved because the ACNN uses the context information to distinguish it from the other regions. Perspective values within R2 are completely unseen during training, but our ACNN still gives a comparable or slightly better performance than CNN, which demonstrates that the FMN can smoothly interpolate along the filter manifold. 6 6.7 · · · · · · 9.7 · · · · · · 12.6· · · · · · 15.5· · · · · · 18.5· · · · · · 21.4 Figure 6: Examples of learned filter manifolds for the 2nd convolutional layer. Each row shows one filter as a function of the auxiliary input (perspective weight), shown at the top. Both the amplitude and patterns change, which shows the adaptability of the ACNN. Method MAE LBP+RR [2, 3] 23.97 MCNN [3] 8.80 CNN 8.72 CNN-X (AH) 9.05 CNN-X (AHP) 8.45 ACNN (AH) 8.35 ACNN (AHP) 8.00 Table 4: Counting results on CityUHK-X, the new counting dataset with side information. Image Predicted density map Image Predicted density map -20.4◦, 6.1m 92.44 (1.57) -29.8◦, 4.9m 18.22 (2.47) -39.8◦, 6.7m 28.99 (0.66) -55.2◦, 11.6m 21.71 (1.24) Figure 7: Examples of the predicted density map by our ACNN on the new CityUHK-X dataset. The extrinsic parameters and predicted count (absolute error in parenthesis) is shown above the images. 4.1.2 CityUHK-X: new crowd dataset with extrinsic camera parameters The new crowd dataset “CityUHK-X” contains 55 scenes (3,191 images in total), covering a camera tilt angle range of [-10◦, -65◦] and a height range of [2.2, 16.0] meters. The training set consists of 43 scenes (2,503 images; 78,592 people), and the test set comprises 12 scenes (688 images; 28,191 people). More information and demo images can be found in the supplemental. The resolution of the new dataset is 512×384, and 65×65 patches are used. The ACNN for this dataset contains three convolutional and max-pooling layers, resulting in the same output feature map size after the convolutional stage as in the ACNN for UCSD. The three adaptive convolutional layers use 40, 40 and 32 filters of size 5×5 each. The side information (auxiliary inputs) are camera tilt angle and camera height (denoted as “AH”), and the camera tilt angle, camera height, and perspective value (denoted as “AHP”). The baseline plain CNN and CNN-X use 64 filters of size 5×5 for all three convolutional layers. Results for ACNN, the plain CNN and CNN-X, and multi-column CNN (MCNN) [3] are presented in Table 4. The plain CNN and MCNN [3], which do not use side information, obtain similar results. Using side information with ACNN decreases the MAE, compared to the plain CNN and CNN-X, with more side information improving the results (AHP vs. AH). Fig. 7 presents example results. 4.2 Digit recognition with salt-and-pepper noise In this experiment, the task is to recognize handwritten digits that are corrupted with different levels of salt-and-pepper noise. The side information is the noise level. We use the MNIST handwritten digits dataset, which contains 60,000 training and 10,000 test examples. We randomly add salt-and-pepper noise (half salt and half pepper), on the MNIST images. Nine noise levels are used on the original MNIST training set from 0% to 80% with an interval of 10%, with the same number of images for each noise level, resulting in a training set of 540,000 samples. Separate validation and test sets, both containing 90,000 samples, are generated from the original MNIST test set. We test our ACNN with the noise level as the side information, as well as the plain CNN and CNN-X. We consider two architectures: two or four convolutional layers (2-conv or 4-conv) followed by 7 Architecture No. Conv. Filters Error Rate No. Parameters CNN 2-conv 32 + 32 8.66% 113,386 CNN-X 2-conv 32 + 32 8.49% (8.60%) 113,674 ACNN 2-conv 32 + 26 7.55% (7.64%) 105,712 CNN 4-conv 32 + 32 + 32 + 32 3.58% 131,882 CNN-X 4-conv 32 + 32 + 32 + 32 3.57% (3.64%) 132,170 ACNN 4-conv 32 + 32 + 32 + 26 2.92% (2.97%) 124,208 Table 5: Digit recognition with salt-and-pepper noise, where the noise level is the side information. The number of filters for each convolutional layer and total number of parameters are listed. In the Error Rate column, the parenthesis shows the error when using the estimated side information rather than the ground-truth. Arch-filters training set r r=3 r=5 r=7 r=9 r=11 all seen r unseen r blurred image — 23.42 21.90 20.96 20.28 19.74 21.26 — — CNN [23] {3, 7, 11} +0.55 -0.25 +0.49 +0.69 +0.56 +0.41 +0.53 +0.22 CNN-X {3, 7, 11} +0.88 -0.70 +1.65 +0.47 +1.86 +0.83 +1.46 -0.12 ACNN {3, 7, 11} +0.77 +0.06 +1.17 +0.94 +1.28 +0.84 +1.07 +0.50 CNN-X (blind) {3, 7, 11} +0.77 -0.77 +1.23 +0.25 +0.98 +0.49 +0.99 -0.26 ACNN (blind) {3, 7, 11} +0.76 -0.04 +0.70 +0.80 +1.13 +0.67 +0.86 +0.38 CNN [23] {3, 5, 7, 9, 11} +0.28 +0.45 +0.62 +0.86 +0.59 +0.56 +0.56 — CNN-X {3, 5, 7, 9, 11} +0.99 +1.38 +1.53 +1.60 +1.55 +1.41 +1.41 — ACNN {3, 5, 7, 9, 11} +0.71 +0.92 +1.00 +1.28 +1.22 +1.03 +1.03 — CNN-X (blind) {3, 5, 7, 9, 11} +0.91 +1.06 +0.81 +1.12 +1.24 +1.03 +1.03 — ACNN (blind) {3, 5, 7, 9, 11} +0.66 +0.79 +0.64 +1.12 +1.04 +0.85 +0.85 — Table 6: PSNRs for image deconvolution experiments. The PSNR for the blurred input image is in the first row, while the other rows are the change in PSNR relative to that of the blurred input image. Blind means the network takes estimated auxiliary value (disk radius) as the side information. two fully-connected (FC) layers.2 For ACNN, only the 1st convolutional layer is adaptive. All convolutional layers use 3×3 filters. All networks use the same configuration for the FC layers, one 128-neuron layer and one 10-neuron layer. ReLU activation is used for all layers, except the final output layer which uses soft-max. Max pooling is used after each convolutional layer for the 2-conv network, or after the 2nd and 4th convolutional layers for the 4-conv network. The classification error rates are listed in Table 5. Generally, adding side information as extra input channel (CNN-X) decreases the error, but the benefit diminishes as the baseline performance increases – CNN-X 4-conv only decreases the error rate by 0.01% compared with CNN. Using ACNN to incorporate the side information can improve the performance more significantly. In particular, for ACNN 2-conv, the error rate decreases 0.94% (11% relatively) from 8.49% to 7.55%, while the error rate decreases 0.65% (18% relatively) from 3.57% to 2.92% for ACNN 4-conv. We also tested the ACNN when the noise level is unknown – The noise level is estimated from the image, and then passed to the ACNN. To this end, a 4-layer CNN (2 conv. layers, 1 max-pooling layer and 2 FC layers) is trained to predict the noise level from the input image. The error rate increases slightly when using the estimated noise level (e.g., by 0.05% for the ACNN 4-conv, see Table 5). More detailed setting of the networks can be found in the supplemental. 4.3 Image deconvolution In the final experiment, we use ACNN for image deconvolution (deblurring) where the kernel blur parameter is the side information. We test on the Flickr8k [31] dataset, and randomly select 5000 images for training, 1400 images for validation, and another 1600 images for testing. The images were blurred uniformly using a disk kernel, and then corrupted with additive Gaussian noise (AWG) and JPEG compression as in [23], which is the current state-of-the-art for non-blind deconvolution using deep learning. We train the models with images blurred with different sets of kernel radii r ∈{3, 5, 7, 9, 11}. The test set consists of images blurred with all r ∈{3, 5, 7, 9, 11}. The evaluation is based on the peak signal-to-noise ratio (PSNR) between the deconvolved image and the original image, relative to the PSNR of the blurred image. The results are shown in Table 6 using different sets of radii for the training set. First, when trained on the full training set, ACNN almost doubles the increase in PSNR, compared to the CNN (+1.03dB vs. +0.56dB). Next, we consider a reduced training set with radii r ∈{3, 7, 11}, and ACNN again doubles the increase in PSNR (+0.84dB vs. +0.41dB). The performance of ACNN on the unseen radii r ∈{5, 9} is better than CNN, which demonstrates the capability of ACNN to interpolate along 2 On the clean MNIST dataset, the 2-conv and 4-conv CNN architectures achieve 0.81% and 0.69% error, while the current state-of-the-art is ∼0.23% error [30]. 8 the filter manifold for unseen auxiliary inputs. Interestingly, CNN-X has higher PSNR than ACNN on seen radii, but lower PSNR on unseen radii. CNN-X cannot well handle interpolation between unseen aux inputs, which shows the advantage of explicitly modeling the filter manifold. We also test CNN-X and ACNN for blind deconvolution, where we estimate the kernel radius using manually-crafted features and random forest regression (see supplemental). For the blind task, the PSNR drops for CNN-X (0.38 on r ∈{3, 5, 7, 9, 11} and 0.34 on r ∈{3, 7, 11}) are larger than ACNN (0.18 and 0.17), which means CNN-X is more sensitive to the auxiliary input. Example learned filters are presented in Fig. 8, and Fig. 9 presents examples of deblurred images. Deconvolved images using CNN are overly-smoothed since it treats images blurred by all the kernels uniformly. In contrast, the ACNN result has more details and higher PSNR. On this task, CNN-X performs better than ACNN on the seen radii, most likely because the relationship between the side information (disk radius) and the main input (sharp image) is not complicated and deblurring is a low-level task. Hence, incorporating the side information directly into the filtering calculations (as an extra channel) is a viable solution3. In contrast, for the crowd counting and corrupted digit recognition tasks, the relationship between the side information (camera angle/height or noise level) and the main input is less straightforward and not deterministic, and hence the more complex FMN is required to properly adapt the filters. Thus, the adaptive convolutions are not universally applicable, and CNN-X could be used in some situations where there is a simple relationship between the auxiliary input and the desired filter output. 0 20 40 60 80 100 120 1.5 1.0 0.5 0.0 0.5 1.0 1.5 0 20 40 60 80 100 120 aux=3 aux=5 aux=7 aux=9 aux=11 1-D filter parameters parameter weights Figure 8: Two examples of filter manifolds for image deconvolution. The y-axis is the filter weight, and x-axis is location. The auxiliary input is the disk kernel radius. Both the amplitude and the frequency can be adapted. (a) Original (target) (b) Blurred (input) (c) CNN [23] (d) ACNN PSNR=24.34 PSNR=25.30 PSNR=26.04 Figure 9: Image deconvolution example: (a) original image; (b) blurred image with disk radius of 7; deconvolved images using (c) CNN and (d) our ACNN. 5 Conclusion In this paper, we propose an adaptive convolutional neural network (ACNN), which employs the available side information as an auxiliary input to adapt the convolution filter weights. The ACNN can disentangle variations related to the side information, and extract features related to the current context. We apply ACNN to three computer vision applications: crowd counting using either the camera angle/height and perspective weight as side information, corrupted digit recognition using the noise level as side information, and image deconvolution using the kernel parameter as side information. The experiments show that ACNN can better incorporate high-level side information to improve performance, as compared to using simple methods such as including the side information as an extra input channel. The placement of the adaptive convolution layers is important, and should consider the relationship between the image content and the aux input, i.e., how the image contents changes with respect to the auxiliary input. For example, for counting, the auxiliary input indicates the amount of perspective distortion, which geometrically transforms the people’s appearances, and thus adapting the 2nd layer is more helpful since changes in object configuration are reflected in mid-level features. In contrast, salt-and-pepper-noise has a low-level (local) effect on the image, and thus adapting the first layer, corresponding to low-level features, is sufficient. How to select the appropriate convolution layers for adaptation is interesting future work. 3The extra channel is equivalent to using an adaptive bias term for each filter in the 1st convolutional layer. 9 Acknowledgments The work described in this paper was supported by a grant from the Research Grants Council of the Hong Kong Special Administrative Region, China (Project No. [T32-101/15-R]), and by a Strategic Research Grant from City University of Hong Kong (Project No. 7004682). We gratefully acknowledge the support of NVIDIA Corporation with the donation of the Tesla K40 GPU used for this research. References [1] V. Lempitsky and A. Zisserman, “Learning To Count Objects in Images,” in NIPS, 2010. 1, 3, 4, 6 [2] C. Zhang, H. Li, X. Wang, and X. Yang, “Cross-scene Crowd Counting via Deep Convolutional Neural Networks,” in CVPR, 2015. 1, 2, 3, 4, 6, 7 [3] Y. Zhang, D. Zhou, S. Chen, S. Gao, and Y. Ma, “Single-Image Crowd Counting via Multi-Column Convolutional Neural Network,” in CVPR, 2016. 2, 3, 4, 6, 7 [4] D. Onoro-Rubio and R. J. López-Sastre, “Towards perspective-free object counting with deep learning,” in ECCV, 2016. 1, 2, 3 [5] A. B. Chan, Z.-S. J. Liang, and N. Vasconcelos, “Privacy preserving crowd monitoring: Counting people without people models or tracking,” in CVPR. IEEE, 2008, pp. 1–7. 1, 3, 4 [6] A. B. Chan and N. Vasconcelos, “Counting people with low-level features and bayesian regression,” IEEE Trans. Image Process., 2012. 1 [7] ——, “Bayesian poisson regression for crowd counting,” in ICCV, 2009. [8] C. Arteta, V. Lempitsky, J. A. Noble, and A. Zisserman, “Interactive Object Counting,” in ECCV, 2014. 3, 6 [9] H. Idrees, I. Saleemi, C. Seibert, and M. Shah, “Multi-source multi-scale counting in extremely dense crowd images,” in CVPR, 2013. 1 [10] M. Gharbi, G. Chaurasia, S. Paris, and F. Durand, “Deep joint demosaicking and denoising,” ACM Transactions on Graphics (TOG), 2016. 2, 5 [11] A. Krizhevsky, I. Sutskever, and G. E. Hinton, “Imagenet classification with deep convolutional neural networks,” in NIPS, 2012. 3, 4 [12] K. Simonyan and A. Zisserman, “Very Deep Convolutional Networks for Large-Scale Image Recognition,” in ICLR, 2015. 3 [13] K. He, X. Zhang, S. Ren, and J. Sun, “Deep Residual Learning for Image Recognition,” in CVPR, 2016. 3 [14] M. Jaderberg, K. Simonyan, A. Zisserman, and K. Kavukcuoglu, “Spatial transformer networks,” in NIPS, 2015, pp. 2017–2025. 3 [15] B. Klein, L. Wolf, and Y. Afek, “A Dynamic Convolutional Layer for short range weather prediction,” in CVPR, 2015. 3 [16] B. De Brabandere, X. Jia, T. Tuytelaars, and L. Van Gool, “Dynamic filter networks,” in NIPS, 2016. 3 [17] D. Ha, A. Dai, and Q. V. Le, “HyperNetworks,” in ICLR, 2017. 3 [18] Z. Ma, L. Yu, and A. B. Chan, “Small Instance Detection by Integer Programming on Object Density Maps,” in CVPR, 2015. 3 [19] D. Kang, Z. Ma, and A. B. Chan, “Beyond counting: Comparisons of density maps for crowd analysis tasks-counting, detection, and tracking,” arXiv preprint arXiv:1705.10118, 2017. 3 [20] M. Rodriguez, I. Laptev, J. Sivic, and J.-Y. Y. Audibert, “Density-aware person detection and tracking in crowds,” in ICCV, 2011. 3 [21] L. Fiaschi, R. Nair, U. Koethe, and F. a. Hamprecht, “Learning to Count with Regression Forest and Structured Labels,” in ICPR, 2012. 3, 6 [22] D. Eigen, D. Krishnan, and R. Fergus, “Restoring an image taken through a window covered with dirt or rain,” in ICCV, 2013. 4 [23] L. Xu, J. S. Ren, C. Liu, and J. Jia, “Deep Convolutional Neural Network for Image Deconvolution,” in NIPS, 2014. 4, 5, 8, 9 [24] H. C. Burger, C. J. Schuler, and S. Harmeling, “Image denoising: Can plain neural networks compete with BM3D?” in CVPR, 2012. 4 [25] S. Li, Z.-Q. Liu, and A. B. Chan, “Heterogeneous Multi-task Learning for Human Pose Estimation with Deep Convolutional Neural Network,” IJCV, 2015. 4 [26] Z. Zhang, P. Luo, C. C. Loy, and X. Tang, “Facial Landmark Detection by Deep Multi-task Learning,” in ECCV, 2014. [27] Y. Sun, X. Wang, and X. Tang, “Deep Learning Face Representation by Joint Identification-Verification,” in NIPS, 2014. 4 [28] A. L. Maas, A. Y. Hannun, and A. Y. Ng, “Rectifier Nonlinearities Improve Neural Network Acoustic Models,” in ICML, 2013. 5 [29] S. Ioffe and C. Szegedy, “Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift,” in ICML, 2015. 5 10 [30] D. Ciresan, U. Meier, and J. Schmidhuber, “Multi-column Deep Neural Networks for Image Classification,” in CVPR, 2012, pp. 3642–3649. 8 [31] M. Hodosh, P. Young, and J. Hockenmaier, “Framing image description as a ranking task: Data, models and evaluation metrics,” in Journal of Artificial Intelligence Research, 2013. 8 11
2017
610
7,131
Hierarchical Clustering Beyond the Worst-Case Vincent Cohen-Addad University of Copenhagen vcohenad@gmail.com Varun Kanade University of Oxford Alan Turing Institute varunk@cs.ox.ac.uk Frederik Mallmann-Trenn MIT mallmann@mit.edu Abstract Hiererachical clustering, that is computing a recursive partitioning of a dataset to obtain clusters at increasingly finer granularity is a fundamental problem in data analysis. Although hierarchical clustering has mostly been studied through procedures such as linkage algorithms, or top-down heuristics, rather than as optimization problems, Dasgupta [9] recently proposed an objective function for hierarchical clustering and initiated a line of work developing algorithms that explicitly optimize an objective (see also [7, 22, 8]). In this paper, we consider a fairly general random graph model for hierarchical clustering, called the hierarchical stochastic block model (HSBM), and show that in certain regimes the SVD approach of McSherry [18] combined with specific linkage methods results in a clustering that give an Op1q approximation to Dasgupta’s cost function. Finally, we report empirical evaluation on synthetic and real-world data showing that our proposed SVD-based method does indeed achieveabettercostthanotherwidely-usedheursticsandalsoresultsinabetterclassification accuracy when the underlying problem was that of multi-class classification. 1 Introduction Computing a recursive partitioning of a dataset to obtain a finer and finer classification of the data is a classic problem in data analysis. Such a partitioning is often refered to as a hierarchical clustering and represented as a rooted tree whose leaves correspond to data elements and where each internal node induces a cluster of the leaves of its subtree. There exists a large literature on the design and analysis of algorithms for hierarchical clustering (see e.g., [21]). Two main approaches have proven to be successful in practice so far: on the one hand divisive heuristics compute the hierarchical clustering tree in a top-down fashion by recursively partitioning the data (see e.g., [14]). On the other hand, agglomerative heuristics produce a tree by first defining a cluster for each data elements and successively merging clusters according to a carefully defined function (see e.g., [19]). These heuristics are widely used in practice and are now part of the data scientists’ toolkit—standard machine learning libraries contain implementations of both types of heuristics. Agglomerative heuristics have several appealing features: they are easy to implement, easy to tune, and their running time is rOpn2polylognq on a dataset of size n. Standard divisive heuristics based on graph partitioning or clustering methods (like for example the bisection k-means or the recursive sparsest-cut approaches) often involve solving or approximating NP-hard problems.1 Therefore, it is natural to 1In some cases, it may be possible to have a very fast algorithms based on heuristics to compute partitions, however, we are unaware of any such methods that would have provable guarantees for the kinds of graphs that appear in hierarchical clustering. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. ask how good the solution output by an agglomerative method is compared to the solution output by a top-down method. From a qualitative perspective, this question has been addressed in a large body of work (see e.g., [5]). However, from a quantitative perspective little is known. As Dasgupta observes in his recent work [9], both agglomerative and divisive heuristics are defined procedurally rather than in term of an objective function to optimize, a reason why a quantitative comparision of the different heuristics is rather difficult. Dasgupta introduced an objective function to model the problem of finding a hierarchical clustering of a similarity graph—such an objective can be used to explicitly design optimization algorithms that minimize this cost function as well as serve as a quantitative measure of the quality of the output. Given a similarity graph i.e., a graph where vertices represent data elements and edge weights similarities between data elements, Dasgupta’s objective function associates a cost to any hierarchical clustering tree of the graph. He showed that his objective function exhibits several desirable properties: For example, if the graph is disconnected i.e., data elements in different connected components are very dissimilar, a tree minimizing this objective function will first split the graph according to the connected components. This axiomatic approach to defining a “meaningful” objective function for hierarchical clustering has been further explored in recent work by Cohen-Addad et al. [8]. Roughly speaking, they characterize a family of cost functions, which includes Dasgupta’s cost function, that when the input graph has a “natural” ground-truth hierarchical clustering tree (in other words a natural classification of the data), this tree has optimal cost (and any tree that is not a “natural” hierarchical clustering tree of the graph has higher cost). Therefore, the results by Dasgupta and Cohen-Addad et al. indicate that Dasgupta’s cost function provides a sound framework for a rigorous quantitative analysis of agglomerative and divisive heuristics. A suitable objective function to measure the quality of a clustering also allows one to explicitly design algorithms that minimize the cost. Dasgupta showed that the recursive sparsest-cut heuristic is an Oplog3{2nq-approximation algorithm for his objective function. His analysis has been improved by Charikar and Chatziafratis [7] and Cohen-Addad et al. [8] to Op?log nq. Unfortunately, Charikar and Chatziafratis [7] and Roy and Pokutta [22] showed that, for general inputs, the problem cannot be approximated within any constant factor under the Small-Set Expansion hypothesis. Thus, as suggested by Charikar and Chatziafratis [7], a natural way to obtain a more fine-grained analysis of the classic agglomerative and divisive heuristics is to study beyond-worst case scenarios. Random Graph Model for Hierarchical Clustering. A natural way to analyse a problem beyond the worst-case is to consider a suitable random input model, which is the focus of this paper. More precisely, we introduce a random graph model based on the notion of “hierarchical stochastic block model” (HSBM) introduced by Cohen-Addad et al., which is a natural extensions of the stochastic block model introduced. Our random graph model relies on the notion of ultrametric, a metric in which the triangle inequality is strengthened by requiring dpx,yqďmaxpdpx,zq,dpy,zqq. This is a key concept as ultrametrics exactly capture the notion of data having a “natural” hierarchical structure (cf. [5]). The random graphs are generated from data that comes from an ultrametric, but the randomness hides the natural hierarchical structure. Two natural questions are: Given a random graph generated in such a fashion, when is it possible to identify the underlying ultrametric and is the optimization of Dasgupta’s cost function easier for graphs generated according to such a model. The former question was partially addressed by Cohen-Addad et al. and our focus is primarily on developing algorithms that achieve an Op1q approximation to the expected Dasgupta cost, not on recovering the underlying ultrametric. More formally, assume that the data elements lie in an unknown ultrametric space pA,distq and so exhibit a natural hierarchical clustering defined by this ultrametric. The input is a random graph generated as follows: an edge is added between nodes u,vPA with probability p“fpdistpu,vqq, where f is an (unknown) non-increasing function with range p0,1q.Thus, vertices that are very close in the ultrametric (and so very similar) have a higher probability to have an edge between them than vertices that are further apart. Given such a random graph, the goal is to obtain a hierarchical clustering tree that has a good cost for the objective function. The actual ground-truth tree is optimal in expectation and we focus on designing algorithms that with high probability output a tree whose cost is within a constant factor of the expected cost of the ground-truth tree. Although, we do not study it in this work, the question of exact recovery is also an interesting one and the work of Cohen-Addad et al. [8] addresses this partially in certain regimes. Algorithmic Results. Even in the case of random graphs, the linkage algorithms may perform quite poorly, mainly because ties may be broken unfavourably at the very bottom, when the clusters are 2 singleton nodes; these choices cannot be easily compensated later on in the algorithm. We thus consider the LINKAGE++ algorithm which first uses a seeding step using a standard SVD approach to build clusters of a significant size, which is an extension of the algorithm introduced in [8]. Then, we show that using these clusters as starting point, the classic single-linkage approach achieves a p1`εq-approximation for the problem (cf. Theorem 2.4). Experimental Results. We evaluate the performance of LINKAGE++ on real-world data (Scikit-learn) as well as on synthetic hierarchical data. The measure of interest is the Dasgupta cost function and for completeness we also consider the classification error (see e.g., [22]). Our experiments show that 1) LINKAGE++ performs well on all accounts and 2) that a clustering with a low Dasgupta cost appears to be correlated with a good classification. On synthetic data LINKAGE++ seems to be clearly superior. Related Work. Our work follows the line of research initiated by Dasgupta [9] and further studied by [22, 7, 8]. Dasgupta [9] introduced the cost function studied in this paper and showed that the recursive sparsest-cut approach yields an Oplog3{2nq. His analysis was recently improved to Op?lognq by [7, 8]. Roy and Pokutta [22] and Charikar also considered LP and SDP formulations with spreading constraints to obtain approximation algorithms with approximation factor Oplognq and Op?lognq respectively. Both these works also showed the infeasibility of constant factor approximations under the small-set expansion hypothesis. Cohen-Addad et al. [8] took an axiomatic approach to identify suitable cost functions for data generated from ultrametrics, which results in a natural ground-truth clustering. They also looked at a slightly less general hierarchical stochastic blockmodel (HSBM), where each bottom-level cluster must have a linear size and with stronger conditions on allowable probabilities. Their algorithm also has a “seeding phase” followed by an agglomerative approach. We go beyond their bounds by focusing on approximation algorithms (we obtain a p1`εq-approximation) whereas they aim at recovering the underlying ultrametric. As the experiments show, this trade-off seem not to impact the classification error compared to classic other approaches. There is also a vast literature on graph partitionning problems in random and semi-random models. Most of this work (see e.g., [18, 11]) focuses on recovering a hidden subgraph e.g., a clique, whereas we address the problem of obtaining good approximation guarantees w.r.t. an objective function.the reader may refer to [24, 13] for the definitions and the classic properties on agglomerative and divisive heuristics. Agglomerative and divisive heuristics have been widely studied from either a qualitative perspective or for classic “flat” clustering objective like the classic k-median and k-means, see e.g., [20, 10, 16, 3, 2]. For further background on hierarchical clustering and its application in machine learning and data science, the reader may refer to e.g., [15, 23, 12, 6]. Preliminaries In this paper, we work with undirected weighted graph G“pV,E,wq, where V is a set of vertices, E a set of edges, and w:E ÑR`. In the random and semi-random model, we work with unweighted graphs. We slightly abuse notation and extend the function w to subsets of V . Namely, for any A,B Ď V , let wpA,Bq “ ř aPA,bPB wpa,bq. We use weights to model similarity, namely wpu,vq ą wpu,wq means that data element u is more similar to v than to w. When G is clear from the context, we let |V | “ n and |E| “ m. For any subset S of vertices of a graph G, let GrSs be the subgraph induced by the nodes of S. In the following, let G“pV,E,wq be a weighted graph on n vertices. A cluster tree or hierarchical clustering T for G is a rooted binary tree with exactly |V | leaves, each of which is labeled by a distinct vertex v PV . We denote LCAT pu,vq the lowest common ancestor of vertices u,v in T. Given a tree T and a node N of T, we say that the subtree of N in T is the the connected subgraph containing all the leaves of T that are descendant of N and denote this set of leaves by V pNq. A metric space pX,dq is an ultrametric if for every x,y,z PX, dpx,yqďmaxtdpx,zq,dpy,zqu. We borrow the notion of a (similarity) graph generated from an ultrametric and generating tree introduced by [8]. A weighted graph G “ pV,E,wq is a generated from an ultrametric, if there exists an ultrametric pX,dq, such that V Ď X, and for every x,y P V,x ‰ y, e “ tx,yu exists, and wpeq“fpdpx,yqq, where f :R` ÑR` is a non-increasing function. Definition 1.1 (Generating Tree). Let G“pV,E,wq be a graph generated by a minimal ultrametric pV,dq. Let T be a rooted binary tree with |V | leaves; let N denote the internal nodes and L the set of leaves of T and let σ : L Ñ V denote a bijection between the leaves of T and nodes of V . We say that T is a generating tree for G, if there exists a weight function W : N Ñ R`, such that for N1,N2 P N, if N1 appears on the path from N2 to the root, WpN1q ď WpN2q. Moreover for every x,yPV , wptx,yuq“WpLCAT pσ´1pxq,σ´1pyqqq. 3 As noted in [8], the above notion bear similarities to what is referred to as a dendrogram in the machine learning literature (see e.g., [5]). Objective Function. We consider the objective function introduced by Dasgupta [9]. Let G“pV,E,wq be a weighted graph and T “ pN,Eq be any rooted binary tree with leaves set V . The cost induced by a node N of T is costT pNq “ |V pNq|¨wpV pC1q,V pC2qq where C1,C2 are the children of N in T. The cost of T is costT “ř NPN costT pNq. As pointed out by Dasgupta [9], this can be rephrased as costT “ř pu,vqPEwpu,vq¨|V pLCAT pu,vqq|. 2 A General Hierarchical Stochastic Block Model We introduce a generalization of the HSBM studied by [8] and [17]. Cohen-Addad et al. [8] introduce an algorithm to recover a “ground-truth” hierarchical clustering in the HSBM setting. The regime in which their algorithm works is the following: (1) there is a set of hidden clusters that have linear size and (2) the ratio between the minimum edge probability and the maximum edge probability is Op1q. We aim at obtaining an algorithm that “works” in a more general setting. We reach this goal by proposing on p1`εq-approximation algorithms. Our algorithm very similar to the widely-used linkage approach and remains easy to implement and parallelize. Thus, the main message of our work is that, on “structured inputs” the agglomerative heuristics perform well, hence making a step toward explaining their success in practice. The graphs generated from our model possess an underlying, hidden (because of noise) “ground-truth hierarchical clustering tree” (see Definition 2.1). This aims at modeling real-world classification problem for which we believe there is a natural hierarchical clustering but perturbed because of missing information or measurement erros. For example, in the tree of life, there is a natural hierarchical clustering hidden that we would like to reconstruct. Unfortunately because of extinct species, we don’t have a perfect input and must account for noise. We formalize this intuition using the notion of generating tree (Def 1.1) which, as hinted at by the definition, can be associated to an ultrametric (and so a “natural” hierarchical clustering). The “ground-truth tree” is the tree obtained from a generating tree on k leaves to which we will refer as “bottom”-level clusters containing n1,n2,...,nk nodes (following the terminology in [8]). Each edge of a generated graph has a fixed probability of being present, which only depends on the underlying ground-truth tree. This probability is a function of the clusters in which their endpoints lie and the underlying graph on k vertices for which the generating tree is generating (as in Def 1.1). Definition 2.1 (Hierarchical Stochastic Block Model – Generalization of [8]). Let n be a positive integer. A hierarchical stochastic block model with k bottom-level clusters is defined as follows: 1) Let rGk “ prVk, rEk,wq be a graph generated from an ultrametric, where |rVk| “ k for each e P rEk, wpeqPp0,1q. let rTk be a tree on k leaves, let r N denote the internal nodes of rT and rL denote the leaves; let rσ: rLÑrks be a bijection. Let rT be generating for rGk with weight function Ă W : r N Ñr0,1q. 2) For each iPrks, let pi Pp0,1s be such that pi ą Ă WpNq, if N denotes the parent of rσ´1piq in rT. 3) For each iPrks, there is a positive integer ni such that řk i“1ni “n. Then a random graph G“pV,Eq on n nodes is defined as follows. Each vertex iPrns is assigned a label ψpiqPrks, so that exactly nj nodes are assigned the label j for j Prks. An edge pi,jq is added to the graph with probability pψpiq if ψpiq“ψpjq and with probability Ă WpNq if ψpiq‰ψpjq and N is the least common ancestor of rσ´1piq and rσ´1pjq in rT. The graph G“pV,Eq is returned without any labels. We use, for a generating tree rT, the notation pmin to denote Ă WpN0q, where N0 is the root node of rT. Let nmin be the size of the smallest cluster (of the k clusters) As in [8], we will use the notion of expected graph. The expected graph as the is the weighted complete graph ¯G in which an edge pi,jq has weight pi,j, where pi,j is the probability with which it appears in the random graph G. We refer to any tree that is generating for the expected graph ¯G as a ground-truth tree for G. In order to avoid ambiguity, we denote by costT pGq and costT p ¯Gq the costs of the cluster tree T for the unweighted (random) graph G and weighted graph ¯G respectively. Observe that due to linearity of expectation for any tree T and any admissible cost function, costT p ¯Gq“ErcostT pGqs, where the expectation is with respect to the random choices of edges in G. We have Theorem 2.2. Let n be a positive integer and pmin “ωp a logn{nq. Let k be a fixed constant and G be a graph generated from an HSBM (as per Defn. 2.1) where the underlying graph rGk has k nodes and minimum probability is pmin. For any binary tree T with n leaves labelled by the vertices of G, 4 the following holds with high probability: |costpTq´ErcostpTqs|ďopErcostpTqsq. The expectation is taken only over the random choice of edges. In particular if T ˚ is a ground-truth tree for G, then, with high probability, costpT ˚qďp1`op1qqminT 1costpT 1q“p1`op1qqOPT. Algorithm LINKAGE++, a p1`εq-Approximation Algorithm in the HSBM. We consider a simple algorithm, called LINKAGE++, which works in two phases (see Alg. 1). We use a result of [18] who considers the planted partition model. His approach however does not allow to recover directly a hierarchical structure when the input has it. Algorithm 1 LINKAGE++ 1: Input: Graph G“pV,Eq generated from an HSBM. 2: Parameter: An integer k. 3: Apply (SVD) projection algorithm of [18, Thm. 12] with parameters G, k, δ “ |V |´2, to get ζp1q,...,ζp|V |qPR|V | for vertices in V , where dimpspanpζp1q,...,ζp|V |qqq“k. 4: Run the single-linkage algorithm on the points tζp1q,...,ζp|V |qu until there are exactly k clusters. Let C “tCζ 1,...,Cζ ku be the clusters (of points ζpiq) obtained. Let Ci ĎV denote the set of vertices corresponding to the cluster Cζ i . 5: Define dist:CˆC ÞÑR`: distpCζ i ,Cζ j q“wpCζ i ,Cζ j q{p|Cζ i ||Cζ j |q. 6: while there are at least two clusters in C do 7: Take the pair of clusters C1 i,C1 j of C at max distpC1 i,C1 jq. Define a new cluster C1 “tC1 iYC1 ju. 8: Update dist: distpC1,C1 ℓq“maxpdistpC1 i,C1 ℓq,distpC1 j,C1 ℓqq 9: C ÐC z tC1 iu z tC1 ju Y tC1u 10: end while 11: The sequence of merges in the while-loop (Steps 6 to 10) induces a hierarchical clustering tree on tCζ 1,...,Cζ ku, say T 1 k with k leaves (Cζ 1,...,Cζ k). Replace each leaf Cζ i of T 1 k by the tree obtained for Cζ i at Step 4 to obtain T. 12: Repeat the algorithm k1 “2klogn times. Let T 1,...T k1 be the corresponding outputs. 13: Output: Tree T i (out of the k1 candidates) that minimises ΓpTiq. Theorem 2.3 ([18], Observation 11 and a simplification of Theorem 12). Let δ be the confidence parameter. Assume that for all u,v belonging to different clusters with adjacency vectors u,v (i.e., ui is 1 if the edge pu,iq exists in G and 0 otherwise) satisfy }Erus´Ervs}2 2 ěc¨k¨ ` σ2n{nmin`logpn{δq ˘ (1) for a large enough constant c, where Erus is the entry-wise expectation and σ2 “ωplog6n{nq is an upper bound on the variance. Then, the algorithm of [18, Thm. 12] with parameters G,k,δ projects the columns of the adjacency matrix of G to points tζp1q,...,ζp|V |qu in a k-dimensional subspace of R|V | such that the following holds w.p. at least 1´δ over the random graph G and with probability 1{k over the random bits of the algorithm. There exists ηą0 such that for any u in the ith cluster and v in the jth cluster: 1) if i“j then }ζpuq´ζpvq}2 2 ďη and 2) if i‰j then }ζpuq´ζpvq}2 2 ą2η. In the remainder we assume δ“1{|V |2. We are ready to state our main theorem. Theorem 2.4. Let n be a positive integer and εą0 a constant. Assume that the separation of bottom clusters given by (1) holds, pmin “ωp a logn{nq, and nmin ě?n¨log1{4n. Let k be a fixed constant and G be a graph generated from an HSBM (as per Defn. 2.1) where the underlying graph rGk has k nodes with satisfying the above constraints. With high probability, Algorithm 1 with parameter k on graph G outputs a tree T 1 that satisfies costT 1 ďp1`εqOPT. We note that k might not be known in advance. However, different values of k can be tested and an Op1q-estimate on k is enough for the proofs to hold. Thus, it is possible to run Algorithm 1 Oplog nq times with different “guesses” for k and take the best of these runs. Let G “ pV,Eq be the input graph generated according to an HSBM. Let T be the tree output by Algorithm 1. We divide the proof into two main lemmas that correspond to the outcome of the two phases mentioned above. 5 The algorithm of [18, Thm. 12] might fail for two reasons: The first reason is that the random choices by the algorithm result in an incorrect clustering. This happens w.p. at most 1´1{k and we can simply repeat the algorithm sufficiently many times to be sure that at least once we get the desired result, i.e., the projections satisfy the conclusion of Thm. 2.3. Lemmas 2.6, 2.7 show that in this case, Steps 6 to 10 of LINKAGE++ produce a tree that has cost close to optimal. Ultimately, the algorithm simply outputs a tree that has the least cost among all the ones produced (and one of them is guaranteed to have cost p1`εqOPT) with high probability. The second reason why the McSherry’s algorithm may fail is that the generated random graph G might “deviate” too much from its expectation. This is controlled by the parameter δ (which we set to 1{|V |2). Deviations from expected behaviour will cause our algorithm to fail as well. We bound this failure probability in terms of two events. The first bad event is that McSherry’s algorithm fails for either of the aforementioned reasons. We denote the complement of this event E1. The second bad event it that the numberofedgesbetweentheverticesoftwonodesoftheground-truthtreedeviatesfromit’sexpectation. Namely, that given two nodes N1,N2 of T ˚, we expect the cut to be EpN1,N2q “|V pN1q|¨|V pN1q|¨ WpLCAT ˚pN1,N2qq. Thus, we define E2 to be the event that |wpV pN1q,V pN2qq ´ EpN1,N2q| ă ε2EpN1,N2q for all cuts of the k bottom leaves. Note that the number of cuts is bounded by 2k and we will show that, due to size of nmin and pmin this even holds w.h.p.. The assumptions on the ground-truth tree will ensure that the latter holds w.h.p. allowing us to argue that both events hold w.p. at least Ωp1{kq Thus, from now on we assume that both “good” events E1 and E2 occur. We bound the probability of event E1 in Lemma 2.5. We now prove a structural properties of the tree output by the algorithm, we introducethefollowingdefinition. WesaythatatreeT “pN,Eqisaγ-approximateground-truthtreefor G and T ˚ if there exists a weight function W 1 :N ÞÑR` such that for any two vertices a,b, we have that 1. γ´1W 1pLCAT pa,bqqďWpLCAT ˚pa,bqqďγW 1pLCAT pa,bqq and 2. for any node N of T and any node N 1 descendant of N in T, WpNqďWpN 1q. Lemma 2.5. Let G be generated by an HSBM. Assume that the separation of bottom clusters given by (1) holds. Let C˚ 1 ,...,C˚ k be the hidden bottom-level clusters, i.e., C˚ i “tv | ψpvq“iu. With probability at least Ωp1{kq, the clusters obtained after Step 4 correspond to the assignment ψ, i.e., there exists a permutation π:rksÑrks, such that Cj “C˚ πpjq. Lemma 2.6. Assume that the separation of bottom clusters given by (1) holds, pmin “ωp a logn{nq, and nmin ě ?n¨log1{4n. Let G be generated according to an HSBM and let T ˚ be a ground-truth tree for G. Assume that events E1 and E2 occur, and that furthermore, the clusters obtained after Step 4 correspond to the assignment ψ, i.e., there exists a permutation π:rksÑrks such that for each vPCi, ψpvq“πpiq. Then, the output by the algorithm is a p1`εq-approximate ground-truth tree. The following lemma allows us to bound the cost of an approximate ground-truth tree. Lemma 2.7. Let G be a graph generated according to an HSBM and let T ˚ be a ground-truth tree for G. Let ¯G be the expected graph associated to T ˚ and G. Let T be a γ-approximate ground-truth tree. Then, costT ďγ2OPT. Proof of Theorem 2.4. Conditioning on E1 and E2 which occur w.h.p. and combining Lemmas 2.5, 2.7, and 2.6 together with Theorem 2.2 yields the result. As argued before, E1 holds at least w.p. 1{k and it is possible to boost part of this probability by running Algorithm 1 multiple times. Running it Ωpklognq times and taking the tree with the smallest cost yields the result. Moreover, E2 also holds w.h.p.. 3 Empirical Evaluation In this section, we evaluate the effectiveness of LINKAGE++ on real-world and synthetic datasets. We compare our results to the classic agglomerative heuristics for hierarchical clustering both in terms of the cost function and the classification error. Our goal is answering the question: How good is LINKAGE++ compared to the classic agglomerative approaches on real-world and synthetic data that exhibit a ground-truth clustering? Datasets. The datasets we use are part of the standard Scikit-learn library [4] (and most of them are available at the UCI machine learning repository [1]). Most of these datasets exhibit a “flat” clustering structure, with the exception of the newsgroup datasets which is truly hierarchical. The goal of the 6 algorithm is to perform a clustering of the data by finding the underlying classes. The datasets are: iris, digits, newsgroup2, diabetes, cancer, boston. For a given dataset, we define similarity between data elements using the cosine similarity, this is a standard approach for defining similarity between data elements (see, e.g., [22]) This induces a weighted similarity graph that is given as input to LINKAGE++. Synthethic Data. We generate random graphs of sizes n P t256,512,1024u according to the model described in Section 2.1. More precisely, we define a binary tree on ℓPt4,8u bottom clusters/leaves. Each leaf represents a “class”. We create n{ℓvertices for each class. The probability of having an edge between two vertices of class a and b is given by the probability induced by lowest common ancestor between the leaves corresponding to a and b respectively. We first define pmin “2logn¨ℓ{n. The probability induced by the vertices of the binary tree are the following: the probability at the root is p “ pmin`p1´pminq{logpℓq, and the probability induced by a node at distance d from the root is pd`1qp. In particular, the probability induced by the leaves is pmin `logpℓqp1´pminq{logpℓq “ 1. We also investigate a less structured setting using a ground truth tree on three nodes. Method. We run LINKAGE++ with 9 different breakpoints at which we switch between phase 1 and phase 2 (which corresponds to “guesses” of k). We output the clustering with the smallest cost. To evaluate our algorithm, we compare its performances to classic agglomerative heuristics (for the similarity setting): single linkage, complete linkage, (see also [24, 13] for a complete description) and to the approach of performing only phase 1 of LINKAGE++ until only one cluster remains; we will denote the approach as PCA+. Additionally, we compare ourselves to applying only phase 2 of LINKAGE++, we call this approach density-based linkage. We observe that the running times of the algorithms are of order rOpn2q stemming already from the agglomerative parts.3 This is close to the rOpn2qq running time achieved by the classic agglomerative heuristics. We compare the results by using both the cost of the output tree w.r.t. the hierarchical clustering cost function and the classification error. The classification error is a classic tool to compare different (usually flat) clusterings (see, e.g., [22]). For a k-clustering C :V ÞÑt1,...,ku, the classification error w.r.t. a ground-truth flat clustering C˚ :V ÞÑt1,...,ku is defined as minσPSk `ř xPV 1Cpxq‰σpC˚pxqq ˘ {|V |, where Sk is the set of all permutations σ over k elements. We note that the cost function is more relevant for the newsgroup dataset since it exhibits a truly hierarchical structure and so the cost function is presumably capturing the quality of the classification at different levels. On the other hand, the classification error is more relevant for the others data sets as they are intrinsically flat. All experiments are repeated at least 10 times and standard deviation is shown. Results. The results are summarized in Figure 1, 2, and 3 (App. 3). Almost in all experiments LINKAGE++ performs extremlely well w.r.t. the cost and classification error. Moreover, we observe that a low cost function correlates with a good classification error. For synthetic data, in both LINKAGE++ and PCA+, we observe in Figure 2b that classification error drops drastically from k“4 to k“8, from 0.5 to 0 as the size is number of nodes is increased from n“512 to n“1024. We observe this threshold phenomena for all fixed k we considered. We can observe that the normalized cost in Figure 2a for the other linkage algorithms increases in the aforementioned setting. Moreover, the only dataset where LINKAGE++ and PCA+ differ significantly is the hierarchical dataset newsgroup. Here the cost function of PCA+ is much higher. While the classification error of all algorithm is large, it turns out by inspecting the final clustering of LINKAGE++ and PCA+ that the categories which were being misclassified are mostly sub categories of the same category. On the dataset of Figure 3 (App. 3) only LINKAGE++ performs well. Conclusion. Overall both algorithms LINKAGE++ and Single-linkage perform considerably better when it comes to real-world data and LINKAGE++ and PCA+ dominate on our synthetic datasets. However, in general there is no reason to believe that PCA+ would perform well in clustering truly hierarchical data: there are regimes of the HSBM for which applying only phase 1 of the algorithm might lead to a high missclassification error and high cost and for which we can prove that LINKAGE++ is an p1`εq-approximation. This is exemplified in Figure 3 (App. 3). Moreover, our experiments suggest that one should use in addition to LINKAGE++ other linkage algorithm and pick the algorithm with the lowest cost function, which appears to correlate with the classification error. Nevertheless, a high classification error of hierarchical 2Due to the enormous size of the dataset, we consider a subset consisting of ’comp.graphics’, ’comp.os.mswindows.misc’, ’comp.sys.ibm.pc.hardware’, ’comp.sys.mac.hardware’, ’rec.sport.baseball’, ’rec.sport.hockey’ 3Top k singular vectors of an nˆn matrix can be approximately computed in time rOpkn2q. 7 (a) (b) Figure 1: A comparison of the algorithms on real-world data. (a) The figure shows the cost costp¨q of the algorithm normalized by the the cost of LINKAGE++. (b) The figure shows the percentage of misclassified nodes. By looking more closely at the output of the algorithm, one can see that a large fraction of the misclassifications happen in subgroups of the same group. (a) (b) Figure 2: A comparison of the algorithms on synthetic data for highly structured ground-truth for different n,k. PCA+ performs well on these inputs and we conjecture that this due to the highly structured nature of the groundtruth. (a) The cost of LINKAGE++ and PCA+ are well-below the costs’ of the standard linkage algorithms. (b) We see a threshold phenomena for k“8 from n“512 to n“1024. Here the classification error drops from 0.5 to 0, which is explained by concentration of the eigenvalues allowing the PCA to separated the bottom clusters correctly. data is not a bad sign per se: A misclassification of subcategories of the same categories (as we observe in our experiments) is arguably tolerable, but ignored by the classification error. On the other hand, the cost function captures such errors nicely by its inherently hierarchical nature and we thus strongly advocate it. (a) (b) (c) Figure 3: The clustering obtained by PCA+ on a ground truth tree on three nodes induced by the adjacency matrix rr1.,0.49,0.39sr0.49,0.49,0.39sr0.39,0.39,0.62ss and n“999 nodes split equally. Here only LINKAGE++ and PCA+ classify the bottom clusters of the subtrees correctly. However, the projection to the euclidian space (PCA) does not preserve the underlying ultramtric causing PCA+ to merge incorrectly. (a) LINKAGE++ recovers the ground truth. All other algorithm merge incorrectly. (b) LINKAGE++ and PCA+ classify the bottom clusters correctly causing the classification to be perfect even though PCA+ failed to correctly reconstruct the ground-truth. This suggests that the classification error is less suitable measure for hierarchical data. (c) PCA+ in contrast to LINKAGE++ merges incorrectly two bottom clusters of different branches in the ground-truth tree (green and blue as opposed to green and red). Acknowledgement The project leading to this application has received funding from the European Union’s Horizon 2020 research and innovation programme under the Marie Sklodowska-Curie grant agreement No. 748094. This work was supported in part by EPSRC grant EP/N510129/1. This work was supported in part by NSF Award Numbers BIO-1455983, CCF-1461559, and CCF-0939370. 8 References [1] D. J. N. A. Asuncion. UCI machine learning repository, 2007. [2] M. Balcan and Y. Liang. Clustering under perturbation resilience. SIAM J. Comput., 45(1):102–155, 2016. [3] M.-F. Balcan, A. Blum, and S. Vempala. A discriminative framework for clustering via similarity functions. In STOC ’08, pages 671–680. ACM. [4] L. Buitinck, G. Louppe, M. Blondel, F. Pedregosa, A. Mueller, O. Grisel, V. Niculae, P. Prettenhofer, A. Gramfort, J. Grobler, R. Layton, J. VanderPlas, A. Joly, B. Holt, and G. Varoquaux. API design for machine learning software: experiences from the scikit-learn project. In ECML PKDD Workshop: Languages for Data Mining and Machine Learning, pages 108–122, 2013. [5] G. Carlsson and F. Mémoli. Characterization, stability and convergence of hierarchical clustering methods. Journal of Machine Learning Research, 11:1425–1470, 2010. [6] R. M. Castro, M. J. Coates, and R. D. Nowak. Likelihood based hierarchical clustering. IEEE Transactions on signal processing, 52(8):2308–2321, 2004. [7] M. Charikar and V. Chatziafratis. Approximate hierarchical clustering via sparsest cut and spreading metrics. In SODA’17, pages 841–854, 2017. [8] V. Cohen-Addad, V. Kanade, F. Mallmann-Trenn, and C. Mathieu. Hierarchical clustering: Objective functions and algorithms. To appear at SODA’17, 2017. [9] S. Dasgupta. A cost function for similarity-based hierarchical clustering. In Proc. of the 48th Annual ACM Symposium on Theory of Computing, STOC 2016. ACM, 2016. [10] S. Dasgupta and P. M. Long. Performance guarantees for hierarchical clustering. Journal of Computer and System Sciences, 70(4):555–569, 2005. [11] U. Feige and J. Kilian. Heuristics for semirandom graph problems. J. Comput. Syst. Sci., 63(4):639–671, Dec. 2001. [12] J. Felsenstein and J. Felenstein. Inferring phylogenies, volume 2. Sinauer Associates Sunderland, 2004. [13] J. Friedman, T. Hastie, and R. Tibshirani. The elements of statistical learning, volume 1. Springer, 2001. [14] A. Guénoche, P. Hansen, and B. Jaumard. Efficient algorithms for divisive hierarchical clustering with the diameter criterion. Journal of classification, 8(1):5–30, 1991. [15] N. Jardine and R. Sibson. Mathematical Taxonomy. Wiley series in probability and mathematical statistiscs. John Wiley & Sons, 1972. [16] G. Lin, C. Nagarajan, R. Rajaraman, and D. P. Williamson. A general approach for incremental approximation and hierarchical clustering. In SODA ’06, pages 1147–1156. SIAM, 2006. [17] V. Lyzinski, M. Tang, A. Athreya, Y. Park, and C. E. Priebe. Community detection and classification in hierarchical stochastic blockmodels. IEEE Transactions on Network Science and Engineering, 4(1):13–26, 2017. [18] F. McSherry. Spectral partitioning of random graphs. In FOCS ’01, pages 529–537. [19] F. Murtagh. A survey of recent advances in hierarchical clustering algorithms. The Computer Journal, 26(4):354–359, 1983. [20] C. G. Plaxton. Approximation algorithms for hierarchical location problems. In STOC ’03, pages 40–49. [21] C. K. Reddy and B. Vinzamuri. A survey of partitional and hierarchical clustering algorithms. Data Clustering: Algorithms and Applications, 87, 2013. [22] A. Roy and S. Pokutta. Hierarchical clustering via spreading metrics. In NIPS ’16, pages 2316–2324. [23] P. H. Sneath and R. R. Sokal. Numerical taxonomy. Nature, 193(4818):855–860, 1962. [24] M. Steinbach, G. Karypis, and V. Kumar. A comparison of document clustering techniques. In In KDD Workshop on Text Mining, 2000. 9
2017
611
7,132
Sticking the Landing: Simple, Lower-Variance Gradient Estimators for Variational Inference Geoffrey Roeder University of Toronto roeder@cs.toronto.edu Yuhuai Wu University of Toronto ywu@cs.toronto.edu David Duvenaud University of Toronto duvenaud@cs.toronto.edu Abstract We propose a simple and general variant of the standard reparameterized gradient estimator for the variational evidence lower bound. Specifically, we remove a part of the total derivative with respect to the variational parameters that corresponds to the score function. Removing this term produces an unbiased gradient estimator whose variance approaches zero as the approximate posterior approaches the exact posterior. We analyze the behavior of this gradient estimator theoretically and empirically, and generalize it to more complex variational distributions such as mixtures and importance-weighted posteriors. 1 Introduction KL( φinit ∥φtrue ) 400 600 800 1000 1200 Optimization using: Path Derivative Total Derivative Iterations Figure 1: Fitting a 100-dimensional variational posterior to another Gaussian, using standard gradient versus our proposed path derivative gradient estimator. Recent advances in variational inference have begun to make approximate inference practical in large-scale latent variable models. One of the main recent advances has been the development of variational autoencoders along with the reparameterization trick [Kingma and Welling, 2013, Rezende et al., 2014]. The reparameterization trick is applicable to most continuous latent-variable models, and usually provides lower-variance gradient estimates than the more general REINFORCE gradient estimator [Williams, 1992]. Intuitively, the reparameterization trick provides more informative gradients by exposing the dependence of sampled latent variables z on variational parameters φ. In contrast, the REINFORCE gradient estimate only depends on the relationship between the density function log qφ(z|x, φ) and its parameters. Surprisingly, even the reparameterized gradient estimate contains the score function—a special case of the REINFORCE gradient estimator. We show that this term can easily be removed, and that doing so gives even lower-variance gradient estimates in many circumstances. In particular, as the variational posterior approaches the true posterior, this gradient estimator approaches zero variance faster, making stochastic gradient-based optimization converge and "stick" to the true variational parameters, as seen in figure 1. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. 1.1 Contributions • We present a novel unbiased estimator for the variational evidence lower bound (ELBO) that has zero variance when the variational approximation is exact. • We provide a simple and general implementation of this trick in terms of a single change to the computation graph operated on by standard automatic differentiation packages. • We generalize our gradient estimator to mixture and importance-weighted lower bounds, and discuss extensions to flow-based approximate posteriors. This change takes a single function call using automatic differentiation packages. • We demonstrate the efficacy of this trick through experimental results on MNIST and Omniglot datasets using variational and importance-weighted autoencoders. 1.2 Background Making predictions or computing expectations using latent variable models requires approximating the posterior distribution p(z|x). Calculating these quantities in turn amounts to using Bayes’ rule: p(z|x) = p(x|z)p(z)/p(x). Variational inference approximates p(z|x) with a tractable distribution qφ(z|x) parameterized by φ that is close in KL-divergence to the exact posterior. Minimizing the KL-divergence is equivalent to maximizing the evidence lower bound (ELBO): L(φ) = Ez∼q[log p(x, z) −log qφ(z | x)] (ELBO) An unbiased approximation of the gradient of the ELBO allows stochastic gradient descent to scalably learn parametric models. Stochastic gradients of the ELBO can be formed from the REINFORCEstyle gradient, which applies to any continuous or discrete model, or a reparameterized gradient, which requires the latent variables to be modeled as continuous. Our variance reduction trick applies to the reparameterized gradient of the evidence lower bound. 2 Estimators of the variational lower bound In this section, we analyze the gradient of the ELBO with respect to the variational parameters to show a source of variance that depends on the complexity of the approximate distribution. When the joint distribution p(x, z) can be evaluated by p(x|z) and p(z) separately, the ELBO can be written in the following three equivalent forms: L(φ) = Ez∼q[log p(x|z) + log p(z) −log qφ(z|x)] (1) = Ez∼q[log p(x|z) + log p(z))] + H[qφ] (2) = Ez∼q[log p(x|z)] −KL(qφ(z|x)||p(z)) (3) Which ELBO estimator is best? When p(z) and qφ(z|x) are multivariate Gaussians, using equation (3) is appealing because it analytically integrates out terms that would otherwise have to be estimated by Monte Carlo. Intuitively, we might expect that using exact integrals wherever possible will give lower-variance estimators by reducing the number of terms to be estimated by Monte Carlo methods. Surprisingly, even when analytic forms of the entropy or KL divergence are available, sometimes it is better to use (1) because it will have lower variance. Specifically, this occurs when qφ(z|x) = p(z|x), i.e. the variational approximation is exact. Then, the variance of the full Monte Carlo estimator ˆLMC is exactly zero. Its value is a constant, independent of z iid∼qφ(z|x). This follows from the assumption qφ(z|x) = p(z|x): ˆLMC(φ) = log p(x, z) −log qφ(z|x) = log p(z|x) + log p(x) −log p(z|x) = log p(x), (4) This suggests that using equation (1) should be preferred when we believe that qφ(z|x) ≈p(z|x). Another reason to prefer the ELBO estimator given by equation (1) is that it is the most generally applicable, requiring a closed form only for qφ(z|x). This makes it suitable for highly flexible approximate distributions such as normalizing flows [Jimenez Rezende and Mohamed, 2015], Real NVP [Dinh et al., 2016], or Inverse Autoregressive Flows [Kingma et al., 2016]. 2 Estimators of the lower bound gradient What about estimating the gradient of the evidence lower bound? Perhaps surprisingly, the variance of the gradient of the fully Monte Carlo estimator (1) with respect to the variational parameters is not zero, even when the variational parameters exactly capture the true posterior, i.e., qφ(z|x) = p(z|x). This phenomenon can be understood by decomposing the gradient of the evidence lower bound. Using the reparameterization trick, we can express a sample z from a parametric distribution qφ(z) as a deterministic function of a random variable ϵ with some fixed distribution and the parameters φ of qφ, i.e., z = t(ϵ, φ). For example, if qφ is a diagonal Gaussian, then for ϵ ∼N(0, I), z = µ + σϵ is a sample from qφ. Under such a parameterization of z, we can decompose the total derivative (TD) of the integrand of estimator (1) w.r.t. the trainable parameters φ as ˆ∇TD(ϵ, φ) = ∇φ [log p(x|z) + log p(z) −log qφ(z|x)] (5) = ∇φ [log p(z|x) + log p(x) −log qφ(z|x)] (6) = ∇z [log p(z|x) −log qφ(z|x)] ∇φt(ϵ, φ) | {z } path derivative −∇φ log qφ(z|x) | {z } score function , (7) Variational Parameters (φ) qφ(z|x) = p(z|x) Latent Variable (z) log p(x, z) −log qφ(z|x) log p(x, z) −log qφ(z|x) Surface Along Trajectory through True φ ELBO Figure 2: The evidence lower bound is a function of the sampled latent variables z and the variational parameters φ. As the variational distribution approaches the true posterior, the gradient with respect to the sampled z (blue) vanishes. The reparameterized gradient estimator w.r.t. φ decomposes into two parts. We call these the path derivative and score function components. The path derivative measures dependence on φ only through the sample z. The score function measures the dependence on log qφ directly, without considering how the sample z changes as a function of φ. When qφ(z|x) = p(z|x) for all z, the path derivative component of equation (7) is identically zero for all z. However, the score function component is not necessarily zero for any z in some finite sample, meaning that the total derivative gradient estimator (7) will have nonzero variance even when q matches the exact posterior everywhere. This variance is induced by the Monte Carlo sampling procedure itself. Figure 3 depicts this phenomenon through the loss surface of log p(x, z)−log qφ(z|x) for a Mixture of Gaussians approximate and true posterior. Path derivative of the ELBO Could we remove the high-variance score function term from the gradient estimate? For stochastic gradient descent to converge, we require that our gradient estimate is unbiased. By construction, the gradient estimate given by equation (7) is unbiased. Fortunately, the problematic score function term has expectation zero. If we simply remove that term, we maintain an unbiased estimator of the true gradient: ˆ∇PD(ϵ, φ) = ∇z [log p(z|x) −log qφ(z|x)] ∇φt(ϵ, φ) −((((((( ∇φ log qφ(z|x). (8) This estimator, which we call the path derivative gradient estimator due to its dependence on the gradient flow only through the path variables z to update φ, is equivalent to the standard gradient estimate with the score function term removed. The path derivative estimator has the desirable property that as qφ(z|x) approaches p(z|x), the variance of this estimator goes to zero. When to prefer the path derivative estimator Does eliminating the score function term from the gradient yield lower variance in all cases? It might seem that its removal can only have a variance reduction effect on the gradient estimator. Interestingly, the variance of the path derivative gradient estimator may actually be higher in some cases. This will be true when the score function is positively correlated with the remaining terms in the total derivative estimator. In this case, the score function acts as a control variate: a zero-expectation term added to an estimator in order to reduce variance. 3 Alg. 1 Standard ELBO Gradient Input: Variational parameters φt, Data x ϵt ∼p(ϵ) def ˆLt(φ): zt ←sample_q(φ, ϵt) return log p(x, zt) - log q(zt|x, φ) return ∇φ ˆLt(φt) Alg. 2 Path Derivative ELBO Gradient Input: Variational parameters φt, Data x ϵt ∼p(ϵ) def ˆLt(φ): zt ←sample_q(φ, ϵt) φ′ ←stop_gradient(φ) return log p(x, zt) - log q(zt|x, φ′) return ∇φ ˆLt(φt) Control variates are usually scaled by an adaptive constant c∗, which modifies the magnitude and direction of the control variate to optimally reduce variance, as in Ranganath et al. [2014]. In the preceding discussion, we have shown that bc∗= 1 is optimal when the variational approximation is exact, since that choice yields analytically zero variance. When the variational approximation is not exact, an estimate of c∗based on the current minibatch will change sign and magnitude depending on the positive or negative correlation of the score function with the path derivative. Optimal scale estimation procedures is particularly important when the variance of an estimator is so large that convergence is unlikely. However, in the present case of reparameterized gradients, where the variance is already low, estimating a scaling constant introduces another source of variance. Indeed, we can only recover the true optimal scale when the variational approximation is exact in the regime of infinite samples during Monte Carlo integration. Moreover, the score function must be independently estimated in order to scale it. Estimating the gradient of the score function independent of automatic reverse-mode differentiation can be a challenging engineering task for many flexible approximate posterior distributions such as Normalizing Flows [Jimenez Rezende and Mohamed, 2015], Real NVP [Dinh et al., 2016], or IAF [Kingma et al., 2016]. By contrast, in section 6 we show improved performance on the MNIST and Omniglot density estimation benchmarks by approximating the optimal scale with 1 throughout optimization. This technique is easy to implement using existing automatic differentiation software packages. However, if estimating the score function independently is computationally feasible, and a practitioner has evidence that the variance induced by Monte Carlo integration will reduce the overall variance away from the optimum point, we recommend establishing an annealling schedule for the optimal scaling constant that converges to 1. 3 Implementation Details In this section, we introduce algorithms 1 and 2 in relation to reverse-mode automatic differentiation, and discuss how to implement the new gradient estimator in Theano, Autograd, Torch or Tensorflow Bergstra et al. [2010], Maclaurin et al. [2015], Collobert et al. [2002], Abadi et al. [2015]. Algorithm 1 shows the standard reparameterized gradient for the ELBO. We require three function definitions: q_sample to generate a reparameterized sample from the variational approximation, and functions that implement log p(x, z) and log q(z|x, φ). Once the loss ˆLt is defined, we can leverage automatic differentiation to return the standard gradient evaluated at φt. This yields equation (7). Algorithm 2 shows the path derivative gradient for the ELBO. The only difference from algorithm 1 is the application of the stop_gradient function to the variational parameters inside ˆLt. Table 1 indicates the names of stop_gradient in popular software packages. Theano: T.gradient.disconnected_grad Autograd: autograd.core.getval TensorFlow: tf.stop_gradient Torch: torch-autograd.util.get_value Table 1: Functions that implement stop_gradient 4 Alg. 3 Path Derivative Mixture ELBO Gradient Input: Params πt = {πj t }K j=1, φt = {φi t}K i=1, Data x ϵt ∼p(ϵ) φ′ t, π′ t ←stop_gradient(φt, πt) def ˆLc t(φ): zc t ←sample_q(φ, ϵt) return log p(x, zc t) - log PK c=1 π′c t q(zc t|x, φ′ t) return ∇φ,π PK c=1 πc t ˆLc t(φc t)  Alg. 4 IWAE ELBO Gradient Input: Params φt, Data x ϵ1, ϵ2, . . . , ϵK ∼p(ϵ) φ′ t ←stop_gradient(φt) def wi(φ, ϵi): zi ←sample_q(φ, ϵi) return p(x,zi) q(zi|x,φ′ t) return ∇φ log 1 k PK i=1 wi(φ, ϵi)  This simple modification to algorithm 1 generates a copy of the parameter variable that is treated as a constant with respect to the computation graph generated for automatic differentiation. The copied variational parameters are used to evaluate variational the density log qφ at z. Recall that the variational parameters φ are used both to generate z through some deterministic function of an independent random variable ϵ, and to evaluate the density of z through log qφ. By blocking the gradient through variational parameters in the density function, we eliminate the score function term that appears in equation (7). Per-iteration updates to the variational parameters φ rely on the z channel only, e.g., the path derivative component of the gradient of the loss function ˆLt. This yields the gradient estimator corresponding to equation (8). 4 Extensions to Richer Variational Families Trace Norm of Covariance Matrix 0.0e+00 2.0e+05 4.0e+05 6.0e+05 8.0e+05 Total Derivative Estimator Path Derivative Estimator True Posterior Variational Approximation Variational Parameters φinit →φtrue Figure 3: Fitting a mixture of 5 Gaussians as a variational approximation to a posterior that is also a mixture of 5 Gaussians. Path derivative and score function gradient components were measured 1000 times. The path derivative goes to 0 as the variational approximation becomes exact, along an arbitrarily chosen path Mixture Distributions In this section, we discuss extensions of the path derivative gradient estimator to richer variational approximations to the true posterior. Using a mixture distribution as an approximate posterior in an otherwise differentiable estimator introduces a problematic, non-differentiable random variable π ∼Cat(α). We solve this by integrating out the discrete mixture choice from both the ELBO and the mixture distribution. In this section, we show that such a gradient estimator is unbiased, and introduce an extended algorithm to handle mixture variational families. For any mixture of K base distributions qφ(z|x), a mixture variational family can be defined by qφM (z|x) = PK c=1 πc qφc(z|x), where φM = {π1, ..., πk, φ1, ..., φk} are variational parameters, e.g., the weights and distributional parameters for each component. Then, the mixture ELBO LM is given by: K X c=1 πcEzc∼qφc  log p(x, zc) −log  K X k=1 πkqφk(zc|x)  , where the outer sum integrates over the choice of mixture component for each sample from qφM , and the inner sum evaluates the density. Applying the new gradient estimator to the mixture ELBO involves applying it to each qφk(zc|x) in the inner marginalization. Algorithm 3 implements the gradient estimator of (8) in the context of a continuous mixture distribution. Like algorithm 2, the new gradient estimator of 3 differs from the vanilla gradient estimator only in the application of stop_gradient to the variational parameters. This eliminates the gradient of the score function from the gradient of any mixture distribution. 5 Importance-Weighted Autoencoder We also explore the effect of our new gradient estimator on the IWAE bound Burda et al. [2015], defined as ˆLK = Ez1,...,zK∼q(z|x)  log 1 k K X i=1 p(x, zi) q(zi|x)  (9) with gradient ∇φ ˆLK = Ez1,...,zK∼q(z|x)  K X i=1 ˜wi∇φ log wi  (10) where wi := p(x, zi)/q(zi|x) and ˜wi := wi/ Pk i=1 wi. Since ∇φ log wi is the same gradient as the Monte Carlo estimator of the ELBO (equation (7)), we can again apply our trick to get a new estimator. However, it is not obvious whether this new gradient estimator is unbiased. In the unmodified IWAE bound, when q = p, the gradient with respect to the variational parameters reduces to: Ez1,...,zk∼q(z|x)  − k X i=1 ˜wi∇φ log qφ(zi|x)  . (11) Each sample zi is used to evaluate both ˜wi and the partial derivative term. Hence, we cannot simply appeal to the linearity of expectation to show that this gradient is 0. Nevertheless, a natural extension of the variance reduction technique in equation (8) is to apply our variance reduction to each importance-weighted gradient sample. See algorithm 4 for how to implement the path derivative estimator in this form. We present empirical validation of the idea in our experimental results section, which shows markedly improved results using our gradient estimator. We observe a strong improvement in many cases, supporting our conjecture that the gradient estimator is unbiased as in the mixture and multi-sample ELBO cases. Flow Distributions Flow-based approximate posteriors such as Kingma et al. [2016], Dinh et al. [2016], Jimenez Rezende and Mohamed [2015] are a powerful and flexible framework for fitting approximate posterior distributions in variational inference. Flow-based variational inference samples an initial z0 from a simple base distribution with known density, then learns a chain of invertible, parameterized maps fk(zk−1) that warp z0 into zK = fK ◦fK−1 ◦... ◦f1(z0). The endpoint zK represents a sample from a more flexible distribution with density log qK(zK) = log q0(z0) − PK k=1 log det ∂fk ∂zk−1 . We expect our gradient estimator to improve the performance of flow-based stochastic variational inference. However, due to the chain composition used to learn zK, we cannot straightforwardly apply our trick as described in algorithm 2. This is because each intermediate zj, 1 ≤j ≤K contributes to the path derivative component in equation (8). The log-Jacobian terms used in the evaluation of log q(zk), however, require this gradient information to calculate the correct estimator. By applying stop_gradient to the variational parameters used to generate each intermediate zi and passing only the endpoint zK to a log density function, we would lose necessary gradient information at each intermediate step needed for the gradient estimator to be correct. At time of writing, the requisite software engineering to track and expose intermediate steps during backpropagation is not implemented in the packages listed in Table 1, and so we leave this to future work. 5 Related Work Our modification of the standard reparameterized gradient estimate can be interpreted as adding a control variate, and in fact Ranganath et al. [2014] investigated the use of the score function as a control variate in the context of non-reparameterized variational inference. The variance-reduction effect we use to motivate our general gradient estimator has been noted in the special cases of Gaussian distributions with sparse precision matrices and Gaussian copula inference in Tan and Nott [2017] and Han et al. [2016] respectively. In particular, Tan and Nott [2017] observes that by 6 MNIST Omniglot VAE IWAE VAE IWAE stochastic layers k Total Path Total Path Total Path Total Path 1 1 86.76 86.40 86.76 86.40 108.11 107.39 108.11 107.39 5 86.47 86.33 85.54 85.20 107.62 107.40 106.12 105.42 50 86.35 86.48 84.78 84.45 107.80 107.42 104.67 104.16 2 1 85.33 84.77 85.33 84.77 107.58 105.22 107.56 105.22 5 85.01 84.68 83.89 83.57 106.31 104.87 104.79 103.59 50 84.78 84.33 82.90 83.16 106.30 105.70 103.38 102.86 Table 2: Results on variational (VAE) and importance-weighted (IWAE) autoencoders using the total derivative estimator, equation (7), versus the path derivative estimator, equation (8) (ours). eliminating certain terms from a gradient estimator for Gaussian families parameterized by sparse precision matrices, multiple lower-variance unbiased gradient estimators may be derived. Our work is a generalization to any continuous variational family. This provides a framework for easily implementing the technique in existing software packages that provide automatic differentiation. By expressing the general technique in terms of automatic differentiation, we eliminate the need for case-by-case analysis of the gradient of the variational lower bound as in Tan and Nott [2017] and Han et al. [2016]. An innovation by Ruiz et al. [2016] introduces the generalized reparameterization gradient (GRG) which unifies the REINFORCE-style and reparameterization gradients. GRG employs a weaker form of reparameterization that requires only the first moment to have no dependence on the latent variables, as opposed to complete independence as in Kingma and Welling [2013]. GRG improves on the variance of the score-function gradient estimator in BBVI without the use of Rao-Blackwellization as in Ranganath et al. [2014]. A term in their estimator also behaves like a control variate. The present study, in contrast, develops a simple drop-in variance reduction technique through an analysis of the functional form of the reparameterized evidence lower bound gradient. Our technique is developed outside of the framework of GRG but can strongly improve the performance of existing algorithms, as demonstrated in section 6. Our technique can be applied alongside GRG. In the python toolkit Edward [Tran et al., 2016], efforts are ongoing to develop algorithms that implement stochastic variational inference in general as a black-box method. In cases where an analytic form of the entropy or KL-divergence is known, the score function term can be avoided using Edward. This is equivalent to using equations (2) or (3) respectively to estimate the ELBO. As of release 1.2.4 of Edward, the total derivative gradient estimator corresponding to (7) is used for reparameterized stochastic variational inference. 6 Experiments Experimental Setup Because we follow the experimental setup of Burda et al. [2015], we review it briefly here. Both benchmark datasets are composed of 28 × 28 binarized images. The MNIST dataset was split into 60, 000 training and 10, 000 test examples. The Omniglot dataset was split into 24, 345 training and 8070 test examples. Each model used Xavier initialization [Glorot and Bengio, 2010] and trained using Adam with parameters β1 = 0.9, β2 = 0.999, and ϵ = 1e−4 with 20 observations per minibatch [Kingma and Ba, 2015]. We compared against both architectures reported in Burda et al. [2015]. The first has one stochastic layer with 50 hidden units, encoded using two fully-connected layers of 200 neurons each, using a tanh nonlinearity throughout. The second architecture is two stochastic layers: the first stochastic layer encodes the observations, with two fully-connected layers of 200 hidden units each, into 100 dimensional outputs. The output is used as the parameters of diagonal Gaussian. The second layer takes samples from this Gaussian and passes them through two fully-connected layers of 100 hidden units each into 50 dimensions. See table 2 for NLL scores estimated as the mean of equation (9) with k=5000 on the test set. We can see that the path derivative gradient estimator improves over the original gradient estimator in all but two cases. 7 Benchmark Datasets We evaluate our path derivative estimator using two benchmark datasets: MNIST, a dataset of handwritten digits [LeCun et al., 1998], and Omniglot, a dataset of handwritten characters from many different alphabets [Lake, 2014]. To underscore both the easy implementation of this technique and the improvement it offers over existing approaches, we have empirically evaluated our new gradient estimator by a simple modification of existing code1 [Burda et al., 2015]. Omniglot Results For a two-stochastic-layer VAE using the multi-sample ELBO with gradient corresponding to equation (8) improves over the results in Burda et al. [2015] by 2.36, 1.44, and 0.6 nats for k={1, 5, 50} respectively. For a one-stochastic-layer VAE, the improvements are more modest: 0.72, 0.22, and 0.38 nats lower for k={1, 5, 50} respectively. A VAE with a deep recognition network appears to benefit more from our path derivative estimator than one with a shallow recognition network. For comparison, a VAE using the path derivative estimator with k=5 samples performs only 0.08 nats worse than an IWAE using the total derivative gradient estimator (7) and 5 samples. By contrast, using the total derivative (vanilla) estimator for both models, IWAE otherwise outperforms VAE for k=5 samples by 1.52 nats. By increasing the accuracy of the ELBO gradient estimator, we may also increase the risk of overfitting. Burda et al. [2015] report that they didn’t notice any significant problems with overfitting, as the training log likelihood was usually 2 nats lower than the test log likelihood. With our gradient estimator, we observe only 0.77 nats worse performance for a VAE with k=50 compared to k=5 in the two-layer experiments. IWAE using equation (8) markedly outperforms IWAE using equation (7) on Omniglot. For a 2-layer IWAE, we observe an improvement of 2.34, 1.2, and 0.52 nats for k={1, 5, 50} respectively. For a 1-layer IWAE, the improvements are 0.72, 0.7, and 0.51 for k={1, 5, 50} respectively. Just as in the VAE Omniglot results, a deeper recognition network for an IWAE model benefits more from the improved gradient estimator than a shallow recognition network. MNIST Results For all but one experiment, a VAE with our path derivative estimator outperforms a vanilla VAE on MNIST data. For k=50 with one stochastic layer, our gradient estimator underperforms a vanilla VAE by 0.13 nats. Interestingly, the training NLL for this run is 86.11, only 0.37 nats different than the test NLL. The similar magnitude of the two numbers suggests that training for longer than Burda et al. [2015] would improve the performance of our gradient estimator. We hypothesize that the worse performance using the path derivative estimator is a consequence of fine-tuning towards the characteristics of the total derivative estimator. For a two-stochastic-layer VAE on MNIST, the improvements are 0.56, 0.33 and 0.45 for k={1, 5, 50} respectively. In a one-stochastic-layer VAE on MNIST, the improvements are 0.36 and 0.14 for k={1, 5} respectively. The improvements on IWAE are of a similar magnitude. For k=50 in a two-layer path-derivative IWAE, we perform 0.26 nats worse than with a vanilla IWAE. The training loss for the k=50 run is 82.74, only 0.42 nats different. As in the other failure case, this suggests we have room to improve these results by fine-tuning over our method. For a two stochastic layer IWAE, the improvements are 0.66 and 0.22 for k=1 and 5 respectively. In a one stochastic layer IWAE, the improvements are 0.36, 0.34, and 0.33 for k={1, 5, 50} respectively. 7 Conclusions and Future Work We demonstrated that even when the reparameterization trick is applicable, further reductions in gradient variance are possible. We presented our variance reduction method in a general way by expressing it as a modification of the computation graph used for automatic differentiation. The gain from using our method grows with the complexity of the approximate posterior, making it complementary to the development of non-Gaussian posterior families. Although the proposed method is specific to variational inference, we suspect that similar unbiased but high-variance terms might exist in other stochastic optimization settings, such as in reinforcement learning, or gradient-based Markov Chain Monte Carlo. 1See https://github.com/geoffroeder/iwae 8 References Martín Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dan Mané, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viégas, Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. TensorFlow: Large-scale machine learning on heterogeneous systems, 2015. URL http://tensorflow.org/. Software available from tensorflow.org. James Bergstra, Olivier Breuleux, Frédéric Bastien, Pascal Lamblin, Razvan Pascanu, Guillaume Desjardins, Joseph Turian, David Warde-Farley, and Yoshua Bengio. Theano: A cpu and gpu math compiler in python. In Proc. 9th Python in Science Conf, pages 1–7, 2010. Yuri Burda, Roger Grosse, and Ruslan Salakhutdinov. Importance weighted autoencoders. arXiv preprint arXiv:1509.00519, 2015. Ronan Collobert, Samy Bengio, and Johnny Mariéthoz. Torch: a modular machine learning software library. Technical report, Idiap, 2002. Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using real nvp. arXiv preprint arXiv:1605.08803, 2016. Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In Aistats, volume 9, pages 249–256, 2010. Shaobo Han, Xuejun Liao, David B Dunson, and Lawrence Carin. Variational gaussian copula inference. In Proceedings of the 19th International Conference on Artificial Intelligence and Statistics, volume 51, pages 829–838, 2016. Danilo Jimenez Rezende and Shakir Mohamed. Variational inference with normalizing flows. In The 32nd International Conference on Machine Learning, 2015. Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. Proceedings of the 3rd international conference on learning representations, 2015. Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013. Diederik P. Kingma, Tim Salimans, and Max Welling. Improving variational inference with inverse autoregressive flow. Advances in Neural Information Processing Systems 29, 2016. Brenden M Lake. Towards more human-like concept learning in machines: Compositionality, causality, and learning-to-learn. PhD thesis, Massachusetts Institute of Technology, 2014. Yann LeCun, Corinna Cortes, and Christopher JC Burges. The mnist dataset of handwritten digits. URL http://yann. lecun. com/exdb/mnist, 1998. Dougal Maclaurin, David Duvenaud, Matthew Johnson, and Ryan P. Adams. Autograd: Reversemode differentiation of native Python, 2015. URL http://github.com/HIPS/autograd. Rajesh Ranganath, Sean Gerrish, and David M Blei. Black box variational inference. In AISTATS, pages 814–822, 2014. Danilo J Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In Proceedings of the 31st International Conference on Machine Learning (ICML-14), pages 1278–1286, 2014. Francisco JR Ruiz, Michalis K Titsias, and David M Blei. The generalized reparameterization gradient. arXiv preprint arXiv:1610.02287, 2016. Linda SL Tan and David J Nott. Gaussian variational approximation with sparse precision matrices. Statistics and Computing, pages 1–17, 2017. 9 Dustin Tran, Alp Kucukelbir, Adji B. Dieng, Maja Rudolph, Dawen Liang, and David M. Blei. Edward: A library for probabilistic modeling, inference, and criticism. arXiv preprint arXiv:1610.09787, 2016. Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229–256, 1992. 10
2017
612
7,133
Multiplicative Weights Update with Constant Step-Size in Congestion Games: Convergence, Limit Cycles and Chaos Gerasimos Palaiopanos∗ SUTD Singapore gerasimosath@yahoo.com Ioannis Panageas† MIT Cambridge, MA 02139 ioannis@csail.mit.edu Georgios Piliouras‡ SUTD Singapore georgios@sutd.edu.sg Abstract The Multiplicative Weights Update (MWU) method is a ubiquitous meta-algorithm that works as follows: A distribution is maintained on a certain set, and at each step the probability assigned to action γ is multiplied by (1 −ϵC(γ)) > 0 where C(γ) is the “cost" of action γ and then rescaled to ensure that the new values form a distribution. We analyze MWU in congestion games where agents use arbitrary admissible constants as learning rates ϵ and prove convergence to exact Nash equilibria. Interestingly, this convergence result does not carry over to the nearly homologous MWU variant where at each step the probability assigned to action γ is multiplied by (1 −ϵ)C(γ) even for the simplest case of two-agent, two-strategy load balancing games, where such dynamics can provably lead to limit cycles or even chaotic behavior. 1 Introduction The Multiplicative Weights Update (MWU) is a ubiquitous meta-algorithm with numerous applications in different fields [2]. It is particularly useful in game theory due to its regret-minimizing properties [24, 11]. It is typically introduced in two nearly identical variants, the one in which at each step the probability assigned to action γ is multiplied by (1 −ϵC(γ)) and the one in which it is multiplied by (1 −ϵ)C(γ) where C(γ) is the cost of action γ. We will refer to the first as the linear variant, MWUℓ, and the second as the exponential, MWUe (also known as Hedge). In the literature there is little distinction between these two variants as both carry the same advantageous regret-minimizing property. It is also well known that in order to achieve sublinear regret, the learning rate ϵ must be decreasing as time progresses. This constraint raises a natural question: Are there interesting classes of games where MWU behaves well without the need to fine-tune its learning rate? A natural setting to test the learning behavior of MWU with constant learning rates ϵ is the wellstudied class of congestion games. Unfortunately, even for the simplest instances of congestion games MWUe fails to converge to equilibria. For example, even in the simplest case of two balls two ∗Gerasimos Palaiopanos would like to acknowledge a SUTD Presidential fellowship. †Ioannis Panageas would like to acknowledge a MIT-SUTD postdoctoral fellowship. Part of this work was completed while Ioannis Panageas was a PhD student at Georgia Institute of Technology and a visiting scientist at the Simons Institute for the Theory of Computing. ‡Georgios Piliouras would like to acknowledge SUTD grant SRG ESD 2015 097, MOE AcRF Tier 2 Grant 2016-T2-1-170 and a NRF Fellowship. Part of this work was completed while Georgios Piliouras was a visiting scientist at the Simons Institute for the Theory of Computing. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. bins games,4 MWUe with ϵ = 1 −e−10 is shown to converge to a limit cycle of period 2 for infinitely many initial conditions (Theorem 4.1). If the cost functions of the two edges are not identical then we create instances of two player load balancing games such that MWUe has periodic orbits of length k for all k > 0, as well as uncountable many initial conditions which never settle on any periodic orbit but instead exhibit an irregular behavior known as Li-Yorke chaos (Theorem 4.2, see Corollary 4.3). The source of these problems is exactly the large, fixed learning rate ϵ, e.g., ϵ ≈1 for costs in [0, 1]. Intuitively, the key aspect of the problem can be captured by (simultaneous) best response dynamics. If both agents start from the same edge and best-respond simultaneously they will land on the second edge which now has a load of two. In the next step they will both jump back to the first edge and this motion will be continued perpetually. Naturally, MWUe dynamics are considerably more intricate as they evolve over mixed strategies and allow for more complicated non-equilibrium behavior but the key insight is correct. Each agent has the right goal, decrease his own cost and hence the potential of the game, however, as they pursue this goal too aggressively they cancel each other’s gains and lead to unpredictable non-converging behavior. In a sense, the cautionary tales above agree with our intuition. Large, constant learning rates ϵ nullify the known performance guarantees of MWU. We should expect erratic behavior in such cases. The typical way to circumvent these problems is through careful monitoring and possibly successive halving of the ϵ parameter, a standard technique in the MWU literature. In this paper, we explore an alternative, cleaner, and surprisingly elegant solution to this problem. We show that applying MWUℓ, the linear variant of MWU, suffices to guarantee convergence in all congestion games. Our key contributions. Our key result is the proof of convergence of MWUℓin congestion games. The main technical contribution is a proof that the potential of the mixed state is always strictly decreasing along any nontrivial trajectory (Theorem 3.1). This result holds for all congestion games, irrespective of the number of agents or the size, topology of the strategy sets. Moreover, each agent i may be applying different learning rates ϵi which will be constant along the dynamics (ϵi does not depend on the number of iterations T of the dynamics and therefore is bounded away from zero as T →∞; this is not the case for most of the results in the literature). The only restriction on the set of allowable learning rates ϵi is that for each agent the multiplicative factor (1 −ϵiCi(s)) should be positive for all strategy outcomes s.5 Arguing convergence to equilibria for all initial conditions (Theorem 3.4) and further, convergence to Nash equilibria for all interior initial conditions (Theorem 3.8) follows. Proving that the potential always decreases (Theorem 3.1) hinges upon discovering a novel interpretation of MWU dynamics. Specifically, we show that the class of dynamical systems derived by applying MWUℓin congestion games is a special case of a convergent class of dynamical systems introduced by Baum and Eagon [5] (see Theorem 2.4). The most well known member of this class is the classic Baum-Welch algorithm, the standard instantiation of the Expectation-Maximization (EM) algorithm for hidden Markov models (HMM). Effectively, the proof of convergence of both these systems boils down to a proof of membership to the same class of Baum-Eagon systems (see section 2.3 for more details on these connections). In the second part we provide simple congestion games where MWUe provably fails to converge. The first main technical contribution of this section is proving convergence to a limit cycle, specifically a periodic orbit of length two, for the simplest case of two balls two bins games for infinitely many initial conditions (Theorem 4.1). Moreover, after normalizing costs to lie in [0, 1], i.e. c(x) = x/2, we prove that almost all symmetric non-equilibrium initial conditions converge to a unique limit cycle when both agents use learning rate ϵ = 1−e−10. In contrast, since 1−ϵ·C(s) ≥1−(1−e−10)1 = e−10 > 0, MWUℓsuccessfully converges to equilibrium. In other words, for the same learning rates, MWUe exhibits chaotic behavior whereas MWUℓconverges to Nash equilibrium. Establishing chaotic behavior for the case of edges with different cost functions is rather straightforward in comparison (Theorem 4.2). The key step is to exploit symmetries in the system to reduce it to a single dimensional one and then establish the existence of a periodic orbit of length three. The existence of periodic orbits of any length as well as chaotic orbits then follows from the Li-Yorke theorem 2.3 [30] (see section 2.2 for background on chaos and dynamical systems). Finally, for any learning rate 1 > ϵ > 0, we construct n-player games so that MWUe has chaotic behavior for uncountably many starting points. 4n balls n bin games are symmetric load balancing games with n agent and n edges/elements each with a cost function of c(x)=x. We normalize costs equal to c(x) = x/n so that they lie in [0, 1]. 5This is an absolutely minimal restriction so that the denominator of MWUℓcannot become equal to zero. 2 Related work and Extensions/Implications of our results. Connections to learning in games and price of anarchy: Several recent papers, e.g., [40, 22] focus on proving welfare guarantees of no-regret dynamics in games exploiting connections to (robust) price of anarchy literature [37] by establishing fast convergence of the time average behavior to (approximate) coarse correlate equilibria. Although these approaches are rather powerful they are not always applicable. For example, it is well known that when we consider the makespan (i.e. the load of the most congested machine) instead of the social/total cost there can be an exponential gap between the performance of coarse correlated equilibria and Nash equilibria. For example the price of anarchy for the makespan objective for n balls n bins games is O(log(n)/ log log(n)) whereas for the worst no regret algorithm it can be Ω(√n) [9]. Moreover, even if we focus on the social cost, the price of anarchy guarantees do not carry over if we perform affine transformation to the cost functions (e.g. if there exist users of different tiers/types that the system designer wants to account for in a differential manner). In contrast, our convergence results are robust to any affine cost transformation. In fact, our results apply for all weighted potential games [32] (Remark 3.5). Connections to distributed computation and adversarial agent scheduling: A rather realistic concern about results on learning in games has to do with their sensitivity to the ordering of the moves of the agent dynamics. For example, better-response dynamics in congestion games are guaranteed to converge only if in every round, exactly one agent deviates to a better strategy. A series of recent papers has established strong non-termination (cycling) results for large classes of bounded recall dynamics with a wide variety of interesting and timely applications: game theory, circuit design, social networks, routing and congestion control [26, 19, 34, 25]. In the case of games, these results translate to corollaries such as: “If there are two or more pure Nash equilibria in a game with unique best responses, then all bounded-recall self-independent dynamics6 for which those equilibria are fixed points can fail to converge in asynchronous environments." Even the simplest 2 balls 2 bins game satisfies these properties (two pure Nash and unique best responses) which shows the strength of this impossibility result. In contrast, our convergence result holds for any adversarial scheduling with the minimal fairness assumption that given any mixed state at least one agent who is not best responding eventually will be given the possibility to update their behavior, answering open questions in [26, 25]. In fact, our convergence result is in a sense the strongest possible, no matter how many agents get to update their behavior (as long as one of them does) then the potential of the game will strictly decrease (Corollary 3.6). Connections to complexity theory: Whereas the complexity of computing both mixed Nash equilibria in general games (PPAD-complete [17]) as well as the complexity of finding pure Nash equilibria in congestion games (PLS-complete [20]) have both been completely characterized and are thus unlikely to admit an efficient time algorithm, the complexity of computing mixed Nash equilibria in congestion games has withstood so far an exhaustive characterization. Naturally, it lies on the intersection of both PPAD and PLS, known as CLS [18]. Such an equilibrium can be found both via an end-of-line type of argument as well as a local search type of argument, but it is still not known if it is CLS-complete. Given the active interest for producing CLS-complete problems [16, 21] our constructive/convergence proof may help shed light on this open question. Chaos for arbitrary small learning rates ϵ: Although our example of chaotic behavior uses a very high learning rate ϵ = 1 −e−10, it should be noted that for any learning rate ϵ (e.g. ϵ = e−10), as well as for any number of agents n, we can create congestion games with n agents where MWUe exhibits chaotic behavior (Corollary 4.3). Congestion/potential games: Congestion games are amongst the most well known and thoroughly studied class of games. Proposed in [36] and isomorphic to potential games [32], they have been successfully employed in myriad modeling problems. Despite the numerous positive convergence results for concurrent dynamics in congestion games, e.g., [33, 23, 7, 1, 6, 28, 10, 13, 12, 31], we know of no prior work establishing such a deterministic convergence result of the day-to-day agent behavior to exact Nash equilibria for general atomic congestion games. MWU has also been studied in congestion games. In [29] randomized variants of the exponential version of the MWU are shown to converge w.h.p. to pure Nash equilibria as long as the learning rate ϵ is small enough. In contrast our positive results for linear MWUℓhold deterministically and for all learning rates. Recently, [14] showed that if the Hedge algorithm is run with a suitably decreasing learning factor ϵ, the sequence 6A dynamic is called self-independent if the agent’s response does not depend on his actions. 3 of play converges to a Nash equilibrium with probability 1 (in the bandit case). The result and the techniques are orthogonal to ours, since we assume fixed learning rates. Non-convergent dynamics: Outside the class of congestion games, there exist several negative results in the literature concerning the non-convergence of MWU and variants thereof. In particular, in [15] it was shown that the multiplicative updates algorithm fails to find the unique Nash equilibrium of the 3 × 3 Shapley game. Similar non-convergent results have been proven for perturbed zero-sum games [4], as well as for the continuous time version of MWU, the replicator dynamics [27, 35]. The possibility of applying Li-Yorke type arguments for MWU in congestion games with two agents was inspired by a remark in [3] for the case of continuum of agents. Our paper is the first to our knowledge where non-convergent MWU behavior in congestion games is formally proven capturing both limit cycles and chaos and we do so in the minimal case of two balls two bin games. 2 Preliminaries Notation. We use boldface letters, e.g., x, to denote column vectors (points). For a function f : Rm →Rm, by f n we denote the composition of f with itself n times, namely f ◦f ◦· · · ◦f | {z } n times . 2.1 Congestion Games A congestion game [36] is defined by the tuple (N; E; (Si)i∈N ; (ce)e∈E) where N is the set of agents, N = |N|, E is a set of resources (also known as edges or bins or facilities) and each player i has a set Si of subsets of E (Si ⊆2E) and |Si| ≥1. Each strategy si ∈Si is a set of edges and ce is a positive cost (latency) function associated with facility e. We use small greek characters like γ, δ to denote different strategies/paths. For a strategy profile s = (s1, s2, . . . , sN), the cost of player i is given by ci(s) = P e∈si ce(ℓe(s)), where ℓe(s) is the number of players using e in s (the load of edge e). The potential function is defined to be Φ(s) = P e∈E Pℓe(s) j=1 ce(j). For each i ∈N and γ ∈Si, piγ denotes the probability player i chooses strategy γ. We denote by ∆(Si) = {p ≥0 : P γ piγ = 1} the set of mixed (randomized) strategies of player i and ∆= ×i∆(Si) the set of mixed strategies of all players. We use ciγ = Es−i∼p−ici(γ, s−i) to denote the expected cost of player i given that he chooses strategy γ and ˆci = P δ∈Si piδciδ to denote his expected cost. 2.2 Dynamical Systems and Chaos Let x(t+1) = f(x(t)) be a discrete time dynamical system with update rule f : Rm →Rm. The point z is called a fixed point of f if f(z) = z. A sequence (f t(x(0)))t∈N is called a trajectory or orbit of the dynamics with x(0) as starting point. A common technique to show that a dynamical system converges to a fixed point is to construct a function P : Rm →R such that P(f(x)) > P(x) unless x is a fixed point. We call P a Lyapunov or potential function. Definition 2.1. C = {z1, . . . , zk} is called a periodic orbit of length k if zi+1 = f(zi) for 1 ≤i ≤ k −1 and f(zk) = z1. Each point z1, . . . , zk is called periodic point of period k. If the dynamics converges to some periodic orbit, we also use the term limit cycle. Some dynamical systems converge and their behavior can be fully understood and some others have strange, chaotic behavior. There are many different definitions for what chaotic behavior and chaos means. In this paper we follow the definition of chaos by Li and Yorke. Let us first give the definition of a scrambled set. Given a dynamical system with update rule f, a pair x and y is called “scrambled" if limn→∞inf |f n(x) −f n(y)| = 0 (the trajectories get arbitrarily close) and also limn→∞sup |f n(x) −f n(y)| > 0 (the trajectories move apart). A set S is called “scrambled" if ∀x, y ∈S, the pair is “scrambled". Definition 2.2 (Li and Yorke). A discrete time dynamical system with update rule f, f : X →X continuous on a compact set X ⊂R is called chaotic if (a) for each k ∈Z+, there exists a periodic point p ∈X of period k and (b) there is an uncountably infinite set S ⊆X that is “scrambled". Li and Yorke proved the following theorem [30] (there is another theorem of similar flavor due to Sharkovskii [38]): 4 Theorem 2.3 (Period three implies chaos). Let J be an interval and let F : J →J be continuous. Assume there is a point a ∈J for which the points b = F(a), c = F 2(a) and d = F 3(a), satisfy d ≤a < b < c (or d ≥a > b > c). Then 1. For every k = 1, 2, . . . there is a periodic point in J having period k. 2. There is an uncountable set S ⊂J (containing no periodic points), which satisfies the following conditions: • For every p, q ∈S with p ̸= q, lim n→∞sup |F n(p) −F n(q)| > 0 and lim n→∞inf |F n(p) −F n(q)| = 0. • For every point p ∈S and periodic point q ∈J, lim n→∞sup |F n(p) −F n(q)| > 0. Notice that if there is a periodic point with period 3, then the hypothesis of the theorem will be satisfied. 2.3 Baum-Eagon Inequality, Baum-Welch and EM We start this subsection by stating the Baum-Eagon inequality. This inequality will be used to show that MWUℓconverges to fixed points and more specifically Nash equilibria for congestion games. Theorem 2.4 (Baum-Eagon inequality [5]). Let P(x) = P ({xij}) be a polynomial with nonnegative coefficients homogeneous of degree d in its variables {xij}. Let x = {xij} be any point of the domain D : xij ≥0, Pqi j=1 xij = 1, i = 1, 2, ..., p, j = 1, 2, ..., qi. For x = {xij} ∈D let ℑ(x) = ℑ{xij} denote the point of D whose i, j coordinate is ℑ(x)ij = xij ∂P ∂xij (x) ! , qi X j′=1 xij′ ∂P ∂xij′ (x) Then P(ℑ(x)) > P(x) unless ℑ(x) = x. The Baum-Welch algorithm is a classic technique used to find the unknown parameters of a hidden Markov model (HMM). A HMM describes the joint probability of a collection of “hidden" and observed discrete random variables. It relies on the assumption that the i-th hidden variable given the (i −1)-th hidden variable is independent of previous hidden variables, and the current observation variables depend only on the current hidden state. The Baum-Welch algorithm uses the well known EM algorithm to find the maximum likelihood estimate of the parameters of a hidden Markov model given a set of observed feature vectors. More detailed exposition of these ideas can be found here [8]. The probability of making a specific time series of observations of length T can be shown to be a homogeneous polynomial P of degree T with nonnegative (integer) coefficients of the model parameters. Baum-Welch algorithm is homologous to the iterative process derived by applying the Baum-Eagon theorem to polynomial P [5, 41]. In a nutshell, both Baum-Welch and MWUℓin congestion games are special cases of the Baum-Eagon iterative process (for different polynomials P). 2.4 Multiplicative Weights Update In this section, we describe the MWU dynamics (both the linear MWUℓ, and the exponential MWUe variants) applied in congestion games. The update rule (function) ξ : ∆→∆(where p(t + 1) = ξ(p(t))) for the linear variant MWUℓis as follows: piγ(t + 1) = (ξ(p(t)))iγ = piγ(t)1 −ϵiciγ(t) 1 −ϵiˆci(t) , ∀i ∈N, ∀γ ∈Si, (1) 5 where ϵi is a constant (can depend on player i but not on p) so that both enumerator and denominator of the fraction in (1) are positive (and thus the fraction is well defined). Under the assumption that 1/ϵi > 1 β def = supi,p∈∆,γ∈Si {ciγ}, it follows that 1/ϵi > ciγ for all i, γ and hence 1/ϵi > ˆci. The update rule (function) η : ∆→∆(where p(t + 1) = η(p(t))) for the exponential variant MWUe is as follows: piγ(t + 1) = (η(p(t)))iγ = piγ(t) (1 −ϵi)ciγ(t) P γ′∈Si piγ′(t)(1 −ϵi)ciγ′(t) , ∀i ∈N, ∀γ ∈Si, (2) where ϵi < 1 is a constant (can depend on player i but not on p). Note that ϵi can be small when the number of agents N is large enough. Remark 2.5. Observe that ∆is invariant under the discrete dynamics (1), (2) defined above. If piγ = 0 then piγ remains zero, and if it is positive, it remains positive (both numerator and denominator are positive) and also is true that P γ∈Si piγ = 1 for all agents i. A point p∗is called a fixed point if it stays invariant under the update rule of the dynamics, namely ξ(p∗) = p∗or η(p∗) = p∗. A point p∗is a fixed point of (1), (2) if for all i, γ with p∗ iγ > 0 we have that ciγ = ˆci. To see why, observe that if p∗ iγ, p∗ iγ′ > 0, then ciγ = ciγ′ and thus ciγ = ˆci. We conclude that the set of fixed points of both dynamics (1), (2) coincide and are supersets of the set of Nash equilibria of the corresponding congestion game. 3 Convergence of MWUℓto Nash Equilibria We first prove that MWUℓ(1) converges to fixed points7. Technically, we establish that function Ψ def = Es∼p [Φ(s)] is strictly decreasing along any nontrivial (i.e. nonequilibrium) trajectory, where Φ is the potential function of the congestion game as defined in Section 2. Formally we show the following theorem: Theorem 3.1 (Ψ is decreasing). Function Ψ is decreasing w.r.t. time, i.e., Ψ(p(t + 1)) ≤Ψ(p(t)) where equality Ψ(p(t + 1)) = Ψ(p(t)) holds only at fixed points. We define the function Q(p) def = X i∈N  (1/ϵi −1/β) · X γ∈Si piγ  + 1/β · Y i∈N  X γ∈Si piγ   | {z } constant term −Ψ(p), (3) and show that Q(p) is strictly increasing w.r.t time, unless p is a fixed point. Observe that P γ∈Si piγ = 1 since p lies in ∆, but we include this terms in Q for technical reasons that will be made clear later in the section. By showing that Q is increasing with time, Theorem 3.1 trivially follows since Q = const −Ψ where const = P i∈N 1/ϵi −1/β(N −1). To show that Q(p) is strictly increasing w.r.t time, unless p is a fixed point, we use a generalization of an inequality by Baum and Eagon [5] on function Q. Corollary 3.2 (Generalization of Baum-Eagon). Theorem 2.4 holds even if P is non-homogeneous. We want to apply Corollary 3.2 on Q. To do so, it suffices to show that Q(p) is a polynomial with nonnegative coefficients. Lemma 3.3. Q(p) is a polynomial with respect to piγ and has nonnegative coefficients. Using Lemma 3.3 and Corollary 3.2 we show the following: Theorem 3.4. Let Q be the function defined in (3). Let also p(t) ∈∆be the point MWUℓ(1) outputs at time t with update rule ξ. It holds that Q(p(t + 1)) def = Q(ξ(p(t))) > Q(p(t)) unless ξ(p(t)) = p(t) (fixed point). Namely Q is strictly increasing with respect to the number of iterations t unless MWUℓis at a fixed point. 7All missing proofs can be found in the full version of this paper http://arxiv.org/abs/1703.01138. 6 Remark 3.5 (Weighted potential games). A congestion game is a potential game because if a player deviates, the difference he experiences in his cost is exactly captured by the deviation of the global (same for all players) function Φ = P e∈E Pℓe(s) j=1 ce(j). In a weighted potential game, it holds that ci(si, s−i) −ci(s′ i, s−i) = wi(Φ(si, s−i) −Φ(s′ i, s−i)), where wi is some constant not necessarily 1 (as in the potential games case) and vector s−i captures the strategies of all players but i. It is not hard to see that Lemma 3.3 and thus Theorems 3.4 and 3.1 hold in this particular class of games (which is a generalization of congestion games), and so do the rest of the theorems of the section. Effectively, in terms of the weighted potential games analysis, it is possible to reduce it to the standard potential games analysis as follows: Consider the system with learning rates ϵi and cost functions wici so that the game with cost functions ci is a potential game. The only necessary condition that we ask of this system is that ϵiwici(s) < 1 for all i (as in the standard case) so that the enumerators/denominators are positive. By reduction, we can show that for every round T, even if a subset (that depends on the round T) of the players update their strategy according to MWUℓand the rest remain fixed, the potential still decreases. Corollary 3.6 (Any subset). Assume that at time t we partition the players in two sets St, S′ t so that we allow only players in St to apply MWUℓdynamics, whereas the players in S′ t remain fixed. It holds that the expected potential function of the game at time t decreases. As stated earlier in the section, if Q(p(t)) is strictly increasing with respect to time t unless p(t) is a fixed point, it follows that the expected potential function Ψ(p(t)) = const −Q(p(t)) is strictly decreasing unless p(t) is a fixed point and Theorem 3.1 is proved. Moreover, we can derive the fact that our dynamics converges to fixed points as a corollary of Theorem 3.1. Theorem 3.7 (Convergence to fixed points). MWUℓdynamics (1) converges to fixed points. We conclude the section by strengthening the convergence result (i.e., Theorem 3.7). We show that if the initial distribution p is in the interior of ∆then we have convergence to Nash equilibria. Theorem 3.8 (Convergence to Nash equilibria). Assume that the fixed points of (1) are isolated. Let p(0) be a point in the interior of ∆. It follows that limt→∞p(t) = p∗is a Nash equilibrium. Proof. We showed in Theorem 3.7 that MWUℓdynamics (1) converges, hence limt→∞p(t) exists (under the assumption that the fixed points are isolated) and is equal to a fixed point of the dynamics p∗. Also it is clear from the dynamics that ∆is invariant, i.e., P δ∈Sj pjδ(t) = 1, pjδ(t) > 0 for all j and t ≥0 since p(0) is in the interior of ∆. Assume that p∗is not a Nash equilibrium, then there exists a player i and a strategy γ ∈Si so that ciγ(p∗) < ˆci(p∗) (on mixed strategies p∗) and p∗ iγ = 0. Fix a ζ > 0 and let Uζ = {p : ciγ(p) < ˆci(p) −ζ}. By continuity we have that Uζ is open. It is also true that p∗∈Uζ for ζ small enough. Since p(t) converges to p∗as t →∞, there exists a time t0 so that for all t′ ≥t0 we have that p(t′) ∈Uζ. However, from MWUℓdynamics (1) we get that if p(t′) ∈Uζ then 1 −ϵiciγ(t′) > 1 −ϵiˆci(t′) and hence piγ(t′ + 1) = piγ(t′) 1−ϵiciγ(t′) 1−ϵiˆci(t′) ≥piγ(t′) > 0, i.e., piγ(t′) is positive and increasing with t′ ≥t0. We reached a contradiction since piγ(t) →p∗ iγ = 0, thus p∗is a Nash equilibrium. 4 Non-Convergence of MWUe: Limit Cycle and Chaos We consider a symmetric two agent congestion game with two edges e1, e2. Both agents have the same two available strategies γ1 = {e1} and γ2 = {e2}. We denote x, y the probability that the first and the second agent respectively choose strategy γ1. For the first example, we assume that ce1(l) = 1 2 · l and ce2(l) = 1 2 · l. Computing the expected costs we get that c1γ1 = 1+y 2 , c1γ2 = 2−y 2 , c2γ1 = 1+x 2 , c2γ2 = 2−x 2 . MWUe then becomes xt+1 = xt (1−ϵ1) (yt+1) 2 xt(1−ϵ1) yt+1 2 +(1−xt)(1−ϵ1) 2−yt 2 (first player) and yt+1 = yt (1−ϵ2) xt+1 2 yt(1−ϵ2) xt+1 2 +(1−yt)(1−ϵ2) 2−xt 2 (second player). We assume that ϵ1 = ϵ2 and also that x0 = y0 (players start with the same mixed 7 (a) Exponential MWUe: Plot of function G (blue) and its iterated versions G2 (red), G3 (yellow). Function y(x) = x is also included. (b) Linear MWUℓ: Plot of function Gℓ(blue) and its iterated versions G2 ℓ(red) and G3 ℓ(yellow). Function y(x) = x is also included. (c) Exponential MWUe: Plot of function G10. Function y(x) = x is also included. (d) Linear MWUℓ: Plot of function G10 ℓ. Function y(x) = x is also included. Figure 1: We compare and contrast MWUe (left) and MWUℓ(right) in the same two agent two strategy/edges congestion game with ce1(l) = 1 4 · l and ce2(l) = 1.4 4 · l and same learning rate ϵ = 1 −e−40. MWUe exhibits sensitivity to initial conditions whereas MWUℓequilibrates. Function y(x) = x is also included in the graphs to help identify fixed points and periodic points. strategy. Due to symmetry, it follows that xt = yt for all t ∈N, thus it suffices to keep track only of one variable (we have reduced the number of variables of the update rule of the dynamics to one) and the dynamics becomes xt+1 = xt (1−ϵ) xt+1 2 xt(1−ϵ) xt+1 2 +(1−xt)(1−ϵ) 2−xt 2 . Finally, we choose ϵ = 1 −e−10 and we get xt+1 = H(xt) = xt e−5(xt+1) xte−5(xt+1) + (1 −xt)e−5(2−xt) , i.e., we denote H(x) = xe−5(x+1) xe−5(x+1)+(1−x)e−5(2−x) . For the second example, we assume that ce1(l) = 1 4 · l and ce2(l) = 1.4 4 · l. Computing the expected costs we get that c1γ1 = 1+y 4 , c1γ2 = 1.4(2−y) 4 , c2γ1 = 1+x 4 , c2γ2 = 1.4(2−x) 4 . MWUe then becomes xt+1 = xt (1−ϵ1) (yt+1) 4 xt(1−ϵ1) yt+1 4 +(1−xt)(1−ϵ1) 1.4(2−yt) 4 (first player) and yt+1 = yt (1−ϵ2) xt+1 4 yt(1−ϵ2) xt+1 4 +(1−yt)(1−ϵ2) 1.4(2−xt) 4 (second player). We assume that ϵ1 = ϵ2 and also that x0 = y0 (players start with the same mixed strategy. Similarly, due to symmetry, it follows that xt = yt for all t ∈N, thus it suffices to keep track only of one variable and the dynamics becomes 8 xt+1 = xt (1−ϵ) xt+1 4 xt(1−ϵ) xt+1 4 +(1−xt)(1−ϵ) 1.4(2−xt) 4 . Finally, we choose ϵ = 1 −e−40 and we get xt+1 = G(xt) = xt e−10(xt+1) xte−10(xt+1) + (1 −xt)e−14(2−xt) , i.e., we denote G(x) = xe−10(x+1) xe−10(x+1)+(1−x)e−14(2−x) . We show the following three statements, the proofs of which can be found in the full version. Theorem 4.1. For all but a measure zero set S of x ∈(0, 1) we get that limt→∞H2t(x) = ρ1 or ρ2. Moreover, H(ρ1) = ρ2 and H(ρ2) = ρ1, i.e., {ρ1, ρ2} is a periodic orbit. Thus, all but a measure zero set S of initial conditions converge to the limit cycle {ρ1, ρ2}. Finally, the initial points in S converge to the equilibrium 1 2. Theorem 4.2. There exist two player two strategy symmetric congestion games such that MWUe has periodic orbits of length n for any natural number n > 0 and as well as an uncountably infinite set of “scrambled" initial conditions (Li-Yorke chaos). Using Theorem 4.2, we conclude with the following corollary. Corollary 4.3. For any 1 > ϵ > 0 and n, there exists a n-player congestion game G(ϵ) (depending on ϵ) so that MWUe dynamics exhibits Li-Yorke chaos for uncountably many starting points. 5 Conclusion and Future Work We have analyzed MWUℓin congestion games where agents use arbitrary admissible constants as learning rates ϵ and showed convergence to exact Nash equilibria. We have also shown that this result is not true for the nearly homologous exponential variant MWUe even for the simplest case of two-agent, two-strategy load balancing games. There we prove that such dynamics can provably lead to limit cycles or even chaotic behavior. For a small enough learning rate ϵ the behavior of MWUe approaches that of its smooth variant, replicator dynamics, and hence convergence is once again guaranteed [29]. This means that as we increase the learning rate ϵ from near zero values we start off with a convergent system and we end up with a chaotic one. Numerical experiments establish that between the convergent region and the chaotic region there exists a range of values for ϵ for which the system exhibits periodic behavior. Period doubling is known as standard route for 1-dimensional chaos (e.g. logistic map) and is characterized by unexpected regularities such as the Feigenbaum constant [39]. Elucidating these connections is an interesting open problem. More generally, what other type of regularities can be established in these non-equilibrium systems? Another interesting question has to do with developing a better understanding of the set of conditions that result to non-converging trajectories. So far, it has been critical for our non-convergent examples that the system starts from a symmetric initial condition. Whether such irregular MWUe trajectories can be constructed for generic initial conditions, possibly in larger congestion games, is not known. Nevertheless, the non-convergent results, despite their non-generic nature are rather useful since they imply that we cannot hope to leverage the power of Baum-Eagon techniques for MWUe. In conclusion, establishing generic (non)convergence results (e.g. for most initial conditions, most congestion games) for MWUe with constant step size is an interesting future direction. References [1] H. Ackermann, P. Berenbrink, S. Fischer, and M. Hoefer. Concurrent imitation dynamics in congestion games. In PODC, pages 63–72, New York, USA, 2009. ACM. [2] S. Arora, E. Hazan, and S. Kale. The multiplicative weights update method: a meta-algorithm and applications. Theory of Computing, 8(1):121–164, 2012. [3] I. Avramopoulos. Evolutionary stability implies asymptotic stability under multiplicative weights. CoRR, abs/1601.07267, 2016. 9 [4] M.-F. Balcan, F. Constantin, and R. Mehta. The weighted majority algorithm does not converge in nearly zero-sum games. In ICML Workshop on Markets, Mechanisms and Multi-Agent Models, 2012. [5] L. E. Baum and J. A. Eagon. An inequality with applications to statistical estimation for probabilistic functions of markov processes and to a model of ecology. Bulletin of the American Mathematical Society, 73(3):360–363, 1967. [6] P. Berenbrink, M. Hoefer, and T. Sauerwald. Distributed selfish load balancing on networks. In ACM Transactions on Algorithms (TALG), 2014. [7] P. Berenbrink, T. Friedetzky, L. A. Goldberg, P. W. Goldberg, Z. Hu, and R. Martin. Distributed selfish load balancing. SIAM J. Comput., 37(4):1163–1181, November 2007. [8] J. A Bilmes et al. A gentle tutorial of the em algorithm and its application to parameter estimation for gaussian mixture and hidden markov models. International Computer Science Institute, 4(510):126, 1998. [9] A. Blum, M. Hajiaghayi, K. Ligett, and A. Roth. Regret minimization and the price of total anarchy. In Proceedings of the 40th annual ACM symposium on Theory of computing, STOC, pages 373–382, 2008. [10] I. Caragiannis, A. Fanelli, N. Gravin, and A. Skopalik. Efficient computation of approximate pure nash equilibria in congestion games. In FOCS, 2011. [11] N. Cesa-Bianchi and G. Lugoisi. Prediction, Learning, and Games. Cambridge University Press, 2006. [12] P. Chen and C. Lu. Generalized mirror descents in congestion games. Artificial Intelligence, 241:217–243, 2016. [13] S. Chien and A. Sinclair. Convergence to approximate nash equilibria in congestion games. In Games and Economic Behavior, pages 315–327, 2011. [14] J. Cohen, A. Heliou, and P. Mertikopoulos. Learning with bandit feedback in potential games. In Proceedings of the 31th International Conference on Neural Information Processing Systems, 2017. [15] C. Daskalakis, R. Frongillo, C. Papadimitriou, G. Pierrakos, and G. Valiant. On learning algorithms for Nash equilibria. Symposium on Algorithmic Game Theory (SAGT), pages 114–125, 2010. [16] C. Daskalakis, C. Tzamos, and M. Zampetakis. A Converse to Banach’s Fixed Point Theorem and its CLS Completeness. ArXiv e-prints, February 2017. [17] C. Daskalakis, P. W. Goldberg, and C. H. Papadimitriou. The complexity of computing a nash equilibrium. pages 71–78. ACM Press, 2006. [18] C. Daskalakis and C. Papadimitriou. Continuous local search. In Proceedings of the Twentysecond Annual ACM-SIAM Symposium on Discrete Algorithms, SODA ’11, pages 790–804, Philadelphia, PA, USA, 2011. Society for Industrial and Applied Mathematics. [19] R. Engelberg, A. Fabrikant, M. Schapira, and D. Wajc. Best-response dynamics out of sync: Complexity and characterization. In Proceedings of the Fourteenth ACM Conference on Electronic Commerce, EC ’13, pages 379–396, New York, NY, USA, 2013. ACM. [20] A. Fabrikant, C. Papadimitriou, and K. Talwar. The complexity of pure Nash equilibria. In ACM Symposium on Theory of Computing (STOC), pages 604–612. ACM, 2004. [21] J. Fearnley, S. Gordon, R. Mehta, and R. Savani. CLS: New Problems and Completeness. ArXiv e-prints, February 2017. [22] D. J Foster, T. Lykouris, K. Sridharan, and E. Tardos. Learning in games: Robustness of fast convergence. In Advances in Neural Information Processing Systems, pages 4727–4735, 2016. 10 [23] D. Fotakis, A. C. Kaporis, and P. G. Spirakis. Atomic congestion games: Fast, myopic and concurrent. In Burkhard Monien and Ulf-Peter Schroeder, editors, Algorithmic Game Theory, volume 4997 of Lecture Notes in Computer Science, pages 121–132. Springer Berlin Heidelberg, 2008. [24] D. Fudenberg and D. K. Levine. The Theory of Learning in Games. MIT Press Books. The MIT Press, 1998. [25] A. D Jaggard, N. Lutz, M. Schapira, and R. N Wright. Dynamics at the boundary of game theory and distributed computing. ACM Transactions on Economics and Computation (TEAC), 2017. [26] A. D Jaggard, M. Schapira, and R. N Wright. Distributed computing with adaptive heuristics. In ICS, 2011. [27] R. Kleinberg, K. Ligett, G. Piliouras, and É. Tardos. Beyond the Nash equilibrium barrier. In Symposium on Innovations in Computer Science (ICS), 2011. [28] R. Kleinberg, G. Piliouras, and É. Tardos. Load balancing without regret in the bulletin board model. Distributed Computing, 24(1):21–29, 2011. [29] R. Kleinberg, G. Piliouras, and É. Tardos. Multiplicative updates outperform generic no-regret learning in congestion games. In ACM Symposium on Theory of Computing (STOC), 2009. [30] T. Li and J. A. Yorke. Period three implies chaos. The American Mathematical Monthly, 82(10):985–992, 1975. [31] P. Mertikopoulos and A. L. Moustakas. The emergence of rational behavior in the presence of stochastic perturbations. The Annals of Applied Probability, 20(4):1359–1388, 2010. [32] D. Monderer and L. S. Shapley. Potential games. Games and Economic Behavior, pages 124–143, 1996. [33] D. Monderer and L. S Shapley. Fictitious play property for games with identical interests. Journal of economic theory, 68(1):258–265, 1996. [34] N. Nisan, M. Schapira, and A. Zohar. Asynchronous best-reply dynamics. In International Workshop on Internet and Network Economics, pages 531–538. Springer, 2008. [35] G. Piliouras and J. S. Shamma. Optimization despite chaos: Convex relaxations to complex limit sets via Poincaré recurrence. In SODA, 2014. [36] R.W. Rosenthal. A class of games possessing pure-strategy Nash equilibria. International Journal of Game Theory, 2(1):65–67, 1973. [37] T. Roughgarden. Intrinsic robustness of the price of anarchy. In Proc. of STOC, pages 513–522, 2009. [38] A.N. Sharkovskii. Co-existence of cycles of a continuous mapping of the line into itself. Ukrainian Math. J., 16:61 – 71, 1964. [39] S. Strogatz. Nonlinear Dynamics and Chaos. Perseus Publishing, 2000. [40] V. Syrgkanis, A. Agarwal, H. Luo, and R. E. Schapire. Fast convergence of regularized learning in games. In Proceedings of the 28th International Conference on Neural Information Processing Systems, NIPS’15, pages 2989–2997, Cambridge, MA, USA, 2015. MIT Press. [41] L. R Welch. Hidden markov models and the baum-welch algorithm. IEEE Information Theory Society Newsletter, 53(4):10–13, 2003. 11
2017
613
7,134
QMDP-Net: Deep Learning for Planning under Partial Observability Peter Karkus1,2 David Hsu1,2 Wee Sun Lee2 1NUS Graduate School for Integrative Sciences and Engineering 2School of Computing National University of Singapore {karkus, dyhsu, leews}@comp.nus.edu.sg Abstract This paper introduces the QMDP-net, a neural network architecture for planning under partial observability. The QMDP-net combines the strengths of model-free learning and model-based planning. It is a recurrent policy network, but it represents a policy for a parameterized set of tasks by connecting a model with a planning algorithm that solves the model, thus embedding the solution structure of planning in a network learning architecture. The QMDP-net is fully differentiable and allows for end-to-end training. We train a QMDPnet on different tasks so that it can generalize to new ones in the parameterized task set and “transfer” to other similar tasks beyond the set. In preliminary experiments, QMDP-net showed strong performance on several robotic tasks in simulation. Interestingly, while QMDP-net encodes the QMDP algorithm, it sometimes outperforms the QMDP algorithm in the experiments, as a result of end-to-end learning. 1 Introduction Decision-making under uncertainty is of fundamental importance, but it is computationally hard, especially under partial observability [24]. In a partially observable world, the agent cannot determine the state exactly based on the current observation; to plan optimal actions, it must integrate information over the past history of actions and observations. See Fig. 1 for an example. In the model-based approach, we may formulate the problem as a partially observable Markov decision process (POMDP). Solving POMDPs exactly is computationally intractable in the worst case [24]. Approximate POMDP algorithms have made dramatic progress on solving large-scale POMDPs [17, 25, 29, 32, 37]; however, manually constructing POMDP models or learning them from data remains difficult. In the model-free approach, we directly search for an optimal solution within a policy class. If we do not restrict the policy class, the difficulty is data and computational efficiency. We may choose a parameterized policy class. The effectiveness of policy search is then constrained by this a priori choice. Deep neural networks have brought unprecedented success in many domains [16, 21, 30] and provide a distinct new approach to decision-making under uncertainty. The deep Q-network (DQN), which consists of a convolutional neural network (CNN) together with a fully connected layer, has successfully tackled many Atari games with complex visual input [21]. Replacing the postconvolutional fully connected layer of DQN by a recurrent LSTM layer allows it to deal with partial observaiblity [10]. However, compared with planning, this approach fails to exploit the underlying sequential nature of decision-making. We introduce QMDP-net, a neural network architecture for planning under partial observability. QMDP-net combines the strengths of model-free learning and model-based planning. A QMDP-net is a recurrent policy network, but it represents a policy by connecting a POMDP model with an algorithm that solves the model, thus embedding the solution structure of planning in a network 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. (a) (b) (c) (d) Fig. 1: A robot learning to navigate in partially observable grid worlds. (a) The robot has a map. It has a belief over the initial state, but does not know the exact initial state. (b) Local observations are ambiguous and are insufficient to determine the exact state. (c, d) A policy trained on expert demonstrations in a set of randomly generated environments generalizes to a new environment. It also “transfers” to a much larger real-life environment, represented as a LIDAR map [12]. learning architecture. Specifically, our network uses QMDP [18], a simple, but fast approximate POMDP algorithm, though other more sophisticated POMDP algorithms could be used as well. A QMDP-net consists of two main network modules (Fig. 2). One represents a Bayesian filter, which integrates the history of an agent’s actions and observations into a belief, i.e. a probabilistic estimate of the agent’s state. The other represents the QMDP algorithm, which chooses the action given the current belief. Both modules are differentiable, allowing the entire network to be trained end-to-end. We train a QMDP-net on expert demonstrations in a set of randomly generated environments. The trained policy generalizes to new environments and also “transfers” to more complex environments (Fig. 1c–d). Preliminary experiments show that QMDP-net outperformed state-of-the-art network architectures on several robotic tasks in simulation. It successfully solved difficult POMDPs that require reasoning over many time steps, such as the well-known Hallway2 domain [18]. Interestingly, while QMDP-net encodes the QMDP algorithm, it sometimes outperformed the QMDP algorithm in our experiments, as a result of end-to-end learning. 2 Background 2.1 Planning under Uncertainty A POMDP is formally defined as a tuple (S, A, O, T, Z, R), where S, A and O are the state, action, and observation space, respectively. The state-transition function T(s, a, s0) = P(s0|s, a) defines the probability of the agent being in state s0 after taking action a in state s. The observation function Z(s, a, o) = p(o|s, a) defines the probability of receiving observation o after taking action a in state s. The reward function R(s, a) defines the immediate reward for taking action a in state s. In a partially observable world, the agent does not know its exact state. It maintains a belief, which is a probability distribution over S. The agent starts with an initial belief b0 and updates the belief bt at each time step t with a Bayesian filter: bt(s0) = ⌧(bt−1, at, ot) = ⌘Z(s0, at, ot) P s2S T(s, at, s0)bt−1(s), (1) where ⌘is a normalizing constant. The belief bt recursively integrates information from the entire past history (a1, o1, a2, o2, . . . , at, ot) for decision making. POMDP planning seeks a policy ⇡that maximizes the value, i.e., the expected total discounted reward: V⇡(b0) = E "P1 t=0 γtR(st, at+1) ## b0, ⇡ $ , (2) where st is the state at time t, at+1 = ⇡(bt) is the action that the policy ⇡chooses at time t, and γ 2 (0, 1) is a discount factor. 2.2 Related Work To learn policies for decision making in partially observable domains, one approach is to learn models [6, 19, 26] and solve the models through planning. An alternative is to learn policies directly [2, 5]. Model learning is usually not end-to-end. While policy learning can be end-to-end, it does not exploit model information for effective generalization. Our proposed approach combines model-based and 2 model-free learning by embedding a model and a planning algorithm in a recurrent neural network (RNN) that represents a policy and then training the network end-to-end. RNNs have been used earlier for learning in partially observable domains [4, 10, 11]. In particular, Hausknecht and Stone extended DQN [21], a convolutional neural network (CNN), by replacing its post-convolutional fully connected layer with a recurrent LSTM layer [10]. Similarly, Mirowski et al. [20] considered learning to navigate in partially observable 3-D mazes. The learned policy generalizes over different goals, but in a fixed environment. Instead of using the generic LSTM, our approach embeds algorithmic structure specific to sequential decision making in the network architecture and aims to learn a policy that generalizes to new environments. The idea of embedding specific computation structures in the neural network architecture has been gaining attention recently. Tamar et al. implemented value iteration in a neural network, called Value Iteration Network (VIN), to solve Markov decision processes (MDPs) in fully observable domains, where an agent knows its exact state and does not require filtering [34]. Okada et al. addressed a related problem of path integral optimal control, which allows for continuous states and actions [23]. Neither addresses the issue of partial observability, which drastically increases the computational complexity of decision making [24]. Haarnoja et al. [9] and Jonschkowski and Brock [15] developed end-to-end trainable Bayesian filters for probabilistic state estimation. Silver et al. introduced Predictron for value estimation in Markov reward processes [31]. They do not deal with decision making or planning. Both Shankar et al. [28] and Gupta et al. [8] addressed planning under partial observability. The former focuses on learning a model rather than a policy. The learned model is trained on a fixed environment and does not generalize to new ones. The latter proposes a network learning approach to robot navigation in an unknown environment, with a focus on mapping. Its network architecture contains a hierarchical extension of VIN for planning and thus does not deal with partial observability during planning. The QMDP-net extends the prior work on network architectures for MDP planning and for Bayesian filtering. It imposes the POMDP model and computation structure priors on the entire network architecture for planning under partial observability. 3 Overview We want to learn a policy that enables an agent to act effectively in a diverse set of partially observable stochastic environments. Consider, for example, the robot navigation domain in Fig. 1. The environments may correspond to different buildings. The robot agent does not observe its own location directly, but estimates it based on noisy readings from a laser range finder. It has access to building maps, but does not have models of its own dynamics and sensors. While the buildings may differ significantly in their layouts, the underlying reasoning required for effective navigation is similar in all buildings. After training the robot in a few buildings, we want to place the robot in a new building and have it navigate effectively to a specified goal. Formally, the agent learns a policy for a parameterized set of tasks in partially observable stochastic environments: W⇥= {W(✓) | ✓2 ⇥}, where ⇥is the set of all parameter values. The parameter value ✓captures a wide variety of task characteristics that vary within the set, including environments, goals, and agents. In our robot navigation example, ✓encodes a map of the environment, a goal, and a belief over the robot’s initial state. We assume that all tasks in W⇥share the same state space, action space, and observation space. The agent does not have prior models of its own dynamics, sensors, or task objectives. After training on tasks for some subset of values in ⇥, the agent learns a policy that solves W(✓) for any given ✓2 ⇥. A key issue is a general representation of a policy for W⇥, without knowing the specifics of W⇥or its parametrization. We introduce the QMDP-net, a recurrent policy network. A QMDP-net represents a policy by connecting a parameterized POMDP model with an approximate POMDP algorithm and embedding both in a single, differentiable neural network. Embedding the model allows the policy to generalize over W⇥effectively. Embedding the algorithm allows us to train the entire network end-to-end and learn a model that compensates for the limitations of the approximate algorithm. Let M(✓)=(S, A, O, fT(·|✓), fZ(·|✓), fR(·|✓)) be the embedded POMDP model, where S, A and O are the shared state space, action space, observation space designed manually for all tasks in W⇥and fT(·|·), fZ(·|·), fR(·|·) are the state-transition, observation, and reward functions to be learned from data. It may appear that a perfect answer to our learning problem would have 3 (a) Policy (b) QMDP planner Bayesian filter (c) QMDP planner QMDP planner QMDP planner Bayesian filter Bayesian filter Bayesian filter Fig. 2: QMDP-net architecture. (a) A policy maps a history of actions and observations to a new action. (b) A QMDP-net is an RNN that imposes structure priors for sequential decision making under partial observability. It embeds a Bayesian filter and the QMDP algorithm in the network. The hidden state of the RNN encodes the belief for POMDP planning. (c) A QMDP-net unfolded in time. fT(·|✓), fZ(·|✓), and fR(·|✓) represent the “true” underlying models of dynamics, observation, and reward for the task W(✓). This is true only if the embedded POMDP algorithm is exact, but not true in general. The agent may learn an alternative model to mitigate an approximate algorithm’s limitations and obtain an overall better policy. In this sense, while QMDP-net embeds a POMDP model in the network architecture, it aims to learn a good policy rather than a “correct” model. A QMDP-net consists of two modules (Fig. 2). One encodes a Bayesian filter, which performs state estimation by integrating the past history of agent actions and observations into a belief. The other encodes QMDP, a simple, but fast approximate POMDP planner [18]. QMDP chooses the agent’s actions by solving the corresponding fully observable Markov decision process (MDP) and performing one-step look-ahead search on the MDP values weighted by the belief. We evaluate the proposed network architecture in an imitation learning setting. We train on a set of expert trajectories with randomly chosen task parameter values in ⇥and test with new parameter values. An expert trajectory consist of a sequence of demonstrated actions and observations (a1, o1, a2, o2, . . .) for some ✓2 ⇥. The agent does not access the ground-truth states or beliefs along the trajectory during the training. We define loss as the cross entropy between predicted and demonstrated action sequences and use RMSProp [35] for training. See Appendix C.7 for details. Our implementation in Tensorflow [1] is available online at http://github.com/AdaCompNUS/qmdp-net. 4 QMDP-Net We assume that all tasks in a parameterized set W⇥share the same underlying state space S, action space A, and observation space O. We want to learn a QMDP-net policy for W⇥, conditioned on the parameters ✓2 ⇥. A QMDP-net is a recurrent policy network. The inputs to a QMDP-net are the action at 2 A and the observation ot 2 O at time step t, as well as the task parameter ✓2 ⇥. The output is the action at+1 for time step t + 1. A QMDP-net encodes a parameterized POMDP model M(✓)=(S, A, O, T =fT(·|✓), Z = fZ(·|✓), R=fR(·|✓)) and the QMDP algorithm, which selects actions by solving the model approximately. We choose S, A, and O of M(✓) manually, based on prior knowledge on W⇥, specifically, prior knowledge on S, A, and O. In general, S 6= S, A 6= A, and O 6= O. The model states, actions, and observations may be abstractions of their real-world counterparts in the task. In our robot navigation example (Fig. 1), while the robot moves in a continuous space, we choose S to be a grid of finite size. We can do the same for A and O, in order to reduce representational and computational complexity. The transition function T, observation function Z, and reward function R of M(✓) are conditioned on ✓, and are learned from data through end-to-end training. In this work, we assume that T is the same for all tasks in W⇥to simplify the network architecture. In other words, T does not depend on ✓. End-to-end training is feasible, because a QMDP-net encodes both a model and the associated algorithm in a single, fully differentiable neural network. The main idea for embedding the algorithm in a neural network is to represent linear operations, such as matrix multiplication and summation, by convolutional layers and represent maximum operations by max-pooling layers. Below we provide some details on the QMDP-net’s architecture, which consists of two modules, a filter and a planner. 4 (a) Bayesian filter module (b) QMDP planner module Fig. 3: A QMDP-net consists of two modules. (a) The Bayesian filter module incorporates the current action at and observation ot into the belief. (b) The QMDP planner module selects the action according to the current belief bt. Filter module. The filter module (Fig. 3a) implements a Bayesian filter. It maps from a belief, action, and observation to a next belief, bt+1 = f(bt|at, ot). The belief is updated in two steps. The first accounts for actions, the second for observations: b0 t(s) = P s02S T(s0, at, s)bt(s0), (3) bt+1(s) = ⌘Z(s, ot)b0 t(s), (4) where ot 2 O is the observation received after taking action at 2 A and ⌘is a normalization factor. We implement the Bayesian filter by transforming Eq. (3) and Eq. (4) to layers of a neural network. For ease of discussion consider our N⇥N grid navigation task (Fig. 1a–c). The agent does not know its own state and only observes neighboring cells. It has access to the task parameter ✓that encodes the obstacles, goal, and a belief over initial states. Given the task, we choose M(✓) to have a N⇥N state space. The belief, bt(s), is now an N⇥N tensor. Eq. (3) is implemented as a convolutional layer with |A| convolutional filters. We denote the convolutional layer by fT. The kernel weights of fT encode the transition function T in M(✓). The output of the convolutional layer, b0 t(s, a), is a N⇥N⇥|A| tensor. b0 t(s, a) encodes the updated belief after taking each of the actions, a 2 A. We need to select the belief corresponding to the last action taken by the agent, at. We can directly index b0 t(s, a) by at if A = A. In general A 6= A, so we cannot use simple indexing. Instead, we will use “soft indexing”. First we encode actions in A to actions in A through a learned function fA. fA maps from at to an indexing vector wa t , a distribution over actions in A. We then weight b0 t(s, a) by wa t along the appropriate dimension, i.e. b0 t(s) = P a2A b0 t(s, a)wa t . (5) Eq. (4) incorporates observations through an observation model Z(s, o). Now Z(s, o) is a N⇥N⇥|O| tensor that represents the probability of receiving observation o 2 O in state s 2 S. In our grid navigation task observations depend on the obstacle locations. We condition Z on the task parameter, Z(s, o) = fZ(s, o|✓) for ✓2 ⇥. The function fZ is a neural network, mapping from ✓to Z(s, o). In this paper fZ is a CNN. Z(s, o) encodes observation probabilities for each of the observations, o 2 O. We need the observation probabilities for the last observation ot. In general O 6= O and we cannot index Z(s, o) directly. Instead, we will use soft indexing again. We encode observations in O to observations in O through fO. fO is a function mapping from ot to an indexing vector, wo t , a distribution over O. We then weight Z(s, o) by wo t , i.e. Z(s) = P o2O Z(s, o)wo t . (6) Finally, we obtain the updated belief, bt+1(s), by multiplying b0 t(s) and Z(s) element-wise, and normalizing over states. In our setting the initial belief for the task W(✓) is encoded in ✓. We initialize the belief in QMDP-net through an additional encoding function, b0 = fB(✓). 5 Planner module. The QMDP planner (Fig. 3b) performs value iteration at its core. Q values are computed by iteratively applying Bellman updates, Qk+1(s, a) = R(s, a) + γ P s02S T(s, a, s0)Vk(s0), (7) Vk(s) = maxa Qk(s, a). (8) Actions are then selected by weighting the Q values with the belief. We can implement value iteration using convolutional and max pooling layers [28, 34]. In our grid navigation task Q(s, a) is a N⇥N⇥|A| tensor. Eq. (8) is expressed by a max pooling layer, where Qk(s, a) is the input and Vk(s) is the output. Eq. (7) is a N⇥N convolution with |A| convolutional filters, followed by an addition operation with R(s, a), the reward tensor. We denote the convolutional layer by f 0 T. The kernel weights of f 0 T encode the transition function T, similarly to fT in the filter. Rewards for a navigation task depend on the goal and obstacles. We condition rewards on the task parameter, R(s, a) = fR(s, a|✓). fR maps from ✓to R(s, a). In this paper fR is a CNN. We implement K iterations of Bellman updates by stacking the layers representing Eq. (7) and Eq. (8) K times with tied weights. After K iterations we get QK(s, a), the approximate Q values for each state-action pair. We weight the Q values by the belief to obtain action values, q(a) = P s2S QK(s, a)bt(s). (9) Finally, we choose the output action through a low-level policy function, f⇡, mapping from q(a) to the action output, at+1. QMDP-net naturally extends to higher dimensional discrete state spaces (e.g. our maze navigation task) where n-dimensional convolutions can be used [14]. While M(✓) is restricted to a discrete space, we can handle continuous tasks W⇥by simultaneously learning a discrete M(✓) for planning, and fA, fO, fB, f⇡to map between states, actions and observations in W⇥and M(✓). 5 Experiments The main objective of the experiments is to understand the benefits of structure priors on learning neural-network policies. We create several alternative network architectures by gradually relaxing the structure priors and evaluate the architectures on simulated robot navigation and manipulation tasks. While these tasks are simpler than, for example, Atari games, in terms of visual perception, they are in fact very challenging, because of the sophisticated long-term reasoning required to handle partial observability and distant future rewards. Since the exact state of the robot is unknown, a successful policy must reason over many steps to gather information and improve state estimation through partial and noisy observations. It also must reason about the trade-off between the cost of information gathering and the reward in the distance future. 5.1 Experimental Setup We compare the QMDP-net with a number of related alternative architectures. Two are QMDP-net variants. Untied QMDP-net relaxes the constraints on the planning module by untying the weights representing the state-transition function over the different CNN layers. LSTM QMDP-net replaces the filter module with a generic LSTM module. The other two architectures do not embed POMDP structure priors at all. CNN+LSTM is a state-of-the-art deep CNN connected to an LSTM. It is similar to the DRQN architecture proposed for reinforcement learning under partially observability [10]. RNN is a basic recurrent neural network with a single fully-connected hidden layer. RNN contains no structure specific to planning under partial observability. Each experimental domain contains a parameterized set of tasks W⇥. The parameters ✓encode an environment, a goal, and a belief over the robot’s initial state. To train a policy for W⇥, we generate random environments, goals, and initial beliefs. We construct ground-truth POMDP models for the generated data and apply the QMDP algorithm. If the QMDP algorithm successfully reaches the goal, we then retain the resulting sequence of action and observations (a1, o1, a2, o2, . . .) as an expert trajectory, together with the corresponding environment, goal, and initial belief. It is important to note that the ground-truth POMDPs are used only for generating expert trajectories and not for learning the QMDP-net. 6 For fair comparison, we train all networks using the same set of expert trajectories in each domain. We perform basic search over training parameters, the number of layers, and the number of hidden units for each network architecture. Below we briefly describe the experimental domains. See Appendix C for implementation details. Grid-world navigation. A robot navigates in an unknown building given a floor map and a goal. The robot is uncertain of its own location. It is equipped with a LIDAR that detects obstacles in its direct neighborhood. The world is uncertain: the robot may fail to execute desired actions, possibly because of wheel slippage, and the LIDAR may produce false readings. We implemented a simplified version of this task in a discrete n⇥n grid world (Fig. 1c). The task parameter ✓is represented as an n⇥n image with three channels. The first channel encodes the obstacles in the environment, the second channel encodes the goal, and the last channel encodes the belief over the robot’s initial state. The robot’s state represents its position in the grid. It has five actions: moving in each of the four canonical directions or staying put. The LIDAR observations are compressed into four binary values corresponding to obstacles in the four neighboring cells. We consider both a deterministic and a stochastic variant of the domain. The stochastic variant adds action and observation uncertainties. The robot fails to execute the specified move action and stays in place with probability 0.2. The observations are faulty with probability 0.1 independently in each direction. We trained a policy using expert trajectories from 10, 000 random environments, 5 trajectories from each environment. We then tested on a separate set of 500 random environments. Fig. 4: Highly ambiguous observations in a maze. The four observations (in red) are the same, despite that the robot states are all different. Maze navigation. A differential-drive robot navigates in a maze with the help of a map, but it does not know its pose (Fig. 1d). This domain is similar to the grid-world navigation, but it is significant more challenging. The robot’s state contains both its position and orientation. The robot cannot move freely because of kinematic constraints. It has four actions: move forward, turn left, turn right and stay put. The observations are relative to the robot’s current orientation, and the increased ambiguity makes it more difficult to localize the robot, especially when the initial state is highly uncertain. Finally, successful trajectories in mazes are typically much longer than those in randomly-generated grid worlds. Again we trained on expert trajectories in 10, 000 randomly generated mazes and tested them in 500 new ones. (a) (b) Fig. 5: Object grasping using touch sensing. (a) An example [3]. (b) Simplified 2-D object grasping. Objects from the training set (top) and the test set (bottom). 2-D object grasping. A robot gripper picks up novel objects from a table using a two-finger hand with noisy touch sensors at the finger tips. The gripper uses the fingers to perform compliant motions while maintaining contact with the object or to grasp the object. It knows the shape of the object to be grasped, maybe from an object database. However, it does not know its own pose relative to the object and relies on the touch sensors to localize itself. We implemented a simplified 2-D variant of this task, modeled as a POMDP [13]. The task parameter ✓ is an image with three channels encoding the object shape, the grasp point, and a belief over the gripper’s initial pose. The gripper has four actions, each moving in a canonical direction unless it touches the object or the environment boundary. Each finger has 3 binary touch sensors at the tip, resulting in 64 distinct observations. We trained on expert demonstration on 20 different objects with 500 randomly sampled poses for each object. We then tested on 10 previously unseen objects in random poses. 5.2 Choosing QMDP-Net Components for a Task Given a new task W⇥, we need to choose an appropriate neural network representation for M(✓). More specifically, we need to choose S, A and O, and a representation for the functions fR, fT, f 0 T, fZ, fO, fA, fB, f⇡. This provides an opportunity to incorporate domain knowledge in a principled way. For example, if W⇥has a local and spatially invariant connectivity structure, we can choose convolutions with small kernels to represent fT, fR and fZ. 7 In our experiments we use S =N⇥N for N⇥N grid navigation, and S =N⇥N⇥4 for N⇥N maze navigation where the robot has 4 possible orientations. We use |A| = |A| and |O| = |O| for all tasks except for the object grasping task, where |O| = 64 and |O| = 16. We represent fT, fR and fZ by CNN components with 3⇥3 and 5⇥5 kernels depending on the task. We enforce that fT and fZ are proper probability distributions by using softmax and sigmoid activations on the convolutional kernels, respectively. Finally, fO is a small fully connected component, fA is a one-hot encoding function, f⇡is a single softmax layer, and fB is the identity function. We can adjust the amount of planning in a QMDP-net by setting K. A large K allows propagating information to more distant states without affecting the number of parameters to learn. However, it results in deeper networks that are computationally expensive to evaluate and more difficult to train. We used K = 20 . . . 116 depending on the problem size. We were able to transfer policies to larger environments by increasing K up to 450 when executing the policy. In our experiments the representation of the task parameter ✓is isomorphic to the chosen state space S. While the architecture is not restricted to this setting, we rely on it to represent fT, fZ, fR by convolutions with small kernels. Experiments with a more general class of problems is an interesting direction for future work. 5.3 Results and Discussion The main results are reported in Table 1. Some additional results are reported in Appendix A. For each domain, we report the task success rate and the average number of time steps for task completion. Comparing the completion time is meaningful only when the success rates are similar. QMDP-net successfully learns policies that generalize to new environments. When evaluated on new environments, the QMDP-net has higher success rate and faster completion time than the alternatives in nearly all domains. To understand better the performance difference, we specifically compared the architectures in a fixed environment for navigation. Here only the initial state and the goal vary across the task instances, while the environment remains the same. See the results in the last row of Table 1. The QMDP-net and the alternatives have comparable performance. Even RNN performs very well. Why? In a fixed environment, a network may learn the features of an optimal policy directly, e.g., going straight towards the goal. In contrast, the QMDP-net learns a model for planning, i.e., generating a near-optimal policy for a given arbitrary environment. POMDP structure priors improve the performance of learning complex policies. Moving across Table 1 from left to right, we gradually relax the POMDP structure priors on the network architecture. As the structure priors weaken, so does the overall performance. However, strong priors sometimes over-constrain the network and result in degraded performance. For example, we found that tying the weights of fT in the filter and f 0 T in the planner may lead to worse policies. While both fT and f 0 T represent the same underlying transition dynamics, using different weights allows each to choose its own approximation and thus greater flexibility. We shed some light on this issue and visualize the learned POMDP model in Appendix B. QMDP-net learns “incorrect”, but useful models. Planning under partial observability is intractable in general, and we must rely on approximation algorithms. A QMDP-net encodes both a POMDP model and QMDP, an approximate POMDP algorithm that solves the model. We then train the network end-to-end. This provides the opportunity to learn an “incorrect”, but useful model that compensates the limitation of the approximation algorithm, in a way similar to reward shaping in reinforcement learning [22]. Indeed, our results show that the QMDP-net achieves higher success rate than QMDP in nearly all tasks. In particular, QMDP-net performs well on the well-known Hallway2 domain, which is designed to expose the weakness of QMDP resulting from its myopic planning horizon. The planning algorithm is the same for both the QMDP-net and QMDP, but the QMDP-net learns a more effective model from expert demonstrations. This is true even though QMDP generates the expert data for training. We note that the expert data contain only successful QMDP demonstrations. When both successful and unsuccessful QMDP demonstrations were used for training, the QMDP-net did not perform better than QMDP, as one would expect. QMDP-net policies learned in small environments transfer directly to larger environments. Learning a policy for large environments from scratch is often difficult. A more scalable approach 8 Table 1: Performance comparison of QMDP-net and alternative architectures for recurrent policy networks. SR is the success rate in percentage. Time is the average number of time steps for task completion. D-n and S-n denote deterministic and stochastic variants of a domain with environment size n⇥n. QMDP QMDP-net Untied LSTM CNN RNN QMDP-net QMDP-net +LSTM Domain SR Time SR Time SR Time SR Time SR Time SR Time Grid D-10 99.8 8.8 99.6 8.2 98.6 8.3 84.4 12.8 90.0 13.4 87.8 13.4 Grid D-18 99.0 15.5 99.0 14.6 98.8 14.8 43.8 27.9 57.8 33.7 35.8 24.5 Grid D-30 97.6 24.6 98.6 25.0 98.8 23.9 22.2 51.1 19.4 45.2 16.4 39.3 Grid S-18 98.1 23.9 98.8 23.9 95.9 24.0 23.8 55.6 41.4 65.9 34.0 64.1 Maze D-29 63.2 54.1 98.0 56.5 95.4 62.5 9.8 57.2 9.2 41.4 9.8 47.0 Maze S-19 63.1 50.5 93.9 60.4 98.7 57.1 18.9 79.0 19.2 80.8 19.6 82.1 Hallway2 37.3 28.2 82.9 64.4 69.6 104.4 82.8 89.7 77.8 99.5 68.0 108.8 Grasp 98.3 14.6 99.6 18.2 98.9 20.4 91.4 26.4 92.8 22.1 94.1 25.7 Intel Lab 90.2 85.4 94.4 107.7 20.0 55.3 Freiburg 88.4 66.9 93.2 81.1 37.4 51.7 Fixed grid 98.8 17.4 98.6 17.6 99.8 17.0 97.0 19.7 98.4 19.9 98.0 19.8 would be to learn a policy in small environments and transfer it to large environments by repeating the reasoning process. To transfer a learned QMDP-net policy, we simply expand its planning module by adding more recurrent layers. Specifically, we trained a policy in randomly generated 30 ⇥30 grid worlds with K = 90. We then set K = 450 and applied the learned policy to several real-life environments, including Intel Lab (100⇥101) and Freiburg (139⇥57), using their LIDAR maps (Fig. 1c) from the Robotics Data Set Repository [12]. See the results for these two environments in Table 1. Additional results with different K settings and other buildings are available in Appendix A. 6 Conclusion A QMDP-net is a deep recurrent policy network that embeds POMDP structure priors for planning under partial observability. While generic neural networks learn a direct mapping from inputs to outputs, QMDP-net learns how to model and solve a planning task. The network is fully differentiable and allows for end-to-end training. Experiments on several simulated robotic tasks show that learned QMDP-net policies successfully generalize to new environments and transfer to larger environments as well. The POMDP structure priors and end-to-end training substantially improve the performance of learned policies. Interestingly, while a QMDP-net encodes the QMDP algorithm for planning, learned QMDP-net policies sometimes outperform QMDP. There are many exciting directions for future exploration. First, a major limitation of our current approach is the state space representation. The value iteration algorithm used in QMDP iterates through the entire state space and is well known to suffer from the “curse of dimensionality”. To alleviate this difficulty, the QMDP-net, through end-to-end training, may learn a much smaller abstract state space representation for planning. One may also incorporate hierarchical planning [8]. Second, QMDP makes strong approximations in order to reduce computational complexity. We want to explore the possibility of embedding more sophisticated POMDP algorithms in the network architecture. While these algorithms provide stronger planning performance, their algorithmic sophistication increases the difficulty of learning. Finally, we have so far restricted the work to imitation learning. It would be exciting to extend it to reinforcement learning. Based on earlier work [28, 34], this is indeed promising. Acknowledgments We thank Leslie Kaelbling and Tomás Lozano-Pérez for insightful discussions that helped to improve our understanding of the problem. The work is supported in part by Singapore Ministry of Education AcRF grant MOE2016-T2-2-068 and National University of Singapore AcRF grant R-252-000-587112. 9 References [1] M. Abadi, A. Agarwal, P. Barham, E. Brevdo, Z. Chen, C. Citro, G. S. Corrado, A. Davis, J. Dean, M. Devin, et al. TensorFlow: Large-scale machine learning on heterogeneous systems, 2015. URL http://tensorflow.org/. [2] J. A. Bagnell, S. Kakade, A. Y. Ng, and J. G. Schneider. Policy search by dynamic programming. In Advances in Neural Information Processing Systems, pages 831–838, 2003. [3] H. Bai, D. Hsu, W. S. Lee, and V. A. Ngo. Monte carlo value iteration for continuous-state POMDPs. In Algorithmic Foundations of Robotics IX, pages 175–191, 2010. [4] B. Bakker, V. Zhumatiy, G. Gruener, and J. Schmidhuber. A robot that reinforcement-learns to identify and memorize important previous observations. In International Conference on Intelligent Robots and Systems, pages 430–435, 2003. [5] J. Baxter and P. L. Bartlett. Infinite-horizon policy-gradient estimation. Journal of Artificial Intelligence Research, 15:319–350, 2001. [6] B. Boots, S. M. Siddiqi, and G. J. Gordon. Closing the learning-planning loop with predictive state representations. The International Journal of Robotics Research, 30(7):954–966, 2011. [7] K. Cho, B. Van Merriënboer, C. Gulcehre, D. Bahdanau, F. Bougares, H. Schwenk, and Y. Bengio. Learning phrase representations using RNN encoder-decoder for statistical machine translation. arXiv preprint arXiv:1406.1078, 2014. [8] S. Gupta, J. Davidson, S. Levine, R. Sukthankar, and J. Malik. Cognitive mapping and planning for visual navigation. arXiv preprint arXiv:1702.03920, 2017. [9] T. Haarnoja, A. Ajay, S. Levine, and P. Abbeel. Backprop kf: Learning discriminative deterministic state estimators. In Advances in Neural Information Processing Systems, pages 4376–4384, 2016. [10] M. J. Hausknecht and P. Stone. Deep recurrent Q-learning for partially observable MDPs. arXiv preprint, 2015. URL http://arxiv.org/abs/1507.06527. [11] S. Hochreiter and J. Schmidhuber. Long short-term memory. Neural Computation, 9(8):1735–1780, 1997. [12] A. Howard and N. Roy. The robotics data set repository (radish), 2003. URL http://radish. sourceforge.net/. [13] K. Hsiao, L. P. Kaelbling, and T. Lozano-Pérez. Grasping POMDPs. In International Conference on Robotics and Automation, pages 4685–4692, 2007. [14] S. Ji, W. Xu, M. Yang, and K. Yu. 3D convolutional neural networks for human action recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence, 35(1):221–231, 2013. [15] R. Jonschkowski and O. Brock. End-to-end learnable histogram filters. In Workshop on Deep Learning for Action and Interaction at NIPS, 2016. URL http://www.robotics.tu-berlin.de/fileadmin/ fg170/Publikationen_pdf/Jonschkowski-16-NIPS-WS.pdf. [16] A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems, pages 1097–1105, 2012. [17] H. Kurniawati, D. Hsu, and W. S. Lee. Sarsop: Efficient point-based POMDP planning by approximating optimally reachable belief spaces. In Robotics: Science and Systems, volume 2008, 2008. [18] M. L. Littman, A. R. Cassandra, and L. P. Kaelbling. Learning policies for partially observable environments: Scaling up. In International Conference on Machine Learning, pages 362–370, 1995. [19] M. L. Littman, R. S. Sutton, and S. Singh. Predictive representations of state. In Advances in Neural Information Processing Systems, pages 1555–1562, 2002. [20] P. Mirowski, R. Pascanu, F. Viola, H. Soyer, A. Ballard, A. Banino, M. Denil, R. Goroshin, L. Sifre, K. Kavukcuoglu, et al. Learning to navigate in complex environments. arXiv preprint arXiv:1611.03673, 2016. [21] V. Mnih, K. Kavukcuoglu, D. Silver, A. A. Rusu, J. Veness, M. G. Bellemare, A. Graves, M. Riedmiller, A. K. Fidjeland, G. Ostrovski, et al. Human-level control through deep reinforcement learning. Nature, 518(7540):529–533, 2015. 10 [22] A. Y. Ng, D. Harada, and S. Russell. Policy invariance under reward transformations: Theory and application to reward shaping. In International Conference on Machine Learning, pages 278–287, 1999. [23] M. Okada, L. Rigazio, and T. Aoshima. Path integral networks: End-to-end differentiable optimal control. arXiv preprint arXiv:1706.09597, 2017. [24] C. H. Papadimitriou and J. N. Tsitsiklis. The complexity of Markov decision processes. Mathematics of Operations Research, 12(3):441–450, 1987. [25] J. Pineau, G. J. Gordon, and S. Thrun. Applying metric-trees to belief-point POMDPs. In Advances in Neural Information Processing Systems, page None, 2003. [26] G. Shani, R. I. Brafman, and S. E. Shimony. Model-based online learning of POMDPs. In European Conference on Machine Learning, pages 353–364, 2005. [27] G. Shani, J. Pineau, and R. Kaplow. A survey of point-based POMDP solvers. Autonomous Agents and Multi-agent Systems, 27(1):1–51, 2013. [28] T. Shankar, S. K. Dwivedy, and P. Guha. Reinforcement learning via recurrent convolutional neural networks. In International Conference on Pattern Recognition, pages 2592–2597, 2016. [29] D. Silver and J. Veness. Monte-carlo planning in large POMDPs. In Advances in Neural Information Processing Systems, pages 2164–2172, 2010. [30] D. Silver, A. Huang, C. J. Maddison, A. Guez, L. Sifre, G. Van Den Driessche, J. Schrittwieser, I. Antonoglou, V. Panneershelvam, M. Lanctot, et al. Mastering the game of Go with deep neural networks and tree search. Nature, 529(7587):484–489, 2016. [31] D. Silver, H. van Hasselt, M. Hessel, T. Schaul, A. Guez, T. Harley, G. Dulac-Arnold, D. Reichert, N. Rabinowitz, A. Barreto, et al. The predictron: End-to-end learning and planning. arXiv preprint, 2016. URL https://arxiv.org/abs/1612.08810. [32] M. T. Spaan and N. Vlassis. Perseus: Randomized point-based value iteration for POMDPs. Journal of Artificial Intelligence Research, 24:195–220, 2005. [33] C. Stachniss. Robotics 2D-laser dataset. URL http://www.ipb.uni-bonn.de/datasets/. [34] A. Tamar, S. Levine, P. Abbeel, Y. Wu, and G. Thomas. Value iteration networks. In Advances in Neural Information Processing Systems, pages 2146–2154, 2016. [35] T. Tieleman and G. Hinton. Lecture 6.5 - rmsprop: Divide the gradient by a running average of its recent magnitude. COURSERA: Neural networks for machine learning, pages 26–31, 2012. [36] S. Xingjian, Z. Chen, H. Wang, D.-Y. Yeung, W.-k. Wong, and W.-c. Woo. Convolutional LSTM network: A machine learning approach for precipitation nowcasting. In Advances in Neural Information Processing Systems, pages 802–810, 2015. [37] N. Ye, A. Somani, D. Hsu, and W. S. Lee. Despot: Online POMDP planning with regularization. Journal of Artificial Intelligence Research, 58:231–266, 2017. 11
2017
614
7,135
Deep Supervised Discrete Hashing Qi Li Zhenan Sun Ran He Tieniu Tan Center for Research on Intelligent Perception and Computing National Laboratory of Pattern Recognition CAS Center for Excellence in Brain Science and Intelligence Technology Institute of Automation, Chinese Academy of Sciences {qli,znsun,rhe,tnt}@nlpr.ia.ac.cn Abstract With the rapid growth of image and video data on the web, hashing has been extensively studied for image or video search in recent years. Benefiting from recent advances in deep learning, deep hashing methods have achieved promising results for image retrieval. However, there are some limitations of previous deep hashing methods (e.g., the semantic information is not fully exploited). In this paper, we develop a deep supervised discrete hashing algorithm based on the assumption that the learned binary codes should be ideal for classification. Both the pairwise label information and the classification information are used to learn the hash codes within one stream framework. We constrain the outputs of the last layer to be binary codes directly, which is rarely investigated in deep hashing algorithm. Because of the discrete nature of hash codes, an alternating minimization method is used to optimize the objective function. Experimental results have shown that our method outperforms current state-of-the-art methods on benchmark datasets. 1 Introduction Hashing has attracted much attention in recent years because of the rapid growth of image and video data on the web. It is one of the most popular techniques for image or video search due to its low computational cost and storage efficiency. Generally speaking, hashing is used to encode high dimensional data into a set of binary codes while preserving the similarity of images or videos. Existing hashing methods can be roughly grouped into two categories: data independent methods and data dependent methods. Data independent methods rely on random projections to construct hash functions. Locality Sensitive Hashing (LSH) [3] is one of the representative methods, which uses random linear projections to map nearby data into similar binary codes. LSH is widely used for large scale image retrieval. In order to generalize LSH to accommodate arbitrary kernel functions, the Kenelized Locality Sensitive Hashing (KLSH) [7] is proposed to deal with high-dimensional kernelized data. Other variants of LSH are also proposed in recent years, such as super-bit LSH [5], non-metric LSH [14]. However, there are some limitations of data independent hashing methods, e.g., it makes no use of training data. The learning efficiency is low, and it requires longer hash codes to attain high accuracy. Due to the limitations of the data independent hashing methods, recent hashing methods try to exploit various machine learning techniques to learn more effective hash function based on a given dataset. Data dependent methods refer to using training data to learn the hash functions. They can be further categorized into supervised and unsupervised methods. Unsupervised methods retrieve the neighbors under some kinds of distance metrics. Iterative Quantization (ITQ) [4] is one of the representative unsupervised hashing methods, in which the projection matrix is optimized by iterative projection and thresholding according to the given training samples. In order to utilize the semantic labels of data samples, supervised hashing methods are proposed. Supervised Hashing with Kernels (KSH) [13] 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. is a well-known method of this kind, which learns the hash codes by minimizing the Hamming distances between similar pairs, and at the same time maximizing the Hamming distances between dissimilar pairs. Binary Reconstruction Embedding (BRE) [6] learns the hash functions by explicitly minimizing the reconstruction error between the original distances and the reconstructed distances in Hamming space. Order Preserving Hashing (OPH) [17] learns the hash codes by preserving the supervised ranking list information, which is calculated based on the semantic labels. Supervised Discrete Hashing (SDH) [15] aims to directly optimize the binary hash codes using the discrete cyclic coordinate descend method. Recently, deep learning based hashing methods have been proposed to simultaneously learn the image representation and hash coding, which have shown superior performance over the traditional hashing methods. Convolutional Neural Network Hashing (CNNH) [20] is one of the early works to incorporate deep neural networks into hash coding, which consists of two stages to learn the image representations and hash codes. One drawback of CNNH is that the learned image representation can not give feedback for learning better hash codes. To overcome the shortcomings of CNNH, Network In Network Hashing (NINH) [8] presents a triplet ranking loss to capture the relative similarities of images. The image representation learning and hash coding can benefit each other within one stage framework. Deep Semantic Ranking Hashing (DSRH) [26] learns the hash functions by preserving semantic similarity between multi-label images. Other ranking-based deep hashing methods have also been proposed in recent years [18, 22]. Besides the triplet ranking based methods, some pairwise label based deep hashing methods are also exploited [9, 27]. A novel and efficient training algorithm inspired by alternating direction method of multipliers (ADMM) is proposed to train very deep neural networks for supervised hashing in [25]. The classification information is used to learn hash codes. [25] relaxes the binary constraint to be continuous, then thresholds the obtained continuous variables to be binary codes. Although deep learning based methods have achieved great progress in image retrieval, there are some limitations of previous deep hashing methods (e.g., the semantic information is not fully exploited). Recent works try to divide the whole learning process into two streams under the multitask learning framework [11, 21, 22]. The hash stream is used to learn the hash function, while the classification stream is utilized to mine the semantic information. Although the two stream framework can improve the retrieval performance, the classification stream is only employed to learn the image representations, which does not have a direct impact on the hash function. In this paper, we use CNN to learn the image representation and hash function simultaneously. The last layer of CNN outputs the binary codes directly based on the pairwise label information and the classification information. The contributions of this work are summarized as follows. 1) The last layer of our method is constrained to output the binary codes directly. The binary codes are learned to preserve the similarity relationship and keep the label consistent simultaneously. To the best of our knowledge, this is the first deep hashing method that uses both pairwise label information and classification information to learn the hash codes under one stream framework. 2) In order to reduce the quantization error, we keep the discrete nature of the hash codes during the optimization process. An alternating minimization method is proposed to optimize the objective function by using the discrete cyclic coordinate descend method. 3) Extensive experiments have shown that our method outperforms current state-of-the-art methods on benchmark datasets for image retrieval, which demonstrates the effectiveness of the proposed method. 2 Deep supervised discrete hashing 2.1 Problem definition Given N image samples X = {xi}N i=1 ∈Rd×N, hash coding is to learn a collection of K-bit binary codes B ∈{−1, 1}K×N, where the i-th column bi ∈{−1, 1}K denotes the binary codes for the i-th sample xi. The binary codes are generated by the hash function h (·), which can be rewritten as [h1 (·) , ..., hK (·)]. For image sample xi, its hash codes can be represented as bi = h (xi) = [h1 (xi) , ..., hK (xi)]. Generally speaking, hashing is to learn a hash function to project image samples to a set of binary codes. 2 2.2 Similarity measure In supervised hashing, the label information is given as Y = {yi}N i=1 ∈Rc×N, where yi ∈{0, 1}c corresponds to the sample xi, c is the number of categories. Note that one sample may belong to multiple categories. Given the semantic label information, the pairwise label information is derived as: S = {sij}, sij ∈{0, 1}, where sij = 1 when xi and xj are semantically similar, sij = 0 when xi and xj are semantically dissimilar. For two binary codes bi and bj, the relationship between their Hamming distance distH (·, ·) and their inner product ⟨·, ·⟩is formulated as follows: distH (bi, bj) = 1 2 (K −⟨bi, bj⟩). If the inner product of two binary codes is small, their Hamming distance will be large, and vice versa. Therefore the inner product of different hash codes can be used to quantify their similarity. Given the pairwise similarity relationship S = {sij}, the Maximum a Posterior (MAP) estimation of hash codes can be represented as: p (B|S) ∝p (S|B) p (B) = Π sij∈S p (sij|B) p (B) (1) where p (S|B) denotes the likelihood function, p (B) is the prior distribution. For each pair of the images, p (sij|B) is the conditional probability of sij given their hash codes B, which is defined as follows: p (sij|B) =  σ (Φij) , sij = 1 1 −σ (Φij) , sij = 0 (2) where σ (x) = 1/ (1 + e−x) is the sigmoid function, Φij = 1 2 ⟨bi, bj⟩= 1 2bT i bj. From Equation 2 we can see that, the larger the inner product ⟨bi, bj⟩is, the larger p (1|bi, bj) will be, which implies that bi and bj should be classified as similar, and vice versa. Therefore Equation 2 is a reasonable similarity measure for hash codes. 2.3 Loss function In recent years, deep learning based methods have shown their superior performance over the traditional handcrafted features on object detection, image classification, image segmentation, etc. In this section, we take advantage of recent advances in CNN to learn the hash function. In order to have a fair comparison with other deep hashing methods, we choose the CNN-F network architecture [2] as a basic component of our algorithm. This architecture is widely used to learn the hash function in recent works [9, 18]. Specifically, there are two separate CNNs to learn the hash function, which share the same weights. The pairwise samples are used as the input for these two separate CNNs. The CNN model consists of 5 convolutional layers and 2 fully connected layers. The number of neurons in the last fully connected layer is equal to the number of hash codes. Considering the similarity measure, the following loss function is used to learn the hash codes: J = −log p (S|B) = −P sij∈S log p (sij|B) = −P sij∈S sijΦij −log 1 + eΦij . (3) Equation 3 is the negative log likelihood function, which makes the Hamming distance of two similar points as small as possible, and at the same time makes the Hamming distance of two dissimilar points as large as possible. Although pairwise label information is used to learn the hash function in Equation 3, the label information is not fully exploited. Most of the previous works make use of the label information under a two stream multi-task learning framework [21, 22]. The classification stream is used to measure the classification error, while the hash stream is employed to learn the hash function. One basic assumption of our algorithm is that the learned binary codes should be ideal for classification. In order to take advantage of the label information directly, we expect the learned binary codes to be optimal for the jointly learned linear classifier. We use a simple linear classifier to model the relationship between the learned binary codes and the label information: Y = W T B, (4) where W = [w1, w2,...,wC] is the classifier weight, Y = [y1, y2,...,yN] is the ground-truth label vector. The loss function can be calculated as: Q = L Y, W T B  + λ ∥W∥2 F = N P i=1 L yi, W T bi  + λ ∥W∥2 F , (5) 3 where L (·) is the loss function, λ is the regularization parameter, ∥·∥F is the Frobenius norm of a matrix. Combining Equation 5 and Equation 3, we have the following formulation: F = J + µQ = −P sij∈S sijΦij −log 1 + eΦij + µ N P i=1 L yi, W T bi  + ν ∥W∥2 F , (6) where µ is the trade-off parameters, ν = λµ. Suppose that we choose the l2 loss for the linear classifier, Equation 6 is rewritten as follows: F = −P sij∈S sijΦij −log 1 + eΦij + µ N P i=1 yi −W T bi 2 2 + ν ∥W∥2 F , (7) where ∥·∥2 is l2 norm of a vector. The hypothesis for Equation 7 is that the learned binary codes should make the pairwise label likelihood as large as possible, and should be optimal for the jointly learned linear classifier. 2.4 Optimization The minimization of Equation 7 is a discrete optimization problem, which is difficult to optimize directly. There are several ways to solve this problem. (1) In the training stage, the sigmoid or tanh activation function is utilized to replace the ReLU function after the last fully connected layer, and then the continuous outputs are used as a relaxation of the hash codes. In the testing stage, the hash codes are obtained by applying a thresholding function on the continuous outputs. One limitation of this method is that the convergence of the algorithm is slow. Besides, there will be a large quantization error. (2) The sign function is directly applied after the outputs of the last fully connected layer, which constrains the outputs to be binary variables strictly. However, the sign function is non-differentiable, which is difficult to back propagate the gradient of the loss function. Because of the discrepancy between the Euclidean space and the Hamming space, it would result in suboptimal hash codes if one totally ignores the binary constraints. We emphasize that it is essential to keep the discrete nature of the binary codes. Note that in our formulation, we constrain the outputs of the last layer to be binary codes directly, thus Equation 7 is difficult to optimize directly. Similar to [9, 18, 22], we solve this problem by introducing an auxiliary variable. Then we approximate Equation 7 as: F = −P sij∈S sijΨij −log 1 + eΨij + µ N P i=1 yi −W T bi 2 2 + ν ∥W∥2 F , s.t. bi = sgn(hi), hi ∈RK×1, (i = 1, ..., N) , (8) where Ψij = 1 2hi T hj. hi (i = 1, ..., N) can be seen as the output of the last fully connected layer, which is represented as: hi = M T Θ (xi; θ) + n, (9) where θ denotes the parameters of the previous layers before the last fully connected layer, M ∈ R4096×K represents the weight matrix, n ∈RK×1 is the bias term. According to the Lagrange multipliers method, Equation 8 can be reformulated as: F = −P sij∈S sijΨij −log 1 + eΨij +µ N P i=1 yi −W T bi 2 2 + ν ∥W∥2 F + η N P i=1 ∥bi −sgn (hi)∥2 2, s.t. bi ∈{−1, 1}K, (i = 1, ..., N) , (10) where η is the Lagrange Multiplier. Equation 10 can be further relaxed as: F = −P sij∈S sijΨij −log 1 + eΨij +µ N P i=1 yi −W T bi 2 2 + ν ∥W∥2 F + η N P i=1 ∥bi −hi∥2 2, s.t. bi ∈{−1, 1}K, (i = 1, ..., N) . (11) 4 The last term actually measures the constraint violation caused by the outputs of the last fully connected layer. If the parameter η is set sufficiently large, the constraint violation is penalized severely. Therefore the outputs of the last fully connected layer are forced closer to the binary codes, which are employed for classification directly. The benefit of introducing an auxiliary variable is that we can decompose Equation 11 into two sub optimization problems, which can be iteratively solved by using the alternating minimization method. First, when fixing bi, W, we have: ∂F ∂hi = −1 2 P j:sij∈S  sij − eΨij 1+eΨij  hj −1 2 P j:sji∈S  sji − eΨji 1+eΨji  hj −2η (bi −hi) (12) Then we update parameters M, n and Θ as follows: ∂F ∂M = Θ (xi; θ)  ∂F ∂hi T , ∂F ∂n = ∂F ∂hi , ∂F ∂Θ(xi;θ) = M ∂F ∂hi . (13) The gradient will propagate to previous layers by Back Propagation (BP) algorithm. Second, when fixing M, n, Θ and bi, we solve W as: F = µ N X i=1 yi −W T bi 2 2 + ν ∥W∥2 F . (14) Equation 14 is a least squares problem, which has a closed form solution: W =  BBT + ν µI −1 BT Y, (15) where B = {bi}N i=1 ∈{−1, 1}K×N, Y = {yi}N i=1 ∈RC×N. Finally, when fixing M, n, Θ and W, Equation 11 becomes: F = µ N P i=1 yi −W T bi 2 2 + η N P i=1 ∥bi −hi∥2 2, s.t. bi ∈{−1, 1}K, (i = 1, ..., N) . (16) In this paper, we use the discrete cyclic coordinate descend method to iteratively solve B row by row: min B W T B 2 −2 Tr (P) , s.t. B ∈{−1, 1}K×N, (17) where P = WY + η µH. Let xT be the kth (k = 1, ..., K) row of B, B1 be the matrix of B excluding xT , pT be the kth column of matrix P, P1 be the matrix of P excluding p, wT be the kth column of matrix W, W1 be the matrix of W excluding w, then we can derive: x = sgn p −BT 1 W1w  . (18) It is easy to see that each bit of the hash codes is computed based on the pre-learned K −1 bits B1. We iteratively update each bit until the algorithm converges. 3 Experiments 3.1 Experimental settings We conduct extensive experiments on two public benchmark datasets: CIFAR-10 and NUS-WIDE. CIFAR-10 is a dataset containing 60,000 color images in 10 classes, and each class contains 6,000 images with a resolution of 32x32. Different from CIFAR-10, NUS-WIDE is a public multi-label image dataset. There are 269,648 color images in total with 5,018 unique tags. Each image is annotated with one or multiple class labels from the 5,018 tags. Similar to [8, 12, 20, 24], we use a subset of 195,834 images which are associated with the 21 most frequent concepts. Each concept consists of at least 5,000 color images in this dataset. We follow the previous experimental setting in [8, 9, 18]. In CIFAR-10, we randomly select 100 images per class (1,000 images in total) as the test query set, 500 images per class (5,000 images in 5 total) as the training set. For NUS-WIDE dataset, we randomly sample 100 images per class (2,100 images in total) as the test query set, 500 images per class (10,500 images in total) as the training set. The similar pairs are constructed according to the image labels: two images will be considered similar if they share at least one common semantic label. Otherwise, they will be considered dissimilar. We also conduct experiments on CIFAR-10 and NUS-WIDE dataset under a different experimental setting. In CIFAR-10, 1,000 images per class (10,000 images in total) are selected as the test query set, the remaining 50,000 images are used as the training set. In NUS-WIDE, 100 images per class (2,100 images in total) are randomly sampled as the test query images, the remaining images (193,734 images in total) are used as the training set. As for the comparison methods, we roughly divide them into two groups: traditional hashing methods and deep hashing methods. The compared traditional hashing methods consist of unsupervised and supervised methods. Unsupervised hashing methods include SH [19], ITQ [4]. Supervised hashing methods include SPLH [16], KSH [13], FastH [10], LFH [23], and SDH [15]. Both the hand-crafted features and the features extracted by CNN-F network architecture are used as the input for the traditional hashing methods. Similar to previous works, the handcrafted features include a 512-dimensional GIST descriptor to represent images of CIFAR-10 dataset, and a 1134-dimensional feature vector to represent images of NUS-WIDE dataset. The deep hashing methods include DQN [1], DHN [27], CNNH [20], NINH [8], DSRH [26], DSCH [24], DRCSH [24], DPSH [9], DTSH [18] and VDSH [25]. Note that DPSH, DTSH and DSDH are based on the CNN-F network architecture, while DQN, DHN, DSRH are based on AlexNet architecture. Both the CNN-F network architecture and AlexNet architecture consist of five convolutional layers and two fully connected layers. In order to have a fair comparison, most of the results are directly reported from previous works. Following [25], the pre-trained CNN-F model is used to extract CNN features on CIFAR-10, while a 500 dimensional bag-of-words feature vector is used to represent each image on NUS-WIDE for VDSH. Then we re-run the source code provided by the authors to obtain the retrieval performance. The parameters of our algorithm are set based on the standard cross-validation procedure. µ, ν and η in Equation 11 are set to 1, 0.1 and 55, respectively. Similar to [8], we adopt four widely used evaluation metrics to evaluate the image retrieval quality: Mean Average Precision (MAP) for different number of bits, precision curves within Hamming distance 2, precision curves with different number of top returned samples and precision-recall curves. When computing MAP for NUS-WIDE dataset under the first experimental setting, we only consider the top 5,000 returned neighbors. While we consider the top 50,000 returned neighbors under the second experimental setting. 3.2 Empirical analysis Number of bits 15 20 25 30 35 40 45 Precision (Hamming dist. <=2) 0.5 0.6 0.7 0.8 0.9 (a) Number of top returned images 100 300 500 700 900 Precision 0.5 0.6 0.7 0.8 0.9 (b) Recall 0 0.2 0.4 0.6 0.8 1 Precision 0 0.2 0.4 0.6 0.8 1 DSDH-A DSDH-B DSDH-C DSDH (c) Figure 1: The results of DSDH-A, DSDH-B, DSDH-C and DSDH on CIFAR-10 dataset: (a) precision curves within Hamming radius 2; (b) precision curves with respect to different number of top returned images; (c) precision-recall curves of Hamming ranking with 48 bits. In order to verify the effectiveness of our method, several variants of our method (DSDH) are also proposed. First, we only consider the pairwise label information while neglecting the linear classification information in Equation 7, which is named DSDH-A (similar to [9]). Then we design a two-stream deep hashing algorithm to learn the hash codes. One stream is designed based on the pairwise label information in Equation 3, and the other stream is constructed based on the classification information. The two streams share the same image representations except for the last 6 Table 1: MAP for different methods under the first experimental setting. The MAP for NUS-WIDE dataset is calculated based on the top 5,000 returned neighbors. DPSH∗denotes re-running the code provided by the authors of DPSH. Method CIFAR-10 Method NUS-WIDE 12 bits 24 bits 32 bits 48 bits 12 bits 24 bits 32 bits 48 bits Ours 0.740 0.786 0.801 0.820 Ours 0.776 0.808 0.820 0.829 DQN 0.554 0.558 0.564 0.580 DQN 0.768 0.776 0.783 0.792 DPSH 0.713 0.727 0.744 0.757 DPSH∗ 0.752 0.790 0.794 0.812 DHN 0.555 0.594 0.603 0.621 DHN 0.708 0.735 0.748 0.758 DTSH 0.710 0.750 0.765 0.774 DTSH 0.773 0.808 0.812 0.824 NINH 0.552 0.566 0.558 0.581 NINH 0.674 0.697 0.713 0.715 CNNH 0.439 0.511 0.509 0.522 CNNH 0.611 0.618 0.625 0.608 FastH 0.305 0.349 0.369 0.384 FastH 0.621 0.650 0.665 0.687 SDH 0.285 0.329 0.341 0.356 SDH 0.568 0.600 0.608 0.637 KSH 0.303 0.337 0.346 0.356 KSH 0.556 0.572 0.581 0.588 LFH 0.176 0.231 0.211 0.253 LFH 0.571 0.568 0.568 0.585 SPLH 0.171 0.173 0.178 0.184 SPLH 0.568 0.589 0.597 0.601 ITQ 0.162 0.169 0.172 0.175 ITQ 0.452 0.468 0.472 0.477 SH 0.127 0.128 0.126 0.129 SH 0.454 0.406 0.405 0.400 fully connected layer. We denote this method as DSDH-B. Besides, we also design another approach directly applying the sign function after the outputs of the last fully connected layer in Equation 7, which is denoted as DSDH-C. The loss function of DSDH-C can be represented as: F = −P sij∈S sijΨij −log 1 + eΨij + µ N P i=1 yi −W T hi 2 2 + ν ∥W∥2 F + η N P i=1 ∥bi −sgn (hi)∥2 2, s.t. hi ∈RK×1, (i = 1, ..., N) (19) Then we use the alternating minimization method to optimize DSDH-C. The results of different methods on CIFAR-10 under the first experimental setting are shown in Figure 1. From Figure 1 we can see that, (1) The performance of DSDH-C is better than DSDH-A. DSDH-B is better than DSDH-A in terms of precision with Hamming radius 2 and precision-recall curves. More information is exploited in DSDH-C than DSDH-A, which demonstrates the classification information is helpful for learning the hash codes. (2) The improvement of DSDH-C over DSDH-A is marginal. The reason is that the classification information in DSDH-C is only used to learn the image representations, which is not fully exploited. Due to violation of the discrete nature of the hash codes, DSDH-C has a large quantization loss. Note that our method further beats DSDH-B and DSDH-C by a large margin. 3.3 Results under the first experimental setting The MAP results of all methods on CIFAR-10 and NUS-WIDE under the first experimental setting are listed in Table 1. From Table 1 we can see that the proposed method substantially outperforms the traditional hashing methods on CIFAR-10 dataset. The MAP result of our method is more than twice as much as SDH, FastH and ITQ. Besides, most of the deep hashing methods perform better than the traditional hashing methods. In particular, DTSH achieves the best performance among all the other methods except DSDH on CIFAR-10 dataset. Compared with DTSH, our method further improves the performance by 3 ∼7 percents. These results verify that learning the hash function and classifier within one stream framework can boost the retrieval performance. The gap between the deep hashing methods and traditional hashing methods is not very huge on NUS-WIDE dataset, which is different from CIFAR-10 dataset. For example, the average MAP result of SDH is 0.603, while the average MAP result of DTSH is 0.804. The proposed method is slightly superior to DTSH in terms of the MAP results on NUS-WIDE dataset. The main reasons are that there exits more categories in NUS-WIDE than CIFAR-10, and each of the image contains multiple labels. Compared with CIFAR-10, there are only 500 images per class for training, which may not be enough for DSDH to learn the multi-label classifier. Thus the second term in Equation 7 plays a limited role to learn a better hash function. In Section 3.4, we will show that our method will achieve 7 Table 2: MAP for different methods under the second experimental setting. The MAP for NUS-WIDE dataset is calculated based on the top 50,000 returned neighbors. DPSH∗denotes re-running the code provided by the authors of DPSH. Method CIFAR-10 Method NUS-WIDE 16 bits 24 bits 32 bits 48 bits 16 bits 24 bits 32 bits 48 bits Ours 0.935 0.940 0.939 0.939 Ours 0.815 0.814 0.820 0.821 DTSH 0.915 0.923 0.925 0.926 DTSH 0.756 0.776 0.785 0.799 DPSH 0.763 0.781 0.795 0.807 DPSH 0.715 0.722 0.736 0.741 VDSH 0.845 0.848 0.844 0.845 VDSH 0.545 0.564 0.557 0.570 DRSCH 0.615 0.622 0.629 0.631 DRSCH 0.618 0.622 0.623 0.628 DSCH 0.609 0.613 0.617 0.620 DSCH 0.592 0.597 0.611 0.609 DSRH 0.608 0.611 0.617 0.618 DSRH 0.609 0.618 0.621 0.631 DPSH∗ 0.903 0.885 0.915 0.911 DPSH∗ N/A Table 3: MAP for different methods under the first experimental setting. The MAP for NUS-WIDE dataset is calculated based on the top 5,000 returned neighbors. Method CIFAR-10 NUS-WIDE 12 bits 24 bits 32 bits 48 bits 12 bits 24 bits 32 bits 48 bits Ours 0.740 0.786 0.801 0.820 0.776 0.808 0.820 0.829 FastH+CNN 0.553 0.607 0.619 0.636 0.779 0.807 0.816 0.825 SDH+CNN 0.478 0.557 0.584 0.592 0.780 0.804 0.815 0.824 KSH+CNN 0.488 0.539 0.548 0.563 0.768 0.786 0.790 0.799 LFH+CNN 0.208 0.242 0.266 0.339 0.695 0.734 0.739 0.759 SPLH+CNN 0.299 0.330 0.335 0.330 0.753 0.775 0.783 0.786 ITQ+CNN 0.237 0.246 0.255 0.261 0.719 0.739 0.747 0.756 SH+CNN 0.183 0.164 0.161 0.161 0.621 0.616 0.615 0.612 a better performance than other deep hashing methods with more training images per class for the multi-label dataset. 3.4 Results under the second experimental setting Deep hashing methods usually need many training images to learn the hash function. In this section, we compare with other deep hashing methods under the second experimental setting, which contains more training images. Table 2 lists MAP results for different methods under the second experimental setting. As shown in Table 2, with more training images, most of the deep hashing methods perform better than in Section 3.3. For CIFAR-10 dataset, the average MAP result of DRSCH is 0.624, and the average MAP results of DPSH, DTSH and VDSH are 0.787, 0.922 and 0.846, respectively. The average MAP result of our method is 0.938 on CIFAR-10 dataset. DTSH, DPSH and VDSH have a significant advantage over other deep hashing methods. Our method further outperforms DTSH, DPSH and VDSH by about 2 ∼3 percents. For NUS-WIDE dataset, our method still achieves the best performance in terms of MAP. The performance of VDSH on NUS-WIDE dataset drops severely. The possible reason is that VDSH uses the provided bag-of-words features instead of the learned features. 3.5 Comparison with traditional hashing methods using deep learned features In order to have a fair comparison, we also compare with traditional hashing methods using deep learned features extracted by the CNN-F network under the first experimental setting. The MAP results of different methods are listed in Table 3. As shown in Table 3, most of the traditional hashing methods obtain a better retrieval performance using deep learned features. The average MAP results of FastH+CNN and SDH+CNN on CIFAR-10 dataset are 0.604 and 0.553, respectively. And the average MAP result of our method on CIFAR-10 dataset is 0.787, which outperforms the traditional hashing methods with deep learned features. Besides, the proposed algorithm achieves a comparable performance with the best traditional hashing methods on NUS-WIDE dataset under the first experimental setting. 8 4 Conclusion In this paper, we have proposed a novel deep supervised discrete hashing algorithm. We constrain the outputs of the last layer to be binary codes directly. Both the pairwise label information and the classification information are used for learning the hash codes under one stream framework. Because of the discrete nature of the hash codes, we derive an alternating minimization method to optimize the loss function. Extensive experiments have shown that our method outperforms state-of-the-art methods on benchmark image retrieval datasets. 5 Acknowledgements This work was partially supported by the National Key Research and Development Program of China (Grant No. 2016YFB1001000) and the Natural Science Foundation of China (Grant No. 61622310). References [1] Y. Cao, M. Long, J. Wang, H. Zhu, and Q. Wen. Deep quantization network for efficient image retrieval. In AAAI, pages 3457–3463, 2016. [2] K. Chatfield, K. Simonyan, A. Vedaldi, and A. Zisserman. Return of the devil in the details: Delving deep into convolutional nets. In BMVC, 2014. [3] A. Gionis, P. Indyk, R. Motwani, et al. Similarity search in high dimensions via hashing. In VLDB, pages 518–529, 1999. [4] Y. Gong, S. Lazebnik, A. Gordo, and F. Perronnin. Iterative quantization: A procrustean approach to learning binary codes for large-scale image retrieval. IEEE TPAMI, 35(12):2916–2929, 2013. [5] J. Ji, J. Li, S. Yan, B. Zhang, and Q. Tian. Super-bit locality-sensitive hashing. In NIPS, pages 108–116, 2012. [6] B. Kulis and T. Darrell. Learning to hash with binary reconstructive embeddings. In NIPS, pages 1042–1050, 2009. [7] B. Kulis and K. Grauman. Kernelized locality-sensitive hashing for scalable image search. In ICCV, pages 2130–2137, 2009. [8] H. Lai, Y. Pan, Y. Liu, and S. Yan. Simultaneous feature learning and hash coding with deep neural networks. In CVPR, pages 3270–3278, 2015. [9] W.-J. Li, S. Wang, and W.-C. Kang. Feature learning based deep supervised hashing with pairwise labels. In IJCAI, pages 1711–1717, 2016. [10] G. Lin, C. Shen, Q. Shi, A. van den Hengel, and D. Suter. Fast supervised hashing with decision trees for high-dimensional data. In CVPR, pages 1963–1970, 2014. [11] K. Lin, H.-F. Yang, J.-H. Hsiao, and C.-S. Chen. Deep learning of binary hash codes for fast image retrieval. In CVPRW, pages 27–35, 2015. [12] W. Liu, J. Wang, S. Kumar, and S.-F. Chang. Hashing with graphs. In ICML, pages 1–8, 2011. [13] W. Liu, J. Wang, R. Ji, Y.-G. Jiang, and S.-F. Chang. Supervised hashing with kernels. In CVPR, pages 2074–2081, 2012. [14] Y. Mu and S. Yan. Non-metric locality-sensitive hashing. In AAAI, pages 539–544, 2010. [15] F. Shen, C. Shen, W. Liu, and H. Tao Shen. Supervised discrete hashing. In CVPR, pages 37–45, 2015. [16] J. Wang, S. Kumar, and S.-F. Chang. Sequential projection learning for hashing with compact codes. In ICML, pages 1127–1134, 2010. [17] J. Wang, J. Wang, N. Yu, and S. Li. Order preserving hashing for approximate nearest neighbor search. In ACM MM, pages 133–142, 2013. [18] X. Wang, Y. Shi, and K. M. Kitani. Deep supervised hashing with triplet labels. In ACCV, pages 70–84, 2016. 9 [19] Y. Weiss, A. Torralba, and R. Fergus. Spectral hashing. In NIPS, pages 1753–1760, 2009. [20] R. Xia, Y. Pan, H. Lai, C. Liu, and S. Yan. Supervised hashing for image retrieval via image representation learning. In AAAI, pages 2156–2162, 2014. [21] H. F. Yang, K. Lin, and C. S. Chen. Supervised learning of semantics-preserving hash via deep convolutional neural networks. IEEE TPAMI, (99):1–1, 2017. [22] T. Yao, F. Long, T. Mei, and Y. Rui. Deep semantic-preserving and ranking-based hashing for image retrieval. In IJCAI, pages 3931–3937, 2016. [23] P. Zhang, W. Zhang, W.-J. Li, and M. Guo. Supervised hashing with latent factor models. In SIGIR, pages 173–182, 2014. [24] R. Zhang, L. Lin, R. Zhang, W. Zuo, and L. Zhang. Bit-scalable deep hashing with regularized similarity learning for image retrieval and person re-identification. IEEE TIP, 24(12):4766–4779, 2015. [25] Z. Zhang, Y. Chen, and V. Saligrama. Efficient training of very deep neural networks for supervised hashing. In CVPR, pages 1487–1495, 2016. [26] F. Zhao, Y. Huang, L. Wang, and T. Tan. Deep semantic ranking based hashing for multi-label image retrieval. In CVPR, pages 1556–1564, 2015. [27] H. Zhu, M. Long, J. Wang, and Y. Cao. Deep hashing network for efficient similarity retrieval. In AAAI, pages 2415–2421, 2016. 10
2017
615
7,136
Approximation Algorithms for ℓ0-Low Rank Approximation Karl Bringmann1 kbringma@mpi-inf.mpg.de Pavel Kolev1∗ pkolev@mpi-inf.mpg.de David P. Woodruff2 dwoodruf@cs.cmu.edu 1 Max Planck Institute for Informatics, Saarland Informatics Campus, Saarbrücken, Germany 2 Department of Computer Science, Carnegie Mellon University Abstract We study the ℓ0-Low Rank Approximation Problem, where the goal is, given an m × n matrix A, to output a rank-k matrix A′ for which ∥A′ −A∥0 is minimized. Here, for a matrix B, ∥B∥0 denotes the number of its non-zero entries. This NPhard variant of low rank approximation is natural for problems with no underlying metric, and its goal is to minimize the number of disagreeing data positions. We provide approximation algorithms which significantly improve the running time and approximation factor of previous work. For k > 1, we show how to find, in poly(mn) time for every k, a rank O(k log(n/k)) matrix A′ for which ∥A′ −A∥0 ≤O(k2 log(n/k)) OPT. To the best of our knowledge, this is the first algorithm with provable guarantees for the ℓ0-Low Rank Approximation Problem for k > 1, even for bicriteria algorithms. For the well-studied case when k = 1, we give a (2+ϵ)-approximation in sublinear time, which is impossible for other variants of low rank approximation such as for the Frobenius norm. We strengthen this for the well-studied case of binary matrices to obtain a (1 + O(ψ))-approximation in sublinear time, where ψ = OPT /∥A∥0. For small ψ, our approximation factor is 1 + o(1). 1 Introduction Low rank approximation of an m × n matrix A is an extremely well-studied problem, where the goal is to replace the matrix A with a rank-k matrix A′ which well-approximates A, in the sense that ∥A −A′∥is small under some measure ∥· ∥. Since any rank-k matrix A′ can be written as U · V , where U is m × k and V is k × n, this allows for a significant parameter reduction. Namely, instead of storing A, which has mn entries, one can store U and V , which have only (m+n)k entries in total. Moreover, when computing Ax, one can first compute V x and then U(V x), which takes (m + n)k instead of mn time. We refer the reader to several surveys [19, 24, 40] for references to the many results on low rank approximation. We focus on approximation algorithms for the low-rank approximation problem, i.e. we seek to output a rank-k matrix A′ for which ∥A−A′∥≤α∥A−Ak∥, where Ak = argminrank(B)=k∥A−B∥ is the best rank-k approximation to A, and the approximation ratio α is as small as possible. One of the most widely studied error measures is the Frobenius norm ∥A∥F = (Pm i=1 Pn j=1 A2 i,j)1/2, for which the optimal rank-k approximation can be obtained via the singular value decomposition (SVD). Using randomization and approximation, one can compute an α = 1 + ϵ-approximation, for any ϵ > 0, in time much faster than the min(mn2, mn2) time required for computing the SVD, namely, in O(∥A∥0 + n · poly(k/ϵ)) time [9, 26, 29], where ∥A∥0 denotes the number of non-zero entries ∗This work has been funded by the Cluster of Excellence “Multimodal Computing and Interaction” within the Excellence Initiative of the German Federal Government. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. of A. For the Frobenius norm ∥A∥0 time is also a lower bound, as any algorithm that does not read nearly all entries of A might not read a very large entry, and therefore cannot achieve a relative error approximation. The rank-k matrix Ak obtained by computing the SVD is also optimal with respect to any rotationally invariant norm, such as the operator and Schatten-p norms. Thus, such norms can also be solved exactly in polynomial time. Recently, however, there has been considerable interest [10, 3, 32] in obtaining low rank approximations for NP-hard error measures such as the entrywise ℓp-norm ∥A∥p = P i,j |Ai,j|p1/p, where p ≥1 is a real number. Note that for p < 1, this is not a norm, though it is still a well-defined quantity. For p = ∞, this corresponds to the max-norm or Chebyshev norm. It is known that one can achieve a poly(k log(mn))-approximation in poly(mn) time for the low-rank approximation problem with entrywise ℓp-norm for every p ≥1 [36, 8]. 1.1 ℓ0-Low Rank Approximation A natural variant of low rank approximation which the results above do not cover is that of ℓ0-low rank approximation, where the measure ∥A∥0 is the number of non-zero entries. In other words, we seek a rank-k matrix A′ for which the number of entries (i, j) with A′ i,j ̸= Ai,j is as small as possible. Letting OPT = minrank(B)=k P i,j δ(Ai,j ̸= A′ i,j), where δ(Ai,j ̸= A′ i,j) = 1 if Ai,j ̸= A′ i,j and 0 otherwise, we would like to output a rank-k matrix A′ for which there are at most α OPT entries (i, j) with A′ i,j ̸= Ai,j. Approximation algorithms for this problem are essential since solving the problem exactly is NP-hard [12, 14], even when k = 1 and A is a binary matrix. The ℓ0-low rank approximation problem is quite natural for problems with no underlying metric, and its goal is to minimize the number of disagreeing data positions with a low rank matrix. Indeed, this error measure directly answers the following question: if we are allowed to ignore some data - outliers or anomalies - what is the best low-rank model we can get? One well-studied case is when A is binary, but A′ and its factors U and V need not necessarily be binary. This is called unconstrained Binary Matrix Factorization in [18], which has applications to association rule mining [20], biclustering structure identification [42, 43], pattern discovery for gene expression [34], digits reconstruction [25], mining high-dimensional discrete-attribute data [21, 22], market based clustering [23], and document clustering [43]. There is also a body of work on Boolean Matrix Factorization which restricts the factors to also be binary, which is referred to as constrained Binary Matrix Factorization in [18]. This is motivated in applications such as classifying text documents and there is a large body of work on this, see, e.g. [28, 31]. The ℓ0-low rank approximation problem coincides with a number of problems in different areas. It exactly coincides with the famous matrix rigidity problem over the reals, which asks for the minimal number OPT of entries of A that need to be changed in order to obtain a matrix of rank at most k. The matrix rigidity problem is well-studied in complexity theory [15, 16, 39] and parameterized complexity [13]. These works are not directly relevant here as they do not provide approximation algorithms. There are also other variants of ℓ0-low rank approximation, corresponding to cases such as when A is binary, A′ = UV is required to have binary factors U and V , and multiplication is either performed over a binary field [41, 17, 12, 30], or corresponds to an OR of ANDs. The latter is known as the Boolean model [4, 12, 27, 33, 35, 38]. These different notions of inner products lead to very different algorithms and results for the ℓ0-low rank approximation problem. However, all these models coincide in the special and important case in which A is binary and k = 1. This case was studied in [20, 34, 18], as their algorithm for k = 1 forms the basis for their successful heuristic for general k, e.g. the PROXIMUS technique [20]. Another related problem is robust PCA [6], in which there is an underlying matrix A that can be written as a low rank matrix L plus a sparse matrix S [7]. Candès et al. [7] argue that both components are of arbitrary magnitude, and we do not know the locations of the non-zeros in S nor how many there are. Moreover, grossly corrupted observations are common in image processing, web data analysis, and bioinformatics where some measurements are arbitrarily corrupted due to occlusions, malicious tampering, or sensor failures. Specific scenarios include video surveillance, face recognition, latent semantic indexing, and ranking of movies, books, etc. [7]. These problems have the common theme of being an arbitrary magnitude sparse perturbation to a low rank matrix with no natural underlying metric, and so the ℓ0-error measure (which is just the Hamming distance, or number of disagreements) is appropriate. In order to solve robust PCA in practice, Candès et al. [7] 2 relaxed the ℓ0-error measure to the ℓ1-norm. Understanding theoretical guarantees for solving the original ℓ0-problem is of fundamental importance, and we study this problem in this paper. Finally, interpreting 00 as 0, the ℓ0-low rank approximation problem coincides with the aforementioned notion of entrywise ℓp-approximation when p = 0. It is not hard to see that previous work [8] for general p ≥1 fails to give any approximation factor for p = 0. Indeed, critical to their analysis is the scale-invariance property of a norm, which does not hold for p = 0 since ℓ0 is not a norm. 1.2 Our Results We provide approximation algorithms for the ℓ0-low rank approximation problem which significantly improve the running time or approximation factor of previous work. In some cases our algorithms even run in sublinear time, i.e., faster than reading all non-zero entries of the matrix. This is provably impossible for other measures such as the Frobenius norm and more generally, any ℓp-norm for p > 0. For k > 1, our approximation algorithms are, to the best of our knowledge, the first with provable guarantees for this problem. First, for k = 1, we significantly improve the polynomial running time of previous (2 + ϵ)approximations for this problem. The best previous algorithm due to Jiang et al. [18] was based on the observation that there exists a column u of A spanning a 2-approximation. Therefore, solving the problem minv ∥A −uv∥0 for each column u of A yields a 2-approximation, where for a matrix B the measure ∥B∥0 counts the number of non-zero entries. The problem minv ∥A −uv∥0 decomposes into P i mini ∥A:,i −viu∥0, where A:,i is the i-th column of A, and vi the i-th entry of vector v. The optimal vi is the mode of the ratios Ai,j/uj, where j ranges over indices in {1, 2, . . . , m} with uj ̸= 0. As a result, one can find a rank-1 matrix uvT providing a 2-approximation in O(∥A∥0n) time, which was the best known running time. Somewhat surprisingly, we show that one can achieve sublinear time for solving this problem. Namely, we obtain a (2 + ϵ)-approximation in (m + n) poly(ϵ−1ψ−1 log(mn)) time, for any ϵ > 0, where ψ = OPT /∥A∥0. This significantly improves upon the earlier O(∥A∥0n) time for not too small ϵ and ψ. Our result should be contrasted to Frobenius norm low rank approximation, for which Ω(∥A∥0) time is required even for k = 1, as otherwise one might miss a very large entry in A. Since ℓ0-low rank approximation is insensitive to the magnitude of entries of A, we bypass this general impossibility result. Next, still considering the case of k = 1, we show that if the matrix A is binary, a well-studied case coinciding with the abovementioned GF(2) and Boolean models, we obtain an approximation algorithm parameterized in terms of the ratio ψ = OPT /∥A∥0, showing it is possible in time (m + n)ψ−1 poly(log(mn)) to obtain a (1 + O(ψ))-approximation. Note that our algorithm is again sublinear, unlike all algorithms in previous work. Moreover, when A is itself very well approximated by a low rank matrix, then ψ may actually be sub-constant, and we obtain a significantly better (1 + o(1))-approximation than the previous best known 2-approximations. Thus, we simultaneously improve the running time and approximation factor. We also show that the running time of our algorithm is optimal up to poly(log(mn)) factors by proving that any (1 + O(ψ))-approximation succeeding with constant probability must read Ω((m + n)ψ−1) entries of A in the worst case. Finally, for arbitrary k > 1, we first give an impractical algorithm that runs in time nO(k) and achieves an α = poly(k)-approximation. To the best of our knowledge this is the first approximation algorithm for the ℓ0-low rank approximation problem with any non-trivial approximation factor. To make our algorithm practical, we reduce the running time to poly(mn), with an exponent independent of k, if we allow for a bicriteria solution. In particular, we allow the algorithm to output a matrix A′ of somewhat larger rank O(k log(n/k)), for which ∥A −A′∥0 ≤O(k2 log(n/k)) minrank(B)=k ∥A −B∥0. Although we do not obtain rank exactly k, many of the motivations for finding a low rank approximation, such as reducing the number of parameters and fast matrix-vector product, still hold if the output rank is O(k log(n/k)). We are not aware of any alternative algorithms which achieve poly(mn) time and any provable approximation factor, even for bicriteria solutions. 2 Preliminaries For an matrix A ∈Am×n with entries Ai,j, we write Ai,: for its i-th row and A:,j for its j-th column. 3 Input Formats We always assume that we have random access to the entries of the given matrix A, i.e. we can read any entry Ai,j in constant time. For our sublinear time algorithms we need more efficient access to the matrix, specifically the following two variants: (1) We say that we are given A with column adjacency arrays if we are given arrays B1, . . . , Bn and lengths ℓ1, . . . , ℓn such that for any 1 ≤k ≤ℓj the pair Bj[k] = (i, Ai,j) stores the row i containing the k-th nonzero entry in column j as well as that entry Ai,j. This is a standard representation of matrices used in many applications. Note that given only these adjacency arrays B1, . . . , Bn, in order to access any entry Ai,j we can perform a binary search over Bj, and hence random access to any matrix entry is in time O(log n). Moreover, we assume to have random access to matrix entries in constant time, and note that this is optimistic by at most a factor O(log n). (2) We say that we are given matrix A with row and column sums if we can access the numbers P j Ai,j for i ∈[m] and P i Ai,j for j ∈[n] in constant time (and, as always, access any entry Ai,j in constant time). Notice that storing the row and column sums takes O(n + m) space, and thus while this might not be standard information it is very cheap to store. We show that the first access type even allows to sample from the set of nonzero entries uniformly in constant time. Lemma 1. Given a matrix A ∈Rm×n with column adjacency arrays, after O(n) time preprocessing we can sample a uniformly random nonzero entry (i, j) from A in time O(1). The proof of this lemma, as well as most other proofs in this extended abstract, can be found in the full version of the paper. 3 Algorithms for Real ℓ0-rank-k Given a matrix A ∈Rm×n, the ℓ0-rank-k problem asks to find a matrix A′ with rank k such that the difference between A and A′ measured in ℓ0 norm is minimized. We denote the optimum value by OPT(k) def = min rank(A′)=k ∥A −A′∥0 = min U∈Rm×k, V ∈Rk×n ∥A −UV ∥0 . (1) In this section, we establish several new results on the ℓ0-rank-k problem. In Subsection 3.1, we prove a structural lemma that shows the existence of k columns which provide a (k + 1)-approximation to OPT(k), and we also give an Ω(k)-approximation lower bound for any algorithm that selects k columns from the input matrix A. In Subsection 3.2, we give an approximation algorithm that runs in poly(nk, m) time and achieves an O(k2)-approximation. To the best of our knowledge, this is the first algorithm with provable non-trivial approximation guarantees. In Subsection 3.3, we design a practical algorithm that runs in poly(n, m) time with an exponent independent of k, if we allow for a bicriteria solution. 3.1 Structural Results We give a new structural result for ℓ0 showing that any matrix A contains k columns which provide a (k + 1)-approximation for the ℓ0-rank-k problem (1). Lemma 2. Let A ∈Rm×n be a matrix and k ∈[n]. There is a subset J(k) ⊂[n] of size k and a matrix Z ∈Rk×n such that ∥A −A:,J(k)Z∥0 ≤(k + 1)OPT(k). Proof. Let Q(0) be the set of columns j with UV:,j = 0, and let R(0) def = [n] \ Q(0). Let S(0) def = [n], T (0) def = ∅. We split the value OPT(k) into OPT(S(0), R(0)) def = ∥AS(0),R(0) −UVS(0),R(0)∥0 and OPT(S(0), Q(0)) def = ∥AS(0),Q(0) −UVS(0),Q(0)∥0 = ∥AS(0),Q(0)∥0. Suppose OPT(S(0), R(0)) ≥|S(0)||R(0)|/(k + 1). Then, for any subset J(k) it follows that minZ∥A −AS(0),J(k)Z∥0 ≤|S(0)||R(0)| + ∥AS(0),Q(0)∥0 ≤(k + 1)OPT(k). Otherwise, there is a column i(1) such that AS(0),i(1) −(UV )S(0),i(1) 0 ≤OPT(S(0), R(0))/|R(0)| ≤OPT(k)/|R(0)|. 4 Let T (1) be the set of indices on which (UV )S(0),i(1) and AS(0),i(1) disagree, and similarly S(1) def = S(0)\T (1) on which they agree. Then we have |T (1)| ≤OPT(k)/|R(0)|. Hence, in the submatrix T (1) × R(0) the total error is at most |T (1)| · |R(0)| ≤OPT(k). Let R(1), D(1) be a partitioning of R(0) such that AS(1),j is linearly dependent on AS(1),i(1) iff j ∈D(1). Then by selecting column A:,i(1) the incurred cost on matrix S(1) × D(1) is zero. For the remaining submatrix S(ℓ) × R(ℓ), we perform a recursive call of the algorithm. We make at most k recursive calls, on instances S(ℓ) × R(ℓ) for ℓ∈{0, . . . , k −1}. In the ℓth iteration, either OPT(S(ℓ), R(ℓ)) ≥|S(ℓ)||R(ℓ)|/(k + 1 −ℓ) and we are done, or there is a column i(ℓ+1) which partitions S(ℓ) into S(ℓ+1), T (ℓ+1) and R(ℓ) into R(ℓ+1), D(ℓ+1) such that |S(ℓ+1)| ≥m · Qℓ i=0(1 − 1 k+1−i) = k−ℓ k+1 · m and for every j ∈D(ℓ) the column AS(ℓ+1),j belongs to the span of {AS(ℓ+1),i(t)}ℓ+1 t=1. Suppose we performed k recursive calls. We show now that the incurred cost in submatrix S(k)×R(k) is at most OPT(S(k), R(k)) ≤OPT(k). By construction, the sub-columns {AS(k),i}i∈I(k) are linearly independent, where I(k) = {i(1), . . . , i(k)} is the set of the selected columns, and AS(k),I(k) = (UV )S(k),I(k). Since rank(AS(k),I(k)) = k, it follows that rank(US(k),:) = k, rank(V:,I(k)) = k and the matrix V:,I(k) ∈Rk×k is invertible. Hence, for matrix Z = (V:,I(k))−1V:,Rk we have OPT(S(k), R(k)) = ∥ASk,Rk −ASk,IkZ∥0. The statement follows by noting that the recursive calls accumulate a total cost of at most k · OPT(k) in the submatrices T (ℓ+1) × R(ℓ) for ℓ∈{0, 1, . . . , k −1}, as well as cost at most OPT(k) in submatrix S(k) × R(k). We also show that any algorithm that selects k columns of a matrix A incurs at least an Ω(k)approximation for the ℓ0-rank-k problem. Lemma 3. Let k ≤n/2. Suppose A = (Gk×n; In×n) ∈R(n+k)×n is a matrix composed of a Gaussian random matrix G ∈Rk×n with Gi,j ∼N(0, 1) and identity matrix In×n. Then for any subset J(k) ⊂[n] of size k, we have minZ∈Rk×n∥A −A:,J(k)Z∥0 = Ω(k) · OPT(k). 3.2 Basic Algorithm We give an impractical algorithm that runs in poly(nk, m) time and achieves an O(k2)-approximation. To the best of our knowledge this is the first approximation algorithm for the ℓ0-rank-k problem with non-trivial approximation guarantees. Theorem 4. Given A ∈Rm×n and k ∈[n] we can compute in O(nk+1m2kω+1) time a set of k indices J(k) ⊂[n] and a matrix Z ∈Rk×n such that ∥A −A:,J(k)Z∥0 ≤O(k2) · OPT(k). Our result relies on a subroutine by Berman and Karpinski [5] (attributed also to Kannan in that paper) which given a matrix U and a vector b approximates minx ∥Ux −b∥0 in polynomial time. Specifically, we invoke in our algorithm the following variant of this result established by Alon, Panigrahy, and Yekhanin [2]. Theorem 5. [2] There is an algorithm that given A ∈Rm×k and b ∈Rm outputs in O(m2kω+1) time a vector z ∈Rk such that w.h.p. ∥Az −b∥0 ≤k · minx ∥Ax −b∥0. 3.3 Bicriteria Algorithm Our main contribution in this section is to design a practical algorithm that runs in poly(n, m) time with an exponent independent of k, if we allow for a bicriteria solution. Theorem 6. Given A ∈Rm×n and k ∈[1, n], there is an algorithm that in expected poly(m, n) time outputs a subset of indices J ⊂[n] with |J| = O(k log(n/k)) and a matrix Z ∈R|J|×n such that ∥A −A:,JZ∥0 ≤O(k2 log(n/k)) · OPT(k). The structure of the proof follows a recent approximation algorithm [8, Algorithm 3] for the ℓp-low rank approximation problem, for any p ≥1. We note that the analysis of [8, Theorem 7] is missing an 5 O(log1/p n) approximation factor, and naïvely provides an O(k log1/p n)-approximation rather than the stated O(k)-approximation. Further, it might be possible to obtain an efficient algorithm yielding an O(k2 log k)-approximation for Theorem 6 using unpublished techniques in [37]; we leave the study of obtaining the optimal approximation factor to future work. There are two critical differences with the proof of [8, Theorem 7]. We cannot use the earlier [8, Theorem 3] which shows that any matrix A contains k columns which provide an O(k)-approximation for the ℓp-low rank approximation problem, since that proof requires p ≥1 and critically uses scale-invariance, which does not hold for p = 0. Our combinatorial argument in Lemma 2 seems fundamentally different than the maximum volume submatrix argument in [8] for p ≥1. Second, unlike for ℓp-regression for p ≥1, the ℓ0-regression problem minx ∥Ux−b∥0 given a matrix U and vector b is not efficiently solvable since it corresponds to a nearest codeword problem, which is NP-hard [1]. Thus, we resort to an approximation algorithm for ℓ0-regression, based on ideas for solving the nearest codeword problem in [2, 5]. Note that OPT(k) ≤∥A∥0. Since there are only mn + 1 possibilities of OPT(k), we can assume we know OPT(k) and we can run the Algorithm 1 below for each such possibility, obtaining a rank-O(k log n) solution, and then outputting the solution found with the smallest cost. This can be further optimized by forming instead O(log(mn)) guesses of OPT(k). One of these guesses is within a factor of 2 from the true value of OPT(k), and we note that the following argument only needs to know OPT(k) up to a factor of 2. We start by defining the notion of approximate coverage, which is different than the corresponding notion in [8] for p ≥1, due to the fact that ℓ0-regression cannot be efficiently solved. Consequently, approximate coverage for p = 0 cannot be efficiently tested. Let Q ⊆[n] and M = A:,Q be an m × |Q| submatrix of A. We say that a column M:,i is (S, Q)-approximately covered by a submatrix M:,S of M, if |S| = 2k and minx ∥M:,Sx −M:,i∥0 ≤100(k+1)OPT(k) |Q| . Lemma 7. (Similar to [8, Lemma 6], but using Lemma 2) Let Q ⊆[n] and M = A:,Q be a submatrix of A. Suppose we select a subset R of 2k uniformly random columns of M. Then with probability at least 1/3, at least a 1/10 fraction of the columns of M are (R, Q)-approximately covered. Proof. To show this, as in [8], consider a uniformly random column index i not in the set R. Let T def = R ∪{i} and η def = minrank(B)=k∥M:,T −B∥0. Since T is a uniformly random subset of 2k + 1 columns of M, ET η ≤(2k+1)OPT(k) M |Q| ≤(2k+1)OPT(k) |Q| . Let E1 be the event η ≤10(2k+1)OPT(k) |Q| . Then, by a Markov bound, Pr[E1] ≥9/10. Fix a configuration T = R ∪{i} and let L(T) ⊂T be the subset guaranteed by Lemma 2 such that |L(T)| = k and minX∥M:,L(T )X −M:,T ∥0 ≤(k + 1) minrank(B)=k∥M:,T −B∥0. Notice that Ei  minx∥M:,L(T )x −M:,i∥0 | T  = 1 2k+1 minX∥M:,L(T )X −M:,T ∥0, and thus by the law of total probability we have ET  minx ∥M:,L(T )x −M:,i∥0  ≤(k+1)η 2k+1 . Let E2 denote the event that minx ∥M:,Lx−M:,i∥0 ≤10(k+1)η 2k+1 . By a Markov bound, Pr[E2] ≥9/10. Further, as in [8], let E3 be the event that i /∈L. Observe that there are k+1 k  ways to choose a subset R′ ⊂T such that |R′| = 2k and L ⊂R′. Since there are 2k+1 2k  ways to choose R′, it follows that Pr[L ⊂R | T] = k+1 2k+1 > 1/2. Hence, by the law of total probability, we have Pr[E3] > 1/2. As in [8], Pr[E1 ∧E2 ∧E3] > 2/5, and conditioned on E1 ∧E2 ∧E3, minx ∥M:,Rx −M:,i∥0 ≤ minx ∥M:,Lx −M:,i∥0 ≤10(k+1)η 2k+1 ≤100(k+1)OPT(k) |Q| , where the first inequality uses that L is a subset of R given E3, and so the regression cost cannot decrease, while the second inequality uses the occurrence of E2 and the final inequality uses the occurrence of E1. As in [8], if Zi is an indicator random variable indicating whether i is approximately covered by R, and Z = P i∈Q Zi, then ER[Z] ≥ 2|Q| 5 and ER[|Q| −Z] ≤ 3|Q| 5 . By a Markov bound, Pr[|Q| −Z ≥9|Q| 10 ] ≤2 3. Thus, probability at least 1/3, at least a 1/10 fraction of the columns of M are (R, Q)-approximately covered. 6 Algorithm 1 Selecting O(k log(n/k)) columns of A. Require: An integer k, and a matrix A. Ensure: O(k log(n/k)) columns of A APPROXIMATELYSELECTCOLUMNS (k, A): if number of columns of A ≤2k then return all the columns of A else repeat Let R be a set of 2k uniformly random columns of A until at least (1/10)-fraction columns of A are nearly approximately covered Let AR be the columns of A not nearly approximately covered by R return R ∪APPROXIMATELYSELECTCOLUMNS(k, AR) end if Given Lemma 7, we are ready to prove Theorem 6. As noted above, a key difference with the corresponding [8, Algorithm 3] for ℓp and p ≥1, is that we cannot efficiently test if a column i is approximately covered by a set R. We will instead again make use of Theorem 5. Proof of Theorem 6. The computation of matrix Z force us to relax the notion of (R, Q)approximately covered to the notion of (R, Q)-nearly-approximately covered as follows: we say that a column M:,i is (R, Q)-nearly-approximately covered if, the algorithm in Theorem 5 returns a vector z such that ∥M:,Rz −M:,i∥0 ≤100(k+1)2OPT(k) |Q| . By the guarantee of Theorem 5, if M:,i is (R, Q)-approximately covered then it is also w.h.p. (R, Q)-nearly-approximately covered. Suppose Algorithm 1 makes t iterations and let A:,∪t i=1Ri and Z be the resulting solution. We bound now its cost. Let B0 = [n], and consider the i-th iteration of Algorithm 1. We denote by Ri a set of 2k uniformly random columns of Bi−1, by Gi a set of columns that is (Ri, Bi−1)-nearly-approximately covered, and by Bi = Bi−1\{Gi ∪Ri} a set of the remaining columns. By construction, |Gi| ≥ |Bi−1|/10 and |Bi| ≤ 9 10|Bi−1| −2k < 9 10|Bi−1|. Since Algorithm 1 terminates when Bt+1 ≤2k, we have 2k < |Bt| < (1 − 1 10)tn, and thus the number of iterations t ≤10 log(n/2k). By construction, |Gi| = (1 −αi)|Bi−1| for some αi ≤9/10, and so Pt i=1 |Gi| |Bi−1| ≤t ≤10 log n 2k. Since minx(j)∥A:,Rix(j) −A:,j∥0 ≤100(k+1)2OPT(k) |Bi−1| , we have Pt i=1 P j∈Gi∥A:,Riz(j) −A:,j∥0 ≤ Pt i=1 P j∈Gi k · minx(j)∥A:,Rix(j) −A:,j∥0 ≤O k2 · log n 2k  · OPT(k). By Lemma 7, the expected number of iterations of selecting a set Ri such that |Gi| ≥1/10|Bi−1| is O(1). Since the number of recursive calls t is bounded by O(log(n/k)), it follows by a Markov bound that Algorithm 1 chooses O(k log(n/k)) columns in total. Since the approximation algorithm of Theorem 5 runs in polynomial time, our entire algorithm has expected polynomial time. 4 Algorithm for Real ℓ0-rank-1 Given a matrix A ∈Rm×n, the ℓ0-rank-1 problem asks to find a matrix A′ with rank 1 such that the difference between A and A′ measured in ℓ0 norm is minimized. We denote the optimum value by OPT(1) def = min rank(A′)=1∥A −A′∥0 = min u∈Rm, v∈Rn∥A −uvT ∥0. (2) In the trivial case when OPT(1) = 0, there is an optimal algorithm that runs in time O(∥A∥0) and finds the exact rank-1 decomposition uvT of a matrix A. In this work, we focus on the case when OPT(1) ≥1. We show that Algorithm 2 yields a (2 + ϵ)-approximation factor and runs in nearly linear time in ∥A∥0, for any constant ϵ > 0. Furthermore, a variant of our algorithm even runs in sublinear time, if ∥A∥0 is large and ψ def = OPT(1)/∥A∥0 is not too small. In particular, we obtain time o(∥A∥0) when OPT(1) ≥(ϵ−1 log(mn))4 and ∥A∥0 ≥n(ϵ−1 log(mn))4. 7 Algorithm 2 Input: A ∈Rm×n and ϵ ∈(0, 0.1). 1. Partition the columns of A into weight-classes S = {S(0), . . . , S(log n+1)} such that S(0) contains all columns j with ∥A:,j∥0 = 0 and S(i) contains all columns j with 2i−1 ≤∥A:,j∥0 < 2i. 2. For each weight-class S(i) do: 2.1 Sample a set C(i) of Θ(ϵ−2 log n) elements uniformly at random from S(i). 2.2 Find a vector z(j) ∈Rn such that ∥A −A:,j[z(j)]T ∥0 ≤ 1 + ϵ 15  minv ∥A −A:,jvT ∥0, for each column A:,j ∈C(i). 3. Compute a (1 + ϵ 15)-approximation Yj of ∥A −A:,j[z(j)]T ∥0 for every j ∈S i∈[|S|] C(i). Return: the pair (A:,j, z(j)) corresponding to the minimal value Yj. Theorem 8. There is an algorithm that, given A ∈ Rm×n with column adjacency arrays and OPT(1) ≥ 1, and given ϵ ∈ (0, 0.1], runs w.h.p. in time O  n log m ϵ2 + min  ∥A∥0, n + ψ−1 log n ϵ2  log2 n ϵ2  and outputs a column A:,j and a vector z that satisfy w.h.p. ∥A −A:,jzT ∥0 ≤(2 + ϵ)OPT(1). The algorithm also computes a value Y satisfying w.h.p. (1 −ϵ)OPT(1) ≤Y ≤(2 + 2ϵ)OPT(1). The only steps for which the implementation details are not immediate are Steps 2.2 and 3. We will discuss them in Sections 4.1 and 4.2, respectively. Note that the algorithm from Theorem 8 selects a column A:,j and then finds a good vector z such that the product A:,jzT approximates A. We show that the approximation guarantee 2 + ϵ is essentially tight for algorithms following this pattern. Lemma 9. There exist a matrix A ∈Rn×n such that minz∥A −A:,jzT ∥0 ≥2(1 −1/n)OPT(1), for every column A:,j. 4.1 Implementing Step 2.2 The Step 2.2 of Algorithm 2 uses the following sublinear procedure, given in Algorithm 3. Lemma 10. Given A ∈Rm×n, u ∈Rm and ϵ ∈(0, 1) we can compute in O(ϵ−2n log m) time a vector z ∈Rn such that w.h.p. ∥A:,i −ziu∥0 ≤(1 + ϵ) minvi∥A:,i −viu∥0 for every i ∈[n]. Algorithm 3 Input: A ∈Rm×n, u ∈Rm and ϵ ∈(0, 1). Let Z def = Θ(ϵ−2 log m), N def = supp(u), and p def = Z/|N|. 1. Select each index i ∈N with probability p and let S be the resulting set. 2. Compute a vector z ∈Rn such that zj = arg minr∈R∥AS,j −r · uS∥0 for all j ∈[n]. Return: vector z. 4.2 Implementing Step 3 In Step 3 of Algorithm 2 we want to compute a (1 + ϵ 15)-approximation Yj of ∥A −A:,j[z(j)]T ∥0 for every j ∈S i∈[|S|] C(i). We present two solutions, an exact algorithm (see Lemma 11) and a sublinear time sampling-based algorithm (see Lemma 13). Lemma 11. Suppose A, B ∈Rm×n are represented by column adjacency arrays. Then, we can compute in O(∥A∥0 + n) time the measure ∥A −B∥0. For our second, sampling-based implementation of Step 3, we make use of an algorithm by Dagum et al. [11] for estimating the expected value of a random variable. We note that the runtime of their algorithm is a random variable, the magnitude of which is bounded w.h.p. within a certain range. Theorem 12. [11] Let X be a random variable taking values in [0, 1] with µ def = E[X] > 0. Let 0 < ϵ, δ < 1 and ρX = max{Var[X], ϵµ}. There is an algorithm with sample access to X that computes an estimator ˜µ in time t such that for a universal constant c we have: i) Pr[(1 −ϵ)µ ≤˜µ ≤(1 + ϵ)µ] ≥1 −δ, and ii) Pr[t ≥c ϵ−2 log(1/δ)ρX/µ2] ≤δ. 8 We state now our key technical insight, on which we build upon our sublinear algorithm. Lemma 13. There is an algorithm that, given A, B ∈Rm×n with column adjacency arrays and ∥A −B∥0 ≥1, and given ϵ > 0, computes an estimator Z that satisfies w.h.p. (1 −ϵ)∥A −B∥0 ≤ Z ≤(1 + ϵ)∥A −B∥0. The algorithm runs w.h.p. in time O(n + ϵ−2 ∥A∥0+∥B∥0 ∥A−B∥0 log n}). We present now our main result in this section. Theorem 14. There is an algorithm that, given A ∈Rm×n with column adjacency arrays and OPT(1) ≥1, and given j ∈[n], v ∈Rm and ϵ ∈(0, 1), outputs an estimator Y that satisfies w.h.p. (1 −ϵ)∥A −A:,jvT ∥0 ≤Y ≤(1 + ϵ)∥A −A:,jvT ∥0. The algorithm runs w.h.p. in time O(min{∥A∥0, n + ϵ−2ψ−1 log n}), where ψ = OPT(1)/∥A∥0. To implement Step 3 of Algorithm 2, we simply apply Theorem 14 with A, ϵ and v = z(j) to each sampled column j ∈S 0≤i≤log n+1 C(i). 5 Algorithms for Boolean ℓ0-rank-1 Our goal is to compute an approximate solution of the Boolean ℓ0-rank-1 problem, defined by: OPT = OPTA def = min u∈{0,1}m, v∈{0,1}n∥A −uvT ∥0, where A ∈{0, 1}m×n. (3) In practice, approximating a matrix A by a rank-1 matrix uvT makes most sense if A is close to being rank-1. Hence, the above optimization problem is most relevant when OPT ≪∥A∥0. In this section, we focus on the case OPT/∥A∥0 ≤φ for sufficiently small φ > 0. We prove the following. Theorem 15. Given A ∈{0, 1}m×n with row and column sums, and given φ ∈(0, 1/80] with OPT/∥A∥0 ≤φ, we can compute vectors ˜u, ˜v with ∥A −˜u˜vT ∥0 ≤(1 + 5φ)OPT + 37φ2∥A∥0 in time O(min{∥A∥0 + m + n, φ−1(m + n) log(mn)}). In combination with Theorem 8 we obtain the following. Theorem 16. Given A ∈{0, 1}m×n with column adjacency arrays and with row and column sums, for ψ = OPT/∥A∥0 we can compute vectors ˜u, ˜v with ∥A −˜u˜vT ∥0 ≤(1 + 500ψ)OPT in time w.h.p. O(min{∥A∥0 + m + n, ψ−1(m + n)} · log3(mn)). A variant of the algorithm from Theorem 15 can also be used to solve the Boolean ℓ0-rank-1 problem exactly. This yields the following theorem, which in particular shows that the problem is in polynomial time when OPT ≤O p ∥A∥0 log(mn)  . Theorem 17. Given a matrix A ∈{0, 1}m×n, if OPTA/∥A∥0 ≤1/240 then we can exactly solve the Boolean ℓ0-rank-1 problem in time 2O(OPT/√ ∥A∥0) · poly(mn). 6 Lower Bounds for Boolean ℓ0-rank-1 We give now a lower bound of Ω(n/φ) on the number of samples of any 1 + O(φ)-approximation algorithm for the Boolean ℓ0-rank-1 problem, where OPT/∥A∥0 ≤φ as before. Theorem 18. Let C ≥1. Given an n × n Boolean matrix A with column adjacency arrays and with row and column sums, and given p log(n)/n ≪φ ≤1/100C such that OPTA/∥A∥0 ≤φ, computing a (1 + Cφ)-approximation of OPTA requires to read Ω(n/φ) entries of A. The technical core of our argument is the following lemma. Lemma 19. Let φ ∈(0, 1/2). Let X1, . . . , Xk be Boolean random variables with expectations p1, . . . , pk, where pi ∈{1/2 −φ, 1/2 + φ} for each i. Let A be an algorithm which can adaptively obtain any number of samples of each random variable, and which outputs bits bi for every i ∈[1 : k]. Suppose that with probability at least 0.95 over the joint probability space of A and the random samples, A outputs for at least a 0.95 fraction of all i that bi = 1 if pi = 1/2 + φ and bi = 0 otherwise. Then, with probability at least 0.05, A makes Ω(k/φ2) samples in total. 9 References [1] Michael Alekhnovich. More on average case vs approximation complexity. Computational Complexity, 20(4):755–786, 2011. [2] Noga Alon, Rina Panigrahy, and Sergey Yekhanin. Deterministic approximation algorithms for the nearest codeword problem. In Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques, 12th International Workshop, APPROX 2009, and 13th International Workshop, RANDOM 2009, Berkeley, CA, USA, August 21-23, 2009. Proceedings, pages 339–351, 2009. [3] Sanjeev Arora, Rong Ge, Ravi Kannan, and Ankur Moitra. Computing a nonnegative matrix factorization - provably. SIAM J. Comput., 45(4):1582–1611, 2016. [4] Radim Belohlávek and Vilém Vychodil. Discovery of optimal factors in binary data via a novel method of matrix decomposition. J. Comput. Syst. Sci., 76(1):3–20, 2010. [5] Piotr Berman and Marek Karpinski. Approximating minimum unsatisfiability of linear equations. In Proceedings of the Thirteenth Annual ACM-SIAM Symposium on Discrete Algorithms, January 6-8, 2002, San Francisco, CA, USA., pages 514–516, 2002. [6] Emmanuel J Candès, Xiaodong Li, Yi Ma, and John Wright. Robust principal component analysis? Journal of the ACM (JACM), 58(3):11, 2011. [7] Emmanuel J. Candès, Xiaodong Li, Yi Ma, and John Wright. Robust principal component analysis? J. ACM, 58(3):11:1–11:37, June 2011. [8] Flavio Chierichetti, Sreenivas Gollapudi, Ravi Kumar, Silvio Lattanzi, Rina Panigrahy, and David P. Woodruff. Algorithms for $\ell_p$ low-rank approximation. In Proceedings of the 34th International Conference on Machine Learning, ICML 2017, Sydney, NSW, Australia, 6-11 August 2017, pages 806–814, 2017. [9] Kenneth L. Clarkson and David P. Woodruff. Low rank approximation and regression in input sparsity time. In Symposium on Theory of Computing Conference, STOC’13, Palo Alto, CA, USA, June 1-4, 2013, pages 81–90, 2013. [10] Kenneth L. Clarkson and David P. Woodruff. Input sparsity and hardness for robust subspace approximation. In IEEE 56th Annual Symposium on Foundations of Computer Science, FOCS 2015, Berkeley, CA, USA, 17-20 October, 2015, pages 310–329, 2015. [11] Paul Dagum, Richard M. Karp, Michael Luby, and Sheldon M. Ross. An optimal algorithm for monte carlo estimation. SIAM J. Comput., 29(5):1484–1496, 2000. [12] C. Dan, K. Arnsfelt Hansen, H. Jiang, L. Wang, and Y. Zhou. Low Rank Approximation of Binary Matrices: Column Subset Selection and Generalizations. ArXiv e-prints, 2015. [13] Fedor V. Fomin, Daniel Lokshtanov, S. M. Meesum, Saket Saurabh, and Meirav Zehavi. Matrix rigidity: Matrix theory from the viewpoint of parameterized complexity. In STACS. Springer, March 2017. [14] Nicolas Gillis and Stephen A. Vavasis. On the complexity of robust PCA and ℓ1-norm low-rank matrix approximation. CoRR, abs/1509.09236, 2015. [15] D. Grigoriev. Using the notions of separability and independence for proving the lower bounds on the circuit complexity (in russian). Notes of the Leningrad branch of the Steklov Mathematical Institute, Nauka, 1976. [16] D. Grigoriev. Using the notions of separability and independence for proving the lower bounds on the circuit complexity. Journal of Soviet Math., 14(5):1450–1456, 1980. [17] Harold W. Gutch, Peter Gruber, Arie Yeredor, and Fabian J. Theis. ICA over finite fields separability and algorithms. Signal Processing, 92(8):1796–1808, 2012. 10 [18] Peng Jiang, Jiming Peng, Michael Heath, and Rui Yang. A clustering approach to constrained binary matrix factorization. In Data Mining and Knowledge Discovery for Big Data, pages 281–303. Springer, 2014. [19] Ravi Kannan and Santosh Vempala. Spectral algorithms. Foundations and Trends in Theoretical Computer Science, 4(3-4):157–288, 2009. [20] Mehmet Koyutürk and Ananth Grama. Proximus: a framework for analyzing very high dimensional discrete-attributed datasets. In Proceedings of the ninth ACM SIGKDD international conference on Knowledge discovery and data mining, pages 147–156. ACM, 2003. [21] Mehmet Koyutürk, Ananth Grama, and Naren Ramakrishnan. Compression, clustering, and pattern discovery in very high-dimensional discrete-attribute data sets. IEEE Trans. Knowl. Data Eng., 17(4):447–461, 2005. [22] Mehmet Koyutürk, Ananth Grama, and Naren Ramakrishnan. Nonorthogonal decomposition of binary matrices for bounded-error data compression and analysis. ACM Transactions on Mathematical Software (TOMS), 32(1):33–69, 2006. [23] Tao Li. A general model for clustering binary data. In Proceedings of the eleventh ACM SIGKDD international conference on Knowledge discovery in data mining, pages 188–197. ACM, 2005. [24] Michael W. Mahoney. Randomized algorithms for matrices and data. Foundations and Trends in Machine Learning, 3(2):123–224, 2011. [25] Edward Meeds, Zoubin Ghahramani, Radford M. Neal, and Sam T. Roweis. Modeling dyadic data with binary latent factors. In Advances in Neural Information Processing Systems 19, Proceedings of the Twentieth Annual Conference on Neural Information Processing Systems, Vancouver, British Columbia, Canada, December 4-7, 2006, pages 977–984, 2006. [26] Xiangrui Meng and Michael W. Mahoney. Low-distortion subspace embeddings in inputsparsity time and applications to robust linear regression. In Symposium on Theory of Computing Conference, STOC’13, Palo Alto, CA, USA, June 1-4, 2013, pages 91–100, 2013. [27] Pauli Miettinen, Taneli Mielikäinen, Aristides Gionis, Gautam Das, and Heikki Mannila. The discrete basis problem. IEEE Trans. Knowl. Data Eng., 20(10):1348–1362, 2008. [28] Pauli Miettinen and Jilles Vreeken. MDL4BMF: minimum description length for boolean matrix factorization. TKDD, 8(4):18:1–18:31, 2014. [29] Jelani Nelson and Huy L. Nguyen. OSNAP: faster numerical linear algebra algorithms via sparser subspace embeddings. In 54th Annual IEEE Symposium on Foundations of Computer Science, FOCS 2013, 26-29 October, 2013, Berkeley, CA, USA, pages 117–126, 2013. [30] A. Painsky, S. Rosset, and M. Feder. Generalized Independent Component Analysis Over Finite Alphabets. ArXiv e-prints, 2015. [31] S. Ravanbakhsh, B. Poczos, and R. Greiner. Boolean Matrix Factorization and Noisy Completion via Message Passing. ArXiv e-prints, 2015. [32] Ilya P. Razenshteyn, Zhao Song, and David P. Woodruff. Weighted low rank approximations with provable guarantees. In Proceedings of the 48th Annual ACM SIGACT Symposium on Theory of Computing, STOC 2016, Cambridge, MA, USA, June 18-21, 2016, pages 250–263, 2016. [33] Jouni K. Seppänen, Ella Bingham, and Heikki Mannila. A simple algorithm for topic identification in 0-1 data. In Knowledge Discovery in Databases: PKDD 2003, 7th European Conference on Principles and Practice of Knowledge Discovery in Databases, Cavtat-Dubrovnik, Croatia, September 22-26, 2003, Proceedings, pages 423–434, 2003. [34] Bao-Hong Shen, Shuiwang Ji, and Jieping Ye. Mining discrete patterns via binary matrix factorization. In Proceedings of the 15th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, Paris, France, June 28 - July 1, 2009, pages 757–766, 2009. 11 [35] Tomás Singliar and Milos Hauskrecht. Noisy-or component analysis and its application to link analysis. Journal of Machine Learning Research, 7:2189–2213, 2006. [36] Zhao Song, David P. Woodruff, and Peilin Zhong. Low rank approximation with entrywise ℓ1-norm error. CoRR, abs/1611.00898, 2016. [37] Zhao Song, David P. Woodruff, and Peilin Zhong. Entrywise low rank approximation of general functions, 2018. Manuscript. [38] Jaideep Vaidya, Vijayalakshmi Atluri, and Qi Guo. The role mining problem: finding a minimal descriptive set of roles. In 12th ACM Symposium on Access Control Models and Technologies, SACMAT 2007, Sophia Antipolis, France, June 20-22, 2007, Proceedings, pages 175–184, 2007. [39] Leslie G. Valiant. Graph-theoretic arguments in low-level complexity. In Mathematical Foundations of Computer Science 1977, 6th Symposium, Tatranska Lomnica, Czechoslovakia, September 5-9, 1977, Proceedings, pages 162–176, 1977. [40] David P. Woodruff. Sketching as a tool for numerical linear algebra. Foundations and Trends in Theoretical Computer Science, 10(1-2):1–157, 2014. [41] Arie Yeredor. Independent component analysis over galois fields of prime order. IEEE Trans. Information Theory, 57(8):5342–5359, 2011. [42] Zhong-Yuan Zhang, Tao Li, Chris Ding, Xian-Wen Ren, and Xiang-Sun Zhang. Binary matrix factorization for analyzing gene expression data. Data Mining and Knowledge Discovery, 20(1):28–52, 2010. [43] Zhongyuan Zhang, Tao Li, Chris Ding, and Xiangsun Zhang. Binary matrix factorization with applications. In Data Mining, 2007. ICDM 2007. Seventh IEEE International Conference on, pages 391–400. IEEE, 2007. 12
2017
616
7,137
ADMM without a Fixed Penalty Parameter: Faster Convergence with New Adaptive Penalization Yi Xu†, Mingrui Liu†, Qihang Lin‡, Tianbao Yang† †Department of Computer Science, The University of Iowa, Iowa City, IA 52242, USA ‡Department of Management Sciences, The University of Iowa, Iowa City, IA 52242, USA {yi-xu, mingrui-liu, qihang-lin, tianbao-yang}@uiowa.edu Abstract Alternating direction method of multipliers (ADMM) has received tremendous interest for solving numerous problems in machine learning, statistics and signal processing. However, it is known that the performance of ADMM and many of its variants is very sensitive to the penalty parameter of a quadratic penalty applied to the equality constraints. Although several approaches have been proposed for dynamically changing this parameter during the course of optimization, they do not yield theoretical improvement in the convergence rate and are not directly applicable to stochastic ADMM. In this paper, we develop a new ADMM and its linearized variant with a new adaptive scheme to update the penalty parameter. Our methods can be applied under both deterministic and stochastic optimization settings for structured non-smooth objective function. The novelty of the proposed scheme lies at that it is adaptive to a local sharpness property of the objective function, which marks the key difference from previous adaptive scheme that adjusts the penalty parameter per-iteration based on certain conditions on iterates. On theoretical side, given the local sharpness characterized by an exponent θ ∈(0, 1], we show that the proposed ADMM enjoys an improved iteration complexity of eO(1/ϵ1−θ)1 in the deterministic setting and an iteration complexity of eO(1/ϵ2(1−θ)) in the stochastic setting without smoothness and strong convexity assumptions. The complexity in either setting improves that of the standard ADMM which only uses a fixed penalty parameter. On the practical side, we demonstrate that the proposed algorithms converge comparably to, if not much faster than, ADMM with a fine-tuned fixed penalty parameter. 1 Introduction Our problem of interest is the following convex optimization problem that commonly arises in machine learning, statistics and signal processing: min x∈Ω F(x) ≜f(x) + ψ(Ax) (1) where Ω⊆Rd is a closed convex set, f : Rd →R and ψ : Rm →R are proper lower-semicontinuous convex functions, and A ∈Rm×d is a matrix. In this paper, we consider solving (1) by alternating direction method of multipliers (ADMM) in two paradigms, namely deterministic optimization and stochastic optimization. In both paradigms, ADMM has been employed widely for solving the regularized statistical learning problems like (1) due to its capability of tackling the sophisticated structured regularization term ψ(Ax) in (1) (e.g., the generalized lasso ∥Ax∥1), which is often an 1 eO() suppresses a logarithmic factor. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. obstacle for applying other methods such as proximal gradient method. As follows, we describe the standard ADMM and its variants for solving (1) in different optimization paradigms. It is worth mentioning that all algorithms presented in this paper can be easily extended to handle a more general term ψ(A(x) + c), where A is a linear mapping. To apply ADMM, the original problem (1) is first cast into an equivalent constrained optimization problem via decoupling: min x∈Ω,y∈Rm f(x) + ψ(y), s.t. y = Ax. (2) An augmented Lagrangian function for (2) is defined as L(x, y, λ) = f(x) + ψ(y) −λ⊤(Ax −y) + β 2 ∥Ax −y∥2 2, (3) where β is a constant called penalty parameter and λ ∈Rm is a dual variable. Then, the standard ADMM solves problem (1) by executing the following three steps in each iteration: xτ+1 = arg min x∈ΩL(x, yτ, λτ) = arg min x∈Ωf(x) + β 2 (Ax −yτ) −1 β λτ 2 2 , (4) yτ+1 = arg min x∈ΩL(xτ+1, y, λτ) = arg min y∈Rm ψ(y) + β 2 (Axτ+1 −y) −1 β λτ 2 2 , (5) λτ+1 = λτ −β(Axτ+1 −yτ+1). (6) When A is not an identity matrix, solving the subproblem (4) above for xτ+1 might be difficult. To alleviate the issue, linearized ADMM [33, 34, 8] has been proposed, which solves the following problem instead of (4): xτ+1 = arg min x∈Ωf(x) + β 2 (Ax −yτ) −1 β λτ 2 2 + 1 2∥x −xτ∥2 G, (7) where ∥x∥G = √ x⊤Gx and G ∈Rd×d is a positive semi-definite matrix. By setting G = γI −βA⊤A ⪰0, the term x⊤A⊤Ax in (7) vanishes. It has been established that both standard ADMM and linearized ADMM have an O(1/t) convergence rate for solving (2) [8] , where t is the number of iterations. Under a minor condition, this result implies an O(1/ϵ) iteration complexity for solving the original problem (1) (see Corollary 1). In addition, we consider ADMM for solving (1) in stochastic optimization with f(x) = Eξ[f(x; ξ)] (8) where ξ is a random variable. This formulation captures many risk minimization problems in machine learning where ξ denotes a data point sampled from a distribution and f(x; ξ) denotes a loss function of the model x on the data ξ. It also covers as a special case the empirical loss where f(x) = 1 n Pn i=1 f(x; ξi) with n is the number of samples. For these problems, computing f(x) itself might be prohibitive (e.g., when n is very large) or even impossible. To address this issue, one usually considers the stochastic optimization paradigm, where it is assumed that f(x; ξ) and its subgradient ∂f(x; ξ) can be efficiently computed. To solve the stochastic optimization problem, stochastic ADMM algorithms have been proposed [21, 23], which update yτ+1 and λτ+1 the same to (5) and (6), respectively, but update xτ+1 as xτ+1 = arg min x∈Ωf(xτ; ξτ)+∂f(xτ; ξτ)⊤(x−xτ)+ β 2 (Ax −yτ) −1 β λτ 2 2 + ∥x −xτ∥2 Gτ ητ (9) where ξτ is a random sample, ητ is a stepsize and Gτ = γI −βητA⊤A ⪰I [23] or Gτ = I [21]. Other stochastic variants of ADMM for general convex optimization were also proposed in [23, 35]. These work have established an O(1/ √ t) convergence rate of stochastic ADMM for solving (2) with f(x) being (8). Under a minor condition, we can also show that these stochastic ADMM algorithms suffer from a higher iteration complexity of O(1/ϵ2) for finding an ϵ-optimal solution to the original problem (1) (see Corollary 3). Although the variants of ADMM with fast convergence rates have been developed under smoothness, strong convexity and other regularity conditions (e.g., the matrix A has full rank), the best iteration 2 complexities of deterministic ADMM and stochastic ADMM for general convex optimization remain O(1/ϵ) and O(1/ϵ2), respectively. On the other hand, many studies have reported that the performance of ADMM is very sensitive to the penalty parameter β. How to address or alleviate this issue has attracted many studies and remains an active topic. In particular, it remains an open question how to quantify the improvement in ADMM’s theoretical convergence by using adaptive penalty parameters. Of course, the answer to this question depends on the adaptive scheme being used. Almost all previous works focus on using self-adaptive schemes that update the penalty parameter during the course of optimization according to the historical iterates (e.g., by balancing the primal residual and dual residual). However, there is hitherto no quantifiable improvement in terms of convergence rate or iteration complexity for these self-adaptive schemes. In this paper, we focus on the design of adaptive penalization for both deterministic and stochastic ADMM and show that, with the proposed adaptive updating scheme on the penalty parameter, the theoretical convergence properties of ADMM can be improved without imposing any smoothness and strong convexity assumptions on the objective function. The key difference between the proposed adaptive scheme and previous self-adaptive schemes is that the proposed penalty parameter is adaptive to an local sharpness property of the objective function, namely the local error bound (see Definition 1). Given the exponent constant θ ∈(0, 1] that characterizes this local sharpness property, we show that the proposed deterministic ADMM enjoys an improved iteration complexity of eO(1/ϵ1−θ)2 and the proposed stochastic ADMM enjoys an iteration complexity of eO(1/ϵ2(1−θ)), both of which improve the complexity of their standard counterparts which only use a fixed penalty parameter. To the best of our knowledge, this is the first evidence that an adaptive penalty parameter used in ADMM can lead to provably lower iteration complexities. We call the proposed ADMM algorithms locally adaptive ADMM because of its adaptivity to the problem’s local property. 2 Related Work Since there is a tremendous amount of studies on ADMM, the review below mainly focuses on the ADMMs with a variable penalty parameter. A convergence rate of O(1/t) was first shown for both the standard and linearized variants of ADMM [8, 19, 9] on general non-smooth and non-strongly convex problems. Later, smoothness and strong convexity assumptions are introduced to develop faster convergence rates of ADMMs [22, 3, 11, 6]. Stochastic ADMM was considered in [21, 23] with a convergence rate of O(1/ √ t) for general convex problems and eO(1/t) for strongly convex problems. Recently, many variance reduction techniques have been borrowed into stochastic ADMM to achieve improved convergence rates for finite-sum optimization problems where f(x) = 1 n Pn i=1 fi(x) under the smoothness and strong convexity assumptions [37, 36, 24]. Nevertheless, most of these aforementioned works focus on using a constant penalty parameter. He et al. [10] analyzed ADMM with self-adaptive penalty parameters. The motivation for their self-adaptive penalty is to balance the order of the primal residual and the dual residual. However, the convergence of ADMM with self-adaptive penalty is not guaranteed unless the adaptive scheme is turned off after a number of iterations. Additionally, their self-adaptive rule requires computing the deterministic subgradient of f(x) so that is not appropriate for stochastic optimization. Tian & Yuan [25] proposed a variant of ADMM with variable penalty parameters. Their analysis and algorithm require the smoothness assumption of ψ(Ax) and full column rank of the A matrix. Zhou et al. [15] focused on solving low-rank representation by linearized ADMM and also proposed a non-decreasing self-adaptive penalty scheme. However, their scheme is only applicable to an equality constraint Ax + By = c with c ̸= 0. Recently, Xu et al. [31] proposed a self-adaptive penalty scheme for ADMM based on the Barzilai and Borwein gradient methods. The convergence of their ADMM relies on the analysis in He et al. [10] and thus requires the penalty parameter to be fixed after a number of iterations. In contrast, our adaptive scheme fpr the penalty parameter is different from the previous methods in the following aspects: (i) it is adaptive to the local sharpness property of the problem; (ii) it allows the penalty parameter to increase to infinity as the algorithm proceeds; (iii) it can be employed for both deterministic and stochastic ADMMs as well as their linearized versions. It is also notable that the presented algorithms and their convergence theory share many similarities with the recent developments leveraging the local error bound condition [32, 30, 29], where similar iteration complexities have been established. However, we would like to emphasize that the newly 2 eO() suppresses a logarithmic factor. 3 proposed ADMM algorithms are more effective to tackle problems with structured regularizers (e.g., generalized lasso) than the methods in [32, 30, 29], and have an additional unique feature of using adaptive penalty parameter. 3 Preliminaries Recall that the problem of our interest: min x∈ΩF(x) ≜f(x) + ψ(Ax), (10) where Ω⊆Rd is a closed convex set, f : Rd →(−∞, +∞] and ψ : Rm →(−∞, +∞] are proper lower-semicontinuous convex functions, and A ∈Rm×d is a matrix. Let Ω∗and F∗denote the optimal set of (10) and the optimal value, respectively. We present some assumptions that will be used in the paper. Assumption 1. For the convex optimization problem (10), we assume (a) there exist known x0 ∈Ω and ϵ0 ≥0 such that F(x0) −F∗≤ϵ0; (b) Ω∗is a non-empty convex compact set; (c) there exists a constant ρ such that ∥∂ψ(y)∥2 ≤ρ for all y; (d) ψ is defined everywhere. For a positive semi-definite matrix G, the G-norm is defined as ∥x∥G = √ x⊤Gx. Let B(x, r) = {u ∈Rd : ∥u −x∥2 ≤r} denote the Euclidean ball centered x with a radius r. We denote by dist(x, Ω∗) the distance between x and the set Ω∗, i.e., dist(x, Ω∗) = minv∈Ω∗∥x −v∥2. We denote by Sϵ the ϵ-sublevel set of F(x), respectively, i.e., Sϵ = {x ∈Ω: F(x) ≤F∗+ ϵ}. Local Sharpness. Below, we introduce a condition, namely local error bound condition, to characterize the local sharpness property of the objective function. Definition 1 (Local error bound (LEB)). A function F(x) is said to satisfy a local error bound condition on the ϵ-sublevel set if there exist θ ∈(0, 1] and c > 0 such that for any x ∈Sϵ dist(x, Ω∗) ≤c(F(x) −F∗)θ. (11) Remark: We will refer to θ as the local sharpness parameter. A recent study [1] has shown that the local error bound condition is equivalent to the famous Kurdyka - Łojasiewicz (KL) property [13], which characterizes that under a transformation of ψ(s) = csθ, the function F(x) can be made sharp around the optimal solutions, i.e, the norm of subgradient of the transformed function ψ(F(x) −F∗) is lowered bounded by a constant 1. Note that by allowing θ = 0 in the above condition we can capture a full spectrum of functions. However, a broad family of functions can have a sharper upper bound, i.e., with a non-zero constant θ in the above condition. For example, for functions that are semi-algebraic and continuous, the above inequality is known to hold on any compact set (c.f. [1] and references therein). The value of θ has been revealed for many functions (c.f. [18, 14, 20, 1, 32]). 4 Locally Adaptive ADMM for Deterministic Optimization Since the proposed locally adaptive ADMM algorithm builds upon the standard ADMM, we first present the detailed steps of ADMM in Algorithm 1. Note that if we set G = 0 ∈Rd×d, it gives the standard ADMM; and if we use G = γI −βA⊤A ⪰0, it gives the linearized variant, which can make the computation of xτ+1 easier. To ensure G ⪰0, the minimum valid value for γ in the linearized variant is β∥A∥2 2. To present the convergence result of ADMM (Algorithm 1), we first introduce some notations. u = x y λ ! , F(u) =   −A⊤λ λ Ax −y  , but = 1 t t X τ=1 uτ, bxt = 1 t t X τ=1 xτ, byt = 1 t t X τ=1 yτ, bλt = 1 t t X τ=1 λτ. We recall the convergence result of [8] for the equality constrained problem (2), which does not assume any smoothness, strong convexity and other regularity conditions. 4 Algorithm 1 ADMM(x0, β, t) 1: Input: x0 ∈Ω, the penalty parameter β, the number of iterations t 2: Initialize: x1 = x0, y1 = Ax1, λ1 = 0, γ = β∥A∥2 2 and G = γI −βA⊤A or G = 0. 3: for τ = 1, . . . , t do 4: Update xτ+1 by (7), yτ+1 by (5), 5: Update λτ+1 by (6) 6: end for 7: Output: bxt = Pt τ=1 xτ/t Algorithm 2 LA-ADMM (x0, β1, K, t) 1: Input: x0 ∈Ω, the number of stages K, and the number of iterations t per stage, initial value of penalization parameter β1 2: for k = 1, . . . , K do 3: Let xk = ADMM(xk−1, βk, t) 4: Update βk+1 = 2βk 5: end for 6: Output: xK Proposition 1 (Theorem 4.1 in [8]). For any x ∈Ω, y ∈Rm and λ ∈Rm, we have f(bxt) + ψ(byt) −[f(x) + ψ(y)] + (but −u)⊤F(u) ≤∥x −x1∥2 G 2t + β∥y −y1∥2 2 2t + ∥λ −λ1∥2 2 2βt . Remark: The above result establishes a convergence rate for the variational inequality pertained to (2). When t →∞, (bxt, byt) converges to the optimal solutions of (2) in a rate of O(1/t). Since our goal is to solve the problem (1), next we present a corollary exhibiting the convergence of ADMM for solving the original problem (1). All omitted proofs can be found in the supplement. Corollary 1. Suppose Assumption 1.c and 1.d hold. Let bxt be the output of ADMM. For any x ∈Ω, we have F(bxt) −F(x) ≤∥x −x0∥2 G 2t + β∥A∥2 2∥x −x0∥2 2 2t + ρ2 2βt. Remark: For the standard ADMM with G = 0 the first term in the R.H.S vanishes. For the linearized ADMM with G = γI −βA⊤A ⪰0, we can bound ∥x −x0∥2 G ≤γ∥x −x0∥2 2. One can also derive a theoretically optimal value of β by setting x = x∗∈Ω∗and minimizing the upper bound, which results in β = ρ ∥A∥2∥x∗−x0∥2 for the standard ADMM or β = ρ √ 2∥A∥2∥x∗−x0∥2 for the linearized ADMM. Finally, the above result implies that the iteration complexity of standard and linearized ADMM for finding an ϵ-optimal solution of (1) is O  ρ∥A∥2∥x−x0∥2 ϵ  . Next, we present our locally adaptive ADMM and our main result in this section regarding its iteration complexity. The proposed algorithm is described in Algorithm 2, which is referred to as LA-ADMM. The algorithm runs with multiple stages by calling ADMM at each stage with a warm start and a constant number of iterations t. The penalty parameter βk is increased by a constant factor larger than 1 (e.g., 2) after each stage and has an initial value dependent on ρ, ∥A∥2, ϵ0, θ and the targeted accuracy ϵ. The convergence result of LA-ADMM employing G = γI −βA⊤A is established below. A slightly better result in terms of a constant factor can be established for employing G = 0. Theorem 2. Suppose Assumption 1 holds and F(x) obeys a local error bound condition on the ϵsublevel. Let β1 = 2ρϵ1−θ ∥A∥2ϵ0 , K = ⌈log2(ϵ0/ϵ)⌉and t = l 8ρ∥A∥2 max(1,c2) ϵ1−θ m , we have F(xK) −F∗≤ 2ϵ. The iteration complexity of LA-ADMM for achieving an 2ϵ-optimal solution is eO(1/ϵ1−θ). Remark: There are two levels of adaptivity to the local sharpness of the penalty parameter. First, the initial value β1 in Algorithm 3 depends on the local sharpness parameter θ. Second, the time interval to increase the penalty parameter is determined by the value of t which is also dependent on θ. Compared to the iteration complexity O(1/ϵ) of vanilla ADMM, LA-ADMM can enjoy a lower iteration complexity. 5 Locally Adaptive ADMM for Stochastic Optimization In this section, we consider stochastic optimization problem as the following: min x∈ΩF(x) ≜Eξ[f(x; ξ)] + ψ(Ax), (12) where ξ is a random variable and f(x; ξ) : Rd →(−∞, +∞] is a proper lower-semicontinuous convex function for each realization of ξ. For this problem, in addition to Assumption 1, we make 5 Algorithm 3 SADMM(x0, η, β, t, Ω) 1: Input: x0 ∈Rd, a step size η, penalty parameter β, the number of iterations t and a domain Ω. 2: Initialize: x1 = x0, y1 = Ax1, λ1 = 0 3: for τ = 1, . . . , t do 4: Update xτ+1 by (9) and yτ+1 by (5) 5: Update λτ+1 by (6) 6: end for 7: Output: bxt = Pt τ=1 xτ/t Algorithm 4 LA-SADMM (x0, η1, β1, D1, K, t) 1: Input: x0 ∈Rd, the number of stages K, the number of iterations t per stage, the initial step size η1, the initial parameter β1 and the initial radius D1. 2: for k = 1, . . . , K do 3: Let xk = SADMM(xk−1, ηk, βk, t, Bk ∩Ω) 4: Update ηk+1 = ηk/2 and βk+1 = 2βk, Dk+1 = Dk/2. 5: end for 6: Output: xK the following assumption for our development, which is a standard assumption for many previous stochastic gradient methods. Assumption 2. For the stochastic optimization problem (12), we assume that there exists a constant R such that ∥∂f(x; ξ)∥2 ≤R almost surely for any x ∈Ω. We present a framework of stochastic ADMM (SADMM) in Algorithm 3. The convergence results for solving the equivalent constrained optimization problem of stochastic ADMM with different choices of Gτ have been established in [21, 23, 35]. Below, we will focus on Gτ = γI −ηβA⊤A ⪰I because it leads to computationally more efficient update for xτ+1 than other two choices for high-dimensional problems. Using Gτ = I will yield a similar convergence bound except for a constant term and using the idea of AdaGrad for computing Gτ will lead to the same order of convergence in the worst-case, which we will postpone to future work for exploration. The corollary below will be used in our analysis. Corollary 3. Suppose Assumption 1.c, 1.d and Assumption 2 hold. Let Gτ = γI −ηβA⊤A ⪰I in Algorithm 3. For any x ∈Ω, F(bxt) −F(x) ≤ηR2 2 + γ∥x1 −x∥2 2 2ηt + β∥A∥2 2∥x1 −x∥2 2 2t + ρ2 2βt  + ρ∥A∥2∥x1 −xt+1∥2 t + 1 t t X τ=1 (E[gτ] −gτ)⊤(xτ −x). Remark: Taking expectation on both sides will yield the expectational convergence bound. We can also use an analysis of large deviation to bound the last term to obtain the convergence with high probability. In particular, by setting η ∝1/√τ, the above result implies an O(1/ √ t) convergence rate, i.e., O(1/ϵ2) iteration complexity of stochastic ADMM. Next, we discuss our locally adaptive stochastic ADMM (LA-SADMM) algorithm in Algorithm 4. The key idea is similar to LA-ADMM, i.e., calling SADMM in multiple stages with warm start. The step size ηk in each call of SADMM is fixed and decreases by a certain fraction after one stage. The penalty parameter is updated similarly to that in LA-ADMM but with a different initial value. A key difference from LA-ADMM is that we employ a domain shrinking approach to modify the domain of the solutions xτ+1 at each stage. For the k-th stage, the domain for x is the intersection of Ω and Bk = B(xk−1, Dk), where the latter is a ball with a radius of Dk centered at xk−1 (the initial solution of the k-th stage). The radius Dk will decrease geometrically between stages. The purpose of using the domain shrinking approach is to tackle the last term of the upper bound in Corollary 3 so that it can decrease geometrically as the stage number increases. A similar idea has been adopted in [29, 7, 5]. Note that during each SADMM, we can use the three choices of Gτ as mentioned before. Below we only present the convergence result of the variant with Gτ = γI −ηkβkA⊤A. Theorem 4. Suppose Assumptions 1 and 2 hold and F(x) obeys the local error bound condition on Sϵ. Given δ ∈(0, 1), let ˜δ = δ/K, K = ⌈log2( ϵ0 ϵ )⌉, η1 = ϵ0 6R2 , β1 = 6R2 ∥A∥2 2ϵ0 , D1 ≥ cϵ0 ϵ1−θ , t be the smallest integer such that t ≥max{ 6912R2 log(1/˜δ)D2 1 ϵ2 0 , 12ρ∥A∥2D1 ϵ0 , ρ2∥A∥2 2 R2 } and Gτ = 2I −η1β1A⊤A ⪰I. Then LA-SADMM guarantees that, with a probability 1 −δ, we have F(xK) − F∗≤2ϵ. The iteration complexity of LA-SADMM for achieving an 2ϵ-optimal solution with a high probability 1 −δ is eO(log(1/δ)/ϵ2(1−θ)), provided D1 = O( cϵ0 ϵ(1−θ) ). 6 Algorithm 5 LA-ADMM with Restarting 1: Input: t1, β(1) 1 2: Initialization: x(0) 3: for s = 1, 2, . . . , do 4: x(s) =LA-ADMM(x(s−1), β(s) 1 , K, ts) 5: ts+1 = ts21−θ, β(s+1) 1 = β(s) 1 /21−θ 6: end for 7: Output: x(S) Algorithm 6 LA-SADMM with Restarting 1: Input: t1, D(1) 1 and ϵ ≤ϵ0/2 2: Initialization: x(0), η1 = ϵ0 6R2 , β1 = 6R2 ∥A∥2 2ϵ0 3: for s = 1, 2, . . . , do 4: x(s) =LA-SADMM(x(s−1), η1, β1, D(s) 1 , K, ts) 5: ts+1 = ts22(1−θ), D(s+1) 1 = D(s) 1 21−θ 6: end for 7: Output: x(S) Remark: Interestingly, unlike that in LA-ADMM, the initial value β1 does not depend on θ. The adaptivity of the penalty parameters lies on the time interval t which determines when the value of β is increased. The difference comes from the first two terms in Corollary 3. Before ending this section, we discuss two points. First, both Theorem 2 and Theorem 4 exhibit the dependence of the two algorithms on the c parameter (e.g., t in Algorithm 2 and D1 in Algorithm 4) that is usually unknown. Nevertheless, this issue can be easily addressed by using another level of restarting and increasing sequence of t and D1 similar to the practical variants in [29, 32]. Due to the limit of space, we only present the algorithms in Algorithm 5 and Algorithm 6 with their formal guarantee presented in supplement. The conclusion is that under mild conditions as long as β(1) in Algorithm 5 is sufficiently small, t1 and D(1) 1 in Algorithm 6 are sufficiently large, the iteration complexities remain eO(1/ϵ1−θ) and eO(1/ϵ2(1−θ)) when θ in LEB condition is known. Second, these variants can be even employed when the local sharpness parameter θ is unknown by simply setting it to 0, and still enjoy reduced iteration complexities in terms of a multiplicative factor compared to vanilla ADMMs. Detailed results are included in the supplement. 6 Applications and Experiments In this section, we present some experimental results of the proposed algorithms for solving three tasks, namely generalized LASSO, robust regression with a low-rank regularizer (RR-LR) and learning low-rank representation. For generalized lasso, our experiment focuses on comparing the proposed LA-SADMM with SADMM. For the latter tasks, we focus on comparing the proposed LA-ADMM with previous linearized ADMM with and without self-adaptive penalty parameters. We first consider generalized LASSO, which can find applications in many problems in statistics and machine learning [28]. The objective of generalized LASSO can be expressed as: min x∈Rd F(x) = 1 n n X i=1 ℓ(x⊤ai, bi) + δ∥Ax∥1 (13) where (ai, bi) is a set of pairs of training data, i = 1, . . . , n, δ ≥0 is a regularization parameter, A ∈Rm×d is a specified matrix, and ℓ(z, b) is a convex loss function in terms of z. The above formulation include many formulations as special cases, e.g., the standard LASSO where A = I ∈ Rd×d [26], fused LASSO that penalizes the ℓ1 norm of both the coefficients and their successive differences [27], graph-guided fused LASSO (GGLASSO) where A = F ∈Rm×d encodes some graph information about features [12], and sparse graph-guided fused LASSO (S-GGLASSO) where ∥Ax∥1 = δ2∥x∥1 + δ1∥Fx∥1 [21]. Let us first discuss the local sharpness parameter of generalized lasso with different loss functions. For the loss function, let us first consider piecewise linear loss function such as hinge loss ℓ(z, b) = max(0, 1 −bz), absolute loss ℓ(z, b) = |z −b| and ϵ-insensitive loss ℓ(z, b) = max(|z −b| −ϵ, 0). Then the objective is a polyhedral function. According to the results in [32], the local sharpness parameter is θ = 1. It then implies that both LA-ADMM and LA-SADMM enjoy linear convergence results for solving the problem (13) with a piecewise linear loss function. To the best of our knowledge, these are the first linear convergence results of ADMM without smoothness and strong convexity conditions. One can also consider piecewise quadratic loss such as square loss ℓ(z, b) = (z −b)2 for b ∈R and squared hinge loss ℓ(z, b) = max(0, 1 −bz)2 for b ∈{1, −1}. According to [14], the problem with convex piecewise quadratic loss has a local sharpness parameter θ = 1/2, implying eO(1/√ϵ) and eO(1/ϵ) for LA-ADMM and LA-SADMM. 7 # of iterations ×106 0 0.5 1 1.5 2 2.5 3 objective 0.13 0.135 0.14 0.145 0.15 0.155 0.16 w8a SADMM LA-SADMM (a) SVM + GGLASSO # of iterations ×105 0 2 4 6 8 10 objective 0.25 0.3 0.35 0.4 0.45 0.5 0.55 gisette SADMM LA-SADMM (b) SVM + GGLASSO # of iterations 0 20 40 60 80 100 log(objective) 10 10.5 11 11.5 12 12.5 13 synthetic data ADMM-best ADMM-worst ADMM-AP ADMM-RB LA-ADMM (c) RR + LR # of iterations ×106 0 1 2 3 4 objective 0.135 0.14 0.145 0.15 0.155 0.16 0.165 0.17 0.175 w8a SADMM LA-SADMM (d) SVM + S-GGLASSO # of iterations ×105 0 2 4 6 8 10 objective 0.25 0.3 0.35 0.4 0.45 0.5 0.55 gisette SADMM LA-SADMM (e) SVM + S-GGLASSO # of iterations 0 200 400 600 800 1000 log(objective) 5 5.5 6 6.5 7 shape ADMM-best ADMM-worst ADMM-AP ADMM-RB LA-ADMM (f) LRR Figure 1: Comparison of different algorithms for solving different tasks. RR + LR represents robust regression with a low rank regularizer. LRR represents low-rank representation. For more examples with different values of θ, we refer readers to [32, 30, 29, 17]. SVM Classification with GGLASSO and S-GGLASSO Regularizers To generate the A matrix, we first need to construct a dependency graph of features. We follow [21] to generate a dependency graph by sparse inverse covariance selection [4]. Specifically, we get the estimator of the inverse covariance matrix denoted by ˆΣ−1 via sparse inverse covariance estimation with the graphical lasso [4]. For each nonzero entry ˆΣ−1 ij , where i, j ∈{1, . . . , d}, i ̸= j, an edge between i and j is created. If we denote by G ≡{V, E} the resulting graph, where V is a set of d vertices, which correspond to d features in the data, and E = {e1, . . . , em} denotes the set of m edges between elements of V, where ei consists of a tuple of two elements, then the k-th row of A has two non-zero elements corresponding to the k-th edge ek = (i, j) ∈E with Ak,i = 1 and Ak,j = −1. We choose two medium-scale data sets from libsvm website, namely w8a data (n = 49749, d = 300) and gisette data (n = 6000, d = 5000), to conduct the experiment. In the process of estimating inverse covariance matrix, we choose a penalty parameter to be 0.01 that renders the percentage of non-zero elements of the A matrix to be around 3% for w8a data and 1% for gisette data. We compare the performance of the LA-SADMM algorithm with SADMM [23], where in SADMM we use Gτ = γI −βητA⊤A ⪰I with ητ ∝η1/√τ. For fairness, we set the same initial solution with all zero entries. We fix the value of regularization parameters (δ in GGLASSO and δ1, δ2 in S-GGLASSO) to be 1 n, where n is the number of samples. For SADMM, we tune both η1 and β from {10−5:1:5} . For LA-SADMM, we set the initial step size and penalty parameter to their theoretical value in Theorem 4, and select D1 from {100, 1000}. The values of t in LA-SADMM is set to 105 and 5 × 104 for w8a and gisette, respectively. The results of comparing the objective values versus the number of iterations are presented in Figure 1 (a,b,d,e). We can see that LA-SADMM exhibits a much faster convergence than SADMM. Robust Regression with a Low-rank Regularizer The objective function is F(X) = λ∥X∥∗+ ∥AX −C∥1. We can form an equality constraint Y = AX −C and solve the problem by linearized ADMM. The value of the local sharpness parameter of this problem is still an open problem. We compare the proposed LA-ADMM, the vanilla linearized ADMM with a fixed penalty parameter (ADMM), the linearized ADMM with self-adaptive penalty proposed in [15] (ADMM-AP), and the linearized ADMM with residual balancing in [10, 2] (ADMM-RB). We construct a synthetic data where A ∈R1000×100 is generated following a Gaussian distribution with mean 0 and standard deviation 1. To construct C ∈R1000×50, we first generate X ∈R100×50 and 8 retain only its top 20 components denoted by ˆX and then let C = A ˆX + ε, where ε is a Gaussian noise matrix with mean zero and standard deviation 0.01. We set λ = 100. For the vanilla linearized ADMM, we try different penalty parameters from {10−3:1:3} and report the best performance (using β = 0.01) and worst performance (using β = 0.001). To demonstrate the capability of adaptive ADMM, we choose β = 0.001 as the initial step size for LA-ADMM and ADMM-AP. Other parameters of ADMM-AP is the same as suggested in the original paper. For LA-ADMM, we implement its restarting variant (Algorithm 5), and start with the number of inner iterations t = 2 and increase its value by a factor 2 after 10 stages, and also increase the value of β by 10 times after each stage. The results are reported in Figure 1 (c), from which we can see that LA-ADMM performs comparably with ADMM with the best penalty parameter and also better than ADMM-AP. We also include the results in terms of running time in the supplement. Low-rank Representation [16] The objective function is F(X) = λ∥X∥∗+ ∥AX −A∥2,1, where A ∈Rn×d is a data matrix. We used the shape image 3 and set λ = 10. For the vanilla linearized ADMM, we try different penalty parameters from {10−3:1:3} and report the best performance (using β = 0.1) and worst performance (using β = 0.01). To demonstrate the capability of adaptive ADMM, we choose β = 0.01 as the initial step size for LA-ADMM and ADMM-AP. Other parameters of ADMM-AP is the same as suggested in the original paper. For LA-ADMM, we start with the number of inner iterations t = 20 and increase its value by a factor 2 after 2 stages, and also increase the value of β by 2 times after each stage. The results are reported in Figure 1 (f), from which we can see that LA-ADMM performs comparably with ADMM with the best penalty parameter and also better than ADMM-AP. We can see from the figure that the results of ADMM-worst and ADMM-AP are quite similar. We also include the results in terms of running time in the supplement. 7 Conclusion In this paper, we have presented a new theory of (linearized) ADMM for both deterministic and stochastic optimization with adaptive penalty parameters. The new adaptive scheme is different from previous self-adaptive schemes and is adaptive to the local sharpness of the problem. We have established faster convergence of the proposed algorithms of ADMM with penalty parameters adaptive to the local sharpness parameter. Experimental results have demonstrated the superior performance of the proposed stochastic and deterministic adaptive ADMM. Acknowlegements We thank the anonymous reviewers for their helpful comments. Y. Xu, M. Liu and T. Yang are partially supported by National Science Foundation (IIS-1463988, IIS-1545995). Y. Xu would like to thank Yan Yan for useful discussions on the low-rank representation experiments. References [1] J. Bolte, T. P. Nguyen, J. Peypouquet, and B. Suter. From error bounds to the complexity of first-order descent methods for convex functions. CoRR, abs/1510.08234, 2015. [2] S. Boyd, N. Parikh, E. Chu, B. Peleato, and J. Eckstein. Distributed optimization and statistical learning via the alternating direction method of multipliers. Foundations and Trends R⃝in Machine Learning, 3(1):1–122, 2011. [3] W. Deng and W. Yin. On the global and linear convergence of the generalized alternating direction method of multipliers. Journal of Scientific Computing, 66(3):889–916, 2016. [4] J. Friedman, T. Hastie, and R. Tibshirani. Sparse inverse covariance estimation with the graphical lasso. Biostatistics, 9, 2008. [5] S. Ghadimi and G. Lan. Optimal stochastic approximation algorithms for strongly convex stochastic composite optimization, ii: Shrinking procedures and optimal algorithms. SIAM Journal on Optimization, 23(4):2061–2089, 2013. 3http://pages.cs.wisc.edu/~swright/TVdenoising/ 9 [6] T. Goldstein, B. O’Donoghue, S. Setzer, and R. Baraniuk. Fast alternating direction optimization methods. SIAM Journal on Imaging Sciences, 7(3):1588–1623, 2014. [7] E. Hazan and S. Kale. Beyond the regret minimization barrier: an optimal algorithm for stochastic strongly-convex optimization. In Proceedings of the 24th Annual Conference on Learning Theory (COLT), pages 421–436, 2011. [8] B. He and X. Yuan. On the o(1/n) convergence rate of the douglas-rachford alternating direction method. SIAM Journal on Numerical Analysis, 50(2):700–709, 2012. [9] B. He and X. Yuan. On non-ergodic convergence rate of douglas–rachford alternating direction method of multipliers. Numerische Mathematik, 130(3):567–577, 2015. [10] B. S. He, H. Yang, and S. L. Wang. Alternating direction method with self-adaptive penalty parameters for monotone variational inequalities. Journal of Optimization Theory and Applications, 106(2):337–356, 2000. [11] M. Hong and Z.-Q. Luo. On the linear convergence of the alternating direction method of multipliers. Mathematical Programming, pages 1–35, 2016. [12] S. Kim, K.-A. Sohn, and E. P. Xing. A multivariate regression approach to association analysis of a quantitative trait network. Bioinformatics, 25(12):i204–i212, 2009. [13] K. Kurdyka. On gradients of functions definable in o-minimal structures. Annales de l’institut Fourier, 48(3):769 – 783, 1998. [14] G. Li. Global error bounds for piecewise convex polynomials. Math. Program., 137(1-2):37–64, 2013. [15] Z. Lin, R. Liu, and Z. Su. Linearized alternating direction method with adaptive penalty for low-rank representation. In Advances In Neural Information Processing Systems (NIPS), pages 612–620, 2011. [16] G. Liu, Z. Lin, and Y. Yu. Robust subspace segmentation by low-rank representation. In Proceedings of the 27th international conference on machine learning (ICML-10), pages 663– 670, 2010. [17] M. Liu and T. Yang. Adaptive accelerated gradient converging methods under holderian error bound condition. CoRR, abs/1611.07609, 2017. [18] Z.-Q. Luo and J. F. Sturm. Error bound for quadratic systems. Applied Optimization, 33:383– 404, 2000. [19] R. D. Monteiro and B. F. Svaiter. Iteration-complexity of block-decomposition algorithms and the alternating direction method of multipliers. SIAM Journal on Optimization, 23(1):475–507, 2013. [20] I. Necoara, Y. Nesterov, and F. Glineur. Linear convergence of first order methods for nonstrongly convex optimization. CoRR, abs/1504.06298, 2015. [21] H. Ouyang, N. He, L. Tran, and A. G. Gray. Stochastic alternating direction method of multipliers. Proceedings of the 30th International Conference on Machine Learning (ICML), 28:80–88, 2013. [22] Y. Ouyang, Y. Chen, G. Lan, and E. Pasiliao Jr. An accelerated linearized alternating direction method of multipliers. SIAM Journal on Imaging Sciences, 8(1):644–681, 2015. [23] T. Suzuki. Dual averaging and proximal gradient descent for online alternating direction multiplier method. In Proceedings of The 30th International Conference on Machine Learning, pages 392–400, 2013. [24] T. Suzuki. Stochastic dual coordinate ascent with alternating direction method of multipliers. In Proceedings of The 31st International Conference on Machine Learning, pages 736–744, 2014. 10 [25] W. Tian and X. Yuan. Faster alternating direction method of multipliers with a worst-case o(1/n2) convergence rate. 2016. [26] R. Tibshirani. Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society (Series B), 58:267–288, 1996. [27] R. Tibshirani, M. Saunders, S. Rosset, J. Zhu, and K. Knight. Sparsity and smoothness via the fused lasso. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 67(1):91–108, 2005. [28] R. J. Tibshirani, J. Taylor, et al. The solution path of the generalized lasso. The Annals of Statistics, 39(3):1335–1371, 2011. [29] Y. Xu, Q. Lin, and T. Yang. Stochastic convex optimization: Faster local growth implies faster global convergence. In Proceedings of the 34th International Conference on Machine Learning (ICML), pages 3821–3830, 2017. [30] Y. Xu, Y. Yan, Q. Lin, and T. Yang. Homotopy smoothing for non-smooth problems with lower complexity than O(1/ϵ). In Advances In Neural Information Processing Systems 29 (NIPS), pages 1208–1216, 2016. [31] Z. Xu, M. A. T. Figueiredo, and T. Goldstein. Adaptive admm with spectral penalty parameter selection. CoRR, abs/1605.07246, 2016. [32] T. Yang and Q. Lin. Rsg: Beating subgradient method without smoothness and strong convexity. CoRR, abs/1512.03107, 2016. [33] X. Zhang, M. Burger, X. Bresson, and S. Osher. Bregmanized nonlocal regularization for deconvolution and sparse reconstruction. SIAM Journal on Imaging Sciences, 3(3):253–276, 2010. [34] X. Zhang, M. Burger, and S. Osher. A unified primal-dual algorithm framework based on bregman iteration. Journal of Scientific Computing, 46(1):20–46, 2011. [35] P. Zhao, J. Yang, T. Zhang, and P. Li. Adaptive stochastic alternating direction method of multipliers. In Proceedings of the 32nd International Conference on Machine Learning (ICML), pages 69–77, 2015. [36] S. Zheng and J. T. Kwok. Fast-and-light stochastic admm. In The 25th International Joint Conference on Artificial Intelligence (IJCAI-16), 2016. [37] W. Zhong and J. T.-Y. Kwok. Fast stochastic alternating direction method of multipliers. In Proceedings of The 31st International Conference on Machine Learning, pages 46–54, 2014. 11
2017
617
7,138
A Learning Error Analysis for Structured Prediction with Approximate Inference Yuanbin Wu1, 2, Man Lan1, 2, Shiliang Sun1, Qi Zhang3, Xuanjing Huang3 1School of Computer Science and Software Engineering, East China Normal University 2Shanghai Key Laboratory of Multidimensional Information Processing 3School of Computer Science, Fudan University {ybwu, mlan, slsun}@cs.ecnu.edu.cn, {qz, xjhuang}@fudan.edu.cn Abstract In this work, we try to understand the differences between exact and approximate inference algorithms in structured prediction. We compare the estimation and approximation error of both underestimate (e.g., greedy search) and overestimate (e.g., linear relaxation of integer programming) models. The result shows that, from the perspective of learning errors, performances of approximate inference could be as good as exact inference. The error analyses also suggest a new margin for existing learning algorithms. Empirical evaluations on text classification, sequential labelling and dependency parsing witness the success of approximate inference and the benefit of the proposed margin. 1 Introduction Given an input x ∈X, structured prediction is the task of recovering a structure y = h(x) ∈Y, where Y is a set of combinatorial objects such as sequences (sequential labelling) and trees (syntactic parsing). Usually, the computation of h(x) needs an inference (decoding) procedure to find an optimal y: h(x) = arg max y∈Y score(x, y). Solving the “arg max” operation is essential for training and testing structured prediction models, and it is also one of the most time-consuming parts due to its combinatorial natural. In practice, the inference problem often reduces to combinatorial optimization or integer programming problems, which are intractable in many cases. In order to accelerate models, faster approximate inference methods are usually applied. Examples include underestimation algorithms which output structures with suboptimal scores (e.g., greedy search, max-product belief propagation), and overestimation algorithms which output structures in a larger output space (e.g., linear relaxation of integer programming). Understanding the trade-offs between computational efficiency and statistical performance is important for designing effective structured prediction models [Chandrasekaran and Jordan, 2013]. Prior work [Kulesza and Pereira, 2007] shows that approximate inference may not be sufficient for learning a good statistical model, even with rigorous approximation guarantees. However, the successful application of various approximate inference algorithms motivates a deeper exploration of the topic. For example, the recent work [Globerson et al., 2015] shows that an approximate inference can achieve optimal results on grid graphs. In this work, instead of focusing on specific models and algorithms, we try to analyze general estimation and approximation errors for structured prediction with approximate inference. Recall that given a hypothesis space H, a learning algorithm A receives a set of training samples S = {(xi, yi)}m i=1 which are i.i.d. according to a distribution D on the space X × Y, and returns a 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. hypothesis A(S) ∈H. Let e(h) = EDl(y, h(x)) be the risk of a hypothesis h on X × Y (l is a loss function), and h∗= arg minh∈He(h). Applying algorithm A will suffer two types of error: e(A(S)) = e(h∗) | {z } approximation + e(A(S)) −e(h∗) | {z } estimation The estimation error measures how close A(S) is to the best possible h∗; the approximation error measures whether H is suitable for D, which only depends on the hypothesis space. Our main theoretical results are: • For the estimation error, we show that, comparing with exact inference, overestimate inference always has larger estimation error, while underestimate inference can probably have smaller error. The results are based on the PAC-Bayes framework [McAllester, 2007] for structured prediction models. • For the approximation error, we find that the errors of underestimate and exact inference are not comparable. On the other side, overestimate inference algorithms have a smaller approximation error than exact inference. The results may explain the success of exact inference: it makes a good balance between the two errors. They also suggest that the learning performances of approximate inference can still be improved. Our contributions on empirical algorithms are two-fold. First, following the PAC-Bayes error bounds, we propose to use a new margin (Definition 3) when working with approximate algorithms. It introduces a model parameter which can be tuned for different inference algorithms. We investigate three widely used structured prediction models with the new margin (structural SVM, structured perceptron and online passive-aggressive algorithm). Second, we evaluate the algorithms on three NLP tasks: multi-class text classification (a special case of structured prediction), sequential labelling (chunking, POS tagging, word segmentation) and high-order non-projective dependency parsing. Results show that the proposed algorithms can benefit each structured prediction task. 2 Related Work The first learning error analysis of structured prediction was given in [Collins, 2001]. The bounds depend on the number of candidate outputs of samples, which grow exponentially with the size of a sample. To tighten the result, Taskar et al. [2003] provided an improved covering number argument, where the dependency on the output space size is replaced by the l2 norm of feature vectors, and London et al. [2013] showed that when the data exhibits weak dependence within each structure (collective stability), the bound’s dependency on structure size could be improved. A concise analysis based on the PAC-Bayes framework was given in [McAllester, 2007]. It enjoys the advantages of Taskar et al.’s bound and has a simpler derivation. Besides the structured hinge loss, the PAC-Bayes framework was also applied to derive generalization bounds (and consistent results) for ramp and probit surrogate loss functions [McAllester and Keshet, 2011], and loss functions based on Gibbs decoders [Honorio and Jaakkola, 2016]. Recently, Cortes et al. [2016] proposed a new hypothesis space complexity measurement (factor graph complexity) by extending the Rademacher complexity, and they can get tighter bounds than [Taskar et al., 2003]. For approximate inference algorithms, theoretical results have been given for different learning scenarios, such as the cutting plane algorithm of structured SVMs [Finley and Joachims, 2008, Wang and Shawe-Taylor, 2009], subgradient descent [Martins et al., 2009], approximate inference via dual loss [Meshi et al., 2010], pseudo-max approach [Sontag et al., 2010], local learning with decomposed substructures [Samdani and Roth, 2012], perceptron [Huang et al., 2012], and amortized inference [Kundu et al., 2013, Chang et al., 2015]. Different from previous works, we try to give a general analysis of approximate inference algorithms which is independent of specific learning algorithms. The concept of algorithmically separable is defined in [Kulesza and Pereira, 2007], it showed that without understanding combinations of learning and inference, the learning model could fail. Two recent works gave theoretical analyses on approximate inference showing that they could also obtain 2 promising performances: Globerson et al. [2015] showed that for a generative 2D grid models, a twostep approximate inference algorithm achieves optimal learning error. Meshi et al. [2016] showed that approximation based on LP relaxations are often tight in practice. The PAC-Bayes approach was initiated by [McAllester, 1999]. Variants of the theory include Seeger’s bound [Seeger, 2002], Catoni’s bound [Catoni, 2007] and the works [Langford and ShaweTaylor, 2002, Germain et al., 2009] on linear classifiers. 3 Learning Error Analyses We will focus on structured prediction with linear discriminant functions. Define exact inference h(x, w) = arg max y∈Y w⊺Φ(x, y), where Φ(x, y) ∈Rd is the feature vector, and w is the parameter vector in Rd. We consider two types of approximate inference algorithms, namely underestimate approximation and overestimate approximation [Finley and Joachims, 2008] 1. Definition 1. Given a w, h-(x, w) is an underestimate approximation of h(x, w) on a sample x if ρw⊺Φ(x, y∗) ≤w⊺Φ(x, y-) ≤w⊺Φ(x, y∗) for some ρ > 0, where y∗= h(x, w), y- = h-(x, w) ∈Y. Similarly, h+(x, w) is an overestimate approximation of h(x, w) on sample x if w⊺Φ(x, y∗) ≤w⊺Φ(x, y+) ≤ρw⊺Φ(x, y∗) for some ρ > 0, where y+ = h+(x, w) ∈¯Y and Y ⊆¯Y. Let H, H-, H+ be hypothesis spaces containing h, h- and h+ respectively: H = {h(·, w)|w ∈ Rd}, H- = {h-(·, w)|∀x ∈X, h-(·, w) is an underestimation}, and H+ = {h+(·, w)|∀x ∈ X, h+(·, w) is an overestimation}. Let l(y, ˆy) ∈[0, 1] be a structured loss function on Y × Y and I(·) be a 0-1 valued function which equals 1 if the argument is true, 0 otherwise. 3.1 Estimation Error Our analysis of the estimation error for approximate inference is based on the PAC-Bayes results for exact inference [McAllester, 2007]. PAC-Bayes is a framework for analyzing hypothesis h(·, w) with stochastic parameters: given an input x, first randomly select a parameter w′ according to some distribution Q(w′|w), and then make a prediction using h(x, w′). Define L(Q, D, h(·, w)) = ED,Q(w′|w)l(y, h(x, w′)), L(Q, S, h(·, w)) = 1 m m ∑ i=1 EQ(w′|w)l(yi, h(xi, w′)). Given some prior distribution P(w) on the model parameter w, the following PAC-Bayes Theorem [McAllester, 2003] gives an estimation error bound of h(x, w). Lemma 2 (PAC-Bayes Theorem). Given a w, for any distribution D over X × Y, loss function l(y, ˆy) ∈[0, 1], prior distribution P(w) over w, and δ ∈[0, 1], we have with probability at least 1 −δ (over the sample set S), the following holds for all posterior distribution Q(w′|w): L(Q, D, h(·, w)) ≤L(Q, S, h(·, w)) + √ DKL(Q∥P) + ln m δ 2(m −1) , where DKL(Q∥P) is the KL divergence between Q and P. 1Definition 1 slightly generalizes “undergenerating” and “overgenerating” in [Finley and Joachims, 2008]. Instead of requiring ρ > 0, the “undergenerating” there only considers ρ ∈(0, 1), and “overgenerating” only considers ρ > 1. Although their definition is more intuitive (i.e., the meaning of “over” and “under” is more clear), it implicitly assumes w⊺Φ(x, y∗) > 0 for all x and w, which limits the size of hypothesis space. Finally, by adding a bias term, we could make w⊺Φ(x, y∗) + b > 0 for all x, and obtain the same definitions in [Finley and Joachims, 2008]. 3 Definition 3. For ρ > 0, we extend the definition of margin as mρ(x, y, ˆy, w) ≜w⊺∆ρ(x, y, ˆy), where ∆ρ(x, y, ˆy) ≜ρΦ(x, y) −Φ(x, ˆy). Clearly, mρ(x, y∗, y-, w) ≤0 for underestimation, and mρ(x, y∗, y+, w) ≥0 for overestimation. The following theorem gives an analysis of the estimation error for approximate inference. The proof (in the supplementary) is based on Theorem 2 of [McAllester, 2007], with emphasis on the approximation rate ρ. Theorem 4. For a training set S = {(xi, yi)}m i=1, assume h′(xi, w) is a ρi-approximation of h(xi, w) on xi for all w. Denote ρ = maxi ρi and Mi = maxy ∥Φ(xi, y)∥1. Then, for any D, l(y, ˆy) ∈[0, 1] and δ ∈[0, 1], with probability at least 1 −δ, the following upper bound holds. L(Q, D, h′(·, w)) ≤L(w, S) + ∥w∥2 m + √ (1 + ρ)2∥w∥2 ln 2mλS ∥w∥2 + ln m δ 2(m −1) , (1) L(w, S) =        1 m m ∑ i=1 maxy l(yi, y)I(mρi(xi, y∗ i , y, w) ≤Mi) if h′(·, w) ∈H1 m m ∑ i=1 maxy l(yi, y)I(mρi(xi, y∗ i , y, w) ≥−Mi) if h′(·, w) ∈H+ where y∗ i = h(xi, w), Q(w′|w) is Gaussian with identity covariance matrix and mean (1 + ρ) √ 2 ln 2mλS ∥w∥2 w, λS is the maximum number of non-zero features among samples in S: λS = maxi,y ∥Φ(xi, y)∥0. We compare the bound in Theorem 4 for two hypotheses h1, h2 with approximation rate ρ1,i, ρ2,i on sample xi. Without loss of generality, we assume w⊺Φ(xi, y∗ i ) > 0 and ρ1,i > ρ2,i. In the case of underestimation, since {y|mρ1,i(xi, y∗ i , y, w) ≤Mi} ⊆{y|mρ2,i(xi, y∗ i , y, w) ≤ Mi}, L(w, S) of h1 is smaller than that of h2, but h1 has a larger square root term. Thus, it is possible that underestimate approximation has a less estimation error than the exact inference. On the other hand, for overestimation, both L(w, S) and the square root term of h1 are larger than those of h2. It means that the more overestimation an inference algorithm makes, the larger estimation error it may suffer. Theorem 4 requires that h′(·, w) attains approximation rate ρi on xi for all possible w. This assumption could be restrictive for including many approximate inference algorithms. We will try to relax the requirement of Theorem 4 using the following measurement on stability of inference algorithms. Definition 5. h(x, w) is τ-stable on a sample x with respect to a norm ∥· ∥if for any w′ |w⊺Φ(x, y) −w′⊺Φ(x, y′)| |w⊺Φ(x, y)| ≤τ ∥w −w′∥ ∥w∥ , where y = h(x, w), y′ = h(x, w′). Theorem 6. Assume that h′(xi, w) is a ρi-approximation of h(xi, w) on the sample xi, and h′(·, w) is τ-stable on S with respect to ∥· ∥∞. Then with the same symbols in Theorem 4, L(Q, D, h′(·, w)) is upper bounded by L(w, S) + ∥w∥2 m + √ (1 + 2ρ + τ)2∥w∥2 ln 2mλS ∥w∥2 + ln m δ 2(m −1) . Note that we still need to consider all possible w′ according to the definition of τ. However, upper bounds of τ could be derived for some approximate inference algorithms. As an example, we discuss the linear programming relaxation (LP-relaxation) of integer linear programming, which covers a broad range of approximate inference algorithms. The τ-stability of LP-relaxation can be obtained from perturbation theory of linear programming [Renegar, 1994, 1995]. Theorem 7 (Proposition 2.5 of [Renegar, 1995]). For a feasible linear programming max . w⊺z s.t. Az ≤b, z ≥0, 4 1 2 3 (a) 1′ 2′ 3′ (b) 1 2 3 1′ 2′ 3′ (c) 1 2 3 (d) 1′ 2′ 3′ (e) (f) Figure 1: An example of exact inference with less approximation error than underestimate inference (i.e., e(h) < e(h-)) 1 2 3 (a) 1′ 2′ 3′ (b) 1 2 3 1′ 2′ 3′ (c) 1 2 3 (d) 1′ 2′ 3′ (e) (f) Figure 2: An example of underestimate inference with less approximation error than exact inference (i.e., e(h-) < e(h)). let ˆz, ˆz′ be solutions of the LP w.r.t. w and w′. Then |w⊺ˆz −w′⊺ˆz′| ≤max(∥b∥∞, |w⊺ˆz|) d ∥w −w′∥∞, where d is the l∞distance from A, b to the dual infeasible LP (∥A, b∥∞= maxi,j,k{|Aij|, |bk|}): d = inf{δ|∥∆A, ∆b∥∞< δ ⇒the dual problem of the LP with(A + ∆A, b + ∆b) is infeasible}. 3.2 Approximation Error In this section, we compare the approximation error of models with different inference algorithms. The discussions are based on the following definition (Definition 1.1 of [Daniely et al., 2012]). Definition 8. For hypothesis spaces H, H′, we say H essentially contains H′ if for any h′ ∈H′, there is an h ∈H satisfying e(h) ≤e(h′) for all D, where e(h) = EDl(y, h(x)). In other words, for any distribution D, the approximation error of H is at most the error of H′. Our main result is that there exist cases that approximation errors of exact and underestimate inference are not comparable, in the sense that neither H contains H-, nor H- contains H. 2 To see that approximation errors could be non-comparable, we consider an approximate inference algorithm h- which always outputs the second best y for a given w. The two examples in Figure 1 and 2 demonstrate that it is both possible that e(h) < e(h-) and e(h-) < e(h). The following are the details. We consider an input space containing two samples X = {x, x′}. Sample x has three possible output structures, which are named with 1, 2, 3 respectively. Sample x′ also has three possible y, which are named with 1′, 2′, 3′. Let the correct output of x and x′ be 1 and 1′. For sample x, feature vectors Φ(x, 1), Φ(x, 2), Φ(x, 3) ∈R2 are points on the unit circle and form a equilateral triangle △(1, 2, 3). Similarly, feature vectors Φ(x′, 1′), Φ(x′, 2′), Φ(x′, 3′) are vertices of △(1′, 2′, 3′). The parameter space of w is the unit circle (since inference results only depend on directions of w). Given a w, the exact inference h(x, w) choose the y whose Φ(x, y) has the largest projection on w (i.e., h(x, w) = arg maxy∈{1,2,3} w⊺Φ(x, y) and h(x′, w) = arg maxy∈{1′,2′,3′} w⊺Φ(x′, y)), and h-(x, w) choose the y whose Φ(x, y) has the second largest projection on w. 2 Note that there exist two paradigms for handling intractability of inference problems. The first one is to develop approximate inference algorithms for the exact problem, which is our focus here. Another one is to develop approximate problems with tractable exact inference algorithms. For example, in probabilistic graphical models, one can add conditional independent assumptions to get a simplified model with efficient inference algorithms. In the second paradigm, it is clear that approximate models are less expressive than the exact model, thus the approximation error of them are always larger. Our result, however, shows that it is possible to have underestimate inference of the original problem with smaller approximation error. 5 We first show that it is possible e(h) < e(h-). In Figure 1, (a) shows that for sample x, any w in the gray arc can make the output of exact inference correct (i.e., h(x, w) = 1). Similarly, in (b), any w in the gray arc guarantees h(x′, w) = 1′. (c) shows that the two gray arcs in (a) and (b) are overlapping on the dark arc. For any w in the dark arc, the exact inference has correct outputs on both x and x′, which means that approximation error of exact inference H is 0. At the same time, in (d) of Figure 1, gray arcs contain w which makes the underestimate inference correct on sample x (i.e., h-(x, w) = 1), gray arcs in (e) are w with h-(x′, w) = 1′. (f) shows the gray arcs in (d) and (e) are not overlapping, which means it is impossible to find a w such that h-(·, w) is correct on both x and x′. Thus the approximation error of underestimate inference H- is strictly larger than 0, and we have e(h) < e(h-). Similarly, in Figure 2, (a), (b), (c) show that we are able to choose w such that the underestimate inference is correct both on x and x′, which implies the approximation error of underestimation Hequals 0. On the other hand, (d), (e), (f) shows that the approximation error of exact inference H is strictly larger than 0, and we have e(h-) < e(h). Following the two figures, we can illustrate that when Φ(x, y) are vertices of convex regular n-gons, it is both possible that e(h) < e(h-) and e(h-) < e(h), where h- is an underestimation outputting the k-th best y. In fact, when we consider the “worst” approximation which outputs y with the smallest score, its approximation error equals to the exact inference since h(x, w) = h-(x, −w). Thus, we would like to think that the geometry structures of Φ(x, y) could be complex enough to make both exact and underestimate inference efficient. To summarize, the examples suggest that underestimation algorithms give us a different family of predictors. For some data distribution, the underestimation family can have a better predictor than the exact inference family. Finally, for the case of overestimate approximation, we can show that H+ contains H using Theorem 1 of [Kulesza and Pereira, 2007]. Theorem 9. For ρ > 1, if the loss function l satisfies l(y1, y2) ≤l(y1, y3) + l(y3, y2), then H+ contains H. 4 Training with the New Margin Theorems 4 and 6 suggest that we could learn the model parameter w by minimizing a non-convex objective L(w, S) + ∥w∥2. The L(w, S) term is related to the size of the set {y|mρ(xi, y∗ i , y, w) ≤ Mi}, which can be controlled by margin mρ2(xi, yi, yi). Specifically, for underestimation, mρ(xi, y∗ i , y, w)≥ρw⊺Φ(xi, yi) −w⊺Φ(xi, y) ≥ρw⊺Φ(xi, yi) −w⊺Φ(xi, y∗ i ) ≥ρw⊺Φ(xi, yi) −ρ−1w⊺Φ(xi, yi) = ρ−1mρ2(xi, yi, yi, w), ∀y. It implies that the larger mρ2(xi, yi, yi), the lower L(w, S). Thus, when working with approximate inference, we can apply mρ2(xi, yi, yi) in existing maximum margin frameworks instead of m1(xi, yi, yi) (replacing exact y∗ i with the approximate yi). For example, the structural SVM in [Finley and Joachims, 2008] becomes min . 1 2||w||2 + C ∑ i ξi, s.t. mρ2(xi, yi, yi, w) > 1 −ξi. Intuitively, mρ2 aims to improve learning process by including more information about inference algorithms. For overestimation, we don’t have similar lower bounds as underestimation, but since mρ(xi, yi, y+ i, w) > 1 ⇒m1(xi, yi, y∗ i , w) > ρ−1, we can apply the margin mρ as an approximation of m1. In practice, since it is hard to obtain ρ for inference algorithms (even it is possible, as ρ must consider the worst case of all possible x, a tight ρ maybe inefficient on individual samples), we treat it as an algorithm parameter which can be heuristically determined either by prior knowledge or by tuning on development data. We leave the study of how to estimate ρ systematically for future work. For empirical evaluation, we examine structural SVM with cutting plane learning algorithm [Finley and Joachims, 2008], and we also adapt two wildly used online structured learning algorithms with mρ: structured perceptron [Collins, 2002] (Algorithm 3) and online passive aggressive algorithm (PA) [Crammer et al., 2006] (Algorithm 4). The mistake bounds of the two algorithms are similar to bounds with exact inference algorithms (given in the supplementary). 6 1: w0 = 0 2: for t = 0 to T do 3: yt = h-(xt, wt) 4: if yt ̸= yt then 5: wt+1 = wt+ρΦ(xt, yt)−Φ(xt, yt) 6: end if 7: end for 8: return w = wT Figure 3: Structured perceptron with mρ. 1: w0 = 0 2: for t = 0 to T do 3: if mρ(xt, yt, yt, w) < 1 then 4: wt+1 = arg minw. ∥w −wt∥2 5: s.t. mρ(xt, yt, yt, w) ≥1 6: end if 7: end for 8: return w = wT Figure 4: Online PA with mρ. 5 Experiments We present experiments on three natural language processing tasks: multi-class text classification, sequential labelling and dependency parsing. For text classification, we compare with the vanilla structural SVM. For sequential labelling, we consider three tasks (phrase chunking (chu), POS tagging (pos) and Chinese word segmentation (cws)) and the perceptron training. For dependency parsing, we focus on the second order non-projective parser and the PA algorithm. For each task, we focus on underestimate inference algorithms. 5.1 Multi-class classification Multi-class classification is a special case of structured prediction. It has a limited number of class labels and a simple exact inference algorithm (i.e., by enumerating labels). To evaluate the proposed margin constraints, we consider toy approximate algorithms which output the kth best class label. 2 3 4 5 6 7 8 k 40 50 60 70 80 90 Error rates Vanilla SVM SVM with mρ 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 ρ Figure 5: Results on text classification. Blue points are error rates for different k, and red points are ρ achieving the best error rates on the development set. The red dot line is the least square linear fitting of red points. The model parameter C = 104. We report results on the 20 newsgroups corpus (18000 documents, 20 classes). The meta data is removed (headers, footers and quotes), and feature vectors are simple tf-idf vectors. We take 20% of the training set as development set for tuning ρ (grid search in [0, 2] with step size 0.05). The implementation is adapted from SVMmulticlass 3. From the results (Figure 5) we find that, comparing with the vanilla structural SVM, the proposed margin constraints are able to improve error rates for different inference algorithms. And, as k becomes larger, the improvement becomes more significant. This property might be attractive since algorithms with loose approximation rates are common in practical use. Another observation is that, as k becomes larger, the best parameter ρ decreases in general. It shows that the tuned parameter can reflect the definition of approximate rate (Defnition 1). 5.2 Sequential Labelling In sequential labelling, we predict sequences y = y1y2, . . . , yK, where yk ∈Y is a label (e.g., POS tag). We consider the first order Markov assumption: h(x) = arg maxy ∑K k=1 w⊺Φ(x, yk, yk−1). The inference problem is tractable using O(KY 2) dynamic programming (Viterbi). We examine a simple and fast greedy iterative decoder (“gid”), which is also known as the iterative conditional modes [Besag, 1986]. The algorithm flips each label yk of y in a greedy way: for fixed yk−1 and yk+1, it finds a yk that makes the largest increase of the decoding objective function. The 3http://www.cs.cornell.edu/People/tj/svm_light/svm_multiclass.html 7 0.0 0.2 0.4 0.6 0.8 1.0 u 0.952 0.953 0.954 0.955 0.956 0.957 0.958 0.959 Accuracy chu ρ = 0.9 ρ = 0.99 ρ = 0.999 ρ = 1 0.0 0.2 0.4 0.6 0.8 1.0 u 0.944 0.945 0.946 0.947 0.948 0.949 0.950 0.951 0.952 pos 0.0 0.2 0.4 0.6 0.8 1.0 u 0.925 0.930 0.935 0.940 0.945 0.950 0.955 0.960 cws-pku 0.0 0.2 0.4 0.6 0.8 1.0 u 0.945 0.950 0.955 0.960 0.965 0.970 cws-msr Figure 6: Results of sequential labelling tasks with Algorithm 3. The x-axis represents the random selection parameters u. The y-axis represents label accuracy. algorithm passes the sequence multiple times and stops when no yk can be changed. It is faster in practice (speedup of 18x on POS tagging, 1.5x on word segmentation), requires less memory (O(1) space complexity), and can obtain a reasonable performance. We use the CoNLL 2000 dataset [Sang and Buchholz, 2000] for chunking and POS tagging, SIGHAN 2005 bake-off corpus (pku and msr) [Emerson, 2005] for word segmentation. We use Algorithm 3 with 20 iterations and learning step 1. We adopt standard feature sets in all tasks. To test ρ on more inference algorithms, we will apply a simple random selection strategy to generate a bunch of in-between inference algorithms: when decoding an example, we select “Viterbi” with probability u, “gid” with probability 1 −u. Heuristically, by varying u, we obtain inference algorithms with different expected approximation rates. Figure 6 shows the results of ρ ≤1 4. We can have following observations: • At u = 0 (i.e., inference with “gid”), models with ρ < 1 are significantly better than ρ = 1 on pos and cws (p < 0.01 using z-test for proportions). Furthermore, on pos and cws, the best “gid” results with parameters ρ < 1 are competitive to the standard perceptron with exact inference (i.e., ρ = 1, u = 1). Thus, it is possible for approximate inference to be both fast and good. • For 0 < u < 1, we can find that curves of ρ < 1 are above the curve of ρ = 1 in many cases. The largest gap is 0.2% on chu, 0.6% on pos and 2% on cws. Thus, the learning parameter ρ can also provide performance gains for the combined inference algorithms. • For u = 1 (i.e., using the “Viterbi”), it is interesting to see that in pos, ρ < 1 still outperforms ρ = 1 by a large margin. We suspect that the ρ parameter might also help the structured perceptron converging to a better solution. 5.3 Dependency Parsing Our third experiment is high order non-projective dependency parsing, for which the exact inference is intractable. We follows the approximate inference in MSTParser [McDonald and Pereira, 2006] 5. The algorithm first finds the best high order projective tree using a O(n3) dynamic programming [Eisner, 1996], then heuristically introduces non-projective edges on the projective tree. We use the online PA in Algorithm 4 with above two-phase approximate inference algorithm. The parser is trained and tested on 5 languages in the CoNLL-2007 shared task [Nivre et al., 2007] with non-projective sentences more than 20%. Features are identical to default MSTParser settings 6. Figure 1 lists the results with different ρ. It shows that on all languages, tuning the parameter helps to improve the parsing accuracy. As a reference, we also include results of the first order models. On Basque and Greek, the performance gains from ρ is comparable to the gains from introducing second order features, but the improvement on Czech, Hungarian and Turkish are limited. We also find that different with text classification and sequential labelling, both ρ > 1 and ρ < 1 can obtain optimal scores. Thus, with the feature configuration of MSTParser, the value of w⊺Φ(x, y∗) may not always be positive during the online learning process, and it reflect the fact that feature space of 4We also test models with ρ > 1, which underperform ρ < 1 in general. Details are in the supplementary. 5http://sourceforge.net/projects/mstparser/ 6Features in MSTParser are less powerful than state-of-the-art, but we keep them for an easier implementation and comparison. 8 parsing problems is usually more complex. Finally, setting a global ρ for different training samples could be coarse (so we only get improvement in a small neighborhood of 1), and how to estimate ρ for individual x is an important future work. Setting Basque Czech Greek Hungarian Turkish 1st Order 79.4 82.1 81.1 79.9 85.0 ρ =1 79.8 82.8 81.7 81.7 85.5 ρ =1−10−3 79.7 83.0 81.3 81.1 85.2 ρ =1−10−4 80.3 82.9 82.2 81.8 85.7 ρ =1+10−3 79.4 82.3 81.5 80.7 85.6 ρ =1+10−4 79.6 83.0 82.5 81.6 85.4 Table 1: Results of the second order dependency parsing with parameter ρ. We report the unlabelled attachment score (UAS), which is the percentage of words with correct parents. 6 Conclusion We analyzed the learning errors of structured prediction models with approximate inference. For the estimation error, we gave a PAC-Bayes analysis for underestimation and overestimation inference algorithms. For the approximation error, we showed the incomparability between exact and underestimate inference. The experiments on three NLP tasks with the newly proposed learning algorithms showed encouraging performances. In future work, we plan to explore more adaptive methods for estimating approximation rate ρ and combining inference algorithms. Acknowledgements The authors wish to thank all reviewers for their helpful comments and suggestions. The corresponding authors are Man Lan and Shiliang Sun. This research is (partially) supported by NSFC (61402175, 61532011), STCSM (15ZR1410700) and Shanghai Key Laboratory of Trustworthy Computing (07dz22304201604). Yuanbin Wu is supported by a Microsoft Research Asia Collaborative Research Program. References Julian Besag. On the statistical analysis of dirty pictures. Journal of the Royal Statistical Society B, 48(3):48–259, 1986. Olivier Catoni. PAC-Bayesian Supervised Classification: The Thermodynamics of Statistical Learning, volume 56 of Lecture Notes-Monograph Series. IMS, 2007. Venkat Chandrasekaran and Michael I. Jordan. Computational and statistical tradeoffs via convex relaxation. In Proc. of the National Academy of Sciences, volume 110, 2013. Kai-Wei Chang, Shyam Upadhyay, Gourab Kundu, and Dan Roth. Structural learning with amortized inference. In Proc. of AAAI, pages 2525–2531, 2015. Michael Collins. Parameter estimation for statistical parsing models: Theory and practice of distribution-free methods. In Proc. of the Seventh International Workshop on Parsing Technologies, 2001. Michael Collins. Discriminative training methods for hidden Markov models: Theory and experiments with perceptron algorithms. In Proc. of EMNLP, pages 1–8, 2002. Corinna Cortes, Vitaly Kuznetsov, Mehryar Mohri, and Scott Yang. Structured prediction theory based on factor graph complexity. In NIPS, pages 2514–2522, 2016. Koby Crammer, Ofer Dekel, Joseph Keshet, Shai Shalev-Shwartz, and Yoram Singer. Online passive-aggressive algorithms. Journal of Machine Learning Research, 7:551–585, 2006. 9 Amit Daniely, Sivan Sabato, and Shai Shalev-Shwartz. Multiclass learning approaches: A theoretical comparison with implications. In NIPS, pages 494–502, 2012. Jason M. Eisner. Three new probabilistic models for dependency parsing: An exploration. In Proc. of COLING, 1996. Thomas Emerson. The second international Chinese word segmentation bakeoff. In the Second SIGHAN Workshop on Chinese Language Processing, pages 123 – 133, 2005. Thomas Finley and Thorsten Joachims. Training structural SVMs when exact inference is intractable. In Proc. of ICML, pages 304–311, 2008. Pascal Germain, Alexandre Lacasse, François Laviolette, and Mario Marchand. PAC-Bayesian learning of linear classifiers. In Proc. of ICML, pages 353–360, 2009. Amir Globerson, Tim Roughgarden, David Sontag, and Cafer Yildirim. How hard is inference for structured prediction? In Proc. of ICML, pages 2181–2190, 2015. Jean Honorio and Tommi S. Jaakkola. Structured prediction: From gaussian perturbations to lineartime principled algorithms. In Proc. of UAI, 2016. Liang Huang, Suphan Fayong, and Yang Guo. Structured perceptron with inexact search. In Proc. of HLT-NAACL, pages 142–151, 2012. Alex Kulesza and Fernando Pereira. Structured learning with approximate inference. In NIPS, pages 785–792, 2007. Gourab Kundu, Vivek Srikumar, and Dan Roth. Margin-based decomposed amortized inference. In Proc. of ACL, pages 905–913, 2013. John Langford and John Shawe-Taylor. PAC-Bayes & margins. In NIPS, pages 423–430, 2002. Ben London, Bert Huang, Ben Taskar, and Lise Getoor. Collective stability in structured prediction: Generalization from one example. In Proc. of ICML, pages 828–836, 2013. André F. T. Martins, Noah A. Smith, and Eric P. Xing. Polyhedral outer approximations with application to natural language parsing. In Proc. of ICML, pages 713–720, 2009. David McAllester. Generalization Bounds and Consistency for Structured Labeling, chapter Predicting Structured Data. MIT Press, 2007. David A. McAllester. Some PAC-Bayesian theorems. Machine Learning, 37(3):355–363, 1999. David A. McAllester. Pac-bayesian stochastic model selection. Machine Learning, 51(1):5–21, 2003. David A. McAllester and Joseph Keshet. Generalization bounds and consistency for latent structural probit and ramp loss. In NIPS, pages 2205–2212, 2011. Ryan McDonald and Fernando Pereira. Online learning of approximate dependency parsing algorithms. In Proc. of EACL, 2006. Ofer Meshi, David Sontag, Tommi S. Jaakkola, and Amir Globerson. Learning efficiently with approximate inference via dual losses. In Proc. of ICML, pages 783–790, 2010. Ofer Meshi, Mehrdad Mahdavi, Andrian Weller, and David Sontag. Train and test tightness of lp relaxations in structured prediction. In Proc. of ICML, 2016. Joakim Nivre, Johan Hall, Sandra Kübler, Ryan McDonald, Jens Nilsson, Sebastian Riedel, and Deniz Yuret. The CoNLL 2007 shared task on dependency parsing. In Proc. of the CoNLL Shared Task Session of EMNLP-CoNLL 2007, pages 915–932, 2007. James Renegar. Some perturbation theory for linear programming. Mathematical Programming, 65: 73–91, 1994. 10 James Renegar. Incorporating condition measures into the complexity theory of linear programming. SIAM Journal on Optimization, 5(3):506–524, 1995. Rajhans Samdani and Dan Roth. Efficient decomposed learning for structured prediction. In Proc. of ICML, 2012. Erik F. Tjong Kim Sang and Sabine Buchholz. Introduction to the conll-2000 shared task: Chunking. In Proc. of CoNLL and LLL, 2000. Matthias Seeger. PAC-Bayesian generalisation error bounds for gaussian process classification. JMLR, 3:233–269, 2002. David Sontag, Ofer Meshi, Tommi S. Jaakkola, and Amir Globerson. More data means less inference: A pseudo-max approach to structured learning. In NIPS, pages 2181–2189, 2010. Benjamin Taskar, Carlos Guestrin, and Daphne Koller. Max-margin Markov networks. In NIPS, pages 25–32, 2003. Zhuoran Wang and John Shawe-Taylor. Large-margin structured prediction via linear programming. In Proc. of AISTATS, pages 599–606, 2009. 11
2017
618
7,139
Simple Strategies for Recovering Inner Products from Coarsely Quantized Random Projections Ping Li Baidu Research, and Rutgers University pingli98@gmail.com Martin Slawski Department of Statistics George Mason University mslawsk3@gmu.edu Abstract Random projections have been increasingly adopted for a diverse set of tasks in machine learning involving dimensionality reduction. One specific line of research on this topic has investigated the use of quantization subsequent to projection with the aim of additional data compression. Motivated by applications in nearest neighbor search and linear learning, we revisit the problem of recovering inner products (respectively cosine similarities) in such setting. We show that even under coarse scalar quantization with 3 to 5 bits per projection, the loss in accuracy tends to range from “negligible” to “moderate”. One implication is that in most scenarios of practical interest, there is no need for a sophisticated recovery approach like maximum likelihood estimation as considered in previous work on the subject. What we propose herein also yields considerable improvements in terms of accuracy over the Hamming distance-based approach in Li et al. (ICML 2014) which is comparable in terms of simplicity. 1 Introduction The method of random projections (RPs) for linear dimensionality reduction has become more and more popular over the years after the basic theoretical foundation, the celebrated JohnsonLindenstrauss (JL) Lemma [12, 20, 33], had been laid out. In a nutshell, it states that it is possible to considerably lower the dimension of a set of data points by means of a linear map in such a way that squared Euclidean distances and inner products are roughly preserved in the low-dimensional representation. Conveniently, a linear map of this sort can be realized by a variety of random matrices [1, 2, 18]. The scope of applications of RPs has expanded dramatically in the course of time, and includes dimension reduction in linear classification and regression [14, 30], similarity search [5, 17], compressed sensing [8], clustering [7, 11], randomized numerical linear algebra and matrix sketching [29], and differential privacy [21], among others. The idea of achieving further data compression by means of subsequent scalar quantization of the projected data has been considered for a while. Such setting can be motivated from constraints concerning data storage and communication, locality-sensitive hashing [13, 27], or the enhancement of privacy [31]. The extreme case of one-bit quantization can be associated with two seminal works in computer science, the SDP relaxation of the MAXCUT problem [16] and the simhash [10]. One-bit compressed sensing is introduced in [6], and along with its numerous extensions, has meanwhile developed into a subfield within the compressed sensing literature. A series of recent papers discuss quantized RPs with a focus on similarity estimation and search. The papers [25, 32] discuss quantized RPs with a focus on image retrieval based on nearest neighbor search. Independent of the specific application, [25, 32] provide JL-type statements for quantized RPs, and consider the trade-off between the number of projections and the number of bits per projection under a given budget of bits as it also appears in the compressed sensing literature [24]. The paper [19] studies approximate JL-type results for quantized RPs in detail. The approach to quantized RPs taken in the present paper follows [27, 28] 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. in which the problem of recovering distances and inner products is recast within the framework of classical statistical point estimation theory. The paper [28] discusses maximum likelihood estimation in this context, with an emphasis on the aforementioned trade-off between the number of RPs and the bit depth per projection. In the present paper we focus on the much simpler and computationally much more convenient approach in which the presence of the quantizer is ignored, i.e., quantized data are treated in the same way as full-precision data. We herein quantify the loss of accuracy of this approach relative to the full-precision case, which turns out to be insignificant in many scenarios of practical interest even under coarse quantization with 3 to 5 bits per projection. Moreover, we show that the approach compares favorably to the Hamming distance-based (or equivalently collision-based) scheme in [27] which is of similar simplicity. We argue that both approaches have their merits: the collision-based scheme performs better in preserving local geometry (the distances of nearby points), whereas the one studied in more detail herein yields better preservation globally. Notation. For a positive integer m, we let [m] = {1, . . . , m}. For l ∈[m], v(l) denotes the l-th component of a vector v ∈Rm; if there is no danger of confusion with another index, the brackets in the subscript are omitted. I(P) denotes the indicator function of expression P. Supplement: Proofs and additional experimental results can be found in the supplement. Basic setup. Let X = {x1, . . . , xn} ⊂Rd be a set of input data with squared Euclidean norms λ2 i := ∥xi∥2 2, i ∈[n]. We think of d being large. RPs reduce the dimensionality of the input data by means of a linear map A : Rd →Rk, k ≪d. We assume throughout the paper that the map A is realized by a random matrix with i.i.d. entries from the standard Gaussian distribution, i.e., Alj ∼N(0, 1), l ∈[k], j ∈[d]. One standard goal of RPs is to approximately preserve distances in X while lowering the dimension, i.e., ∥Axi −Axj∥2 2/k ≈∥xi −xj∥2 2 for all (i, j). This is implied by approximate inner product preservation ⟨xi, xj⟩≈⟨Axi, Axj⟩/k for all (i, j). For the time being, we assume that it is possible to compute and store the squared norms {λ2 i }n i=1, and to rescale the input data to unit norm, i.e., one first forms exi ←xi/λi, i ∈[n], before applying A. In this case, it suffices to recover the (cosine) similarities ρij := ⟨xi,xj⟩ λiλj = ⟨exi, exj⟩, i, j ∈[n], of the input data X from their compressed representation Z = {z1, . . . , zn}, zi := Aexi, i ∈[n]. 2 Estimation of cosine similarity based on full-precision RPs As preparation for later sections, we start by providing background concerning the usual setting without quantization. Let (Z, Z′)r be random variables having a bivariate Gaussian distribution with zero mean, unit variance, and correlation r ∈(−1, 1): (Z, Z′)r ∼N2   0 0  ,  1 r r 1  . (1) Let further x, x′ be a generic pair of points from X, and let z := Aex, z′ := Aex′ be the counterpart in Z. Then the components {(z(l), z′ (l))}k l=1 of (z, z′) are distributed i.i.d. as in (1) with r = ρ =: ⟨ex, ex′⟩. Hence the problem of recovering the cosine similarity of x and x′ can be re-cast as estimating the correlation from an i.i.d. sample of k bivariate Gaussian random variables. To simplify our exposition, we henceforth assume that 0 ≤ρ < 1 as this can easily be achieved by flipping the sign of one of x or x′. The standard estimator of ρ is what is called the “linear estimator” herein: bρlin = 1 k ⟨z, z′⟩= 1 k k X l=1 z(l)z′ (l). (2) As pointed out in [26] this estimator can be considerably improved upon by the maximum likelihood estimator (MLE) given (1): bρMLE = argmax r  −1 2 log(1 −r2) −1 2 1 1 −r2 1 k ∥z∥2 2 + 1 k ∥z′∥2 2 −1 k ⟨z, z′⟩2r  . (3) The estimator bρMLE is not available in closed form, which is potentially a serious concern since it needs to be evaluated for numerous different pairs of data points. However, this can be addressed 2 by tabulation of the two statistics n ∥z∥2 2 + ∥z′∥2 2  /k, ⟨z, z′⟩/k o and the corresponding solutions bρMLE over a sufficiently fine grid. At processing time, computation of bρMLE can then be reduced to a look-up in a pre-computed table. One obvious issue of bρlin is that it does not respect the range of the underlying parameter. A natural fix is the use of the “normalized linear estimator” bρnorm = ⟨z, z′⟩/(∥z∥2 ∥z′∥2). (4) When comparing different estimators of ρ in terms of statistical accuracy, we evaluate the mean squared error (MSE), possibly asymptotically as the number of RPs k →∞. Specifically, we consider MSEρ(bρ) = Eρ[(ρ −bρ)2] = Bias2 ρ(bρ) + Varρ(bρ), Biasρ(bρ) := Eρ[bρ] −ρ, (5) where bρ is some estimator, and the subscript ρ indicates that expectations are taken with respect to a sample (z, z′) following the bivariate normal distribution in (1) with r = ρ. It turns out that bρnorm and bρMLE can have dramatically lower (asymptotic) MSEs than bρlin for large values of ρ, i.e., for points of high cosine similarity. It can be shown that (cf. [4], p.132, and [26]) Biasρ(bρlin) = 0, Varρ(bρlin) = (1 + ρ2)/k, (6) Bias2 ρ(bρnorm) = O(1/k2), Varρ(bρnorm) = (1 −ρ2)2/k + O(1/k2), (7) Bias2 ρ(bρMLE) = O(1/k2), Varρ(bρMLE) = (1−ρ2)2 1+ρ2 /k + O(1/k2). (8) While for ρ = 0, the (asymptotic) MSEs are the same, we note that the leading terms of the MSEs of bρnorm and bρMLE decay at rate Θ((1 −ρ)2) as ρ →1, whereas the MSE of bρlin grows with ρ. The following table provides the asymptotic MSE ratios of bρlin and bρnorm for selected values of ρ. ρ 0.5 0.6 0.7 0.8 0.9 0.95 0.99 MSEρ(bρlin) MSEρ(bρnorm) 2.2 3.3 5.7 12.6 50 200 5000 In conclusion, if it is possible to pre-compute and store the norms of the data prior to dimensionality reduction, a simple form of normalization can yield important benefits with regard to the recovery of inner products and distances for pairs of points having high cosine similarity. The MLE can provide a further refinement, but the improvement over bρnorm can be at most by a factor of 2. 3 Estimation of cosine similarity based on quantized RPs The following section contains our main results. After introducing preliminaries regarding quantization, we review previous approaches to the problem, before analyzing estimators following a different paradigm. We conclude with a comparison and some recommendations about what to use in practice. Quantization. After obtaining the projected data Z, the next step is scalar quantization. Let t = (t1, . . . , tK−1) with 0 = t0 < t1 < . . . < tK−1 < tK = +∞be a set of thresholds inducing a partitioning of the positive real line into K intervals {[ts−1, ts), s ∈[K]}, and let M = {µ1, . . . , µK} be a set of codes with µs representing interval [ts−1, ts), s ∈[K]. Given t and M, the scalar quantizer (or quantization map) is defined by Q : R →M± := −M ∪M, z 7→Q(z) = sign(z) PK s=1 µsI(|z| ∈[ts−1, ts)). (9) The projected and quantized data result as Q = {qi}n i=1 ⊂(M±)k, qi = Q(zi(l)) k l=1, where zi(l) denotes the l-th component of zi ∈Z, l ∈[k], i ∈[n]. The bit depth b of the quantizer is given by b := 1 + log2(K). For simplicity, we only consider the case where b is an integer. The case b = 1 is well-studied [10, 27] and is hence disregarded in our analysis to keep our exposition compact. Bin-based vs. code-based approaches. Let q = Q(z) and q′ = Q(z′) be the points resulting from quantization of the generic pair z, z′ in the previous section. In this paper, we distinguish between two basic paradigms for estimating the cosine similarity of the underlying pair x, x′ from q, q′. The first paradigm, which we refer to as bin-based estimation, does not make use of the specific values of 3 the codes M±, but only of the intervals (“bins”) associated with each code. This is opposite to the second paradigm, referred to as code-based estimation which only makes use of the values of the codes. As we elaborate below, an advantage of the bin-based approach is that working with intervals reflects the process of quantization more faithfully and hence can be statistically more accurate; on the other hand, a code-based approach tends to be more convenient from the point of view computation. In this paper, we make a case for the code-based approach by showing that the loss in statistical accuracy can be fairly minor in several regimes of practical interest. Lloyd-Max (LM) quantizer. With b respectively K being fixed, one needs to choose the thresholds t and the codes M of the quantizer (the second is crucial only for a code-based approach). In our setting, with zi(l) ∼N(0, 1), i ∈[n], l ∈[k], which is inherited from the distribution of the entries of A, a standard choice is LM quantization [15] which minimizes the squared distortion error: (t⋆, µ⋆) = argmin t,µ Eg∼N(0,1)[{g −Q(g; t, µ)}2]. (10) Problem (10) can be solved by an iterative scheme that alternates between optimization of t for fixed µ and vice versa. That scheme can be shown to deliver the global optimum [22]. In the absence of any prior information about the cosine similarities that we would like to recover, (10) appears as a reasonable default whose use for bin-based estimation has been justified in [28]. In the limit of cosine similarity ρ →1, it may seem more plausible to use (10) with g replaced by its square, and taking the root of the resulting optimal thresholds and codes. However, it turns out that empirically this yields reduced performance more often than improvements, hence we stick to (10) in the sequel. 3.1 Bin-based approaches MLE. Given a pair q = (q(l))k l=1 and q′ = (q′ (l))k l=1 of projected and quantized points, maximum likelihood estimation of the underlying cosine similarity ρ is studied in depth in [28]. The associated likelihood function L(r) is based on bivariate normal probabilities of the form Pr(Z ∈[ts−1, ts), Z′ ∈[tu−1, tu)), P−r(Z ∈[ts−1, ts), Z′ ∈[tu−1, tu)) with (Z, Z′)r as in (1). It is shown in [28] that the MLE with b ≥2 can be more efficient at the bit level than common single-bit quantization [10, 16]; the optimal choice of b increases with ρ. While statistically optimal in the given setting, the MLE remains computationally cumbersome even when using the approximation in [28] because it requires cross-tabulation of the empirical frequencies corresponding to the bivariate normal probabilities above. This makes the use of the MLE unattractive particularly in situations in which it is not feasible to materialize all O(n2) pairwise similarities estimable from (qi, qj)i<j so that they would need to be re-evaluated frequently. Collision-based estimator. The collision-based estimator proposed in [27] is a bin-based approach as the MLE. The similarity ρ is estimated as bρcol = θ−1 Pk l=1 I(q(l) = q′ (l))/k  , where the map θ : [0, 1] →[0, 1] is defined by r 7→θ(r) = Pr(Q(Z) = Q(Z′)), shown to be monotonically increasing in [27]. Compared to the MLE, bρcol uses less information – it only counts “collisions”, i.e., events {q(l) = q′ (l)}. The loss in statistical efficiency is moderate for b = 2, in particular for ρ close to 1. However, as b increases that loss becomes more and more substantial; cf. Figure 1. On the positive side, bρcol is convenient to compute given that the evaluation of the function θ−1 can be approximated by employing a look-up table after tabulating θ on a fine grid. 0 0.2 0.4 0.6 0.8 1 -3 -2.5 -2 -1.5 -1 -0.5 0 0.5 1 1.5 log10(MSE) b = 2 b = 3 b = 4 0.2 0.4 0.6 0.8 1 1 2 3 4 5 Relative Efficiency b = 2 0 0.2 0.4 0.6 0.8 1 1 10 20 30 Relative Efficiency b = 4 Figure 1: (L): Asymptotic MSEs [27] of bρcol (to be divided by k) for 2 ≤b ≤4. (M,R): Asymptotic relative efficiencies MSEρ(bρcol)/MSEρ(bρMLE) for b ∈{2, 4}, where bρMLE is the MLE in [28]. 4 0 0.2 0.4 0.6 0.8 1 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 log10(squared Bias) b = 2 b = 3 b = 4 b = 5 b = 6 b bound on bias2 2 1.2 · 10−1 3 7.2 · 10−3 4 4.5 · 10−4 5 2.8 · 10−5 6 1.8 · 10−6 0 0.2 0.4 0.6 0.8 1 0.8 1 1.2 1.4 1.6 1.8 2 variance Figure 2: (L): Bias2 ρ(bρlin) and the bound of Theorem 1. (M): uniform upper bounds on Bias2 ρ(bρlin) obtained from Theorem 1 by setting ρ = 1. (R): Varρ(bρlin) (to be divided by k). 3.2 Code-based approaches In the code-based approach, we simply ignore the fact that the quantized data actually represent intervals and treat them precisely in the same way as full-precision data. Recovery of cosine similarity is performed by means of the estimator in §2 with z, z′ replaced by q, q′. Perhaps surprisingly, it turns out that depending on ρ the loss of information incurred by this rather crude approach can be small already for bit depths between b = 3 and b = 5. That loss increases with ρ, with a fundamental gap compared to bin-based approaches and to the full precision case in the limit ρ →1. Linear estimator. We first consider bρlin = ⟨q, q′⟩/k. We note that bρlin = bρlin,b depends on b; b = ∞ corresponds to the estimator bρlin = bρlin,∞in §2 denoted by the same symbol. A crucial difference between the code-based and the bin-based approaches discussed above is that the latter have vanishing asymptotic squared bias of the order O(k−2) for any b [27, 28]. This is not the case for code-based approaches whose bias needs to be analyzed carefully. The exact bias of bρlin in dependence of ρ and b can be evaluated exactly numerically. Numerical evaluations of bias and variance of estimators discussed in the present section only rely on the computation of coefficients θα,β defined by θα,β := Eρ[Q(Z)αQ(Z′)β] = X σ,σ′∈{−1,1} K X s,u=1 σα(σ′)βµα s µβ u Pρ Z ∈σ(ts−1, ts), Z′ ∈σ′(tu−1, tu)  , (11) where α, β are non-negative integers and (Z, Z′) are bivariate normal (1) with r = ρ. Specifically, we have Eρ[bρlin] = θ1,1, Varρ(bρlin) = (θ2,2 −θ2 1,1)/k. In addition to exact numerical evaluation, we provide a bound on the bias of bρlin which quantifies explicitly the rate of decay in dependence b. Theorem 1. We have Bias2 ρ(bρlin) ≤4ρ2D2 b, where Db = 33/22π 12 2−2b ≈2.72 · 2−2b. As shown in Figure 2 (L), the bound on the squared bias in Theorem 1 constitutes a reasonable proxy of the exact squared bias. The rate of decay is O(2−4b). Moreover, it can be verified numerically that the variance in the full precision case upper bounds the variance for finite b, i.e., Varρ(bρlin,b) ≤Varρ(bρlin,∞), ρ ∈[0, 1). Combining bias and variance, we may conclude that depending on k, the MSE of bρlin based on coarsely quantized data does not tend to be far from what is achieved with full precision data. The following two examples illustrate this point. (i) Suppose k = 100 and b = 3. With full precision, we have MSEρ(bρlin,∞) = (1+ρ2)/k ∈[.01, .02]. From Figure 2 (M) and the observation that Varρ(bρlin,3) ≤Varρ(bρlin,∞), we find that the MSE can go up by at most 7.2 · 10−3, i.e., it can at most double relative to the full precision case. (ii) Suppose k = 1000 and b = 4. With the same reasoning as in (i), the MSE under quantization can increase at most by a factor of 1.45 as compared to full precision data. Figure 3 shows that these numbers still tend to be conservative. In general, the difference of the MSEs for b = ∞on the one hand and b ∈{3, 4, 5} on the other hand gets more pronounced for large values of the similarity ρ and large values of k. This is attributed to the (squared) bias of bρlin. In particular, it does not pay off to choose k significantly larger than the order of the squared bias. 5 0 0.2 0.4 0.6 0.8 1 -4 -3.5 -3 -2.5 -2 -1.5 -1 log10(MSE) k = 20 k = 50 k = 100 k = 200 k = 500 k = 1000 k = 2000 k = 5000 k = 10000 b = 3 0 0.2 0.4 0.6 0.8 1 -4 -3.5 -3 -2.5 -2 -1.5 -1 log10(MSE) k = 20 k = 50 k = 100 k = 200 k = 500 k = 1000 k = 2000 k = 5000 k = 10000 b = 4 0 0.2 0.4 0.6 0.8 1 -4 -3.5 -3 -2.5 -2 -1.5 -1 log10(MSE) k = 20 k = 50 k = 100 k = 200 k = 500 k = 1000 k = 2000 k = 5000 k = 10000 b = 5 Figure 3: MSEs of bρlin for various k and b ∈{3, 4, 5} (dotted). The solid (red) lines indicate the corresponding MSEs for bρlin in the full-precision case (b = ∞). Normalized estimator. In the full precision case we have seen that simple normalization of the form bρnorm = ⟨z, z′⟩/(∥z∥2 ∥z′∥2) can yield substantial benefits. Interestingly, it turns out that the counterpart bρnorm = ⟨q, q′⟩/(∥q∥2 ∥q′∥2) for quantized data is even more valuable as it helps reducing the bias of bρlin = ⟨q, q′⟩/k. This effect can be seen easily in the limit ρ →1 in which case Biasρ(bρnorm) →0 by construction. In general, bias and variance can be evaluated as follows. Proposition 1. In terms of the coefficients θα,β defined in (11), as k →∞, we have | Biasρ[bρnorm]| = θ1,1 θ2,0 −ρ + O(k−1) Var(bρnorm) = 1 k  θ2,2 θ2 2,0 −2θ1,1θ3,1 θ3 2,0 + θ2 1,1(θ4,0+θ2,2) 2θ4 2,0  + O(k−2). Figure 4 (L,M) graphs the above two expressions. In particular, the plots highlight the reduction in bias compared to bρlin and the fact that the variance is decreasing in ρ as for b = ∞. While Proposition 1 is asymptotic, we verify a tight agreement in simulations for reasonably small k (cf. supplement). 0 0.2 0.4 0.6 0.8 1 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 log10(squared Bias) b = 2 b = 3 b = 4 b = 5 b = 6 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 variance b = 3 b = 2 b = 0 0.2 0.4 0.6 0.8 1 -5 -4.5 -4 -3.5 -3 -2.5 -2 -1.5 -1 log10(MSE) k = 20 k = 50 k = 100 k = 200 k = 500 k = 1000 k = 2000 k = 5000 k = 10000 Figure 4: (L): Asymptotic Bias2 ρ(bρnorm) relative to Bias2 ρ(bρlin). (M): Varρ(bρnorm) (asymptotic, to be divided by k). (R): MSEs of bρlin,4 vs. the MSEs of bρcoll,2 using twice the number of RPs (comparison at the bit level). The stars indicate the values of ρ at which the MSEs of the two estimators are equal. 3.3 Coding-based estimation vs. Collision-based estimation Both schemes are comparable in terms of simplicity, but at the level of statistical performance none of the two dominates the other. The collision-based approach behaves favorably in a high similarity regime as shows a comparison of MSEρ(bρcol) (b = 2) and MSEρ(bρnorm) (b = 4) at the bit level (Figure 4 (R)): since bρcol uses only two bits for each of the k RPs, while bρnorm uses twice as many bits, we have doubled the number of RPs for bρcol. The values of ρ for which the curves of the two approaches (for fixed k) intersect are indicated by stars. As k decreases from 104 to 102, these values increase from about ρ = 0.55 to ρ = 0.95. In conclusion, bρcol is preferable in applications in which high similarities prevail, e.g., in duplicate detection. On the other hand, for generic high-dimensional data, one would rather not expect ρ to take high values given that two points drawn uniformly at random from the sphere are close to orthogonal with high probability. Figure 1 (L) shows that as b is raised, bρcol requires ρ to be increasingly closer to one to achieve lower MSE. By contrast, increasing b for the coding-based schemes yields improvements essentially for the 6 whole range of ρ. An interesting phenomenon occurs in the limit ρ →1. It turns out that the rate of decay of Varρ(bρnorm) is considerably slower than the rate of decay of Varρ(bρcol). Theorem 2. For any finite b, we have Varρ(bρnorm) = Θ((1 −ρ)1/2), Varρ(bρcol) = Θ((1 −ρ)3/2) as ρ →1. The rate Θ((1 −ρ)3/2) is the same as the MLE [28] which is slower than the rate Θ((1 −ρ)2) in the full precision case (cf. §2). We conjecture that the rate Θ((1 −ρ)1/2) is intrinsic to code-based estimation as this rate is also obtained when computing the full precision MLE (3) with quantized data (i.e., z, z′ gets replaced by q, q′). 3.4 Quantization of norms Let us recall that according to our basic setup in §1, we have assumed so far that it is possible to compute the norms λi = ∥xi∥2 2, i ∈[n], of the original data prior to projection and quantization, and store them in full precision to approximately recover inner products and squared distances via ⟨xi, xj⟩≈λiλj bρij, ∥xi −xj∥2 2 ≈λ2 i + λ2 j −2λiλj bρij, where bρij is an estimate of the cosine similarity of xi and xj. Depending on the setting, it may be required to quantize the {λi}n i=1 as well. It turns out that the MSE for estimating distances can be tightly bounded in terms of the MSE for estimating cosine similarities and max1≤i≤n |bλi −λi|, where {bλi}n i=1 denote the quantized versions of {λi}n i=1; the precise bound is stated in the supplement. 4 Empirical results: linear classification using quantized RPs One traditional application of RPs is dimension reduction in linear regression or classification with high-dimensional predictors [14, 30]. The results of §3.2 suggest that as long as the number of RPs k are no more than a few thousand, subsequent scalar quantization to four bits is not expected to have much of a negative effect relative to using full precision data. In this section, we verify this hypothesis for four high-dimensional data sets from the UCI repository: arcene (d = 104), Dexter (d = 2 · 104), farm (d = 5.5 · 104) and PEMS (d = 1.4 · 105). Setup. All data points are scaled to unit Euclidean norm before dimension reduction and scalar quantization based on the Lloyd-Max quantizer (10). The number of RPs k is varied according to {26, 27, . . . , 212}. For each of these values for k, we consider 20 independent realizations of the random projection matrix A. Given projected and quantized data {q1, . . . , qn}, we estimate the underlying cosine similarities ρij as bρij = bρ(qi, qj), i, j ∈[n], where bρ(qi, qj) is a placeholder for either the collision-based estimator bρcoll based on b = 2 bits or the normalized estimator bρnorm for b ∈{1, 2, 4, ∞} using data {qi(l), qj(l)}k l=1; one-bit quantization (b = 1) is here included as a reference. The {bρij}1≤i,j≤n are then used as a kernel matrix fed into LIBSVM [9] to train a binary classifier. Prediction on test sets is performed accordingly. LIBSVM is run with 30 different values of its tuning parameter C ranging from 10−3 to 104. Results. A subset of the results is depicted in Figure 5 which is composed of three columns (one for each type of plot) and four rows (one for each data set). All results are averages over 20 independent sets of random projections. The plots in the left column show the minimum test errors over all 30 choices of the tuning parameter C under consideration in dependency of the number of RPs k. The plots in the middle column show the test errors in dependency of C for a selected value of k (the full set of plots can be found in the supplement). The plots in the right column provide a comparison of the minimum (w.r.t. C) test errors of bρcoll,2 and bρnorm,4 at the bit level, i.e., with k doubled for bρcoll,2. In all plots, classification performance improves as b increases. What is more notable though is that the gap between b = 4 and b = ∞is indeed minor as anticipated. Regarding the performance of bρcoll,2 and bρnorm,4, the latter consistently achieves better performance. 5 Conclusion In this paper, we have presented theoretical and empirical evidence that it is possible to achieve additional data compression in the use of random projections by means of coarse scalar quantization. 7 6 7 8 9 10 11 12 log2(k) 0.63 0.66 0.69 0.72 0.75 0.78 0.81 accuracy on test set PEMS -4 -2 0 2 4 log10(C) 0.2 0.3 0.4 0.5 0.6 0.7 accuracy on test set PEMS, k = 64 6 7 8 9 10 11 log2(k) 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 accuracy on test set PEMS 6 7 8 9 10 11 12 log2(k) 0.6 0.65 0.7 0.75 0.8 0.85 0.9 accuracy on test set Dexter -4 -2 0 2 4 log10(C) 0.55 0.6 0.65 0.7 0.75 0.8 accuracy on test set Dexter, k = 512 6 7 8 9 10 11 log2(k) 0.6 0.65 0.7 0.75 0.8 0.85 0.9 accuracy on test set Dexter 6 7 8 9 10 11 12 log2(k) 0.7 0.75 0.8 0.85 0.9 accuracy on test set farm -4 -2 0 2 4 log10(C) 0.5 0.55 0.6 0.65 0.7 0.75 accuracy on test set farm, k = 64 6 7 8 9 10 11 log2(k) 0.7 0.75 0.8 0.85 0.9 accuracy on test set farm 6 7 8 9 10 11 12 log2(k) 0.65 0.7 0.75 0.8 0.85 accuracy on test set arcene -4 -2 0 2 4 log10(C) 0.55 0.6 0.65 0.7 0.75 0.8 0.85 accuracy on test set arcene, k = 512 6 7 8 9 10 11 log2(k) 0.6 0.65 0.7 0.75 0.8 0.85 accuracy on test set arcene Figure 5: Results of the classification experiments. Each row corresponds to one data set. (L): Accuracy on the test set (optimized over C) in dependence of the number of RPs k (log2 scale). (M): Accuracy on the test set for a selected value of k in dependence of log10(C). (R): Comparison of the test accuracies when using the estimators bρnorm,4 respectively bρcoll,2 with twice the number of RPs. The loss of information incurred at this step tends to be mild even with the naive approach in which quantized data are treated in the same way as their full precision counterparts. An exception only arises for cosine similarities close to 1 (Theorem 2). We have also shown that the simple form of normalization employed in the construction of the estimator bρnorm can be extremely beneficial, even more so for coarsely quantized data because of a crucial bias reduction. Regarding future work, it is worthwhile to consider the extension to the case in which the random projections are not Gaussian but arise from one of the various structured Johnson-Lindenstrauss transforms, e.g., those in [2, 3, 23]. A second direction of interest is to analyze the optimal trade-off between the number of RPs k and the bit depth b in dependence of the similarity ρ; in the present work, the choice of b has been driven with the goal of roughly matching the full precision case. 8 Acknowledgments The work was partially supported by NSF-Bigdata-1419210, NSF-III-1360971. Ping Li also thanks Michael Mitzenmacher for helpful discussions. References [1] D. Achlioptas. Database-friendly random projections: Johnson-Lindenstrauss with binary coins. Journal of Computer and System Sciences, 66:671–687, 2003. [2] N. Ailon and B. Chazelle. Approximate nearest neighbors and the fast Johnson-Lindenstrauss transform. In Proceedings of the Symposium on Theory of Computing (STOC), pages 557–563, 2006. [3] N. Ailon and E. Liberty. Almost optimal unrestricted fast Johnson–Lindenstrauss transform. ACM Transactions on Algorithms, 9:21, 2013. [4] T. Anderson. An Introduction to Multivariate Statistical Analysis. Wiley, 2003. [5] E. Bingham and H. Mannila. Random projection in dimensionality reduction: applications to image and text data. In Conference on Knowledge Discovery and Data Mining (KDD), pages 245–250, 2001. [6] P. Boufounos and R. Baraniuk. 1-bit compressive sensing. In Information Science and Systems, 2008. [7] C. Boutsidis, A. Zouzias, and P. Drineas. Random Projections for k-means Clustering. In Advances in Neural Information Processing Systems (NIPS), pages 298–306. 2010. [8] E. Candes and T. Tao. Near-optimal signal recovery from random projections: Universal encoding strategies? IEEE Transactions on Information Theory, 52:5406–5425, 2006. [9] C-C. Chang and C-J. Lin. LIBSVM: A library for support vector machines. ACM Transactions on Intelligent Systems and Technology, 2:27:1–27:27, 2011. http://www.csie.ntu.edu.tw/~cjlin/libsvm. [10] M. Charikar. Similarity estimation techniques from rounding algorithms. In Proceedings of the Symposium on Theory of Computing (STOC), pages 380–388, 2002. [11] S. Dasgupta. Learning mixtures of Gaussians. In Symposium on Foundations of Computer Science (FOCS), pages 634–644, 1999. [12] S. Dasgupta. An elementary proof of a theorem of Johnson and Lindenstrauss. Random Structures and Algorithms, 22:60–65, 2003. [13] M. Datar, N. Immorlica, P. Indyk, and V. Mirrokni. Locality-Sensitive Hashing Scheme Based on p-Stable Distributions. In Symposium on Computational Geometry (SCG), pages 253–262, 2004. [14] D. Fradkin and D. Madigan. Experiments with random projections for machine learning. In Conference on Knowledge Discovery and Data Mining (KDD), pages 517–522, 2003. [15] A. Gersho and R. Gray. Vector Quantization and Signal Compression. Springer, 1991. [16] M. Goemans and D. Williamson. Improved Approximation Algorithms for Maximum Cut and Satisfiability Problems Using Semidefinite Programming. Journal of the ACM, 42:1115–1145, 1995. [17] P. Indyk and R. Motwani. Approximate nearest neighbors: towards removing the curse of dimensionality. In Proceedings of the Symposium on Theory of Computing (STOC), pages 604–613, 1998. [18] J. Matousek. On variants of the Johnson-Lindenstrauss lemma. Random Structures and Algorithms, 33:142–156, 2008. [19] L. Jacques. A Quantized Johnson-Lindenstrauss Lemma: The Finding of Buffon’s needle. IEEE Transactions on Information Theory, 61:5012–5027, 2015. [20] W. Johnson and J. Lindenstrauss. Extensions of Lipschitz mappings into a Hilbert space. Contemporary Mathematics, pages 189–206, 1984. [21] K. Kenthapadi, A. Korolova, I. Mironov, and N. Mishra. Privacy via the Johnson-Lindenstrauss Transform. Journal of Privacy and Confidentiality, 5, 2013. [22] J. Kieffer. Uniqueness of locally optimal quantizer for log-concave density and convex error weighting function. IEEE Transactions on Information Theory, 29:42–47, 1983. 9 [23] F. Krahmer and R. Ward. New and improved Johnson-Lindenstrauss embeddings via the Restricted Isometry Property. SIAM Journal on Mathematical Analysis, 43:1269–1281, 2011. [24] J. Laska and R. Baraniuk. Regime change: Bit-depth versus measurement-rate in compressive sensing. IEEE Transactions on Signal Processing, 60:3496–3505, 2012. [25] M. Li, S. Rane, and P. Boufounos. Quantized embeddings of scale-invariant image features for mobile augmented reality. In International Workshop on Multimedia Signal Processing (MMSP), pages 1–6, 2012. [26] P. Li, T. Hastie, and K. Church. Improving Random Projections Using Marginal Information. In Annual Conference on Learning Theory (COLT), pages 635–649, 2006. [27] P. Li, M. Mitzenmacher, and A. Shrivastava. Coding for Random Projections. In Proceedings of the International Conference on Machine Learning (ICML), pages 676–678, 2014. [28] P. Li, M. Mitzenmacher, and M. Slawski. Quantized Random Projections and Non-Linear Estimation of Cosine Similarity. In Advances in Neural Information Processing Systems (NIPS), pages 2756–2764. 2016. [29] M. Mahoney. Randomized Algorithms for Matrices and Data. Foundations and Trends in Machine Learning, 3:123–224, 2011. [30] O. Maillard and R. Munos. Compressed least-squares regression. In Advances in Neural Information Processing Systems (NIPS), pages 1213–1221. 2009. [31] S. Rane and P. Boufounos. Privacy-preserving nearest neighbor methods: Comparing signals wihtout revealing them. IEEE Signal Processing Magazine, 30:18–28, 2013. [32] S. Rane, P. Boufounos, and A. Vetro. Quantized embeddings: An efficient and universal nearest neighbor method for cloud-based image retrieval. In SPIE Optical Engineering and Applications, pages 885609– 885609. International Society for Optics and Photonics, 2013. [33] S. Vempala. The Random Projection Method. American Mathematical Society, 2005. 10
2017
619
7,140
Efficient Modeling of Latent Information in Supervised Learning using Gaussian Processes Zhenwen Dai ∗‡ zhenwend@amazon.com Mauricio A. Álvarez † mauricio.alvarez@sheffield.ac.uk Neil D. Lawrence †‡ lawrennd@amazon.com Abstract Often in machine learning, data are collected as a combination of multiple conditions, e.g., the voice recordings of multiple persons, each labeled with an ID. How could we build a model that captures the latent information related to these conditions and generalize to a new one with few data? We present a new model called Latent Variable Multiple Output Gaussian Processes (LVMOGP) that allows to jointly model multiple conditions for regression and generalize to a new condition with a few data points at test time. LVMOGP infers the posteriors of Gaussian processes together with a latent space representing the information about different conditions. We derive an efficient variational inference method for LVMOGP for which the computational complexity is as low as sparse Gaussian processes. We show that LVMOGP significantly outperforms related Gaussian process methods on various tasks with both synthetic and real data. 1 Introduction Machine learning has been very successful in providing tools for learning a function mapping from an input to an output, which is typically referred to as supervised learning. One of the most pronouncing examples currently is deep neural networks (DNN), which empowers a wide range of applications such as computer vision, speech recognition, natural language processing and machine translation [Krizhevsky et al., 2012, Sutskever et al., 2014]. The modeling in terms of function mapping assumes a one/many to one mapping between input and output. In other words, ideally the input should contain sufficient information to uniquely determine the output apart from some sensory noise. Unfortunately, in most cases, this assumption does not hold. We often collect data as a combination of multiple scenarios, e.g., the voice recording of multiple persons, the images taken from different models of cameras. We only have some labels to identify these scenarios in our data, e.g., we can have the names of the speakers and the specifications of the used cameras. These labels themselves do not represent the full information about these scenarios. A question therefore is how to use these labels in a supervised learning task. A common practice in this case would be to ignore the difference of scenarios, but this will result in low accuracy of modeling, because all the variations related to the different scenarios are considered as the observation noise, as different scenarios are not distinguishable anymore in the inputs,. Alternatively, we can either model each scenario separately, which often suffers from too small training data, or use a one-hot encoding to represent each scenario. In both of these cases, generalization/transfer to new scenario is not possible. ∗Inferentia Limited. †Dept. of Computer Science, University of Sheffield, Sheffield, UK. ‡Amazon.com. The scientific idea and a preliminary version of code were developed prior to joining Amazon. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. 𝑣" 𝐹$ (a) 0 2 4 6 8 10 Speed −20 0 20 40 60 Braking Distance Mean Data Confidence (b) 0 10 Distance ground truth data 0 2 4 6 8 10 Speed 0 10 Distance (c) 0 10 Braking Distance ground truth data 0 2 4 6 8 10 Initial Speed 0 10 Braking Distance (d) 2.5 5.0 7.5 10.0 1/µ −2 −1 0 1 Latent Variable (e) Figure 1: A toy example about modeling the braking distance of a car. (a) illustrating a car with the initial speed v0 on a flat road starts to brake due to the friction force Fr. (b) the results of a GP regression on all the data from 10 different road and tyre conditions. (c) The top plot visualizes the fitted model with respect to one of the conditions in the training data and the bottom plot shows the prediction of the trained model for a new condition with only one observation. The model assumes every condition independently. (d) LVMOGP captures the correlation among different conditions and the plot shows the curve with respect to one of the conditions. By using the information from all the conditions, it is able to predict in a new condition with only one observation.(e) The learned latent variable with uncertainty corresponds to a linear transformation of the inverse of the true friction coefficient (µ). The blue error bars denote the variational posterior of the latent variables q(H). In this paper, we address this problem by proposing a probabilistic model that can jointly consider different scenarios and enables efficient generalization to new scenarios. Our model is based on Gaussian Processes (GP) augmented with additional latent variables. The model is able to represent the data variance related to different scenarios in the latent space, where each location corresponds to a different scenario. When encountering a new scenario, the model is able to efficient infer the posterior distribution of the location of the new scenario in the latent space. This allows the model to efficiently and robustly generalize to a new scenario. An efficient Bayesian inference method of the propose model is developed by deriving a closed-form variational lower bound for the model. Additionally, with assuming a Kronecker product structure in the variational posterior, the derived stochastic variational inference method achieves the same computational complexity as a typical sparse Gaussian process model with independent output dimensions. 2 Modeling Latent Information 2.1 A Toy Problem Let us consider a toy example where we wish to model the braking distance of a car in a completely data-driven way. Assuming that we do not know physics about car, we could treat it as a nonparametric regression problem, where the input is the initial speed read from the speedometer and the output is the distance from the location where the car starts to brake to the point where the car is fully stopped. We know that the braking distance depends on the friction coefficient, which varies according to the condition of the tyres and road. As the friction coefficient is difficult to measure directly, we can conduct experiments with a set of different tyre and road conditions, each associated with a condition id, e.g., ten different conditions, each has five experiments with different initial speeds. How can we model the relation between the speed and distance in a data-driven way, so that we can extrapolate to a new condition with only one experiment? Denote the speed to be x, the observed braking distance to be y, and the condition id to be d. A straight-forward modeling choice is to ignore the difference in conditions. Then, the relation between 2 the speed and the distance can be modeled as y = f(x) + ϵ, f ∼GP, (1) where ϵ represents measurement noise, and the function f is modeled as a Gaussian Process (GP). Since we do not know the parametric form of the function, we model it non-parametrically. The drawback of this model is that the accuracy is very low as all the variations caused by different conditions are modeled as measurement noise (see Figure 1b). Alternatively, we can model each condition separately, i.e., fd ∼GP, d = 1, . . . , D, where D denotes the number of considered conditions. In this case, the relation between speed and distance for each condition can be modeled cleanly if there are sufficient data in that condition. However, such modeling is not able to generalize to new conditions (see Figure 1c), because it does not consider the correlations among conditions. Ideally, we wish to model the relation together with the latent information associated with different conditions, i.e., the friction coefficient in this example. A probabilistic approach is to assume a latent variable. With a latent variable hd that represents the latent information associated with the condition d, the relation between speed and distance for the condition d is, then, modeled as y = f(x, hd) + ϵ, f ∼GP, hd ∼N(0, I). (2) Note that the function f is shared across all the conditions like in (1), while for each condition a different latent variable hd is inferred. As all the conditions are jointly modeled, the correlation among different conditions are correctly captured, which enables generalization to new conditions (see Figure 1d for the results of the proposed model). This model enables us to capture the relation between the speed, distance as well as the latent information. The latent information is learned into a latent space, where each condition is encoded as a point in the latent space. Figure 1e shows how the model “discovers" the concept of friction coefficient by learning the latent variable as a linear transformation of the inverse of the true friction coefficients. With this latent representation, we are able to infer the posterior distribution of a new condition given only one observation and it gives reasonable prediction for the speed-distance relation with uncertainty. 2.2 Latent Variable Multiple Output Gaussian Processes In general, we denote the set of inputs as X = [x1, . . . , xN]⊤, which corresponds to the speed in the toy example, and each input xn can be considered in D different conditions in the training data. For simplicity, we assume that, given an input xn, the outputs associated with all the D conditions are observed, denoted as yn = [yn1, . . . , ynD]⊤and Y = [y1, . . . , yN]⊤. The latent variables representing different conditions are denoted as H = [h1, . . . , hD]⊤, hd ∈RQH. The dimensionality of the latent space QH needs to be pre-specified like in other latent variable models. The more general case where each condition has a different set of inputs and outputs will be discussed in Section 4. Unfortunately, inference of the model in (2) is challenging, because the integral for computing the marginal likelihood, p(Y|X) = R p(Y|X, H)p(H)dH, is analytically intractable. Apart from the analytical intractability, the computation of the likelihood p(Y|X, H) is also very expensive, because of its cubic complexity O((ND)3). To enable efficient inference, we propose a new model which assumes the covariance matrix can be decomposed as a Kronecker product of the covariance matrix of the latent variables KH and the covariance matrix of the inputs KX. We call the new model Latent Variable Multiple Output Gaussian Processes (LVMOGP) due to its connection with multiple output Gaussian processes. The probabilistic distributions of LVMOGP are defined as p(Y:|F:) = N Y:|F:, σ2I  , p(F:|X, H) = N F:|0, KH ⊗KX , (3) where the latent variables H have unit Gaussian priors, hd ∼N(0, I), F = [f1, . . . , fN]⊤, fn ∈RD denote the noise-free observations, the notation ":" represents the vectorization of a matrix, e.g., Y: = vec(Y) and ⊗denotes the Kronecker product. KX denotes the covariance matrix computed on the inputs X with the kernel function kX and KH denotes the covariance matrix computed on the latent variable H with the kernel function kH. Note that the definition of LVMOGP only introduces a Kronecker product structure in the kernel, which does not directly avoid the intractability of its marginal likelihood. In the next section, we will show how the Kronecker product structure can be used for deriving an efficient variational lower bound. 3 3 Scalable Variational Inference The exact inference of LVMOGP in (3) is analytically intractable due to an integral of the latent variable in the marginal likelihood. Titsias and Lawrence [2010] develop a variational inference method by deriving a closed-form variational lower bound for a Gaussian process model with latent variables, known as Bayesian Gaussian process latent variable model. Their method is applicable to a broad family of models including the one in (2), but is not efficient for LVMOGP because it has cubic complexity with respect to D.4 In this section, we derive a variational lower bound that has the same complexity as a sparse Gaussian process assuming independent outputs by exploiting the Kronecker product structure of the kernel of LVMOGP. We augment the model with an auxiliary variable, known as the inducing variable U, following the same Gaussian process prior p(U:) = N (U:|0, Kuu). The covariance matrix Kuu is defined as Kuu = KH uu ⊗KX uu following the assumption of the Kronecker product decomposition in (3), where KH uu is computed on a set of inducing inputs ZH = [zH 1 , . . . , zH MH]⊤, zH m ∈RQH with the kernel function kH. Similarly, KX uu is computed on another set of inducing inputs ZX = [zX 1 , . . . , zX MX]⊤, zX m ∈RQX with the kernel function kX, where zX m has the same dimensionality as the inputs xn. We construct the conditional distribution of F as: p(F|U, ZX, ZH, X, H) = N F:|KfuK−1 uuU:, Kff −KfuK−1 uuK⊤ fu  , (4) where Kfu = KH fu ⊗KX fu and Kff = KH ff ⊗KX ff. KX fu is the cross-covariance computed between X and ZX with kX and KH fu is the cross-covariance computed between H and ZH with kH. Kff is the covariance matrix computed on X with kX and KH ff is computed on H with kH. Note that the prior distribution of F after marginalizing U is not changed with the augmentation, because p(F|X, H) = R p(F|U, ZX, ZH, X, H)p(U|ZX, ZH)dU. Assuming variational posteriors q(F|U) = p(F|U, X, H) and q(H), the lower bound of the log marginal likelihood can be derived as log p(Y|X) ≥F −KL (q(U) ∥p(U)) −KL (q(H) ∥p(H)) , (5) where F = ⟨log p(Y:|F:)⟩p(F|U,X,H)q(U)q(H). It is known that the optimal posterior distribution of q(U) is a Gaussian distribution [Titsias, 2009, Matthews et al., 2016]. With an explicit Gaussian definition of q(U) = N U|M, ΣU , the integral in F has a closed-form solution: F = −ND 2 log 2πσ2 − 1 2σ2 Y⊤ : Y: − 1 2σ2 Tr K−1 uuΦK−1 uu(M:M⊤ : + ΣU)  + 1 σ2 Y⊤ : ΨK−1 uuM: − 1 2σ2 ψ −tr K−1 uuΦ  , (6) where ψ = ⟨tr (Kff)⟩q(H), Ψ = ⟨Kfu⟩q(H) and Φ = D K⊤ fuKfu E q(H).5 Note that the optimal variational posterior of q(U) with respect to the lower bound can be computed in closed-form. However, the computational complexity of the closed-form solution is O(NDM 2 XM 2 H). 3.1 More Efficient Formulation Note that the lower bound in (5-6) does not take advantage of the Kronecker product decomposition. The computational efficiency could be improved by avoiding directly computing the Kronecker product of the covariance matrices. Firstly, we reformulate the expectations of the covariance matrices ψ, Ψ and Φ, so that the expectation computation can be decomposed, ψ = ψHtr KX ff  , Ψ = ΨH ⊗KX fu, Φ = ΦH ⊗ (KX fu)⊤KX fu)  , (7) where ψH = D tr  KH ff E q(H), ΨH = D KH fu E q(H) and ΦH = D (KH fu)⊤KH fu E q(H). Secondly, we assume a Kronecker product decomposition of the covariance matrix of q(U), i.e., ΣU = ΣH ⊗ΣX. Although this decomposition restricts the covariance matrix representation, it dramatically reduces 4Assume that the number of inducing points is proportional to D. 5The expectation with respect to a matrix ⟨·⟩q(H) denotes the expectation with respect to every element of the matrix. 4 the number of variational parameters in the covariance matrix from M 2 XM 2 H to M 2 X + M 2 H. Thanks to the above decomposition, the lower bound can be rearranged to speed up the computation, F = −ND 2 log 2πσ2 − 1 2σ2 Y⊤ : Y: − 1 2σ2 tr M⊤((KX uu)−1ΦC(KX uu)−1)M(KH uu)−1ΦH(KH uu)−1 − 1 2σ2 tr (KH uu)−1ΦH(KH uu)−1ΣH tr (KX uu)−1ΦX(KX uu)−1ΣX + 1 σ2 Y⊤ : (ΨX(KX uu)−1)M(KH uu)−1(ΨH)⊤ : − 1 2σ2 ψ + 1 2σ2 tr (KH uu)−1ΦH tr (KX uu)−1ΦX . (8) Similarly, the KL-divergence between q(U) and p(U) can also take advantage of the above decomposition: KL (q(U) ∥p(U)) =1 2  MX log |KH uu| |ΣH| + MH log |KX uu| |ΣX| + tr M⊤(KX uu)−1M(KH uu)−1 + tr (KH uu)−1ΣH tr (KX uu)−1ΣX −MHMX  . (9) As shown in the above equations, the direct computation of Kronecker products is completely avoided. Therefore, the computational complexity of the lower bound is reduced to O(max(N, MH) max(D, MX) max(MX, MH)), which is comparable to the complexity of sparse GPs with independent observations O(NM max(D, M)). The new formulation is significantly more efficient than the formulation described in the previous section. This enables LVMOGP to be applicable to real world scenarios. It is also straight-forward to extend this lower bound to mini-batch learning like in Hensman et al. [2013], which allows further scaling up. 3.2 Prediction After estimating the model parameters and variational posterior distributions, the trained model is typically used to make predictions. In our model, a prediction can be about a new input x∗as well as a new scenario which corresponds to a new value of the hidden variable h∗. Given both a set of new inputs X∗with a set of new scenarios H∗, the prediction of noiseless observation F∗can be computed in closed-form, q(F∗ : |X∗, H∗) = Z p(F∗ : |U:, X∗, H∗)q(U:)dU: =N F∗ : |Kf ∗uK−1 uuM:, Kf ∗f ∗−Kf ∗uK−1 uuK⊤ f ∗u + Kf ∗uK−1 uuΣUK−1 uuK⊤ f ∗u  , where Kf ∗f ∗= KH f ∗f ∗⊗KX f ∗f ∗and Kf ∗u = KH f ∗u ⊗KX f ∗u . KH f ∗f ∗and KH f ∗u are the covariance matrices computed on H∗and the cross-covariance matrix computed between H∗and ZH. Similarly, KX f ∗f ∗and KX f ∗u are the covariance matrices computed on X∗and the cross-covariance matrix computed between X∗and ZX. For a regression problem, we are often more interested in predicting for the existing condition from the training data. As the posterior distributions of the existing conditions have already been estimated as q(H), we can approximate the prediction by integrating the above prediction equation with q(H), q(F∗ : |X∗) = R q(F∗ : |X∗, H)q(H)dH. The above integration is intractable, however, as suggested by Titsias and Lawrence [2010], the first and second moment of F∗ : under q(F∗ : |X∗) can be computed in closed-form. 4 Missing Data The model described in Section 2.2 assumes that for N different inputs, we observe them in all the D different conditions. However, in real world problems, we often collect data at a different set of inputs for each scenario, i.e., for each condition d, d = 1, . . . , D. Alternatively, we can view the problem as having a large set of inputs and for each condition only the outputs associated with a 5 subset of the inputs being observed. We refer to this problem as missing data. For the condition d, we denote the inputs as X(d) = [x(d) 1 , . . . , x(d) Nd]⊤and the outputs as Yd = [y1d, . . . , yNdd]⊤, and optionally a different noise variance as σ2 d. The proposed model can be extended to handle this case by reformulating the F as F = D X d=1 −Nd 2 log 2πσ2 d − 1 2σ2 d Y⊤ d Yd − 1 2σ2 d Tr K−1 uuΦdK−1 uu(M:M⊤ : + ΣU)  + 1 σ2 d Y⊤ d ΨdK−1 uuM: − 1 2σ2 d ψd −tr K−1 uuΦd  , (10) where Φd = ΦH d ⊗  (KX fdu)⊤KX fdu)  , Ψd = ΨH d ⊗KX fdu, ψd = ψH d ⊗tr  KX fdfd  , in which ΦH d = D (KH fdu)⊤KH fdu E q(hd), ΨH d = D KH fdu E q(hd) and ψH d = D tr  KH fdfd E q(hd). The rest of the lower bound remains unchanged because it does not depend on the inputs and outputs. Note that, although it looks very similar to the bound in Section 3, the above lower bound is computationally more expensive, because it involves the computation of a different set of Φd, Ψd, ψd and the corresponding part of the lower bound for each condition. 5 Related works LVMOGP can be viewed as an extension of a multiple output Gaussian process. Multiple output Gaussian processes have been thoughtfully studied in Álvarez et al. [2012]. LVMOGP can be seen as an intrinsic model of coregionalization [Goovaerts, 1997] or a multi-task Gaussian process [Bonilla et al., 2008], if the coregionalization matrix B is replaced by the kernel KH. By replacing the coregionalization matrix with a kernel matrix, we endow the multiple output GP with the ability to predict new outputs or tasks at test time, which is not possible if a finite matrix B is used at training time. Also, by using a model for the coregionalization matrix in the form of a kernel function, we reduce the number of hyperparameters necessary to fit the covariance between the different conditions, reducing overfitting when fewer datapoints are available for training. Replacing the coregionalization matrix by a kernel matrix has also been used in Qian et al. [2008] and more recently by Bussas et al. [2017]. However, these works do not address the computational complexity problem and their models can not scale to large datasets. Furthermore, in our model, the different conditions hd are treated as latent variables, which are not observed, as opposed to these two models where we would need to provide observed data to compute KH. Computational complexity in multi-output Gaussian processes has also been studied before for convolved multiple output Gaussian processes [Álvarez and Lawrence, 2011] and for the intrinsic model of coregionalization [Stegle et al., 2011]. In Álvarez and Lawrence [2011], the idea of inducing inputs is also used and computational complexity reduces to O(NDM 2), where M refers to a generic number of inducing inputs. In Stegle et al. [2011], the covariances KH and KX are replaced by their respective eigenvalue decompositions and computational complexity reduces to O(N 3 + D3). Our method reduces computationally complexity to O(max(N, MH) max(D, MX) max(MX, MH)) when there are no missing data. Notice that if MH = MX = M, N > M and D > M, our method achieves a computational complexity of O(NDM), which is faster than O(NDM 2) in Álvarez and Lawrence [2011]. If N = D = MH = MX, our method achieves a computational complexity of O(N 3), similar to Stegle et al. [2011]. Nonetheless, the usual case is that N ≫MX, improving the computational complexity over Stegle et al. [2011]. An additional advantage of our method is that it can easily be parallelized using mini-batches like in Hensman et al. [2013]. Note that we have also provided expressions for dealing with missing data, a setup which is very common in our days, but that has not been taken into account in previous formulations. The idea of modeling latent information about different conditions jointly with the modeling of data points is related to the style and content model by Tenenbaum and Freeman [2000], where they explicitly model the style and content separation as a bilinear model for unsupervised learning. 6 Experiments We evaluate the performance of the proposed model with both synthetic and real data. 6 GP-ind LMC LVMOGP 0.2 0.3 0.4 0.5 0.6 0.7 RMSE (a) GP-ind LMC LVMOGP 0.2 0.3 0.4 0.5 0.6 0.7 RMSE (b) GP-ind −2 0 2 test train LMC −2 0 2 −0.2 0.0 0.2 0.4 0.6 0.8 1.0 1.2 LVMOGP −2 0 2 (c) Figure 2: The results on two synthetic datasets. (a) The performance of GP-ind, LMC and LVMOGP evaluated on 20 randomly drawn datasets without missing data. (b) The performance evaluated on 20 randomly drawn datasets with missing data. (c) A comparison of the estimated functions by the three methods on one of the synthetic datasets with missing data. The plots show the estimated functions for one of the conditions with few training data. The red rectangles are the noisy training data and the black crosses are the test data. Synthetic Data. We compare the performance of the proposed method with GP with independent observations and the linear model of coregionalization (LMC) [Journel and Huijbregts, 1978, Goovaerts, 1997] on synthetic data, where the ground truth is known. We generated synthetic data by sampling from a Gaussian process, as stated in (3), and assuming a two-dimensional space for the different conditions. We first generated a dataset, where all the conditions of a set of inputs are observed. The dataset contains 100 different uniformly sampled input locations (50 for training and 50 for testing), where each corresponds to 40 different conditions. An observation noise with variance 0.3 is added onto the training data. This dataset belongs to the case of no missing data, therefore, we can apply LVMOGP with the inference method presented in Section 3. We assume a 2 dimensional latent space and set MH = 30 and MX = 10. We compare LVMOGP with two other methods: GP with independent output dimensions (GP-ind) and LMC (with a full rank coregionalization matrix). We repeated the experiments on 20 randomly sampled datasets. The results are summarized in Figure 2a. The means and standard deviations of all the methods on 20 repeats are: GP-ind: 0.24 ± 0.02, LMC:0.28±0.11, LVMOGP 0.20±0.02. Note that, in this case, GP-ind performs quite well because the only gain by modeling different conditions jointly is the reduction of estimation variance from the observation noise. Then, we generated another dataset following the same setting, but where each condition had a different set of inputs. Often, in real data problems, the number of available data in different conditions is quite uneven. To generate a dataset with uneven numbers of training data in different conditions, we group the conditions into 10 groups. Within each group, the numbers of training data in four conditions are generated through a three-step stick breaking procedure with a uniform prior distribution (200 data points in total). We apply LVMOGP with missing data (Section 4) and compare with GP-ind and LMC. The results are summarized in Figure 2b. The means and standard deviations of all the methods on 20 repeats are: GP-ind: 0.43 ± 0.06, LMC:0.47 ± 0.09, LVMOGP 0.30 ± 0.04. In both synthetic experiments, LMC does not perform well because of overfitting caused by estimating the full rank coregionalization matrix. The figure 2c shows a comparison of the estimated functions by the three methods for a condition with few training data. Both LMC and LVMOGP can leverage the information from other conditions to make better predictions, while LMC often suffers from overfitting due to the high number of parameters in the coregionalization matrix. Servo Data. We apply our method to a servo modeling problem, in which the task is to predict the rise time of a servomechanism in terms of two (continuous) gain settings and two (discrete) choices of mechanical linkages [Quinlan, 1992]. The two choices of mechanical linkages introduce 25 different conditions in the experiments (five types of motors and five types of lead screws). The data in each condition are scarce, which makes joint modeling necessary (see Figure 3a). We took 70% of the dataset as training data and the rest as test data, and randomly generated 20 partitions. We applied LVMOGP with a two-dimensional latent space with an ARD kernel and used five inducing points for the latent space and 10 inducing points for the function. We compared LVMOGP with GP with ignoring the different conditions (GP-WO), GP with taking each condition as an independent output (GP-ind), GP with one-hot encoding of conditions (GP-OH) and LMC. The means and standard deviations of the RMSE of all the methods on 20 partitions are: GP-WO: 1.03 ± 0.20, GP-ind: 7 0 5 10 15 20 25 0 2 4 6 8 10 12 (a) GP-WO GP-ind GP-OH LMC LVMOGP 0.5 1.0 1.5 2.0 RMSE (b) 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 1 2 3 4 5 -0.948 -0.700 -0.452 -0.452 -0.204 -0.204 0.044 0.044 0.292 0.292 0.539 0.539 0.787 0.787 train test (c) GP-ind LMC LVMOGP 0.4 0.5 0.6 0.7 0.8 0.9 RMSE (d) Figure 3: The experimental results on servo data and sensor imputation. (a) The numbers of data points are scarce in each condition. (b) The performance of a list of methods on 20 different train/test partitions is shown in the box plot. (c) The function learned by LVMOGP for the condition with the smallest amount of data. With only one training data, the method is able to extrapolate a non-linear function due to the joint modeling of all the conditions. (d) The performance of three methods on sensor imputation with 20 repeats. 1.30 ± 0.31, GP-OH: 0.73 ± 0.26, LMC:0.69 ± 0.35, LVMOGP 0.52 ± 0.16. Note that in some conditions the data are very scarce, e.g., there are only one training data point and one test data point (see Figure 3c). As all the conditions are jointly modeled in LVMOGP, the method is able to extrapolate a non-linear function by only seeing one data point. Sensor Imputation. We apply our method to impute multivariate time series data with massive missing data. We take a in-house multi-sensor recordings including a list of sensor measurements such as temperature, carbon dioxide, humidity, etc. [Zamora-Martínez et al., 2014]. The measurements are recorded every minute for roughly a month and smoothed with 15 minute means. Different measurements are normalized to zero-mean and unit-variance. We mimic the scenario of massive missing data by randomly taking out 95% of the data entries and aim at imputing all the missing values. The performance is measured as RMSE on the imputed values. We apply LVMOGP with missing data with the settings: QH = 2, MH = 10 and MX = 100. We compare with LMC and GP-ind. The experiments are repeated 20 times with different missing values. The results are shown in a box plot in Figure 3d. The means and standard deviations of all the methods on 20 repeats are: GP-ind: 0.85 ± 0.09, LMC:0.59 ± 0.21, LVMOGP 0.45 ± 0.02. The high variance of LMC results are due to the large number of parameters in the coregionalization matrix. 7 Conclusion In this work, we study the problem of how to model multiple conditions in supervised learning. Common practices such as one-hot encoding cannot efficiently model the relation among different conditions and are not able to generalize to a new condition at test time. We propose to solve this problem in a principled way, where we learn the latent information of conditions into a latent space. By exploiting the Kronecker product decomposition in the variational posterior, our inference method is able to achieve the same computational complexity as sparse GPs with independent observations, when there are no missing data. In experiments on synthetic and real data, LVMOGP outperforms common approaches such as ignoring condition difference, using one-hot encoding and LMC. In Figure 3b and 3d, LVMOGP delivers more reliable performance than LMC among different train/test partitions due to the marginalization of latent variables. Acknowledgements MAA has been financed by the Engineering and Physical Research Council (EPSRC) Research Project EP/N014162/1. 8 References Mauricio A. Álvarez and Neil D. Lawrence. Computationally efficient convolved multiple output Gaussian processes. J. Mach. Learn. Res., 12:1459–1500, July 2011. Edwin V. Bonilla, Kian Ming Chai, and Christopher K. I. Williams. Multi-task Gaussian process prediction. In John C. Platt, Daphne Koller, Yoram Singer, and Sam Roweis, editors, NIPS, volume 20, 2008. Matthias Bussas, Christoph Sawade, Nicolas Kühn, Tobias Scheffer, and Niels Landwehr. Varyingcoefficient models for geospatial transfer learning. Machine Learning, pages 1–22, 2017. Pierre Goovaerts. Geostatistics For Natural Resources Evaluation. Oxford University Press, 1997. James Hensman, Nicolo Fusi, and Neil D. Lawrence. Gaussian processes for big data. In UAI, 2013. Andre G. Journel and Charles J. Huijbregts. Mining Geostatistics. Academic Press, 1978. Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems, pages 1097–1105, 2012. Alexander G. D. G. Matthews, James Hensman, Richard E Turner, and Zoubin Ghahramani. On sparse variational methods and the Kullback-Leibler divergence between stochastic processes. In AISTATS, 2016. Peter Z. G Qian, Huaiqing Wu, and C. F. Jeff Wu. Gaussian process models for computer experiments with qualitative and quantitative factors. Technometrics, 50(3):383–396, 2008. J R Quinlan. Learning with continuous classes. In Australian Joint Conference on Artificial Intelligence, pages 343–348, 1992. Oliver Stegle, Christoph Lippert, Joris Mooij, Neil Lawrence, and Karsten Borgwardt. Efficient inference in matrix-variate Gaussian models with IID observation noise. In NIPS, pages 630–638, 2011. Ilya Sutskever, Oriol Vinyals, and Quoc VV Le. Sequence to sequence learning with neural networks. In Advances in Neural Information Processing Systems, 2014. JB Tenenbaum and WT Freeman. Separating style and content with bilinear models. Neural Computation, 12:1473–83, 2000. Michalis K. Titsias. Variational learning of inducing variables in sparse Gaussian processes. In AISTATS, 2009. Michalis K. Titsias and Neil D. Lawrence. Bayesian Gaussian process latent variable model. In AISTATS, 2010. F. Zamora-Martínez, P. Romeu, P. Botella-Rocamora, and J. Pardo. On-line learning of indoor temperature forecasting models towards energy efficiency. Energy and Buildings, 83:162–172, 2014. Mauricio A. Álvarez, Lorenzo Rosasco, and Neil D. Lawrence. Kernels for vector-valued functions: A review. Foundations and Trends R⃝in Machine Learning, 4(3):195–266, 2012. ISSN 1935-8237. doi: 10.1561/2200000036. URL http://dx.doi.org/10.1561/2200000036. 9
2017
62
7,141
Trimmed Density Ratio Estimation Song Liu∗ University of Bristol song.liu@bristol.ac.uk Akiko Takeda The Institute of Statistical Mathematics, AIP, RIKEN, atakeda@ism.ac.jp Taiji Suzuki University of Tokyo, Sakigake (PRESTO), JST, AIP, RIKEN, taiji@mist.i.u-tokyo.ac.jp Kenji Fukumizu The Institute of Statistical Mathematics, fukumizu@ism.ac.jp Abstract Density ratio estimation is a vital tool in both machine learning and statistical community. However, due to the unbounded nature of density ratio, the estimation procedure can be vulnerable to corrupted data points, which often pushes the estimated ratio toward infinity. In this paper, we present a robust estimator which automatically identifies and trims outliers. The proposed estimator has a convex formulation, and the global optimum can be obtained via subgradient descent. We analyze the parameter estimation error of this estimator under high-dimensional settings. Experiments are conducted to verify the effectiveness of the estimator. 1 Introduction Density ratio estimation (DRE) [18, 11, 27] is an important tool in various branches of machine learning and statistics. Due to its ability of directly modelling the differences between two probability density functions, DRE finds its applications in change detection [13, 6], two-sample test [32] and outlier detection [1, 26]. In recent years, a sampling framework called Generative Adversarial Network (GAN) (see e.g., [9, 19]) uses the density ratio function to compare artificial samples from a generative distribution and real samples from an unknown distribution. DRE has also been widely discussed in statistical literatures for adjusting non-parametric density estimation [5], stabilizing the estimation of heavy tailed distribution [7] and fitting multiple distributions at once [8]. However, as a density ratio function can grow unbounded, DRE can suffer from robustness and stability issues: a few corrupted points may completely mislead the estimator (see Figure 2 in Section 6 for example). Considering a density ratio p(x)/q(x), a point x that is extremely far away from the high density region of q may have an almost infinite ratio value and DRE results can be dominated by such points. This makes DRE performance very sensitive to rare pathological data or small modifications of the dataset. Here we give two examples: Cyber-attack In change detection applications, a density ratio p(x)/q(x) is used to determine how the data generating model differs between p and q. Consider a “hacker” who can spy on our data may just inject a few data points in p which are extremely far away from the high-density region of q. This would result excessively large p(x)/q(x) tricking us to believe there is a significant change from q(x) to p(x), even if there is no change at all. If the generated outliers are also far away from the ∗This work was done when Song Liu was at The Institute of Statistical Mathematics, Japan 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. high density region of p(x), we end up with a very different density ratio function and the original parametric pattern in the ratio is ruined. We give such an example in Section 6. Volatile Samples The change of external environment may be responded in unpredictable ways. It is possible that a small portion of samples react more “aggressively” to the change than the others. These samples may be skewed and show very high density ratios, even if the change of distribution is relatively mild when these volatile samples are excluded. For example, when testing a new fertilizer, a small number of plants may fail to adapt, even if the vast majority of crops are healthy. Overly large density ratio values can cause further troubles when the ratio is used to weight samples. For example, in the domain adaptation setting, we may reweight samples from one task and reuse them in another task. Density ratio is a natural choice of such “importance weighting” scheme [28, 25]. However, if one or a few samples have extremely high ratio, after renormalizing, other samples will have almost zero weights and have little impact to the learning task. Several methods have been proposed to solve this problem. The relative density ratio estimation [33] estimates a “biased” version of density ratio controlled by a mixture parameter α. The relative density ratio is always upper-bounded by 1 α, which can give a more robust estimator. However, it is not clear how to de-bias such an estimator to recover the true density ratio function. [26] took a more direct approach. It estimates a thresholded density ratio by setting up a tolerance t to the density ratio value. All likelihood ratio values bigger than t will be clipped to t. The estimator was derived from Fenchel duality for f-divergence [18]. However, the optimization for the estimator is not convex if one uses log-linear models. The formulation also relies on the non-parametric approximation of the density ratio function (or the log ratio function) making the learned model hard to interpret. Moreover, there is no intuitive way to directly control the proportion of ratios that are thresholded. Nonetheless, the concept studied in our paper is inspired by this pioneering work. In this paper, we propose a novel method based on a “trimmed Maximum Likelihood Estimator” [17, 10]. This idea relies on a specific type of density ratio estimator (called log-linear KLIEP) [30] which can be written as a maximum likelihood formulation. We simply “ignore” samples that make the empirical likelihood take exceedingly large values. The trimmed density ratio estimator can be formulated as a convex optimization and translated into a weighted M-estimator. This helps us develop a simple subgradient-based algorithm that is guaranteed to reach the global optimum. Moreover, we shall prove that in addition to recovering the correct density ratio under the outlier setting, the estimator can also obtain a “corrected” density ratio function under a truncation setting. It ignores “pathological” samples and recovers density ratio only using “healthy” samples. Although trimming will usually result a more robust estimate of the density ratio function, we also point out that it should not be abused. For example, in the tasks of two-sample test, a diverging density ratio might indicate interesting structural differences between two distributions. In Section 2, we explain some preliminaries on trimmed maximum likelihood estimator. In Section 3, we introduce a trimmed DRE. We solve it using a convex formulation whose optimization procedure is explained in Section 4. In Section 5, we prove the estimation error upper-bound with respect to a sparsity inducing regularizer. Finally, experimental results are shown in Section 6 and we conclude our work in Section 7. 2 Preliminary: Trimmed Maximum Likelihood Estimation Although our main purpose is to estimate the density ratio, we first introduce the basic concept of trimmed estimator using density functions as examples. Given n samples drawn from a distribution P, i.e., X :=  x(i) n i=1 i.i.d. ∼P, x ∈Rd, we want to estimate the density function p(x). Suppose the true density function is a member of exponential family [20], p(x; θ) = exp [⟨θ, f(x)⟩−log Z(θ)] , Z(θ) = Z q(x) exp⟨θ, f(x)⟩dx (1) where f(x) is the sufficient statistics, Z(θ) is the normalization function and q(x) is the base measure. Maximum Likelihood Estimator (MLE) maximizes the empirical likelihood over the entire dataset. In contrast, a trimmed MLE only maximizes the likelihood over a subset of samples according to 2 their likelihood values (see e.g., [10, 31]). This paradigm can be used to derive a popular outlier detection method, one-class Support Vector Machine (one-SVM) [24]. The derivation is crucial to the development of our trimmed density ratio estimator in later sections. Without loss of generality, we can set the log likelihood function as log p(x(i); θ) −τ0, where τ0 is a constant. As samples corresponding to high likelihood values are likely to be inliers, we can trim all samples whose likelihood is bigger than τ0 using a clipping function [·]−, i.e., ˆθ = arg maxθ Pn i=1[log p(x(i); θ) −τ0]−, where [ℓ]−returns ℓif ℓ≤0 and 0 otherwise. This optimization has a convex formulation: min θ,ϵ≥0⟨ϵ, 1⟩, s.t. ∀i, log p  x(i); θ  ≥τ0 −ϵi, (2) where ϵ is the slack variable measuring the difference between log p x(i); θ  and τ0. However, formulation (2) is not practical since computing the normalization term Z(θ) in (1) is intractable for a general f and it is unclear how to set the trimming level τ0. Therefore we ignore the normalization term and introduce other control terms: min θ,ϵ≥0,τ≥0 1 2∥θ∥2 −ντ + 1 n⟨ϵ, 1⟩s.t. ∀i, ⟨θ, f(x(i))⟩≥τ −ϵi. (3) The ℓ2 regularization term is introduced to avoid θ reaching unbounded values. A new hyper parameter ν ∈(0, 1] replaces τ0 to control the number of trimmed samples. It can be proven using KKT conditions that at most 1 −ν fraction of samples are discarded (see e.g., [24], Proposition 1 for details). Now we have reached the standard formulation of one-SVM. This trimmed estimator ignores the large likelihood values and creates a focus only on the low density region. Such a trimming strategy allows us to discover “novel” points or outliers which are usually far away from the high density area. 3 Trimmed Density Ratio Estimation In this paper, our main focus is to derive a robust density ratio estimator following a similar trimming strategy. First, we briefly review the a density ratio estimator [27] from the perspective of KullbackLeibler divergence minimization. 3.1 Density Ratio Estimation (DRE) For two sets of data Xp := {x(1) p , . . . , x(np) p } i.i.d. ∼ P, Xq := {x(1) q , . . . , x(nq) q } i.i.d. ∼ Q, assume both the densities p(x) and q(x) are in exponential family (1). We know p(x;θp) q(x;θq) ∝ exp [⟨θp −θq, f(x)⟩] . Observing that the data x only interacts with the parameter θp −θq through f , we can keep using f(x) as our sufficient statistic for the density ratio model, and merge two parameters θp and θq into one single parameter δ = θp −θq. Now we can model our density ratio as r(x; δ) := exp [⟨δ, f(x)⟩−log N(δ)] , N(δ) := Z q(x) exp⟨δ, f(x)⟩dx, (4) where N(δ) is the normalization term that guarantees R q(x)r(x; δ)dx = 1 so that q(x)r(x; δ) is a valid density function and is normalized over its domain. Interestingly, despite the parameterization (changing from θ to δ), (4) is exactly the same as (1) where q(x) appeared as a base measure. The difference is, here, q(x) is a density function from which Xq are drawn so that N(δ) can be approximated accurately from samples of Q. Let us define ˆr(x; δ) := exp h ⟨δ, f(x)⟩−log b N(δ) i , b N(δ) := 1 nq nq X j=1 exp h ⟨δ, f(x(j) q )⟩ i . (5) Note this model can be computed for any f even if the integral in N(δ) does not have a closed form . 3 In order to estimate δ, we minimize the Kullback-Leibler divergence between p and q · rδ: min δ KL [p|q · rδ] = min δ Z p(x) log p(x) q(x)r(x; δ)dx = c −max δ Z p(x) log r(x; δ)dx ≈c −max δ 1 np np X i=1 log ˆr(x(i) p ; δ) (6) where c is a constant irrelevant to δ. It can be seen that the minimization of KL divergence boils down to maximizing log likelihood ratio over dataset Xp. Now we have reached the log-linear Kullback-Leibler Importance Estimation Procedure (log-linear KLIEP) estimator [30, 14]. 3.2 Trimmed Maximum Likelihood Ratio As stated in Section 1, to rule out the influences of large density ratio, we trim samples with large likelihood ratio values from (6). Similarly to one-SVM in (2), we can consider a trimmed MLE ˆδ = arg maxδ Pnp i=1[log ˆr(x(i) p ; δ) −t0]−where t0 is a threshold above which the likelihood ratios are ignored. It has a convex formulation: min δ,ϵ≥0⟨ϵ, 1⟩, s.t. ∀x(i) p ∈Xp, log ˆr(x(i) p ; δ) ≥t0 −ϵi. (7) (7) is similar to (2) since we have only replaced p(x; θ) with ˆr(x; δ). However, the ratio model ˆr(x; δ) in (7) comes with a tractable normalization term ˆN while the normalization term Z in p(x; θ) is in general intractable. Similar to (3), we can directly control the trimming quantile via a hyper-parameter ν: min δ,ϵ≥0,t≥0 1 np ⟨ϵ, 1⟩−ν · t + λR(δ), s.t. ∀x(i) p ∈Xp, log ˆr(x(i) p ; δ) ≥t −ϵi (8) where R(δ) is a convex regularizer. (8) is also convex, but it has np number of non-linear constraints and the search for the global optimal solution can be time-consuming. To avoid such a problem, one could derive and solve the dual problem of (8). In some applications, we rely on the primal parameter structure (such as sparsity) for model interpretation, and feature engineering. In Section 4, we translate (8) into an equivalent form so that its solution is obtained via a subgradient ascent method which is guaranteed to converge to the global optimum. One common way to construct a convex robust estimator is using a Huber loss [12]. Although the proposed trimming technique rises from a different setting, it shares the same guiding principle with Huber loss: avoid assigning dominating values to outlier likelihoods in the objective function. In Section 8.1 in the supplementary material, we show the relationship between trimmed DRE and binary Support Vector Machines [23, 4]. 4 Optimization The key to solving (8) efficiently is reformulating it into an equivalent max min problem. Proposition 1. Assuming ν is chosen such that ˆt > 0 for all optimal solutions in (8), then ˆδ is an optimal solution of (8) if and only if it is also the optimal solution of the following max min problem: max δ min w∈ h 0, 1 np inp,⟨1,w⟩=ν L(δ, w) −λR(δ), L(δ, w) := np X i=1 wi · log ˆr(x(i) p ; δ). (9) The proof is in Section 8.2 in the supplementary material. We define (ˆδ, ˆw) as a saddle point of (9): ∇δL(ˆδ, ˆw) −∇δλR(ˆδ) = 0, ˆw ∈arg min w∈[0, 1 np ]np,⟨w,1⟩=ν L(ˆδ, w), (10) where the second ∇δ means the subgradient if R is sub-differentiable. 4 Algorithm 1 Gradient Ascent and Trimming Input: Xp, Xq, ν and step sizes {ηit}itmax it=1 ; Initialize δ0, w0, Iteration counter: it = 0, Maximum number of iterations: itmax, Best objective, parameter pair (Obest = −∞, δbest, wbest) . while not converged and it ≤itmax do Obtain a sorted set n x(i) p onp i=1 so that log ˆr(x(1) p ; δit) ≤log ˆr(x(2) p ; δit) · · · ≤log ˆr(x(np) p ; δit). wit+1,i = 1 np , ∀i ≤νnp. wit+1,i = 0, otherwise. Gradient ascent with respect to δ: δit+1 = δit + ηit · ∇δ[L(δit, wit+1) −λR(δit)], Obest = max(Obest, L(δit+1, wit+1)) and update (δbest, wbest) accordingly. it = it + 1. end while Output: (δbest, wbest) Now the “trimming” process of our estimator can be clearly seen from (9): The max procedure estimates a density ratio given the currently assigned weights w, and the min procedure trims the large log likelihood ratio values by assigning corresponding wi to 0 (or values smaller than 1 np ). For simplicity, we only consider the cases where ν is a multiple of 1 np . Intuitively, 1 −ν is the proportion of likelihood ratios that are trimmed thus ν should not be greater than 1. Note if we set ν = 1, (9) is equivalent to the standard density ratio estimator (6). Downweighting outliers while estimating the model parameter δ is commonly used by robust estimators (See e.g., [3, 29]). The search for (ˆδ, ˆw) is straightforward. It is easy to solve with respect to w or δ while the other is fixed: given a parameter δ, the optimization with respect to w is a linear programming and one of the extreme optimal solutions is attained by assigning weight 1 np to the elements that correspond to the νnp-smallest log-likelihood ratio log ˆr(x(i), δ). This observation leads to a simple “gradient ascent and trimming” algorithm (see Algorithm 1). In Algorithm 1, ∇δL(δ, w) = 1 np np X i=1 wi · f(x(i) p ) −ν · nq X j=1 e(j) Pnq k=1 e(k) f(x(j) q ), e(i) := exp(⟨δ, f(x(i) q )⟩). In fact, Algorithm 1 is a subgradient method [2, 16], since the optimal value function of the inner problem of (9) is not differentiable at some δ where the inner problem has multiple optimal solutions. The subdifferential of the optimal value of the inner problem with respect to δ can be a set but Algorithm 1 only computes a subgradient obtained using the extreme point solution wit+1 of the inner linear programming. Under mild conditions, this subgradient ascent approach will converge to optimal results with diminishing step size rule and it →∞. See [2] for details. Algorithm 1 is a simple gradient ascent procedure and can be implemented by deep learning softwares such as Tensorflow2 which benefits from the GPU acceleration. In contrast, the original problem (8), due to its heavily constrained nature, cannot be easily programmed using such a framework. 5 Estimation Consistency in High-dimensional Settings In this section, we show how the estimated parameter ˆδ in (10) converges to the “optimal parameters” δ∗as both sample size and dimensionality goes to infinity under the “outlier” and “truncation” setting respectively. In the outlier setting (Figure 1a), we assume Xp is contaminated by outliers and all “inlier” samples in Xp are i.i.d.. The outliers are injected into our dataset Xp after looking at our inliers. For example, hackers can spy on our data and inject fake samples so that our estimator exaggerates the degree of change. In the truncation setting, there are no outliers. Xp and Xq are i.i.d. samples from P and Q respectively. However, we have a subset of “volatile” samples in Xp (the rightmost mode on histogram in Figure 1b) that are pathological and exhibit large density ratio values. 2https://www.tensorflow.org/ 5 (a) Outlier Setting. Blue and red points are i.i.d. (b) Truncation Setting. There are no outliers. Figure 1: Two settings of theoretical analysis. In the theoretical results in this section, we focus on analyzing the performance of our estimator for high-dimensional data assuming the number of non-zero elements in the optimal δ∗is k and use the ℓ1 regularizer, i.e., R(θ) = ∥θ∥1 which induces sparsity on ˆδ. The proofs rely on a recent development [35, 34] where a “weighted” high-dimensional estimator was studied. We also assume the optimization of δ in (9) was conducted within an ℓ1 ball of width ρ, i.e., Ball(ρ), and ρ is wisely chosen so that the optimal parameter δ∗∈Ball(ρ). The same technique was used in previous works [15, 35]. Notations: We denote w∗∈Rnp as the “optimal” weights depending on δ∗and our data. To lighten the notation, we shorten the log density ratio model as zδ(x) := log r(x; δ), ˆzδ(x) := log ˆr(x; δ) The proof of Theorem 1, 2 and 3 can be found in Section 8.4, 8.5 and 8.6 in supplementary materials. 5.1 A Base Theorem Now we provide a base theorem giving an upperbound of ∥ˆδ −δ∗∥. We state this theorem only with respect to an arbitrary pair (δ∗, w∗) and the pair is set properly later in Section 5.2 and 5.3. We make a few regularity conditions on samples from Q. Samples of Xq should be well behaved in terms of log-likelihood ratio values. Assumption 1. ∃0 < c1 < 1, 1 < c2 < ∞∀xq ∈Xq, u ∈Ball(ρ), c1 ≤exp⟨δ∗+ u, xq⟩≤c2 and collectively c2/c1 = Cr. We also assume the Restricted Strong Convexity (RSC) condition on the covariance of Xq, i.e., cov(Xq) = 1 nq (Xq − 1 nq Xq1)(Xq − 1 nq Xq1)⊤. Note this property has been verified for various different design matrices Xq, such as Gaussian or sub-Gaussian (See, e.g., [21, 22]). Assumption 2. RSC condition of cov(Xq) holds for all u, i.e., there exists κ′ 1 > 0 and c > 0 such that u⊤cov(Xq)u ≥κ′ 1∥u∥2 − c √nq ∥u∥2 1 with high probability. Theorem 1. In addition to Assumption 1 and 2, there exists coherence between parameter w and δ at a saddle point (ˆδ, ˆw): ⟨∇δL(ˆδ, ˆw) −∇δL(ˆδ, w∗), ˆu⟩≥−κ2∥ˆu∥2 −τ2(n, d)∥ˆu∥1, (11) where ˆu := ˆδ −δ∗, κ2 > 0 is a constant and τ2(d, n) > 0. It can be shown that if λn ≥2 max h ∥∇δL(δ∗, w∗)∥∞, ρνc 2C2r √nq , τ2(n, d) i and νκ′ 1 > 2C2 rκ2, where c > 0 is a constant determined by RSC condition, we are guaranteed that ∥ˆδ −δ∗∥≤ C2 r (νκ′ 1−2C2 rκ2) · 3 √ kλn 2 with probability converging to one. The condition (11) states that if we swap ˆw for w∗, the change of the gradient ∇δL is limited. Intuitively, it shows that our estimator (9) is not “picky” on w: even if we cannot have the optimal weight assignment w∗, we can still use “the next best thing”, ˆw to compute the gradient which is close enough. We later show how (11) is satisfied. Note if ∥∇δL(δ∗, w∗)∥∞, τ2(n, d) converge to zero as np, nq, d →∞, by taking λn as such, Theorem 1 guarantees the consistency of ˆδ. In Section 5.2 and 5.3, we explore two different settings of (δ∗, w∗) that make ||ˆδ −δ∗∥converges to zero. 6 5.2 Consistency under Outlier Setting Setting: Suppose dataset Xp is the union of two disjoint sets G (Good points) and B (Bad points) such that G i.i.d. ∼p(x) and minj∈B zδ∗(x(j) p ) > maxi∈G zδ∗(x(i) p ) (see Figure 1a). Dataset Xq i.i.d. ∼ q(x) does not contain any outlier. We set ν = |G| np . The optimal parameter δ∗is set such that p(x) = q(x)r(x; δ∗). We set w∗ i = 1 np , ∀x(i) p ∈G and 0 otherwise. Remark: Knowing the inlier proportion |G|/np is a strong assumption. However it is only imposed for theoretical analysis. As we show in Section 6, our method works well even if ν is only a rough guess (like 90%). Loosening this assumption will be an important future work. Assumption 3. ∀u ∈Ball(ρ), supx |ˆzδ∗+u(x) −ˆzδ∗(x)| ≤Clip∥u∥1. This assumption says that the log density ratio model is Lipschitz continuous around its optimal parameter δ∗and hence there is a limit how much a log ratio model can deviate from the optimal model under a small perturbation u. As our estimated weights ˆwi depends on the relative ranking of ˆzˆδ(x(i) p ), this assumption implies that the relative ranking between two points will remain unchanged under a small perturbation u if they are far apart. The following theorem shows that if we have enough clearance between “good”and “bad samples”, ˆδ converges to the optimal parameter δ∗. Theorem 2. In addition to Assumption 1, 2 and a few mild technical conditions (see Section 8.5 in the supplementary material), Assumptions 3 holds. Suppose minj∈B zδ∗(x(j) p ) −maxi∈G zδ∗(x(i) p ) ≥ 3Clipρ, ν = |G| np , nq = Ω(|G|2). If λn ≥2 · max q K1 log d |G| , ρνc 2C2r √nq  , where K1 > 0, c > 0 are constants, we are guaranteed that ||ˆδ −δ∗∥≤C2 r νκ′ 1 · 3 √ kλn with probability converging to 1. It can be seen that ∥ˆδ −δ∗∥= O p log d/min(|G|, nq)  if d is reasonably large. 5.3 Consistency under Truncation Setting In this setting, we do not assume there are outliers in the observed data. Instead, we examine the ability of our estimator recovering the density ratio up to a certain quantile of our data. This ability is especially useful when the behavior of the tail quantile is more volatile and makes the standard estimator (6) output unpredictable results. Notations: Given ν ∈(0, 1], we call tν(δ) is the ν-th quantile of zδ if P [zδ < tν(δ))] ≤ν and P [zδ ≤tν(δ))] ≥ν. In this setting, we consider ν is fixed by a user thus we drop the subscript ν from all subsequent discussions. Let’s define a truncated domain: X(δ) =  x ∈Rd|zδ(x) < t(δ) , X p(δ) = Xp ∩X(δ) and X q(δ) = Xq ∩X(δ). See Figure 1b for a visualization of t(δ) and X(δ) (the dark shaded region). Setting: Suppose dataset Xp i.i.d. ∼ P and Xq i.i.d. ∼ Q. Truncated densities pδ and qδ are the unbounded densities p and q restricted only on the truncated domain X(δ). Note that the truncated densities are dependent on the parameter δ and ν. We show that under some assumptions, the parameter ˆδ obtained from (9) using a fixed hyperparameter ν will converge to the δ∗such that qδ∗(x)r(x; δ∗) = pδ∗(x). We also define the “optimal” weight assignment w∗ i = 1 np , ∀i, x(i) p ∈ X(δ∗) and 0 otherwise. Interestingly, the constraint in (9), ⟨w∗, 1⟩= ν may not hold, but our analysis in this section suggests we can always find a pair (ˆδ, ˆw) in the feasible region so that ∥ˆδ −δ∗∥converges to 0 under mild conditions. We first assume the log density ratio model and its CDF is Lipschitz continuous. Assumption 4. ∀u ∈Ball(ρ), sup x |ˆzδ∗+u(x) −ˆzδ∗(x)| ≤Clip∥u∥. (12) 7 Define T(u, ϵ) :=  x ∈Rd | |zδ∗(x) −t(δ∗)| ≤2Clip∥u∥+ ϵ where 0 < ϵ ≤1. We assume ∀u ∈Ball(ρ), 0 < ϵ ≤1 P [xp ∈T(u, ϵ)] ≤CCDF · ∥u∥+ ϵ. In this assumption, we define a “zone” T(u, ϵ) near the ν-th quantile t(δ∗) and assume the CDF of our ratio model is upper-bounded over this region. Different from Assumption 3, the RHS of (12) is with respect to ℓ2 norm of u. In the following assumption, we assume regularity on P and Q. Assumption 5. ∀xq ∈Rd, ∥f(xq)∥∞≤Cq and ∀u ∈Ball(ρ), ∀xp ∈T(u, 1), ∥f(xp)∥∞≤Cp. Theorem 3. In addition Assumption 1 and 2 and other mild assumptions (see Section 8.6 in the supplementary material), Assumption 4 and 5 hold. If 1 ≥ν ≥8CCDF √ kCpC2 r κ′ 1 , nq = Ω(|Xp(δ∗)|2), λn ≥2 max hq K′ 1 log d |Xp(δ∗)| + 2C2 rCq|Xq\X q(δ∗)| nq , 2L·Cp √np , ρνc 2C2r √nq i , where K′ 1 > 0, c > 0 are constants, we are guaranteed that ||ˆδ −δ∗∥≤4C2 r νκ′ 1 · 3 √ kλn with high probability. It can be seen that ∥ˆδ −δ∗∥= O q log d/min(|X p(δ∗)|, nq)  if d is reasonably large and |Xq\X q(δ∗)|/nq decays fast. 6 Experiments 6.1 Detecting Sparse Structural Changes between Two Markov Networks (MNs) [14] In the first experiment3, we learn changes between two Gaussian MNs under the outlier setting. The ratio between two Gaussian MNs can be parametrized as p(x)/q(x) ∝exp(−P i,j≤d ∆i,jxixj), where ∆i,j := Θp i,j −Θq i,j is the difference between precision matrices. We generate 500 samples as Xp and Xq using two randomly structured Gaussian MNs. One point [10, . . . , 10] is added as an outlier to Xp. To induce sparsity, we set R(∆) = Pd i,j=1,i≤j |∆i,j| and fix λ = 0.0938. Then run DRE and TRimmed-DRE to learn the sparse differential precision matrix ∆and results are plotted on Figure 2a and 2b4 where the ground truth (the position i, j, ∆∗ i,j ̸= 0) is marked by red boxes. It can be seen that the outlier completely misleads DRE while TR-DRE performs reasonably well. We also run experiments with two different settings (d = 25, d = 36) and plot True Negative Rate (TNR) - True Positive Rate (TPR) curves. We fix ν in TR-DRE to 90% and compare the performance of DRE and TR-DRE using DRE without any outliers as gold standard (see Figure 2c). It can be seen that the added outlier makes the DRE fail completely while TR-DRE can almost reach the gold standard. It also shows the price we pay: TR-DRE does lose some power for discarding samples. However, the loss of performance is still acceptable. 6.2 Relative Novelty Detection from Images In the second experiment, we collect four images (see Figure 3a) containing three objects with a textured background: a pencil, an earphone and an earphone case. We create data points from these four images using sliding windows of 48 × 48 pixels (the green box on the lower right picture on Figure 3a). We extract 899 features using MATLAB HOG method on each window and construct an 899-dimensional sample. Although our theorems in Section 5 are proved for linear models, here f(x) is an RBF kernel using all samples in Xp as kernel basis. We pick the top left image as Xp and using all three other images as Xq, then run TR-DRE, THresholded-DRE [26], and one-SVM. In this task, we select high density ratio super pixels on image Xp. It can be expected that the super pixels containing the pencil will exhibit high density ratio values as they did not appear in the reference dataset Xq while super pixels containing the earphone case, the earphones and the background, repeats similar patches in Xq will have lower density ratio values. This is different from 3Code can be found at http://allmodelsarewrong.org/software.html 4Figures are best viewed in color. 8 (a) ˆ∆obtained by DRE, d = 20, with one outlier. (b) ˆ∆obtained by TR-DRE, ν = 90%, with one outlier. 0 0.2 0.4 0.6 0.8 1 TPR 0 0.2 0.4 0.6 0.8 1 TNR (c) TNR-TPR plot, ν = 90% Figure 2: Using DRE to learn changes between two MNs. We set R(·) = ∥·∥1 and f(xi, xj) = xixj. (a) Dataset (b) ν = 97% (c) ν = 90% (d) ν = 85% (e) TH-DRE (f) one-SVM Figure 3: Relative object detection using super pixels. We set R(·) = ∥· ∥2, f(x) is an RBF kernel. a conventional novelty detection, as a density ratio function help us capture only the relative novelty. For TR-DRE, we use the trimming threshold ˆt as the threshold for selecting high density ratio points. It can be seen on Figure 3b, 3c and 3d, as we tune ν to allow more and more high density ratio windows to be selected, more relative novelties are detected: First the pen, then the case, and finally the earphones, as the lack of appearance in the reference dataset Xq elevates the density ratio value by different degrees. In comparison, we run TH-DRE with top 3% highest density ratio values thresholded, which corresponds to ν = 97% in our method. The pattern of the thresholded windows (shaded in red) in Figure 3e is similar to Figure 3b though some parts of the case are mistakenly shaded. Finally, one-SVM with 3% support vectors (see Figure 3f) does not utilize the knowledge of a reference dataset Xq and labels all salient objects in Xp as they corresponds to the “outliers” in Xp. 7 Conclusion We presents a robust density ratio estimator based on the idea of trimmed MLE. It has a convex formulation and the optimization can be easily conducted using a subgradient ascent method. We also investigate its theoretical property through an equivalent weighted M-estimator whose ℓ2 estimation error bound was provable under two high-dimensional, robust settings. Experiments confirm the effectiveness and robustness of the our trimmed estimator. Acknowledgments We thank three anonymous reviewers for their detailed and helpful comments. Akiko Takeda thanks Grant-in-Aid for Scientific Research (C), 15K00031. Taiji Suzuki was partially supported by MEXT KAKENHI (25730013, 25120012, 26280009 and 15H05707), JST-PRESTO and JST-CREST. Song Liu and Kenji Fukumizu have been supported in part by MEXT Grant-in-Aid for Scientific Research on Innovative Areas (25120012). 9 References [1] F. Azmandian, J. G. Dy, J. A. Aslam, and D. R. Kaeli. Local kernel density ratio-based feature selection for outlier detection. In Proceedings of 8th Asian Conference on Machine Learning (ACML2012), JMLR Workshop and Conference Proceedings, pages 49–64, 2012. [2] S. Boyd. Subgradient methods. Technical report, Stanford University, 2014. Notes for EE364b, Stanford University, Spring 2013–14. [3] W. S. Cleveland. Robust locally weighted regression and smoothing scatterplots. Journal of the American Statistical Association, 74(368):829–836, 1979. [4] N. Cristianini and J. Shawe-Taylor. An Introduction to Support Vector Machines and Other Kernel-based Learning Methods. Cambridge University Press, 2000. [5] B. Efron and R. Tibshirani. Using specially designed exponential families for density estimation. The Annals of Statistics, 24(6):2431–2461, 1996. [6] F. Fazayeli and A. Banerjee. Generalized direct change estimation in ising model structure. In Proceedings of The 33rd International Conference on Machine Learning (ICML2016), page 2281–2290, 2016. [7] W. Fithian and S. Wager. Semiparametric exponential families for heavy-tailed data. Biometrika, 102(2):486–493, 2015. [8] K. Fokianos. Merging information for semiparametric density estimation. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 66(4):941–958, 2004. [9] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio. Generative adversarial nets. In Advances in neural information processing systems, pages 2672–2680, 2014. [10] A. S. Hadi and A. Luceno. Maximum trimmed likelihood estimators: a unified approach, examples, and algorithms. Computational Statistics & Data Analysis, 25(3):251 – 272, 1997. [11] J. Huang, A. Gretton, K. M Borgwardt, B. Schölkopf, and A. J Smola. Correcting sample selection bias by unlabeled data. In Advances in neural information processing systems, pages 601–608, 2007. [12] P. J. Huber. Robust estimation of a location parameter. The Annals of Mathematical Statistics, 35(1):73–101, 03 1964. [13] Y. Kawahara and M. Sugiyama. Sequential change-point detection based on direct density-ratio estimation. Statistical Analysis and Data Mining, 5(2):114–127, 2012. [14] S. Liu, T. Suzuki, R. Relator, J. Sese, M. Sugiyama, and K. Fukumizu. Support consistency of direct sparse-change learning in Markov networks. Annals of Statistics, 45(3):959–990, 06 2017. [15] P.-L. Loh and M. J. Wainwright. Regularized m-estimators with nonconvexity: Statistical and algorithmic theory for local optima. Journal of Machine Learning Research, 16:559–616, 2015. [16] A. Nedi´c and A. Ozdaglar. Subgradient methods for saddle-point problems. Journal of Optimization Theory and Applications, 142(1):205–228, 2009. [17] N. Neykov and P. N. Neytchev. Robust alternative of the maximum likelihood estimators. COMPSTAT’90, Short Communications, pages 99–100, 1990. [18] X. Nguyen, M. J. Wainwright, and M. I. Jordan. Estimating divergence functionals and the likelihood ratio by convex risk minimization. IEEE Transactions on Information Theory, 56(11):5847–5861, 2010. [19] S. Nowozin, B. Cseke, and R. Tomioka. f-gan: Training generative neural samplers using variational divergence minimization. In Advances in Neural Information Processing Systems, pages 271–279, 2016. 10 [20] E. J. G. Pitman. Sufficient statistics and intrinsic accuracy. Mathematical Proceedings of the Cambridge Philosophical Society, 32(4):567–579, 1936. [21] G. Raskutti, M. J. Wainwright, and B. Yu. Restricted eigenvalue properties for correlated gaussian designs. Journal of Machine Learning Research, 11:2241–2259, 2010. [22] M. Rudelson and S. Zhou. Reconstruction from anisotropic random measurements. IEEE Transactions on Information Theory, 59(6):3434–3447, 2013. [23] B. Scholkopf and A. J. Smola. Learning with kernels: support vector machines, regularization, optimization, and beyond. MIT press, 2001. [24] B. Schölkopf, R. C. Williamson, Smola A. J., Shawe-Taylor J., and Platt J.C. Support vector method for novelty detection. In Advances in Neural Information Processing Systems 12, pages 582–588. MIT Press, 2000. [25] A. Shimodaira. Improving predictive inference under covariate shift by weighting the loglikelihood function. Journal of Statistical Planning and Inference, 90(2):227 – 244, 2000. [26] A. Smola, L. Song, and C. H. Teo. Relative novelty detection. In Proceedings of the Twelth International Conference on Artificial Intelligence and Statistics (AISTATS), volume 5, pages 536–543, 2009. [27] M. Sugiyama, T. Suzuki, and T. Kanamori. Density Ratio Estimation in Machine Learning. Cambridge University Press, 2012. [28] M. Sugiyama, T. Suzuki, S. Nakajima, H. Kashima, P. von Bünau, and M. Kawanabe. Direct importance estimation for covariate shift adaptation. Annals of the Institute of Statistical Mathematics, 60(4):699–746, 2008. [29] J. A. K. Suykens, J. De Brabanter, L. Lukas, and J. Vandewalle. Weighted least squares support vector machines: robustness and sparse approximation. Neurocomputing, 48(1):85–105, 2002. [30] Y. Tsuboi, H. Kashima, S. Hido, S. Bickel, and M. Sugiyama. Direct density ratio estimation for large-scale covariate shift adaptation. Journal of Information Processing, 17:138–155, 2009. [31] D. L. Vandev and N. M. Neykov. About regression estimators with high breakdown point. Statistics: A Journal of Theoretical and Applied Statistics, 32(2):111–129, 1998. [32] M. Wornowizki and R. Fried. Two-sample homogeneity tests based on divergence measures. Computational Statistics, 31(1):291–313, 2016. [33] M. Yamada, T. Suzuki, T. Kanamori, H. Hachiya, and M. Sugiyama. Relative density-ratio estimation for robust distribution comparison. Neural Computation, 25(5):1324–1370, 2013. [34] E. Yang, A. Lozano, and A. Aravkin. High-dimensional trimmed estimators: A general framework for robust structured estimation. arXiv preprint arXiv:1605.08299, 2016. [35] E. Yang and A. C. Lozano. Robust gaussian graphical modeling with the trimmed graphical lasso. In Advances in Neural Information Processing Systems, pages 2602–2610, 2015. 11
2017
620
7,142
Adaptive Batch Size for Safe Policy Gradients Matteo Papini DEIB Politecnico di Milano, Italy matteo.papini@polimi.it Matteo Pirotta SequeL Team Inria Lille, France matteo.pirotta@inria.fr Marcello Restelli DEIB Politecnico di Milano, Italy marcello.restelli@polimi.it Abstract Policy gradient methods are among the best Reinforcement Learning (RL) techniques to solve complex control problems. In real-world RL applications, it is common to have a good initial policy whose performance needs to be improved and it may not be acceptable to try bad policies during the learning process. Although several methods for choosing the step size exist, research paid less attention to determine the batch size, that is the number of samples used to estimate the gradient direction for each update of the policy parameters. In this paper, we propose a set of methods to jointly optimize the step and the batch sizes that guarantee (with high probability) to improve the policy performance after each update. Besides providing theoretical guarantees, we show numerical simulations to analyse the behaviour of our methods. 1 Introduction In many real-world sequential decision-making problems (e.g., industrial robotics, natural resource management, smart grids), engineers have developed automatic control policies usually derived from modelling approaches. The performance of such policies strictly depends on the model accuracy that for some tasks (e.g., financial applications) may be quite poor. Furthermore, even when accurate models are available and good control policies are obtained, their performance may degrade over time due to the non-stationary dynamics of the problem, thus requiring human intervention to adjust the policy parameters (think about equipment wear in smart manufacturing). In such scenarios, Reinforcement Learning (RL) techniques represent an interesting solution to get an online optimization of the control policies and to hinder the performance loss caused by unpredictable environment changes, thus allowing to improve the autonomy of the control system. In the last years, several RL studies [1, 2, 3, 4, 5, 6, 7] have shown that policy-search methods can effectively be employed to solve complex control tasks (e.g., robotic ones) due to their capabilities to handle high-dimensional continuous problems, face uncertain and partial observations of the state, and incorporate prior knowledge about the problem by means of the definition of a proper policy model whose parameters need to be optimized (refer to [8, 9] for recent surveys). This last property is particularly appealing when the reinforcement learning algorithm needs to operate online in scenarios where bad exploratory policies may damage the system. A proper design of the policy model may allow excluding such policies. On the other hand, in order to speed up the learning process, most RL methods need to explore the policy space by executing policies that may be worse than the initial one. This is not acceptable in many relevant applications. Under this perspective, we are interested in developing RL methods that are (in high probability) monotonically improving. Inspired by the conservative policy iteration approach [10], recently, new advances have been done in the field of approximate policy iteration algorithms [11, 12], obtaining methods that can learn faster while still giving statistical guarantees of improvement after each policy update [13, 14]. These methods are usually referred to as conservative, monotonically improving, or safe (as we do in this paper). These ideas have been exploited also for deriving novel safe policy-search approaches [15, 16, 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. 17, 18, 19] that have obtained significant empirical results. In particular, policy-gradient methods are among the most commonly used RL techniques to solve complex high-dimensional tasks. Up to now, works on safe policy gradients [15, 16] have focused mainly on the choice of the step size, a parameter that significantly affects the speed and stability of gradient methods. By adopting small enough step sizes, one can limit oscillations and avoid worsening updates, but the consequent reduction of the learning rate is paid on the long term as a poor overall performance. On the other hand, as we will show in this paper, there is another parameter that plays an important role in the definition of safe policy gradient approaches: the batch size (i.e., the number of samples used to estimate the gradient). So far, the optimization of the batch size has not been considered in the RL literature. The batch size, besides conditioning the optimal step size, has a non-negligible impact on the speed of improvement when samples are trajectories performed on the actual system. In the present paper, we inquire the relationship between the step size and the batch size, showing an interesting duality. Focusing on Gaussian policies, we make a first attempt at developing practical methods aimed at achieving the best average performance in the long term, by jointly optimizing both meta-parameters. After providing some background in Section 2, in Section 3 we improve an existing adaptive step-size method [15]. Building on this result, in Section 4 we derive the main result on the batch size, proposing jointly adaptive methods. Finally, in Section 5 we empirically analyse the behaviour of the proposed methods on a simple simulated control task. 2 Preliminaries A discrete-time continuous Markov decision process (MDP) is a tuple ⟨S, A, P, R, γ, µ⟩, where S is the continuous state space, A is the continuous action space, P is a Markovian transition model where P(s′|s, a) defines the transition density between states s and s′ under action a, R : S ×A →[−R, R] is the reward function, such that R(s, a) is the expected immediate reward for the state-action pair (s, a) and R is the maximum absolute reward value, γ ∈[0, 1) is the discount factor for future rewards and µ is the initial state distribution. A policy is defined as a density distribution π(·|s) that, for each state s, specifies the density distribution over action space A. We consider infinite horizon problems where the future rewards are exponentially discounted with γ. For each state-action pair (s, a), the utility of taking action a in state s and then following a stationary policy π is defined as: Qπ(s, a) = R(s, a) + γ Z S P(s′|s, a) Z A π(a′|s′)Qπ(s′, a′)da′ds′. Policies can be ranked by their expected discounted reward starting from initial state distribution µ: Jπ µ = Z S µ(s) Z A π(a | s)Qπ(s, a)dads = Z S dπ µ(s) Z A π(a|s)R(s, a)dads, where dπ µ(s) = (1 −γ) P∞ t=0 γtPr(st = s|π, µ) is the γ-discounted future state distribution for a starting state distribution µ [2]. In the following, we will often refer to Jπ µ as the performance of policy π. Solving an MDP means finding a policy π∗maximizing Jπ µ . We consider the problem of finding a policy that maximizes the expected discounted reward over a class of parametrized policies Πθ = {πθ : θ ∈Rm}. A particular class of parametrized policies is the Gaussian policy model with standard deviation σ and mean linear in the state features φ(·): π(a|s, θ) = 1 √ 2πσ2 exp  −1 2 a −θT φ(s) σ !2 , which is a common choice for MDPs with continuous actions. The exact gradient of the expected discounted reward w.r.t. the policy parameters [2] is: ∇θJµ(θ) = 1 1 −γ Z S dπθ µ (s) Z A ∇θπ(a|s, θ)Qπθ(s, a)dads. In most commonly used policy gradient methods, the policy parameters are updated by following the direction of the gradient of the expected discounted reward: θ′ = θ + α∇θJµ(θ), where α ≥0 is a scalar step size. In the following we will denote with ∥∇θJµ(θ)∥p the Lp-norm of the policy gradient. 2 3 Non-Scalar Step Size for Gaussian Policies Before starting to optimize the batch size for the gradient estimation, in this section we extend the results in [15] to the case of a non-scalar step size, showing that, focusing on the Gaussian policy model, such extension guarantees a larger performance improvement than the one obtained in [15]. Furthermore, this result significantly simplifies the closed-form solutions obtained for the optimization of the batch size described in the following sections. In Section 3.1 we stick to the theoretical setting in which the gradient is known exactly, while in Section 3.2 we take into account the estimation error. 3.1 Exact Framework The idea is to have a separate adaptive step size αi for each component θi of θ. For notational convenience, we define a non-scalar step size as a diagonal matrix Λ = diag(α1, α2, . . . , αm) with αi ≥0 for i = 1, . . . , m. The policy parameters can be updated as: θ′ = θ + Λ∇θJµ(θ). Note that the direction of the update can differ from the gradient direction. Since the αi are nonnegative, the absolute angular difference is never more than π/2. The traditional scalar step-size update can be seen as a special case where Λ = αI. Assumption 3.1. State features are uniformly bounded: |φi(s)| ≤Mφ, ∀s ∈S, ∀i = 1, . . . , m. By adapting Theorem 4.3 in [15] to the new parameter update, we obtain a lower bound on the policy performance improvement: Lemma 3.2. For any initial state distribution µ and any pair of stationary Gaussian policies πθ ∼N(θT φ(s), σ2) and πθ′ ∼N(θ′T φ(s), σ2), so that θ′ = θ + Λ∇θJµ(θ), and under Assumption 3.1, the difference between the performance of πθ′ and the one of πθ can be bounded below as follows: Jµ(θ′) −Jµ(θ) ≥∇θJµ(θ)TΛ∇θJµ(θ) − ∥Λ∇θJµ(θ)∥2 1 M 2 φ (1 −γ)σ2  1 √ 2πσ Z S dπθ µ (s) Z A Qπθ (s, a)dads + γ ∥Qπθ ∥∞ 2(1 −γ)  , where ∥Qπθ∥∞is the supremum norm of the Q-function: ∥Qπθ∥∞= sup s∈S,a∈A Qπθ(s, a). The above bound requires us to compute the Q-function explicitly, but this is often not possible in real-world applications. We now consider a simplified (although less tight) version of the bound that does not have this requirement, which is an adaptation of Corollary 5.1 in [15]: Theorem 3.3. For any initial state distribution µ and any pair of stationary Gaussian policies πθ ∼N(θT φ(s), σ2) and πθ′ ∼N(θ′T φ(s), σ2), so that θ′ = θ + Λ∇θJµ(θ), and under Assumption 3.1, the difference between the performance of πθ′ and the one of πθ can be bounded below as follows: Jµ(θ′) −Jµ(θ) ≥∇θJµ(θ)TΛ∇θJµ(θ) −c ∥Λ∇θJµ(θ)∥2 1 , where c = RM 2 φ (1−γ)2σ2  |A| √ 2πσ + γ 2(1−γ)  and |A| is the volume of the action space. We then find the step size Λ∗that maximizes this lower bound under the natural constraint αi ≥0 ∀i = 1, . . . , m. The derivation is not trivial and is provided in Appendix A. Corollary 3.4. The lower bound of Theorem 3.3 is maximized by the following non-scalar step size: α∗ k =  1 2c if k = min {arg maxi |∇θiJµ(θ)|} , 0 otherwise, which guarantees the following performance improvement: Jµ(θ′) −Jµ(θ) ≥∥∇θJµ(θ)∥2 ∞ 4c . Note that update induced by the obtained Λ∗corresponds to employing a constant, scalar step size to update just the parameter corresponding to the largest absolute gradient component. This method is known in the literature as greedy coordinate descent. Convergence of this algorithm to a local 3 optimum is guaranteed for small step sizes, as shown in [20]. Note also that the way in which the index is selected in case of multiple maxima (here min) is arbitrary, see the proof of Corollary 3.4 for details. We now propose an intuitive explanation of our result: the employed performance lower bound ultimately derives from Corollary 3.6 in [13]. From the original bound, one can easily see that the positive part accounts to the average advantage of the new policy over the old one, while the negative part penalizes large parameter updates, which may result in overshooting. Updating just the parameter corresponding to the larger policy gradient component represents an intuitive trade-off between these two objectives. We now show that this result represents an improvement w.r.t. the adaptive scalar step size proposed in [15] for the current setting: Corollary 3.5. Under identical hypotheses, the performance improvement guaranteed by Corollary 3.4 is never less than the one guaranteed by Corollary 5.1 in [15], i.e.: ∥∇θJµ(θ)∥2 ∞ 4c ≥ ∥∇θJµ(θ)∥4 2 4c ∥∇θJµ(θ)∥2 1 . This corollary derives from the trivial norm inequality ∥∇θJµ(θ)∥∞∥∇θJµ(θ)∥1 ≥∥∇θJµ(θ)∥2 2. 3.2 Approximate Framework We now turn to the more realistic case in which the policy gradient, ∇θJµ(θ), is not known, and has to be estimated from a finite number of trajectory samples. A performance improvement can still be guaranteed with high probability. To adapt the result of Theorem 3.3 to the stochastic gradient case, we need both a lower bound on the policy gradient estimate ˆ∇θJµ(θ): ˆ∇θJµ(θ) = max(| ˆ∇θJµ(θ)| −ϵ, 0) (where the maximum is component-wise) and an upper bound: ˆ∇θJµ(θ) = | ˆ∇θJµ(θ)| + ϵ where ϵ = [ϵ1, . . . , ϵm], and ϵi is an upper bound on the approximation error of ∇θiJµ(θ) with probability at least 1 −δ. We can now state the following: Theorem 3.6. Under the same assumptions of Theorem 3.3, and provided that a policy gradient estimate ˆ∇θJµ(θ) is available, so that P(|∇θiJµ(θ) −ˆ∇θiJµ(θ)| ≥ϵi) ≤δ, ∀i = 1, . . . , m, the difference between the performance of πθ′ and the one of πθ can be bounded below with probability at least (1 −δ)m as follows: Jµ(θ′) −Jµ(θ) ≥ˆ∇θJµ(θ) TΛ ˆ∇θJµ(θ) −c Λ ˆ∇θJµ(θ) 2 1 , where c is defined as in Theorem 3.3. To derive the optimal step size, we first restrict our analysis to the case in which ϵ1 = ϵ2 = . . . = ϵm ≜ϵ. We call this common estimation error ϵ. This comes naturally in the following section, where we use concentration bounds to give an expression for ϵ. However, it is always possible to define a common error by ϵ = maxi ϵi. We then need the following assumption: Assumption 3.7. At least one component of the policy gradient estimate is, in absolute value, no less than the approximation error: ˆ∇θJµ(θ) ∞≥ϵ. The violation of the above assumption can be used as a stopping condition since it prevents to guarantee any performance improvement. We can now state the following (the derivation is similar to the one of Corollary 3.5 and is, again, left to Appendix A): Corollary 3.8. The performance lower bound of Theorem 3.6 is maximized under Assumption 3.7 by the following non-scalar step size: α∗ k =    (∥ˆ∇θJµ(θ)∥∞−ϵ) 2 2c(∥ˆ∇θJµ(θ)∥∞+ϵ) 2 if k = min n arg maxi | ˆ∇θiJµ(θ)| o , 0 otherwise, 4 which guarantees with probability (1 −δ)m a performance improvement Jµ(θ′) −Jµ(θ) ≥  ˆ∇θJµ(θ) ∞−ϵ 4 4c  ˆ∇θJµ(θ) ∞+ ϵ 2 . 4 Adaptive Batch Size In this section we jointly optimize the step size for parameter updates and the batch size for policy gradient estimation, taking into consideration the cost of collecting sample trajectories. We call N the batch size, i.e., the number of trajectories sampled to compute the policy gradient estimate ˆ∇θJµ(θ) at each parameter update. We define the following cost-sensitive performance improvement measure: Definition 4.1. Cost-sensitive performance improvement measure Υδ is defined as: Υδ(Λ, N) := Bδ(Λ, N) N , where Bδ is the high probability lower bound on performance improvement given in Theorem 3.6. The rationale behind this choice of performance measure is to maximize the performance improvement per sample trajectory. Using larger batch sizes leads to more accurate policy updates, but the gained performance improvement is spread over a larger number of trials. This is particularly relevant in real-world online applications, where the collection of more samples with a sub-optimal policy affects the overall performance and must be justified by a greater improvement in the learned policy. By defining Υδ in this way, we can control the improvement provided, on average, by each collected sample. We now show how to jointly select the step size Λ and the batch size N so as to maximize Υδ. Notice that the dependence of Bδ on N is entirely through ϵ, whose expression depends on which concentration bound is considered. We first restrict our analysis to concentration bounds that allow to express ϵ as follows: Assumption 4.1. The per-component policy gradient estimation error made by averaging over N sample trajectories can be bounded with probability at least 1 −δ by: ϵ(N) = dδ √ N , where dδ is a constant w.r.t. N. This class of inequalities includes well-known concentration bounds such as Chebyshev’s and Hoeffding’s. Under Assumption 4.1 Υδ can be optimized in closed form: Theorem 4.2. Under the hypotheses of Theorem 3.3 and Assumption 4.1, the cost-sensitive performance improvement measure Υδ, as defined in Definition 4.1, is maximized by the following step size and batch size: α∗ k = ( (13−3 √ 17) 4c if k = min n arg maxi | ˆ∇θiJµ(θ)| o , 0 otherwise, N ∗=   (13 + 3 √ 17)d2 δ 2 ˆ∇θJµ(θ) 2 ∞   , where c = RM 2 φ (1−γ)2σ2  |A| √ 2πσ + γ 2(1−γ)  . This choice guarantees with probability (1 −δ)m a performance improvement of: Jµ(θ′) −Jµ(θ) ≥393 −95 √ 17 8 ˆ∇θJµ(θ) 2 ∞≥0.16 ˆ∇θJµ(θ) 2 ∞. Notice that, under Assumption 4.1, Assumption 3.7 can be restated as N ≥ d2 δ ∥ˆ∇θJµ(θ)∥ 2 ∞ , which is always verified by the proposed N ∗. This means that the adaptive batch size never allows an estimation error larger than the gradient estimate. Another peculiarity of this result is that the step size is constant, in the sense that its value does not depend on the gradient estimate. This can be 5 explained in terms of a duality between step size and batch size: in other conservative adaptive-step size approaches, such as the one proposed with Theorem 4.2, the step size is kept small to counteract policy updates that are too off due to bad gradient estimates. When also the batch size is made adaptive, a sufficient number of sample trajectories can be taken to keep the policy update on track even with a constant-valued step size. Note that, in this formulation, the batch size selection process is always one step behind the gradient estimation. A possible synchronous implementation is to update N ∗each time a trajectory is performed, using all the data collected since the last learning step. As soon as the number of trajectories performed in the current learning iteration is larger than or equal to N ∗, a new learning step is performed. We now consider some concentration bounds in more detail: we provide the values for dδ, while the full expressions for N ∗can be found in Appendix B. 4.1 Chebyshev’s Bound By using the sample mean version of Chebyshev’s bound we obtain: dδ = s V ar[ ˜∇θiJµ(θ)] δ , where ˜∇θiJµ(θ) is the policy gradient approximator (from a single sample trajectory). The main advantage of this bound is that it does not make any assumption on the range of the gradient sample. The variance of the sample can be upper bounded in the case of the REINFORCE [1] and the G(PO)MDP [3]/PGT [2] gradient estimators by using results from [21], already adapted for similar purposes in [15]. The G(PO)MDP/PGT estimator suffers from a smaller variance if compared with REINFORCE, and the variance bound is indeed tighter. 4.2 Hoeffding’s Bound By using Hoeffding’s bound we obtain: dδ = R r log 2/δ 2 , where R is the range of the gradient approximator, i.e., |supp( ˜∇θiJµ(θ))|. For the class of policies we are considering, i.e., Gaussian with mean linear in the features, under some assumptions, the range can be upper bounded as follows: Lemma 4.3. For any Gaussian policy πθ ∼N(θT φ(s), σ2), assuming that the action space is bounded (∀a ∈A, |a| ≤A) and the policy gradient is estimated on trajectories of length H, the range R of the policy gradient sample ˜∇θiJµ(θ) can be upper bounded ∀i = 1, . . . , m and ∀θ by R ≤2HMφAR σ2(1 −γ) . As we will show in Section 5, a more practical solution (even if less rigorous) consists in computing the range as the difference between the largest and the smallest gradient sample seen during learning. 4.3 Empirical Bernstein’s Bound Tighter concentration bounds allow for smaller batch sizes (which result in more frequent policy updates) and larger step sizes, thus speeding up the learning process and improving long-time average performance. An empirical Bernstein bound from [22] allows to use sample variance instead of the variance bounds from [21] and to limit the impact of the gradient range. On the other hand, this bound does not satisfy Assumption 4.1, giving for the estimation error the following, more complex, expression: ϵ(N) = dδ √ N + fδ N , where dδ = p 2SN ln 3/δ, f = 3R ln 3/δ, 6 and SN is the sample variance of the gradient approximator. No reasonably simple closed-form solution is available in this case, requiring a linear search of the batch size N ∗maximizing Υδ. By adapting Assumption 3.7 to this case, a starting point for this search can be provided: N ≥     dδ + r d2 δ + 4fδ ˆ∇θJµ(θ) ∞ 2 ˆ∇θJµ(θ) ∞     2 , We also know that there is a unique maximum in [N0, +∞) (see Appendix A for more details) and that Υδ goes to 0 as N goes to infinity. Hence, to find the optimal batch size, it is enough to start from N0 and stop as soon as the value of the cost function Υ(Λ∗, N) begins to decrease. Furthermore, the optimal step size is no longer constant: it can be computed with the expression given in Corollary 3.8 by setting ϵ := ϵ(N ∗). As for the Hoeffding’s bound, the range R can be upper bounded exactly or estimated from samples. Table 1: Improvement rate of the policy updates for different policy standard deviation σ, fixed batch size N and fixed step size α, using the G(PO)MDP gradient estimator. σ = 0.5 σ = 1 N = 10000 N = 1000 N = 100 N = 10000 N = 1000 N = 100 1e-3 95.96% 52.85% 49.79% 24.24% 37.4% 50.4% α 1e-4 100% 73.27% 51.41% 100% 27.03% 46.08% 1e-5 98.99% 81.88% 55.69% 100% 99.9% 39.04% 1e-6 100% 83.88% 58.44% 100% 100% 86.04% Table 2: Average performance for different gradient estimators, statistical bounds and values of δ. All results are averaged over 5 runs (95% confidence intervals are reported). Estimator Bound δ Υ Confidence interval REINFORCE Chebyshev 0.95 -11.3266 [-11.3277; -11.3256] REINFORCE Chebyshev 0.75 -11.4303 [-11.4308; -11.4297] REINFORCE Chebyshev 0.5 -11.5947 [-11.5958; -11.5937] G(PO)MDP Chebyshev 0.95 -10.6085 [-10.6087; -10.6083] G(PO)MDP Chebyshev 0.75 -10.7141 [-10.7145; -10.7136] G(PO)MDP Chebyshev 0.5 -10.9036 [-10.904; -10.9031] G(PO)MDP Chebyshev 0.25 -11.2355 [-11.2363; -11.2346] G(PO)MDP Chebyshev 0.05 -11.836 [-11.8368; -11.8352] G(PO)MDP Hoeffding 0.95 -11.914 [-11.9143; -11.9136] G(PO)MDP Bernstein 0.95 -10.2159 [-10.2162; -10.2155] G(PO)MDP Hoeffding (empirical range) 0.95 -9.8582 [-9.8589; -9.8574] G(PO)MDP Bernstein (empirical range) 0.95 -9.6623 [-9.6619; -9.6627] 5 Numerical Simulations In this section, we test the proposed methods on the linear-quadratic Gaussian regulation (LQG) problem [23]. The LQG problem is defined by transition model st+1 ∼N(st + at, σ2 0), Gaussian policy at ∼N(θ · s, σ2) and reward rt = −0.5(s2 t + a2 t). In all our simulations we use σ0 = 0, since all the noise can be modelled on the agent’s side without loss of generality. Both action and state variables are bounded to the interval [−2, 2] and the initial state is drawn uniformly at random. We use this task as a testing ground because it is simple, all the constants involved in our bounds can be computed exactly, and the true optimal parameter θ∗is available as a reference. We use a discount factor γ = 0.9, which gives an optimal parameter θ∗≈−0.59, corresponding to expected performance J(θ∗) ≈−13.21. Coherently with the framework described in Section 1, we are interested both in the convergence speed and in the ratio of policy updates that does not result in a 7 worsening of the expected performance, which we will call improvement ratio. First of all, we want to analyze how the choice of fixed step sizes and batch sizes may affect the improvement ratio and how much it depends on the variability of the trajectories (that in this case is due to the variance of the policy). Table 1 shows the improvement ratio for two parameterizations (σ = 0.5 and σ = 1) when various constant step sizes and batch sizes are used, starting from θ = −0.55 and stopping after a total of one million trajectories. As expected, small batch sizes combined with large step sizes lead to low improvement ratios. However, the effect is non-trivial and problem-dependent, justifying the need for an adaptive method. We then proceed to test the methods described in Section 4. In the following simulations, we use σ = 1 and start from θ = 0, stopping after a total of 30 million trajectories. Figure 1 shows the expected performance over sample trajectories for both the REINFORCE and G(PO)MDP gradient estimators, using Chebyshev’s bound with different values of δ. Expected performance is computed for each parameter update. Data are then scaled to account for the different batch sizes. In general, REINFORCE performs worse than G(PO)MDP due to its larger variance (in both cases the proper optimal baseline from [23] was used), and larger values of δ (the probability with which worsening updates are allowed to take place) lead to better performance. Notice that an improvement ratio of 1 is achieved also with large values of δ. This is due to the fact that the bounds used in the development of our method are not tight. Being the method this conservative, in practical applications δ can be set to a high value to improve the convergence rate. Another common practice in empirical applications is to shrink confidence intervals through a scalar multiplicative factor. However, in this work we chose to not exploit this trick. Figure 2 compares the performance of the different concentration bounds described in the previous section, using always G(PO)MDP to estimate the gradient and δ = 0.95. As expected, Bernstein’s bound performs better than Chebyshev’s, especially in the empirical range version. The rigorous version of Hoeffding’s bound performs very poorly, while the one using the empirical range is almost as good as the corresponding Bernstein method. This is due to the fact that the bound on the gradient estimate range is very loose, since it accounts also for unrealistic combinations of state, action and reward. Finally, to better capture the performance of the different variants of the algorithm in a real-time scenario, we define a metric Υ, which is obtained by averaging the real performance (measured during learning) over all the trajectories, coherently with the cost function used to derive the optimal batch size. The results are reported in Table 2. In Appendix C we also show how the adaptive batch size evolves as the policy approaches the optimum. 6 Conclusions We showed the relationship between the batch size and the step size in policy gradient approaches under Gaussian policies, and how their joint optimization can lead to parameters updates that guarantee with high probability a fixed improvement in the policy performance. In addition to the formal analysis, we proposed practical methods to compute the information required by the algorithms. Finally, we have proposed a preliminary evaluation on a simple control task. Future work should focus on developing more practical methods. It would also be interesting to investigate the extension of the proposed methodology to other classes of policies. Acknowledgments This research was supported in part by French Ministry of Higher Education and Research, Nord-Pasde-Calais Regional Council and French National Research Agency (ANR) under project ExTra-Learn (n.ANR-14-CE24-0010-01). References [1] Ronald J. Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine Learning, 8(3):229–256, 1992. [2] Richard S Sutton, David A. McAllester, Satinder P. Singh, and Yishay Mansour. Policy gradient methods for reinforcement learning with function approximation. In Advances in Neural Information Processing Systems 12, pages 1057–1063. MIT Press, 2000. [3] Jonathan Baxter and Peter L. Bartlett. Infinite-horizon policy-gradient estimation. Journal of Artificial Intelligence Research, 15:319–350, 2001. 8 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 2.2 2.4 2.6 2.8 3 ·107 −55 −50 −45 −40 −35 −30 −25 −20 −15 Number of Trajectories Expected Performance G(PO)MDP δ=0.95 G(PO)MDP δ=0.75 G(PO)MDP δ=0.5 G(PO)MDP δ=0.25 G(PO)MDP δ=0.05 REINFORCE δ=0.95 REINFORCE δ=0.75 REINFORCE δ=0.5 Figure 1: Expected performance over sample trajectories using G(PO)MDP and REINFORCE (dashed) gradient estimators and Chebyshev bound, for different values of δ. All results are averaged over 5 runs. 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 2.2 2.4 2.6 2.8 3 ·107 −50 −40 −30 −20 −10 Number of Trajectories Expected Performance Bernstein (empirical range) Hoeffding (empirical range) Bernstein Chebyshev Hoeffding Figure 2: Comparison of the performance of different statistical bounds, using the G(PO)MDP gradient estimator and δ = 0.95. All results are averaged over 5 runs. [4] Frank Sehnke, Christian Osendorfer, Thomas Rückstieß, Alex Graves, Jan Peters, and Jürgen Schmidhuber. Policy gradients with parameter-based exploration for control. In Artificial Neural Networks - ICANN 2008, pages 387–396. Springer Berlin Heidelberg, 2008. [5] Jens Kober and Jan Peters. Policy search for motor primitives in robotics. In Advances in Neural Information Processing Systems 21, volume 21, pages 849–856, 2008. [6] Jan Peters and Stefan Schaal. Natural actor-critic. Neurocomputing, 71(7-9):1180–1190, 2008. [7] Jan Peters, Katharina Mülling, and Yasemin Altun. Relative entropy policy search. In AAAI Conference on Artificial Intelligence 24. AAAI Press, 2010. [8] Ivo Grondman, Lucian Busoniu, Gabriel AD Lopes, and Robert Babuska. A survey of actor-critic reinforcement learning: Standard and natural policy gradients. Systems, Man, and Cybernetics, Part C: Applications and Reviews, IEEE Transactions on, 42(6):1291–1307, 2012. [9] Marc Peter Deisenroth, Gerhard Neumann, Jan Peters, et al. A survey on policy search for robotics. Foundations and Trends in Robotics, 2(1-2):1–142, 2013. [10] Sham Kakade and John Langford. Approximately optimal approximate reinforcement learning. In International Conference on Machine Learning 19, pages 267–274. Morgan Kaufmann, 2002. [11] Dimitri P Bertsekas. Approximate policy iteration: A survey and some new methods. Journal of Control Theory and Applications, 9(3):310–335, 2011. 9 [12] Bruno Scherrer. Approximate policy iteration schemes: A comparison. In International Conference on Machine Learning 31, volume 32 of JMLR Workshop and Conference Proceedings, pages 1314–1322. JMLR.org, 2014. [13] Matteo Pirotta, Marcello Restelli, Alessio Pecorino, and Daniele Calandriello. Safe policy iteration. In International Conference on Machine Learning 30, volume 28 of JMLR Workshop and Conference Proceedings, pages 307–315. JMLR.org, 2013. [14] Yasin Abbasi-Yadkori, Peter L Bartlett, and Stephen J Wright. A fast and reliable policy improvement algorithm. In Proceedings of the 19th International Conference on Artificial Intelligence and Statistics, pages 1338–1346, 2016. [15] Matteo Pirotta, Marcello Restelli, and Luca Bascetta. Adaptive step-size for policy gradient methods. In Advances in Neural Information Processing Systems 26, pages 1394–1402. Curran Associates, Inc., 2013. [16] Matteo Pirotta, Marcello Restelli, and Luca Bascetta. Policy gradient in lipschitz markov decision processes. Machine Learning, 100(2-3):255–283, 2015. [17] John Schulman, Sergey Levine, Pieter Abbeel, Michael I. Jordan, and Philipp Moritz. Trust region policy optimization. In International Conference on Machine Learning 32, volume 37 of JMLR Workshop and Conference Proceedings, pages 1889–1897. JMLR.org, 2015. [18] Philip Thomas, Georgios Theocharous, and Mohammad Ghavamzadeh. High confidence policy improvement. In International Conference on Machine Learning 32, volume 37 of JMLR Workshop and Conference Proceedings, pages 2380–2388. JMLR.org, 2015. [19] Mohammad Ghavamzadeh, Marek Petrik, and Yinlam Chow. Safe policy improvement by minimizing robust baseline regret. pages 2298–2306, 2016. [20] Julie Nutini, Mark W. Schmidt, Issam H. Laradji, Michael P. Friedlander, and Hoyt A. Koepke. Coordinate descent converges faster with the gauss-southwell rule than random selection. In International Conference on Machine Learning 32, volume 37 of JMLR Workshop and Conference Proceedings, pages 1632–1641. JMLR.org, 2015. [21] Tingting Zhao, Hirotaka Hachiya, Gang Niu, and Masashi Sugiyama. Analysis and improvement of policy gradient estimation. Neural Networks, 26:118–129, 2012. [22] Volodymyr Mnih, Csaba Szepesvári, and Jean-Yves Audibert. Empirical bernstein stopping. In International Conference on Machine Learning 25, volume 307 of ACM International Conference Proceeding Series, pages 672–679. ACM, 2008. [23] J. Peters and S. Schaal. Reinforcement learning of motor skills with policy gradients. Neural Networks, 21(4):682–697, May 2008. [24] M. S. Pinsker. Information and Information Stability of Random Variables and Processes. Izv. Akad. Nauk, Moskva, 1960. 10
2017
621
7,143
Beyond normality: Learning sparse probabilistic graphical models in the non-Gaussian setting Rebecca E. Morrison MIT rmorriso@mit.edu Ricardo Baptista MIT rsb@mit.edu Youssef Marzouk MIT ymarz@mit.edu Abstract We present an algorithm to identify sparse dependence structure in continuous and non-Gaussian probability distributions, given a corresponding set of data. The conditional independence structure of an arbitrary distribution can be represented as an undirected graph (or Markov random field), but most algorithms for learning this structure are restricted to the discrete or Gaussian cases. Our new approach allows for more realistic and accurate descriptions of the distribution in question, and in turn better estimates of its sparse Markov structure. Sparsity in the graph is of interest as it can accelerate inference, improve sampling methods, and reveal important dependencies between variables. The algorithm relies on exploiting the connection between the sparsity of the graph and the sparsity of transport maps, which deterministically couple one probability measure to another. 1 Undirected probabilistic graphical models Given n samples from the joint probability distribution of some random variables X1, . . . , Xp, a common goal is to discover the underlying Markov random field. This field is specified by an undirected graph G, comprising the set of vertices V = {1, . . . , p} and the set of edges E. The edge set E encodes the conditional independence structure of the distribution, i.e., ejk /∈E ⇐⇒Xj ⊥⊥ Xk | XV \{jk}. Finding the edges of the graph is useful for several reasons: knowledge of conditional independence relations can accelerate inference and improve sampling methods, as well as illuminate structure underlying the process that generated the data samples. This problem—identifying an undirected graph given samples—is quite well studied for Gaussian or discrete distributions. In the Gaussian setting, the inverse covariance, or precision, matrix precisely encodes the sparsity of the graph. That is, a zero appears in the jk-th entry of the precision if and only if variables Xj and Xk are conditionally independent given the rest. Estimation of the support of the precision matrix is often achieved using a maximum likelihood estimate with ℓ1 penalties. Coordinate descent (glasso) [4] and neighborhood selection [14] algorithms can be consistent for sparse recovery with few samples, i.e., p > n. In the discrete setting, [12] showed that for some particular graph structure, the support of a generalized covariance matrix encodes the conditional independence structure of the graph, while [21] employed sparse ℓ1-penalized logistic regression to identify Ising Markov random fields. Many physical processes, however, generate data that are continuous but non-Gaussian. One example is satellite images of cloud cover formation, which may greatly impact weather conditions and climate [25, 20]. Other examples include biological processes such as bacteria growth [5], heartbeat behavior [19], and transport in biological tissues [9]. Normality assumptions about the data may prevent the detection of important conditional dependencies. Some approaches have allowed for non-Gaussianity, such as the nonparanormal approach of [11, 10], which uses copula functions to estimate a joint non-Gaussian density while preserving conditional independence. However, this approach is still restricted by the choice of copula function, and as far as we know, no fully general approach is yet available. Our goal in this work is to consistently estimate graph structure when 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. the underlying data-generating process is non-Gaussian. To do so, we propose the algorithm SING (Sparsity Identification in Non-Gaussian distributions). SING uses the framework of transport maps to characterize arbitrary continuous distributions, as described in §3. Our representations of transport maps employ polynomial expansions of degree β. Setting β = 1 (i.e., linear maps) is equivalent to assuming that the data are well approximated by a multivariate Gaussian. With β > 1, SING acts as a generalization of Gaussian-based algorithms by allowing for arbitrarily rich parameterizations of the underlying data-generating distribution, without additional assumptions on its structure or class. 2 Learning conditional independence Let X1, . . . , Xp have a smooth and strictly positive density π on Rp. A recent result in [26] shows that conditional independence of the random variables Xj and Xk can be determined as follows: Xj ⊥⊥Xk | XV \{jk} ⇐⇒∂jk log π(x) = 0, ∀x ∈Rp, (1) where ∂jk(·) denotes the jk-th mixed partial derivative. Here, we define the generalized precision as the matrix Ω, where Ωjk = Eπ [|∂jk log π(x)|]. Note that Ωjk = 0 is a sufficient condition that variables Xj and Xk be conditionally independent. Thus, finding the zeros in the matrix Ωis equivalent to finding the graphical structure underlying the density π. Note that the zeros of the precision matrix in a Gaussian setting encode the same information—the lack of an edge—as the zeros in the generalized precision introduced here. Our approach identifies the zeros of Ωand thus the edge set E in an iterative fashion via the algorithm SING, outlined in §4. Note that computation of an entry of the generalized precision relies on an expression for the density π. We represent π and also estimate Ωusing the notion of a transport map between probability distributions. This map is estimated from independent samples x(i) ∼π, i = 1, . . . , n, as described in §3. Using a map, of the particular form described below, offers several advantages: (1) computing the generalized precision given the map is efficient (e.g., the result of a convex optimization problem); (2) the transport map itself enjoys a notion of sparsity that directly relates to the Markov structure of the data-generating distribution; (3) a coarse map may capture these Markov properties without perfectly estimating the high-dimensional density π. Let us first summarize our objective and proposed approach. We aim to solve the following graph recovery problem: Given samples {x(i)}n i=1 from some unknown distribution, find the dependence graph of this distribution and the associated Markov properties. Our proposed approach loosely follows these steps: • Estimate a transport map from samples • Given an estimate of the map, compute the generalized precision Ω • Threshold Ωto identify a (sparse) graph • Given a candidate graphical structure, re-estimate the map. Iterate... The final step—re-estimating the map, given a candidate graphical structure—makes use of a strong connection between the sparsity of the graph and the sparsity of the transport map (as shown by [26] and described in §3.2). Sparsity in the graph allows for sparsity in the map, and a sparser map allows for improved estimates of Ω. This is the motivation behind an iterative algorithm. 3 Transport maps The first step of SING is to estimate a transport map from samples [13]. A transport map induces a deterministic coupling of two probability distributions [22, 15, 18, 26]. Here, we build a map between the distribution generating the samples (i.e., X ∼π) and a standard normal distribution η = N(0, Ip). As described in [28, 2], given two distributions with smooth and strictly positive densities (π, η),1 there exists a monotone map S : Rp →Rp such that S♯π = η and S♯η = π, where S♯π(y) = π ◦S−1(y) det ∇S−1(y)  (2) S♯η(x) = η ◦S(x) det (∇S(x)) . (3) 1Regularity assumptions on π, η can be substantially relaxed, though (2) and (3) may need modification [2]. 2 We say η is the pushforward density of π by the map S, and similarly, π is the pullback of η by S. Many possible transport maps satisfy the measure transformation conditions above. In this work, we restrict our attention to lower triangular monotone increasing maps. [22, 7, 2] show that, under the conditions above, there exists a unique lower triangular map S of the form S(x) =   S1(x1) S2(x1, x2) S3(x1, x2, x3) ... Sp(x1, . . . . . . , xp)   , with ∂kSk > 0. The qualifier “lower triangular” refers to the property that each component of the map Sk only depends on variables x1, . . . , xk. The space of such maps is denoted S∆. As an example, consider a normal random variable: X ∼N(0, Σ). Taking the Cholesky decomposition of the covariance KKT = Σ, then K−1 is a linear operator that maps (in distribution) X to a random variable Y ∼N(0, Ip), and similarly, K maps Y to X. In this example, we associate the map K−1 with S, since it maps the more exotic distribution to the standard normal: S(X) = K−1X d= Y , S−1(Y ) = KY d= X. In general, however, the map S may be nonlinear. This is exactly what allows us to represent and capture arbitrary non-Gaussianity in the samples. The monotonicity of each component of the map (that is, ∂kSk > 0) can be enforced by using the following parameterization: Sk(x1, . . . , xk) = ck(x1, . . . , xk−1) + Z xk 0 exp {hk (x1, . . . , xk−1, t)}dt, with functions ck : Rk−1 →R and hk : Rk →R. Next, a particular form for ck and hk is specified; in this work, we use a linear expansion with Hermite polynomials for ck and Hermite functions for hk. An important choice is the maximum degree β of the polynomials. With higher degree, the computational difficulty of the algorithm increases by requiring the estimation of more coefficients in the expansion. This trade-off between higher degree (which captures more possible nonlinearity) and computational expense is a topic of current research [1]. The space of lower triangular maps, parameterized in this way, is denoted Sβ ∆. Computations in the transport map framework are performed using the software TransportMaps [27]. 3.1 Optimization of map coefficients is an MLE problem Let α ∈Rnα be the vector of coefficients that parameterize the functions ck and hk, which in turn define a particular instantiation of the transport map Sα ∈Sβ ∆. (We include the subscript in this subsection to emphasize that the map depends on its particular parameterization, but later drop it for notational efficiency.) To complete the estimation of Sα, it remains to optimize for the coefficients α. This optimization is achieved by minimizing the Kullback-Leibler divergence between the density in question, π, and the pullback of the standard normal η by the map Sα [27]: α∗= argmin α DKL π||S♯ αη  (4) = argmin α Eπ log π −log S♯ αη  (5) ≈argmax α 1 n n X i=1 log  S♯ αη  x(i) = ˆα. (6) As shown in [13, 17], for standard Gaussian η and lower triangular S, this optimization problem is convex and separable across dimensions 1, . . . , p. Moreover, by line (6), the solution to the optimization problem is a maximum likelihood estimate ˆα. Given that the n samples are random, ˆα converges in distribution as n →∞to a normal random variable whose mean is the exact minimizer α∗, and whose variance is I−1(α∗)/n, where I(α) is the Fisher information matrix. That is: ˆα ∼N  α∗, 1 nI−1(α∗)  , as n →∞. (7) 3 2 1 3 4 5 (a) 2 1 4 5 3 (b) Figure 1: (a) A sparse graph with an optimal ordering; (b) Suboptimal ordering induces extra edges. Optimizing for the map coefficients yields a representation of the density π as S♯ αη. Thus, it is now possible to compute the conditional independence scores with the generalized precision: Ωjk = Eπ [|∂jk log π(x)|] = Eπ  ∂jk log S♯ αη(x)  (8) ≈1 n n X i=1 ∂jk log S♯ αη  x(i) = ˆΩjk. (9) The next step is to threshold ˆΩ. First, however, we explain the connection between the two notions of sparsity—one of the graph and the other of the map. 3.2 Sparsity and ordering of the transport map Because the transport maps are lower triangular, they are in some sense already sparse. However, it may be possible to prescribe more sparsity in the form of the map. [26] showed that the Markov structure associated with the density π yields tight lower bounds on the sparsity pattern IS, where the latter is defined as the set of all pairs (j, k), j < k, such that the kth component of the map does not depend on the jth variable: IS := {(j, k) : j < k, ∂jSk = 0}. The variables associated with the complement of this set are called active. Moreover, these sparsity bounds can be identified by simple graph operations; see §5 in [26] for details. Essentially these operations amount to identifying the intermediate graphs produced by the variable elimination algorithm, but they do not involve actually performing variable elimination or marginalization. The process starts with node p, creates a clique between all its neighbors, and then “removes” it. The process continues in the same way with nodes p −1, p −2, and so on until node 1. The edges in the resulting (induced) graph determine the sparsity pattern of the map IS. In general, the induced graph will be more highly connected unless the original graph is chordal. Since the set of added edges, or fill-in, depends on the ordering of the nodes, it is beneficial to identify an ordering that minimizes it. For example, consider the graph in Figure 1a. The corresponding map has a nontrivial sparsity pattern, and is thus more sparse than a dense lower triangular map: S(x) =   S1(x1) S2(x1, x2) S3(x1, x2, x3) S4( x3, x4) S5( x4, x5)  , IS = {(1, 4), (2, 4), (1, 5), (2, 5), (3, 5)}. (10) Now consider Figure 1b. Because of the suboptimal ordering, edges must be added to the induced graph, shown in dashed lines. The resulting map is then less sparse than in 1a: IS = {(1, 5), (2, 5)}. An ordering of the variables is equivalent to a permutation ϕ, but the problem of finding an optimal permutation is NP-hard, and so we turn to heuristics. Possible schemes include so-called min-degree and min-fill [8]. Another that we have found to be successful in practice is reverse Cholesky, i.e., the reverse of a good ordering for sparse Cholesky factorization [24]. We use this in the examples below. The critical point here is that sparsity in the graph implies sparsity in the map. The space of maps that respect this sparsity pattern is denoted Sβ I . A sparser map can be described by fewer coefficients α, which in turn decreases their total variance when found via MLE. This improves the subsequent estimate of Ω. Numerical results supporting this claim are shown in Figure 2 for a Gaussian grid graph, p = 16. The plots show three levels of sparsity: “under,” corresponding to a dense lower 4 triangular map; “exact,” in which the map includes only the necessary active variables; and “over,” corresponding to a diagonal map. In each case, the variance decreases with increasing sample size, and the sparser the map, the lower the variance. However, non-negligible bias is incurred when the map is over-sparsified; see Figure 2b. Ideally, the algorithm would move from the under-sparsified level to the exact level. 102 103 Number of samples 10−1 100 Average variance in ˆΩ Grid graph, p = 16 Sparsity level Under Exact Over (a) 102 103 Number of samples 10−3 10−2 10−1 100 Bias squared in ˆΩ Grid graph, p = 16 Sparsity level Under Exact Over (b) Figure 2: (a) Variance of ˆΩjk decreases with fewer coefficients and/or more samples; (b) Bias in ˆΩjk occurs with oversparsification. The bias and variance of ˆΩare computed using the Frobenius norm. 4 Algorithm: SING We now present the full algorithm. Note that the ending condition is controlled by a variable DECREASING, which is set to true until the size of the recovered edge set is no longer decreasing. The final ingredient is the thresholding step, explained in §4.1. Subscripts l in the algorithm refer to the given quantity at that iteration. Algorithm 1: Sparsity Identification in Non-Gaussian distributions (SING) input :n i.i.d. samples {x(i)}n i=1 ∼π, maximum polynomial degree β output : sparse edge set ˆE define : IS1 = {∅}, l = 1, | ˆE0| = p(p −1)/2, DECREASING = TRUE 1 while DECREASING = TRUE do 2 Estimate transport map Sl ∈Sβ Il, where Sl♯π = η 3 Compute (ˆΩl)jk = 1 n Pn i=1 ∂jk log S♯ αη x(i) 4 Threshold ˆΩl 5 Compute | ˆEl| (the number of edges in the thresholded graph) 6 if | ˆEl| < | ˆEl−1| then 7 Find appropriate permutation of variables ϕl (for example, reverse Cholesky ordering) 8 Identify sparsity pattern of subsequent map ISl+1 9 l ←l + 1 10 else 11 DECREASING = FALSE SING is not a strictly greedy algorithm—neither for the sparsity pattern of the map nor for the edge removal of the graph. First, the process of identifying the induced graph may involve fill-in, and the extent of this fill-in might be larger than optimal due to the ordering heuristics. Second, the estimate of the generalized precision is noisy due to finite sample size, and this noise can add randomness to a thresholding decision. As a result, a variable that is set as inactive may be reactivated in subsequent iterations. However, we have found that oscillation in the set of active variables is a rare occurence. Thus, checking that the total number of edges is nondecreasing (as a global measure of sparsity) works well as a practical stopping criterion. 5 4.1 Thresholding the generalized precision An important component of this algorithm is a thresholding of the generalized precision. Based on literature [3] and numerical results, we model the threshold as τjk = δρjk, where δ is a tuning parameter and ρjk = [V(ˆΩjk)]1/2 (where V denotes variance). Note that a threshold τjk is computed at each iteration and for every off-diagonal entry of Ω. More motivation for this choice is given in the scaling analysis of the following section. The expression (7) yields an estimate of the variances of the map coefficients ˆα, but this uncertainty must still be propagated to the entries of Ωin order to compute ρjk. This is possible using the delta method [16], which states that if a sequence of one-dimensional random variables satisfies √n X(n) −θ d −→N µ, σ2 , then for a function g(θ), √n g  X(n) −g (θ) d −→N g(µ), σ2|g′(θ)|2 . The MLE result also states that the coefficients are normally distributed as n →∞. Thus, generalizing this method to vector-valued random variables gives an estimate for the variance in the entries of Ω, as a function of α, evaluated at the true minimizer α∗: ρ2 jk ≈(∇αΩjk)T  1 nI−1(α)  (∇αΩjk) α∗. (11) 5 Scaling analysis In this section, we derive an estimate for the number of samples needed to recover the exact graph with some given probability. We consider a one-step version of the algorithm, or in other words: what is the probability that the correct graph will be returned after a single step of SING? We also assume a particular instantiation of the transport map, and that κ, the minimum non-zero edge weight in the true generalized precision, is given. That is, κ = minj̸=k,Ωjk̸=0 (Ωjk). There are two possibilities for each pair (j, k), j < k: the edge ejk does exist in the true edge set E (case 1), or it does not (case 2). In case 1, the estimated value should be greater than its variance, up to some level of confidence, reflected in the choice of δ: Ωjk > δρjk. In the worst case, Ωjk = κ, so it must be that κ > δρjk. On the other hand, in case 2, in which the edge does not exist, then similarly κ −δρjk > 0. If ρjk < κ/δ, then by equation (11), we have 1 n (∇αΩjk)T I−1(α) (∇αΩjk) < κ δ 2 (12) and so it must be that the number of samples n > (∇αΩjk)T I−1(α) (∇αΩjk)  δ κ 2 . (13) Let us define the RHS above as n∗ jk and set n∗= maxj̸=k  n∗ jk  . Recall that the estimate in line (9) contains the absolute value of a normally distributed quantity, known as a folded normal distribution. In case 1, the mean is bounded away from zero, and with small enough variance, the folded part of this distribution is negligible. In case 2, the mean (before taking the absolute value) is zero, and so this estimate takes the form of a half-normal distribution. Let us now relate the level of confidence as reflected in δ to the probability z that an edge is correctly estimated. We define a function for the standard normal (in case 1) φ1 : R+ →(0, 1) such that φ1(δ1) = z1 and its inverse δ1 = φ−1 1 (z1), and similarly for the half-normal with φ2, δ2, and z2. Consider the event Bjk as the event that edge ejk is estimated incorrectly: Bjk = n (ejk ∈E) ∩(ˆejk /∈ˆE)  ∪  (ejk /∈E) ∩(ˆejk ∈ˆE) o . 6 In case 1, δ1ρjk < κ =⇒P(Bjk) < 1 2(1 −z1) where the factor of 1/2 appears because this event only occurs when the estimate is below κ (and not when the estimate is high). In case 2, we have δ2ρjk < κ =⇒P(Bjk) < (1 −z2). To unify these two cases, let us define z where 1 −z = (1 −z1)/2, and set z = z2. Finally, we have (Bjk) < (1 −z), j < k. Now we bound the probability that at least one edge is incorrect with a union bound: P  [ j<k Bjk  ≤ X j<k P(Bjk) (14) = 1 2p(p −1)(1 −z). (15) Note p(p −1)/2 is the number of possible edges. The probability that an edge is incorrect increases as p increases, and decreases as z approaches 1. Next, we bound this probability of recovering an incorrect graph by m. Then p(p −1)(1 −z) < 2m which yields z > 1 −2m/ (p(p −1)). Let δ∗= max [δ1, δ2] = max  φ−1 1  1 − 2m p(p −1)  , φ−1 2  1 − 2m p(p −1)  . (16) Therefore, to recover the correct graph with probability m we need at least n∗samples, where n∗= max j̸=k ( (∇αΩjk)T I−1(α) (∇αΩjk) δ∗ κ 2) . 6 Examples 6.1 Modified Rademacher Consider r pairs of random variables (X, Y ), where: X ∼N(0, 1) (17) Y = WX, with W ∼N(0, 1). (18) (A common example illustrating that two random variables can be uncorrelated but not independent uses draws for W from a Rademacher distribution, which are −1 and 1 with equal probability.) When r = 5, the corresponding graphical model and support of the generalized precision are shown in Figure 3. The same figure also shows the one- and two-dimensional marginal distributions for one pair (X, Y ). Each 1-dimensional marginal is symmetric and unimodal, but the two-dimensional marginal is quite non-Gaussian. Figures 4a–4c show the progression of the identified graph over the iterations of the algorithm, with n = 2000, δ = 2, and maximum degree β = 2. The variables are initially permuted to demonstrate that the algorithm is able to find a good ordering. After the first iteration, one extra edge remains. After the second, the erroneous edge is removed and the graph is correct. After the third, the sparsity of the graph has not changed and the recovered graph is returned as is. Importantly, an assumption of normality on the data returns the incorrect graph, displayed in Figure 4d. (This assumption can be enforced by using a linear transport map, or β = 1.) In fact, not only is the graph incorrect, the use of a linear map fails to detect any edges at all and deems the ten variables to be independent. 6.2 Stochastic volatility As a second example, we consider data generated from a stochastic volatility model of a financial asset [23, 6]. The log-volatility of the asset is modeled as an autoregressive process at times t = 1, . . . , T. In particular, the state at time t + 1 is given as Zt+1 = µ + φ(Zt −µ) + ϵt, ϵt ∼N(0, 1) (19) 7 1 3 5 7 9 2 4 6 8 0 (a) −3 −2 −1 0 1 2 3 x −3 −2 −1 0 1 2 3 y (b) 5 10 2 4 6 8 10 (c) Figure 3: (a) The undirected graphical model; (b) One- and two-dimensional marginal distributions for one pair (X, Y ); (c) Adjacency matrix of true graph (dark blue corresponds to an edge, off-white to no edge). 5 10 2 4 6 8 10 (a) 5 10 2 4 6 8 10 (b) 5 10 2 4 6 8 10 (c) 5 10 2 4 6 8 10 (d) Figure 4: (a) Adjacency matrix of original graph under random variable permutation; (b) Iteration 1; (c) Iterations 2 and 3 are identical: correct graph recovered via SING with β = 2; (d) Recovered graph, using SING with β = 1. where Z0|µ, φ ∼N  µ, 1 1 −φ2  , µ ∼N(0, 1) (20) φ = 2 eφ∗ 1 + eφ∗−1, φ∗∼N(3, 1). (21) The corresponding graph is depicted in Figure 6. With T = 6, samples were generated from the posterior distribution of the state Z1:6 and hyperparameters µ and φ, given noisy measurements of the state. Using a relatively large number of samples n = 15000, δ = 1.5, and β = 2, the correct graph is recovered, shown in Figure 6a. With the same amount of data, a linear map returns the incorrect graph—having both missing and spurious additional edges. The large number of samples is required µ φ Z1 Z2 Z3 Z4 ZT (a) µ φ Z1 Z2 Z3 Z4 Z5 Z6 µ φ Z1 Z2 Z3 Z4 Z5 Z6 (b) Figure 5: (a) The graph of the stochastic volatility model; (b) Adjacency matrix of true graph. 8 µ φ Z1 Z2 Z3 Z4 Z5 Z6 µ φ Z1 Z2 Z3 Z4 Z5 Z6 (a) µ φ Z1 Z2 Z3 Z4 Z5 Z6 µ φ Z1 Z2 Z3 Z4 Z5 Z6 (b) µ φ Z1 Z2 Z3 Z4 Z5 Z6 µ φ Z1 Z2 Z3 Z4 Z5 Z6 (c) Figure 6: Recovered graphs using: (a) SING, β = 2, n = 15000; (b) SING, β = 1; (c) GLASSO. because the edges between hyperparameters and state variables are quite weak. Magnitudes of the entries of the generalized precision (scaled to have maximum value 1) are displayed in Figure 7a. The stronger edges may be recovered with a much smaller number of samples (n = 2000), however; see Figure 7b. This example illustrates the interplay between the minimum edge weight κ and the number of samples needed, as seen in the previous section. In some cases, it may be more reasonable to expect that, given a fixed number of samples, SING could recover edges with edge weight above some κmin, but would not reliably discover edges below that cutoff. Strong edges could also be discovered using fewer samples and a modified SING algorithm with ℓ1 penalties (a modification to the algorithm currently under development). For comparison, Figure 6c shows the graph produced by assuming that the data are Gaussian and using the GLASSO algorithm [4]. Results were generated for 40 different values of the tuning parameter λ ∈(10−6, 1). The result shown here was chosen such that the sparsity level is locally constant with respect to λ, specifically at λ = .15. Here we see that using a Gaussian assumption with non-Gaussian data overestimates edges among state variables and underestimates edges between state variables and the hyperparameter φ. µ φ Z1 Z2 Z3 Z4 Z5 Z6 µ φ Z1 Z2 Z3 Z4 Z5 Z6 0.0 0.2 0.4 0.6 0.8 1.0 (a) µ φ Z1 Z2 Z3 Z4 Z5 Z6 µ φ Z1 Z2 Z3 Z4 Z5 Z6 (b) Figure 7: (a) The scaled generalized precision matrix ˆΩ; (b) Strong edges recovered via SING, n = 2000. 7 Discussion The scaling analysis presented here depends on a particular representation of the transport map. An interesting open question is: What is the information-theoretic (representation-independent) lower bound on the number of samples needed to identify edges in the non-Gaussian setting? This question relates to the notion of an information gap: any undirected graph satisfies the Markov properties of an infinite number of distributions, and thus identification of the graph should require less information than that of the distribution. Formalizing these notions is an important topic of future work. Acknowledgments This work has been supported in part by the AFOSR MURI on “Managing multiple information sources of multi-physics systems,” program officer Jean-Luc Cambier, award FA9550-15-1-0038. We would also like to thank Daniele Bigoni for generous help with code implementation and execution. 9 References [1] D. Bigoni, A. Spantini, and Y. Marzouk. On the computation of monotone transports. In preparation. [2] V. I. Bogachev, A. V. Kolesnikov, and K. V. Medvedev. Triangular transformations of measures. Sbornik: Mathematics, 196(3):309, 2005. [3] T. Cai and W. Liu. Adaptive thresholding for sparse covariance matrix estimation. Journal of the American Statistical Association, 106(494):672–684, 2011. [4] J. Friedman, T. Hastie, and R. Tibshirani. Sparse inverse covariance estimation with the graphical lasso. Biostatistics, 9(3):432–441, 2008. [5] S. K. Ghosh, A. G. Cherstvy, D. S. Grebenkov, and R. Metzler. Anomalous, non-Gaussian tracer diffusion in crowded two-dimensional environments. New Journal of Physics, 18(1):013027, 2016. [6] S. Kim, N. Shephard, and S. Chib. Stochastic volatility: likelihood inference and comparison with ARCH models. The Review of Economic Studies, 65(3):361–393, 1998. [7] H. Knothe. Contributions to the theory of convex bodies. The Michigan Mathematical Journal, 1957(1028990175), 1957. [8] D. Koller and N. Friedman. Probabilistic Graphical Models: Principles and Techniques. MIT Press, 2009. [9] C. Liu, R. Bammer, B. Acar, and M. E. Moseley. Characterizing non-Gaussian diffusion by using generalized diffusion tensors. Magnetic Resonance in Medicine, 51(5):924–937, 2004. [10] H. Liu, F. Han, M. Yuan, J. Lafferty, and L. Wasserman. High-dimensional semiparametric Gaussian copula graphical models. The Annals of Statistics, 40(4):2293–2326, 2012. [11] H. Liu, J. Lafferty, and L. Wasserman. The nonparanormal: Semiparametric estimation of high dimensional undirected graphs. Journal of Machine Learning Research, 10:2295–2328, 2009. [12] P.-L. Loh and M. J. Wainwright. Structure estimation for discrete graphical models: Generalized covariance matrices and their inverses. In NIPS, pages 2096–2104, 2012. [13] Y. Marzouk, T. Moselhy, M. Parno, and A. Spantini. Sampling via measure transport: An introduction. In R. Ghanem, D. Higdon, and H. Owhadi, editors, Handbook of Uncertainty Quantification. Springer, 2016. [14] N. Meinshausen and P. B¨uhlmann. High-dimensional graphs and variable selection with the lasso. The Annals of Statistics, pages 1436–1462, 2006. [15] T. A. Moselhy and Y. M. Marzouk. Bayesian inference with optimal maps. Journal of Computational Physics, 231(23):7815–7850, 2012. [16] G. W. Oehlert. A note on the delta method. The American Statistician, 46(1):27–29, 1992. [17] M. Parno and Y. Marzouk. Transport map accelerated Markov chain Monte Carlo. arXiv preprint arXiv:1412.5492, 2014. [18] M. Parno, T. Moselhy, and Y. M. Marzouk. A multiscale strategy for Bayesian inference using transport maps. SIAM/ASA Journal on Uncertainty Quantification, 4(1):1160–1190, 2016. [19] C.-K. Peng, J. Mietus, J. Hausdorff, S. Havlin, H. E. Stanley, and A. L. Goldberger. Long-range anticorrelations and non-Gaussian behavior of the heartbeat. Physical Review Letters, 70(9):1343, 1993. [20] M. Perron and P. Sura. Climatology of non-Gaussian atmospheric statistics. Journal of Climate, 26(3):1063– 1083, 2013. [21] P. Ravikumar, M. J. Wainwright, and J. D. Lafferty. High-dimensional Ising model selection using l1-regularized logistic regression. The Annals of Statistics, 38(3):1287–1319, 2010. [22] M. Rosenblatt. Remarks on a multivariate transformation. The Annals of Mathematical Statistics, 23(3):470– 472, 1952. [23] H. Rue and L. Held. Gaussian Markov Random Fields: Theory and Applications. Chapman & Hall/CRC Monographs on Statistics & Applied Probability. CRC Press, 2005. [24] Y. Saad. Iterative Methods for Sparse Linear Systems. SIAM, 2003. 10 [25] A. Sengupta, N. Cressie, B. H. Kahn, and R. Frey. Predictive inference for big, spatial, non-Gaussian data: MODIS cloud data and its change-of-support. Australian & New Zealand Journal of Statistics, 58(1):15–45, 2016. [26] A. Spantini, D. Bigoni, and Y. Marzouk. Inference via low-dimensional couplings. arXiv preprint arXiv:1703.06131, 2017. [27] T. M. Team. TransportMaps v1.0. http://transportmaps.mit.edu. [28] C. Villani. Optimal Transport: Old and New, volume 338. Springer, 2008. 11
2017
622
7,144
REBAR: Low-variance, unbiased gradient estimates for discrete latent variable models George Tucker1,⇤, Andriy Mnih2, Chris J. Maddison2,3, Dieterich Lawson1,*, Jascha Sohl-Dickstein1 1Google Brain, 2DeepMind, 3University of Oxford {gjt, amnih, dieterichl, jaschasd}@google.com cmaddis@stats.ox.ac.uk Abstract Learning in models with discrete latent variables is challenging due to high variance gradient estimators. Generally, approaches have relied on control variates to reduce the variance of the REINFORCE estimator. Recent work (Jang et al., 2016; Maddison et al., 2016) has taken a different approach, introducing a continuous relaxation of discrete variables to produce low-variance, but biased, gradient estimates. In this work, we combine the two approaches through a novel control variate that produces low-variance, unbiased gradient estimates. Then, we introduce a modification to the continuous relaxation and show that the tightness of the relaxation can be adapted online, removing it as a hyperparameter. We show state-of-the-art variance reduction on several benchmark generative modeling tasks, generally leading to faster convergence to a better final log-likelihood. 1 Introduction Models with discrete latent variables are ubiquitous in machine learning: mixture models, Markov Decision Processes in reinforcement learning (RL), generative models for structured prediction, and, recently, models with hard attention (Mnih et al., 2014) and memory networks (Zaremba & Sutskever, 2015). However, when the discrete latent variables cannot be marginalized out analytically, maximizing objectives over these models using REINFORCE-like methods (Williams, 1992) is challenging due to high-variance gradient estimates obtained from sampling. Most approaches to reducing this variance have focused on developing clever control variates (Mnih & Gregor, 2014; Titsias & Lázaro-Gredilla, 2015; Gu et al., 2015; Mnih & Rezende, 2016). Recently, Jang et al. (2016) and Maddison et al. (2016) independently introduced a novel distribution, the Gumbel-Softmax or Concrete distribution, that continuously relaxes discrete random variables. Replacing every discrete random variable in a model with a Concrete random variable results in a continuous model where the reparameterization trick is applicable (Kingma & Welling, 2013; Rezende et al., 2014). The gradients are biased with respect to the discrete model, but can be used effectively to optimize large models. The tightness of the relaxation is controlled by a temperature hyperparameter. In the low temperature limit, the gradient estimates become unbiased, but the variance of the gradient estimator diverges, so the temperature must be tuned to balance bias and variance. We sought an estimator that is low-variance, unbiased, and does not require tuning additional hyperparameters. To construct such an estimator, we introduce a simple control variate based on the difference between the REINFORCE and the reparameterization trick gradient estimators for the relaxed model. This reduces variance, but does not outperform state-of-the-art methods on its own. Our key contribution is to show that it is possible to conditionally marginalize the control variate ⇤Work done as part of the Google Brain Residency Program. Source code for experiments: github.com/tensorflow/models/tree/master/research/rebar 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. to significantly improve its effectiveness. We call this the REBAR gradient estimator, because it combines REINFORCE gradients with gradients of the Concrete relaxation. Next, we show that a modification to the Concrete relaxation connects REBAR to MuProp in the high temperature limit. Finally, because REBAR is unbiased for all temperatures, we show that the temperature can be optimized online to reduce variance further and relieve the burden of setting an additional hyperparameter. In our experiments, we illustrate the potential problems inherent with biased gradient estimators on a toy problem. Then, we use REBAR to train generative sigmoid belief networks (SBNs) on the MNIST and Omniglot datasets and to train conditional generative models on MNIST. Across tasks, we show that REBAR has state-of-the-art variance reduction which translates to faster convergence and better final log-likelihoods. Although we focus on binary variables for simplicity, this work is equally applicable to categorical variables (Appendix C). 2 Background For clarity, we first consider a simplified scenario. Let b ⇠Bernoulli (✓) be a vector of independent binary random variables parameterized by ✓. We wish to maximize E p(b) [f(b, ✓)] , where f(b, ✓) is differentiable with respect to b and ✓, and we suppress the dependence of p(b) on ✓to reduce notational clutter. This covers a wide range of discrete latent variable problems; for example, in variational inference f(b, ✓) would be the stochastic variational lower bound. Typically, this problem has been approached by gradient ascent, which requires efficiently estimating d d✓E p(b) [f(b, ✓)] = E p(b) @f(b, ✓) @✓ + f(b, ✓) @ @✓log p(b) " . (1) In practice, the first term can be estimated effectively with a single Monte Carlo sample, however, a naïve single sample estimator of the second term has high variance. Because the dependence of f(b, ✓) on ✓is straightforward to account for, to simplify exposition we assume that f(b, ✓) = f(b) does not depend on ✓and concentrate on the second term. 2.1 Variance reduction through control variates Paisley et al. (2012); Ranganath et al. (2014); Mnih & Gregor (2014); Gu et al. (2015) show that carefully designed control variates can reduce the variance of the second term significantly. Control variates seek to reduce the variance of such estimators using closed form expectations for closely related terms. We can subtract any c (random or constant) as long as we can correct the bias (see Appendix A and (Paisley et al., 2012) for a review of control variates in this context): @ @✓ E p(b,c) [f(b)] = @ @✓ ✓ E p(b,c) [f(b) −c] + E p(b,c) [c] ◆ = E p(b,c)  (f(b) −c) @ @✓log p(b) " + @ @✓ E p(b,c) [c] For example, NVIL (Mnih & Gregor, 2014) learns a c that does not depend2 on b and MuProp (Gu et al., 2015) uses a linear Taylor expansion of f around Ep(b|✓)[b]. Unfortunately, even with a control variate, the term can still have high variance. 2.2 Continuous relaxations for discrete variables Alternatively, following Maddison et al. (2016), we can parameterize b as b = H(z), where H is the element-wise hard threshold function3 and z is a vector of independent Logistic random variables defined by z := g(u, ✓) := log ✓ 1 −✓+ log u 1 −u, 2In this case, c depends on the implicit observation in variational inference. 3H(z) = 1 if z ≥0 and H(z) = 0 if z < 0. 2 where u ⇠Uniform(0, 1). Notably, z is differentiably reparameterizable (Kingma & Welling, 2013; Rezende et al., 2014), but the discontinuous hard threshold function prevents us from using the reparameterization trick directly. Replacing all occurrences of the hard threshold function with a continuous relaxation H(z) ⇡σλ(z) := σ % z λ & = % 1 + exp % −z λ &&−1 however results in a reparameterizable computational graph. Thus, we can compute low-variance gradient estimates for the relaxed model that approximate the gradient for the discrete model. In summary, @ @✓E p(b) [f(b)] = @ @✓E p(z) [f(H(z))] ⇡@ @✓E p(z) [f(σλ(z))] = E p(u) @ @✓f (σλ(g(u, ✓))) " , where λ > 0 can be thought of as a temperature that controls the tightness of the relaxation (at low temperatures, the relaxation is nearly tight). This generally results in a low-variance, but biased Monte Carlo estimator for the discrete model. As λ ! 0, the approximation becomes exact, but the variance of the Monte Carlo estimator diverges. Thus, in practice, λ must be tuned to balance bias and variance. See Appendix C and Jang et al. (2016); Maddison et al. (2016) for the generalization to the categorical case. 3 REBAR We seek a low-variance, unbiased gradient estimator. Inspired by the Concrete relaxation, our strategy will be to construct a control variate (see Appendix A for a review of control variates in this context) based on the difference between the REINFORCE gradient estimator for the relaxed model and the gradient estimator from the reparameterization trick. First, note that closely following Eq. 1 E p(b)  f(b) @ @✓log p(b) " = @ @✓E p(b) [f(b)] = @ @✓E p(z) [f(H(z))] = E p(z)  f(H(z)) @ @✓log p(z) " . (2) The similar form of the REINFORCE gradient estimator for the relaxed model @ @✓E p(z) [f(σλ(z))] = E p(z)  f(σλ(z)) @ @✓log p(z) " (3) suggests it will be strongly correlated and thus be an effective control variate. Unfortunately, the Monte Carlo gradient estimator derived from the left hand side of Eq. 2 has much lower variance than the Monte Carlo gradient estimator derived from the right hand side. This is because the left hand side can be seen as analytically performing a conditional marginalization over z given b, which is noisily approximated by Monte Carlo samples on the right hand side (see Appendix B for details). Our key insight is that an analogous conditional marginalization can be performed for the control variate (Eq. 3), E p(z)  f(σλ(z)) @ @✓log p(z) " = E p(b) @ @✓ E p(z|b) [f(σλ(z))] " + E p(b)  E p(z|b) [f(σλ(z))] @ @✓log p(b) " , where the first term on the right-hand side can be efficiently estimated with the reparameterization trick (see Appendix C for the details) E p(b) @ @✓ E p(z|b) [f(σλ(z))] " = E p(b)  E p(v) @ @✓f(σλ(˜z)) "" , where v ⇠Uniform(0, 1) and ˜z ⌘˜g(v, b, ✓) is the differentiable reparameterization for z|b (Appendix C). Therefore, E p(z)  f(σλ(z)) @ @✓log p(z) " = E p(b)  E p(v) @ @✓f(σλ(˜z)) "" + E p(b)  E p(z|b) [f(σλ(z))] @ @✓log p(b) " . Using this to form the control variate and correcting with the reparameterization trick gradient, we arrive at @ @✓E p(b) [f(b)] = E p(u,v)  [f(H(z)) −⌘f(σλ(˜z))] @ @✓log p(b) '''' b=H(z) + ⌘@ @✓f(σλ(z)) −⌘@ @✓f(σλ(˜z)) " , (4) 3 where u, v ⇠Uniform(0, 1), z ⌘g(u, ✓), ˜z ⌘˜g(v, H(z), ✓), and ⌘is a scaling on the control variate. The REBAR estimator is the single sample Monte Carlo estimator of this expectation. To reduce computation and variance, we couple u and v using common random numbers (Appendix G, (Owen, 2013)). We estimate ⌘by minimizing the variance of the Monte Carlo estimator with SGD. In Appendix D, we present an alternative derivation of REBAR that is shorter, but less intuitive. 3.1 Rethinking the relaxation and a connection to MuProp Because σλ(z) ! 1 2 as λ ! 1, we consider an alternative relaxation H(z) ⇡σ ✓1 λ λ2 + λ + 1 λ + 1 log ✓ 1 −✓+ 1 λ log u 1 −u ◆ = σλ(zλ), (5) where zλ = λ2+λ+1 λ+1 log ✓ 1−✓+log u 1−u. As λ ! 1, the relaxation converges to the mean, ✓, and still as λ ! 0, the relaxation becomes exact. Furthermore, as λ ! 1, the REBAR estimator converges to MuProp without the linear term (see Appendix E). We refer to this estimator as SimpleMuProp in the results. 3.2 Optimizing temperature (λ) The REBAR gradient estimator is unbiased for any choice of λ > 0, so we can optimize λ to minimize the variance of the estimator without affecting its unbiasedness (similar to optimizing the dispersion coefficients in Ruiz et al. (2016)). In particular, denoting the REBAR gradient estimator by r(λ), then @ @λ Var(r(λ)) = @ @λ ⇣ E ⇥ r(λ)2⇤ −E [r(λ)]2⌘ = E  2r(λ)@r(λ) @λ " because E[r(λ)] does not depend on λ. The resulting expectation can be estimated with a single sample Monte Carlo estimator. This allows the tightness of the relaxation to be adapted online jointly with the optimization of the parameters and relieves the burden of choosing λ ahead of time. 3.3 Multilayer stochastic networks Suppose we have multiple layers of stochastic units (i.e., b = {b1, b2, . . . , bn}) where p(b) factorizes as p(b1:n) = p(b1)p(b2|b1) · · · p(bn|bn−1), and similarly for the underlying Logistic random variables p(z1:n) recalling that bi = H(zi). We can define a relaxed distribution over z1:n where we replace the hard threshold function H(z) with a continuous relaxation σλ(z). We refer to the relaxed distribution as q(z1:n). We can take advantage of the structure of p, by using the fact that the high variance REINFORCE term of the gradient also decomposes E p(b)  f(b) @ @✓log p(b) " = X i E p(b)  f(b) @ @✓log p(bi|bi−1) " . Focusing on the ith term, we have E p(b)  f(b) @ @✓log p(bi|bi−1) " = E p(b1:i−1)  E p(bi|bi−1)  E p(bi+1:n|bi) [f(b)] @ @✓log p(bi|bi−1) "" , which suggests the following control variate E p(zi|bi,bi−1)  E q(zi+1:n|zi)[f(b1:i−1, σλ(zi:n))] " @ @✓log p(bi|bi−1) for the middle expectation. Similarly to the single layer case, we can debias the control variate with terms that are reparameterizable. Note that due to the switch between sampling from p and sampling from q, this approach requires n passes through the network (one pass per layer). We discuss alternatives that do not require multiple passes through the network in Appendix F. 4 3.4 Q-functions Finally, we note that since the derivation of this control variate is independent of f, the REBAR control variate can be generalized by replacing f with a learned, differentiable Q-function. This suggests that the REBAR control variate is applicable to RL, where it would allow a “pseudo-action”dependent baseline. In this case, the pseudo-action would be the relaxation of the discrete output from a policy network. 4 Related work Most approaches to optimizing an expectation of a function w.r.t. a discrete distribution based on samples from the distribution can be seen as applications of the REINFORCE (Williams, 1992) gradient estimator, also known as the likelihood ratio (Glynn, 1990) or score-function estimator (Fu, 2006). Following the notation from Section 2, the basic form of an estimator of this type is (f(b) −c) @ @✓log p(b) where b is a sample from the discrete distribution and c is some quantity independent of b, known as a baseline. Such estimators are unbiased, but without a carefully chosen baseline their variance tends to be too high for the estimator to be useful and much work has gone into finding effective baselines. In the context of training latent variable models, REINFORCE-like methods have been used to implement sampling-based variational inference with either fully factorized (Wingate & Weber, 2013; Ranganath et al., 2014) or structured (Mnih & Gregor, 2014; Gu et al., 2015) variational distributions. All of these involve learned baselines: from simple scalar baselines (Wingate & Weber, 2013; Ranganath et al., 2014) to nonlinear input-dependent baselines (Mnih & Gregor, 2014). MuProp (Gu et al., 2015) combines an input-dependent baseline with a first-order Taylor approximation to the function based on the corresponding mean-field network to achieve further variance reduction. REBAR is similar to MuProp in that it also uses gradient information from a proxy model to reduce the variance of a REINFORCE-like estimator. The main difference is that in our approach the proxy model is essentially the relaxed (but still stochastic) version of the model we are interested in, whereas MuProp uses the mean field version of the model as a proxy, which can behave very differently from the original model due to being completely deterministic. The relaxation we use was proposed by (Maddison et al., 2016; Jang et al., 2016) as a way of making discrete latent variable models reparameterizable, resulting in a low-variance but biased gradient estimator for the original model. REBAR on the other hand, uses the relaxation in a control variate which results in an unbiased, low-variance estimator. Alternatively, Titsias & Lázaro-Gredilla (2015) introduced local expectation gradients, a general purpose unbiased gradient estimator for models with continuous and discrete latent variables. However, it typically requires substantially more computation than other methods. Recently, a specialized REINFORCE-like method was proposed for the tighter multi-sample version of the variational bound (Burda et al., 2015) which uses a leave-out-out technique to construct per-sample baselines (Mnih & Rezende, 2016). This approach is orthogonal to ours, and we expect it to benefit from incorporating the REBAR control variate. 5 Experiments As our goal was variance reduction to improve optimization, we compared our method to the state-of-the-art unbiased single-sample gradient estimators, NVIL (Mnih & Gregor, 2014) and MuProp (Gu et al., 2015), and the state-of-the-art biased single-sample gradient estimator GumbelSoftmax/Concrete (Jang et al., 2016; Maddison et al., 2016) by measuring their progress on the training objective and the variance of the unbiased gradient estimators4. We start with an illustrative problem and then follow the experimental setup established in (Maddison et al., 2016) to evaluate the methods on generative modeling and structured prediction tasks. 4Both MuProp and REBAR require twice as much computation per step as NVIL and Concrete. To present comparable results with previous work, we plot our results in steps. However, to offer a fair comparison, NVIL should use two samples and thus reduce its variance by half (or log(2) ⇡0.69 in our plots). 5 Figure 1: Log variance of the gradient estimator (left) and loss (right) for the toy problem with t = 0.45. Only the unbiased estimators converge to the correct answer. We indicate the temperature in parenthesis where relevant. 5.1 Toy problem To illustrate the potential ill-effects of biased gradient estimators, we evaluated the methods on a simple toy problem. We wish to minimize Ep(b)[(b −t)2], where t 2 (0, 1) is a continuous target value, and we have a single parameter controlling the Bernoulli distribution. Figure 1 shows the perils of biased gradient estimators. The optimal solution is deterministic (i.e., p(b = 1) 2 {0, 1}), whereas the Concrete estimator converges to a stochastic one. All of the unbiased estimators correctly converge to the optimal loss, whereas the biased estimator fails to. For this simple problem, it is sufficient to reduce temperature of the relaxation to achieve an acceptable solution. 5.2 Learning sigmoid belief networks (SBNs) Next, we trained SBNs on several standard benchmark tasks. We follow the setup established in (Maddison et al., 2016). We used the statically binarized MNIST digits from Salakhutdinov & Murray (2008) and a fixed binarization of the Omniglot character dataset. We used the standard splits into training, validation, and test sets. The network used several layers of 200 stochastic binary units interleaved with deterministic nonlinearities. In our experiments, we used either a linear deterministic layer (denoted linear) or 2 layers of 200 tanh units (denoted nonlinear). 5.2.1 Generative modeling on MNIST and Omniglot For generative modeling, we maximized a single-sample variational lower bound on the log-likelihood. We performed amortized inference (Kingma & Welling, 2013; Rezende et al., 2014) with an inference network with similar architecture in the reverse direction. In particular, denoting the image by x and the hidden layer stochastic activations by b ⇠q(b|x, ✓), we have log p(x|✓) ≥ E q(b|x,✓) [log p(x, b|✓) −log q(b|x, ✓)] , which has the required form for REBAR. To measure the variance of the gradient estimators, we follow a single optimization trajectory and use the same random numbers for all methods. This significantly reduces the variance in our measurements. We plot the log variance of the unbiased gradient estimators in Figure 2 for MNIST (Appendix Figure App.3 for Omniglot). REBAR produced the lowest variance across linear and nonlinear models for both tasks. The reduction in variance was especially large for the linear models. For the nonlinear model, REBAR (0.1) reduced variance at the beginning of training, but its performance degraded later in training. REBAR was able to adaptively change the temperature as optimization progressed and retained superior variance reduction. We also observed that SimpleMuProp was a surprisingly strong baseline that improved significantly over NVIL. It performed similarly to MuProp despite not explicitly using the gradient of f. Generally, lower variance gradient estimates led to faster optimization of the objective and convergence to a better final value (Figure 3, Table 1, Appendix Figures App.2 and App.4). For the nonlinear model, the Concrete estimator underperformed optimizing the training objective in both tasks. 6 Figure 2: Log variance of the gradient estimator for the two layer linear model (left) and single layer nonlinear model (right) on the MNIST generative modeling task. All of the estimators are unbiased, so their variance is directly comparable. We estimated moments from exponential moving averages (with decay=0.999; we found that the results were robust to the exact value). The temperature is shown in parenthesis where relevant. Figure 3: Training variational lower bound for the two layer linear model (left) and single layer nonlinear model (right) on the MNIST generative modeling task. We plot 5 trials over different random initializations for each method with the median trial highlighted. The temperature is shown in parenthesis where relevant. Although our primary focus was optimization, for completeness, we include results on the test set in Appendix Table App.2 computed with a 100-sample lower bound Burda et al. (2015). Improvements on the training variational lower bound do not directly translate into improved test log-likelihood. Previous work (Maddison et al., 2016) showed that regularizing the inference network alone was sufficient to prevent overfitting. This led us to hypothesize that the overfitting results was primarily due to overfitting in the inference network (q). To test this, we trained a separate inference network on the validation and test sets, taking care not to affect the model parameters. This reduced overfitting (Appendix Figure App.5), but did not completely resolve the issue, suggesting that the generative and inference networks jointly overfit. 5.2.2 Structured prediction on MNIST Structured prediction is a form of conditional density estimation that aims to model high dimensional observations given a context. We followed the structured prediction task described by Raiko et al. (2014), where we modeled the bottom half of an MNIST digit (x) conditional on the top half (c). The conditional generative network takes as input c and passes it through an SBN. We optimized a single sample lower bound on the log-likelihood log p(x|c, ✓) ≥ E p(b|c,✓) [log p(x|b, ✓)] . We measured the log variance of the gradient estimator (Figure 4) and found that REBAR significantly reduced variance. In some configurations, MuProp excelled, especially with the single layer linear model where the first order expansion that MuProp uses is most accurate. Again, the training objective performance generally mirrored the reduction in variance of the gradient estimator (Figure 5, Table 1). 7 MNIST gen. NVIL MuProp REBAR (0.1) REBAR Concrete (0.1) Linear 1 layer −112.5 −111.7 −111.7 −111.6 −111.3 Linear 2 layer −99.6 −99.07 −99 −98.8 −99.62 Nonlinear −102.2 −101.5 −101.4 −101.1 −102.8 Omniglot gen. Linear 1 layer −117.44 −117.09 −116.93 −116.83 −117.23 Linear 2 layer −109.98 −109.55 −109.12 −108.99 −109.95 Nonlinear −110.4 −109.58 −109 −108.72 −110.64 MNIST struct. pred. Linear 1 layer −69.17 −64.33 −65.73 −65.21 −65.49 Linear 2 layer −68.87 −63.69 −65.5 −61.72 −66.88 Nonlinear −54.08 −47.6 −47.302 −46.44 −47.02 Table 1: Mean training variational lower bound over 5 trials with different random initializations. The standard error of the mean is given in the Appendix. We bolded the best performing method (up to standard error) for each task. We report trials using the best performing learning rate for each task. Figure 4: Log variance of the gradient estimator for the two layer linear model (left) and single layer nonlinear model (right) on the structured prediction task. 6 Discussion Inspired by the Concrete relaxation, we introduced REBAR, a novel control variate for REINFORCE, and demonstrated that it greatly reduces the variance of the gradient estimator. We also showed that with a modification to the relaxation, REBAR and MuProp are closely related in the high temperature limit. Moreover, we showed that we can adapt the temperature online and that it further reduces variance. Roeder et al. (2017) show that the reparameterization gradient includes a score function term which can adversely affect the gradient variance. Because the reparameterization gradient only enters the Figure 5: Training variational lower bound for the two layer linear model (left) and single layer nonlinear model (right) on the structured prediction task. We plot 5 trials over different random initializations for each method with the median trial highlighted. 8 REBAR estimator through differences of reparameterization gradients, we implicitly implement the recommendation from (Roeder et al., 2017). When optimizing the relaxation temperature, we require the derivative with respect to λ of the gradient of the parameters. Empirically, the temperature changes slowly relative to the parameters, so we might be able to amortize the cost of this operation over several parameter updates. We leave exploring these ideas to future work. It would be natural to explore the extension to the multi-sample case (e.g., VIMCO (Mnih & Rezende, 2016)), to leverage the layered structure in our models using Q-functions, and to apply this approach to reinforcement learning. Acknowledgments We thank Ben Poole and Eric Jang for helpful discussions and assistance replicating their results. References Yuri Burda, Roger Grosse, and Ruslan Salakhutdinov. Importance weighted autoencoders. arXiv preprint arXiv:1509.00519, 2015. Michael C Fu. Gradient estimation. Handbooks in operations research and management science, 13: 575–616, 2006. Peter W Glynn. Likelihood ratio gradient estimation for stochastic systems. Communications of the ACM, 33(10):75–84, 1990. Shixiang Gu, Sergey Levine, Ilya Sutskever, and Andriy Mnih. Muprop: Unbiased backpropagation for stochastic neural networks. arXiv preprint arXiv:1511.05176, 2015. Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax. arXiv preprint arXiv:1611.01144, 2016. Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013. Chris J. Maddison, Daniel Tarlow, and Tom Minka. A* Sampling. In Advances in Neural Information Processing Systems 27, 2014. Chris J Maddison, Andriy Mnih, and Yee Whye Teh. The concrete distribution: A continuous relaxation of discrete random variables. arXiv preprint arXiv:1611.00712, 2016. Andriy Mnih and Karol Gregor. Neural variational inference and learning in belief networks. In Proceedings of The 31st International Conference on Machine Learning, pp. 1791–1799, 2014. Andriy Mnih and Danilo Rezende. Variational inference for monte carlo objectives. In Proceedings of The 33rd International Conference on Machine Learning, pp. 2188–2196, 2016. Volodymyr Mnih, Nicolas Heess, Alex Graves, et al. Recurrent models of visual attention. In Advances in neural information processing systems, pp. 2204–2212, 2014. Art B. Owen. Monte Carlo theory, methods and examples. 2013. John Paisley, David M Blei, and Michael I Jordan. Variational bayesian inference with stochastic search. In Proceedings of the 29th International Coference on International Conference on Machine Learning, pp. 1363–1370, 2012. Tapani Raiko, Mathias Berglund, Guillaume Alain, and Laurent Dinh. Techniques for learning binary stochastic feedforward neural networks. arXiv preprint arXiv:1406.2989, 2014. Rajesh Ranganath, Sean Gerrish, and David M Blei. Black box variational inference. In AISTATS, pp. 814–822, 2014. 9 Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In Proceedings of The 31st International Conference on Machine Learning, pp. 1278–1286, 2014. Geoffrey Roeder, Yuhuai Wu, and David Duvenaud. Sticking the landing: An asymptotically zero-variance gradient estimator for variational inference. arXiv preprint arXiv:1703.09194, 2017. Francisco JR Ruiz, Michalis K Titsias, and David M Blei. Overdispersed black-box variational inference. In Proceedings of the Thirty-Second Conference on Uncertainty in Artificial Intelligence, pp. 647–656. AUAI Press, 2016. Ruslan Salakhutdinov and Iain Murray. On the quantitative analysis of deep belief networks. In Proceedings of the 25th international conference on Machine learning, pp. 872–879. ACM, 2008. Michalis K Titsias and Miguel Lázaro-Gredilla. Local expectation gradients for black box variational inference. In Advances in Neural Information Processing Systems, pp. 2638–2646, 2015. Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229–256, 1992. David Wingate and Theophane Weber. Automated variational inference in probabilistic programming. arXiv preprint arXiv:1301.1299, 2013. Wojciech Zaremba and Ilya Sutskever. Reinforcement learning neural Turing machines. arXiv preprint arXiv:1505.00521, 362, 2015. 10
2017
623
7,145
Submultiplicative Glivenko-Cantelli and Uniform Convergence of Revenues Noga Alon Tel Aviv University, Israel and Microsoft Research nogaa@tau.ac.il Moshe Babaioff Microsoft Research moshe@microsoft.com Yannai A. Gonczarowski The Hebrew University of Jerusalem, Israel and Microsoft Research yannai@gonch.name Yishay Mansour Tel Aviv University, Israel and Google Research, Israel mansour@tau.ac.il Shay Moran Institute for Advanced Study, Princeton shaymoran1@gmail.com Amir Yehudayoff Technion — IIT, Israel amir.yehudayoff@gmail.com Abstract In this work we derive a variant of the classic Glivenko-Cantelli Theorem, which asserts uniform convergence of the empirical Cumulative Distribution Function (CDF) to the CDF of the underlying distribution. Our variant allows for tighter convergence bounds for extreme values of the CDF. We apply our bound in the context of revenue learning, which is a well-studied problem in economics and algorithmic game theory. We derive sample-complexity bounds on the uniform convergence rate of the empirical revenues to the true revenues, assuming a bound on the kth moment of the valuations, for any (possibly fractional) k > 1. For uniform convergence in the limit, we give a complete characterization and a zero-one law: if the first moment of the valuations is finite, then uniform convergence almost surely occurs; conversely, if the first moment is infinite, then uniform convergence almost never occurs. 1 Introduction A basic task in machine learning is to learn an unknown distribution µ, given access to samples from it. A natural and widely studied criterion for learning a distribution is approximating its Cumulative Distribution Function (CDF). The seminal Glivenko-Cantelli Theorem [13, 6] addresses this question when the distribution µ is over the real numbers. It determines the behavior of the empirical distribution function as the number of samples grows: let X1, X2, . . . be a sequence of i.i.d. random variables drawn from a distribution µ on R with Cumulative Distribution Function (CDF) F, and let x1, x2, . . . be their realizations. The empirical distribution µn is µn ≜1 n n X i=1 δxi, 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. where δxi is the constant distribution supported on xi. Let Fn denote the CDF of µn, i.e., Fn(t) ≜ 1 n · {1 ≤i ≤n : xi ≤t} . The Glivenko-Cantelli Theorem formalizes the statement that µn converges to µ as n grows, by establishing that Fn(t) converges to F(t), uniformly over all t ∈R: Theorem 1.1 (Glivenko-Cantelli Theorem, [13, 6]). Almost surely, lim n→∞sup t Fn(t) −F(t) = 0. Some twenty years after Glivenko [13] and Cantelli [6] discovered this theorem, Dvoretzky, Kiefer, and Wolfowitz (DKW) [12] strengthened this result by giving an almost1 tight quantitative bound on the convergence rate. In 1990, Massart [17] proved a tight inequality, confirming a conjecture due to Birnbaum and McCarty [3]: Theorem 1.2 ([17]). Pr h supt Fn(t) −F(t) > ϵ i ≤2 exp(−2nϵ2) for all ϵ > 0, n ∈N. The above theorems show that, with high probability, F and Fn are close up to some additive error. We would have liked to prove a stronger, multiplicative bound on the error: ∀t : F(t) −Fn(t) ≤ϵ · F(t). However, for some distributions, the above event has probability 0, no matter how large n is. For example, assume that µ satisfies F(t) > 0 for all t. Since the empirical measure µn has finite support, there is t with Fn(t) = 0; for such a value of t, such a multiplicative approximation fails to hold. So, the above multiplicative requirement is too strong to hold in general. A natural compromise is to consider a submultiplicative bound: ∀t : F(t) −Fn(t) ≤ϵ · F(t)α, where 0 ≤α < 1. When α = 0, this is the additive bound studied in the context of the GlivenkoCantelli Theorem. When α = 1, this is the unattainable multiplicative bound. Our first main result shows that the case of α < 1 is attainable: Theorem 1.3 (Submultiplicative Glivenko-Cantelli Theorem). Let ϵ > 0, δ > 0 and 0 ≤α < 1. There exists n0(ϵ, δ, α) such that for all n > n0, with probability 1 −δ: ∀t : F(t) −Fn(t) ≤ϵ · F(t)α. It is worth pointing out a central difference between Theorem 1.3 and other generalizations of the Glivenko-Cantelli Theorem: for example, the seminal work of Vapnik and Chervonenkis [24] shows that for every class of events F of VC dimension d, there is n0 = n0(ϵ, δ, d) such that for every n ≥n0, with probability 1 −δ it holds that ∀A ∈F : p(A) −pn(A) ≤ϵ. This yields Glivenko-Cantelli by plugging F =  (−∞, t] : t ∈R , which has VC dimension 1. In contrast, the submultiplicative bound from Theorem 1.3 does not even extend to the VC dimension 1 class F =  {t} : t ∈R . Indeed, pick any distribution p over R such that p {t}  = 0 for every t, and observe that for every sample x1, . . . , xn, it holds that pn {xi}  ≥1/n, however p {xi}  = 0, and therefore, as long as α > 0, it is never the case that p {xi}  −pn {xi}  ≤p {xi} α. Our second main result gives an explicit upper bound on n0(ϵ, δ, α): Theorem 1.4 (Submultiplicative Glivenko-Cantelli Bound). Let ϵ, δ ≤1/4, and α < 1. Then n0(ϵ, δ, α) ≤max    ln 6/δ  2ϵ2 ϵδ 3 −4α 1−α , (D + 1) 10 · ln  12 · D + 4 δ(1 −α) ! 4α 1−α   , where D = ln(6/δ) 2ϵ2  ϵδ 6 · ln 1+α 2α −4α 1−α . Note that for fixed ϵ, δ, when α →0 the above bound approaches the familiar O  ln(1/δ) ϵ2  bound by DKW [12] and Massart [17] for α = 0. On the other hand, when α →1 the above bound tends 1The inequality due to [12] has a larger constant C in front of the exponent on the right hand side. 2 to ∞, reflecting the fact that the multiplicative variant of Glivenko-Cantelli (α = 1) does not hold. Theorems 1.3 and 1.4 are proven in the supplementary material. Note that the dependency of the above bound on the confidence parameter δ is polynomial. This contrasts with standard uniform convergence rates, which, due to applications of concentration bounds such as Chernoff/Hoeffding, achieve logarithmic dependencies on δ. These concentration bounds are not applicable in our setting when the CDF values are very small, and we use Markov’s inequality instead. The following example shows that a polynomial dependency on δ is indeed necessary and is not due to a limitation of our proof. Example 1.5. For large n, consider n independent samples x1, . . . , xn from the uniform distribution over [0, 1], and set α = 1/2 and ϵ = 1. The probability of the event ∃i : xi ≤1/n3 is roughly 1/n2: indeed, the complementary event has probability (1−1/n3)n ≈exp(−1/n2) ≈1− 1/n2. When this happens, we have: Fn(1/n3) ≥1/n >> 1/n3+1/n 3/2 = F(1/n3)+  F(1/n3) 1/2. Note that this happens with probability inverse polynomial in n (roughly 1/n2) and not inverse exponential. An application to revenue learning. We demonstrate an application of our Submultiplicative Glivenko-Cantelli Theorem in the context of a widely studied problem in economics and algorithmic game theory: the problem of revenue learning. In the setting of this problem, a seller has to decide which price to post for a good she wishes to sell. Assume that each consumer draws her private valuation for the good from an unknown distribution µ. We envision that a consumer with valuation v will buy the good at any price p ≤v, but not at any higher price. This implies that the expected revenue at price p is simply r(p) ≜p · q(p), where q(p) ≜PrV ∼µ[V ≥p]. In the language of machine learning, this problem can be phrased as follows: the examples domain Z ≜R+ is the set of all valuations v. The hypothesis space H ≜R+ is the set of all prices p. The revenue (which is a gain, rather than loss) of a price p on a valuation v is the function p · 1{p≤v}. The well-known revenue maximization problem is to find a price p∗that maximizes the expected revenue, given a sample of valuations drawn i.i.d. from µ. In this paper, we consider the more demanding revenue estimation problem: the problem of well-approximating r(p), simultaneously for all prices p, from a given sample of valuations. (This clearly also implies a good estimation of the maximum revenue and of a price that yields it.) More specifically, we address the following question: when do the empirical revenues, rn(p) ≜p · qn(p), where qn(p) ≜PrV ∼µn[V ≥p] = 1 n · {1 ≤ i ≤n : xi ≥t} , uniformly converge to the true revenues r(p)? More specifically, we would like to show that for some n0, for n ≥n0 we have with probability 1 −δ that r(p) −rn(p) ≤ϵ. The revenue estimation problem is a basic instance of the more general problem of uniform convergence of empirical estimates. The main challenge in this instance is that the prices are unbounded (and so are the private valuations that are drawn from the distribution µ). Unfortunately, there is no (upper) bound on n0 that is only a function of ϵ and δ. Moreover, even if we add the expectation of valuations, i.e., E[V ] where V is distributed according to µ, still there is no bound on n0 that is a function of only those three parameters (see Section 2.3 for an example). In contrast, when we consider higher moments of the distribution µ, we are able to derive bounds on the value of n0. These bounds are based on our Submultiplicative Glivenko-Cantelli Bound. Specifically, assume that EV ∼µ[V 1+θ] ≤C for some θ > 0 and C ≥1. Then, we show that for any ϵ, δ ∈(0, 1), we have Pr h ∃v : r(v) −rn(v) > ϵ i ≤Pr  ∃v : q(v) −qn(v) > ϵ C 1 1+θ q(v) 1 1+θ  . This essentially reduces uniform convergence bounds to our Submultiplicative Glivenko-Cantelli variant. It then follows that there exists n0(C, θ, ϵ, δ) such that for any n ≥n0, with probability at least 1 −δ, ∀v : rn(v) −r(v) ≤ϵ. 3 We remark that when θ is large, our bound yields n0 ≈O  ln(1/δ) ϵ2  , which recovers the standard sample complexity bounds obtainable via DKW [12] and Massart [17]. When θ →0, our bound diverges to infinity, reflecting the fact (discussed above) that there is no bound on n0 that depends only on ϵ, δ, and E[V ]. Nevertheless, we find that E[V ] qualitatively determines whether uniform convergence occurs in the limit. Namely, we show that • If Eµ[V ] < ∞, then almost surely limn→∞supv r(v) −rn(v) = 0, • Conversely, if Eµ[V ] = ∞, then almost never limn→∞supv r(v) −rn(v) = 0. 1.1 Related work Generalizations of Glivenko-Cantelli. Various generalizations of the Glivenko-Cantelli Theorem were established. These include uniform convergence bounds for more general classes of functions as well as more general loss functions (for example, [24, 23, 16, 2]). The results that concern unbounded loss functions are most relevant to this work (for example, [9, 8, 23]). We next briefly discuss the relevant results from Cortes et al. [8] in the context of this paper; more specifically, in the context of Theorem 1.3. To ease presentation, set α in this theorem to be 1/2. Theorem 1.3 analyzes the event where the empirical quantile is bounded by2 qn(p) ≤q(p) + ϵ p q(p), qn(p) ≥q(p) −ϵ p q(p). whereas, [8] analyzes the event where it is bounded it by: qn(p) ≤˜O q(p) + p q(p)/n + 1/n  , qn(p) ≥˜Ω q(p) − p qn(p)/n −1/n  Thus, the main difference is the additive 1/n term in the bound from [8]. In the context of uniform convergence of revenues, it is crucial to use the upper bound on the empirical quantile as we do, as it guarantees that large prices will not overfit, which is the main challenge in proving uniform convergence in this context. In particular, the upper bound from [8] does not provide any guarantee on the revenues of prices p >> n, as for such prices p · 1/n >> 1. It is also worth pointing out that our lower bound on the empirical quantile implies that with high probability the quantile of the maximum sampled point is at least 1/n2 (or more generally, at least 1/n1/α when α ̸= 1/2), while the bound from [8] does not imply any non-trivial lower bound. Another, more qualitative difference is that unlike the bounds in [8] that apply for general VC classes, our bound is tailored for the class of thresholds (corresponding to CDF/quantiles), and does not extend even to other classes of VC dimension 1 (see the discussion after Theorem 1.3). Uniform convergence of revenues. The problem of revenue maximization is a central problem in economics and Algorithmic Game Theory (AGT). The seminal work of Myerson [20] shows that given a valuation distribution for a single good, the revenue-maximizing selling mechanism for this good is a posted-price mechanism. In the recent years, there has been a growing interest in the case where the valuation distribution is unknown, but the seller observes samples drawn from it. Most papers in this direction assume that the distribution meets some tail condition that is considered “natural” within the algorithmic game theory community, such as boundedness [18, 21, 19, 1, 14, 10]3, such as a condition known as Myerson-regularity [11, 15, 7, 10], or such as a condition known as monotone hazard rate [15].4 These papers then go on to derive computation- or sample-complexity 2For consistency with the canonical statement of the Glivenko-Cantelli theorem, we stated our submultiplicative variants of this theorem with regard to the CDFs Fn and F. However, these results also hold when replacing these CDFs with the respective quantiles (tail CDFs) qn and q. See Section 2.2 for details. 3The analysis of [1] assumes a bound on the realized revenue (from any possible valuation profile) of any mechanism/auction in the class that they consider. For the class of posted-price mechanisms, this is equivalent to assuming a bound on the support of the valuation distribution. Indeed, for any valuation v, pricing at v gives realized revenue v (from the valuation v), and so unbounded valuations (together with the ability to post unbounded prices) imply unbounded realized revenues. 4Both Myerson-regularity and monotone hazard rate are conditions on the second derivative of the revenue as a function of the quantile of the underlying distribution. In particular, they impose restrictions on the tail of the distribution. 4 bounds on learning an optimal price (or an optimal selling mechanism from a given class) for a distribution that meets the assumed condition. A recurring theme in statistical learning theory is that learnability guarantees are derived via a, sometimes implicit, uniform convergence bound. However, this has not been the case in the context of revenue learning. Indeed, while some papers that studied bounded distributions [18, 21, 19, 1] did use uniform convergence bounds as part of their analysis, other papers, in particular those that considered unbounded distributions, had to bypass the usage of uniform convergence by more specialized arguments. This is due to the fact that many unbounded distributions do not satisfy any uniform convergence bound. As a concrete example, the (unbounded, Myerson-regular) equal revenue distribution5 has an infinite expectation and therefore, by our Theorem 2.3, satisfies no uniform convergence, even in the limit. Thus, it turns out that the works that studied the popular class of Myerson-regular distributions [11, 15, 7, 10] indeed could not have hoped to establish learnability via a uniform convergence argument. For instance, the way [11, 7] establish learnability for Myerson-regular distributions is by considering the guarded ERM algorithm (an algorithm that chooses an empirical revenue maximizing price that is smaller than, say, the √nth largest sampled price), and proving a uniform convergence bound, not for all prices, but only for prices that are, say, smaller than the √nth largest sampled price, and then arguing that larger prices are likely to have a small empirical revenue, compared to the guarded empirical revenue maximizer. This means that the guarded ERM will output a good price, but it does not (and cannot) imply uniform convergence for all prices. We complement the extensive literature surveyed above in a few ways. The first is generalizing the revenue maximization problem to a revenue estimation problem, where the goal is to uniformly estimate the revenue of all possible prices, when no bound on the possible valuations is given (or even exists). The problem of revenue estimation arises naturally when the seller has additional considerations when pricing her good, such as regulations that limit the price choice, bad publicity if the price is too high (or, conversely, damage to prestige if the price is too low), or willingness to suffer some revenue loss for better market penetration (which may translate to more revenue in the future). In such a case, the seller may wish to estimate the revenue loss due to posting a discounted (or inflated) price. The second, and most important, contribution to the above literature is that we consider arbitrary distributions rather than very specific and limited classes of distributions (e.g., bounded, Myersonregular, monotone hazard rate, etc.). Third, we derive finite sample bounds in the case that the expected valuation is bounded for some moment larger than 1. We further derive a zero-one law for uniform convergence in the limit that depends on the finiteness of the first moment. Technically, our bounds are based on an additive error rather than multiplicative ones, which are popular in the AGT community. 1.2 Paper organization The rest of the paper is organized as follows. Section 2 contains the application of our Submultiplicative Glivenko-Cantelli to revenue estimation, and Section 3 contains a discussion and possible directions of future work. The proof of the Submultiplicative Glivenko-Cantelli variant, and some extensions of it, appear in the supplementary material. 2 Uniform Convergence of Empirical Revenues In this section we demonstrate an application of our Submultiplicative Glivenko-Cantelli variant by establishing uniform convergence bounds for a family of unbounded random variables in the context of revenue estimation. 2.1 Model Consider a good g that we wish to post a price for. Let V be a random variable that models the valuation of a random consumer for g. Technically, it is assumed that V is a nonnegative random variable, and we denote by µ its induced distribution over R+. A consumer who values g at a 5This is a distribution that satisfies the special property that all prices have the same expected revenue. 5 valuation v is willing to buy the good at any price p ≤v, but not at any higher price. This implies that the realized revenue to the seller from a (posted) price p is the random variable p · 1{p≤V }. The quantile of a value v ∈R+ is q(v) = q(v; µ) ≜µ {x : x ≥v}  . This models the fraction of the consumers in the population that are willing to purchase the good if priced at v. The expected revenue from a (posted) price p ∈R+ is r(p) = r(p; µ) ≜E µ  p · 1{p≤V }  = p · q(p). Let V1, V2, . . . be a sequence of i.i.d. valuations drawn from µ, and let v1, v2, . . . be their realizations. The empirical quantile of a value v ∈R+ is qn(v) = q(v; µn) ≜1 n · {1 ≤i ≤n : vi ≥v} . The empirical revenue from a price p ∈R+ is rn(p) = r(p; µn) ≜E µn  p · 1{p≤V }  = p · qn(p). The revenue estimation error for a given sample of size n is ϵn ≜sup p rn(p) −r(p) . It is worth highlighting the difference between revenue estimation and revenue maximization. Let p∗ be a price that maximizes the revenue, i.e., p∗∈arg supp r(p). The maximum revenue is r∗= r(p∗). The goal in many works in revenue maximization is to find a price ˆp such that r∗−r(ˆp) ≤ϵ, or alternatively, to bound r∗/r(ˆp). Given a revenue-estimation error ϵn, one can clearly maximize the revenue within an additive error of 2ϵn by simply posting a price p∗ n ∈arg maxp rn(p), thereby attaining revenue r∗ n = r(p∗ n). This follows since r∗ n = r(p∗ n) ≥rn(p∗ n) −ϵn ≥rn(p∗) −ϵn ≥r(p∗) −2ϵn = r∗−2ϵn. Therefore, good revenue estimation implies good revenue maximization. We note that the converse does not hold. Namely, there are distributions for which revenue maximization is trivial but revenue estimation is impossible. One such case is the equal revenue distribution, where all values in the support of µ have the same expected revenue. For such distributions, the problem of revenue maximization becomes trivial, since any posted price is optimal. However, as follows from Theorem 2.3, since the expected revenue of such distributions is infinite, almost never do the empirical revenues uniformly converge to the true revenues. 2.2 Quantitative bounds on the uniform convergence rate Recall that we are interested in deriving sample bounds that would guarantee uniform convergence for the revenue estimation problem. We will show that given an upper bound on the kth moment of V for some k > 1, we can derive a finite sample bound. To this end we utilize our Submultiplicative Glivenko-Cantelli Bound (Theorem 1.4). We also consider the case of k = 1, namely that E[V ] is bounded, and show that in this case there is still uniform convergence in the limit, but that there cannot be any guarantees on the convergence rate. Interestingly, it turns out that E[V ] < ∞is not only sufficient but also necessary so that in the limit, the empirical revenues uniformly converge to the true revenues (see Section 2.3). We begin by showing that bounds on the kth moment for k > 1 yield explicit bounds on the convergence rate. It is convenient to parametrize by setting k = 1 + θ, where θ > 0. Theorem 2.1. Let EV ∼µ[V 1+θ] ≤C for some θ > 0 and C ≥1, and let ϵ, δ ∈(0, 1). Set6 n0 = ˜O ln(1/δ) ϵ2 C 2 1+θ  6 · C 1 1+θ ϵδ ln 1 + θ/2  4/θ! . (1) For any n ≥n0, with probability at least 1 −δ, ∀v : rn(v) −r(v) ≤ϵ. 6The ˜O conceals low order terms. 6 Note that when θ is large, this bound approaches the standard O  ln(1/δ) ϵ2  sample complexity bound of the additive Glivenko-Cantelli. For example, if all moments are uniformly bounded, then the convergence is roughly as fast as in standard uniform convergence settings (e.g., VC-dimension based bounds). The proof of Theorem 2.1 follows from Theorem 1.4 and the next proposition, which reduces bounds on the uniform convergence rate of the empirical revenues to our Submultiplicative Glivenko-Cantelli. Proposition 2.2. Let EV ∼µ[V 1+θ] ≤C for some θ > 0 and C ≥1, and let ϵ, δ ∈(0, 1). Then, Pr h ∃v : r(v) −rn(v) > ϵ i ≤Pr  ∃v : q(v) −qn(v) > ϵ C 1 1+θ q(v) 1 1+θ  . Thus, to prove Theorem 2.1, we first note that Theorem 1.4 (as well as Theorem 1.3) also holds when Fn and F are respectively replaced in the definition of n0 with qn and q (indeed, applying Theorem 1.4 to the measure µ′ defined by µ′(A) ≜µ {−a | a ∈A}  yields the required result with regard to the measure µ). We then plug ϵ ← ϵ C 1 1+θ and α ← 1 1+θ into this variant of Theorem 1.4 to yield a bound on the right-hand side of the inequality in Proposition 2.2, whose application concludes the proof. Proof of Proposition 2.2. By Markov’s inequality: q(v) = Pr[V ≥v] = Pr[V 1+θ ≥v1+θ] ≤ C v1+θ . (2) Now, Pr h ∃v : r(v)−rn(v) > ϵ i = Pr h ∃v : v · q(v)−v · qn(v) > ϵ i = Pr h ∃v : v · q(v)−v · qn(v) > ϵ (v1+θ · q(v)) 1 1+θ (v1+θ·q(v)) 1 1+θ i ≤Pr h ∃v : v · q(v)−v · qn(v) > ϵ C 1 1+θ (v1+θ·q(v)) 1 1+θ i = Pr h ∃v : q(v)−qn(v) > ϵ C 1 1+θ q(v) 1 1+θ i . where the inequality follows from Equation (2). 2.3 A qualitative characterization of uniform convergence The sample complexity bounds in Theorem 2.1 are meaningful as long as θ > 0, but deteriorate drastically as θ →0. Indeed, as the following example shows, there is no bound on the uniform convergence sample complexity that depends only on the first moment of V , i.e., its expectation. Consider a distribution ηp so that with probability p we have V = 1/p and otherwise V = 0. Clearly, E[V ] = 1. However, we need to sample mp = O(1/p) valuations to see a single nonzero value. Therefore, there is no bound on the sample size mp as a function of the expectation, which is simply 1. We can now consider the higher moments of ηp. Consider the kth moment, for k = 1 + θ and θ > 0, so k > 1. For this moment, we have Ap,θ = E[V 1+θ] = pθ/(1+θ), which implies that mp = O 1/(Ap,θ)(1+θ)/θ . This does allow us to bound mp as a function of θ and E[V 1+θ], but for small θ we have a huge exponent of approximately 1/θ. While the above examples show that there cannot be a bound on the sample size as a function of the expectation of the value, it turns out that there is a very tight connection between the first moment and uniform convergence: Theorem 2.3. The following dichotomy holds for a distribution µ on R+: 1. If Eµ[V ] < ∞, then almost surely limn→∞supv r(v) −rn(v) = 0. 2. If Eµ[V ] = ∞, then almost never limn→∞supv r(v) −rn(v) = 0. 7 That is, the empirical revenues uniformly converge to the true revenues if and only if Eµ[V ] < ∞. We use the following basic fact in the Proof of Theorem 2.3: Lemma 2.4. Let X be a nonnegative random variable. Then ∞ X n=1 Pr[X ≥n] ≤E[X] ≤ ∞ X n=0 Pr[X ≥n]. Proof. Note that: ∞ X n=1 1{X≥n} = ⌊X⌋≤X ≤⌊X⌋+ 1 = ∞ X n=0 1{X≥n}. The lemma follows by taking expectations. Proof of Theorem 2.3. We start by proving item 2. Let µ be a distribution such that Eµ  V  = ∞. If supv v · q(v) = ∞then for every realization v1, . . . , vn there is some v ≥max{v1, . . . , vn} such that v ·q(v) ≥1, but v ·qn(v) = 0. So, we may assume supv v ·q(v) < ∞. Without loss of generality we may assume that supv v ·q(v) = 1/2 by rescaling the distribution if needed. Consider the sequence of events E1, E2, . . . where En denotes the event that Vn ≥n. Since Eµ  V  = ∞, Lemma 2.4 implies that P∞ n=1 Pr[En] = ∞. Thus, since these events are independent, the second Borel-Cantelli Lemma [4, 5] implies that almost surely, infinitely many of them occur and so infinitely often Vn · qn(Vn) ≥1 ≥Vn · q(Vn) + 1 2. Therefore, the probability that v · qn(v) uniformly converge to v · q(v) is 0. Item 1 follows from the following monotone domination theorem: Theorem 2.5. Let F be a family of nonnegative monotone functions, and let F be an upper envelope7 for F. If Eµ[F] < ∞, then almost surely: lim n→∞sup f∈F E µ[f] −E µn[f] = 0. Indeed, item 1 follows by plugging F =  v · 1x≥v : v ∈R+ , which is uniformly bounded by the identity function F(x) = x. Now, by assumption Eµ[F] < ∞, and therefore, almost surely lim n→∞sup v∈R+ r(v) −rn(v) = lim n→∞sup f∈F E µ[f] −E µn[f] = 0. Theorem 2.5 follows by known results in the theory of empirical processes (for example, with some work it can be proved using Theorem 2.4.3 from Vaart and Wellner [22]). For completeness, we give a short and basic proof in the supplementary material. 3 Discussion Our main result is a submultiplicative variant of the Glivenko-Cantelli Theorem, which allows for tighter convergence bounds for extreme values of the CDF. We show that for the revenue learning setting our submultiplicative bound can be used to derive uniform convergence sample complexity bounds, assuming a finite bound on the kth moment of the valuations, for any (possibly fractional) k > 1. For uniform convergence in the limit, we give a complete characterization, where uniform convergence almost surely occurs if and only if the first moment is finite. It would be interesting to find other applications of our submultiplicative bound in other settings. A potentially interesting direction is to consider unbounded loss functions (e.g., the squared-loss, or log-loss). Many works circumvent the unboundedness in such cases by ensuring (implicitly) that the losses are bounded, e.g., through restricting the inputs and the hypotheses. Our bound offers a different perspective of addressing this issue. In this paper we consider revenue learning, and replace the boundedness assumption by assuming bounds on higher moments. An interesting challenge is to 7F is an upper envelope for F if F(v) ≥f(v) for every v ∈V and f ∈F. 8 prove uniform convergence bounds for other practically interesting settings. One such setting might be estimating the effect of outliers (which correspond to the extreme values of the loss). In the context of revenue estimation, this work only considers the most naïve estimator, namely of estimating the revenues by the empirical revenues. One can envision other estimators, for example ones which regularize the extreme tail of the sample. Such estimators may have a potential of better guarantees or better convergence bounds. In the context of uniform convergence of selling mechanism revenues, this work only considers the basic class of posted-price mechanisms. While for one good and one valuation distribution, it is always possible to maximize revenue via a selling mechanism of this class, this is not the case in more complex auction environments. While in many more-complex environments, the revenue-maximizing mechanism/auction is still not understood well enough, for environments where it is understood [7, 10, 14] (as well as for simple auction classes that do not necessarily contain a revenue-maximizing auction [19, 1]) it would also be interesting to study relaxations of the restrictive tail or boundedness assumptions currently common in the literature. Acknowledgments The research of Noga Alon is supported in part by an ISF grant and by a GIF grant. Yannai Gonczarowski is supported by the Adams Fellowship Program of the Israel Academy of Sciences and Humanities; his work is supported by ISF grant 1435/14 administered by the Israeli Academy of Sciences and by Israel-USA Bi-national Science Foundation (BSF) grant number 2014389; this project has received funding from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (grant agreement No 740282). The research of Yishay Mansour was supported in part by The Israeli Centers of Research Excellence (I-CORE) program (Center No. 4/11), by a grant from the Israel Science Foundation, and by a grant from United States-Israel Binational Science Foundation (BSF); the research was done while author was co-affiliated with Microsoft Research. The research of Shay Moran is supported by the National Science Foundations and the Simons Foundations; part of the research was done while author was co-affiliated with Microsoft Research. The research of Amir Yehudayoff is supported by ISF grant 1162/15. References [1] Maria-Florina Balcan, Tuomas Sandholm, and Ellen Vitercik. Sample complexity of automated mechanism design. In Proceedings of the 30th Conference on Neural Information Processing Systems (NIPS), pages 2083–2091, 2016. [2] Peter L. Bartlett and Shahar Mendelson. Rademacher and gaussian complexities: Risk bounds and structural results. Journal of Machine Learning Research, 3:463–482, 2002. [3] Z. W. Birnbaum and R. C. McCarty. A distribution-free upper confidence bound for Pr{Y < X}, based on independent samples of X and Y . The Annals of Mathematical Statistics, 29(2):558–562, 1958. [4] Émile Borel. Les probabilités dénombrables et leurs applications arithmétiques. Rendiconti del Circolo Matematico di Palermo (1884-1940), 27(1):247–271, 1909. [5] Francesco Paolo Cantelli. Sulla probabilitá come limite della frequenza. Atti Accad. Naz. Lincei, 26(1):39– 45, 1917. [6] Francesco Paolo Cantelli. Sulla determinazione empirica delle leggi di probabilita. Giornalle dell’Istituto Italiano degli Attuari, 4:421–424, 1933. [7] Richard Cole and Tim Roughgarden. The sample complexity of revenue maximization. In Proceedings of the 46th Annual ACM Symposium on Theory of Computing (STOC), pages 243–252, 2014. [8] Corinna Cortes, Spencer Greenberg, and Mehryar Mohri. Relative deviation learning bounds and generalization with unbounded loss functions. CoRR, abs/1310.5796, 2013. [9] Corinna Cortes, Yishay Mansour, and Mehryar Mohri. Learning bounds for importance weighting. In Proceedings of the 24th Conference on Neural Information Processing Systems (NIPS), pages 442–450, 2010. [10] Nikhil R. Devanur, Zhiyi Huang, and Christos-Alexandros Psomas. The sample complexity of auctions with side information. In Proceedings of the 48th Annual ACM Symposium on Theory of Computing (STOC), pages 426–439, 2016. 9 [11] Peerapong Dhangwatnotai, Tim Roughgarden, and Qiqi Yan. Revenue maximization with a single sample. Games and Economic Behavior, 91:318–333, 2015. [12] Aryeh Dvoretzky, Jack Kiefer, and Jacob Wolfowitz. Asymptotic minimax character of the sample distribution function and of the classical multinomial estimator. The Annals of Mathematical Statistics, 27(3):642–669, 1956. [13] VL Glivenko. Sulla determinazione empirica delle leggi di probabilita. Giornalle dell’Istituto Italiano degli Attuari, 4:92–99, 1933. [14] Yannai A. Gonczarowski and Noam Nisan. Efficient empirical revenue maximization in single-parameter auction environments. In Proceedings of the 49th Annual ACM Symposium on Theory of Computing (STOC), pages 856–868, 2017. [15] Zhiyi Huang, Yishay Mansour, and Tim Roughgarden. Making the most of your samples. In Proceedings of the 16th ACM Conference on Economics and Computation (EC), pages 45–60, 2015. [16] Vladimir Koltchinskii and Dmitriy Panchenko. Rademacher Processes and Bounding the Risk of Function Learning, pages 443–457. Birkhäuser Boston, Boston, MA, 2000. [17] Pascal Massart. The tight constant in the dvoretzky-kiefer-wolfowitz inequality. The Annals of Probability, 18(3):1269–1283, 1990. [18] Jamie Morgenstern and Tim Roughgarden. On the pseudo-dimension of nearly optimal auctions. In Proceedings of the 29th Conference on Neural Information Processing Systems (NIPS), pages 136–144, 2015. [19] Jamie Morgenstern and Tim Roughgarden. Learning simple auctions. In Proceedings of the 29th Annual Conference on Learning Theory (COLT), pages 1298–1318, 2016. [20] Roger Myerson. Optimal auction design. Mathematics of Operations Research, 6(1):58–73, 1981. [21] Tim Roughgarden and Okke Schrijvers. Ironing in the dark. In Proceedings of the 17th ACM Conference on Economics and Computation (EC), pages 1–18, 2016. [22] A. W. van der Vaart and Jon August Wellner. Weak convergence and empirical processes : with applications to statistics. Springer series in statistics. Springer, New York, 1996. Réimpr. avec corrections 2000. [23] Vladimir Vapnik. Statistical Learning Theory. Wiley, 1998. [24] V.N. Vapnik and A.Ya. Chervonenkis. On the uniform convergence of relative frequencies of events to their probabilities. Theory Probab. Appl., 16:264–280, 1971. 10
2017
624
7,146
Tensor Biclustering Soheil Feizi Stanford University sfeizi@stanford.edu Hamid Javadi Stanford University hrhakim@stanford.edu David Tse Stanford University dntse@stanford.edu Abstract Consider a dataset where data is collected on multiple features of multiple individuals over multiple times. This type of data can be represented as a three dimensional individual/feature/time tensor and has become increasingly prominent in various areas of science. The tensor biclustering problem computes a subset of individuals and a subset of features whose signal trajectories over time lie in a low-dimensional subspace, modeling similarity among the signal trajectories while allowing different scalings across different individuals or different features. We study the information-theoretic limit of this problem under a generative model. Moreover, we propose an efficient spectral algorithm to solve the tensor biclustering problem and analyze its achievability bound in an asymptotic regime. Finally, we show the efficiency of our proposed method in several synthetic and real datasets. 1 Introduction Let T ∈Rn1×n2 be a data matrix whose rows and columns represent individuals and features, respectively. Given T, the matrix biclustering problem aims to find a subset of individuals (i.e., J1 ⊂{1, 2, ..., n1}) which exhibit similar values across a subset of features (i.e., J2 ⊂{1, 2, ..., n2}) (Figure 1-a). The matrix biclustering problem has been studied extensively in machine learning and statistics and is closely related to problems of sub-matrix localization, planted clique and community detection [1, 2, 3]. In modern datasets, however, instead of collecting data on every individual-feature pair at a single time, we may collect data at multiple times. One can visualize a trajectory over time for each individual-feature pair. This type of datasets has become increasingly prominent in different areas of science. For example, the roadmap epigenomics dataset [4] provides multiple histon modification marks for genome-tissue pairs, the genotype-tissue expression dataset [5] provides expression data on multiple genes for individual-tissue pairs, while there have been recent efforts to collect various omics data in individuals at different times [6]. Suppose we have n1 individuals, n2 features, and we collect data for every individual-feature pair at m different times. This data can be represented as a three dimensional tensor T ∈Rn1×n2×m (Figure 1-b). The tensor biclustering problem aims to compute a subset of individuals and a subset of features whose trajectories are highly similar. Similarity is modeled as the trajectories as lying in a low-dimensional (say one-dimensional) subspace (Figure 1-d). This definition allows different scalings across different individuals or different features, and is important in many applications such as in omics datasets [6] because individual-feature trajectories often have their own intrinsic scalings. In particular, at each time the individual-feature data matrix may not exhibit a matrix bicluster separately. This means that repeated applications of matrix biclustering cannot solve the tensor biclustering problem. Moreover, owing to the same reason, trajectories in a bicluster can have large distances among themselves (Figure 1-d). Thus, a distance-based clustering of signal trajectories is likely to fail as well. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. -24 -1 0 2 4 1 2 2 0 3 0 -2 -2 -4 -4 -34 -2 -1 2 4 0 1 2 0 2 3 0 -2 -2 -4 -4 All Trajectories Trajectories in the Bicluster (d) (c) (b) (a) Tensor Triclustering features times individuals Tensor Biclustering features individuals Our Model Tensor Biclustering Matrix Biclustering features times individuals Figure 1: (a) The matrix biclustering problem. (b) The tensor biclustering problem. (c) The tensor triclustering problem. (d) A visualization of a bicluster in a three dimensional tensor. Trajectories in the bicluster (red points) form a low dimensional subspace. This problem formulation has two main differences with tensor triclustering, which is a natural generalization of matrix biclustering to a three dimensional tensor (Figure 1-c). Firstly, unlike tensor triclustering, tensor biclustering has an asymmetric structure along tensor dimensions inspired by aforementioned applications. That is, since a tensor bicluster is defined as a subset of individuals and a subset of features with similar trajectories, the third dimension of the tensor (i.e., the time dimension) plays a different role compared to the other two dimensions. This is in contrast with tensor triclustering where there is not such a difference between roles of tensor dimensions in defining the cluster. Secondly, in tensor biclustering, the notion of a cluster is defined regarding to trajectories lying in a low-dimensional subspace while in tensor triclustering, a cluster is defined as a sub-cube with similar entries. Finding statistically significant patterns in multi-dimensional data tensors has been studied in dimensionality reduction [7, 8, 9, 10, 11, 12, 13, 14], topic modeling [15, 16, 17], among others. One related model is the spiked tensor model [7]. Unlike the tensor biclustering model that is asymmetric along tensor dimensions, the spiked tensor model has a symmetric structure. Computational and statistical limits for the spiked tensor model have been studied in [8, 9, 10, 14], among others. For more details, see Supplementary Materials (SM) Section 1.3. In this paper, we study information-theoretic and computational limits for the tensor biclustering problem under a statistical model described in Section 2. From a computational perspective, we present four polynomial time methods and analyze their asymptotic achievability bounds. In particular, one of our proposed methods, namely tensor folding+spectral, outperforms other methods both theoretically (under realistic model parameters) and numerically in several synthetic and real data experiments. Moreover, we characterize a fundamental limit under which no algorithm can solve the tensor biclustering problem reliably in a minimax sense. We show that above this limit, a maximum likelihood estimator (MLE) which has an exponential computational complexity can solve this problem with vanishing error probability. 1.1 Notation We use T , X, and Z to represent input, signal, and noise tensors, respectively. For any set J, |J| denotes its cardinality. [n] represents the set {1, 2, ..., n}. ¯J = [n] −J. ∥x∥2 = (xtx)1/2 is the second norm of the vector x. x ⊗y is the Kronecker product of two vectors x and y. The asymptotic notation a(n) = O(b(n)) means that, there exists a universal constant c such that for sufficiently 2 large n, we have |a(n)| < cb(n). If there exists c > 0 such that a(n) = O(b(n) log(n)c), we use the notation a(n) = ˜O(b(n)). The asymptotic notation a(n) = Ω(b(n)) and a(n) = ˜Ω(b(n)) is the same as b(n) = O(a(n)) and b(n) = ˜O(a(n)), respectively. Moreover, we write a(n) = Θ(b(n)) iff a(n) = Ω(b(n)) and b(n) = Ω(a(n)). Similarly, we write a(n) = ˜Θ(b(n)) iff a(n) = ˜Ω(b(n)) and b(n) = ˜Ω(a(n)). 2 Problem Formulation Let T = X + Z where X is the signal tensor and Z is the noise tensor. Consider T = X + Z = q X r=1 σru(J1) r ⊗w(J2) r ⊗vr + Z, (1) where u(J1) r and w(J2) r have zero entries outside of J1 and J2 index sets, respectively. We assume σ1 ≥σ2 ≥... ≥σq > 0. Under this model, trajectories X(J1, J2, :) form an at most q dimensional subspace. We assume q ≪min(m, |J1| × |J2|). Definition 1 (Tensor Biclustering). The problem of tensor biclustering aims to compute bicluster index sets (J1, J2) given T according to (1). In this paper, we make the following simplifying assumptions: we assume q = 1, n = |n1| = |n2|, and k = |J1| = |J2|. To simplify notation, we drop superscripts (J1) and (J2) from u(J1) 1 and w(J2) 1 , respectively. Without loss of generality, we normalize signal vectors such that ∥u1∥= ∥w1∥= ∥v1∥= 1. Moreover, we assume that for every (j1, j2) ∈J1 × J2, ∆≤u1(j1) ≤c∆ and ∆≤w1(j2) ≤c∆, where c is a constant. Under these assumptions, a signal trajectory can be written as X(j1, j2, :) = u1(j1)w1(j2)v1. The scaling of this trajectory depends on row and column specific parameters u1(j1) and w1(j2). Note that our analysis can be extended naturally to a more general setup of having multiple embedded biclusters with q > 1. We discuss this in Section 7. Next we describe the noise model. If (j1, j2) /∈J1 ×J2, we assume that entries of the noise trajectory Z(j1, j2, :) are i.i.d. and each entry has a standard normal distribution. If (j1, j2) ∈J1 × J2, we assume that entries of Z(j1, j2, :) are i.i.d. and each entry has a Gaussian distribution with zero mean and σ2 z variance. We analyze the tensor biclustering problem under two noise models for σ2 z: - Noise Model I: In this model, we assume σ2 z = 1, i.e., the variance of the noise within and outside of the bicluster is assumed to be the same. This is the noise model often considered in analysis of sub-matrix localization [2, 3] and tensor PCA [7, 8, 9, 10, 11, 12, 14]. Although this model simplifies the analysis, it has the following drawback: under this noise model, for every value of σ1, the average trajectory lengths in the bicluster is larger than the average trajectory lengths outside of the bicluster. See SM Section 1.2 for more details. - Noise Model II: In this model, we assume σ2 z = max(0, 1− σ2 1 mk2 ), i.e., σ2 z is modeled to minimize the difference between the average trajectory lengths within and outside of the bicluster. If σ2 1 < mk2, noise is added to make the average trajectory lengths within and outside of the bicluster comparable. See SM Section 1.2 for more details. 3 Computational Limits of the Tensor Biclustering Problem 3.1 Tensor Folding+Spectral Recall the formulation of the tensor biclustering problem (1). Let T(j1,1) ≜T (j1, :, :) and T(j2,2) ≜T (:, j2, :), (2) be horizontal (the first mode) and lateral (the second mode) matrix slices of the tensor T , respectively. One way to learn the embedded bicluster in the tensor is to compute row and column indices whose trajectories are highly correlated with each other. To do that, we compute C1 ≜ n X j2=1 Tt (j2,2)T(j2,2) and C2 ≜ n X j1=1 Tt (j1,1)T(j1,1). (3) 3 n2 n2 . . . . . . n2 m n2 m n1 Matrix Slices T T(n1, : , : ) T(k+1, : , : ) T(k, : , : ) T(1, : , : ) . . . . . . T(n1, : , : ) T(n1, : , : ) t T(1, : , : ) T(1, : , : ) t n2 n2 Combined Covariance Spectral Decomposition Bicluster Index Set (J2) Input Tensor Figure 2: A visualization of the tensor folding+spectral algorithm 1 to compute the bicluster index set J2. The bicluster index set J1 can be computed similarly. Algorithm 1 Tensor Folding+Spectral Input: T , k Compute ˆu1, the top eigenvector of C1 Compute ˆw1, the top eigenvector of C2 Compute ˆJ1, indices of the k largest values of | ˆw1| Compute ˆJ2, indices of the k largest values of |ˆu1| Output: ˆJ1 and ˆJ2 C1 represents a combined covariance matrix along the tensor columns (Figure 2). We refer to it as the folded tensor over the columns. If there was no noise, this matrix would be equal to σ2 1u1ut 1. Thus, its eigenvector corresponding to the largest eigenvalue would be equal to u1. On the other hand, we have u1(j1) = 0 if j1 /∈J1 and |u1(j1)| > ∆, otherwise. Therefore, selecting k indices of the top eigenvector with largest magnitudes would recover the index set J1. However, with added noise, the top eigenvector of the folded tensor would be a perturbed version of u1. Nevertheless one can estimate J1 similarly (Algorithm 1). A similar argument holds for C2. Theorem 1. Let ˆu1 and ˆw1 be top eigenvectors of C1 and C2, respectively. Under both noise models I and II, - for m < ˜O(√n), if σ2 1 = ˜Ω(n), - for m = ˜Ω(√n), if σ2 1 = ˜Ω(√n max(n, m)), as n →∞, with high probability, we have |ˆu1(j1)| > |ˆu1(j′ 1)| and | ˆw1(j2)| > | ˆw1(j′ 2)| for every j1 ∈J1, j′ 1 ∈¯J1, j2 ∈J2 and j′ 2 ∈¯J2. In the proof of Theorem 1, following the result of [18] for a Wigner noise matrix, we have proved an l∞version of the Davis-Kahan Lemma for a Wishart noise matrix. This lemma can be of independent interest for the readers. 3.2 Tensor Unfolding+Spectral Let Tunfolded ∈Rm×n2 be the unfolded tensor T such that Tunfolded(:, (j1 −1)n + j2) = T (j1, j2, :) for 1 ≤j1, j2 ≤n. Without noise, the right singular vector of this matrix is u1 ⊗w1 which corresponds to the singular value σ1. Therefore, selecting k2 indices of this singular vector with largest magnitudes would recover the index set J1 × J2. With added noise, however, the top singular vector of the unfolded tensor will be perturbed. Nevertheless one can estimate J1 × J2 similarly (SM Section 2). 4 Theorem 2. Let ˆx be the top right singular vector of Tunfolded. Under both noise models I and II, if σ2 1 = ˜Ω(max(n2, m)), as n →∞, with high probability, we have |ˆx(j′)| < |ˆx(j)| for every j in the bicluster and j′ outside of the bicluster. 3.3 Thresholding Sum of Squared and Individual Trajectory Lengths If the average trajectory lengths in the bicluster is larger than the one outside of the bicluster, methods based on trajectory length statistics can be successful in solving the tensor biclustering problem. One such method is thresholding individual trajectory lengths. In this method, we select k2 indices (j1, j2) with the largest trajectory length ∥T (j1, j2, :)∥(SM Section 2). Theorem 3. As n →∞, with high probability, ˆJ1 = J1 and ˆJ2 = J2 - if σ2 1 = ˜Ω(√mk2), under noise model I. - if σ2 1 = ˜Ω(mk2), under noise model II. Another method to solve the tensor biclustering problem is thresholding sum of squared trajectory lengths. In this method, we select k row indices with the largest sum of squared trajectory lengths along the columns as an estimation of J1. We estimate J2 similarly (SM Section 2). Theorem 4. As n →∞, with high probability, ˆJ1 = J1 and ˆJ2 = J2 - if σ2 1 = ˜Ω(k√nm), under noise model I. - if σ2 1 = ˜Ω(mk2 + k√nm), under noise model II. 4 Statistical (Information-Theoretic) Limits of the Tensor Biclustering Problem 4.1 Coherent Case In this section, we study a statistical (information theoretic) boundary for the tensor biclustering problem under the following statistical model: We assume u1(j1) = 1/ √ k for j1 ∈J1. Similarly, we assume w1(j2) = 1/ √ k for j2 ∈J2. Moreover, we assume v1 is a fixed given vector with ∥v1∥= 1. In the next section, we consider a non-coherent model where v1 is random and unknown. Let T be an observed tensor from the tensor biclustering model (J1, J2). Let Jall be the set of all possible (J1, J2). Thus, |Jall| = n k 2. A maximum likelihood estimator (MLE) for the tensor biclustering problem can be written as: max ˆ J∈Jall vt 1 X (j1,j2)∈ˆ J1× ˆ J2 T (j1, j2, :) −k(1 −σ2 z) 2σ1 X (j1,j2)∈ˆ J1× ˆ J2 ∥T (j1, j2, :)∥2 (4) ( ˆJ1, ˆJ2) ∈Jall. Note that under the noise model I, the second term is zero. To solve this optimization, one needs to compute the likelihood function for n k 2 possible bicluster indices. Thus, the computational complexity of the MLE is exponential in n. Theorem 5. Under noise model I, if σ2 1 = ˜Ω(k), as n →∞, with high probability, (J1, J2) is the optimal solution of optimization (4). A similar result holds under noise model II if mk = Ω(log(n/k)). Next, we establish an upper bound on σ2 1 under which no computational method can solve the tensor biclustering problem with vanishing probability of error. This upper bound indeed matches with the MLE achievability bound of Theorem 5 indicating its tightness. Theorem 6. Let T be an observed tensor from the tensor biclustering model with bicluster indices (J1, J2). Let A be an algorithm that uses T and computes ( ˆJ1, ˆJ2). Under noise model I, for any 5 fixed 0 < α < 1, if σ2 1 < cαk log(n/k), as n →∞, we have inf A∈AllAlg sup (J1,J2)∈Jall P h ˆJ1 ̸= J1 or ˆJ2 ̸= J2 i > 1 −α − log(2) 2k log(ne/k). (5) A similar result holds under noise model II if mk = Ω(log(n/k)). 4.2 Non-coherent Case In this section we consider a similar setup to the one of Section 4.1 with the difference that v1 is assumed to be uniformly distributed over a unit sphere. For simplicity, in this section we only consider noise model I. The ML optimization in this setup can be written as follows: max ˆ J∈Jall ∥ X (j1,j2)∈ˆ J1× ˆ J2 T (j1, j2, :)∥2 (6) ( ˆJ1, ˆJ2) ∈Jall. Theorem 7. Under noise model I, if σ2 1 = ˜Ω(max(k, √ km)), as n →∞, with high probability, (J1, J2) is the optimal solution of optimization (6). If k > Ω(m), the achievability bound of Theorem 7 simplifies to the one of Theorem 5. In this case, using the result of Theorem 6, this bound is tight. If k < O(m), the achievability bound of Theorem 7 simplifies to ˜Ω( √ mk) which is larger than the one of Theorem 5 (this is the price we pay for not knowing v1). In the following, we show that this bound is also tight. To show the converse of Theorem 7, we consider the detection task which is presumably easier than the estimation task. Consider two probability distributions: (1) Pσ1 under which the observed tensor is T = σ1u1 ⊗w1 ⊗v1 + Z where J1 and J2 have uniform distributions over k subsets of [n] and v1 is uniform over a unit sphere. (2) P0 under which the observed tensor is T = Z. Noise entries are i.i.d. normal. We need the following definition of contiguous distributions ([8]): Definition 2. For every n ∈N, let P0,n and P1,n be two probability measures on the same measure space. We say that the sequence (P1,n) is contiguous with respect to (P0,n), if, for any sequence of events An, we have lim n→∞P0,n(An) = 0 ⇒lim n→∞P1,n(An) = 0. (7) Theorem 8. If σ2 1 < ˜O( √ mk), Pσ1 is contiguous with respect to P0. This theorem with Lemma 2 of [8] establishes the converse of Theorem 7. The proof is based on bounding the second moment of the Radon-Nikodym derivative of Pσ1 with respect to P0 (SM Section 4.9). 5 Summary of Asymptotic Results Table 1 summarizes asymptotic bounds for the case of ∆= 1/ √ k and m = Θ(n). For the MLE we consider the coherent model of Section 4.1. Also in Table 1 we summarize computational complexity of different tensor biclustering methods. We discuss analytical and empirical running time of these methods in SM Section 2.2. Table 1: Comparative analysis of tensor biclustering methods. Results have been simplified for the case of m = Θ(n) and ∆= 1/ √ k. Methods σ2 1, noise model I σ2 1, noise model II Comp. Complexity Tensor Folding+Spectral ˜Ω(n3/2) ˜Ω(n3/2) O(n4) Tensor Unfolding+Spectral ˜Ω(n2) ˜Ω(n2) O(n3) Th. Sum of Squared Trajectory Lengths ˜Ω(nk) ˜Ω(nk2) O(n3) Th. Individual Trajectory Lengths ˜Ω(k2√n) ˜Ω(nk2) O(n3) Maximum Likelihood ˜Ω(k) ˜Ω(k) exp(n) Statistical Lower Bound ˜O(k) ˜O(k) 6 (b) (a) noise model II noise model I Signal Strength Signal Strength Bicluster Recovery Rate Bicluster Recovery Rate Th. individual trajectory lengths Th. sum of squared trajectory lengths Tensor unfolding+Spectral Tensor folding+Spectral 0 50 100 150 200 250 300 350 400 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 50 100 150 200 250 300 350 400 0 0.2 0.4 0.6 0.8 1 Figure 3: Performance of different tensor biclustering methods in various values of σ1 (i.e., the signal strength), under both noise models I and II. We consider n = 200, m = 50, k = 40. Experiments have been repeated 10 times for each point. In both noise models, the maximum likelihood estimator which has an exponential computational complexity leads to the best achievability bound compared to other methods. Below this bound, the inference is statistically impossible. Tensor folding+spectral method outperforms other methods with polynomial computational complexity if k > √n under noise model I, and k > n1/4 under noise model II. For smaller values of k, thresholding individual trajectory lengths lead to a better achievability bound. This case is a part of the high-SNR regime where the average trajectory lengths within the bicluster is significantly larger than the one outside of the bicluster. Unlike thresholding individual trajectory lengths, other methods use the entire tensor to solve the tensor biclustering problem. Thus, when k is very small, the accumulated noise can dominate the signal strength. Moreover, the performance of the tensor unfolding method is always worst than the one of the tensor folding method. The reason is that, the tensor unfolding method merely infers a low dimensional subspace of trajectories, ignoring the block structure that true low dimensional trajectories form. 6 Numerical Results 6.1 Synthetic Data In this section we evaluate the performance of different tensor biclustering methods in synthetic datasets. We use the statistical model described in Section 4.1 to generate the input tensor T . Let ( ˆJ1, ˆJ2) be estimated bicluster indices (J1, J2) where | ˆJ1| = | ˆJ2| = k. To evaluate the inference quality we compute the fraction of correctly recovered bicluster indices (SM Section 3.1). In our simulations we consider n = 200, m = 50, k = 40. Figure 3 shows the performance of four tensor biclustering methods in different values of σ1 (i.e., the signal strength), under both noise models I and II. Tensor folding+spectral algorithm outperforms other methods in both noise models. The gain is larger in the setup of noise model II compared to the one of noise model I. 6.2 Real Data In this section we apply tensor biclustering methods to the roadmap epigenomics dataset [4] which provides histon mark signal strengths in different segments of human genome in various tissues and cell types. In this dataset, finding a subset of genome segments and a subset of tissues (cell-types) with highly correlated histon mark values can provide insight on tissue-specific functional roles of genome segments [4]. After pre-processing the data (SM Section 3.2), we obtain a data tensor T ∈Rn1×n2×m where n1 = 49 is the number of tissues (cell-types), n2 = 1457 is the number of 7 1 2 3 4 5 6 7 0 1 2 3 4 5 6 i-th largest singular value i-th largest eigenvalue i-th largest eigenvalue 10 6 1 2 3 4 5 6 7 0 1 2 3 4 5 6 10 6 1 2 3 4 5 6 7 0 500 1000 1500 2000 2500 i i i (c) (f) (e) (b) (d) (a) 200 400 600 800 1000 1200 1400 5 10 15 20 25 30 35 40 45 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 tissues genome segments (chromosome 20) 1000 2000 3000 4000 0 5 10 15 20 25 30 tissues x genome segments H3K27me3 H3K27ac H3K36me3 H3K4me1 H3K4me3 H3K9ac H3K9me3 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 inferred bicluster quality random Tensor unfolding Tensor folding Th. individual TL Th. sum of squared TL Figure 4: An application of tensor biclustering methods to the the roadmap epigenomics data. genome segments, and m = 7 is the number of histon marks. Note that although in our analytical results for simplicity we assume n1 = n2, our proposed methods can be used in a more general case such as the one considered in this section. We form two combined covariance matrices C1 ∈Rn1×n1 and C2 ∈Rn2×n2 according to (3). Figure 4-(a,b) shows largest eigenvalues of C1 and C2, respectively. As illustrated in these figures, spectral gaps (i.e., λ1 −λ2) of these matrices are large, indicating the existence of a low dimensional signal tensor in the input tensor. We also form an unfolded tensor Tunfolded ∈Rm×n1n2. Similarly, there is a large gap between the first and second largest singular values of Tunfolded (Figure 4-c). We use the tensor folding+spectral algorithm 1 with |J1| = 10 and |J2| = 400 (we consider other values for the bicluster size in SM Section 3.2). The output of the algorithm ( ˆJ1, ˆJ2) is illustrated in Figure 4-d (note that for visualization purposes, we re-order rows and columns to have the bicluster appear in the corner). Figure 4-e illustrates the unfolded subspace {T (j1, j2, :) : (j1, j2) ∈ˆJ1 × ˆJ2}. In this inferred bicluster, Histon marks H3K4me3, H3K9ac, and H3K27ac have relatively high values. Reference [4] shows that these histon marks indicate a promoter region with an increased activation in the genome. To evaluate the quality of the inferred bicluster, we compute total absolute pairwise correlations among vectors in the inferred bicluster. As illustrated in Figure 4-f, the quality of inferred bicluster by tensor folding+spectral algorithm is larger than the one of other methods. Next, we compute the bicluster quality by choosing bicluster indices uniformly at random with the same cardinality. We repeat this experiment 100 times. There is a significant gap between the quality of these random biclusters and the ones inferred by tensor biclustering methods indicating the significance of our inferred biclusters. For more details on these experiment, see SM Section 3.2. 7 Discussion In this paper, we introduced and analyzed the tensor biclustering problem. The goal is to compute a subset of tensor rows and columns whose corresponding trajectories form a low dimensional subspace. To solve this problem, we proposed a method called tensor folding+spectral which demonstrated improved analytical and empirical performance compared to other considered methods. Moreover, we characterized computational and statistical (information theoretic) limits for the tensor biclustering problem in an asymptotic regime, under both coherent and non-coherent statistical models. Our results consider the case when the rank of the subspace is equal to one (i.e., q = 1). When q > 1, in both tensor folding+spectral and tensor unfolding+spectral methods, the embedded subspace in the signal matrix will have a rank of q > 1, with singular values σ1 ≥σ2 ≥... ≥σq > 0. In this 8 setup, we need the spectral radius of the noise matrix to be smaller than σq in order to guarantee the recovery of the subspace. The procedure to characterize asymptotic achievability bounds would follow from similar steps of the rank one case with some technical differences. For example, we would need to extend Lemma 6 to the case where the signal matrix has rank q > 1. Moreover, in our problem setup, we assumed that the size of the bicluster k and the rank of its subspace q are know parameters. In practice, these parameters can be learned approximately from the data. For example, in the tensor folding+spectral method, a good choice for the q parameter would be the index where eigenvalues of the folded matrix decrease significantly. Knowing q, one can determine the size of the bicluster similarly as the number of indices in top eigenvectors with significantly larger absolute values. Another practical approach to estimate model parameters would be trial and error plus cross validations. Some of the developed proof techniques may be of independent interest as well. For example, we proved an l∞version of the Davis-Kahan lemma for a Wishart noise matrix. Solving the tensor biclustering problem for the case of having multiple overlapping biclusters, for the case of having incomplete tensor, and for the case of a priori unknown bicluster sizes are among future directions. 8 Code We provide code for tensor biclustering methods in the following link: https://github.com/ SoheilFeizi/Tensor-Biclustering. 9 Acknowledgment We thank Prof. Ofer Zeitouni for the helpful discussion on detectably proof techniques of probability measures. References [1] Amos Tanay, Roded Sharan, and Ron Shamir. Biclustering algorithms: A survey. Handbook of computational molecular biology, 9(1-20):122–124, 2005. [2] Yudong Chen and Jiaming Xu. Statistical-computational tradeoffs in planted problems and submatrix localization with a growing number of clusters and submatrices. arXiv preprint arXiv:1402.1267, 2014. [3] T Tony Cai, Tengyuan Liang, and Alexander Rakhlin. Computational and statistical boundaries for submatrix localization in a large noisy matrix. arXiv preprint arXiv:1502.01988, 2015. [4] Anshul Kundaje, Wouter Meuleman, Jason Ernst, Misha Bilenky, Angela Yen, Alireza HeraviMoussavi, Pouya Kheradpour, Zhizhuo Zhang, Jianrong Wang, Michael J Ziller, et al. Integrative analysis of 111 reference human epigenomes. Nature, 518(7539):317–330, 2015. [5] GTEx Consortium et al. The genotype-tissue expression (gtex) pilot analysis: Multitissue gene regulation in humans. Science, 348(6235):648–660, 2015. [6] Rui Chen, George I Mias, Jennifer Li-Pook-Than, Lihua Jiang, Hugo YK Lam, Rong Chen, Elana Miriami, Konrad J Karczewski, Manoj Hariharan, Frederick E Dewey, et al. Personal omics profiling reveals dynamic molecular and medical phenotypes. Cell, 148(6):1293–1307, 2012. [7] Emile Richard and Andrea Montanari. A statistical model for tensor pca. In Advances in Neural Information Processing Systems, pages 2897–2905, 2014. [8] Andrea Montanari, Daniel Reichman, and Ofer Zeitouni. On the limitation of spectral methods: From the gaussian hidden clique problem to rank-one perturbations of gaussian tensors. In Advances in Neural Information Processing Systems, pages 217–225, 2015. [9] Samuel B Hopkins, Tselil Schramm, Jonathan Shi, and David Steurer. Fast spectral algorithms from sum-of-squares proofs: tensor decomposition and planted sparse vectors. arXiv preprint arXiv:1512.02337, 2015. 9 [10] Samuel B Hopkins, Jonathan Shi, and David Steurer. Tensor principal component analysis via sum-of-square proofs. In COLT, pages 956–1006, 2015. [11] Amelia Perry, Alexander S Wein, and Afonso S Bandeira. Statistical limits of spiked tensor models. arXiv preprint arXiv:1612.07728, 2016. [12] Thibault Lesieur, Léo Miolane, Marc Lelarge, Florent Krzakala, and Lenka Zdeborová. Statistical and computational phase transitions in spiked tensor estimation. arXiv preprint arXiv:1701.08010, 2017. [13] Animashree Anandkumar, Rong Ge, and Majid Janzamin. Guaranteed non-orthogonal tensor decomposition via alternating rank-1 updates. arXiv preprint arXiv:1402.5180, 2014. [14] Anru Zhang and Dong Xia. Guaranteed tensor pca with optimality in statistics and computation. arXiv preprint arXiv:1703.02724, 2017. [15] Animashree Anandkumar, Rong Ge, Daniel J Hsu, and Sham M Kakade. A tensor approach to learning mixed membership community models. Journal of Machine Learning Research, 15(1):2239–2312, 2014. [16] Animashree Anandkumar, Rong Ge, Daniel J Hsu, Sham M Kakade, and Matus Telgarsky. Tensor decompositions for learning latent variable models. Journal of Machine Learning Research, 15(1):2773–2832, 2014. [17] Victoria Hore, Ana Viñuela, Alfonso Buil, Julian Knight, Mark I McCarthy, Kerrin Small, and Jonathan Marchini. Tensor decomposition for multiple-tissue gene expression experiments. Nature Genetics, 48(9):1094–1100, 2016. [18] Yiqiao Zhong and Nicolas Boumal. Near-optimal bounds for phase synchronization. arXiv preprint arXiv:1703.06605, 2017. 10
2017
625
7,147
On the Model Shrinkage Effect of Gamma Process Edge Partition Models Iku Ohama⋆‡ Issei Sato† Takuya Kida‡ Hiroki Arimura‡ ⋆Panasonic Corp., Japan †The Univ. of Tokyo, Japan ‡Hokkaido Univ., Japan ohama.iku@jp.panasonic.com sato@k.u-tokyo.ac.jp {kida,arim}@ist.hokudai.ac.jp Abstract The edge partition model (EPM) is a fundamental Bayesian nonparametric model for extracting an overlapping structure from binary matrix. The EPM adopts a gamma process (ΓP) prior to automatically shrink the number of active atoms. However, we empirically found that the model shrinkage of the EPM does not typically work appropriately and leads to an overfitted solution. An analysis of the expectation of the EPM’s intensity function suggested that the gamma priors for the EPM hyperparameters disturb the model shrinkage effect of the internal ΓP. In order to ensure that the model shrinkage effect of the EPM works in an appropriate manner, we proposed two novel generative constructions of the EPM: CEPM incorporating constrained gamma priors, and DEPM incorporating Dirichlet priors instead of the gamma priors. Furthermore, all DEPM’s model parameters including the infinite atoms of the ΓP prior could be marginalized out, and thus it was possible to derive a truly infinite DEPM (IDEPM) that can be efficiently inferred using a collapsed Gibbs sampler. We experimentally confirmed that the model shrinkage of the proposed models works well and that the IDEPM indicated state-of-the-art performance in generalization ability, link prediction accuracy, mixing efficiency, and convergence speed. 1 Introduction Discovering low-dimensional structure from a binary matrix is an important problem in relational data analysis. Bayesian nonparametric priors, such as Dirichlet process (DP) [1] and hierarchical Dirichlet process (HDP) [2], have been widely applied to construct statistical models with an automatic model shrinkage effect [3, 4]. Recently, more advanced stochastic processes such as the Indian buffet process (IBP) [5] enabled the construction of statistical models for discovering overlapping structures [6, 7], wherein each individual in a data matrix can belong to multiple latent classes. Among these models, the edge partition model (EPM) [8] is a fundamental Bayesian nonparametric model for extracting overlapping latent structure underlying a given binary matrix. The EPM considers latent positive random counts for only non-zero entries in a given binary matrix and factorizes the count matrix into two non-negative matrices and a non-negative diagonal matrix. A link probability of the EPM for an entry is defined by transforming the multiplication of the non-negative matrices into a probability, and thus the EPM can capture overlapping structures with a noisy-OR manner [6]. By incorporating a gamma process (ΓP) as a prior for the diagonal matrix, the number of active atoms of the EPM shrinks automatically according to the given data. Furthermore, by truncating the infinite atoms of the ΓP with a finite number, all parameters and hyperparameters of the EPM can be inferred using closed-form Gibbs sampler. Although, the EPM is well designed to capture an overlapping structure and has an attractive affinity with a closed-form posterior 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. (a) Synthetic data (b) EPM solution (c) Proposed IDEPM solution The EPM extracted many unexpected latent classes. (98 active classes) The proposed IDEPM successfully found expected 5 overlapped latent classes. Figure 1: (Best viewed in color.) A synthetic example: (a) synthetic 90 × 90 data (white corresponds to one, and black to zero); (b) EPM solution; and (c) the proposed IDEPM solution. In (b) and (c), non-zero entries are colored to indicate their most probable assignment to the latent classes. inference, the EPM involves a critical drawback in its model shrinkage mechanism. As we experimentally show in Sec. 5, we found that the model shrinkage effect of the EPM does not typically work in an appropriate manner. Figure 1 shows a synthetic example. As shown in Fig. 1a, there are five overlapping latent classes (white blocks). However, as shown in Fig. 1b, the EPM overestimates the number of active atoms (classes) and overfits the data. In this paper, we analyze the undesired property of the EPM’s model shrinkage mechanism and propose novel generative constructions for the EPM to overcome the aforementioned disadvantage. As shown in Fig. 1c, the IDEPM proposed in this paper successfully shrinks unnecessary atoms. More specifically, we have three major contributions in this paper. (1) We analyse the generative construction of the EPM and find a property that disturbs its model shrinkage effect (Sec. 3). We derive the expectation of the EPM’s intensity function (Theorem 1), which is the total sum of the infinite atoms for an entry. From the derived expectation, we obtain a new finding that gamma priors for the EPM’s hyperparameters disturb the model shrinkage effect of the internal ΓP (Theorem 2). That is, the derived expectation is expressed by a multiplication of the terms related to ΓP and other gamma priors. Thus, there is no guarantee that the expected number of active atoms is finite. (2) Based on the analysis of the EPM’s intensity function, we propose two novel constructions of the EPM: the CEPM incorporating constrained gamma priors (Sec. 4.1) and the DEPM incorporating Dirichlet priors instead of the gamma priors (Sec. 4.2). The model shrinkage effect of the CEPM and DEPM works appropriately because the expectation of their intensity functions depends only on the ΓP prior (Sec. 4.1 and Theorem 3 in Sec. 4.2). (3) Furthermore, for the DEPM, all model parameters, including the infinite atoms of the ΓP prior, can be marginalized out (Theorem 4). Therefore, we can derive a truly infinite DEPM (IDEPM), which has a closed-form marginal likelihood without truncating infinite atoms, and can be efficiently inferred using collapsed Gibbs sampler [9] (Sec. 4.3). 2 The Edge Partition Model (EPM) In this section, we review the EPM [8] as a baseline model. Let x be an I ×J binary matrix, where an entry between i-th row and j-th column is represented by xi,j ∈{0, 1}. In order to extract an overlapping structure underlying x, the EPM [8] considers a non-negative matrix factorization problem on latent Poisson counts as follows: xi,j = I(mi,j,· ≥1), mi,j,· | U, V , λ ∼Poisson K X k=1 Ui,kVj,kλk ! , (1) where U and V are I ×K and J ×K non-negative matrices, respectively, and λ is a K ×K non-negative diagonal matrix. Note that I(·) is 1 if the predicate holds and is zero otherwise. The latent counts m take positive values only for edges (non-zero entries) within a given binary matrix and the generative model for each positive count is equivalently expressed as a sum of K Poisson random variables as mi,j,· = P k mi,j,k, mi,j,k ∼Poisson(Ui,kVj,kλk). This is the reason why the above model is called edge partition model. Marginalizing m out from Eq. (1), the generative model of the EPM can be equivalently rewritten as 2 xi,j | U, V , λ ∼Bernoulli(1 −Q k e−Ui,kVj,kλk). As e−Ui,kVj,kλk ∈[0, 1] denotes the probability that a Poisson random variable with mean Ui,kVj,kλk corresponds to zero, the EPM can capture an overlapping structure with a noisy-OR manner [6]. In order to complete the Bayesian hierarchical model of the EPM, gamma priors are adopted as Ui,k ∼Gamma(a1, b1) and Vj,k ∼Gamma(a2, b2), where a1, a2 are shape parameters and b1, b2 are rate parameters for the gamma distribution, respectively. Furthermore, a gamma process (ΓP) is incorporated as a Bayesian nonparametric prior for λ to make the EPM automatically shrink its number of atoms K. Let Gamma(γ0/T, c0) denote a truncated ΓP with a concentration parameter γ0 and a rate parameter c0, where T denotes a truncation level that should be set large enough to ensure a good approximation to the true ΓP. Then, the diagonal elements of λ are drawn as λk ∼Gamma(γ0/T, c0) for k ∈{1, . . . , T}. The posterior inference for all parameters and hyperparameters of the EPM can be performed using Gibbs sampler (detailed in Appendix A). Thanks to the conjugacy between gamma and Poisson distributions, given mi,·,k = P j mi,j,k and m·,j,k = P i mi,j,k, posterior sampling for Ui,k and Vj,k is straightforward. As the ΓP prior is approximated by a gamma distribution, posterior sampling for λk also can be performed straightforwardly. Given U, V , and λ, posterior sample for mi,j,· can be simulated using zero-truncated Poisson (ZTP) distribution [10]. Finally, we can obtain sufficient statistics mi,j,k by partitioning mi,j,· into T atoms using a multinomial distribution. Furthermore, all hyperparameters of the EPM (i.e., γ0, c0, a1, a2, b1, and b2) can also be sampled by assuming a gamma hyper prior Gamma(e0, f0). Thanks to the conjugacy between gamma distributions, posterior sampling for c0, b1, and b2 is straightforward. For the remaining hyperparameters, we can construct closed-form Gibbs samplers using data augmentation techniques [11, 12, 2]. 3 Analysis for Model Shrinkage Mechanism The EPM is well designed to capture an overlapping structure with a simple Gibbs inference. However, the EPM involves a critical drawback in its model shrinkage mechanism. For the EPM, a ΓP prior is incorporated as a prior for the non-negative diagonal matrix as λk ∼Gamma(γ0/T, c0). From the form of the truncated ΓP, thanks to the additive property of independent gamma random variables, the total sum of λk over countably infinite atoms follows a gamma distribution as P∞ k=1 λk ∼Gamma(γ0, c0), wherein the intensity function of the ΓP has a finite expectation as E[P∞ k=1 λk] = γ0 c0 . Therefore, the ΓP has a regularization mechanism that automatically shrinks the number of atoms according to given observations. However, as experimentally shown in Sec. 5, the model shrinkage mechanism of the EPM does not work appropriately. More specifically, the EPM often overestimates the number of active atoms and overfits the data. Thus, we analyse the intensity function of the EPM to reveal the reason why the model shrinkage mechanism does not work appropriately. Theorem 1. The expectation of the EPM’s intensity function P∞ k=1 Ui,kVj,kλk for an entry (i, j) is finite and can be expressed as follows: E " ∞ X k=1 Ui,kVj,kλk # = a1 b1 × a2 b2 × γ0 c0 . (2) Proof. As U, V , and λ are independent of each other, the expected value operator is multiplicative for the EPM’s intensity function. Using the multiplicativity and the low of total expectation, the proof is completed as E [P∞ k=1 Ui,kVj,kλk] = P∞ k=1 E[Ui,k]E[Vj,k]E[λk] = a1 b1 × a2 b2 × E[P∞ k=1 λk]. As Eq. (2) in Theorem 1 shows, the expectation of the EPM’s intensity function is expressed by multiplying individual expectations of a ΓP and two gamma distributions. This causes an undesirable property to the model shrinkage effect of the EPM. From Theorem 1, another important theorem about the EPM’s model shrinkage effect is obtained as follows: 3 Theorem 2. Given an arbitrary non-negative constant C, even if the expectation of the EPM’s intensity function in Eq. (2) is fixed as E [P∞ k=1 Ui,kVj,kλk] = C, there exist cases in which the model shrinkage effect of the ΓP prior disappears. Proof. Substituting E [P∞ k=1 Ui,kVj,kλk] = C for Eq. (2), we obtain C = a1 b1 × a2 b2 × γ0 c0 . Since a1, a2, b1, and b2 are gamma random variables, even if the expectation of the EPM’s intensity function, C, is fixed, γ0 c0 can take an arbitrary value so that equation C = a1 b1 × a2 b2 × γ0 c0 holds. Hence, γ0 can take an arbitrary large value such that γ0 = T × bγ0. This implies that the ΓP prior for the EPM degrades to a gamma distribution without model shrinkage effect as λk ∼Gamma(γ0/T, c0) = Gamma(bγ0, c0). Theorem 2 indicates that the EPM might overestimate the number of active atoms, and lead to overfitted solutions. 4 Proposed Generative Constructions We describe our novel generative constructions for the EPM with an appropriate model shrinkage effect. According to the analysis described in Sec. 3, the model shrinkage mechanism of the EPM does not work because the expectation of the EPM’s intensity function has an undesirable redundancy. This finding motivates the proposal of new generative constructions, in which the expectation of the intensity function depends only on the ΓP prior. First, we propose a naive extension of the original EPM using constrained gamma priors (termed as CEPM). Next, we propose an another generative construction for the EPM by incorporating Dirichlet priors instead of gamma priors (termed as DEPM). Furthermore, for the DEPM, we derive truly infinite DEPM (termed as IDEPM) by marginalizing out all model parameters including the infinite atoms of the ΓP prior. 4.1 CEPM In order to ensure that the EPM’s intensity function depends solely on the ΓP prior, a naive way is to introduce constraints for the hyperparameters of the gamma prior. In the CEPM, the rate parameters of the gamma priors are constrained as b1 = C1 × a1 and b2 = C2 × a2, respectively, where C1 > 0 and C2 > 0 are arbitrary constants. Based on the aforementioned constraints and Theorem 1, the expectation of the intensity function for the CEPM depends only on the ΓP prior as E[P∞ k=1 Ui,kVj,kλk] = γ0 C1C2c0 . The posterior inference for the CEPM can be performed using Gibbs sampler in a manner similar to that for the EPM. However, we can not derive closed-form samplers only for a1 and a2 because of the constraints. Thus, in this paper, posterior sampling for a1 and a2 are performed using grid Gibbs sampling [13] (see Appendix B for details). 4.2 DEPM We have another strategy to construct the EPM with efficient model shrinkage effect by re-parametrizing the factorization problem. Let us denote transpose of a matrix A by A⊤. According to the generative model of the EPM in Eq. (1), the original generative process for counts m can be viewed as a matrix factorization as m ≈UλV ⊤. It is clear that the optimal solution of the factorization problem is not unique. Let Λ1 and Λ2 be arbitrary K × K non-negative diagonal matrices. If a solution m ≈UλV ⊤is globally optimal, then another solution m ≈(UΛ1)(Λ−1 1 λΛ2)(V Λ−1 2 )⊤is also optimal. In order to ensure that the EPM has only one optimal solution, we re-parametrize the original factorization problem to an equivalent constrained factorization problem as follows: m ≈φλψ⊤, (3) where φ denotes an I × K non-negative matrix with l1-constraints as P i φi,k = 1, ∀k. Similarly, ψ denotes an J × K non-negative matrix with l1-constraints as P j ψj,k = 1, ∀k. This parameterization ensures the uniqueness of the optimal solution for a given m because each column of φ and ψ is constrained such that it is defined on a simplex. 4 According to the factorization in Eq. (3), by incorporating Dirichlet priors instead of gamma priors, the generative construction for m of the DEPM is as follows: mi,j,· | φ, ψ, λ ∼Poisson T X k=1 φi,kψj,kλk ! , {φi,k}I i=1 | α1 ∼Dirichlet( I z }| { α1, . . . , α1), {ψj,k}J j=1 | α2 ∼Dirichlet( J z }| { α2, . . . , α2), λk | γ0, c0 ∼Gamma(γ0/T, c0). (4) Theorem 3. The expectation of DEPM’s intensity function P∞ k=1 φi,kψj,kλk depends sorely on the ΓP prior and can be expressed as E[P∞ k=1 φi,kψj,kλk] = γ0 IJc0 . Proof. The expectations of Dirichlet random variables φi,k and ψj,k are 1 I and 1 J , respectively. Similar to the proof for Theorem 1, using the multiplicativity of independent random variables and the low of total expectation, the proof is completed as E [P∞ k=1 φi,kψj,kλk] = P∞ k=1 E[φi,k]E[ψj,k]E[λk] = 1 I × 1 J × E[P∞ k=1 λk]. Note that, if we set constants C1 = I and C2 = J for the CEPM in Sec. 4.1, then the expectation of the intensity function for the CEPM is equivalent to that for the DEPM in Theorem 3. Thus, in order to ensure the fairness of comparisons, we set C1 = I and C2 = J for the CEPM in the experiments. As the Gibbs sampler for φ and ψ can be derived straightforwardly, the posterior inference for all parameters and hyperparameters of the DEPM also can be performed via closedform Gibbs sampler (detailed in Appendix C). Differ from the CEPM, l1-constraints in the DEPM ensure the uniqueness of its optimal solution. Thus, the inference for the DEPM is considered as more efficient than that for the CEPM. 4.3 Truly Infinite DEPM (IDEPM) One remarkable property of the DEPM is that we can derive a fully marginalized likelihood function. Similar to the beta-negative binomial topic model [13], we consider a joint distribution for mi,j,· Poisson customers and their assignments zi,j = {zi,j,s}mi,j,· s=1 ∈{1, · · · , T}mi,j,· to T tables as P(mi,j,·, zi,j | φ, ψ, λ) = P(mi,j,· | φ, ψ, λ) Qmi,j,· s=1 P(zi,j,s | mi,j,·, φ, ψ, λ). Thanks to the l1-constraints we introduced in Eq. (3), the joint distribution P(m, z | φ, ψ, λ) has a fully factorized form (see Lemma 1 in Appendix D). Therefore, marginalizing φ, ψ, and λ out according to the prior construction in Eq. (4), we obtain an analytical marginal likelihood P(m, z) for the truncated DEPM (see Appendix D for a detailed derivation). Furthermore, by taking T →∞, we can derive a closed-form marginal likelihood for the truly infinite version of the DEPM (termed as IDEPM). In a manner similar to that in [14], we consider the likelihood function for partition [z] instead of the assignments z. Assume we have K+ of T atoms for which m·,·,k = P i P j mi,j,k > 0, and a partition of M(= P i P j mi,j,·) customers into K+ subsets. Then, joint marginal likelihood of the IDEPM for [z] and m is given by the following theorem, with the proof provided in Appendix D: Theorem 4. The marginal likelihood function of the IDEPM is defined as P(m, [z])∞= limT →∞P(m, [z]) = limT →∞ T ! (T −K+)!P(m, z), and can be derived as follows: P(m, [z])∞= IY i=1 J Y j=1 1 mi,j,·! × K+ Y k=1 Γ(Iα1) Γ(Iα1 + m·,·,k) IY i=1 Γ(α1 + mi,·,k) Γ(α1) × K+ Y k=1 Γ(Jα2) Γ(Jα2 + m·,·,k) J Y j=1 Γ(α2 + m·,j,k) Γ(α2) × γK+ 0  c0 c0 + 1 γ0 K+ Y k=1 Γ(m·,·,k) (c0 + 1)m·,·,k , (5) where mi,·,k = P j mi,j,k, m·,j,k = P i mi,j,k, and m·,·,k = P i P j mi,j,k. Note that Γ(·) denotes gamma function. From Eq. (5) in Theorem 4, we can derive collapsed Gibbs sampler [9] to perform posterior inference for the IDEPM. Since φ, ψ, and λ have been marginalized out, the only latent variables we have to update are m and z. 5 Sampling z: Given m, similar to the Chinese restaurant process (CRP) [15], the posterior probability that zi,j,s is assigned to k∗is given as follows: P(zi,j,s = k∗| z\(ijs), m) ∝    m\(ijs) k∗ × α1+m\(ijs) i,·,k∗ Iα1+m\(ijs) ·,·,k∗× α2+m\(ijs) ·,j,k∗ Iα2+m\(ijs) ·,·,k∗ if m\(ijs) ·,·,k∗> 0, γ0 × 1 I × 1 J if m\(ijs) ·,·,k∗= 0, (6) where the superscript \(ijs) denotes that the corresponding statistics are computed excluding the s-th customer of entry (i, j). Sampling m: Given z, posteriors for the φ and ψ are simulated as {φi,k}I i=1 | −∼ Dirichlet({α1 + mi,·,k}I i=1) and {ψj,k}J j=1 | − ∼ Dirichlet({α2 + m·,j,k}J j=1) for k ∈ {1, . . . , K+}. Furthermore, the posterior sampling of the λk for K+ active atoms can be performed as λk | −∼Gamma(m·,·,k, c0 + 1). Therefore, similar to the sampler for the EPM [8], we can update m as follows: mi,j,· | φ, ψ, λ ∼  δ(0) if xi,j = 0, ZTP(PK+ k=1 φi,kψj,kλk) if xi,j = 1, (7) {mi,j,k}K+ k=1 | mi,j,·, φ, ψ, λ ∼Multinomial  mi,j,·; ( φi,kψj,kλk PK+ k′=1 φi,k′ψj,k′λk′ )K+ k=1  , (8) where δ(0) denotes point mass at zero. Sampling hyperparameters: We can construct closed-form Gibbs sampler for all hyperparameters of the IDEPM assuming a gamma prior (Gamma(e0, f0)). Using the additive property of the ΓP, posterior sample for the sum of λk over unused atoms is obtained as λγ0 = P∞ k′=K++1 λk′ | −∼Gamma(γ0, c0 + 1). Consequently, we obtain a closed-form posterior sampler for the rate parameter c0 of the ΓP as c0 | −∼Gamma(e0 +γ0, f0 +λγ0 +PK+ k=1 λk). For all remaining hyperparameters (i.e., α1, α2, and γ0), we can derive posterior samplers from Eq. (5) using data augmentation techniques [12, 8, 2, 11] (detailed in Appendix E). 5 Experimental Results In previous sections, we theoretically analysed the reason why the model shrinkage of the EPM does not work appropriately (Sec. 3) and proposed several novel constructions (i.e., CEPM, DEPM, and IDEPM) of the EPM with an efficient model shrinkage effect (Sec. 4). The purpose of the experiments involves ascertaining the following hypotheses: (H1) The original EPM overestimates the number of active atoms and overfits the data. In contrast, the model shrinkage mechanisms of the CEPM and DEPM work appropriately. Consequently, the CEPM and DEPM outperform the EPM in generalization ability and link prediction accuracy. (H2) Compared with the CEPM, the DEPM indicates better generalization ability and link prediction accuracy because of the uniqueness of the DEPM’s optimal solution. (H3) The IDEPM with collapsed Gibbs sampler is superior to the DEPM in generalization ability, link prediction accuracy, mixing efficiency, and convergence speed. Datasets: The first dataset was the Enron [16] dataset, which comprises e-mails sent between 149 Enron employees. We extracted e-mail transactions from September 2001 and constructed Enron09 dataset. For this dataset, xi,j = 1(0) was used to indicate whether an e-mail was, or was not, sent by the i-th employee to the j-th employee. For larger dataset, we used the MovieLens [17] dataset, which comprises five-point scale ratings of movies submitted by users. For this dataset, we set xi,j = 1 when the rating was higher than three and xi,j = 0 otherwise. We prepared two different sized MovieLens dataset: MovieLens100K (943 users and 1,682 movies) and MovieLens1M (6,040 users and 3,706 movies). The densities of the Enron09, MovieLens100K and MovieLens1M datasets were 0.016, 0.035, and 0.026, respectively. 6 -0.120 -0.110 -0.100 -0.090 -0.080 -0.070 -0.060 -0.050 -0.040 2 4 8 16 32 64 128 TDLL Truncation level T IDEPM DEPM-T CEPM-T EPM-T -0.100 -0.098 -0.096 -0.094 -0.092 -0.090 -0.088 -0.086 -0.084 2 4 8 16 32 64 128 Truncation level T (d) Enron09 (e) MovieLens100K (f) MovieLens1M -0.078 -0.076 -0.074 -0.072 -0.070 -0.068 -0.066 2 4 8 16 32 64 128 Truncation level T 2 4 8 16 32 64 128 2 4 8 16 32 64 128 Estimated # of K Truncation level T IDEPM DEPM-T CEPM-T EPM-T 2 4 8 16 32 64 128 2 4 8 16 32 64 128 Truncation level T 2 4 8 16 32 64 128 2 4 8 16 32 64 128 Truncation level T (a) Enron09 (b) MovieLens100K (c) MovieLens1M (g) Enron09 (h) MovieLens100K (i) MovieLens1M 0.000 0.050 0.100 0.150 0.200 0.250 0.300 0.350 2 4 8 16 32 64 128 TDAUC-PR Truncation level T IDEPM DEPM-T CEPM-T EPM-T 0.370 0.390 0.410 0.430 0.450 0.470 2 4 8 16 32 64 128 Truncation level T 0.300 0.320 0.340 0.360 0.380 0.400 0.420 0.440 2 4 8 16 32 64 128 Truncation level T Figure 2: Calculated measurements as functions of the truncation level T for each dataset. The horizontal line in each figure denotes the result obtained using the IDEPM. Evaluating Measures: We adopted three measurements to evaluate the performance of the models. The first is the estimated number of active atoms K for evaluating the model shrinkage effect of each model. The second is the averaged Test Data Log Likelihood (TDLL) for evaluating the generalization ability of each model. We calculated the averaged likelihood that a test entry takes the actual value. For the third measurement, as many real-world binary matrices are often sparse, we adopted the Test Data Area Under the Curve of the Precision-Recall curve (TDAUC-PR) [18] to evaluate the link prediction ability. In order to calculate the TDLL and TDAUC-PR, we set all the selected test entries as zero during the inference period, because binary observations for unobserved entries are not observed as missing values but are observed as zeros in many real-world situations. Experimental Settings: Posterior inference for the truncated models (i.e., EPM, CEPM, and DEPM) were performed using standard (non-collapsed) Gibbs sampler. Posterior inference for the IDEPM was performed using the collapsed Gibbs sampler derived in Sec. 4.3. For all models, we also sampled all hyperparameters assuming the same gamma prior (Gamma(e0, f0)). For the purpose of fair comparison, we set hyper-hyperparameters as e0 = f0 = 0.01 throughout the experiments. We ran 600 Gibbs iterations for each model on each dataset and used the final 100 iterations to calculate the measurements. Furthermore, all reported measurements were averaged values obtained by 10-fold cross validation. Results: Hereafter, the truncated models are denoted as EPM-T, CEPM-T, and DEPM-T to specify the truncation level T. Figure 2 shows the calculated measurements. (H1) As shown in Figs. 2a–c, the EPM overestimated the number of active atoms K for all datasets especially for a large truncation level T. In contrast, the number of active atoms K for the CEPM-T and DEPM-T monotonically converges to a specific value. This result supports the analysis with respect to the relationship between the model shrinkage effect and the expectation of the EPM’s intensity function, as discussed in Sec. 3. Consequently, 7 -0.080 -0.075 -0.070 -0.065 -0.060 -0.055 -0.050 0 100 200 300 400 500 600 TDLL Gibbs sampling iteration IDEPM DEPM-128 -0.098 -0.096 -0.094 -0.092 -0.090 -0.088 -0.086 0 100 200 300 400 500 600 Gibbs sampling iteration -0.080 -0.078 -0.076 -0.074 -0.072 -0.070 -0.068 -0.066 0 100 200 300 400 500 600 Gibbs sampling iteration (a) Enron09 (b) MovieLens100K (c) MovieLens1M Figure 3: (Best viewed in color.) The TDLL as a function of the Gibbs iterations. -0.080 -0.075 -0.070 -0.065 -0.060 -0.055 -0.050 0 10 20 30 40 50 TDLL Elapsed time (sec) IDEPM DEPM-128 DEPM-64 DEPM-32 DEPM-16 DEPM-8 DEPM-4 DEPM-2 -0.110 -0.105 -0.100 -0.095 -0.090 -0.085 -0.080 0 200 400 600 800 1000 Elapsed time (sec) -0.085 -0.080 -0.075 -0.070 -0.065 0 2000 4000 6000 8000 10000 Elapsed time (sec) (a) Enron09 (b) MovieLens100K (c) MovieLens1M Figure 4: (Best viewed in color.) The TDLL as a function of the elapsed time (in seconds). as shown by the TDLL (Figs. 2d–f) and TDAUC-PR (Figs. 2g–i), the CEPM and DEPM outperformed the original EPM in both generalization ability and link prediction accuracy. (H2) As shown in Figs. 2a–c, the model shrinkage effect of the DEPM is stronger than that of the CEPM. As a result, the DEPM significantly outperformed the CEPM in both generalization ability and link prediction accuracy (Figs. 2d–i). Although the CEPM slightly outperformed the EPM, the CEPM with a larger T tends to overfit the data. In contrast, the DEPM indicated its best performance with the largest truncation level (T = 128). Therefore, we confirmed that the uniqueness of the optimal solution in the DEPM was considerably important in achieving good generalization ability and link prediction accuracy. (H3) As shown by the horizontal lines in Figs. 2d–i, the IDEPM indicated the state-of-theart scores for all datasets. Finally, the computational efficiency of the IDEPM was compared with that of the truncated DEPM. Figure 3 shows the TDLL as a function of the number of Gibbs iterations. In keeping with expectations, the IDEPM indicated significantly better mixing property when compared with that of the DEPM for all datasets. Furthermore, Fig. 4 shows a comparison of the convergence speed of the IDEPM and DEPM with several truncation levels (T = {2, 4, 8, 16, 32, 64, 128}). As clearly shown in the figure, the convergence of the IDEPM was significantly faster than that of the DEPM with all truncation levels. Therefore, we confirmed that the IDEPM indicated a state-of-the-art performance in generalization ability, link prediction accuracy, mixing efficiency, and convergence speed. 6 Conclusions In this paper, we analysed the model shrinkage effect of the EPM, which is a Bayesian nonparametric model for extracting overlapping structure with an optimal dimension from binary matrices. We derived the expectation of the intensity function of the EPM, and showed that the redundancy of the EPM’s intensity function disturbs its model shrinkage effect. According to this finding, we proposed two novel generative construction for the EPM (i.e., CEPM and DEPM) to ensure that its model shrinkage effect works appropriately. Furthermore, we derived a truly infinite version of the DEPM (i.e, IDEPM), which can be inferred using collapsed Gibbs sampler without any approximation for the ΓP. We experimentally showed that the model shrinkage mechanism of the CEPM and DEPM worked appropriately. Furthermore, we confirmed that the proposed IDEPM indicated a state-ofthe-art performance in generalization ability, link prediction accuracy, mixing efficiency, and convergence speed. It is of interest to further investigate whether the truly infinite construction of the IDEPM can be applied to more complex and modern machine learning models, including deep brief networks [19], and tensor factorization models [20]. 8 References [1] Thomas S. Ferguson. “A Bayesian Analysis of Some Nonparametric Problems”. In: The Annals of Statistics 1.2 (1973), pp. 209–230. [2] Yee Whye Teh, Michael I. Jordan, Matthew J. Beal, and David M. Blei. “Hierarchical Dirichlet Processes”. In: J. Am. Stat. Assoc. 101.476 (2006), pp. 1566–1581. [3] Charles Kemp, Joshua B. Tenenbaum, Thomas L. Griffiths, Takeshi Yamada, and Naonori Ueda. “Learning Systems of Concepts with an Infinite Relational Model”. In: Proc. AAAI. Vol. 1. 2006, pp. 381–388. [4] Edoardo M. Airoldi, David M. Blei, Stephen E. Fienberg, and Eric P. Xing. “Mixed Membership Stochastic Blockmodels”. In: J. Mach. Learn. Res. 9 (2008), pp. 1981– 2014. [5] Thomas L. Griffiths and Zoubin Ghahramani. “Infinite Latent Feature Models and the Indian Buffet Process”. In: Proc. NIPS. 2005, pp. 475–482. [6] Morten Mørup, Mikkel N. Schmidt, and Lars Kai Hansen. “Infinite Multiple Membership Relational Modeling for Complex Networks”. In: Proc. MLSP. 2011, pp. 1– 6. [7] Konstantina Palla, David A. Knowles, and Zoubin Ghahramani. “An Infinite Latent Attribute Model for Network Data”. In: Proc. ICML. 2012, pp. 1607–1614. [8] Mingyuan Zhou. “Infinite Edge Partition Models for Overlapping Community Detection and Link Prediction”. In: Proc. AISTATS. Vol. 38. 2015, pp. 1135–1143. [9] Jun S. Liu. “The Collapsed Gibbs Sampler in Bayesian Computations with Applications to a Gene Regulation Problem”. In: J. Am. Stat. Assoc. 89.427 (1994), pp. 958– 966. [10] Charles J. Geyer. Lower-Truncated Poisson and Negative Binomial Distributions. Tech. rep. Working Paper Written for the Software R. University of Minnesota, MN (available: http://cran.r-project.org/web/packages/aster/vignettes/trunc.pdf), 2007. [11] David Newman, Arthur U. Asuncion, Padhraic Smyth, and Max Welling. “Distributed Algorithms for Topic Models”. In: J. Mach. Learn. Res. 10 (2009), pp. 1801–1828. [12] Michael D. Escobar and Mike West. “Bayesian Density Estimation and Inference Using Mixtures”. In: J. Am. Stat. Assoc. 90 (1994), pp. 577–588. [13] Mingyuan Zhou. “Beta-Negative Binomial Process and Exchangeable Random Partitions for Mixed-Membership Modeling”. In: Proc. NIPS. 2014, pp. 3455–3463. [14] Thomas L. Griffiths and Zoubin Ghahramani. “The Indian Buffet Process: An Introduction and Review”. In: J. Mach. Learn. Res. 12 (2011), pp. 1185–1224. [15] David Blackwell and James B. MacQueen. “Ferguson distributions via Polya urn schemes”. In: The Annals of Statistics 1 (1973), pp. 353–355. [16] Bryan Klimat and Yiming Yang. “The Enron Corpus: A New Dataset for Email Classification Research”. In: Proc. ECML. 2004, pp. 217–226. [17] MovieLens dataset, http://www.grouplens.org/. as of 2003. url: http://www.grouplens.org/. [18] Jesse Davis and Mark Goadrich. “The Relationship Between Precision-Recall and ROC Curves”. In: Proc. ICML. 2006, pp. 233–240. [19] Mingyuan Zhou, Yulai Cong, and Bo Chen. “The Poisson Gamma Belief Network”. In: Proc. NIPS. 2015, pp. 3043–3051. [20] Changwei Hu, Piyush Rai, and Lawrence Carin. “Zero-Truncated Poisson Tensor Factorization for Massive Binary Tensors”. In: Proc. UAI. 2015, pp. 375–384. 9
2017
626
7,148
Estimating Mutual Information for Discrete-Continuous Mixtures Weihao Gao Department of ECE Coordinated Science Laboratory University of Illinois at Urbana-Champaign wgao9@illinois.edu Sreeram Kannan Department of Electrical Engineering University of Washington ksreeram@uw.edu Sewoong Oh Department of IESE Coordinated Science Laboratory University of Illinois at Urbana-Champaign swoh@illinois.edu Pramod Viswanath Department of ECE Coordinated Science Laboratory University of Illinois at Urbana-Champaign pramodv@illinois.edu Abstract Estimation of mutual information from observed samples is a basic primitive in machine learning, useful in several learning tasks including correlation mining, information bottleneck, Chow-Liu tree, and conditional independence testing in (causal) graphical models. While mutual information is a quantity well-defined for general probability spaces, estimators have been developed only in the special case of discrete or continuous pairs of random variables. Most of these estimators operate using the 3H-principle, i.e., by calculating the three (differential) entropies of X, Y and the pair (X, Y ). However, in general mixture spaces, such individual entropies are not well defined, even though mutual information is. In this paper, we develop a novel estimator for estimating mutual information in discrete-continuous mixtures. We prove the consistency of this estimator theoretically as well as demonstrate its excellent empirical performance. This problem is relevant in a wide-array of applications, where some variables are discrete, some continuous, and others are a mixture between continuous and discrete components. 1 Introduction A fundamental quantity of interest in machine learning is mutual information (MI), which characterizes the shared information between a pair of random variables (X, Y ). MI obeys several intuitively appealing properties including the data-processing inequality, invariance under one-to-one transformations and chain rule [10]. Therefore, mutual information is widely used in machine learning for canonical tasks as classification [35], clustering [32, 49, 8, 29] and feature selection [2, 13]. Mutual information also emerges as the “correct" quantity in several graphical model inference problems (e.g., the Chow-Liu tree [9] and conditional independence testing [6]). MI is also pervasively used in many data science application domains, such as sociology [40], computational biology [28], and computational neuroscience [41]. An important problem in any of these applications is to estimate mutual information effectively from samples. While mutual information has been the de facto measure of information in several applications for decades, the estimation of mutual information from samples remains an active research problem. Recently, there has been a resurgence of interest in entropy, relative entropy and 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. mutual information estimators, on both the theoretical as well as practical fronts [46, 31, 44, 45, 22, 19, 7, 15, 14, 17, 16]. The previous estimators focus on either of two cases – the data is either purely discrete or purely continuous. In these special cases, the mutual information can be calculated based on the three (differential) entropies of X, Y and (X, Y ). We term estimators based on this principle as 3Hestimators (since they estimate three entropy terms), and a majority of previous estimators fall under this category [19, 16, 46]. In practical downstream applications, we often have to deal with a mixture of continuous and discrete random variables. Random variables can be mixed in several ways. First, one random variable can be discrete whereas the other is continuous. For example, we want to measure the strength of relationship between children’s age and height, here age X is discrete and height Y is continuous. Secondly, a single scalar random variable itself can be a mixture of discrete and continuous components. For example, consider X taking a zero-inflated-Gaussian distribution, which takes value 0 with probability 0.1 and is a Poisson distribution with mean 10 with probability 0.9. This distribution has both a discrete component as well as a component with density, and is a well-known model for gene expression readouts [24, 37]. Finally, X and / or Y can be high dimensional vector, each of whose components may be discrete, continuous or mixed. In all of the aforementioned mixed cases, mutual information is well-defined through the RadonNikodym derivative (see Section 2) but cannot be expressed as a function of the entropies or differential entropies of the random variables. Crucially, entropy is not well defined when a single scalar random variable comprises of both discrete and continuous components, in which case, 3H estimators (the vast majority of prior art) cannot be directly employed. In this paper, we address this challenge by proposing an estimator that can handle all these cases of mixture distributions. The estimator directly estimates the Radon-Nikodym derivative using the k-nearest neighbor distances from the samples; we prove ℓ2 consistency of the estimator and demonstrate its excellent practical performance through a variety of experiments on both synthetic and real dataset. Most relevantly, it strongly outperforms natural baselines of discretizing the mixed random variables (by quantization) or making it continuous by adding a small Gaussian noise. The rest of the paper is organized as follows. In Section 2, we review the general definition of mutual information for Radon-Nikodym derivative and show that it is well-defined for all the cases of mixtures. In Section 3, we propose our estimator of mutual information for mixed random variables. In Section 4, we prove that our estimator is ℓ2 consistent under certain technical assumptions and verify that the assumptions are satisfied for most practical cases. Section 5 contains the results of our detailed synthetic and real-world experiments testing the efficacy of the proposed estimator. 2 Problem Formation In this section, we define mutual information for general distributions as follows (e.g., [39]). Definition 2.1. Let PXY be a probability measure on the space X × Y, where X and Y are both Euclidean spaces. For any measurable set A ⊆X and B ⊆Y, define PX(A) = PXY (A × Y) and PY (B) = PXY (X × B). Let PXPY be the product measure PX × PY . Then the mutual information I(X; Y ) of PXY is defined as I(X; Y ) ≡ Z X×Y log dPXY dPXPY dPXY , (1) where dPXY dPXPY is the Radon-Nikodym derivative. We prove that for any probability measure P on X × Y, the joint measure PXY is absolutely continuous with respect to the product measure PXPY , hence mutual information is well-defined. See Appendix ?? for the detailed proof. Notice that this general definition includes the following cases of mixtures: (1) X is discrete and Y is continuous (or vice versa); (2) X or Y has many components each, where some components are discrete and some are continuous; (3) X or Y or their joint distribution is a mixture of continuous and discrete distributions. 2 3 Estimators of Mutual Information Review of prior work. The estimation problem is quite different depending on whether the underlying distribution is discrete, continuous or mixed. As pointed out earlier, most existing estimators for mutual information are based on the 3H principle: they estimate the three entropy terms first. This 3H principle can be applied only in the purely discrete or purely continuous case. Discrete data: For entropy estimation of a discrete variable X, the straightforward approach to plug-in the estimated probabilities ˆpX(x) into the formula for entropy has been shown to be suboptimal [33, 1]. Novel entropy estimators with sub-linear sample complexity have been proposed [48, 53, 19, 21, 20, 23]. MI estimation can then be performed using the 3H principle, and such an approach is shown to be worst-case optimal for mutual-information estimation [19]. Continuous data: There are several estimators for differential entropy of continuous random variables, which have been exploited in a 3H principle to calculate the mutual information [3]. One family of entropy estimators are based on kernel density estimators [34] followed by re-substitution estimation. An alternate family of entropy estimators is based on k-Nearest Neighbor (k-NN) estimates, beginning with the pioneering work of Kozachenko and Leonenko [26] (the so-called KL estimator). Recent progress involves an inspired mixture of an ensemble of kernel and k-NN estimators [46, 4]. Exponential concentration bounds under certain conditions are in [43]. Mixed Random Variables: Since the entropies themselves may not be well defined for mixed random variables, there is no direct way to apply the 3H principle. However, once the data is quantized, this principle can be applied in the discrete domain. That mutual information in arbitrary measure spaces can indeed be computed as a maximum over quantization is a classical result [18, 36, 38]. However, the choice of quantization is complicated and while some quantization schemes are known to be consistent when there is a joint density[11], the mixed case is complex. Estimator of the average of Radon-Nikodym derivative has been studied in [50, 51]. Very recent work generalizing the ensemble entropy estimator when some components are discrete and others continuous is in [31]. Beyond 3H estimation: In an inspired work [27] proposed a direct method for estimating mutual information (KSG estimator) when the variables have a joint density. The estimator starts with the 3H estimator based on differential entropy estimates based on the k-NN estimates, and employs a heuristic to couple the estimates in order to improve the estimator. While the original paper did not contain any theoretical proof, even of consistency, its excellent practical performance has encouraged widespread adoption. Recent work [17] has established the consistency of this estimator along with its convergence rate. Further, recent works [14, 16] involving a combination of kernel density estimators and k-NN methods have been proposed to further improve the KSG estimator. [42] extends the KSG estimator to the case when one variable is discrete and another is scalar continuous. None of these works consider a case even if one of the components has a mixture of continuous and discrete distribution, let alone for general probability distributions. There are two generic options: (1) one can add small independent noise on each sample to break the multiple samples and apply a continuous valued MI estimator (like KSG), or (2) quantize and apply discrete MI estimators but the performance for high-dimensional case is poor. These form baselines to compare against in our detailed simulations. Mixed Regime. We first examine the behavior of other estimators in the mixed regime, before proceeding to develop our estimator. Let us consider the case when X is discrete (but real valued) and Y possesses a density. In this case, we will examine the consequence of using the 3H principle, with differential entropy estimated by the K-nearest neighbors. To do this, fix a parameter k, that determines the number of neighbors and let ρi,z denote the distance of the k-the nearest neighbor of z, where z = x or z = y or z = (x, y). Then bI(N) 3H (X; Y ) = 1 N N X i=1 log Ncxρd i,x k + a(k) ! + 1 N N X i=1 log Ncyρd i,y k + a(k) ! − 1 N N X i=1 log Ncxyρd i,xy k + a(k) ! where ψ(·) is the digamma function and a(·) = log(·) −ψ(·). In the case that X is discrete and Y has a density, I3H(X; Y ) = −∞+ a −b = −∞, which is clearly wrong. The basic idea of the KSG estimator is to ensure that the ρ is the same for both x, y and (x, y) and the difference is instead in the number of nearest neighbors. Let nx,i be the number of samples of Xi’s 3 within distance ρi,xy and ny,i be the number of samples of Yi’s within distance ρi,xy. Then the KSG estimator is given by bI(N) KSG ≡ 1 N PN i=1 ( ψ(k) + log(N) −log(nx,i + 1) −log(ny,i + 1) ) where ψ(·) is the digamma function. In the case of X being discrete and Y being continuous, it turns out that the KSG estimator does not blow up (unlike the 3H estimator), since the distances do not go to zero. However, in the mixed case, the estimator has a non-trivial bias due to discrete points and is no longer consistent. Proposed Estimator. We propose the following estimator for general probability distributions, inspired by the KSG estimator. The intuition is as follows. Fist notice that MI is the average of the logarithm of Radon-Nikodym derivative, so we compute the Radon-Nikodym derivative for each sample i and take the empirical average. The re-substitution estimator for MI is then given as follows: bI(X; Y ) ≡1 n Pn i=1 log  dPXY dPXPY  (xi,yi) . The basic idea behind our estimate of the Radon-Nikodym derivative at each sample point is as follows: • When the point is discrete (which can be detected by checking if the k-nearest neighbor distance of data i is zero), then we can assert that data i is in a discrete component, and we can use plug-in estimator for Radon-Nikodym derivative. • If the point is such that there is a joint density (locally), the KSG estimator suggests a natural idea: fix the radius and estimate the Radon-Nikodym derivative by (ψ(k) + log(N) −log(nx,i + 1) −log(ny,i + 1)). • If k-nearest neighbor distance is not zero, then it may be either purely continuous or mixed. But we show below that the method for purely continuous is also applicable for mixed. Precisely, let nx,i be the number of samples of Xi’s within distance ρi,xy and ny,i be the number of samples of Yi’s with in ρi,xy. Denote ˜ki by the number of tuples (Xi, Yi) within distance ρi,xy. If the k-NN distance is zero, which means that the sample (Xi, Yi) is a discrete point of the probability measure, we set k to ˜ki, which is the number of samples that have the same value as (Xi, Yi). Otherwise we just keep ˜ki as k. Our proposed estimator is described in detail in Algorithm 1. Algorithm 1 Mixed Random Variable Mutual Information Estimator Input: {Xi, Yi}N i=1, where Xi ∈X and Yi ∈Y; Parameter: k ∈Z+; for i = 1 to N do ρi,xy := the k smallest distance among [di,j := max{∥Xj −Xi∥, ∥Yj −Yi∥}, j ̸= i]; if ρi,xy = 0 then ˜ki := number of samples such that di,j = 0; else ˜ki := k; end if nx,i := number of samples such that ∥Xj −Xi∥≤ρi,xy; ny,i := number of samples such that ∥Yj −Yi∥≤ρi,xy; ξi := ψ(˜ki) + log N −log(nx,i + 1) −log(ny,i + 1); end for Output: bI(N)(X; Y ) := 1 N PN i=1 ξi. We note that our estimator recovers previous ideas in several canonical settings. If the underlying distribution is discrete, the k-nearest neighbor distance ρi,xy equals to 0 with high probability, then our estimator recovers the plug-in estimator. If the underlying distribution does not have probability masses, then there are no multiple overlapping samples, so ˜ki equals to k, our estimator recovers the KSG estimator. If X is discrete and Y is single-dimensional continuous and PX(x) > 0 for all x, for sufficiently large dataset, the k-nearest neighbors of sample (xi, yi) will be located on the same xi with high probability. Therefore, our estimator recovers the discrete vs continuous estimator in [42]. 4 4 Proof of Consistency We show that under certain technical conditions on the joint probability measure, the proposed estimator is consistent. We begin with the following definitions. PXY (x, y, r) ≡ PXY ( {(a, b) ∈X × Y : ∥a −x∥≤r, ∥b −y∥≤r} ) , (2) PX(x, r) ≡ PX ( {a ∈X : ∥a −x∥≤r} ) , (3) PY (y, r) ≡ PY ( {b ∈Y : ∥b −y∥≤r} ) . (4) Theorem 1. Suppose that 1. k is chosen to be a function of N such that kN →∞and kN log N/N →0 as N →∞. 2. The set of discrete points {(x, y) : PXY (x, y, 0) > 0} is finite. 3. PXY (x,y,r) PX(x,r)PY (y,r) converges to f(x, y) as r →0 and f(x, y) ≤C with probability 1. 4. X ×Y can be decomposed into countable disjoint sets {Ei}∞ i=1 such that f(x, y) is uniformly continuous on each Ei. 5. R X×Y log f(x, y) dPXY < +∞. Then we have limN→∞E h bI(N)(X; Y ) i = I(X; Y ) . Notice that Assumptions 2,3,4 are satisfied whenever (1) the distribution is (finitely) discrete; (2) the distribution is continuous; (3) some dimensions are (countably) discrete and some dimensions are continuous; (4) a mixture of the previous cases. Most real world data can be covered by these cases. A sketch of the proof is below with the full proof in the supplementary material. Proof. (Sketch) We start with an explicit form of the Radon-Nikodym derivative dPXY /(dPXPY ). Lemma 4.1. Under Assumption 3 and 4 in Theorem 1, (dPXY /(dPXPY ))(x, y) = f(x, y) = limr→0 PXY (x, y, r)/(PX(x, r)PY (y, r)). Notice that bIN(X; Y ) = (1/N) PN i=1 ξi, where all ξi are identically distributed. Therefore, E[bI(N)(X; Y )] = E[ξ1]. Therefore, the bias can be written as: E[bI(N)(X; Y )] −I(X; Y ) = EXY [E [ξ1|X, Y ]] − Z log f(X, Y )PXY ≤ Z E [ξ1|X, Y ] −log f(X, Y ) dPXY . (5) Now we upper bound E [ ξ1|X, Y ]−log f(X, Y ) for every (x, y) ∈X ×Y by dividing the domain into three parts as X × Y = Ω1 S Ω2 S Ω3 where • Ω1 = {(x, y) : f(x, y) = 0} ; • Ω2 = {(x, y) : f(x, y) > 0, PXY (x, y, 0) > 0} ; • Ω3 = {(x, y) : f(x, y) > 0, PXY (x, y, 0) = 0} . We show that limN→∞ R Ωi E [ξ1|X, Y ]−log f(X, Y ) dPXY = 0 for each i ∈{1, 2, 3} separately. • For (x, y) ∈Ω1, we will show that Ω1 has zero probability with respect to PXY , i.e. PXY (Ω1) = 0. Hence, R Ω1 E [ξ1|X, Y ] −log f(X, Y ) dPXY = 0. 5 • For (x, y) ∈Ω2, f(x, y) equals to PXY (x, y, 0)/PX(x, 0)PY (y, 0), so it can be viewed as a discrete part. We will first show that the k-nearest neighbor distance ρk,1 = 0 with high probability. Then we will use the the number of samples on (x, y) as ˜ki, and we will show that the mean of estimate ξ1 is closed to log f(x, y). • For (x, y) ∈Ω3, it can be viewed as a continuous part. We use the similar proof technique as [27] to prove that the mean of estimate ξ1 is closed to log f(x, y). The following theorem bounds the variance of the proposed estimator. Theorem 2. Assume in addition that 6. (kN log N)2/N →0 as N →∞. Then we have lim N→∞Var h bI(N)(X; Y ) i = 0 . (6) Proof. (Sketch) We use the Efron-Stein inequality to bound the variance of the estimator. For simplicity, let bI(N)(Z) be the estimate based on original samples {Z1, Z2, . . . , ZN}, where Zi = (Xi, Yi), and bI(N)(Z\j) is the estimate from {Z1, . . . , Zj−1, Zj+1, . . . , ZN}. Then a certain version of EfronStein inequality states that: Var h bI(N)(Z) i ≤2 PN j=1  supZ1,...,ZN bI(N)(Z) −bI(N)(Z\j) 2 . Now recall that bI(N)(Z) = 1 N N X i=1 ξi(Z) = 1 N N X i=1  ψ(˜ki) + log N −log(nx,i + 1) −log(ny,i + 1)  , (7) Therefore, we have sup Z1,...,ZN bI(N)(Z) −bI(N)(Z\j) ≤1 N sup Z1,...,ZN N X i=1 ξi(Z) −ξi(Z\j) . (8) To upper bound the difference | ξi(Z) −ξi(Z\j) | created by eliminating sample Zj for different i ’s we consider three different cases: (1) i = j; (2) ρk,i = 0; (3) ρk,i > 0, and conclude that PN i=1 | ξi(Z) −ξi(Z\j) | ≤O(k log N) for all Zi’s. The detail of the case study is in Section. ?? in the supplementary material. Plug it into Efron-Stein inequality, we obtain: Var h bI(N)(Z) i ≤2 N X j=1  sup Z1,...,ZN bI(N)(Z) −bI(N)(Z\j) 2 ≤ 2 N X j=1 1 N sup Z1,...,ZN N X i=1 ξi(Z) −ξi(Z\j) !2 = O((k log N)2/N) . (9) By Assumption 6, we have limN→∞Var h bI(N)(Z) i = 0. Combining Theorem 1 and Theorem 2, we have the ℓ2 consistency of bI(N)(X; Y ). 5 Simulations We evaluate the performance of our estimator in a variety of (synthetic and real-world) experiments. Experiment I. (X, Y ) is a mixture of one continuous distribution and one discrete distribution. The continuous distribution is jointly Gaussian with zero mean and covariance Σ =  1 0.9 0.9 1  , and 6 -3 -2 -1 0 1 2 3 -3 -2 -1 0 1 2 3 X Y 0 1 2 3 4 5 6 0 1 2 3 4 X Y Figure 1: Left: An example of samples from a mixture of continuous (blue) and discrete (red) distributions, where red points denote multiple samples. Right: An example of samples from a discrete X and a continuous Y . the discrete distribution is P(X = 1, Y = 1) = P(X = −1, Y = −1) = 0.45 and P(X = 1, Y = −1) = P(X = −1, 1) = 0.05. These two distributions are mixed with equal probability. The scatter plot of a set of samples from this distribution is shown in the left panel of Figure. 1, where the red squares denote multiple samples from the discrete distribution. For all synthetic experiments, we compare our proposed estimator with a (fixed) partitioning estimator, an adaptive partitioning estimator [11] implemented by [47], the KSG estimator [27] and noisy KSG estimator (by adding Gaussian noise N(0, σ2I) on each sample to transform all mixed distributions into continuous one). We plot the mean squared error versus number of samples in Figure 2. The mean squared error is averaged over 250 independent trials. The KSG estimator is entirely misled by the discrete samples as expected. The noisy KSG estimator performs better but the added noise causes the estimate to degrade. In this experiment, the estimate is less sensitive to the noise added and the line is indistinguishable with the line for KSG. The partitioning and adaptive partitioning method quantizes all samples, resulting in an extra quantization error. Note that only the proposed estimator has error decreasing with the sample size. Experiment II. X is a discrete random variable and Y is a continuous random variable. X is uniformly distributed over integers {0, 1, . . . , m −1} and Y is uniformly distributed over the range [X, X + 2] for a given X. The ground truth I(X; Y ) = log(m) −(m −1) log(2)/m. We choose m = 5 and a scatter plot of a set of samples is in the right panel of Figure. 1. Notice that in this case (and the following experiments) our proposed estimator degenerates to KSG if the hyper parameter k is chosen the same, hence KSG is not plotted. In this experiment our proposed estimator outperforms other methods. Experiment III. Higher dimensional mixture. Let (X1, Y1) and (Y2, X2) have the same joint distribution as in experiment II and independent of each other. We evaluate the mutual information between X = (X1, X2) and Y = (Y1, Y2). Then ground truth I(X; Y ) = 2(log(m) −(m − 1) log(2)/m). We also consider X = (X1, X2, X3) and Y = (Y1, Y2, Y3) where (X3, Y3) have the same joint distribution as in experiment II and independent of (X1, Y1), (X2, Y2). The ground truth I(X; Y ) = 3(log(m) −(m −1) log(2)/m). The adaptive partitioning algorithm works only for one-dimensional X and Y and is not compared here. We can see that the performance of partitioning estimator is very bad because the number of partitions grows exponentially with dimension. Proposed algorithm suffers less from the curse of dimensionality. For the right figure, noisy KSG method has smaller error, but we point out that it is unstable with respect to the noise level added: as the noise level is varied from σ = 0.5 to σ = 0.7 and the performance varies significantly (far from convergence). Experiment IV. Zero-inflated Poissonization. Here X ∼Exp(1) is a standard exponential random variable, and Y is zero-inflated Poissonization of X, i.e., Y = 0 with probability p and Y ∼ Poisson(x) given X = x with probability 1 −p. Here the ground truth is I(X; Y ) = (1 − p)(2 log 2 −γ −P∞ k=1 log k · 2−k) ≈(1 −p)0.3012, where γ is Euler-Mascheroni constant. We repeat the experiment for no zero-inflation (p = 0) and for p = 15%. We find that the proposed 7 estimator is comparable to adaptive partitioning for no zero-inflation and outperforms others for 15% zero-inflation. 1e-3 0.01 0.1 1 10 800 1600 2400 3200 Proposed Partitioning Adapt Part Noisy KSG KSG mean squared error 1e-5 1e-4 1e-3 0.01 0.1 1 800 1600 2400 3200 Proposed Partitioning Adapt Part Noisy KSG 1e-3 0.01 0.1 1 10 800 1600 2400 3200 Proposed Partitioning Noisy KSG mean squared error 0.1 1 10 800 1600 2400 3200 Proposed Partitioning (Small) Noisy KSG (Large) Noisy KSG 1e-5 1e-4 1e-3 0.01 0.1 1 800 1600 2400 3200 Proposed Partitioning Adapt Part Noisy KSG mean squared error sample size 1e-5 1e-4 1e-3 0.01 0.1 1 800 1600 2400 3200 Proposed Partitioning Adapt Part Noisy KSG sample size Figure 2: Mean squared error vs. sample size for synthetic experiments. Top row (left to right): Experiment I; Experiment II. Middle row (left to right): Experiment III for 4 dimensions and 6 dimensions. Bottom row (left to right): Experiment IV for p = 0 and p = 15%. We conclude that our proposed estimator is consistent for all these four experiments, and the mean squared error is always the best or comparable to the best. Other estimators are either not consistent or have large mean squared error for at least one experiment. Feature Selection Task. Suppose there are a set of features modeled by independent random variables (X1, . . . , Xp) and the data Y depends on a subset of features {Xi}i∈S, where card(S) = q < p. We observe the features (X1, . . . , Xp) and data Y and try to select which features are related to Y . In many biological applications, some of the data is lost due to experimental reasons and set to 0; even the available data is noisy. This setting naturally leads to a mixture of continuous and discrete parts which we model by supposing that the observation is ˜Xi and ˜Y , instead of Xi and Y . Here ˜Xi and ˜Y equals to 0 with probability σ and follows Poisson distribution parameterized by Xi or Y (which corresponds to the noisy observation) with probability 1 −σ. In this experiment, (X1, . . . , X20) are i.i.d. standard exponential random variables and Y is simply (X1, . . . , X5). ˜Xi equals to 0 with probability 0.15, and ˜Xi ∼Poisson(Xi) with probability 0.85. ˜Yi equals to 0 with probability 0.15 and ˜Yi ∼Exp(Yi) with probability 0.85. Upon observing ˜Xi’s 8 and ˜Y , we evaluate MIi = I( ˜Xi; Y ) using different estimators, and select the features with top-r highest mutual information. Since the underlying number of features is unknown, we iterate over all r ∈{0, . . . , p} and observe a receiver operating characteristic (ROC) curve, shown in left of Figure 3. Compared to partitioning, noisy KSG and KSG estimators, we conclude that our proposed estimator outperforms other estimators. 0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0 Proposed Partitioning Noisy KSG KSG False Positive Rate True Positive Rate 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.0 0.2 0.4 0.6 0.8 1.0 Proposed Partitioning Noisy KSG KSG Level of Dropout AUROC Figure 3: Left: ROC curve for the feature selection task. Right: AUROC versus levels of dropout for gene regulatory network inference. Gene regulatory network inference. Gene expressions form a rich source of data from which to infer gene regulatory networks; it is now possible to sequence gene expression data from single cells using a technology called single-cell RNA-sequencing [52]. However, this technology has a problem called dropout, which implies that sometimes, even when the gene is present it is not sequenced [25, 12]. While we tested our algorithm on real single-cell RNA-seq dataset, it is hard to establish the ground truth on these datasets. Instead we resorted to a challenge dataset for reconstructing regulatory networks, called the DREAM5 challenge [30]. The simulated (insilico) version of this dataset contains gene expression for 20 genes with 660 data point containing various perturbations. The goal is to reconstruct the true network between the various genes. We used mutual information as the test statistic in order to obtain AUROC for various methods. While the dataset did not have any dropouts, in order to simulate the effect of dropouts in real data, we simulated various levels of dropout and compared the AUROC (area under ROC) of different algorithms in the right of Figure 3 where we find the proposed algorithm to outperform the competing ones. Acknowledgement This work was partially supported by NSF grants CNS-1527754, CCF-1553452, CCF-1705007, CCF-1651236, CCF-1617745, CNS-1718270 and GOOGLE Faculty Research Award. References [1] Jayadev Acharya, Hirakendu Das, Alon Orlitsky, and Ananda Suresh. Maximum likelihood approach for symmetric distribution property estimation. [2] R. Battiti. Using mutual information for selecting features in supervised neural net learning. Neural Networks, IEEE Transactions on, 5(4):537–550, 1994. [3] Jan Beirlant, Edward J Dudewicz, László Györfi, and Edward C Van der Meulen. Nonparametric entropy estimation: An overview. International Journal of Mathematical and Statistical Sciences, 6(1):17–39, 1997. [4] Thomas B Berrett, Richard J Samworth, and Ming Yuan. Efficient multivariate entropy estimation via k-nearest neighbour distances. arXiv preprint arXiv:1606.00304, 2016. [5] Gérard Biau and Luc Devroye. Lectures on the nearest neighbor method. Springer, 2015. [6] Christopher M Bishop. Pattern recognition. Machine Learning, 128:1–58, 2006. 9 [7] Yuheng Bu, Shaofeng Zou, Yingbin Liang, and Venugopal V Veeravalli. Estimation of kl divergence between large-alphabet distributions. In Information Theory (ISIT), 2016 IEEE International Symposium on, pages 1118–1122. IEEE, 2016. [8] C. Chan, A. Al-Bashabsheh, J. B. Ebrahimi, T. Kaced, and T. Liu. Multivariate mutual information inspired by secret-key agreement. Proceedings of the IEEE, 103(10):1883–1913, 2015. [9] C Chow and Cong Liu. Approximating discrete probability distributions with dependence trees. IEEE transactions on Information Theory, 14(3):462–467, 1968. [10] T. M. Cover and J. A. Thomas. Information theory and statistics. Elements of Information Theory, pages 279–335, 1991. [11] Georges A Darbellay and Igor Vajda. Estimation of the information by an adaptive partitioning of the observation space. IEEE Transactions on Information Theory, 45(4):1315–1321, 1999. [12] Greg Finak, Andrew McDavid, Masanao Yajima, Jingyuan Deng, Vivian Gersuk, Alex K Shalek, Chloe K Slichter, Hannah W Miller, M Juliana McElrath, Martin Prlic, et al. Mast: a flexible statistical framework for assessing transcriptional changes and characterizing heterogeneity in single-cell rna sequencing data. Genome biology, 16(1):278, 2015. [13] F. Fleuret. Fast binary feature selection with conditional mutual information. The Journal of Machine Learning Research, 5:1531–1555, 2004. [14] S. Gao, G Ver Steeg, and A. Galstyan. Estimating mutual information by local gaussian approximation. arXiv preprint arXiv:1508.00536, 2015. [15] Shuyang Gao, Greg Ver Steeg, and Aram Galstyan. Efficient estimation of mutual information for strongly dependent variables. In Artificial Intelligence and Statistics, pages 277–286, 2015. [16] Weihao Gao, Sewoong Oh, and Pramod Viswanath. Breaking the bandwidth barrier: Geometrical adaptive entropy estimation. In Advances in Neural Information Processing Systems, pages 2460–2468, 2016. [17] Weihao Gao, Sewoong Oh, and Pramod Viswanath. Demystifying fixed k-nearest neighbor information estimators. In Information Theory (ISIT), 2017 IEEE International Symposium on, pages 1267–1271. IEEE, 2017. [18] Izrail Moiseevich Gelfand and AM Yaglom. Calculation of the amount of information about a random function contained in another such function. American Mathematical Society Providence, 1959. [19] Yanjun Han, Jiantao Jiao, and Tsachy Weissman. Adaptive estimation of shannon entropy. In Information Theory (ISIT), 2015 IEEE International Symposium on, pages 1372–1376. IEEE, 2015. [20] Yanjun Han, Jiantao Jiao, and Tsachy Weissman. Minimax estimation of discrete distributions under ell1 loss. IEEE Transactions on Information Theory, 61(11):6343–6354, 2015. [21] Jiantao Jiao, Kartik Venkat, Yanjun Han, and Tsachy Weissman. Minimax estimation of functionals of discrete distributions. IEEE Transactions on Information Theory, 61(5):2835– 2885, 2015. [22] Jiantao Jiao, Kartik Venkat, Yanjun Han, and Tsachy Weissman. Maximum likelihood estimation of functionals of discrete distributions. IEEE Transactions on Information Theory, 63(10):6774– 6798, 2017. [23] Jiantao Jiao, Kartik Venkat, and Tsachy Weissman. Non-asymptotic theory for the plug-in rule in functional estimation. available on arXiv, 2014. [24] Peter V Kharchenko, Lev Silberstein, and David T Scadden. Bayesian approach to single-cell differential expression analysis. Nature methods, 11(7):740–742, 2014. 10 [25] Peter V Kharchenko, Lev Silberstein, and David T Scadden. Bayesian approach to single-cell differential expression analysis. Nature methods, 11(7):740–742, 2014. [26] LF Kozachenko and Nikolai N Leonenko. Sample estimate of the entropy of a random vector. Problemy Peredachi Informatsii, 23(2):9–16, 1987. [27] A. Kraskov, H. Stögbauer, and P. Grassberger. Estimating mutual information. Physical review E, 69(6):066138, 2004. [28] Smita Krishnaswamy, Matthew H Spitzer, Michael Mingueneau, Sean C Bendall, Oren Litvin, Erica Stone, Dana Pe’er, and Garry P Nolan. Conditional density-based analysis of t cell signaling in single-cell data. Science, 346(6213):1250689, 2014. [29] Pan Li and Olgica Milenkovic. Inhomogoenous hypergraph clustering with applications. arXiv preprint arXiv:1709.01249, 2017. [30] Daniel Marbach, James C Costello, Robert Küffner, Nicole M Vega, Robert J Prill, Diogo M Camacho, Kyle R Allison, Manolis Kellis, James J Collins, Gustavo Stolovitzky, et al. Wisdom of crowds for robust gene network inference. Nature methods, 9(8):796–804, 2012. [31] Kevin R Moon, Kumar Sricharan, and Alfred O Hero III. Ensemble estimation of mutual information. arXiv preprint arXiv:1701.08083, 2017. [32] A. C. Müller, S. Nowozin, and C. H. Lampert. Information theoretic clustering using minimum spanning trees. Springer, 2012. [33] Liam Paninski. Estimation of entropy and mutual information. Neural computation, 15(6):1191– 1253, 2003. [34] Liam Paninski and Masanao Yajima. Undersmoothed kernel entropy estimators. IEEE Transactions on Information Theory, 54(9):4384–4388, 2008. [35] H. Peng, F. Long, and C. Ding. Feature selection based on mutual information criteria of maxdependency, max-relevance, and min-redundancy. Pattern Analysis and Machine Intelligence, IEEE Transactions on, 27(8):1226–1238, 2005. [36] A Perez. Information theory with abstract alphabets. Theory of Probability and its Applications, 4(1), 1959. [37] Emma Pierson and Christopher Yau. Zifa: Dimensionality reduction for zero-inflated single-cell gene expression analysis. Genome biology, 16(1):241, 2015. [38] Mark S Pinsker. Information and information stability of random variables and processes. 1960. [39] Yury Polyanskiy and Yihong Wu. Strong data-processing inequalities for channels and bayesian networks. In Convexity and Concentration, pages 211–249. Springer, 2017. [40] David N Reshef, Yakir A Reshef, Hilary K Finucane, Sharon R Grossman, Gilean McVean, Peter J Turnbaugh, Eric S Lander, Michael Mitzenmacher, and Pardis C Sabeti. Detecting novel associations in large data sets. science, 334(6062):1518–1524, 2011. [41] Fred Rieke. Spikes: exploring the neural code. MIT press, 1999. [42] B. C. Ross. Mutual information between discrete and continuous data sets. PloS one, 9(2):e87357, 2014. [43] Shashank Singh and Barnabás Póczos. Exponential concentration of a density functional estimator. In Advances in Neural Information Processing Systems, pages 3032–3040, 2014. [44] Shashank Singh and Barnabás Póczos. Finite-sample analysis of fixed-k nearest neighbor density functional estimators. In Advances in Neural Information Processing Systems, pages 1217–1225, 2016. [45] Shashank Singh and Barnabás Pøczos. Nonparanormal information estimation. arXiv preprint arXiv:1702.07803, 2017. 11 [46] K. Sricharan, D. Wei, and A. O. Hero. Ensemble estimators for multivariate entropy estimation. Information Theory, IEEE Transactions on, 59(7):4374–4388, 2013. [47] Zoltán Szabó. Information theoretical estimators toolbox. Journal of Machine Learning Research, 15:283–287, 2014. [48] Gregory Valiant and Paul Valiant. Estimating the unseen: an n/log (n)-sample estimator for entropy and support size, shown optimal via new clts. In Proceedings of the forty-third annual ACM symposium on Theory of computing, pages 685–694. ACM, 2011. [49] G. Ver Steeg and A. Galstyan. Maximally informative hierarchical representations of highdimensional data. stat, 1050:27, 2014. [50] Q. Wang, S. R. Kulkarni, and S. Verdú. Divergence estimation of continuous distributions based on data-dependent partitions. Information Theory, IEEE Transactions on, 51(9):3064–3074, 2005. [51] Q. Wang, S. R. Kulkarni, and S. Verdú. Divergence estimation for multidimensional densities via-nearest-neighbor distances. Information Theory, IEEE Transactions on, 55(5):2392–2405, 2009. [52] Angela R Wu, Norma F Neff, Tomer Kalisky, Piero Dalerba, Barbara Treutlein, Michael E Rothenberg, Francis M Mburu, Gary L Mantalas, Sopheak Sim, Michael F Clarke, et al. Quantitative assessment of single-cell rna-sequencing methods. Nature methods, 11(1):41–46, 2014. [53] Yihong Wu and Pengkun Yang. Minimax rates of entropy estimation on large alphabets via best polynomial approximation. IEEE Transactions on Information Theory, 62(6):3702–3720, 2016. 12
2017
627
7,149
Reconstructing perceived faces from brain activations with deep adversarial neural decoding Ya˘gmur Güçlütürk*, Umut Güçlü*, Katja Seeliger, Sander Bosch, Rob van Lier, Marcel van Gerven, Radboud University, Donders Institute for Brain, Cognition and Behaviour Nijmegen, the Netherlands {y.gucluturk, u.guclu}@donders.ru.nl *Equal contribution Abstract Here, we present a novel approach to solve the problem of reconstructing perceived stimuli from brain responses by combining probabilistic inference with deep learning. Our approach first inverts the linear transformation from latent features to brain responses with maximum a posteriori estimation and then inverts the nonlinear transformation from perceived stimuli to latent features with adversarial training of convolutional neural networks. We test our approach with a functional magnetic resonance imaging experiment and show that it can generate state-of-the-art reconstructions of perceived faces from brain activations. ConvNet (pretrained) + PCA ConvNet (adversarial training) latent feat. prior (Gaussian) maximum a posteriori likelihood (Gaussian) posterior (Gaussian) perceived stim. brain resp. *reconstruction *from brain resp. Figure 1: An illustration of our approach to solve the problem of reconstructing perceived stimuli from brain responses by combining probabilistic inference with deep learning. 1 Introduction A key objective in sensory neuroscience is to characterize the relationship between perceived stimuli and brain responses. This relationship can be studied with neural encoding and neural decoding in functional magnetic resonance imaging (fMRI) [1]. The goal of neural encoding is to predict brain responses to perceived stimuli [2]. Conversely, the goal of neural decoding is to classify [3, 4], identify [5, 6] or reconstruct [7–11] perceived stimuli from brain responses. The recent integration of deep learning into neural encoding has been a very successful endeavor [12, 13]. To date, the most accurate predictions of brain responses to perceived stimuli have been achieved with convolutional neural networks [14–20], leading to novel insights about the functional organization of neural representations. At the same time, the use of deep learning as the basis for neural decoding has received less widespread attention. Deep neural networks have been used for classifying or identifying stimuli via the use of a deep encoding model [16, 21] or by predicting 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. intermediate stimulus features [22, 23]. Deep belief networks and convolutional neural networks have been used to reconstruct basic stimuli (handwritten characters and geometric figures) from patterns of brain activity [24, 25]. To date, going beyond such mostly retinotopy-driven reconstructions and reconstructing complex naturalistic stimuli with high accuracy have proven to be difficult. The integration of deep learning into neural decoding is an exciting approach for solving the reconstruction problem, which is defined as the inversion of the (non)linear transformation from perceived stimuli to brain responses to obtain a reconstruction of the original stimulus from patterns of brain activity alone. Reconstruction can be formulated as an inference problem, which can be solved by maximum a posteriori estimation. Multiple variants of this formulation have been proposed in the literature [26–30]. At the same time, significant improvements are to be expected from deep neural decoding given the success of deep learning in solving image reconstruction problems in computer vision such as colorization [31], face hallucination [32], inpainting [33] and super-resolution [34]. Here, we present a new approach by combining probabilistic inference with deep learning, which we refer to as deep adversarial neural decoding (DAND). Our approach first inverts the linear transformation from latent features to observed responses with maximum a posteriori estimation. Next, it inverts the nonlinear transformation from perceived stimuli to latent features with adversarial training and convolutional neural networks. An illustration of our model is provided in Figure 1. We show that our approach achieves state-of-the-art reconstructions of perceived faces from the human brain. 2 Methods 2.1 Problem statement Let x ∈Rh×w×c, z ∈Rp, y ∈Rq be a stimulus, feature, response triplet, and φ : Rh×w×c →Rp be a latent feature model such that z = φ(x) and x = φ−1(z). Without loss of generality, we assume that all of the variables are normalized to have zero mean and unit variance. We are interested in solving the problem of reconstructing perceived stimuli from brain responses: ˆx = φ−1(arg max z Pr (z | y)) (1) where Pr(z | y) is the posterior. We reformulate the posterior through Bayes’ theorem: ˆx = φ−1  arg max z [Pr(y | z) Pr(z)]  (2) where Pr(y | z) is the likelihood, and Pr(z) is the prior. In the following subsections, we define the latent feature model, the likelihood and the prior. 2.2 Latent feature model We define the latent feature model φ(x) by modifying the VGG-Face pretrained model [35]. This model is a 16-layer convolutional neural network, which was trained for face recognition. First, we truncate it by retaining the first 14 layers and discarding the last two layers of the model. At this point, the truncated model outputs 4096-dimensional latent features. To reduce the dimensionality of the latent features, we then combine the model with principal component analysis by estimating the loadings that project the 4096-dimensional latent features to the first 699 principal component scores (maximum number of components given the number of training observations) and adding them at the end of the truncated model as a new fully-connected layer. At this point, the combined model outputs 699-dimensional latent features. Following the ideas presented in [36–38], we define the inverse of the feature model φ−1(z) (i.e., the image generator) as a convolutional neural network which transforms the 699-dimensional latent variables to 64 × 64 × 3 images and estimate its parameters via an adversarial process. The generator comprises five deconvolution layers: The ith layer has 210−i kernels with a size of 4 × 4, a stride of 2 × 2, a padding of 1 × 1, batch normalization and rectified linear units. Exceptions are the first layer which has a stride of 1 × 1, and no padding; and the last layer which has three kernels, no batch normalization [39] and hyperbolic tangent units. Note that we do use the inverse of the loadings in the generator. 2 To enable adversarial training, we define a discriminator (ψ) along with the generator. The discriminator comprises five convolution layers. The ith layer has 25+i kernels with a size of 4 × 4, a stride of 2 × 2, a padding of 1 × 1, batch normalization and leaky rectified linear units with a slope of 0.2 except for the first layer which has no batch normalization and last layer which has one kernel, a stride of 1 × 1, no padding, no batch normalization and a sigmoid unit. We train the generator and the discriminator by pitting them against each other in a two-player zero-sum game, where the goal of the discriminator is to discriminate stimuli from reconstructions and the goal of the generator is to generate reconstructions that are indiscriminable from original stimuli. This ensures that reconstructed stimuli are similar to target stimuli on a pixel level and a feature level. The discriminator is trained by iteratively minimizing the following discriminator loss function: Ldis = −E  log(ψ(x)) + log(1 −ψ(φ−1(z)))  (3) where ψ is the output of the discriminator which gives the probability that its input is an original stimulus and not a reconstructed stimulus. The generator is trained by iteratively minimizing a generator loss function, which is a linear combination of an adversarial loss function, a feature loss function and a stimulus loss function: Lgen = −λadv E  log(ψ(φ−1(z)))  | {z } Ladv +λfea E[∥ξ(x) −ξ(φ−1(z))∥2] | {z } Lfea +λsti E[∥x −φ−1(z)∥2] | {z } Lsti (4) where ξ is the relu3_3 outputs of the pretrained VGG-16 model [40, 41]. Note that the targets and the reconstructions are lower resolution (i.e., 64 × 64) than the images that are used to obtain the latent features (i.e., 224 × 224). 2.3 Likelihood and prior We define the likelihood as a multivariate Gaussian distribution over y: Pr(y|z) = Ny(B⊤z, Σ) (5) where B = (β1, . . . , βq) ∈Rp×q and Σ = diag(σ2 1, . . . , σ2 q) ∈Rq×q. Here, the features × voxels matrix B contains the learnable parameters of the likelihood in its columns βi (which can also be interpreted as regression coefficients of a linear regression model, which predicts y from z). We estimate the parameters with ordinary least squares, such that ˆβi = arg minβi E[∥yi −β⊤ i z∥2] and ˆσ2 i = E[∥yi −ˆβ ⊤ i z∥2]. We define the prior as a zero mean and unit variance multivariate Gaussian distribution Pr(z) = Nz(0, I). 2.4 Posterior To derive the posterior (2), we first reformulate the likelihood as a multivariate Gaussian distribution over z. That is, after taking out constant terms with respect to z from the likelihood, it immediately becomes proportional to the canonical form Gaussian over z with ν = BΣ−1y and Λ = BΣ−1B⊤, which is equivalent to the standard form Gaussian with mean Λ−1ν and covariance Λ−1. This allows us to write: Pr(z|y) ∝Nz Λ−1ν, Λ−1)Nz(0, I  (6) Next, recall that the product of two multivariate Gaussians can be formulated in terms of one multivariate Gaussian [42]. That is, Nz(m1, Σ1)Nz(m2, Σ2) ∝Nz(mc, Σc) with mc = Σ−1 1 + Σ−1 2 −1 Σ−1m1 + Σ−1 2 m2  and Σc = Σ−1 1 + Σ−1 2 −1. By plugging this formulation into Equation (6), we obtain Pr(z|y) ∝Nz(mc, Σc) with mc = (BΣ−1B⊤+ I)−1BΣ−1y and Σc = (BΣ−1B⊤+ I)−1. Recall that we are interested in reconstructing stimuli from responses by generating reconstructions from the features that maximize the posterior. Notice that the (unnormalized) posterior is maximized 3 at its mean mc since this corresponds to the mode for a multivariate Gaussian distribution. Therefore, the solution of the problem of reconstructing stimuli from responses reduces to the following simple expression: ˆx = φ−1 (BΣ−1B⊤+ I)−1BΣ−1y  (7) 3 Results 3.1 Datasets We used the following datasets in our experiments: fMRI dataset. We collected a new fMRI dataset, which comprises face stimuli and associated bloodoxygen-level dependent (BOLD) responses. The stimuli used in the fMRI experiment were drawn from [43–45] and other online sources, and consisted of photographs of front-facing individuals with neutral expressions. We measured BOLD responses (TR = 1.4 s, voxel size = 2 × 2 × 2 mm3, whole-brain coverage) of two healthy adult subjects (S1: 28-year old female; S2: 39-year old male) as they were fixating on a target (0.6 × 0.6 degree) [46] superimposed on the stimuli (15 × 15 degrees). Each face was presented at 5 Hz for 1.4 s and followed by a middle gray background presented for 2.8 s. In total, 700 faces were presented twice for the training set, and 48 faces were repeated 13 times for the test set. The test set was balanced in terms of gender and ethnicity (based on the norming data provided in the original datasets). The experiment was approved by the local ethics committee (CMO Regio Arnhem-Nijmegen) and the subjects provided written informed consent in accordance with the Declaration of Helsinki. Our fMRI dataset is available from the first authors on reasonable request. The stimuli were preprocessed as follows: Each image was cropped and resized to 224 × 224 pixels. This procedure was organized such that the distance between the top of the image and the vertical center of the eyes was 87 pixels, the distance between the vertical center of the eyes and the vertical center of the mouth was 75 pixels, the distance between the vertical center of the mouth and the bottom of the image was 61 pixels, and the horizontal center of the eyes and the mouth was at the horizontal center of the image. The fMRI data were preprocessed as follows: Functional scans were realigned to the first functional scan and the mean functional scan, respectively. Realigned functional scans were slice time corrected. Anatomical scans were coregistered to the mean functional scan. Brains were extracted from the coregistered anatomical scans. Finally, stimulus-specific responses were deconvolved from the realigned and slice time corrected functional scans with a general linear model [47]. Here, deconvolution refers to estimating regression coefficients (y) of the following GLMs: y∗= Xy, where y∗is raw voxel responses, X is HRF-convolved design matrix (one regressor per stimulus indicating its presence), and y is deconvolved voxel responses such that y is a vector of size m × 1 with m denoting the number of unique stimuli, and there is one y per voxel. CelebA dataset [48]. This dataset comprises 202599 in-the-wild portraits of 10177 people, which were drawn from online sources. The portraits are annotated with 40 attributes and five landmarks. We preprocessed the portraits as we preprocessed the stimuli in our fMRI dataset. 3.2 Implementation details Our implementation makes use of Chainer and Cupy with CUDA and cuDNN [49] except for the following: The VGG-16 and VGG-Face pretrained models were ported to Chainer from Caffe [50]. Principal component analysis was implemented in scikit-learn [51]. fMRI preprocessing was implemented in SPM [52]. Brain extraction was implemented in FSL [53]. We trained the discriminator and the generator on the entire CelebA dataset by iteratively minimizing the discriminator loss function and the generator loss function in sequence for 100 epochs with Adam [54]. Model parameters were initialized as follows: biases were set to zero, the scaling parameters were drawn from N(1, 2·10−2I), the shifting parameters were set to zero and the weights were drawn from N(1, 10−2I) [37]. We set the hyperparameters of the loss functions as follows: λadv = 102, λdis = 102, λfea = 10−2 and λsti = 2 · 10−6 [38]. We set the hyperparameters of the optimizer as follows: α = 0.001, β1 = 0.9, β2 = 0.999 and ϵ = 108 [37]. We estimated the parameters of the likelihood term on the training split of our fMRI dataset. 4 3.3 Evaluation metrics We evaluated our approach on the test split of our fMRI dataset with the following metrics: First, the feature similarity between the stimuli and their reconstructions, where the feature similarity is defined as the Euclidean similarity between the features, defined as the relu7 outputs of the VGGFace pretrained model. Second, the Pearson correlation coefficient between the stimuli and their reconstructions. Third, the structural similarity between the stimuli and their reconstructions [55]. All evaluation was done on a held-out set not used at any point during model estimation or training. The voxels used in the reconstructions were selected as follows: For each test trial, n voxels with smallest residuals (on training set) were selected. n itself was selected such that reconstruction accuracy of remaining test trials was highest. We also performed an encoding analysis to see how well the latent features were predictive of voxel responses in different brain areas. The results of this analysis is reported in the supplementary material. 3.4 Reconstruction We first demonstrate our results by reconstructing the stimulus images in the test set using i) the latent features and ii) the brain responses. Figure 2 shows 4 representative examples of the test stimuli and their reconstructions. The first column of both panels show the original test stimuli. The second column of both panels show the reconstructions of these stimuli x from the latent features z obtained by φ(x). These can be considered as an upper limit for the reconstruction accuracy of the brain responses since they are the best possible reconstructions that we can expect to achieve with a perfect neural decoder that can exactly predict the latent features from brain responses. The third and fourth columns of the figure show reconstructions of brain responses to stimuli of Subject 1 and Subject 2, respectively. stim. reconstruction from: model brain 1 brain 2 stim. reconstruction from: model brain 1 brain 2 Figure 2: Reconstructions of the test stimuli from the latent features (model) and the brain responses of the two subjects (brain 1 and brain 2). Visual inspection of the reconstructions from brain responses reveals that they match the test stimuli in several key aspects, such as gender, skin color and facial features. Table 1 shows the three reconstruction accuracy metrics for both subjects in terms of ratio of the reconstruction accuracy from brain responses to the reconstruction accuracy from latent features, which were significantly (p < 0.05, permutation test) above those for randomly sampled latent features (cf. 0.5181, 0.1532 and 0.5183, respectively). Table 1: Reconstruction accuracy of the proposed decoding approach. The results are reported as the ratio of accuracy of reconstructing from brain responses and latent features. Feature similarity Pearson correlation coefficient Structural similarity S1 0.6546 ± 0.0220 0.6512 ± 0.0493 0.8365 ± 0.0239 S2 0.6465 ± 0.0222 0.6580 ± 0.0480 0.8325 ± 0.0229 Furthermore, besides reconstruction accuracy, we tested the identification performance within and between groups that shared similar features (those that share gender or ethnicity as defined by the norming data were assumed to share similar features). Identification accuracies (which ranged between 57% and 62%) were significantly above chance-level (which ranged between 3% and 8%) in all cases (p ≪0.05, Student’s t-test). Furthermore, we found no significant differences between the identification accuracies when a reconstruction was identified among a group sharing similar features versus among a group that did not share similar features (p > 0.79, Student’s t-test) (cf. [56]). 5 3.5 Visualization, interpolation and sampling In the second experiment, we analyzed the properties of the stimulus features predictive of brain activations to characterize neural representations of faces. We first investigated the model representations to better understand what kind of features drive responses of the model. We visualized the features explaining the highest variance by independently setting the values of the first few latent dimensions to vary between their minimum and maximum values and generating reconstructions from these representations (Figure 3). As a result, we found that many of the latent features were coding for interpretable high level information such as age, gender, etc. For example, the first feature in Figure 3 appears to code for gender, the second one appears to code for hair color and complexion, the third one appears to code for age, and the fourth one appears to code for two different facial expressions. feature 1 2 3 4 feature i = min. <-> feature i = max. reconstruction (from features) feature i = min. <-> feature i = max. reconstruction (from features) Figure 3: Reconstructions from features with single features set to vary between their minimum and maximum values. We then explored the feature space that was learned by the latent feature model and the response space that was learned by the likelihood by systematically traversing the reconstructions obtained from different points in these spaces. Figure 4A shows examples of reconstructions of stimuli from the latent features (rows one and four) and brain responses (rows two, three, five and six), as well as reconstructions from their interpolations between two points (columns three to nine). The reconstructions from the interpolations between two points show semantic changes with no sharp transitions. Figure 4B shows reconstructions from latent features sampled from the model prior (first row) and from responses sampled from the response prior of each subject (second and third rows). The reconstructions from sampled representations are diverse and of high quality. These results provide evidence that no memorization took place and the models learned relevant and interesting representations [37]. Furthermore, these results suggest that neural representations of faces might be embedded in a continuous and distributed space in the brain. 3.6 Comparison versus state-of-the-art In this section we qualitatively (Figure 5) and quantitatively (Table 2) compare the performance of our approach with two existing decoding approaches from the literature∗. Figure 5 shows example reconstructions from brain responses with three different approaches, namely with our approach, the eigenface approach [11, 57] and the identity transform approach [58, 29]. To achieve a fair comparison, the implementations of the three approaches only differed in terms of the feature models that were used, i.e. the eigenface approach had an eigenface (PCA) feature model and the identity transform approach had simply an identity transformation in place of the feature model. Visual inspection of the reconstructions displayed in Figure 5 shows that DAND clearly outperforms the existing approaches. In particular, our reconstructions better capture the features of the stimuli ∗We also experimented with the VGG-ImageNet pretrained model, which failed to match the reconstruction performance of the VGG-Face model, while their encoding performances were comparable in non-face related brain areas. We plan to further investigate other models in detail in future work. 6 A B recon. (from interpolated features or responses) stim. reconstruction from: brain 2 brain 1 model stim. recon. recon. brain 2 brain 1 model recon. (from sampled features or responses) reconstruction from: brain 2 brain 1 model Figure 4: Reconstructions from interpolated (A) and sampled (B) latent features (model) and brain responses of the two subjects (brain 1 and brain 2). such as gender, skin color and facial features. Furthermore, our reconstructions are more detailed, sharper, less noisy and more photorealistic than the eigenface and identity transform approaches. A quantitative comparison of the performance of the three approaches shows that the reconstruction accuracies achieved by our approach were significantly higher than those achieved by the existing approaches (p ≪0.05, Student’s t-test). Table 2: Reconstruction accuracies of the three decoding approaches. LF denotes reconstructions from latent features. Feature similarity Pearson correlation coefficient Structural similarity Identity S1 0.1254 ± 0.0031 0.4194 ± 0.0347 0.3744 ± 0.0083 S2 0.1254 ± 0.0038 0.4299 ± 0.0350 0.3877 ± 0.0083 LF 1.0000 ± 0.0000 1.0000 ± 0.0000 1.0000 ± 0.0000 Eigenface S1 0.1475 ± 0.0043 0.3779 ± 0.0403 0.3735 ± 0.0102 S2 0.1457 ± 0.0043 0.2241 ± 0.0435 0.3671 ± 0.0113 LF 0.3841 ± 0.0149 0.9875 ± 0.0011 0.9234 ± 0.0040 DAND S1 0.1900 ± 0.0052 0.4679 ± 0.0358 0.4662 ± 0.0126 S2 0.1867 ± 0.0054 0.4722 ± 0.0344 0.4676 ± 0.0130 LF 0.2895 ± 0.0137 0.7181 ± 0.0419 0.5595 ± 0.0181 7 eigen. recon. from: identity recon. from: deep recon. from: brain 1 brain 2 brain 1 brain 2 brain 1 brain 2 stim. model model model Figure 5: Reconstructions from the latent features and brain responses of the two subjects (brain 1 and brain 2) using our decoding approach, as well as the eigenface and identity transform approaches for comparison. 3.7 Factors contributing to reconstruction accuracy Finally, we investigated the factors contributing to the quality of reconstructions from brain responses. All of the faces in the test set had been annotated with 30 objective physical measures (such as nose width, face length, etc.) and 14 subjective measures (such as attractiveness, gender, ethnicity, etc.). Among these measures, we identified five subjective measures that are important for face perception [59–64] as measures of interest and supplemented them with an additional measure of stimulus complexity. Complexity was included because of its important role in visual perception [65]. The selected measures were attractiveness, complexity, ethnicity, femininity, masculinity and prototypicality. Note that the complexity measure was not part of the dataset annotations and was defined as the Kolmogorov complexity of the stimuli, which was taken to be their compressed file sizes [66]. To this end, we correlated the reconstruction accuracies of the 48 stimuli in the test set (for both subjects) with their corresponding measures (except for ethnicity) and used a two-tailed Student’s t-test to test if the multiple comparison corrected (Bonferroni correction) p-value was less than the critical value of 0.05. In the case of ethnicity we used one-way analysis of variance to compare the reconstruction accuracies of faces with different ethnicities. We were able to reject the null hypothesis for the measures complexity, femininity and masculinity, but failed to do so for attractiveness, ethnicity and prototypicality. Specifically, we observed a significant negative correlation (r = -0.3067) between stimulus complexity and reconstruction accuracy. Furthermore, we found that masculinity and reconstruction accuracy were significantly positively correlated (r = 0.3841). Complementing this result, we found a negative correlation (r = -0.3961) between femininity and reconstruction accuracy. We found no effect of attractiveness, ethnicity and prototypicality on the quality of reconstructions. We then compared the complexity levels of the images of each gender and found that female face images were significantly more complex than male face images (p < 0.05, Student’s t-test), pointing to complexity as the factor underlying the relationship between reconstruction accuracy and gender. This result demonstrates the importance of taking stimulus complexity into account while making inferences about factors driving the reconstructions from brain responses. 4 Conclusion In this study we combined probabilistic inference with deep learning to derive a novel deep neural decoding approach. We tested our approach by reconstructing face stimuli from BOLD responses at an unprecedented level of accuracy and detail, matching the target stimuli in several key aspects such as gender, skin color and facial features as well as identifying perceptual factors contributing to the reconstruction accuracy. Deep decoding approaches such as the one developed here are expected to play an important role in the development of new neuroprosthetic devices that operate by reading subjective information from the human brain. 8 Acknowledgments This work has been partially supported by a VIDI grant (639.072.513) from the Netherlands Organization for Scientific Research and a GPU grant (GeForce Titan X) from the Nvidia Corporation. References [1] T. Naselaris, K. N. Kay, S. Nishimoto, and J. L. Gallant, “Encoding and decoding in fMRI,” NeuroImage, vol. 56, no. 2, pp. 400–410, may 2011. [2] M. van Gerven, “A primer on encoding models in sensory neuroscience,” J. Math. Psychol., vol. 76, no. B, pp. 172–183, 2017. [3] J. V. Haxby, “Distributed and overlapping representations of faces and objects in ventral temporal cortex,” Science, vol. 293, no. 5539, pp. 2425–2430, sep 2001. [4] Y. Kamitani and F. Tong, “Decoding the visual and subjective contents of the human brain,” Nature Neuroscience, vol. 8, no. 5, pp. 679–685, apr 2005. [5] 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, vol. 320, no. 5880, pp. 1191–1195, may 2008. [6] K. N. Kay, T. Naselaris, R. J. Prenger, and J. L. Gallant, “Identifying natural images from human brain activity,” Nature, vol. 452, no. 7185, pp. 352–355, mar 2008. [7] B. Thirion, E. Duchesnay, E. Hubbard, J. Dubois, J.-B. Poline, D. Lebihan, and S. Dehaene, “Inverse retinotopy: Inferring the visual content of images from brain activation patterns,” NeuroImage, vol. 33, no. 4, pp. 1104–1116, dec 2006. [8] Y. Miyawaki, H. Uchida, O. Yamashita, M. aki Sato, Y. Morito, H. C. Tanabe, N. Sadato, and Y. Kamitani, “Visual image reconstruction from human brain activity using a combination of multiscale local image decoders,” Neuron, vol. 60, no. 5, pp. 915–929, dec 2008. [9] T. Naselaris, R. J. Prenger, K. N. Kay, M. Oliver, and J. L. Gallant, “Bayesian reconstruction of natural images from human brain activity,” Neuron, vol. 63, no. 6, pp. 902–915, sep 2009. [10] S. Nishimoto, A. T. Vu, T. Naselaris, Y. Benjamini, B. Yu, and J. L. Gallant, “Reconstructing visual experiences from brain activity evoked by natural movies,” Current Biology, vol. 21, no. 19, pp. 1641–1646, oct 2011. [11] A. S. Cowen, M. M. Chun, and B. A. Kuhl, “Neural portraits of perception: Reconstructing face images from evoked brain activity,” NeuroImage, vol. 94, pp. 12–22, jul 2014. [12] D. L. K. Yamins and J. J. Dicarlo, “Using goal-driven deep learning models to understand sensory cortex,” Nat. Neurosci., vol. 19, pp. 356–365, 2016. [13] N. Kriegeskorte, “Deep neural networks: A new framework for modeling biological vision and brain information processing,” Annu. Rev. Vis. Sci., vol. 1, no. 1, pp. 417–446, 2015. [14] D. L. K. Yamins, H. Hong, C. F. Cadieu, E. A. Solomon, D. Seibert, and J. J. DiCarlo, “Performance-optimized hierarchical models predict neural responses in higher visual cortex,” Proceedings of the National Academy of Sciences, vol. 111, no. 23, pp. 8619–8624, may 2014. [15] S.-M. Khaligh-Razavi and N. Kriegeskorte, “Deep supervised, but not unsupervised, models may explain IT cortical representation,” PLoS Computational Biology, vol. 10, no. 11, p. e1003915, nov 2014. [16] U. Güçlü and M. van Gerven, “Deep neural networks reveal a gradient in the complexity of neural representations across the ventral stream,” Journal of Neuroscience, vol. 35, no. 27, pp. 10 005–10 014, jul 2015. [17] R. M. Cichy, A. Khosla, D. Pantazis, A. Torralba, and A. Oliva, “Comparison of deep neural networks to spatio-temporal cortical dynamics of human visual object recognition reveals hierarchical correspondence,” Scientific Reports, vol. 6, no. 1, jun 2016. [18] U. Güçlü, J. Thielen, M. Hanke, and M. van Gerven, “Brains on beats,” in Advances in Neural Information Processing Systems, 2016. 9 [19] U. Güçlü and M. A. J. van Gerven, “Modeling the dynamics of human brain activity with recurrent neural networks,” Frontiers in Computational Neuroscience, vol. 11, feb 2017. [20] M. Eickenberg, A. Gramfort, G. Varoquaux, and B. Thirion, “Seeing it all: Convolutional network layers map the function of the human visual system,” NeuroImage, vol. 152, pp. 184–194, may 2017. [21] U. Güçlü and M. van Gerven, “Increasingly complex representations of natural movies across the dorsal stream are shared between subjects,” NeuroImage, vol. 145, pp. 329–336, jan 2017. [22] T. Horikawa and Y. Kamitani, “Generic decoding of seen and imagined objects using hierarchical visual features,” Nature Communications, vol. 8, p. 15037, may 2017. [23] ——, “Hierarchical neural representation of dreamed objects revealed by brain decoding with deep neural network features,” Frontiers in Computational Neuroscience, vol. 11, jan 2017. [24] M. van Gerven, F. de Lange, and T. Heskes, “Neural decoding with hierarchical generative models,” Neural Comput., vol. 22, no. 12, pp. 3127–3142, 2010. [25] C. Du, C. Du, and H. He, “Sharing deep generative representation for perceived image reconstruction from human brain activity,” CoRR, vol. abs/1704.07575, 2017. [26] B. Thirion, E. Duchesnay, E. Hubbard, J. Dubois, J.-B. Poline, D. Lebihan, and S. Dehaene, “Inverse retinotopy: inferring the visual content of images from brain activation patterns,” Neuroimage, vol. 33, no. 4, pp. 1104–1116, 2006. [27] T. Naselaris, R. J. Prenger, K. N. Kay, M. Oliver, and J. L. Gallant, “Bayesian reconstruction of natural images from human brain activity,” Neuron, vol. 63, no. 6, pp. 902–915, 2009. [28] U. Güçlü and M. van Gerven, “Unsupervised learning of features for Bayesian decoding in functional magnetic resonance imaging,” in Belgian-Dutch Conference on Machine Learning, 2013. [29] S. Schoenmakers, M. Barth, T. Heskes, and M. van Gerven, “Linear reconstruction of perceived images from human brain activity,” NeuroImage, vol. 83, pp. 951–961, dec 2013. [30] S. Schoenmakers, U. Güçlü, M. van Gerven, and T. Heskes, “Gaussian mixture models and semantic gating improve reconstructions from human brain activity,” Frontiers in Computational Neuroscience, vol. 8, jan 2015. [31] R. Zhang, P. Isola, and A. A. Efros, “Colorful image colorization,” Lect. Notes Comput. Sci., vol. 9907 LNCS, pp. 649–666, 2016. [32] Y. Güçlütürk, U. Güçlü, R. van Lier, and M. van Gerven, “Convolutional sketch inversion,” in Lecture Notes in Computer Science. Springer International Publishing, 2016, pp. 810–824. [33] D. Pathak, P. Krähenbühl, J. Donahue, T. Darrell, and A. A. Efros, “Context encoders: Feature learning by inpainting,” CoRR, vol. abs/1604.07379, 2016. [34] C. Ledig, L. Theis, F. Huszar, J. Caballero, A. P. Aitken, A. Tejani, J. Totz, Z. Wang, and W. Shi, “Photo-realistic single image super-resolution using a generative adversarial network,” CoRR, vol. abs/1609.04802, 2016. [35] O. M. Parkhi, A. Vedaldi, and A. Zisserman, “Deep face recognition,” in British Machine Vision Conference, jul 2016. [36] I. J. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. C. Courville, and Y. Bengio, “Generative adversarial networks,” CoRR, vol. abs/1406.2661, 2014. [37] A. Radford, L. Metz, and S. Chintala, “Unsupervised representation learning with deep convolutional generative adversarial networks,” CoRR, vol. abs/1511.06434, 2015. [38] A. Dosovitskiy and T. Brox, “Generating images with perceptual similarity metrics based on deep networks,” CoRR, vol. abs/1602.02644, 2016. [39] S. Ioffe and C. Szegedy, “Batch normalization: Accelerating deep network training by reducing internal covariate shift,” CoRR, vol. abs/1502.03167, 2015. [40] K. Simonyan and A. Zisserman, “Very deep convolutional networks for large-scale image recognition,” CoRR, vol. abs/1409.1556, 2014. 10 [41] J. Johnson, A. Alahi, and F. Li, “Perceptual losses for real-time style transfer and super-resolution,” CoRR, vol. abs/1603.08155, 2016. [42] K. B. Petersen and M. S. Pedersen, “The matrix cookbook,” nov 2012, version 20121115. [43] D. S. Ma, J. Correll, and B. Wittenbrink, “The Chicago face database: A free stimulus set of faces and norming data,” Behavior Research Methods, vol. 47, no. 4, pp. 1122–1135, jan 2015. [44] N. Strohminger, K. Gray, V. Chituc, J. Heffner, C. Schein, and T. B. Heagins, “The MR2: A multi-racial, mega-resolution database of facial stimuli,” Behavior Research Methods, vol. 48, no. 3, pp. 1197–1204, aug 2015. [45] O. Langner, R. Dotsch, G. Bijlstra, D. H. J. Wigboldus, S. T. Hawk, and A. van Knippenberg, “Presentation and validation of the Radboud faces database,” Cognition & Emotion, vol. 24, no. 8, pp. 1377–1388, dec 2010. [46] L. Thaler, A. Schütz, M. Goodale, and K. Gegenfurtner, “What is the best fixation target? the effect of target shape on stability of fixational eye movements,” Vision Research, vol. 76, pp. 31–42, jan 2013. [47] J. A. Mumford, B. O. Turner, F. G. Ashby, and R. A. Poldrack, “Deconvolving BOLD activation in event-related designs for multivoxel pattern classification analyses,” NeuroImage, vol. 59, no. 3, pp. 2636–2643, feb 2012. [48] Z. Liu, P. Luo, X. Wang, and X. Tang, “Deep learning face attributes in the wild,” in Proceedings of International Conference on Computer Vision (ICCV), Dec. 2015. [49] S. Tokui, K. Oono, S. Hido, and J. Clayton, “Chainer: a next-generation open source framework for deep learning,” in Advances in Neural Information Processing Systems Workshops, 2015. [50] Y. Jia, E. Shelhamer, J. Donahue, S. Karayev, J. Long, R. B. Girshick, S. Guadarrama, and T. Darrell, “Caffe: Convolutional architecture for fast feature embedding,” CoRR, vol. abs/1408.5093, 2014. [51] 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,” Journal of Machine Learning Research, vol. 12, pp. 2825–2830, 2011. [52] K. Friston, J. Ashburner, S. Kiebel, T. Nichols, and W. Penny, Eds., Statistical Parametric Mapping: The Analysis of Functional Brain Images. Academic Press, 2007. [53] M. Jenkinson, C. F. Beckmann, T. E. Behrens, M. W. Woolrich, and S. M. Smith, “FSL,” NeuroImage, vol. 62, no. 2, pp. 782–790, aug 2012. [54] D. P. Kingma and J. Ba, “Adam: A method for stochastic optimization,” CoRR, vol. abs/1412.6980, 2014. [55] Z. Wang, A. Bovik, H. Sheikh, and E. Simoncelli, “Image quality assessment: From error visibility to structural similarity,” IEEE Transactions on Image Processing, vol. 13, no. 4, pp. 600–612, apr 2004. [56] E. Goesaert and H. P. O. de Beeck, “Representations of facial identity information in the ventral visual stream investigated with multivoxel pattern analyses,” Journal of Neuroscience, vol. 33, no. 19, pp. 8549–8558, may 2013. [57] H. Lee and B. A. Kuhl, “Reconstructing perceived and retrieved faces from activity patterns in lateral parietal cortex,” Journal of Neuroscience, vol. 36, no. 22, pp. 6069–6082, jun 2016. [58] M. van Gerven and T. Heskes, “A linear gaussian framework for decoding of perceived images,” in 2012 Second International Workshop on Pattern Recognition in NeuroImaging. IEEE, jul 2012. [59] A. C. Hahn and D. I. Perrett, “Neural and behavioral responses to attractiveness in adult and infant faces,” Neuroscience & Biobehavioral Reviews, vol. 46, pp. 591–603, oct 2014. [60] D. I. Perrett, K. A. May, and S. Yoshikawa, “Facial shape and judgements of female attractiveness,” Nature, vol. 368, no. 6468, pp. 239–242, mar 1994. [61] B. Birkás, M. Dzhelyova, B. Lábadi, T. Bereczkei, and D. I. Perrett, “Cross-cultural perception of trustworthiness: The effect of ethnicity features on evaluation of faces’ observed trustworthiness across four samples,” Personality and Individual Differences, vol. 69, pp. 56–61, oct 2014. 11 [62] M. A. Strom, L. A. Zebrowitz, S. Zhang, P. M. Bronstad, and H. K. Lee, “Skin and bones: The contribution of skin tone and facial structure to racial prototypicality ratings,” PLoS ONE, vol. 7, no. 7, p. e41193, jul 2012. [63] A. C. Little, B. C. Jones, D. R. Feinberg, and D. I. Perrett, “Men’s strategic preferences for femininity in female faces,” British Journal of Psychology, vol. 105, no. 3, pp. 364–381, jun 2013. [64] M. de Lurdes Carrito, I. M. B. dos Santos, C. E. Lefevre, R. D. Whitehead, C. F. da Silva, and D. I. Perrett, “The role of sexually dimorphic skin colour and shape in attractiveness of male faces,” Evolution and Human Behavior, vol. 37, no. 2, pp. 125–133, mar 2016. [65] Y. Güçlütürk, R. H. A. H. Jacobs, and R. van Lier, “Liking versus complexity: Decomposing the inverted U-curve,” Frontiers in Human Neuroscience, vol. 10, mar 2016. [66] D. Donderi and S. McFadden, “Compressed file length predicts search time and errors on visual displays,” Displays, vol. 26, no. 2, pp. 71–78, apr 2005. 12
2017
628
7,150
An Inner-loop Free Solution to Inverse Problems using Deep Neural Networks Kai Fai∗ Duke University kai.fan@stat.duke.edu Qi Wei∗ Duke University qi.wei@duke.edu Lawrence Carin Duke University lcarin@duke.edu Katherine Heller Duke University kheller@stat.duke.edu Abstract We propose a new method that uses deep learning techniques to accelerate the popular alternating direction method of multipliers (ADMM) solution for inverse problems. The ADMM updates consist of a proximity operator, a least squares regression that includes a big matrix inversion, and an explicit solution for updating the dual variables. Typically, inner loops are required to solve the first two subminimization problems due to the intractability of the prior and the matrix inversion. To avoid such drawbacks or limitations, we propose an inner-loop free update rule with two pre-trained deep convolutional architectures. More specifically, we learn a conditional denoising auto-encoder which imposes an implicit data-dependent prior/regularization on ground-truth in the first sub-minimization problem. This design follows an empirical Bayesian strategy, leading to so-called amortized inference. For matrix inversion in the second sub-problem, we learn a convolutional neural network to approximate the matrix inversion, i.e., the inverse mapping is learned by feeding the input through the learned forward network. Note that training this neural network does not require ground-truth or measurements, i.e., data-independent. Extensive experiments on both synthetic data and real datasets demonstrate the efficiency and accuracy of the proposed method compared with the conventional ADMM solution using inner loops for solving inverse problems. 1 Introduction Most of the inverse problems are formulated directly to the setting of an optimization problem related to the a forward model [25]. The forward model maps unknown signals, i.e., the ground-truth, to acquired information about them, which we call data or measurements. This mapping, or forward problem, generally depends on a physical theory that links the ground-truth to the measurements. Solving inverse problems involves learning the inverse mapping from the measurements to the groundtruth. Specifically, it recovers a signal from a small number of degraded or noisy measurements. This is usually ill-posed [26, 25]. Recently, deep learning techniques have emerged as excellent models and gained great popularity for their widespread success in allowing for efficient inference techniques on applications include pattern analysis (unsupervised), classification (supervised), computer vision, image processing, etc [6]. Exploiting deep neural networks to help solve inverse problems has been explored recently [24, 1] and deep learning based methods have achieved state-of-the-art performance in many challenging inverse problems like super-resolution [3, 24], image reconstruction [20], ∗The authors contributed equally to this work. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. automatic colorization [13]. More specifically, massive datasets currently enables learning end-to-end mappings from the measurement domain to the target image/signal/data domain to help deal with these challenging problems instead of solving the inverse problem by inference. This mapping function from degraded data point to ground-truth has recently been characterized by using sophisticated networks, e.g., deep neural networks. A strong motivation to use neural networks stems from the universal approximation theorem [5], which states that a feed-forward network with a single hidden layer containing a finite number of neurons can approximate any continuous function on compact subsets of Rn, under mild assumptions on the activation function. More specifically, in recent work [3, 24, 13, 20], an end-to-end mapping from measurements y to ground-truth x was learned from the training data and then applied to the testing data. Thus, the complicated inference scheme needed in the conventional inverse problem solver was replaced by feeding a new measurement through the pre-trained network, which is much more efficient. To improve the scope of deep neural network models, more recently, in [4], a splitting strategy was proposed to decompose an inverse problem into two optimization problems, where one sub-problem, related to regularization, can be solved efficiently using trained deep neural networks, leading to an alternating direction method of multipliers (ADMM) framework [2, 17]. This method involves training a deep convolutional auto-encoder network for low-level image modeling, which explicitly imposes regularization that spans the subspace that the ground-truth images live in. For the subproblem that requires inverting a big matrix, a conventional gradient descent algorithm was used, leading to an alternating update, iterating between feed-forward propagation through a network and iterative gradient descent. Thus, an inner loop for gradient descent is still necessary in this framework. A similar approach to learn approximate ISTA with neural network is illustrated in [11]. In this work, we propose an inner-loop free framework, in the sense that no iterative algorithm is required to solve sub-problems, using a splitting strategy for inverse problems. The alternating updates for the two sub-problems were derived by feeding through two pre-trained deep neural networks, i.e., one using an amortized inference based denoising convolutional auto-encoder network for the proximity operation and one using structured convolutional neural networks for the huge matrix inversion related to the forward model. Thus, the computational complexity of each iteration in ADMM is linear with respect to the dimensionality of the signals. The network for the proximity operation imposes an implicit prior learned from the training data, including the measurements as well as the ground-truth, leading to amortized inference. The network for matrix inversion is independent from the training data and can be trained from noise, i.e., a random noise image and its output from the forward model. To make training the networks for the proximity operation easier, three tricks have been employed: the first one is to use a pixel shuffling technique to equalize the dimensionality of the measurements and ground-truth; the second one is to optionally add an adversarial loss borrowed from the GAN (Generative Adversarial Nets) framework [10] for sharp image generation; the last one is to introduce a perceptual measurement loss derived from pre-trained networks, such as AlexNet [12] or VGG-16 Model [23]. Arguably, the speed of the proposed algorithm, which we term InfADMM-ADNN (Inner-loop free ADMM with Auxiliary Deep Neural Network), comes from the fact that it uses two auxiliary pre-trained networks to accelerate the updates of ADMM. Contribution The main contribution of this paper is comprised of i) learning an implicit prior/regularizer using a denoising auto-encoder neural network, based on amortized inference; ii) learning the inverse of a big matrix using structured convolutional neural networks, without using training data; iii) each of the above networks can be exploited to accelerate the existing ADMM solver for inverse problems. 2 Linear Inverse Problem Notation: trainable networks by calligraphic font, e.g., A, fixed networks by italic font e.g., A. As mentioned in the last section, the low dimensional measurement is denoted as y ∈Rm, which is reduced from high dimensional ground truth x ∈Rn by a linear operator A such that y = Ax. Note that usually n ≥m, which makes the number of parameters to estimate no smaller than the number of data points in hand. This imposes an ill-posed problem for finding solution x on new observation y, since A is an underdetermined measurement matrix. For example, in a super-resolution set-up, the matrix A might not be invertible, such as the strided Gaussian convolution in [21, 24]. To overcome this difficulty, several computational strategies, including Markov chain Monte Carlo (MCMC) and tailored variable splitting under the ADMM framework, have been proposed and applied to different 2 kinds of priors, e.g., the empirical Gaussian prior [29, 32], the Total Variation prior [22, 30, 31], etc. In this paper, we focus on the popular ADMM framework due to its low computational complexity and recent success in solving large scale optimization problems. More specifically, the optimization problem is formulated as ˆx = arg min x,z ∥y −Az∥2 + λR(x), s.t. z = x (1) where the introduced auxiliary variable z is constrained to be equal to x, and R(x) captures the structure promoted by the prior/regularization. If we design the regularization in an empirical Bayesian way, by imposing an implicit data dependent prior on x, i.e., R(x; y) for amortized inference [24], the augmented Lagrangian for (1) is L(x, z, u) = ∥y −Az∥2 + λR(x; y) + ⟨u, x −z⟩+ β∥x −z∥2 (2) where u is the Lagrange multiplier, and β > 0 is the penalty parameter. The usual augmented Lagrange multiplier method is to minimize L w.r.t. x and z simultaneously. This is difficult and does not exploit the fact that the objective function is separable. To remedy this issue, ADMM decomposes the minimization into two subproblems that are minimizations w.r.t. x and z, respectively. More specifically, the iterations are as follows: xk+1 = arg min x β∥x −zk + uk/2β∥2 + λR(x; y) (3) zk+1 = arg min z ∥y −Az∥2 + β∥xk+1 −z + uk/2β∥2 (4) uk+1 = uk + 2β(xk+1 −zk+1). (5) If the prior R is appropriately chosen, such as ∥x∥1, a closed-form solution for (3), i.e., a soft thresholding solution is naturally desirable. However, for some more complicated regularizations, e.g., a patch based prior [8], solving (3) is nontrivial, and may require iterative methods. To solve (4), a matrix inversion is necessary, for which conjugate gradient descent (CG) is usually applied to update z [4]. Thus, solving (3) and (4) is in general cumbersome. Inner loops are required to solve these two sub-minimization problems due to the intractability of the prior and the inversion, resulting in large computational complexity. To avoid such drawbacks or limitations, we propose an inner loop-free update rule with two pretrained deep convolutional architectures. 3 Inner-loop free ADMM 3.1 Amortized inference for x using a conditional proximity operator Solving sub-problem (3) is equivalent to finding the solution of the proximity operator PR(v; y) = arg minx 1 2∥x −v∥2 + R(x; y), where we incorporate the constant λ 2β into R without loss of generality. If we impose the first order necessary conditions [18], we have x = PR(v; y) ⇔0 ∈∂R(·; y)(x) + x −v ⇔v −x ∈∂R(·; y)(x) (6) where ∂R(·; y) is a partial derivative operator. For notational simplicity, we define another operator F =: I + ∂R(·; y). Thus, the last condition in (6) indicates that xk+1 = F−1(v). Note that the inverse here represents the inverse of an operator, i.e., the inverse function of F. Thus our objective is to learn such an inverse operator which projects v into the prior subspace. For simple priors like ∥· ∥1 or ∥· ∥2 2, the projection can be efficiently computed. In this work, we propose an implicit examplebased prior, which does not have a truly Bayesian interpretation, but aids in model optimization. In line with this prior, we define the implicit proximity operator Gθ(x; v, y) parameterized by θ to approximate unknown F−1. More specifically, we propose a neural network architecture referred to as conditional Pixel Shuffling Denoising Auto-Encoders (cPSDAE) as the operator G, where pixel shuffling [21] means periodically reordering the pixels in each channel mapping a high resolution image to a low resolution image with scale r and increase the number of channels to r2 (see [21] for more details). This allows us to transform v so that it is the same scale as y, and concatenate it with y as the input of cPSDAE easily. The architecture of cPSDAE is shown in Fig. 1 (d). 3.2 Inversion-free update of z While it is straightforward to write down the closed-form solution for sub-problem (4) w.r.t. z as is shown in (7), explicitly computing this solution is nontrivial. zk+1 = K A⊤y + βxk+1 + uk/2  , where K = A⊤A + βI −1 (7) 3 (a) (b) (c) (d) (e) Figure 1: Network for updating z (in black): (a) loss function (9), (b) structure of B−1, (c) struture of Cφ. Note that the input ϵ is random noise independent from the training data. Network for updating z (in blue): (d) structure of cPSDAE Gθ(x; ˜x, y) (˜x plays the same role as v in training), (e) adversarial training for R(x; y). Note again that (a)(b)(c) describes the network for inferring z, which is data-independent and (d)(e) describes the network for inferring x, which is data-dependent. In (7), A⊤is the transpose of the matrix A. As we mentioned, the term K in the right hand side involves an expensive matrix inversion with computational complexity O(n3) . Under some specific assumptions, e.g., A is a circulant matrix, this matrix inversion can be accelerated with a Fast Fourier transformation, which has a complexity of order O(n log n). Usually, the gradient based update has linear complexity in each iteration and thus has an overall complexity of order O(nint log n), where nint is the number of iterations. In this work, we will learn this matrix inversion explicitly by designing a neural network. Note that K is only dependent on A, and thus can be computed in advance for future use. This problem can be reduced to a smaller scale matrix inversion by applying the Sherman-Morrison-Woodbury formula: K = β−1 I −A⊤BA  , where B = βI + AA⊤−1 . (8) Therefore, we only need to solve the matrix inversion in dimension m × m, i.e., estimating B. We propose an approach to approximate it by a trainable deep convolutional neural network Cφ ≈B parameterized by φ. Note that B−1 = λI + AA⊤can be considered as a two-layer fully-connected or convolutional network as well, but with a fixed kernel. This inspires us to design two auto-encoders with shared weights, and minimize the sum of two reconstruction losses to learn the inversion Cφ : arg min φ Eε  ∥ε −CφB−1ε∥2 2 + ∥ε −B−1Cφε∥2 2  (9) where ε is sampled from a standard Gaussian distribution. The loss in (9) is clearly depicted in Fig. 1 (a) with the structure of B−1 in Fig. 1 (b) and the structure of Cφ in Fig. 1 (c). Since the matrix B is symmetric, we can reparameterize Cφ as WφW⊤ φ , where Wφ represents a multi-layer convolutional network and W⊤ φ is a symmetric convolution transpose architecture using shared kernels with Wφ, as shown in Fig. 1 (c) (the blocks with the same colors share the same network parameters). By plugging the learned Cφ in (8) , we obtain a reusable deep neural network Kφ = β−1 I −A⊤CφA  as a surrogate for the exact inverse matrix K. The update of z at each iteration can be done by applying the same Kφ as follows: zk+1 ←β−1 I −A⊤CφA  A⊤y + βxk+1 + uk/2  . (10) 3.3 Adversarial training of cPSDAE In this section, we will describe the proposed adversarial training scheme for cPSDAE to update x. Suppose that we have the paired training dataset (xi, yi)N i=1, a single cPSDAE with the input pair (˜x, y) is trying to minimize the reconstruction error Lr(Gθ(˜x, y), x), where ˜x is a corrupted version of x, i.e., ˜x = x + n where n is random noise. Notice Lr in traditional DAE is commonly 4 defined as ℓ2 loss, however, ℓ1 loss is an alternative in practice. Additionally, we follow the idea in [19, 7] by introducing a discriminator and a comparator to help train the cPSDAE, and find that it can produce sharper or higher quality images than merely optimizing G. This will wrap our conditional generative model Gθ into the conditional GAN [10] framework with an extra feature matching network (comparator). Recent advances in representation learning problems have shown that the features extracted from well pre-trained neural networks on supervised classification problems can be successfully transferred to others tasks, such as zero-shot learning [15], style transfer learning [9]. Thus, we can simply use pre-trained AlexNet [12] or VGG-16 Model [23] on ImageNet as the comparator without fine-tuning in order to extract features that capture complex and perceptually important properties. The feature matching loss Lf(C(Gθ(˜x, y)), C(x)) is usually the ℓ2 distance of high level image features, where C represents the pre-trained network. Since C is fixed, the gradient of this loss can be back-propagated to θ. For the adversarial training, the discriminator Dψ is a trainable convolutional network. We can keep the standard discriminator loss as in a traditional GAN, and add the generator loss of the GAN to the previously defined DAE loss and comparator loss. Thus, we can write down our two objectives, LD(x, y) = −log Dψ(x) −log (1 −Dψ(Gθ(˜x, y))) (11) LG(x, y) = λr∥Gθ(˜x, y) −x∥2 2 + λf∥C(Gθ(˜x, y)) −C(x)∥2 2 −λa log Dψ(Gθ(˜x, y)) (12) The optimization involves iteratively updating ψ by minimizing LD keeping θ fixed, and then updating θ by minimizing LG keeping ψ fixed. The proposed method, including training and inference has been summarized in Algorithm 1. Note that each update of x or z using neural networks in an ADMM iteration has a complexity of linear order w.r.t. the data dimensionality n. 3.4 Discussion Algorithm 1 Inner-loop free ADMM with Auxiliary Deep Neural Nets (Inf-ADMM-ADNN) Training stage: 1: Train net Kφ for inverting AT A + βI 2: Train net cPSDAE for proximity operator of R(x; y) Testing stage: 1: for t = 1, 2, . . . do 2: Update x cf. xk+1 = F−1(v); 3: Update z cf. (10); 4: Update u cf. (5); 5: end for A critical point for learning-based methods is whether the method generalizes to other problems. More specifically, how does a method that is trained on a specific dataset perform when applied to another dataset? To what extent can we reuse the trained network without re-training? In the proposed method, two deep neural networks are trained to infer x and z. For the network w.r.t. z, the training only requires the forward model A to generate the training pairs (ϵ, Aϵ). The trained network for z can be applied for any other datasets as long as A remains the same. Thus, this network can be adapted easily to accelerate inference for inverse problems without training data. However, for inverse problems that depends on a different A, a re-trained network is required. It is worth mentioning that the forward model A can be easily learned using training dataset (x, y), leading to a fully blind estimator associated with the inverse problem. An example of learning ˆA can be found in the supplementary materials. For the network w.r.t. x, training requires data pairs (xi, yi) because of the amortized inference. Note that this is different from training a prior for x only using training data xi. Thus, the trained network for x is confined to the specific tasks constrained by the pairs (x, y). To extend the generality of the trained network, the amortized setting can be removed, i.e, y is removed from the training, leading to a solution to proximity operator PR(v) = arg minx 1 2∥x −v∥2 + R(x). This proximity operation can be regarded as a denoiser which projects the noisy version v of x into the subspace imposed by R(x). The trained network (for the proximity operator) can be used as a plug-and-play prior [27] to regularize other inverse problems for datasets that share similar statistical characteristics. However, a significant change in the training dataset, e.g., different modalities like MRI and natural images (e.g., ImageNet [12]), would require re-training. Another interesting point to mention is the scalability of the proposed method to data of different dimensions. The scalability can be adapted using patch-based methods without loss of generality. For example, a neural network is trained for images of size 64×64 but the test image is of size 256×256. To use this pre-trained network, the full image can be decomposed as four 64 × 64 images and fed to 5 the network. To overcome the possible blocking artifacts, eight overlapping patches can be drawn from the full image and fed to the network. The output of these eight patches are then averaged (unweighted or weighted) over the overlapping parts. A similar strategy using patch stitching can be exploited to feed small patches to the network for higher dimensional datasets. 4 Experiments In this section, we provide experimental results and analysis on the proposed Inf-ADMM-ADNN and compare the results with a conventional ADMM using inner loops for inverse problems. Experiments on synthetic data have been implemented to show the fast convergence of our method, which comes from the efficient feed-forward propagation through pre-trained neural networks. Real applications using proposed Inf-ADMM-ADNN have been explored, including single image super-resolution, motion deblurring and joint super-resolution and colorization. 4.1 Synthetic data To evaluate the performance of proposed Inf-ADMM-ADNN, we first test the neural network Kφ, approximating the matrix inversion on synthetic data. More specifically, we assume that the ground-truth x is drawn from a Laplace distribution Laplace(µ, b), where µ = 0 is the location parameter and b is the scale parameter. The forward model A is a sparse matrix representing convolution with a stride of 4. The architecture of A is available in the supplementary materials (see Section 2). The noise n is drawn from a standard Gaussian distribution N(0, σ2). Thus, the observed data is generated as y = Ax + n. Following Bayes theorem, the maximum a posterior estimate of x given y, i.e., maximizing p(x|y) ∝p(y|x)p(x) can be equivalently formulated as arg minx 1 2σ2 ∥y −Ax∥2 2 + 1 b∥x∥1, where b = 1 and σ = 1 in this setting. Following (3), (4), (5), this problem is reduced to the following three sub-problems: i) xk+1 = S 1 2β (zk −uk/2β); ii) zk+1 = arg minz ∥y −Az∥2 2 + β∥xk+1 −z + uk/2β∥2 2; iii) uk+1 = uk + 2β(xk+1 −zk+1), where the soft thresholding operator S is defined as Sκ(a) =  0 |a| ≤κ a −sgn(a)κ |a| > κ and sgn(a) extracts the sign of a. The update of xk+1 has a closed-form solution, i.e., soft thresholding of zk −uk/2β. The update of zk+1 requires the inversion of a big matrix, which is usually solved using a gradient descent based algorithm. The update of uk+1 is straightforward. Thus, we compare the gradient descent based update, a closed-form solution for matrix inversion2 and the proposed inner-free update using a pre-trained neural network. The evolution of the objective function w.r.t. the number of iterations and the time has been plotted in the left and middle of Figs. 2. While all three methods perform similarly from iteration to iteration (in the left of Figs. 2), the proposed innerloop free based and closed-form inversion based methods converge much faster than the gradient based method (in the middle of Figs. 2). Considering the fact that the closed-form solution, i.e., a direct matrix inversion, is usually not available in practice, the learned neural network allows us to approximate the matrix inversion in a very accurate and efficient way. 0 5 10 15 20 25 30 iterations 1 1.2 1.4 1.6 1.8 objective 104 GD-based Closed-form Proposed 22 24 26 28 8750 8760 8770 0 2 4 6 8 time/s 1 1.2 1.4 1.6 1.8 objective 104 GD-based Closed-form Proposed 0.05 0.1 0.15 0.2 9000 9500 10000 0 50 100 150 iterations 0.1 0.2 0.3 0.4 0.5 0.6 0.7 NMSE = 0.0001 = 0.0005 = 0.001 = 0.005 = 0.01 = 0.1 Figure 2: Synthetic data: (left) objective v.s. iterations, (middle) objective v.s. time. MNIST dataset: (right) NMSE v.s. iterations for MNIST image 4× super-resolution. 2Note that this matrix inversion can be explicitly computed due to its small size in this toy experiment. In practice, this matrix is not built explicitly. 6 Figure 3: Top two rows : (column 1) LR images, (column 2) bicubic interpolation (×4), (column 3) results using proposed method (×4), (column 4) HR image. Bottom row: (column 1) motion blurred images, (column 2) results using Wiener filter with the best performance by tuning regularization parameter, (column 3) results using proposed method, (column 4) ground-truth. 4.2 Image super-resolution and motion deblurring In this section, we apply the proposed Inf-ADMM-ADNN to solve the poplar image super-resolution problem. We have tested our algorithm on the MNIST dataset [14] and the 11K images of the Caltech-UCSD Birds-200-2011 (CUB-200-2011) dataset [28]. In the first two rows of Fig. 3, high resolution images, as shown in the last column, have been blurred (convolved) using a Gaussian kernel of size 3 × 3 and downsampled every 4 pixels in both vertical and horizontal directions to generate the corresponding low resolution images as shown in the first column. The bicubic interpolation of LR images and results using proposed Inf-ADMM-ADNN on a 20% held-out test set are displayed in column 2 and 3. Visually, the proposed Inf-ADMM-ADNN gives much better results than the bicubic interpolation, recovering more details including colors and edges. A similar task to super-resolution is motion deblurring, in which the convolution kernel is a directional kernel and there is no downsampling. The motion deblurring results using Inf-ADMM-ADNN are displayed in the bottom of Fig. 3 and are compared with the Wiener filtered deblurring result (the performance of Wiener filter has been tuned to the best by adjusting the regularization parameter). Obviously, the Inf-ADMM-ADNN gives visually much better results than the Wiener filter. Due to space limitations, more simulation results are available in supplementary materials (see Section 3.1 and 3.2). To explore the convergence speed w.r.t. the ADMM regularization parameter β, we have plotted the normalized mean square error (NMSE) defined as NMSE = ∥ˆx −x∥2 2/∥x∥2 2, of super-resolved MNIST images w.r.t. ADMM iterations using different values of β in the right of Fig. 2. It is interesting to note that when β is large, e.g., 0.1 or 0.01, the NMSE of ADMM updates converges to a stable value rapidly in a few iterations (less than 10). Reducing the value of β slows down the decay of NMSE over iterations but reaches a lower stable value. When the value of β is small enough, e.g., β = 0.0001, 0.0005, 0.001, the NMSE converges to the identical value. This fits well with the claim in Boyd’s book [2] that when β is too large it does not put enough emphasis on minimizing the 7 objective function, causing coarser estimation; thus a relatively small β is encouraged in practice. Note that the selection of this regularization parameter is still an open problem. 4.3 Joint super-resolution and colorization While image super-resolution tries to enhance spatial resolution from spatially degraded images, a related application in the spectral domain exists, i.e., enhancing spectral resolution from a spectrally degraded image. One interesting example is the so-called automatic colorization, i.e., hallucinating a plausible color version of a colorless photograph. To the best knowledge of the authors, this is the first time we can enhance both spectral and spatial resolutions from one single band image. In this section, we have tested the ability to perform joint super-resolution and colorization from one single colorless LR image on the celebA-dataset [16]. The LR colorless image, its bicubic interpolation and ×2 HR image are displayed in the top row of Fig. 4. The ADMM updates in the 1st, 4th and 7th iterations (on held-out test set) are displayed in the bottom row, showing that the updated image evolves towards higher quality. More results are in the supplementary materials (see Section 3.3). Figure 4: (top left) colorless LR image, (top middle) bicubic interpolation, (top right) HR ground-truth, (bottom left to right) updated image in 1th, 4th and 7th ADMM iteration. Note that the colorless LR images and bicubic interpolations are visually similar but different in details noticed by zooming out. 5 Conclusion In this paper we have proposed an accelerated alternating direction method of multipliers, namely, Inf-ADMM-ADNN to solve inverse problems by using two pre-trained deep neural networks. Each ADMM update consists of feed-forward propagation through these two networks, with a complexity of linear order with respect to the data dimensionality. More specifically, a conditional pixel shuffling denoising auto-encoder has been learned to perform amortized inference for the proximity operator. This auto-encoder leads to an implicit prior learned from training data. A data-independent structured convolutional neural network has been learned from noise to explicitly invert the big matrix associated with the forward model, getting rid of any inner loop in an ADMM update, in contrast to the conventional gradient based method. This network can also be combined with existing proximity operators to accelerate existing ADMM solvers. Experiments and analysis on both synthetic and real dataset demonstrate the efficiency and accuracy of the proposed method. In future work we hope to extend the proposed method to inverse problems related to nonlinear forward models. 8 Appendices We will address the question proposed by reviewers in this Appendix. To Reviewer 1 The title has been changed to “An inner-loop free solution to inverse problems using deep neural networks” according to the reviewer’s suggestion, which is in consistence with our arxiv submission. The pixel shuffling used in our PSDAE architecture is mainly to keep the filter size of every layer including input and output as the same, thus trick has been practically proved to remove the check-board effect. Especially for the super-resolution task with different scales of input/output, it is basically to use the input to regress the same scale output but with more channels. Figure 5: Result of super-resolution from SRGAN with different settings. To Reviewer 2 As we explained in the rebuttal, we have the implementation of SRCNN with or without adversarial loss in our own but we did not successfully reproduce a reasonable result in our dataset. Thus, we did not include the visualization in the initial submission, since either blurriness or check-board effect will appear, but we will further fine-tune the model or use other tricks such as pixel shuffling. [11] has been added to the reference. To Reviewer 3 Most of the questions have been addressed in the rebuttal. 9 Acknowledgments The authors would like to thank Siemens Corporate Research for supporting this work and thank NVIDIA for the GPU donations. References [1] Jonas Adler and Ozan Öktem. Solving ill-posed inverse problems using iterative deep neural networks. arXiv preprint arXiv:1704.04058, 2017. [2] 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. [3] Joan Bruna, Pablo Sprechmann, and Yann LeCun. Super-resolution with deep convolutional sufficient statistics. arXiv preprint arXiv:1511.05666, 2015. [4] JH Chang, Chun-Liang Li, Barnabas Poczos, BVK Kumar, and Aswin C Sankaranarayanan. One network to solve them all—solving linear inverse problems using deep projection models. arXiv preprint arXiv:1703.09912, 2017. [5] Balázs Csanád Csáji. Approximation with artificial neural networks. Faculty of Sciences, Etvs Lornd University, Hungary, 24:48, 2001. [6] Li Deng, Dong Yu, et al. Deep learning: methods and applications. Foundations and Trends R⃝ in Signal Processing, 7(3–4):197–387, 2014. [7] Alexey Dosovitskiy and Thomas Brox. Generating images with perceptual similarity metrics based on deep networks. In Advances in Neural Information Processing Systems, pages 658–666, 2016. [8] Michael Elad and Michal Aharon. Image denoising via sparse and redundant representations over learned dictionaries. IEEE Trans. Image Process., 15(12):3736–3745, 2006. [9] Leon A Gatys, Alexander S Ecker, and Matthias Bethge. Image style transfer using convolutional neural networks. In Proc. IEEE Int. Conf. Comp. Vision and Pattern Recognition (CVPR), pages 2414–2423, 2016. [10] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in Neural Information Processing Systems, pages 2672–2680, 2014. [11] Karol Gregor and Yann LeCun. Learning fast approximations of sparse coding. In Proceedings of the 27th International Conference on Machine Learning (ICML-10), pages 399–406, 2010. [12] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems, pages 1097–1105, 2012. [13] Gustav Larsson, Michael Maire, and Gregory Shakhnarovich. Learning representations for automatic colorization. In Proc. European Conf. Comp. Vision (ECCV), pages 577–593. Springer, 2016. [14] Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proc. IEEE, 86(11):2278–2324, 1998. [15] Jimmy Lei Ba, Kevin Swersky, Sanja Fidler, et al. Predicting deep zero-shot convolutional neural networks using textual descriptions. In Proc. IEEE Int. Conf. Comp. Vision (ICCV), pages 4247–4255, 2015. [16] Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In Proc. IEEE Int. Conf. Comp. Vision (ICCV), pages 3730–3738, 2015. [17] Songtao Lu, Mingyi Hong, and Zhengdao Wang. A nonconvex splitting method for symmetric nonnegative matrix factorization: Convergence analysis and optimality. IEEE Transactions on Signal Processing, 65(12):3120–3135, June 2017. [18] Helmut Maurer and Jochem Zowe. First and second-order necessary and sufficient optimality conditions for infinite-dimensional programming problems. Math. Progam., 16(1):98–110, 1979. 10 [19] Anh Nguyen, Jason Yosinski, Yoshua Bengio, Alexey Dosovitskiy, and Jeff Clune. Plug & play generative networks: Conditional iterative generation of images in latent space. arXiv preprint arXiv:1612.00005, 2016. [20] Jo Schlemper, Jose Caballero, Joseph V Hajnal, Anthony Price, and Daniel Rueckert. A deep cascade of convolutional neural networks for MR image reconstruction. arXiv preprint arXiv:1703.00555, 2017. [21] Wenzhe Shi, Jose Caballero, Ferenc Huszár, Johannes Totz, Andrew P Aitken, Rob Bishop, Daniel Rueckert, and Zehan Wang. Real-time single image and video super-resolution using an efficient sub-pixel convolutional neural network. In Proc. IEEE Int. Conf. Comp. Vision and Pattern Recognition (CVPR), pages 1874–1883, 2016. [22] M. Simoes, J. Bioucas-Dias, L.B. Almeida, and J. Chanussot. A convex formulation for hyperspectral image superresolution via subspace-based regularization. IEEE Trans. Geosci. Remote Sens., 53(6):3373–3388, Jun. 2015. [23] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. [24] Casper Kaae Sønderby, Jose Caballero, Lucas Theis, Wenzhe Shi, and Ferenc Huszár. Amortised MAP inference for image super-resolution. arXiv preprint arXiv:1610.04490, 2016. [25] Albert Tarantola. Inverse problem theory and methods for model parameter estimation. SIAM, 2005. [26] A.N. Tikhonov and V.I.A. Arsenin. Solutions of ill-posed problems. Scripta series in mathematics. Winston, 1977. [27] Singanallur V Venkatakrishnan, Charles A Bouman, and Brendt Wohlberg. Plug-and-play priors for model based reconstruction. In Proc. IEEE Global Conf. Signal and Information Processing (GlobalSIP), pages 945–948. IEEE, 2013. [28] Catherine Wah, Steve Branson, Peter Welinder, Pietro Perona, and Serge Belongie. The caltech-ucsd birds-200-2011 dataset. 2011. [29] Q. Wei, N. Dobigeon, and Jean-Yves Tourneret. Bayesian fusion of multi-band images. IEEE J. Sel. Topics Signal Process., 9(6):1117–1127, Sept. 2015. [30] Qi Wei, Nicolas Dobigeon, and Jean-Yves Tourneret. Fast fusion of multi-band images based on solving a Sylvester equation. IEEE Trans. Image Process., 24(11):4109–4121, Nov. 2015. [31] Qi Wei, Nicolas Dobigeon, Jean-Yves Tourneret, J. M. Bioucas-Dias, and Simon Godsill. R-FUSE: Robust fast fusion of multi-band images based on solving a Sylvester equation. IEEE Signal Process. Lett., 23(11):1632–1636, Nov 2016. [32] N. Zhao, Q. Wei, A. Basarab, N. Dobigeon, D. Kouamé, and J. Y. Tourneret. Fast single image super-resolution using a new analytical solution for ℓ2 −ℓ2 problems. IEEE Trans. Image Process., 25(8):3683–3697, Aug. 2016. 11
2017
629
7,151
Semi-Supervised Learning for Optical Flow with Generative Adversarial Networks Wei-Sheng Lai1 Jia-Bin Huang2 Ming-Hsuan Yang1,3 1University of California, Merced 2Virginia Tech 3Nvidia Research 1{wlai24|mhyang}@ucmerced.edu 2jbhuang@vt.edu Abstract Convolutional neural networks (CNNs) have recently been applied to the optical flow estimation problem. As training the CNNs requires sufficiently large amounts of labeled data, existing approaches resort to synthetic, unrealistic datasets. On the other hand, unsupervised methods are capable of leveraging real-world videos for training where the ground truth flow fields are not available. These methods, however, rely on the fundamental assumptions of brightness constancy and spatial smoothness priors that do not hold near motion boundaries. In this paper, we propose to exploit unlabeled videos for semi-supervised learning of optical flow with a Generative Adversarial Network. Our key insight is that the adversarial loss can capture the structural patterns of flow warp errors without making explicit assumptions. Extensive experiments on benchmark datasets demonstrate that the proposed semi-supervised algorithm performs favorably against purely supervised and baseline semi-supervised learning schemes. 1 Introduction Optical flow estimation is one of the fundamental problems in computer vision. The classical formulation builds upon the assumptions of brightness constancy and spatial smoothness [15, 25]. Recent advancements in this field include using sparse descriptor matching as guidance [4], leveraging dense correspondences from hierarchical features [2, 39], or adopting edge-preserving interpolation techniques [32]. Existing classical approaches, however, involve optimizing computationally expensive non-convex objective functions. With the rapid growth of deep convolutional neural networks (CNNs), several approaches have been proposed to solve optical flow estimation in an end-to-end manner. Due to the lack of the large-scale ground truth flow datasets of real-world scenes, existing approaches [8, 16, 30] rely on training on synthetic datasets. These synthetic datasets, however, do not reflect the complexity of realistic photometric effects, motion blur, illumination, occlusion, and natural image noise. Several recent methods [1, 40] propose to leverage real-world videos for training CNNs in an unsupervised setting (i.e., without using ground truth flow). The main idea is to use loss functions measuring brightness constancy and spatial smoothness of flow fields as a proxy for losses using ground truth flow. However, the assumptions of brightness constancy and spatial smoothness often do not hold near motion boundaries. Despite the acceleration in computational speed, the performance of these approaches still does not match up to the classical flow estimation algorithms. With the limited quantity and unrealistic of ground truth flow and the large amounts of real-world unlabeled data, it is thus of great interest to explore the semi-supervised learning framework. A straightforward approach is to minimize the End Point Error (EPE) loss for data with ground truth flow and the loss functions that measure classical brightness constancy and smoothness assumptions for unlabeled training images (Figure 1 (a)). However, we show that such an approach is sensitive to the choice of parameters and may sometimes decrease the accuracy of flow estimation. Prior work [1, 40] minimizes a robust loss function (e.g., Charbonnier function) on the flow warp error 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. Flow warp error Labeled data Unlabeled data Ground truth flow Predicted flow Predicted flow CNN CNN EPE loss Brightness constancy loss Smoothness loss Flow warp error Flow warp error Labeled data Unlabeled data EPE loss Predicted flow Predicted flow Adversarial loss CNN CNN Ground truth flow (a) Baseline semi-supervised learning (b) The proposed semi-supervised learning Figure 1: Semi-supervised learning for optical flow estimation. (a) A baseline semi-supervised algorithm utilizes the assumptions of brightness constancy and spatial smoothness to train CNN from unlabeled data (e.g., [1, 40]). (b) We train a generative adversarial network to capture the structure patterns in flow warp error images without making any prior assumptions. (i.e., the difference between the first input image and the warped second image) by modeling the brightness constancy with a Laplacian distribution. As shown in Figure 2, although robust loss functions can fit the likelihood of the per-pixel flow warp error well, the spatial structure in the warp error images cannot be modeled by simple distributions. Such structural patterns often arise from occlusion and dis-occlusion caused by large object motion, where the brightness constancy assumption does not hold. A few approaches have been developed to cope with such brightness inconsistency problem using the Fields-of-Experts (FoE) [37] or a Gaussian Mixture Model (GMM) [33]. However, the inference of optical flow entails solving time-consuming optimization problems. In this work, our goal is to leverage both the labeled and the unlabeled data without making explicit assumptions on the brightness constancy and flow smoothness. Specifically, we propose to impose an adversarial loss [12] on the flow warp error image to replace the commonly used brightness constancy loss. We formulate the optical flow estimation as a conditional Generative Adversarial Network (GAN) [12]. Our generator takes the input image pair and predicts the flow. We then compute the flow warp error image using a bilinear sampling layer. We learn a discriminator to distinguish between the flow warp error from predicted flow and ground truth optical flow fields. The adversarial training scheme encourages the generator to produce the flow warp error images that are indistinguishable from the ground truth. The adversarial loss serves as a regularizer for both labeled and unlabeled data (Figure 1 (b)). With the adversarial training, our network learns to model the structural patterns of flow warp error to refine the motion boundary. During the test phase, the generator can efficiently predict optical flow in one feed-forward pass. We make the following three contributions: • We propose a generative adversarial training framework to learn to predict optical flow by leveraging both labeled and unlabeled data in a semi-supervised learning framework. • We develop a network to capture the spatial structure of the flow warp error without making primitive assumptions on brightness constancy or spatial smoothness. • We demonstrate that the proposed semi-supervised flow estimation method outperforms the purely supervised and baseline semi-supervised learning when using the same amount of ground truth flow and network parameters. 2 Related Work In the following, we discuss the learning-based optical flow algorithms, CNN-based semi-supervised learning approaches, and generative adversarial networks within the context of this work. Optical flow. Classical optical flow estimation approaches typically rely on the assumptions of brightness constancy and spatial smoothness [15, 25]. Sun et al. [36] provide a unified review of classical algorithms. Here we focus our discussion on recent learning-based methods in this field. Learning-based methods aim to learn priors from natural image sequences without using hand-crafted assumptions. Sun et al. [37] assume that the flow warp error at each pixel is independent and use a set of linear filters to learn the brightness inconsistency. Rosenbaum and Weiss [33] use a GMM to learn the flow warp error at the patch level. The work of Rosenbaum et al. [34] learns patch priors 2 Input image 1 Ground truth optical flow Input image 2 Ground truth flow warp error Flow warp error -0.15 -0.1 -0.05 0 0.05 0.1 0.15 Negative log likelihood Flow warp error Gaussian Laplacian Lorentzian Negative log likelihood Figure 2: Modeling the distribution of flow warp error. The robust loss functions, e.g., Lorentzian or Charbonnier functions, can model the distribution of per-pixel flow warp error well. However, the spatial pattern resulting from large motion and occlusion cannot be captured by simple distributions. to model the local flow statistics. These approaches incorporate the learned priors into the classical formulation and thus require solving time-consuming alternative optimization to infer the optical flow. Furthermore, the limited amount of training data (e.g., Middlebury [3] or Sintel [5]) may not fully demonstrate the capability of learning-based optical flow algorithms. In contrast, we train a deep CNN with large datasets (FlyingChairs [8] and KITTI [10]) in an end-to-end manner. Our model can predict flow efficiently in a single feed-forward pass. The FlowNet [8] presents a deep CNN approach for learning optical flow. Even though the network is trained on a large dataset with ground truth flow, strong data augmentation and the variational refinement are required. Ilg et al. [16] extend the FlowNet by stacking multiple networks and using more training data with different motion types including complex 3D motion and small displacements. To handle large motion, the SPyNet approach [30] estimates flow in a classical spatial pyramid framework by warping one of the input images and predicting the residual flow at each pyramid level. A few attempts have recently been made to learn optical flow from unlabeled videos in an unsupervised manner. The USCNN method [1] approximates the brightness constancy with a Taylor series expansion and trains a deep network using the UCF101 dataset [35]. Yu et al. [40] enables the backpropagation of the warping function using the bilinear sampling layer from the spatial transformer network [18] and explicitly optimizes the brightness constancy and spatial smoothness assumptions. While Yu et al. [40] demonstrate comparable performance with the FlowNet on the KITTI dataset, the method requires significantly more sophisticated data augmentation techniques and different parameter settings for each dataset. Our approach differs from these methods in that we use both labeled and unlabeled data to learn optical flow in a semi-supervised framework. Semi-supervised learning. Several methods combine the classification objective with unsupervised reconstruction losses for image recognition [31, 41]. In low-level vision tasks, Kuznietsov et al. [21] train a deep CNN using sparse ground truth data for single-image depth estimation. This method optimizes a supervised loss for pixels with ground truth depth value as well as an unsupervised image alignment cost and a regularization cost. The image alignment cost resembles the brightness constancy, and the regularization cost enforces the spatial smoothness on the predicted depth maps. We show that adopting a similar idea to combine the EPE loss with image reconstruction and smoothness losses may not improve flow accuracy. Instead, we use the adversarial training scheme for learning to model the structural flow warp error without making assumptions on images or flow. Generative adversarial networks. The GAN framework [12] has been successfully applied to numerous problems, including image generation [7, 38], image inpainting [28], face completion [23], image super-resolution [22], semantic segmentation [24], and image-to-image translation [17, 42]. Within the scope of domain adaptation [9, 14], the discriminator learns to differentiate the features from the two different domains, e.g., synthetic, and real images. Kozi´nski et al. [20] adopt the adversarial training framework for semi-supervised learning on the image segmentation task where the discriminator is trained to distinguish between the predictions produced from labeled and unlabeled data. Different from Kozi´nski et al. [20], our discriminator learns to distinguish the flow warp errors between using the ground truth flow and using the estimated flow. The generator thus learns to model the spatial structure of flow warp error images and can improve flow estimation accuracy around motion boundaries. 3 3 Semi-Supervised Optical Flow Estimation In this section, we describe the semi-supervised learning approach for optical flow estimation, the design methodology of the proposed generative adversarial network for learning the flow warp error, and the use of the adversarial loss to leverage labeled and unlabeled data. 3.1 Semi-supervised learning We address the problem of learning optical flow by using both labeled data (i.e., with the ground truth dense optical flow) and unlabeled data (i.e., raw videos). Given a pair of input images {I1, I2}, we train a deep network to generate the dense optical flow field f = [u, v]. For labeled data with the ground truth optical flow (denoted by ˆf = [ˆu, ˆv]), we optimize the EPE loss between the predicted and ground truth flow: LEPE(f, ˆf) = q (u −ˆu)2 + (v −ˆv)2. (1) For unlabeled data, existing work [40] makes use of the classical brightness constancy and spatial smoothness to define the image warping loss and flow smoothness loss: Lwarp(I1, I2, f) = ρ (I1 −W (I2, f)) , (2) Lsmooth(f) = ρ(∂xu) + ρ(∂yu) + ρ(∂xv) + ρ(∂yv), (3) where ∂x and ∂y are horizontal and vertical gradient operators and ρ(·) is the robust penalty function. The warping function W (I2, f) uses the bilinear sampling [18] to warp I2 according to the flow field f. The difference I1 −W (I2, f) is the flow warp error as shown in Figure 2. Minimizing Lwarp(I1, I2, f) enforces the flow warp error to be close to zero at every pixel. A baseline semi-supervised learning approach is to minimize LEPE for labeled data and minimize Lwarp and Lsmooth for unlabeled data: X i∈Dl LEPE  f (i), ˆf (i) + X j∈Du  λwLwarp  I(j) 1 , I(j) 2 , f (j) + λsLsmooth  f (j) , (4) where Dl and Du represent labeled and unlabeled datasets, respectively. However, the commonly used robust loss functions (e.g., Lorentzian and Charbonnier) assume that the error is independent at each pixel and thus cannot model the structural patterns of flow warp error caused by occlusion. Minimizing the combination of the supervised loss in (1) and unsupervised losses in (2) and (3) may degrade the flow accuracy, especially when large motion present in the input image pair. As a result, instead of using the unsupervised losses based on classical assumptions, we propose to impose an adversarial loss on the flow warp images within a generative adversarial network. We use the adversarial loss to regularize the flow estimation for both labeled and unlabeled data. 3.2 Adversarial training Training a GAN involves optimizing the two networks: a generator G and a discriminator D. The generator G takes a pair of input images to generate optical flow. The discriminator D performs binary classification to distinguish whether a flow warp error image is produced by the estimated flow from the generator G or by the ground truth flow. We denote the flow warp error image from the ground truth flow and generated flow by ˆy = I1 −W(I2, ˆf) and y = I1 −W(I2, f), respectively. The objective function to train the GAN can be expressed as: Ladv(y, ˆy) = Eˆy[log D(ˆy)] + Ey[log (1 −D(y))]. (5) We incorporate the adversarial loss with the supervised EPE loss and solve the following minmax problem for optimizing G and D: min G max D LEPE(G) + λadvLadv(G, D), (6) where λadv controls the relative importance of the adversarial loss for optical flow estimation. Following the standard procedure for GAN training, we alternate between the following two steps to solve (6): (1) update the discriminator D while holding the generator G fixed and (2) update generator G while holding the discriminator D fixed. 4 Predicted flow Ground truth flow Generator G Discriminator D Flow warp error Ground truth flow warp error Labeled data ℒ"#$ % (Eq. 7) Updated Frozen (a) Update discriminator D using labeled data Unlabeled data Predicted flow Flow warp error Predicted flow Ground truth flow Generator G Labeled data Flow warp error ℒ"#" (Eq. 1) ℒ$%& ' (Eq. 9) Discriminator D Updated Frozen (b) Update generator G using both labeled and unlabeled data Figure 3: Adversarial training procedure. Training a generative adversarial network involves the alternative optimization of the discriminator D and generator G. Updating discriminator D. We train the discriminator D to classify between the ground truth flow warp error (real samples, labeled as 1) and the flow warp error from the predicted flow (fake samples, labeled as 0). The maximization of (5) is equivalent to minimizing the binary cross-entropy loss LBCE(p, t) = −t log(p) −(1 −t) log(1 −p) where p is the output from the discriminator and t is the target label. The adversarial loss for updating D is defined as: LD adv(y, ˆy) = LBCE(D(ˆy), 1) + LBCE(D(y), 0) = −log D(ˆy) −log(1 −D(y)). (7) As the ground truth flow is required to train the discriminator, only the labeled data Dl is involved in this step. By fixing G in (6), we minimize the following loss function for updating D: X i∈Dl LD adv(y(i), ˆy(i)). (8) Updating generator G. The goal of the generator is to “fool” the discriminator by producing flow to generate realistic flow warp error images. Optimizing (6) with respect to G becomes minimizing log(1 −D(y)). As suggested by Goodfellow et al. [12], one can instead minimize −log(D(y)) to speed up the convergence. The adversarial loss for updating G is then equivalent to the binary cross entropy loss that assigns label 1 to the generated flow warp error y: LG adv(y) = LBCE(D(y), 1) = −log(D(y)). (9) By combining the adversarial loss with the supervised EPE loss, we minimize the following function for updating G: X i∈Dl  LEPE  f (i), ˆf (i) + λadvLG adv(y(i))  + X j∈Du λadvLG adv(y(j)). (10) We note that the adversarial loss is computed for both labeled and unlabeled data, and thus guides the flow estimation for image pairs without the ground truth flow. Figure 3 illustrates the two main steps to update the generator D and the discriminator G in the proposed semi-supervised learning framework. 5 3.3 Network architecture and implementation details Generator. We construct a 5-level SPyNet [30] as our generator. Instead of using simple stacks of convolutional layers as sub-networks [30], we choose the encoder-decoder architecture with skip connections to effectively increase the receptive fields. Each convolutional layer has a 3 × 3 spatial support and is followed by a ReLU activation. We present the details of our SPyNet architecture in the supplementary material. Discriminator. As we aim to learn the local structure of flow warp error at motion boundaries, it is more effective to penalize the structure at the scale of local patches instead of the whole image. Therefore, we use the PatchGAN [17] architecture as our discriminator. The PatchGAN is a fully convolutional classifier that classifies whether each N × N overlapping patch is real or fake. The PatchGAN has a receptive field of 47 × 47 pixels. Implementation details. We implement the proposed method using the Torch framework [6]. We use the Adam solver [19] to optimize both the generator and discriminator with β1 = 0.9, β2 = 0.999 and the weight decay of 1e −4. We set the initial learning rate as 1e −4 and then multiply by 0.5 every 100k iterations after the first 200k iterations. We train the network for a total of 600k iterations. We use the FlyingChairs dataset [8] as the labeled dataset and the KITTI raw videos [10] as the unlabeled dataset. In each mini-batch, we randomly sample 4 image pairs from each dataset. We randomly augment the training data in the following ways: (1) Scaling between [1, 2], (2) Rotating within [−17◦, 17◦], (3) Adding Gaussian noise with a sigma of 0.1, (4) Using color jitter with respect to brightness, contrast and saturation uniformly sampled from [0, 0.04]. We then crop images to 384 × 384 patches and normalize by the mean and standard deviation computed from the ImageNet dataset [13]. The source code is publicly available on http://vllab.ucmerced.edu/wlai24/ semiFlowGAN. 4 Experimental Results We evaluate the performance of optical flow estimation on five benchmark datasets. We conduct ablation studies to analyze the contributions of individual components and present comparisons with the state-of-the-art algorithms including classical variational algorithms and CNN-based approaches. 4.1 Evaluated datasets and metrics We evaluate the proposed optical flow estimation method on the benchmark datasets: MPI-Sintel [5], KITTI 2012 [11], KITTI 2015 [27], Middlebury [3] and the test set of FlyingChairs [8]. The MPISintel and FlyingChairs are synthetic datasets with dense ground truth flow. The Sintel dataset provides two rendered sets, Clean and Final, that contain both small displacements and large motion. The training and test sets contain 1041 and 552 image pairs, respectively. The FlyingChairs test set is composed of 640 image pairs with similar motion statistics to the training set. The Middlebury dataset has only eight image pairs with small motion. The images from the KITTI 2012 and KITTI 2015 datasets are collected from driving real-world scenes with large forward motion. The ground truth optical flow is obtained from a 3D laser scanner and thus only covers about 50% of image pixels. There are 194 image pairs in the KITTI 2012 dataset, and 200 image pairs in the KITTI 2015 dataset. We compute the average EPE (1) on pixels with the ground truth flow available for each dataset. On the KITTI-2015 dataset, we also compute the Fl score [27], which is the ratio of pixels that have EPE greater than 3 pixels and 5% of the ground truth value. 4.2 Ablation study We conduct ablation studies to analyze the contributions of the adversarial loss and the proposed semi-supervised learning with different training schemes. Adversarial loss. We adjust the weight of the adversarial loss λadv in (10) to validate the effect of the adversarial training. When λadv = 0, our method falls back to the fully supervised learning setting. We show the quantitative evaluation in Table 1. Using larger values of λadv may decrease the performance and cause visual artifacts as shown in Figure 4. We therefore choose λadv = 0.01. 6 Table 1: Analysis on adversarial loss. We train the proposed model using different weights for the adversarial loss in (10). λadv Sintel-Clean Sintel-Final KITTI 2012 KITTI 2015 FlyingChairs EPE EPE EPE EPE Fl-all EPE 0 3.51 4.70 7.69 17.19 40.82% 2.15 0.01 3.30 4.68 7.16 16.02 38.77% 1.95 0.1 3.57 4.73 8.25 16.82 42.78% 2.11 1 3.93 5.18 13.89 21.07 63.43% 2.21 Table 2: Analysis on receptive field of discriminator. We vary the number of strided convolutional layers in the discriminator to achieve different size of receptive fields. # Strided Receptive field Sintel-Clean Sintel-Final KITTI 2012 KITTI 2015 FlyingChairs convolutions EPE EPE EPE EPE Fl-all EPE d = 2 23 × 23 3.66 4.90 7.38 16.28 40.19% 2.15 d = 3 47 × 47 3.30 4.68 7.16 16.02 38.77% 1.95 d = 4 95 × 95 3.70 5.00 7.54 16.38 41.52% 2.16 Receptive fields of discriminator. The receptive field of the discriminator is equivalent to the size of patches used for classification. The size of the receptive field is determined by the number of strided convolutional layers, denoted by d. We test three different values, d = 2, 3, 4, which are corresponding to the receptive field of 23×23, 47×47, and 95×95, respectively. As shown in Table 2, the network with d = 3 performs favorably against other choices on all benchmark datasets. Using too large or too small patch sizes might not be able to capture the structure of flow warp error well. Therefore, we design our discriminator to have a receptive field of 47 × 47 pixels. Training schemes. We train the same network (i.e., our generator G) with the following training schemes: (a) Supervised: minimizing the EPE loss (1) on the FlyingChairs dataset. (b) Unsupervised: minimizing the classical brightness constancy (2) and spatial smoothness (3) using the Charbonnier loss function on the KITTI raw dataset. (c) Baseline semi-supervised: minimizing the combination of supervised and unsupervised losses (4) on the FlyingChairs and KITTI raw datasets. For the semi-supervised setting, we evaluate different combinations of λw and λs in Table 3. We note that it is not easy to run grid search to find the best parameter combination for all evaluated datasets. We choose λw = 1 and λs = 0.01 for the baseline semi-supervised and unsupervised settings. We provide the quantitative evaluation of the above training schemes in Table 4 and visual comparisons in Figure 5 and 6. As images in KITTI 2015 have large forward motion, there are large occluded/disoccluded regions, particularly on the image and moving object boundaries. The brightness constancy does not hold in these regions. Consequently, minimizing the image warping loss (2) results in inaccurate flow estimation. Compared to the fully supervised learning, our method further refines the motion boundaries by modeling the flow warp error. By incorporating both labeled and unlabeled data in training, our method effectively reduces EPEs on the KITTI 2012 and 2015 datasets. Training on partially labeled data. We further analyze the effect of the proposed semi-supervised method by reducing the amount of labeled training data. Specifically, we use 75%, 50% and 25% Input images λadv = 0 λadv = 0.01 Ground truth flow λadv = 0.1 λadv = 1 Figure 4: Comparisons of adversarial loss λadv. Using larger value of λadv does not necessarily improve the performance and may cause unwanted visual artifacts. 7 Table 3: Evaluation for baseline semi-supervised setting. We test different combinations of λw and λs in (4). We note that it is difficult to find the best parameters for all evaluated datasets. λw λs Sintel-Clean Sintel-Final KITTI 2012 KITTI 2015 FlyingChairs EPE EPE EPE EPE Fl-all EPE 1 0 3.77 5.02 10.90 18.52 39.94% 2.25 1 0.1 3.75 5.05 11.82 19.98 43.18% 2.19 1 0.01 3.69 4.86 10.38 18.07 39.33% 2.11 0.1 0.01 3.64 4.81 10.15 18.94 40.85 % 2.17 0.01 0.01 3.57 4.82 8.63 18.87 42.63 % 2.22 Table 4: Analysis on different training schemes. “Chairs” represents the FlyingChairs dataset and “KITTI” denotes the KITTI raw dataset. The baseline semi-supervised settings cannot improve the flow accuracy as the brightness constancy assumption does not hold on occluded regions. In contrast, our approach effectively utilizes the unlabeled data to improve the performance. Method Training Datasets Sintel-Clean Sintel-Final KITTI 2012 KITTI 2015 FlyingChairs EPE EPE EPE EPE Fl EPE Supervised Chairs 3.51 4.70 7.69 17.19 40.82% 2.15 Unsupervised KITTI 8.01 8.97 16.54 25.53 54.40% 6.66 Baseline semi-supervised Chairs + KITTI 3.69 4.86 10.38 18.07 39.33% 2.11 Proposed semi-supervised Chairs + KITTI 3.30 4.68 7.16 16.02 38.77% 1.95 of labeled data with ground truth flow from the FlyingChairs dataset and treat the remaining part as unlabeled data to train the proposed semi-supervised method. We also train the purely supervised method with the same amount of labeled data for comparisons. Table 5 shows that the proposed semisupervised method consistently outperforms the purely supervised method on the Sintel, KITTI2012 and KITTI2015 datasets. The performance gap becomes larger when using less labeled data, which demonstrates the capability of the proposed method on utilizing the unlabeled data. 4.3 Comparisons with the state-of-the-arts In Table 6, we compare the proposed algorithm with four variational methods: EpicFlow [32], DeepFlow [39], LDOF [4] and FlowField [2], and four CNN-based algorithms: FlowNetS [8], FlowNetC [8], SPyNet [30] and FlowNet 2.0 [16]. We further fine-tune our model on the Sintel training set (denoted by “+ft“) and compare with the fine-tuned results of FlowNetS, FlowNetC, SPyNet, and FlowNet2. We note that the SPyNet+ft is also fine-tuned on the Driving dataset [26] for evaluating on the KITTI2012 and KITTI2015 datasets, while other methods are fine-tuned on the Sintel training data. The FlowNet 2.0 has significantly more network parameters and uses more training datasets (e.g., FlyingThings3D [26]) to achieve the state-of-the-art performance. We show that our model achieves competitive performance with the FlowNet and SPyNet when using the same amount of ground truth flow (i.e., FlyingChairs and Sintel datasets). We present more qualitative comparisons with the state-of-the-art methods in the supplementary material. 4.4 Limitations As the images in the KITTI raw dataset are captured in driving scenes and have a strong prior of forward camera motion, the gain of our semi-supervised learning over the supervised setting is mainly on the KITTI 2012 and 2015 datasets. In contrast, the Sintel dataset typically has moving objects with various types of motion. Exploring different types of video datasets, e.g., UCF101 [35] or DAVIS [29], as the source of unlabeled data in our semi-supervised learning framework is a promising future direction to improve the accuracy on general scenes. Table 5: Training on partial labeled data. We use 75%, 50% and 25% of data with ground truth flow from the FlyingChair dataset as labeled data and treat the remaining part as unlabeled data. The proposed semi-supervised method consistently outperforms the purely supervised method. Method Amount of Sintel-Clean Sintel-Final KITTI 2012 KITTI 2015 FlyingChairs labeled data EPE EPE EPE EPE Fl-all EPE Supervised 75% 4.35 5.40 8.22 17.43 41.62% 1.96 Proposed semi-supervised 3.58 4.81 7.30 16.46 41.00% 2.20 Supervised 50% 4.48 5.46 9.34 18.71 42.14% 2.04 Proposed semi-supervised 3.67 4.92 7.39 16.64 40.48% 2.28 Supervised 25% 4.91 5.78 10.60 19.90 43.79% 2.09 Proposed semi-supervised 3.95 5.00 7.40 16.61 40.68% 2.33 8 Input images Unsupervised Supervised Ground truth flow Baseline semi-supervised Proposed semi-supervised Figure 5: Comparisons of training schemes. The proposed method learns the flow warp error using the adversarial training and improve the flow accuracy on motion boundary. Ground truth Baseline semi-supervised Proposed semi-supervised Figure 6: Comparisons of flow warp error. The baseline semi-supervised approach penalizes the flow warp error on occluded regions and thus produce inaccurate flow. Table 6: Comparisons with state-of-the-arts. We report the average EPE on six benchmark datasets and the Fl score on the KITTI 2015 dataset. Method Middlebury Sintel-Clean Sintel-Final KITTI 2012 KITTI 2015 Chairs Train Train Test Train Test Train Test Train Train Test Test EPE EPE EPE EPE EPE EPE EPE EPE Fl-all Fl-all EPE EpicFlow [32] 0.31 2.27 4.12 3.57 6.29 3.47 3.8 9.27 27.18% 27.10% 2.94 DeepFlow [39] 0.25 2.66 5.38 4.40 7.21 4.58 5.8 10.63 26.52% 29.18% 3.53 LDOF [4] 0.44 4.64 7.56 5.96 9.12 10.94 12.4 18.19 38.11% 3.47 FlowField [2] 0.27 1.86 3.75 3.06 5.81 3.33 3.5 8.33 24.43% FlowNetS [8] 1.09 4.50 7.42 5.45 8.43 8.26 15.44 52.86% 2.71 FlowNetC [8] 1.15 4.31 7.28 5.87 8.81 9.35 12.52 47.93% 2.19 SpyNet [30] 0.33 4.12 6.69 5.57 8.43 9.12 20.56 44.78% 2.63 FlowNet2 [16] 0.35 2.02 3.96 3.14 6.02 4.09 10.06 30.37% 1.68 FlowNetS + ft [8] 0.98 (3.66) 6.96 (4.44) 7.76 7.52 9.10 3.04 FlowNetC + ft [8] 0.93 (3.78) 6.85 (5.28) 8.51 8.79 2.27 SpyNet + ft [30] 0.33 (3.17) 6.64 (4.32) 8.36 4.13 4.7 3.07 FlowNet2 + ft [16] 0.35 (1.45) 4.16 (2.01) 5.74 3.61 9.84 28.20% Ours 0.37 3.30 6.28 4.68 7.61 7.16 7.5 16.02 38.77% 39.71% 1.95 Ours + ft 0.32 (2.41) 6.27 (3.16) 7.31 5.23 6.8 14.69 30.30% 31.01 % 2.41 5 Conclusions In this work, we propose a generative adversarial network for learning optical flow in a semisupervised manner. We use a discriminative network and an adversarial loss to learn the structural patterns of the flow warp error without making assumptions on brightness constancy and spatial smoothness. The adversarial loss serves as guidance for estimating optical flow from both labeled and unlabeled datasets. Extensive evaluations on benchmark datasets validate the effect of the adversarial loss and demonstrate that the proposed method performs favorably against the purely supervised and the straightforward semi-supervised learning approaches for learning optical flow. Acknowledgement This work is supported in part by the NSF CAREER Grant #1149783, gifts from Adobe and NVIDIA. 9 References [1] A. Ahmadi and I. Patras. Unsupervised convolutional neural networks for motion estimation. In ICIP, 2016. [2] C. Bailer, B. Taetz, and D. Stricker. Flow fields: Dense correspondence fields for highly accurate large displacement optical flow estimation. In ICCV, 2015. [3] S. Baker, D. Scharstein, J. Lewis, S. Roth, M. J. Black, and R. Szeliski. A database and evaluation methodology for optical flow. IJCV, 92(1):1–31, 2011. [4] T. Brox and J. Malik. Large displacement optical flow: descriptor matching in variational motion estimation. TPAMI, 33(3):500–513, 2011. [5] D. J. Butler, J. Wulff, G. B. Stanley, and M. J. Black. A naturalistic open source movie for optical flow evaluation. In ECCV, 2012. [6] R. Collobert, K. Kavukcuoglu, and C. Farabet. Torch7: A Matlab-like environment for machine learning. In BigLearn, NIPS Workshop, 2011. [7] E. L. Denton, S. Chintala, and R. Fergus. Deep generative image models using a laplacian pyramid of adversarial networks. In NIPS, 2015. [8] P. Fischer, A. Dosovitskiy, E. Ilg, P. Häusser, C. Hazırba¸s, V. Golkov, P. van der Smagt, D. Cremers, and T. Brox. FlowNet: Learning optical flow with convolutional networks. In ICCV, 2015. [9] Y. Ganin, E. Ustinova, H. Ajakan, P. Germain, H. Larochelle, F. Laviolette, M. Marchand, and V. Lempitsky. Domain-adversarial training of neural networks. Journal of Machine Learning Research, 17(59):1–35, 2016. [10] A. Geiger, P. Lenz, C. Stiller, and R. Urtasun. Vision meets robotics: The KITTI dataset. The International Journal of Robotics Research, 32(11):1231–1237, 2013. [11] A. Geiger, P. Lenz, and R. Urtasun. Are we ready for autonomous driving? The KITTI vision benchmark suite. In CVPR, 2012. [12] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio. Generative adversarial nets. In NIPS, 2014. [13] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In CVPR, 2016. [14] J. Hoffman, D. Wang, F. Yu, and T. Darrell. FCNs in the wild: Pixel-level adversarial and constraint-based adaptation. arXiv, 2016. [15] B. K. Horn and B. G. Schunck. Determining optical flow. Artificial intelligence, 17(1-3):185– 203, 1981. [16] E. Ilg, N. Mayer, T. Saikia, M. Keuper, A. Dosovitskiy, and T. Brox. FlowNet 2.0: Evolution of optical flow estimation with deep networks. In CVPR, 2017. [17] P. Isola, J.-Y. Zhu, T. Zhou, and A. A. Efros. Image-to-image translation with conditional adversarial networks. In CVPR, 2017. [18] M. Jaderberg, K. Simonyan, and A. Zisserman. Spatial transformer networks. In NIPS, 2015. [19] D. Kingma and J. Ba. ADAM: A method for stochastic optimization. In ICLR, 2015. [20] M. Kozi´nski, L. Simon, and F. Jurie. An adversarial regularisation for semi-supervised training of structured output neural networks. arXiv, 2017. [21] Y. Kuznietsov, J. Stückler, and B. Leibe. Semi-supervised deep learning for monocular depth map prediction. In CVPR, 2017. [22] C. Ledig, L. Theis, F. Huszár, J. Caballero, A. Cunningham, A. Acosta, A. Aitken, A. Tejani, J. Totz, Z. Wang, and W. Shi. Photo-realistic single image super-resolution using a generative adversarial network. In CVPR, 2017. [23] Y. Li, S. Liu, J. Yang, and M.-H. Yang. Generative face completion. In CVPR, 2017. [24] P. Luc, C. Couprie, S. Chintala, and J. Verbeek. Semantic segmentation using adversarial networks. In NIPS Workshop on Adversarial Training, 2016. [25] B. D. Lucas and T. Kanade. An iterative image registration technique with an application to stereo vision. In International Joint Conference on Artificial Intelligence, 1981. [26] N. Mayer, E. Ilg, P. Häusser, P. Fischer, D. Cremers, A. Dosovitskiy, and T. Brox. A large dataset to train convolutional networks for disparity, optical flow, and scene flow estimation. In CVPR, 2016. [27] M. Menze and A. Geiger. Object scene flow for autonomous vehicles. In CVPR, 2015. 10 [28] D. Pathak, P. Krahenbuhl, J. Donahue, T. Darrell, and A. A. Efros. Context encoders: Feature learning by inpainting. In CVPR, 2016. [29] F. Perazzi, J. Pont-Tuset, B. McWilliams, L. Van Gool, M. Gross, and A. Sorkine-Hornung. A benchmark dataset and evaluation methodology for video object segmentation. In CVPR, 2016. [30] A. Ranjan and M. J. Black. Optical flow estimation using a spatial pyramid network. In CVPR, 2017. [31] A. Rasmus, M. Berglund, M. Honkala, H. Valpola, and T. Raiko. Semi-supervised learning with ladder networks. In NIPS, 2015. [32] J. Revaud, P. Weinzaepfel, Z. Harchaoui, and C. Schmid. EpicFlow: Edge-preserving interpolation of correspondences for optical flow. In CVPR, 2015. [33] D. Rosenbaum and Y. Weiss. Beyond brightness constancy: Learning noise models for optical flow. arXiv, 2016. [34] D. Rosenbaum, D. Zoran, and Y. Weiss. Learning the local statistics of optical flow. In NIPS, 2013. [35] K. Soomro, A. R. Zamir, and M. Shah. UCF101: A dataset of 101 human actions classes from videos in the wild. CRCV-TR-12-01, 2012. [36] D. Sun, S. Roth, and M. J. Black. A quantitative analysis of current practices in optical flow estimation and the principles behind them. IJCV, 106(2):115–137, 2014. [37] D. Sun, S. Roth, J. Lewis, and M. Black. Learning optical flow. In ECCV, 2008. [38] X. Wang and A. Gupta. Generative image modeling using style and structure adversarial networks. In ECCV, 2016. [39] P. Weinzaepfel, J. Revaud, Z. Harchaoui, and C. Schmid. DeepFlow: Large displacement optical flow with deep matching. In ICCV, 2013. [40] J. J. Yu, A. W. Harley, and K. G. Derpanis. Back to basics: Unsupervised learning of optical flow via brightness constancy and motion smoothness. In ECCV Workshops, 2016. [41] Y. Zhang, K. Lee, and H. Lee. Augmenting supervised neural networks with unsupervised objectives for large-scale image classification. In ICML, 2016. [42] J.-Y. Zhu, T. Park, P. Isola, and A. A. Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In ICCV, 2017. 11
2017
63
7,152
A framework for Multi-A(rmed)/B(andit) Testing with Online FDR Control Fanny Yang Dept. of EECS, U.C. Berkeley fanny-yang@berkeley.edu Aaditya Ramdas Dept. of EECS and Statistics, U.C. Berkeley ramdas@berkeley.edu Kevin Jamieson Allen School of CSE, U. of Washington jamieson@cs.washington.edu Martin Wainwright Dept. of EECS and Statistics, U.C. Berkeley wainwrig@berkeley.edu Abstract We propose an alternative framework to existing setups for controlling false alarms when multiple A/B tests are run over time. This setup arises in many practical applications, e.g. when pharmaceutical companies test new treatment options against control pills for different diseases, or when internet companies test their default webpages versus various alternatives over time. Our framework proposes to replace a sequence of A/B tests by a sequence of best-arm MAB instances, which can be continuously monitored by the data scientist. When interleaving the MAB tests with an online false discovery rate (FDR) algorithm, we can obtain the best of both worlds: low sample complexity and any time online FDR control. Our main contributions are: (i) to propose reasonable definitions of a null hypothesis for MAB instances; (ii) to demonstrate how one can derive an always-valid sequential p-value that allows continuous monitoring of each MAB test; and (iii) to show that using rejection thresholds of online-FDR algorithms as the confidence levels for the MAB algorithms results in both sample-optimality, high power and low FDR at any point in time. We run extensive simulations to verify our claims, and also report results on real data collected from the New Yorker Cartoon Caption contest. 1 Introduction Randomized trials are the default option to determine whether potential improvements of an alternative method (e.g. website design for a tech company, or medication in clinical trials for pharmaceutical companies) are significant compared to a well-established default. In the applied domain, this is often colloquially referred to as A/B testing or A/B/n testing for several alternatives. The standard practice is to divert a small amount of the traffic or patients to the alternative and control. If an alternative appears to be significantly better, it is implemented; otherwise, the default setting is maintained. At first glance, this procedure seems intuitive and simple. However, in cases where the aim is to optimize over one particular metric, one can do better. In particular, this common tool suffers from several downsides. (1) First, one may wish to allocate more traffic to a better treatment if it is clearly better. Yet typical A/B/n testing frameworks split the traffic uniformly over alternatives. Adaptive techniques should help to detect better alternatives faster. (2) Second, companies often desire to continuously monitor an ongoing A/B test as they may adjust their termination criteria as time goes by and possibly stop earlier or later than originally intended. However, this practice may result in many more false alarms if not properly accounted for. This is one of the reasons for the lack of reproducibility of scientific results, an issue recently receiving increased attention from the public media. (3) Third, the lack of sufficient evidence or an insignificant improvement of the metric may make it undesirable from a practical or financial perspective to replace the default. Therefore, when a 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. company runs hundreds to thousands of A/B tests within a year, ideally the number of statistically insignificant changes that it made should be small relative to the total number of changes made. While controlling the false alarm rate of each individual test does not achieve this type of false discovery rate (FDR) control, there are known procedures in the multiple testing literature that are tailored to this problem. In this paper, we provide a novel framework that addresses the above shortcomings of A/B or A/B/n testing. The first concern is tackled by employing recent advances in adaptive sampling like the pureexploration multi-armed bandit (MAB) algorithm. For the second concern, we adopt the notion of any-time p-values for guilt-free continuous monitoring. Finally, we handle the third issue using recent results in online FDR control. Hence the combined framework can be described as doubly-sequential (sequences of MAB tests, each of which is itself sequential). Although each of those problems has been studied in hitherto disparate communities, how to leverage the best of all worlds, if at all possible, has remained an open problem. The main contributions of this paper are in successfully merging these ideas in a meta framework and presenting the conditions under which it can be shown to yield near-optimal sample complexity and FDR control. The remainder of this paper is organized as follows. In Section 2, we lay out the conceptual challenges that we address in the paper, and describe a meta-algorithm that combines adaptive sampling strategies with FDR control procedures. Section 3 is devoted to the description of a concrete procedure, along with some theoretical guarantees on its properties. In Section 4, we discuss some results of our extensive experiments on both simulated and real-world data sets available to us. 2 Formal experimental setup and a meta-algorithm In this section provide a high-level overview of our proposed combined framework aimed at addressing the shortcomings mentioned in the introduction. A specific instantiation of this meta-algorithm along with detailed theoretical guarantees are specified in Section 3. For concreteness, we refer to the system designer, whether a tech company or a pharmaceutical company, as a (data) scientist. We assume that the scientist needs to possibly conduct an infinite number of experiments sequentially, indexed by j. Each experiment has one default setting, referred to as the control, and K = K(j) alternative settings, called the treatments or alternatives. The scientist must return one of the K + 1 options that is the “best” according to some predefined metric, before the next experiment is started. Such a setup is a simple mathematical model both for clinical trials run by pharmaceutical labs, and A/B/n testing used at scale by tech companies. One full experiment consists of a sequence of steps. In each step, the scientist assigns a new person to one of the K + 1 options and observes an outcome. In practice, the role of the scientist could be taken by an adaptive algorithm, which determines the assignment at time step j by careful consideration of all previous outcomes. Borrowing terminology from the multi-armed bandit (MAB) literature, we refer to each of the K + 1 options as an arm, and each assignment to arm i is termed “pulling arm i”. For concreteness, we assign the index 0 to the control arm and note that it is known to the algorithm. Furthermore, we assume that the observable metric from each pull of arm i = 0, 1, . . . , K corresponds to an independent draw from an unknown probability distribution with expectation µi. In the sequel we use µi⋆:= max i=1,...,K µi to denote the mean of the best arm. We refer the reader to Table 1 in Appendix A for a glossary of the notation used throughout this paper. 2.1 Some desiderata and difficulties Given the setup above, how can we mathematically describe the guarantees that the companies might desire from an improved multiple-A/B/n testing framework? For which parts can we leverage known results and what challenges remain? For the purpose of addressing the first question, let us adopt terminology from the hypothesis testing literature and view each experiment as a test of a null hypothesis. Any claim that an alternative arm is the best is called a discovery, and when such a claim is erroneous, it is called a false discovery. When multiple hypotheses are to be tested, the scientist needs to define the quantity it wants to control. While we may desire that the probability of even a single false discovery is small, this is usually far too stringent for a large and unknown number of tests and results in low power. For this reason, [1] proposed that it may be more useful to control the expected ratio of false discoveries to the total number of discoveries (called the False Discovery Rate, or FDR for short) or the ratio of expected number of false discoveries to the expected number of total discoveries (called the modified FDR 2 or mFDR for short). Over the past decades, the FDR and its variants like the mFDR have become standard quantities for multiple testing applications. In the following, if not otherwise specified, we use the term FDR to denote both measures in order to simplify the presentation. In Section 3, we show that both mFDR and FDR can be controlled for different choices of procedures. 2.1.1 Challenges in viewing an MAB instance as a hypothesis test In our setup, we want to be able to control the FDR at any time in an online manner. Online FDR procedures were first introduced by Foster and Stine [2], and have since been studied by other authors (e.g., [3, 4]). They are based on comparing a valid p-value P j with carefully-chosen levels αj for each hypothesis test1. We reject the null hypothesis, represented as Rj = 1, when P j ≤αj and we set Rj = 0 otherwise. As mentioned, we want to use adaptive MAB algorithms to test each hypothesis, since they can find a best arm among K + 1 with near-optimal sample complexity. However the traditional MAB setup does not account for the asymmetry between the arms as is the case in a testing setup, with one being the default (control) and others being alternatives (treatments). This is the standard scenario in A/B/n testing applications, as e.g. a company might prefer wrong claims that the control is the best (false negative), rather than wrong claims that an alternative is the best (false positive), simply because new system-wide adoption of selected alternatives might involve high costs. What would be a suitable null hypothesis in this hybrid setting? For the sake of continuous monitoring, is it possible to define and compute always-valid p-values that are super-uniformly distributed under the null hypothesis when computed at any time t? In addition to asymmetry, the practical scientist might have a different incentive than the ideal outcome for MAB algorithms as he/she might not want to find the best alternative if it is not substantially better than the control. Indeed, if the net gain is small, it might be offset by the cost of implementing the change from the existing default choice. By similar reasoning, we may not require identifying the single best arm if there is a set of arms with similar means all larger than the rest. We propose a sensible null-hypothesis for each experiment which incorporates the approximation and minimum improvement requirement as described above, and provide an always valid p-value which can be easily calculated at each time step in the experiment. We show that a slight modification of the usual LUCB algorithm caters to this specific null-hypothesis while still maintaining near-optimal sample complexity. MAB-FDR meta algorithm 𝛼𝛼𝑗𝑗 𝑅𝑅𝑗𝑗(𝛼𝛼𝑗𝑗) Exp j MAB Test 𝑝𝑝𝑗𝑗< 𝛼𝛼𝑗𝑗 𝑝𝑝𝑗𝑗(𝛼𝛼𝑗𝑗) 𝛼𝛼j+1 𝑅𝑅j+1 (𝛼𝛼j+1) Exp j+1 MAB Test 𝑝𝑝j+1 < 𝛼𝛼j+1 𝑝𝑝j+1 (𝛼𝛼j+1) Online FDR procedure … … desired FDR level 𝛼𝛼 Figure 1: Diagram of our MAB-FDR meta algorithm. The green solid arrows symbolize interaction between the MAB and FDR procedures via the FDR test levels αj and rejection indicator variables Rj. Notice that the P j-values are now dependent as each αj depends on the past rejections R1, . . . , Rj−1. The eyes represent possible continuous monitoring by the scientist. 2.1.2 Interaction between MAB and FDR In order to take advantage of the sample efficiency of best-arm bandit algorithms, it is crucial to set the confidence levels close to what is needed. Given a user-defined level α, at each hypothesis j, online 1A valid P j must be stochastically dominated by a uniform distribution on [0, 1], which we henceforth refer to as super-uniformly distributed. 3 FDR procedures automatically output the significance level αj which are sufficient to guarantee FDR control, based on past decisions. Can we directly set the MAB confidence levels to these output levels αj? If we do, our p-values are not independent across different hypotheses anymore: P j directly depends on the FDR levels αj and each αj in turn depends on past MAB rejections, thus on past MAB p-values (see Figure 1). Does the new interaction compromise FDR guarantees? Although known procedures as in [2, 4] guarantee FDR control for independent p-values, this does not hold for dependent p-values in general. Hence FDR control guarantees cannot simply be obtained out of the box. A key insight that emerges from our analysis is that an appropriate bandit algorithm actually shapes the p-value distribution under the null in a “good” way that allows us to control FDR. 2.2 A meta-algorithm Procedure 1 summarizes our doubly-sequential procedure, with a corresponding flowchart in Figure 1. We will prove theoretical guarantees after instantiating the separate modules. Note that our framework allows the scientist to plug in their favorite best-arm MAB algorithm or online FDR procedure. The choice for each of them determines which guarantees can be proven for the entire setup. Any independent improvement in either of the two parts would immediately lead to an overall performance boost of the overall framework. Procedure 1 MAB-FDR Meta algorithm skeleton 1. The scientist sets a desired FDR control rate α. 2. For each j = 1, 2, . . . : • Experiment j receives a designated control arm and some number of alternative arms. • An online-FDR procedure returns an αj that is some function of the past values {P ℓ}j−1 ℓ=1. • An MAB procedure is executed with inputs (a) the control arm and K(j) alternative arms, (b) confidence level αj, maintains an always valid p-value for each t and if the procedure self-terminates, returns a recommended arm. • When the MAB procedure is terminated at time t by itself or the user, if the arm with the highest empirical mean is not the control arm and P j t ≤αj, then we return P j := P j t , and the control arm is rejected in favor of this empirically best arm. 3 A concrete procedure with guarantees We now take the high-level road map given in Procedure 1, and show that we can obtain a concrete, practically implementable framework with FDR control and power guarantees. We first discuss the key modeling decisions we have to make in order to seamlessly embed MAB algorithms into an online FDR framework. We then outline a modified version of a commonly used best-arm algorithm, before we finally prove FDR and power guarantees for the concrete combined procedure. 3.1 Defining null hypotheses and constructing p-values Our first task is to define a null hypothesis for each experiment. As mentioned before, the choice of the null is not immediately obvious, since we sample from multiple distributions adaptively instead of independently. In particular, we will generally not have the same number of samples for all arms. Given a default mean µ0 and alternatives means {µi}K i=1, we propose that the null hypothesis for the j-th experiment should be defined as Hj 0 : µ0 ≥µi −ϵ for all i = 1, . . . , K, (1) where we usually omit the index j for simplicity. It remains to define an always valid p-value (previously defined by Johari et al. [5]) for each experiment for the purpose of continuous monitoring. It is defined as a stochastic process {Pt}∞ t=1 such that for all fixed and random stopping times T, under any distribution P0 over the arm rewards such that the null hypothesis is true, we have P0(PT ≤α) ≤α. (2) When all arms are drawn independently an equal number of times, by linearity of expectation one can regard the distance of each pair of samples as a random variable drawn i.i.d. from a distribution with mean ˜µ := µ0 −µi. We can then view the problem as testing the standard hypothesis Hj 0 : ˜µ > −ϵ. However, when the arms are pulled adaptively, a different solution needs to be found—indeed, in this 4 case, the sample means are not unbiased estimators of the true means, since the number of times an arm was pulled now depends on the empirical means of all the arms. Our strategy is to construct always valid p-values by using the fact that p-values can be obtained by inverting confidence intervals. To construct always-valid confidence bounds, we resort to the fundamental concept of the law of the iterated logarithm (LIL), for which non-asymptotic versions have been recently derived and used for both bandits and testing problems (see [6], [7]). To elaborate, define the function ϕn(δ) = s log( 1 δ ) + 3 log(log( 1 δ )) + 3 2 log(log(en)) n . (3) If bµi,n is the empirical average of independent samples from a sub-Gaussian distribution, then it is known (see, for instance, [8, Theorem 8]) that for all δ ∈(0, 1), we have max n P  ∞ [ n=1 {bµi,n −µi > ϕn(δ ∧0.1)}  , P  ∞ [ n=1 {bµi,n −µi < −ϕn(δ ∧0.1)} o ≤δ, (4) where δ ∧0.1 := min{δ, 0.1}. We are now ready to propose single arm p-values of the form Pi,t : = sup n γ ∈[0, 1] | bµi,ni(t) −ϕni(t)( γ 2K ) ≤bµ0,n0(t) + ϕn0(t)( γ 2 ) + ϵ o (5) = sup n γ ∈[0, 1] | LCBi(t) ≤UCB0(t) + ϵ o Here we set Pi,t = 1 if the supremum is taken over an empty set. Given these single arm p-values, the always-valid p-value for the experiment is defined as Pt := min s≤t min i=1,...,K Pi,s. (6) We claim that this procedure leads to an always valid p-value (with proof in Appendix C). Proposition 1. The sequence {Pt}∞ t=1 defined via equation (6) is an always valid p-value. 3.2 Adaptive sampling for best-arm identification In the traditional A/B testing setting described in the introduction, samples are allocated uniformly to the different alternatives. But by allowing adaptivity, decisions can be made with the same statistical significance using far fewer samples. Suppose moreover that there is a unique maximizer i⋆:= arg max i=0,1,...,K µi, so that ∆i := µi⋆−µi > 0 for all i ̸= i⋆. Then for any δ ∈(0, 1), best-arm MAB algorithms can identify i⋆with probability at least 1−δ based on at most2 P i̸=i⋆∆−2 i log(1/δ) total samples (see the paper [9] for a brief survey and [10] for an application to clinical trials). In contrast, if samples are allocated uniformly to the alternatives under the same conditions, then the most natural procedures require K max i̸=i⋆∆−2 i log(K/δ) samples before returning i⋆with probability at least 1 −δ. However, standard best-arm bandit algorithms do not incorporate asymmetry as induced by nullhypotheses as in definition (1) by default. Furthermore, recall that a practical scientist might desire the ability to incorporate approximation and a minimum improvement requirement. More precisely, it is natural to consider the requirement that the returned arm ib satisfies the bounds µib ≥µ0 + ϵ and µib ≥µi⋆−ϵ for some ϵ > 0. In Algorithm 1 we present a modified MAB algorithm based on the common LUCB algorithm (see [11, 12]) which incorporates the above desiderata. We provide a visualization of how ϵ affects the usual stopping condition in Figure 4 in Appendix A.1. The following proposition applies to Algorithm 1 run with a control arm indexed by i = 0 with mean µ0 and alternative arms indexed by i = 1, . . . , K with means µi, respectively. Let ib denote the random arm returned by the algorithm assuming that it exits, and define the set S⋆:= {i⋆̸= 0 | µi⋆≥ max i=1,...,K µi −ϵ and µi⋆> µ0 + ϵ}. (7) 2Here we have ignored some doubly-logarithmic factors. 5 Algorithm 1 Best-arm identification with a control arm for confidence δ and precision ϵ ≥0 For all t let ni(t) be the number of times arm i has been pulled up to time t. In addition, for each arm i let bµi(t) = 1 ni(t) Pni(t) τ=1 ri(τ), define LCBi(t) := bµi,ni(t) −ϕni(t)( δ 2K ) and UCBi(t) := bµi,ni(t) + ϕni(t)( δ 2). 1. Set t = 1 and sample every arm once. 2. Repeat: Compute ht = arg max i=0,1,...,K bµi(t), and ℓt = arg max i=0,1,...,K,i̸=ht UCBi(t) (a) If LCB0(t) > UCBi(t) −ϵ, for all i ̸= 0, then output 0 and terminate. Else if LCBht(t) > UCBℓt(t) −ϵ and LCBht(t) > UCB0(t) + ϵ, then output ht and terminate. (b) If ϵ > 0, let ut = arg maxi̸=0 UCBi(t) and pull all distinct arms in {0, ut, ht, ℓt} once. If ϵ = 0, pull arms ht and ℓt and set t = t + 1. Note that the mean associated with any index i⋆∈S⋆, assuming that the set is non-empty, is guaranteed to be ϵ-superior to the control mean, and at most ϵ-inferior to the maximum mean over all arms. Proposition 2. The algorithm 1 terminates in finite time with probability one. Furthermore, suppose that the samples from each arm are independent and sub-Gaussian with scale 1. Then for any δ ∈(0, 1) and ϵ ≥0, Algorithm 1 has the following guarantees: (a) Suppose that µ0 > max i=1,...,K µi −ϵ. Then with probability at least 1 −δ, the algorithm exits with ib = 0 after taking at most O PK i=0 e∆−2 i log(K log(e∆−2 i )/δ)  time steps with effective gaps e∆0 = (µ0 + ϵ) − max j=1,...,K µj and e∆i = (µ0 + ϵ) −µi. (b) Otherwise, suppose that the set S⋆as defined in equation (7) is non-empty. Then with probability at least 1 −δ, the algorithm exits with ib ∈S⋆after taking at most O PK i=0 e∆−2 i log(K log(e∆−2 i )/δ)  time steps with effective gaps e∆0 = min  max j=1,...,K µj −(µ0 + ϵ), max{∆0, ϵ}  and e∆i = max  ∆i, min  max j=1,...,K µj −(µ0 + ϵ), ϵ  . See Appendix D for the proof of this claim. Part (a) of Proposition 2 guarantees that when no alternative arm is ϵ-superior to the control arm (i.e. under the null hypothesis), the algorithm stops and returns the control arm with probability at least 1 −δ. Part (b) guarantees that if there is in fact at least one alternative that is ϵ-superior to the control arm (i.e. under the alternative), then the algorithm will find at least one of them that is at most ϵ-inferior to the best of all possible arms. As our algorithm is a slight modification of the LUCB algorithm, the results of [11, 12] provide insight into the number of samples taken before the algorithm terminates. Indeed, when ϵ = 0 and i⋆= arg maxi=0,1,...,K µi is a unique maximizer, the nearly optimal sample complexity result of [12] implies that the algorithm terminates under settings (a) and (b) after at most maxj̸=i⋆∆−2 j log(K log(∆−2 j )/δ)+P i̸=i⋆∆−2 i log(log(∆−2 i )/δ) samples are taken (ignoring constants), where ∆i = µi⋆−µi. In our development to follow, we now bring back the index for experiment j, in particular using P j to denote the quantity P j T at any stopping time T. Here the stopping time can either be defined by the scientist, or in an algorithmic manner. 6 3.3 Best-arm MAB interacting with online FDR After having established null hypotheses and p-values in the context of best-arm MAB algorithms, we are now ready to embed them into an online FDR procedure. In the following, we consider p-values for the j-th experiment P j := P j Tj which is just the p-value as defined in equation (6) at the stopping time Tj, which depends on αj. We denote the set of true null and false null hypotheses up to experiment J as H0(J) and H1(J) respectively, where we drop the argument whenever it’s clear from the context. The variable Rj = 1P j≤αj indicates whether a the null hypothesis of experiment j has been rejected, where Rj = 1 denotes a claimed discovery that an alternative was better than the control. The false discovery rate (FDR) and modified FDR up to experiment J are then defined as FDR(J) := E P j∈H0 Rj PJ i=1 Ri ∨1 and mFDR(J) := E P j∈H0 Rj E PJ i=1 Ri + 1 . (8) Here the expectations are taken with respect to distributions of the arm pulls and the respective sampling algorithm. In general, it is not true that control of one quantity implies control of the other. Nevertheless, in the long run (when the law of large numbers is a good approximation), one does not expect a major difference between the two quantities in practice. The set of true nulls H0 thus includes all experiments where Hj 0 is true, and the FDR and mFDR are well-defined for any number of experiments J, since we often desire to control FDR(J) or mFDR(J) for all J ∈N. In order to measure power, we define the ϵ-best-arm discovery rate as ϵBDR(J) := E P j∈H1 Rj1µib≥µi⋆−ϵ1µib≥µ0+ϵ |H1(J)| (9) We provide a concrete procedure 2 for our doubly sequential framework, where we use a particular online FDR algorithm due to Javanmard and Montanari [4] known as LORD; the reader should note that other online FDR procedure could be used to obtain essentially the same set of guarantees. Given a desired level α, the LORD procedure starts off with an initial “α-wealth” of W(0) < α. Based on a inifinite sequence {γi}∞ i=1 that sums to one, and the time of the most recent discovery τj, it uses up a fraction γj−τj of the remaining α-wealth to test. Whenever there is a rejection, we increase the α-wealth by α −W(0). A feasible choice for a stopping time in practice is Tj := min{T(αj), TS}, where TS is a maximal number of samples the scientist wants to pull and T(αj) is the stopping time of the best-arm MAB algorithm run at confidence αj. Procedure 2 MAB-LORD: best-arm identification with online FDR control 1. Initialize W(0) < α, set τ0 = 0, and choose a sequence {γi} s.t. P∞ i=1 γi = 1 2. At each step j, compute αj = γj−τjW(τj) and W(j + 1) = W(j) −αj + Rj(α −W(0)) 3. Output αj and run Algorithm 1 using αj-confidence and stop at a stopping time Tj. 4. Algorithm 1 returns P j and we reject the null hypothesis if P j ≤αj. 5. Set Rj = 1P j≤αj, τj = τj−1 ∨jRj, update j = j + 1 and go back to step 2. The following theorem provides guarantees on mFDR and power for the MAB-LORD procedure. Theorem 1 (Online mFDR control for MAB-LORD). (a) Procedure 2 achieves mFDR control at level α for stopping times Tj = min{T(αj), TS}. (b) Furthermore, if we set TS = ∞, Procedure 2 satisfies ϵBDR(J) ≥ PJ j=1 1j∈H1(1 −αj) |H1(J)| . (10) See Appendix E for the proof of this claim. Note that by the arguments in the proof of Theorem 1, mFDR control itself is actually guaranteed for any generalized α-investing procedure [3] combined with any best-arm MAB algorithm. In fact we could use any adaptive stopping time Tj which depend on the history only via the rejections R1, . . . , Rj−1. Furthermore, using a modified LORD proposed 7 by Javanmard and Montanari [13], we can also guarantee FDR control– a result we moved to the Appendix F due to space constraints. It is noteworthy that small values of α do not only guarantee smaller FDR error but also higher BDR. However, there is no free lunch — a smaller α implies a smaller αj at each experiment, resulting in a larger required number of pulls for the the best-arm MAB algorithm. 4 Experimental results In the following, we briefly describe some results of our experiments3 on both simulated and realworld data sets, which illustrate that, apart from FDR control, MAB-FDR (used interchangeably with MAB-LORD here) is highly advantageous in terms of sample complexity and power compared to a straightforward embedding of A/B testing in online FDR procedures. Unless otherwise noted, we set ϵ = 0 in all of our simulations to focus on the main ideas and keep the discussion concise. Competing procedures There are two natural frameworks to compare against MAB-FDR. The first, called AB-FDR or AB-LORD, swaps the MAB part for an A/B (i.e. A/B/n) test (uniformly sampling all alternatives until termination). The second comparator exchanges the online FDR control for independent testing at α for all hypotheses – we call this MAB-IND. Formally, AB-FDR swaps step 3 in Procedure 2 with “Output αj and uniformly sample each arm until stopping time Tj.” while MAB-IND swaps step 4 in Procedure 2 with “The algorithm returns P j and we reject the null hypothesis if P j ≤α.”. In order to compare the performances of these procedures, we ran three sets of simulations using Procedure 2 with ϵ = 0 and γj = 0.07 log(j∨2) je √log j as in [4]. Our experiments are run on artificial data with Gaussian/Bernoulli draws and real-world Bernoulli draws from the New Yorker Cartoon Caption Contest. Recall that the sample complexity of the best-arm MAB algorithm is determined by the gaps ∆j = µi⋆−µj. One of the main relevant differences to consider between an experiment of artificial or real-world nature is thus the distribution of the means µi for i = 1, . . . , K. The artificial data simulations are run with a fixed gap ∆:= ∆2 while the means of the other arms are set uniformly in [0, µi⋆−∆]. For our real-world simulations, we use empirical means computed from the cartoon caption contest (see details in Appendix B.1.1). In addition, the contests actually follow a natural chronological order, which makes this dataset highly relevant to our purposes. In all simulations, 60% of all the hypotheses are true nulls, and their indices are chosen uniformly. Due to space constraints, the experimental results for artificial and real-world Bernoulli draws are deferred to Appendix B. 100 200 300 400 500 600 700 800 Truncation time TS 0.0 0.2 0.4 0.6 0.8 1.0 BDR MAB-LORD AB-LORD 20 40 60 80 100 120 Number of arms 0 20 40 60 80 100 120 140 160 Total number of samples /1000 MAB-LORD AB-LORD (a) (b) Figure 2: (a) Power vs. truncation time TS (per hypothesis) for 50 arms and (b) Sample complexity vs. # arms for truncation time TS = 300 for Gaussian draws with fixed µi⋆= 8, ∆= 3 over 500 hypotheses with 200 non-nulls, averaged over 100 runs and α = 0.1. Power and sample complexity In this section we include figures on artificial Gaussian trials which confirm that the total number of necessary pulls to determine significance is much smaller for MABFDR than for AB-FDR. In Fig. 2 (a) we fix the number of arms and plot the ϵBDR with ϵ = 0 (BDR for short) for both procedures over different choices of truncation times TS. Low BDR indicates that the algorithm often reaches truncation time before it could stop. For Fig. 2 (b) we fix TS and show how the sample complexity varies with the number of arms. 3The code for reproducing all experiments and plots in this paper is publicly available at https://github.com/fanny-yang/MABFDR 8 Observe in Fig. 2 (a) that the power at any given truncation time is much higher for MAB-FDR than AB-FDR. This is because the best-arm MAB is more likely to satisfy the stopping criterion before any given truncation time than the uniform sampling algorithm. Fig. 2(b) qualitatively shows how the total number of necessary arm pulls for AB-FDR increases much faster with the number of arms than for MAB-FDR before it plateaus due to the truncation. Recall that whenever the best-arm MAB stops before the truncation time in each hypothesis, the stopping criterion is met, i.e. the best arm is identified with probability at least 1 −αj, so that the power is bound to be close to one whenever Tj = T(αj). mFDR control For Fig. 3, we again consider Gaussian draws as in Fig. 2. This time however, for each true null hypothesis we skip the bandit experiment and directly draw P j ∼[0, 1] to compare with the significance levels αj from our online FDR procedure 2 (see App. B.2 for motivation of this setting). By Theorem 1, mFDR should still be controlled as it only requires the p-values to be superuniform. In Fig. 3(a) we plot the instantaneous false discovery proportion FDP(J) = P j∈H0J Rj PT j=1 Rj over the hypothesis index for different runs with the same settings. Apart from initial fluctuations due to the relatively small denominator, observe how the guarantee for the FDR(J) = E FDP(J) with the red line showing its empirical value, transfers to the control of each individual run (blue lines). 0.1 0.3 0.5 0.7 0.9 Proportion of alternatives π1 0.0 0.1 0.2 0.3 0.4 0.5 mFDR MAB-LORD MAB-IND MAB-Bonf. (a) (b) Figure 3: (a) Single runs of MAB-LORD (blue) and their average (red) with uniformly drawn p-values for null hypotheses and Gaussian draws as in Figure 2. (b) mFDR over different proportions of non-nulls π1, with same settings, averaged over 80 runs. In Figure 3 (b), we compare the mFDR of MAB-FDR against MAB-IND and a Bonferroni type correction. The latter uses a simple union bound and chooses αj = 6α π2j2 such that P∞ j=1 αj ≤α and thus trivially allows for any time FWER, implying FDR control. As expected, Bonferroni is too conservative and barely makes any rejections whereas the naive MAB-IND approach does not control FDR. LORD avoids both extremes and controls FDR while having reasonable power. 5 Discussion The recent focus in popular media about the lack of reproducibility of scientific results erodes the public’s confidence in published scientific research. To maintain credibility of claimed discoveries, simply decreasing the statistical significance levels α of each individual experimental work (e.g., reject at level 0.001 rather than 0.05) would drastically hurt power. A common approach is instead to control the ratio of false discoveries to claimed discoveries at some desired value over many sequential experiments, requiring the statistical significances αj to change from experiment to experiment. Unlike earlier works on online FDR control, our framework synchronously interacts with adaptive sampling methods like MABs to make the overall sampling procedure per experiment much more efficient than uniform sampling. To the best of our knowledge, it is the first work that successfully combines the benefits of adaptive sampling and FDR control. It is worthwhile to note that any improvement, theoretical or practical, to either online FDR algorithms or best-arm identification in MAB, immediately results in a corresponding improvement for our MAB-FDR framework. More general notions of FDR with corresponding online procedures have recently been developed by Ramdas et al [14]. In particular, they incorporate the notion of memory and a priori importance of each hypothesis. This could prove to be a valuable extension for our setting, especially in cases when only the percentage of wrong rejections in the recent past matters. It would be useful to establish FDR control for these generalized notions of FDR as well. 9 Acknowledgements This work was partially supported by Office of Naval Research MURI grant DOD-002888, Air Force Office of Scientific Research Grant AFOSR-FA9550-14-1-001, and National Science Foundation Grants CIF-31712-23800 and DMS-1309356. References [1] Y. Benjamini and Y. Hochberg, “Controlling the false discovery rate: a practical and powerful approach to multiple testing,” Journal of the Royal Statistical Society. Series B (Methodological), pp. 289–300, 1995. [2] D. P. Foster and R. A. Stine, “α-investing: a procedure for sequential control of expected false discoveries,” Journal of the Royal Statistical Society: Series B (Statistical Methodology), vol. 70, no. 2, pp. 429–444, 2008. [3] E. Aharoni and S. Rosset, “Generalized α-investing: definitions, optimality results and application to public databases,” Journal of the Royal Statistical Society: Series B (Statistical Methodology), vol. 76, no. 4, pp. 771–794, 2014. [4] A. Javanmard and A. Montanari, “Online rules for control of false discovery rate and false discovery exceedance,” The Annals of Statistics, 2017. [5] R. Johari, L. Pekelis, and D. J. Walsh, “Always valid inference: Bringing sequential analysis to A/B testing,” arXiv preprint arXiv:1512.04922, 2015. [6] K. G. Jamieson, M. Malloy, R. D. Nowak, and S. Bubeck, “lil’ucb: An optimal exploration algorithm for multi-armed bandits,” in COLT, vol. 35, 2014, pp. 423–439. [7] A. Balsubramani and A. Ramdas, “Sequential nonparametric testing with the law of the iterated logarithm,” in Proceedings of the Thirty-Second Conference on Uncertainty in Artificial Intelligence. AUAI Press, 2016, pp. 42–51. [8] E. Kaufmann, O. Cappé, and A. Garivier, “On the complexity of best arm identification in multi-armed bandit models,” The Journal of Machine Learning Research, 2015. [9] K. Jamieson and R. Nowak, “Best-arm identification algorithms for multi-armed bandits in the fixed confidence setting,” in Information Sciences and Systems (CISS), 2014 48th Annual Conference on. IEEE, 2014, pp. 1–6. [10] S. S. Villar, J. Bowden, and J. Wason, “Multi-armed bandit models for the optimal design of clinical trials: benefits and challenges,” Statistical science: a review journal of the Institute of Mathematical Statistics, vol. 30, no. 2, p. 199, 2015. [11] S. Kalyanakrishnan, A. Tewari, P. Auer, and P. Stone, “Pac subset selection in stochastic multiarmed bandits,” in Proceedings of the 29th International Conference on Machine Learning (ICML-12), 2012, pp. 655–662. [12] M. Simchowitz, K. Jamieson, and B. Recht, “The simulator: Understanding adaptive sampling in the moderate-confidence regime,” arXiv preprint arXiv:1702.05186, 2017. [13] A. Javanmard and A. Montanari, “On online control of false discovery rate,” arXiv preprint arXiv:1502.06197, 2015. [14] A. Ramdas, F. Yang, M. J. Wainwright, and M. I. Jordan, “Online control of the false discovery rate with decaying memory,” in Advances in Neural Information Processing Systems (NIPS) 2017, arXiv preprint arXiv:1710.00499, 2017. 10
2017
630
7,153
Interactive Submodular Bandit Lin Chen1,2, Andreas Krause3, Amin Karbasi1,2 1 Department of Electrical Engineering, 2 Yale Institute for Network Science, Yale University 3 Department of Computer Science, ETH Zürich {lin.chen, amin.karbasi}@yale.edu, krausea@ethz.ch Abstract In many machine learning applications, submodular functions have been used as a model for evaluating the utility or payoff of a set such as news items to recommend, sensors to deploy in a terrain, nodes to influence in a social network, to name a few. At the heart of all these applications is the assumption that the underlying utility/payoff function is known a priori, hence maximizing it is in principle possible. In many real life situations, however, the utility function is not fully known in advance and can only be estimated via interactions. For instance, whether a user likes a movie or not can be reliably evaluated only after it was shown to her. Or, the range of influence of a user in a social network can be estimated only after she is selected to advertise the product. We model such problems as an interactive submodular bandit optimization, where in each round we receive a context (e.g., previously selected movies) and have to choose an action (e.g., propose a new movie). We then receive a noisy feedback about the utility of the action (e.g., ratings) which we model as a submodular function over the context-action space. We develop SM-UCB that efficiently trades off exploration (collecting more data) and exploration (proposing a good action given gathered data) and achieves a O( √ T) regret bound after T rounds of interaction. More specifically, given a bounded-RKHS norm kernel over the context-action-payoff space that governs the smoothness of the utility function, SM-UCB keeps an upperconfidence bound on the payoff function that allows it to asymptotically achieve no-regret. Finally, we evaluate our results on four concrete applications, including movie recommendation (on the MovieLense data set), news recommendation (on Yahoo! Webscope dataset), interactive influence maximization (on a subset of the Facebook network), and personalized data summarization (on Reuters Corpus). In all these applications, we observe that SM-UCB consistently outperforms the prior art. 1 Introduction Interactive learning is a modern machine learning paradigm that has recently received significant interest in both theory and practice [15, 14, 7, 6]. In this setting, the learning algorithm engages in a two-way dialog with the environment (e.g., users) by performing actions and receiving a response (e.g., like or dislike) for each action. Interactive learning has led to substantial performance improvement in a variety of machine learning applications [43, 13], including clustering [4, 25, 1], classification [46, 10], language learning [48], decision making [26], and recommender systems [28], to name a few. At a high level, interactive learning can be cast as a dynamic optimization problem with a known utility/payoff function where the goal is to achieve an objective whose value depends on the selected actions, their responses, and the state of the environment. In many practical settings, the utility functions are submodular, stating (informally) that the payoff of performing an action earlier is more 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. than performing it later. In fact, rigorous treatment of submodularity in interactive settings led to strong theoretical guarantees on the performance of greedy policies [19, 22]. In this paper, we go one step further and consider scenarios where the exact form of the submodular payoff function is not completely known and hence needs to be estimated through interactions. This problem is closely related to the contextual multi-armed bandit [38, 9, 36] where for a sequence of T rounds, we receive a payoff function along with some side information or context (e.g., user’s features), based on which we have to choose an action (e.g., proposing an item) and then a noisy feedback about the obtained payoff is revealed (e.g., rating of the proposed item). The goal is to minimize the regret of not selecting the optimal action due to the uncertainty associated with the utility function. The interactive contextual bandit generalizes this setting by allowing to interact with a payoff function multiple times, where each time we need to take a new action based on both the context and previously taken actions. The regret is then defined in terms of the difference between the utility of the best set of actions that we could have chosen versus the ones that are actually selected. In this paper, we further assume that the marginal payoffs of actions show diminishing returns. This problem, which we call interactive submodular bandit, appears in many practical scenarios, including: • Interactive recommender system. The goal is to design a recommender system that interacts with the users in order to elicit and satisfy their preferences. In our approach, we model the utility of a set of items as an unknown submodular objective function that the recommender systems aims to maximize. In each round of interaction, the recommender system decides which item should be presented to the user, given the previously proposed items to this or similar users (affinity between users, if this side information exists, can be leveraged to enhance recommendation performance). Since the users’ preferences are unknown, the recommender system can only gather information about the users through the feedback they provide in terms of ratings. A successful recommender system should be able to minimize the total regret accumulated over T iterations with users. • Interactive influence maximization. Influence spread maximization addresses the problem of selecting the most influential source nodes of a given size in a diffusion network [51]. A diffusion process that starts with those source nodes can potentially reach the greatest number of nodes in the network. Under many diffusion models, the expected total number of influenced people is a submodular function of the seed subjects [29, 20]. In a natural interactive variant of this problem, users may be recruited in a sequential manner [42, 5] where a new user is selected once we fully observe the extent to which the current seed users influenced people. Note that finding the optimal set of source nodes in a diffusion network depends dramatically on the underlying dynamics of the diffusion. Again, very often in practice, we are faced with the dilemma of estimating the underlying diffusion parameters through interactively selecting the nodes while at the same time trying to maximize the influence. • Interactive coverage. Coverage problems arise naturally in many applications [32, 33]. Consider an environmental monitoring task, for instance, where sensors are placed in the Alps to better predict floods, landslides and avalanches [8]. Similarly, Wi-Fi hotspots are carefully arranged to cover every corner of a floor. However, it is likely that the actual coverage of a device is uncertain before deployment due to unknown conditions present in the environment. Hence, we might need to install devices in a sequential manner after we observe the actual coverage of the ones already installed [19, 22]. Without any assumptions about the smoothness of the payoff function, no algorithm may be able to achieve low regret [31]. Thus, in our setting, we make a crucial yet very natural assumption that the space of context-action-payoff has low complexity, quantified in terms of the Reproducing Kernel Hilbert Space (RKHS) norm associated with some kernel [24]. We then show that SMUCB, an upper-confidence-bound based algorithm achieves an O( √ T) regret. We also evaluate the performance of SM-UCB on four real-world applications, including movie recommendation [40], news recommendation [16], interactive influence maximization [42, 34], and personalized data summarization [39]. 2 2 Problem Formulation As we stated earlier, many utility or payoff functions we encounter in machine learning applications are submodular. As a reminder, a set function f is called submodular if for all A ⊆B ⊆Ωwe have f(A) + f(B) ≥f(A ∩B) + f(A ∪B). An equivalent definition of submodularity that shows better the diminishing returns property is as follows: for all A ⊆B ⊆Ωand any element e ̸∈B we have f(A ∪{e}) −f(A) ≥f(B ∪{e}) −f(B). We also denote the marginal gain of an element e to a set A by ∆(e|A) ≜f(A ∪{e}) −f(A). The function f is called monotone if for all A ⊆B we have f(A) ≤f(B). In this paper, we consider a sequential decision making process for a horizon of T time steps, where at each round i, a monotone submodular function fi, is (partially) revealed. Let us first consider the simple bandit problem [50] where we need to select an item (or an arm) e from the set of items Ω such that fi(e) is maximized. After the item e is selected, the payoff fi(e) is revealed. Since ft’s are not known in advance, the goal is to minimize the accumulated regret over T rounds, for not choosing the optimum items. Contextual submodular bandit generalizes the aforementioned setting by allowing to receive side information φi (also called context) in each round i [31]. But still the goal is to select a single item e such that fφi(e) is maximized. In the interactive contextual submodular bandit, the focus of this paper, we may encounter the same valuation function fφ, with its associate context φ, multiple times over the time horizon T. Here instead, at each round, we need to propose a new item that maximizes the marginal payoff given the ones we selected in the previous encounters. Therefore, we are sequentially building up subsets of items that maximize the payoff for each separate function fφ. For instance, a recommender system may interact with a user (or a number of users) multiple times. In each interaction, it has to recommend a new item while taking into account what it has recommended in previous interactions. More formally, let us assume that we encounter m ≤T distinct functions fφ, in an arbitrary order, over the time horizon T, i.e., φ ∈{φ1, . . . , φm}. We denote the arriving ordered sequence by f1, f2, . . . , fT where for each round i, we have fi ∈{fφ1, . . . , fφm}. Let us also denote by ui ∈{1, . . . , m} the index of the context received in round i. We also need to maintain a collection of m sets S1, . . . , Sm, (initialized to the empty set) corresponding to fφ1, . . . , fφm. Our goal is to select a subset Sj ⊆Ωfor each function fφj that maximizes its corresponding utility fφj(Sj). Note that if fφj were known in advance, we could simply use the greedy algorithm. However, in the interactive submodular bandit setting, we need to build up the sets Sj sequentially and through interactions, as the marginal payoff of an element is only revealed after it is selected. Let oi ≜P j≤i 1{uj = ui} denote the number of occurrences of function fφui in the first i rounds. In each round, say the i-th with the corresponding function fφui, we need to select a new item xoi,ui from the set of items Ω and add it to Sui. Clearly, after including xoi,ui, the set Sui will be of cardinality oi. For the ease of presentation, we denote Sui ∪{xoi,ui} by Soi,ui, initialized to the empty set in the beginning, i.e., S0,ui = ∅. After selecting the item xoi,ui and given the previously selected items Sui, we receive yi, a noisy (but unbiased) estimate of xoi,ui’s marginal payoff, i.e., yi = ∆(xoi,ui|Soi−1,ui, φui) + ϵi, where the marginal gain ∆(·|·, ·) : Ω× 2Ω× Φ →R is defined as ∆(x|S, φ) = fφ(S ∪{x}) −fφ(S). (1) We also assume that ϵi’s are uniformly bounded noise variables that form a martingale difference sequence, i.e., E[ϵi|ϵ1, ϵ2, . . . , ϵi−1] = 0 and |ϵi|≤σ for all i ∈{1, . . . , T}. We call σ the noise level. Note that yi is the only feedback that we obtain in round i. It crucially depends on the previously selected items and contextual information Soi−1,ui, φui. Therefore, the only avenue through which we can learn about the payoff functions fφ (that we try to optimize over) is via noisy feedbacks yi. We need to design an algorithm that minimizes the accumulated regret over the total number of T rounds. Formally, we compare the performance of any algorithm in this interactive submodular bandit setting with that of the greedy algorithm with the full knowledge of the payoff functions fφ1, . . . , fφm. 3 Algorithm 1 SM-UCB Input: set of items Ω, mean µ0 = 0, variance σ0. 1: Initialize Si ←∅for all i ∈[m] 2: for i = 1, 2, 3, . . . do 3: select an item xoi,ui ←argmaxx∈Ωµi−1(x) + √βiσi−1(x) 4: update the set Sui ←Sui ∪{xoi,ui} 5: obtain the feedback yi = ∆(xoi,ui|Soi−1,ui, φui) + ϵi 6: let ki(x) be a vector-valued function that outputs an i-dimensional column vector with j-th entry k((xoj,uj, Soj−1,uj, φuj), (x, Soi−1,ui, φui)) 7: let Ki be an i×i matrix with (j, j′)-entry k((xoj,uj, Soj−1,uj, φuj), (xoj′,uj′ , Soj′−1,uj′ , φuj′ )) 8: update yi ←[y1, y2, . . . , yi]T 9: let ki(x, x′) be a kernel function defined as k(x, x′) −ki(x)T (Ki + σ2I)−1ki(x′) 10: estimate µi(x) ←ki(x)T (Ki + σ2I)−1yi 11: estimate σi(x) ← p ki(x, x) 12: end for Suppose that by the end of the T-th round, an algorithm has selected Tj items for the payoff function fφj; therefore the cardinality of Sj by the end of the T-th round is Tj. Thus, we have Tj = P t≤T 1{ut = j} and T = Pm j=1 Tj. We use S∗ j to denote the set that maximizes the payoff of function fφj with at most Tj elements, i.e., S∗ j = argmax|S|≤Tj fφj(S). We know that the greedy algorithm is guaranteed to achieve (1 −1/e) Pm j=1 fφj(S∗ j ) [41] and there is no polynomial time algorithm that achieves a better approximation guarantee in general [17]. Therefore, we define the total regret of an algorithm up to round T as follows: RT ≜(1 −1/e) m X j=1 fφj(S∗ j ) − m X j=1 fφj(STj,j), (2) which is the gap between the greedy algorithm’s guarantee and the total utility obtained by the algorithm. Without any smoothness assumption over the payoff functions, it may not be possible to guarantee a sublinear regret [31]. In this paper, we make a natural assumption about the complexity of payoff functions. More specifically, we assume that the marginal payoffs, defined in (1), have a low RKHS-norm according to a kernel k : (Ω× 2Ω× Φ) × (Ω× 2Ω× Φ) →R, i.e., ∥∆(·|·, ·)∥k≤B. Note that such a kernel encodes how close two marginal payoffs are if a) the contexts φi and φj or b) the selected elements Si and Sj are similar. For instance, a recommender system can leverage this information to propose an item to a user if it has observed that a user with similar features liked that item. 3 Main Results In Algorithm 1 we propose SM-UCB, an interactive submodular bandit algorithm. Recall that the marginal gain function ∆has a low RKHS norm w.r.t. some kernel k. In each round, say the i-th, SM-UCB maintains the posterior mean µi−1(·) and standard deviation σi−1(·) conditioned on the historical observations or context {(xoj,uj, Soj−1,uj, φuj) : 1 ≤j ≤i}. Based on these posterior estimates, SM-UCB then selects an item x that attains the highest upper confidence bound µi−1(x)+√βiσi−1(x). It then receives the noisy feedback yi = ∆(xoi,ui|Soi−1,ui, φui)+ϵi. Since ϵi’s are uniformly bounded and form a martingale difference sequence, SM-UCB can predict the mean µi and standard deviation σi via posterior inference in order to determine the item to be selected in the next round. In order to bound the regret of an algorithm, we need to quantify how much information that algorithm can acquire through interactions. Let yA denote a subset of noisy observations indexed by the set A, i.e., yA = {yi|i ∈A}. Note that any subset A of noisy observations yA reduces our uncertainty about the marginal gain function ∆. In an extreme case, if we had perfect information (or no uncertainty) about ∆, we could have achieved zero regret. We can precisely quantify this notion through what is called the information gain I(yA; ∆) = H(yA) −H(yA|∆), where H denotes the Shannon entropy. In fact, by lifting the results from [31, 44] to a much more general setting, we relate the regret to the maximum information gain γT [44] obtained after T rounds and defined as 4 γT ≜maxA⊆Ω:|A|=T I(yA; ∆). Another important quantity that shows up in the regret bound is the confidence parameter βT (see line 3 of Algorithm 1) that needs to be chosen carefully so that our theoretical guarantee holds with high probability. In fact, the following theorem shows that SM-UCB attains a O(√TβT γT ) regret bound with high probability. Theorem 1. Suppose that the true marginal gain function ∆(·|·, ·) has a small RKHS norm according to some kernel k, i.e., ∥∆(·|·, ·)∥k≤B. The noise variables ϵt satisfy E[ϵt|ϵ1, ϵ2, . . . , ϵt−1] = 0 for all t ∈N and are uniformly bounded by σ. Let δ ∈(0, 1), βt = 2B2 + 300γt ln3(t/δ) and C1 = 8/log(1 + σ−2). Then, the accumulated regret of SM-UCB over T rounds is as follows: Pr n RT ≤ p C1TβT γT + 2, ∀T ≥1 o ≥1 −δ. The proof of the above theorem is provided in the Supplementary Material. It relies on two powerful ideas: greedy selection for constrained submodular maximization [41] and upper confidence bounds of contextual Gaussian bandit [31]. If the marginal payoffs were completely known, then the greedy policy would provide a competitive solution to the optimum. However, one cannot run the greedy policy without knowing the marginal gains. In fact, there are strong negative results regarding the approximation guarantee of any polynomial time algorithm if the marginal gains are arbitrarily noisy [23]. Instead, SM-UCB relies on optimistic estimates of the marginal gains and select greedily an item with the highest upper confidence bound. By assuming that marginal gains are smooth and relying on Theorem 1 in [31], we can control the accumulated error of a greedy-like solution that relies on confidence bounds and obtain low regret. Our setting and theoretical result generalize a number of prior work mentioned below. Linear submodular bandit [50]. In this setting, the objective function has the form f(S) = Pd i=1 wifi(S), where fi’s are known submodular functions and wi’s are positive unknown coefficients. Therefore, the marginal gain function can be written as ∆(x|S) = Pd i=1 wi∆i(x|S), where ∆i(·|·)’s are known functions and wi’s are unknown coefficients. Let w = (w1, w2, . . . , wd) denote the weight vector. Since the only unknown part of the marginal gain function is the weight vector, the space of the marginal gain function is isomorphic to the space of weight vectors, which is in fact a d-dimensional Euclidean space Rd. The RKHS norm of ∆is given by some norm in Rd; i.e., ∥∆∥k≜∥w∥. The assumption in [50] that ∥w∥≤B is equivalent to assuming that ∥∆∥k≤B. Therefore, the linear bandit setting is included in our setting where the marginal gain function ∆has a special form and its RKHS norm is given by the norm of its corresponding weight vector in the Euclidean space. Also, LSBGREEDY proposed in [50], is a special case of SM-UCB (except that the feedback is delayed). Adaptive valuable item discovery [47]. In this setting, the objective function has the form f(S) = (1 −λ) P x∈S g(x) + λD(S), where D is a known submodular function that quantifies the diversity of the items in S, g is an unknown function that denotes the utility g(x) for any item x, and λ is a known tradeoff parameter balancing the importance of the accumulative utility and joint diversity of the items. Note that the unknown function M(S) = P x∈S g(x) is a modular function. Therefore, the marginal gain function has the form ∆(x|S) = (1 −λ)g(x) + λD(x|S), where D(x|S) ≜D({x} ∪S) −D(S). The only uncertainty of ∆arises from the uncertainty about the modular function M. In particular, [47] assumes that the RKHS norm of g is bounded. Again, our setting encompasses adaptive valuable item discovery as we consider any monotone submodular function. Moreover, GPSELECT proposed in [47], is a special case of SM-UCB. Contextual Gaussian bandit [31]. This is the closest setting to ours where in each round i we receive a context φi from the set of contexts Φ and have to choose an item x from the set of items Ω. We then receive a payoff fφi(x) + ϵt. Note that instead of building up a set (our problem), in the contextual bandit process we simply choose a single element for each function fφi as the main assumption is that we encounter each function only once. To obtain regret bounds it is assumed in [31] that f has low norm in the RKHS associated with some kernel k. Again, CGP-UCB proposed in [31], is a special case of SM-UCB. 5 4 Experiments In this section, we compare empirically the performance of SM-UCB with the following baselines: • RANDOM. In each round, an item is randomly selected for the current payoff function fφ. • GREEDY. It has the full knowledge of the submodular functions fφ. In each round, say the i-th with the corresponding function fφui , GREEDY selects the item that maximizes the marginal gain, i.e., argmaxx∈Ω∆(x|Soi−1, φui). • HISTORY-FREE. We run SM-UCB without considering the previously selected items. HISTORY-FREE is basically the contextual Gaussian bandit algorithm proposed in [31] whose context is the user feature. • FEATURE-FREE. We run SM-UCB without considering the context φ of an arriving function f. • CONTEXT-FREE. We run SM-UCB without considering the context or the previously selected elements. In fact, CONTEXT-FREE is basically the GP-SELECT algorithm proposed in [47]. In all of our experiments, the m distinct functions {fφi : 1 ≤i ≤m} that the algorithm encounters represent the valuation functions of m users, where the context φi ∈Rd encodes users’ features. Moreover, Si is the set of items that an algorithm selects for user i ∈[m]. Instead of computing the regret, we quantify the performance of the algorithms by computing the accumulated reward Pm i=1 fφi(Si). Recall that the regret is given by (1 −1/e) · OPT −Pm i=1 fφi(Si), where OPT = Pm i=1 fφi(S∗ i ) is a constant generally hard to compute. Movie Recommendation In this set of experiments, we use the MovieLens dataset1 where a userrating matrix M is provided. The rows of M represent users and the columns represent movies. The matrix M contains 943 users and 1682 movies. As a preprocessing step, we apply the singular-value decomposition (SVD) to impute the missing values; the six largest singular values are kept. In the first part of the study, we use the submatrix of M that consists of 80% of the users and all of the movies for training the feature vectors of movies via SVD. Let M ′ be the submatrix of M that consists of the remaining nuser users and all of the movies; this matrix is for testing. Let Ω denote the set of movies. We consider selecting a subset of Ωto maximize the facility-locationtype objective [30] f(S) = Pnuser i=1 maxj∈S M ′ ij. This objective function corresponds to a scenario without any context φ as there is only one payoff function f that we are trying to maximize. Thus, FEATURE-FREE does not apply here. We use the cosine kernel kmovie : Ω× Ω→R for pairs of movies and Jaccard kernel ksubset(S, T) = |S ∩T|/|S ∪T| [18] for pairs of subsets of movies, say S and T. The composite kernel k : (Ω× 2Ω) × (Ω× 2Ω) →R is defined as κ1kmovie ⊕κ2ksubset, i.e., k((u, S), (v, T)) = κ1kmovie(u, v) + κ2ksubset(S, T), where κ1, κ2 > 0. The results are shown in Fig. 1(a). The horizontal axis denotes the cardinality of S. The vertical axis denotes the function value of f on the set S. We observe that SM-UCB outperforms all of the baselines except the practically infeasible GREEDY. In the second part, we consider a setting where a separate subset of movies is selected for each user. We cluster the users in the dataset into 40 groups via the k-means algorithm and the users of the same group are viewed as identical users. The feature vector of a group of users is the mean of the feature vectors of all member users and the rating of a group is the sum of the ratings of all member users. The users are labeled as 1, 2, 3, . . . , n′ user, where n′ user = 40. Similar to the first part, the feature vectors of the users and movies are obtained via SVD. We maintain a set Si for user i. The objective function is fφi(S) = maxj∈S M ′′ ij, where M ′′ ij is user i’s rating for movie j. In addition, we also need a collective objective function that quantifies the overall performance of an algorithm for all users. It is defined as f(S1, S2, . . . , Sn′user) = Pn′ user i=1 fφi(Si). We assume a random arrival of users. We use the linear kernel kuser : Φ × Φ →R for pairs of users. The composite kernel k : (Ω× 2Ω× Φ) × (Ω× 2Ω× Φ) →R is defined as κ1kmovie ⊕κ2ksubset ⊕κ3kuser. In Fig. 1(b), we plot the performance of SM-UCB against other baselines. The horizontal axis denotes the number of user arrivals while the vertical axis denotes the value of the collective objective function. We 1https://grouplens.org/datasets/movielens/ 6 Greedy SM-UCB History free Random (a) Greedy SM-UCB Random Feature free History free Context free (b) Greedy SM-UCB History free Random (c) Greedy Random History free SM-UCB (d) Greedy SM-UCB Random Context free History free Feature free (e) Greedy SM-UCB Feature free Context free History free (f) Figure 1: Figs. 1(a) and 1(b) show the results of the experiments on the MovieLens dataset. Fig. 1(a) shows how the total objective function for all users evolves as the number of selected movies increases; the algorithm recommends the same subset of movies to all users. In Fig. 1(b), we consider the situation where users arrive in a random order and we have to recommend a separate subset of movies to each user. Figs. 1(c) and 1(d) show the dependency of fraction of influenced nodes on the target set size in the Facebook network and the student network from the User Knowledge Modelling Dataset [27]. Fig. 1(e) shows how the payoff function varies as more users arrive in the Yahoo news recommender. In Fig. 1(f), we consider the personalized data summarization from Reuters corpus for arriving users. It shows the fraction of covered topics versus the number of user arrivals. observe that SM-UCB outperforms all other baselines except GREEDY. In addition, CONTEXT-FREE that uses the least amount of information achieves a lower function value than HISTORY-FREE and FEATURE-FREE, which either leverages the information about users’ features or previously selected items. 7 Interactive Influence Maximization For this experiment, we use the Facebook network provided in [35]. The goal is to choose a subset of subjects in the network, which we call the target set, in order to maximize the number of influenced subjects. We assume that each member in the target set can influence all of her neighbors. Under this assumption, the submodular objective function is f(S) = S u∈S(N(u) ∪{u}) , where N(u) is the set of all neighbors of subject u. All the baselines, except GREEDY, have no knowledge of the underlying Facebook network or the objective function. They are only given the feature vector of each subject obtained via the NODE2VEC algorithm [21]. The kernel function ksubject between two subjects is a linear kernel while the kernel function between subsets of subjects is the Jaccard kernel. The results are shown in Fig. 1(c). Again, SM-UCB reaches the largest influence w.r.t other baselines except for GREEDY. We ran the same idea over the 6-nearest neighbor network of randomly sampled 150 students from User Knowledge Modelling Dataset [27]. As Fig. 1(d) indicates, a similar pattern emerges. News Recommendation For this experiment, we use the Yahoo! Webscope dataset R6A2. The dataset provides a list of records, each containing a time stamp, a user ID, a news article ID and a Boolean value that indicates whether the user clicked on the news article that was presented to her. The feature vectors of the users and the articles are also provided. We use k-means clustering to cluster users into 175 groups and identify users of the same group as identical users. We form a matrix M whose (i, j)-entry is the total number of times that user i clicked on article j. This matrix quantifies each user’s preferences regarding news articles. The objective function for user i is defined as fφi(Si) = maxj∈Si Mij. The collective objective function f is defined as the sum of the objective functions of all users. From the time stamps, we can infer the order in which the users arrive. We use the Laplacian kernels knews : Ω× Ω→R and kuser : Φ × Φ →R for pairs of pieces of news and pairs of users, respectively. For a pair of subsets of news S and T, the kernel function between them is again the Jaccard kernel. The composite kernel k : (Ω× 2Ω× Φ) × (Ω× 2Ω× Φ) →R is defined as κ1knews ⊕κ2ksubset ⊕κ3kuser. The results are illustrated in Fig. 1(e). The horizontal axis is the number of arriving users while the vertical axis is the value of the collective objective function. Again, we observe that SM-UCB outperforms all other methods except GREEDY. Personalized Data Summarization For this experiment, we apply latent Dirichlet allocation (LDA) to the Reuters Corpus. The number of topics is set to ntopic = 10. LDA returns a topic distribution P(i|a) for each article a and topic i. Suppose that A is a subset of articles. Probabilistic coverage function quantifies the degree to which a set of articles A covers a topic i [16], and is given by Fi(A) = 1 −Q a∈A(1 −P(i|a)). Each user j is characterized by her ntopic-dimensional preference vector wj = (wj,1, wj,2, wj,3, . . . , wj,ntopic); we assume that the preference vector is L1-normalized, i.e., its entries sum to 1. The personalized probabilistic coverage function for user j is defined as fj(A) = Pntopic i=1 wj,iFi(A) [16, 50]. Note that since the preference vector is L1normalized and Fi(A) ≤1, we have fj(A) ≤1 for any j. The total average coverage function is f(A) = 1 nuser Pnuser j=1 fj(A), where nuser = 10 is the number of users. Random order of user arrivals is simulated. We use the linear kernel for pairs of users and pairs of articles and use the Jaccard kernel between subsets of articles. The results are shown in Fig. 1(f). The horizontal axis is the number of user arrivals while the vertical axis is the total average coverage function f(A), which characterizes the average fraction of covered topics. We observe that SM-UCB outperforms all the baselines other than GREEDY. Discussion Recall that the RKHS is a complete subspace of the L2 space of functions defined on the product of the item set, its power set, and the context set. It has an inner product (·, ·)k obeying the reproducing property: (f, k(x, ·))k = f(x) for all f in RKHS. Functions implied by a particular kernel k are always of the form f(x) = P i αik(xi, x). The bounded norm implies that αi vanish quickly enough. With universal kernels like Gaussian/Laplacian kernels, such functions are dense (according to sup-norm) in the space of continuous functions. In three sets of experiments (movie recommendation, influence maximization, data summarization) we used the linear and cosine kernels for items and users, and the Jaccard kernel for subsets of items. In fact, the Jaccard kernel is a widely used metric that quantifies the similarity between subsets of selected items. Moreover, the linear and cosine kernels between items and users capture the simplest form of interactions. In contrast to the the above three experiments, in the news recommendation 2http://webscope.sandbox.yahoo.com/ 8 application, we chose the Laplacian kernel for the following reason. The features provided in the dataset have highly heterogeneous norms. If we use the linear kernel, the inner product between a short vector and a close-by vector with a small norm will be easily dominated by the inner product with a vector with a large norm. We used the Laplacian kernel to circumvent this problem and put more weight on nearby vectors even if they have small norms. 5 Related Work Originally, Auer et al. [2] proposed UCB policies for the multi-armed bandit (MAB) problem which exhibits the exploration-exploitation tradeoff and achieves an O( √ T) regret. In the literature, there are many variants of the multi-armed bandit problem and corresponding solutions, for example, EXP3 algorithm for adversarial bandits [3], LINUCB for stochastic contextual bandits [36, 12], and a family of UCB-based policies for infinitely many-armed bandit [49]. Chen et al. [11] considered the combinatorial MAB problem where the unit of play is a super arm and base arms can be probabilistically triggered. For a comprehensive survey on bandit problems, we refer the interested reader to [9]. Srinivas et al. [44] studied the Gaussian process (GP) optimization problem in the bandit setting. They assumed that the objective function f is either sampled from a Gaussian process or resides in a reproducing kernel Hilbert space (RKHS). Given a subset of items S ⊆Ω, the total utility is P x∈Ωf(x). Under either the GP model or the RKHS assumption, they showed that their proposed GP-UCB algorithm achieves an O( √ T) regret bound. It is noteworthy to mention that their bound also relies on the maximum information gain. Based on [44], Krause and Ong [31] further investigated the contextual Guassian process bandit optimization and their proposed algorithm CGP-UCB achieves a similar regret bound. Lin et al. [37] addressed an online learning problem where the input to the greedy algorithm is stochastic with unknown parameters and the algorithm receives semi-bandit feedbacks. Their algorithm can also be applied to submodular functions. However, there are several major differences between their work and ours: Firstly, they assume that the objective functions are drawn from a predetermined but unknown distribution, while our work applies to any set of submodular functions; secondly they assume bounded submodular functions while we have no such assumptions; thirdly, their work did not have the notion of context. They optimize the expected objective function while we optimize objective functions with different contexts simultaneously. Streeter and Golovin [45] studied the online maximization problem of submodular functions. Yue and Guestrin [50] studied the linear submodular bandit problem where they assumed that the unknown submodular function is a linear combination of multiple known submodular functions. The only uncertainty in their setting is the unknown positive coefficients of each known submodular function. They proposed LSBGREEDY that achieves a similar O( √ T) regret bound. Beyond unconstrained sequential decision problems, Zhou et al. [52] considered online maximization of list submodular functions under a knapsack constraint. Our key contribution in this paper is that the notion of contextual regret that we bound is much more challenging than the typical notion: Our actions are affecting the future contexts experienced, and we compete with policies that are aware of this fact and can plan for it. This is qualitatively different from any prior analysis. More specifically, we need to build up a subset of items/actions as we encounter a valuation function multiple times. This is a non-trivial task as not only the functions are unknown, the marginal gains are also noisy. Moreover, the choices we make can affect the future. Our positive results can be seen in light of very recent negative results in [23] that indicates submodular optimization is hard when function evaluations are noisy. We show that the UCB-based algorithm can be naturally combined with the greedy selection policy to provide sublinear regret. To the best of our knowledge the analysis is new. Acknowledgements This research was supported by DARPA Young Faculty Award (D16AP00046), grant SCADAPT and ERC StG. 9 References [1] Hassan Ashtiani, Shrinu Kushagra, and Shai Ben-David. Clustering with same-cluster queries. In NIPS, pages 3216–3224, 2016. [2] Peter Auer, Nicolo Cesa-Bianchi, and Paul Fischer. Finite-time analysis of the multiarmed bandit problem. Machine learning, 47(2-3):235–256, 2002. [3] Peter Auer, Nicolo Cesa-Bianchi, Yoav Freund, and Robert E Schapire. The nonstochastic multiarmed bandit problem. SIAM journal on computing, 32(1):48–77, 2002. [4] Pranjal Awasthi, Maria-Florina Balcan, and Konstantin Voevodski. Local algorithms for interactive clustering. In ICML, pages 550–558, 2014. [5] Ashwinkumar Badanidiyuru, Christos Papadimitriou, Aviad Rubinstein, Lior Seeman, and Yaron Singer. Locally adaptive optimization: Adaptive seeding for monotone submodular functions. In SODA, pages 414–429, 2016. [6] Maria-Florina Balcan, Andrei Broder, and Tong Zhang. Margin based active learning. In COLT, pages 35–50. Springer, 2007. [7] Maria-Florina Balcan, Alina Beygelzimer, and John Langford. Agnostic active learning. Journal of Computer and System Sciences, 75(1):78–89, 2009. [8] Guillermo Barrenetxea, François Ingelrest, Gunnar Schaefer, and Martin Vetterli. The hitchhiker’s guide to successful wireless sensor network deployments. In ACM SenSys, pages 43–56, 2008. [9] Sébastien Bubeck, Nicolo Cesa-Bianchi, et al. Regret analysis of stochastic and nonstochastic multi-armed bandit problems. Foundations and Trends R⃝in Machine Learning, 5(1):1–122, 2012. [10] Lin Chen, Seyed Hamed Hassani, and Amin Karbasi. Near-optimal active learning of halfspaces via query synthesis in the noisy setting. In AAAI, pages 1798–1804, 2017. [11] Wei Chen, Yajun Wang, Yang Yuan, and Qinshi Wang. Combinatorial multi-armed bandit and its extension to probabilistically triggered arms. JMLR, 17(1):1746–1778, 2016. [12] Wei Chu, Lihong Li, Lev Reyzin, and Robert E Schapire. Contextual bandits with linear payoff functions. In AISTATS, volume 15, pages 208–214, 2011. [13] David A Cohn, Zoubin Ghahramani, and Michael I Jordan. Active learning with statistical models. In NIPS, pages 705–712, 1995. [14] Sanjoy Dasgupta. Analysis of a greedy active learning strategy. In NIPS, pages 337–344, 2005. [15] Sanjoy Dasgupta, Daniel J Hsu, and Claire Monteleoni. A general agnostic active learning algorithm. In NIPS, pages 353–360, 2008. [16] Khalid El-Arini, Gaurav Veda, Dafna Shahaf, and Carlos Guestrin. Turning down the noise in the blogosphere. In ACM SIGKDD, pages 289–298, 2009. [17] Uriel Feige. A threshold of ln n for approximating set cover. Journal of the ACM, 45(4): 634–652, 1998. [18] Thomas Gärtner. Kernels for structured data, volume 72. World Scientific, 2008. [19] Daniel Golovin and Andreas Krause. Adaptive submodularity: Theory and applications in active learning and stochastic optimization. JAIR, 42:427–486, 2011. [20] Manuel Gomez-Rodriguez, Le Song, Nan Du, Hongyuang Zha, and B. Schoelkopf. Influence estimation and maximization in continuous-time diffusion networks. ACM TOIS, 2016. [21] Aditya Grover and Jure Leskovec. node2vec: Scalable feature learning for networks. In ACM SIGKDD, pages 855–864, 2016. 10 [22] Andrew Guillory and Jeff Bilmes. Interactive submodular set cover. In ICML, Haifa, Israel, 2010. [23] Avinatan Hassidim and Yaron Singer. Submodular optimization under noise. In COLT, volume 65, pages 1069–1122, 2017. [24] Thomas Hofmann, Bernhard Schölkopf, and Alexander J Smola. Kernel methods in machine learning. The annals of statistics, pages 1171–1220, 2008. [25] Ruizhang Huang and Wai Lam. An active learning framework for semi-supervised document clustering with language modeling. Data & Knowledge Engineering, 68(1):49–67, 2009. [26] Shervin Javdani, Yuxin Chen, Amin Karbasi, Andreas Krause, Drew Bagnell, and Siddhartha S Srinivasa. Near optimal bayesian active learning for decision making. In AISTATS, pages 430–438, 2014. [27] H Tolga Kahraman, Seref Sagiroglu, and Ilhami Colak. The development of intuitive knowledge classifier and the modeling of domain dependent data. Knowledge-Based Systems, 37:283–295, 2013. [28] Amin Karbasi, Stratis Ioannidis, and laurent Massoulie. Comparison-based learning with rank nets. In ICML, pages 855–862, 2012. [29] David Kempe, Jon Kleinberg, and Éva Tardos. Maximizing the spread of influence through a social network. In ACM SIGKDD, pages 137–146, 2003. [30] Andreas Krause and Daniel Golovin. Submodular function maximization. Tractability: Practical Approaches to Hard Problems, 3(19):8, 2012. [31] Andreas Krause and Cheng S Ong. Contextual gaussian process bandit optimization. In NIPS, pages 2447–2455, 2011. [32] Andreas Krause, Carlos Guestrin, Anupam Gupta, and Jon Kleinberg. Near-optimal sensor placements: Maximizing information while minimizing communication cost. In ACM IPSN, pages 2–10, 2006. [33] Andreas Krause, Ajit Singh, and Carlos Guestrin. Near-optimal sensor placements in gaussian processes: Theory, efficient algorithms and empirical studies. JMLR, 9(Feb):235–284, 2008. [34] Siyu Lei, Silviu Maniu, Luyi Mo, Reynold Cheng, and Pierre Senellart. Online influence maximization. In ACM SIGKDD, pages 645–654, 2015. [35] Jure Leskovec and Julian J Mcauley. Learning to discover social circles in ego networks. In NIPS, pages 539–547, 2012. [36] Lihong Li, Wei Chu, John Langford, and Robert E Schapire. A contextual-bandit approach to personalized news article recommendation. In WWW, pages 661–670. ACM, 2010. [37] Tian Lin, Jian Li, and Wei Chen. Stochastic online greedy learning with semi-bandit feedbacks. In NIPS, pages 352–360, 2015. [38] Tyler Lu, Dávid Pál, and Martin Pál. Contextual multi-armed bandits. In AISTATS, pages 485–492, 2010. [39] Baharan Mirzasoleiman, Ashwinkumar Badanidiyuru, and Amin Karbasi. Fast constrained submodular maximization: Personalized data summarization. In ICML, volume 48, pages 1358–1367, 2016. [40] Baharan Mirzasoleiman, Morteza Zadimoghaddam, and Amin Karbasi. Fast distributed submodular cover: Public-private data summarization. In NIPS, pages 3594–3602, 2016. [41] George L Nemhauser and Laurence A Wolsey. Best algorithms for approximating the maximum of a submodular set function. Mathematics of operations research, 3(3):177–188, 1978. 11 [42] Lior Seeman and Yaron Singer. Adaptive seeding in social networks. In FOCS, pages 459–468, 2013. [43] Burr Settles. Active learning literature survey. University of Wisconsin, Madison, 52(55-66):11, 2010. [44] Niranjan Srinivas, Andreas Krause, Sham Kakade, and Matthias Seeger. Information-theoretic regret bounds for gaussian process optimization in the bandit setting. IEEE Transactions on Information Theory, 58(5):3250–3265, May 2012. [45] Matthew Streeter and Daniel Golovin. An online algorithm for maximizing submodular functions. In NIPS, pages 1577–1584, 2009. [46] Simon Tong and Daphne Koller. Support vector machine active learning with applications to text classification. JMLR, 2(Nov):45–66, 2001. [47] Hastagiri Vanchinathan, Andreas Marfurt, Charles-Antoine Robelin, Donald Kossmann, and Andreas Krause. Discovering valuable items from massive data. In ACM SIGKDD, 2015. [48] S. I. Wang, P. Liang, and C. Manning. Learning language games through interaction. In ACL, 2016. [49] Yizao Wang, Jean yves Audibert, and Rémi Munos. Algorithms for infinitely many-armed bandits. In NIPS, pages 1729–1736. 2009. [50] Yisong Yue and Carlos Guestrin. Linear submodular bandits and their application to diversified retrieval. In NIPS, pages 2483–2491, 2011. [51] Yuanxing Zhang, Yichong Bai, Lin Chen, Kaigui Bian, and Xiaoming Li. Influence maximization in messenger-based social networks. In GLOBECOM, pages 1–6. IEEE, 2016. [52] Jiaji Zhou, Stephane Ross, Yisong Yue, Debadeepta Dey, and J Andrew Bagnell. Knapsack constrained contextual submodular list prediction with application to multi-document summarization. In In Inferning Workshop at ICML. Citeseer, 2013. 12
2017
631
7,154
Hash Embeddings for Efficient Word Representations Dan Svenstrup Department for Applied Mathematics and Computer Science Technical University of Denmark (DTU) 2800 Lyngby, Denmark dsve@dtu.dk Jonas Meinertz Hansen FindZebra Copenhagen, Denmark jonas@findzebra.com Ole Winther Department for Applied Mathematics and Computer Science Technical University of Denmark (DTU) 2800 Lyngby, Denmark olwi@dtu.dk Abstract We present hash embeddings, an efficient method for representing words in a continuous vector form. A hash embedding may be seen as an interpolation between a standard word embedding and a word embedding created using a random hash function (the hashing trick). In hash embeddings each token is represented by k d-dimensional embeddings vectors and one k dimensional weight vector. The final d dimensional representation of the token is the product of the two. Rather than fitting the embedding vectors for each token these are selected by the hashing trick from a shared pool of B embedding vectors. Our experiments show that hash embeddings can easily deal with huge vocabularies consisting of millions of tokens. When using a hash embedding there is no need to create a dictionary before training nor to perform any kind of vocabulary pruning after training. We show that models trained using hash embeddings exhibit at least the same level of performance as models trained using regular embeddings across a wide range of tasks. Furthermore, the number of parameters needed by such an embedding is only a fraction of what is required by a regular embedding. Since standard embeddings and embeddings constructed using the hashing trick are actually just special cases of a hash embedding, hash embeddings can be considered an extension and improvement over the existing regular embedding types. 1 Introduction Contemporary neural networks rely on loss functions that are continuous in the model’s parameters in order to be able to compute gradients for training. For this reason, any data that we wish to feed through the network, even data that is of a discrete nature in its original form will be translated into a continuous form. For textual input it often makes sense to represent each distinct word or phrase with a dense real-valued vector in Rn. These word vectors are trained either jointly with the rest of the model, or pre-trained on a large corpus beforehand. For large datasets the size of the vocabulary can easily be in the order of hundreds of thousands, adding millions or even billions of parameters to the model. This problem can be especially severe when n-grams are allowed as tokens in the vocabulary. For example, the pre-trained Word2Vec vectors from Google (Miháltz, 2016) has a vocabulary consisting of 3 million words and phrases. This means that even though the embedding size is moderately small (300 dimensions), the total number of parameters is close to one billion. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. The embedding size problem caused by a large vocabulary can be solved in several ways. Each of the methods have some advantages and some drawbacks: 1. Ignore infrequent words. In many cases, the majority of a text is made up of a small subset of the vocabulary, and most words will only appear very few times (Zipf’s law (Manning et al., 1999)). By ignoring anything but most frequent words, and sometimes stop words as well, it is possible to preserve most of the text while drastically reducing the number of embedding vectors and parameters. However, for any given task, there is a risk of removing too much or to little. Many frequent words (besides stop words) are unimportant and sometimes even stop words can be of value for a particular task (e.g. a typical stop word such as “and” when training a model on a corpus of texts about logic). Conversely, for some problems (e.g. specialized domains such as medical search) rare words might be very important. 2. Remove non-discriminative tokens after training. For some models it is possible to perform efficient feature pruning based on e.g. entropy (Stolcke, 2000) or by only retaining the K tokens with highest norm (Joulin et al., 2016a). This reduction in vocabulary size can lead to a decrease in performance, but in some cases it actually avoids some over-fitting and increases performance (Stolcke, 2000). For many models, however, such pruning is not possible (e.g. for on-line training algorithms). 3. Compress the embedding vectors. Lossy compression techniques can be employed to reduce the amount of memory needed to store embedding vectors. One such method is quantization, where each vector is replaced by an approximation which is constructed as a sum of vectors from a previously determined set of centroids (Joulin et al., 2016a; Jegou et al., 2011; Gray and Neuhoff, 1998). For some problems, such as online learning, the need for creating a dictionary before training can be a nuisance. This is often solved with feature hashing, where a hash function is used to assign each token w ∈T to one of a fixed set of “buckets” {1, 2, . . . B}, each of which has its own embedding vector. Since the goal of hashing is to reduce the dimensionality of the token space T , we normally have that B ≪|T |. This results in many tokens “colliding” with each other because they are assigned to the same bucket. When multiple tokens collide, they will get the same vector representation which prevents the model from distinguishing between the tokens. Even though some information is lost when tokens collide, the method often works surprisingly well in practice (Weinberger et al., 2009). One obvious improvement to the feature hashing method described above would be to learn an optimal hash function where important tokens do not collide. However, since a hash function has a discrete codomain, it is not easy to optimize using e.g. gradient based methods used for training neural networks (Kulis and Darrell, 2009). The method proposed in this article is an extension of feature hashing where we use k hash functions instead of a single hash function, and then use k trainable parameters for each word in order to choose the “best” hash function for the tokens (or actually the best combination of hash functions). We call the resulting embedding hash embedding. As we explain in section 3, embeddings constructed by both feature hashing and standard embeddings can be considered special cases of hash embeddings. A hash embedding is an efficient hybrid between a standard embedding and an embedding created using feature hashing, i.e. a hash embedding has all of the advantages of the methods described above, but none of the disadvantages: • When using hash embeddings there is no need for creating a dictionary beforehand and the method can handle a dynamically expanding vocabulary. • A hash embedding has a mechanism capable of implicit vocabulary pruning. • Hash embeddings are based on hashing but has a trainable mechanism that can handle problematic collisions. • Hash embeddings perform something similar to product quantization. But instead of all of the tokens sharing a single small codebook, each token has access to a few elements in a very large codebook. Using a hash embedding typically results in a reduction of parameters of several orders of magnitude. Since the bulk of the model parameters often resides in the embedding layer, this reduction of 2 “horse” H2(“horse”) = H1(“horse”) = ... Hk(“horse”) = P hash functions component vectors importance parameters hash vector ˆe“horse” input token p1 “horse” p2 “horse” pk “horse” Figure 1: Illustration of how to build the hash vector for the word “horse”. The optional step of concatenating the vector of importance parameters to ˆe“horse” has been omitted. The size of component vectors in the illustration is d = 4. parameters opens up for e.g. a wider use of e.g. ensemble methods or large dimensionality of word vectors. 2 Related Work Argerich et al. (2016) proposed a type of embedding that is based on hashing and word co-occurrence and demonstrates that correlations between those embedding vectors correspond to the subjective judgement of word similarity by humans. Ultimately, it is a clever reduction in the embedding sizes of word co-occurrence based embeddings. Reisinger and Mooney (2010) and since then Huang et al. (2012) have used multiple different word embeddings (prototypes) for the same words for representing different possible meanings of the same words. Conversely, Bai et al. (2009) have experimented with hashing and treating words that co-occur frequently as the same feature in order to reduce dimensionality. Huang et al. (2013) have used bags of either bi-grams or tri-grams of letters of input words to create feature vectors that are somewhat robust to new words and minor spelling differences. Another approach employed by Zhang et al. (2015); Xiao and Cho (2016); Conneau et al. (2016) is to use inputs that represent sub-word units such as syllables or individual characters rather than words. This generally moves the task of finding meaningful representations of the text from the input embeddings into the model itself and increases the computational cost of running the models (Johnson and Zhang, 2016). Johansen et al. (2016) used a hierarchical encoding technique to do machine translation with character inputs while keeping computational costs low. 3 Hash Embeddings In the following we will go through the step by step construction of a vector representation for a token w ∈T using hash embeddings. The following steps are also illustrated in fig. 1: 1. Use k different functions H1, . . . , Hk to choose k component vectors for the token w from a predefined pool of B shared component vectors 2. Combine the chosen component vectors from step 1 as a weighted sum: ˆew = Pk i=1 pi wHi(w). pw = (p1 w, . . . , pk w)⊤∈Rk are called the importance parameters for w. 3. Optional: The vector of importance parameters for the token pw can be concatenated with ˆew in order to construct the final hash vector ew. 3 The full translation of a token to a hash vector can be written in vector notation (⊕denotes the concatenation operator): cw = (H1(w), H2(w), . . . , Hk(w))⊤ pw = (p1 w, . . . , pk w)⊤ ˆew = p⊤ wcw e⊤ w = ˆe⊤ w ⊕p⊤ w(optional) The token to component vector functions Hi are implemented by Hi(w) = ED2(D1(w)), where • D1 : T →{1, . . . K} is a token to id function. • D2 : {1, . . . , K} →{1, . . . B} is an id to bucket (hash) function. • E is a B × d matrix. If creating a dictionary beforehand is not a problem, we can use an enumeration (dictionary) of the tokens as D1. If, on the other hand, it is inconvenient (or impossible) to use a dictionary because of the size of T , we can simply use a hash function D1 : T →{1, . . . K}. The importance parameter vectors pw are represented as rows in a K × k matrix P, and the token to importance vector mapping is implemented by w →P ˆ D(w). ˆD(w) can be either equal to D1, or we can use a different hash function. In the rest of the article we will use ˆD = D1, and leave the case where ˆD ̸= D1 to future work. Based on the description above we see that the construction of hash embeddings requires the following: 1. A trainable embedding matrix E of size B × d, where each of the B rows is a component vector of length d. 2. A trainable matrix P of importance parameters of size K × k where each of the K rows is a vector of k scalar importance parameters. 3. k different hash functions H1, . . . , Hk that each uniformly assigns one of the B component vectors to each token w ∈T . The total number of trainable parameters in a hash embedding is thus equal to B · d + K · k, which should be compared to a standard embedding where the number of trainable parameters is K · d. The number of hash functions k and buckets B can typically be chosen quite small without degrading performance, and this is what can give a huge reduction in the number of parameters (we typically use k = 2 and choose K and B s.t. K > 10 · B). From the description above we also see that the computational overhead of using hash embeddings instead of standard embeddings is just a matrix multiplication of a 1×k matrix (importance parameters) with a k × d matrix (component vectors). When using small values of k, the computational overhead is therefore negligible. In our experiments, hash embeddings were actually marginally faster to train than standard embedding types for large vocabulary problems1. However, since the embedding layer is responsible for only a negligible fraction of the computational complexity of most models, using hash embeddings instead of regular embeddings should not make any difference for most models. Furthermore, when using hash embeddings it is not necessary to create a dictionary before training nor to perform vocabulary pruning after training. This can also reduce the total training time. Note that in the special case where the number of hash functions is k = 1, and all importance parameters are fixed to p1 w = 1 for all tokens w ∈T , hash embeddings are equivalent to using the hashing trick. If furthermore the number of component vectors is set to B = |T | and the hash function h1(w) is the identity function, hash embeddings are equivalent to standard embeddings. 1the small performance difference was observed when using Keras with a Tensorflow backend on a GeForce GTX TITAN X with 12 GB of memory and a Nvidia GeForce GTX 660 with 2GB memory. The performance penalty when using standard embeddings for large vocabulary problems can possibly be avoided by using a custom embedding layer, but we have not pursued this further. 4 4 Hashing theory Theorem 4.1. Let h : T →{0, . . . , K} be a hash function. Then the probability pcol that w0 ∈T collides with one or more other tokens is given by pcol = 1 −(1 −1/K)|T |−1 . (1) For large K we have the approximation pcol ≈1 −e−|T | K . (2) The expected number of tokens in collision Ctot is given by Ctot = |T |pcol . (3) Proof. This is a simple variation of the “birthday problem”. When using hashing for dimensionality reduction, collisions are unavoidable, which is the main disadvantage for feature hashing. This is counteracted by hash embeddings in two ways: First of all, for choosing the component vectors for a token w ∈T , hash embeddings use k independent uniform hash functions hi : T →{1, . . . , B} for i = 1, . . . , k. The combination of multiple hash functions approximates a single hash function with much larger range h : T → {1, . . . , Bk}, which drastically reduces the risk of total collisions. With a vocabulary of |T | = 100M, B = 1M different component vectors and just k = 2 instead of 1, the chance of a given token colliding with at least one other token in the vocabulary is reduced from approximately 1−exp −108/106 ≈1 to approximately 1 −exp −108/1012 ≈0.0001. Using more hash functions will further reduce the number of collisions. Second, only a small number of the tokens in the vocabulary are usually important for the task at hand. The purpose of the importance parameters is to implicitly prune unimportant words by setting their importance parameters close to 0. This would reduce the expected number of collisions to |Timp| · exp  −|Timp| B  where Timp ⊂T is the set of important words for the given task. The weighting with the component vector will further be able to separate the colliding tokens in the k dimensional subspace spanned by their k d dimensional embedding vectors. Note that hash embeddings consist of two layers of hashing. In the first layer each token is simply translated to an integer in {1, . . . , K} by a dictionary or a hash function D1. If D1 is a dictionary, there will of course not be any collisions in the first layer. If D1 is a random hash function then the expected number of tokens in collision will be given by equation 3. These collisions cannot be avoided, and the expected number of collisions can only be decreased by increasing K. Increasing the vocabulary size by 1 introduces d parameters in standard embeddings and only k in hash embeddings. The typical d ranges from 10 to 300, and k is in the range 1-3. This means that even when the embedding size is kept small, the parameter savings can be huge. In (Joulin et al., 2016b) for example, the embedding size is chosen to be as small as 10. In order to go from a bi-gram model to a general n-gram model the number of buckets is increased from K = 107 to K = 108. This increase of buckets requires an additional 900 million parameters when using standard embeddings, but less than 200 million when using hash embeddings with the default of k = 2 hash functions. I.e. even when the embedding size is kept extremely small, the parameter savings can be huge. 5 Experiments We benchmark hash embeddings with and without dictionaries on text classification tasks. 5.1 Data and preprocessing We evaluate hash embeddings on 7 different datasets in the form introduced by Zhang et al. (2015) for various text classification tasks including topic classification, sentiment analysis, and news categorization. All of the datasets are balanced so the samples are distributed evenly among the 5 classes. An overview of the datasets can be seen in table 1. Significant previous results are listed in table 2. We use the same experimental protocol as in (Zhang et al., 2015). We do not perform any preprocessing besides removing punctuation. The models are trained on snippets of text that are created by first converting each text to a sequence of n-grams, and from this list a training sample is created by randomly selecting between 4 and 100 consecutive n-grams as input. This may be seen as input drop-out and helps the model avoid overfitting. When testing we use the entire document as input. The snippet/document-level embedding is obtained by simply adding up the word-level embeddings. Table 1: Datasets used in the experiments, See (Zhang et al., 2015) for a complete description. #Train #Test #Classes Task AG’s news 120k 7.6k 4 English news categorization DBPedia 450k 70k 14 Ontology classification Yelp Review Polarity 560k 38k 2 Sentiment analysis Yelp Review Full 560k 50k 5 Sentiment analysis Yahoo! Answers 650k 60k 10 Topic classification Amazon Review Full 3000k 650k 5 Sentiment analysis Amazon Review Polarity 3600k 400k 2 Sentiment analysis 5.2 Training All the models are trained by minimizing the cross entropy using the stochastic gradient descentbased Adam method (Kingma and Ba, 2014) with a learning rate set to α = 0.001. We use early stopping with a patience of 10, and use 5% of the training data as validation data. All models were implemented using Keras with TensorFlow backend. The training was performed on a Nvidia GeForce GTX TITAN X with 12 GB of memory. 5.3 Hash embeddings without a dictionary In this experiment we compare the use of a standard hashing trick embedding with a hash embedding. The hash embeddings use K = 10M different importance parameter vectors, k = 2 hash functions, and B = 1M component vectors of dimension d = 20. This adds up to 40M parameters for the hash embeddings. For the standard hashing trick embeddings, we use an architecture almost identical to the one used in (Joulin et al., 2016b). As in (Joulin et al., 2016b) we only consider bi-grams. We use one layer of hashing with 10M buckets and an embeddings size of 20. This requires 200M parameters. The document-level embedding input is passed through a single fully connected layer with softmax activation. The performance of the model when using each of the two embedding types can be seen in the left side of table 2. We see that even though hash embeddings require 5 times less parameters compared to standard embeddings, they perform at least as well as standard embeddings across all of the datasets, except for DBPedia where standard embeddings perform a tiny bit better. 5.4 Hash embeddings using a dictionary In this experiment we limit the vocabulary to the 1M most frequent n-grams for n < 10. Most of the tokens are uni-grams and bi-grams, but also many tokens of higher order are present in the vocabulary. We use embedding vectors of size d = 200. The hash embeddings use k = 2 hash functions and the bucket size B is chosen by cross-validation among [500, 10K, 50K, 100K, 150K]. The maximum number of words for the standard embeddings is chosen by cross-validation among [10K, 25K, 50K, 300K, 500K, 1M]. We use a more complex architecture than in the experiment above, consisting of an embedding layer (standard or hash) followed by three dense layers with 1000 hidden units and ReLU activations, ending in a softmax layer. We use batch normalization (Ioffe and Szegedy, 2015) as regularization between all of the layers. The parameter savings for this problem are not as great as in the experiment without a dictionary, but the hash embeddings still use 3 times less parameters on average compared to a standard embedding. 6 As can be seen in table 2 the more complex models actually achieve a worse result than the simple model described above. This could be caused by either an insufficient number of words in the vocabulary or by overfitting. Note however, that the two models have access to the same vocabulary, and the vocabulary can therefore only explain the general drop in performance, not the performance difference between the two types of embedding. This seems to suggest that using hash embeddings have a regularizing effect on performance. When using a dictionary in the first layer of hashing, each vector of importance parameters will correspond directly to a unique phrase. In table 4 we see the phrases corresponding to the largest/smallest (absolute) importance values. As we would expect, large absolute values of the importance parameters correspond to important phrases. Also note that some of the n-grams contain information that e.g. the bi-gram model above would not be able to capture. For example, the bi-gram model would not be able to tell whether 4 or 5 stars had been given on behalf of the sentence “I gave it 4 stars instead of 5 stars”, but the general n-gram model would. 5.5 Ensemble of hash embeddings The number of buckets for a hash embedding can be chosen quite small without severely affecting performance. B = 500 −10.000 buckets is typically sufficient in order to obtain a performance almost at par with the best results. In the experiments using a dictionary only about 3M parameters are required in the layers on top of the embedding, while kK + Bd = 2M + B × 200 are required in the embedding itself. This means that we can choose to train an ensemble of models with small bucket sizes instead of a large model, while at the same time use the same amount of parameters (and the same training time since models can be trained in parallel). Using an ensemble is particularly useful for hash embeddings: even though collisions are handled effectively by the word importance parameters, there is still a possibility that a few of the important words have to use suboptimal embedding vectors. When using several models in an ensemble this can more or less be avoided since different hash functions can be chosen for each hash embedding in the ensemble. We use an ensemble consisting of 10 models and combine the models using soft voting. Each model use B = 50.000 and d = 200. The architecture is the same as in the previous section except that models with one to three hidden layers are used instead of just ten models with three hidden layers. This was done in order to diversify the models. The total number of parameters in the ensemble is approximately 150M. This should be compared to both the standard embedding model in section 5.3 and the standard embedding model in section 5.4 (when using the full vocabulary), both of which require ≈200M parameters. Table 2: Test accuracy (in %) for the selected datasets Without dictionary With dictionary Shallow network (section 5.3) Deep network (section 5.4) Hash emb. Std emb Hash emb. Std. emb. Ensemble AG 92.4 92.0 91.5 91.7 92.0 Amazon full 60.0 58.3 59.4 58.5 60.5 Dbpedia 98.5 98.6 98.7 98.6 98.8 Yahoo 72.3 72.3 71.3 65.8 72.9 Yelp full 63.8 62.6 62.6 61.4 62.9 Amazon pol 94.4 94.2 94.7 93.6 94.7 Yelp pol 95.9 95.5 95.8 95.0 95.7 6 Future Work Hash embeddings are complementary to other state-of-the-art methods as it addresses the problem of large vocabularies. An attractive possibility is to use hash-embeddings to create a word-level embedding to be used in a context sensitive model such as wordCNN. As noted in section 3, we have used the same token to id function D1 for both the component vectors and the importance parameters. This means that words that hash to the same bucket in the first layer get both identical component vectors and importance parameters. This effectively means that those words become indistinguishable to the model. If we instead use a different token to id function ˆD for 7 Table 3: State-of-the-art test accuracy in %. The table is split between BOW embedding approaches (bottom) and more complex rnn/cnn approaches (top). The best result in each category for each dataset is bolded. AG DBP Yelp P Yelp F Yah A Amz F Amz P char-CNN (Zhang et al., 2015) 87.2 98.3 94.7 62.0 71.2 59.5 94.5 char-CRNN (Xiao and Cho, 2016) 91.4 98.6 94.5 61.8 71.7 59.2 94.1 VDCNN (Conneau et al., 2016) 91.3 98.7 95.7 64.7 73.4 63.0 95.7 wordCNN (Johnson and Zhang, 2016) 93.4 99.2 97.1 67.6 75.2 63.8 96.2 Discr. LSTM (Yogatama et al., 2017) 92.1 98.7 92.6 59.6 73.7 Virt. adv. net. (Miyato et al., 2016) 99.2 fastText (Joulin et al., 2016b) 92.5 98.6 95.7 63.9 72.3 60.2 94.6 BoW (Zhang et al., 2015) 88.8 96.6 92.2 58.0 68.9 54.6 90.4 n-grams (Zhang et al., 2015) 92.0 98.6 95.6 56.3 68.5 54.3 92.0 n-grams TFIDF (Zhang et al., 2015) 92.4 98.7 95.4 54.8 68.5 52.4 91.5 Hash embeddings (no dict.) 92.4 98.5 95.9 63.8 72.3 60.0 94.4 Hash embeddings (dict.) 91.5 98.7 95.8 62.5 71.9 59.4 94.7 Hash embeddings (dict., ensemble) 92.0 98.8 95.7 62.9 72.9 60.5 94.7 Table 4: Words in the vocabulary with the highest/lowest importance parameters. Yelp polarity Amazon full Important tokens What_a_joke, not_a_good_experience, Great_experience, wanted_to_love, and_lacking, Awful, by_far_the_worst, gave_it_4, it_two_stars_because, 4_stars_instead_of_5, 4_stars, four_stars, gave_it_two_stars Unimportant tokens The_service_was, got_a_cinnamon, 15_you_can, while_touching, and_that_table, style_There_is that_my_wife_and_I, the_state_I, power_back_on, years_and_though, you_want_a_real_good the importance parameters, we severely reduce the chance of "total collisions". Our initial findings indicate that using a different hash function for the index of the importance parameters gives a small but consistent improvement compared to using the same hash function. In this article we have represented word vector using a weighed sum of component vectors. However, other aggregation methods are possible. One such method is simply to concatenate the (weighed) component vectors. The resulting kd-dimensional vector is then equivalent to a weighed sum of orthogonal vectors in Rkd. Finally, it might be interesting to experiment with pre-training lean, high-quality hash vectors that could be distributed as an alternative to word2vec vectors, which require around 3.5 GB of space for almost a billion parameters. 7 Conclusion We have described an extension and improvement to standard word embeddings and made an empirical comparisons between hash embeddings and standard embeddings across a wide range of classification tasks. Our experiments show that the performance of hash embeddings is always at par with using standard embeddings, and in most cases better. We have shown that hash embeddings can easily deal with huge vocabularies, and we have shown that hash embeddings can be used both with and without a dictionary. This is particularly useful for problems such as online learning where a dictionary cannot be constructed before training. Our experiments also suggest that hash embeddings have an inherent regularizing effect on performance. When using a standard method of regularization (such as L1 or L2 regularization), we start with the full parameter space and regularize parameters by pushing some of them closer to 0. This is in contrast to regularization using hash embeddings where the number of parameters (number of buckets) determines the degree of regularization. Thus parameters not needed by the model will not have to be added in the first place. The hash embedding models used in this article achieve equal or better performance than previous bag-of-words models using standard embeddings. Furthermore, in 5 of 7 datasets, the performance of hash embeddings is in top 3 of state-of-the art. 8 References Argerich, L., Zaffaroni, J. T., and Cano, M. J. (2016). Hash2vec, feature hashing for word embeddings. CoRR, abs/1608.08940. Bai, B., Weston, J., Grangier, D., Collobert, R., Sadamasa, K., Qi, Y., Chapelle, O., and Weinberger, K. (2009). Supervised semantic indexing. In Proceedings of the 18th ACM conference on Information and knowledge management, pages 187–196. ACM. Conneau, A., Schwenk, H., Barrault, L., and LeCun, Y. (2016). Very deep convolutional networks for natural language processing. CoRR, abs/1606.01781. Gray, R. M. and Neuhoff, D. L. (1998). Quantization. IEEE Trans. Inf. Theor., 44(6):2325–2383. Huang, E. H., Socher, R., Manning, C. D., and Ng, A. Y. (2012). Improving word representations via global context and multiple word prototypes. In Proceedings of the 50th Annual Meeting of the Association for Computational Linguistics: Long Papers - Volume 1, ACL ’12, pages 873–882, Stroudsburg, PA, USA. Association for Computational Linguistics. Huang, P.-S., He, X., Gao, J., Deng, L., Acero, A., and Heck, L. (2013). Learning deep structured semantic models for web search using clickthrough data. In Proceedings of the 22nd ACM International Conference on Information and Knowledge Management (CIKM), pages 2333–2338. Ioffe, S. and Szegedy, C. (2015). Batch normalization: Accelerating deep network training by reducing internal covariate shift. CoRR, abs/1502.03167. Jegou, H., Douze, M., and Schmid, C. (2011). Product quantization for nearest neighbor search. IEEE Trans. Pattern Anal. Mach. Intell., 33(1):117–128. Johansen, A. R., Hansen, J. M., Obeid, E. K., Sønderby, C. K., and Winther, O. (2016). Neural machine translation with characters and hierarchical encoding. CoRR, abs/1610.06550. Johnson, R. and Zhang, T. (2016). Convolutional neural networks for text categorization: Shallow word-level vs. deep character-level. CoRR, abs/1609.00718. Joulin, A., Grave, E., Bojanowski, P., Douze, M., Jégou, H., and Mikolov, T. (2016a). Fasttext.zip: Compressing text classification models. CoRR, abs/1612.03651. Joulin, A., Grave, E., Bojanowski, P., and Mikolov, T. (2016b). Bag of tricks for efficient text classification. CoRR, abs/1607.01759. Kingma, D. P. and Ba, J. (2014). Adam: A method for stochastic optimization. CoRR, abs/1412.6980. Kulis, B. and Darrell, T. (2009). Learning to hash with binary reconstructive embeddings. In Bengio, Y., Schuurmans, D., Lafferty, J. D., Williams, C. K. I., and Culotta, A., editors, Advances in Neural Information Processing Systems 22, pages 1042–1050. Curran Associates, Inc. Manning, C. D., Schütze, H., et al. (1999). Foundations of statistical natural language processing, volume 999. MIT Press. Miháltz, M. (2016). Google’s trained word2vec model in python. https://github.com/mmihaltz/ word2vec-GoogleNews-vectors. Accessed: 2017-02-08. Miyato, T., Dai, A. M., and Goodfellow, I. (2016). Virtual adversarial training for semi-supervised text classification. stat, 1050:25. Reisinger, J. and Mooney, R. J. (2010). Multi-prototype vector-space models of word meaning. In Human Language Technologies: The 2010 Annual Conference of the North American Chapter of the Association for Computational Linguistics, HLT ’10, pages 109–117, Stroudsburg, PA, USA. Association for Computational Linguistics. Stolcke, A. (2000). Entropy-based pruning of backoff language models. CoRR, cs.CL/0006025. Weinberger, K. Q., Dasgupta, A., Attenberg, J., Langford, J., and Smola, A. J. (2009). Feature hashing for large scale multitask learning. CoRR, abs/0902.2206. Xiao, Y. and Cho, K. (2016). Efficient character-level document classification by combining convolution and recurrent layers. CoRR, abs/1602.00367. Yogatama, D., Dyer, C., Ling, W., and Blunsom, P. (2017). Generative and discriminative text classification with recurrent neural networks. arXiv preprint arXiv:1703.01898. Zhang, X., Zhao, J. J., and LeCun, Y. (2015). Character-level convolutional networks for text classification. CoRR, abs/1509.01626. 9
2017
632
7,155
Learning Low-Dimensional Metrics Lalit Jain ⇤ University of Michigan Ann Arbor, MI 48109 lalitj@umich.edu Blake Mason ⇤ University of Wisconsin Madison, WI 53706 bmason3@wisc.edu Robert Nowak University of Wisconsin Madison, WI 53706 rdnowak@wisc.edu Abstract This paper investigates the theoretical foundations of metric learning, focused on three key questions that are not fully addressed in prior work: 1) we consider learning general low-dimensional (low-rank) metrics as well as sparse metrics; 2) we develop upper and lower (minimax) bounds on the generalization error; 3) we quantify the sample complexity of metric learning in terms of the dimension of the feature space and the dimension/rank of the underlying metric; 4) we also bound the accuracy of the learned metric relative to the underlying true generative metric. All the results involve novel mathematical approaches to the metric learning problem, and also shed new light on the special case of ordinal embedding (aka non-metric multidimensional scaling). 1 Low-Dimensional Metric Learning This paper studies the problem of learning a low-dimensional Euclidean metric from comparative judgments. Specifically, consider a set of n items with high-dimensional features xi 2 Rp and suppose we are given a set of (possibly noisy) distance comparisons of the form sign(dist(xi, xj) −dist(xi, xk)), for a subset of all possible triplets of the items. Here we have in mind comparative judgments made by humans and the distance function implicitly defined according to human perceptions of similarities and differences. For example, the items could be images and the xi could be visual features automatically extracted by a machine. Accordingly, our goal is to learn a p ⇥p symmetric positive semi-definite (psd) matrix K such that the metric dK(xi, xj) := (xi −xj)T K(xi −xj), where dK(xi, xj) denotes the squared distance between items i and j with respect to a matrix K, predicts the given distance comparisons as well as possible. Furthermore, it is often desired that the metric is low-dimensional relative to the original high-dimensional feature representation (i.e., rank(K) d < p). There are several motivations for this: • Learning a high-dimensional metric may be infeasible from a limited number of comparative judgments, and encouraging a low-dimensional solution is a natural regularization. • Cognitive scientists are often interested in visualizing human perceptual judgments (e.g., in a two-dimensional representation) and determining which features most strongly influence human perceptions. For example, educational psychologists in [1] collected comparisons between visual representations of chemical molecules in order to identify a small set of visual features that most significantly influence the judgments of beginning chemistry students. • It is sometimes reasonable to hypothesize that a small subset of the high-dimensional features dominate the underlying metric (i.e., many irrelevant features). • Downstream applications of the learned metric (e.g., for classification purposes) may benefit from robust, low-dimensional metrics. ⇤Authors contributed equally to this paper and are listed alphabetically. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. (a) A general low rank psd matrix (b) A sparse and low rank psd matrix Figure 1: Examples of K for p = 20 and d = 7. The sparse case depicts a situation in which only some of the features are relevant to the metric. With this in mind, several authors have proposed nuclear norm and `1,2 group lasso norm regularization to encourage low-dimensional and sparse metrics as in Fig. 1b (see [2] for a review). Relative to such prior work, the contributions of this paper are three-fold: 1. We develop novel upper bounds on the generalization error and sample complexity of learning lowdimensional metrics from triplet distance comparisons. Notably, unlike previous generalization bounds, our bounds allow one to easily quantify how the feature space dimension p and rank or sparsity d < p of the underlying metric impacts the sample complexity. 2. We establish minimax lower bounds for learning low-rank and sparse metrics that match the upper bounds up to polylogarithmic factors, demonstrating the optimality of learning algorithms for the first time. Moreover, the upper and lower bounds demonstrate that learning sparse (and low-rank) metrics is essentially as difficult as learning a general low-rank metric. This suggests that nuclear norm regularization may be preferable in practice, since it places less restrictive assumptions on the problem. 3. We use the generalization error bounds to obtain model identification error bounds that quantify the accuracy of the learned K matrix. This problem has received very little, if any, attention in the past and is crucial for interpreting the learned metrics (e.g., in cognitive science applications). This is a bit surprising, since the term “metric learning” strongly suggests accurately determining a metric, not simply learning a predictor that is parameterized by a metric. 1.1 Comparison with Previous Work There is a fairly large body of work on metric learning which is nicely reviewed and summarized in the monograph [2], and we refer the reader to it for a comprehensive summary of the field. Here we discuss a few recent works most closely connected to this paper. Several authors have developed generalization error bounds for metric learning, as well as bounds for downstream applications, such as classification, based on learned metrics. To use the terminology of [2], most of the focus has been on must-link/cannot-link constraints and less on relative constraints (i.e., triplet constraints as considered in this paper). Generalization bounds based on algorithmic robustness are studied in [3], but the generality of this framework makes it difficult to quantify the sample complexity of specific cases, such as low-rank or sparse metric learning. Rademacher complexities are used to establish generalization error bounds in the must-link/cannot-link situation in [4, 5, 6], but do not consider the case of relative/triplet constraints. The sparse compositional metric learning framework of [7] does focus on relative/triplet constraints and provides generalization error bounds in terms of covering numbers. However, this work does not provide bounds on the covering numbers, making it difficult to quantify the sample complexity. To sum up, prior work does not quantify the sample complexity of metric learning based on relative/triplet constraints in terms of the intrinsic problem dimensions (i.e., dimension p of the high-dimensional feature space and the dimension d of the underlying metric), there is no prior work on lower bounds, and no prior work quantifying the accuracy of learned metrics themselves (i.e., only bounds on prediction errors, not model identification errors). Finally we mention that Fazel et a.l [8] also consider the recovery of sparse and low rank matrices from linear observations. Our situation is very different, our matrices are low rank because they are sparse - not sparse and simultaneously low rank as in their case. 2 2 The Metric Learning Problem Consider n known points X := [x1, x2, . . . , xn] 2 Rp⇥n. We are interested in learning a symmetric positive semidefinite matrix K that specifies a metric on Rp given ordinal constraints on distances between the known points. Let S denote a set of triplets, where each t = (i, j, k) 2 S is drawn uniformly at random from the full set of n !n−1 2 " triplets T := {(i, j, k) : 1 i 6= j 6= k n, j < k}. For each triplet, we observe a yt 2 {±1} which is a noisy indication of the triplet constraint dK(xi, xj) < dK(xi, xk). Specifically we assume that each t has an associated probability qt of yt = −1, and all yt are statistically independent. Objective 1: Compute an estimate c K from S that predicts triplets as well as possible. In many instances, our triplet measurements are noisy observations of triplets from a true positive semi-definite matrix K⇤. In particular we assume qt > 1/2 () dK⇤(xi, xj) < dK⇤(xi, xk) . We can also assume an explicit known link function, f : R ! [0, 1], so that qt = f(dK⇤(xi, xj) − dK⇤(xi, xk)). Objective 2: Assuming an explicit known link function f estimate K⇤from S. 2.1 Definitions and Notation Our triplet observations are nonlinear transformations of a linear function of the Gram matrix G := XT KX. Indeed for any triple t = (i, j, k), define M t(K) := dK(xi, xj) −dK(xi, xk) = xT i Kxk + xT k Kxi −xT i Kxj −xT j Kxi + xT j Kxj −xT k Kxk . So for every t 2 S, yt is a noisy measurement of sign(M t(K)). This linear operator may also be expressed as a matrix M t := xixT k + xkxT i −xixT j −xjxT i + xjxT j −xkxT k , so that M t(K) = hM t, Ki = Trace(M T t K). We will use M t to denote the operator and associated matrix interchangeably. Ordering the elements of T lexicographically, we let M denote the linear map, M(K) = (M t(K)| for t 2 T ) 2 Rn( n−1 2 ) Given a PSD matrix K and a sample, t 2 S, we let `(ythM t, Ki) denote the loss of K with respect to t; e.g., the 0-1 loss {sign(ythM t,Ki)6=1}, the hinge-loss max{0, 1 −ythM t, Ki}, or the logistic loss log(1 + exp(−ythM t, Ki)). Note that we insist that our losses be functions of our triplet differences hM t, Ki. Further, note that this makes our losses invariant to rigid motions of the points xi. Other models proposed for metric learning use scale-invariant loss functions [9]. For a given loss `, we then define the empirical risk with respect to our set of observations S to be bRS(K) := 1 |S| X t2S `(ythM t, Ki). This is an unbiased estimator of the true risk R(K) := E[`(ythM t, Ki)] where the expectation is taken with respect to a triplet t selected uniformly at random and the random value of yt. Finally, we let In denote the identity matrix in Rn⇥n, 1n the n-dimensional vector of all ones and V := In −1 n1n1T n the centering matrix. In particular if X 2 Rp⇥n is a set of points, XV subtracts the mean of the columns of X from each column. We say that X is centered if XV = 0, or equivalently X1n = 0. If G is the Gram matrix of the set of points X, i.e. G = XT X, then we say that G is centered if X is centered or if equivalently, G1n = 0. Furthermore we use k · k⇤to denote the nuclear norm, and k · k1,2 to denote the mixed `1,2 norm of a matrix, the sum of the `2 norms of its rows. Unless otherwise specified, we take k · k to be the standard operator norm when applied to matrices and the standard Euclidean norm when applied to vectors. Finally we define the K-norm of a vector as kxk2 K := xT Kx. 3 2.2 Sample Complexity of Learning Metrics. In most applications, we are interested in learning a matrix K that is low-rank and positivesemidefinite. Furthermore as we will show in Theorem 2.1, such matrices can be learned using fewer samples than general psd matrices. As is common in machine learning applications, we relax the rank constraint to a nuclear norm constraint. In particular, let our constraint set be Kλ,γ = {K 2 Rp⇥p|K positive-semidefinite, kKk⇤λ, max t2T hM t, Ki γ}. Up to constants, a bound on hM t, Ki is a bound on xT i Kxi. This bound along with assuming our loss function is Lipschitz, will lead to a tighter bound on the deviation of bRS(K) from R(K) crucial in our upper bound theorem. Let K⇤ := minK2Kλ,γ R(K) be the true risk minimizer in this class, and let c K := minK2Kλ,γ bRS(K) be the empirical risk minimizer. We achieve the following prediction error bounds for the empirical risk minimzer. Theorem 2.1. Fix λ, γ, δ > 0. In addition assume that max1in kxik2 = 1. If the loss function ` is L-Lipschitz, then with probability at least 1 −δ R(c K) −R(K⇤) 4L 0 @ s 140λ2 kXXT k n log p |S| + 2 log p |S| 1 A + s 2L2γ2 log 2/δ |S| Note that past generalization error bounds in the metric learning literature have failed to quantify the precise dependence on observation noise, dimension, rank, and our features X. Consider the fact that a p ⇥p matrix with rank d has O(dp) degrees of freedom. With that in mind, one expects the sample complexity to be also roughly O(dp). We next show that this intuition is correct if the original representation X is isotropic (i.e., has no preferred direction). The Isotropic Case. Suppose that x1, · · · , xn, n > p, are drawn independently from the isotropic Gaussian N(0, 1 pI). Furthermore, suppose that K⇤= p p dUU T with U 2 Rp⇥d is a generic (dense) orthogonal matrix with unit norm columns. The factor p p d is simply the scaling needed so that the average magnitude of the entries in K⇤is a constant, independent of the dimensions p and d. In this case, rank(K⇤) = d and kK⇤kF = trace(U T U) = p. These two facts imply that the tightest bound on the nuclear norm of K⇤is kK⇤k⇤p p d. Thus, we take λ = p p d for the nuclear norm constraint. Now let zi = q p p dU T xi ⇠N(0, Id) and note that kxik2 K = kzik2 ⇠χ2 d. Therefore, Ekxik2 K = d and it follows from standard concentration bounds that with large probability maxi kxik2 K 5d log n =: γ see [10]. Also, because the xi ⇠N(0, 1 pI) it follows that if n > p log p, say, then with large probability kXXT k 5n/p. We now plug these calculations into Theorem 2.1 to obtain the following corollary. Corollary 2.1.1 (Sample complexity for isotropic points). Fix δ > 0, set λ = p p d, and assume that kXXT k = O(n/p) and γ := maxi kxik2 K = O(d log n). Then for a generic K⇤2 Kλ,γ, as constructed above, with probability at least 1 −δ, R(c K) −R(K⇤) = O 0 @ s dp(log p + log2 n) |S| 1 A This bound agrees with the intuition that the sample complexity should grow roughly like dp, the degrees of freedom on K⇤. Moreover, our minimax lower bound in Theorem 2.3 below shows that, ignoring logarithmic factors, the general upper bound in Theorem 2.1 is unimprovable in general. Beyond low rank metrics, in many applications it is reasonable to assume that only a few of the features are salient and should be given nonzero weight. Such a metric may be learned by insisting K to be row sparse in addition to being low rank. Whereas learning a low rank K assumes that distance is well represented in a low dimensional subspace, a row sparse (and hence low rank) K defines a metric using only a subset of the features. Figure 1 gives a comparison of a low rank versus a low rank and sparse matrix K. 4 Analogous to the convex relaxation of rank by the nuclear norm, it is common to relax row sparsity by using the mixed `1,2 norm. In fact, the geometry of the `1,2 and nuclear norm balls are tightly related as the following lemma shows. Lemma 2.2. For a symmetric positive semi-definite matrix K 2 Rp⇥p, kKk⇤kKk1,2. Proof. kKk1,2 = p X i=1 v u u t p X j=1 K2 i,j ≥ p X i=1 Ki,i = Trace(K) = p X i=1 λi(K) = kKk⇤ This implies that the `1,2 ball of a given radius is contained inside the nuclear norm ball of the same radius. In particular, it is reasonable to assume that it is easier to learn a K that is sparse in addition to being low rank. Surprisingly, however, the following minimax bound shows that this is not necessarily the case. To make this more precise, we will consider optimization over the set K0 λ,γ = {K 2 Rp⇥p|K positive-semidefinite, kKk1,2 λ, max t2T hM t, Ki γ}. Furthermore, we must specify the way in which our data could be generated from noisy triplet observations of a fixed K⇤. To this end, assume the existence of a link function f : R ! [0, 1] so that qt = P(yt = −1) = f(M t(K⇤)) governs the observations. There is a natural associated logarithmic loss function `f corresponding to the log-likelihood, where the loss of an arbitrary K is `f(ythM t, Ki) = {yt=−1} log 1 f(hM t, Ki) + {yt=1} log 1 1 −f(hM t, Ki) Theorem 2.3. Choose a link function f and let `f be the associated logarithmic loss. For p sufficiently large, then there exists a choice of γ, λ, X, and |S| such that inf c K sup K2K0 λ,γ E[R(c K)] −R(K) ≥C s C3 1 ln 4 2 λ2 kXXT k n |S| where C = C2 f 32 r inf|x|γ f(x)(1−f(x)) sup|⌫|γ f 0(⌫)2 with Cf = inf|x|γ f 0(x), C1 is an absolute constant, and the infimum is taken over all estimators c K of K from |S| samples. Importantly, up to polylogarithmic factors and constants, our minimax lower bound over the `1,2 ball matches the upper bound over the nuclear norm ball given in Theorem 2.1. In particular, in the worst case, learning a sparse and low rank matrix K is no easier than learning a K that is simply low rank. However in many realistic cases, a slight performance gain is seen from optimizing over the `1,2 ball when K⇤is row sparse, while optimizing over the nuclear norm ball does better when K⇤is dense. We show examples of this in the Section 3. The proof is given in the supplementary materials. Note that if γ is in a bounded range, then the constant C has little effect. For the case that f is the logistic function, Cf ≥1 4e−ythM t,Ki ≥1 4e−γ. Likewise, the term under the root will be also be bounded for γ in a constant range. The terms in the constant C arise when translating from risk and a KL-divergence to squared distance and reflects the noise in the problem. 2.3 Sample Complexity Bounds for Identification Under a general loss function and arbitrary K⇤, we can not hope to convert our prediction error bounds into a recovery statement. However in this section we will show that as long as K⇤is low rank, and if we choose the loss function to be the log loss `f of a given link function f as defined prior to the statement of Theorem 2.3, recovery is possible. Firstly, note that under these assumptions we have an explicit formula for the risk, R(K) = 1 |T | X t2T f(hM t, K⇤i) log 1 f(hM t, Ki) + (1 −f(hM t, K⇤i)) log 1 1 −f(hM t, Ki) 5 and R(K) −R(K⇤) = 1 |T | X t2T KL(f(hM t, K⇤i)||f(hM t, Ki)). The following theorem shows that if the excess risk is small, i.e. R(c K) approximates R(K⇤) well, then M(c K) approximates M(K⇤) well. The proof, given in the supplementary materials, uses standard Taylor series arguments to show the KL-divergence is bounded below by squared-distance. Lemma 2.4. Let Cf = inf|x|γ f 0(x). Then for any K 2 Kλ,γ, 2C2 f |T | kM(K) −M(K⇤)k2 R(K) −R(K⇤). The following may give us hope that recovering K⇤from M(K⇤) is trivial, but the linear operator M is non-invertible in general, as we discuss next. To see why, we must consider a more general class of operators defined on Gram matrices. Given a symmetric matrix G, define the operator Lt by Lt(G) = 2Gik −2Gij + Gjj −Gkk If G = XT KX then Lt(G) = M t(K), and more so M t = XLtXT . Analogous to M, we will combine the Lt operators into a single operator L, L(G) = (Lt(G)| for t 2 T ) 2 Rn( n−1 2 ). Lemma 2.5. The null space of L is one dimensional, spanned by V = In −1 n1n1T n. The proof is contained in the supplementary materials. In particular we see that M is not invertible in general, adding a serious complication to our argument. However L is still invertible on the subset of centered symmetric matrices orthogonal to V , a fact that we will now exploit. We can decompose G into V and a component orthogonal to V denoted H, G = H + σGV where σG := hG,V i kV k2 F , and under the assumption that G is centered, σG = kGk⇤ n−1 . Remarkably, the following lemma tells us that a non-linear function of H uniquely determines G. Lemma 2.6. If n > d + 1, and G is rank d and centered, then −σG is an eigenvalue of H with multiplicity n −d −1. In addition, given another Gram matrix G0 of rank d0, σG0 −σG is an eigenvalue of H −H0 with multiplicity at least n −d −d0 −1. Proof. Since G is centered, 1n 2 ker G, and in particular dim(1? n \ ker G) = n −d −1. If x 2 1? n \ ker G, then Gx = Hx + σGV x ) Hx = −σGx. For the second statement, notice that dim(1? n \ ker G −G0) ≥n −d −d0 −1. A similar argument then applies. If n > 2d, then the multiplicity of the eigenvalue −σG is at least n/2. So we can trivially identify it from the spectrum of H. This gives us a non-linear way to recover G from H. Now we can return to the task of recovering K⇤from M(c K). Indeed the above lemma implies that G⇤(and hence K⇤if X is full rank) can be recovered from H⇤by computing an eigenvalue of H⇤. However H⇤is recoverable from L(H⇤), which is itself well approximated by L(c H) = M(c K). The proof of the following theorem makes this argument precise. Theorem 2.7. Assume that K⇤is rank d, c K is rank d0, n > d + d0 + 1, X is rank p and XT K⇤X and XT c KX are all centered. Let Cd,d0 = ⇣ 1 + n−1 (n−d−d0−1) ⌘ . Then with probability at least 1 −δ, nσmin(XXT )2 |T | kc K −K⇤k2 F 2LCd,d0 C2 f 2 4 0 @ s 140λ2 kXXT k n log p |S| + 2 log p |S| 1 A + s 2L2γ2 log 2 δ |S| 3 5 where σmin(XXT ) is the smallest eigenvalue of XXT . 6 The proof, given in the supplementary materials, relies on two key components, Lemma 2.6 and a type of restricted isometry property for M on V ?. Our proof technique is a streamlined and more general approach similar to that used in the special case of ordinal embedding. In fact, our new bound improves on the recovery bound given in [11] for ordinal embedding. We have several remarks about the bound in the theorem. If X is well conditioned, e.g. isotropic, then σmin(XXT ) ⇡n p . In that case nσmin(XXT )2 |T | ⇡ 1 p2 , so the left hand side is the average squared error of the recovery. In most applications the rank of the empirical risk minimizer c K is approximately equal to the rank of K⇤, i.e. d ⇡d0. Note that If d + d0 1 2(n −1) then Cd,d0 3. Finally, the assumption that XT K⇤X are centered can be guaranteed by centering X, which has no impact on the triplet differences hM t, K⇤i, or insisting that K⇤is centered. As mentioned above Cf will be have little effect assuming that our measurements hM t, Ki are bounded. 2.4 Applications to Ordinal Embedding In the ordinal embedding setting, there are a set of items with unknown locations, z1, · · · , zn 2 Rd and a set of triplet observations S where as in the metric learning case observing yt = −1, for a triplet t = (i, j, k) is indicative of the kzi −zjk2 kzi −zkk2, i.e. item i is closer to j than k. The goal is to recover the zi’s, up to rigid motions, by recovering their Gram matrix G⇤from these comparisons. Ordinal embedding case reduces to metric learning through the following observation. Consider the case when n = p and X = Ip, i.e. the xi are standard basis vectors. Letting K⇤= G⇤, we see that kxi −xjk2 K = kzi −zjk2. So in particular, Lt = M t for each triple t, and observations are exactly comparative distance judgements. Our results then apply, and extend previous work on sample complexity in the ordinal embedding setting given in [11]. In particular, though Theorem 5 in [11] provides a consistency guarantee that the empirical risk minimizer bG will converge to G⇤, they do not provide a convergence rate. We resolve this issue now. In their work, it is assumed that kzik2 γ and kGk⇤ p dnγ. In particular, sample complexity results of the form O(dnγ log n) are obtained. However, these results are trivial in the following sense, if kzik2 γ then kGk⇤γn, and their results (as well as our upper bound) implies that true sample complexity is significantly smaller, namely O(γn log n) which is independent of the ambient dimension d. As before, assume an explicit link function f with Lipschitz constant L, so the samples are noisy observations governed by G⇤, and take the loss to be the logarithmic loss associated to f. We obtain the following improved recovery bound in this case. The proof is immediate from Theorem 2.7. Corollary 2.7.1. Let G⇤be the Gram matrix of n centered points in d dimensions with kG⇤k2 F = γ2n2 d . Let bG = minkGk⇤γn,kGk1γ RS(G) and assume that bG is rank d, with n > 2d + 1. Then, k bG −G⇤k2 F n2 = O LCd,d C2 f s γn log n |S| ! 3 Experiments To validate our complexity and recovery guarantees, we ran the following simulations. We generate x1, · · · , xn iid ⇠N(0, 1 pI), with n = 200, and K⇤= p p dUU T for a random orthogonal matrix U 2 Rp⇥d with unit norm columns. In Figure 2a, K⇤has d nonzero rows/columns. In Figure 2b, K⇤is a dense rank-d matrix. We compare the performance of nuclear norm and `1,2 regularization in each setting against an unconstrained baseline where we only enforce that K be psd. Given a fixed number of samples, each method is compared in terms of the relative excess risk, R(c K)−R(K⇤) R(K⇤) , and the relative squared recovery error, kc K−K⇤k2 F kK⇤k2 F , averaged over 20 trials. The y-axes of both plots have been trimmed for readability. In the case that K⇤is sparse, `1,2 regularization outperforms nuclear norm regularization. However, in the case of dense low rank matrices, nuclear norm reularization is superior. Notably, as expected from our upper and lower bounds, the performances of the two approaches seem to be within constant 7 factors of each other. Therefore, unless there is strong reason to believe that the underlying K⇤is sparse, nuclear norm regularization achieves comparable performance with a less restrictive modeling assumption. Furthermore, in the two settings, both the nuclear norm and `1,2 constrained methods outperform the unconstrained baseline, especially in the case where K⇤is low rank and sparse. To empirically validate our sample complexity results, we compute the number of samples averaged over 20 runs to achieve a relative excess risk of less than 0.1 in Figure 3. First, we fix p = 100 and increment d from 1 to 10. Then we fix d = 10 and increment p from 10 to 100 to clearly show the linear dependence of the sample complexity on d and p as demonstrated in Corollary 2.1.1. To our knowledge, these are the first results quantifying the sample complexity in terms of the number of features, p, and the embedding dimension, d. (a) Sparse low rank metric (b) Dense low rank metric Figure 2: `1,2 and nuclear norm regularization performance (a) d varying (b) p varying Figure 3: Number of samples to achieve relative excess risk < 0.1 Acknowledgments This work was partially supported by the NSF grants CCF-1218189 and IIS1623605 8 References [1] Martina A Rau, Blake Mason, and Robert D Nowak. How to model implicit knowledge? similarity learning methods to assess perceptions of visual representations. In Proceedings of the 9th International Conference on Educational Data Mining, pages 199–206, 2016. [2] Aurélien Bellet, Amaury Habrard, and Marc Sebban. Metric learning. Synthesis Lectures on Artificial Intelligence and Machine Learning, 9(1):1–151, 2015. [3] Aurélien Bellet and Amaury Habrard. Robustness and generalization for metric learning. Neurocomputing, 151:259–267, 2015. [4] Zheng-Chu Guo and Yiming Ying. Guaranteed classification via regularized similarity learning. Neural Computation, 26(3):497–522, 2014. [5] Yiming Ying, Kaizhu Huang, and Colin Campbell. Sparse metric learning via smooth optimization. In Advances in neural information processing systems, pages 2214–2222, 2009. [6] Wei Bian and Dacheng Tao. Constrained empirical risk minimization framework for distance metric learning. IEEE transactions on neural networks and learning systems, 23(8):1194–1205, 2012. [7] Yuan Shi, Aurélien Bellet, and Fei Sha. Sparse compositional metric learning. arXiv preprint arXiv:1404.4105, 2014. [8] Samet Oymak, Amin Jalali, Maryam Fazel, Yonina C Eldar, and Babak Hassibi. Simultaneously structured models with application to sparse and low-rank matrices. IEEE Transactions on Information Theory, 61(5):2886–2908, 2015. [9] Eric Heim, Matthew Berger, Lee Seversky, and Milos Hauskrecht. Active perceptual similarity modeling with auxiliary information. arXiv preprint arXiv:1511.02254, 2015. [10] Kenneth R Davidson and Stanislaw J Szarek. Local operator theory, random matrices and banach spaces. Handbook of the geometry of Banach spaces, 1(317-366):131, 2001. [11] Lalit Jain, Kevin G Jamieson, and Rob Nowak. Finite sample prediction and recovery bounds for ordinal embedding. In Advances In Neural Information Processing Systems, pages 2703–2711, 2016. [12] Mark A Davenport, Yaniv Plan, Ewout Van Den Berg, and Mary Wootters. 1-bit matrix completion. Information and Inference: A Journal of the IMA, 3(3):189–223, 2014. [13] Joel A. Tropp. An introduction to matrix concentration inequalities, 2015. [14] Felix Abramovich and Vadim Grinshtein. Model selection and minimax estimation in generalized linear models. IEEE Transactions on Information Theory, 62(6):3721–3730, 2016. [15] Florentina Bunea, Alexandre B Tsybakov, Marten H Wegkamp, et al. Aggregation for gaussian regression. The Annals of Statistics, 35(4):1674–1697, 2007. [16] Philippe Rigollet and Alexandre Tsybakov. Exponential screening and optimal rates of sparse estimation. The Annals of Statistics, pages 731–771, 2011. [17] Jon Dattorro. Convex Optimization & Euclidean Distance Geometry. Meboo Publishing USA, 2011. 9
2017
633
7,156
Unsupervised Sequence Classification using Sequential Output Statistics Yu Liu †, Jianshu Chen ⇤, and Li Deng† ⇤Microsoft Research, Redmond, WA 98052, USA⇤ jianshuc@microsoft.com † Citadel LLC, Seattle/Chicago, USA† Li.Deng@citadel.com Abstract We consider learning a sequence classifier without labeled data by using sequential output statistics. The problem is highly valuable since obtaining labels in training data is often costly, while the sequential output statistics (e.g., language models) could be obtained independently of input data and thus with low or no cost. To address the problem, we propose an unsupervised learning cost function and study its properties. We show that, compared to earlier works, it is less inclined to be stuck in trivial solutions and avoids the need for a strong generative model. Although it is harder to optimize in its functional form, a stochastic primal-dual gradient method is developed to effectively solve the problem. Experiment results on real-world datasets demonstrate that the new unsupervised learning method gives drastically lower errors than other baseline methods. Specifically, it reaches test errors about twice of those obtained by fully supervised learning. 1 Introduction Unsupervised learning is one of the most challenging problems in machine learning. It is often formulated as the modeling of how the world works without requiring a huge amount of human labeling effort, e.g. [8]. To reach this grand goal, it is necessary to first solve a sub-goal of unsupervised learning with high practical value; that is, learning to predict output labels from input data without requiring costly labeled data. Toward this end, we study in this paper the learning of a sequence classifier without labels by using sequential output statistics. The problem is highly valuable since the sequential output statistics, such as language models, could be obtained independently of the input data and thus with no labeling cost. The problem we consider here is different from most studies on unsupervised learning, which concern automatic discovery of inherent regularities of the input data to learn their representations [13, 28, 18, 17, 5, 1, 31, 20, 14, 12]. When these methods are applied in prediction tasks, either the learned representations are used as feature vectors [22] or the learned unsupervised models are used to initialize a supervised learning algorithm [9, 18, 2, 24, 10]. In both ways, the above unsupervised methods played an auxiliary role in helping supervised learning when it is applied to prediction tasks. Recently, various solutions have been proposed to address the input-to-output prediction problem without using labeled training data, all without demonstrated successes [11, 30, 7]. Similar to this work, the authors in [7] proposed an unsupervised cost that also exploits the sequence prior of the output samples to train classifiers. The power of such a strong prior in the form of language ⇤All the three authors contributed equally to the paper. †The work was done while Yu Liu and Li Deng were at Microsoft Research. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. models in unsupervised learning was also demonstrated in earlier studies in [21, 3]. However, these earlier methods did not perform well in practical prediction tasks with real-world data without using additional strong generative models. Possible reasons are inappropriately formulated cost functions and inappropriate choices of optimization methods. For example, it was shown in [7] that optimizing the highly non-convex unsupervised cost function could easily get stuck in trivial solutions, although adding a special regularization mitigated the problem somewhat. The solution provided in this paper fundamentally improves these prior works in [11, 30, 7] in following aspects. First, we propose a novel cost function for unsupervised learning, and find that it has a desired coverage-seeking property that makes the learning algorithm less inclined to be stuck in trivial solutions than the cost function in [7]. Second, we develop a special empirical formulation of this cost function that avoids the need for a strong generative model as in [30, 11].3 Third, although the proposed cost function is more difficult to optimize in its functional form, we develop a stochastic primal-dual gradient (SPDG) algorithm to effectively solve problem. Our analysis of SPDG demonstrates how it is able to reduce the high barriers in the cost function by transforming it into a primal-dual domain. Finally and most importantly, we demonstrate the new cost function and the associated SPDG optimization algorithm work well in two real-world classification tasks. In the rest of the paper, we proceed to demonstrate these points and discuss related works along the way. 2 Empirical-ODM: An unsupervised learning cost for sequence classifiers In this section, we extend the earlier work of [30] and propose an unsupervised learning cost named Empirical Output Distribution Match (Empirical-ODM) for training classifiers without labeled data. We first formulate the unsupervised learning problem with sequential output structures. Then, we introduce the Empirical-ODM cost and discuss its important properties that are closely related to unsupervised learning. 2.1 Problem formulation We consider the problem of learning a sequence classifier that predicts an output sequence (y1, . . . , yT0) from an input sequence (x1, . . . , xT0) without using labeled data, where T0 denotes the length of the sequence. Specifically, the learning algorithm does not have access to a labeled training set DXY , {(xn 1, . . . , xn Tn), (yn 1 , . . . , yn Tn) : n = 1, . . . , M}, where Tn denotes the length of the n-th sequence. Instead, what is available is a collection of input sequences, denoted as DX , {(xn 1, . . . , xn Tn) : n = 1, . . . , M}. In addition, we assume that the sequential output statistics (or sequence prior), in the form of an N-gram probability, are available: pLM(i1, . . . , iN) , pLM(yn t−N+1 = i1, . . . , yn t = iN) where i1, . . . , iN 2 {1, . . . , C} and the subscript “LM” stands for language model. Our objective is to train the sequence classifier by just using DX and pLM(·). Note that the sequence prior pLM(·), in the form of language models, is a type of structure commonly found in natural language data, which can be learned from a large amount of text data freely available without labeling cost. For example, in optical character recognition (OCR) tasks, yn t could be an English character and xn t is the input image containing this character. We can estimate an N-gram character-level language model pLM(·) from a separate text corpus. Therefore, our learning algorithm will work in a fully unsupervised manner, without any human labeling cost. In our experiment section, we will demonstrate the effectiveness of our method on such a real OCR task. Other potential applications include speech recognition, machine translation, and image/video captioning. In this paper, we focus on the sequence classifier in the form of p✓(yn t |xn t ) that is, it computes the posterior probability p✓(yn t |xn t ) only based on the current input sample xn t in the sequence. Furthermore, we restrict our choice of p✓(yn t |xn t ) to be linear classifiers4 and focus our attention on designing and understanding unsupervised learning costs and methods for label-free prediction. In 3The work [11] only proposed a conceptual idea of using generative models to integrate the output structure and the output-to-input structure for unsupervised learning in speech recognition. Specifically, the generative models are built from the domain knowledge of speech waveform generation mechanism. No mathematical formulation or successful experimental results are provided in [11]. 4p✓(yn t = i|xn t ) = eγwT i xn t /PC j=1 eγwT j xn t , where the model parameter is ✓, {wi 2 Rd, i = 1, . . . , C}. 2 fact, as we will show in later sections, even with linear models, the unsupervised learning problem is still highly nontrivial and the cost function is also highly non-convex. And we emphasize that developing a successful unsupervised learning approach for linear classifiers, as we do in this paper, provides important insights and is an important first step towards more advanced nonlinear models (e.g., deep neural networks). We expect that, in future work, the insights obtained here could help us generalize our techniques to nonlinear models. A recent work that shares the same motivations as our work is [29], which also recognizes the high cost of obtaining labeled data and seeks label-free prediction. Different from our setting, they exploit domain knowledge from laws of physics in computer vision applications, whereas our approach exploits sequential statistics in the natural language outputs. Finally, our problem is fundamentally different from the sequence transduction method in [15], although it also exploits language models for sequence prediction. Specifically, the method in [15] is a fully supervised learning in that it requires supervision at the sequence level; that is, for each input sequence, a corresponding output sequence (of possibly different length) is provided as a label. The use of language model in [15] only serves the purpose of regularization in the sequence-level supervised learning. In stark contrast, the unsupervised learning we propose does not require supervision at any level including specifically the sequence level; we do not need the sequence labels but only the prior distribution pLM(·) of the output sequences. 2.2 The Empirical-ODM We now introduce an unsupervised learning cost that exploits the sequence structure in pLM(·). It is mainly inspired by the approach to breaking the Caesar cipher, one of the simplest forms of encryption [23]. Caesar cipher is a substitution cipher where each letter in the original message is replaced with a letter corresponding to a certain number of letters up or down in the alphabet. For example, the letter “D” is replaced by the letter “A”, the letter “E” is replaced by the letter “B”, and so on. In this way, the original message that was readable ends up being less understandable. The amount of this shifting is also known to the intended receiver of the message, who can decode the message by shifting back each letter in the encrypted message. However, Caesar cipher could also be broken by an unintended receiver (not knowing the shift) when it analyzes the frequencies of the letters in the encrypted messages and matches them up with the letter distribution of the original text [4, pp.9-11]. More formally, let yt = f(xt) denote a function that maps each encrypted letter xt into an original letter yt. And let pLM(i) , pLM(yt = i) denote the prior letter distribution of the original message, estimated from a regular text corpus. When f(·) is constructed in a way that all mapped letters {yt : yt = f(xt), t = 1, . . . , T} have the same distribution as the prior pLM(i), it is able to break the Caesar cipher and recover the original letters at the mapping outputs. Inspired by the above approach, the posterior probability p✓(yn t |xn t ) in our classification problem can be interpreted as a stochastic mapping, which maps each input vector xn t (the “encrypted letter”) into an output vector yn t (the “original letter”) with probability p✓(yn t |xn t ). Then in a samplewise manner, each input sequence (xn 1, . . . , xn Tn) is stochastically mapped into an output sequence (yn 1 , . . . , yn Tn). We move a step further than the above approach by requiring that the distribution of the N-grams among all the mapped output sequences are close to the prior N-gram distribution pLM(i1, . . . , iN). With this motivation, we propose to learn the classifier p✓(yt|xt) by minimizing the cross entropy between the prior distribution and the expected N-gram frequency of the output sequences: min ✓ ⇢ J (✓) , − X i1,...,iN pLM(i1, . . . , iN) ln p✓(i1, . . . , iN) # (1) where p✓(i1, . . . , iN) denotes the expected frequency of a given N-gram (i1, . . . , iN) among all the output sequences. In Appendix B of the supplementary material, we derive its expression as p✓(i1, . . . , iN) , 1 T M X n=1 Tn X t=1 N−1 Y k=0 p✓(yn t−k = iN−k|xn t−k) (2) where T , T1 + · · · + TM is the total number of samples in all sequences. Note that minimizing the cross entropy in (1) is also equivalent to minimizing the Kullback-Leibler (KL) divergence between the two distributions since they only differ by a constant term, P pLM ln pLM. Therefore, the cost function (1) seeks to estimate ✓by matching the two output distributions, where the expected N-gram 3 distribution in (2) is an empirical average over all the samples in the training set. For this reason, we name the cost (1) as Empirical Output Distribution Match (Empirical-ODM) cost. In [30], the authors proposed to minimize an output distribution match (ODM) cost, defined as the KL-divergence between the prior output distribution and the marginalized output distribution, D(pLM(y)||p✓(y)), where p✓(y) , R p✓(y|x)p(x)dx. However, evaluating p✓(y) requires integrating over the input space using a generative model p(x). Due to the lack of such a generative model, they were not able to optimize this proposed ODM cost. Instead, alternative approaches such as Dual autoencoders and GANs were proposed as heuristics. Their results were not successful without using a few labeled data. Our proposed Empirical-ODM cost is different from the ODM cost in [30] in three key aspects. (i) We do not need any labeled data for training. (ii) We exploit sequence structure of output statistics, i.e., in our case y = (y1, . . . , yN) (N-gram) whereas in [30] y = yt (unigram, i.e., no sequence structure). This is crucial in developing a working unsupervised learning algorithm. The change from unigram to N-gram allows us to explicitly exploit the sequence structures at the output, which makes the technique from non-working to working (see Table 2 in Section 4). It might also explain why the method in [30] failed as it does not exploit the sequence structure. (iii) We replace the marginalized distribution p✓(y) by the expected N-gram frequency in (2). This is critical in that it allows us to directly minimize the divergence between two output distributions without the need for a generative model, which [30] could not do. In fact, we can further show that p✓(i1, . . . , iN) is an empirical approximation of p✓(y) with y = (y1, . . . , yN) (see Appendix B.2 of the supplementary material). In this way, our cost (1) can be understood as an N-gram and empirical version of the ODM cost except for an additive constant, i.e., y is replaced by y = (y1, . . . , yN) and p✓(y) is replaced by its empirical approximation. 2.3 Coverage-seeking versus mode-seeking We now discuss an important property of the proposed Empirical-ODM cost (1) by comparing it with the cost proposed in [7]. We show that the Empirical-ODM cost has a coverage-seeking property, which makes it more suitable for unsupervised learning than the mode-seeking cost in [7]. In [7], the authors proposed the expected negative log-likelihood as the unsupervised learning cost function that exploits the output sequential statistics. The intuition was to maximize the aggregated log-likelihood of all the output sequences assumed to be generated by the stochastic mapping p✓(yn t |xn t ). We show in Appendix A of the supplementary material that their cost is equivalent to − X i1,...,iN−1 X iN p✓(i1, . . . , iN) ln pLM(iN|iN−1, . . . , i1) (3) where pLM(iN|iN−1, . . . , i1) , p(yn t = iN|yn t−1 = iN−1, . . . , yn t−N+1 = i1), and the summations are over all possible values of i1, . . . , iN 2 {1, . . . , C}. In contrast, we can rewrite our cost (1) as − X i1,...,iN−1 pLM(i1, . . . , iN−1) · X iN pLM(iN|iN−1, . . . , i1) ln p✓(i1, . . . , iN) (4) where we used the chain rule of conditional probabilities. Note that both costs (3) and (4) are in a cross entropy form. However, a key difference is that the positions of the distributions p✓(·) and pLM(·) are swapped. We show that the cost in the form of (3) proposed in [7] is a mode-seeking divergence between two distributions, while by swapping p✓(·) and pLM(·), our cost in (4) becomes a coverage-seeking divergence (see [25] for a detailed discussion on divergences with these two different behaviors). To understand this, we consider the following two situations: • If pLM(iN|iN−1, . . . , i1) ! 0 and p✓(i1, . . . , iN) > 0 for a certain (i1, . . . , iN), the cross entropy in (3) goes to +1 and the cross entropy in (4) approaches zero. • If pLM(iN|iN−1, . . . , i1) > 0 and p✓(i1, . . . , iN) ! 0 for a certain (i1, . . . , iN), the cross entropy in (3) approaches zero and the cross entropy in (4) goes to +1. Therefore, the cost function (3) will heavily penalize the classifier if it predicts an output that is believed to be less probable by the prior distribution pLM(·), and it will not penalize the classifier when it does not predict an output that pLM(·) believes to be probable. That is, the classifier is encouraged to predict a single output mode with high probability in pLM(·), a behavior called “mode-seeking” in [25]. This probably explains the phenomena observed in [7]: the training process easily converges to 4 (a) (b) (c) Figure 1: The profiles of J (✓) for the OCR dataset on a two-dimensional affine space passing through the supervised solution. The three figures show the same profile from different angles, where the red dot is the supervised solution. The contours of the profiles are shown at the bottom. a trivial solution of predicting the same output that has the largest probability in pLM(·). In contrast, the cost (4) will heavily penalize the classifier if it does not predict the output for which pLM(·) is positive, and will penalize less if it predicts outputs for which pLM(·) is zero. That is, this cost will encourage p✓(y|x) to cover as much of pLM(·) as possible, a behavior called “coverage-seeking” in [25]. Therefore, training the classifier using (4) will make it less inclined to learn trivial solutions than that in [7] since it will be heavily penalized. We will verify this fact in our experiment section 4. In addition, the coverage-seeking property could make the learning less sensitive to the sparseness of language models (i.e., pLM is zero for some N-grams) since the cost will not penalize these N-grams. In summary, our proposed cost (1) is more suitable for unsupervised learning than that in [7]. 2.4 The difficulties of optimizing J (✓) However, there are two main challenges of optimizing the Empirical-ODM cost J (✓) in (1). The first one is that the sample average (over the entire training data set) in the expression of p✓(·) (see (2)) is inside the logarithmic loss, which is different from traditional machine learning problems where the average is outside loss functions (e.g., P t ft(✓)). This functional form prevents us from applying stochastic gradient descent (SGD) to minimize (1) as the stochastic gradients would be intrinsically biased (see Appendix C for a detailed discussion and see section 4 for the experiment results). The second challenge is that the cost function J (✓) is highly non-convex even with linear classifiers. To see this, we visualize the profile of the cost function J (✓) (restricted to a two-dimensional sub-space) around the supervised solution in Figure 1.56 We observe that there are local optimal solutions and there are high barriers between the local and global optimal solutions. Therefore, besides the difficulty of having the sample average inside the logarithmic loss, minimizing this cost function directly will be difficult since crossing the high barriers to reach the global optimal solution would be hard if not properly initialized. 3 The Stochastic Primal-Dual Gradient (SPDG) Algorithm To address the first difficulty in Section 2.4, we transform the original cost (1) into an equivalent min-max problem in order to bring the sample average out of the logarithmic loss. Then, we could obtain unbiased stochastic gradients to solve the problem. To this end, we first introduce the concept of convex conjugate functions. For a given convex function f(u), its convex conjugate function f ?(⌫) is defined as f ?(⌫) , supu(⌫T u −f(u)) [6, pp.90-95], where u and ⌫are called primal and dual variables, respectively. For a scalar function f(u) = −ln u, its conjugate function can be calculated as f ?(⌫) = −1 −ln(−⌫) with ⌫< 0. Furthermore, it holds that f(u) = sup⌫(uT ⌫−f ?(⌫)), by 5The approach to visualizing the profile is explained with more detail in Appendix F. More slices and a video of the profiles from many angles can be found in the supplementary material. 6Note that the supervised solution (red dot) coincides with the global optimal solution of J (✓). The intuition for this is that the classifier trained by supervised learning should also produce output N-gram distribution that is close to the prior marginal output N-gram distribution given by pLM(·). 5 Algorithm 1 Stochastic Primal-Dual Gradient Method 1: Input data: DX = {(xn 1, . . . , xn Tn) : n = 1, . . . , M} and pLM(i1, . . . , iN). 2: Initialize ✓and V where the elements of V are negative 3: repeat 4: Randomly sample a mini-batch of B subsequences of length N from all the sequences in the training set DX, i.e., B = {(xnm tm−N+1, . . . , xnm tm )}B m=1. 5: Compute the stochastic gradients for each subsequence in the mini-batch and average them ∆✓= 1 B B X m=1 @Lnm tm @✓ , ∆V = 1 B B X m=1 @Lnm tm @V + @ @V X i1...iN pLM(i1,. . ., iN) ln(−⌫i1,...,iN) 6: Update ✓and V according to ✓ ✓−µ✓∆✓and V V + µv∆V . 7: until convergence or a certain stopping condition is met which we have −ln u = max⌫(u⌫+1+ln(−⌫)).7 Substituting it into (1), the original minimization problem becomes the following equivalent min-max problem: min ✓ max {⌫i1,...,iN <0} ⇢ L(✓, V ) , 1 T M X n=1 Tn X t=1 Ln t (✓, V ) + X i1,...,iN pLM(i1, . . . , iN) ln(−⌫i1,...,iN ) # (5) where V , {⌫i1,...,iN } is a collection of all the dual variables ⌫i1,...,iN , and Ln t (✓, V ) is the t-th component function in the n-th sequence, defined as Ln t (✓, V ) , X i1,...,iN pLM(i1, . . . , iN)⌫i1,...,iN N−1 Y k=0 p✓(yn t−k =iN−k|xn t−k) In the equivalent min-max problem (5), we find the optimal solution (✓?, V ?) by minimizing L with respect to the primal variable ✓and maximizing L with respect to the dual variable V . The obtained optimal solution to (5), (✓?, V ?), is called the saddle point of L [6]. Once it is obtained, we only keep ✓?, which is also the optimal solution to (1) and thus the model parameter. We further note that the equivalent min-max problem (5) is now in a form that sums over T = T1 + · · · + TM component functions Ln t (✓, V ). Therefore, the empirical average has been brought out of the logarithmic loss and we are ready to apply stochastic gradient methods. Specifically, we minimize L with respect to the primal variable ✓by stochastic gradient descent and maximize L with respect to the dual variable V by stochastic gradient ascent. Therefore, we name the algorithm stochastic primal-dual gradient (SPDG) method (see its details in Algorithm 1). We implement the SPDG algorithm in TensorFlow, which automatically computes the stochastic gradients.8 Finally, the constraint on dual variables ⌫i1,...,iN are automatically enforced by the inherent log-barrier, ln(−⌫i1,...,iN ), in (5) [6]. Therefore, we do not need a separate method to enforce the constraint. We now show that the above min-max (primal-dual) reformulation also alleviates the second difficulty discussed in Section 2.4. Similar to the case of J (✓), we examine the profile of L(✓, V ) in (5) (restricted to a two-dimensional sub-space) around the optimal (supervised) solution in Figure 2a (see Appendix F for the visualization details). Comparing Figure 2a to Figure 1, we observe that the profile of L(✓, V ) is smoother than that of J (✓) and the barrier is significantly lower. To further compare J (✓) and L(✓, V ), we plot in Figure 2b the values of J (✓) and L(✓, V ) along the same line of ✓? + λp(✓1 −✓?) for different λp. It shows that the barrier of L(✓, V ) along the primal direction is lower than that in J (✓). These observations imply that the reformulated min-max problem (5) is better conditioned than the original problem (1), which further justifies the use of SPDG method. 7The supremum is attainable and is thus replaced by maximum. 8The code will be released soon. 6 (a) (b) Figure 2: The profiles of L(✓, V ) for the OCR dataset. (a) The profile on a two-dimensional affine space passing through the optimal solution (red dot). (b) The profile along the line of ✓? +λp(✓1 −✓?) for different values of λp 2 R, where the circles are the optimal solutions. 4 Experiments 4.1 Experimental setup We evaluate our unsupervised learning scheme described in earlier secitons using two classification tasks, unsupervised character-level OCR and unsupervised English Spelling Correction (Spell-Corr). In both tasks, there is no label provided during training. Hence, they are both unsupervised. For the OCR task, we obtain our dataset from a public database UWIII English Document Image Database [27], which contains images for each line of text with its corresponding groudtruth. We first use Tesseract [19] to segment the image for each line of text into characters tiles and assign each tile with one character. We verify the segmentation result by training a simple neural network classifier on the segmented results and achieve 0.9% error rate on the test set. Then, we select sentence segments that are longer than 100 and contain only lowercase English characters and common punctuations (space, comma, and period). As a result, we have a vocabulary of size 29 and we obtain 1,175 sentence segments including 153,221 characters for our OCR task. To represent images, we extract VGG19 features with dim = 4096, and project them into 200-dimension vectors using Principal Component Analysis. We train the language models (LM) pLM(·) to provide the required output sequence statistics from both in-domain and out-of-domain data sources. The out-of-domain data sources are completely different databases, including three different language partitions (CNA, NYT, XIN) in the English Gigaword database [26]. In Spell-Corr task, we learn to correct the spelling from a mis-spelled text. From the AFP partition of the Gigaword database, we select 500 sentence segments into our Spell-Corr dataset. We select sentences that are longer than 100 and contain only English characters and common punctuations, resulting in a total of 83,567 characters. The mis-spelled texts are generated by substitution simulations and are treated as our inputs. The objective of this task is to recover the original text. 4.2 Results: Comparing optimization algorithms In the first set of experiments, we aim to evaluate the effectiveness of the SPDG method as described in Section 3, which is designed for optimizing the Empirical-ODM cost in Section 2. The analysis provided in Sections 2 and 3 sheds insight to why SPDG is superior to the method in [7] and to the standard stochastic gradient descent (SGD) method. The coverage-seeking behavior of the proposed Empirical-ODM cost helps avoid trivial solutions, and the simultaneous optimization of primal-dual variables reduces the barriers in the highly non-convex profile of the cost function. Furthermore, we do not include the methods from [30] because their approaches could not achieve satisfactory results without a few labeled data, while we only consider fully unsupervised learning setting. In addition, the methods in [30] are not optimizing the ODM cost and do not exploit the output sequential statistics. 7 Table 1 provides strong experimental evidence demonstrating the substantially greater effectiveness of the primal-dual method over the SGD and the method in [7] on both tasks. All these results are obtained by training the models until converge. Let us examine the results on the OCR in detail. First, the SPGD on the unsupervised cost function achieves 9.21% error rate, much lower than the error rates of any of mini-batch SGD runs, where the size of the mini-batches ranges from 10 to 10,000. Note that, larger mini-batch sizes produce lower errors here because it becomes closer to full-batch gradient and thus lower bias in SGD. On the other hand, when the mini-batch size is as small as 10, the high error rate of 83.09% is close to a guess by majority rule — predicting the character (space) that has a largest proportion in the train set, i.e., 25, 499/153, 221 = 83.37%. Furthermore, the method from [7] does not perform well no matter how we tune the hyperparameters for the generative regularization. Finally and perhaps most interestingly, with no labels provided in the training, the classification errors produced by our method are only about twice compared with supervised learning (4.63% shown in Table 1). This clearly demonstrates that the unsupervised learning scheme proposed in this paper is an effective one. For the Spelling Correction data set (see the third column in Table 1), we observe rather consistent results with the OCR data set. Table 1: Test error rates on two datasets: OCR and Spell-Corr. The 2-gram character LM is trained from in-domain data. The numbers inside h·i are the mini-batch sizes of the SGD method. Data sets SPDG (Ours) Method from [7] SGD h10i SGD h100i SGD h1ki SGD h10ki Supervised Learning Majority Guess OCR 9.59% 83.37% 83.09% 78.05% 67.14% 56.48% 4.63% 83.37% Spell-Corr 1.94% 82.91% 82.91% 72.93% 65.69% 45.24% 0.00% 82.91% 4.3 Results: Comparing orders of language modeling In the second set of experiments, we examine to what extent the use of sequential statistics (e.g. 2and 3-gram LMs) can do better than the uni-gram LM (no sequential information) in unsupervised learning. The unsupervised prediction results are shown in Table 2, using different data sources to estimate N-gram LM parameters. Consistent across all four ways of estimating reliable N-gram LMs, we observe significantly lower error rates when the unsupervised learning exploits 2-gram and 3-gram LM as sequential statistics compared with exploiting the prior with no sequential statistics (i.e. 1-gram). In three of four cases, exploiting a 3-gram LM gives better results than a 2-gram LM. Furthermore, the comparable error rate associated with 3-gram using out-of-domain output character data (10.17% in Table 2) to that using in-domain output character data (9.59% in Table 1) indicates that the effectiveness of the unsupervised learning paradigm presented in this paper is robust to the quality of the LM acting as the sequential prior. Table 2: Test error rates on the OCR dataset. Character-level language models (LMs) with the orders are trained from three out-of-domain datasets and from the fused in-domain and out-of-domain data. NYT-LM XIN-LM CNA-LM Fused-LM No. Sents 1,206,903 155,647 12,234 15,409 No. Chars 86,005,542 18,626,451 1,911,124 2,064,345 1-gram 71.83% 72.14% 71.51% 71.25% 2-gram 10.93% 12.55% 10.56% 10.33% 3-gram 10.17% 12.89% 10.29 % 9.21% 5 Conclusions and future work In this paper, we study the problem of learning a sequence classifier without the need for labeled training data. The practical benefit of such unsupervised learning is tremendous. For example, in large scale speech recognition systems, the currently dominant supervised learning methods typically require a few thousand hours of training data, where each utterance in the acoustic form needs to be labeled by humans. Although there are millions of hours of natural speech data available for training, labeling all of them for supervised learning is less feasible. To make effective use of such 8 huge amounts of acoustic data, the practical unsupervised learning approach discussed in this paper would be called for. Other potential applications such as machine translation, image and video captioning could also benefit from our paradigm. This is mainly because of their common natural language output structure, from which we could exploit the sequential structures for learning the classifier without labels. For other (non-natural-language) applications where there is also a sequential output strucutre, our proposed approach could be applicable in a similar manner. Furthermore, our proposed Empirical-ODM cost function significantly improves over the one in [7] by emphasizing the coverage-seeking behavior. Although the new cost function has a functional form that is more difficult to optimize, a novel SPDG algorithm is developed to effectively address the problem. An analysis of profiles of the cost functions sheds insight to why SPDG works well and why previous methods failed. Finally, we demonstrate in two datasets that our unsupervised learning method is highly effective, producing only about twice errors as fully supervised learning, which no previous unsupervised learning could produce without additional steps of supervised learning. While the current work is restricted to linear classifiers, we intend to generalize the approach to nonlinear models (e.g., deep neural nets [16]) in our future work. We also plan to extend our current method from exploiting N-gram LM to exploiting the currently state-of-the-art neural-LM. Finally, one challenge that remains to be addressed is the scaling of the current method to large vocabulary and high-order LM (i.e., large C and N). In this case, the summation over all (i1, . . . , iN) in (5) becomes computationally expensive. A potential solution is to parameterize the dual variable ⌫i1,...,iN by a recurrent neural network and approximate the sum using beamsearch, which we leave as a future work. Acknowledgments The authors would like to thank all the anonymous reviewers for their constructive feedback. References [1] Yoshua Bengio. Learning deep architectures for AI. Foundations and Trends in Machine Learning, 2(1):1–127, January 2009. [2] Yoshua Bengio, Pascal Lamblin, Dan Popovici, and Hugo Larochelle. Greedy layer-wise training of deep networks. In Proceedings of the Advances in Neural Information Processing Systems (NIPS), pages 153–160, 2007. [3] Taylor Berg-Kirkpatrick, Greg Durrett, and Dan Klein. Unsupervised transcription of historical documents. In Proceedings of the 51st Annual Meeting of the Association for Computational Linguistics, pages 207–217, 2013. [4] Albrecht Beutelspacher. Cryptology. Mathematical Association of America, 1994. [5] David M. Blei, Andrew Y. Ng, and Michael I. Jordan. Latent dirichlet allocation. The Journal of Machine Learning Research, 3:993–1022, March 2003. [6] Stephen Boyd and Lieven Vandenberghe. Convex optimization. Cambridge university press, 2004. [7] Jianshu Chen, Po-Sen Huang, Xiaodong He, Jianfeng Gao, and Li Deng. Unsupervised learning of predictors from unpaired input-output samples. arXiv:1606.04646, 2016. [8] Soumith Chintala and Yann LeCun. A path to unsupervised learning through adversarial networks. In https://code.facebook.com/posts/1587249151575490/a-path-to-unsupervisedlearning-through-adversarial-networks/, 2016. [9] George E Dahl, Dong Yu, Li Deng, and Alex Acero. Context-dependent pre-trained deep neural networks for large-vocabulary speech recognition. Audio, Speech, and Language Processing, IEEE Transactions on, 20(1):30–42, 2012. [10] Andrew M Dai and Quoc V Le. Semi-supervised sequence learning. In Proceedings of the Advances in Neural Information Processing Systems (NIPS), pages 3079–3087, 2015. [11] Li Deng. Deep learning for speech and language processing. In Tutorial at Interspeech Conf, Dresden, Germany, https://www.microsoft.com/en-us/research/wpcontent/uploads/2016/07/interspeech-tutorial-2015-lideng-sept6a.pdf, Aug-Sept, 2015. 9 [12] Ian Goodfellow. Generative adversarial nets. In Tutorial at NIPS, http://www.cs.toronto.edu/ dtarlow/pos14/talks/goodfellow.pdf, 2016. [13] Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep Learning, by MIT Press. 2016. [14] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Proceedings of the Advances in Neural Information Processing Systems (NIPS), pages 2672–2680, 2014. [15] Alex Graves. Sequence transduction with recurrent neural networks. arXiv preprint arXiv:1211.3711, 2012. [16] Geoffrey Hinton, Li Deng, Dong Yu, George E Dahl, Abdel-Rahman Mohamed, Navdeep Jaitly, Andrew Senior, Vincent Vanhoucke, Patrick Nguyen, Tara N. Sainath, and B. Kingsbury. Deep neural networks for acoustic modeling in speech recognition: The shared views of four research groups. IEEE Signal Processing Magazine, 29(6):82–97, November 2012. [17] Geoffrey E Hinton, Simon Osindero, and Yee-Whye Teh. A fast learning algorithm for deep belief nets. Neural computation, 18(7):1527–1554, 2006. [18] Geoffrey E Hinton and Ruslan R Salakhutdinov. Reducing the dimensionality of data with neural networks. Science, 313(5786):504–507, 2006. [19] Anthony Kay. Tesseract: An open-source optical character recognition engine. Linux Journal, 2007. [20] Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013. [21] Kevin Knight, Anish Nair, Nishit Rathod, and Kenji Yamada. Unsupervised analysis for decipherment problems. In Proceedings of the COLING/ACL, pages 499–506, 2006. [22] Quoc Le, Marc’Aurelio Ranzato, Rajat Monga, Matthieu Devin, Kai Chen, Greg Corrado, Jeff Dean, and Andrew Ng. Building high-level features using large scale unsupervised learning. In International Conference in Machine Learning, 2012. [23] Dennis Luciano and Gordon Prichett. Cryptology: From caesar ciphers to public-key cryptosystems. The College Mathematics Journal, 18(1):2–17, 1987. [24] Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781, 2013. [25] Tom Minka. Divergence measures and message passing. Technical report, Technical report, Microsoft Research, 2005. [26] Robert et al Parker. English gigaword fourth edition ldc2009t13. Philadelphia: Linguistic Data Consortium, 2009. [27] Ihsin Phillips, Bhabatosh Chanda, and Robert Haralick. http://isisdata.science.uva.nl/events/dlia//datasets/uwash3.html. [28] P. Smolensky. Parallel distributed processing: Explorations in the microstructure of cognition, vol. 1. chapter Information Processing in Dynamical Systems: Foundations of Harmony Theory, pages 194–281. 1986. [29] Russell Stewart and Stefano Ermon. Label-free supervision of neural networks with physics and domain knowledge. In Proceedings of AAAI, 2017. [30] Ilya Sutskever, Rafal Jozefowicz, Karol Gregor, Danilo Rezende, Tim Lillicrap, and Oriol Vinyals. Towards principled unsupervised learning. arXiv preprint arXiv:1511.06440, 2015. [31] Pascal Vincent, Hugo Larochelle, Isabelle Lajoie, Yoshua Bengio, and Pierre-Antoine 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. 10
2017
634
7,157
Deep Sets Manzil Zaheer1,2, Satwik Kottur1, Siamak Ravanbhakhsh1, Barnabás Póczos1, Ruslan Salakhutdinov1, Alexander J Smola1,2 1 Carnegie Mellon University 2 Amazon Web Services {manzilz,skottur,mravanba,bapoczos,rsalakhu,smola}@cs.cmu.edu Abstract We study the problem of designing models for machine learning tasks defined on sets. In contrast to traditional approach of operating on fixed dimensional vectors, we consider objective functions defined on sets that are invariant to permutations. Such problems are widespread, ranging from estimation of population statistics [1], to anomaly detection in piezometer data of embankment dams [2], to cosmology [3, 4]. Our main theorem characterizes the permutation invariant functions and provides a family of functions to which any permutation invariant objective function must belong. This family of functions has a special structure which enables us to design a deep network architecture that can operate on sets and which can be deployed on a variety of scenarios including both unsupervised and supervised learning tasks. We also derive the necessary and sufficient conditions for permutation equivariance in deep models. We demonstrate the applicability of our method on population statistic estimation, point cloud classification, set expansion, and outlier detection. 1 Introduction A typical machine learning algorithm, like regression or classification, is designed for fixed dimensional data instances. Their extensions to handle the case when the inputs or outputs are permutation invariant sets rather than fixed dimensional vectors is not trivial and researchers have only recently started to investigate them [5–8]. In this paper, we present a generic framework to deal with the setting where input and possibly output instances in a machine learning task are sets. Similar to fixed dimensional data instances, we can characterize two learning paradigms in case of sets. In supervised learning, we have an output label for a set that is invariant or equivariant to the permutation of set elements. Examples include tasks like estimation of population statistics [1], where applications range from giga-scale cosmology [3, 4] to nano-scale quantum chemistry [9]. Next, there can be the unsupervised setting, where the “set” structure needs to be learned, e.g. by leveraging the homophily/heterophily tendencies within sets. An example is the task of set expansion (a.k.a. audience expansion), where given a set of objects that are similar to each other (e.g. set of words {lion, tiger, leopard}), our goal is to find new objects from a large pool of candidates such that the selected new objects are similar to the query set (e.g. find words like jaguar or cheetah among all English words). This is a standard problem in similarity search and metric learning, and a typical application is to find new image tags given a small set of possible tags. Likewise, in the field of computational advertisement, given a set of high-value customers, the goal would be to find similar people. This is an important problem in many scientific applications, e.g. given a small set of interesting celestial objects, astrophysicists might want to find similar ones in large sky surveys. Main contributions. In this paper, (i) we propose a fundamental architecture, DeepSets, to deal with sets as inputs and show that the properties of this architecture are both necessary and sufficient (Sec. 2). (ii) We extend this architecture to allow for conditioning on arbitrary objects, and (iii) based on this architecture we develop a deep network that can operate on sets with possibly different sizes (Sec. 3). We show that a simple parameter-sharing scheme enables a general treatment of sets within supervised and semi-supervised settings. (iv) Finally, we demonstrate the wide applicability of our framework through experiments on diverse problems (Sec. 4). 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. 2 Permutation Invariance and Equivariance 2.1 Problem Definition A function f transforms its domain X into its range Y. Usually, the input domain is a vector space Rd and the output response range is either a discrete space, e.g. {0, 1} in case of classification, or a continuous space R in case of regression. Now, if the input is a set X = {x1, . . . , xM}, xm ∈X, i.e., the input domain is the power set X = 2X, then we would like the response of the function to be “indifferent” to the ordering of the elements. In other words, Property 1 A function f : 2X →Y acting on sets must be permutation invariant to the order of objects in the set, i.e. for any permutation π : f({x1, . . . , xM}) = f({xπ(1), . . . , xπ(M)}). In the supervised setting, given N examples of of X(1), ..., X(N) as well as their labels y(1), ..., y(N), the task would be to classify/regress (with variable number of predictors) while being permutation invariant w.r.t. predictors. Under unsupervised setting, the task would be to assign high scores to valid sets and low scores to improbable sets. These scores can then be used for set expansion tasks, such as image tagging or audience expansion in field of computational advertisement. In transductive setting, each instance x(n) m has an associated labeled y(n) m . Then, the objective would be instead to learn a permutation equivariant function f : XM →YM that upon permutation of the input instances permutes the output labels, i.e. for any permutation π: f([xπ(1), . . . , xπ(M)]) = [fπ(1)(x), . . . , fπ(M)(x)] (1) 2.2 Structure We want to study the structure of functions on sets. Their study in total generality is extremely difficult, so we analyze case-by-case. We begin by analyzing the invariant case when X is a countable set and Y = R, where the next theorem characterizes its structure. Theorem 2 A function f(X) operating on a set X having elements from a countable universe, is a valid set function, i.e., invariant to the permutation of instances in X, iff it can be decomposed in the form ρ P x∈X φ(x)  , for suitable transformations φ and ρ. The extension to case when X is uncountable, like X = R, we could only prove that f(X) = ρ P x∈X φ(x)  holds for sets of fixed size. The proofs and difficulties in handling the uncountable case, are discussed in Appendix A. However, we still conjecture that exact equality holds in general. Next, we analyze the equivariant case when X = Y = R and f is restricted to be a neural network layer. The standard neural network layer is represented as fΘ(x) = σ(Θx) where Θ ∈RM×M is the weight vector and σ : R →R is a nonlinearity such as sigmoid function. The following lemma states the necessary and sufficient conditions for permutation-equivariance in this type of function. Lemma 3 The function fΘ : RM →RM defined above is permutation equivariant iff all the offdiagonal elements of Θ are tied together and all the diagonal elements are equal as well. That is, Θ = λI + γ (11T) λ, γ ∈R 1 = [1, . . . , 1]T ∈RM I ∈RM×Mis the identity matrix This result can be easily extended to higher dimensions, i.e., X = Rd when λ, γ can be matrices. 2.3 Related Results The general form of Theorem 2 is closely related with important results in different domains. Here, we quickly review some of these connections. de Finetti theorem. A related concept is that of an exchangeable model in Bayesian statistics, It is backed by deFinetti’s theorem which states that any exchangeable model can be factored as p(X|α, M0) = Z dθ " M Y m=1 p(xm|θ) # p(θ|α, M0), (2) where θ is some latent feature and α, M0 are the hyper-parameters of the prior. To see that this fits into our result, let us consider exponential families with conjugate priors, where we can analytically calculate the integral of (2). In this special case p(x|θ) = exp (⟨φ(x), θ⟩−g(θ)) and p(θ|α, M0) = exp (⟨θ, α⟩−M0g(θ) −h(α, M0)). Now if we marginalize out θ, we get a form which looks exactly like the one in Theorem 2 p(X|α, M0) = exp h α + X m φ(xm), M0 + M ! −h(α, M0) ! . (3) 2 Representer theorem and kernel machines. Support distribution machines use f(p) = P i αiyiK(pi, p) + b as the prediction function [8, 10], where pi, p are distributions and αi, b ∈R. In practice, the pi, p distributions are never given to us explicitly, usually only i.i.d. sample sets are available from these distributions, and therefore we need to estimate kernel K(p, q) using these samples. A popular approach is to use ˆK(p, q) = 1 MM ′ P i,j k(xi, yj), where k is another kernel operating on the samples {xi}M i=1 ∼p and {yj}M ′ j=1 ∼q. Now, these prediction functions can be seen fitting into the structure of our Theorem. Spectral methods. A consequence of the polynomial decomposition is that spectral methods [11] can be viewed as a special case of the mapping ρ ◦φ(X): in that case one can compute polynomials, usually only up to a relatively low degree (such as k = 3), to perform inference about statistical properties of the distribution. The statistics are exchangeable in the data, hence they could be represented by the above map. 3 Deep Sets 3.1 Architecture Invariant model. The structure of permutation invariant functions in Theorem 2 hints at a general strategy for inference over sets of objects, which we call DeepSets. Replacing φ and ρ by universal approximators leaves matters unchanged, since, in particular, φ and ρ can be used to approximate arbitrary polynomials. Then, it remains to learn these approximators, yielding in the following model: • Each instance xm is transformed (possibly by several layers) into some representation φ(xm). • The representations φ(xm) are added up and the output is processed using the ρ network in the same manner as in any deep network (e.g. fully connected layers, nonlinearities, etc.). • Optionally: If we have additional meta-information z, then the above mentioned networks could be conditioned to obtain the conditioning mapping φ(xm|z). In other words, the key is to add up all representations and then apply nonlinear transformations. Equivariant model. Our goal is to design neural network layers that are equivariant to the permutations of elements in the input x. Based on Lemma 3, a neural network layer fΘ(x) is permutation equivariant if and only if all the off-diagonal elements of Θ are tied together and all the diagonal elements are equal as well, i.e., Θ = λI + γ (11T) for λ, γ ∈R. This function is simply a non-linearity applied to a weighted combination of (i) its input Ix and; (ii) the sum of input values (11T)x. Since summation does not depend on the permutation, the layer is permutation-equivariant. We can further manipulate the operations and parameters in this layer to get other variations, e.g.: f(x) .= σ (λIx + γ maxpool(x)1) . (4) where the maxpooling operation over elements of the set (similar to sum) is commutative. In practice, this variation performs better in some applications. This may be due to the fact that for λ = γ, the input to the non-linearity is max-normalized. Since composition of permutation equivariant functions is also permutation equivariant, we can build DeepSets by stacking such layers. 3.2 Other Related Works Several recent works study equivariance and invariance in deep networks w.r.t. general group of transformations [12–14]. For example, [15] construct deep permutation invariant features by pairwise coupling of features at the previous layer, where fi,j([xi, xj]) .= [|xi −xj|, xi + xj] is invariant to transposition of i and j. Pairwise interactions within sets have also been studied in [16, 17]. [18] approach unordered instances by finding “good” orderings. The idea of pooling a function across set-members is not new. In [19], pooling was used binary classification task for causality on a set of samples. [20] use pooling across a panoramic projection of 3D object for classification, while [21] perform pooling across multiple views. [22] observe the invariance of the payoff matrix in normal form games to the permutation of its rows and columns (i.e. player actions) and leverage pooling to predict the player action. The need of permutation equivariance also arise in deep learning over sensor networks and multi-agent setings, where a special case of Lemma 3 has been used as the architecture [23]. In light of these related works, we would like to emphasize our novel contributions: (i) the universality result of Theorem 2 for permutation invariance that also relates DeepSets to other machine learning techniques, see Sec. 3; (ii) the permutation equivariant layer of (4), which, according to Lemma 3 identifies necessary and sufficient form of parameter-sharing in a standard neural layer and; (iii) novel application settings that we study next. 3 (a) Entropy estimation for rotated of 2d Gaussian (b) Mutual information estimation by varying correlation (c) Mutual information estimation by varying rank-1 strength (d) Mutual information on 32d random covariance matrices Figure 1: Population statistic estimation: Top set of figures, show prediction of DeepSets vs SDM for N = 210 case. Bottom set of figures, depict the mean squared error behavior as number of sets is increased. SDM has lower error for small N and DeepSets requires more data to reach similar accuracy. But for high dimensional problems DeepSets easily scales to large number of examples and produces much lower estimation error. Note that the N × N matrix inversion in SDM makes it prohibitively expensive for N > 214 = 16384. 4 Applications and Empirical Results We present a diverse set of applications for DeepSets. For the supervised setting, we apply DeepSets to estimation of population statistics, sum of digits and classification of point-clouds, and regression with clustering side-information. The permutation-equivariant variation of DeepSets is applied to the task of outlier detection. Finally, we investigate the application of DeepSets to unsupervised set-expansion, in particular, concept-set retrieval and image tagging. In most cases we compare our approach with the state-of-the art and report competitive results. 4.1 Set Input Scalar Response 4.1.1 Supervised Learning: Learning to Estimate Population Statistics In the first experiment, we learn entropy and mutual information of Gaussian distributions, without providing any information about Gaussianity to DeepSets. The Gaussians are generated as follows: • Rotation: We randomly chose a 2 × 2 covariance matrix Σ, and then generated N sample sets from N(0, R(α)ΣR(α)T ) of size M = [300 −500] for N random values of α ∈[0, π]. Our goal was to learn the entropy of the marginal distribution of first dimension. R(α) is the rotation matrix. • Correlation: We randomly chose a d × d covariance matrix Σ for d = 16, and then generated N sample sets from N(0, [Σ, αΣ; αΣ, Σ]) of size M = [300 −500] for N random values of α ∈(−1, 1). Goal was to learn the mutual information of among the first d and last d dimension. • Rank 1: We randomly chose v ∈R32 and then generated a sample sets from N(0, I +λvvT ) of size M = [300 −500] for N random values of λ ∈(0, 1). Goal was to learn the mutual information. • Random: We chose N random d × d covariance matrices Σ for d = 32, and using each, generated a sample set from N(0, Σ) of size M = [300 −500]. Goal was to learn the mutual information. We train using L2 loss with a DeepSets architecture having 3 fully connected layers with ReLU activation for both transformations φ and ρ. We compare against Support Distribution Machines (SDM) using a RBF kernel [10], and analyze the results in Fig. 1. 4.1.2 Sum of Digits Figure 2: Accuracy of digit summation with text (left) and image (right) inputs. All approaches are trained on tasks of length 10 at most, tested on examples of length up to 100. We see that DeepSets generalizes better. Next, we compare to what happens if our set data is treated as a sequence. We consider the task of finding sum of a given set of digits. We consider two variants of this experiment: Text. We randomly sample a subset of maximum M = 10 digits from this dataset to build 100k “sets” of training images, where the setlabel is sum of digits in that set. We test against sums of M digits, for M starting from 5 all the way up to 100 over another 100k examples. 4 Image. MNIST8m [24] contains 8 million instances of 28 × 28 grey-scale stamps of digits in {0, . . . , 9}. We randomly sample a subset of maximum M = 10 images from this dataset to build N = 100k “sets” of training and 100k sets of test images, where the set-label is the sum of digits in that set (i.e. individual labels per image is unavailable). We test against sums of M images of MNIST digits, for M starting from 5 all the way up to 50. We compare against recurrent neural networks – LSTM and GRU. All models are defined to have similar number of layers and parameters. The output of all models is a scalar, predicting the sum of N digits. Training is done on tasks of length 10 at most, while at test time we use examples of length up to 100. The accuracy, i.e. exact equality after rounding, is shown in Fig. 2. DeepSets generalize much better. Note for image case, the best classification error for single digit is around p = 0.01 for MNIST8m, so in a collection of N of images at least one image will be misclassified is 1 −(1 −p)N, which is 40% for N = 50. This matches closely with observed value in Fig. 2(b). 4.1.3 Point Cloud Classification Model Instance Size Representation Accuracy 3DShapeNets [25] 303 voxels (using convolutional deep belief net) 77% VoxNet [26] 323 voxels (voxels from point-cloud + 3D CNN) 83.10% MVCNN [21] 164×164× 12 multi-vew images (2D CNN + viewpooling) 90.1% VRN Ensemble [27] 323 voxels (3D CNN, variational autoencoder) 95.54% 3D GAN [28] 643 voxels (3D CNN, generative adversarial training) 83.3% DeepSets 5000 × 3 point-cloud 90 ± .3% DeepSets 100 × 3 point-cloud 82 ± 2% Table 1: Classification accuracy and the representationsize used by different methods on the ModelNet40. A point-cloud is a set of low-dimensional vectors. This type of data is frequently encountered in various applications like robotics, vision, and cosmology. In these applications, existing methods often convert the point-cloud data to voxel or mesh representation as a preprocessing step, e.g. [26, 29, 30]. Since the output of many range sensors, such as LiDAR, is in the form of pointcloud, direct application of deep learning methods to point-cloud is highly desirable. Moreover, it is easy and cheaper to apply transformations, such as rotation and translation, when working with point-clouds than voxelized 3D objects. As point-cloud data is just a set of points, we can use DeepSets to classify point-cloud representation of a subset of ShapeNet objects [31], called ModelNet40 [25]. This subset consists of 3D representation of 9,843 training and 2,468 test instances belonging to 40 classes of objects. We produce point-clouds with 100, 1000 and 5000 particles each (x, y, z-coordinates) from the mesh representation of objects using the point-cloudlibrary’s sampling routine [32]. Each set is normalized by the initial layer of the deep network to have zero mean (along individual axes) and unit (global) variance. Tab. 1 compares our method using three permutation equivariant layers against the competition; see Appendix H for details. 4.1.4 Improved Red-shift Estimation Using Clustering Information An important regression problem in cosmology is to estimate the red-shift of galaxies, corresponding to their age as well as their distance from us [33] based on photometric observations. One way to estimate the red-shift from photometric observations is using a regression model [34] on the galaxy clusters. The prediction for each galaxy does not change by permuting the members of the galaxy cluster. Therefore, we can treat each galaxy cluster as a “set” and use DeepSets to estimate the individual galaxy red-shifts. See Appendix G for more details. Method Scatter MLP 0.026 redMaPPer 0.025 DeepSets 0.023 Table 2: Red-shift experiment. Lower scatter is better. For each galaxy, we have 17 photometric features from the redMaPPer galaxy cluster catalog [35] that contains photometric readings for 26,111 red galaxy clusters. Each galaxy-cluster in this catalog has between ∼20 −300 galaxies – i.e. x ∈RN(c)×17, where N(c) is the cluster-size. The catalog also provides accurate spectroscopic red-shift estimates for a subset of these galaxies. We randomly split the data into 90% training and 10% test clusters, and minimize the squared loss of the prediction for available spectroscopic red-shifts. As it is customary in cosmology literature, we report the average scatter |zspec−z| 1+zspec , where zspec is the accurate spectroscopic measurement and z is a photometric estimate in Tab. 2. 5 Method LDA-1k (Vocab = 17k) LDA-3k (Vocab = 38k) LDA-5k (Vocab = 61k) Recall (%) MRR Med. Recall (%) MRR Med. Recall (%) MRR Med. @10 @100 @1k @10 @100 @1k @10 @100 @1k Random 0.06 0.6 5.9 0.001 8520 0.02 0.2 2.6 0.000 28635 0.01 0.2 1.6 0.000 30600 Bayes Set 1.69 11.9 37.2 0.007 2848 2.01 14.5 36.5 0.008 3234 1.75 12.5 34.5 0.007 3590 w2v Near 6.00 28.1 54.7 0.021 641 4.80 21.2 43.2 0.016 2054 4.03 16.7 35.2 0.013 6900 NN-max 4.78 22.5 53.1 0.023 779 5.30 24.9 54.8 0.025 672 4.72 21.4 47.0 0.022 1320 NN-sum-con 4.58 19.8 48.5 0.021 1110 5.81 27.2 60.0 0.027 453 4.87 23.5 53.9 0.022 731 NN-max-con 3.36 16.9 46.6 0.018 1250 5.61 25.7 57.5 0.026 570 4.72 22.0 51.8 0.022 877 DeepSets 5.53 24.2 54.3 0.025 696 6.04 28.5 60.7 0.027 426 5.54 26.1 55.5 0.026 616 Table 3: Results on Text Concept Set Retrieval on LDA-1k, LDA-3k, and LDA-5k. Our DeepSets model outperforms other methods on LDA-3k and LDA-5k. However, all neural network based methods have inferior performance to w2v-Near baseline on LDA-1k, possibly due to small data size. Higher the better for recall@k and mean reciprocal rank (MRR). Lower the better for median rank (Med.) 4.2 Set Expansion In the set expansion task, we are given a set of objects that are similar to each other and our goal is to find new objects from a large pool of candidates such that the selected new objects are similar to the query set. To achieve this one needs to reason out the concept connecting the given set and then retrieve words based on their relevance to the inferred concept. It is an important task due to wide range of potential applications including personalized information retrieval, computational advertisement, tagging large amounts of unlabeled or weakly labeled datasets. Going back to de Finetti’s theorem in Sec. 3.2, where we consider the marginal probability of a set of observations, the marginal probability allows for very simple metric for scoring additional elements to be added to X. In other words, this allows one to perform set expansion via the following score s(x|X) = log p(X ∪{x} |α) −log p(X|α)p({x} |α) (5) Note that s(x|X) is the point-wise mutual information between x and X. Moreover, due to exchangeability, it follows that regardless of the order of elements we have S(X) = X m s (xm| {xm−1, . . . x1}) = log p(X|α) − M X m=1 log p({xm} |α) (6) When inferring sets, our goal is to find set completions {xm+1, . . . xM} for an initial set of query terms {x1, . . . , xm}, such that the aggregate set is coherent. This is the key idea of the Bayesian Set algorithm [36] (details in Appendix D). Using DeepSets, we can solve this problem in more generality as we can drop the assumption of data belonging to certain exponential family. For learning the score s(x|X), we take recourse to large-margin classification with structured loss functions [37] to obtain the relative loss objective l(x, x′|X) = max(0, s(x′|X)−s(x|X)+∆(x, x′)). In other words, we want to ensure that s(x|X) ≥s(x′|X) + ∆(x, x′) whenever x should be added and x′ should not be added to X. Conditioning. Often machine learning problems do not exist in isolation. For example, task like tag completion from a given set of tags is usually related to an object z, for example an image, that needs to be tagged. Such meta-data are usually abundant, e.g. author information in case of text, contextual data such as the user click history, or extra information collected with LiDAR point cloud. Conditioning graphical models with meta-data is often complicated. For instance, in the BetaBinomial model we need to ensure that the counts are always nonnegative, regardless of z. Fortunately, DeepSets does not suffer from such complications and the fusion of multiple sources of data can be done in a relatively straightforward manner. Any of the existing methods in deep learning, including feature concatenation by averaging, or by max-pooling, can be employed. Incorporating these metadata often leads to significantly improved performance as will be shown in experiments; Sec. 4.2.2. 4.2.1 Text Concept Set Retrieval In text concept set retrieval, the objective is to retrieve words belonging to a ‘concept’ or ‘cluster’, given few words from that particular concept. For example, given the set of words {tiger, lion, cheetah}, we would need to retrieve other related words like jaguar, puma, etc, which belong to the same concept of big cats. This task of concept set retrieval can be seen as a set completion task conditioned on the latent semantic concept, and therefore our DeepSets form a desirable approach. Dataset. We construct a large dataset containing sets of NT = 50 related words by extracting topics from latent Dirichlet allocation [38, 39], taken out-of-the-box1. To compare across scales, we 1github.com/dmlc/experimental-lda 6 consider three values of k = {1k, 3k, 5k} giving us three datasets LDA-1k, LDA-3k, and LDA-5k, with corresponding vocabulary sizes of 17k, 38k, and 61k. Methods. We learn this using a margin loss with a DeepSets architecture having 3 fully connected layers with ReLU activation for both transformations φ and ρ. Details of the architecture and training are in Appendix E. We compare to several baselines: (a) Random picks a word from the vocabulary uniformly at random. (b) Bayes Set [36]. (c) w2v-Near computes the nearest neighbors in the word2vec [40] space. Note that both Bayes Set and w2v NN are strong baselines. The former runs Bayesian inference using Beta-Binomial conjugate pair, while the latter uses the powerful 300 dimensional word2vec trained on the billion word GoogleNews corpus2. (d) NN-max uses a similar architecture as our DeepSets but uses max pooling to compute the set feature, as opposed to sum pooling. (e) NN-max-con uses max pooling on set elements but concatenates this pooled representation with that of query for a final set feature. (f) NN-sum-con is similar to NN-max-con but uses sum pooling followed by concatenation with query representation. Evaluation. We consider the standard retrieval metrics – recall@K, median rank and mean reciprocal rank, for evaluation. To elaborate, recall@K measures the number of true labels that were recovered in the top K retrieved words. We use three values of K = {10, 100, 1k}. The other two metrics, as the names suggest, are the median and mean of reciprocals of the true label ranks, respectively. Each dataset is split into TRAIN (80%), VAL (10%) and TEST (10%). We learn models using TRAIN and evaluate on TEST, while VAL is used for hyperparameter selection and early stopping. Results and Observations. As seen in Tab. 3: (a) Our DeepSets model outperforms all other approaches on LDA-3k and LDA-5k by any metric, highlighting the significance of permutation invariance property. (b) On LDA-1k, our model does not perform well when compared to w2v-Near. We hypothesize that this is due to small size of the dataset insufficient to train a high capacity neural network, while w2v-Near has been trained on a billion word corpus. Nevertheless, our approach comes the closest to w2v-Near amongst other approaches, and is only 0.5% lower by Recall@10. 4.2.2 Image Tagging Method ESP game IAPRTC-12.5 P R F1 N+ P R F1 N+ Least Sq. 35 19 25 215 40 19 26 198 MBRM 18 19 18 209 24 23 23 223 JEC 24 19 21 222 29 19 23 211 FastTag 46 22 30 247 47 26 34 280 Least Sq.(D) 44 32 37 232 46 30 36 218 FastTag(D) 44 32 37 229 46 33 38 254 DeepSets 39 34 36 246 42 31 36 247 Table 4: Results of image tagging on ESPgame and IAPRTC-12.5 datasets. Performance of our DeepSets approach is roughly similar to the best competing approaches, except for precision. Refer text for more details. Higher the better for all metrics – precision (P), recall (R), f1 score (F1), and number of non-zero recall tags (N+). We next experiment with image tagging, where the task is to retrieve all relevant tags corresponding to an image. Images usually have only a subset of relevant tags, therefore predicting other tags can help enrich information that can further be leveraged in a downstream supervised task. In our setup, we learn to predict tags by conditioning DeepSets on the image, i.e., we train to predict a partial set of tags from the image and remaining tags. At test time, we predict tags from the image alone. Datasets. We report results on the following three datasets - ESPGame, IAPRTC-12.5 and our in-house dataset, COCO-Tag. We refer the reader to Appendix F, for more details about datasets. Methods. The setup for DeepSets to tag images is similar to that described in Sec. 4.2.1. The only difference being the conditioning on the image features, which is concatenated with the set feature obtained from pooling individual element representations. Baselines. We perform comparisons against several baselines, previously reported in [41]. Specifically, we have Least Sq., a ridge regression model, MBRM [42], JEC [43] and FastTag [41]. Note that these methods do not use deep features for images, which could lead to an unfair comparison. As there is no publicly available code for MBRM and JEC, we cannot get performances of these models with Resnet extracted features. However, we report results with deep features for FastTag and Least Sq., using code made available by the authors 3. Evaluation. For ESPgame and IAPRTC-12.5, we follow the evaluation metrics as in [44]–precision (P), recall (R), F1 score (F1), and number of tags with non-zero recall (N+). These metrics are evaluate for each tag and the mean is reported (see [44] for further details). For COCO-Tag, however, we use recall@K for three values of K = {10, 100, 1000}, along with median rank and mean reciprocal rank (see evaluation in Sec. 4.2.1 for metric details). 2code.google.com/archive/p/word2vec/ 3http://www.cse.wustl.edu/~mchen/ 7 Figure 3: Each row shows a set, constructed from CelebA dataset, such that all set members except for an outlier, share at least two attributes (on the right). The outlier is identified with a red frame. The model is trained by observing examples of sets and their anomalous members, without access to the attributes. The probability assigned to each member by the outlier detection network is visualized using a red bar at the bottom of each image. The probabilities in each row sum to one. Method Recall MRR Med. @10 @100 @1k w2v NN (blind) 5.6 20.0 54.2 0.021 823 DeepSets (blind) 9.0 39.2 71.3 0.044 310 DeepSets 31.4 73.4 95.3 0.131 28 Table 5: Results on COCO-Tag dataset. Clearly, DeepSets outperforms other baselines significantly. Higher the better for recall@K and mean reciprocal rank (MRR). Lower the better for median rank (Med). Results and Observations. Tab. 4 shows results of image tagging on ESPgame and IAPRTC-12.5, and Tab. 5 on COCO-Tag. Here are the key observations from Tab. 4: (a) performance of our DeepSets model is comparable to the best approaches on all metrics but precision, (b) our recall beats the best approach by 2% in ESPgame. On further investigation, we found that the DeepSets model retrieves more relevant tags, which are not present in list of ground truth tags due to a limited 5 tag annotation. Thus, this takes a toll on precision while gaining on recall, yet yielding improvement on F1. On the larger and richer COCO-Tag, we see that the DeepSets approach outperforms other methods comprehensively, as expected. Qualitative examples are in Appendix F. 4.3 Set Anomaly Detection The objective here is to find the anomalous face in each set, simply by observing examples and without any access to the attribute values. CelebA dataset [45] contains 202,599 face images, each annotated with 40 boolean attributes. We build N = 18, 000 sets of 64 × 64 stamps, using these attributes each containing M = 16 images (on the training set) as follows: randomly select 2 attributes, draw 15 images having those attributes, and a single target image where both attributes are absent. Using a similar procedure we build sets on the test images. No individual person‘s face appears in both train and test sets. Our deep neural network consists of 9 2D-convolution and max-pooling layers followed by 3 permutation-equivariant layers, and finally a softmax layer that assigns a probability value to each set member (Note that one could identify arbitrary number of outliers using a sigmoid activation at the output). Our trained model successfully finds the anomalous face in 75% of test sets. Visually inspecting these instances suggests that the task is non-trivial even for humans; see Fig. 3. As a baseline, we repeat the same experiment by using a set-pooling layer after convolution layers, and replacing the permutation-equivariant layers with fully connected layers of same size, where the final layer is a 16-way softmax. The resulting network shares the convolution filters for all instances within all sets, however the input to the softmax is not equivariant to the permutation of input images. Permutation equivariance seems to be crucial here as the baseline model achieves a training and test accuracy of ∼6.3%; the same as random selection. See Appendix I for more details. 5 Summary In this paper, we develop DeepSets, a model based on powerful permutation invariance and equivariance properties, along with the theory to support its performance. We demonstrate the generalization ability of DeepSets across several domains by extensive experiments, and show both qualitative and quantitative results. In particular, we explicitly show that DeepSets outperforms other intuitive deep networks, which are not backed by theory (Sec. 4.2.1, Sec. 4.1.2). Last but not least, it is worth noting that the state-of-the-art we compare to is a specialized technique for each task, whereas our one model, i.e., DeepSets, is competitive across the board. 8 References [1] B. Poczos, A. Rinaldo, A. Singh, and L. Wasserman. Distribution-free distribution regression. In International Conference on AI and Statistics (AISTATS), JMLR Workshop and Conference Proceedings, 2013. pages 1 [2] I. Jung, M. Berges, J. Garrett, and B. Poczos. Exploration and evaluation of ar, mpca and kl anomaly detection techniques to embankment dam piezometer data. Advanced Engineering Informatics, 2015. pages 1 [3] M. Ntampaka, H. Trac, D. Sutherland, S. Fromenteau, B. Poczos, and J. Schneider. Dynamical mass measurements of contaminated galaxy clusters using machine learning. The Astrophysical Journal, 2016. URL http://arxiv.org/abs/1509.05409. pages 1 [4] M. Ravanbakhsh, J. Oliva, S. Fromenteau, L. Price, S. Ho, J. Schneider, and B. Poczos. Estimating cosmological parameters from the dark matter distribution. In International Conference on Machine Learning (ICML), 2016. pages 1 [5] J. Oliva, B. Poczos, and J. Schneider. Distribution to distribution regression. In International Conference on Machine Learning (ICML), 2013. pages 1 [6] Z. Szabo, B. Sriperumbudur, B. Poczos, and A. Gretton. Learning theory for distribution regression. Journal of Machine Learning Research, 2016. pages [7] K. Muandet, D. Balduzzi, and B. Schoelkopf. Domain generalization via invariant feature representation. In In Proceeding of the 30th International Conference on Machine Learning (ICML 2013), 2013. pages [8] K. Muandet, K. Fukumizu, F. Dinuzzo, and B. Schoelkopf. Learning from distributions via support measure machines. In In Proceeding of the 26th Annual Conference on Neural Information Processing Systems (NIPS 2012), 2012. pages 1, 3 [9] Felix A. Faber, Alexander Lindmaa, O. Anatole von Lilienfeld, and Rickard Armiento. Machine learning energies of 2 million elpasolite (abC2D6) crystals. Phys. Rev. Lett., 117:135502, Sep 2016. doi: 10.1103/PhysRevLett.117.135502. pages 1 [10] B. Poczos, L. Xiong, D. Sutherland, and J. Schneider. Support distribution machines, 2012. URL http://arxiv.org/abs/1202.0302. pages 3, 4 [11] A. Anandkumar, R. Ge, D. Hsu, S. M. Kakade, and M. Telgarsky. Tensor decompositions for learning latent variable models. arXiv preprint arXiv:1210.7559, 2012. pages 3 [12] Robert Gens and Pedro M Domingos. Deep symmetry networks. In Advances in neural information processing systems, pages 2537–2545, 2014. pages 3 [13] Taco S Cohen and Max Welling. Group equivariant convolutional networks. arXiv preprint arXiv:1602.07576, 2016. pages [14] Siamak Ravanbakhsh, Jeff Schneider, and Barnabas Poczos. Equivariance through parametersharing. arXiv preprint arXiv:1702.08389, 2017. pages 3 [15] Xu Chen, Xiuyuan Cheng, and Stéphane Mallat. Unsupervised deep haar scattering on graphs. In Advances in Neural Information Processing Systems, pages 1709–1717, 2014. pages 3 [16] Michael B Chang, Tomer Ullman, Antonio Torralba, and Joshua B Tenenbaum. A compositional object-based approach to learning physical dynamics. arXiv preprint arXiv:1612.00341, 2016. pages 3 [17] Nicholas Guttenberg, Nathaniel Virgo, Olaf Witkowski, Hidetoshi Aoki, and Ryota Kanai. Permutation-equivariant neural networks applied to dynamics prediction. arXiv preprint arXiv:1612.04530, 2016. pages 3 [18] Oriol Vinyals, Samy Bengio, and Manjunath Kudlur. Order matters: Sequence to sequence for sets. arXiv preprint arXiv:1511.06391, 2015. pages 3 [19] David Lopez-Paz, Robert Nishihara, Soumith Chintala, Bernhard Schölkopf, and Léon Bottou. Discovering causal signals in images. arXiv preprint arXiv:1605.08179, 2016. pages 3 9 [20] Baoguang Shi, Song Bai, Zhichao Zhou, and Xiang Bai. Deeppano: Deep panoramic representation for 3-d shape recognition. IEEE Signal Processing Letters, 22(12):2339–2343, 2015. pages 3, 26, 27 [21] Hang Su, Subhransu Maji, Evangelos Kalogerakis, and Erik Learned-Miller. Multi-view convolutional neural networks for 3d shape recognition. In Proceedings of the IEEE International Conference on Computer Vision, pages 945–953, 2015. pages 3, 5, 26, 27 [22] Jason S Hartford, James R Wright, and Kevin Leyton-Brown. Deep learning for predicting human strategic behavior. In Advances in Neural Information Processing Systems, pages 2424–2432, 2016. pages 3 [23] Sainbayar Sukhbaatar, Rob Fergus, et al. Learning multiagent communication with backpropagation. In Neural Information Processing Systems, pages 2244–2252, 2016. pages 3 [24] Gaëlle Loosli, Stéphane Canu, and Léon Bottou. Training invariant support vector machines using selective sampling. In Léon Bottou, Olivier Chapelle, Dennis DeCoste, and Jason Weston, editors, Large Scale Kernel Machines, pages 301–320. MIT Press, Cambridge, MA., 2007. pages 5 [25] Zhirong Wu, Shuran Song, Aditya Khosla, Fisher Yu, Linguang Zhang, Xiaoou Tang, and Jianxiong Xiao. 3d shapenets: A deep representation for volumetric shapes. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1912–1920, 2015. pages 5, 26 [26] Daniel Maturana and Sebastian Scherer. Voxnet: A 3d convolutional neural network for realtime object recognition. In Intelligent Robots and Systems (IROS), 2015 IEEE/RSJ International Conference on, pages 922–928. IEEE, 2015. pages 5, 26 [27] Andrew Brock, Theodore Lim, JM Ritchie, and Nick Weston. Generative and discriminative voxel modeling with convolutional neural networks. arXiv preprint arXiv:1608.04236, 2016. pages 5, 26 [28] Jiajun Wu, Chengkai Zhang, Tianfan Xue, William T Freeman, and Joshua B Tenenbaum. Learning a probabilistic latent space of object shapes via 3d generative-adversarial modeling. arXiv preprint arXiv:1610.07584, 2016. pages 5, 26 [29] Siamak Ravanbakhsh, Junier Oliva, Sebastien Fromenteau, Layne C Price, Shirley Ho, Jeff Schneider, and Barnabás Póczos. Estimating cosmological parameters from the dark matter distribution. In Proceedings of The 33rd International Conference on Machine Learning, 2016. pages 5 [30] Hong-Wei Lin, Chiew-Lan Tai, and Guo-Jin Wang. A mesh reconstruction algorithm driven by an intrinsic property of a point cloud. Computer-Aided Design, 36(1):1–9, 2004. pages 5 [31] Angel X Chang, Thomas Funkhouser, Leonidas Guibas, Pat Hanrahan, Qixing Huang, Zimo Li, Silvio Savarese, Manolis Savva, Shuran Song, Hao Su, et al. Shapenet: An information-rich 3d model repository. arXiv preprint arXiv:1512.03012, 2015. pages 5 [32] Radu Bogdan Rusu and Steve Cousins. 3D is here: Point Cloud Library (PCL). In IEEE International Conference on Robotics and Automation (ICRA), Shanghai, China, May 9-13 2011. pages 5 [33] James Binney and Michael Merrifield. Galactic astronomy. Princeton University Press, 1998. pages 5, 25 [34] AJ Connolly, I Csabai, AS Szalay, DC Koo, RG Kron, and JA Munn. Slicing through multicolor space: Galaxy redshifts from broadband photometry. arXiv preprint astro-ph/9508100, 1995. pages 5, 25 [35] Eduardo Rozo and Eli S Rykoff. redmapper ii: X-ray and sz performance benchmarks for the sdss catalog. The Astrophysical Journal, 783(2):80, 2014. pages 5, 25 [36] Zoubin Ghahramani and Katherine A Heller. Bayesian sets. In NIPS, volume 2, pages 22–23, 2005. pages 6, 7, 20, 21, 22 10 [37] B. Taskar, C. Guestrin, and D. Koller. Max-margin Markov networks. In S. Thrun, L. Saul, and B. Schölkopf, editors, Advances in Neural Information Processing Systems 16, pages 25–32, Cambridge, MA, 2004. MIT Press. pages 6 [38] Jonathan K. Pritchard, Matthew Stephens, and Peter Donnelly. Inference of population structure using multilocus genotype data. Genetics, 155(2):945–959, 2000. ISSN 0016-6731. URL http://www.genetics.org/content/155/2/945. pages 6, 22 [39] David M. Blei, Andrew Y. Ng, Michael I. Jordan, and John Lafferty. Latent dirichlet allocation. Journal of Machine Learning Research, 3:2003, 2003. pages 6, 22 [40] Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In Advances in neural information processing systems, pages 3111–3119, 2013. pages 7, 22 [41] Minmin Chen, Alice Zheng, and Kilian Weinberger. Fast image tagging. In Proceedings of The 30th International Conference on Machine Learning, pages 1274–1282, 2013. pages 7, 23 [42] S. L. Feng, R. Manmatha, and V. Lavrenko. Multiple bernoulli relevance models for image and video annotation. In Proceedings of the 2004 IEEE Computer Society Conference on Computer Vision and Pattern Recognition, CVPR’04, pages 1002–1009, Washington, DC, USA, 2004. IEEE Computer Society. pages 7, 23 [43] Ameesh Makadia, Vladimir Pavlovic, and Sanjiv Kumar. A new baseline for image annotation. In Proceedings of the 10th European Conference on Computer Vision: Part III, ECCV ’08, pages 316–329, Berlin, Heidelberg, 2008. Springer-Verlag. pages 7, 23 [44] Matthieu Guillaumin, Thomas Mensink, Jakob Verbeek, and Cordelia Schmid. Tagprop: Discriminative metric learning in nearest neighbor models for image auto-annotation. In Computer Vision, 2009 IEEE 12th International Conference on, pages 309–316. IEEE, 2009. pages 7, 23, 24 [45] Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In Proceedings of International Conference on Computer Vision (ICCV), 2015. pages 8 [46] Branko ´Curgus and Vania Mascioni. Roots and polynomials as homeomorphic spaces. Expositiones Mathematicae, 24(1):81–95, 2006. pages 13, 15 [47] Boris A Khesin and Serge L Tabachnikov. Arnold: Swimming Against the Tide, volume 86. American Mathematical Society, 2014. pages 15 [48] Jerrold E Marsden and Michael J Hoffman. Elementary classical analysis. Macmillan, 1993. pages 15 [49] Nicolas Bourbaki. Eléments de mathématiques: théorie des ensembles, chapitres 1 à 4, volume 1. Masson, 1990. pages 15 [50] C. A. Micchelli. Interpolation of scattered data: distance matrices and conditionally positive definite functions. Constructive Approximation, 2:11–22, 1986. pages 18 [51] Luis Von Ahn and Laura Dabbish. Labeling images with a computer game. In Proceedings of the SIGCHI conference on Human factors in computing systems, pages 319–326. ACM, 2004. pages 23 [52] Michael Grubinger. Analysis and evaluation of visual information systems performance, 2007. URL http://eprints.vu.edu.au/1435. Thesis (Ph. D.)–Victoria University (Melbourne, Vic.), 2007. pages 23 [53] Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollár, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In European Conference on Computer Vision, pages 740–755. Springer, 2014. pages 23 [54] Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. pages 25, 26, 27 [55] Djork-Arné Clevert, Thomas Unterthiner, and Sepp Hochreiter. Fast and accurate deep network learning by exponential linear units (elus). arXiv preprint arXiv:1511.07289, 2015. pages 27 11
2017
635
7,158
Optimal Shrinkage of Singular Values Under Random Data Contamination Danny Barash School of Computer Science and Engineering Hebrew University Jerusalem, Israel danny.barash@mail.huji.ac.il Matan Gavish School of Computer Science and Engineering Hebrew University Jerusalem, Israel gavish@cs.huji.ac.il Abstract A low rank matrix X has been contaminated by uniformly distributed noise, missing values, outliers and corrupt entries. Reconstruction of X from the singular values and singular vectors of the contaminated matrix Y is a key problem in machine learning, computer vision and data science. In this paper, we show that common contamination models (including arbitrary combinations of uniform noise, missing values, outliers and corrupt entries) can be described efficiently using a single framework. We develop an asymptotically optimal algorithm that estimates X by manipulation of the singular values of Y , which applies to any of the contamination models considered. Finally, we find an explicit signal-to-noise cutoff, below which estimation of X from the singular value decomposition of Y must fail, in a welldefined sense. 1 Introduction Reconstruction of low-rank matrices from noisy and otherwise contaminated data is a key problem in machine learning, computer vision and data science. Well-studied problems such as dimension reduction [3], collaborative filtering [24, 28], topic models [13], video processing [21], face recognition [35], predicting preferences [26], analytical chemistry [29] and background-foreground separation [4] all reduce, under popular approaches, to low-rank matrix reconstruction. A significant part of the literature on these problems is based on the singular value decomposition (SVD) as the underlying algorithmic component, see e.g. [7, 19, 23]. Understanding and improving the behavior of SVD in the presence of random data contamination therefore arises as a crucially important problem in machine learning. While this is certainly a classical problem [14, 17, 20], it remains of significant interest, owing in part to the emergence of low-rank matrix models for matrix completion and collaborative filtering [9, 34]. Let X be an m-by-n unknown low-rank matrix of interest (m ≤n), and assume that we only observe the data matrix Y , which is a contaminated or noisy version of X. Let Y = m X i=1 yiuiv′ i (1) be the SVD of the data matrix Y . Any algorithm based on the SVD essentially aims to obtain an estimate for the target matrix X from (1). Most practitioners simply form the Truncated SVD (TSVD) estimate [18] ˆXr = r X i=1 yiuiv′ i (2) 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. where r is an estimate of rank(X), whose choice in practice tends to be ad hoc [15]. Recently, [10, 16, 32] have shown that under white additive noise, it is useful to apply a carefully designed shrinkage function η : R →R to the data singular values, and proposed estimators of the form ˆXη = n X i=1 η(yi)uiv′ i . (3) Such estimators are extremely simple to use, as they involve only simple manipulation of the data singular values. Interestingly, in the additive white noise case, it was shown that a unique optimal shrinkage function η(y) exists, which asymptotically delivers the same performance as the best possible rotation-invariant estimator based on the data Y [16]. Singular value shrinkage thus emerged as a simple yet highly effective method for improving the SVD in the presence of white additive noise, with the unique optimal shrinker as a natural choice for the shrinkage function. A typical form of optimal singular value shrinker is shown in Figure 1 below, left panel. Shrinkage of singular values, an idea that can be traced back to Stein’s groundbreaking work on covariance estimation from the 1970’s [33], is a natural generalization of the classical TSVD. Indeed, ˆXr is equivalent to shrinkage with the hard thresholding shrinker η(y) = 1y≥λ, as (2) is equivalent to ˆXλ = n X i=1 1yi≥λuiv′ i (4) with a specific choice of the so-called hard threshold λ. While the choice of the rank r for truncation point TSVD is often ad hoc and based on gut feeling methods such as the Scree Plot method [11], its equivalent formulation, namely hard thresholding of singular values, allows formal and systematic analysis. In fact, restricting attention to hard thresholds alone [15] has shown that under white additive noise there exists a unique asymptotically optimal choice of hard threshold for singular values. The optimal hard threshold is a systematic, rational choice for the number of singular values that should be included in a truncated SVD of noisy data. [27] has proposed an algorithm that finds η∗in presence of additive noise and missing values, but has not derived an explicit shrinker. 1.1 Overview of main results In this paper, we extend this analysis to common data contaminations that go well beyond additive white noise, including an arbitrary combination of additive noise, multiplicative noise, missing-atrandom entries, uniformly distributed outliers and uniformly distributed corrupt entries. The primary contribution of this paper is formal proof that there exists a unique asymptotically optimal shrinker for singular values under uniformly random data contaminations, as well a unique asymptotically optimal hard threshold. Our results are based on a novel, asymptotically precise description of the effect of these data contaminations on the singular values and the singular vectors of the data matrix, extending the technical contribution of [16, 27, 32] to the setting of general uniform data contamination. General contamination model. We introduce the model Y = A ⊙X + B (5) where X is the target matrix to be recovered, and A, B are random matrices with i.i.d entries. Here, (A ⊙B)i,j = Ai,jBi,j is the Hadamard (entrywise) product of A and B. Assume that Ai,j iid∼(µA, σ2 A), meaning that the entries of A are i.i.d drawn from a distribution with mean µA and variance σ2 A, and that Bi,j iid∼(0, σ2 B). In Section 2 we show that for various choices of the matrix A and B, this model represents a broad range of uniformly distributed random contaminations, including an arbitrary combination of additive noise, multiplicative noise, missing-atrandom entries, uniformly distributed outliers and uniformly distributed corrupt entries. As a simple example, if B ≡0 and P(Ai,j = 1) = κ, then the Y simply has missing-at-random entries. 2 To quantify what makes a “good” singular value shrinker η for use in (3), we use the standard Mean Square Error (MSE) metric and L(η|X) = ˆXη(Y ) −X 2 F . Using the methods of [16], our results can easily be extended to other error metrics, such as the nuclear norm or operator norm losses. Roughly speaking, an optimal shrinker η∗has the property that, asymptotically as the matrix size grows, L(η∗|X) ≤L(η|X) for any other shrinker η and any low-rank target matrix X. The design of optimal shrinkers requires a subtle understanding of the random fluctuations of the data singular values y1, . . . , yn, which are caused by the random contamination. Such results in random matrix theory are generally hard to prove, as there are nontrivial correlations between yi and yj, i ̸= j. Fortunately, in most applications it is very reasonable to assume that the target matrix X is low rank. This allows us to overcome this difficulty by following [15, 27, 32] and considering an asymptotic model for low-rank X, inspired by Johnstone’s Spiked Covariance Model [22], in which the correlation between yi and yj, for i ̸= j vanish asymptotically. We state our main results informally at first. The first main result of this paper is the existence of a unique asymptotically optimal hard threshold λ∗in (4). Importantly, as E(Y ) = µAX, to apply hard thresholding to Y = A ⊙X + B we must from now on define ˆ Xλ = 1 µA n X i=1 1yi>λuiv′ i . Theorem 1. (Informal.) Let X be an m-by-n low-rank matrix and assume that we observe the contaminated data matrix Y given by the general contamination model (5). Then there exists a unique optimal (def. 3) hard threshold λ∗for the singular values of Y , given by λ∗= σB s c + 1 c   c + β c  where β = m/n and c = q 1 + β + p 1 + 14β + β2/ √ 2. Our second main result is the existence of a unique asymptotically optimal shrinkage function η∗in (equation (3)). We calculate this shrinker explicitly: Theorem 2. (Informal.) Assume everything as in Theorem 1. Then there exists a unique optimal (def. 3) shrinker η∗for the singular values of Y given by η∗(y) =          σ2 B yµA v u u t  y σB 2 −β −1 !2 −4β y ≥σB(1 + p β) 0 y < σB(1 + p β) We also discover that for each contamination model, there is a critical signal-to-noise cutoff, below which X cannot be reconstructed from the singular values and vectors of Y . Specifically, let η0 be the zero singular value shrinker, η0(y) ≡0, so that ˆXη0(Y ) ≡0. Define the critical signal level for a shrinker η by xcritical(η) = inf x {x : L(η|X) < L(η0|X)} where X = x˜u˜v′ is an arbitrary rank-1 matrix with singular value x. In other words, xcritical(η) is the smallest singular value of the target matrix, for which η still outperforms the trivial zero shrinker η0. As we show in Section 4, a target matrix X with a singular value below xcritical(η) cannot be reliably reconstructed using η. The critical signal level for the optimal shrinker η∗is of special importance, since a target matrix X with a singular value below xcritical(η∗) cannot be reliably reconstructed using any shrinker η. Restricting attention to hard thresholds only, we define xcritical(λ), the critical level for a hard threshold, similarly. Again, singular values of X that fall below xcritical(λ∗) cannot be reliably reconstructed using any hard threshold. Our third main result is the explicit calculation of these critical signal levels: 3 Theorem 3. (Informal.) Assume everything as in Theorem 1 and let c be as in Theorem 1. Let η∗be the optimal shrinker from Theorem 2 and let λ∗be the optimal hard threshold from Theorem 1. The critical signal levels for η∗and λ∗are given by: xcritical(η∗) = (σB/µA) · β 1 4 xcritical(λ∗) = (σB/µA) · c . Finally, one might ask what the improvement is in terms of the mean square error that is guaranteed by using the optimal shrinker and optimal threshold. As discussed below, existing methods are either infeasible in terms of running time on medium and large matrices, or lack a theory that can predict the reconstruction mean square error. For lack of a better candidate, we compare the optimal shrinker and optimal threshold to the default method, namely, TSVD. Theorem 4. (Informal.) Consider β = 1, and denote the worst-case mean square error of TSVD, η∗ and λ∗by MT SV D, Mη∗and Mλ∗, respectively, over a target matrix of low rank r. Then MT SV D = σB µA 2 5r Mη∗ = σB µA 2 2r Mλ∗ = σB µA 2 3r . Indeed, the optimal shrinker offers a significant performance improvement (specifically, an improvement of 3r(σB/µA)2, over the TSVD baseline. 0 1 2 3 4 5 6 y 0 1 2 3 4 5 6 η(y) β=0.3 β=0.6 β=1 0.15 0.25 0.35 0.45 0.55 0.65 0.75 0.85 0.95 κ 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 2.2 2.4 2.6 2.8 3 x Threshold Critical Shrinker Critical Figure 1: Left: Optimal shrinker for additive noise and missing-at-random contamination. Right: Phase plane for critical signal levels, see Section 6, Simulation 2. Our main results allow easy calculation of the optimal threshold, optimal shrinkage and signal-to-noise cutoffs for various specific contamination models. For example: 1. Additive noise and missing-at-random. Let X be an m-by-n low-rank matrix. Assume that some entries are completely missing and the rest suffer white additive noise. Formally, we observe the contaminated matrix Yi,j = Xi,j + Zi,j w.p. κ 0 w.p. 1 −κ , where Zi,j iid∼(0, σ2), namely, follows an unknown distribution with mean 0 and variance σ2. Let β = m/n. Theorem 1 implies that in this case, the optimal hard threshold for the singular values of Y is λ∗= p σ2κ (c + 1/c) (c + β/c) where c = q 1 + β + p 1 + 14β + β2/ √ 2. In other words, the optimal location (w.r.t mean square error) to truncate the singular values of Y , in order to recover X, is given by λ∗. The 4 optimal shrinker from Theorem 2 for this contamination mode may be calculated similarly, and is shown in Figure 1, left panel. By Theorem 4, the improvement in mean square error obtained by using the optimal shrinker, over the TSVD baseline, is 3rσ2/κ, quite a significant improvement. 2. Additive noise and corrupt-at-random. Let X be an m-by-n low-rank matrix. Assume that some entries are irrecoverably corrupt (replaced by random entries), and the rest suffer white additive noise. Formally, Yi,j = Xi,j + Zi,j w.p. κ Wi,j w.p. 1 −κ . Where Zi,j iid∼(0, σ2), Wi,j iid∼(0, τ 2), and τ is typically large. Let ˜σ = p κσ2 + (1 −κ)τ 2. The optimal shrinker, which should be applied to the singular values of Y , is given by: η∗(y) =    ˜σ2/(yκ) q(y/˜σ)2 −β −1 2 −4 y ≥˜σ(1 + p β) 0 y < ˜σ(1 + p β) . By Theorem 4, the improvement in mean square error, obtained by using the optimal shrinker, over the TSVD baseline, is 3r(κσ2 + (1 −κ)τ 2)/κ2. 1.2 Related Work The general data contamination model we propose includes as special cases several modes extensively studied in the literature, including missing-at-random and outliers. While it is impossible to propose a complete list of algorithms to handle such data, we offer a few pointers, organized around the notions of robust principal component analysis (PCA) and matrix completion. To the best of our knowledge, the precise effect of general data contamination on the SVD (or the closely related PCA) has not been documented thus far. The approach we propose, based on careful manipulation of the data singular values, enjoys three distinct advantages. One, its running time is not prohibitive; indeed, it involves a small yet important modification on top of the SVD or TSVD, so that it is available whenever the SVD is available. Two, it is well understood and its performance (say, in mean square error) can be reliably predicted by the available theory. Three, to the best of our knowledge, none of the approaches below have become mainstream, and most practitioners still turn to the SVD, even in the presence of data contamination. Our approach can easily be used in practice, as it relies on the well-known and very widely used SVD, and can be implemented as a simple modification on top of the existing SVD implementations. Robust Principle Component Analysis (RPCA). In RPCA, one assumes Y = X + W where X is the low rank target matrix and W is a sparse outliers matrix. Classical approaches such as influence functions [20], multivariate trimming [17] and random sampling techniques [14] lack a formal theoretical framework and are not well understood. More modern approaches based on convex optimization [9, 34] proposed reconstructing X from Y via the nuclear norm minimization min X ||X||∗+ λ ||Y −X||1 , whose runtime and memory requirements are both prohibitively large in medium and large matrices. Matrix Completion. There are numerous heuristic approaches for data analysis in the presence of missing values [5, 30, 31]. To the best of our knowledge, there are no formal guarantees of their performance. When the target matrix is known to be low rank, the reconstruction problem is known as matrix completion. [7–9] and numerous other authors have shown that a semi-definite program may be used to stably recover the target matrix, even in the presence of additive noise. Here too, the runtime and memory requirements are both prohibitively large in medium and large matrices, making these algorithms infeasible in practice. 2 A Unified Model for Uniformly Distributed Contamination Contamination modes encountered in practice are best described by a combination of primitive modes, shown in Table 1 below. These primitive contamination modes fit into a single template: 5 Definition 1. Let A and B be two random variables, and assume that all moments of A and B are bounded. Define the contamination link function fA,B(x) = Ax + B . Given a matrix X, define the corresponding contaminated matrix Y with entries Yi,j indep. ∼fA,B(Xi,j) . (6) Now observe that each of the primitive modes above corresponds to a different choice of random variables A and B, as shown in Table 1. Specifically, each of the primitive modes is described by a different assignment to A and B. We employ three different random variables in these assignments: Z iid∼(0, σ2/n), a random variable describing multiplicative or additive noise; W iid∼(0, τ 2/n), a random variable describing a large “outlier” measurement; and M iid∼Bernoulli(κ) describing a random choice of “defective” entries, such as a missing value, an outlier and so on. Table 1: Primitive modes fit into the model (6). By convention, Y is m-by-n, Z iid∼(0, σ2/n) denotes a noise random variable, W iid∼(0, τ 2/n) denotes an outlier random variable and M iid∼Bernoulli(κ) is a contaminated entry random variable. mode model A B levels i.i.d additive noise Yi,j = Xi,j + Zi,j 1 Z σ i.i.d multiplicative noise Yi,j = Xi,j Zi,j Z 0 σ missing-at-random Yi,j = Mi,j Xi,j M 0 κ outliers-at-random Yi,j = Xi,j + Mi,jWi,j 1 MW κ,τ corruption-at-random Yi,j = Mi,jXi,j + (1 −Mi,j)Wi,j M (1 −M)W κ,τ Actual datasets rarely demonstrate a single primitive contamination mode. To adequately describe contamination observed in practice, one usually needs to combine two or more of the primitive contamination modes into a composite mode. While there is no point in enumerating all possible combinations, Table 2 offers a few notable composite examples, using the framework (6). Many other examples are possible of course. 3 Signal Model Following [32] and [15], as we move toward our formal results we are considering an asymptotic model inspired by Johnstone’s Spiked Model [22]. Specifically, we are considering a sequence of increasingly larger data target matrices Xn, and corresponding data matrices Yn iid∼fAn,Bn(Xn). We make the following assumptions regarding the matrix sequence {Xn}: A1 Limiting aspect ratio: The matrix dimension mn × n sequence converges: mn/n →β as n →∞. To simplify the results, we assume 0 < β ≤1. A2 Fixed signal column span: Let the rank r > 0 be fixed and choose a vector x ∈Rr with coordinates x = (x1, . . . xr) such that x1 > . . . > xr > 0. Assume that for all n Xn = ˜Un diag(x1, . . . , xr) ˜Vn is an arbitrary singular value decomposition of Xn, Table 2: Some examples of composite contamination modes and how they fit into the model (6). Z,W,M are the same as in Table 1. mode A B levels Additive noise and missing-at-random M ZM σ,κ Additive noise and corrupt-at-random M ZM + W(1 −M) σ,κ,τ multiplicative noise and corrupt-at-random ZM W(1 −M) σ,κ,τ Additive noise and outliers 1 Z + W(1 −M) σ,κ,τ 6 A3 Incoherence of the singular vectors of Xn: We make one of the following two assumptions regarding the singular vectors of Xn: A3.1 Xn is random with an orthogonally invariant distribution. Specifically, ˜Un and ˜Vn, which follow the Haar distribution on orthogonal matrices of size mn and n, respectively. A3.2 The singular vectors of Xn are non-concentrated. Specifically, each left singular vector ˜un,i of Xn (the i-th column of ˜Un) and each right singular vector ˜vn,j of Xn (the j-th column of ˜Vn) satisfy1 ||˜un,i||∞≤C logD(mn) √mn and ||˜vn,j||∞≤C logD(n) √n for any i, j and fixed constants C, D. Definition 2. (Signal model.) Let An iid∼(µA, σ2 A/n) and Bn iid∼(0, σ2 B/n) have bounded moments. Let Xn follow assumptions [A1]–[A3] above. We say that the matrix sequence Yn = fAn,Bn(Xn) follows our signal model, where fA,B(X) is as in Definition 1. We further denote Xn = Pr i=1 xi˜un,i˜vn,i for the singular value decomposition of Xn and Yn = Pm i=1 yn,iun,ivn,i for the singular value decomposition of Yn. 4 Main Results Having described the contamination and the signal model, we can now formulate our main results. All proofs are deferred to the Supporting Information. Let Xn and Yn follow our signal model, Definition 2, and write x = (x1, . . . , xr) for the non-zero singular values of Xn. For a shrinker η, we write L∞(η|x) a.s. = lim n→∞ ˆXn(Yn) −Xn 2 F . assuming the limit exists almost surely. The special case of hard thresholding at λ is denoted as L∞(η|x). Definition 3. Optimal shrinker and optimal threshold. A shrinker η∗is called optimal if L∞(η|x) ≤L∞(η|x) for any shrinker η, any r ≥1 and any x = (x1, . . . , xr). Similarly, a threshold λ is called optimal if L∞(λ∗|x) ≤L∞(λ|x) for any threshold λ, any r ≥1 and any x = (x1, . . . , xr). With these definitions, our main results Theorem 2 and Theorem 1 become formal. To make Theorem 3 formal, we need the following lemma and definition. Lemma 1. Decomposition of the asymptotic mean square error. Let Xn and Yn follow our signal model (Definition 2) and write x = (x1, . . . , xr) for the non-zero singular values of Xn, and let η be the optimal shrinker. Then the limit L∞(η|x) a.s. exists, and L∞(η|x) a.s. = Pr i=1 L1(η|x), where L1(η|x) =      x2  1 − (t4 −β)2 (t4 + βt2)(t4 + t2)  t ≥β 1 4 x2 t < β 1 4 where t = (µA · x)/σB. Similarly, for a threshold λ we have L∞(λ|x) = Pr i=1 L1(λ|x) with L1(λ|x) =      σB µA 2  t + 1 t   t + β t  −  t2 −2β t2  µAx ≥x(λ) x2 µAx < x(λ) Where x(y) =      (σB/ √ 2µA) r (y/σB)2 −β −1 + q1 + β −(y/σB)22 −4β t ≥β 1 4 0 t < β 1 4 (7) 1The incoherence assumption is widely used in related literature [6, 12, 27], and asserts that the singular vectors are spread out so X is not sparse and does not share singular subspaces with the noise. 7 Definition 4. Let η0 be the zero singular value shrinker, η0(y) ≡0, so that ˆXη0(Y ) ≡0. Let η be a singular value shrinker. The critical signal level for η is xcritical(η) = inf x {L1(η|X) < L1(η0|X)} As we can see, the asymptotic mean square error decomposes over the singular values of the target matrix, x1, . . . , xr. Each value xi that falls below xcritical(η) is better estimated with the zero shrinker η0 than with η. It follows that any xi that falls below xcritical(η∗), where η∗is the optimal shrinker, cannot be reliably estimated by any shrinker η, and its corresponding data singular value yi should simply be set to zero. This makes Theorem 2 formal. 5 Estimating the model parameters In practice, using the optimal shrinker we propose requires an estimate of the model parameters. In general, σB is easy to estimate from the data via a median-matching method [15], namely ˆσB = ymed √nµβ , where ymed is the median singular value of Y, and µβ is the median of the Mar˘cenko-Pastur distribution. However, estimation of µA and σA must be considered on a case-by-case basis. For example, in the “Additive noise and missing at random” mode (table 2), σA ≡1 is known, and µA is estimated by dividing the amount of missing values by the matrix size. 6 Simulation Simulations were performed to verify the correctness of our main results2. For more details, see Supporting Information. 1. Critical signal level xcritical(λ∗) under increasing noise. Figure 2, left panel, shows the amount of data singular values yi above xcritical(λ∗), as a function of the fraction of missing values κ. Theorem 3 correctly predicts the exact values of κ at which the “next” data singular value falls below xcritical(λ∗). 2. Phase plane for critical signal levels xcritical(η∗) and xcritical(λ∗). Figure 1, right panel, shows the x, κ plane, where x is the signal level and κ is the fraction of missing values. At each point in the plane, several independent data matrices were generated. Heatmap shows the fraction of the experiments at which the data singular value y1 was above xcritical(η∗) and xcritical(λ∗). The overlaid graphs are theoretical predictions of the critical points. 3. Brute-force verification of the optimal shrinker shape. Figure 2, right panel, shows the shape of the optimal shrinker (Theorem 1). We performed a brute-force search for the value of η(y) that produces the minimal mean square error. A brute force search, performed with a relatively small matrix size, matches the asymptotic shape of the optimal shrinker. 7 Conclusions Singular value shrinkage emerges as an effective method to reconstruct low-rank matrices from contaminated data that is both practical and well understood. Through simple, carefully designed manipulation of the data singular values, we obtain an appealing improvement in the reconstruction mean square error. While beyond our present scope, following [16], it is highly likely that the optimal shrinker we have developed offers the same mean square error, asymptotically, as the best rotation-invariant estimator based on the data, making it asymptotically the best SVD-based estimator for the target matrix. 2The full Matlab code that generated the figures in this paper and in the Supporting Information is permanently available at https://purl.stanford.edu/kp113fq0838. 8 0 0.2 0.4 0.6 0.8 1 κ 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 Number of estimable singular values 1 1.5 2 2.5 3 3.5 4 4.5 y -1 0 1 2 3 4 5 6 η(y) Theoretical Empirical Figure 2: Left: empirical validation of the predicted critical signal level (Simulation 1). Right: Empirical validation of the optimal shrinker shape (Simulation 3). Acknowledgements DB was supported by Israeli Science Foundation grant no. 1523/16 and German-Israeli Foundation for scientific research and development program no. I-1100-407.1-2015. References [1] Benaych-Georges, Florent and Nadakuditi, Raj Rao. The singular values and vectors of low rank perturbations of large rectangular random matrices. Journal of Multivariate Analysis, 111: 120–135, 2012. ISSN 0047259X. [2] Bloemendal, Alex, Erdos, Laszlo, Knowles, Antti, Yau, Horng Tzer, and Yin, Jun. Isotropic local laws for sample covariance and generalized Wigner matrices. Electronic Journal of Probability, 19(33):1–53, 2014. ISSN 10836489. [3] Boutsidis, Christos, Zouzias, Anastasios, Mahoney, Michael W, and Drineas, Petros. Randomized dimensionality reduction for k-means clustering. IEEE Transactions on Information Theory, 61(2):1045–1062, 2015. [4] Bouwmans, Thierry, Sobral, Andrews, Javed, Sajid, Ki, Soon, and Zahzah, El-hadi. Decomposition into low-rank plus additive matrices for background / foreground separation : A review for a comparative evaluation with a large-scale dataset. Computer Science Review, 2016. ISSN 1574-0137. [5] Buuren, Stef and Groothuis-Oudshoorn, Karin. mice: Multivariate imputation by chained equations in r. Journal of statistical software, 45(3), 2011. [6] Cai, Jian-Feng, Candes, Emmanuel J., and Zuowei, Shen. A singular value thresholding algorithm for matrix completion. 2010 Society for Industrial and Applied Mathematics, 20(4): 1956–1982, 2010. [7] Candes, Emmanuel J. and Plan, Yaniv. Matrix completion with noise. Proceedings of the IEEE, 98(6):925–936, 2010. ISSN 00189219. [8] Candes, Emmanuel J and Plan, Yaniv. Matrix completion with noise. Proceedings of the IEEE, 98(6):925–936, 2010. [9] Candès, Emmanuel J., Li, Xiaodong, Ma, Yi, and Wright, John. Robust principal component analysis? Journal of the ACM, 58(3):1–37, may 2011. ISSN 00045411. [10] Candes, Emmanuel J, Sing-Long, Carlos A, and Trzasko, Joshua D. Unbiased risk estimates for singular value thresholding and spectral estimators. IEEE transactions on signal processing, 61 (19):4643–4657, 2013. 9 [11] Cattell, Raymond B. The scree test for the number of factors. Multivariate Behavioral Research, 1(2):245–276, 1966. [12] Chandrasekaran, Venkat, Sanghavi, Sujay, Parrilo, Pablo a., and Willsky, Alan S. Rank-Sparsity Incoherence for Matrix Decomposition. SIAM Journal on Optimization, 21(2):572–596, 2011. ISSN 1052-6234. [13] Das, Rajarshi, Zaheer, Manzil, and Dyer, Chris. Gaussian lda for topic models with word embeddings. In ACL (1), pp. 795–804, 2015. [14] Fischler, Martin A and Bolles, Robert C. Random sample consensus: a paradigm for model fitting with applications to image analysis and automated cartography. Communications of the ACM, 24(6):381–395, 1981. [15] Gavish, Matan and Donoho, David L. The optimal hard threshold for singular values is 4/sqrt(3). IEEE Transactions on Information Theory, 60(8):5040–5053, 2014. ISSN 00189448. [16] Gavish, Matan and Donoho, David L. Optimal shrinkage of singular values. IEEE Transactions on Information Theory, 63(4):2137–2152, 2017. [17] Gnanadesikan, Ramanathan and Kettenring, John R. Robust estimates, residuals, and outlier detection with multiresponse data. Biometrics, pp. 81–124, 1972. [18] Golub, Gene and Kahan, William. Calculating the singular values and pseudo-inverse of a matrix. Journal of the Society for Industrial and Applied Mathematics, Series B: Numerical Analysis, 2(2):205–224, 1965. [19] Hastie, Trevor, Tibshirani, Robert, Sherlock, Gavin, Brown, Patrick, Botstein, David, and Eisen, Michael. Imputing Missing Data for Gene Expression Arrays Imputation using the SVD. Technical Report, pp. 1–9, 1999. [20] Huber, Peter J. Robust statistics. Springer, 2011. [21] Ji, Hui, Liu, Chaoqiang, Shen, Zuowei, and Xu, Yuhong. Robust video denoising using low rank matrix completion. 2010 IEEE Computer Society Conference on Computer Vision and Pattern Recognition, pp. 1791–1798, 2010. ISSN 1063-6919. [22] Johnstone, Iain M. On the distribution of the largest eigenvalue in principal components analysis. The Annals of Statistics, 29(2):295–327, 2001. [23] Lin, Zhouchen, Chen, Minming, and Ma, Yi. The Augmented Lagrange Multiplier Method for Exact Recovery of Corrupted Low-Rank Matrices. 2013. [24] Luo, Xin, Zhou, Mengchu, Xia, Yunni, and Zhu, Qingsheng. An efficient non-negative matrix-factorization-based approach to collaborative filtering for recommender systems. IEEE Transactions on Industrial Informatics, 10(2):1273–1284, 2014. [25] Marcenko, V. A. and Pastur, L. A. Distribution of eigenvalues for some sets of random matrices. Math. USSR-Sbornik, 1(4):457–483, 1967. [26] Meloun, Milan, Capek, Jindrich, Miksk, Petr, and Brereton, Richard G. Critical comparison of methods predicting the number of components in spectroscopic data. Analytica Chimica Acta, 423(1):51–68, 2000. [27] Nadakuditi, Raj Rao. OptShrink: An algorithm for improved low-rank signal matrix Denoising by optimal, data-driven singular value shrinkage. IEEE Transactions on Information Theory, 60 (5):3002–3018, 2014. ISSN 00189448. [28] Rao, Nikhil, Yu, Hsiang-Fu, Ravikumar, Pradeep K, and Dhillon, Inderjit S. Collaborative filtering with graph information: Consistency and scalable methods. In Advances in neural information processing systems, pp. 2107–2115, 2015. 10 [29] Rennie, Jasson Dm M and Srebro, Nathan. Fast Maximum Margin Matrix Factorization for Collaborative Prediction. Proceedings of the 22Nd International Conference on Machine Learning, pp. 713–719, 2005. ISSN 1595931805. doi: 10.1145/1102351.1102441. URL http://doi.acm.org/10.1145/1102351.1102441. [30] Rubin, Donald B. Multiple imputation after 18+ years. Journal of the American statistical Association, 91(434):473–489, 1996. [31] Schafer, Joseph L. Analysis of incomplete multivariate data. CRC press, 1997. [32] Shabalin, Andrey A and Nobel, Andrew B. Reconstruction of a low-rank matrix in the presence of Gaussian noise. Journal of Multivariate Analysis, 118:67–76, 2013. ISSN 0047-259X. [33] Stein, Charles M. Lectures on the theory of estimation of many parameters. Journal of Soviet Mathematics, 74(5), 1986. URL http://link.springer.com/article/10.1007/ BF01085007. [34] Wright, John, Peng, Yigang, Ma, Yi, Ganesh, Arvind, and Rao, Shankar. Robust Principal Component Analysis: Exact Recovery of Corrupted Low-Rank Matrices. Advances in Neural Information Processing Systems (NIPS), pp. 2080—-2088, 2009. ISSN 0010-3640. [35] Yang, Jian, Qian, Jianjun, Luo, Lei, Zhang, Fanlong, and Gao, Yicheng. Nuclear norm based matrix regression with applications to face recognition with occlusion and illumination changes. IEEE Transactions on Pattern Analysis and Machine Intelligence Machine Intelligence, pp(99): 1–1, 2016. ISSN 0162-8828. 11
2017
636
7,159
Learning Mixture of Gaussians with Streaming Data Aditi Raghunathan Stanford University aditir@stanford.edu Prateek Jain Microsoft Research, India prajain@microsoft.com Ravishankar Krishnaswamy Microsoft Research, India rakri@microsoft.com Abstract In this paper, we study the problem of learning a mixture of Gaussians with streaming data: given a stream of N points in d dimensions generated by an unknown mixture of k spherical Gaussians, the goal is to estimate the model parameters using a single pass over the data stream. We analyze a streaming version of the popular Lloyd’s heuristic and show that the algorithm estimates all the unknown centers of the component Gaussians accurately if they are sufficiently separated. Assuming each pair of centers are Cσ distant with C = Ω((k log k)1/4σ) and where σ2 is the maximum variance of any Gaussian component, we show that asymptotically the algorithm estimates the centers optimally (up to certain constants); our center separation requirement matches the best known result for spherical Gaussians [18]. For finite samples, we show that a bias term based on the initial estimate decreases at O(1/poly(N)) rate while variance decreases at nearly optimal rate of σ2d/N. Our analysis requires seeding the algorithm with a good initial estimate of the true cluster centers for which we provide an online PCA based clustering algorithm. Indeed, the asymptotic per-step time complexity of our algorithm is the optimal d · k while space complexity of our algorithm is O(dk log k). In addition to the bias and variance terms which tend to 0, the hard-thresholding based updates of streaming Lloyd’s algorithm is agnostic to the data distribution and hence incurs an approximation error that cannot be avoided. However, by using a streaming version of the classical (soft-thresholding-based) EM method that exploits the Gaussian distribution explicitly, we show that for a mixture of two Gaussians the true means can be estimated consistently, with estimation error decreasing at nearly optimal rate, and tending to 0 for N →∞. 1 Introduction Clustering data into homogeneous clusters is a critical first step in any data analysis/exploration task and is used extensively to pre-process data, form features, remove outliers and visualize data. Due to the explosion in amount of data collected and processed, designing clustering algorithms that can handle large datasets that do not fit in RAM is paramount to any big-data system. A common approach in such scenarios is to treat the entire dataset as a stream of data, and then design algorithms which update the model after every few points from the data stream. In addition, there are several practical applications where the data itself is not available beforehand and is streaming in, for example in any typical online system like web-search. For such a model, the algorithm of choice in practice is the so-called streaming k-means heuristic. It is essentially a streaming version of the celebrated k-means algorithm or Lloyd’s heuristic [8]. The basic k-means algorithm is designed for offline/batch data where each data point is assigned to the nearest centroid and the centroids are then updated based on the assigned points; this process is iterated till the solution is locally optimal. The streaming version of the k-means algorithm assigns the new point from the stream to the closest centroid and updates this centroid immediately. That is, unlike offline k-means which first assigns all the points to the respective centroids and then updates 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. the centroids, the streaming algorithm updates the centroids after each point, making it much more space efficient. While streaming k-means and its several variants are used heavily in practice, their properties such as solution quality, time complexity of convergence have not been studied widely. In this paper, we attempt to provide such a theoretical study of the streaming k-means heuristic. One of the big challenges is that even the (offline) k-means algorithm attempts to solve a non-convex NP-hard problem. Streaming data poses additional challenges because of the large noise in each point that can deviate the solution significantly. In the offline setting, clustering algorithms are typically studied under certain simplifying assumptions that help bypass the worst-case NP-hardness of these problems. One of the most widely studied setting is when the data is sampled from a mixture of well-separated Gaussians [5, 18, 1], which is also the generative assumption that we impose on the data in this work. However, the online/streaming version of the k-means algorithm has not been studied in such settings. In this work, we design and study a variant of the popular online k-means algorithm where the data is streaming-in, we cannot store more than logarithmically many data points, and each data point is sampled from a mixture of well-separated spherical Gaussians. The goal of the algorithm is then to learn the means of each of the Gaussians; note that estimating other parameters like variance, and weight of each Gaussian in the mixture becomes simple once the true means are estimated accurately. Our Results. Our main contribution is the first bias-variance bound for the problem of learning Gaussian mixtures with streaming data. Assuming that the centers are separated by Cσ where C = Ω(√log k) and if we seed the algorithm with initial cluster centers that are ≤Cσ/20 distance away from the true centers, then we show that the error in estimating the true centers can be decomposed into three terms and bound each one of them: (a) the bias term, i.e., the term dependent on distance of true means to initial centers decreases at a 1/poly(N) rate, where N is the number of data points observed so far, (b) the variance term is bounded by σ2 d log N N  where σ is the standard deviation of each of the Gaussians, and d is the dimensionality of the data, and (c) an offline approximation error: indeed, note that even the offline Lloyd’s heuristic will have an approximation error due to its hard-thresholding nature. For example, even when k = 2, and the centers are separated by Cσ, around exp(−C2 8 ) fraction of points from the first Gaussian will be closer to the second center, and so the k-means heuristic will converge to centers that are at a squared distance of roughly O(C2) exp(−C2 8 )σ2 from the true means. We essentially inherit this offline error up to constants. Note that the above result holds at a center separation of Ω(√log kσ) distance, which is substantially weaker than the currently best-known result of Ω(σk1/4) for even the offline problem [18]. However, as mentioned before, this only holds provided we have a good initialization. To this end, we show that when C = Ω(σ(k log k)1/4), we can combine an online PCA algorithm [9, 11] with the batch k-means algorithm on a small seed sample of around O(k log k) points, to get such an initialization. Note that this separation requirement nearly matches the best-known result offline results [18]. Finally, we also study a soft-version of streaming k-means algorithm, which can also be viewed as the streaming version of the popular Expectation Maximization (EM) algorithm. We show that for mixture of two well-separated Gaussians, a variant of streaming EM algorithm recovers the above mentioned bias-variance bound but without the approximation error. That is, after observing infinite many samples, streaming EM converges to the true means and matches the corresponding offline results in [3, 6]; to the best of our knowledge this is also first such consistency result for the streaming mixture problem. However, the EM updates require that the data is sampled from mixture of Gaussians, while the updates of streaming Lloyd’s algorithm are agnostic of the data distribution and hence same updates can be used to solve arbitrary mixture of sub-Gaussians as well. Technical Challenges. One key technical challenge in analyzing streaming k-means algorithm in comparison to the standard streaming regression style problems is that the offline problem itself is non-convex and moreover can only be solved approximately. Hence, a careful analysis is required to separate out the error we get in each iteration in terms of the bias, variance, and inherent approximation error terms. Moreover, due to the non-convexity, we are able to guarantee decrease in error only if each of our iterates lies in a small ball around the true mean. While this is initially true due to the initialization algorithm, our intermediate centers might escape these balls during our update. However, we show using a delicate martingale based argument that with high probability, our estimates stay within slightly larger balls around the true means, which turns out to be sufficient for us. 2 Related Work. A closely related work to ours is an independent work by [17] which studies a stochastic version of k-means for data points that satisfy a spectral variance condition which can be seen as a deterministic version of the mixture of distributions assumption. However, their method requires multiple passes over the data, thus doesn’t fit directly in the streaming k-means setting. In particular, the above mentioned paper analyzes the stochastic k-means method only for highly accurate initial set of iterates which requires a large burn-in period of t = O(N 2) and hence needs O(N) passes over the data, where N is the number of data points. Tensor methods [1, 10] can also be extended to cluster streaming data points sampled from a mixture distribution but these methods suffer from large sample/time complexity and might not provide reasonable results when the data distribution deviates from the assumed generative model. In addition to the gaussian mixture model, clustering problems are also studied under other models such as data with small spectral variance [12], stability of data [4], etc. It would be interesting to study the streaming versions in such models as well. Paper Outline. We describe our models and problem setup in Section 2. We then present our streaming k-means algorithm and its proof overview in Sections 3 and 4. We then discuss the initialization procedure in Section 5. Finally we describe our streaming-EM algorithm in Section 6. 2 Setup and Notation We assume that the data is drawn from a mixture of k spherical Gaussians distributions, i.e., xt i.i.d ∼ X i wiN(µ⋆ i , σ2I), µ⋆ i ∈Rd ∀i = 1, 2, . . . k (1) where µ⋆ i ∈Rd is the mean of the i-th mixture component, mixture weights wi ≥0, and P i wi = 1. All the problem parameters (i.e., the true means, the variance σ2 and the mixture weights) are unknown to the algorithm. Using the standard streaming setup, where the tth sample xt ∈Rd is drawn from the data distribution, our goal is to produce an estimate ˆµi of µ⋆ i for i = 1, 2, . . . k in a single pass over the data using bounded space. Center Separation. A suitable notion of signal to noise ratio for our problem turns out to be the ratio of minimum separation between the true centers and the maximum variance along any direction. We denote this ratio by C = mini,j ∥µ⋆ i −µ⋆ j ∥ σ . For convenience, we also denote ∥µ⋆ i −µ⋆ j ∥ σ by Cij. Here and in the rest of the paper, ∥y∥is the Euclidean norm of a vector y. We use η to denote the learning rate of the streaming updates and µt i to denote the estimate of µ⋆ i at time t. Remarks. For a cleaner presentation, we assume that all the mixture weights are 1/k, but our results hold with general weights as long as an appropriate center separation condition is satisfied. Secondly, our proofs also go through when the Gaussians have different variances σi2, as long as the separation conditions are satisfied with σ = maxi σi. We furnish details in the full version of this paper [14]. 3 Algorithm and Main Result In this section, we describe our proposed streaming clustering algorithm and present our analysis of the algorithm. At a high level, we follow the approach of various recent results for (offline) mixture recovery algorithms [18, 12]. That is, we initialize the algorithm with an SVD style operation which de-noises the data significantly in Algorithm 1 and then apply our streaming version of Lloyd’s heuristic in Algorithm 2. Note that the Lloyd’s algorithm is agnostic to the underlying distribution and does not include distribution specific terms like variance etc. Intuitively, the initialization algorithm first computes an online batch PCA in the for-loop. After this step, we perform an offline distance-based clustering on the projected subspace (akin to VempalaWang for the offline algorithm). Note that since we only need estimates for centers within a suitable proximity from the true centers, this step only uses few (roughly k log k) samples. These centers are fed as the initial centers for the streaming update algorithm. The streaming algorithm then, for each new sample, updates the current center which is closest to the sample, and iterates. 3 Figure 1: Illustration of optimal K-means error Algorithm 1 InitAlg(N0) U ←random orthonormal matrix ∈Rd×k B = Θ(d log d), S = 0 for t = 1 to N0 −k log k do if mod(t, B) = 0 then U ←QR(S · U), S ←0 end if Receive xt as generated by the input stream S = S + xt(xt)T end for X0 = [xN0−k log k+1, . . . , xN0] Form nearest neighbor graph using U T X0 and find connected components [ν0 1, . . . , ν0 k] ←mean of points in each component Return: [µ0 1, . . . , µ0 k] = [Uν0 1, . . . , Uν0 k] Algorithm 2 StreamKmeans(N, N0) 1: Set η ←3k log 3N N . 2: Set {µ0 1, . . . , µ0 k} ←InitAlgo(N0). 3: for t = 1 to N do 4: Receive xt+N0 given by the input stream 5: x = xt+N0 6: Let it = arg mini ∥x −µt−1 i ∥. 7: Set µt it = (1 −η)µt−1 it + ηx 8: Set µt i = µt−1 i for i ̸= it 9: end for 10: Output: µN 1 , . . . , µN k We now present our main result for the streaming clustering problem. Theorem 1. Let xt, 1 ≤t ≤N + N0 be generated using a mixture of Gaussians (1) with wi = 1/k, ∀i. Let N0, N ≥O(1)k3d3 log d and C ≥Ω((k log k)1/4). Then, the mean estimates (µN 1 , . . . , µN k ) output by Algorithm 2 satisfies the following error bound: E "X i ∥µN i −µ⋆ i ∥2 # ≤maxi ∥µ⋆ i ∥2 NΩ(1) | {z } bias +O(k3)    σ2 d log N N | {z } variance + exp(−C2/8)(C2 + k)σ2 | {z } ≈offline k−means error    . Our error bound consists of three key terms: bias, variance, and offline k-means error, with bias and variance being standard statistical error terms: (i) bias is dependent on the initial estimation error and goes down at N ζ rate where ζ > 1 is a large constant; (ii) variance error is the error due to noise in each observation xt and goes down at nearly optimal rate of ≈σ2 d N albeit with an extra log N term as well as worse dependence on k; and (iii) an offline k-means error, which is the error that even the offline Lloyds’ algorithm would incur for a given center separation C. Note that while sampling from the mixture distribution, ≈exp(−C2/8) fraction of data-points can be closer to the true means of other clusters rather than their own mean, because the tails of the distributions overlap. Hence, in general it is not possible to assign back these points to the correct cluster, without any modeling assumptions. These misclassified points will shift the estimated centers along the line joining the means. See Figure 3 for an illustration. This error can however be avoided by performing soft updates, which is discussed in Section 6. Time, space, and sample complexity: Our algorithm has nearly optimal time complexity of O(d·k) per iteration; the initialization algorithm requires about O(d4k3) time. Space complexity of our algorithm is O(dk · log k) which is also nearly optimal. Finally, the sample complexity is O(d3k3), which is a loose upper bound and can be significantly improved by a more careful analysis. To compare, the best known sample complexity for the offline setting is ˜O(kd) [2], which is better by a factor of (dk)2. 4 Analysis Overview. The proof of Theorem 1 essentially follows from the two theorems stated below: a) update analysis given a good initialization; b) InitAlg analysis for showing such an initialization. Theorem 2 (Streaming Update). Let xt, N0 + 1 ≤t ≤N + N0 be generated using a mixture of Gaussians (1) with wi = 1/k, ∀i, and N = Ω(k3d3 log kd). Also, let the center-separation C ≥ Ω(√log k), and also suppose our initial centers µ0 i are such that for all 1 ≤i ≤k, ∥µ0 i −µ⋆ i ∥≤Cσ 20 . Then, the streaming update of StreamKmeans(N, N0) , i.e, Steps 3-8 of Algorithm 2 satisfies: E "X i ∥µN i −µ⋆ i ∥2 # ≤maxi ∥µ⋆ i ∥2 NΩ(1) + O(k3)  exp(−C2/8)(C2 + k)σ2 + log N N dσ2  . Note that our streaming update analysis requires only C = Ω(√log k) separation but needs appropriate initialization that is guaranteed by the below result. Theorem 3 (Initialization). Let xt, 1 ≤t ≤N0 be generated using a mixture of Gaussians (1) with wi = 1/k, ∀i. Let µ0 1, µ0 2, . . . µ0 k be the output of Algorithm 1. If C = Ω  (k log k)1/4 and N0 = Ω  d3k3 log dk  , then w.p. ≥1 −1/poly(k), we have maxi ∥µ0 i −µ⋆ i ∥≤C 20σ. 4 Streaming Update Analysis At a high level our analysis shows that at each step of the streaming updates, the error decreases on average. However, due to the non-convexity of the objective function we can show such a decrease only if the current estimates of our centers lie in a small ball around the true centers of the gaussians. Indeed, while the initialization provides us with such centers, due to the added noise in each step, our iterates may occasionally fall outside these balls, and we need to bound the probability that this happens. To overcome this, we start with initial centers that are within slightly smaller balls around the true means, and use a careful Martingale argument to show that even if the iterates go a little farther from the true centers (due to noise), with high probability, the iterates are still within the slightly larger ball that we require to show decrease in error. We therefore divide our proof in two parts: a) first we show in Section 4.1 that the error decreases in expectation, assuming that the current estimates lie in a reasonable neighborhood around the true centers; and b) in Section 4.2) we show using a martingale analysis that with high probability, each iterate satisfies the required neighborhood condition if the initialization is good enough. We formalize the required condition for our per-iteration error analysis below. For the remainder of this section, we fix the initialization and only focus on Steps 3-8 of Algorithm 2. Definition 1. For a fixed initialization, and given a sequence of points ωt = (xt′+N0+1 : 0 ≤t′ < t), we say that condition It is satisfied at time t if maxi ∥µt′ i −µ⋆ i ∥≤Cσ 10 holds for all 0 ≤t′ ≤t. Note that given a sequence of points and a fixed initialization, Algorithm 2 is deterministic. We now define the following quantities which will be useful in the upcoming analysis. At any time t ≥1, let ωt = (xt′+N0+1 : 0 ≤t′ < t) denote the sequence of points received by our algorithm. For all t ≥0, let eEi t = ∥µt i −µ⋆ i ∥2 denote the random variable measuring the current error for cluster i, and let eVt = maxi eEi t to be the maximum cluster error at time t. Now, let bEi t+1 = Ext+N0+1  ∥µt+1 i −µ⋆ i ∥2 |ωt  be the expected error of the ith cluster center after receiving the (t + 1)th, conditioned on ωt. Finally, let Ei t = E  ∥µt i −µ⋆ i ∥2 | It  be the expected error conditioned on It, and let Et = P i Ei t. 4.1 Error Reduction in Single Iteration Our main tool toward showing Theorem 2 is the following theorem which bounds the expected error after updating the means on arrival of the next sample. Theorem 4. If It holds and C ≥Ω(√log k), then for all i, we have bEi t+1 ≤(1 −η 2k ) eEi t + η k5 eVt + O(1)η2dσ2 + O(k)η(1 −η) exp(−C2/8)(C2 + k)σ2 . 5 Proof sketch of Theorem 4. In all calculations in this proof, we first assume that the candidate centers satisfy It, and all expectations and probabilities are only over the new sample xt+N0+1, which we denote by x after omitting the superscript. Now recall our update rule: µt+1 i = (1 −η)µt i + ηx if µt i is the closest center for the new sample x; the other centers are unchanged. To simplify notations, let: gt i(x) = 1 iff i = arg min j ∥x −µt j∥, gt i(x) = 0 otherwise. (2) By definition, we have for all i, µt+1 i = (1 −η)µt i + η gt i(x)x + (1 −gt i(x))µt i  = µt i + ηgt i(x)(x −µt i). Our proof relies on the following simple yet crucial lemmas. The first bounds the failure probability of a sample being closest to an incorrect cluster center among our candidates. The second shows that if the candidate centers are sufficiently close to the true centers, then the failure probability of mis-classifying a point to a wrong center is (upto constant factors) the probability of mis-classification even in the optimal solution (with true centers). Finally the third lemma shows that the probability of gt i(x) = 1 for each i is lower-bounded. Complete details and proofs appear in [14]. Lemma 1. Suppose condition It holds. For any i, j ̸= i, let x ∼Cl(j) denote a random point from cluster j. Then Pr  ∥x −µt i∥≤∥x −µt j∥  ≤exp(−Ω(C2 ij)). Lemma 2. Suppose max(∥µt i −µ⋆ i ∥, ∥µt i −µ⋆ i ∥) ≤σ/Cij. For any i, j ̸= i, let x ∼Cl(j) denote a random point from cluster j. Then Pr  ∥x −µt i∥≤∥x −µt j∥  ≤O(1) exp(−C2 ij/8). Lemma 3. If It holds and C = Ω(√log k), then for all i, then Pr [gt i(x) = 1] ≥ 1 2k. And so, equipped with the above notations and lemmas, we have bEi t+1 = Ex  ∥µt+1 i −µ⋆ i ∥2 = (1 −η)2∥µt i −µ⋆ i ∥2 + η2E  ∥gt i(x)(x −µ⋆ i ) + (1 −gt i(x))(µt i −µ⋆ i )∥2 + 2η(1 −η)E hD µt i −µ⋆ i , gt i(x)(x −µ⋆ i ) + (1 −gt i(x))(µt i −µ⋆ i )  Ei ≤(1 −η 2k ) eEi t + η2 E  ∥gt i(x)(x −µ⋆ i )∥2 | {z } T1 +2η(1 −η) E hD µt i −µ⋆ i , gt i(x)(x −µ⋆ i )  Ei | {z } T2 The last inequality holds because of the following line of reasoning: (i) firstly, the cross term in the second squared norm evaluates to 0 due to the product gt i(x)(1 −gt i(x)), (ii) η2E  (1 −gt i(x))∥µt i −µ⋆ i ∥2 ≤η2 eEi t, (iii) 2η(1 −η)E [⟨µt i −µ⋆ i , (1 −gt i(x))(µt i −µ⋆ i )⟩] ≤ 2η(1 −η) eEi t Pr [gt i(x) = 0] ≤2η(1 −η) eEi t(1 −1/2k) by Lemma 3, and finally (iv) by collecting terms with coefficient eEi t. The proof then roughly proceeds as follows: suppose in an ideal case, gt i(x) is 1 for all points x generated from cluster i, and 0 otherwise. Then, if x is a random sample from cluster i, T1 would be dσ2, and T2 would be 0. Of course, the difficulty is that gt i(x) is not always as well-behaved, and so the bulk of the analysis is in carefully using Lemmas 1and 2, and appropriately “charging” the various error terms we get to the current error eEi t, the variance, and the offline approximation error. 4.2 Ensuring Proximity Condition Via Super-Martingales In the previous section, we saw that condition It = 1 is sufficient to ensure that expected one-step error reduces at time step t + 1. Our next result shows that IN = 1 is satisfied with high probability. Theorem 5. Suppose maxi ∥µ0 i −µ⋆ i ∥≤C 20σ, then IN = 1 w.p ≥1 −( 1 poly(N)). Our argument proceeds as follows. Suppose we track the behaviour of the actual error terms eEi t over time, and stop the process (call it a failure) when any of these error terms exceeds C2σ2/100 (recall that they are all initially smaller than C2σ2/400). Assuming that the process has not stopped, we show that each of these error terms has a super-martingale behaviour using Theorem 4, which 6 says that on average, the expected one-step error drops. Moreover, we also show that the actual one-step difference, while not bounded, has a sub-gaussian tail. Our theorem now follows by using Azuma-Hoeffding type inequality for super-martingale sequences. 4.3 Wrapping Up Now, using Theorems 4 and 5, we can get the following theorem. Theorem 6. Let γ = O(k)η2dσ2 + O(k2)η(1 −η)exp(−C2/8)(C2 + k)σ2. Then if C ≥ Ω(√log k), for all t, we have Et+1 ≤(1 −η 4k)Et + γ. It follows that EN ≤(1 −η 4k)NE0 + 4k η γ. Proof. Let E i t+1 = E h ∥µt+1 i −µ⋆ i ∥2 It i to be the average over all sample paths of eEi t+1 conditioned on It. Recall that Et+1 is very similar, except the conditioning is on It+1. With this notation, let us take expectation over all sample paths where It is satisfied, and use Theorem 4 to get E i t+1 ≤(1 −η 2k )Ei t + η k5 Et + O(1)η2dσ2 + O(k)η(1 −η) exp(−C2/8)(C2 + k)σ2 . And so, summing over all i we will get Et+1 ≤(1 −η 3k )Et + O(k)η2dσ2 + O(k2)η(1 −η) exp(−C2/8)(C2 + k)σ2 . Finally note that Et+1 and Et+1 are related as Et+1 Pr [It+1] ≤Et+1 Pr [It], and so Et+1 ≤ Et+1(1 + 1 N 2 ) since Pr [It+1] ≥1 −1/N 5 by Theorem 5. Proof of Theorem 2. From Theorem 5 we know that the probability of IN being satisfied is 1−1/N 5, and in this case, we can use Theorem 6 to get the desired error bound. In case IN fails, then the maximum possible error is roughly maxi,j ∥µ⋆ i −µ⋆ j∥2 · N (when all our samples are sent to the same cluster), which contributes a negligible amount to the bias term. 5 Initialization for streaming k-means In Section 4 we saw that our proposed streaming algorithm can lead to a good solution for any separation Cσ ≥O(√log k)σ if we can initialize all centers such that ∥µ0 i −µ⋆ i ∥≤C 20σ. We now show that InitAlg (Algorithm 1) is one such procedure. We first approximately compute the top-k eigenvectors U of the data covariance using a streaming PCA algorithm [9, 13] on O(k3d3 log d) samples. We next store k log k points and project them onto the subspace spanned by U. We then perform a simple distance based clustering [18] that correctly clusters the stored points (assuming reasonable center separation), and finally we output these cluster centers. Proof of Theorem 3. Using an argument similar to [9] (Theorem 3), we get that U obtained by the online PCA algorithm (Steps 1:4 of Algorithm 1) satisfies (w.p. ≥1 −1/poly(d)): ∥UU T µ⋆ i −µ⋆ i ∥2 ≤.01σ2, ∀1 ≤i ≤k. (3) Now, let bµ∗ i = U T µ⋆ i . For any x sampled from mixture distribution (1), U T x ∼P i wiN(bµ∗ i , σ2I). Hence, if U T xt, U T xt′ both belong to cluster i, then (w.p. ≥1 −1/kα): ∥U T xt′ −U T xt′∥2 = ∥U T (zt −zt′)∥2 2 ≤(k + 8α p k log k)σ2, (4) where xt = µ⋆ i + zt and xt′ = µ⋆ i + zt′. The last inequality above follows by using standard χ2 random variable tail bound. Similarly if U T xt, U T xt′ belong to cluster i and j, i.e., xt = µ⋆ i + zt and xt′ = µ⋆ j + zt′ then (w.p. ≥1 −1/kα): ∥U T xt′ −U T xt′∥2 = ∥bµ∗ i −bµ∗ j∥2 + ∥U T (zt −zt′)∥2 2 + 2(bµ∗ i −bµ∗ j)T U T (zt −zt′) ≥(C2 −.2C + 8α p k log k −16αC p log k)σ2, (5) where the above equation follows by using (3), setting α = C/32 and using C = Ω((k log k)1/4). 7 Using (4), (5), w.h.p. all the points from the same cluster are closer to each other than points from other clusters. Hence, connected components of nearest neighbor graph recover clusters accurately. Now, we estimate bµi = 1 |Cluster(i)| P t∈Cluster(i) U T xt for each i. Since, our clustering is completely accurate, we have w.p. ≥1 −2m2/kC/32, ∥bµi −bµ∗ i ∥2 ≤σ √log k p |Cluster(i)| . (6) As wi = 1/k for all i, |Cluster(i)| ≥m k −Cp m k w.p. ≥1 −1/kC/32. Theorem now follows by setting m = O(k log k) and by using (3), (6) along with C = Ω((k log k)1/4). Remark 1. We would like to emphasize that our analysis for the convergence of streaming algorithms works even for smaller separations C = O(√log k), as long as we can get a good enough initialization. Hence, a better initialization algorithm with weaker dependence of C on k would lead to an improvement in the overall algorithm. 6 Soft thresholding EM based algorithm In this section, we study a streaming version of the Expectation Maximization (EM) algorithm [7] which is also used extensively in practice. While the standard k-means or Lloyd’s heuristic is known to be agnostic to the distribution, and the same procedure can solve the mixture problem for a variety of distributions [12], EM algorithms are designed specifically for the input mixture distribution. In this section, we consider a streaming version of the EM algorithm when applied to the problem of mixture of two spherical Gaussians with known variances. In this case, the EM algorithm reduces to a softer version of the Lloyd’s algorithm where a point can be partially assigned to the two clusters. Recent results by [6, 3, 19] show convergence of the EM algorithm in the offline setting for this simple setup. In keeping with earlier notation, let µ⋆ 1 = µ⋆and µ⋆ 2 = −µ⋆and the center separation C = 2∥µ⋆∥ σ . Hence, xt i.i.d ∼ 1 2N(µ⋆, σ2I) + 1 2N(−µ⋆, σ2I). Algorithm 3 StreamSoftUpdate(N, N0) Set η = 3 log N N . Set µ0 i ←InitAlgo(N0). for t = 1 to N do Receive xt+N0 as generated by the input stream. x = xt+N0 Let wt = exp −∥x−µt∥2 σ2  exp −∥x−µt∥2 σ2  +exp −∥x+µt∥2 σ2  Set µt+1 = (1 −η)µt + η[2wt −1]x. end for In our algorithm, wt(x) is an estimate of the probability that x belongs to the cluster with µt, given that it is drawn from a balanced mixture of gaussians at µt and −µt. Calculating wt(x) corresponds to the E step and updating the estimate of the centers corresponds to the M step of the EM algorithm. Similar to the streaming Lloyd’s algorithm presented in Section 3, our analysis of streaming soft updates can be separated into streaming update analysis and analysis InitAlg (which is already presented in Section 5). We now provide our main theorem, and the proof is presented in Appendix C. Theorem 7 (Streaming Update). Let xt, 1 ≤t ≤N + N0 be generated using a mixture two balanced spherical Gaussians with variance σ2. Also, let the center-separation C ≥4, and also suppose our initial estimate µ0 is such that ∥µ0 −µ⋆∥≤ Cσ 20 . Then, the streaming update of StreamSoftUpdate(N, N0) , i.e, Steps 3-8 of Algorithm 3 satisfies: E  ∥µN −µ⋆∥2 ≤∥µ⋆∥2 N Ω(1) | {z } bias + O(1)log N N dσ2 | {z } variance . 8 Remark 2. Our bias and variance terms are similar to the ones in Theorem 1 but the above bound does not have the additional approximation error term. Hence, in this case we can estimate µ⋆ consistently but the algorithm applies only to a mixture of Gaussians while our algorithm and result in Section 3 can potentially be applied to arbitrary sub-Gaussian distributions. Remark 3. We note that for our streaming soft update algorithm, it is not critical to know the variance σ2 beforehand. One could get a good estimate of σ by taking the mean of a random projection of a small number of points. We provide the details in the full version of this paper [14]. 7 Conclusions In this paper, we studied the problem of clustering with streaming data where each data point is sampled from a mixture of spherical Gaussians. For this problem, we study two algorithms that use appropriate initialization: a) a streaming version of Lloyd’s method, b) a streaming EM method. For both the methods we show that we can accurately initialize the cluster centers using an online PCA based method. We then show that assuming Ω((k log k)1/4σ) separation between the cluster centers, the updates by both the methods lead to decrease in both the bias as well as the variance error terms. For Lloyd’s method there is an additional estimation error term, which even the offline algorithm incurs, and which is avoided by the EM method. However, the streaming Lloyd’s method is agnostic to the data distribution and can in fact be applied to any mixture of sub-Gaussians problem. For future work, it would be interesting to study the streaming data clustering problem under deterministic assumptions like [12, 16]. Also, it is an important question to understand the optimal separation assumptions needed for even the offline gaussian mixture clustering problem. References [1] Anima Anandkumar, Rong Ge, Daniel J. Hsu, Sham M. Kakade, and Matus Telgarsky. Tensor decompositions for learning latent variable models (A survey for ALT). In Proceedings of ALT, pages 19–38, 2015. [2] Hassan Ashtiani, Shai Ben-David, and Abbas Mehrabian. Sample-efficient learning of mixtures. arXiv preprint arXiv:1706.01596, 2017. [3] Sivaraman Balakrishnan, Martin J Wainwright, and Bin Yu. St atistical guarantees for the em algorithm: From population to sample-based analysis. Annals of Stats. 45 (1), 77-120, 2014. [4] Maria-Florina Balcan, Avrim Blum, and Anupam Gupta. Clustering under approximation stability. J. ACM, 60(2):8:1–8:34, 2013. [5] Anirban Dasgupta, John Hopcroft, Ravi Kannan, and Pradipta Mitra. Spectral clustering with limited independence. In Proceedings of SODA, pages 1036–1045, 2007. [6] Constantinos Daskalakis, Christos Tzamos, and Manolis Zampetakis. Ten steps of em suffice for mixtures of two gaussians. arXiv preprint arXiv:1609.00368, 2016. [7] Arthur P Dempster, Nan M Laird, and Donald B Rubin. Maximum likelihood from incomplete data via the em algorithm. Journal of the royal statistical society, pages 1–38, 1977. [8] R. O. Duda, P. E. Hart, and D. G. Stork. Pattern Classification. John Wiley and Sons, 2000. [9] Moritz Hardt and Eric Price. The noisy power method: A meta algorithm with applications. In Proceedings of NIPS, pages 2861–2869, 2014. [10] Daniel J. Hsu and Sham M. Kakade. Learning mixtures of spherical gaussians: moment methods and spectral decompositions. In Proceedings of ITCS ’13, pages 11–20, 2013. [11] Prateek Jain, Chi Jin, Sham M. Kakade, Praneeth Netrapalli, and Aaron Sidford. Streaming PCA: matching matrix bernstein and near-optimal finite sample guarantees for oja’s algorithm. In Proceedings of COLT, pages 1147–1164, 2016. [12] Amit Kumar and Ravindran Kannan. Clustering with spectral norm and the k-means algorithm. In Proceedings of FOCS, pages 299–308, 2010. 9 [13] Ioannis Mitliagkas, Constantine Caramanis, and Prateek Jain. Memory limited, streaming PCA. In Proceedings of 27th NIPS, pages 2886–2894, 2013. [14] Aditi Raghunathan, Ravishankar Krishnaswamy, and Prateek Jain. Learning mixture of gaussians with streaming data. CoRR, abs/1707.02391, 2017. [15] Ohad Shamir. A variant of azuma’s inequality for martingales with subgaussian tails. arXiv preprint arXiv:1110.2392, 2011. [16] Cheng Tang and Claire Monteleoni. On lloyd’s algorithm: New theoretical insights for clustering in practice. In Proceedings of AISTATS, pages 1280–1289, 2016. [17] Cheng Tang and Claire Monteleoni. Convergence rate of stochastic k-means. Proceedings of AISTATS, 2017. [18] Santosh Vempala and Grant Wang. A spectral algorithm for learning mixture models. J. Comput. Syst. Sci., 68(4):841–860, 2004. [19] Ji Xu, Daniel J Hsu, and Arian Maleki. Global analysis of expectation maximization for mixtures of two gaussians. In Advances in Neural Information Processing Systems, pages 2676–2684, 2016. 10
2017
637
7,160
Learning to Compose Domain-Specific Transformations for Data Augmentation Alexander J. Ratner∗, Henry R. Ehrenberg∗, Zeshan Hussain, Jared Dunnmon, Christopher Ré Stanford University {ajratner,henryre,zeshanmh,jdunnmon,chrismre}@cs.stanford.edu Abstract Data augmentation is a ubiquitous technique for increasing the size of labeled training sets by leveraging task-specific data transformations that preserve class labels. While it is often easy for domain experts to specify individual transformations, constructing and tuning the more sophisticated compositions typically needed to achieve state-of-the-art results is a time-consuming manual task in practice. We propose a method for automating this process by learning a generative sequence model over user-specified transformation functions using a generative adversarial approach. Our method can make use of arbitrary, non-deterministic transformation functions, is robust to misspecified user input, and is trained on unlabeled data. The learned transformation model can then be used to perform data augmentation for any end discriminative model. In our experiments, we show the efficacy of our approach on both image and text datasets, achieving improvements of 4.0 accuracy points on CIFAR-10, 1.4 F1 points on the ACE relation extraction task, and 3.4 accuracy points when using domain-specific transformation operations on a medical imaging dataset as compared to standard heuristic augmentation approaches. 1 Introduction Modern machine learning models, such as deep neural networks, may have billions of free parameters and accordingly require massive labeled data sets for training. In most settings, labeled data is not available in sufficient quantities to avoid overfitting to the training set. The technique of artificially expanding labeled training sets by transforming data points in ways which preserve class labels – known as data augmentation – has quickly become a critical and effective tool for combatting this labeled data scarcity problem. Data augmentation can be seen as a form of weak supervision, providing a way for practitioners to leverage their knowledge of invariances in a task or domain. And indeed, data augmentation is cited as essential to nearly every state-of-the-art result in image classification [3, 7, 11, 24] (see Supplemental Materials), and is becoming increasingly common in other modalities as well [20]. Even on well studied benchmark tasks, however, the choice of data augmentation strategy is known to cause large variances in end performance and be difficult to select [11, 7], with papers often reporting their heuristically found parameter ranges [3]. In practice, it is often simple to formulate a large set of primitive transformation operations, but time-consuming and difficult to find the parameterizations and compositions of them needed for state-of-the-art results. In particular, many transformation operations will have vastly different effects based on parameterization, the set of other transformations they are applied with, and even their particular order of composition. For example, brightness and saturation enhancements might be destructive when applied together, but produce realistic images when paired with geometric transformations. ∗Authors contributed equally 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. Rotate Rotate Flip ShiftHue ZoomOut ShiftHue Flip Brighten programs Rachel writes code for WebCo. P(w′ 2 | w1, w0) E1 NN E2 Figure 1: Three examples of transformation functions (TFs) in different domains: Two example sequences of incremental image TFs applied to CIFAR-10 images (left); a conditional word-swap TF using an externally trained language model and specifically targeting nouns (NN) between entity mentions (E1,E2) for a relation extraction task (middle); and an unsupervised segementation-based translation TF applied to mass-containing mammography images (right). Given the difficulty of searching over this configuration space, the de facto norm in practice consists of applying one or more transformations in random order and with random parameterizations selected from hand-tuned ranges. Recent lines of work attempt to automate data augmentation entirely, but either rely on large quantities of labeled data [1, 21], restricted sets of simple transformations [8, 13], or consider only local perturbations that are not informed by domain knowledge [1, 22] (see Section 4). In contrast, our aim is to directly and flexibly leverage domain experts’ knowledge of invariances as a valuable form of weak supervision in real-world settings where labeled training data is limited. In this paper, we present a new method for data augmentation that directly leverages user domain knowledge in the form of transformation operations, and automates the difficult process of composing and parameterizing them. We formulate the problem as one of learning a generative sequence model over black-box transformation functions (TFs): user-specified operators representing incremental transformations to data points that need not be differentiable nor deterministic. For example, TFs could rotate an image by a small degree, swap a word in a sentence, or translate a segmented structure in an image (Fig. 1). We then design a generative adversarial objective [9] which allows us to train the sequence model to produce transformed data points which are still within the data distribution of interest, using unlabeled data. Because the TFs can be stochastic or non-differentiable, we present a reinforcement learning-based training strategy for this model. The learned model can then be used to perform data augmentation on labeled training data for any end discriminative model. Given the flexibility of our representation of the data augmentation process, we can apply our approach in many different domains, and on different modalities including both text and images. On a real-world mammography image task, we achieve a 3.4 accuracy point boost above randomly composed augmentation by learning to appropriately combine standard image TFs with domainspecific TFs derived in collaboration with radiology experts. Using novel language model-based TFs, we see a 1.4 F1 boost over heuristic augmentation on a text relation extraction task from the ACE corpus. And on a 10%-subsample of the CIFAR-10 dataset, we achieve a 4.0 accuracy point gain over a standard heuristic augmentation approach and are competitive with comparable semi-supervised approaches. Additionally, we show empirical results suggesting that the proposed approach is robust to misspecified TFs. Our hope is that the proposed method will be of practical value to practitioners and of interest to researchers, so we have open-sourced the code at https: //github.com/HazyResearch/tanda. 2 Modeling Setup and Motivation In the standard data augmentation setting, our aim is to expand a labeled training set by leveraging knowledge of class-preserving transformations. For a practitioner with domain expertise, providing individual transformations is straightforward. However, high performance augmentation techniques use compositions of finely tuned transformations to achieve state-of-the-art results [7, 3, 11], and heuristically searching over this space of all possible compositions and parameterizations for a new task is often infeasible. Our goal is to automate this task by learning to compose and parameterize a set of user-specified transformation operators in ways that are diverse but still preserve class labels. In our method, transformations are modeled as sequences of incremental user-specified operations, called transformation functions (TFs) (Fig. 1). Rather than making the strong assumption that all the provided TFs preserve class labels, as existing approaches do, we assume a weaker form of class 2 Figure 2: A high-level diagram of our method. Users input a set of transformation functions h1, ..., hK and unlabeled data. A generative adversarial approach is then used to train a null class discriminator, D∅, and a generator, G, which produces TF sequences hτ1, ..., hτL. Finally, the trained generator is used to perform data augmentation for an end discriminative model Df. invariance which enables us to use unlabeled data to learn a generative model over transformation sequences. We then propose two representative model classes to handle modeling both commutative and non-commutative transformations. 2.1 Augmentation as Sequence Modeling In our approach, we represent transformations as sequences of incremental operations. In this setting, the user provides a set of K TFs, hi : X 7→X, i ∈[1, K]. Each TF performs an incremental transformation: for example, hi could rotate an image by five degrees, swap a word in a sentence, or move a segmented tumor mass around a background mammography image (see Fig. 1). In order to accommodate a wide range of such user-defined TFs, we treat them as black-box functions which need not be deterministic nor differentiable. This formulation gives us a tractable way to tune both the parameterization and composition of the TFs in a discretized but fine-grained manner. Our representation can be thought of as an implicit binning strategy for tuning parameterizations – e.g. a 15 degree rotation might be represented as three applications of a five-degree rotation TF. It also provides a direct way to represent compositions of multiple transformation operations. This is critical as a multitude of state-of-the-art results in the literature show the importance of using compositions of more than one transformations per image [7, 3, 11], which we also confirm experimentally in Section 5. 2.2 Weakening the Class-Invariance Assumption Any data augmentation technique fundamentally relies on some assumption about the transformation operations’ relation to the class labels. Previous approaches make the unrealistic assumption that all provided transformation operations preserve class labels for all data points. That is, y(hτL ◦. . . ◦hτ1(x)) = y(x) (1) for label mapping function y, any sequence of TF indices τ1, ..., τL, and all data points x. This assumption puts a large burden of precise specification on the user, and based on our observations, is violated by many real-world data augmentation strategies. Instead, we consider a weaker modeling assumption. We assume that transformation operations will not map between classes, but might destructively map data points out of the distribution of interest entirely: y(hτL ◦. . . ◦hτ1(x)) ∈{y(x), y∅} (2) where y∅represents an out-of-distribution null class. Intuitively, this weaker assumption is motivated by the categorical image classification setting, where we observe that transformation operations provided by the user will almost never turn, for example, a plane into a car, but may often turn a plane into an indistinguishable “garbage” image (Fig. 3). We are the first to consider this weaker invariance assumption, which we believe more closely matches various practical data augmentation settings of interest. In Section 5, we also provide empirical evidence that this weaker assumption is useful in binary classification settings and over modalities other than image data. Critically, it also enables us to learn a model of TF sequences using unlabeled data alone. 3 Plane Auto Bird Original Plane Auto Bird Cat Deer Figure 3: Our modeling assumption is that transformations may map out of the natural distribution of interest, but will rarely map between classes. As a demonstration, we take images from CIFAR-10 (each row) and randomly search for a transformation sequence that best maps them to a different class (each column), according to a trained discriminative model. The matches rarely resemble the target class but often no longer look like “normal” images at all. Note that we consider a fixed set of user-provided TFs, not adversarially selected ones. Figure 4: Some example transformed images generated using an augmentation generative model trained using our approach. Note that this is not meant as a comparison to Fig. 3. 2.3 Minimizing Null Class Mappings Using Unlabeled Data Given assumption (2), our objective is to learn a model Gθ which generates sequences of TF indices τ ∈{1, K}L with fixed length L, such that the resulting TF sequences hτ1, ..., hτL are not likely to map data points into y∅. Crucially, this does not involve using the class labels of any data points, and so we can use unlabeled data. Our goal is then to minimize the the probability of a generated sequence mapping unlabeled data points into the null class, with respect to θ: J∅= Eτ∼GθEx∼U [P(y(hτL ◦. . . ◦hτ1(x)) = y∅)] (3) where U is some distribution of unlabeled data. Generative Adversarial Objective In order to approximate P(y(hτ1 ◦. . . ◦hτL(x)) = y∅), we jointly train the generator Gθ and a discriminative model D∅ φ using a generative adversarial network (GAN) objective [9], now minimizing with respect to θ and maximizing with respect to φ: ˜J∅= Eτ∼GθEx∼U h log(1 −D∅ φ(hτL ◦. . . ◦hτ1(x))) i + Ex′∼U h log(D∅ φ(x′)) i (4) As in the standard GAN setup, the training procedure can be viewed as a minimax game in which the discriminator’s goal is to assign low values to transformed, out-of-distribution data points and high values to real in-distribution data points, while simultaneously, the generator’s goal is to generate transformation sequences which produce data points that are indistinguishable from real data points according to the discriminator. For D∅ φ, we use an all-convolution CNN as in [23]. For further details, see Supplemental Materials. Diversity Objective An additional concern is that the model will learn a variety of null transformation sequences (e.g. rotating first left than right repeatedly). Given the potentially large state-space of actions, and the black-box nature of the user-specified TFs, it seems infeasible to hard-code sets of inverse operations to avoid. To mitigate this, we instead consider a second objective term: Jd = Eτ∼GθEx∼U [d(hτL ◦. . . ◦hτ1(x), x)] (5) where d : X × X →R is some distance function. For d, we evaluated using both distance in the raw input space, and in the feature space learned by the final pre-softmax layer of the discriminator D∅ φ. Combining eqns. 4 and 5, our final objective is then J = ˜J∅+αJ−1 d where α > 0 is a hyperparameter. We minimize J with respect to θ and maximize with respect to φ. 4 2.4 Modeling Transformation Sequences We now consider two model classes for Gθ: Independent Model We first consider a mean field model in which each sequential TF is chosen independently. This reduces our task to one of learning K parameters, which we can think of as representing the task-specific “accuracies” or “frequencies” of each TF. For example, we might want to learn that elastic deformations or swirls should only rarely be applied to images in CIFAR-10, but that small rotations can be applied frequently. In particular, a mean field model also provides a simple way of effectively learning stochastic, discretized parameterizations of the TFs. For example, if we have a TF representing five-degree rotations, Rotate5Deg, a marginal value of PGθ(Rotate5Deg) = 0.1 could be thought of as roughly equivalent to learning to rotate 0.5L degrees on average. State-Based Model There are important cases, however, where the independent representation learned by the mean field model could be overly limited. In many settings, certain TFs may have very different effects depending on which other TFs are applied with them. As an example, certain similar pairs of image transformations might be overly lossy when applied together, such as a blur and a zoom operation, or a brighten and a saturate operation. A mean field model could not represent such disjunctions as these. Another scenario where an independent model fails is where the TFs are non-commutative, such as with lossy operators (e.g. image transformations which use aliasing). In both of these cases, modeling the sequences of transformations could be important. Therefore we consider a long short-term memory (LSTM) network as as a representative sequence model. The output from each cell of the network is a distribution over the TFs. The next TF in the sequence is then sampled from this distribution, and is fed as a one-hot vector to the next cell in the network. 3 Learning a Transformation Sequence Model The core challenge that we now face in learning Gθ is that it generates sequences over TFs which are not necessarily differentiable or deterministic. This constraint is a critical facet of our approach from the usability perspective, as it allows users to easily write TFs as black-box scripts in the language of their choosing, leveraging arbitrary subfunctions, libraries, and methods. In order to work around this constraint, we now describe our model in the syntax of reinforcement learning (RL), which provides a convenient framework and set of approaches for handling computation graphs with non-differentiable or stochastic nodes [27]. Reinforcement Learning Formulation Let τi be the index of the ith TF applied, and ˜xi be the resulting incrementally transformed data point. Then we consider st = (x, ˜x1, ˜x2, ..., ˜xt, τ1, ...., τt) as the state after having applied t of the incremental TFs. Note that we include the incrementally transformed data points ˜x1, ..., ˜xt in st since the TFs may be stochastic. Each of the model classes considered for Gθ then uses a different state representation ˆs. For the mean field model, the state representation used is ˆsMF t = ∅. For the LSTM model, we use ˆsLSTM t = LSTM(τt, st−1), the state update operation performed by a standard LSTM cell parameterized by θ. Policy Gradient with Incremental Rewards Let ℓt(x, τ) = log(1 −D∅ φ(˜xt)) be the cumulative loss for a data point x at step t, with ℓ0(x) = ℓ0(x, τ) ≡log(1 −D∅ φ(x)). Let R(st) = ℓt(x, τ) − ℓt−1(x, τ) be the incremental reward, representing the difference in discriminator loss at incremental transformation step t. We can now recast the first term of our objective ˜J∅as an expected sum of incremental rewards: U(θ) ≡Eτ∼GθEx∼U h log(1 −D∅ φ(hτ1 ◦. . . ◦hτL(x))) i = Eτ∼GθEx∼U " ℓ0(x) + L X t=1 R(st) # (6) We omit ℓ0 in practice, equivalent to using the loss of x as a baseline term. Next, let πθ be the stochastic transition policy implictly defined by Gθ. We compute the recurrent policy gradient [32] 5 of the objective U(θ) as: ∇θU(θ) = Eτ∼GθEx∼U " L X t=1 R(st)∇θ log πθ(τt | ˆst−1) # (7) Following standard practice, we approximate this quantity by sampling batches of n data points and m sampled action sequences per data point. We also use standard techniques of discounting with factor γ ∈[0, 1] and considering only future rewards [12]. See Supplemental Materials for details. 4 Related Work We now review related work, both to motivate comparisons in the experiments section and to present complementary lines of work. Heuristic Data Augmentation Most state-of-the-art image classification pipelines use some limited form of data augmentation [11, 7]. This generally consists of applying crops, flips, or small affine transformations, in fixed order or at random, and with parameters drawn randomly from hand-tuned ranges. In addition, various studies have applied heuristic data augmentation techniques to modalities such as audio [31] and text [20]. As reported in the literature, the selection of these augmentation strategies can have large performance impacts, and thus can require extensive selection and tuning by hand [3, 7] (see Supplemental Materials as well). Interpolation-Based Techniques Some techniques have explored generating augmented training sets by interpolating between labeled data points. For example, the well-known SMOTE algorithm applies this basic technique for oversampling in class-imbalanced settings [2], and recent work explores using a similar interpolation approach in a learned feature space [5]. [13] proposes learning a class-conditional model of diffeomorphisms interpolating between nearest-neighbor labeled data points as a way to perform augmentation. We view these approaches as complementary but orthogonal, as our goal is to directly exploit user domain knowledge of class-invariant transformation operations. Adversarial Data Augmentation Several lines of recent work have explored techniques which can be viewed as forms of data augmentation that are adversarial with respect to the end classification model. In one set of approaches, transformation operations are selected adaptively from a given set in order to maximize the loss of the end classification model being trained [30, 8]. These procedures make the strong assumption that all of the provided transformations will preserve class labels, or use bespoke models over restricted sets of operations [28]. Another line of recent work has showed that augmentation via small adversarial linear perturbations can act as a regularizer [10, 22]. While complimentary, this work does not consider taking advantage of non-local transformations derived from user knowledge of task or domain invariances. Finally, generative adversarial networks (GANs) [9] have recently made great progress in learning complete data generation models from unlabeled data. These can be used to augment labeled training sets as well. Class-conditional GANs [1, 21] generate artificial data points but require large sets of labeled training data to learn from. Standard unsupervised GANs can be used to generate additional out-of-class data points that can then augment labeled training sets [25, 29]. We compare our proposed approach with these methods empirically in Section 5. 5 Experiments We experimentally validate the proposed framework by learning augmentation models for several benchmark and real-world data sets, exploring both image recognition and natural language understanding tasks. Our focus is on the performance of end classification models trained on labeled datasets augmented with our approach and others used in practice. We also examine robustness to user misspecification of TFs, and sensitivity to core hyperparameters. 5.1 Datasets and Transformation Functions Benchmark Image Datasets We ran experiments on the MNIST [18] and CIFAR-10 [17] datasets, using only a subset of the class labels to train the end classification models and treating the rest 6 as unlabeled data. We used a generic set of TFs for both MNIST and CIFAR-10: small rotations, shears, central swirls, and elastic deformations. We also used morphologic operations for MNIST, and adjustments to hue, saturation, contrast, and brightness for CIFAR-10. Benchmark Text Dataset We applied our approach to the Employment relation extraction subtask from the NIST Automatic Content Extraction (ACE) corpus [6], where the goal is to identify mentions of employer-employee relations in news articles. Given the standard class imbalance in information extraction tasks like this, we used data augmentation to oversample the minority positive class. The flexibility of our TF representation allowed us to take a straightforward but novel approach to data augmentation in this setting. We constructed a trigram language model using the ACE corpus and Reuters Corpus Volume I [19] from which we can sample a word conditioned on the preceding words. We then used this model as the basis for a set of TFs that select words to swap based on the part-of-speech tag and location relative to entities of interest (see Supplemental Materials for details). Mammography Tumor-Classification Dataset To demonstrate the effectiveness of our approach on real-world applications, we also considered the task of classifying benign versus malignant tumors from images in the Digital Database for Screening Mammography (DDSM) dataset [15, 4, 26], which is a class-balanced dataset consisting of 1506 labeled mammograms. In collaboration with domain experts in radiology, we constructed two basic TF sets. The first set consisted of standard image transformation operations subselected so as not to break class-invariance in the mammography setting. For example, brightness operations were excluded for this reason. The second set consisted of both the first set as well as several novel segmentation-based transplantation TFs. Each of these TFs utilized the output of an unsupervised segmentation algorithm to isolate the tumor mass, perform a transformation operation such as rotation or shifting, and then stitch it into a randomly-sampled benign tissue image. See Fig. 1 (right panel) for an illustrative example, and Supplemental Materials for further details. 5.2 End Classifier Performance We evaluated our approach by using it to augment labeled training sets for the tasks mentioned above, and show that we achieve strong gains over heuristic baselines. In particular, for a given set of TFs, we evaluate the performance of mean field (MF) and LSTM generators trained using our approach against two standard data augmentation techniques used in practice. The first (Basic) consists of applying random crops to images, or performing simple minority class duplication for the ACE relation extraction task. The second (Heur.) is the standard heuristic approach of applying random compositions of the given set of transformation operations, the most common technique used in practice [3, 11, 14]. For both our approaches (MF and LSTM) and Heur., we additionally use the same random cropping technique as in the Basic approach. We present these results in Table 1, where we report test set accuracy (or F1 score for ACE), and use a random subsample of the available labeled training data. Additionally, we include an extra row for the DDSM task highlighting the impact of adding domain-specific (DS) TFs – the segmentation-based operations described above – on performance. In Table 2 we additionally compare to two related generative-adversarial methods, the Categorical GAN (CatGAN) [29], and the semi-supervised GAN (SS-GAN) from [25]. Both of these methods use GAN-based architectures trained on unlabeled data to generate new out-of-class data points with which to augment a labeled training set. Following their protocol for CIFAR-10, we train our generator on the full set of unlabeled data, and our end discriminator on ten disjoint random folds of the labeled training set not including the validation set (i.e. n = 4000 each), averaging the results. In all settings, we train our TF sequence generator on the full set of unlabeled data. We select a fixed sequence length for each task via an initial calibration experiment (Fig. 5b). We use L = 5 for ACE, L = 7 for DDSM + DS, and L = 10 for all other tasks. We note that our findings here mirrored those in the literature, namely that compositions of multiple TFs lead to higher end model accuracies. We selected hyperparameters of the generator via performance on a validation set. We then used the trained generator to transform the entire training set at each epoch of end classification model training. For MNIST and DDSM we use a four-layer all-convolutional CNN, for CIFAR10 we use a 56-layer ResNet [14], and for ACE we use a bi-directional LSTM. Additionally, we incorporate a basic transformation regularization term as in [24] (see Supplemental Materials), and train for the last ten epochs without applying any transformations as in [11]. In all cases, we use hyperparameters as 7 Task % None Basic Heur. MF LSTM MNIST 1 90.2 95.3 95.9 96.5 96.7 10 97.3 98.7 99.0 99.2 99.1 CIFAR-10 10 66.0 73.1 77.5 79.8 81.5 100 87.8 91.9 92.3 94.4 94.0 ACE (F1) 100 62.7 59.9 62.8 62.9 64.2 DDSM 10 57.6 58.8 59.3 58.2 61.0 DDSM + DS 53.7 59.9 62.7 Table 1: Test set performance of end models trained on subsamples of the labeled training data (%), not including validation splits, using various data augmentation approaches. None indicates performance with no augmentation. All tasks are measured in accuracy, except ACE which is measured by F1 score. Model Acc. (%) CatGAN 80.42 ± 0.58 SS-GAN 81.37 ± 2.32 LSTM 81.47 ± 0.46 Table 2: Reported end model accuracies, averaged across 10% subsample folds, on CIFAR-10 for comparable GAN methods. (a) (b) Figure 5: (a) Learned TF frequency parameters for misspecified and normal TFs on MNIST. The mean field model correctly learns to avoid the misspecified TFs. (b) Larger sequence lengths lead to higher end model accuracy on CIFAR-10, while random performs best with shorter sequences, according to a sequence length calibration experiment. reported in the literature. For further details of generator and end model training see the Supplemental Materials. We see that across the applications studied, our approach outperforms the heuristic data augmentation approach most commonly used in practice. Furthermore, the LSTM generator outperforms the simple mean field one in most settings, indicating the value of modeling sequential structure in data augmentation. In particular, we realize significant gains over standard heuristic data augmentation on CIFAR-10, where we are competitive with comparable semi-supervised GAN approaches, but with significantly smaller variance. We also train the same CIFAR-10 end model using the full labeled training dataset, and again see strong relative gains (2.1 pts. in accuracy over heuristic), coming within 2.1 points of the current state-of-the-art [16] using our much simpler end model. On the ACE and DDSM tasks, we also achieve strong performance gains, showing the ability of our method to productively incorporate more complex transformation operations from domain expert users. In particular, in DDSM we observe that the addition of the segmentation-based TFs causes the heuristic augmentation approach to perform significantly worse, due to a large number of new failure modes resulting from combinations of the segmentation-based TFs – which use gradient-based blending – and the standard TFs such as zoom and rotate. In contrast, our LSTM model learns to avoid these destructive subsequences and achieves the highest score, resulting in a 9.0 point boost over the comparable heuristic approach. 8 Robustness to TF Misspecification One of the high-level goals of our approach is to enable an easier interface for users by not requiring that the TFs they specify be completely class-preserving. The lack of any assumption of well-specified transformation operations in our approach, and the strong empirical performance realized, is evidence of this robustness. To additionally illustrate the robustness of our approach to misspecified TFs, we train a mean field generator on MNIST using the standard TF set, but with two TFs (shear operations) parameterized so as to map almost all images to the null class. We see in Fig. 5a that the generator learns to avoid applying the misspecified TFs (red lines) almost entirely. 6 Conclusion and Future Work We presented a method for learning how to parameterize and compose user-provided black-box transformation operations used for data augmentation. Our approach is able to model arbitrary TFs, allowing practitioners to leverage domain knowledge in a flexible and simple manner. By training a generative sequence model over the specified transformation functions using reinforcement learning in a GAN-like framework, we are able to generate realistic transformed data points which are useful for data augmentation. We demonstrated that our method yields strong gains over standard heuristic approaches to data augmentation for a range of applications, modalities, and complex domain-specific transformation functions. There are many possible future directions of research for learning data augmentation strategies in the proposed model, such as conditioning the generator’s stochastic policy on a featurized version of the data point being transformed, and generating TF sequences of dynamic length. More broadly, we are excited about further formalizing data augmentation as a novel form of weak supervision, allowing users to directly encode domain knowledge about invariants into machine learning models. Acknowledgements We would like to thank Daniel Selsam, Ioannis Mitliagkas, Christopher De Sa, William Hamilton, and Daniel Rubin for valuable feedback and conversations. We gratefully acknowledge the support of the Defense Advanced Research Projects Agency (DARPA) SIMPLEX program under No. N66001-15-C-4043, the DARPA D3M program under No. FA8750-17-20095, DARPA programs No. FA8750-12-2-0335 and FA8750-13-2-0039, DOE 108845, National Institute of Health (NIH) U54EB020405, the Office of Naval Research (ONR) under awards No. N000141210041 and No. N000141310129, the Moore Foundation, the Okawa Research Grant, American Family Insurance, Accenture, Toshiba, and Intel. This research was also supported in part by affiliate members and other supporters of the Stanford DAWN project: Intel, Microsoft, Teradata, and VMware. This material is based on research sponsored by DARPA under agreement number FA8750-17-2-0095. The U.S. Government is authorized to reproduce and distribute reprints for Governmental purposes notwithstanding any copyright notation thereon. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views, policies, or endorsements, either expressed or implied, of DARPA, AFRL, NSF, NIH, ONR, or the U.S. Government. References [1] S. Baluja and I. Fischer. Adversarial transformation networks: Learning to generate adversarial examples. arXiv preprint arXiv:1703.09387, 2017. [2] N. V. Chawla, K. W. Bowyer, L. O. Hall, and W. P. Kegelmeyer. Smote: synthetic minority over-sampling technique. Journal of artificial intelligence research, 16:321–357, 2002. [3] D. C. Ciresan, U. Meier, L. M. Gambardella, and J. Schmidhuber. Deep big simple neural nets excel on handwritten digit recognition, 2010. Cited on, 80. [4] K. Clark, B. Vendt, K. Smith, J. Freymann, J. Kirby, P. Koppel, S. Moore, S. Phillips, D. Maffitt, M. Pringle, L. Tarbox, and F. Prior. The cancer imaging archive (TCIA): Maintaining and operating a public information repository. Journal of Digital Imaging, 26(6):1045–1057, 2013. [5] T. DeVries and G. W. Taylor. Dataset augmentation in feature space. arXiv preprint arXiv:1702.05538, 2017. 9 [6] G. R. Doddington, A. Mitchell, M. A. Przybocki, L. A. Ramshaw, S. Strassel, and R. M. Weischedel. The automatic content extraction (ace) program-tasks, data, and evaluation. In LREC, volume 2, page 1, 2004. [7] A. Dosovitskiy, P. Fischer, J. Springenberg, M. Riedmiller, and T. Brox. Discriminative unsupervised feature learning with exemplar convolutional neural networks, arxiv preprint. arXiv preprint arXiv:1506.02753, 2015. [8] A. Fawzi, H. Samulowitz, D. Turaga, and P. Frossard. Adaptive data augmentation for image classification. In Image Processing (ICIP), 2016 IEEE International Conference on, pages 3688–3692. IEEE, 2016. [9] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio. Generative adversarial nets. In Advances in neural information processing systems, pages 2672–2680, 2014. [10] I. J. Goodfellow, J. Shlens, and C. Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014. [11] B. Graham. Fractional max-pooling. arXiv preprint arXiv:1412.6071, 2014. [12] E. Greensmith, P. L. Bartlett, and J. Baxter. Variance reduction techniques for gradient estimates in reinforcement learning. Journal of Machine Learning Research, 5(Nov):1471–1530, 2004. [13] S. Hauberg, O. Freifeld, A. B. L. Larsen, J. Fisher, and L. Hansen. Dreaming more data: Class-dependent distributions over diffeomorphisms for learned data augmentation. In Artificial Intelligence and Statistics, pages 342–350, 2016. [14] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 770–778, 2016. [15] M. Heath, K. Bowyer, D. Kopans, R. Moore, and W. P. Kegelmeyer. The digital database for screening mammography. In Proceedings of the 5th international workshop on digital mammography, pages 212–218. Medical Physics Publishing, 2000. [16] G. Huang, Z. Liu, K. Q. Weinberger, and L. van der Maaten. Densely connected convolutional networks. arXiv preprint arXiv:1608.06993, 2016. [17] A. Krizhevsky and G. Hinton. Learning multiple layers of features from tiny images. 2009. [18] Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998. [19] D. D. Lewis, Y. Yang, T. G. Rose, and F. Li. Rcv1: A new benchmark collection for text categorization research. Journal of machine learning research, 5(Apr):361–397, 2004. [20] X. Lu, B. Zheng, A. Velivelli, and C. Zhai. Enhancing text categorization with semantic-enriched representation and training data augmentation. Journal of the American Medical Informatics Association, 13(5):526–535, 2006. [21] M. Mirza and S. Osindero. Conditional generative adversarial nets. arXiv preprint arXiv:1411.1784, 2014. [22] T. Miyato, S.-i. Maeda, M. Koyama, K. Nakae, and S. Ishii. Distributional smoothing with virtual adversarial training. arXiv preprint arXiv:1507.00677, 2015. [23] A. Radford, L. Metz, and S. Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015. [24] M. Sajjadi, M. Javanmardi, and T. Tasdizen. Regularization with stochastic transformations and perturbations for deep semi-supervised learning. CoRR, abs/1606.04586, 2016. 10 [25] T. Salimans, I. Goodfellow, W. Zaremba, V. Cheung, A. Radford, and X. Chen. Improved techniques for training gans. In Advances in Neural Information Processing Systems, pages 2226–2234, 2016. [26] R. Sawyer Lee, F. Gimenez, A. Hoogi, and D. Rubin. Curated breast imaging subset of DDSM. In The Cancer Imaging Archive, 2016. [27] J. Schulman, N. Heess, T. Weber, and P. Abbeel. Gradient estimation using stochastic computation graphs. In Advances in Neural Information Processing Systems, pages 3528–3536, 2015. [28] L. Sixt, B. Wild, and T. Landgraf. Rendergan: Generating realistic labeled data. arXiv preprint arXiv:1611.01331, 2016. [29] J. T. Springenberg. Unsupervised and semi-supervised learning with categorical generative adversarial networks. arXiv preprint arXiv:1511.06390, 2015. [30] C. H. Teo, A. Globerson, S. T. Roweis, and A. J. Smola. Convex learning with invariances. In Advances in neural information processing systems, pages 1489–1496, 2008. [31] S. Uhlich, M. Porcu, F. Giron, M. Enenkl, T. Kemp, N. Takahashi, and Y. Mitsufuji. Improving music source separation based on deep neural networks through data augmentation and network blending. Submitted to ICASSP, 2017. [32] D. Wierstra, A. Förster, J. Peters, and J. Schmidhuber. Recurrent policy gradients. Logic Journal of IGPL, 18(5):620–634, 2010. 11
2017
638
7,161
Preventing Gradient Explosions in Gated Recurrent Units Sekitoshi Kanai, Yasuhiro Fujiwara, Sotetsu Iwamura NTT Software Innovation Center 3-9-11, Midori-cho, Musashino-shi, Tokyo {kanai.sekitoshi, fujiwara.yasuhiro, iwamura.sotetsu}@lab.ntt.co.jp Abstract A gated recurrent unit (GRU) is a successful recurrent neural network architecture for time-series data. The GRU is typically trained using a gradient-based method, which is subject to the exploding gradient problem in which the gradient increases significantly. This problem is caused by an abrupt change in the dynamics of the GRU due to a small variation in the parameters. In this paper, we find a condition under which the dynamics of the GRU changes drastically and propose a learning method to address the exploding gradient problem. Our method constrains the dynamics of the GRU so that it does not drastically change. We evaluated our method in experiments on language modeling and polyphonic music modeling. Our experiments showed that our method can prevent the exploding gradient problem and improve modeling accuracy. 1 Introduction Recurrent neural networks (RNNs) can handle time-series data in many applications such as speech recognition [14, 1], natural language processing [26, 30], and hand writing recognition [13]. Unlike feed-forward neural networks, RNNs have recurrent connections and states to represent the data. Back propagation through time (BPTT) is a standard approach to train RNNs. BPTT propagates the gradient of the cost function with respect to the parameters, such as weight matrices, at each layer and at each time step by unfolding the recurrent connections through time. The parameters are updated using the gradient in a way that minimizes the cost function. The cost function is selected according to the task, such as classification or regression. Although RNNs are used in many applications, they have problems in that the gradient can be extremely small or large; these problems are called the vanishing gradient and exploding gradient problems [5, 28]. If the gradient is extremely small, RNNs can not learn data with long-term dependencies [5]. On the other hand, if the gradient is extremely large, the gradient moves the RNNs parameters far away and disrupts the learning process. To handle the vanishing gradient problem, previous studies [18, 8] proposed sophisticated models of RNN architectures. One successful model is a long short-term memory (LSTM). However, the LSTM has the complex structures and numerous parameters with which to learn the long-term dependencies. As a way of reducing the number of parameters while avoiding the vanishing gradient problem, a gated recurrent unit (GRU) was proposed in [8]; the GRU has only two gate functions that hold or update the state which summarizes the past information. In addition, Tang et al. [33] show that the GRU is more robust to noise than the LSTM is, and it outperforms the LSTM in several tasks [9, 20, 33, 10]. Gradient clipping is a popular approach to address the exploding gradient problem [26, 28]. This method rescales the gradient so that the norm of the gradient is always less than a threshold. Although gradient clipping is a very simple method and can be used with GRUs, it is heuristic and does not analytically derive the appropriate threshold. The threshold has to be manually tuned to the data 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. and tasks by trial and error. Therefore, a learning method is required to more effectively address the exploding gradient problem in training of GRUs. In this paper, we propose a learning method for GRUs that addresses the exploding gradient problem. The method is based on an analysis of the dynamics of GRUs. GRUs suffer from gradient explosions due to their nonlinear dynamics [11, 28, 17, 3] that enable GRUs to represent time-series data. The dynamics can drastically change when the parameters cross certain values, called bifurcation points [36], in the learning process. Therefore, the gradient of the state with respect to the parameters can drastically increase at a bifurcation point. This paper presents an analysis of the dynamics of GRUs and proposes a learning method to prevent the parameters from crossing the bifurcation point. It describes evaluations of this method through language modeling and polyphonic music modeling experiments. The experiments demonstrate that our method can train GRUs without gradient clipping and that it can improve the accuracy of GRUs. The rest of this paper is organized as follows: Section 2 briefly explains the GRU, dynamical systems and the exploding gradient problem. It also outlines related work. The dynamics of GRUs is analyzed and our training approach is presented in Section 3. The experiments that verified our method are discussed in Section 4. The paper concludes in Section 5. Proofs of lemmas are given in the supplementary material. 2 Preliminaries 2.1 Gated Recurrent Unit Time-series data often have long and short-term dependencies. In order to model long and short-term behavior, a GRU is designed to properly keep and forget past information. The GRU controls the past information by having two gates: an update gate and reset gate. The update gate zt ∈Rn×1 at a time step t is expressed as zt = sigm(Wxzxt + Whzht−1), (1) where xt ∈Rm×1 is the input vector, and ht ∈Rn×1 is the state vector. Wxz ∈Rn×m and Whz ∈Rn×n are weight matrices. sigm(·) represents the element-wise logistic sigmoid function. The reset gate rt ∈Rn×1 is expressed as rt = sigm(Wxrxt + Whrht−1), (2) where Wxr ∈Rn×m and Whr ∈Rn×n are weight matrices. The activation of the state ht is expressed as ht = zt ⊙ht−1 + (1 −zt) ⊙˜ht, (3) where 1 is the vector of all ones, and ⊙means the element-wise product. ˜ht is a candidate for a new state, expressed as ˜ht = tanh(Wxhxt + Whh(rt ⊙ht−1)), (4) where tanh(·) is the element-wise hyperbolic tangent, and Wxh ∈Rn×m and Whh ∈Rn×n are weight matrices. The initial value of ht is h0 = 0 where 0 represents the vector of all zeros; the GRU completely forgets the past information when ht becomes 0. The training of a GRU can be formulated as an optimization problem as follows: minθ 1 N PN j=1 C(x(j), y(j); θ), (5) where θ, x(j), y(j), C(x(j), y(j); θ), and N are all parameters of the model (e.g., elements of Whh), the j-th training input data, the j-th training output data, the loss function for the j-th data (e.g., mean squared error or cross entropy), and the number of training data, respectively. This optimization problem is usually solved through stochastic gradient descent (SGD). SGD iteratively updates parameters according to the gradient of a mini-batch, which is randomly sampled data from the training data. The parameter update at step τ is θ(τ) = θ(τ−1) −η∇θ 1 |Dτ | P (x(j),y(j))∈Dτ C(x(j), y(j); θ), (6) where Dτ, |Dτ|, and η represent the τ-th mini-batch, the size of the mini-batch, and the learning rate of SGD, respectively. In gradient clipping, the norm of ∇θ 1 |Dτ | P (x(j),y(j))∈Dτ C(x(j), y(j); θ) is clipped by the specified threshold. The size of the parameters θ is 3(n2 + mn) + α, where α is the number of parameters except for the GRU, because the sizes of the six weight matrices of W∗in eqs. (1)-(4) are n×n or n×m. Therefore, the computational cost of gradient clipping is O(n2 + mn + α). 2 2.2 Dynamical System and Gradient Explosion An RNN is a nonlinear dynamical system that can be represented as follows: ht = f(ht−1, θ), (7) where ht is a state vector at time step t, θ is a parameter vector, and f is a nonlinear vector function. The state evolves over time according to eq. (7). If the state ht∗at some time step t∗satisfies ht∗= f(ht∗, θ), i.e., the new state equals the previous state, the state never changes until an external input is applied to the system. Such a state point is called a fixed point h∗. The state converges to or goes away from the fixed point h∗depending on f and θ. This property is important and is called stability [36]. The fixed point h∗is said to be locally stable if there exists a constant ε such that, for ht whose initial value h0 satisfies |h0 −h∗| < ε, limt→∞|ht −h∗| = 0 holds. In this case, a set of points h0 such that |h0 −h∗| < ε is called a basin of attraction of the fixed point. Conversely, if h∗is not stable, the fixed point is said to be unstable. Stability and the behavior of ht near a fixed point, e.g., converging or diverging, can be qualitatively changed by a smooth variation in θ. This phenomenon is called a local bifurcation, and the value of the parameter of a bifurcation is called a bifurcation point [36]. Doya [11], Pascanu et al. [28] and Baldi and Hornik [3] pointed out that gradient explosions are due to bifurcations. The training of an RNN involves iteratively updating its parameters. This process causes a bifurcation: a small change in parameters can result in a drastic change in the behavior of the state. As a result, the gradient increases at a bifurcation point. 2.3 Related Work Kuan et al. [23] established a learning method to avoid the exploding gradient problem. This method restricts the dynamics of an RNN so that the state remains stable. Yu [37] proposed a learning rate for stable training through Lyapunov functions. However, these methods mainly target Jordan and Elman networks called simple RNNs which, unlike GRUs, are difficult to train long-term dependencies. In addition, they suppose that the mean squared error is used as the loss function. By contrast, our method targets the GRU, a more sophisticated model, and can be used regardless of the loss function. Doya [11] showed that bifurcations cause gradient explosions and that real-time recurrent learning (RTRL) can train an RNN without the gradient explosion. However, RTRL has a high computational cost: O((n + u)4) for each update step where u is the number of output units [19]. More recently, Arjovsky et al. [2] proposed unitary matrix constraints in order to prevent the gradient vanishing and exploding. Vorontsov et al. [35], however, showed that it can be detrimental to maintain hard constraints on matrix orthogonality. Previous studies analyzed the dynamics of simple RNNs [12, 4, 31, 16, 27]. Barabanov and Prokhorov [4] analyzed the absolute stability of multi-layer simple RNNs. Haschke and Steil [16] presented a bifurcation analysis of a simple RNN in which inputs are regarded as the bifurcation parameter. Few studies have analyzed the dynamics of the modern RNN models. Talathi and Vartak [32] analyzed the nonlinear dynamics of an RNN with a Relu nonlinearity. Laurent and von Brecht [24] empirically revealed that LSTMs and GRUs can exhibit chaotic behavior and proposed a novel model that has stable dynamics. To the best of our knowledge, our study is the first to analyze the stability of GRUs. 3 Proposed Method As mentioned in Section 2, a bifurcation makes the gradient explode. In this section, through an analysis of the dynamics of GRUs, we devise a training method that avoids a bifurcation and prevents the gradient from exploding. 3.1 Formulation of Proposed Training In Section 3.1, we formulate our training approach. For the sake of clarity, we first explain the formulation for a one-layer GRU; then, we apply the method to a multi-layer GRU. 3.1.1 One-Layer GRU The training of a GRU is formulated as eq. (5). This training with SGD can be disrupted by a gradient explosion. To prevent the gradient from exploding, we formulate the training of a one-layer GRU as 3 the following constrained optimization: minθ 1 N PN j=1 C(x(j), y(j); θ), s.t. σ1(Whh) < 2, (8) where σi(·) is the i-th largest singular value of a matrix, and σ1(·) is called the spectral norm. This constrained optimization problem keeps the one-layer GRU locally stable and prevents the gradient from exploding due to a bifurcation of the fixed point on the basis of the following theorem: Theorem 1. When σ1(Whh) < 2, a one-layer GRU is locally stable at a fixed point h∗= 0. We show the proof of this theorem later. This theorem indicates that our training approach of eq. (8) maintains the stability of the fixed point h∗= 0. Therefore, our approach prevents the gradient explosion caused by the bifurcation of the fixed point h∗. In order to prove this theorem, we need to use the following three lemmas: Lemma 1. A one-layer GRU has a fixed point at h∗= 0. Lemma 2. Let I be an n×n identity matrix, λi(·) be the eigenvalue that has the i-th largest absolute value, and J = 1 4Whh + 1 2I. When the spectral radius 1 |λ1(J)| < 1, a one-layer GRU without input can be approximated by the following linearized GRU near ht = 0: ht = Jht−1, (9) and the fixed point h∗= 0 of a one-layer GRU is locally stable. Lemma 2 indicates that we can prevent a change in local stability by exploiting the constraint of |λ1( 1 4Whh + 1 2I)| < 1. This constraint can be represented as a bilinear matrix inequality (BMI) constraint [7]. However, an optimization problem with a BMI constraint is NP-hard [34]. Therefore, we relax the optimization problem to that of a singular value constraint as in eq. (8) by using the following lemma: Lemma 3. When σ1(Whh) < 2, we have |λ1( 1 4Whh + 1 2I)| < 1. By exploiting Lemmas 1, 2, and 3, we can prove Theorem 1 as follows: Proof. From Lemma 1, there exists a fixed point h∗= 0 in a one-layer GRU. This fixed point is locally stable when |λ1( 1 4Whh + 1 2I)| < 1 from Lemma 2. From Lemma 3, |λ1( 1 4Whh + 1 2I)| < 1 holds when σ1(Whh) < 2. Therefore, when σ1(Whh) < 2, the one-layer GRU is locally stable at the fixed point h∗= 0 Lemma 1 indicates that a one-layer GRU has a fixed point. Lemma 2 shows the condition under which this fixed point is kept stable. Lemma 3 shows that we can use a singular value constraint instead of an eigenvalue constraint. These lemmas prove Theorem 1, and this theorem ensures that our method prevents the gradient from exploding because of a local bifurcation. In our method of eq. (8), h∗= 0 is a fixed point. This fixed point is important since the initial value of the state h0 is 0, and the GRU forgets all the past information when the state is reset to 0 as described in Section 2. If h∗= 0 is stable, the state vector near 0 asymptotically converges to 0. This means that the state vector ht can be reset to 0 after a sufficient time in the absence of an input; i.e., the GRU can forget the past information entirely. On the other hand, when |λ1(J)| becomes greater than one, the fixed point at 0 becomes unstable. This means that the state vector ht never resets to 0; i.e., the GRU can not forget all the past information until we manually reset the state. In this case, the forget gate and reset gate may not work effectively. In addition, Laurent and von Brecht [24] show that an RNN model with state that asymptotically converges to zero achieves a level of performance comparable to that of LSTMs and GRUs. Therefore, our constraint that the GRU is locally stable at h∗= 0 is effective for learning. 3.1.2 Multi-Layer GRU Here, we extend our method in the multi-layer GRU. An L-layer GRU is represented as follows: h1,t = f1(h1,t−1, xt), h2,t = f2(h2,t−1, h1,t), . . . , hL,t = fL(hL,t−1, hL−1,t), where hl,t ∈Rnl×1 is a state vector with the length of nl at the l-th layer, and fl represents a GRU that corresponds to eqs. (1)-(4) at the l-th layer. In the same way as the one-layer GRU, ht = [hT 1,t, . . . , hT L,t]T = 0 is a fixed point, and we have the following lemma: 1The spectral radius is the maximum value of the absolute value of the eigenvalues. 4 Lemma 4. When |λ1( 1 4Wl,hh + 1 2I)| < 1 for l = 1, . . . , L, the fixed point h∗= 0 of a multi-layer GRU is locally stable. From Lemma 3, we have |λ1(Wl,hh + 1 2I)| < 1 when σ1(Wl,hh) < 2. Thus, we formulated our training of a multi-layer GRU to prevent gradient explosions as minθ 1 N PN j=1 C(x(j), y(j); θ), s.t. σ1(Wl,hh)<2, σ1(Wl,xh)≤2 for l = 1, . . . , L. (10) We added the constraint σ1(Wl,xh) ≤2 in order to prevent the input from pushing the state out of the basin of attraction of the fixed point h∗= 0. This constrained optimization problem keeps a multi-layer GRU locally stable. 3.2 Algorithm The optimization method for eq. (8) needs to find the optimal parameters in the feasible set, in which the parameters satisfy the constraint: {Whh|Whh ∈Rn×n, σ1(Whh) < 2}. Here, we modify SGD in order to solve eq. (8). Our method updates the parameters as follows: θ(τ) −Whh = θ(τ−1) −Whh −η∇θCDτ (θ), W (τ) hh = Pδ(W (τ−1) hh −η∇WhhCDτ (θ)), (11) where CDτ (θ) represents 1 |Dτ | P (x(j),y(j))∈Dτ C(x(j), y(j); θ), and θ(τ) −Whh represents the parameters except for W (τ) hh . In eq. (11), We compute Pδ(·) by using the following procedure: Step 1. Decompose ˆ W (τ) hh :=W (τ−1) hh −η∇WhhCDτ(θ) by using singular value decomposition (SVD): ˆ W (τ) hh = UΣV. (12) Step 2. Replace the singular values that are greater than the threshold 2 −δ: ¯Σ = diag(min(σ1, 2 −δ), . . . min(σn, 2 −δ)). (13) Step 3. Reconstruct W (τ) hh by using U, V and ¯Σ in Steps 1 and 2: W (τ) hh ←U ¯ΣV. (14) By using this procedure, Whh is guaranteed to have a spectral norm of less than or equal to 2 −δ. When δ is 0 < δ < 2, our method constrains σ1(Whh) to be less than 2. Pδ(·) in our method brings back the parameters into the feasible set when the parameters go out the feasible set after SGD. Our procedure Pδ(·) is an optimal projection into the feasible set as shown by the following lemma: Lemma 5. The weight matrix W (τ) hh obtained by Pδ(·) is a solution of the following optimization: minW (τ) hh || ˆ W (τ) hh −W (τ) hh ||2 F , s.t. σ1(W (τ) hh )≤2−δ, where || · ||2 F represents the Frobenius norm. Lemma 5 indicates that our method can bring back the weight matrix into the feasible set with minimal variations in the parameters. Therefore, our procedure Pδ(·) has minimal impact on the minimization of the loss function. Note that our method does not depend on the learning rate schedule, and an adaptive learning rate method (such as Adam [21]) can be used with it. 3.3 Computational Cost Let n be the length of a state vector ht; a naive implementation of SVD needs O(n3) time. Here, we propose an efficient method to reduce the computational cost. First, let us reconsider the computation of Pδ(·). Equations (12)-(14) can be represented as follows: W (τ) hh = ˆ W (τ) hh −Ps i=1 h σi( ˆ W (τ) hh ) −(2 −δ) i uivT i , (15) where s is the number of the singular values greater than 2 −δ, and ui and vi are the i-th left and right singular vectors, respectively. Eq. (15) shows that our method only needs the singular values and vectors such that σi( ˆ W (τ) hh ) > 2 −δ. In order to reduce the computational cost of our method, we use the truncated SVD [15] to efficiently compute the top s singular values in O(n2 log(s)) time, where s is the specified number of singular values. Since the truncated SVD requires s to be set beforehand, we need to efficiently estimate the number of singular values such that must meet the condition of σi( ˆ W (τ) hh ) > 2 −δ. Therefore, we compute upper bounds of the singular values that meet the condition on the basis of the following lemma: 5 Lemma 6. The singular values of ˆ W (τ) hh are bounded with the following inequality: σi( ˆ W (τ) hh ) ≤ σi(W (τ−1) hh ) + |η|||∇WhhCDτ (θ)||F . Using this upper bound, we can estimate s as the number of the singular values with upper bounds of greater than 2−δ. This upper bound can be computed in O(n2) time since the size of ∇WhhCDτ (θ) is n×n and σi(W (τ−1) hh ) has already been obtained at step τ. If we did not compute the previous singular values from τ −K step to τ −1 step, we compute the upper bound of σi( ˆ W (τ) hh ) as σi(W (τ−K−1) hh )+ PK k=0 |η|||∇WhhCDτ−k(θ)||F from Lemma 6. Since our training originally constrains σ1(W (τ) hh ) < 2 as described in eq. (8), we can redefine s as the number of singular values such that σi( ˆ W (τ) hh ) > 2, instead of σi( ˆ W (τ) hh ) > 2 −δ. This modification can further reduce the computational cost without disrupting the training. In summary, our method can efficiently estimate the number of singular values needed in O(n2) time, and we compute the truncated SVD in O(n2log(s)) time only if we need to compute singular values by using Lemma 6. 4 Experiments 4.1 Experimental Conditions To evaluate the effectiveness of our method, we conducted experiments on language modeling and polyphonic music modeling. We trained the GRU and examined the successful training rate, as well as the average and standard deviation of the loss. We defined successful training as training in which the validation loss at each epoch is never greater than the initial value. The experimental conditions of each modeling are explained below. 4.1.1 Language Modeling Penn Treebank (PTB) [25] is a widely used dataset to evaluate the performance of RNNs. PTB is split into training, validation, and test sets, and the sets are composed of 930 k, 74 k, 80 k tokens. This experiment used a 10 k word vocabulary, and all words outside the vocabulary were mapped to a special token. The experimental conditions were based on the previous paper [38]. Our model architecture was as follows: The first layer was a 650×10, 000 linear layer without bias to convert the one-hot vector input into a dense vector, and we multiplied the output of the first layer by 0.01 because our method assumes small inputs. The second layer was a GRU layer with 650 units, and we used the softmax function as the output layer. We applied 50 % dropout to the output of each layer except for the recurrent connection [38]. We unfolded the GRU for 35 time steps in BPTT and set the mini-batch size to 20. We trained the GRU with SGD for 75 epochs since the performance of the models trained by Adam and RMSprop were worse than that trained by SGD in the preliminary experiments, and Zaremba et al. [38] used SGD. The results and conditions of preliminary experiments are in the supplementary material. We set the learning rate to one in the first 10 epochs, and then, divided the learning rate by 1.1 after each epoch. In our method, δ was set to [0.2, 0.5, 0.8, 1.1, 1.4]. In gradient clipping, a heuristic for setting the threshold is to look at the average norm of the gradient [28]. We evaluated gradient clipping based on the gradient norm by following the study [28]. In the supplementary material, we evaluated gradient elementwise clipping which is used practically. Since the average norm of the gradient was about 10, we set the threshold to [5, 10, 15, 20]. We initialized the weight matrices except for Whh with a normal distribution N(0, 1/650) , and Whh as an orthogonal matrix composed of the left singular vectors of a random matrix [29, 8]. After each epoch, we evaluated the validation loss. The model that achieved the least validation loss was evaluated using the test set. 4.1.2 Polyphonic Music Modeling In this modeling, we predicted MIDI note numbers at the next time step given the observed notes of the previous time steps. We used the Nottingham dataset: a MIDI file containing 1200 folk tunes [6]. We represented the notes at each time step as a 93-dimensional binary vector. This dataset is split into training, validation and test sets [6]. The experimental conditions were based on the previous study [20]. Our model architecture was as follows: The first layer was a 200 × 93 linear layer without bias, and the output of the first layer was multiplied by 0.01. The second and third layers were GRU 6 Table 1: Language modeling results: success rate and perplexity. Our method Gradient clipping Delta 0.2 0.5 0.8 1.1 1.4 Threshold 5 10 15 20 Success Rate 100 % 100 % 100 % 100 % 100 % Success Rate 100 % 40 % 0 % 0 % Validation Loss 102.0±0.3 102.8±0.3 103.7±0.2 105.2±0.2 107.0±0.4 Validation Loss 109.3±0.4 103.1±0.4 N/A N/A Test Loss 97.6±0.4 98.4±0.3 99.0±0.4 100.3±0.2 102.1±0.2 Test Loss 106.9±0.4 100.4±0.5 N/A N/A Table 2: Music modeling results: success rate and negative log-likelihood. Our method Gradient clipping Delta 0.2 0.5 0.8 1.1 1.4 Threshold 15 30 45 60 Success Rate 100 % 100 % 100 % 100 % 100 % Success Rate 100 % 100 % 100 % 100 % Validation Loss 3.46±0.05 3.47±0.07 3.59±0.1 4.58±0.2 4.64±0.2 Validation Loss 3.57±0.01 3.61±0.2 3.88±0.2 5.26±3 Test Loss 3.53±0.04 3.53±0.04 3.64±0.2 4.56±0.2 4.62±0.2 Test Loss 3.64±0.04 3.64±0.2 3.89±0.2 5.36±3 layers with 200 units per layer, and we used the logistic function as the output layer. 50 % dropout was applied to non-recurrent connections. We unfolded GRUs for 35 time steps and set the size of the mini-batch to 20. We used SGD with a learning rate of 0.1 and divided the learning rate by 1.25 if we observed no improvement over 10 consecutive epochs. We repeated the same procedure until the learning rate became smaller than 10−4. In our method, δ was set to [0.2, 0.5, 0.8, 1.1, 1.4]. In gradient clipping, the threshold was set to [15, 30, 45, 60], since the average norm of the gradient was about 30. We initialized the weight matrices except for Whh with a normal distribution N(0, 10−4/200) , and Whh as an orthogonal matrix. After each epoch, we evaluated the validation loss, and the model that achieved the least validation loss was evaluated using the test set. 4.2 Success Rate and Accuracy Tables 1 and 2 list the success rates of language modeling and music modeling, respectively. These tables also list the averages and standard deviations of the loss in each modeling to show that our method outperforms gradient clipping. In these tables, “Threshold” means the threshold of gradient clipping, and “Delta” means δ in our method. As shown in Table 1, in language modeling, gradient clipping failed to train even though its parameter was set to 10, which is the average norm of the gradient as recommended by Pascanu et al. [28]. Although gradient clipping successfully trained the GRU when its threshold was five, it failed to effectively learn the model with this setting; a threshold of 10 achieved lower perplexity than a threshold of five. As shown in Table 2, in music modeling, gradient clipping successfully trained the GRU. However, the standard deviation of the loss was high when the threshold was set to 60 (double the average norm). On the other hand, our method successfully trained the GRU in both modelings. Tables 1 and 2 show that our approach achieved lower perplexity and negative loglikelihood compared with gradient clipping, while it constrained the GRU to be locally stable. This is because our approach of constraining stability improves the performance of the GRU. The previous study [22] showed that stabilizing the activation of the RNN can improve performance on several tasks. In addition, Bengio et al. [5] showed that an RNN is robust to noise when the state remains in the basin of attraction. Using our method, the state of the GRU tends to remain in the basin of the attraction of h∗= 0. Therefore, our method can improve robustness against noise, which is an advantage of the GRU [33]. As shown in Table 2, when δ was set to 1.1 or 1.4, the performance of the GRU deteriorated. This is because the convergence speed of the state depends on δ. As mentioned in Section 3.2, the spectral norm of Whh is less than or equal to 2 −δ. This spectral norm gives the upper bound of |λ1(J)|. |λ1(J)| gives the rate of convergence of a linearized GRU (eq. (9)), which approximates GRU near ht = 0 when |λ1(J)|<1. Therefore, the state of the GRU near ht = 0 tends to converge quickly if δ is set to close to two. In this case, the GRU becomes robust to noise since the state affected by the past noise converges to zero quickly, while the GRU loses effectiveness for long-term dependencies. We can tune δ from the characteristics of the data: if data have the long-term dependencies, we should set δ small, whereas we should set δ large for noisy data. The threshold in gradient clipping is unbounded, and hence, it is difficult to tune. Although the threshold can be heuristically set on the basis of the average norm, this may not be effective in language modeling using the GRU, as shown in Table 1. In contrast, the hyper-parameter is bounded in our method, i.e., 0 < δ < 2, and it is easy to understand its effect as mentioned above. 7 0 100 200 300 400 500 No. of Iteration 0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 Norm of gradient Spectral radius (a) Gradient clipping (threshold of 5). 0 100 200 300 400 500 No. of Iteration 0.0 0.2 0.4 0.6 0.8 1.0 1.2 Norm of gradient Spectral radius (b) Our method (delta of 0.2). Figure 1: Gradient explosion in language modeling. Table 3: Computation time in the language modeling (delta is 0.2, threshold is 5). Computation time (s) Naive SVD Truncated SVD Gradient clipping 5.02 × 104 4.55 × 104 4.96 × 104 4.3 Relation between Gradient and Spectral Radius Our method of constraining the GRU to be locally stable is based on the hypothesis that a change in stability causes an exploding gradient problem. To confirm this hypothesis, we examined (i) the norm of the gradient before clipping and (ii) the spectral radius of J (in Lemma 2), which determines local stability, versus the number of iterations until the 500th iteration in Fig. 1. Fig. 1(a) and 1(b) show the results of gradient clipping with a threshold of 5 and our method with δ of 0.2. Each norm of the gradient was normalized so that its maximum value was one. The norm of the gradient significantly increased when the spectral radius crossed one, such as at the 63rd, 79th, and 141st iteration (Fig. 1(a)). In addition, the spectral radius decreased to less than one after the gradient explosion; i.e., when the gradient explosion occurred, the gradient became in the direction of decreasing spectral radius. In contrast, our method kept the spectral radius less than one by constraining the spectral norm of Whh (Fig. 1(b)). Therefore, our method can prevent the gradient from exploding and effectively train the GRU. 4.4 Computation Time We evaluated computation time of the language modeling experiment. The detailed experimental setup is described in the supplementary material. Table 3 lists the computation time of the whole learning process using gradient clipping and our method with the naive SVD and with truncated SVD. This table shows the computation time of our method is comparable to gradient clipping. As mentioned in Section 2.1, the computational cost of gradient clipping is proportional to the number of parameters including weight matrices of input and output layers. In language modeling, the sizes of input and output layers tend to be large due to the large vocabulary size. On the other hand, the computational cost of our method only depends on the length of the state vector, and our method can be efficiently computed if the number of singular values greater than 2 is small as described in Section 3.3. As a result, our method could reduce the computation time comparing to gradient clipping. 5 Conclusion We analyzed the dynamics of GRUs and devised a learning method that prevents the exploding gradient problem. Our analysis of stability provides new insight into the behavior of GRUs. Our method constrains GRUs so that the states near 0 asymptotically converge to 0. Through language and music modeling experiments, we confirmed that our method can successfully train GRUs and found that our method can improve their performance. 8 References [1] Dario Amodei, Rishita Anubhai, Eric Battenberg, Carl Case, Jared Casper, Bryan Catanzaro, Jingdong Chen, Mike Chrzanowski, Adam Coates, Greg Diamos, Erich Elsen, Jesse Engel, Linxi Fan, Christopher Fougner, Awni Hannun, Billy Jun, Tony Han, Patrick LeGresley, Xiangang Li, Libby Lin, Sharan Narang, Andrew Ng, Sherjil Ozair, Ryan Prenger, Sheng Qian, Jonathan Raiman, Sanjeev Satheesh, David Seetapun, Shubho Sengupta, Chong Wang, Yi Wang, Zhiqian Wang, Bo Xiao, Yan Xie, Dani Yogatama, Jun Zhan, and Zhenyao Zhu. Deep speech 2: End-to-end speech recognition in english and mandarin. In Proc. ICML, pages 173–182, 2016. [2] Martin Arjovsky, Amar Shah, and Yoshua Bengio. Unitary evolution recurrent neural networks. In Proc. ICML, pages 1120–1128, 2016. [3] Pierre Baldi and Kurt Hornik. Universal approximation and learning of trajectories using oscillators. In Proc. NIPS, pages 451–457. 1996. [4] Nikita E Barabanov and Danil V Prokhorov. Stability analysis of discrete-time recurrent neural networks. IEEE Transactions on Neural Networks, 13(2):292–303, 2002. [5] Yoshua Bengio, Patrice Simard, and Paolo Frasconi. Learning long-term dependencies with gradient descent is difficult. IEEE Transactions on Neural Networks, 5(2):157–166, 1994. [6] Nicolas Boulanger-Lewandowski, Yoshua Bengio, and Pascal Vincent. Modeling temporal dependencies in high-dimensional sequences: Application to polyphonic music generation and transcription. In Proc. ICML, pages 1159–1166, 2012. [7] Mahmoud Chilali and Pascal Gahinet. H ∞design with pole placement constraints: an lmi approach. IEEE Transactions on automatic control, 41(3):358–367, 1996. [8] Kyunghyun Cho, Bart Van Merriënboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. Learning phrase representations using rnn encoder– decoder for statistical machine translation. In Proc. EMNLP, pages 1724–1734. ACL, 2014. [9] Junyoung Chung, Caglar Gulcehre, KyungHyun Cho, and Yoshua Bengio. Empirical evaluation of gated recurrent neural networks on sequence modeling. arXiv preprint arXiv:1412.3555, 2014. [10] Jasmine Collins, Jascha Sohl-Dickstein, and David Sussillo. Capacity and trainability in recurrent neural networks. In Proc. ICLR, 2017. [11] Kenji Doya. Bifurcations in the learning of recurrent neural networks. In Proc. ISCAS, volume 6, pages 2777–2780. IEEE, 1992. [12] Bernard Doyon, Bruno Cessac, Mathias Quoy, and Manuel Samuelides. Destabilization and route to chaos in neural networks with random connectivity. In Proc. NIPS, pages 549–555. 1993. [13] Alex Graves and Jürgen Schmidhuber. Offline handwriting recognition with multidimensional recurrent neural networks. In Proc. NIPS, pages 545–552, 2009. [14] Alex Graves, Abdel-rahman Mohamed, and Geoffrey Hinton. Speech recognition with deep recurrent neural networks. In Proc. ICASSP, pages 6645–6649. IEEE, 2013. [15] N Halko, PG Martinsson, and JA Tropp. Finding structure with randomness: Stochastic algorithms for constructing approximate matrix decompositions. arXiv preprint arXiv:0909.4061, 2009. [16] Robert Haschke and Jochen J Steil. Input space bifurcation manifolds of recurrent neural networks. Neurocomputing, 64:25–38, 2005. [17] Michiel Hermans and Benjamin Schrauwen. Training and analysing deep recurrent neural networks. In Proc. NIPS, pages 190–198. 2013. [18] Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8): 1735–1780, 1997. [19] Herbert Jaeger. Tutorial on training recurrent neural networks, covering BPPT, RTRL, EKF and the" echo state network" approach. GMD-Forschungszentrum Informationstechnik, 2002. [20] Rafal Jozefowicz, Wojciech Zaremba, and Ilya Sutskever. An empirical exploration of recurrent network architectures. In Proc. ICML, pages 2342–2350, 2015. 9 [21] Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Proc. ICLR, 2015. [22] David Krueger and Roland Memisevic. Regularizing rnns by stabilizing activations. In Proc. ICLR, 2016. [23] Chung-Ming Kuan, Kurt Hornik, and Halbert White. A convergence result for learning in recurrent neural networks. Neural Computation, 6(3):420–440, 1994. [24] Thomas Laurent and James von Brecht. A recurrent neural network without chaos. In Proc. ICLR, 2017. [25] Mitchell P Marcus, Mary Ann Marcinkiewicz, and Beatrice Santorini. Building a large annotated corpus of english: The penn treebank. Computational linguistics, 19(2):313–330, 1993. [26] Tomas Mikolov. Statistical language models based on neural networks. PhD thesis, Brno University of Technology, 2012. [27] Hiroyuki Nakahara and Kenji Doya. Dynamics of attention as near saddle-node bifurcation behavior. In Proc. NIPS, pages 38–44. 1996. [28] Razvan Pascanu, Tomas Mikolov, and Yoshua Bengio. On the difficulty of training recurrent neural networks. In Proc. ICML, pages 1310–1318, 2013. [29] Andrew M Saxe, James L McClelland, and Surya Ganguli. Exact solutions to the nonlinear dynamics of learning in deep linear neural networks. In Proc. ICLR, 2014. [30] Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to sequence learning with neural networks. In Proc. NIPS, pages 3104–3112. 2014. [31] Johan AK Suykens, Bart De Moor, and Joos Vandewalle. Robust local stability of multilayer recurrent neural networks. IEEE Transactions on Neural Networks, 11(1):222–229, 2000. [32] Sachin S Talathi and Aniket Vartak. Improving performance of recurrent neural network with relu nonlinearity. arXiv preprint arXiv:1511.03771, 2015. [33] Zhiyuan Tang, Ying Shi, Dong Wang, Yang Feng, and Shiyue Zhang. Memory visualization for gated recurrent neural networks in speech recognition. In Proc. ICASSP, pages 2736–2740. IEEE, 2017. [34] Onur Toker and Hitay Ozbay. On the np-hardness of solving bilinear matrix inequalities and simultaneous stabilization with static output feedback. In Proc. of American Control Conference, volume 4, pages 2525–2526. IEEE, 1995. [35] Eugene Vorontsov, Chiheb Trabelsi, Samuel Kadoury, and Chris Pal. On orthogonality and learning recurrent networks with long term dependencies. In Proc. ICML, 2017. [36] Stephen Wiggins. Introduction to applied nonlinear dynamical systems and chaos, volume 2. Springer Science & Business Media, 2003. [37] Wen Yu. Nonlinear system identification using discrete-time recurrent neural networks with stable learning algorithms. Information sciences, 158:131–147, 2004. [38] Wojciech Zaremba, Ilya Sutskever, and Oriol Vinyals. Recurrent neural network regularization. arXiv preprint arXiv:1409.2329, 2014. 10
2017
639
7,162
Phase Transitions in the Pooled Data Problem Jonathan Scarlett and Volkan Cevher Laboratory for Information and Inference Systems (LIONS) École Polytechnique Fédérale de Lausanne (EPFL) {jonathan.scarlett,volkan.cevher}@epfl.ch Abstract In this paper, we study the pooled data problem of identifying the labels associated with a large collection of items, based on a sequence of pooled tests revealing the counts of each label within the pool. In the noiseless setting, we identify an exact asymptotic threshold on the required number of tests with optimal decoding, and prove a phase transition between complete success and complete failure. In addition, we present a novel noisy variation of the problem, and provide an information-theoretic framework for characterizing the required number of tests for general random noise models. Our results reveal that noise can make the problem considerably more difficult, with strict increases in the scaling laws even at low noise levels. Finally, we demonstrate similar behavior in an approximate recovery setting, where a given number of errors is allowed in the decoded labels. 1 Introduction Consider the following setting: There exists a large population of items, each of which has an associated label. The labels are initially unknown, and are to be estimated based on pooled tests. Each pool consists of some subset of the population, and the test outcome reveals the total number of items corresponding to each label that are present in the pool (but not the individual labels). This problem, which we refer to as the pooled data problem, was recently introduced in [1,2], and further studied in [3,4]. It is of interest in applications such as medical testing, genetics, and learning with privacy constraints, and has connections to the group testing problem [5] and its linear variants [6,7]. The best known bounds on the required number of tests under optimal decoding were given in [3]; however, the upper and lower bounds therein do not match, and can exhibit a large gap. In this paper, we completely close these gaps by providing a new lower bound that exactly matches the upper bound of [3]. These results collectively reveal a phase transition between success and failure, with the probability of error vanishing when the number of tests exceeds a given threshold, but tending to one below that threshold. In addition, we explore the novel aspect of random noise in the measurements, and show that this can significantly increase the required number of tests. Before summarizing these contributions in more detail, we formally introduce the problem. 1.1 Problem setup We consider a large population of items [p] = {1, . . . , p}, each of which has an associated label in [d] = {1, . . . , d}. We let ⇡= (⇡1, . . . , ⇡d) denote a vector containing the proportions of items having each label, and we assume that the vector of labels itself, β = (β1, . . . , βp), is uniformly distributed over the sequences consistent with these proportions: β ⇠Uniform(B(⇡)), (1) where B(⇡) is the set of length-p sequences whose empirical distribution is ⇡. The goal is to recover β based on a sequence of pooled tests. The i-th test is represented by a (possibly random) vector X(i) 2 {0, 1}p, whose j-th entry X(i) j indicates whether the j-th item is 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. Sufficient for Pe ! 0 [3] Necessary for Pe 6! 1 [3] Necessary for Pe 6! 1 (this paper) p log p · max r2{1,...,d−1} f(r) p log p · 1 2f(1) p log p · max r2{1,...,d−1} f(r) Table 1: Necessary and sufficient conditions on the number of tests n in the noiseless setting. The function f(r) is defined in (5). Asymptotic multiplicative 1 + o(1) terms are omitted. Noiseless testing Noisy testing (SNR = p⇥(1)) Noisy testing (SNR = (log p)⇥(1)) Noisy testing (SNR = ⇥(1)) ⇥ ⇣ p log p ⌘ ⌦ ⇣ p log p ⌘ ⌦ ⇣ p log log p ⌘ ⌦ # p log p $ Table 2: Necessary and sufficient conditions on the number of tests n in the noisy setting. SNR denotes the signal-to-noise ratio, and the noise model is given in Section 2.2. included in the i-th test. We define a measurement matrix X 2 {0, 1}n⇥p whose i-th row is given by X(i) for i = 1, . . . , n, where n denotes the total number of tests. We focus on the non-adaptive testing scenario, where the entire matrix X must be specified prior to performing any tests. In the noiseless setting, the i-th test outcome is a vector Y (i) = (Y (i) 1 , . . . , Y (i) d ), with t-th entry Y (i) t = Nt(β, X(i)), (2) where for t = 1, . . . , d, we let Nt(β, X) = P j2[p] 1{βj = t \ Xj = 1} denote the number of items with label t that are included in the test described by X 2 {0, 1}p. More generally, in the possible presence of noise, the i-th observation is randomly generated according to # Y (i) | X(i), β $ ⇠PY |N1(β,X(i))...Nd(β,X(i)) (3) for some conditional probability mass function PY |N1,...,Nd (or density function in the case of continuous observations). We assume that the observations Y (i) (i = 1, . . . , n) are conditionally independent given X, but otherwise make no assumptions on PY |N1,...,Nd. Clearly, the noiseless model (2) falls under this more general setup. Similarly to X, we let Y denote an n⇥d matrix of observations, with the i-th row being Y (i). Given X and Y, a decoder outputs an estimate ˆβ of β, and the error probability is given by Pe = P[ˆβ 6= β], (4) where the probability is with respect to β, X, and Y. We seek to find conditions on the number of tests n under which Pe attains a certain target value in the limit as p ! 1, and our main results provide necessary conditions (i.e., lower bounds on n) for this to occur. As in [3], we focus on the case that d and ⇡are fixed and do not depend on p.1 1.2 Contributions and comparisons to existing bounds Our focus in this paper is on information-theoretic bounds on the required number of tests that hold regardless of practical considerations such as computation and storage. Among the existing works in the literature, the one most relevant to this paper is [3], whose bounds strictly improve on the initial bounds in [1]. The same authors also proved a phase transition for a practical algorithm based on approximate message passing [4], but the required number of tests is in fact significantly larger than the information-theoretic threshold (specifically, linear in p instead of sub-linear). Table 1 gives a summary of the bounds from [3] and our contributions in the noiseless setting. To define the function f(r) therein, we introduce the additional notation that for r = {1, . . . , d −1}, ⇡(r) = (⇡(r) 1 , . . . , ⇡(r) r ) is a vector whose first entry sums the largest d −r + 1 entries of ⇡, and whose remaining entries coincide with the remaining r −1 entries of ⇡. We have f(r) = max r2{1,...,d−1} 2(H(⇡) −H(⇡(r))) d −r , (5) meaning that the entries in Table 1 corresponding to the results of [3] are given as follows: 1More precisely, ⇡should be rounded to the nearest empirical distribution (e.g., in `1-norm) for sequences β 2 [d]p of length p; we leave such rounding implicit throughout the paper. 2 1 2 3 4 5 6 7 8 9 r 0 0.2 0.4 0.6 0.8 1 1.2 1.4 f(r) Random : Uniform : Highly non-uniform : Figure 1: The function f(r) in (5), for several choices of ⇡, with d = 10. The random ⇡are drawn uniformly on the probability simplex, and the highly non-uniform choice of ⇡is given by ⇡= (0.49, 0.49, 0.0025, . . . , 0.0025). When the maximum is achieved at r = 1, the bounds of [3] coincide up to a factor of two, whereas if the maximum is achieved for r > 1 then the gap is larger. • (Achievability) When the entries of X are i.i.d. on Bernoulli(q) for some q 2 (0, 1) (not depending on p), there exists a decoder such that Pe ! 0 as p ! 1 with n  p log p ✓ max r2{1,...,d−1} 2(H(⇡) −H(⇡(r))) d −r ◆ (1 + ⌘) (6) for arbitrarily small ⌘> 0. • (Converse) In order to achieve Pe 6! 1 as p ! 1, it is necessary that n ≥ p log p ✓H(⇡) d −1 ◆ (1 −⌘) (7) for arbitrarily small ⌘> 0. Unfortunately, these bounds do not coincide. If the maximum in (6) is achieved by r = 1 (which occurs, for example, when ⇡is uniform [3]), then the gap only amounts to a factor of two. However, as we show in Figure 1, if we compute the bounds for some “random” choices of ⇡then the gap is typically larger (i.e., r = 1 does not achieve the maximum), and we can construct choices where the gap is significantly larger. Closing these gaps was posed as a key open problem in [3]. We can now summarize our contributions as follows: 1. We give a lower bound that exactly matches (6), thus completely closing the above-mentioned gaps in the existing bounds and solving the open problem raised in [3]. More specifically, we show that Pe ! 1 whenever n  p log p # maxr2{1,...,d−1} 2(H(⇡)−H(⇡(r))) d−r $ (1 −⌘) for some ⌘> 0, thus identifying an exact phase transition – a threshold above which the error probability vanishes, but below which the error probability tends to one. 2. We develop a framework for understanding variations of the problem consisting of random noise, and give an example of a noise model where the scaling laws are strictly higher compared to the noiseless case. A summary is given in Table 2; the case SNR = (log p)⇥(1) reveals a strict increase in the scaling laws even when the signal-to-noise ratio grows unbounded, and the case SNR = ⇥(1) reveals that the required number of tests increases from sub-linear to super-linear in the dimension when the signal-to-noise ratio is constant. 3. In the supplementary material, we discuss how our lower bounds extend readily to the approximate recovery criterion, where we only require β to be identified up to a certain Hamming distance. However, for clarity, we focus on exact recovery throughout the paper. In a recent independent work [8], an adversarial noise setting was introduced. This turns out to be fundamentally different to our noisy setting. In particular, the results of [8] state that exact recovery is impossible, and even with approximate recovery, a huge number of tests (i.e., higher than polynomial) is needed unless ∆= O # q1/2+o(1) max $ , where qmax is the maximum allowed reconstruction error measured by the Hamming distance, and ∆is maximum adversarial noise amplitude. Of course, both random and adversarial noise are of significant interest, depending on the application. 3 Notation. For a positive integer d, we write [d] = {1, . . . , d}. We use standard information-theoretic notations for the (conditional) entropy and mutual information, e.g., H(X), H(Y |X), I(X; Y |Z) [9]. All logarithms have base e, and accordingly, all of the preceding information measures are in units of nats. The Gaussian distribution with mean µ and variance σ2 is denoted by N(µ, σ2). We use the standard asymptotic notations O(·), o(·), ⌦(·), !(·) and ⇥(·). 2 Main results In this section, we present our main results for the noiseless and noisy settings. The proofs are given in Section 3, as well as the supplementary material. 2.1 Phase transition in the noiseless setting The following theorem proves that the upper bound given in (6) is tight. Recall that for r = {1, . . . , d −1}, ⇡(r) = (⇡(r) 1 , . . . , ⇡(r) r ) is a vector whose first entry sums the largest d −r + 1 entries of ⇡, and whose remaining entries coincide with the remaining r −1 entries of ⇡. Theorem 1. (Noiseless setting) Consider the pooled data problem described in Section 1.1 with a given number of labels d and label proportion vector ⇡(not depending on the dimension p). For any decoder, in order to achieve Pe 6! 1 as p ! 1, it is necessary that n ≥ p log p ✓ max r2{1,...,d−1} 2(H(⇡) −H(⇡(r))) d −r ◆ (1 −⌘) (8) for arbitrarily small ⌘> 0. Combined with (6), this result reveals an exact phase transition on the required number of measurements: Denoting n⇤= p log p # maxr2{1,...,d−1} 2(H(⇡)−H(⇡r)) d−r $ , the error probability vanishes for n ≥n⇤(1 + ⌘), tends to one for n n⇤(1 −⌘), regardless of how small ⌘is chosen to be. Remark 1. Our model assumes that β is uniformly distributed over the sequences with empirical distribution ⇡, whereas [3] assumes that β is i.i.d. on ⇡. However, Theorem 1 readily extends to the latter setting: Under the i.i.d. model, once we condition on a given empirical distribution, the conditional distribution of β is uniform. As a result, the converse bound for the i.i.d. model follows directly from Theorem 1 by basic concentration and the continuity of the entropy function. 2.2 Information-theoretic framework for the noisy setting We now turn to general noise models of the form (3), and provide necessary conditions for the noisy pooled data problem in terms of the mutual information. General characterizations of this form were provided previously for group testing [10,11] and other sparse recovery problems [12,13]. Our general result is stated in terms of a maximization over a vector parameter ` = (`1, . . . , `d) with `t 2 {0, . . . , ⇡tp} for all t. We will see in the proof that `t represents the number of items of type t that are unknown to the decoder after p⇡t −`t are revealed by a genie. We define the following: • Given ` and β, we let S` be a random set of indices in [p] such that for each t 2 [d], the set contains `t indices corresponding to entries where β equals t. Specifically, we define S` to be uniformly distributed over all such sets. Moreover, we define Sc ` = [p] \ S`. • Given the above definitions, we define βSc ` = ⇢βj j 2 Sc ` ? otherwise, (9) where ? can be thought of as representing an unknown value. Hence, knowing βSc ` amounts to knowing the labels of all items in the set Sc `. • We define |B`(⇡)| to be the number of sequences β 2 [d]p that coincide with a given βSc ` on the entries not equaling ?, while also having empirical distribution ⇡overall. This number does not depend on the specific choice of Sc `. As an example, when `t = p⇡t for all t, we have S` = [p], βSc ` = (?, . . . , ?), and |B`(⇡)| = |B(⇡)|, defined following (1) • We let k`k0 denote the number of values in (`1, . . . , `d) that are positive. 4 With these definitions, we have the following result for general random noise models. Theorem 2. (Noisy setting) Consider the pooled data problem described in Section 1.1 under a general observation model of the form (3), with a given number of labels d and label proportion vector ⇡. For any decoder, in order to achieve Pe δ for a given δ 2 (0, 1), it is necessary that n ≥ max ` : k`k0≥2 # log |B`(⇡)| $ (1 −δ) −log 2 1 n Pn i=1 I(β; Y (i)|βSc ` , X(i)). (10) In order to obtain more explicit bounds on n from (10), one needs to characterize the mutual information terms, ideally forming an upper bound that does not depend on the distribution of the measurement matrix X. We do this for some specific models below; however, in general it can be a difficult task. The following corollary reveals that if the entries of X are i.i.d. on Bernoulli(q) for some q 2 (0, 1) (as was assumed in [3]), then we can simplify the bound. Corollary 1. (Noisy setting with Bernoulli testing) Suppose that the entries of X are i.i.d. on Bernoulli(q) for some q 2 (0, 1). Under the setup of Theorem 2, it is necessary that n ≥ max ` : k`k0≥2 # log |B`(⇡)| $ (1 −δ) −log 2 I(X0,`; Y |X1,`) , (11) where (X0,`, X1,`, Y ) are distributed as follows: (i) X0,` (respectively, X1,`) is a concatenation of the vectors X0,`(1), . . . , X0,`(d) (respectively, X1,`(1), . . . , X1,`(d)), the t-th of which contains `t (respectively, ⇡tp −`t) entries independently drawn from Bernoulli(q); (ii) Letting each Nt (t = 1, . . . , d) be the total number of ones in X0,`(t) and X1,`(t) combined, the random variable Y is drawn from PY |N1,...,Nd according to (3). As well as being simpler to evaluate, this corollary may be of interest in scenarios where one does not have complete freedom in designing X, and one instead insists on using Bernoulli testing. For instance, one may not know how to optimize X, and accordingly resort to generating it at random. Example 1: Application to the noiseless setting. In the supplementary material, we show that in the noiseless setting, Theorem 2 recovers a weakened version of Theorem 1 with 1 −⌘replaced by 1 −δ −o(1) in (8). Hence, while Theorem 2 does not establish a phase transition, it does recover the exact threshold on the number of measurements required to obtain Pe ! 0. An overview of the proof of this claim is as follows. We restrict the maximum in (10) to choices of ` where each `t equals either its minimum value 0 or its maximum value p⇡t. Since we are in the noiseless setting, each mutual information term reduces to the conditional entropy of Y (i) = (Y (i) 1 , . . . , Y (i) d ) given βSc ` and X(i). For the values of t such that `t = 0, the value Y (i) t is deterministic (i.e., it has zero entropy), whereas for the values of t such that `t = p⇡t, the value Y (i) t follows a hypergeometric distribution, whose entropy behaves as # 1 2 log p $ (1 + o(1)). In the case that X is i.i.d. on Bernoulli(q), we can use Corollary 1 to obtain the following necessary condition for Pe δ as as p ! 1, proved in the supplementary material: n ≥ p log(pq(1 −q)) ✓ max r2{1,...,d−1} 2(H(⇡) −H(⇡r)) d −r ◆ (1 −δ −o(1)) (12) for any q = q(p) such that both q and 1 −q behave as ! # 1 p $ . Hence, while q = ⇥(1) recovers the threshold in (8), the required number of tests strictly increases when q = o(1), albeit with a mild logarithmic dependence. Example 2: Group testing. To highlight the versatility of Theorem 2 and Corollary 1, we show that the latter recovers the lower bounds given in the group testing framework of [11]. Set d = 2, and let label 1 represent “defective” items, and label 2 represent “non-defective” items. Let PY |N1N2 be of the form PY |N1 with Y 2 {0, 1}, meaning the observations are binary and depend only on the number of defective items in the test. For brevity, let k = p⇡1 denote the total number of defective items, so that p⇡2 = p −k is the number of non-defective items. Letting `2 = p −k in (11), and letting `1 remain arbitrary, we obtain the necessary condition n ≥ max `12{1,...,k} # log #p−k+`1 `1 $$ (1 −δ) −log 2 I(X0,`1; Y |X1,`1) , (13) 5 where X0,`1 is a shorthand for X0,` with ` = (`1, p −k), and similarly for X1,`1. This matches the lower bound given in [11] for Bernoulli testing with general noise models, for which several corollaries for specific models were also given. Example 3: Gaussian noise. To give a concrete example of a noisy setting, consider the case that we observe the values in (2), but with each such value corrupted by independent Gaussian noise: Y (i) t = Nt(β, X(i)) + Z(i) t , (14) where Z(i) t ⇠N(0, pσ2) for some σ2 > 0. Note that given X(i), the values Nt themselves have variance at most proportional to p (e.g., see Appendix C), so σ2 = ⇥(1) can be thought of as the constant signal-to-noise ratio (SNR) regime. In the supplementary material, we prove the following bounds for this model: • By letting each `t in (10) equal its minimum or maximum value analogously to the noiseless case above, we obtain the following necessary condition for Pe δ as p ! 1: n ≥ ✓ max G✓[d] : |G|≥2 pGH(⇡G) P t2G 1 2 log # 1 + ⇡t 4σ2 ) ◆ (1 −δ −o(1)), (15) where pG := P t2G ⇡tp, and ⇡G has entries ⇡t P t02G ⇡t0 for t 2 G. Hence, we have the following: – In the case that σ2 = p−c for some c 2 (0, 1), each summand in the denominator simplifies to # c 2 log p $ (1 + o(1)), and we deduce that compared to the noiseless case (cf., (8)), the asymptotic number of tests increases by at least a constant factor of 1 c. – In the case that σ2 = (log p)−c for some c > 0, each summand in the denominator simplifies to # c 2 log log p $ (1+o(1)), and we deduce that compared to the noiseless case, the asymptotic number of tests increases by at least a factor of log p c log log p. Hence, we observe a strict increase in the scaling laws despite the fact that the SNR grows unbounded. – While (15) also provides an ⌦(p) lower bound for the case σ2 = ⇥(1), we can in fact do better via a different choice of ` (see below). • By letting `1 = p⇡1, `2 = 1, and `t = 0 for t = 3, . . . , d, we obtain the necessary condition n ≥ # 4pσ2 log p $ (1 −δ −o(1)) (16) for Pe δ as p ! 1. Hence, if σ2 = ⇥(1), we require n = ⌦(p log p); this is super-linear in the dimension, in contrast with the sub-linear ⇥ # p log p $ behavior observed in the noiseless case. Note that this choice of ` essentially captures the difficulty in identifying a single item, namely, the one corresponding to `2 = 1. These findings are summarized in Table 2; see also the supplementary material for extensions to the approximate recovery setting. Remark 2. While it may seem unusual to add continuous noise to discrete observations, this still captures the essence of the noisy pooled data problem, and simplifies the evaluation of the mutual information terms in (10). Moreover, this converse bound immediately implies the same bound for the discrete model in which the noise consists of adding a Gaussian term, rounding, and clipping to {0, . . . , p}, since the decoder could always choose to perform these operations as pre-processing. 3 Proofs Here we provide the proof of Theorem 1, along with an overview of the proof of Theorem 2. The remaining proofs are given in the supplementary material. 3.1 Proof of Theorem 1 Step 1: Counting typical outcomes. We claim that it suffices to consider the case that X is deterministic and ˆβ is a deterministic function of Y; to see this, we note that when either of these are random we have Pe = EX, ˆβ[Pβ[error]], and the average is lower bounded by the minimum. The following lemma, proved in the supplementary material, shows that for any X(i), each entry of the corresponding outcome Y (i) lies in an interval of length O #pp log p $ with high probability. 6 Lemma 1. For any deterministic test vector X 2 {0, 1}p, and for β uniformly distributed on B(⇡), we have for each t 2 [d] that P h**Nt(β, X) −E[Nt(β, X)] ** > p p log p i 2 p2 . (17) By Lemma 1 and the union bound, we have with probability at least 1 −2nd p2 that **Nt(β, X(i)) − E[Nt(β, X(i))] ** pp log p for all i 2 [n] and t 2 [d]. Letting this event be denoted by A, we have Pe ≥P[A] −P[A \ no error] ≥1 −2nd p2 −P[A \ no error]. (18) Next, letting Y(β) 2 [p]n⇥d denote Y explicitly as a function of β and similarly for ˆβ(Y) 2 [d]p, and letting YA denote the set of matrices Y under which the event A occurs, we have P[A \ no error] = 1 |B(⇡)| X b2B(⇡) 1{Y(b) 2 YA \ ˆβ(Y(b)) = b} (19) |YA| |B(⇡)|, (20) where (20) follows since each each Y 2 YA can only be counted once in the summation of (19), due to the condition ˆβ(Y(b)) = b. Step 2: Bounding the set cardinalities. By a standard combinatorial argument (e.g., [14, Ch. 2]) and the fact that ⇡is fixed as p ! 1, we have |B(⇡)| = ep(H(⇡)+o(1)). (21) To bound |YA|, first note that the entries of each Y (i) 2 [p]d sum to a deterministic value, namely, the number of ones in X(i). Hence, each Y 2 YA is uniquely described by a sub-matrix of Y 2 [p]n⇥d of size n ⇥(d −1). Moreover, since YA only includes matrices under which A occurs, each value in this sub-matrix only takes one of at most 2pp log p + 1 values. As a result, we have |YA|  # 2 p p log p + 1 $n(d−1), (22) and combining (18)–(22) gives Pe ≥ # 2pp log p + 1 $n(d−1) ep(H(⇡)+o(1)) −2nd p2 . (23) Since d is constant, it immediately follows that Pe ! 1 whenever n  pH(⇡) (d−1) log(2pp log p+1)(1 −⌘) for some ⌘> 0. Applying log(2pp log p + 1) = # 1 2 log p $ (1 + o(1)), we obtain the following necessary condition for Pe 6! 1: n ≥ 2pH(⇡) (d −1) log p(1 −⌘). (24) This yields the term in (8) corresponding to r = 1. Step 3: Genie argument. Let G be a subset of [d] of cardinality at least two, and define Gc = [d]\G. Moreover, define βGc to be a length-p vector with (βGc)j = ⇢βj βj 2 Gc ? βj 2 G, (25) where the symbol ? can be thought of as representing an unknown value. We consider a modified setting in which a genie reveals βGc to the decoder, i.e., the decoder knows the labels of all items for which the label lies in Gc, and is only left to estimate those in G. This additional knowledge can only make the pooled data problem easier, and hence, any lower bound in this modified setting remains valid in the original setting. In the genie-aided setting, instead of receiving the full observation vector Y (i) = (Y (i) 1 , . . . , Y (i) d ), it is equivalent to only be given {Y (i) j : j 2 G}, since the values in Gc are uniquely determined 7 from βGc and X(i). This means that the genie-aided setting can be cast in the original setting with modified parameters: (i) p is replaced by pG = P t2G ⇡tp, the number of items with unknown labels; (ii) d is replaced by |G|, the number of distinct remaining labels; (iii) ⇡is replaced by ⇡G, defined to be a |G|-dimensional probability vector with entries equaling ⇡t P t02G ⇡t0 (t 2 G). Due to this equivalence, the condition (24) yields the necessary condition n ≥ 2pGH(⇡G) (|G|−1) log p(1 −⌘), and maximizing over all G with |G| ≥2 gives n ≥ max G✓[d] : |G|≥2 2pGH(⇡G) (|G| −1) log p # 1 −⌘ $ . (26) Step 4: Simplification. Define r = d−|G|+1. We restrict the maximum in (26) to sets G indexing the highest |G| = d −r + 1 values of ⇡, and consider the following process for sampling from ⇡: • Draw a sample v from ⇡(r) (defined above Theorem 1); • If v corresponds to the first entry of ⇡(r), then draw a random sample from ⇡G and output it as a label (i.e., the labels have conditional probability proportional to the top |G| entries of ⇡); • Otherwise, if v corresponds to one of the other entries of ⇡(r), then output v as a label. By Shannon’s property of entropy for sequentially-generated random variables [15, p. 10], we find that H(⇡) = H(⇡(r))+ # P t2G ⇡t $ H(⇡G). Moreover, since pG = p·P t2G ⇡j, this can be written as pGH(⇡G) = p # H(⇡) −H(⇡(r)) $ . Substituting into (26), noting that |G| −1 = d −r by the definition of r, and maximizing over r = 1, . . . , d −1, we obtain the desired result (8). 3.2 Overview of proof of Theorem 2 We can interpret the pooled data problem as a communication problem in which a “message” β is sent over a “channel” PY |N1,...,Nd via “codewords” of the form {(N (i) 1 , . . . , N (i) d )}n i=1 that are constructed by summing various columns of X. As a result, it is natural to use Fano’s inequality [9, Ch. 7] to lower bound the error probability in terms of information content (entropy) of β and the amount of information that Y reveals about β (mutual information). However, a naive application of Fano’s inequality only recovers the bound in (10) with ` = p⇡. To handle the other possible choices of `, we again consider a genie-aided setting in which, for each t 2 [d], the decoder is informed of p⇡t −`t of the items whose label equals t. Hence, it only remains to identify the remaining `t items of each type. This genie argument is a generalization of that used in the proof of Theorem 1, in which each `t was either equal to its minimum value zero or its maximum value p⇡t. In Example 3 of Section 2, we saw that this generalization can lead to a strictly better lower bound in certain noisy scenarios. The complete proof of Theorem 2 is given in the supplementary material. 4 Conclusion We have provided novel information-theoretic lower bounds for the pooled data problem. In the noiseless setting, we provided a matching lower bound to the upper bound of [3], establishing an exact threshold indicating a phase transition between success and failure. In the noisy setting, we provided a characterization of general noise models in terms of the mutual information. In the special case of Gaussian noise, we proved an inherent added difficulty compared to the noiseless setting, with strict increases in the scaling laws even when the signal-to-noise ratio grows unbounded. An interesting direction for future research is to provide upper bounds for the noisy setting, potentially establishing the tightness of Theorem 2 for general noise models. This appears to be challenging using existing techniques; for instance, the pooled data problem bears similarity to group testing with linear sparsity, whereas existing mutual information based upper bounds for group testing are limited to the sub-linear regime [10, 11, 16]. In particular, the proofs of such bounds are based on concentration inequalities which, when applied to the linear regime, lead to additional requirements on the number of tests that prevent tight performance characterizations. Acknowledgment: This work was supported in part by the European Commission under Grant ERC Future Proof, SNF Sinergia project CRSII2-147633, SNF 200021-146750, and EPFL Fellows Horizon2020 grant 665667. 8 References [1] I.-H. Wang, S. L. Huang, K. Y. Lee, and K. C. Chen, “Data extraction via histogram and arithmetic mean queries: Fundamental limits and algorithms,” in IEEE Int. Symp. Inf. Theory, July 2016, pp. 1386–1390. [2] I.-H. Wang, S. L. Huang, and K. Y. Lee, “Extracting sparse data via histogram queries,” in Allerton Conf. Comm., Control, and Comp., 2016. [3] A. E. Alaoui, A. Ramdas, F. Krzakala, L. Zdeborova, and M. I. Jordan, “Decoding from pooled data: Sharp information-theoretic bounds,” 2016, http://arxiv.org/abs/1611.09981. [4] ——, “Decoding from pooled data: Phase transitions of message passing,” 2017, http://arxiv.org/abs/1702.02279. [5] D.-Z. Du and F. K. Hwang, Combinatorial group testing and its applications, ser. Series on Applied Mathematics. World Scientific, 1993. [6] A. Seb˝o, “On two random search problems,” J. Stat. Plan. Inf., vol. 11, no. 1, pp. 23–31, 1985. [7] M. Malyutov and H. Sadaka, “Maximization of ESI. Jaynes principle for testing significant inputs of linear model,” Rand. Opt. Stoch. Eq., vol. 6, no. 4, pp. 339–358, 1998. [8] W.-N. Chen and I.-H. Wang, “Partial data extraction via noisy histogram queries: Information theoretic bounds,” in IEEE Int. Symp. Inf. Theory (ISIT), 2017. [9] T. M. Cover and J. A. Thomas, Elements of Information Theory. John Wiley & Sons, Inc., 2006. [10] M. Malyutov, “The separating property of random matrices,” Math. Notes Acad. Sci. USSR, vol. 23, no. 1, pp. 84–91, 1978. [11] G. Atia and V. Saligrama, “Boolean compressed sensing and noisy group testing,” IEEE Trans. Inf. Theory, vol. 58, no. 3, pp. 1880–1901, March 2012. [12] C. Aksoylar, G. K. Atia, and V. Saligrama, “Sparse signal processing with linear and nonlinear observations: A unified Shannon-theoretic approach,” IEEE Trans. Inf. Theory, vol. 63, no. 2, pp. 749–776, Feb. 2017. [13] J. Scarlett and V. Cevher, “Limits on support recovery with probabilistic models: An information-theoretic framework,” IEEE Trans. Inf. Theory, vol. 63, no. 1, pp. 593–620, 2017. [14] I. Csiszár and J. Körner, Information Theory: Coding Theorems for Discrete Memoryless Systems, 2nd ed. Cambridge University Press, 2011. [15] C. E. Shannon, “A mathematical theory of communication,” Bell Syst. Tech. Journal, vol. 27, pp. 379–423, July and Oct. 1948. [16] J. Scarlett and V. Cevher, “Phase transitions in group testing,” in Proc. ACM-SIAM Symp. Disc. Alg. (SODA), 2016. [17] W. Hoeffding, “Probability inequalities for sums of bounded random variables,” J. Amer. Stat. Assoc., vol. 58, no. 301, pp. 13–30, 1963. [18] J. Massey, “On the entropy of integer-valued random variables,” in Int. Workshop on Inf. Theory, 1988. [19] G. Reeves and M. Gastpar, “The sampling rate-distortion tradeoff for sparsity pattern recovery in compressed sensing,” IEEE Trans. Inf. Theory, vol. 58, no. 5, pp. 3065–3092, May 2012. [20] ——, “Approximate sparsity pattern recovery: Information-theoretic lower bounds,” IEEE Trans. Inf. Theory, vol. 59, no. 6, pp. 3451–3465, June 2013. [21] J. Scarlett and V. Cevher, “How little does non-exact recovery help in group tesitng?” in IEEE Int. Conf. Acoust. Sp. Sig. Proc. (ICASSP), New Orleans, 2017. [22] ——, “On the difficulty of selecting Ising models with approximate recovery,” IEEE Trans. Sig. Inf. Proc. over Networks, vol. 2, no. 4, pp. 625–638, 2016. [23] J. C. Duchi and M. J. Wainwright, “Distance-based and continuum Fano inequalities with applications to statistical estimation,” 2013, http://arxiv.org/abs/1311.2669. 9
2017
64
7,163
Streaming Sparse Gaussian Process Approximations Thang D. Bui∗ Cuong V. Nguyen∗ Richard E. Turner Department of Engineering, University of Cambridge, UK {tdb40,vcn22,ret26}@cam.ac.uk Abstract Sparse pseudo-point approximations for Gaussian process (GP) models provide a suite of methods that support deployment of GPs in the large data regime and enable analytic intractabilities to be sidestepped. However, the field lacks a principled method to handle streaming data in which both the posterior distribution over function values and the hyperparameter estimates are updated in an online fashion. The small number of existing approaches either use suboptimal hand-crafted heuristics for hyperparameter learning, or suffer from catastrophic forgetting or slow updating when new data arrive. This paper develops a new principled framework for deploying Gaussian process probabilistic models in the streaming setting, providing methods for learning hyperparameters and optimising pseudo-input locations. The proposed framework is assessed using synthetic and real-world datasets. 1 Introduction Probabilistic models employing Gaussian processes have become a standard approach to solving many machine learning tasks, thanks largely to the modelling flexibility, robustness to overfitting, and well-calibrated uncertainty estimates afforded by the approach [1]. One of the pillars of the modern Gaussian process probabilistic modelling approach is a set of sparse approximation schemes that allow the prohibitive computational cost of GP methods, typically O(N 3) for training and O(N 2) for prediction where N is the number of training points, to be substantially reduced whilst still retaining accuracy. Arguably the most important and influential approximations of this sort are pseudo-point approximation schemes that employ a set of M ≪N pseudo-points to summarise the observational data thereby reducing computational costs to O(NM 2) and O(M 2) for training and prediction, respectively [2, 3]. Stochastic optimisation methods that employ mini-batches of training data can be used to further reduce computational costs [4, 5, 6, 7], allowing GPs to be scaled to datasets comprising millions of data points. The focus of this paper is to provide a comprehensive framework for deploying the Gaussian process probabilistic modelling approach to streaming data. That is, data that arrive sequentially in an online fashion, possibly in small batches, and whose number are not known a priori (and indeed may be infinite). The vast majority of previous work has focussed exclusively on the batch setting and there is not a satisfactory framework that supports learning and approximation in the streaming setting. A naïve approach might simply incorporate each new datum as they arrived into an ever-growing dataset and retrain the GP model from scratch each time. With infinite computational resources, this approach is optimal, but in the majority of practical settings, it is intractable. A feasible alternative would train on just the most recent K training data points, but this completely ignores potentially large amounts of informative training data and it does not provide a method for incorporating the old model into the new one which would save computation (except perhaps through initialisation of the hyperparameters). Existing, sparse approximation schemes could be applied in the same manner, but they merely allow K to be increased, rather than allowing all previous data to be leveraged, and again do not utilise intermediate approximate fits. ∗These authors contributed equally to this work. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. What is needed is a method for performing learning and sparse approximation that incrementally updates the previously fit model using the new data. Such an approach would utilise all the previous training data (as they will have been incorporated into the previously fit model) and leverage as much of the previous computation as possible at each stage (since the algorithm only requires access to the data at the current time point). Existing stochastic sparse approximation methods could potentially be used by collecting the streamed data into mini-batches. However, the assumptions underpinning these methods are ill-suited to the streaming setting and they perform poorly (see sections 2 and 4). This paper provides a new principled framework for deploying Gaussian process probabilistic models in the streaming setting. The framework subsumes Csató and Opper’s two seminal approaches to online regression [8, 9] that were based upon the variational free energy (VFE) and expectation propagation (EP) approaches to approximate inference respectively. In the new framework, these algorithms are recovered as special cases. We also provide principled methods for learning hyperparameters (learning was not treated in the original work and the extension is non-trivial) and optimising pseudo-input locations (previously handled via hand-crafted heuristics). The approach also relates to the streaming variational Bayes framework [10]. We review background material in the next section and detail the technical contribution in section 3, followed by several experiments on synthetic and real-world data in section 4. 2 Background Regression models that employ Gaussian processes are state of the art for many datasets [11]. In this paper we focus on the simplest GP regression model as a test case of the streaming framework for inference and learning. Given N input and real-valued output pairs {xn, yn}N n=1, a standard GP regression model assumes yn = f(xn) + ϵn, where f is an unknown function that is corrupted by Gaussian observation noise ϵn ∼N(0, σ2 y). Typically, f is assumed to be drawn from a zero-mean GP prior f ∼GP(0, k(·, ·|θ)) whose covariance function depends on hyperparameters θ. In this simple model, the posterior over f, p(f|y, θ), and the marginal likelihood p(y|θ) can be computed analytically (here we have collected the observations into a vector y = {yn}N n=1).2 However, these quantities present a computational challenge resulting in an O(N 3) complexity for maximum likelihood training and O(N 2) per test point for prediction. This prohibitive complexity of exact learning and inference in GP models has driven the development of many sparse approximation frameworks [12, 13]. In this paper, we focus on the variational free energy approximation scheme [3, 14] which lower bounds the marginal likelihood of the data using a variational distribution q(f) over the latent function: log p(y|θ) = log Z df p(y, f|θ) ≥ Z df q(f) log p(y, f|θ) q(f) = Fvfe(q, θ). (1) Since Fvfe(q, θ) = log p(y|θ) −KL[q(f)||p(f|y, θ)], where KL[·||·] denotes the Kullback–Leibler divergence, maximising this lower bound with respect to q(f) guarantees the approximate posterior gets closer to the exact posterior p(f|y, θ). Moreover, the variational bound Fvfe(q, θ) approximates the marginal likelihood and can be used for learning the hyperparameters θ. In order to arrive at a computationally tractable method, the approximate posterior is parameterized via a set of M pseudo-points u that are a subset of the function values f = {f̸=u, u} and which will summarise the data. Specifically, the approximate posterior is assumed to be q(f) = p(f̸=u|u, θ)q(u), where q(u) is a variational distribution over u and p(f̸=u|u, θ) is the prior distribution of the remaining latent function values. This assumption allows the following critical cancellation that results in a computationally tractable lower bound: Fvfe(q(u), θ) = Z df q(f) log p(y|f, θ)p(u|θ)XXXXX p(f̸=u|u, θ) XXXXX p(f̸=u|u, θ)q(u) = −KL[q(u)||p(u|θ)] + X n Z du q(u)p(fn|u, θ) log p(yn|fn, θ), where fn = f(xn) is the latent function value at xn. For the simple GP regression model considered here, closed-form expressions for the optimal variational approximation qvfe(f) and the optimal 2The dependence on the inputs {xn}N n=1 of the posterior, marginal likelihood, and other quantities is suppressed throughout to lighten the notation. 2 variational bound Fvfe(θ) = maxq(u)Fvfe(q(u), θ) (also called the ‘collapsed’ bound) are available: p(f|y, θ) ≈qvfe(f) ∝p(f̸=u|u, θ)p(u|θ)N(y; KfuK−1 uuu, σ2 yI), log p(y|θ) ≈Fvfe(θ) = log N(y; 0, KfuK−1 uuKuf + σ2 yI) − 1 2σ2y X n (knn −KnuK−1 uuKun), where f is the latent function values at training points, and Kf1f2 is the covariance matrix between the latent function values f1 and f2. Critically, the approach leads to O(NM 2) complexity for approximate maximum likelihood learning and O(M 2) per test point for prediction. In order for this method to perform well, it is necessary to adapt the pseudo-point input locations, e.g. by optimising the variational free energy, so that the pseudo-data distribute themselves over the training data. Alternatively, stochastic optimisation may be applied directly to the original, uncollapsed version of the bound [4, 15]. In particular, an unbiased estimate of the variational lower bound can be obtained using a small number of training points randomly drawn from the training set: Fvfe(q(u), θ) ≈−KL[q(u)||p(u|θ)] + N |B| X yn∈B Z du q(u)p(fn|u, θ) log p(yn|fn, θ). Since the optimal approximation is Gaussian as shown above, q(u) is often posited as a Gaussian distribution and its parameters are updated by following the (noisy) gradients of the stochastic estimate of the variational lower bound. By passing through the training set a sufficient number of times, the variational distribution converges to the optimal solution above, given appropriately decaying learning rates [4]. In principle, the stochastic uncollapsed approach is applicable to the streaming setting as it refines an approximate posterior based on mini-batches of data that can be considered to arrive sequentially (here N would be the number of data points seen so far). However, it is unsuited to this task since stochastic optimisation assumes that the data subsampling process is uniformly random, that the training set is revisited multiple times, and it typically makes a single gradient update per mini-batch. These assumptions are incompatible with the streaming setting: continuously arriving data are not typically drawn iid from the input distribution (consider an evolving time-series, for example); the data can only be touched once by the algorithm and not revisited due to computational constraints; each mini-batch needs to be processed intensively as it will not be revisited (multiple gradient steps would normally be required, for example, and this runs the risk of forgetting old data without delicately tuning the learning rates). In the following sections, we shall discuss how to tackle these challenges through a novel online inference and learning procedure, and demonstrate the efficacy of this method over the uncollapsed approach and naïve online versions of the collapsed approach. 3 Streaming sparse GP (SSGP) approximation using variational inference The general situation assumed in this paper is that data arrive sequentially so that at each step new data points ynew are added to the old dataset yold. The goal is to approximate the marginal likelihood and the posterior of the latent process at each step, which can be used for anytime prediction. The hyperparameters will also be adjusted online. Importantly, we assume that we can only access the current data points ynew directly for computational reasons (it might be too expensive to hold yold and x1:Nold in memory, for example, or approximations made at the previous step must be reused to reduce computational overhead). So the effect of the old data on the current posterior must be propagated through the previous posterior. We will now develop a new sparse variational free energy approximation for this purpose, that compactly summarises the old data via pseudo-points. The pseudo-inputs will also be adjusted online since this is critical as new parts of the input space will be revealed over time. The framework is easily extensible to more complex non-linear models. 3.1 Online variational free energy inference and learning Consider an approximation to the true posterior at the previous step, qold(f), which must be updated to form the new approximation qnew(f), qold(f) ≈p(f|yold) = 1 Z1(θold)p(f|θold)p(yold|f), (2) qnew(f) ≈p(f|yold, ynew) = 1 Z2(θnew)p(f|θnew)p(yold|f)p(ynew|f). (3) 3 Whilst the updated exact posterior p(f|yold, ynew) balances the contribution of old and new data through their likelihoods, the new approximation cannot access p(yold|f) directly. Instead, we can find an approximation of p(yold|f) by inverting eq. (2), that is p(yold|f) ≈Z1(θold)qold(f)/p(f|θold). Substituting this into eq. (3) yields, ˆp(f|yold, ynew) = Z1(θold) Z2(θnew)p(f|θnew)p(ynew|f) qold(f) p(f|θold). (4) Although it is tempting to use this as the new posterior, qnew(f) = ˆp(f|yold, ynew), this recovers exact GP regression with fixed hyperparameters (see section 3.3) and it is intractable. So, instead, we consider a variational update that projects the distribution back to a tractable form using pseudo-data. At this stage we allow the pseudo-data input locations in the new approximation to differ from those in the old one. This is required if new regions of input space are gradually revealed, as for example in typical time-series applications. Let a = f(zold) and b = f(znew) be the function values at the pseudo-inputs before and after seeing new data. Note that the number of pseudo-points, Ma = |a| and Mb = |b| are not necessarily restricted to be the same. The form of the approximate posterior mirrors that in the batch case, that is, the previous approximate posterior, qold(f) = p(f̸=a|a, θold)qold(a) where we assume qold(a) = N(a; ma, Sa). The new posterior approximation takes the same form, but with the new pseudo-points and new hyperparameters: qnew(f) = p(f̸=b|b, θnew)qnew(b). Similar to the batch case, this approximate inference problem can be turned into an optimisation problem using variational inference. Specifically, consider KL[qnew(f)||ˆp(f|yold, ynew)] = Z df qnew(f) log p(f̸=b|b, θnew)qnew(b) Z1(θold) Z2(θnew)p(f|θnew)p(ynew|f) qold(f) p(f|θold) (5) = log Z2(θnew) Z1(θold) + Z df qnew(f)  log p(a|θold)qnew(b) p(b|θnew)qold(a)p(ynew|f)  . Since the KL divergence is non-negative, the second term in the expression above is the negative approximate lower bound of the online log marginal likelihood (as Z2/Z1 ≈p(ynew|yold)), or the variational free energy F(qnew(f), θnew). By setting the derivative of F w.r.t. q(b) equal to 0, the optimal approximate posterior can be obtained for the regression case,3 qvfe(b) ∝p(b) exp  Z da p(a|b) log qold(a) p(a|θold) + Z df p(f|b) log p(ynew|f)  (6) ∝p(b)N(ˆy; KˆfbK−1 bbb, Σˆy,vfe), (7) where f is the latent function values at the new training points, ˆy =  ynew DaS−1 a ma  , Kˆfb =  Kfb Kab  , Σˆy,vfe =  σ2 yI 0 0 Da  , Da = (S−1 a −K′−1 aa )−1. The negative variational free energy is also analytically available, F(θ) = log N(ˆy; 0, KˆfbK−1 bbKbˆf + Σˆy,vfe) − 1 2σ2y tr(Kff−KfbK−1 bbKbf) + ∆a; where (8) 2∆a = −log |Sa| + log |K′ aa| + log |Da| + m⊺ a(S−1 a DaS−1 a −S−1 a )ma −tr[D−1 a Qa] + const. Equations (7) and (8) provide the complete recipe for online posterior update and hyperparameter learning in the streaming setting. The computational complexity and memory overhead of the new method is of the same order as the uncollapsed stochastic variational inference approach. The procedure is demonstrated on a toy regression example as shown in fig. 1[Left]. 3.2 Online α-divergence inference and learning One obvious extension of the online approach discussed above replaces the KL divergence in eq. (5) with a more general α-divergence [16]. This does not affect tractability: the optimal form of the approximate posterior can be obtained analytically for the regression case, qpep(b) ∝p(b)N(ˆy; KˆfbK−1 bbb, Σˆy,pep) where Σˆy,pep =  σ2 yI + αdiag(Kff−KfbK−1 bbKbf) 0 0 Da + α(Kaa −KabK−1 bbKba)  . (9) 3Note that we have dropped θnew from p(b|θnew), p(a|b, θnew) and p(f|b, θnew) to lighten the notation. 4 -2.0 -1.0 0.0 1.0 2.0 y -2.0 -1.0 0.0 1.0 2.0 y −2 0 2 4 6 8 10 12 x -2.0 -1.0 0.0 1.0 2.0 y 0 5 10 15 20 25 batch index 1.0 1.5 2.0 2.5 mean log-likelihood 0.01 0.20 0.50 0.80 1.00 Figure 1: [Left] SSGP inference and learning on a toy time-series using the VFE approach. The black crosses are data points (past points are greyed out), the red circles are pseudo-points, and blue lines and shaded areas are the marginal predictive means and confidence intervals at test points. [Right] Log-likelihood of test data as training data arrives for different α values, for the pseudo periodic dataset (see section 4.2). We observed that α = 0.01 is virtually identical to VFE. Dark lines are means over 4 splits and shaded lines are results for each split. Best viewed in colour. This reduces back to the variational case as α →0 (compare to eq. (7)) since then the α-divergence is equivalent to the KL divergence. The approximate online log marginal likelihood is also analytically tractable and recovers the variational case when α →0. Full details are provided in the appendix. 3.3 Connections to previous work and special cases This section briefly highlights connections between the new framework and existing approaches including Power Expectation Propagation (Power-EP), Expectation Propagation (EP), Assumed Density Filtering (ADF), and streaming variational Bayes. Recent work has unified a range of batch sparse GP approximations as special cases of the Power-EP algorithm [13]. The online α-divergence approach to inference and learning described in the last section is equivalent to running a forward filtering pass of Power-EP. In other words, the current work generalizes the unifying framework to the streaming setting. When the hyperparameters and the pseudo-inputs are fixed, α-divergence inference for sparse GP regression recovers the batch solutions provided by Power-EP. In other words, only a single pass through the data is necessary for Power-EP to converge in sparse GP regression. For the case α = 1, which is called Expectation Propagation, we recover the seminal work by Csató and Opper [8]. For the variational free energy case (equivalently where α →0) we recover the seminal work by Csató [9]. The new framework can be seen to extend these methods to allow principled learning and pseudo-input optimisation. Interestingly, in the setting where hyperparameters and the pseudo-inputs are fixed, if pseudo-points are added at each stage at the new data input locations, the method returns the true posterior and marginal likelihood (see appendix). For fixed hyperparameters and pseudo-points, the new VFE framework is equivalent to the application of streaming variational Bayes (VB) or online variational inference [10, 17, 18] to the GP setting in which the previous posterior plays a role of an effective prior for the new data. Similarly, the equivalent algorithm when α = 1 is called Assumed Density Filtering [19]. When the hyperparameters are updated, the new method proposed here is different from streaming VB and standard application of ADF, as the new method propagates approximations to just the old likelihood terms and not the prior. Importantly, we found vanilla application of the streaming VB framework performed catastrophically for hyperparameter learning, so the modification is critical. 4 Experiments In this section, the SSGP method is evaluated in terms of speed, memory usage, and accuracy (loglikelihood and error). The method was implemented on GPflow [20] and compared against GPflow’s version of the following baselines: exact GP (GP), sparse GP using the collapsed bound (SGP), and stochastic variational inference using the uncollapsed bound (SVI). In all the experiments, the RBF kernel with ARD lengthscales is used, but this is not a limitation required by the new methods. An implementation of the proposed method can be found at http://github.com/thangbui/streaming_sparse_gp. Full experimental results and additional discussion points are included in the appendix. 4.1 Synthetic data Comparing α-divergences. We first consider the general online α-divergence inference and learning framework and compare the performance of different α values on a toy online regression dataset 5 in fig. 1[Right]. Whilst the variational approach performs well, adapting pseudo-inputs to cover new regions of input space as they are revealed, algorithms using higher α values perform more poorly. Interestingly this appears to be related to the tendency for EP, in batch settings, to clump pseudo-inputs on top of one another [21]. Here the effect is much more extreme as the clumps accumulate over time, leading to a shortage of pseudo-points if the input range of the data increases. Although heuristics could be introduced to break up the clumps, this result suggests that using small α values for online inference and learning might be more appropriate (this recommendation differs from the batch setting where intermediate settings of α around 0.5 are best [13]). Due to these findings, for the rest of the paper, we focus on the variational case. Hyperparameter learning. We generated multiple time-series from GPs with known hyperparameters and observation noises, and tracked the hyperparameters learnt by the proposed online variational free energy method and exact GP regression. Overall, SSGP can track and learn good hyperparameters, and if there are sufficient pseudo-points, it performs comparatively to full GP on the entire dataset. Interestingly, all models including full GP regression tend to learn bigger noise variances as any discrepancy in the true and learned function values is absorbed into this parameter. 4.2 Speed versus accuracy In this experiment, we compare SSGP to the baselines (GP, SGP, and SVI) in terms of a speedaccuracy trade-off where the mean marginal log-likelihood (MLL) and the root mean squared error (RMSE) are plotted against the accumulated running time of each method after each iteration. The comparison is performed on two time-series datasets and a spatial dataset. Time-series data. We first consider modelling a segment of the pseudo periodic synthetic dataset [22], previously used for testing indexing schemes in time-series databases. The segment contains 24,000 time-steps. Training and testing sets are chosen interleaved so that their sizes are both 12,000. The second dataset is an audio signal prediction dataset, produced from the TIMIT database [23] and previously used to evaluate GP approximations [24]. The signal was shifted down to the baseband and a segment of length 18,000 was used to produce interleaved training and testing sets containing 9,000 time steps. For both datasets, we linearly scale the input time steps to the range [0, 10]. All algorithms are assessed in the mini-batch streaming setting with data ynew arriving in batches of size 300 and 500 taken in order from the time-series. The first 1,000 examples are used as an initial training set to obtain a reasonable starting model for each algorithm. In this experiment, we use memory-limited versions of GP and SGP that store the last 3,000 examples. This number was chosen so that the running times of these algorithms match those of SSGP or are slightly higher. For all sparse methods (SSGP, SGP, and SVI), we run the experiments with 100 and 200 pseudo-points. For SVI, we allow the algorithm to make 100 stochastic gradient updates during each iteration and run preliminary experiments to compare 3 learning rates r = 0.001, 0.01, and 0.1. The preliminary results showed that the performance of SVI was not significantly altered and so we only present the results for r = 0.1. Figure 2 shows the plots of the accumulated running time (total training and testing time up until the current iteration) against the MLL and RMSE for the considered algorithms. It is clear that SSGP significantly outperforms the other methods both in terms of the MLL and RMSE, once sufficient training data have arrived. The performance of SSGP improves when the number of pseudo-points increases, but the algorithm runs more slowly. In contrast, the performance of GP and SGP, even after seeing more data or using more pseudo-points, does not increase significantly since they can only model a limited amount of data (the last 3,000 examples). Spatial data. The second set of experiments consider the OS Terrain 50 dataset that contains spot heights of landscapes in Great Britain computed on a grid.4 A block of 200 × 200 points was split into 10,000 training examples and 30,000 interleaved testing examples. Mini-batches of data of size 750 and 1,000 arrive in spatial order. The first 1,000 examples were used as an initial training set. For this dataset, we allow GP and SGP to remember the last 7,500 examples and use 400 and 600 pseudo-points for the sparse models. Figure 3 shows the results for this dataset. SSGP performs better than the other baselines in terms of the RMSE although it is worse than GP and SGP in terms of the MLL. 4The dataset is available at: https://data.gov.uk/dataset/os-terrain-50-dtm. 6 100 101 102 103 104 accumulated running time (s) 10−3 10−2 10−1 100 RMSE SVI (r=0.1) GP SGP SSGP 100 101 102 103 104 accumulated running time (s) −4 −2 0 2 4 mean log-likelihood 100 101 102 103 accumulated running time (s) −4 −2 0 2 4 mean log-likelihood 100 101 102 103 104 accumulated running time (s) 10−4 10−3 10−2 10−1 100 101 RMSE pseudo periodic data, batch size = 300 100 101 102 103 accumulated running time (s) 10−4 10−3 10−2 10−1 100 RMSE pseudo periodic data, batch size = 500 100 101 102 103 accumulated running time (s) −8 −6 −4 −2 0 2 4 mean log-likelihood 100 101 102 103 accumulated running time (s) −8 −6 −4 −2 0 2 4 mean log-likelihood 100 101 102 103 accumulated running time (s) 10−4 10−3 10−2 10−1 100 101 RMSE audio data, batch size = 300 100 101 102 103 accumulated running time (s) 10−4 10−3 10−2 10−1 100 101 RMSE audio data, batch size = 500 Figure 2: Results for time-series datasets with batch sizes 300 and 500. Pluses and circles indicate the results for M = 100, 200 pseudo-points respectively. For each algorithm (except for GP), the solid and dashed lines are the efficient frontier curves for M = 100, 200 respectively. 4.3 Memory usage versus accuracy Besides running time, memory usage is another important factor that should be considered. In this experiment, we compare the memory usage of SSGP against GP and SGP on the Terrain dataset above with batch size 750 and M = 600 pseudo-points. We allow GP and SGP to use the last 2,000 and 6,000 examples for training, respectively. These numbers were chosen so that the memory usage of the two baselines roughly matches that of SSGP. Figure 4 plots the maximum memory usage of the three methods against the MLL and RMSE. From the figure, SSGP requires small memory usage while it can achieve comparable or better MLL and RMSE than GP and SGP. 4.4 Binary classification We show a preliminary result for GP models with non-Gaussian likelihoods, in particular, a binary classification model on the benchmark banana dataset. As the optimal form for the approximate posterior is not analytically tractable, the uncollapsed variational free energy is optimised numerically. The predictions made by SSGP in a non-iid streaming setting are shown in fig. 5. SSGP performs well and achieves the performance of the batch sparse variational method [5]. 7 100 101 102 103 104 accumulated running time (s) −6 −5 −4 −3 −2 −1 0 1 2 mean log-likelihood 100 101 102 103 104 accumulated running time (s) −6 −5 −4 −3 −2 −1 0 1 2 mean log-likelihood 100 101 102 103 104 accumulated running time (s) 25 50 100 200 RMSE terrain data, batch size = 750 100 101 102 103 104 accumulated running time (s) 12.5 25 50 100 200 RMSE terrain data, batch size = 1000 Figure 3: Results for spatial data (see fig. 2 for the legend). Pluses/solid lines and circles/dashed lines indicate the results for M = 400, 600 pseudo-points respectively. 400 600 800 1000 1200 1400 maximum memory usage (MB) −3.0 −2.5 −2.0 −1.5 −1.0 −0.5 0.0 0.5 mean log-likelihood 400 600 800 1000 1200 1400 maximum memory usage (MB) 20 40 60 80 100 RMSE Figure 4: Memory usage of SSGP (blue), GP (magenta) and SGP (red) against MLL and RMSE. −2 0 2 x1 −2 0 2 x2 error=0.28 −2 0 2 x1 error=0.15 −2 0 2 x1 error=0.10 −2 0 2 x1 error=0.10 Figure 5: SSGP inference and learning on a binary classification task in a non-iid streaming setting. The right-most plot shows the prediction made by using sparse variational inference on full training data [5] for comparison. Past observations are greyed out. The pseudo-points are shown as black dots and the black curves show the decision boundary. 5 Summary We have introduced a novel online inference and learning framework for Gaussian process models. The framework unifies disparate methods in the literature and greatly extends them, allowing sequential updates of the approximate posterior and online hyperparameter optimisation in a principled manner. The proposed approach outperforms existing approaches on a wide range of regression datasets and shows promising results on a binary classification dataset. A more thorough investigation on models with non-Gaussian likelihoods is left as future work. We believe that this framework will be particularly useful for efficient deployment of GPs in sequential decision making problems such as active learning, Bayesian optimisation, and reinforcement learning. 8 Acknowledgements The authors would like to thank Mark Rowland, John Bradshaw, and Yingzhen Li for insightful comments and discussion. Thang D. Bui is supported by the Google European Doctoral Fellowship. Cuong V. Nguyen is supported by EPSRC grant EP/M0269571. Richard E. Turner is supported by Google as well as EPSRC grants EP/M0269571 and EP/L000776/1. References [1] C. E. Rasmussen and C. K. I. Williams, Gaussian Processes for Machine Learning. The MIT Press, 2006. [2] E. Snelson and Z. Ghahramani, “Sparse Gaussian processes using pseudo-inputs,” in Advances in Neural Information Processing Systems (NIPS), 2006. [3] M. K. Titsias, “Variational learning of inducing variables in sparse Gaussian processes,” in International Conference on Artificial Intelligence and Statistics (AISTATS), 2009. [4] J. Hensman, N. Fusi, and N. D. Lawrence, “Gaussian processes for big data,” in Conference on Uncertainty in Artificial Intelligence (UAI), 2013. [5] J. Hensman, A. G. D. G. Matthews, and Z. Ghahramani, “Scalable variational Gaussian process classification,” in International Conference on Artificial Intelligence and Statistics (AISTATS), 2015. [6] A. Dezfouli and E. V. Bonilla, “Scalable inference for Gaussian process models with black-box likelihoods,” in Advances in Neural Information Processing Systems (NIPS), 2015. [7] D. Hernández-Lobato and J. M. Hernández-Lobato, “Scalable Gaussian process classification via expectation propagation,” in International Conference on Artificial Intelligence and Statistics (AISTATS), 2016. [8] L. Csató and M. Opper, “Sparse online Gaussian processes,” Neural Computation, 2002. [9] L. Csató, Gaussian Processes – Iterative Sparse Approximations. PhD thesis, Aston University, 2002. [10] T. Broderick, N. Boyd, A. Wibisono, A. C. Wilson, and M. I. Jordan, “Streaming variational Bayes,” in Advances in Neural Information Processing Systems (NIPS), 2013. [11] T. D. Bui, D. Hernández-Lobato, J. M. Hernández-Lobato, Y. Li, and R. E. Turner, “Deep Gaussian processes for regression using approximate expectation propagation,” in International Conference on Machine Learning (ICML), 2016. [12] J. Quiñonero-Candela and C. E. Rasmussen, “A unifying view of sparse approximate Gaussian process regression,” The Journal of Machine Learning Research, 2005. [13] T. D. Bui, J. Yan, and R. E. Turner, “A unifying framework for Gaussian process pseudo-point approximations using power expectation propagation,” Journal of Machine Learning Research, 2017. [14] A. G. D. G. Matthews, J. Hensman, R. E. Turner, and Z. Ghahramani, “On sparse variational methods and the Kullback-Leibler divergence between stochastic processes,” in International Conference on Artificial Intelligence and Statistics (AISTATS), 2016. [15] C.-A. Cheng and B. Boots, “Incremental variational sparse Gaussian process regression,” in Advances in Neural Information Processing Systems (NIPS), 2016. [16] T. Minka, “Power EP,” tech. rep., Microsoft Research, Cambridge, 2004. [17] Z. Ghahramani and H. Attias, “Online variational Bayesian learning,” in NIPS Workshop on Online Learning, 2000. [18] M.-A. Sato, “Online model selection based on the variational Bayes,” Neural Computation, 2001. [19] M. Opper, “A Bayesian approach to online learning,” in On-Line Learning in Neural Networks, 1999. [20] A. G. D. G. Matthews, M. van der Wilk, T. Nickson, K. Fujii, A. Boukouvalas, P. León-Villagrá, Z. Ghahramani, and J. Hensman, “GPflow: A Gaussian process library using TensorFlow,” Journal of Machine Learning Research, 2017. [21] M. Bauer, M. van der Wilk, and C. E. Rasmussen, “Understanding probabilistic sparse Gaussian process approximations,” in Advances in Neural Information Processing Systems (NIPS), 2016. [22] E. J. Keogh and M. J. Pazzani, “An indexing scheme for fast similarity search in large time series databases,” in International Conference on Scientific and Statistical Database Management, 1999. [23] J. Garofolo, L. Lamel, W. Fisher, J. Fiscus, D. Pallett, N. Dahlgren, and V. Zue, “TIMIT acoustic-phonetic continuous speech corpus LDC93S1,” Philadelphia: Linguistic Data Consortium, 1993. [24] T. D. Bui and R. E. Turner, “Tree-structured Gaussian process approximations,” in Advances in Neural Information Processing Systems (NIPS), 2014. 9
2017
640
7,164
Differentially Private Empirical Risk Minimization Revisited: Faster and More General∗ Di Wang Dept. of Computer Science and Engineering State University of New York at Buffalo Buffalo, NY 14260 dwang45@buffalo.edu Minwei Ye Dept. of Computer Science and Engineering State University of New York at Buffalo Buffalo, NY 14260 minweiye@buffalo.edu Jinhui Xu Dept. of Computer Science and Engineering State University of New York at Buffalo Buffalo, NY 14260 jinhui@buffalo.edu Abstract In this paper we study the differentially private Empirical Risk Minimization (ERM) problem in different settings. For smooth (strongly) convex loss function with or without (non)-smooth regularization, we give algorithms that achieve either optimal or near optimal utility bounds with less gradient complexity compared with previous work. For ERM with smooth convex loss function in high-dimensional (p ≫n) setting, we give an algorithm which achieves the upper bound with less gradient complexity than previous ones. At last, we generalize the expected excess empirical risk from convex loss functions to non-convex ones satisfying the PolyakLojasiewicz condition and give a tighter upper bound on the utility than the one in [34]. 1 Introduction Privacy preserving is an important issue in learning. Nowadays, learning algorithms are often required to deal with sensitive data. This means that the algorithm needs to not only learn effectively from the data but also provide a certain level of guarantee on privacy preserving. Differential privacy is a rigorous notion for statistical data privacy and has received a great deal of attentions in recent years [11, 10]. As a commonly used supervised learning method, Empirical Risk Minimization (ERM) also faces the challenge of achieving simultaneously privacy preserving and learning. Differentially Private (DP) ERM with convex loss function has been extensively studied in the last decade, starting from [7]. In this paper, we revisit this problem and present several improved results. Problem Setting Given a dataset D = {z1, z2 · · · , zn} from a data universe X, and a closed convex set C ⊆Rp, DP-ERM is to find x∗∈arg min x∈C F r(x, D) = F(x, D) + r(x) = 1 n n X i=1 f(x, zi) + r(x) with the guarantee of being differentially private. We refer to f as loss function. r(·) is some simple (non)-smooth convex function called regularizer. If the loss function is convex, the utility of the ∗This research was supported in part by NSF through grants IIS-1422591, CCF-1422324, and CCF-1716400. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. Method Utility Upper Bd Gradient Complexity Non smooth Regularizer? [8][7] Objective Perturbation O( p n2ϵ2 ) N/A No [21] Objective Perturbation O( p n2ϵ2 + λ||x∗||2 nϵ ) N/A Yes [6] Gradient Perturbation O( p log2(n) n2ϵ2 ) O(n2) Yes [34] Output Perturbation O( p n2ϵ2 ) O(nκ log( nϵ κ )) No This Paper Gradient Perturbation O( p log(n) n2ϵ2 ) O((n + κ) log( nϵµ p )) Yes Table 1: Comparison with previous (ϵ, δ)-DP algorithms. We assume that the loss function f is convex, 1-smooth, differentiable (twice differentiable for objective perturbation), and 1-Lipschitz. F r is µ-strongly convex. Bound and complexity ignore multiplicative dependence on log(1/δ). κ = L µ is the condition number. The lower bound is Ω(min{1, p n2ϵ2 })[6]. algorithm is measured by the expected excess empirical risk, i.e. E[F r(xprivate, D)]−F r(x∗, D). The expectation is over the coins of the algorithm. A number of approaches exist for this problem with convex loss function, which can be roughly classified into three categories. The first type of approaches is to perturb the output of a non-DP algorithm. [7] first proposed output perturbation approach which is extended by [34]. The second type of approaches is to perturb the objective function [7]. We referred to it as objective perturbation approach. The third type of approaches is to perturb gradients in first order optimization algorithms. [6] proposed gradient perturbation approach and gave the lower bound of the utility for both general convex and strongly convex loss functions. Later, [28] showed that this bound can actually be broken by adding more restrictions on the convex domain C of the problem. As shown in the following tables2 , the output perturbation approach can achieve the optimal bound of utility for strongly convex case. But it cannot be generalized to the case with non-smooth regularizer. The objective perturbation approach needs to obtain the optimal solution to ensure both differential privacy and utility, which is often intractable in practice, and cannot achieve the optimal bound. The gradient perturbation approach can overcome all the issues and thus is preferred in practice. However, its existing results are all based on Gradient Descent (GD) or Stochastic Gradient Descent (SGD). For large datasets, they are slow in general. In the first part of this paper, we present algorithms with tighter utility upper bound and less running time. Almost all the aforementioned results did not consider the case where the loss function is non-convex. Recently, [34] studied this case and measured the utility by gradient norm. In the second part of this paper, we generalize the expected excess empirical risk from convex to Polyak-Lojasiewicz condition, and give a tighter upper bound of the utility given in [34]. Due to space limit, we leave many details, proofs, and experimental studies in the supplement. 2 Related Work There is a long list of works on differentially private ERM in the last decade which attack the problem from different perspectives. [17][30] and [2] investigated regret bound in online settings. [20] studied regression in incremental settings. [32] and [31] explored the problem from the perspective of learnability and stability. We will compare to the works that are most related to ours from the utility and gradient complexity (i.e., the number (complexity) of first order oracle (f(x, zi), ∇f(x, zi)) being called) points of view. Table 1 is the comparison for the case that loss function is strongly convex and 1-smooth. Our algorithm achieves near optimal bound with less gradient complexity compared with previous ones. It is also robust to non-smooth regularizers. Tables 2 and 3 show that for non-strongly convex and high-dimension cases, our algorithms outperform other peer methods. Particularly, we improve the gradient complexity from O(n2) to O(n log n) while preserving the optimal bound for non-strongly convex case. For high-dimension case, gradient complexity is reduced from O(n3) to O(n1.5). Note that [19] also considered high-dimension case 2 Bound and complexity ignore multiplicative dependence on log(1/δ). 2 Method Utility Upper Bd Gradient Complexity Non smooth Regularizer? [21] Objective Perturbation O( √p nϵ ) N/A Yes [6] Gradient Perturbation O( √p log3/2(n) nϵ ) O(n2) Yes [34] Output Perturbation O([ √p nϵ ] 2 3 ) O(n[ nϵ d ] 2 3 ) No This paper Gradient Perturbation O( √p nϵ ) O( nϵ √p + n log( nϵ p )) Yes Table 2: Comparison with previous (ϵ, δ)-DP algorithms, where F r is not necessarily strongly convex. We assume that the loss function f is convex, 1-smooth, differentiable( twice differentiable for objective perturbation), and 1-Lipschitz. Bound and complexity ignore multiplicative dependence on log(1/δ). The lower bound in this case is Ω(min{1, √p nϵ })[6]. via dimension reduction. But their method requires the optimal value in the dimension-reduced space, in addition they considered loss functions under the condition rather than ℓ2- norm Lipschitz. For non-convex problem under differential privacy, [15][9][13] studied private SVD. [14] investigated k-median clustering. [34] studied ERM with non-convex smooth loss functions. In [34], the authors defined the utility using gradient norm as E[||∇F(xprivate)||2]. They achieved a qualified utility in O(n2) gradient complexity via DP-SGD. In this paper, we use DP-GD and show that it has a tighter utility upper bound. Method Utility Upper Bd Gradient Complexity Non smooth Regularizer? [28] Gradient Perturbation O( √ G2 C+||C||2 log(n) nϵ ) O( n3ϵ2 (G2 C+||C||2) log2(n)) Yes [28] Objective Perturbation O( GC+λ||C||2 nϵ ) N/A No [29] Gradient Perturbation O( (G 2 3 C log2(n)) (nϵ) 2 3 ) O( (nϵ) 2 3 G 2 3 C ) Yes This paper Gradient Perturbation O( √ G2 C+||C||2 nϵ ) O  n1.5√ϵ (G2 C+||C||2) 1 4  No Table 3: Comparison with previous (ϵ, δ)-DP algorithms. We assume that the loss function f is convex, 1-smooth, differentiable( twice differentiable for objective perturbation), and 1-Lipschitz. The utility bound depends on GC, which is the Gaussian width of C. Bound and complexity ignore multiplicative dependence on log(1/δ). 3 Preliminaries Notations: We let [n] denote {1, 2, . . . , n}. Vectors are in column form. For a vector v, we use ||v||2 to denote its ℓ2-norm. For the gradient complexity notation, G, δ, ϵ are omitted unless specified. D = {z1, · · · , zn} is a dataset of n individuals. Definition 3.1 (Lipschitz Function over θ). A loss function f : C × X →R is G-Lipschitz (under ℓ2-norm) over θ, if for any z ∈X and θ1, θ2 ∈C, we have |f(θ1, z) −f(θ2, z)| ≤G||θ1 −θ2||2. Definition 3.2 (L-smooth Function over θ). A loss function f : C × X →R is L-smooth over θ with respect to the norm || · || if for any z ∈X and θ1, θ2 ∈C, we have ||∇f(θ1, z) −∇f(θ2, z)||∗≤L||θ1 −θ2||, where || · ||∗is the dual norm of || · ||. If f is differentiable, this yields f(θ1, z) ≤f(θ2, z) + ⟨∇f(θ2, z), θ1 −θ2⟩+ L 2 ||θ1 −θ2||2. We say that two datasets D, D′ are neighbors if they differ by only one entry, denoted as D ∼D′. Definition 3.3 (Differentially Private[11]). A randomized algorithm A is (ϵ, δ)-differentially private if for all neighboring datasets D, D′ and for all events S in the output space of A, we have Pr(A(D) ∈S) ≤eϵPr(A(D′) ∈S) + δ, 3 when δ = 0 and A is ϵ-differentially private. We will use Gaussian Mechanism [11] and moments accountant [1] to guarantee (ϵ, δ)-DP. Definition 3.4 (Gaussian Mechanism). Given any function q : X n →Rp, the Gaussian Mechanism is defined as: MG(D, q, ϵ) = q(D) + Y, where Y is drawn from Gaussian Distribution N(0, σ2Ip) with σ ≥ √ 2 ln(1.25/δ)∆2(q) ϵ . Here ∆2(q) is the ℓ2-sensitivity of the function q, i.e. ∆2(q) = supD∼D′ ||q(D)−q(D′)||2. Gaussian Mechanism preservers (ϵ, δ)-differentially private. The moments accountant proposed in [1] is a method to accumulate the privacy cost which has tighter bound for ϵ and δ. Roughly speaking, when we use the Gaussian Mechanism on the (stochastic) gradient descent, we can save a factor of p ln(T/δ) in the asymptotic bound of standard deviation of noise compared with the advanced composition theorem in [12]. Theorem 3.1 ([1]). For G-Lipschitz loss function, there exist constants c1 and c2 so that given the sampling probability q = l/n and the number of steps T, for any ϵ < c1q2T, a DP stochastic gradient algorithm with batch size l that injects Gaussian Noise with standard deviation G n σ to the gradients (Algorithm 1 in [1]), is (ϵ, δ)-differentially private for any δ > 0 if σ ≥c2 q p T ln(1/δ) ϵ . 4 Differentially Private ERM with Convex Loss Function In this section we will consider ERM with (non)-smooth regularizer3, i.e. min x∈Rp F r(x, D) = F(x, D) + r(x) = 1 n n X i=1 f(x, zi) + r(x). (1) The loss function f is convex for every z. We define the proximal operator as proxr(y) = arg min x∈Rp{1 2||x −y||2 2 + r(x)}, and denote x∗= arg minx∈Rp F r(x, D). Algorithm 1 DP-SVRG(F r, ˜x0, T, m, η, σ) Input: f(x, z) is G-Lipschitz and L-smooth. F r(x, D) is µ-strongly convex w.r.t ℓ2-norm. ˜x0 is the initial point, η is the step size, T, m are the iteration numbers. 1: for s = 1, 2, · · · , T do 2: ˜x = ˜xs−1 3: ˜v = ∇F(˜x) 4: xs 0 = ˜x 5: for t = 1, 2, · · · , m do 6: Pick is t ∈[n] 7: vs t = ∇f(xs t−1, zis t ) −∇f(˜x, zis t ) + ˜v + us t, where us t ∼N(0, σ2Ip) 8: xs t = proxηr(xs t−1 −ηvs t ) 9: end for 10: ˜xs = 1 m Pm k=1 xs k 11: end for 12: return ˜xT 3 All of the algorithms and theorems in this section are applicable to closed convex set C rather than Rp. 4 4.1 Strongly convex case We first consider the case that F r(x, D) is µ-strongly convex, Algorithm 1 is based on the ProxSVRG [33], which is much faster than SGD or GD. We will show that DP-SVRG is also faster than DP-SGD or DP-GD in terms of the time needed to achieve the near optimal excess empirical risk bound. Definition 4.1 (Strongly Convex). The function f(x) is µ-strongly convex with respect to norm || · || if for any x, y ∈dom(f), there exist µ > 0 such that f(y) ≥f(x) + ⟨∂f, y −x⟩+ µ 2 ||y −x||2, (2) where ∂f is any subgradient on x of f. Theorem 4.1. In DP-SVRG(Algorithm 1), for ϵ ≤c1 T m n2 with some constant c1 and δ > 0, it is (ϵ, δ)-differentially private if σ2 = cG2Tm ln( 1 δ ) n2ϵ2 (3) for some constant c. Remark 4.1. The constraint on ϵ in Theorems 4.1 and 4.3 comes from Theorem 3.1. This constraint can be removed if the noise σ is amplified by a factor of O(ln(T/δ)) in (3) and (6). But accordingly there will be a factor of ˜O(log(Tm/δ)) in the utility bound in (5) and (7). In this case the guarantee of differential privacy is by advanced composition theorem and privacy amplification via sampling[6]. Theorem 4.2 (Utility guarantee). Suppose that the loss function f(x, z) is convex, G-Lipschitz and L-smooth over x. F r(x, D) is µ-strongly convex w.r.t ℓ2-norm. In DP-SVRG(Algorithm 1), let σ be as in (3). If one chooses η = Θ( 1 L) ≤ 1 12L and sufficiently large m = Θ( L µ ) so that they satisfy inequality 1 η(1 −8ηL)µm + 8Lη(m + 1) m(1 −8Lη) < 1 2, (4) then the following holds for T = O  log( n2ϵ2µ pG2 ln(1/δ))  , E[F r(˜xT , D)] −F r(x∗, D) ≤˜O p log(n)G2 log(1/δ) n2ϵ2µ  , (5) where some insignificant logarithm terms are hiding in the ˜O-notation. The total gradient complexity is O  (n + L µ ) log nϵµ p  . Remark 4.2. We can further use some acceleration methods to reduce the gradient complexity, see [25][3]. 4.2 Non-strongly convex case In some cases, F r(x, D) may not be strongly convex. For such cases, [5] has recently showed that SVRG++ has less gradient complexity than Accelerated Gradient Descent. Following the idea of DP-SVRG, we present the algorithm DP-SVRG++ for the non-strongly convex case. Unlike the previous one, this algorithm can achieve the optimal utility bound. Theorem 4.3. In DP-SVRG++(Algorithm 2), for ϵ ≤c1 2T m n2 with some constant c1 and δ > 0, it is (ϵ, δ)-differentially private if σ2 = cG22T m ln( 2 δ ) n2ϵ2 (6) for some constant c. Theorem 4.4 (Utility guarantee). Suppose that the loss function f(x, z) is convex, G-Lipschitz and L-smooth. In DP-SVRG++(Algorithm 2), if σ is chosen as in (6), η = 1 13L, and m = Θ(L) is sufficiently large, then the following holds for T = O  log( nϵ G√p√ log(1/δ))  , E[F r(˜xT , D)] −F r(x∗, D) ≤O G p p ln(1/δ)) nϵ ! . (7) The gradient complexity is O  nLϵ √p + n log( nϵ p )  . 5 Algorithm 2 DP-SVRG++(F r, ˜x0, T, m, η, σ) Input:f(x, z) is G-Lipschitz, and L-smooth over x ∈C. ˜x0 is the initial point, η is the step size, and T, m are the iteration numbers. x1 0 = ˜x0 for s = 1, 2, · · · , T do ˜v = ∇F(˜xs−1) ms = 2sm for t = 1, 2, · · · , ms do Pick is t ∈[n] vs t = ∇f(xs t−1, zis t ) −∇f(˜xs−1, zis t ) + ˜v + ut s, where ut s ∼N(0, σ2Ip) xs t = proxηr(xs t−1 −ηvs t ) end for ˜xs = 1 ms Pms k=1 xs k xs+1 0 = xs ms end for return ˜xT 5 Differentially Private ERM for Convex Loss Function in High Dimensions The utility bounds and gradient complexities in Section 4 depend on dimensionality p. In highdimensional (i.e., p ≫n) case, such a dependence is not very desirable. To alleviate this issue, we can usually get rid of the dependence on dimensionality by reformulating the problem so that the goal is to find the parameter in some closed centrally symmetric convex set C ⊆Rp (such as l1-norm ball), i.e., min x∈C F(x, D) = 1 n n X i=1 f(x, zi), (8) where the loss function is convex. [28],[29] showed that the √p term in (5),(7) can be replaced by the Gaussian Width of C, which is no larger than O(√p) and can be significantly smaller in practice (for more detail and examples one may refer to [28]). In this section, we propose a faster algorithm to achieve the upper utility bound. We first give some definitions. Algorithm 3 DP-AccMD(F, x0, T, σ, w) Input:f(x, z) is G-Lipschitz , and L-smooth over x ∈C . ||C||2 is the ℓ2 norm diameter of the convex set C. w is a function that is 1-strongly convex w.r.t || · ||C. x0 is the initial point, and T is the iteration number. Define Bw(y, x) = w(y) −⟨∇w(x), y −x⟩−w(x) y0, z0 = x0 for k = 0, · · · , T −1 do αk+1 = k+2 4L and rk = 1 2αk+1L xk+1 = rkzk + (1 −rk)yk yk+1 = arg miny∈C{ L||C||2 2 2 ||y −xk+1||2 C + ⟨∇F(xk+1), y −xk+1⟩} zk+1 = arg minz∈C{Bw(z, zk) + αk+1⟨∇F(xk+1) + bk+1, z −zk⟩}, where bk+1 ∼ N(0, σ2Ip) end for return yT Definition 5.1 (Minkowski Norm). The Minkowski norm (denoted by || · ||C) with respect to a centrally symmetric convex set C ⊆Rp is defined as follows. For any vector v ∈Rp, || · ||C = min{r ∈R+ : v ∈rC}. The dual norm of || · ||C is denoted as || · ||C∗, for any vector v ∈Rp, ||v||C∗= maxw∈C |⟨w, v⟩|. 6 The following lemma implies that for every smooth convex function f(x, z) which is L-smooth with respect to ℓ2 norm, it is L||C||2 2-smooth with respect to || · ||C norm. Lemma 5.1. For any vector v, we have ||v||2 ≤||C||2||v||C, where ||C||2 is the ℓ2-diameter and ||C||2 = supx,y∈C ||x −y||2. Definition 5.2 (Gaussian Width). Let b ∼N(0, Ip) be a Gaussian random vector in Rp. The Gaussian width for a set C is defined as GC = Eb[supw∈C⟨b, w⟩]. Lemma 5.2 ([28]). For W = (maxw∈C⟨w, v⟩)2 where v ∼N(0, Ip), we have Ev[W] = O(G2 C + ||C||2 2). Our algorithm DP-AccMD is based on the Accelerated Mirror Descent method, which was studied in [4],[23]. Theorem 5.3. In DP-AccMD( Algorithm 3), for ϵ, δ > 0, it is (ϵ, δ)-differentially private if σ2 = cG2T ln(1/δ) n2ϵ2 (9) for some constant c. Theorem 5.4 (Utility Guarantee). Suppose the loss function f(x, z) is G-Lipschitz , and L-smooth over x ∈C . In DP-AccMD, let σ be as in (9) and w be a function that is 1-strongly convex with respect to || · ||C. Then if T 2 = O L||C||2 2 p Bw(x∗, x0)nϵ G p ln(1/δ) p G2 C + ||C||2 2 ! , we have E[F(yT , D)] −F(x∗, D) ≤O p Bw(x∗, x0) p G2 C + ||C||2 2G p ln(1/δ) nϵ ! . The total gradient complexity is O  n1.5√ ϵL (G2 C+||C||2 2) 1 4  . 6 ERM for General Functions In this section, we consider non-convex functions with similar objective function as before, min x∈Rp F(x, D) = 1 n n X i=1 f(x, zi). (10) Algorithm 4 DP-GD(x0, F, η, T, σ, D) Input:f(x, z) is G-Lipschitz , and L-smooth over x ∈C . F is under the assumptions. 0 < η ≤1 L is the step size. T is the iteration number. for t = 1, 2, · · · , T do xt = xt−1 −η (∇F(xt−1, D) + zt−1), where zt−1 ∼N(0, σ2Ip) end for return xT (For section 6.1) return xm where m is uniform sampled from {0, 1, · · · , m −1}(For section 6.2) Theorem 6.1. In DP-GD( Algorithm 4), for ϵ, δ > 0, it is (ϵ, δ)-differentially private if σ2 = cG2T ln(1/δ) n2ϵ2 (11) for some constant c. 7 6.1 Excess empirical risk for functions under Polyak-Lojasiewicz condition In this section, we consider excess empirical risk in the case where the objective function F(x, D) satisfies Polyak-Lojasiewicz condition. This topic has been studied in [18][27][26][24][22]. Definition 6.1 ( Polyak-Lojasiewicz condition). For function F(·), denote X ∗= arg minx∈Rp F(x) and F ∗= minx∈Rp F(x). Then there exists µ > 0 and for every x, ||∇F(x)||2 ≥2µ(F(x) −F ∗). (12) (12) guarantees that every critical point (i.e., the point where the gradient vanish) is the global minimum. [18] shows that if F is differentiable and L-smooth w.r.t ℓ2 norm, then we have the following chain of implications: Strong Convex ⇒Essential Strong Convexity⇒Weak Strongly Convexity ⇒Restricted Secant Inequality ⇒Polyak-Lojasiewicz Inequality ⇔Error Bound Theorem 6.2. Suppose that f(x, z) is G-Lipschitz, and L-smooth over xC, and F(x, D) satisfies the Polyak-Lojasiewicz condition. In DP-GD( Algorithm 4), let σ be as in (11) with η = 1 L. Then if T = ˜O  log( n2ϵ2 pG2 log(1/δ))  , the following holds E[F(xT , D)] −F(x∗, D) ≤O(G2p log2(n) log(1/δ) n2ϵ2 ), (13) where ˜O hides other log, L, µ terms. DP-GD achieves near optimal bound since strongly convex functions can be seen as a special case in the class of functions satisfying Polyak-Lojasiewicz condition. The lower bound for strongly convex functions is Ω(min{1, p n2ϵ2 })[6]. Our result has only a logarithmic multiplicative term comparing to that. Thus we achieve near optimal bound in this sense. 6.2 Tight upper bound for (non)-convex case In [34], the authors considered (non)-convex smooth loss functions and measured the utility as ||F(xprivate, D)||2. They proposed an algorithm with gradient complexity O(n2). For this algorithm, they showed that E[||F(xprivate, D)||2] ≤O( log(n)√ p log(1/δ) nϵ ). By using DP-GD( Algorithm 4), we can eliminate the log(n) term. Theorem 6.3. Suppose that f(x, z) is G-Lipschitz, and L-smooth. In DP-GD( Algorithm 4), let σ be as in (11) with η = 1 L. Then when T = O( √ Lnϵ √ p log(1/δ)G), we have E[||∇F(xm, D)||2] ≤O( √ LG p p log(1/δ) nϵ ). (14) Remark 6.1. Although we can obtain the optimal bound by Theorem 3.1 using DP-SGD, there will be a constraint on ϵ. Also, we still do not know the lower bound of the utility using this measure. We leave it as an open problem. 7 Discussions From the discussion in previous sections, we know that when gradient perturbation is combined with linearly converge first order methods, near optimal bound with less gradient complexity can be achieved. The remaining issue is whether the optimal bound can be obtained in this way. In Section 6.1, we considered functions satisfying the Polyak-Lojasiewicz condition, and achieved near optimal bound on the utility. It will be interesting to know the bound for functions satisfying other conditions (such as general Gradient-dominated functions [24], quasi-convex and locally-Lipschitz in [16]) under the differential privacy model. For general non-smooth convex loss function (such as SVM ), we do not know whether the optimal bound is achievable with less time complexity. Finally, for non-convex loss function, proposing an easier interpretable measure for the utility is another direction for future work. 8 References [1] M. Abadi, A. Chu, I. Goodfellow, H. B. McMahan, I. Mironov, K. Talwar, and L. Zhang. Deep learning with differential privacy. In Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security, pages 308–318. ACM, 2016. [2] N. Agarwal and K. Singh. The price of differential privacy for online learning. In Proceedings of the 34th International Conference on Machine Learning, ICML 2017, Sydney, NSW, Australia, 6-11 August 2017, pages 32–40, 2017. [3] Z. Allen-Zhu. Katyusha: the first direct acceleration of stochastic gradient methods. In Proceedings of the 49th Annual ACM SIGACT Symposium on Theory of Computing, pages 1200–1205. ACM, 2017. [4] Z. Allen-Zhu and L. Orecchia. Linear Coupling: An Ultimate Unification of Gradient and Mirror Descent. In Proceedings of the 8th Innovations in Theoretical Computer Science, ITCS ’17, 2017. [5] Z. Allen-Zhu and Y. Yuan. Improved SVRG for Non-Strongly-Convex or Sum-of-Non-Convex Objectives. In Proceedings of the 33rd International Conference on Machine Learning, ICML ’16, 2016. [6] R. Bassily, A. Smith, and A. Thakurta. Private empirical risk minimization: Efficient algorithms and tight error bounds. In Foundations of Computer Science (FOCS), 2014 IEEE 55th Annual Symposium on, pages 464–473. IEEE, 2014. [7] K. Chaudhuri and C. Monteleoni. Privacy-preserving logistic regression. In Advances in Neural Information Processing Systems, pages 289–296, 2009. [8] K. Chaudhuri, C. Monteleoni, and A. D. Sarwate. Differentially private empirical risk minimization. Journal of Machine Learning Research, 12(Mar):1069–1109, 2011. [9] K. Chaudhuri, A. Sarwate, and K. Sinha. Near-optimal differentially private principal components. In Advances in Neural Information Processing Systems, pages 989–997, 2012. [10] C. Dwork. Differential privacy: A survey of results. In International Conference on Theory and Applications of Models of Computation, pages 1–19. Springer, 2008. [11] C. Dwork, F. McSherry, K. Nissim, and A. Smith. Calibrating noise to sensitivity in private data analysis. In Theory of Cryptography Conference, pages 265–284. Springer, 2006. [12] C. Dwork, G. N. Rothblum, and S. Vadhan. Boosting and differential privacy. In Foundations of Computer Science (FOCS), 2010 51st Annual IEEE Symposium on, pages 51–60. IEEE, 2010. [13] C. Dwork, K. Talwar, A. Thakurta, and L. Zhang. Analyze gauss: optimal bounds for privacypreserving principal component analysis. In Proceedings of the 46th Annual ACM Symposium on Theory of Computing, pages 11–20. ACM, 2014. [14] D. Feldman, A. Fiat, H. Kaplan, and K. Nissim. Private coresets. In Proceedings of the forty-first annual ACM symposium on Theory of computing, pages 361–370. ACM, 2009. [15] M. Hardt and A. Roth. Beyond worst-case analysis in private singular vector computation. In Proceedings of the forty-fifth annual ACM symposium on Theory of computing, pages 331–340. ACM, 2013. [16] E. Hazan, K. Levy, and S. Shalev-Shwartz. Beyond convexity: Stochastic quasi-convex optimization. In Advances in Neural Information Processing Systems, pages 1594–1602, 2015. [17] P. Jain, P. Kothari, and A. Thakurta. Differentially private online learning. In COLT, volume 23, pages 24–1, 2012. [18] H. Karimi, J. Nutini, and M. Schmidt. Linear convergence of gradient and proximal-gradient methods under the polyak-łojasiewicz condition. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pages 795–811. Springer, 2016. 9 [19] S. P. Kasiviswanathan and H. Jin. Efficient private empirical risk minimization for highdimensional learning. In Proceedings of The 33rd International Conference on Machine Learning, pages 488–497, 2016. [20] S. P. Kasiviswanathan, K. Nissim, and H. Jin. Private incremental regression. In Proceedings of the 36th ACM SIGMOD-SIGACT-SIGAI Symposium on Principles of Database Systems, PODS 2017, Chicago, IL, USA, May 14-19, 2017, pages 167–182, 2017. [21] D. Kifer, A. Smith, and A. Thakurta. Private convex empirical risk minimization and highdimensional regression. Journal of Machine Learning Research, 1(41):3–1, 2012. [22] G. Li and T. K. Pong. Calculus of the exponent of kurdyka-{\ L} ojasiewicz inequality and its applications to linear convergence of first-order methods. arXiv preprint arXiv:1602.02915, 2016. [23] Y. Nesterov. Smooth minimization of non-smooth functions. Mathematical programming, 103(1):127–152, 2005. [24] Y. Nesterov and B. T. Polyak. Cubic regularization of newton method and its global performance. Mathematical Programming, 108(1):177–205, 2006. [25] A. Nitanda. Stochastic proximal gradient descent with acceleration techniques. In Advances in Neural Information Processing Systems, pages 1574–1582, 2014. [26] B. T. Polyak. Gradient methods for the minimisation of functionals. USSR Computational Mathematics and Mathematical Physics, 3(4):864–878, 1963. [27] S. J. Reddi, A. Hefny, S. Sra, B. Poczos, and A. Smola. Stochastic variance reduction for nonconvex optimization. In International conference on machine learning, pages 314–323, 2016. [28] K. Talwar, A. Thakurta, and L. Zhang. Private empirical risk minimization beyond the worst case: The effect of the constraint set geometry. arXiv preprint arXiv:1411.5417, 2014. [29] K. Talwar, A. Thakurta, and L. Zhang. Nearly optimal private lasso. In Advances in Neural Information Processing Systems, pages 3025–3033, 2015. [30] A. G. Thakurta and A. Smith. (nearly) optimal algorithms for private online learning in fullinformation and bandit settings. In Advances in Neural Information Processing Systems, pages 2733–2741, 2013. [31] Y.-X. Wang, J. Lei, and S. E. Fienberg. Learning with differential privacy: Stability, learnability and the sufficiency and necessity of erm principle. Journal of Machine Learning Research, 17(183):1–40, 2016. [32] X. Wu, M. Fredrikson, W. Wu, S. Jha, and J. F. Naughton. Revisiting differentially private regression: Lessons from learning theory and their consequences. arXiv preprint arXiv:1512.06388, 2015. [33] L. Xiao and T. Zhang. A proximal stochastic gradient method with progressive variance reduction. SIAM Journal on Optimization, 24(4):2057–2075, 2014. [34] J. Zhang, K. Zheng, W. Mou, and L. Wang. Efficient private ERM for smooth objectives. In Proceedings of the Twenty-Sixth International Joint Conference on Artificial Intelligence, IJCAI 2017, Melbourne, Australia, August 19-25, 2017, pages 3922–3928, 2017. 10
2017
641
7,165
Unbounded cache model for online language modeling with open vocabulary Edouard Grave Facebook AI Research egrave@fb.com Moustapha Cisse Facebook AI Research moustaphacisse@fb.com Armand Joulin Facebook AI Research ajoulin@fb.com Abstract Recently, continuous cache models were proposed as extensions to recurrent neural network language models, to adapt their predictions to local changes in the data distribution. These models only capture the local context, of up to a few thousands tokens. In this paper, we propose an extension of continuous cache models, which can scale to larger contexts. In particular, we use a large scale non-parametric memory component that stores all the hidden activations seen in the past. We leverage recent advances in approximate nearest neighbor search and quantization algorithms to store millions of representations while searching them efficiently. We conduct extensive experiments showing that our approach significantly improves the perplexity of pre-trained language models on new distributions, and can scale efficiently to much larger contexts than previously proposed local cache models. 1 Introduction Language models are a core component of many natural language processing applications such as machine translation [3], speech recognition [2] or dialogue agents [50]. In recent years, deep learning has led to remarkable progress in this domain, reaching state of the art performance on many challenging benchmarks [31]. These models are known to be over-parametrized, and large quantities of data are needed for them to reach their full potential [12]. Consequently, the training time can be very long (up to weeks) even when vast computational resources are available [31]. Unfortunately, in many real-world scenarios, either such quantity of data is not available, or the distribution of the data changes too rapidly to permit very long training. A common strategy to circumvent these problems is to use a pre-trained model and slowly finetune it on the new source of data. Such adaptive strategy is also time-consuming for parametric models since the specificities of the new dataset must be slowly encoded in the parameters of the model. Additionally, such strategy is also prone to overfitting and dramatic forgetting of crucial information from the original dataset. These difficulties directly result from the nature of parametric models. In contrast, non-parametric approaches do not require retraining and can efficiently incorporate new information without damaging the original model. This makes them particularly suitable for settings requiring rapid adaptation to a changing distribution or to novel examples. However, nonparametric models perform significantly worse than fully trained deep models [12]. In this work, we are interested in building a language model that combines the best of both non-parametric and parametric approaches: a deep language model to model most of the distribution and a non-parametric one to adapt it to the change of distribution. This solution has been used in speech recognition under the name of cache models [36, 37]. Cache models exploit the unigram distribution of a recent context to improve the predictive ability of the model. Recently, Grave et al. [22] and Merity et al. [43] showed that this solution could be applied to neural networks. However, cache models depend on the local context. Hence, they can only adapt a parametric model to a local change in the distribution. These specificities limit their usefulness when 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. the context is unavailable (e.g., tweets) or is enormous (e.g., book reading). This work overcomes this limitation by introducing a fast non-parametric retrieval system into the hybrid approach. We demonstrate that this novel combination of a parametric neural language model with a non-parametric retrieval system can smoothly adapt to changes in the distribution while remaining as consistent as possible with the history of the data. Our approach is as a generalization of cache models which scales to millions of examples. 2 Related work This section reviews different settings that require models to adapt to changes in the data distribution, like transfer learning or open set (continual) learning. We also discuss solutions specific to language models, and we briefly explain large-scale retrieval methods. Transfer Learning. Transfer learning [10] is a well-established component of machine learning practitioners’ toolbox. It exploits the commonalities between different tasks to improve the predictive performance of the models trained to solve them. Notable variants of transfer learning are multitask learning [10], domain adaptation [6], and curriculum learning [8]. Multitask learning jointly trains several models to promote sharing of statistical strength. Domain adaptation reuses existing information about a given problem (e.g., data or model) to solve a new task. Curriculum learning takes one step further by adapting an existing model across a (large) sequence of increasingly difficult tasks. Models developed for these settings have proven useful in practice. However, they are chiefly designed for supervised learning and do not scale to the size of the problem we consider in this work. Class-incremental and Open Set Learning. These methods are concerned with problems where the set of targets is not known in advance but instead, increases over time. The main difficulty in this scenario lies in the deterioration of performance on previously seen classes when trying to accommodate new ones. Kuzborskij et al. [39] proposed to reduce the loss of accuracy when adding new classes by partly retraining the existing classifier. Muhlbaier et al. [47] introduced an ensemble model to deal with an increasingly large number of concepts. However, their approach relies on unrealistic assumptions on the data distribution. Zero-shot learning [41] can deal with new classes but often requires additional descriptive information about them [1]. Scheirer et al. [49] proposed a framework for open set recognition based on one-class SVMs. Adaptive language models. Adaptive language models change their parameters according to the recent history. Therefore, they implement a form of domain adaptation. A popular approach adds a cache to the model and has shown early success in the context of speech recognition [36, 38, 37]. Jelinek et al. further extended this strategy [29] into a smoothed trigram language model, reporting a reduction in both perplexity and word error rates. Della Pietra et al.[15] adapt the cache to a general n-gram model such that it satisfies marginal constraints obtained from the current document. Closer to our work, Grave et al. [21] have shown that this strategy can improve modern language models like recurrent networks without retraining. However, their model assumes that the data distribution changes smoothly over time, by using a context window to improve the performance. Merity et al. [43] proposed a similar model, where the cache is jointly trained with the language model. Other adaptive language models have been proposed in the past: Kneser and Steinbiss [35] and, Iyer and Ostendorf [26] dynamically adapt the parameters of their model to recent history using different weight interpolation schemes. Bellegarda [5] and Coccaro and Jurafsky [14] use latent semantic analysis to adapt their models to current context. Similarly, topic features have been used with either maximum entropy models [33] or recurrent networks [46, 53]. Finally, Lau et al. [42] propose to use pairs of distant of words to capture long-range dependencies. Large scale retrieval approaches. The standard method for large-scale retrieval is to compress vectors and query them using a standard efficient algorithm. One of the most popular strategies is Locality-sensitive hashing (LSH) by Charikar [11], which uses random projections to approximate the cosine similarity between vectors by a function related to the Hamming distance between their corresponding binary codes. Several works have built on this initial binarization technique, such as spectral hashing [54], or Iterative Quantization (ITQ) [19]. Product Quantization (PQ) [28] approximates the distances between vectors by simultaneously learning the codes and the centroids, using 2 k-means. In the context of text, several works have shown that compression does not significantly reduce the performance of models [17, 24, 30]. 3 Approach In this section, we first briefly review language modeling and the use of recurrent networks for this task. We then describe our model, called unbounded cache, and explain how to scale it to large datasets with millions of words. 3.1 Language modeling A language model evaluates the probability distribution of sequences of words. It is often framed as learning the conditional probability of words, given their history [4]. Let V be the size of the vocabulary; each word is represented by a one-hot encoding vector x in RV = V, corresponding to its index in the dictionary. Using the chain rule, the probability assigned to a sequence of words x1, . . . , xT can be factorized as p(x1, ..., xT ) = T Y t=1 p(xt | xt−1, ..., x1). (1) This conditional probability is traditionally approximated with non-parametric models based on counting statistics [20]. In particular, smoothed N-gram models [32, 34] have been the dominant type of models historically, achieving good performance in practice [44]. While the use of parametric models for language modeling is not new [48], their superiority has only been established with the recent emergence of neural networks [7, 45]. In particular, recurrent networks are now the standard approach, achieving state-of-the-art performances on several challenging benchmarks [31, 55]. 3.2 Recurrent networks. Recurrent networks are a special case of neural networks specifically designed for sequence modeling. At each time step, they maintain a hidden representation of the past and make a prediction accordingly. This representation is maintained by a continuous vector ht ∈Rd encoding the history xt, ..., x1. The probability of the next word is then simply parametrized using this hidden vector, i.e., p(w | xt, ..., x1) ∝exp(h⊤ t ow). (2) The hidden vector ht is computed by recursively applying an update rule: ht = Φ (xt, ht−1) , (3) where Φ is a function depending on the architecture of the network. Depending on Φ, the hidden vectors may have a specific structure adapted to different sequence representation problems. Several architectures for recurrent networks have been proposed, such as the Elman network [16], the long short-term memory (LSTM) [25] or the gated recurrent unit (GRU) [13]. For example, the Elman network [16] is defined by the following update rule ht = σ (Lxt + Rht−1) , (4) where σ is a non-linearity such as the logistic or tanh functions, L ∈Rd×V is a word embedding matrix and R ∈Rd×d is the recurrent matrix. Empirical results have validated the effectiveness of the LSTM architecture to natural language modeling [31]. We refer the reader to [23] for details on this architecture. In the rest of this paper, we focus on this structure of recurrent networks. Recurrent networks process a sentence one word at a time and update their weights by backpropagating the error of the prediction to a fixed window size of past time steps. This training procedure is computationally expensive, and often requires a significant amount of data to achieve good performance. To circumvent the need of retraining such network for domain adaptation, we propose to add a non-parametric model that takes care of the fluctuation in the data distribution. 3 3.3 Unbounded cache An unbounded cache adds a non-parametric and unconstrained memory to a neural network. Our approach is inspired by the cache model of Khun [36] and can be seen as an extension of Grave et al. [22] to an unbounded memory structure tailored to deal with out-of-vocabulary and rare words. Similar to Grave et al. [22], we extend a recurrent neural network with a key-value memory component, storing the pairs (hi, wi+1) of hidden representation and corresponding word. This memory component also shares similarity with the parametric memory component of the pointer network introduced by Vinyals et al. [52] and extended by Merity et al. [43]. As opposed to these models and standard cache models, we do not restrict the cache component to recent history but store all previously observed words. Using the information stored in the cache component, we can obtain a probability distribution over the words observed up to time t using the kernel density estimator: pcache(wt | w1, ...wt−1) ∝ t−1 X i=1 1{w = wi}K ∥ht −hi∥ θ  , (5) where K is a kernel, such as Epanechnikov or Gaussian, and θ is a smoothing parameter. If K is the Gaussian kernel (K(x) = exp(−x2/2)) and the hidden representations are normalized, this is equivalent to the continuous cache model. As the memory grows with the amount of data seen by the model, this probability distribution becomes impossible to compute. Millions of words and their multiple associated context representations are stored, and exact exhaustive matching is prohibitive. Instead, we use the approximate k-nearest neighbors algorithm that is described below in Sec. 3.4 to estimate this probability distribution: pcache(wt | w1, ...wt−1) ∝ X i∈N (ht) 1{w = wi}K ∥ht −hi∥ θ(ht)  , (6) where N(ht) is the set of nearest neighbors and θ(ht) is the Euclidean distance from ht to its k-th nearest neighbor. This estimator is known as variable kernel density estimation [51]. It should be noted that if the kernel K is equal to zero outside of [−1, 1], taking the sum over the k nearest neighbors is equivalent to taking the sum over the full data. The distribution obtained using the estimator defined in Eq. 6 assigns non-zero probability to at most k words, where k is the number of nearest neighbors used. In order to have non-zero probability everywhere (and avoid getting infinite perplexity), we propose to linearly interpolate this distribution with the one from the model: p(wt | w1, ...wt−1) = (1 −λ)pmodel(wt | w1, ...wt−1) + λpcache(wt | w1, ...wt−1). 3.4 Fast large scale retrieval Fast computation of the probability of a rare word is crucial to make the cache grow to millions of potential words. Their representation also needs to be stored with relatively low memory usage. In this section, we briefly describe a scalable retrieval method introduced by Jegou et al. [27]. Their approach called Inverted File System Product Quantization (IVFPQ) combines two methods, an inverted file system [56] and a quantization method, called Product quantization (PQ) [28]. Combining these two components offers a good compromise between a fast retrieval of approximate nearest neighbors and a low memory footprint. Inverted file system. Inverted file systems [56] are a core component of standard large-scale text retrieval systems, like search engines. When a query x is compared to a set Y of potential elements, an inverted file avoids an exhaustive search by providing a subset of possible matching candidates. In the context of continuous vectors, this subset is obtained by measuring some distance between the query and predefined vector representations of the set. More precisely, these candidates are selected through “coarse matching” by clustering all the elements in Y in c groups using k-means. The centroids are used as the vector representations. Each element of the set Y is associated with one centroid in an inverted table. The query x is then compared to each centroid and a subset of them is selected according to their distance to the query. All the elements of Y associated with these centroids are then compared to the query x. Typically, we take c centroids and keep the cc closest centroids to a query. 4 This procedure is quite efficient but very memory consuming, as each vector in the set Y must be stored. This can be drastically reduced by quantizing the vectors. Product Quantization (PQ) is a popular quantization method that has shown competitive performance on many retrieval benchmarks [28]. Following Jegou et al. [28], we do not directly quantize the vector y but its residual r, i.e., the difference between the vector and its associated centroids. Product Quantization. Product quantization is a data-driven compression algorithm with no overhead during search [28]. While PQ has been designed for image feature compression, Joulin et al. [30] have demonstrated its effectiveness for text too. PQ compresses real-valued vector by approximating them with the closest vector in a pre-defined structured set of centroids, called a codebook. This codebook is obtained by splitting each residual vector r into k subvectors ri, each of dimension d/k, and running a k-means algorithm with s centroids on each resulting subspace. The resulting codebook contains cs elements which is too large to be enumerated, and is instead implicitly defined by its structure: a d-dimensional vector x ∈Rd is approximated as ˆx = k X i=1 qi(x), (7) where qi(x) is the closest centroid to subvector xi. For each subspace, there are s = 2b centroids, where b is the number of bits required to store the quantization index of the sub-quantizer. Note that in PQ, the subspaces are aligned with the natural axis and improvements where made by Ge et al. [18] to align the subspaces to principal axes in the data. The reconstructed vector can take 2kb distinct reproduction values and is stored in kb bits. PQ estimates the inner product in the compressed domain as x⊤y ≈ˆx⊤y = k X i=1 qi(xi)⊤yi. (8) In practice, the vector estimate ˆx is trivially reconstructed from the codes, (i.e., from the quantization indexes) by concatenating these centroids. PQ uses two parameters, namely the number of subquantizers k and the number of bits b per quantization index. 4 Experiments In this section, we present evaluations of our unbounded cache model on different language modeling tasks. We first briefly describe our experimental setting and the datasets we used, before presenting the results. 4.1 Experimental setting One of the motivations of our model is to be able to adapt to changing data distribution. In particular, we want to incorporate new words in the vocabulary, as they appear in the test data. We thus consider a setting where we do not replace any words by the <unk> token, and where the test set contains out-of-vocabulary words (OOV) which were absent at train time. Since we use the perplexity as the evaluation metric, we need to avoid probabilities equal to zero in the output of our models (which would result in infinite perplexity). Thus, we always interpolate the probability distributions of the various models with the uniform distribution over the full vocabulary: puniform(wt) = 1 |vocabulary|. This is a standard technique, which was previously used to compare language models trained on datasets with different vocabularies [9]. Baselines We compare our unbounded cache model with the static model interpolated with uniform distribution, as well as the static model interpolated with the unigram probability distribution observed up to time t. Our proposal is a direct extension of the local cache model [22]. Therefore, we also compare to it to highlight the settings where an unbounded cache model is preferable to a local one. 5 model Size OoV rate (%) News 2008 219,796 2.3% News 2009 218,628 2.4% News 2010 205,859 2.4% News 2011 209,187 2.5% Commentary 144,197 4.2% Web 321,072 5.9% Wiki 191,554 5.5% Books 174,037 3.7% Table 1: Vocabulary size and out-of-vocabulary rate for various test sets (for a model trained on News 2007). 4.2 Implementation details We train recurrent neural networks with 256 LSTM hidden units, using the Adagrad algorithm with a learning rate of 0.2 and 10 epochs. We compute the gradients using backpropagation through time (BPTT) over 20 timesteps. Because of the large vocabulary sizes, we use the adaptative softmax [21]. We use the IVFPQ implementation from the FAISS open source library.1 We use 4, 096 centroids and 8 probes for the inverted file. Unless said otherwise, we query the 1, 024 nearest neighbors. 4.3 Datasets Most commonly used benchmarks for evaluating language models propose to replace rare words by the <unk> token. On the contrary, we are interested in open vocabulary settings, and therefore decided to use datasets without <unk>. We performed experiments on data from the five following domains: • News Crawl2 is a dataset made of news articles, collected from various online publications. There is one subset of the data for each year, from 2007 to 2011. This dataset will allow testing the unbounded cache models on data whose distribution slowly changes over time. The dataset is shuffled at the sentence level. In the following, we refer to this dataset as news 2007-2011. • News Commentary consists of political and economic commentaries from the website https://www.project-syndicate.org/. This dataset is publicly available from the Statistical Machine Translation workshop website. In the following, we refer to this dataset as commentary. • Common Crawl is a text dataset collected from diverse web sources. The dataset is shuffled at the sentence level. In the following, we refer to this dataset as web. • WikiText3 is a dataset derived from high quality English Wikipedia articles, introduced by Merity et al. [43]. Since we do not to replace any tokens by <unk>, we use the raw version. In the following, we refer to this dataset as wiki. • The book Corpus This is a dataset of 3,036 English books, collected from the Project Gutenberg4 [40]. We use a subset of the books, which have a length around 100,000 tokens. In the following we refer to this dataset as books. All these datasets are publicly available. Unless stated otherwise, we use 2 million tokens for training the static models and 10 million tokens for evaluation. All datasets are lowercased and tokenized using the europarl dataset tools.5 1https://github.com/facebookresearch/faiss 2http://www.statmt.org/wmt14/translation-task.html 3https://metamind.io/research/the-wikitext-long-term-dependency-language-modeling-dataset/ 4http://www.gutenberg.org/ 5http://statmt.org/europarl/v7/tools.tgz 6 Test set model 2007 2008 2009 2010 2011 static 220.9 237.6 256.2 259.7 268.8 static + unigram 220.3 235.9 252.6 256.1 264.3 static + local cache 218.9 234.5 250.5 256.2 265.2 static + unbounded cache 166.5 191.4 202.6 204.8 214.3 Table 2: Static model trained on news 2007 and tested on news 2007-2011. 200 400 600 800 1000 number k of nearest neighbors 0.23 0.22 0.21 0.20 0.19 0.18 0.17 0.16 0.15 0.14 Entropy difference with baseline News 2008-2011 news 2008 news 2009 news 2010 news 2011 200 400 600 800 1000 number k of nearest neighbors 0.60 0.55 0.50 0.45 0.40 0.35 0.30 0.25 0.20 Entropy difference with baseline Domain adaptation commentary web wiki books Figure 1: Performance of our model, as a function of the number k of nearest neighbors, used to estimate the probability of words in the unbounded cache. We report the entropy difference with the static+unigram baseline. Test domain Train domain model News Commentary Web Wiki Books static 342.7 689.3 1003.2 687.1 News static + unigram 303.5 581.1 609.4 349.1 static + local cache 288.5 593.4 316.5 240.3 static + unbounded cache 191.1 383.4 337.4 237.2 static 624.1 484.0 805.3 784.3 Web static + unigram 519.2 395.6 605.3 352.4 static + local cache 531.4 391.3 321.5 235.8 static + unbounded cache 306.3 234.9 340.2 223.6 static 638.1 626.3 901.0 654.6 Wiki static + unigram 537.9 462.2 688.5 346.9 static + local cache 532.8 436.7 694.3 228.8 static + unbounded cache 318.7 255.3 456.1 223.8 Table 3: Static model trained on news 2007 and tested on data from other domains. Dataset Static model Local cache Unbounded cache News 2008 82 664 433 Commentary 78 613 494 Web 85 668 502 Wiki 87 637 540 Books 81 626 562 Table 4: Computational time (in seconds) to process 10M tokens from different test sets for the static language model, the local cache (size 10,000) and the unbounded cache. 7 105 106 107 Number of test examples (log scale) 0.25 0.20 0.15 0.10 0.05 0.00 Entropy difference with baseline news 2008 news 2009 news 2010 Figure 2: Performance of the unbounded cache model, as a function of the number of test examples. We report the entropy difference with the static+unigram baseline. We observe that, as the number of test examples increases (and thus, the information stored in the cache), the performance of the unbounded cache increases. 4.4 Results We demonstrate the effectiveness of using an unbounded cache to complement a language model as advocated in the previous sections model by performing two types of experiments representing a near domain and far domain adaptation scenarios. In both experiments, we compare the unigram static model, the unigram extension, and the unbounded cache model. Local vs. Unbounded Cache We first study the impact of using an unbounded cache instead of a local one. To that end, we compare the performance of the two models when trained and tested on different combinations of the previously described datasets. These datasets can be categorized into two groups according to their properties and the results obtained by the various models we use. On the one hand, the Wiki and Books datasets are not shuffled. Hence, the recent history (up to a few thousands words) contains a wealth of information that can be used by a local cache to reduce the perplexity of a static model. Indeed, the local cache model achieves respectively 316.5 and 240.3 on the Wiki and Books datasets when trained on the News dataset. This corresponds to about 3× reduction in perplexity on both datasets in comparison to the static model. A similar trend holds when the training data is either Web or Wiki dataset. Surprisingly, the unbounded cache model performs similarly to the cache model despite using orders of magnitude broader context. A static model trained on News and augmented with an unbounded cache achieves respectively 337.4 and 237.2 of perplexity. It is also worth noting that our approach is more efficient than the local cache, while storing a much larger number of elements. Thanks to the use of fast nearest neighbor algorithm, it takes 502 seconds to process 10M tokens from the test set when using the unbounded cache. Comparatively, it takes 668 seconds for a local cache model of size 10, 000 to perform a similar task. The timing experiments, reported in Table 4.3, show a similar trend. On the other hand, the Commentary and Web datasets are shuffled. Therefore, a local cache can hardly capture the relevant statistics to significantly improve upon the static model interpolated with the unigram distribution. Indeed, the perplexity of a local cache model on these datasets when the static model is trained on the News dataset is respectively 288.5 and 593.4. In comparison, the unbounded cache model achieves on the same datasets respectively a perplexity of 191.1 and 383.4. That is an average improvement of about 50% over the local cache in both cases (see Table 3). Near domain adaptation. We study the benefit of using an unbounded cache model when the test domain is only slightly different from the source domain. We train the static model on news 2007 and test on the corpus news 2008 to news 2011. All the results are reported in Table 1. We first observe that the unbounded cache brings a 24.6% improvement relative to the static model on the in-domain news 2007 corpus by bringing the perplexity from 220.9 down to 166.5. In comparison, neither using the unigram information nor using a local cache lead to significant improvement. This result underlines two phenomena. First, the simple distributional information captured by the unigram or the local cache is already captured by the static model. Second, the unbounded cache enhances the discrimination capabilities of the static model by capturing useful non-linearities thanks to the combination of the nearest neighbor and the representation extracted from 8 the static model. Interestingly, these observations remain consistent when we consider evaluations on the test sets news 2008-2011. Indeed, the average improvement of unbounded cache relatively to the static model on the corpus news 2008-2011 is 20.44% while the relative improvement of the unigram cache is only 1.3%. Similarly to the in-domain experiment, the unigram brings little useful information to the static model mainly because the source (news 2007) and the target distributions (news 2008-2011) are very close. In contrast, the unbounded cache still complements the static model with valuable non-linear information of the target distributions. Far domain adaptation. Our second set of experiments is concerned with testing on different domains from the one the static model is trained on. We use the News, Web and Wiki datasets as source domains, and all five domains as target. The results are reported in Table 3. First, we observe that the unigram, the local and the unbounded cache significantly help the static model in all the far domain adaptation experiments. For example, when adapting the static model from the News domain to the Commentary and Wiki domains, the unigram reduces the perplexity of the static model by 39.2 and 393.8 in absolute value respectively. The unbounded cache significantly improves upon the static model and the unigram on all the far domain adaptation experiment. The smallest relative improvement compared to the static model and the unigram is achieved when adapting from News to Web and is 79.7% and 51.6% respectively. The more the target domain is different from the source one, the more interesting is the use of an unbounded cache mode. Indeed, when adapting to the Books domain (which is the most different from the other domains) the average improvement given by the unbounded cache relatively to the static model is 69.7%. Number of nearest neighbors. Figure 1 shows the performance of our model with the number of nearest neighbors per query. As observed previously by Grave et al [22], the performance of a language model improves with the size of the context used in the cache. This context is, in some sense, a constrained version of our set of retained nearest neighbors. Interestingly, we observe the same phenomenon despite forming the set of possible predictions over a much broader set of potential candidates than the immediate local context. Since IFVPQ has a linear complexity with the number of nearest neighbors, setting the number of nearest neighbors to a thousand offers a good trade-off between speed and accuracy. Size of the cache. Figure 2 shows the gap between the performance of static language model with and without the cache as the size of the test set increases. Despite having a much more significant set of candidates to look from, our algorithm continues to select relevant information. As the test set is explored, better representations for rare words are stored, explaining this constant improvement. 5 Conclusion In this paper, we introduce an extension to recurrent networks for language modeling, which stores past hidden activations and associated target words. This information can then be used to obtain a probability distribution over the previous words, allowing the language models to adapt to the current distribution of the data dynamically. We propose to scale this simple mechanism to large amounts of data (millions of examples) by using fast approximate nearest neighbor search. We demonstrated on several datasets that our unbounded cache is an efficient method to adapt a recurrent neural network to new domains dynamically, and can scale to millions of examples. Acknowledgements We thank the anonymous reviewers for their insightful comments. References [1] I. Alabdulmohsin, M. Cisse, and X. Zhang. Is attribute-based zero-shot learning an ill-posed strategy? In ECML-PKDD. [2] D. Amodei, R. Anubhai, E. Battenberg, C. Case, J. Casper, B. Catanzaro, J. Chen, M. Chrzanowski, A. Coates, G. Diamos, et al. Deep speech 2: End-to-end speech recognition in English and Mandarin. In ICML, 2016. 9 [3] D. Bahdanau, K. Cho, and Y. Bengio. Neural machine translation by jointly learning to align and translate. In ICLR, 2015. [4] L. R. Bahl, F. Jelinek, and R. L. Mercer. A maximum likelihood approach to continuous speech recognition. PAMI, 1983. [5] J. R. Bellegarda. Exploiting latent semantic information in statistical language modeling. Proceedings of the IEEE, 2000. [6] S. Ben-David, J. Blitzer, K. Crammer, A. Kulesza, F. Pereira, and J. W. Vaughan. A theory of learning from different domains. Machine learning, 79(1), 2010. [7] Y. Bengio, R. Ducharme, P. Vincent, and C. Jauvin. A neural probabilistic language model. JMLR, 2003. [8] Y. Bengio, J. Louradour, R. Collobert, and J. Weston. Curriculum learning. In ICML, 2009. [9] C. Buck, K. Heafield, and B. van Ooyen. N-gram counts and language models from the common crawl. In LREC, 2014. [10] R. Caruana. Multitask learning. In Learning to learn. Springer, 1998. [11] M. S. Charikar. Similarity estimation techniques from rounding algorithms. In STOC, 2002. [12] C. Chelba, T. Mikolov, M. Schuster, Q. Ge, T. Brants, P. Koehn, and T. Robinson. One billion word benchmark for measuring progress in statistical language modeling. arXiv preprint arXiv:1312.3005, 2013. [13] J. Chung, C. Gulcehre, K. Cho, and Y. Bengio. Empirical evaluation of gated recurrent neural networks on sequence modeling. arXiv preprint arXiv:1412.3555, 2014. [14] N. Coccaro and D. Jurafsky. Towards better integration of semantic predictors in statistical language modeling. In ICSLP, 1998. [15] S. Della Pietra, V. Della Pietra, R. L. Mercer, and S. Roukos. Adaptive language modeling using minimum discriminant estimation. In Proceedings of the workshop on Speech and Natural Language, 1992. [16] J. L. Elman. Finding structure in time. Cognitive science, 1990. [17] M. Federico, N. Bertoldi, and M. Cettolo. Irstlm: an open source toolkit for handling large scale language models. In INTERSPEECH, 2008. [18] T. Ge, K. He, Q. Ke, and J. Sun. Optimized product quantization for approximate nearest neighbor search. In CVPR, 2013. [19] Y. Gong and S. Lazebnik. Iterative quantization: A procrustean approach to learning binary codes. In CVPR, 2011. [20] J. T. Goodman. A bit of progress in language modeling. Computer Speech & Language, 2001. [21] E. Grave, A. Joulin, M. Cissé, D. Grangier, and H. Jégou. Efficient softmax approximation for GPUs. In ICML, 2017. [22] E. Grave, A. Joulin, and N. Usunier. Improving neural language models with a continuous cache. In ICLR, 2017. [23] A. Graves, A. Mohamed, and G. Hinton. Speech recognition with deep recurrent neural networks. In ICASSP, 2013. [24] K. Heafield. Kenlm: Faster and smaller language model queries. In Proceedings of the Sixth Workshop on Statistical Machine Translation, 2011. [25] S. Hochreiter and J. Schmidhuber. Long short-term memory. Neural computation, 1997. [26] R. M. Iyer and M. Ostendorf. Modeling long distance dependence in language: Topic mixtures versus dynamic cache models. IEEE Transactions on speech and audio processing, 1999. [27] H. Jegou, M. Douze, and C. Schmid. Hamming embedding and weak geometric consistency for large scale image search. In ECCV, 2008. [28] H. Jegou, M. Douze, and C. Schmid. Product quantization for nearest neighbor search. PAMI, 2011. 10 [29] F. Jelinek, B. Merialdo, S. Roukos, and M. Strauss. A dynamic language model for speech recognition. In HLT, 1991. [30] A. Joulin, E. Grave, P. Bojanowski, M. Douze, H. Jégou, and T. Mikolov. Fasttext.zip: Compressing text classification models. arXiv preprint arXiv:1612.03651, 2016. [31] R. Jozefowicz, O. Vinyals, M. Schuster, N. Shazeer, and Y. Wu. Exploring the limits of language modeling. arXiv preprint arXiv:1602.02410, 2016. [32] S. M. Katz. Estimation of probabilities from sparse data for the language model component of a speech recognizer. ICASSP, 1987. [33] S. Khudanpur and J. Wu. Maximum entropy techniques for exploiting syntactic, semantic and collocational dependencies in language modeling. Computer Speech & Language, 2000. [34] R. Kneser and H. Ney. Improved backing-off for m-gram language modeling. In ICASSP, 1995. [35] R. Kneser and V. Steinbiss. On the dynamic adaptation of stochastic language models. In ICASSP, 1993. [36] R. Kuhn. Speech recognition and the frequency of recently used words: A modified markov model for natural language. In Proceedings of the 12th conference on Computational linguistics-Volume 1, 1988. [37] R. Kuhn and R. De Mori. A cache-based natural language model for speech recognition. PAMI, 1990. [38] J. Kupiec. Probabilistic models of short and long distance word dependencies in running text. In Proceedings of the workshop on Speech and Natural Language, 1989. [39] I. Kuzborskij, F. Orabona, and B. Caputo. From n to n+ 1: Multiclass transfer incremental learning. In CVPR, 2013. [40] S. Lahiri. Complexity of word collocation networks: A preliminary structural analysis. In Proceedings of the Student Research Workshop at the 14th Conference of the European Chapter of the Association for Computational Linguistics, 2014. [41] C. H. Lampert, H. Nickisch, and S. Harmeling. Attribute-based classification for zero-shot visual object categorization. PAMI, 2014. [42] R. Lau, R. Rosenfeld, and S. Roukos. Trigger-based language models: A maximum entropy approach. In ICASSP, 1993. [43] S. Merity, C. Xiong, J. Bradbury, and R. Socher. Pointer sentinel mixture models. In ICLR, 2017. [44] T. Mikolov, A. Deoras, S. Kombrink, L. Burget, and J. Cernock`y. Empirical evaluation and combination of advanced language modeling techniques. In INTERSPEECH, 2011. [45] T. Mikolov, M. Karafiát, L. Burget, J. Cernock`y, and S. Khudanpur. Recurrent neural network based language model. In INTERSPEECH, 2010. [46] T. Mikolov and G. Zweig. Context dependent recurrent neural network language model. In SLT, 2012. [47] M. D. Muhlbaier, A. Topalis, and R. Polikar. Learn++.NC: Combining ensemble of classifiers with dynamically weighted consult-and-vote for efficient incremental learning of new classes. IEEE transactions on neural networks, 20(1), 2009. [48] R. Rosenfeld. A maximum entropy approach to adaptive statistical language modeling. Computer, Speech and Language, 1996. [49] W. J. Scheirer, A. de Rezende Rocha, A. Sapkota, and T. E. Boult. Toward open set recognition. PAMI, 2013. [50] I. V. Serban, A. Sordoni, Y. Bengio, A. Courville, and J. Pineau. Building end-to-end dialogue systems using generative hierarchical neural network models. In AAAI, 2016. [51] G. R. Terrell and D. W. Scott. Variable kernel density estimation. The Annals of Statistics, 1992. [52] O. Vinyals, M. Fortunato, and N. Jaitly. Pointer networks. In NIPS, 2015. [53] T. Wang and K. Cho. Larger-context language modelling. In ACL, 2016. [54] Y. Weiss, A. Torralba, and R. Fergus. Spectral hashing. In NIPS, 2009. [55] J. G. Zilly, R. K. Srivastava, J. Koutník, and J. Schmidhuber. Recurrent highway networks. In ICML, 2017. [56] J. Zobel and A. Moffat. Inverted files for text search engines. ACM computing surveys (CSUR), 2006. 11
2017
642
7,166
Shape and Material from Sound Zhoutong Zhang MIT Qiujia Li University of Cambridge Zhengjia Huang ShanghaiTech University Jiajun Wu MIT Joshua B. Tenenbaum MIT William T. Freeman MIT, Google Research Abstract Hearing an object falling onto the ground, humans can recover rich information including its rough shape, material, and falling height. In this paper, we build machines to approximate such competency. We first mimic human knowledge of the physical world by building an efficient, physics-based simulation engine. Then, we present an analysis-by-synthesis approach to infer properties of the falling object. We further accelerate the process by learning a mapping from a sound wave to object properties, and using the predicted values to initialize the inference. This mapping can be viewed as an approximation of human commonsense learned from past experience. Our model performs well on both synthetic audio clips and real recordings without requiring any annotated data. We conduct behavior studies to compare human responses with ours on estimating object shape, material, and falling height from sound. Our model achieves near-human performance. 1 Introduction From a short audio clip of interacting objects, humans can recover the number of objects involved, as well as their materials and surface smoothness [Zwicker and Fastl, 2013, Kunkler-Peck and Turvey, 2000, Siegel et al., 2014]. How does our cognitive system recover so much content from so little? What is the role of past experience in understanding auditory data? For physical scene understanding from visual input, recent behavioral and computational studies suggest that human judgments can be well explained as approximate, probabilistic simulations of a mental physics engine [Battaglia et al., 2013, Sanborn et al., 2013]. These studies suggest that the brain encodes rich, but noisy, knowledge of physical properties of objects and basic laws of physical interactions between objects. To understand, reason, and predict about a physical scene, humans seem to rely on simulations from this mental physics engine. In this paper, we develop a computational system to interpret audio clips of falling objects, inspired by the idea that humans may use a physics engine as part of a generative model to understand the physical world. Our generative model has three components. The first is a object representation that includes its 3D shape, position in space, and physical properties such as mass, Young’s modulus, Rayleigh damping coefficients, and restitution. We aim to infer all these attributes from auditory inputs. The second component is an efficient, physics-based audio synthesis engine. Given an initial scene setup and object properties, the engine simulates the object’s motion and generates its trajectory using rigid body physics. It also produces the corresponding collision profile — when, where, and how collisions happen. The object’s trajectory and collision profile are then combined with its pre-computed sound statistics to generate the sound it makes during the physical event. With this efficient forward model, we can then infer object properties using analysis-by-synthesis; for each audio clip, we want to find a set of latent variables that best reproduce it. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. Figure 1: Given an audio of a single object falling, we utilize our generative model to infer latent variables that could best reproduce the sound. The third component of the model is therefore a likelihood function that measures the perceptual distance between two sounds. Designing such a likelihood function is typically challenging; however, we observe that features like spectrogram are effective when latent variables have limited degrees of freedom. This motivates us to infer latent variables via methods like Gibbs sampling, where we focus on approximating the conditional probability of a single variable given the others. The inference procedure can be further accelerated with a self-supervised learning paradigm inspired by the wake/sleep phases in Helmholtz machines [Dayan et al., 1995]. We train a deep neural network as the recognition model to regress object properties from sound, where training data are generated using our inference algorithm. Then, for any future audio clip, the output of the recognition model can be used as a good initialization for the sampling algorithm to converge faster. We evaluate our models on a range of perception tasks: inferring object shape, material, and initial height from sound. We also collect human responses for each task and compare them with model estimates. Our results indicate that first, humans are quite successful in these tasks; second, our model not only closely matches human successes, but also makes similar errors as humans do. For these quantitative evaluations, we have mostly used synthetic data, where ground truth labels are available. We further evaluate the model on recordings to demonstrate that it also performs well on real-world audios. We make three contributions in this paper. First, we propose a novel model for estimating physical object properties from auditory inputs by incorporating the feedback of a physics engine and an audio engine into the inference process. Second, we incorporate a deep recognition network with the generative model for more efficient inference. Third, we evaluate our model and compare it to humans on a variety of judgment tasks, and demonstrate the correlation between human responses and model estimates. 2 Related Work Human visual and auditory perception Psychoacoustics researchers have explored how humans can infer object properties, including shape, material and size, from audio in the past decades [Zwicker and Fastl, 2013, Kunkler-Peck and Turvey, 2000, Rocchesso and Fontana, 2003, Klatzky et al., 2000, Siegel et al., 2014]. Recently, McDermott et al. [2013] proposed compact sound representations that capture semantic information and are informative of human auditory perception. Sound simulation Our sound synthesis engine builds upon and extends existing sound simulation systems in computer graphics and computer vision [O’Brien et al., 2001, 2002, James et al., 2006, Bonneel et al., 2008, Van den Doel and Pai, 1998, Zhang et al., 2017]. Van den Doel and Pai [1998] simulated object vibration using the finite element method and approximated the vibrating object as a single point source. O’Brien et al. [2001, 2002] used the Rayleigh method to approximate wave equation solutions for better synthesis quality. James et al. [2006] proposed to solve Helmholtz 2 shape rotation height material Gibbs Sampling Likelihood Function Generative Model Target Audio iteration iteration Figure 2: Our inference pipeline. We use Gibbs sampling over the latent variables. The conditional probability is approximated using the likelihood between reconstructed sound and the input sound. equations using the Boundary Element Method, where each object’s vibration mode is approximated by a set of vibrating points. Recently, Zhang et al. [2017] built a framework for synthesizing largescale audio-visual data. In this paper, we accelerate the framework by Zhang et al. [2017] to achieve near real-time rendering, and explore learning object representations from sound with the synthesis engine in the loop. Physical Object Perception There has been a growing interest in understanding physical object properties, like mass and friction, from visual input or scene dynamics [Chang et al., 2017, Battaglia et al., 2016, Wu et al., 2015, 2016, 2017]. Much of the existing research has focused on inferring object properties from visual data. Recently, researchers have begun to explore learning object representations from sound. Owens et al. [2016a] attempted to infer material properties from audio, focusing on the scenario of hitting objects with a drumstick. Owens et al. [2016b] further demonstrated audio signals can be used as supervision on learning object concepts from visual data, and Aytar et al. [2016] proposed to learn sound representations from corresponding video frames. Zhang et al. [2017] discussed the complementary role of auditory and visual data in recovering both geometric and physical object properties. In this paper, we learn physical object representations from audio through a combination of powerful deep recognition models and analysis-by-synthesis inference methods. Analysis-by-synthesis Our framework also relates to the field of analysis-by-synthesis, or generative models with data-driven proposals [Yuille and Kersten, 2006, Zhu and Mumford, 2007, Wu et al., 2015], as we are incorporating a graphics engine as a black-box synthesizer. Unlike earlier methods that focus mostly on explaining visual data, our work aims to infer latent parameters from auditory data. Please refer to Bever and Poeppel [2010] for a review of analysis-by-synthesis methods. 3 An Efficient, Physics-Based Audio Engine At the core of our inference pipeline is an efficient audio synthesis engine. In this section, we first give a brief overview of existing synthesis engines, and then present our technical innovations on accelerating them for real-time rendering in our inference algorithm. 3.1 Audio Synthesis Engine Audio synthesis engines generate realistic sound by simulating physics. First, rigid body simulation produces the interaction between an object and the environment, where Newton’s laws dictate the object’s motion and collisions over time. Each collision causes the object to vibrate in certain patterns, changing the air pressure around its surface. These vibrations propagate in air to the recorder and create the sound of this physical process. 3 Waveform SoundNet-8 Audio Wave conv1 pool1 conv7 pool7 fc …… Figure 3: Our 1D deep convolutional network. Its architecture follows that in Aytar et al. [2016], where raw audio waves are forwarded through consecutive conv-pool layers, and then passed to a fully connected layer to produce output. Settings Time (s) Original algorithm 30.4 Amplitude cutoff 24.5 Principal modes 12.7 Multi-threading 1.5 All 0.8 Table 1: Acceleration break down of each technique we adopted. Timing is evaluated by synthesizing an audio with 200 collisions. The last row reports the final timing after adopting all techniques. Rigid Body Simulation Given an object’s 3D position and orientation, and its mass and restitution, a physics engine can simulate the physical processes and output the object’s position, orientation, and collision information over time. Our implementation uses an open-source physics engine, Bullet [Coumans, 2010]. We use a time step of 1/300 second to ensure simulation accuracy. At each time step, we record the 3D pose and position of the object, as well as the location, magnitude, and direction of collisions. The sound made by the object can then be approximated by accumulating sounds caused by those discrete impulse collisions on its surface. Audio Synthesis The audio synthesis procedure is built upon previous work on simulating realistic sounds [James et al., 2006, Bonneel et al., 2008, O’Brien et al., 2001]. To facilitate fast synthesis, this process is decomposed into two modules, one offline and one online. The offline part first uses finite element methods (FEM) to obtain the object’s vibration modes, which depend on the shape and Young’s modulus of the object. These vibration modes are then used as Neumann boundary conditions of the Helmholtz equation, which can be solved using boundary element methods (BEM). We use the techniques proposed by James et al. [2006] to approximate the solution by modeling the pressure fields with a sparse set of vibrating points. Note that the computation above only depends on object’s intrinsic properties such as shape and Young’s modulus, but not on the extrinsics such as its position and velocity. This allows us to pre-compute a number of shape-modulus configurations before simulation; only minimal computation is needed during the online simulation. The online part of the audio engine loads pre-computed approximations and decomposes impulses on the surface mesh of the object into its modal bases. At the observation point, the engine measures the pressure changes induced by vibrations in each mode, and sums them up to produce the simulated sound. An evaluation of the fidelity of these simulations can be found in Zhang et al. [2017]. 3.2 Accelerating Audio Synthesis Analysis-by-synthesis inference requires the audio engine to be highly efficient; however, a straightforward implementation of the above simulation procedure would be computationally expensive. We therefore present technical innovations to accelerate the computation to near real-time. First, we select the most significant modes excited by each impulse until their total energy reaches 90% of the energy of the impulse. Ignoring sound components generated by the less significant modes reduces the computational time by about 50%. Second, we stop the synthesis process if the amplitude of the damped sound goes below a certain threshold, since it is unlikely to be heard. Third, we parallelize the synthesis process by tackling collisions separately, so that each can computed on an independent thread. We then integrate them into a shared buffer to generate the final audio according to their timestamps. The effect of acceleration is shown in Table 1. Online sound synthesis only contains variables that are fully decoupled from the offline stage, which enables us to freely manipulate other variables with little computational cost during simulation. 3.3 Generating Stimuli Because real audio recordings with rich labels are hard to acquire, we synthesize random audio clips using our physics-based simulation to evaluate our models. Specifically, we focus on a single 4 Variable Range C/T Variable Range C/T Primitive shape (s) 14 classes D Specific modulus (E/ρ) [1, 30] × 106 D Height (z) [1, 2] C Restitution (e) [0.6, 0.9] C Rotation axis (i, j, k) S2 C Rotation angle (w) [−π, π) C Rayleigh damping (α) 10[−8,−5] C Rayleigh damping (β) 2[0,5] C Table 2: Variables in our generative model, where the C/T column indicates whether sampling takes place in continuous (C) or discrete (D) domain, and values inside parentheses are the range we uniformly sampled from. Rotation is defined in quaternions. scenario — shape primitives falling onto the ground. We first construct an audio dataset that includes 14 primitives (some shown in Table 2), each with 10 different specific moduli (defined as Young’s modulus over density). After pre-computing their space-modulus configurations, we can generate synthetic audio clips in a near-real-time fashion. Because the process of objects falling onto the ground is relatively fast, we set the total simulation time of each scenario to 3 seconds. Details of our setup can be found in Table 2. 4 Inference In this section, we investigate four models for inferring object properties, each corresponding to a different training condition. Inspired by how humans can infer scene information using a mental physics engine [Battaglia et al., 2013, Sanborn et al., 2013], we start from an unsupervised model where the input is only one single test case with no annotation. We adopt Gibbs sampling over latent variables to find the combination that best reproduces the given audio. We then extend the model to include a deep neural network, analogous to what humans may learn from their past experience. The network is trained using labels inferred by the unsupervised model. During inference, the sampling algorithm uses the network prediction as the initialization. This self-supervised learning paradigm speeds-up convergence. We also investigate a third case, when labels can be acquired but are extremely coarse. We first train a recognition model with weak labels, then randomly pick candidates from those labels as an initialization for our analysis-by-synthesis inference. Lastly, to understand performance limits, we train a deep neural network with fully labeled data that yields the upper-bound performance. 4.1 Models Unsupervised Given an audio clip S, we would like to recover the latent variables x to make the reproduced sound g(x) most similar to S. Let L(·, ·) be a likelihood function that measures the perceptual distance between two sounds, then our goal is to maximize L(g(x), S). We denote L(g(x), S) as p(x) for brevity. In order to find x that maximizes p(x), p(x) can be treated as an distribution ˆp(x) scaled by an unknown partition function Z. Since we do not have an exact form for p(·), nor ˆp(x), we apply Gibbs sampling to draw samples from p(x). Specifically, at sweep round t, we update each variable xi by drawing samples from ˆp(xi|xt 1, xt 2, ...xt i−1, xt−1 i+1, ...xt−1 n ). (1) Such conditional probabilities are straightforward to approximate. For example, to sample Young’s modulus conditioned on other variables, we can use the spectrogram as a feature and measure the l2 distance between the spectrograms of two sounds, because Young’s modulus will only affect the frequency at each collision. Indeed, we can use the spectrogram as features for all variables except height. Since the height can be inferred from the time of the first collision, a simple likelihood function can be designed as measuring the time difference between the first impact in two sounds. Note that this is only an approximate measure: object’s shape and orientation also affect, although only slightly, the time of first impact. 5 To sample from the conditional probabilities, we adopt the Metropolis–Hastings algorithm, where samples are drawn from a Gaussian distribution and are accepted by flipping a biased coin according to its likelihood compared with the previous sample. Specifically, we calculate the l2 distance dt in feature space between g(xt) and S. For a new sample xt+1, we also calculate the l2 distance dt+1 in feature space between g(xt+1) and S. The new sample is accepted if dt+1 is smaller than dt; otherwise, xt+1 is accepted with probability exp(−(dt+1 −dt)/T), where T is a time varying function inspired by simulated annealing algorithm. In our implementation, T is set as a quadratic function of the current MCMC sweep number t. Self-supervised Learning To accelerate the above sampling process, we propose a self-supervised model, which is analogous to a Helmholtz machine trained by the wake-sleep algorithm. We first train a deep neural network, whose labels are generated by the unsupervised inference model suggested above for a limited number of iterations. For a new audio clip, our self-supervised model uses the result from the neural network as an initialization, and then runs our analysis-by-synthesis algorithm to refine the inference. By making use of the past experiences which trained the network, the sampling process starts from a better position and requires fewer iterations to converge than the unsupervised model. Weakly-supervised Learning We further investigate the case where weak supervision might be helpful for accelerating the inference process. Since the latent variables we aim to recover are hard to obtain in real world settings, it is more realistic to assume that we could acquire very coarse labels, such as the type of material, rough attributes of the object’s shape, the height of the fall, etc. Based on such assumptions, we coarsen ground truth labels for all variables. For our primitive shapes, three attributes are defined, namely “with edge,” “with curved surface,” and “pointy.” For material parameters, i.e., specific modulus, Rayleigh damping coefficients and restitution, they are mapped to steel, ceramic, polystyrene and wood by finding the nearest neighbor to those real material parameters. Height is divided into “low” and “high” categories. A deep convolutional neural network is trained on our synthesized dataset with coarse labels. As shown in Figure 4, even trained using coarse labels, our network learns features very similar to the ones learned by the fully supervised network. To go beyond coarse labels, the unsupervised model is applied using the initialization suggested by the neural network. Fully-supervised Learning To explore the performance upper bound of the inference tasks, we train an oracle model with ground truth labels. To visualize the abstraction and characteristic features learned by the oracle model, we plot the inputs that maximally activate some hidden units in the last layer of the network. Figure 4 illustrates some of the most interesting waveforms. A selection of them learned to recognize specific temporal patterns, and others were sensitive to specific frequencies. Similar patterns were found in the weakly and fully supervised models. 4.2 Contrasting Model Performance We evaluate how well our model performs under different settings, studying how past experience or coarse labeling can improve the unsupervised results. We first present the implementation details of all four models, then compare their results on all inference tasks. Sampling Setup We perform 80 sweeps of MCMC sampling over all the 7 latent variables; for every sweep, each variable is sampled twice. Shape, specific modulus and rotation are sampled by uniform distributions across their corresponding dimensions. For other continuous variables, we define an auxiliary Gaussian variable xi ∼N(µi, σ2 i ) for sampling, where the mean µi is based on the current state. To evaluate the likelihood function between the input and the sampled audio (both with sample rate of 44.1k), we compute the spectrogram of the signal using a Tukey window of length 5,000 with a 2,000 sample overlap. For each window, a 10,000 point Fourier transform is applied. Deep Learning Setup Our fully supervised and self-supervised recognition models use the architecture of SoundNet-8 [Aytar et al., 2016] as Figure 3, which takes an arbitrarily long raw audio wave as an input, and produces a 1024-dim feature vector. We append to that a fully connected layer to produce a 28-dim vector as the final output of the neural network. The first 14 dimensions are the one-hot encoding of primitive shapes and the next 10 dimensions are encodings of the specific modulus. The last 4 dimensions regress the initial height, the two Rayleigh damping coefficients and 6 low frequency small damping multiple collisions mid frequency high frequency Frequency Domain Time Domain Fully Supervised Weakly Supervised Figure 4: Visualization of top two sound waves that activate the hidden unit most significantly, in temporal and spectral domain. Their common characteristics can reflect the values of some latent variables, e.g. Rayleigh damping, restitution and specific modulus from left to right. Both weakly and fully supervised models capture similar features. Inference Model Latent Variables shape mod. height α β Unsupervised initial 8% 10% 0.179 0.144 0.161 final 54% 56% 0.003 0.069 0.173 Self-supervised initial 14% 16% 0.060 0.092 0.096 final 52% 62% 0.005 0.061 0.117 Weakly supervised initial 18% 12% 0.018 0.077 0.095 final 62% 66% 0.005 0.055 0.153 Fully supervised final 98% 100% 0.001 0.001 0.051 Table 3: Initial and final classification accuracies (as percentages) and parameter MSE errors of three different inference models after 80 iterations of MCMC. Initial unsupervised numbers indicate chance performance. Results from the fully supervised model show performance bounds. α and β are Rayleigh damping coefficients. the restitution respectively. All the regression dimensions are normalized to a [−1, 1] range. The weakly supervised model preserves the structure of the fully supervised one, but with an 8-dim final output: 3 for shape attributes, 1 for height, and 4 for materials. We used stochastic gradient descent for training, with a learning rate of 0.001, a momentum of 0.9 and a batch size of 16. Mean Square Error(MSE) loss is used for back-propagation. We implemented our framework in Torch7 [Collobert et al., 2011], and trained all models from scratch. Results Results for the four inference models proposed above are shown in Table 3. For shapes and specific modulus, we evaluate the results as classification accuracies; for height, Rayleigh damping coefficients, and restitution, results are evaluated as MSE. Before calculating MSE, we normalize values of each latent variable to [−1, 1] interval, so that the MSE score is comparable across variables. From Table 3, we can conclude that self-supervised and weakly supervised models benefit from the better initialization to the analysis-by-synthesis algorithm, especially on the last four continuous latent variables. One can also observe that final inference accuracies and MSEs are marginally better than for the unsupervised case. To illustrate the rate of convergence, we plot the likelihood value, exp(−kd) where d is the distance of sound features, along iterations of MCMC in Figure 5. The mean curve of self-supervised model meets our expectation, i.e., it converges much faster than the unsupervised model, and reaches a slightly higher likelihood at the end of 30 iterations. The fully supervised model, which is trained on 200,000 audios with the full set of ground-truth labels, yields near-perfect results for all latent variables. 7 steel ceramic poly wood steel ceramic poly wood 0 0.2 0.4 0.6 0.8 1 Unsupervised model steel ceramic poly wood steel ceramic poly wood 0 0.2 0.4 0.6 0.8 1 Human 0 5 10 15 20 25 30 Number of MCMC Sweeps 0.5 0.6 0.7 0.8 0.9 1.0 Likelihood random self-supervised Figure 5: Left and middle: confusion matrix of material classification performed by human and our unsupervised model. Right: mean likelihood curve over MCMC iterations. 10 30 50 80 I 0.25 0.50 0.75 Is Pointy 10 30 50 80 0.17 0.33 0.50 0.67 0.83 1.00 Has Curved Surface 10 30 50 80 Iterations 0.25 0.50 0.75 Has Edge 10 30 50 80 0.56 0.67 0.78 0.89 1.00 Height 10 30 50 80 0.17 0.33 0.50 0.67 Material human 10 30 50 80 Iterations 0.17 0.33 0.50 0.67 0.83 1.00 Has Curved Surface 10 30 50 80 Iterations 0.25 0.50 0.75 Is Pointy 10 30 50 80 Iterations 0.25 0.50 0.75 Has Edge 10 30 50 80 Iterations 0.56 0.67 0.78 0.89 1.00 Height 10 30 50 80 Iterations 0.17 0.33 0.50 0.67 Material human Accuracy Pointy With Edge With Curved Surface Figure 6: Human performance and unsupervised performance comparison. The horizontal line represents human performance for each task. Our algorithm closely matches human performance. 5 Evaluations We first evaluate the performance of our inference procedure by comparing its performance with humans. The evaluation is conducted using synthetic audio with their ground truth labels. Then, we investigate whether our inference algorithm performs well on real-world recordings. Given recorded audio, our algorithm can distinguish the shape from a set of candidates. 5.1 Human Studies We seek to evaluate our model relative to human performance. We designed three tasks for our subjects: inferring the object’s shape, material and height-of-fall from the sound, intuitive attributes when hearing an object fall. Those tasks are designed to be classification problems, where the labels are in accordance with coarse labels used by our weakly-supervised model. The study was conducted on Amazon Mechanical Turk. For each experiment (shape, material, height), we randomly selected 52 test cases. Before answering test questions, the subject is shown 4 training examples with ground truth as familiarization of the setup. We collected 192 responses for the experiment on inferring shape, 566 for material, and 492 for height, resulting in a total of 1,250 responses. Inferring Shapes After becoming familiar with the experiment, participants are asked to make three binary judgments about the shape by listening to our synthesized audio clip. Prior examples are given for people to understand the distinctions of “with edge,” “with curved surface,” and “pointy” attributes. As shown in Figure 6, humans are relatively good at recognizing shape attributes from sound and are around the same level of competency when the unsupervised algorithm runs for 10∼30 iterations. Inferring Materials We sampled audio clips whose physical properties – density, Young’s modulus and damping coefficients – are in the vicinity of true parameters of steel, ceramic, polystyrene and wood. Participants are required to choose one out of four possible materials. However, it can still be challenging to distinguish between materials, especially when sampled ones have similar damping and specific modulus. Our algorithm confuses steel with ceramic and ceramic with polystyrene occasionally, which is in accordance with human performance, as shown in Figure 5. 8 (a) Real shape and sound (b) Inferred shape and sound (c) Normalized likelihood over iterations 0 5 10 15 20 25 30 35 40 45 50 55 Iteration 0.4 0.6 0.8 1 Likelihood Figure 7: Results of inference on real world data. The test recording is made by dropping the metal dice in (a). Our inferred shape and reproduced sound is shown in (b). Likelihood over iteration is plotted in (c). Inferring Heights In this task, we ask participants to choose whether the object is dropped from a high position or a low one. We provided example videos and audios to help people anchor reference height. Under our scene setup, the touchdown times of the two extremes of the height range differ by 0.2s. To address the potential bias that algorithms may be better at exploiting falling time, we explicitly told humans that the silence at the beginning is informative. Second, we make sure that the anchoring example is always available during the test, which participants can always compare and refer to. Third, the participant has to play each test clip manually, and therefore has control over when the audio begins. Last, we tested on different object shapes. Because the time of first impact is shape-dependent, differently shaped objects dropped from the same height would have first impacts at different times, making it harder for the machine to exploit the cue. 5.2 Transferring to Real Scenes In addition to the synthetic data, we designed real world experiments to test our unsupervised model. We select three candidate shapes: tetrahedron, octahedron, and dodecahedron. We record the sound a metal octahedron dropping on a table and used our unsupervised model to recover the latent variables. Because the real world scenarios may introduce highly complex factors that cannot be exactly modeled in our simulation, a more robust feature and a metric are needed. For every audio clip, we use its temporal energy distribution as the feature, which is derived from spectrogram. A window of 2,000 samples with a 1,500 sample overlap is used to calculate the energy distribution. Then, we use the earth mover’s distance (EMD) [Rubner et al., 2000] as the metric, which is a natural choice for measuring distances between distributions. The inference result is illustrated in Figure 7. Using the energy distribution with EMD distance measure, our generated sound aligns its energy at major collision events with the real audio, which greatly reduces ambiguities among the three candidate shapes. We also provide our normalized likelihood function overtime to show our sampling has converged to produce highly probable samples. 6 Conclusion In this paper, we propose a novel model for estimating physical properties of objects from auditory inputs, by incorporating the feedback of an efficient audio synthesis engine in the loop. We demonstrate the possibility of accelerating inference with fast recognition models. We compare our model predictions with human responses on a variety of judgment tasks and demonstrate the correlation between human responses and model estimates. We also show that our model generalizes to some real data. Acknowledgements The authors would like to thank Changxi Zheng, Eitan Grinspun, and Josh H. McDermott for helpful discussions. This work is supported by NSF #1212849 and #1447476, ONR MURI N00014-16-12007, Toyota Research Institute, Samsung, Shell, and the Center for Brain, Minds and Machines (NSF STC award CCF-1231216). 9 References Yusuf Aytar, Carl Vondrick, and Antonio Torralba. Soundnet: Learning sound representations from unlabeled video. In NIPS, 2016. 3, 4, 6 Peter W Battaglia, Jessica B Hamrick, and Joshua B Tenenbaum. Simulation as an engine of physical scene understanding. PNAS, 110(45):18327–18332, 2013. 1, 5 Peter W Battaglia, Razvan Pascanu, Matthew Lai, Danilo Rezende, and Koray Kavukcuoglu. Interaction networks for learning about objects, relations and physics. In NIPS, 2016. 3 Thomas G Bever and David Poeppel. Analysis by synthesis: a (re-) emerging program of research for language and vision. Biolinguistics, 4(2-3):174–200, 2010. 3 Nicolas Bonneel, George Drettakis, Nicolas Tsingos, Isabelle Viaud-Delmon, and Doug James. Fast modal sounds with scalable frequency-domain synthesis. ACM TOG, 27(3):24, 2008. 2, 4 Michael B Chang, Tomer Ullman, Antonio Torralba, and Joshua B Tenenbaum. A compositional object-based approach to learning physical dynamics. In ICLR, 2017. 3 Ronan Collobert, Koray Kavukcuoglu, and Clément Farabet. Torch7: A matlab-like environment for machine learning. In BigLearn, NIPS Workshop, 2011. 7 Erwin Coumans. Bullet physics engine. Open Source Software: http://bulletphysics. org, 2010. 4 Peter Dayan, Geoffrey E Hinton, Radford M Neal, and Richard S Zemel. The helmholtz machine. Neural Comput., 7(5):889–904, 1995. 2 Doug L James, Jernej Barbiˇc, and Dinesh K Pai. Precomputed acoustic transfer: output-sensitive, accurate sound generation for geometrically complex vibration sources. ACM TOG, 25(3):987–995, 2006. 2, 4 Roberta L Klatzky, Dinesh K Pai, and Eric P Krotkov. Perception of material from contact sounds. Presence: Teleoperators and Virtual Environments, 9(4):399–410, 2000. 2 Andrew J Kunkler-Peck and MT Turvey. Hearing shape. J. Exp. Psychol. Hum. Percept. Perform., 26(1):279, 2000. 1, 2 Josh H McDermott, Michael Schemitsch, and Eero P Simoncelli. Summary statistics in auditory perception. Nat. Neurosci., 16(4):493–498, 2013. 2 James F O’Brien, Perry R Cook, and Georg Essl. Synthesizing sounds from physically based motion. In SIGGRAPH, 2001. 2, 4 James F O’Brien, Chen Shen, and Christine M Gatchalian. Synthesizing sounds from rigid-body simulations. In SCA, 2002. 2 Andrew Owens, Phillip Isola, Josh McDermott, Antonio Torralba, Edward H Adelson, and William T Freeman. Visually indicated sounds. In CVPR, 2016a. 3 Andrew Owens, Jiajun Wu, Josh H McDermott, William T Freeman, and Antonio Torralba. Ambient sound provides supervision for visual learning. In ECCV, 2016b. 3 Davide Rocchesso and Federico Fontana. The sounding object. Mondo estremo, 2003. 2 Yossi Rubner, Carlo Tomasi, and Leonidas J Guibas. The earth mover’s distance as a metric for image retrieval. International journal of computer vision, 40(2):99–121, 2000. 9 Adam N Sanborn, Vikash K Mansinghka, and Thomas L Griffiths. Reconciling intuitive physics and newtonian mechanics for colliding objects. Psychol. Rev., 120(2):411, 2013. 1, 5 Max Siegel, Rachel Magid, Joshua B Tenenbaum, and Laura Schulz. Black boxes: Hypothesis testing via indirect perceptual evidence. In CogSci, 2014. 1, 2 Kees Van den Doel and Dinesh K Pai. The sounds of physical shapes. Presence: Teleoperators and Virtual Environments, 7(4):382–395, 1998. 2 Jiajun Wu, Ilker Yildirim, Joseph J Lim, William T Freeman, and Joshua B Tenenbaum. Galileo: Perceiving physical object properties by integrating a physics engine with deep learning. In NIPS, 2015. 3 10 Jiajun Wu, Joseph J Lim, Hongyi Zhang, Joshua B Tenenbaum, and William T Freeman. Physics 101: Learning physical object properties from unlabeled videos. In BMVC, 2016. 3 Jiajun Wu, Erika Lu, Pushmeet Kohli, William T Freeman, and Joshua B Tenenbaum. Learning to see physics via visual de-animation. In NIPS, 2017. 3 Alan Yuille and Daniel Kersten. Vision as bayesian inference: analysis by synthesis? TiCS, 10(7):301–308, 2006. 3 Zhoutong Zhang, Jiajun Wu, Qiujia Li, Zhengjia Huang, James Traer, Josh H. McDermott, Joshua B. Tenenbaum, and William T. Freeman. Generative modeling of audible shapes for object perception. In ICCV, 2017. 2, 3, 4 Song-Chun Zhu and David Mumford. A stochastic grammar of images. Foundations and Trends R⃝in Computer Graphics and Vision, 2(4):259–362, 2007. 3 Eberhard Zwicker and Hugo Fastl. Psychoacoustics: Facts and models, volume 22. Springer Science & Business Media, 2013. 1, 2 11
2017
643
7,167
On the Consistency of Quick Shift Heinrich Jiang Google Inc. 1600 Amphitheatre Parkway, Mountain View, CA 94043 heinrich.jiang@gmail.com Abstract Quick Shift is a popular mode-seeking and clustering algorithm. We present finite sample statistical consistency guarantees for Quick Shift on mode and cluster recovery under mild distributional assumptions. We then apply our results to construct a consistent modal regression algorithm. 1 Introduction Quick Shift [16] is a clustering and mode-seeking procedure that has received much attention in computer vision and related areas. It is simple and proceeds as follows: it moves each sample to its closest sample with a higher empirical density if one exists in a τ radius ball, where the empirical density is taken to be the Kernel Density Estimator (KDE). The output of the procedure can thus be seen as a graph whose vertices are the sample points and a directed edge from each sample to its next point if one exists. Furthermore, it can be seen that Quick Shift partitions the samples into trees which can be taken as the final clusters, and the root of each such tree is an estimate of a local maxima. Quick Shift was designed as an alternative to the better known mean-shift procedure [4, 5]. Mean-shift performs a gradient ascent of the KDE starting at each sample until ϵ-convergence. The samples that correspond to the same points of convergence are in the same cluster and the points of convergence are taken to be the estimates of the modes. Both procedures aim at clustering the data points by incrementally hill-climbing to a mode in the underlying density. Some key differences are that Quick Shift restricts the steps to sample points and has the extra τ parameter. In this paper, we show that Quick Shift can surprisingly attain strong statistical guarantees without the second-order density assumptions required to analyze mean-shift. We prove that Quick Shift recovers the modes of an arbitrary multimodal density at a minimax optimal rate under mild nonparametric assumptions. This provides an alternative to known procedures with similar statistical guarantees; however such procedures only recover the modes but fail to inform us how to assign the sample points to a mode which is critical for clustering. Quick Shift on the other hand recovers both the modes and the clustering assignments with statistical consistency guarantees. Moreover, Quick Shift’s ability to do all of this has been extensively validated in practice. A unique feature of Quick Shift is that it has a segmentation parameter τ which allows practioners to merge clusters corresponding to certain less salient modes of the distribution. In other words, if a local mode is not the maximizer of its τ-radius neighborhood, then its corresponding cluster will become merged to that of another mode. Current consistent mode-seeking procedures [6, 12] fail to allow one to control such segmentation. We give guarantees on how Quick Shift does this given an arbitrary setting of τ. We show that Quick Shift can also be used to recover the cluster tree. In cluster tree estimation, the known procedures with the strongest statistical consistency guarantees include Robust Single Linkage (RSL) [2] and its variants e.g. [13, 7]. We show that Quick Shift attains similar guarantees. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. Thus, Quick Shift, a simple and already popular procedure, can simultaneously recover the modes with segmentation tuning, provide clustering assignments to the appropriate mode, and can estimate the cluster tree of an unknown density f with the strong consistency guarantees. No other procedure has been shown to have these properties. Then we use Quick Shift to solve the modal regression problem [3], which involves estimating the modes of the conditional density f(y|X) rather than the mean as in classical regression. Traditional approaches use a modified version of mean-shift. We provide an alternative using Quick Shift which has precise statistical consistency guarantees under much more mild assumptions. Figure 1: Quick Shift example. Left: τ = ∞. The procedure returns one tree, whose head is the sample with highest empirical density. Right: τ set to a lower value. The edges with length greater than τ are no longer present when compared to the left. We are left with three clusters. 2 Assumptions and Supporting Results Algorithm 1 Quick Shift Input: Samples X[n] := {x1, ..., xn}, KDE bandwidth h, segmentation parameter τ > 0. Initialize directed graph G with vertices {x1, ..., xn} and no edges. for i = 1 to n do if there exists x ∈X[n] such that bfh(x) > bfh(xi) and ||x −xi|| ≤τ then Add to G a directed edge from xi to argminxj∈X[n]: b fh(xj)> b fh(xi)||xi −xj||. end if end for return G. 2.1 Setup Let X[n] = {x1, ..., xn} be n i.i.d. samples drawn from distribution F with density f over the uniform measure on Rd. Assumption 1 (Hölder Density). f is Hölder continuous on compact support X ⊆Rd. i.e. |f(x) − f(x′)| ≤Cα||x −x′||α for all x, x′ ∈X and some 0 < α ≤1 and Cα > 0. Definition 1 (Level Set). The λ level set of f is defined as Lf(λ) := {x ∈X : f(x) ≥λ}. Definition 2 (Hausdorff Distance). dH(A, A′) = max{supx∈A d(x, A′), supx∈A′ d(x, A)}, where d(x, A) := infx′∈A ||x −x′||. The next assumption says that the level sets are continuous w.r.t. the level in the following sense where we denote the ϵ-interior of A as A⊖ϵ := {x ∈A, infy∈∂A d(x, y) ≥ϵ} (∂A is the boundary of A): Assumption 2 (Uniform Continuity of Level Sets). For each ϵ > 0, there exists δ > 0 such that for 0 < λ ≤λ′ ≤||f||∞with |λ −λ′| < δ, then Lf(λ)⊖ϵ ⊆Lf(λ′). Remark 1. Procedures that try to incrementally move points to nearby areas of higher density will have difficulties in regions where there is little or no change in density. The above assumption is a simple and mild formulation which ensures there are no such flat regions. Remark 2. Note that our assumptions are quite mild when compared to analyses of similar procedures like mean-shift, which require at least second-order smoothness assumptions. Interestingly, we only require Hölder continuity. 2 2.2 KDE Bounds We next give uniform bounds on KDE required to analyze Quick Shift. Definition 3. Define kernel function K : Rd →R≥0 where R≥0 denotes the non-negative real numbers such that R Rd K(u)du = 1. We make the following mild regularity assumptions on K. Assumption 3. (Spherically symmetric, non-increasing, and exponential decays) There exists nonincreasing function k : R≥0 →R≥0 such that K(u) = k(|u|) for u ∈Rd and there exists ρ, Cρ, t0 > 0 such that for t > t0, k(t) ≤Cρ · exp(−tρ). Remark 3. These assumptions allow the popular kernels such as Gaussian, Exponential, Silverman, uniform, triangular, tricube, Cosine, and Epanechnikov. Definition 4 (Kernel Density Estimator). Given a kernel K and bandwidth h > 0 the KDE is defined by bfh(x) = 1 n · hd n X i=1 K x −Xi h  . Here we provide the uniform KDE bound which will be used for our analysis, established in [11]. Lemma 1. [ℓ∞bound for α-Hölder continuous functions. Theorem 2 of [11]] There exists positive constant C′ depending on f and K such that the following holds with probability at least 1 −1/n uniformly in h > (log n/n)1/d. sup x∈Rd | bfh(x) −f(x)| < C′ · hα + r log n n · hd ! . 3 Mode Estimation In this section, we give guarantees about the local modes returned by Quick Shift. We make the additional assumption that the modes are local maxima points with negative-definite Hessian. Assumption 4. [Modes] A local maxima of f is a connected region M such that the density is constant on M and decays around its boundaries. Assume that each local maxima of f is a point, which we call a mode. Let M be the modes of f where M is a finite set. Then let f be twice differentiable around a neighborhood of each x ∈M and let f have a negative-definite Hessian at each x ∈M and those neighborhoods are disjoint. This assumption leads to the following. Lemma 2 (Lemma 5 of [6]). Let f satisfy Assumption 4. There exists rM, ˇC, ˆC > 0 such that the following holds for all x0 ∈M simultaneously. ˇC · |x0 −x|2 ≤f(x0) −f(x) ≤ˆC · |x0 −x|2, for all x ∈Ax0 where Ax0 is a connected component of {x : f(x) ≥infx′∈B(x0,rM) f(x)} which contains x0 and does not intersect with other modes. The next assumption ensures that the level sets don’t become arbitrarily thin as long as we are sufficiently away from the modes. Assumption 5. [Level Set Regularity] For each σ, r > 0, there exists η > 0 such that the following holds for all connected components A of Lf(λ) with λ > 0 and A ̸⊆∪x0∈MB(x0, r). If x lies on the boundary of A, then Vol(B(x, σ) ∩A) > η where Vol is volume w.r.t. the uniform measure on Rd. We next give the result about mode recovery for Quick Shift. It says that as long as τ is small enough, then as the number of samples grows, the roots of the trees returned by Quick Shift will bijectively correspond to the true modes of f and the estimation errors will match lower bounds established by Tsybakov [15] up to logarithmic factors. We defer the proof to Theorem 2 which is a generalization of the following result. Theorem 1 (Mode Estimation guarantees for Quick Shift). Let τ < rM/2 and Assumptions 1, 2, 3, 4, and 5 hold. Choose h such that (log n)2/ρ · h →0 and log n/(nhd) →0 as n →∞. Let c M be the 3 heads of the trees in G (returned by Algorithm 1). There exists constant C depending on f and K such that for n sufficiently large, with probability at least 1 −1/n, dH(M, c M)2 < C (log n)4/ρh2 + r log n n · hd ! . and |M| = | c M|. In particular, taking h ≈n−1/(4+d) optimizes the above rate to d(M, c M) = ˜O(n−1/(4+d)). This matches the minimax optimal rate for mode estimation up to logarithmic factors. We now give a stronger notion of mode that fits better for analyzing the role of τ. In the last result, it was assumed that the practitioner wished to recover exactly the modes of the density f by taking τ sufficiently small. Now, we analyze the case where τ is intentionally set to a particular value so that Quick Shift produces segmentations that group modes together that are in close proximity to higher density regions. Definition 5. A mode x0 ∈ M is an (r, δ)+-mode if f(x0) > f(x) + δ for all x ∈ B(x0, r)\B(x0, rM). A mode x0 ∈M is an (r, δ)−-mode if f(x0) < f(x) −δ for some x ∈B(x0, r). Let M+ r,δ ⊆M and M− r,δ ⊆M denote the set of (r, δ)+-modes and (r, δ)−-modes of f, respectively. In other words, an (r, δ)+-mode is a mode that is also a maximizer in a larger ball of radius r by at least δ when outside of the region where there is quadratic decay and smoothness (B(x0, rM)). An (r, δ)−-mode is a mode that is not the maximizer in its radius r ball by a margin of at least δ. The next result shows that Algorithm recovers the (τ +ϵ, δ)+-modes of f and excludes the (τ −ϵ, δ)−modes of f. The proof is in the appendix. Theorem 2. (Generalization of Theorem 1) Let δ, ϵ > 0 and suppose Assumptions 1, 2, 3, 4, and 5 hold. Let h ≡h(n) be chosen such that h →0 and log n/(nhd) →0 as n →∞. Then there exists C > 0 depending on f and K such that the following holds for n sufficiently large with probability at least 1 −1/n. For each x0 ∈M+ τ+ϵ,δ\M− τ−ϵ,δ, there exists unique ˆx ∈c M such that ||x0 −ˆx||2 < C (log n)4/ρh2 + r log n n · hd ! . Moreover, | c M| ≤|M| −|M− τ−ϵ,δ|. In particular, taking ϵ →0 and δ →0 gives us an exact characterization of the asymptotic behavior of Quick Shift in terms of mode recovery. 4 Assignment of Points to Modes In this section, we give guarantees on how the points are assigned to their respective modes. We first give the following definition which formalizes how two points are separated by a wide and deep valley. Definition 6. x1, x2 ∈X are (rs, δ)-separated if there exists a set S such that every path from x1 and x2 intersects with S and sup x∈S+B(0,rs) f(x) < inf x∈B(x1,rs)∪B(x2,rs) f(x) −δ. Lemma 3. Suppose Assumptions 1, 2, 3, 4, and 5 hold. Let τ < rs/2 and choose h such that (log n)2/ρ · h →0 and log n/(nhd) →0 as n →∞. Let G be the output of Algorithm 1. The following holds with probability at least 1 −1/n for n sufficiently large depending on f, K, δ, and τ uniformly in all x1, x2 ∈X. If x1 and x2 are (rs, δ)-separated, then there cannot exist a directed path from x1 to x2 in G. Proof. Suppose that x1 and x2 are (rs, δ)-separated (with respect to set S) and there exists a directed path from x1 to x2 in G. Given our choice of τ, there exists some point x ∈G such that x ∈S+B(0, rs) and x is on the path from x1 to x2. We have f(x) < f(x1)−δ. Choose n sufficiently large such that by Lemma 1, supx∈X | bfh(x) −f(x)| < δ/2. Thus, we have bfh(x) < bfh(x1), which means a directed path in G starting from x1 cannot contain x, a contradiction. The result follows. 4 Figure 2: Illustration of (rs, δ)-separation in 1 dimension. Here A and B are (rs, δ)-separated by S. This is because the minimum density level of rs-radius balls around A and B (the red dotted line) exceeds the maximum density level of the rs-radius ball around S by at least δ (golden dotted line). In other words, there exists a sufficiently wide (controlled by rs and S) and deep (controlled by δ) valley separating A and B. The results in this section will show that in such cases, these pairs of points will not be assigned to the same cluster. This leads to the following consequence about how samples are assigned to their respective modes. Theorem 3. Assume the same conditions as Lemma 3. The following holds with probability at least 1 −1/n for n sufficiently large depending on f, K, δ, and τ uniformly in x ∈X and x0 ∈M. For each x ∈X and x0 ∈M, if x and x0 are (rs, δ)-separated, then x will not be assigned to the tree corresponding to x0 from Theorem 1. Remark 4. In particular, taking δ →0 and rs →0 gives us guarantees for all points which have a unique mode in which it can be assigned to. We now give a more general version of (rs, δ)-separation, in which the condition holds if every path between the two points dips down at some point. The same results as the above extend for this definition in a straightforward manner. Definition 7. x1, x2 ∈X are (rs, δ)-weakly-separated if there exists a set S, with x1, x2 ̸∈S + B(0, rs), such that every path P from x1 and x2 satisifes the following. (1) P ∩S ̸= ∅and (2) sup x∈P∩S+B(0,rs) f(x) < inf x∈B(x′ 1,rs)∪B(x′ 2,rs) f(x) −δ, where x′ 1, x′ 2 are defined as follows. Let P1 be the path obtained by starting at x1 and following P until it intersects S, and P2 be the path obtained by following P starting from the last time it intersects S until the end. Then x′ 1 and x′ 2 are points which respectively attain the highest values of f on P1 and P2. 5 Cluster Tree Recovery The connected components of the level sets as the density level varies forms a hierarchical structure known as the cluster tree. Definition 8 (Cluster Tree). The cluster tree of f is given by Cf(λ) := connected components of {x ∈X : f(x) ≥λ}. Definition 9. Let G(λ) be the subgraph of G with vertices x ∈X[n] such that bfh(x) > λ and edges between pairs of vertices which have corresponding edges in G. Let ˜G(λ) be the sets of vertices corresponding to the connected components of G(λ). Definition 10. Suppose that A is a collection of sets of points in Rd. Then define Link(A, δ) to be the result of repeatedly removing pairs A1, A2 ∈A from A (A1 ̸= A2) that satisfy infa1∈A1 infa2∈A2 ||a1 −a2|| < δ and adding A1 ∪A2 to A until no such pairs exist. Parameter settings for Algorithm 2: Suppose that τ ≡τ(n) is chosen as a function of n such such that τ →0 as n →∞, τ(n) ≥(log2 n/n)1/d and h ≡h(n) is chosen such that h →0 and log n/(nhd) →0 as n →∞. The following is the main result of this section, the proof is in the appendix. 5 Algorithm 2 Quick Shift Cluster Tree Estimator Input: Samples X[n] := {X1, ..., Xn}, KDE bandwidth h, segmentation parameter τ > 0. Let G be the output of Quick Shift (Algorithm 1) with above parameters. For λ > 0, let bCf(λ) := Link( ˜G(λ), τ). return bCf Theorem 4 (Consistency). Algorithm 2 converges in probability to the true cluster tree of f under merge distortion (defined in [7]). Remark 5. By combining the result of this section with the mode estimation result, we can obtain the following interpretation. For any level λ, a component in G(λ) estimates a connected component of the λ-level set of f, and that further, the trees within that component in G(λ) have a one-to-one correspondence with the modes in the connected component. Figure 3: Illustration on 1-dimensional density with three modes A, B, and C. When restricting Quick Shift’s output to samples have empirical density above a certain threshold and connecting nearby clusters, then this approximates the connected components of the true density level set. Moreover, we give guarantees that such points will be assigned to clusters which correspond to modes within its connected component. 6 Modal Regression Suppose that we have joint density f(X, y) on Rd × R w.r.t. to the Lebesgue measure. In modal regression, we are interested in estimating the modes of the conditional f(y|X = x) given samples from the joint distribution. Algorithm 3 Quick Shift Modal Regression Input: Samples D := {(x1, y1), ..., (xn, yn)}, bandwidth h, τ > 0, and x ∈X. Let Y = {y1, ..., yn} and bfh be the KDE computed w.r.t. D. Initialize directed graph G with vertices Y and no edges. for i = 1 to n do if there exists yj ∈[yi −τ, yi + τ] ∩Y such that bfh(x, yj) > bfh(x, yi) then Add to G an directed edge from yi to argminyi∈Y : b fh(x,yj)> b fh(x,yi)||yi −yj||. end if end for return The roots of the trees of G as the estimates of the modes of f(y|X = x). Theorem 5 (Consistency of Quick Shift Modal Regression). Suppose that τ ≡τ(n) is chosen as a function of n such such that τ →0 as n →∞, τ(n) ≥(log2 n/n)1/d and h ≡h(n) is chosen such that h →0 and log n/(nhd+1) →0 as n →∞. Let Mx be the modes of the conditional density f(y|X = x) and c Mx be the output of Algorithm 3. Then with probability at least 1 −1/n uniformly in x such that f(y|X = x) and K satisfies Assumptions 1, 2, 3, 4, and 5, dH(Mx, c Mx) →0 as n →∞. 6 7 Related Works Mode Estimation. Perhaps the most popular procedure to estimate the modes is mean-shift; however, it has proven quite difficult to analyze. Arias-Castro et al. [1] made much progress by utilizing dynamical systems theory to show that mean-shift’s updates converge to the correct gradient ascent steps. The recent work of Dasgupta and Kpotufe [6] was the first to give a procedure which recovers the modes of a density with minimax optimal statistical guarantees in a multimodal density. They do this by using a top-down traversal of the density levels of a proximity graph, borrowing from work in cluster tree estimation. The procedure was shown to recover exactly the modes of the density at minimax optimal rates. In this work, we showed that Quick Shift attains the same guarantees while being a simpler approach than known procedures that attain these guarantees [6, 12]. Moreover unlike these procedures, Quick Shift also assigns the remaining samples to their appropriate modes. Furthermore, Quick Shift also has a segmentation tuning parameter τ which allows us to merge the clusters of modes that are not maximal in its τ-radius neighborhood into the clusters of other modes. This is useful as in practice, one may not wish to pick up every single local maxima, especially when there are local maxima that can be grouped together by proximity. We formalized the segmentation of such modes and identify which modes get returned and which ones become merged into other modes’ clusters by Quick Shift. Cluster Tree Estimation. Work on cluster tree estimation has a long history. Some early work on density based clustering by Hartigan [9] modeled the clusters of a density as the regions {x : f(x) ≥ λ} for some λ. This is called the density level-set of f at level λ. The cluster tree of f is the hierarchy formed by the infinite collection of these clusters over all λ. Chaudhuri and Dasgupta [2] introduced Robust Single Linkage (RSL) which was the first cluster tree estimation procedure with precise statistical guarantees. Shortly after, Kpotufe and Luxburg [13] provided an estimator that ensured false clusters were removed using used an extra pruning step. Interestingly, Quick Shift does not require such a pruning step, since the points near cluster boundaries naturally get assigned to regions with higher density and thus no spurious clusters are formed near these boundaries. Sriperumbudur and Steinwart [14], Jiang [10], Wang et al. [17] showed that the popular DBSCAN algorithm [8] also estimates these level sets. Eldridge et al. [7] introduced the merge distortion metric for cluster tree estimates, which provided a stronger notion of consistency. We use their framework to analyze Quick Shift and show that this simple estimator is consistent in merge distortion. Figure 4: Density-based clusters discovered by level-set model {x : f(x) ≥λ} (e.g. DBSCAN) vs Quick Shift on a one dimensional density. Left two images: level sets for two density level settings. Unassigned regions are noise and have no cluster assignment. Right two images: Quick Shift with two different τ settings. The latter is a hill-climbing based clustering assignment. Modal Regression. Nonparametric modal regression [3] is an alternative to classical regression, where we are interested in estimating the modes of the conditional density f(y|X = x) rather than the mean. Current approaches primarily use a modification of mean-shift; however analysis for mean-shift require higher order smoothness assumptions. Using Quick Shift instead for modal regression requires less regularity assumptions while having consistency guarantees. 8 Conclusion We provided consistency guarantees for Quick Shift under mild assumptions. We showed that Quick Shift recovers the modes of a density from a finite sample with minimax optimal guarantees. The approach of this method is considerably different from known procedures that attain similar guarantees. Moreover, Quick Shift allows tuning of the segmentation and we provided an analysis of this behavior. We also showed that Quick Shift can be used as an alternative for estimating the 7 cluster tree which contrasts with current approaches which utilize proximity graph sweeps. We then constructed a procedure for modal regression using Quick Shift which attains strong statistical guarantees. Appendix Mode Estimation Proofs Lemma 4. Suppose Assumptions 1, 2, 3, 4, and 5 hold. Let ¯r > 0 and h ≡h(n) be chosen such that h →0 and log n/(nhd) →0 as n →∞. Then the following holds for n sufficiently large with probability at least 1 −1/n. Define ˜r2 := max ( 32 ˆC ˇC (log n)4/ρh2, 17 · C′ r log n n · hd ) . Suppose x0 ∈M and x0 is the unique maximizer of f on B(x0, ¯r). Then letting ˆx := argmaxx∈B(x0,¯r)∩X[n] bfh(x), we have ||x0 −ˆx|| < ˜r. Proof sketch. This follows from modifying the proof of Theorem 3 of [11] by replacing Rd\B(x0, ˜r) with B(x0, ¯r)\B(x0, ˜r). This leads us to inf x∈B(x0,rn) bfh(x) > sup x∈B(x0,¯r)\B(x0,˜r) bfh(x), where rn := minx∈X[n] |x0 −x| and n is chosen sufficiently large such that ˜r < τ. Thus, |x0 −ˆx| ≤ ˜r. Proof of Theorem 2. Suppose that x0 ∈M+ τ+ϵ,δ\M− τ−ϵ,δ. Let ˆx := argmaxx∈B(x0,τ)∩X[n] bfh(x). We first show that ˆx ∈c M. By Lemma 4, we have |x0 −ˆx| ≤˜r where ˜r2 := max  32 ˆ C ˇ C (log n)4/ρh2, 17 · C′ q log n n·hd  . It remains to show that ˆx = argmaxx∈B(ˆx,τ)∩X[n] bfh(x). We have B(ˆx, τ) ⊆B(x0, τ + ˜r). Choose n sufficiently large such that (i) ˜r < ϵ, (ii) by Lemma 1, supx∈X | bfh(x) −f(x)| < δ/4 and (iii) ˜r2 < δ/(4 ˆC). Now, we have sup x∈B(x0,τ+˜r)\B(x0,τ) bfh(x) ≤ sup x∈B(x0,τ+˜r)\B(x0,τ) f(x) + δ/4 ≤f(x0) −3δ/4 ≤f(ˆx) + ˆC˜r2 −3δ/4 < f(ˆx) −δ/2 < bfh(ˆx). Thus, ˆx = argmaxx∈B(ˆx,τ)∩X[n] bfh(x). Hence, ˆx ∈c M. Next, we show that it is unique. To do this, suppose that ˆx′ ∈c M such that ||ˆx′ −x0|| ≤τ/2. Then we have both ˆx = argmaxx∈B(ˆx,τ)∩X[n] bfh(x) and ˆx′ = argmaxx∈B(ˆx′,τ)∩X[n] bfh(x). However, choosing n sufficiently large such that ˜r < τ/2, we obtain ˆx ∈B(ˆx′, τ). This implies that ˆx = ˆx′, as desired. We now show | c M| ≤|M| −|M− τ−ϵ,δ|. Suppose that ˆx ∈c M. Let τ0 := min{ϵ/3, τ/3, rM/2}. We show that B(ˆx, τ0) ∩M ̸= ∅. Suppose otherwise. Let λ = f(ˆx). By Assumptions 2 and 5, we have that there exists σ > 0 and η > 0 such that the following holds uniformly: Vol(B(ˆx, τ0) ∩ Lf(λ + σ)) ≥η. Choose n sufficiently large such that (i) by Lemma 1, supx∈X | bfh(x) −f(x)| < min σ/2, δ/4 and (ii) there exists a sample x ∈B(ˆx, ϵ/3) ∩Lf(λ + σ) ∩X[n] by Lemma 7 of Chaudhuri and Dasgupta [2]. Then bfh(x) > λ+σ/2 > bfh(ˆx) but x ∈B(ˆx, τ0), a contradiction since ˆx is the maximizer of the KDE of the samples in its τ-radius neighborhood. Thus, B(ˆx, τ0)∩M ̸= ∅. Now, suppose that there exists x0 ∈B(ˆx, τ0) ∩M− τ−ϵ,δ. Then, there exists x′ ∈B(x0, τ −2τ0) 8 such that f(x′) ≥f(x0) + δ. Then, if ¯x is the closest sample point to x′, we have for n sufficiently large, |x′ −¯x| ≤τ0 and f(¯x) ≥f(x0) + δ/2 and thus bfh(¯x) > f(¯x) −δ/4 ≥f(ˆx) + δ/4 > bfh(ˆx). But ¯x ∈B(ˆx, τ) ∩X[n], contradicting the fact that ˆx is the maximizer of the KDE over samples in its τ-radius neighborhood. Thus, B(ˆx, τ0) ∩(M\M− τ−ϵ,δ) ̸= ∅. Finally, suppose that there exists ˆx, ˆx′ ∈c M such that x0 ∈M\M− τ−ϵ,δ and x0 ∈B(ˆx, τ0) ∩ B(ˆx′, τ0). Then, ˆx, ˆx′ ∈B(x0, τ0), thus |ˆx −ˆx′| ≤τ and thus ˆx = ˆx′, as desired. Cluster Tree Estimation Proofs Lemma 5 (Minimality). The following holds with probability at least 1 −1/n. If A is a connected component of {x ∈X : f(x) ≥λ}, then A ∩X[n] is contained in the same component in bCf(λ −ϵ) for any ϵ > 0 as n →∞. Proof. It suffices to show that for each x ∈A, there exists x′ ∈B(x, τ/2) ∩X[n] such that bfh(x′) > λ −ϵ. Given our choice of τ, it follows by Lemma 7 of [2] that B(x, τ/2) ∩X[n] is non-empty for n sufficiently large. Let x′ ∈B(x, τ/2) ∩X[n]. Choose n sufficiently large such that by Lemma 1, we have supx∈X | bfh(x)−f(x)| < ϵ/2. We have f(x′) ≥infB(x,τ/2) f(x) ≥λ−Cα(τ/2)α > λ−ϵ/2, where the last inequality holds for n sufficiently large so that τ is sufficiently small. Thus, we have bfh(x′) > λ −ϵ, as desired. Lemma 6 (Separation). Suppose that A and B are distinct connected components of {x ∈X : f(x) ≥λ} which merge at {x ∈X : f(x) ≥µ}. Then A ∩X[n] and B ∩X[n] are separated in bCf(µ + ϵ) for any ϵ > 0 as n →∞. Proof. It suffices to assume that λ = µ + ϵ. Let A′ and B′ be the connected components of {x ∈X : f(x) ≥µ + ϵ/2} which contain A and B respectively. By the uniform continuity of f, there exists ˜r > 0 such that A + B(0, 3˜r) ⊆A′. We have supx∈A′\(A+B(0,˜r)) f(x) = µ + ϵ −ϵ′ for some ϵ′ > 0. Choose n sufficiently large such that by Lemma 1, we have supx∈X | bfh(x) −f(x)| < ϵ′/2. Thus, supx∈A′\(A+B(0,˜r)) bfh(x) < µ + ϵ −ϵ′/2. Hence, points in bCf(µ + ϵ) cannot belong to A′\ (A + B(0, ˜r)). Since A′ also contains A + B(0, 3˜r), it means that there cannot be a path from A to B with points of empirical density at least µ + ϵ with all edges of length less than ˜r. The result follows by taking n sufficiently large so that τ < ˜r, as desired. Proof of Theorem 4. By the regularity assumptions on f and Theorem 2 of [7], we have that Algorithm 2 has both uniform minimality and uniform separation (defined in [7]), which implies convergence in merge distortion. Modal Regression Proofs Proof of Theorem 5. There are two directions to show. (1) if ˆy ∈c Mx then ˆy is a consistent estimator of some mode y0 ∈Mx. (2) For each mode, y0 ∈M, there exists a unique ˆy ∈c M which estimates it. We first show (1). We show that [ˆy −τ, ˆy + τ] ∩Mx ̸= ∅. Suppose otherwise. Let λ = f(x, ˆy). Choose σ < τ/4. Then by Assumptions 2 and 5, there exists η > 0 such that taking ϵ = τ/2, we have that there exists δ > 0 such that {(x, y′) : y′ ∈[ˆy −τ, ˆy + τ]} ∩Lf(λ + δ) contains connected set A where Vol(A) > η. Choose n sufficiently large such that (i) there exists y ∈A ∩Y , and (ii) by Lemma 1, sup(x′,y′) | bfh(x′, y′) −f(x′, y′)| < δ/2. Then bfh(x, y) > λ + δ/2 > bfh(x, ˆy) but y ∈[ˆy −τ, ˆy + τ], a contradiction since ˆy is the maximizer of the KDE in τ radius neighborhood when restricted to X = x. Thus, there exists y0 ∈Mx such that y0 ∈[ˆy −τ, ˆy + τ]. Moreover this y0 ∈Mx must be unique by Lemma 2. As n →0, we have τ →0 and thus consistency is established for ˆy estimating y0. Now we show (2). Suppose that y0 ∈Mx. From the above, for n sufficiently large, the maximizer of the KDE in [y0 −2τ, y0 + 2τ] ∩Y is contained in [y0 −τ, y0 + τ]. Thus, there exists a root of the tree contained in [y0 −τ, y0 + τ] and taking τ →0 gives us the desired result. 9 Acknowledgements I thank the anonymous reviewers for their valuable feedback. References [1] 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. Journal of Machine Learning Research, 2015. [2] Kamalika Chaudhuri and Sanjoy Dasgupta. Rates of convergence for the cluster tree. In Advances in Neural Information Processing Systems, pages 343–351, 2010. [3] Yen-Chi Chen, Christopher R Genovese, Ryan J Tibshirani, Larry Wasserman, et al. Nonparametric modal regression. The Annals of Statistics, 44(2):489–514, 2016. [4] Yizong Cheng. Mean shift, mode seeking, and clustering. IEEE transactions on pattern analysis and machine intelligence, 17(8):790–799, 1995. [5] Dorin Comaniciu and Peter Meer. Mean shift: A robust approach toward feature space analysis. IEEE Transactions on pattern analysis and machine intelligence, 24(5):603–619, 2002. [6] Sanjoy Dasgupta and Samory Kpotufe. Optimal rates for k-nn density and mode estimation. In Advances in Neural Information Processing Systems, pages 2555–2563, 2014. [7] Justin Eldridge, Mikhail Belkin, and Yusu Wang. Beyond hartigan consistency: Merge distortion metric for hierarchical clustering. In COLT, pages 588–606, 2015. [8] Martin Ester, Hans-Peter Kriegel, Jörg Sander, and Xiaowei Xu. A density-based algorithm for discovering clusters in large spatial databases with noise. In Kdd, volume 96, pages 226–231, 1996. [9] John A Hartigan. Consistency of single linkage for high-density clusters. Journal of the American Statistical Association, 76(374):388–394, 1981. [10] Heinrich Jiang. Density level set estimation on manifolds with dbscan. In International Conference on Machine Learning, pages 1684–1693, 2017. [11] Heinrich Jiang. Uniform convergence rates for kernel density estimation. In International Conference on Machine Learning, pages 1694–1703, 2017. [12] Heinrich Jiang and Samory Kpotufe. Modal-set estimation with an application to clustering. In International Conference on Artificial Intelligence and Statistics, pages 1197–1206, 2017. [13] Samory Kpotufe and Ulrike V Luxburg. Pruning nearest neighbor cluster trees. In Proceedings of the 28th International Conference on Machine Learning (ICML-11), pages 225–232, 2011. [14] Bharath Sriperumbudur and Ingo Steinwart. Consistency and rates for clustering with dbscan. In Artificial Intelligence and Statistics, pages 1090–1098, 2012. [15] Aleksandr Borisovich Tsybakov. Recursive estimation of the mode of a multivariate distribution. Problemy Peredachi Informatsii, 26(1):38–45, 1990. [16] Andrea Vedaldi and Stefano Soatto. Quick shift and kernel methods for mode seeking. In European Conference on Computer Vision, pages 705–718. Springer, 2008. [17] Daren Wang, Xinyang Lu, and Alessandro Rinaldo. Optimal rates for cluster tree estimation using kernel density estimators. arXiv preprint arXiv:1706.03113, 2017. 10
2017
644
7,168
Wasserstein Learning of Deep Generative Point Process Models Shuai Xiao∗†, Mehrdad Farajtabar∗⋄Xiaojing Ye‡, Junchi Yan§, Le Song⋄¶, Hongyuan Zha⋄ †Shanghai Jiao Tong University ⋄College of Computing, Georgia Institute of Technology ‡School of Mathematics, Georgia State University §IBM Research – China ¶Ant Financial benjaminforever@sjtu.edu.cn, mehrdad@gatech.edu xye@gsu.edu, yanjc@cn.ibm.com {lsong,zha}@cc.gatech.edu Abstract Point processes are becoming very popular in modeling asynchronous sequential data due to their sound mathematical foundation and strength in modeling a variety of real-world phenomena. Currently, they are often characterized via intensity function which limits model’s expressiveness due to unrealistic assumptions on its parametric form used in practice. Furthermore, they are learned via maximum likelihood approach which is prone to failure in multi-modal distributions of sequences. In this paper, we propose an intensity-free approach for point processes modeling that transforms nuisance processes to a target one. Furthermore, we train the model using a likelihood-free leveraging Wasserstein distance between point processes. Experiments on various synthetic and real-world data substantiate the superiority of the proposed point process model over conventional ones. 1 Introduction Event sequences are ubiquitous in areas such as e-commerce, social networks, and health informatics. For example, events in e-commerce are the times a customer purchases a product from an online vendor such as Amazon. In social networks, event sequences are the times a user signs on or generates posts, clicks, and likes. In health informatics, events can be the times when a patient exhibits symptoms or receives treatments. Bidding and asking orders also comprise events in the stock market. In all of these applications, understanding and predicting user behaviors exhibited by the event dynamics are of great practical, economic, and societal interest. Temporal point processes [1] is an effective mathematical tool for modeling events data. It has been applied to sequences arising from social networks [2, 3, 4], electronic health records [5], ecommerce [6], and finance [7]. A temporal point process is a random process whose realization consists of a list of discrete events localized in (continuous) time. The point process representation of sequence data is fundamentally different from the discrete time representation typically used in time series analysis. It directly models the time period between events as random variables, and allows temporal events to be modeled accurately, without requiring the choice of a time window to aggregate events, which may cause discretization errors. Moreover, it has a remarkably extensive theoretical foundation [8]. ∗Authors contributed equally. Work completed at Georgia Tech. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. However, conventional point process models often make strong unrealistic assumptions about the generative processes of the event sequences. In fact, a point process is characterized by its conditional intensity function – a stochastic model for the time of the next event given all the times of previous events. The functional form of the intensity is often designed to capture the phenomena of interests [9]. Some examples are homogeneous and non-homogeneous Poisson processes [10], self-exciting point processes [11], self-correcting point process models [12], and survival processes [8]. Unfortunately, they make various parametric assumptions about the latent dynamics governing the generation of the observed point patterns. As a consequence, model misspecification can cause significantly degraded performance using point process models, which is also shown by our experimental results later. To address the aforementioned problem, the authors in [13, 14, 15] propose to learn a general representation of the underlying dynamics from the event history without assuming a fixed parametric form in advance. The intensity function of the temporal point process is viewed as a nonlinear function of the history of the process and is parameterized using a recurrent neural network. Attenional mechanism is explored to discover the underlying structure [16]. Apparently this line of work still relies on explicit modeling of the intensity function. However, in many tasks such as data generation or event prediction, knowledge of the whole intensity function is unnecessary. On the other hand, sampling sequences from intensity-based models is usually performed via a thinning algorithm [17], which is computationally expensive; many sample events might be rejected because of the rejection step, especially when the intensity exhibits high variation. More importantly, most of the methods based on intensity function are trained by maximizing log likelihood or a lower bound on it. They are asymptotically equivalent to minimizing the Kullback-Leibler (KL) divergence between the data and model distributions, which suffers serious issues such as mode dropping [18, 19]. Alternatively, Generative Adversarial Networks (GAN) [20] have proven to be a promising alternative to traditional maximum likelihood approaches [21, 22]. In this paper, for the first time, we bypass the intensity-based modeling and likelihood-based estimation of temporal point processes and propose a neural network-based model with a generative adversarial learning scheme for point processes. In GANs, two models are used to solve a minimax game: a generator which samples synthetic data from the model, and a discriminator which classifies the data as real or synthetic. Theoretically speaking, these models are capable of modeling an arbitrarily complex probability distribution, including distributions over discrete events. They achieve state-of-the-art results on a variety of generative tasks such as image generation, image super-resolution, 3D object generation, and video prediction [23, 24]. The original GAN in [20] minimizes the Jensen-Shannon (JS) and is regarded as highly unstable and prone to miss modes. Recently, Wasserstein GAN (WGAN) [25] is proposed to use the Earth Moving distance (EM) as an objective for training GANs. Furthermore it is shown that the EM objective, as a metric between probability distributions [26] has many advantages as the loss function correlates with the quality of the generated samples and reduces mode dropping [27]. Moreover, it leverages the geometry of the space of event sequences in terms of their distance, which is not the case for an MLE-based approach. In this paper we extend the notion of WGAN for temporal point processes and adopt a Recurrent Neural Network (RNN) for training. Importantly, we are able to demonstrate that Wasserstein distance training of RNN point process models outperforms the same architecture trained using MLE. In a nutshell, the contributions of the paper are: i) We propose the first intensity-free generative model for point processes and introduce the first (to our best knowledge) likelihood-free corresponding learning methods; ii) We extend WGAN for point processes with Recurrent Neural Network architecture for sequence generation learning; iii) In contrast to the usual subjective measures of evaluating GANs we use a statistical and a quantitative measure to compare the performance of the model to the conventional ones. iv) Extensive experiments involving various types of point processes on both synthetic and real datasets show the promising performance of our approach. 2 Proposed Framework In this section, we define Point Processes in a way that is suitable to be combined with the WGANs. 2.1 Point Processes Let S be a compact space equipped with a Borel σ-algebra B. Take Ξ as the set of counting measures on S with C as the smallest σ-algebra on it. Let (Ω, F, P) be a probability space. A point process on S is a measurable map ξ : Ω→Ξ from the probability space (Ω, F, P) to the measurable space (Ξ, C). Figure 1-a illustrates this mapping. 2 Every realization of a point process ξ can be written as ξ = Pn i=1 δXi where δ is the Dirac measure, n is an integer-valued random variable and Xi’s are random elements of S or events. A point process can be equivalently represented by a counting process: N(B) := R B ξ(x)dx, which basically is the number of events in each Borel subset B ∈B of S. The mean measure M of a point process ξ is a measure on S that assigns to every B ∈B the expected number of events of ξ in B, i.e., M(B) := E[N(B)] for all B ∈B. For inhomogeneous Poisson process, M(B) = R B λ(x)dx, where the intensity function λ(x) yields a positive measurable function on S. Intuitively speaking, λ(x)dx is the expected number of events in the infinitesimal dx. For the most common type of point process, a Homogeneous Poisson process, λ(x) = λ and M(B) = λ|B|, where | · | is the Lebesgue measure on (S, B). More generally, in Cox point processes, λ(x) can be a random density possibly depending on the history of the process. For any point process, given λ(·), N(B) ∼Poisson( R B λ(x)dx). In addition, if B1, . . . , Bk ∈B are disjoint, then N(B1), . . . , N(Bk) are independent conditioning on λ(·). For the ease of exposition, we will present the framework for the case where the events are happening in the real half-line of time. But the framework is easily extensible to the general space. 2.2 Temporal Point Processes A particularly interesting case of point processes is given when S is the time interval [0, T), which we will call a temporal point process. Here, a realization is simply a set of time points: ξ = Pn i=1 δti. With a slight notation abuse we will write ξ = {t1, . . . , tn} where each ti is a random time before T. Using a conditional intensity (rate) function is the usual way to characterize point processes. For Inhomogeneous Poisson process (IP), the intensity λ(t) is a fixed non-negative function supported in [0, T). For example, it can be a multi-modal function comprised of k Gaussian kernels: λ(t) = Pk i=1 αi(2πσ2 i )−1/2 exp −(t −ci)2/σ2 i  , for t ∈[0, T), where ci and σi are fixed center and standard deviation, respectively, and αi is the weight (or importance) for kernel i. A self-exciting (Hawkes) process (SE) is a cox process where the intensity is determined by previous (random) events in a special parametric form: λ(t) = µ+β P ti<t g(t−ti), where g is a nonnegative kernel function, e.g., g(t) = exp(−ωt) for some ω > 0. This process has an implication that the occurrence of an event will increase the probability of near future events and its influence will (usually) decrease over time, as captured by (the usually) decaying fixed kernel g. µ is the exogenous rate of firing events and α is the coefficient for the endogenous rate. In contrast, in self-correcting processes (SC), an event will decrease the probability of an event: λ(t) = exp(ηt−P ti<t γ). The exp ensures that the intensity is positive, while η and γ are exogenous and endogenous rates. We can utilize more flexible ways to model the intensity, e.g., by a Recurrent Neural Network (RNN): λ(t) = gw(t, hti), where hti is the feedback loop capturing the influence of previous events (last updated at the latest event) and is updated by hti = hv(ti, hti−1). Here w, v are network weights. 2.3 Wasserstein-Distance for Temporal Point Processes Given samples from a point process, one way to estimate the process is to find a model (Ωg, Fg, Pg) → (Ξ, C) that is close enough to the real data (Ωr, Fr, Pr) →(Ξ, C). As mentioned in the introduction, Wasserstein distance [25] is our choice as the proximity measure. The Wasserstein distance between distribution of two point processes is: W(Pr, Pg) = inf ψ∈Ψ(Pr,Pg) E(ξ,ρ)∼ψ[∥ξ −ρ∥⋆], (1) where Ψ(Pr, Pg) denotes the set of all joint distributions ψ(ξ, ρ) whose marginals are Pr and Pg. The distance between two sequences ∥ξ −ρ∥⋆, is tricky and need further attention. Take ξ = {x1, x2, . . . , xn} and ρ = {y1, . . . , ym}, where for simplicity we first consider the case m = n. The two sequences can be thought as discrete distributions µξ = Pn i=1 1 nδxi and µρ = Pn i=1 1 nδyi. Then, the distance between these two is an optimal transport problem argminπ∈Σ⟨π, C⟩, where Σ is the set of doubly stochastic matrices (rows and columns sum up to one), ⟨·, ·⟩is the Frobenius dot product, and C is the cost matrix. Cij captures the energy needed to move a probability mass from xi to yj. We take Cij = ∥xi −yj∥◦where ∥· ∥◦is the norm in S. It can be seen that the optimal solution is attained at extreme points and, by Birkhoff’s theorem, the extreme points of the set of doubly stochastic matrices is a permutation [28]. In other words, the mass is transfered from a unique source 3 ω Ω ξ t1 t3 t2 Ξ τ1 τ2 τ3 τ4 τ5 t1 t2 t3 t4 T count s1 s2 s3 s4 s5 a) Point process probability space b) ∥· ∥⋆distance between sequences Figure 1: a) The outcome of the random experiment ω is mapped to a point in space of count measures ξ; b) Distance between two sequences ξ = {t1, t2, . . .} and ρ = {τ1, τ2, . . .} event to a unique target event. Therefore, we have: ∥ξ −ρ∥⋆= minσ Pn i=1 ∥xi −yσ(i)∥◦, where the minimum is taken among all n! permutations of 1 . . . n. For the case m ̸= n, without loss of generality we assume n ≤m and define the distance as follows: ∥ξ −ρ∥⋆= min σ Xn i=1 ∥xi −yσ(i)∥◦+ Xm i=n+1 ∥s −yσ(i)∥, (2) where s is a fixed limiting point in border of the compact space S and the minimum is over all permutations of 1 . . . m. The second term penalizes unmatched points in a very special way which will be clarified later. Appendix B proves that it is indeed a valid distance measure. Interestingly, in the case of temporal point process in [0, T) the distance between ξ = {t1, . . . , tn} and ρ = {τ1, . . . , τm} is reduced to ∥ξ −ρ∥⋆= Xn i=1 |ti −τi| + (m −n) × T − Xm i=n+1 τi, (3) where the time points are ordered increasingly, s = T is chosen as the anchor point, and | · | is the Lebesgue measure in the real line. A proof is given in Appendix C. This choice of distance is significant in two senses. First, it is computationally efficient and no excessive computation is involved. Secondly, in terms of point processes, it is interpreted as the volume by which the two counting measures differ. Figure 1-b demonstrates this intuition and justifies our choice of metric in Ξ and Appendix D contains the proof. The distance used in our current work is the simplest yet effective distance that exhibits high interpretability and efficient computability. More robust distance like local alignment distance and dynamic time warping [29] should be more robust and are great venues for future work. Equation (1) is computationally highly intractable and its dual form is usually utilized [25]: W(Pr, Pg) = sup ∥f∥L≤1 Eξ∼Pr[f(ξ)] −Eρ∼Pg[f(ρ)], (4) where the supremum is taken over all Lipschitz functions f : Ξ →R, i.e., functions that assign a value to a sequence of events (points) and satisfy |f(ξ) −f(ρ)| ≤∥ξ −ρ∥⋆for all ξ and ρ. However, solving the dual form is still highly nontrivial. Enumerating all Lipschitz functions over point process realizations is impossible. Instead, we choose a parametric family of functions to approximate the search space fw and consider solving the problem max w∈W,∥fw∥L≤1 Eξ∼Pr[fw(ξ)] −Eρ∼Pg[fw(ρ)] (5) where w ∈W is the parameter. The more flexible fw, the more accurate will be the approximation. It is notable that W-distance leverages the geometry of the space of event sequences in terms of their distance, which is not the case for MLE-based approach. It in turn requires functions of event sequences f(x1, x2, ...), rather than functions of the time stamps f(xi). Furthermore, Stein’s method to approximate Poisson processes [30, 31] is also relevant as they are defining distances between a Poisson process and an arbitrary point process. 2.4 WGAN for Temporal Point Processes Equipped with a way to approximately compute the Wasserstein distance, we will look for a model Pr that is close to the distribution of real sequences. Again, we choose a sufficiently flexible parametric family of models, gθ parameterized by θ. Inspired by GAN [20], this generator takes a noise and turns it into a sample to mimic the real samples. In conventional GAN or WGAN, Gaussian or uniform distribution is chosen. In point processes, a homogeneous Poisson process plays the role of a 4 non-informative and uniform-like distribution: the probability of events in every region is independent of the rest and is proportional to its volume. Define the noise process as (Ωz, Fz, Pz) →(Ξ, C), then ζ ∼Pz is a sample from a Poisson process on S = [0, T) with constant rate λz > 0. Therefore, gθ : Ξ →Ξ is a transformation in the space of counting measures. Note that λz is part of the prior knowledge and belief about the problem domain. Therefore, the objective of learning the generative model can be written as min W(Pr, Pg) or equivalently: min θ max w∈W,∥fw∥L≤1 Eξ∼Pr[fw(ξ)] −Eζ∼Pz[fw(gθ(ζ))] (6) In GAN terminology fw is called the discriminator and gθ is known as the generator model. We estimate the generative model by enforcing that the sample sequences from the model have the same distribution as training sequences. Given L samples sequences from real data Dr = {ξ1, . . . , ξL} and from the noise Dz = {ζ1, . . . , ζL} the two expectations are estimated empirically: Eξ∼Pr[fw(ξ)] = 1 L PL l=1 fw(ξl) and Eζ∼Pz[fw(gθ(ζ))] = 1 L PL l=1 fw(gθ(ζl)). 2.5 Ingredients of WGANTPP To proceed with our point process based WGAN, we need the generator function gθ : Ξ →Ξ, the discriminator function fw : Ξ →R, and enforce Lipschitz constraint on fw. Figure 4 in Appendix A illustrates the data flow for WGANTPP. The generator transforms a given sequence to another sequence. Similar to [32, 33] we use Recurrent Neural Networks (RNN) to model the generator. For clarity, we use the vanilla RNN to illustrate the computational process as below. The LSTM is used in our experiments for its capacity to capture long-range dependency. If the input and output sequences are ζ = {z1, . . . , zn} and ρ = {t1, . . . , tn} then the generator gθ(ζ) = ρ works according to hi = φh g(Ah gzi + Bh g hi−1 + bh g), ti = φx g(Bx g hi + bx g) (7) Here hi is the k-dimensional history embedding vector and φh g and φx g are the activation functions. The parameter set of the generator is θ = nAh g  k×1 , Bh g  k×k , bh g  k×1 , Bx g  1×k , bx g  1×1 o . Similarly, we define the discriminator function who assigns a scalar value fw(ρ) = Pn i=1 ai to the sequence ρ = {t1, . . . , tn} according to hi = φh d(Ah dti + Bh g hi−1 + bh g) ai = φa d(Ba dhi + ba d) (8) where the parameter set is comprised of w = nAh d  k×1 , Bh d  k×k , bh d  k×1 , (Ba d)1×k , (ba d)1×1 o . Note that both generator and discriminator RNNs are causal networks. Each event is only influenced by the previous events. To enforce the Lipschitz constraints the original WGAN paper [18] adopts weight clipping. However, our initial experiments shows an inferior performance by using weight clipping. This is also reported by the same authors in their follow-up paper [27] to the original work. The poor performance of weight clipping for enforcing 1-Lipschitz can be seen theoretically as well: just consider a simple neural network with one input, one neuron, and one output: f(x) = σ(wx + b) and the weight clipping w < c. Then, |f ′(x)| ≤1 ⇐⇒|wσ′(wx + b)| ≤1 ⇐⇒|w| ≤1/|σ′(wx + b)| (9) It is clear that when 1/|σ′(wx + b)| < c, which is quite likely to happen, the Lipschitz constraint is not necessarily satisfied. In our work, we use a novel approach for enforcing the Lipschitz constraints, avoiding the computation of the gradient which can be costly and difficult for point processes. We add the Lipschitz constraint as a regularization term to the empirical loss of RNN. min θ max w∈W,∥fw∥L≤1 1 L L X l=1 fw(ξl) − L X l=1 fw(gθ(ζl)) −ν L X l,m=1 ||fw(ξl) −fw(gθ(ζm))| |ξl −gθ(ζm)|⋆ −1| (10) We can take each of the 2L 2  pairs of real and generator sequences, and regularize based on them; however, we have seen that only a small portion of pairs (O(L)), randomly selected, is sufficient. The procedure of WGANTPP learning is given in Algorithm 1 Remark The significance of Lipschitz constraint and regularization (or more generally any capacity control) is more apparent when we consider the connection of W-distance and optimal transport problem [28]. Basically, minimizing the W-distance between the empirical distribution and the model distribution is equivalent to a semidiscrete optimal transport [28]. Without capacity control for the generator and discriminator, the optimal solution simply maps a partition of the sample space to the set of data points, in effect, memorizing the data points. 5 Algorithm 1 WGANTPP for Temporal Point Process. The default values α = 1e −4, β1 = 0.5, β2 = 0.9, m = 256, ncritic = 5. Require: : the regularization coefficient ν for direct Lipschitz constraint. the batch size, m. the number of iterations of the critic per generator iteration, ncritic. Adam hyper-parameters α, β1, β2. Require: : w0, initial critic parameters. θ0, initial generator’s parameters. 1: set prior λz to the expectation of event rate for real data. 2: while θ has not converged do 3: for t = 0, ..., ncritic do 4: Sample point process realizations {ξ(i)}m i=1 ∼Pr from real data. 5: Sample {ζ(i)}m i=1 ∼Pz from a Poisson process with rate λz. 6: L′ ←  1 m Pm i=1 fw(gθ(ζ(i))) −1 m Pm i=1 fw(ξ(i))  + ν Pm i,j=1 | |fw(ξi)−fw(gθ(ζj))| |ξi−gθ(ζj)|⋆ −1| 7: w ←Adam(∇wL′, w, α, β1, β2) 8: end for 9: Sample {ζ(i)}m i=1 ∼Pz from a Poisson process with rate λz. 10: θ ←Adam(−∇θ 1 m Pm i=1 fw(gθ(ζ(i))), θ, α, β1, β2) 11: end while 0 2 4 6 Theoretical Quantiles 0 2 4 6 Sample Quantiles Data Generated by IP Real IP SE SC NN WGAN 0 2 4 6 Theoretical Quantiles 0 2 4 6 Sample Quantiles Data Generated by SE Real IP SE SC NN WGAN 0 2 4 6 Theoretical Quantiles 0 2 4 6 Sample Quantiles Data Generated by SC Real IP SE SC NN WGAN 0 2 4 6 Theoretical Quantiles 0 2 4 6 Sample Quantiles Data Generated by NN Real IP SE SC NN WGAN 0 5 10 time 0.00 0.25 0.50 0.75 1.00 intensity Data Generated by IP Real IP SE SC NN WGAN 0 5 10 time 0 2 4 6 8 intensity Data Generated by SE Real IP SE SC NN WGAN 0 5 10 time 0 2 4 6 8 intensity Data Generated by SC Real IP SE SC NN WGAN 0 5 10 time 0 2 4 intensity Data Generated by NN Real IP SE SC NN WGAN 0 5 10 time 0 2 4 6 intensity Data Generated by IP+SE+SC real IP SE SC NN WGAN 0 5 10 time 0 1 2 3 4 intensity Data Generated by IP+SC+NN real IP SE SC NN WGAN 0 5 10 time 0 1 2 3 4 intensity Data Generated by IP+SE+NN real IP SE SC NN WGAN 0 5 10 time 0 2 4 6 intensity Data Generated by SE+SC+NN real IP SE SC NN WGAN Figure 2: Performance of different methods on various synthetic data. Top row: QQ plot slope deviation; middle row: intensity deviation in basic conventional models; bottom row: intensity deviation in mixture of conventional processes. 3 Experiments The current work aims at exploring the feasibility of modeling point process without prior knowledge of its underlying generating mechanism. To this end, most widely-used parametrized point processes, e.g., self-exciting and self-correcting, and inhomogeneous Poisson processes and one flexible neural network model, neural point process are compared. In this work we use the most general forms for simpler and clear exposition to the reader and propose the very first model in adversarial training of point processes in contrast to likelihood based models. 3.1 Datasets and Protocol Synthetic datasets. We simulate 20,000 sequences over time [0, T) where T = 15, for inhomogeneous process (IP), self-exciting (SE), and self-correcting process (SC), recurrent neural point process (NN). We also create another 4 (= C3 4) datasets from the above 4 synthetic data by a uniform mixture 6 Table 1: Deviation of QQ plot slope and empirical intensity for ground-truth and learned model Data Estimator MLE-IP MLE-SE MLE-SC MLE-NN WGAN QQP. Dev. IP 0.035 (8.0e-4) 0.284 (7.0e-5) 0.159 (3.8e-5) 0.216 (3.3e-2) 0.033 (3.3e-3) SE 0.055 (6.5e-5) 0.001 (1.3e-6) 0.086 (1.1e-6) 0.104 (6.7e-3) 0.051 (1.8e-3) SC 3.510 (4.9e-5) 2.778 (7.4e-5) 0.002 (8.8e-6) 4.523 (2.6e-3) 0.070 (6.4e-3) NN 0.182 (1.6e-5) 0.687 (5.0e-6) 1.004 (2.5e-6) 0.065 (1.2e-2) 0.012 (4.7e-3) Int. Dev. IP 0.110 (1.9e-4) 0.241 (1.0e-4) 0.289 (2.8e-5) 0.511 (1.8e-1) 0.136 (8.7e-3) SE 1.950 (4.8e-4) 0.019 (1.84e-5) 1.112 (3.1e-6) 0.414 (1.6e-1) 0.860 (6.2e-2) SC 2.208 (7.0e-5) 0.653 (1.2e-4) 0.006 (9.9e-5) 1.384 (1.7e-1) 0.302 (2.2e-3) NN 1.044 (2.4e-4) 0.889 (1.2e-5) 1.101 (1.3e-4) 0.341 (3.4e-1) 0.144 (4.28e-2) Int. Dev. IP+SE+SC 1.505 (3.3e-4) 0.410 (1.8e-5) 0.823 (3.1e-6) 0.929 (1.6e-1) 0.305 (6.1e-2) IP+SC+NN 1.178 (7.0e-5) 0.588 (1.3e-4) 0.795 (9.9e-5) 0.713 (1.7e-1) 0.525 (2.2e-3) IP+SE+NN 1.052 (2.4e-4) 0.453 (1.2e-4) 0.583 (1.0e-4) 0.678 (3.4e-1) 0.419 (4.2e-2) SE+SC+NN 1.825 (2.8e-4) 0.324 (1.1e-4) 1.269 (1.1e-4) 0.286 (3.6e-1) 0.200 (3.8e-2) from the triplets. The new datasets IP+SE+SC, IP+SE+NN, IP+SC+NN, SE+SC+NN are created to testify the mode dropping problem of learning a generative model. The parameter setting follows: i) Inhomogeneous process. The intensity function is independent from history and given in Sec. 2.2, where k = 3, α = [3, 7, 11], c = [1, 1, 1], σ = [2, 3, 2]. ii) Self-exciting process. The past events increase the rate of future events. The conditional intensity function is given in Sec. 2.2 where µ = 1.0, β = 0.8 and the decaying kernel g(t −ti) = e−(t−ti). iii) Self-correcting process. The conditional intensity function is defined in Sec. 2.2. It increases with time and decreases by events occurrence. We set η = 1.0, γ = 0.2. iv) Recurrent Neural Network process. The conditional intensity is given in Sec. 2.2, where the neural network’s parameters are set randomly and fixed. We first feed random variable from [0,1] uniform distribution, and then iteratively sample events from the intensity and feed the output into the RNN to get the new intensity for the next step. Real datasets. We collect sequences separately from four public available datasets, namely, healthcare MIMIC-III, public media MemeTracker, NYSE stock exchanges, and publications citations. The time scale for all real data are scaled to [0,15], and the details are as follows: i) MIMIC. MIMIC-III (Medical Information Mart for Intensive Care III) is a large, publicly available dataset, which contains de-identified health-related data during 2001 to 2012 for more than 40,000 patients. We worked with patients who appear at least 3 times, which renders 2246 patients. Their visiting timestamps are collected as the sequences. ii) Meme. MemeTracker tracks the meme diffusion over public media, which contains more than 172 million news articles or blog posts. The memes are sentences, such as ideas, proverbs, and the time is recorded when it spreads to certain websites. We randomly sample 22,000 cascades. iii) MAS. Microsoft Academic Search provides access to its data, including publication venues, time, citations, etc. We collect citations records for 50,000 papers. iv) NYSE. We use 0.7 million high-frequency transaction records from NYSE for a stock in one day. The transactions are evenly divided into 3,200 sequences with equal durations. 3.2 Experimental Setup Details. We can feed the temporal sequences to generator and discriminator directly. In practice, all temporal sequences are transformed into time duration between two consecutive events, i.e., transforming the sequence ξ = {t1, . . . , tn} into {τ1, . . . , τn−1}, where τi = ti+1−ti. This approach makes the model train easily and perform robustly. The transformed sequences are statistically identical to the original sequences, which can be used as the inputs of our neural network. To make sure we that the times are increasing we use elu + 1 activation function to produce positive inter arrival times for the generator and accumulate the intervals to get the sequence. The Adam optimization method with learning rate 1e-4, β1 = 0.5, β2 = 0.9, is applied. The code is available 2. Baselines. We compare the proposed method of learning point processes (i.e., minimizing sample distance) with maximum likelihood based methods for point process. To use MLE inference for point process, we have to specify its parametric model. The used parametric model are inhomogeneous Poisson process (mixture of Gaussian), self-exciting process, self-correcting process, and RNN. For 2https://github.com/xiaoshuai09/Wasserstein-Learning-For-Point-Process 7 each data, we use all the above solvers to learn the model and generate new sequences, and then we compare the generated sequences with real ones. Evaluation metrics. Although our model is an intensity-free approach we will evaluate the performance by metrics that are computed via intensity. For all models, we work with the empirical intensity instead. Note that our objective measures are in sharp contrast with the best practices in GANs in which the performance is usually evaluated subjectively, e.g., by visual quality assessment. We evaluate the performance of different methods to learn the underlying processes via two measures: 1) The first one is the well-known QQ plot of sequences generated from learned model. The quantile-quantile (q-q) plot is the graphical representation of the quantiles of the first data set against the quantiles of the second data set. From the time change property [10] of point processes, if the sequences come from the point process λ(t) , then the integral Λ = R tt+1 ti λ(s)ds between consecutive events should be exponential distribution with parameter 1. Therefore, the QQ plot of Λ against exponential distribution with rate 1 should fall approximately along a 45-degree reference line. The evaluation procedure is as follows: i) The ground-truth data is generated from a model, say IP; ii) All 5 methods are used to learn the unknown process using the ground-truth data; iii) The learned model is used to generate a sequence; iv) The sequence is used against the theoretical quantiles from the model to see if the sequence is really coming from the ground-truth generator or not; v) The deviation from slope 1 is visualized or reported as a performance measure. 2) The second metric is the deviation between empirical intensity from the learned model and the ground truth intensity. We can estimate empirical intensity λ′(t) = E(N(t + δt) −N(t))/δt from sufficient number of realizations of point process through counting the average number of events during [t, t + δt], where N(t) is the count process for λ(t). The L1 distance between the ground-truth empirical intensity and the learned empirical intensity is reported as a performance measure. 3.3 Results and Discussion Synthetic data. Figure 2 presents the learning ability of WGANTPP when the ground-truth data is generated via different types of point process. We first compare the QQ plots in the top row from the micro perspective view, where QQ plot describes the dependency between events. Red dots legend-ed with Real are the optimal QQ distribution, where the intensity function generates the sequences are known. We can observe that even though WGANTPP has no prior information about the ground-truth point process, it can estimate the model better except for the estimator that knows the parametric form of data. This is quite expected: When we are training a model and we know the parametric form of the generating model we can find it better. However, whenever the model is misspecified (i.e., we don’t know the parametric from a priori) WGANTPP outperforms other parametric forms and RNN approach. The middle row of figure 2 compares the empirical intensity. The Real line is the optimal empirical intensity estimated from the real data. The estimator can recover the empirical intensity well in the case that we know the parametric form where the data comes from. Otherwise, estimated intensity degrades considerably when the model is misspecified. We can observe our WGANTPP produces the empirical intensity better and performs robustly across different types of point process data. For MLE-IP, different number of kernels are tested and the empirical intensity results improves but QQ plot results degrade when the number of kernels increases, so only result of 3 kernels is shown mainly for clarity of presentation. The fact that the empirical intensity estimated from MLE-IP method are good and QQ plots are very bad indicates the inhomogeneous Poisson process can capture the average intensity (Macro dynamics) accurately but incapable of capturing the dependency between events (Micro dynamics). To testify that WGANTPP can cope with mode dropping, we generate mixtures of data from three different point processes and use this data to train different models. Models with specified form can handle limited types of data and fail to learn from diverse data sources. The last row of figure 2 shows the learned intensity from mixtures of data. WGANTPP produces better empirical intensity than alternatives, which fail to capture the heterogeneity in data. To verify the robustness of WGANTPP, we randomly initialize the generator parameters and run 10 rounds to get the mean and std of deviations for both empirical intensity and QQ plot from ground truth. For empirical intensity, we compute the integral of difference of learned intensity and ground-truth intensity. Table 1 reports the mean and std of deviations for intensity deviation. For each estimators, we obtain the slope from the regression line for its QQ plot. Table 1 reports the mean and std of deviations for slope of the QQ plot. Compared to the MLE-estimators, WGANTPP consistently outperforms even without prior knowledge about the parametric form of the true underlying generative point process. Note that for mixture models QQ-plot is not feasible. Real-world data. We evaluate WGANTPP on a diverse real-world data process from health-care, public media, scientific activities and stock exchange. For those real world data, the underlying 8 0 5 10 time 0.0 0.2 0.4 0.6 0.8 1.0 intensity MIMIC real IP SE SC NN WGAN 0 5 10 time 0 1 2 3 4 5 intensity MEME real IP SE SC NN WGAN 0 5 10 time 0 2 4 6 intensity MAS real IP SE SC NN WGAN 0 5 10 time 0 1 2 intensity NYSE real IP SE SC NN WGAN Figure 3: Performance of different methods on various real-world datasets. Table 2: Deviation of empirical intensity for real-world data. Data Estimator MLE-IP MLE-SE MLE-SC MLE-NN WGAN MIMIC 0.150 0.160 0.339 0.686 0.122 Meme 0.839 1.008 0.701 0.920 0.351 MAS 1.089 1.693 1.592 2.712 0.849 NYSE 0.799 0.426 0.361 0.347 0.303 generative process is unknown, previous works usually assume that they are certain types of point process from their domain knowledge. Figure 3 shows the intensity learned from different models, where Real is estimated from the real-world data itself. Table 2 reports the intensity deviation. When all models have no prior knowledge about the true generative process, WGANTPP recovers intensity better than all the other models across the data sets. Analysis. We have observed that when the generating model is misspecified WGANTPP outperforms the other methods without leveraging the a priori knowledge of the parametric form. However, when the exact parametric form of data is known and when it is utilized to learn the parameters, MLE with this full knowledge performs better. However, this is generally a strong assumption. As we have observed from the real-world experiments WGANTPP is superior in terms of performance. Somewhat surprising is the observation that WGANTPP tends to outperform the MLE-NN approach which basically uses the same RNN architecture but trained using MLE. The superior performance of our approach compared to MLE-NN is another witness of the the benefits of using W-distance in finding a generator that fits the observed sequences well. Even though the expressive power of the estimators is the same for WGANTPP and MLE-NN, MLE-NN may suffer from mode dropping or get stuck in an inferior local minimum since maximizing likelihood is asymptotically equivalent to minimizing the Kullback-Leibler (KL) divergence between the data and model distribution. The inherent weakness of KL divergence [25] renders MLE-NN perform unstably, and the large variances of deviations empirically demonstrate this point. 4 Conclusion and Future Work We have presented a novel approach for Wasserstein learning of deep generative point processes which requires no prior knowledge about the underlying true process and can estimate it accurately across a wide scope of theoretical and real-world processes. For the future work, we would like to explore the connection of the WGAN with the optimal transport problem. We will also explore other possible distance metrics over the realizations of point processes, and more sophisticated transforms of point processes, particularly those that are causal. Extending the current work to marked point processes and processes over structured spaces is another interesting venue for future work. Acknowledgements. This project was supported in part by NSF (IIS-1639792, IIS-1218749, IIS1717916, CMMI-1745382), NIH BIGDATA 1R01GM108341, NSF CAREER IIS-1350983, NSF CNS-1704701, ONR N00014-15-1-2340, NSFC 61602176, Intel ISTC, NVIDIA and Amazon AWS. References [1] DJ Daley and D Vere-Jones. An introduction to the theory of point processes. 2003. [2] Scott W Linderman and Ryan P Adams. Discovering latent network structure in point process data. In ICML, pages 1413–1421, 2014. [3] Mehrdad Farajtabar, Nan Du, Manuel Gomez-Rodriguez, Isabel Valera, Hongyuan Zha, and Le Song. Shaping social activity by incentivizing users. In NIPS 2014 [4] Mehrdad Farajtabar, Xiaojing Ye, Sahar Harati, Hongyuan Zha, and Le Song. Multistage campaigning in social networks In NIPS 2016 9 [5] Wenzhao Lian, Ricardo Henao, Vinayak Rao, Joseph E Lucas, and Lawrence Carin. A multitask point process predictive model. In ICML, pages 2030–2038, 2015. [6] Lizhen Xu, Jason A Duan, and Andrew Whinston. Path to purchase: A mutually exciting point process model for online advertising and conversion. Management Science, 60(6):1392–1412, 2014. [7] Emmanuel Bacry, Iacopo Mastromatteo, and Jean-François Muzy. Hawkes processes in finance. Market Microstructure and Liquidity, 1(01):1550005, 2015. [8] Odd Aalen, Ornulf Borgan, and Hakon Gjessing. Survival and event history analysis: a process point of view. Springer Science & Business Media, 2008. [9] Mehrdad Farajtabar, Yichen Wang, Manuel Gomez-Rodriguez, Shuang Li, Hongyuan Zha, and Le Song. Coevolve: A joint point process model for information diffusion and network co-evolution. In NIPS 2015. [10] John Frank Charles Kingman. Poisson processes. Wiley Online Library, 1993. [11] Alan G Hawkes. Spectra of some self-exciting and mutually exciting point processes. Biometrika, 1971. [12] Valerie Isham and Mark Westcott. A self-correcting point process. Stochastic Processes and Their Applications, 8(3):335–347, 1979. [13] Nan Du, Hanjun Dai, Rakshit Trivedi, Utkarsh Upadhyay, Manuel Gomez-Rodriguez, and Le Song. Recurrent marked temporal point processes: Embedding event history to vector. In KDD, 2016. [14] Shuai Xiao, Junchi Yan, Xiaokang Yang, Hongyuan Zha, Stephen M. Chu. Modeling the Intensity Function of Point Process Via Recurrent Neural Networks. In AAAI, 2017. [15] Hongyuan Mei and Jason Eisne The Neural Hawkes Process: A Neurally Self-Modulating Multivariate Point Process. In NIPS 2017. [16] Shuai Xiao, Junchi Yan, Mehrdad Farajtabar, Le Song, Xiaokang Yang, and Hongyuan Zha. Joint Modeling of Event Sequence and Time Series with Attentional Twin Recurrent Neural Networks. arXiv preprint arXiv:1703.08524, 2017. [17] Yosihiko Ogata. On lewis’ simulation method for point processes. IEEE Transactions on Information Theory, 27(1):23–31, 1981. [18] Martin Arjovsky and Léon Bottou. Towards principled methods for training generative adversarial networks. In NIPS 2016 Workshop on Adversarial Training. In review for ICLR, volume 2016, 2017. [19] Ian Goodfellow. Nips 2016 tutorial: Generative adversarial networks. arXiv preprint:1701.00160, 2016. [20] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In NIPS, 2014. [21] Ferenc Huszár. How (not) to train your generative model: Scheduled sampling, likelihood, adversary? arXiv preprint arXiv:1511.05101, 2015. [22] Lucas Theis, Aäron van den Oord, and Matthias Bethge. A note on the evaluation of generative models. arXiv preprint arXiv:1511.01844, 2015. [23] Anh Nguyen, Jason Yosinski, Yoshua Bengio, Alexey Dosovitskiy, and Jeff Clune. Plug & play generative networks: Conditional iterative generation of images in latent space. arXiv preprint:1612.00005, 2016. [24] Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015. [25] Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein gan. arXiv:1701.07875, 2017. [26] Ding Zhou, Jia Li, and Hongyuan Zha. A new mallows distance based metric for comparing clusterings. In ICML, pages 1028–1035, 2005. [27] Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron Courville. Improved training of wasserstein gans. arXiv preprint arXiv:1704.00028, 2017. [28] Cédric Villani. Optimal transport: old and new, volume 338. Springer Science & Business Media, 2008. [29] Marco Cuturi and Mathieu Blondel. Soft-DTW: a Differentiable Loss Function for Time-Series. In ICML, pages 894–903, 2017. 10 [30] Dominic Schuhmacher and Aihua Xia. A new metric between distributions of point processes. Advances in applied probability, 40(3):651–672, 2008. [31] Laurent Decreusefond, Matthias Schulte, Christoph Thäle, et al. Functional poisson approximation in kantorovich–rubinstein distance with applications to u-statistics and stochastic geometry. The Annals of Probability, 44(3):2147–2197, 2016. [32] Olof Mogren. C-rnn-gan: Continuous recurrent neural networks with adversarial training. arXiv preprint arXiv:1611.09904, 2016. [33] Arnab Ghosh, Viveka Kulharia, Amitabha Mukerjee, Vinay Namboodiri, and Mohit Bansal. Contextual rnn-gans for abstract reasoning diagram generation. arXiv preprint arXiv:1609.09444, 2016. 11
2017
645
7,169
Machine Learning with Adversaries: Byzantine Tolerant Gradient Descent Peva Blanchard EPFL, Switzerland peva.blanchard@epfl.ch El Mahdi El Mhamdi∗ EPFL, Switzerland elmahdi.elmhamdi@epfl.ch Rachid Guerraoui EPFL, Switzerland rachid.guerraoui@epfl.ch Julien Stainer EPFL, Switzerland julien.stainer@epfl.ch Abstract We study the resilience to Byzantine failures of distributed implementations of Stochastic Gradient Descent (SGD). So far, distributed machine learning frameworks have largely ignored the possibility of failures, especially arbitrary (i.e., Byzantine) ones. Causes of failures include software bugs, network asynchrony, biases in local datasets, as well as attackers trying to compromise the entire system. Assuming a set of n workers, up to f being Byzantine, we ask how resilient can SGD be, without limiting the dimension, nor the size of the parameter space. We first show that no gradient aggregation rule based on a linear combination of the vectors proposed by the workers (i.e, current approaches) tolerates a single Byzantine failure. We then formulate a resilience property of the aggregation rule capturing the basic requirements to guarantee convergence despite f Byzantine workers. We propose Krum, an aggregation rule that satisfies our resilience property, which we argue is the first provably Byzantine-resilient algorithm for distributed SGD. We also report on experimental evaluations of Krum. 1 Introduction The increasing amount of data available [6], together with the growing complexity of machine learning models [27], has led to learning schemes that require a lot of computational resources. As a consequence, most industry-grade machine-learning implementations are now distributed [1]. For example, as of 2012, Google reportedly used 16.000 processors to train an image classifier [22]. More recently, attention has been given to federated learning and federated optimization settings [15, 16, 23] with a focus on communication efficiency. However, distributing a computation over several machines (worker processes) induces a higher risk of failures. These include crashes and computation errors, stalled processes, biases in the way the data samples are distributed among the processes, but also, in the worst case, attackers trying to compromise the entire system. The most robust system is one that tolerates Byzantine failures [17], i.e., completely arbitrary behaviors of some of the processes. A classical approach to mask failures in distributed systems is to use a state machine replication protocol [26], which requires however state transitions to be applied by all worker processes. In the case of distributed machine learning, this constraint can be translated in two ways: either (a) the processes agree on a sample of data based on which they update their local parameter vectors, or (b) they agree on how the parameter vector should be updated. In case (a), the sample of data has to be transmitted to each process, which then has to perform a heavyweight computation to update its local ∗contact author 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. parameter vector. This entails communication and computational costs that defeat the entire purpose of distributing the work. In case (b), the processes have no way to check if the chosen update for the parameter vector has indeed been computed correctly on real data: a Byzantine process could have proposed the update and may easily prevent the convergence of the learning algorithm. Neither of these solutions is satisfactory in a realistic distributed machine learning setting. In fact, most learning algorithms today rely on a core component, namely stochastic gradient descent (SGD) [4, 13], whether for training neural networks [13], regression [34], matrix factorization [12] or support vector machines [34]. In all those cases, a cost function – depending on the parameter vector – is minimized based on stochastic estimates of its gradient. Distributed implementations of SGD [33] typically take the following form: a single parameter server is in charge of updating the parameter vector, while worker processes perform the actual update estimation, based on the share of data they have access to. More specifically, the parameter server executes learning rounds, during each of which, the parameter vector is broadcast to the workers. In turn, each worker computes an estimate of the update to apply (an estimate of the gradient), and the parameter server aggregates their results to finally update the parameter vector. Today, this aggregation is typically implemented through averaging [25], or variants of it [33, 18, 31]. This paper addresses the fundamental question of how a distributed SGD can be devised to tolerate f Byzantine processes among the n workers. Contributions. We first show in this paper that no linear combination (current approaches) of the updates proposed by the workers can tolerate a single Byzantine worker. Basically, a single Byzantine worker can force the parameter server to choose any arbitrary vector, even one that is too large in amplitude or too far in direction from the other vectors. Clearly, the Byzantine worker can prevent any classic averaging-based approach to converge. Choosing the appropriate aggregation of the vectors proposed by the workers turns out to be challenging. A non-linear, squared-distance-based aggregation rule, that selects, among the proposed vectors, the vector “closest to the barycenter” (for example by taking the vector that minimizes the sum of the squared distances to every other vector), might look appealing. Yet, such a squared-distance-based aggregation rule tolerates only a single Byzantine worker. Two Byzantine workers can collude, one helping the other to be selected, by moving the barycenter of all the vectors farther from the “correct area”. We formulate a Byzantine resilience property capturing sufficient conditions for the parameter server’s aggregation rule to tolerate f Byzantine workers. Essentially, to guarantee that the cost will decrease despite Byzantine workers, we require the vector output chosen by the parameter server (a) to point, on average, to the same direction as the gradient and (b) to have statistical moments (up to the fourth moment) bounded above by a homogeneous polynomial in the moments of a correct estimator of the gradient. One way to ensure such a resilience property is to consider a majority-based approach, looking at every subset of n −f vectors, and considering the subset with the smallest diameter. While this approach is more robust to Byzantine workers that propose vectors far from the correct area, its exponential computational cost is prohibitive. Interestingly, combining the intuitions of the majority-based and squared-distance 2-based methods, we can choose the vector that is somehow the closest to its n −f neighbors. Namely, the one that minimizes the sum of squared distances to its n −f closest vectors. This is the main idea behind our aggregation rule, we call Krum3. Assuming 2f + 2 < n, we show that Krum satisfies the resilience property aforementioned and the corresponding machine learning scheme converges. An important advantage of Krum is its (local) time complexity (O(n2 · d)), linear in the dimension of the gradient, where d is the dimension of the parameter vector. (In modern machine learning, the dimension d of the parameter vector may take values in the hundreds of billions [30].) For simplicity of presentation, the version of Krum we first consider selects only one vector. We also discuss other variants. We evaluate Krum experimentally, and compare it to classical averaging. We confirm the very fact that averaging does not stand Byzantine attacks, while Krum does. In particular, we report on attacks by omniscient adversaries – aware of a good estimate of the gradient – that send the opposite vector multiplied by a large factor, as well as attacks by adversaries that send random vectors drawn from a Gaussian distribution (the larger the variance of the distribution, the stronger the attack). We also 2In all this paper, distances are computed with the Euclidean norm. 3Krum, in Greek Κρούμος, was a Bulgarian Khan of the end of the eighth century, who undertook offensive attacks against the Byzantine empire. Bulgaria doubled in size during his reign. 2 evaluate the extent to which Krum might slow down learning (compared to averaging) when there are no Byzantine failures. Interestingly, as we show experimentally, this slow down occurs only when the mini-batch size is close to 1. In fact, the slowdown can be drastically reduced by choosing a reasonable mini-batch size. We also evaluate Multi-Krum, a variant of Krum, which, intuitively, interpolates between Krum and averaging, thereby allowing to mix the resilience properties of Krum with the convergence speed of averaging. Multi-Krum outperforms other aggregation rules like the medoid, inspired by the geometric median. Paper Organization. Section 2 recalls the classical model of distributed SGD. Section 3 proves that linear combinations (solutions used today) are not resilient even to a single Byzantine worker, then introduces our new concept of (α, f)-Byzantine resilience. Section 4 introduces our Krum function, computes its computational cost and proves its (α, f)-Byzantine resilience. Section 5 analyzes the convergence of a distributed SGD using Krum. Section 6 presents our experimental evaluation of Krum. We discuss related work and open problems in Section 7. Due to space limitations, some proofs and complementary experimental results are given as supplementary material. 2 Model We consider the general distributed system model of [1], consisting of a parameter server4, and n workers, f of them possibly Byzantine (behaving arbitrarily). Computation is divided into (infinitely many) synchronous rounds. During round t, the parameter server broadcasts its parameter vector xt ∈Rd to all the workers. Each correct worker p computes an estimate V t p = G(xt, ξt p) of the gradient ∇Q(xt) of the cost function Q, where ξt p is a random variable representing, e.g., the sample (or a mini-batch of samples) drawn from the dataset. A Byzantine worker b proposes a vector V t b which can deviate arbitrarily from the vector it is supposed to send if it was correct, i.e., according to the algorithm assigned to it by the system developer (see Figure 1). Figure 1: The gradient estimates computed by correct workers (black dashed arrows) are distributed around the actual gradient (solid arrow) of the cost function (thin black curve). A Byzantine worker can propose an arbitrary vector (red dotted arrow). Since the communication is synchronous, if the parameter server does not receive a vector value V t b from a given Byzantine worker b, then the parameter server acts as if it had received the default value V t b = 0 instead. The parameter server computes a vector F(V t 1 , . . . , V t n) by applying a deterministic function F (aggregation rule) to the vectors received. We refer to F as the aggregation rule of the parameter server. The parameter server updates the parameter vector using the following SGD equation xt+1 = xt −γt · F(V t 1 , . . . , V t n). The correct (non-Byzantine) workers are assumed to compute unbiased estimates of the gradient ∇Q(xt). More precisely, in every round t, the vectors V t i ’s proposed by the correct workers are independent identically distributed random vectors, V t i ∼G(xt, ξt i) with Eξt iG(xt, ξt i) = ∇Q(xt). This can be achieved by ensuring that each sample of data used for computing the gradient is drawn uniformly and independently, as classically assumed in the literature of machine learning [3]. The Byzantine workers have full knowledge of the system, including the aggregation rule F as well as the vectors proposed by the workers. They can furthermore collaborate with each other [21]. 3 Byzantine Resilience In most SGD-based learning algorithms used today [4, 13, 12], the aggregation rule consists in computing the average 5 of the input vectors. Lemma 1 below states that no linear combination of the vectors can tolerate a single Byzantine worker. In particular, averaging is not Byzantine resilient. 4The parameter server is assumed to be reliable. Classical techniques of state-machine replication can be used to ensure this. 5Or a closely related rule. 3 Lemma 1. Consider an aggregation rule Flin of the form Flin(V1, . . . , Vn) = Pn i=1 λi · Vi, where the λi’s are non-zero scalars. Let U be any vector in Rd. A single Byzantine worker can make F always select U. In particular, a single Byzantine worker can prevent convergence. Proof. Immediate: if the Byzantine worker proposes Vn = 1 λn · U −Pn−1 i=1 λi λn Vi, then F = U.6 In the following, we define basic requirements on an appropriate Byzantine-resilient aggregation rule. Intuitively, the aggregation rule should output a vector F that is not too far from the “real” gradient g, more precisely, the vector that points to the steepest direction of the cost function being optimized. This is expressed as a lower bound (condition (i)) on the scalar product of the (expected) vector F and g. Figure 2 illustrates the situation geometrically. If EF belongs to the ball centered at g with radius r, then the scalar product is bounded below by a term involving sin α = r/∥g∥. Condition (ii) is more technical, and states that the moments of F should be controlled by the moments of the (correct) gradient estimator G. The bounds on the moments of G are classically used to control the effects of the discrete nature of the SGD dynamics [3]. Condition (ii) allows to transfer this control to the aggregation rule. Definition 1 ((α, f)-Byzantine Resilience). Let 0 ≤α < π/2 be any angular value, and any integer 0 ≤f ≤n. Let V1, . . . , Vn be any independent identically distributed random vectors in Rd, Vi ∼G, with EG = g. Let B1, . . . , Bf be any random vectors in Rd, possibly dependent on the Vi’s. aggregation rule F is said to be (α, f)-Byzantine resilient if, for any 1 ≤j1 < · · · < jf ≤n, vector F = F(V1, . . . , B1 |{z} j1 , . . . , Bf |{z} jf , . . . , Vn) satisfies (i) ⟨EF, g⟩≥(1 −sin α) · ∥g∥2 > 0 and (ii) for r = 2, 3, 4, E ∥F∥r is bounded above by a linear combination of terms E ∥G∥r1 . . . E ∥G∥rn−1 with r1 + · · · + rn−1 = r. 4 The Krum Function r α g Figure 2: If ∥EF −g∥≤r then ⟨EF, g⟩is bounded below by (1 −sin α)∥g∥2 where sin α = r/∥g∥. We now introduce Krum, our aggregation rule, which, we show, satisfies the (α, f)Byzantine resilience condition. The barycentric aggregation rule Fbary = 1 n Pn i=1 Vi can be defined as the vector in Rd that minimizes the sum of squared distances 7 to the Vi’s Pn i=1 ∥Fbary −Vi∥2. Lemma 1, however, states that this approach does not tolerate even a single Byzantine failure. One could try to select the vector U among the Vi’s which minimizes the sum P i ∥U −Vi∥2, i.e., which is “closest to all vectors”. However, because such a sum involves all the vectors, even those which are very far, this approach does not tolerate Byzantine workers: by proposing large enough vectors, a Byzantine worker can force the total barycenter to get closer to the vector proposed by another Byzantine worker. Our approach to circumvent this issue is to preclude the vectors that are too far away. More precisely, we define our Krum aggregation rule KR(V1, . . . , Vn) as follows. For any i ̸= j, we denote by i →j the fact that Vj belongs to the n −f −2 closest vectors to Vi. Then, we define for each worker i, the score s(i) = P i→j ∥Vi −Vj∥2 where the sum runs over the n −f −2 closest vectors to Vi. Finally, KR(V1, . . . , Vn) = Vi∗where i∗refers to the worker minimizing the score, s(i∗) ≤s(i) for all i.8 Lemma 2. The expected time complexity of the Krum Function KR(V1, . . . , Vn), where V1, . . . , Vn are d-dimensional vectors, is O(n2 · d) 6Note that the parameter server could cancel the effects of the Byzantine behavior by setting, for example, λn to 0. This however requires means to detect which worker is Byzantine. 7Removing the square of the distances leads to the geometric median, we discuss this when optimizing Krum. 8If two or more workers have the minimal score, we choose the one with the smallest identifier. 4 Proof. For each Vi, the parameter server computes the n squared distances ∥Vi −Vj∥2 (time O(n·d)). Then the parameter server selects the first n −f −1 of these distances (expected time O(n) with Quickselect) and sums their values (time O(n · d)). Thus, computing the score of all the Vi’s takes O(n2 · d). An additional term O(n) is required to find the minimum score, but is negligible relatively to O(n2 · d). Proposition 1 below states that, if 2f + 2 < n and the gradient estimator is accurate enough, (its standard deviation is relatively small compared to the norm of the gradient), then the Krum function is (α, f)-Byzantine-resilient, where angle α depends on the ratio of the deviation over the gradient. Proposition 1. Let V1, . . . , Vn be any independent and identically distributed random d-dimensional vectors s.t Vi ∼G, with EG = g and E ∥G −g∥2 = dσ2. Let B1, . . . , Bf be any f random vectors, possibly dependent on the Vi’s. If 2f + 2 < n and η(n, f) √ d · σ < ∥g∥, where η(n, f) = def s 2  n −f + f · (n −f −2) + f 2 · (n −f −1) n −2f −2  =  O(n) if f = O(n) O(√n) if f = O(1) , then the Krum function KR is (α, f)-Byzantine resilient where 0 ≤α < π/2 is defined by sin α = η(n, f) · √ d · σ ∥g∥ . The condition on the norm of the gradient, η(n, f) · √ d · σ < ∥g∥, can be satisfied, to a certain extent, by having the (correct) workers compute their gradient estimates on mini-batches [3]. Indeed, averaging the gradient estimates over a mini-batch divides the deviation σ by the squared root of the size of the mini-batch. For the sake of concision, we only give here the sketch of the proof. (We give the detailed proof in the supplementary material.) Proof. (Sketch) Without loss of generality, we assume that the Byzantine vectors B1, . . . , Bf occupy the last f positions in the list of arguments of KR, i.e., KR = KR(V1, . . . , Vn−f, B1, . . . , Bf). Let i∗be the index of the vector chosen by the Krum function. We focus on the condition (i) of (α, f)-Byzantine resilience (Definition 1). Consider first the case where Vi∗= Vi ∈{V1, . . . , Vn−f} is a vector proposed by a correct process. The first step is to compare the vector Vi with the average of the correct vectors Vj such that i →j. Let δc(i) be the number of such Vj’s. E Vi − 1 δc(i) X i→correct j Vj 2 ≤ 1 δc(i) X i→correct j E ∥Vi −Vj∥2 ≤2dσ2. (1) The last inequality holds because the right-hand side of the first inequality involves only vectors proposed by correct processes, which are mutually independent and follow the distribution of G. Now, consider the case where Vi∗= Bk ∈{B1, . . . , Bf} is a vector proposed by a Byzantine process. The fact that k minimizes the score implies that for all indices i of vectors proposed by correct processes X k→correct j ∥Bk −Vj∥2 + X k→byz l ∥Bk −Bl∥2 ≤ X i→correct j ∥Vi −Vj∥2 + X i→byz l ∥Vi −Bl∥2 . Then, for all indices i of vectors proposed by correct processes Bk − 1 δc(k) X k→correct j Vj 2 ≤ 1 δc(k) X i→correct j ∥Vi −Vj∥2 + 1 δc(k) X i→byz l ∥Vi −Bl∥2 | {z } D2(i) . The term D2(i) is the only term involving vectors proposed by Byzantine processes. However, the correct process i has n −f −2 neighbors and f + 1 non-neighbors. Therefore, there exists a correct 5 process ζ(i) which is farther from i than every neighbor j of i (including the Byzantine neighbors). In particular, for all l such that i →l, ∥Vi −Bl∥2 ≤∥Vi −Vζ(i)∥2. Thus Bk − 1 δc(k) X k→correct j Vj 2 ≤ 1 δc(k) X i→correct j ∥Vi −Vj∥2 + n −f −2 −δc(i) δc(k) Vi −Vζ(i) 2 . (2) Combining equations 1, 2, and a union bound yields ∥EKR −g∥2 ≤η √ d∥g∥, which, in turn, implies ⟨EKR, g⟩≥(1−sin α)∥g∥2. Condition (ii) is proven by bounding the moments of KR with moments of the vectors proposed by the correct processes only, using the same technique as above. The full proof is provided in the supplementary material. 5 Convergence Analysis In this section, we analyze the convergence of the SGD using our Krum function defined in Section 4. The SGD equation is expressed as follows xt+1 = xt −γt · KR(V t 1 , . . . , V t n) where at least n −f vectors among the V t i ’s are correct, while the other ones may be Byzantine. For a correct index i, V t i = G(xt, ξt i) where G is the gradient estimator. We define the local standard deviation σ(x) by d · σ2(x) = E ∥G(x, ξ) −∇Q(x)∥2 . The following proposition considers an (a priori) non-convex cost function. In the context of nonconvex optimization, even in the centralized case, it is generally hopeless to aim at proving that the parameter vector xt tends to a local minimum. Many criteria may be used instead. We follow [3], and we prove that the parameter vector xt almost surely reaches a “flat” region (where the norm of the gradient is small), in a sense explained below. Proposition 2. We assume that (i) the cost function Q is three times differentiable with continuous derivatives, and is non-negative, Q(x) ≥0; (ii) the learning rates satisfy P t γt = ∞and P t γ2 t < ∞; (iii) the gradient estimator satisfies EG(x, ξ) = ∇Q(x) and ∀r ∈{2, . . . , 4}, E∥G(x, ξ)∥r ≤ Ar +Br∥x∥r for some constants Ar, Br; (iv) there exists a constant 0 ≤α < π/2 such that for all x η(n, f) · √ d · σ(x) ≤∥∇Q(x)∥· sin α; (v) finally, beyond a certain horizon, ∥x∥2 ≥D, there exist ϵ > 0 and 0 ≤β < π/2 −α such that ∥∇Q(x)∥≥ϵ > 0 and ⟨x,∇Q(x)⟩ ∥x∥·∥∇Q(x)∥≥cos β. Then the sequence of gradients ∇Q(xt) converges almost surely to zero. η √ dσ α β ∇Q(xt) xt Figure 3: Condition on the angles between xt, ∇Q(xt) and EKRt, in the region ∥xt∥2 > D. Conditions (i) to (iv) are the same conditions as in the non-convex convergence analysis in [3]. Condition (v) is a slightly stronger condition than the corresponding one in [3], and states that, beyond a certain horizon, the cost function Q is “convex enough”, in the sense that the direction of the gradient is sufficiently close to the direction of the parameter vector x. Condition (iv), however, states that the gradient estimator used by the correct workers has to be accurate enough, i.e., the local standard deviation should be small relatively to the norm of the gradient. Of course, the norm of the gradient tends to zero near, e.g., extremal and saddle points. Actually, the ratio η(n, f) · √ d · σ/ ∥∇Q∥controls the maximum angle between the gradient ∇Q and the vector chosen by the Krum function. In the regions where ∥∇Q∥< η(n, f) · √ d · σ, the Byzantine workers may take advantage of the noise (measured by σ) in the gradient estimator G to bias the choice of the parameter server. Therefore, Proposition 2 is to be interpreted as follows: in the presence of Byzantine workers, the parameter vector xt almost surely reaches a basin around points where the gradient is small (∥∇Q∥≤η(n, f) · √ d · σ), i.e., points where the cost landscape is “almost flat”. Note that the convergence analysis is based only on the fact that function KR is (α, f)-Byzantine resilient. The complete proof of Proposition 2 is deferred to the supplementary material. 6 0 0.2 0.4 0.6 0.8 1 0 100 200 300 400 500 error round 0% byzantine average krum 0 0.2 0.4 0.6 0.8 1 0 100 200 300 400 500 error round 33% byzantine average krum Figure 4: Cross-validation error evolution with rounds, respectively in the absence and in the presence of 33% Byzantine workers. The mini-batch size is 3. With 0% Gaussian Byzantine workers, averaging converges faster than Krum. With 33% Gaussian Byzantine workers, averaging does not converge, whereas Krum behaves as if there were 0% Byzantine workers. 6 Experimental Evaluation We report here on the evaluation of the convergence and resilience properties of Krum, as well as an optimized variant of it. (We also discuss other variants of Krum in the supplementary material.) (Resilience to Byzantine processes). We consider the task of spam filtering (dataset spambase [19]). The learning model is a multi-layer perceptron (MLP) with two hidden layers. There are n = 20 worker processes. Byzantine processes propose vectors drawn from a Gaussian distribution with mean zero, and isotropic covariance matrix with standard deviation 200. We refer to this behavior as Gaussian Byzantine. Each (correct) worker estimates the gradient on a mini-batch of size 3. We measure the error using cross-validation. Figure 4 shows how the error (y-axis) evolves with the number of rounds (x-axis). In the first plot (left), there are no Byzantine workers. Unsurprisingly, averaging converges faster than Krum. In the second plot (right), 33% of the workers are Gaussian Byzantine. In this case, averaging does not converge at all, whereas Krum behaves as if there were no Byzantine workers. This experiment confirms that averaging does not tolerate (the rather mild) Gaussian Byzantine behavior, whereas Krum does. (The Cost of Resilience). As seen above, Krum slows down learning when there are no Byzantine workers. The following experiment shows that this overhead can be significantly reduced by slightly increasing the mini-batch size. To highlight the effect of the presence of Byzantine workers, the Byzantine behavior has been set as follows: each Byzantine worker computes an estimate of the gradient over the whole dataset (yielding a very accurate estimate of the gradient), and proposes the opposite vector, scaled to a large length. We refer to this behavior as omniscient. Figure 5 displays how the error value at the 500-th round (y-axis) evolves when the mini-batch size varies (x-axis). In this experiment, we consider the tasks of spam filtering (dataset spambase) and image classification (dataset MNIST). The MLP model is used in both cases. Each curve is obtained with either 0 or 45% of omniscient Byzantine workers. In all cases, averaging still does not tolerate Byzantine workers, but yields the lowest error when there are no Byzantine workers. However, once the size of the mini-batch reaches the value 20, Krum with 45% omniscient Byzantine workers is as accurate as averaging with 0% Byzantine workers. We observe a similar pattern for a ConvNet as provided in the supplementary material. (Multi-Krum). For the sake of presentation simplicity, we considered a version of Krum which selects only one vector among the vector proposed by the workers. We also propose a variant of Krum, we call Multi-Krum. Multi-Krum computes, for each vector proposed, the score as in the Krum function. Then, Multi-Krum selects the m ∈{1, . . . , n} vectors V ∗ 1 , . . . , V ∗ m which score the best, and outputs their average 1 m P i V ∗ i . Note that, the cases m = 1 and m = n correspond to Krum and averaging respectively. Figure 6 shows how the error (y-axis) evolves with the number of rounds (x-axis). In the figure, we consider the task of spam filtering (dataset spambase), and the MLP model (the same comparison 7 0 0.2 0.4 0.6 0.8 1 40 80 120 error at round 500 batch size spambase average (0% byz) krum (0% byz) average (45% byz) krum (45% byz) 0 0.2 0.4 0.6 0.8 1 40 80 120 160 error at round 500 batch size mnist 0 0.1 0.2 0.3 0.4 0.5 10 20 30 40 error at round 500 batch size spambase average (0% byz) krum (0% byz) krum (45% byz) 0 0.1 0.2 0.3 0.4 0.5 10 20 30 40 error at round 500 batch size mnist Figure 5: Cross-validation error at round 500 when increasing the mini-batch size. The two figures on the rights are zoomed versions of the two on the left). With a reasonably large mini-batch size (arround 10 for MNIST and 30 for Spambase), Krum with 45% omniscient Byzantine workers is as accurate as averaging with 0% Byzantine workers. 0 0.2 0.4 0.6 0.8 1 0 40 80 120 160 200 240 280 320 360 400 440 480 error round multi-krum average (0% byz) krum (33% byz) multi-krum (33% byz) Figure 6: Cross-validation error evolution with rounds. The mini-batch size is 3. Multi-Krum with 33% Gaussian Byzantine workers converges as fast as averaging with 0% Byzantine workers. is done for the task of image classification with a ConvNet and is provided in the supplementary material). The Multi-Krum parameter m is set to m = n −f. Figure 6 shows that Multi-Krum with 33% Byzantine workers is as efficient as averaging with 0% Byzantine workers. From the practitionner’s perspective, the parameter m may be used to set a specific trade-off between convergence speed and resilience to Byzantine workers. 7 Concluding Remarks (The Distributed Computing Perspective). Although seemingly related, results in d-dimensional approximate agreement [24, 14] cannot be applied to our Byzantine-resilient machine context for the following reasons: (a) [24, 14] assume that the set of vectors that can be proposed to an instance of the agreement is bounded so that at least f + 1 correct workers propose the same vector, which would require a lot of redundant work in our setting; and more importantly, (b) [24] requires a local computation by each worker that is in O(nd). While this cost seems reasonable for small dimensions, such as, e.g., mobile robots meeting in a 2D or 3D space, it becomes a real issue in the context of machine learning, where d may be as high as 160 billion [30] (making d a crucial parameter when considering complexities, either for local computations, or for communication rounds). The expected time complexity of the Krum function is O(n2 · d). A closer approach to ours has been recently proposed in [28, 29]. In [28], the study only deals with parameter vectors of dimension one, which is too restrictive for today’s multi-dimensional machine learning. In [29], the authors tackle a multi-dimensional situation, using an iterated approximate Byzantine agreement that reaches consensus asymptotically. This is however only achieved on a finite set of possible environmental states and cannot be used in the continuous context of stochastic gradient descent. (The Statistics and Machine Learning View). Our work looks at the resilience of the aggregation rule using ideas that are close to those of [11], and somehow classical in theoretical statistics on the robustness of the geometric median and the notion of breakdown [7]. The closest concept to a breakdown in our work is the maximum fraction of Byzantine workers that can be tolerated, i.e. n−2 2n , which reaches the optimal theoretical value (1/2) asymptotically on n. It is known that the geometric 8 median does achieve the optimal breakdown. However, no closed form nor an exact algorithm to compute the geometric median is known (only approximations are available [5] and their Byzantine resilience is an open problem.). An easily computable variant of the median is the Medoid, which is the proposed vector minimizing the sum of distances to all other proposed vectors. The Medoid can be computed with a similar algorithm to Krum. We show however in the supplementary material that the implementation of the Medoid is outperformed by multi-Krum. (Robustness Within the Model). It is important to keep in mind that this work deals with robustness from a coarse-grained perspective: the unit of failure is a worker, receiving its copy of the model and estimating gradients, based on either local data or delegated data from a server. The nature of the model itself is not important, the distributed system can be training models spanning a large range from simple regression to deep neural networks. As long as this training is using gradient-based learning, our algorithm to aggregate gradients, Krum, provably ensures convergence when a simple majority of nodes are not compromised by an attacker. A natural question to consider is the fine-grained view: is the model itself robust to internal perturbations? In the case of neural networks, this question can somehow be tied to neuroscience considerations: could some neurons and/or synapses misbehave individually without harming the global outcome? We formulated this question in another work and proved a tight upper bound on the resulting global error when a set of nodes is removed or is misbehaving [8]. One of the many practical consequences [9] of such fine-grained view is the understanding of memory cost reduction trade-offs in deep learning. Such memory cost reduction can be viewed as the introduction of precision errors at the level of each neuron and/or synapse [8]. Other approaches to robustness within the model tackled adversarial situations in machine learning with a focus on adversarial examples (during inference) [10, 32, 11] instead of adversarial gradients (during training) as we did for Krum. Robustness to adversarial input can be viewed through the fine-grained lens we introduced in [8], for instance, one can see perturbations of pixels in the inputs as perturbations of neurons in layer zero. It is important to note the orthogonality and complementarity between the fine-grained (model/input units) and the coarse-grained (gradient aggregation) approaches. Being robust, as a model, either to adversarial examples or to internal perturbations, does not necessarily imply robustness to adversarial gradients during training. Similarly, being distributively trained with a robust aggregation scheme such as Krum does not necessarily imply robustness to internal errors of the model or adversarial input perturbations that would occur later during inference. For instance, the theory we develop in the present work is agnostic to the model being trained or the technology of the hardware hosting it, as long as there are gradients to be aggregated. Acknowledgment. The authors would like to thank Georgios Damaskinos and Rhicheek Patra from the Distributed Computing group at EPFL for kindly providing their distributed machine learning framework, on top of which we could test our algorithm, Krum, and its variants described in this work. Further implementation details and additional experiments will be posted in the lab’s Github repository [20]. The authors would also like to thank Saad Benjelloun, Lê Nguyen Hoang and Sébastien Rouault for fruitful comments. This work has been supported in part by the European ERC (Grant 339539 - AOC) and by the Swiss National Science Foundation (Grant 200021_ 169588 TARBDA). A preliminary version of this work appeared as a brief announcement during the 36st ACM Symposium on Principles of Distributed Computing [2]. 9 References [1] M. Abadi, P. Barham, J. Chen, Z. Chen, A. Davis, J. Dean, M. Devin, S. Ghemawat, G. Irving, M. Isard, et al. Tensorflow: A system for large-scale machine learning. In Proceedings of the 12th USENIX Symposium on Operating Systems Design and Implementation (OSDI). Savannah, Georgia, USA, 2016. [2] P. Blanchard, E. M. El Mhamdi, R. Guerraoui, and J. Stainer. Brief announcement: Byzantinetolerant machine learning. In Proceedings of the ACM Symposium on Principles of Distributed Computing, PODC ’17, pages 455–457, New York, NY, USA, 2017. ACM. [3] L. Bottou. Online learning and stochastic approximations. Online learning in neural networks, 17(9):142, 1998. [4] L. Bottou. Large-scale machine learning with stochastic gradient descent. In Proceedings of COMPSTAT’2010, pages 177–186. Springer, 2010. [5] M. B. Cohen, Y. T. Lee, G. Miller, J. Pachocki, and A. Sidford. Geometric median in nearly linear time. In Proceedings of the 48th Annual ACM SIGACT Symposium on Theory of Computing, pages 9–21. ACM, 2016. [6] J. Dean, G. Corrado, R. Monga, K. Chen, M. Devin, M. Mao, A. Senior, P. Tucker, K. Yang, Q. V. Le, et al. Large scale distributed deep networks. In Advances in neural information processing systems, pages 1223–1231, 2012. [7] D. L. Donoho and P. J. Huber. The notion of breakdown point. A festschrift for Erich L. Lehmann, 157184, 1983. [8] E. M. El Mhamdi and R. Guerraoui. When neurons fail. In 2017 IEEE International Parallel and Distributed Processing Symposium (IPDPS), pages 1028–1037, May 2017. [9] E. M. El Mhamdi, R. Guerraoui, and S. Rouault. On the robustness of a neural network. In 2017 IEEE 36th Symposium on Reliable Distributed Systems (SRDS), pages 84–93, Sept 2017. [10] A. Fawzi, S.-M. Moosavi-Dezfooli, and P. Frossard. Robustness of classifiers: from adversarial to random noise. In Advances in Neural Information Processing Systems, pages 1624–1632, 2016. [11] J. Feng, H. Xu, and S. Mannor. Outlier robust online learning. arXiv preprint arXiv:1701.00251, 2017. [12] R. Gemulla, E. Nijkamp, P. J. Haas, and Y. Sismanis. Large-scale matrix factorization with distributed stochastic gradient descent. In Proceedings of the 17th ACM SIGKDD international conference on Knowledge discovery and data mining, pages 69–77. ACM, 2011. [13] S. S. Haykin. Neural networks and learning machines, volume 3. Pearson Upper Saddle River, NJ, USA:, 2009. [14] M. Herlihy, S. Rajsbaum, M. Raynal, and J. Stainer. Computing in the presence of concurrent solo executions. In Latin American Symposium on Theoretical Informatics, pages 214–225. Springer, 2014. [15] J. Koneˇcn`y, B. McMahan, and D. Ramage. Federated optimization: Distributed optimization beyond the datacenter. arXiv preprint arXiv:1511.03575, 2015. [16] J. Koneˇcn`y, H. B. McMahan, F. X. Yu, P. Richtárik, A. T. Suresh, and D. Bacon. Federated learning: Strategies for improving communication efficiency. arXiv preprint arXiv:1610.05492, 2016. [17] L. Lamport, R. Shostak, and M. Pease. The byzantine generals problem. ACM Transactions on Programming Languages and Systems (TOPLAS), 4(3):382–401, 1982. [18] X. Lian, Y. Huang, Y. Li, and J. Liu. Asynchronous parallel stochastic gradient for nonconvex optimization. In Advances in Neural Information Processing Systems, pages 2737–2745, 2015. 10 [19] M. Lichman. UCI machine learning repository, 2013. [20] LPD-EPFL. The implementation is part of a larger distributed framework to run sgd in a reliable distributed fashion and will be released in the github repository of the distributed computing group at epfl, https://github.com/lpd-epfl. [21] N. A. Lynch. Distributed algorithms. Morgan Kaufmann, 1996. [22] J. Markoff. How many computers to identify a cat? 16,000. New York Times, pages 06–25, 2012. [23] B. McMahan, E. Moore, D. Ramage, S. Hampson, and B. A. y Arcas. Communication-efficient learning of deep networks from decentralized data. In Artificial Intelligence and Statistics, pages 1273–1282, 2017. [24] H. Mendes and M. Herlihy. Multidimensional approximate agreement in byzantine asynchronous systems. In Proceedings of the forty-fifth annual ACM symposium on Theory of computing, pages 391–400. ACM, 2013. [25] B. T. Polyak and A. B. Juditsky. Acceleration of stochastic approximation by averaging. SIAM Journal on Control and Optimization, 30(4):838–855, 1992. [26] F. B. Schneider. Implementing fault-tolerant services using the state machine approach: A tutorial. ACM Computing Surveys (CSUR), 22(4):299–319, 1990. [27] R. K. Srivastava, K. Greff, and J. Schmidhuber. Training very deep networks. In Advances in neural information processing systems, pages 2377–2385, 2015. [28] L. Su and N. H. Vaidya. Fault-tolerant multi-agent optimization: optimal iterative distributed algorithms. In Proceedings of the 2016 ACM Symposium on Principles of Distributed Computing, pages 425–434. ACM, 2016. [29] L. Su and N. H. Vaidya. Non-bayesian learning in the presence of byzantine agents. In International Symposium on Distributed Computing, pages 414–427. Springer, 2016. [30] A. Trask, D. Gilmore, and M. Russell. Modeling order in neural word embeddings at scale. In ICML, pages 2266–2275, 2015. [31] J. Tsitsiklis, D. Bertsekas, and M. Athans. Distributed asynchronous deterministic and stochastic gradient optimization algorithms. IEEE transactions on automatic control, 31(9):803–812, 1986. [32] B. Wang, J. Gao, and Y. Qi. A theoretical framework for robustness of (deep) classifiers under adversarial noise. arXiv preprint arXiv:1612.00334, 2016. [33] S. Zhang, A. E. Choromanska, and Y. LeCun. Deep learning with elastic averaging sgd. In Advances in Neural Information Processing Systems, pages 685–693, 2015. [34] T. Zhang. Solving large scale linear prediction problems using stochastic gradient descent algorithms. In Proceedings of the twenty-first international conference on Machine learning, page 116. ACM, 2004. 11
2017
646
7,170
Protein Interface Prediction using Graph Convolutional Networks Alex Fout† Department of Computer Science Colorado State University Fort Collins, CO 80525 fout@colostate.edu Jonathon Byrd† Department of Computer Science Colorado State University Fort Collins, CO 80525 jonbyrd@colostate.edu Basir Shariat† Department of Computer Science Colorado State University Fort Collins, CO 80525 basir@cs.colostate.edu Asa Ben-Hur Department of Computer Science Colorado State University Fort Collins, CO 80525 asa@cs.colostate.edu Abstract We consider the prediction of interfaces between proteins, a challenging problem with important applications in drug discovery and design, and examine the performance of existing and newly proposed spatial graph convolution operators for this task. By performing convolution over a local neighborhood of a node of interest, we are able to stack multiple layers of convolution and learn effective latent representations that integrate information across the graph that represent the three dimensional structure of a protein of interest. An architecture that combines the learned features across pairs of proteins is then used to classify pairs of amino acid residues as part of an interface or not. In our experiments, several graph convolution operators yielded accuracy that is better than the state-of-the-art SVM method in this task. 1 Introduction In many machine learning tasks we are faced with structured objects that can naturally be modeled as graphs. Examples include the analysis of social networks, molecular structures, knowledge graphs, and computer graphics to name a few. The remarkable success of deep neural networks in a wide range of challenging machine learning tasks from computer vision [14, 15] and speech recognition [12] to machine translation [24] and computational biology [4], has resulted in a resurgence of interest in this area. This success has also led to the more recent interest in generalizing the standard notion of convolution over a regular grid representing a sequence or an image, to convolution over graph structures, making these techniques applicable to the wide range of prediction problems that can be modeled in this way [8]. In this work we propose a graph convolution approach that allows us to tackle the challenging problem of predicting protein interfaces. Proteins are chains of amino acid residues that fold into a three dimensional structure that gives them their biochemical function. Proteins perform their function through a complex network of interactions with other proteins. The prediction of those interactions, and the interfaces through which they occur, are important and challenging problems that have attracted much attention [10]. This paper focuses on predicting protein interfaces. Despite †denotes equal contribution 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. the plethora of available methods for interface prediction, it has been recently noted that "The field in its current state appears to be saturated. This calls for new methodologies or sources of information to be exploited" [10]. Most machine learning methods for interface prediction use hand-crafted features that come from the domain expert’s insight on quantities that are likely to be useful and use standard machine learning approaches. Commonly used features for this task include surface accessibility, sequence conservation, residue properties such as hydrophobicity and charge, and various shape descriptors (see Aumentado et al. [6] for a review of the most commonly used features for this task). The task of object recognition in images has similarities to interface prediction: Images are represented as feature values on a 2D grid, whereas the the solved crystal structure of a protein can be thought of as a collection of features on an irregular 3D grid corresponding to the coordinates of its atoms. In both cases, we are trying to recognize an object within a larger context. This suggests that approaches that have proven successful in image classification can be adapted to work for protein structures, and has motivated us to explore the generalization of the convolution operator to graph data. In fact, several techniques from computer vision have found their way into the analysis of protein structures, especially methods for locally describing the shape of an object, and various spectral representations of shape (see e.g. [18, 17]). In this work we evaluate multiple existing and proposed graph convolution operators and propose an architecture for the task of predicting interfaces between pairs of proteins using a graph representation of the underlying protein structure. Our results demonstrate that this approach provides state-of-theart accuracy, outperforming a recent SVM-based approach [2]. The proposed convolution operators are not specific to interface prediction. They are applicable to graphs with arbitrary size and structure, do not require imposing an ordering on the nodes, allow for representing both node and edge features, and maintain the original graph structure, allowing multiple convolution operations without the need to downsample the graph. Therefore we expect it to be applicable to a variety of other learning problems on graphs. 2 Methods for Graph Convolution In this work we consider learning problems over a collection of graphs where prediction occurs at the node level. Nodes and edges have features that are associated with them, and we denote by xi the feature vector associated with node i and Aij the feature vector associated with the edge between nodes i and j, where for simplicity we have omitted indexing over graphs. We describe a framework that allows us to learn a representation of a local neighborhood around each node in a graph. In the domains of image, audio, or text data, convolutional networks learn local features by assigning an ordering to pixels, amplitudes, or words based on the structure inherent to the domain, and associating a weight vector/matrix with each position within a receptive field. The standard notion of convolution over a sequence (1D convolution) or an image (2D convolution) relies on having a regular grid with a well-defined neighborhood at each position in the grid, where each neighbor has a well-defined relationship to its neighbors, e.g. "above", "below", "to the left", "to the right" in the case of a 2D grid. On a graph structure there is usually no natural choice for an ordering of the neighbors of a node. Our objective is to design convolution operators that can be applied to graphs without a regular structure, and without imposing a particular order on the neighbors of a given node. To summarize, we would like to learn a mapping at each node in the graph which has the form: zi = σW (xi, {xn1, . . . , xnk}), where {n1, . . . , nk} are the neighbors of node i that define the receptive field of the convolution, σ is a non-linear activation function, and W are its learned parameters; the dependence on the neighboring nodes as a set represents our intention to learn a function that is order-independent. We present the following two realizations of this operator that provides the output of a set of filters in a neighborhood of a node of interest that we refer to as the "center node": zi = σ  W Cxi + 1 |Ni| X j∈Ni W Nxj + b  , (1) where Ni is the set of neighbors of node i, W C is the weight matrix associated with the center node, W N is the weight matrix associated with neighboring nodes, and b is a vector of biases, one for each filter. The dimensionality of the weight matrices is determined by the dimensionality of the inputs and the number of filters. The computational complexity of this operator on a graph with n nodes, a 2 Node Residue Conservation / Composition Accessible Surface Area Residue Depth Protrusion Index Edge Distance Angle receptive field neighbor residue of interest protein convolution Figure 1: Graph convolution on protein structures. Left: Each residue in a protein is a node in a graph where the neighborhood of a node is the set of neighboring nodes in the protein structure; each node has features computed from its amino acid sequence and structure, and edges have features describing the relative distance and angle between residues. Right: Schematic description of the convolution operator which has as its receptive field a set of neighboring residues, and produces an activation which is associated with the center residue. neighborhood of size k, Fin input features and Fout output features is O(kFinFoutn). Construction of the neighborhood is straightforward using a preprocessing step that takes O(n2 log n). In order to provide for some differentiation between neighbors, we incorporate features on the edges between each neighbor and the center node as follows: zi = σ  W Cxi + 1 |Ni| X j∈Ni W Nxj + 1 |Ni| X j∈Ni W EAij + b  , (2) where W E is the weight matrix associated with edge features. For comparison with order-independent methods we propose an order-dependent method, where order is determined by distance from the center node. In this method each neighbor has unique weight matrices for nodes and edges: zi = σ  W Cxi + 1 |Ni| X j∈Ni W N j xj + 1 |Ni| X j∈Ni W E j Aij + b  . (3) Here W N j /W E j are the weight matrices associated with the jth node or the edges connecting to the jth nodes, respectively. This operator is inspired by the PATCHY-SAN method of Niepert et al. [16]. It is more flexible than the order-independent convolutional operators, allowing the learning of distinctions between neighbors at the cost of significantly more parameters. Multiple layers of these graph convolution operators can be used, and this will have the effect of learning features that characterize the graph at increasing levels of abstraction, and will also allow information to propagate through the graph, thereby integrating information across regions of increasing size. Furthermore, these operators are rotation-invariant if the features have this property. In convolutional networks, inputs are often downsampled based on the size and stride of the receptive field. It is also common to use pooling to further reduce the size of the input. Our graph operators on the other hand maintain the structure of the graph, which is necessary for the protein interface prediction problem, where we classify pairs of nodes from different graphs, rather than entire graphs. Using convolutional architectures that use only convolutional layers without downsampling is common practice in the area of graph convolutional networks, especially if classification is performed at the node or edge level. This practice has support from the success of networks without pooling layers in the realm of object recognition [23]. The downside of not downsampling is higher memory and computational costs. Related work. Several authors have recently proposed graph convolutional operators that generalize the notion of convolution over a regular grid. Spectral graph theory forms the basis for several of 3 these methods [8], in which convolutional filters are viewed as linear operators on the eigenvectors of the graph Laplacian (or an approximation thereof [13]). Our protein dataset consists of multiple graphs with no natural correspondence to each other, making it difficult to apply methods based on the graph Laplacian. In what follows we describe several existing spatial graph convolutional methods, remarking on the aspects which resemble or helped inspire our implementation. In their Molecular Fingerprint Networks (MFNs), Duvenaud et al. [9] proposed a spatial graph convolution approach similar to Equation (1), except that they use a single weight matrix for all nodes in a receptive field and sum the results, whereas we distinguish between the center node and the neighboring nodes, and we average over neighbors rather than sum over them. Furthermore, their graphs do not contain edge features, so their convolution operator does not make use of them. MFNs were designed to generate a feature representation of an entire molecule. In contrast, our node level prediction task motivates distinguishing between the center node, whose representation is being computed, and neighboring nodes, which provide information about the local environment of the node. Averaging is important in our problem to allow for any size of neighborhood. Schlichtkrull et al. [19] describe Relational Graph Convolutional Networks (RGCNs), which consider graphs with a large number of binary edge types, where a unique neighborhood is defined by each edge type. To reduce the total number of model parameters, they employ basis matrices or block diagonal constraints to introduce shared parameters between the representations of different edge/neighborhood types. That aspect of the method is not relevant to our problem, and without it, Equation (1) closely resembles their convolution operator. Schütt et al.[21] define Deep Tensor Neural Networks (DTNNs) for predicting molecular energies. This version of graph convolution uses the node and edge information from neighbors to produce an additive update to the center node: zi = xi + 1 |Ni| X j∈Ni σ  W  (W Nxj + bN) ⊙(W EAij + bE)  , (4) where ⊙denotes the elementwise product, W, W N, and W E are weights matrices, and bN and bE are bias vectors. Edge information is incorporated similarly to Equation (2), with the difference in how the edge and node signals are combined—their choice being elementwise product rather than sum. Another difference is that DTNN convolution forces the output of a layer to have the same dimensionality as its input; our approach does not require that, allowing the networks to have varying numbers of filters across convolutional layers. Rather than operate on fixed neighborhoods, Atwood and Towsley [5] take a different spatial convolution approach in their Diffusion-Convolutional Neural Networks (DCNNs), and apply multiple steps (or "hops") of a diffusion operator that propagates the value of an individual feature across the graph. A node after k hops will contain information from all nodes that have walks of length k ending at that node. If X is a data matrix where each row corresponds to a node, and each column to a different feature, then the representation of X after a k hop convolution is: Zk = σ(wkP kX), (5) where wk is the k-hop vector of weights, and P k is the transition matrix raised to power k. Rather than stack multiple convolution layers, the authors apply the diffusion operator using multiple hop numbers. In our work we use this method with an adjacency matrix whose entries are an exponentially decreasing function of the distance between nodes. Proteins as graphs. In this work we represent a protein as a graph where each amino acid residue is a node whose features represent the properties of the residue; the spatial relationships between residues (distances, angles) are represented as features of the edges that connect them (see Figure 1). The neighborhood of a node used in the convolution operator is the set of k closest residues as determined by the mean distance between their atoms. Before going into the details of the node and edge features we describe the neural network architecture. Pairwise classification architecture. In the protein interface prediction problem, examples are composed of pairs of residues, one from a ligand protein and one from a receptor protein, i.e., our task is to classify pairs of nodes from two separate graphs representing those proteins. More formally, our data are a set of N labeled pairs {((li, ri), yi)}N i=1, where li is a residue (node) in the ligand, ri 4 Merge FullyConnected Graph Convolution Classification Ligand Protein Graph Receptor Protein Graph Graph Convolution Graph Convolution Graph Convolution Residue Representation Residue Pair Representation R1 R2 R3 R1 R2 R3 R1 R2 R3 R1 R2 R3 R1 R2 R3 R1 R1 R1 R2 R2 R2 R3 R3 R3 Figure 2: An overview of the pairwise classification architecture. Each neighborhood of a residue in the two proteins is processed using one or more graph convolution layers, with weight sharing between legs of the network. The activations generated by the convolutional layers are merged by concatenating them, followed by one or more regular dense layers. Data Partition Complexes Positive examples Negative examples Train 140 12,866 (9.1%) 128,660 (90.9%) Validation 35 3,138 (0.2%) 1,874,322 (99.8%) Test 55 4,871 (0.1%) 4,953,446 (99.9%) Table 1: Number of complexes and examples in the Docking Benchmark Dataset. Positive examples are residue pairs that participate in the interface, negative examples are pairs that do not. For training we downsample the negative examples for an overall ratio of 10:1 of negative to positive examples; in validation and testing all the negative examples are used. is a residue (node) in the receptor protein, and yi ∈{−1, 1} is the associated label that indicates if the two residues are interacting or not. The role of ligand/receptor is arbitrary, so we would like to learn a scoring function that is independent of the order in which the two residues are presented to the network. In the context of SVM-based methods this can be addressed using pairwise kernels, building the invariance into the representation (see e.g. [2]). To create an order-invariant model in a setting which requires an explicit feature representation. We considered two approaches. One is to construct explicit features that are order invariant by taking the sum and element-wise products of the two feature vectors. Note that pairwise kernels implicitly use all products of features, which we avoid by taking the element wise product. Another approach is to present each example to the model in both possible orders, (li, ri) and (ri, li), and average the two predictions; the feature representation of an example is the concatenation of the features of the two residues [3]. In preliminary experiments both approaches yielded similar results, and our reported results use the latter. Our network architecture is composed of two identical "legs" which learn feature representations of the ligand and receptor proteins of a complex by applying multiple layers of graph convolution to each. The weights between the two legs are shared. We then merge the legs by concatenating residue representations together to create the representation of residue pairs. The resulting features are then passed through one or more fully-connected layers before classification (see Figure 2). 3 Experiments Data. In our experiments we used the data from Version 5 of the Docking Benchmark Dataset, which is the standard benchmark dataset for assessing docking and interface prediction methods [25]. These complexes are a carefully selected subset of structures from the Protein Data Bank (PDB). The structures are generated from x-ray crystallography or nuclear magnetic resonance experiments and contain the atomic coordinates of each amino acid residue in the protein. These proteins range in length from 29 to 1979 residues with a median of 203.5. For each complex, DBD includes both bound and unbound forms of each protein in the complex. Our features are computed from the unbound form since proteins can alter their shape upon binding, and the labels are derived from the structure of the proteins in complex. As in previous work [2], two residues from different proteins are considered part of the interface if any non-Hydrogen atom in one is within 6Å of any non-Hydrogen atom in the other when in complex. 5 For our test set we used the 55 complexes that were added since version 4.0 of DBD, and separated the complexes in DBD 4.0 into training and validation sets. In dividing the complexes into training and validation we stratified them by difficulty and type using the information provided in DBD. Because in any given complex there are vastly more residue pairs that don’t interact than those that do, we downsampled the negative examples in the training set to obtain a 10:1 ratio of negative and positive examples. Final models used for testing were trained using the training and validation data, with the 10:1 ratio of positive to negative examples. Dataset sizes are shown in Table 1. Node and edge features. Each node and edge in the graph representing a protein has features associated with it that are computed from the protein’s sequence and structure. For the node features we used the same features used in earlier work [2], as summarized next. Protein sequence alone can be a good indicator of the propensity of a residue to form an interface, because each amino acid exhibits unique electrochemical and geometric properties. Furthermore, the level of conservation of a residue in alignments against similar proteins also provides valuable information, since surface residues that participate in an interface tend to be more conserved than surface residues that do not. The identity and conservation of a residue are quantified by 20 features that capture the relative frequency of each of the 20 amino acids in alignments to similar proteins. Earlier methods used these features by considering a window of size 11 in sequence centered around the residue of interest and concatenating their features [2]. Since we are explicitly representing the structure of a protein, each node contains only the sequence features of the corresponding residue. In addition to these sequence-based features, each node contains several features computed from the structure. These include a residue’s surface accessibility, a measure of its protrusion, its distance from the surface, and the counts of amino acids within 8Å in two directions—towards the residue’s side chain, and in the opposite direction. The primary edge feature is based on the distance between two residues, calculated as the average distance between their atoms. The feature is a Radial Basis Function (RBF) of this distance with a standard deviation of 18Å (chosen on the validation set). To incorporate information regarding the relative orientation of two residues, we calculate the angle between the normal vectors of the amide plane of each residue. Note that DCNNs use residue distances to inform the diffusion process. For this we used an RBF kernel over the distance, with a standard deviation optimized as part of the model selection procedure. All node and edge features were normalized to be between 0 and 1, except the residue conservation features, which were standardized. Training, validation, and testing. The validation set was used to perform an extensive search over the space of possible feature representations and model hyperparameters, to select the edge distance feature RBF kernel standard deviation (2 to 32), negative to positive example ratio (1:1 to 20:1), number of convolutional layers (1 to 6), number of filters (8 to 2000), neighborhood size (2 to 26), pairwise residue representation (elementwise sum/product vs concatenation), number of dense layers after merging (0 to 4), optimization algorithm (stochastic gradient descent, RMSProp, ADAM, Momentum), learning rate (0.01 to 1), dropout probability (0.3 to 0.8), minibatch size (64 or 128 examples), and number of epochs (50 to 1000). This search was conducted manually and not all combinations were tested. Automatic model selection as in Bergstra et al.[7] failed to outperform the best manual search results. For testing, all classifiers were trained for 80 epochs in minibatches of 128. Weight matrices were initialized as in He et al. [11] and biases initialized to zero. Rectified Linear Units were employed on all but the classification layer. During training we performed dropout with probability 0.5 to both dense and convolutional layers (except for DCNN, where performance was better when trained without dropout). Negative examples were randomly sampled to achieve a 10:1 ratio with positive examples, and the weighted cross entropy loss function was used to account for the class imbalance. Training was performed using stochastic gradient descent with a learning rate of 0.1. Test results were computed by training the model on the training and validation sets using the model hyperparameters that yielded best validation performance. The convolution neighborhood (i.e. receptive field) is defined as a fixed-size set of residues that are closest in space to a residue of interest, and 21 yielded the best performance in our validation experiments. We implemented our networks in TensorFlow [1] v1.0.1 to make use of rapid training on GPUs. Training times vary from roughly 17-102 minutes depending on convolution method and network depth, using a single NVIDIA GTX 980 or GTX TITAN X GPU. 6 Method Convolutional Layers 1 2 3 4 No Convolution 0.812 (0.007) 0.810 (0.006) 0.808 (0.006) 0.796 (0.006) Diffusion (DCNN) (2 hops) [5] 0.790 (0.014) – – – Diffusion (DCNN) (5 hops) [5]) 0.828 (0.018) – – – Single Weight Matrix (MFN [9]) 0.865 (0.007) 0.871 (0.013) 0.873 (0.017) 0.869 (0.017) Node Average (Equation 1) 0.864 (0.007) 0.882 (0.007) 0.891 (0.005) 0.889 (0.005) Node and Edge Average (Equation 2) 0.876 (0.005) 0.898 (0.005) 0.895 (0.006) 0.889 (0.007) DTNN [21] 0.867 (0.007) 0.880 (0.007) 0.882 (0.008) 0.873 (0.012) Order Dependent (Equation 3) 0.854 (0.004) 0.873 (0.005) 0.891 (0.004) 0.889 (0.008) Table 2: Median area under the receiver operating characteristic curve (AUC) across all complexes in the test set for various graph convolutional methods. Results shown are the average and standard deviation over ten runs with different random seeds. Networks have the following number of filters for 1, 2, 3, and 4 layers before merging, respectively: (256), (256, 512), (256, 256, 512), (256, 256, 512, 512). The exception is the DTNN method, which by necessity produces an output which is has the same dimensionality as its input. Unlike the other methods, diffusion convolution performed best with an RBF with a standard deviation of 2Å. After merging, all networks have a dense layer with 512 hidden units followed by a binary classification layer. Bold faced values indicate best performance for each method. To determine the best form of graph convolution for protein interface prediction, we implemented the spatial graph convolution operators described in the Related Work section. The MFN method required modification to work well in our problem, namely averaging over neighbors rather than summing. For each graph convolution method, we searched over the hyperparameters listed above using the same manual search method; for the DCNN this also included the number of hops. Diffusion convolution is a single layer method as presented in the original publication; and indeed, stacking multiple diffusion convolutional layers yielded poor results, so testing was conducted using only one layer for that method. To demonstrate the effectiveness of graph convolution we examine the effect of incorporating neighbor information by implementing a method that performs no convolution (referred to as No-Convolution), equivalent to Equation (1) with no summation over neighbors. The PAIRpred SVM method [2] was trained by performing five fold cross validation on the training and validation data to select the best kernel and soft margin parameters before evaluating on the test set. 3.1 Results Results comparing the accuracy of the various graph convolution methods are shown in Table 2. Our first observation is that the proposed graph convolution methods, with AUCs around 0.89, outperform the No Convolution method, which had an AUC of 0.81, showing that the incorporation of information from a residue’s neighbors improves the accuracy of interface prediction. This matches the biological intuition that the region around a residue should impact its binding affinity. We also observe that the proposed order-independent methods, with and without edge features (Equations (1) and (2) ) and the order-dependent method (Equation (3) performed at a similar level, although the order-independent methods do so with fewer layers and far fewer model parameters than the order-dependent method. These methods exhibit improvement over the state-of-the-art PAIRPred method which yielded an AUC of 0.863. The MFN method, which is a simpler version of the order-independent method given in Equation (1) performed slightly worse. This method uses the same weight matrix for the center node and its neighbors, and thereby does not differentiate between them. Its lower performance suggests this is an important distinction in our problem, where prediction is performed at the node level. This convolution operator was proposed in the context of a classification problem at the graph level. The DTNN approach is only slightly below the top performing methods. We have observed that the other convolutional methods perform better when the number of filters is increased gradually in subsequent network layers, a feature not afforded by this method. Among the convolutional methods, the diffusion convolution method (DCNN) performed the worst, and was similar in performance to the No Convolution method. The other convolution methods performed best when employing multiple convolutional layers, suggesting that the networks are 7 Figure 3: PyMOL [20] visualizations of the best performing test complex (PDB ID 3HI6). Upper left: Ligand (red) and receptor (blue), along with the true interface (yellow). Upper right: Visualization of predicted scores, where brighter colors (cyan and orange) represent higher scores. Since scores are for pairs of residues, we take the max score over all partners in the partner protein. Bottom row: Activations of two filters in the second convolutional layer, where brighter colors indicate greater activation and black indicates activation of zero. Lower left: A filter which provides high activations for buried residues, a useful screening criterion for interface detection. Lower right: Filter which gives high activations for residues near the interface of this complex. indeed learning a hierarchical representation of the data. However, networks with more than four layers performed worse, which could be attributed to the relatively limited amount of labeled protein interface data. Finally, we note that the extreme class imbalance in the test set produces a very poor area under the precision-recall curve, with no method achieving a value above 0.017. To better understand the behavior of the best performing convolutional method we visualize the best performing test complex, PDB ID 3HI6 (see figure 3). The figure shows that the highest predictions are in agreement with the true interface. We also visualize two convolutional filters to demonstrate their ability to learn aspects of the complex that are useful for interface prediction. 4 Conclusions and Future Work We have examined the performance of several spatial graph convolutional methods in the problem of predicting interfaces between proteins on the basis of their 3D structure. Neighborhood-based convolution methods achieved state-of-the-art performance, outperforming diffusion-based convolution and the previous state-of-the-art SVM-based method. Among the neighborhood-based methods, order-independent methods performed similarly to an order-dependent method, and we identified elements that are important for the performance of the order-indpendent methods. Our experiments did not demonstrate a big difference with the inclusion of edge features. There were very few of those, and unlike the node features, they were static: our networks learned latent representations only for the node features. These methods can be extended to learn both node and edge representations, and the underlying convolution operator admits a simple deconvolution operator which lends itself to be used with auto-encoders. CNNs typically require large datasets to learn effective representations. This may have limited the level of accuracy that we could attain using our purely supervised approach and the relatively small 8 number of labeled training examples. Unsupervised pre-training would allow us to use the entire Protein Data Bank which contains close to 130,000 structures (see http://www.rcsb.org/). The features learned by deep convolutional architectures for image classification have demonstrated a great degree of usefulness in classification tasks different than the ones they were originally trained on (see e.g. [22]). Similarly, we expect the convolution operators we propose and the resulting features to be useful in many other applications, since structure information is useful for predicting a variety of properties of proteins, including their function, catalytic and other functional residues, prediction of protein-protein interactions, and protein interactions with DNA and RNA. In designing our methodology we considered the question of the appropriate level at which to describe protein structure. In classifying image data, CNNs are usually applied to the raw pixel data [15]. The analogous level of description for protein structure would be the raw 3D atomic coordinates, which we thought would prove too difficult. Using much larger training sets and unsupervised learning can potentially allow the network to begin with features that are closer to the raw atomic coordinates and learn a more detailed representation of the geometry of proteins. Supplementary Materials Python code is available at https://github.com/fouticus/pipgcn, data can be downloaded from: https://zenodo.org/record/1127774, and the accompanying poster can be found at: https://zenodo.org/record/1134154. Acknowedgements This work was supported by the National Science Foundation under grant no DBI-1564840. References [1] Martín Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dan Mané, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viégas, Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. TensorFlow: Large-scale machine learning on heterogeneous systems, 2015. [2] Fayyaz ul Amir Afsar Minhas, Brian J. Geiss, and Asa Ben-Hur. PAIRpred: Partner-specific prediction of interacting residues from sequence and structure. Proteins: Structure, Function, and Bioinformatics, 82(7):1142–1155, 2014. [3] Shandar Ahmad and Kenji Mizuguchi. Partner-aware prediction of interacting residues in protein-protein complexes from sequence data. PLoS One, 6(12):e29104, 2011. [4] Christof Angermueller, Tanel Pärnamaa, Leopold Parts, and Oliver Stegle. Deep learning for computational biology. Molecular systems biology, 12(7):878, 2016. [5] James Atwood and Don Towsley. Diffusion-convolutional neural networks. In Advances in Neural Information Processing Systems, pages 1993–2001, 2016. [6] Tristan T Aumentado-Armstrong, Bogdan Istrate, and Robert a Murgita. Algorithmic approaches to protein-protein interaction site prediction. Algorithms for Molecular Biology, 10(1):1–21, 2015. [7] James S. Bergstra, Rémi Bardenet, Yoshua Bengio, and Balázs Kégl. Algorithms for hyperparameter optimization. In J. Shawe-Taylor, R. S. Zemel, P. L. Bartlett, F. Pereira, and K. Q. Weinberger, editors, Advances in Neural Information Processing Systems 24, pages 2546–2554. Curran Associates, Inc., 2011. [8] Michael M Bronstein, Joan Bruna, Yann LeCun, Arthur Szlam, and Pierre Vandergheynst. Geometric deep learning: going beyond Euclidean data. IEEE Sig. Proc. Magazine, 2017. 9 [9] David K Duvenaud, Dougal Maclaurin, Jorge Iparraguirre, Rafael Bombarell, Timothy Hirzel, Alán Aspuru-Guzik, and Ryan P Adams. Convolutional networks on graphs for learning molecular fingerprints. In Advances in Neural Information Processing Systems, pages 2224– 2232, 2015. [10] R. Esmaielbeiki, K. Krawczyk, B. Knapp, J.-C. Nebel, and C. M. Deane. Progress and challenges in predicting protein interfaces. Briefings in Bioinformatics, (January):1–15, 2015. [11] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imageNet classification. CoRR, abs/1502.01852, 2015. [12] Geoffrey Hinton, Li Deng, Dong Yu, George E Dahl, Abdel-rahman Mohamed, Navdeep Jaitly, Andrew Senior, Vincent Vanhoucke, Patrick Nguyen, Tara N Sainath, et al. Deep neural networks for acoustic modeling in speech recognition: The shared views of four research groups. IEEE Signal Processing Magazine, 29(6):82–97, 2012. [13] Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In ICLR, 2017. [14] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. ImageNet classification with deep convolutional neural networks. In Advances in neural information processing systems, pages 1097–1105, 2012. [15] Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, 521(7553):436–444, 2015. [16] Mathias Niepert, Mohamed Ahmed, and Konstantin Kutzkov. Learning convolutional neural networks for graphs. In Proceedings of the 33rd annual international conference on machine learning. ACM, 2016. [17] Lee Sael and Daisuke Kihara. Protein surface representation and comparison : New approaches in structural proteomics. Biological Data Mining, pages 89–109, 2009. [18] Lee Sael, Bin Li, David La, Yi Fang, Karthik Ramani, Raif Rustamov, and Daisuke Kihara. Fast protein tertiary structure retrieval based on global surface shape similarity. Proteins, 72(4):1259–1273, 2008. [19] Michael Schlichtkrull, Thomas N Kipf, Peter Bloem, Rianne van den Berg, Ivan Titov, and Max Welling. Modeling relational data with graph convolutional networks. arXiv preprint arXiv:1703.06103, 2017. [20] Schrödinger, LLC. The PyMOL molecular graphics system, version 1.8. November 2015. [21] Kristof T Schütt, Farhad Arbabzadah, Stefan Chmiela, Klaus R Müller, and Alexandre Tkatchenko. Quantum-chemical insights from deep tensor neural networks. Nature communications, 8:13890, 2017. [22] Ali Sharif Razavian, Hossein Azizpour, Josephine Sullivan, and Stefan Carlsson. CNN features off-the-shelf: an astounding baseline for recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pages 806–813, 2014. [23] Jost Tobias Springenberg, Alexey Dosovitskiy, Thomas Brox, and Martin Riedmiller. Striving for simplicity: The all convolutional net. arXiv preprint arXiv:1412.6806, 2014. [24] Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to sequence learning with neural networks. In Advances in Neural Information Processing Systems, pages 3104–3112, 2014. [25] Thom Vreven, Iain H Moal, Anna Vangone, Brian G Pierce, Panagiotis L Kastritis, Mieczyslaw Torchala, Raphael Chaleil, Brian Jiménez-García, Paul A Bates, Juan Fernandez-Recio, et al. Updates to the integrated protein–protein interaction benchmarks: docking benchmark version 5 and affinity benchmark version 2. Journal of molecular biology, 427(19):3031–3041, 2015. 10
2017
647
7,171
Convergence rates of a partition based Bayesian multivariate density estimation method Linxi Liu ∗ Department of Statistics Columbia University ll3098@columbia.edu Dangna Li ICME Stanford University dangna@stanford.edu Wing Hung Wong Department of Statistics Stanford University whwong@stanford.edu Abstract We study a class of non-parametric density estimators under Bayesian settings. The estimators are obtained by adaptively partitioning the sample space. Under a suitable prior, we analyze the concentration rate of the posterior distribution, and demonstrate that the rate does not directly depend on the dimension of the problem in several special cases. Another advantage of this class of Bayesian density estimators is that it can adapt to the unknown smoothness of the true density function, thus achieving the optimal convergence rate without artificial conditions on the density. We also validate the theoretical results on a variety of simulated data sets. 1 Introduction In this paper, we study the asymptotic behavior of posterior distributions of a class of Bayesian density estimators based on adaptive partitioning. Density estimation is a building block for many other statistical methods, such as classification, nonparametric testing, clustering, and data compression. With univariate (or bivariate) data, the most basic non-parametric method for density estimation is the histogram method. In this method, the sample space is partitioned into regular intervals (or rectangles), and the density is estimated by the relative frequency of data points falling into each interval (rectangle). However, this method is of limited utility in higher dimensional spaces because the number of cells in a regular partition of a p-dimensional space will grow exponentially with p, which makes the relative frequency highly variable unless the sample size is extremely large. In this situation the histogram may be improved by adapting the partition to the data so that larger rectangles are used in the parts of the sample space where data is sparse. Motivated by this consideration, researchers have recently developed several multivariate density estimation methods based on adaptive partitioning [13, 12]. For example, by generalizing the classical Pólya Tree construction [7, 22] developed the Optional Pólya Tree (OPT) prior on the space of simple functions. Computational issues related to OPT density estimates were discussed in [13], where efficient algorithms were developed to compute the OPT estimate. The method performs quite well when the dimension is moderately large (from 10 to 50). The purpose of the current paper is to address the following questions on such Bayesian density estimates based on partition-learning. Question 1: what is the class of density functions that can be “well estimated” by the partition-learning based methods. Question 2: what is the rate at which the posterior distribution is concentrated around the true density as the sample size increases. Our main contributions lie in the following aspects: ∗Work was done while the author was at Stanford University. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. • We impose a suitable prior on the space of density functions defined on binary partitions, and calculate the posterior concentration rate under the Hellinger distance with mild assumptions. The rate is adaptive to the unknown smoothness of the true density. • For two dimensional density functions of bounded variation, the posterior contraction rate of our method is n−1/4(log n)3. • For Hölder continuous (one-dimensional case) or mixture Hölder continuous (multidimensional case) density functions with regularity parameter β in (0, 1], the posterior concentration rate is n− β 2β+p (log n)2+ p 2β , whereas the minimax rate for one-dimensional Hölder continuous functions is (n/ log n)−β/(2β+1). • When the true density function is sparse in the sense that the Haar wavelet coefficients satisfy a weak-lq (q > 1/2) constraint, the posterior concentration rate is n−q−1/2 2q (log n)2+ 1 2q−1 . • We can use a computationally efficient algorithm to sample from the posterior distribution. We demonstrate the theoretical results on several simulated data sets. 1.1 Related work An important feature of our method is that it can adapt to the unknown smoothness of the true density function. The adaptivity of Bayesian approaches has drawn great attention in recent years. In terms of density estimation, there are mainly two categories of adaptive Bayesian nonparametric approaches. The first category of work relies on basis expansion of the density function and typically imposes a random series prior [15, 17]. When the prior on the coefficients of the expansion is set to be normal [4], it is also a Gaussian process prior. In the multivariate case, most existing work [4, 17] uses tensor-product basis. Our improvement over these methods mainly lies in the adaptive structure. In fact, as the dimension increases the number of tensor-product basis functions can be prohibitively large, which imposes a great challenge on computation. By introducing adaptive partition, we are able to handle the multivariate case even when the dimension is 30 (Example 2 in Section 4). Another line of work considers mixture priors [16, 11, 18]. Although the mixture distributions have good approximation properties and naturally lead to adaptivity to very high smoothness levels, they may fail to detect or characterize the local features. On the other hand, by learning a partition of the sample space, the partition based approaches can provide an informative summary of the structure, and allow us to examine the density at different resolutions [14, 21]. The paper is organized as follows. In Section 2 we provide more details of the density functions on binary partitions and define the prior distribution. Section 3 summarizes the theoretical results on posterior concentration rates. The results are further validated in Section 4 by several experiments. 2 Bayesian multivariate density estimation We focus on density estimation problems in p-dimensional Euclidean space. Let (Ω, B) be a measurable space and f0 be a compactly supported density function with respect to the Lebesgue measure µ. Y1, Y2, · · · , Yn is a sequence of independent variables distributed according to f0. After translation and scaling, we can always assume that the support of f0 is contained in the unit cube in Rp. Translating this into notations, we assume that Ω= {(y1, y2, · · · , yp) : yl ∈[0, 1]}. F = {f is a nonnegative measurable function on Ω: R Ωfdµ = 1} denotes the collection of all the density functions on (Ω, B, µ). Then F constitutes the parameter space in this problem. Note that F is an infinite dimensional parameter space. 2.1 Densities on binary partitions To address the infinite dimensionality of F, we construct a sequence of finite dimensional approximating spaces Θ1, Θ2, · · · , ΘI, · · · based on binary partitions. With growing complexity, these spaces provide more and more accurate approximations to the initial parameter space F. Here, we use a recursive procedure to define a binary partition with I subregions of the unit cube in Rp. Let Ω= {(y1, y2, · · · , yp) : yl ∈[0, 1]} be the unit cube in Rp. In the first step, we choose one of the coordinates yl and cut Ωinto two subregions along the midpoint of the range of yl. That is, Ω= Ωl 0 ∪Ωl 1, where Ωl 0 = {y ∈Ω: yl ≤1/2} and Ωl 1 = Ω\Ωl 0. In this way, we get a partition 2 with two subregions. Note that the total number of possible partitions after the first step is equal to the dimension p. Suppose after I −1 steps of the recursion, we have obtained a partition {Ωi}I i=1 with I subregions. In the I-th step, further partitioning of the region is defined as follows: 1. Choose a region from Ω1, · · · , ΩI. Denote it as Ωi0. 2. Choose one coordinate yl and divide Ωi0 into two subregions along the midpoint of the range of yl. Such a partition obtained by I −1 recursive steps is called a binary partition of size I. Figure 1 displays all possible two dimensional binary partitions when I is 1, 2 and 3. Figure 1: Binary partitions Now, let ΘI = {f : f = I X i=1 θi |Ωi|1Ωi, I X i=1 θi = 1, {Ωi}I i=1 is a binary partition of Ω.} where |Ωi| is the volume of Ωi. Then, ΘI is the collection of the density functions supported by the binary partitions of size I. They constitute a sequence of approximating spaces (i.e. a sieve, see [10, 20] for background on sieve theory). Let Θ = ∪∞ I=1ΘI be the space containing all the density functions supported by the binary partitions. Then Θ is an approximation of the initial parameter space F to certain approximation error which will be characterized later. We take the metric on F, Θ and ΘI to be Hellinger distance, which is defined as ρ(f, g) = ( Z Ω ( p f(y) − p g(y))2dy)1/2, f, g ∈F. (1) 2.2 Prior distribution An ideal prior Π on Θ = ∪∞ I=1ΘI is supposed to be capable of balancing the approximation error and the complexity of Θ. The prior in this paper penalizes the size of the partition in the sense that the probability mass on each ΘI is proportional to exp(−λI log I). Given a sample of size n, we restrict our attention to Θn = ∪n/ log n I=1 ΘI, because in practice we need enough samples within each subregion to get a meaningful estimate of the density. This is to say, when I ≤n/ log n, Π(ΘI) ∝exp(−λI log I), otherwise Π(ΘI) = 0. If we use TI to denote the total number of possible partitions of size I, then it is not hard to see that log TI ≤c∗I log I, where c∗is a constant. Within each ΘI, the prior is uniform across all binary partitions. In other words, let {Ωi}I i=1 be a binary partition of Ωof size I, and F({Ωi}I i=1) is the collection of piecewise constant density functions on this partition (i.e. F({Ωi}I i=1) = {f = PI i=1 θi |Ωi|1Ωi : PI i=1 θi = 1 and θi ≥0, i = 1, . . . , I}), then Π F {Ωi}I i=1  ∝exp(−λI log I)/TI. (2) 3 Given a partition {Ωi}I i=1, the weights θi on the subregions follow a Dirichlet distribution with parameters all equal to α (α < 1). This is to say, for x1, · · · , xI ≥0 and PI i=1 xi = 1, Π f = I X i=1 θi |Ωi|1Ωi : θ1 ∈dx1, · · · , θI ∈dxI F {Ωi}I i=1  ! = 1 D(α, · · · , α) IY i=1 xα−1 i , (3) where D(δ1, · · · , δI) = QI i=1 Γ(δi)/Γ(PI i=1 δi). Let Πn(·|Y1, · · · , Yn) to denote the posterior distribution. After integrating out the weights θi, we can compute the marginal posterior probability of F {Ωi}I i=1  : Πn F({Ωi}I i=1) Y1, · · · , Yn  ∝ Π F({Ωi}I i=1)  Z IY i=1 (θi/|Ωi|)ni ! × 1 D(α, · · · , α) IY i=1 θα−1 i ! dθ1 · · · dθI ∝ exp(−λI log I) TI · D(α + n1, · · · , α + nI) D(α, · · · , α) IY i=1 1 |Ωi|ni , (4) where ni is the number of observations in Ωi. Under the prior introduced in [13], the marginal posterior distribution is: Π∗ n F({Ωi}I i=1) Y1, · · · , Yn  ∝ exp(−λI)D(α + n1, · · · , α + nI) D(α, · · · , α) IY i=1 1 |Ωi|ni , (5) while the maximum log-likelihood achieved by histograms on the partition {Ωi}n i=1 is: ln(F({Ωi}I i=1)) := max f∈F({Ωi}I i=1) ln(f) = I X i=1 ni log  ni n|Ωi|  . (6) From a model selection perspective, we may treat the histograms on each binary partition as a model of the data. When I ≪n, asymptotically, log Π∗ n F({Ωi}I i=1) Y1, · · · , Yn  ≍ln(F({Ωi}I i=1)) −1 2(I −1) log n. (7) This is to say, in [13], selecting the partition which maximizes the marginal posterior distribution is equivalent to applying the Bayesian information criterion (BIC) to perform model selection. However, if we allow I to increase with n, (7) will not hold any more. But if we use the prior introduced in this section, in the case when I n →ζ ∈(0, 1) as n →∞, we still have log Πn F({Ωi}I i=1) Y1, · · · , Yn  ≍ln(F({Ωi}I i=1)) −λI log I. (8) From a model selection perspective, this is closer to the risk inflation criterion (RIC, [8]). 3 Posterior concentration rates We are interested in how fast the posterior probability measure concentrates around the true the density f0. Under the prior specified above, the posterior probability is the random measure given by Πn(B|Y1, · · · , Yn) = R B Qn j=1 f(Yj)dΠ(f) R Θ Qn j=1 f(Yj)dΠ(f). A Bayesian estimator is said to be consistent if the posterior distribution concentrates on arbitrarily small neighborhoods of f0, with probability tending to 1 under P n 0 (P0 is the probability measure corresponding to the density function f0). The posterior concentration rate refers to the rate at which these neighborhoods shrink to zero while still possessing most of the posterior mass. More explicitly, we want to find a sequence ϵn →0, such that for sufficiently large M, Πn ({f : ρ(f, f0) ≥Mϵn}|Y1, · · · , Yn) →0 in P n 0 −probability. 4 In [6] and [2], the authors demonstrated that it is impossible to find an estimator which works uniformly well for every f in F. This is the case because for any estimator ˆf, there always exists f ∈F for which ˆf is inconsistent. Given the minimaxity of the Bayes estimator, we have to restrict our attention to a subset of the original parameter space F. Here, we focus on the class of density functions that can be well approximated by ΘI’s. To be more rigorous, a density function f ∈F is said to be well approximated by elements in Θ, if there exits a sequence of fI ∈ΘI, satisfying that ρ(fI, f) = O(I−r)(r > 0). Let F0 be the collection of these density functions. We will first derive posterior concentration rate for the elements in F0 as a function of r. For different function classes, this approximation rate r can be calculated explicitly. In addition to this, we also assume that f0 has finite second moment. The following theorem gives the posterior concentration rate under the prior introduced in Section 2.2. Theorem 3.1. Y1, · · · , Yn is a sequence of independent random variables distributed according to f0. P0 is the probability measure corresponding to f0. Θ is the collection of p-dimensional density functions supported by the binary partitions as defined in Section 2.1. With the modified prior distribution, if f0 ∈F0, then the posterior concentration rate is ϵn = n− r 2r+1 (log n)2+ 1 2r . The strategy to show this theorem is to write the posterior probability of the shrinking ball as Π({f : ρ(f, f0) ≥Mϵn}|Y1, · · · , Yn) = P∞ I=1 R {f:ρ(f,f0)≥Mϵn}∩ΘI Qn j=1 f(Yj) f0(Yj)dΠ(f) P∞ I=1 R ΘI Qn j=1 f(Yj) f0(Yj)dΠ(f) . (9) The proof employs the mechanism developed in the landmark works [9] and [19]. We first obtain the upper bounds for the items in the numerator by dividing them into three blocks, each of which accounts for bias, variance, and rapidly decaying prior respectively, and calculate the upper bound for each block separately. Then we provide the prior thickness result, i.e., we bound the prior mass of a ball around the true density from below. Due to space constraints, the details of the proof will be provided in the appendix. This theorem suggests the following two take-away messages: 1. The rate is adaptive to the unknown smoothness of the true density. 2. The posterior contraction rate is n− r 2r+1 (log n)2+ 1 2r , which does not directly depend on the dimension p. For some density functions, r may depend on p. But in several special cases, like the density function is spatially sparse or the density function lies in a low dimensional subspace, we will show that the rate will not be affected by the full dimension of the problem. In the following three subsections, we will calculate the explicit rates for three density classes. Again, all proofs are given in the appendix. 3.1 Spatial adaptation First, we assume that the density concentrates spatially. Mathematically, this implies the density function satisfies a type of sparsity. In the past two decades, sparsity has become one of the most discussed types of structure under which we are able to overcome the curse of dimensionality. A remarkable example is that it allows us to solve high-dimensional linear models, especially when the system is underdetermined. Let f be a p dimensional density function and Ψ the p-dimensional Haar basis. We will work with g = √f first. Note that g ∈L2([0, 1]p). Thus we can expand g with respect to Ψ as g = P ψ∈Ψ⟨g, ψ⟩ψ, ψ ∈Ψ. We rearrange this summation by the size of wavelet coefficients. In other words, we order the coefficients as the following |⟨g, ψ(1)⟩| ≥|⟨g, ψ(2)⟩| ≥· · · ≥|⟨g, ψ(k)⟩| ≥· · · , then the sparsity condition imposed on the density functions is that the decay of the wavelet coefficients follows a power law, |⟨g, ψ(k)⟩| ≤Ck−q for all k ∈N and q > 1/2, (10) where C is a constant. 5 We call such a constraint a weak-lq constraint. The condition has been widely used to characterize the sparsity of signals and images [1, 3]. In particular, in [5], it was shown that for two-dimensional cases, when q > 1/2, this condition reasonably captures the sparsity of real world images. Corollary 3.2. (Application to spatial adaptation) Suppose f0 is a p-dimensional density function and satisfies the condition (10). If we apply our approaches to this type of density functions, the posterior concentration rate is n−q−1/2 2q (log n)2+ 1 2q−1 . 3.2 Density functions of bounded variation Let Ω= [0, 1)2 be a domain in R2. We first characterize the space BV (Ω) of functions of bounded variation on Ω. For a vector ν ∈R2, the difference operator ∆ν along the direction ν is defined by ∆ν(f, y) := f(y + ν) −f(y). For functions f defined on Ω, ∆ν(f, y) is defined whenever y ∈Ω(ν), where Ω(ν) := {y : [y, y + ν] ⊂Ω} and [y, y + ν] is the line segment connecting y and y + ν. Denote by el, l = 1, 2 the two coordinate vectors in R2. We say that a function f ∈L1(Ω) is in BV (Ω) if and only if VΩ(f) := sup h>0 h−1 2 X l=1 ∥∆hel(f, ·)∥L1(Ω(hel)) = lim h→0 h−1 2 X l=1 ∥∆hel(f, ·)∥L1(Ω(hel)) is finite. The quantity VΩ(f) is the variation of f over Ω. Corollary 3.3. Assume that f0 ∈BV (Ω). If we apply the Bayesian multivariate density estimator based on adaptive partitioning here to estimate f0, the posterior concentration rate is n−1/4(log n)3. 3.3 Hölder space In one-dimensional case, the class of Hölder functions H(L, β) with regularity parameter β is defined as the following: let κ be the largest integer smaller than β, and denote by f (κ) its κth derivative. H(L, β) = {f : [0, 1] →R : |f (κ)(x) −f (κ)(y)| ≤L|x −y|β−κ}. In multi-dimensional cases, we introduce the Mixed-Hölder continuity. In order to simplify the notation, we give the definition when the dimension is two. It can be easily generalized to highdimensional cases. A real-valued function f on R2 is called Mixed-Hölder continuous for some nonnegative constant C and β ∈(0, 1], if for any (x1, y1), (x1, y2) ∈R2, |f(x2, y2) −f(x2, y1) −f(x1, y2) + f(x1, y1)| ≤C|x1 −x2|β|y1 −y2|β. Corollary 3.4. Let f0 be the p-dimensional density function. If √f0 is Hölder continuous (when p = 1) or mixed-Hölder continuous (when p ≥2) with regularity parameter β ∈(0, 1], then the posterior concentration rate of the Bayes estimator is n− β 2β+p (log n)2+ p 2β . This result also implies that if f0 only depends on ˜p variable where ˜p < p, but we do not know in advance which ˜p variables, then the rate of this method is determined by the effective dimension ˜p of the problem, since the smoothness parameter r is only a function of ˜p. In next section, we will use a simulated data set to illustrate this point. 4 Simulation 4.1 Sequential importance sampling Each partition AI = {Ωi}I i=1 is obtained by recursively partitioning the sample space. We can use a sequence of partitions A1, A2, · · · , AI to keep track of the path leading to AI. Let Πn(·) denote the posterior distribution Πn(·|Y1, · · · , Yn) for simplicity, and ΠI n be the posterior distribution conditioning on ΘI. Then ΠI n(AI) can be decomposed as ΠI n(AI) = ΠI n(A1)ΠI n(A2|A1) · · · ΠI n(AI|AI−1). 6 Figure 2: Heatmap of the density and plots of the 2-dimensional Haar coefficients. For the plot on the right, the left panel is the plot of the Haar coefficients from low resolution to high resolution up to level 6. The middle one is the plot of the sorted coefficients according to their absolute values. And the right one is the same as the middle plot but with the abscissa in log scale. The conditional distribution ΠI n(Ai+1|Ai) can be calculated by ΠI n(Ai+1)/ΠI n(Ai). However, the computation of the marginal distribution ΠI n(Ai) is sometimes infeasible, especially when both I and I −i are large, because we need to sum the marginal posterior probability over all binary partitions of size I for which the first i steps in the partition generating path are the same as those of Ai. Therefore, we adopt the sequential importance algorithm proposed in [13]. In order to build a sequence of binary partitions, at each step, the conditional distribution is approximated by Πi+1 n (Ai+1|Ai). The obtained partition is assigned a weight to compensate the approximation, where the weight is wI(AI) = ΠI n(AI) Π1n(A1)Π2n(A2|A1) · · · ΠIn(AI|AI−1). In order to make the data points as uniform as possible, we apply a copula transformation to each variable in advance whenever the dimension exceeds 3. More specifically, we estimate the marginal distribution of each variable Xj by our approach, denoted as ˆfj (we use ˆFj to denote the cdf of Xj), and transform each point (y1, · · · , yp) to (F1(y1), · · · , Fp(yp)). Another advantage of this transformation is that after the transformation the sample space naturally becomes [0, 1]p. Example 1 Assume that the two-dimensional density function is  Y1 Y2  ∼2 5N  0.25 0.25  , 0.052I2×2  + 3 5N  0.75 0.75  , 0.052I2×2  . This density function both satisfies the spatial sparsity condition and belongs to the space of functions of bounded variation. Figure 2 shows the heatmap of the density function and its Haar coefficients. The last panel in the second plot displays the sorted coefficients with the abscissa in log-scale. From this we can clearly see that the power-law decay defined in Section 3.1 is satisfied. We apply the adaptive partitioning approach to estimate the density, and allow the sample size increase from 102 to 105. In Figure 3, the left plot is the density estimation result based on a sample with 10000 data points. The right one is the plot of Kullback-Leibler (KL) divergence from the estimated density to f0 vs. sample size in log-scale. The sample sizes are set to be 100, 500, 1000, 5000, 104, and 105. The linear trend in the plot validates the posterior concentrate rates calculated in Section 3. The reason why we use KL divergence instead of the Hellinger distance is that for any f0 ∈F0 and ˆf ∈Θ, we can show that the KL divergence and the Hellinger distance are of the same order. But KL divergence is relatively easier to compute in our setting, since we can show that it is linear in the logarithm of the posterior marginal probability of a partition. The proof will be provided in the appendix. For each fixed sample size, we run the experiment 10 times and estimate the standard error, which is shown by the lighter blue part in the plot. Example 2 In the second example we work with a density function of moderately high dimension. Assume that the first five random variables Y1, · · · Y5 are generated from the following location 7 1e2 5e2 1e3 5e3 1e4 1e5 sample size 0.01 0.20 0.40 0.60 0.80 1.00 KL divergence Figure 3: Plot of the estimated density and KL divergence against sample size. We use the posterior mean as the estimate. The right plot is on log-log scale, while the labels of x and y axes still represent the sample size and the KL divergence before we take the logarithm. Figure 4: KL divergence vs. sample size. The blue, purple and red curves correspond to the cases when p = 5, p = 10 and p = 30 respectively. The slopes of the three lines are almost the same, implying that the concentration rate only depends on the effective dimension of the problem (which is 5 in this example). mixture of the Gaussian distribution: Y1 Y2 Y3 ! ∼ 1 2N   0.25 0.25 0.25 ! ,   0.052 0.032 0 0.032 0.052 0 0 0 0.052    + 1 2N 0.75 0.75 0.75 ! , 0.052I3×3 ! , Y4, Y5 ∼ N(0.5, 0.1), the other components Y6, · · · , Yp are independently uniformly distributed. We run experiments for p = 5, 10, and 30. For a fixed p, we generate n ∈{500, 1000, 5000, 104, 105} data points. For each pair of p and n, we repeat the experiment 10 times and calculate the standard error. Figure 4 displays the plot of the KL divergence vs. the sample size on log-log scale. The density function is continuous differentiable. Therefore, it satisfies the mixed-Hölder continuity condition. The effective dimension of this example is ˜p = 5, and this is reflected in the plot: the slopes of the three lines, which correspond to the concentration rates under different dimensions, almost remain the same as we increase the full dimension of the problem. 5 Conclusion In this paper, we study the posterior concentration rate of a class of Bayesian density estimators based on adaptive partitioning. We obtain explicit rates when the density function is spatially sparse, belongs to the space of bounded variation, or is Hölder continuous. For the last case, the rate is minimax up to a logarithmic term. When the density function is sparse or lies in a low-dimensional subspace, the rate will not be affected by the dimension of the problem. Another advantage of this method is that it can adapt to the unknown smoothness of the underlying density function. 8 Bibliography [1] Felix Abramovich, Yoav Benjamini, David L. Donoho, and Iain M. Johnstone. Adapting to unknown sparsity by controlling the false discovery rate. The Annals of Statistics, 34(2):584–653, 04 2006. [2] Lucien Birgé and Pascal Massart. Minimum contrast estimators on sieves: exponential bounds and rates of convergence. Bernoulli, 4(3):329–375, 09 1998. [3] E.J. Candès and T. Tao. Near-optimal signal recovery from random projections: Universal encoding strategies? Information Theory, IEEE Transactions on, 52(12):5406–5425, Dec 2006. [4] R. de Jonge and J.H. van Zanten. Adaptive estimation of multivariate functions using conditionally gaussian tensor-product spline priors. Electron. J. Statist., 6:1984–2001, 2012. [5] R.A. DeVore, B. Jawerth, and B.J. Lucier. Image compression through wavelet transform coding. Information Theory, IEEE Transactions on, 38(2):719–746, March 1992. [6] R. H. Farrell. On the lack of a uniformly consistent sequence of estimators of a density function in certain cases. The Annals of Mathematical Statistics, 38(2):471–474, 04 1967. [7] Thomas S. Ferguson. Prior distributions on spaces of probability measures. Ann. Statist., 2:615–629, 1974. [8] Dean P. Foster and Edward I. George. The risk inflation criterion for multiple regression. Ann. Statist., 22(4):1947–1975, 12 1994. [9] Subhashis Ghosal, Jayanta K. Ghosh, and Aad W. van der Vaart. Convergence rates of posterior distributions. The Annals of Statistics, 28(2):500–531, 04 2000. [10] U. Grenander. Abstract Inference. Probability and Statistics Series. John Wiley & Sons, 1981. [11] Willem Kruijer, Judith Rousseau, and Aad van der Vaart. Adaptive bayesian density estimation with location-scale mixtures. Electron. J. Statist., 4:1225–1257, 2010. [12] Dangna Li, Kun Yang, and Wing Hung Wong. Density estimation via discrepancy based adaptive sequential partition. 30th Conference on Neural Information Processing Systems (NIPS 2016), 2016. [13] Luo Lu, Hui Jiang, and Wing H. Wong. Multivariate density estimation by bayesian sequential partitioning. Journal of the American Statistical Association, 108(504):1402–1410, 2013. [14] Li Ma and Wing Hung Wong. Coupling optional pólya trees and the two sample problem. Journal of the American Statistical Association, 106(496):1553–1565, 2011. [15] Vincent Rivoirard and Judith Rousseau. Posterior concentration rates for infinite dimensional exponential families. Bayesian Anal., 7(2):311–334, 06 2012. [16] Judith Rousseau. Rates of convergence for the posterior distributions of mixtures of betas and adaptive nonparametric estimation of the density. The Annals of Statistics, 38(1):146–180, 02 2010. [17] Weining Shen and Subhashis Ghosal. Adaptive bayesian procedures using random series priors. Scandinavian Journal of Statistics, 42(4):1194–1213, 2015. 10.1111/sjos.12159. [18] Weining Shen, Surya T. Tokdar, and Subhashis Ghosal. Adaptive bayesian multivariate density estimation with dirichlet mixtures. Biometrika, 100(3):623–640, 2013. [19] Xiaotong Shen and Larry Wasserman. Rates of convergence of posterior distributions. The Annals of Statistics, 29(3):687–714, 06 2001. [20] Xiaotong Shen and Wing Hung Wong. Convergence rate of sieve estimates. The Annals of Statistics, 22(2):pp. 580–615, 1994. [21] Jacopo Soriano and Li Ma. Probabilistic multi-resolution scanning for two-sample differences. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 79(2):547–572, 2017. [22] Wing H. Wong and Li Ma. Optional pólya tree and bayesian inference. The Annals of Statistics, 38(3):1433– 1459, 06 2010. 9
2017
648
7,172
Avoiding Discrimination through Causal Reasoning Niki Kilbertus†‡ nkilbertus@tue.mpg.de Mateo Rojas-Carulla†‡ mrojas@tue.mpg.de Giambattista Parascandolo†§ gparascandolo@tue.mpg.de Moritz Hardt∗ hardt@berkeley.edu Dominik Janzing† janzing@tue.mpg.de Bernhard Sch¨olkopf† bs@tue.mpg.de †Max Planck Institute for Intelligent Systems ‡University of Cambridge §Max Planck ETH Center for Learning Systems ∗University of California, Berkeley Abstract Recent work on fairness in machine learning has focused on various statistical discrimination criteria and how they trade off. Most of these criteria are observational: They depend only on the joint distribution of predictor, protected attribute, features, and outcome. While convenient to work with, observational criteria have severe inherent limitations that prevent them from resolving matters of fairness conclusively. Going beyond observational criteria, we frame the problem of discrimination based on protected attributes in the language of causal reasoning. This viewpoint shifts attention from “What is the right fairness criterion?” to “What do we want to assume about our model of the causal data generating process?” Through the lens of causality, we make several contributions. First, we crisply articulate why and when observational criteria fail, thus formalizing what was before a matter of opinion. Second, our approach exposes previously ignored subtleties and why they are fundamental to the problem. Finally, we put forward natural causal non-discrimination criteria and develop algorithms that satisfy them. 1 Introduction As machine learning progresses rapidly, its societal impact has come under scrutiny. An important concern is potential discrimination based on protected attributes such as gender, race, or religion. Since learned predictors and risk scores increasingly support or even replace human judgment, there is an opportunity to formalize what harmful discrimination means and to design algorithms that avoid it. However, researchers have found it difficult to agree on a single measure of discrimination. As of now, there are several competing approaches, representing different opinions and striking different trade-offs. Most of the proposed fairness criteria are observational: They depend only on the joint distribution of predictor R, protected attribute A, features X, and outcome Y. For example, the natural requirement that R and A must be statistically independent is referred to as demographic parity. Some approaches transform the features X to obfuscate the information they contain about A [1]. The recently proposed equalized odds constraint [2] demands that the predictor R and the attribute A be independent conditional on the actual outcome Y. All three are examples of observational approaches. A growing line of work points at the insufficiency of existing definitions. Hardt, Price and Srebro [2] construct two scenarios with intuitively different social interpretations that admit identical joint dis31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. tributions over (R, A, Y, X). Thus, no observational criterion can distinguish them. While there are non-observational criteria, notably the early work on individual fairness [3], these have not yet gained traction. So, it might appear that the community has reached an impasse. 1.1 Our contributions We assay the problem of discrimination in machine learning in the language of causal reasoning. This viewpoint supports several contributions: • Revisiting the two scenarios proposed in [2], we articulate a natural causal criterion that formally distinguishes them. In particular, we show that observational criteria are unable to determine if a protected attribute has direct causal influence on the predictor that is not mitigated by resolving variables. • We point out subtleties in fair decision making that arise naturally from a causal perspective, but have gone widely overlooked in the past. Specifically, we formally argue for the need to distinguish between the underlying concept behind a protected attribute, such as race or gender, and its proxies available to the algorithm, such as visual features or name. • We introduce and discuss two natural causal criteria centered around the notion of interventions (relative to a causal graph) to formally describe specific forms of discrimination. • Finally, we initiate the study of algorithms that avoid these forms of discrimination. Under certain linearity assumptions about the underlying causal model generating the data, an algorithm to remove a specific kind of discrimination leads to a simple and natural heuristic. At a higher level, our work proposes a shift from trying to find a single statistical fairness criterion to arguing about properties of the data and which assumptions about the generating process are justified. Causality provides a flexible framework for organizing such assumptions. 1.2 Related work Demographic parity and its variants have been discussed in numerous papers, e.g., [1, 4–6]. While demographic parity is easy to work with, the authors of [3] already highlighted its insufficiency as a fairness constraint. In an attempt to remedy the shortcomings of demographic parity [2] proposed two notions, equal opportunity and equal odds, that were also considered in [7]. A review of various fairness criteria can be found in [8], where they are discussed in the context of criminal justice. In [9, 10] it has been shown that imperfect predictors cannot simultaneously satisfy equal odds and calibration unless the groups have identical base rates, i.e. rates of positive outcomes. A starting point for our investigation is the unidentifiability result of [2]. It shows that observedvational criteria are too weak to distinguish two intuitively very different scenarios. However, the work does not provide a formal mechanism to articulate why and how these scenarios should be considered different. Inspired by Pearl’s causal interpretation of Simpson’s paradox [11, Section 6], we propose causality as a way of coping with this unidentifiability result. An interesting non-observational fairness definition is the notion of individual fairness [3] that assumes the existence of a similarity measure on individuals, and requires that any two similar individuals should receive a similar distribution over outcomes. More recent work lends additional support to such a definition [12]. From the perspective of causality, the idea of a similarity measure is akin to the method of matching in counterfactual reasoning [13, 14]. That is, evaluating approximate counterfactuals by comparing individuals with similar values of covariates excluding the protected attribute. Recently, [15] put forward one possible causal definition, namely the notion of counterfactual fairness. It requires modeling counterfactuals on a per individual level, which is a delicate task. Even determining the effect of race at the group level is difficult; see the discussion in [16]. The goal of our paper is to assay a more general causal framework for reasoning about discrimination in machine learning without committing to a single fairness criterion, and without committing to evaluating individual causal effects. In particular, we draw an explicit distinction between the protected attribute (for which interventions are often impossible in practice) and its proxies (which sometimes can be intervened upon). 2 Moreover, causality has already been employed for the discovery of discrimination in existing data sets by [14, 17]. Causal graphical conditions to identify meaningful partitions have been proposed for the discovery and prevention of certain types of discrimination by preprocessing the data [18]. These conditions rely on the evaluation of path specific effects, which can be traced back all the way to [11, Section 4.5.3]. The authors of [19] recently picked up this notion and generalized Pearl’s approach by a constraint based prevention of discriminatory path specific effects arising from counterfactual reasoning. Our research was done independently of these works. 1.3 Causal graphs and notation Causal graphs are a convenient way of organizing assumptions about the data generating process. We will generally consider causal graphs involving a protected attribute A, a set of proxy variables P, features X, a predictor R and sometimes an observed outcome Y. For background on causal graphs see [11]. In the present paper a causal graph is a directed, acyclic graph whose nodes represent random variables. A directed path is a sequence of distinct nodes V1, . . . , Vk, for k ≥2, such that Vi →Vi+1 for all i ∈{1, . . . , k −1}. We say a directed path is blocked by a set of nodes Z, where V1, Vk /∈Z, if Vi ∈Z for some i ∈{2, . . . , k −1}.1 A structural equation model is a set of equations Vi = fi(pa(Vi), Ni), for i ∈{1, . . . , n}, where pa(Vi) are the parents of Vi, i.e. its direct causes, and the Ni are independent noise variables. We interpret these equations as assignments. Because we assume acyclicity, starting from the roots of the graph, we can recursively compute the other variables, given the noise variables. This leads us to view the structural equation model and its corresponding graph as a data generating model. The predictor R maps inputs, e.g., the features X, to a predicted output. Hence we model it as a childless node, whose parents are its input variables. Finally, note that given the noise variables, a structural equation model entails a unique joint distribution; however, the same joint distribution can usually be entailed by multiple structural equation models corresponding to distinct causal structures. 2 Unresolved discrimination and limitations of observational criteria A X R Figure 1: The admission decision R does not only directly depend on gender A, but also on department choice X, which in turn is also affected by gender A. To bear out the limitations of observational criteria, we turn to Pearl’s commentary on claimed gender discrimination in Berkeley college admissions [11, Section 4.5.3]. Bickel [20] had shown earlier that a lower college-wide admission rate for women than for men was explained by the fact that women applied in more competitive departments. When adjusted for department choice, women experienced a slightly higher acceptance rate compared with men. From the causal point of view, what matters is the direct effect of the protected attribute (here, gender A) on the decision (here, college admission R) that cannot be ascribed to a resolving variable such as department choice X, see Figure 1. We shall use the term resolving variable for any variable in the causal graph that is influenced by A in a manner that we accept as nondiscriminatory. With this convention, the criterion can be stated as follows. Definition 1 (Unresolved discrimination). A variable V in a causal graph exhibits unresolved discrimination if there exists a directed path from A to V that is not blocked by a resolving variable and V itself is non-resolving. Pearl’s commentary is consistent with what we call the skeptic viewpoint. All paths from the protected attribute A to R are problematic, unless they are justified by a resolving variable. The presence of unresolved discrimination in the predictor R is worrisome and demands further scrutiny. In practice, R is not a priori part of a given graph. Instead it is our objective to construct it as a function of the features X, some of which might be resolving. Hence we should first look for unresolved discrimination in the features. A canonical way to avoid unresolved discrimination in R is to only input the set of features that do not exhibit unresolved discrimination. However, the remaining 1As it is not needed in our work, we do not discuss the graph-theoretic notion of d-separation. 3 features might be affected by non-resolving and resolving variables. In Section 4 we investigate whether one can exclusively remove unresolved discrimination from such features. A related notion of “explanatory features” in a non-causal setting was introduced in [21]. A X1 Y X2 R∗ A Y X1 X2 R∗ Figure 2: Two graphs that may generate the same joint distribution for the Bayes optimal unconstrained predictor R∗. If X1 is a resolving variable, R∗exhibits unresolved discrimination in the right graph (along the red paths), but not in the left one. The definition of unresolved discrimination in a predictor has some interesting special cases worth highlighting. If we take the set of resolving variables to be empty, we intuitively get a causal analog of demographic parity. No directed paths from A to R are allowed, but A and R can still be statistically dependent. Similarly, if we choose the set of resolving variables to be the singleton set {Y } containing the true outcome, we obtain a causal analog of equalized odds where strict independence is not necessary. The causal intuition implied by “the protected attribute should not affect the prediction”, and “the protected attribute can only affect the prediction when the information comes through the true label”, is neglected by (conditional) statistical independences A ⊥⊥R, and A ⊥⊥R | Y , but well captured by only considering dependences mitigated along directed causal paths. We will next show that observational criteria are fundamentally unable to determine whether a predictor exhibits unresolved discrimination or not. This is true even if the predictor is Bayes optimal. In passing, we also note that fairness criteria such as equalized odds may or may not exhibit unresolved discrimination, but this is again something an observational criterion cannot determine. Theorem 1. Given a joint distribution over the protected attribute A, the true label Y , and some features X1, . . . , Xn, in which we have already specified the resolving variables, no observational criterion can generally determine whether the Bayes optimal unconstrained predictor or the Bayes optimal equal odds predictor exhibit unresolved discrimination. All proofs for the statements in this paper are in the supplementary material. The two graphs in Figure 2 are taken from [2], which we here reinterpret in the causal context to prove Theorem 1. We point out that there is an established set of conditions under which unresolved discrimination can, in fact, be determined from observational data. Note that the two graphs are not Markov equivalent. Therefore, to obtain the same joint distribution we must violate a condition called faithfulness.2 We later argue that violation of faithfulness is by no means pathological, but emerges naturally when designing predictors. In any case, interpreting conditional dependences can be difficult in practice [22]. 3 Proxy discrimination and interventions We now turn to an important aspect of our framework. Determining causal effects in general requires modeling interventions. Interventions on deeply rooted individual properties such as gender or race are notoriously difficult to conceptualize—especially at an individual level, and impossible to perform in a randomized trial. VanderWeele et al. [16] discuss the problem comprehensively in an epidemiological setting. From a machine learning perspective, it thus makes sense to separate the protected attribute A from its potential proxies, such as name, visual features, languages spoken at home, etc. Intervention based on proxy variables poses a more manageable problem. By deciding on a suitable proxy we can find an adequate mounting point for determining and removing its influence on the prediction. Moreover, in practice we are often limited to imperfect measurements of A in any case, making the distinction between root concept and proxy prudent. As was the case with resolving variables, a proxy is a priori nothing more than a descendant of A in the causal graph that we choose to label as a proxy. Nevertheless in reality we envision the proxy 2If we do assume the Markov condition and faithfulness, then conditional independences determine the graph up to its so called Markov equivalence class. 4 to be a clearly defined observable quantity that is significantly correlated with A, yet in our view should not affect the prediction. Definition 2 (Potential proxy discrimination). A variable V in a causal graph exhibits potential proxy discrimination, if there exists a directed path from A to V that is blocked by a proxy variable and V itself is not a proxy. Potential proxy discrimination articulates a causal criterion that is in a sense dual to unresolved discrimination. From the benevolent viewpoint, we allow any path from A to R unless it passes through a proxy variable, which we consider worrisome. This viewpoint acknowledges the fact that the influence of A on the graph may be complex and it can be too restraining to rule out all but a few designated features. In practice, as with unresolved discrimination, we can naively build an unconstrained predictor based only on those features that do not exhibit potential proxy discrimination. Then we must not provide P as input to R; unawareness, i.e. excluding P from the inputs of R, suffices. However, by granting R access to P, we can carefully tune the function R(P, X) to cancel the implicit influence of P on features X that exhibit potential proxy discrimination by the explicit dependence on P. Due to this possible cancellation of paths, we called the path based criterion potential proxy discrimination. When building predictors that exhibit no overall proxy discrimination, we precisely aim for such a cancellation. Fortunately, this idea can be conveniently expressed by an intervention on P, which is denoted by do(P = p) [11]. Visually, intervening on P amounts to removing all incoming arrows of P in the graph; algebraically, it consists of replacing the structural equation of P by P = p, i.e. we put point mass on the value p. Definition 3 (Proxy discrimination). A predictor R exhibits no proxy discrimination based on a proxy P if for all p, p′ P(R | do(P = p)) = P(R | do(P = p′)) . (1) The interventional characterization of proxy discrimination leads to a simple procedure to remove it in causal graphs that we will turn to in the next section. It also leads to several natural variants of the definition that we discuss in Section 4.3. We remark that Equation (1) is an equality of probabilities in the “do-calculus” that cannot in general be inferred by an observational method, because it depends on an underlying causal graph, see the discussion in [11]. However, in some cases, we do not need to resort to interventions to avoid proxy discrimination. Proposition 1. If there is no directed path from a proxy to a feature, unawareness avoids proxy discrimination. 4 Procedures for avoiding discrimination Having motivated the two types of discrimination that we distinguish, we now turn to building predictors that avoid them in a given causal model. First, we remark that a more comprehensive treatment requires individual judgement of not only variables, but the legitimacy of every existing path that ends in R, i.e. evaluation of path-specific effects [18, 19], which is tedious in practice. The natural concept of proxies and resolving variables covers most relevant scenarios and allows for natural removal procedures. 4.1 Avoiding proxy discrimination While presenting the general procedure, we illustrate each step in the example shown in Figure 3. A protected attribute A affects a proxy P as well as a feature X. Both P and X have additional unobserved causes NP and NX, where NP , NX, A are pairwise independent. Finally, the proxy also has an effect on the features X and the predictor R is a function of P and X. Given labeled training data, our task is to find a good predictor that exhibits no proxy discrimination within a hypothesis class of functions Rθ(P, X) parameterized by a real valued vector θ. We now work out a formal procedure to solve this task under specific assumptions and simultaneously illustrate it in a fully linear example, i.e. the structural equations are given by P = αP A + NP , X = αXA + βP + NX, Rθ = λP P + λXX . Note that we choose linear functions parameterized by θ = (λP , λX) as the hypothesis class for Rθ(P, X). 5 NP A NX P X R ˜G NP A NX P X R G Figure 3: A template graph ˜G for proxy discrimination (left) with its intervened version G (right). While from the benevolent viewpoint we do not generically prohibit any influence from A on R, we want to guarantee that the proxy P has no overall influence on the prediction, by adjusting P →R to cancel the influence along P → X →R in the intervened graph. NE A NX E X R ˜G NE A NX E X R G Figure 4: A template graph ˜G for unresolved discrimination (left) with its intervened version G (right). While from the skeptical viewpoint we generically do not want A to influence R, we first intervene on E interrupting all paths through E and only cancel the remaining influence on A to R. We will refer to the terminal ancestors of a node V in a causal graph D, denoted by taD(V ), which are those ancestors of V that are also root nodes of D. Moreover, in the procedure we clarify the notion of expressibility, which is an assumption about the relation of the given structural equations and the hypothesis class we choose for Rθ. Proposition 2. If there is a choice of parameters θ0 such that Rθ0(P, X) is constant with respect to its first argument and the structural equations are expressible, the following procedure returns a predictor from the given hypothesis class that exhibits no proxy discrimination and is non-trivial in the sense that it can make use of features that exhibit potential proxy discrimination. 1. Intervene on P by removing all incoming arrows and replacing the structural equation for P by P = p. For the example in Figure 3, P = p, X = αXA + βP + NX, Rθ = λP P + λXX . (2) 2. Iteratively substitute variables in the equation for Rθ from their structural equations until only root nodes of the intervened graph are left, i.e. write Rθ(P, X) as Rθ(P, g(taG(X))) for some function g. In the example, ta(X) = {A, P, NX} and Rθ = (λP + λXβ)p + λX(αXA + NX) . (3) 3. We now require the distribution of Rθ in (3) to be independent of p, i.e. for all p, p′ P((λP + λXβ)p + λX(αXA + NX)) = P((λP + λXβ)p′ + λX(αXA + NX)) . (4) We seek to write the predictor as a function of P and all the other roots of G separately. If our hypothesis class is such that there exists ˜θ such that Rθ(P, g(ta(X))) = R˜θ(P, ˜g(ta(X)\{P})), we call the structural equation model and hypothesis class specified in (2) expressible. In our example, this is possible with ˜θ = (λP + λXβ, λX) and ˜g = αXA + NX. Equation (4) then yields the non-discrimination constraint ˜θ = θ0. Here, a possible θ0 is θ0 = (0, λX), which simply yields λP = −λXβ. 4. Given labeled training data, we can optimize the predictor Rθ within the hypothesis class as given in (2), subject to the non-discrimination constraint. In the example Rθ = −λXβP + λXX = λX(X −βP) , with the free parameter λX ∈R. In general, the non-discrimination constraint (4) is by construction just P(R | do(P = p)) = P(R | do(P = p′)), coinciding with Definition 3. Thus Proposition 2 holds by construction of the procedure. The choice of θ0 strongly influences the non-discrimination constraint. However, as the example shows, it allows Rθ to exploit features that exhibit potential proxy discrimination. 6 DAG A P R X ˜G DAG A P R X G Figure 5: Left: A generic graph ˜G to describe proxy discrimination. Right: The graph corresponding to an intervention on P. The circle labeled “DAG” represents any sub-DAG of ˜G and G containing an arbitrary number of variables that is compatible with the shown arrows. Dashed arrows can, but do not have to be present in a given scenario. 4.2 Avoiding unresolved discrimination We proceed analogously to the previous subsection using the example graph in Figure 4. Instead of the proxy, we consider a resolving variable E. The causal dependences are equivalent to the ones in Figure 3 and we again assume linear structural equations E = αEA + NE, X = αXA + βE + NX, Rθ = λEE + λXX . Let us now try to adjust the previous procedure to the context of avoiding unresolved discrimination. 1. Intervene on E by fixing it to a random variable η with P(η) = P(E), the marginal distribution of E in ˜G, see Figure 4. In the example we find E = η, X = αXA + βE + NX, Rθ = λEE + λXX . (5) 2. By iterative substitution write Rθ(E, X) as Rθ(E, g(taG(X))) for some function g, i.e. in the example Rθ = (λE + λXβ)η + λXαXA + λXNX . (6) 3. We now demand the distribution of Rθ in (6) be invariant under interventions on A, which coincides with conditioning on A whenever A is a root of ˜G. Hence, in the example, for all a, a′ P((λE + λXβ)η + λXαXa + λXNX)) = P((λE + λXβ)η + λXαXa′ + λXNX)) . (7) Here, the subtle asymmetry between proxy discrimination and unresolved discrimination becomes apparent. Because Rθ is not explicitly a function of A, we cannot cancel implicit influences of A through X. There might still be a θ0 such that Rθ0 indeed fulfils (7), but there is no principled way for us to construct it. In the example, (7) suggests the obvious non-discrimination constraint λX = 0. We can then proceed as before and, given labeled training data, optimize Rθ = λEE by varying λE. However, by setting λX = 0, we also cancel the path A →E →X →R, even though it is blocked by a resolving variable. In general, if Rθ does not have access to A, we can not adjust for unresolved discrimination without also removing resolved influences from A on Rθ. If, however, Rθ is a function of A, i.e. we add the term λAA to Rθ in (5), the non-discrimination constraint is λA = −λXαX and we can proceed analogously to the procedure for proxies. 4.3 Relating proxy discriminations to other notions of fairness Motivated by the algorithm to avoid proxy discrimination, we discuss some natural variants of the notion in this section that connect our interventional approach to individual fairness and other proposed criteria. We consider a generic graph structure as shown on the left in Figure 5. The proxy P and the features X could be multidimensional. The empty circle in the middle represents any number of variables forming a DAG that respects the drawn arrows. Figure 3 is an example thereof. All dashed arrows are optional depending on the specifics of the situation. Definition 4. A predictor R exhibits no individual proxy discrimination, if for all x and all p, p′ P(R | do(P = p), X = x) = P(R | do(P = p′), X = x) . A predictor R exhibits no proxy discrimination in expectation, if for all p, p′ E[R | do(P = p)] = E[R | do(P = p′)] . 7 Individual proxy discrimination aims at comparing examples with the same features X, for different values of P. Note that this can be individuals with different values for the unobserved non-feature variables. A true individual-level comparison of the form “What would have happened to me, if I had always belonged to another group” is captured by counterfactuals and discussed in [15, 19]. For an analysis of proxy discrimination, we need the structural equations for P, X, R in Figure 5 P = ˆfP (pa(P)) , X = ˆfX(pa(X)) = fX(P, taG(X) \ {P}) , R = ˆfR(P, X) = fR(P, taG(R) \ {P}) . For convenience, we will use the notation taG P (X) := taG(X) \ {P}. We can find fX, fR from ˆfX, ˆfR by first rewriting the functions in terms of root nodes of the intervened graph, shown on the right side of Figure 5, and then assigning the overall dependence on P to the first argument. We now compare proxy discrimination to other existing notions. Theorem 2. Let the influence of P on X be additive and linear, i.e. X = fX(P, taG P (X)) = gX(taG P (X)) + µXP for some function gX and µX ∈R. Then any predictor of the form R = r(X −E[X | do(P)]) for some function r exhibits no proxy discrimination. Note that in general E[X | do(P)] ̸= E[X | P]. Since in practice we only have observational data from ˜G, one cannot simply build a predictor based on the “regressed out features” ˜X := X − E[X | P] to avoid proxy discrimination. In the scenario of Figure 3, the direct effect of P on X along the arrow P →X in the left graph cannot be estimated by E[X | P], because of the common confounder A. The desired interventional expectation E[X | do(P)] coincides with E[X | P] only if one of the arrows A →P or A →X is not present. Estimating direct causal effects is a hard problem, well studied by the causality community and often involves instrumental variables [23]. This cautions against the natural idea of using ˜X as a “fair representation” of X, as it implicitly neglects that we often want to remove the effect of proxies and not the protected attribute. Nevertheless, the notion agrees with our interventional proxy discrimination in some cases. Corollary 1. Under the assumptions of Theorem 2, if all directed paths from any ancestor of P to X in the graph G are blocked by P, then any predictor based on the adjusted features ˜X := X −E[X | P] exhibits no proxy discrimination and can be learned from the observational distribution P(P, X, Y ) when target labels Y are available. Our definition of proxy discrimination in expectation (4) is motivated by a weaker notion proposed in [24]. It asks for the expected outcome to be the same across the different populations E[R | P = p] = E[R | P = p′]. Again, when talking about proxies, we must be careful to distinguish conditional and interventional expectations, which is captured by the following proposition and its corollary. Proposition 3. Any predictor of the form R = λ(X −E[X | do(P)]) + c for λ, c ∈R exhibits no proxy discrimination in expectation. From this and the proof of Corollary 1 we conclude the following Corollary. Corollary 2. If all directed paths from any ancestor of P to X are blocked by P, any predictor of the form R = r(X −E[X | P]) for linear r exhibits no proxy discrimination in expectation and can be learned from the observational distribution P(P, X, Y ) when target labels Y are available. 5 Conclusion The goal of our work is to assay fairness in machine learning within the context of causal reasoning. This perspective naturally addresses shortcomings of earlier statistical approaches. Causal fairness criteria are suitable whenever we are willing to make assumptions about the (causal) generating 8 process governing the data. Whilst not always feasible, the causal approach naturally creates an incentive to scrutinize the data more closely and work out plausible assumptions to be discussed alongside any conclusions regarding fairness. Key concepts of our conceptual framework are resolving variables and proxy variables that play a dual role in defining causal discrimination criteria. We develop a practical procedure to remove proxy discrimination given the structural equation model and analyze a similar approach for unresolved discrimination. In the case of proxy discrimination for linear structural equations, the procedure has an intuitive form that is similar to heuristics already used in the regression literature. Our framework is limited by the assumption that we can construct a valid causal graph. The removal of proxy discrimination moreover depends on the functional form of the causal dependencies. We have focused on the conceptual and theoretical analysis, and experimental validations are beyond the scope of the present work. The causal perspective suggests a number of interesting new directions at the technical, empirical, and conceptual level. We hope that the framework and language put forward in our work will be a stepping stone for future investigations. 9 References [1] Richard S Zemel, Yu Wu, Kevin Swersky, Toniann Pitassi, and Cynthia Dwork. “Learning Fair Representations.” In: Proceedings of the International Conference of Machine Learning 28 (2013), pp. 325–333. [2] Moritz Hardt, Eric Price, Nati Srebro, et al. “Equality of opportunity in supervised learning”. In: Advances in Neural Information Processing Systems. 2016, pp. 3315–3323. [3] Cynthia Dwork, Moritz Hardt, Toniann Pitassi, Omer Reingold, and Richard Zemel. “Fairness Through Awareness”. In: Proceedings of the 3rd Innovations in Theoretical Computer Science Conference. 2012, pp. 214–226. [4] Michael Feldman, Sorelle A Friedler, John Moeller, Carlos Scheidegger, and Suresh Venkatasubramanian. “Certifying and removing disparate impact”. In: Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining. 2015, pp. 259–268. [5] Muhammad Bilal Zafar, Isabel Valera, Manuel G´omez Rogriguez, and Krishna P. Gummadi. “Fairness Constraints: Mechanisms for Fair Classification”. In: Proceedings of the 20th International Conference on Artificial Intelligence and Statistics. 2017, pp. 962–970. [6] Harrison Edwards and Amos Storkey. “Censoring Representations with an Adversary”. In: (Nov. 18, 2015). arXiv: 1511.05897v3. [7] Muhammad Bilal Zafar, Isabel Valera, Manuel G´omez Rodriguez, and Krishna P. Gummadi. “Fairness Beyond Disparate Treatment & Disparate Impact: Learning Classification Without Disparate Mistreatment”. In: Proceedings of the 26th International Conference on World Wide Web. 2017, pp. 1171–1180. [8] Richard Berk, Hoda Heidari, Shahin Jabbari, Michael Kearns, and Aaron Roth. “Fairness in Criminal Justice Risk Assessments: The State of the Art”. In: (Mar. 27, 2017). arXiv: 1703.09207v1. [9] Jon Kleinberg, Sendhil Mullainathan, and Manish Raghavan. “Inherent Trade-Offs in the Fair Determination of Risk Scores”. In: (Sept. 19, 2016). arXiv: 1609.05807v1. [10] Alexandra Chouldechova. “Fair prediction with disparate impact: A study of bias in recidivism prediction instruments”. In: (Oct. 24, 2016). arXiv: 1610.07524v1. [11] Judea Pearl. Causality. Cambridge University Press, 2009. [12] Sorelle A. Friedler, Carlos Scheidegger, and Suresh Venkatasubramanian. “On the (im)possibility of fairness”. In: (Sept. 23, 2016). arXiv: 1609.07236v1. [13] Paul R Rosenbaum and Donald B Rubin. “The central role of the propensity score in observational studies for causal effects”. In: Biometrika (1983), pp. 41–55. [14] Bilal Qureshi, Faisal Kamiran, Asim Karim, and Salvatore Ruggieri. “Causal Discrimination Discovery Through Propensity Score Analysis”. In: (Aug. 12, 2016). arXiv: 1608.03735. [15] Matt J. Kusner, Joshua R. Loftus, Chris Russell, and Ricardo Silva. “Counterfactual Fairness”. In: (Mar. 20, 2017). arXiv: 1703.06856v1. [16] Tyler J VanderWeele and Whitney R Robinson. “On causal interpretation of race in regressions adjusting for confounding and mediating variables”. In: Epidemiology 25.4 (2014), p. 473. [17] Francesco Bonchi, Sara Hajian, Bud Mishra, and Daniele Ramazzotti. “Exposing the probabilistic causal structure of discrimination”. In: (Mar. 8, 2017). arXiv: 1510.00552v3. [18] Lu Zhang and Xintao Wu. “Anti-discrimination learning: a causal modeling-based framework”. In: International Journal of Data Science and Analytics (2017), pp. 1–16. [19] Razieh Nabi and Ilya Shpitser. “Fair Inference On Outcomes”. In: (May 29, 2017). arXiv: 1705.10378v1. [20] Peter J Bickel, Eugene A Hammel, J William O’Connell, et al. “Sex bias in graduate admissions: Data from Berkeley”. In: Science 187.4175 (1975), pp. 398–404. [21] Faisal Kamiran, Indr˙e ˇZliobait˙e, and Toon Calders. “Quantifying explainable discrimination and removing illegal discrimination in automated decision making”. In: Knowledge and information systems 35.3 (2013), pp. 613–644. [22] Nicholas Cornia and Joris M Mooij. “Type-II errors of independence tests can lead to arbitrarily large errors in estimated causal effects: An illustrative example”. In: Proceedings of the Workshop on Causal Inference (UAI). 2014, pp. 35–42. 10 [23] Joshua Angrist and Alan B Krueger. Instrumental variables and the search for identification: From supply and demand to natural experiments. Tech. rep. National Bureau of Economic Research, 2001. [24] Toon Calders and Sicco Verwer. “Three naive Bayes approaches for discrimination-free classification”. In: Data Mining and Knowledge Discovery 21.2 (2010), pp. 277–292. 11
2017
649
7,173
Unifying PAC and Regret: Uniform PAC Bounds for Episodic Reinforcement Learning Christoph Dann Machine Learning Department Carnegie-Mellon University cdann@cdann.net Tor Lattimore∗ tor.lattimore@gmail.com Emma Brunskill Computer Science Department Stanford University ebrun@cs.stanford.edu Abstract Statistical performance bounds for reinforcement learning (RL) algorithms can be critical for high-stakes applications like healthcare. This paper introduces a new framework for theoretically measuring the performance of such algorithms called Uniform-PAC, which is a strengthening of the classical Probably Approximately Correct (PAC) framework. In contrast to the PAC framework, the uniform version may be used to derive high probability regret guarantees and so forms a bridge between the two setups that has been missing in the literature. We demonstrate the benefits of the new framework for finite-state episodic MDPs with a new algorithm that is Uniform-PAC and simultaneously achieves optimal regret and PAC guarantees except for a factor of the horizon. 1 Introduction The recent empirical successes of deep reinforcement learning (RL) are tremendously exciting, but the performance of these approaches still varies significantly across domains, each of which requires the user to solve a new tuning problem [1]. Ultimately we would like reinforcement learning algorithms that simultaneously perform well empirically and have strong theoretical guarantees. Such algorithms are especially important for high stakes domains like health care, education and customer service, where non-expert users demand excellent outcomes. We propose a new framework for measuring the performance of reinforcement learning algorithms called Uniform-PAC. Briefly, an algorithm is Uniform-PAC if with high probability it simultaneously for all ε > 0 selects an ε-optimal policy on all episodes except for a number that scales polynomially with 1/ε. Algorithms that are Uniform-PAC converge to an optimal policy with high probability and immediately yield both PAC and high probability regret bounds, which makes them superior to algorithms that come with only PAC or regret guarantees. Indeed, (a) Neither PAC nor regret guarantees imply convergence to optimal policies with high probability; (b) (ε, δ)-PAC algorithms may be ε/2-suboptimal in every episode; (c) Algorithms with small regret may be maximally suboptimal infinitely often. ∗Tor Lattimore is now at DeepMind, London 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. Uniform-PAC algorithms suffer none of these drawbacks. One could hope that existing algorithms with PAC or regret guarantees might be Uniform-PAC already, with only the analysis missing. Unfortunately this is not the case and modification is required to adapt these approaches to satisfy the new performance metric. The key insight for obtaining Uniform-PAC guarantees is to leverage time-uniform concentration bounds such as the finite-time versions of the law of iterated logarithm, which obviates the need for horizon-dependent confidence levels. We provide a new optimistic algorithm for episodic RL called UBEV that is Uniform PAC. Unlike its predecessors, UBEV uses confidence intervals based on the law of iterated logarithm (LIL) which hold uniformly over time. They allow us to more tightly control the probability of failure events in which the algorithm behaves poorly. Our analysis is nearly optimal according to the traditional metrics, with a linear dependence on the state space for the PAC setting and square root dependence for the regret. Therefore UBEV is a Uniform PAC algorithm with PAC bounds and high probability regret bounds that are near optimal in the dependence on the length of the episodes (horizon) and optimal in the state and action spaces cardinality as well as the number of episodes. To our knowledge UBEV is the first algorithm with both near-optimal PAC and regret guarantees. Notation and setup. We consider episodic fixed-horizon MDPs with time-dependent dynamics, which can be formalized as a tuple M = (S, A, pR, P, p0, H). The statespace S and the actionspace A are finite sets with cardinality S and A. The agent interacts with the MDP in episodes of H time steps each. At the beginning of each time-step t ∈[H] the agent observes a state st and chooses an action at based on a policy π that may depend on the within-episode time step (at = π(st, t)). The next state is sampled from the tth transition kernel st+1 ∼P(·|st, at, t) and the initial state from s1 ∼p0. The agent then receives a reward drawn from a distribution pR(st, at, t) which can depend on st, at and t with mean r(st, at, t) determined by the reward function. The reward distribution pR is supported on [0, 1].2 The value function from time step t for policy π is defined as V π t (s) := E " H X i=t r(si, ai, i) st = s # = X s′∈S P(s′|s, π(s, t), t)V π t+1(s′) + r(s, π(s, t), t) . and the optimal value function is denoted by V ⋆ t . In any fixed episode, the quality of a policy π is evaluated by the total expected reward or return ρπ := E " H X i=t r(si, ai, i) π # = p⊤ 0 V π 1 , which is compared to the optimal return ρ⋆= p⊤ 0 V ⋆ 1 . For this notation p0 and the value functions V ⋆ t , V π 1 are interpreted as vectors of length S. If an algorithm follows policy πk in episode k, then the optimality gap in episode k is ∆k := ρ⋆−ρπk which is bounded by ∆max = maxπ ρ⋆−ρπ ≤H. We let Nε := P∞ k=1 I{∆k > ε} be the number of ε-errors and R(T) be the regret after T episodes: R(T) := PT k=1 ∆k. Note that T is the number of episodes and not total time steps (which is HT after T episodes) and k is an episode index while t usually denotes time indices within an episode. The ˜O notation is similar to the usual O-notation but suppresses additional polylog-factors, that is g(x) = ˜O(f(x)) iff there is a polynomial p such that g(x) = O(f(x)p(log(x))). 2 Uniform PAC and Existing Learning Frameworks We briefly summarize the most common performance measures used in the literature. • (ε, δ)-PAC: There exists a polynomial function FPAC(S, A, H, 1/ε, log(1/δ)) such that P (Nε > FPAC(S, A, H, 1/ε, log(1/δ))) ≤δ . • Expected Regret: There exists a function FER(S, A, H, T) such that E[R(T)] ≤ FER(S, A, H, T). • High Probability Regret: There exists a function FHPR(S, A, H, T, log(1/δ)) such that P (R(T) > FHPR(S, A, H, T, log(1/δ))) ≤δ . 2The reward may be allowed to depend on the next-state with no further effort in the proofs. The boundedness assumption could be replaced by the assumption of subgaussian noise with known subgaussian parameter. 2 • Uniform High Probability Regret: There exists a function FUHPR(S, A, H, T, log(1/δ)) such that P (exists T : R(T) > FUHPR(S, A, H, T, log(1/δ))) ≤δ . In all definitions the function F should be polynomial in all arguments. For notational conciseness we often omit some of the parameters of F where the context is clear. The different performance guarantees are widely used (e.g. PAC: [2, 3, 4, 5], (uniform) high-probability regret: [6, 7, 8]; expected regret: [9, 10, 11, 12]). Due to space constraints, we will not discuss Bayesian-style performance guarantees that only hold in expectation with respect to a distribution over problem instances. We will shortly discuss the limitations of the frameworks listed above, but first formally define the Uniform-PAC criteria Definition 1 (Uniform-PAC). An algorithm is Uniform-PAC for δ > 0 if P (exists ε > 0 : Nε > FUPAC (S, A, H, 1/ε, log(1/δ))) ≤δ , where FUPAC is polynomial in all arguments. All the performance metrics are functions of the distribution of the sequence of errors over the episodes (∆k)k∈N. Regret bounds are the integral of this sequence up to time T, which is a random variable. The expected regret is just the expectation of the integral, while the high-probability regret is a quantile. PAC bounds are the quantile of the size of the superlevel set for a fixed level ε. Uniform-PAC bounds are like PAC bounds, but hold for all ε simultaneously. Limitations of regret. Since regret guarantees only bound the integral of ∆k over k, it does not distinguish between making a few severe mistakes and many small mistakes. In fact, since regret bounds provably grow with the number of episodes T, an algorithm that achieves optimal regret may still make infinitely many mistakes (of arbitrary quality, see proof of Theorem 2 below). This is highly undesirable in high-stakes scenarios. For example in drug treatment optimization in healthcare, we would like to distinguish between infrequent severe complications (few large ∆k) and frequent minor side effects (many small ∆k). In fact, even with an optimal regret bound, we could still serve infinitely patients with the worst possible treatment. Limitations of PAC. PAC bounds limit the number of mistakes for a given accuracy level ε, but is otherwise non-restrictive. That means an algorithm with ∆k > ε/2 for all k almost surely might still be (ε, δ)-PAC. Worse, many algorithms designed to be (ε, δ)-PAC actually exhibit this behavior because they explicitly halt learning once an ε-optimal policy has been found. The less widely used TCE (total cost of exploration) bounds [13] and KWIK guarantees [14] suffer from the same issueand for conciseness are not discussed in detail. Advantages of Uniform-PAC. The new criterion overcomes the limitations of PAC and regret guarantees by measuring the number of ε-errors at every level simultaneously. By definition, algorithms that are Uniform-PAC for a δ are (ε, δ)-PAC for all ε > 0. We will soon see that an algorithm with a non-trivial Uniform-PAC guarantee also has small regret with high probability. Furthermore, there is no loss in the reduction so that an algorithm with optimal Uniform-PAC guarantees also has optimal regret, at least in the episodic RL setting. In this sense Uniform-PAC is the missing bridge between regret and PAC. Finally, for algorithms based on confidence bounds, Uniform-PAC guarantees are usually obtained without much additional work by replacing standard concentration bounds with versions that hold uniformly over episodes (e.g. using the law of the iterated logarithms). In this sense we think Uniform-PAC is the new ‘gold-standard’ of theoretical guarantees for RL algorithms. 2.1 Relationships between Performance Guarantees Existing theoretical analyses usually focus exclusively on either the regret or PAC framework. Besides occasional heuristic translations, Proposition 4 in [15] and Corollary 3 in [6] are the only results relating a notion of PAC and regret, we are aware of. Yet the guarantees there are not widely used3 3The average per-step regret in [6] is superficially a PAC bound, but does not hold over infinitely many time-steps and exhibits the limitations of a conventional regret bound. The translation to average loss in [15] comes at additional costs due to the discounted infinite horizon setting. 3 Uniform PAC Expected Regret High-Prob. Regret Uniform High- Prob. Regret PAC implies implies implies preclude cannot imply implies subopt. for single T Figure 1: Visual summary of relationship among the different learning frameworks: Expected regret (ER) and PAC preclude each other while the other crossed arrows represent only a does-not-implies relationship. Blue arrows represent imply relationships. For details see the theorem statements. unlike the definitions given above which we now formally relate to each other. A simplified overview of the relations discussed below is shown in Figure 1. Theorem 1. No algorithm can achieve • a sub-linear expected regret bound for all T and • a finite (ε, δ)-PAC bound for a small enough ε simultaneously for all two-armed multi-armed bandits with Bernoulli reward distributions. This implies that such guarantees also cannot be satisfied simultaneously for all episodic MDPs. A full proof is in Appendix A.1, but the intuition is simple. Suppose a two-armed Bernoulli bandit has mean rewards 1/2 + ε and 1/2 respectively and the second arm is chosen at most F < ∞times with probability at least 1 −δ, then one can easily show that in an alternative bandit with mean rewards 1/2 + ε and 1/2 + 2ε there is a non-zero probability that the second arm is played finitely often and in this bandit the expected regret will be linear. Therefore, sub-linear expected regret is only possible if each arm is pulled infinitely often almost surely. Theorem 2. The following statements hold for performance guarantees in episodic MDPs: (a) If an algorithm satisfies a (ε, δ)-PAC bound with FPAC = Θ(1/ε2) then it satisfies for a specific T = Θ(ε−3) a FHPR = Θ(T 2/3) bound. Further, there is an MDP and algorithm that satisfies the (ε, δ)-PAC bound FPAC = Θ(1/ε2) on that MDP and has regret R(T) = Ω(T 2/3) on that MDP for any T. That means a (ε, δ)-PAC bound with FPAC = Θ(1/ε2) can only be converted to a high-probability regret bound with FHPR = Ω(T 2/3). (b) For any chosen ε, δ > 0 and FPAC, there is an MDP and algorithm that satisfies the (ε, δ)-PAC bound FPAC on that MDP and has regret R(T) = Ω(T) on that MDP. That means a (ε, δ)-PAC bound cannot be converted to a sub-linear uniform high-probability regret bound. (c) For any FUHPR(T, δ) with FUHPR(T, δ) →∞as T →∞, there is an algorithm that satisfies that uniform high-probability regret bound on some MDP but makes infinitely many mistakes for any sufficiently small accuracy level ε > 0 for that MDP. Therefore, a high-probability regret bound (uniform or not) cannot be converted to a finite (ε, δ)-PAC bound. (d) For any FUHPR(T, δ) there is an algorithm that satisfies that uniform high-probability regret bound on some MDP but suffers expected regret ER(T) = Ω(T) on that MDP. For most interesting RL problems including episodic MDPs the worst-case expected regret grows with O( √ T). The theorem shows that establishing an optimal high probability regret bound does not imply any finite PAC bound. While PAC bounds may be converted to regret bounds, the resulting bounds are necessarily severely suboptimal with a rate of T 2/3. The next theorem formalises the claim that Uniform-PAC is stronger than both the PAC and high-probability regret criteria. 4 Theorem 3. Suppose an algorithm is Uniform-PAC for some δ with FUPAC = ˜O(C1/ε + C2/ε2) where C1, C2 > 0 are constant in ε, but may depend on other quantities such as S, A, H, log(1/δ), then the algorithm (a) converges to optimal policies with high probability: P(limk→∞∆k = 0) ≥1 −δ. (b) is (ε, δ)-PAC with bound FPAC = FUPAC for all ε. (c) enjoys a high-probability regret at level δ with FUHPR = ˜O(√C2T + max{C1, C2}). Observe that stronger uniform PAC bounds lead to stronger regret bounds and for RL in episodic MDPs, an optimal uniform-PAC bound implies a uniform regret bound. To our knowledge, there are no existing approaches with PAC or regret guarantees that are Uniform-PAC. PAC methods such as MBIE, MoRMax, UCRL-γ, UCFH, Delayed Q-Learning or Median-PAC all depend on advance knowledge of ε and eventually stop improving their policies. Even when disabling the stopping condition, these methods are not uniform-PAC as their confidence bounds only hold for finitely many episodes and are eventually violated according to the law of iterated logarithms. Existing algorithms with uniform high-probability regret bounds such as UCRL2 or UCBVI [16] also do not satisfy uniform-PAC bounds since they use upper confidence bounds with width p log(T)/n where T is the number of observed episodes and n is the number of observations for a specific state and action. The presence of log(T) causes the algorithm to try each action in each state infinitely often. One might begin to wonder if uniform-PAC is too good to be true. Can any algorithm meet the requirements? We demonstrate in Section 4 that the answer is yes by showing that UBEV has meaningful Uniform-PAC bounds. A key technique that allows us to prove these bounds is the use of finite-time law of iterated logarithm confidence bounds which decrease at rate p (log log n)/n. 3 The UBEV Algorithm The pseudo-code for the proposed UBEV algorithm is given in Algorithm 1. In each episode it follows an optimistic policy πk that is computed by backwards induction using a carefully chosen confidence interval on the transition probabilities in each state. In line 8 an optimistic estimate of the Q-function for the current state-action-time triple is computed using the empirical estimates of the expected next state value ˆVnext ∈R (given that the values at the next time are ˜Vt+1) and expected immediate reward ˆr plus confidence bounds (H −t)φ and φ. We show in Lemma D.1 in the appendix that the policy update in Lines 3–9 finds an optimal solution to maxP ′,r′,V ′,π′ Es∼p0[V ′ 1(s)] subject to the constraints that for all s ∈S, a ∈A, t ∈[H], V ′ t (s) = r(s, π′(s, t), t) + P ′(s, π′(s, t), t)⊤V ′ t+1 (Bellman Equation) (1) V ′ H+1 = 0, P ′(s, a, t) ∈∆S, r′(s, a, t) ∈[0, 1] |[(P ′ −ˆPk)(s, a, t)]⊤V ′ t+1| ≤φ(s, a, t)(H −t) |r′(s, a, t) −ˆrk(s, a, t)| ≤φ(s, a, t) (2) where (P ′ −ˆPk)(s, a, t) is short for P ′(s, a, t) −ˆPk(s, a, t) = P ′(·|s, a, t) −ˆPk(·|s, a, t) and φ(s, a, t) = s 2 ln ln max{e, n(s, a, t)} + ln(18SAH/δ) n(s, a, t) = O s ln(SAH ln(n(s, a, t))/δ) n(s, a, t) ! is the width of a confidence bound with e = exp(1) and ˆPk(s′|s, a, t) = m(s′,s,a,t) n(s,a,t) are the empirical transition probabilities and ˆrk(s, a, t) = l(s, a, t)/n(s, a, t) the empirical immediate rewards (both at the beginning of the kth episode). Our algorithm is conceptually similar to other algorithms based on the optimism principle such as MBIE [5], UCFH [3], UCRL2 [6] or UCRL-γ [2] but there are several key differences: • Instead of using confidence intervals over the transition kernel by itself, we incorporate the value function directly into the concentration analysis. Ultimately this saves a factor of S in the sample complexity, but the price is a more difficult analysis. Previously MoRMax [17] also used the idea of directly bounding the transition and value function, but in a very different algorithm that required discarding data and had a less tight bound. A similar technique has been used by Azar et al. [16]. 5 Algorithm 1: UBEV (Upper Bounding the Expected Next State Value) Algorithm Input:failure tolerance δ ∈(0, 1] 1 n(s, a, t) = l(s, a, t) = m(s′, s, a, t) = 0; ˜VH+1(s′) := 0 ∀s, s′ ∈S, a ∈A, t ∈[H] 2 for k = 1, 2, 3, . . . do /* Optimistic planning */ 3 for t = H to 1 do 4 for s ∈S do 5 for a ∈A do 6 φ := q 2 ln ln(max{e,n(s,a,t)})+ln(18SAH/δ) n(s,a,t) // confidence bound 7 ˆr := l(s,a,t) n(s,a,t); ˆVnext := m(·,s,a,t)⊤˜Vt+1 n(s,a,t) // empirical estimates 8 Q(a) := min {1, ˆr + φ} + min n max ˜Vt+1, ˆVnext + (H −t)φ o 9 πk(s, t) := arg maxa Q(a), ˜Vt(s) := Q(πk(s, t)) /* Execute policy for one episode */ 10 s1 ∼p0; 11 for t = 1 to H do 12 at := πk(st, t), rt ∼pR(st, at, t) and st+1 ∼P(st, at, t) 13 n(st, at, t)++; m(st+1, st, at, t)++; l(st, at, t)+= rt // update statistics 103 104 105 106 107 Number of Episodes 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 Expected Return S=5 103 104 105 106 107 Number of Episodes 0.5 1.0 1.5 2.0 2.5 3.0 Expected Return S=50 103 104 105 106 107 Number of Episodes 0.5 1.0 1.5 2.0 2.5 Expected Return S=200 MoRMax UBEV UCRL2 MBIE MedianPAC DelayedQL OIM UCFH UCBVI_1 UCBVI_2 optimal Figure 2: Empirical comparison of optimism-based algorithms with frequentist regret or PAC bounds on a randomly generated MDP with 3 actions, time horizon 10 and S = 5, 50, 200 states. All algorithms are run with parameters that satisfy their bound requirements. A detailed description of the experimental setup including a link to the source code can be found in Appendix B. • Many algorithms update their policy less and less frequently (usually when the number of samples doubles), and only finitely often in total. Instead, we update the policy after every episode, which means that UBEV immediately leverages new observations. • Confidence bounds in existing algorithms that keep improving the policy (e.g. Jaksch et al. [6], Azar et al. [16]) scale at a rate p log(k)/n where k is the number of episodes played so far and n is the number of times the specific (s, a, t) has been observed. As the results of a brief empirical comparison in Figure 2 indicate, this leads to slow learning (compare UCBVI_1 and UBEV’s performance which differ essentially only by their use of different rate bounds). Instead the width of UBEV’s confidence bounds φ scales at rate p ln ln(max{e, n})/n ≈ p (log log n)/n which is the best achievable rate and results in significantly faster learning. 4 Uniform PAC Analysis We now discuss the Uniform-PAC analysis of UBEV which results in the following Uniform-PAC and regret guarantee. 6 Theorem 4. Let πk be the policy of UBEV in the kth episode. Then with probability at least 1 −δ for all ε > 0 jointly the number of episodes k where the expected return from the start state is not ε-optimal (that is ∆k > ε) is at most O SAH4 ε2 min  1+εS2A, S polylog  A, S, H, 1 ε, 1 δ  . Therefore, with probability at least 1 −δ UBEV converges to optimal policies and for all episodes T has regret R(T) = O  H2( √ SAT + S3A2) polylog(S, A, H, T)  . Here polylog(x . . . ) is a function that can be bounded by a polynomial of logarithm, that is, ∃k, C : polylog(x . . . ) ≤ln(x . . . )k+C. In Appendix C we provide a lower bound on the sample complexity that shows that if ε < 1/(S2A), the Uniform-PAC bound is tight up to log-factors and a factor of H. To our knowledge, UBEV is the first algorithm with both near-tight (up to H factors) high probability regret and (ε, δ) PAC bounds as well as the first algorithm with any nontrivial uniform-PAC bound. Using Theorem 3 the convergence and regret bound follows immediately from the uniform PAC bound. After a discussion of the different confidence bounds allowing us to prove uniform-PAC bounds, we will provide a short proof sketch of the uniform PAC bound. 4.1 Enabling Uniform PAC With Law-of-Iterated-Logarithm Confidence Bounds To have a PAC bound for all ε jointly, it is critical that UBEV continually make use of new experience. If UBEV stopped leveraging new observations after some fixed number, it would not be able to distinguish with high probability among which of the remaining possible MDPs do or do not have optimal policies that are sufficiently optimal in the other MDPs. The algorithm therefore could potentially follow a policy that is not at least ε-optimal for infinitely many episodes for a sufficiently small ε. To enable UBEV to incorporate all new observations, the confidence bounds in UBEV must hold for an infinite number of updates. We therefore require a proof that the total probability of all possible failure events (of the high confidence bounds not holding) is bounded by δ, in order to obtain high probability guarantees. In contrast to prior (ε, δ)-PAC proofs that only consider a finite number of failure events (which is enabled by requiring an RL algorithm to stop using additional data), we must bound the probability of an infinite set of possible failure events. Some choices of confidence bounds will hold uniformly across all sample sizes but are not sufficiently tight for uniform PAC results. For example, the recent work by Azar et al. [16] uses confidence intervals that shrink at a rate of q ln T n , where T is the number of episodes, and n is the number of samples of a (s, a) pair at a particular time step. This confidence interval will hold for all episodes, but these intervals do not shrink sufficiently quickly and can even increase. One simple approach for constructing confidence intervals that is sufficient for uniform PAC guarantees is to combine bounds for fixed number of samples with a union bound allocating failure probability δ/n2 to the failure case with n samples. This results in confidence intervals that shrink at rate p 1/n ln n. Interestingly we know of no algorithms that do such in our setting. We follow a similarly simple but much stronger approach of using law-of-iterated logarithm (LIL) bounds that shrink at the better rate of p 1/n ln ln n. Such bounds have sparked recent interest in sequential decision making [18, 19, 20, 21, 22] but to the best of our knowledge we are the first to leverage them for RL. We prove several general LIL bounds in Appendix F and explain how we use these results in our analysis in Appendix E.2. These LIL bounds are both sufficient to ensure uniform PAC bounds, and much tighter (and therefore will lead to much better performance) than p 1/n ln T bounds. Indeed, LIL have the tightest possible rate dependence on the number of samples n for a bound that holds for all timesteps (though they are not tight with respect to constants). 4.2 Proof Sketch We now provide a short overview of our uniform PAC bound in Theorem 4. It follows the typical scheme for optimism based algorithms: we show that in each episode UBEV follows a policy that is 7 optimal with respect to the MDP ˜ Mk that yields highest return in a set of MDPs Mk given by the constraints in Eqs. (1)–(2) (Lemma D.1 in the appendix). We then define a failure event F (more details see below) such that on the complement F C, the true MDP is in Mk for all k. Under the event that the true MDP is in the desired set, the V π 1 ≤V ⋆ 1 ≤˜V πk 1 , i.e., the value ˜V πk 1 of πk in MDP ˜ Mk is higher than the optimal value function of the true MDP M (Lemma E.16). Therefore, the optimality gap is bounded by ∆k ≤p⊤ 0 ( ˜V πk 1 −V πk 1 ). The right hand side this expression is then decomposed via a standard identity (Lemma E.15) as H X t=1 X (s,a)∈S×A wtk(s, a)(( ˜Pk −P)(s, a, t))⊤˜V πk t+1 + H X t=1 X (s,a)∈S×A wtk(s, a)(˜rk(s, a, t) −r(s, a, t)), where wtk(s, a) is the probability that when following policy πk in the true MDP we encounter st = s and at = a. The quantities ˜Pk, ˜rk are the model parameters of the optimistic MDP ˜ Mk For the sake of conciseness, we ignore the second term above in the following which can be bounded by ε/3 in the same way as the first. We further decompose the first term as X t∈[H] (s,a)∈Lc tk wtk(s, a)(( ˜Pk −P)(s, a, t))⊤˜V πk t+1 (3) + X t∈[H] (s,a)∈Ltk wtk(s, a)(( ˜Pk −ˆPk)(s, a, t))⊤˜V πk t+1 + X t∈[H] (s,a)∈Ltk wtk(s, a)(( ˆPk −P)(s, a, t))⊤˜V πk t+1 (4) where Ltk =  (s, a) ∈S × A : wtk(s, a) ≥wmin = ε 3HS2 is the set of state-action pairs with non-negligible visitation probability. The value of wmin is chosen so that (3) is bounded by ε/3. Since ˜V πk is the optimal solution of the optimization problem in Eq. (1), we can bound |(( ˜Pk−ˆPk)(s, a, t))⊤˜V πk t+1| ≤φk(s, a, t)(H −t) = O s H2 ln (ln(ntk(s, a))/δ) ntk(s, a) ! , (5) where φk(s, a, t) is the value of φ(s, a, t) and ntk(s, a) the value of n(s, a, t) right before episode k. Further we decompose |(( ˆPk −P)(s, a, t))⊤˜V πk t+1| ≤∥( ˆPk −P)(s, a, t)∥1∥˜V πk t+1∥∞≤O   s SH2 ln ln ntk(s,a) δ ntk(s, a)  ,(6) where the second inequality follows from a standard concentration bound used in the definition of the failure event F (see below). Substituting this and (5) into (4) leads to (4) ≤O   H X t=1 X s,a∈Ltk wtk(s, a) s SH2 ln(ln(ntk(s, a))/δ) ntk(s, a)  . (7) On F C it also holds that ntk(s, a) ≥1 2 P i<k wti(s, a) −ln 9SAH δ and so on nice episodes where each (s, a) ∈Ltk with significant probability wtk(s, a) also had significant probability in the past, i.e., P i<k wti(s, a) ≥4 ln 9SA δ , it holds that ntk(s, a) ≥1 4 P i<k wti(s, a). Substituting this into (7), we can use a careful pidgeon-hole argument laid out it Lemma E.3 in the appendix to show that this term is bounded by ε/3 on all but O(AS2H4/ε2 polylog(A, S, H, 1/ε, 1/δ)) nice episodes. Again using a pidgeon-hole argument, one can show that all but at most O(S2AH3/ε ln(SAH/δ)) episodes are nice. Combining both bounds, we get that on F C the optimality gap ∆k is at most ε except for at most O(AS2H4/ε2 polylog(A, S, H, 1/ε, 1/δ)) episodes. We decompose the failure event into multiple components. In addition to the events F N k that a (s, a, t) triple has been observed few times compared to its visitation probabilities in the past, i.e., ntk(s, a) < 1 2 P i<k wti(s, a) −ln 9SAH δ as well as a conditional version of this statement, the failure event F contains events where empirical estimates of the immediate rewards, the expected optimal value of the successor states and the individual transition probabilites are far from their true 8 expectations. For the full definition of F see Appendix E.2. F also contains event F L1 we used in Eq. (6) defined as  ∃k, s, a, t : ∥ˆPk(s, a, t) −P(s, a, t)∥1 ≥ r 4 ntk(s,a)  2 llnp(ntk(s, a)) + ln 18SAH(2S−2) δ  . It states that the L1-distance of the empirical transition probabilities to the true probabilities for any (s, a, t) in any episode k is too large and we show that P(F L1) ≤1 −δ/9 using a uniform version of the popular bound by Weissman et al. [23] which we prove in Appendix F. We show in similar manner that the other events in F have small probability uniformly for all episodes k so that P(F) ≤δ. Together this yields the uniform PAC bound in Thm. 4 using the second term in the min. With a more refined analysis that avoids the use of Hölder’s inequality in (6) and a stronger notion of nice episodes called friendly episodes we obtain the bound with the first term in the min. However, since a similar analysis has been recently released [16], we defer this discussion to the appendix. 4.3 Discussion of UBEV Bound The (Uniform-)PAC bound for UBEV in Theorem 4 is never worse than ˜O(S2AH4/ε2), which improves on the similar MBIE algorithm by a factor of H2 (after adapting the discounted setting for which MBIE was analysed to our setting). For ε < 1/(S2A) our bound has a linear dependence on the size of the state-space and depends on H4, which is a tighter dependence on the horizon than MoRMax’s ˜O(SAH6/ε2), the best sample-complexity bound with linear dependency S so far. Comparing UBEV’s regret bound to the ones of UCRL2 [6] and REGAL [24] requires care because (a) we measure the regret over entire episodes and (b) our transition dynamics are time-dependent within each episode, which effectively increases the state-space by a factor of H. Converting the bounds for UCRL2/REGAL to our setting yields a regret bound of order SH2√ AHT. Here, the diameter is H, the state space increases by H due to time-dependent transition dynamics and an additional √ H is gained by stating the regret in terms of episodes T instead of time steps. Hence, UBEV’s bounds are better by a factor of √ SH. Our bound matches the recent regret bound for episodic RL by Azar et al. [16] in the S, A and T terms but not in H. Azar et al. [16] has regret bounds that are optimal in H but their algorithm is not uniform PAC, due to the characteristics we outlined in Section 2. 5 Conclusion The Uniform-PAC framework strengthens and unifies the PAC and high-probability regret performance criteria for reinforcement learning in episodic MDPs. The newly proposed algorithm is Uniform-PAC, which as a side-effect means it is the first algorithm that is both PAC and has sublinear (and nearly optimal) regret. Besides this, the use of law-of-the-iterated-logarithm confidence bounds in RL algorithms for MDPs provides a practical and theoretical boost at no cost in terms of computation or implementation complexity. This work opens up several immediate research questions for future work. The definition of Uniform-PAC and the relations to other PAC and regret notions directly apply to multi-armed bandits and contextual bandits as special cases of episodic RL, but not to infinite horizon reinforcement learning. An extension to these non-episodic RL settings is highly desirable. Similarly, a version of the UBEV algorithm for infinite-horizon RL with linear state-space sample complexity would be of interest. More broadly, if theory is ever to say something useful about practical algorithms for large-scale reinforcement learning, then it will have to deal with the unrealizable function approximation setup (unlike the tabular function representation setting considered here), which is a major long-standing open challenge. Acknowledgements. We appreciate the support of a NSF CAREER award and a gift from Yahoo. References [1] Vincent François-Lavet, Raphaël Fonteneau, and Damien Ernst. How to discount deep reinforcement learning: Towards new dynamic strategies. In NIPS 2015 Workshop on Deep 9 Reinforcement Learning, 2015. [2] Tor Lattimore and Marcus Hutter. Near-optimal PAC bounds for discounted MDPs. In Theoretical Computer Science, volume 558, 2014. [3] Christoph Dann and Emma Brunskill. Sample Complexity of Episodic Fixed-Horizon Reinforcement Learning. In Neural Information Processing Systems, 2015. [4] Nan Jiang, Akshay Krishnamurthy, Alekh Agarwal, John Langford, and Robert E Schapire. Contextual Decision Processes with Low Bellman Rank are PAC-Learnable. In International Conference on Machine Learning, 2017. [5] Alexander L Strehl, Lihong Li, and Michael L Littman. Reinforcement Learning in Finite MDPs : PAC Analysis. Journal of Machine Learning Research, 10:2413–2444, 2009. [6] Thomas Jaksch, Ronald Ortner, and Peter Auer. Near-optimal Regret Bounds for Reinorcement Learning. Journal of Machine Learning Research, 11:1563–1600, 2010. [7] Alekh Agarwal, Daniel Hsu, Satyen Kale, John Langford, Lihong Li, and Robert E. Schapire. Taming the Monster: A Fast and Simple Algorithm for Contextual Bandits. In Journal of Machine Learning Research, volume 32, 2014. [8] Niranjan Srinivas, Andreas Krause, Sham M. Kakade, and Matthias W. Seeger. Informationtheoretic regret bounds for Gaussian process optimization in the bandit setting. In IEEE Transactions on Information Theory, volume 58, 2012. [9] Jean Yves Audibert, Rémi Munos, and Csaba Szepesvári. Exploration-exploitation tradeoff using variance estimates in multi-armed bandits. Theoretical Computer Science, 410(19): 1876–1902, 2009. [10] Peter Auer. Using upper confidence bounds for online learning. Proceedings 41st Annual Symposium on Foundations of Computer Science, pages 270–293, 2000. [11] Sébastien Bubeck and Nicolò Cesa-Bianchi. Regret Analysis of Stochastic and Nonstochastic Multi-armed Bandit Problems. arXiv.org, cs.LG(1):138, 2012. [12] Peter Auer and Ronald Ortner. Online Regret Bounds for a New Reinforcement Learning Algorithm. In Proceedings 1st Austrian Cognitive Vision Workshop, 2005. [13] Jason Pazis and Ronald Parr. Efficient PAC-optimal Exploration in Concurrent , Continuous State MDPs with Delayed Updates. In AAAI Conference on Artificial Intelligence, 2016. [14] Lihong Li, Michael L. Littman, Thomas J. Walsh, and Alexander L. Strehl. Knows what it knows: A framework for self-aware learning. Machine Learning, 82(3):399–443, nov 2011. [15] Alexander L. Strehl and Michael L. Littman. An analysis of model-based Interval Estimation for Markov Decision Processes. Journal of Computer and System Sciences, 74(8):1309–1331, 2008. [16] Mohammad Gheshlaghi Azar, Ian Osband, and Rémi Munos. Minimax Regret Bounds for Reinforcement Learning. In International Conference on Machine Learning, 2017. [17] Istvàn Szita and Csaba Szepesvári. Model-based reinforcement learning with nearly tight exploration complexity bounds. In International Conference on Machine Learning, 2010. [18] Kevin Jamieson, Matthew Malloy, Robert Nowak, and Sébastien Bubeck. lil’ UCB : An Optimal Exploration Algorithm for Multi-Armed Bandits. 2013. [19] Akshay Balsubramani and Aaditya Ramdas. Sequential Nonparametric Testing with the Law of the Iterated Logarithm. In Uncertainty in Artificial Intelligence, 2016. [20] Aurélien Garivier, Emilie Kaufmann, and Tor Lattimore. On Explore-Then-Commit Strategies. In Advances in Neural Information Processing Systems, 2016. [21] Pascal Massart. Concentration inequalities and model selection. Lecture Notes in Mathematics, 1896, 2007. [22] Aurelien Garivier and Olivier Cappe. The KL-UCB Algorithm for Bounded Stochastic Bandits and Beyond. In Conference on Learning Theory, 2011. [23] Tsachy Weissman, Erik Ordentlich, Gadiel Seroussi, Sergio Verdu, and Marcelo J Weinberger. Inequalities for the L 1 Deviation of the Empirical Distribution. Technical report, 2003. URL http://www.hpl.hp.com/techreports/2003/HPL-2003-97R1.pdf? origin=publicationDetail. 10 [24] Peter L. Bartlett and a. Tewari. REGAL: A regularization based algorithm for reinforcement learning in weakly communicating MDPs. Proceedings of the Twenty-Fifth Conference on Uncertainty in Artificial Intelligence, pages 35–42, 2009. [25] Stephane Boucheron, Gabor Lugosi, and Pascal Massart. Concentration Inequalities - A Nonasymptotic Theory of Independence. Oxford University Press, 2013. ISBN 978-0-19953525-5. [26] Rick Durrett. Probability - Theory and Examples. Cambridge University Press, 4 edition, 2010. ISBN 978-0-521-76539-8. 11
2017
65
7,174
Alternating Estimation for Structured High-Dimensional Multi-Response Models Sheng Chen Arindam Banerjee Dept. of Computer Science & Engineering University of Minnesota, Twin Cities {shengc,banerjee}@cs.umn.edu Abstract We consider the problem of learning high-dimensional multi-response linear models with structured parameters. By exploiting the noise correlations among different responses, we propose an alternating estimation (AltEst) procedure to estimate the model parameters based on the generalized Dantzig selector (GDS). Under suitable sample size and resampling assumptions, we show that the error of the estimates generated by AltEst, with high probability, converges linearly to certain minimum achievable level, which can be tersely expressed by a few geometric measures, such as Gaussian width of sets related to the parameter structure. To the best of our knowledge, this is the first non-asymptotic statistical guarantee for such AltEst-type algorithm applied to estimation with general structures. 1 Introduction Multi-response (a.k.a. multivariate) linear models [2, 8, 20, 21] have found numerous applications in real-world problems, e.g. expression quantitative trait loci (eQTL) mapping in computational biology [28], land surface temperature prediction in climate informatics [17], neural semantic basis discovery in cognitive science [30], etc. Unlike simple linear model where each response is a scalar, one obtains a response vector at each observation in multi-response model, given as a (noisy) linear combinations of predictors, and the parameter (i.e., coefficient vector) to learn can be either response-specific (i.e., allowed to be different for every response), or shared by all responses. The multi-response model has been well studied under the context of the multi-task learning [10], where each response is coined as a task. In recent years, the multi-task learning literature have largely focused on exploring the parameter structure across tasks via convex formulations [15, 3, 26]. Another emphasis area in multi-response modeling is centered around the exploitation of the noise correlation among different responses [35, 36, 29, 40, 42], instead of assuming that the noise is independent for each response. To be specific, we consider the following multi-response linear models with m real-valued outputs, yi = Xiθ∗+ ηi, ηi ∼N(0, Σ∗) , (1) where yi ∈Rm is the response vector, Xi ∈Rm×p consists of m p-dimensional feature vectors, and ηi ∈Rm is a noise vector sampled from a multivariate zero-mean Gaussian distribution with covariance Σ∗. For simplicity, we assume Diag(Σ∗) = Im×m throughout the paper. The m responses share the same underlying parameter θ∗∈Rp, which corresponds to the so-called pooled model [19]. In fact, this seemingly restrictive setting is general enough to encompass the model with response-specific parameters, which can be realized by block-diagonalizing rows of Xi and stacking all coefficient vectors into a “long” vector. Under the assumption of correlated noise, the true noise covariance structure Σ∗is usually unknown. Therefore it is typically required to estimate the parameter θ∗along with the covariance Σ∗. In practice, we observe n data points, denoted by 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. D = {(Xi, yi)}n i=1, and the maximum likelihood estimator (MLE) is simply as follows,  ˆθMLE, ˆΣMLE  = argmin θ∈Rp, Σ⪰0 1 2 log |Σ| + 1 2n n X i=1 Σ−1 2 (yi −Xiθ) 2 2 (2) Although being convex w.r.t. either θ or Σ when the other is fixed, the optimization problem associated with the MLE is jointly non-convex for θ and Σ. A popular approach to dealing with such problem is alternating minimization (AltMin), i.e., alternately solving for θ (and Σ) while keeping Σ (and θ) fixed. The AltMin algorithm for (2) iteratively performs two simple steps, solving least squares for θ and computing empirical noise covariance for Σ. Recent work [24] has established the non-asymptotic error bound of this approach for (2) with a brief extension to sparse parameter setting using iterative hard thresholding method [25]. But they did not allow more general structure of the parameter. Previous works [35, 29, 33] also considered the regularized MLE approaches for multi-response models with sparse parameters, which are solved by AltMin-type algorithms as well. Unfortunately, none of those works provide finite-sample statistical guarantees for their algorithms. AltMin technique has also been applied to many other problems, such as matrix completion [23], sparse coding [1], and mixed linear regression [41], with provable performance guarantees. Despite the success of AltMin, most existing works are dedicated to recovering unstructured sparse or low-rank parameters, with little attention paid to general structures, e.g., overlapping sparsity [22], hierarchical sparsity [27], k-support sparsity [4], etc. In this paper, we study the multi-response linear model in high-dimensional setting, i.e., sample size n is smaller than the problem dimension p, and the coefficient vector θ∗is assumed to possess a general low-complexity structure, which can be essentially captured by certain norm ∥· ∥[5]. Structured estimation using norm regularization/minimization has been extensively studied for simple linear models over the past decade, and recent advances manage to characterize the estimation error for convex approaches including Lasso-type (regularized) [38, 31, 6] and Dantzig-type (constrained) estimator [7, 12, 14], via a few simple geometric measures, e.g., Gaussian width [18, 11] and restricted norm compatibility [31, 12]. Here we propose an alternating estimation (AltEst) procedure for finding the true parameters, which essentially alternates between estimating θ through the generalized Dantzig selector (GDS) [12] using norm ∥· ∥and computing the approximate empirical noise covariance for Σ. Our analysis puts no restriction on what the norm can be, thus the AltEst framework is applicable to general structures. In contrast to AltMin, our AltEst procedure cannot be casted as a minimization of some joint objective function for θ and Σ, thus is conceptually more general than AltMin. For the proposed AltEst, we provide the statistical guarantees for the iterate ˆθt with the resampling assumption (see Section 2), which may justify the applicability of AltEst technique to other problems without joint objectives for two set of parameters. Specifically, we show that with overwhelming probability, the estimation error ∥ˆθt −θ∗∥2 for generally structured θ∗converges linearly to a minimum achievable error given sub-Gaussian design under moderate sample size. With a straightforward intuition, this minimum achievable error can be tersely expressed by the aforementioned geometric measures which simply depend on the structure of θ∗. Moreover, our analysis implies the error bound for single response high-dimensional models as a by-product [12]. Note that the analysis in [24] focuses on the expected prediction error E[Σ−1/2 ∗ X(ˆθt −θ∗)] for unstructured θ∗, which is related but different from our ∥ˆθt −θ∗∥2 for generally structured θ∗. Compared with the error bound derived for unstructured θ∗in [24], our result also yields better dependency on sample size by removing the log n factor, which seems unnatural to appear. The rest of the paper is organized as follows. We elaborate our AltEst algorithm in Section 2, along with the resampling assumption. In Section 3, we present the statistical guarantees for AltEst. We provide experimental results in Section 4 to support our theoretical development. Finally we conclude in Section 5. Due to space limitations, all proofs are deferred to the supplementary material. 2 Alternating Estimation for High-Dimensional Multi-Response Models Given the high-dimensional setting for (1), it is natural to consider the regularized MLE for (1) by adding the norm ∥· ∥to (2), which captures the structural information of θ∗in (1),  ˆθ, ˆΣ  = argmin θ∈Rp, Σ⪰0 1 2 log |Σ| + 1 2n n X i=1 Σ−1 2 (yi −Xiθ) 2 2 + γn∥θ∥, (3) 2 where γn is a tuning parameter. Using AltMin the update of (3) can be given as ˆθt = argmin θ∈Rp 1 2n n X i=1 ˆΣ −1 2 t−1(yi −Xiθ) 2 2 + γn∥θ∥ (4) ˆΣt = 1 n n X i=1  yi −Xi ˆθt   yi −Xi ˆθt T (5) The update of ˆθt is basically solving a regularized least squares problem, and the new ˆΣt is obtained by computing the approximated empirical covariance of the residues evaluated at ˆθt. In this work, we consider an alternative to (4), the generalized Dantzig selector (GDS) [12], which is given by ˆθt = argmin θ∈Rp ∥θ∥ s.t. 1 n n X i=1 XT i ˆΣ−1 t−1(Xiθ −yi) ∗ ≤γn , (6) where ∥· ∥∗is the dual norm of ∥· ∥. Compared with (4), GDS has nicer geometrical properties, which is favored in the statistical analysis. More importantly, since iteratively solving (6) followed by covariance estimation (5) no longer minimizes a specific objective function jointly, the updates go beyond the scope of AltMin, leading to our broader alternating estimation (AltEst) framework, i.e., alternately estimating one parameter by suitable approaches while keeping the other fixed. For the ease of exposition, we focus on the m ≤n scenario, so that ˆΣt can be easily computed in closed form as shown in (5). When m > n and Σ−1 ∗ is sparse, it is beneficial to directly estimate Σ−1 ∗ using more advanced estimators [16, 9]. Especially the CLIME estimator [9] enjoys certain desirable properties, which fits into our AltEst framework but not AltMin, and our AltEst analysis does not rely on the particular estimator we use to estimate noise covariance or its inverse. The algorithmic details are given in Algorithm 1, for which it is worth noting that every iteration t uses independent new samples, D2t−1 and D2t in Step 3 and 4, respectively. This assumption is known as resampling, which facilitates the theoretical analysis by removing the statistical dependency between iterates. Several existing works benefit from such assumption when analyzing their AltMin-type algorithms [23, 32, 41]. Conceptually resampling can be implemented by partitioning the whole dataset into T subsets, though it is unusual to do so in practice. Loosely speaking, AltEst (AltMin) with resampling is an approximation of the practical AltEst (AltMin) with a single dataset D used by all iterations. For AltMin, attempts have been made to directly analyze its practical version without resampling, by studying the properties of the joint objective [37], which come at the price of invoking highly sophisticated mathematical tools. This technique, however, might fail to work for AltEst since the procedure is not even associated with a joint objective. In the next section, we will leverage such resampling assumption to show that the error of ˆθt generated by Algorithm 1 will converge to a small value with high probability. We again emphasize that the AltEst framework may work for other suitable estimators for (θ∗, Σ∗) although (5) and (6) are considered in our analysis. Algorithm 1 Alternating Estimation with Resampling Input: Number of iterations T, Datasets D1 = {(Xi, yi)}n i=1, . . . , D2T = {(Xi, yi)}2T n i=(2T −1)n+1 1: Initialize ˆΣ0 = Im×m 2: for t:= 1 to T do 3: Solve the GDS (6) for ˆθt using dataset D2t−1 4: Compute ˆΣt according to (5) using dataset D2t 5: end for 6: return ˆθT 3 Statistical Guarantees for Alternating Estimation In this section, we establish the statistical guarantees for our AltEst algorithm. The road map for the analysis is to first derive the error bounds separately for both (5) and (6), and then combine them through AltEst procedure to show the error bound of ˆθt. Throughout the analysis, the design X is assumed to centered, i.e., E[X] = 0m×p. λmax(·) and λmin(·) are used to denote the largest and smallest eigenvalue of a real symmetric matrix. Before presenting the results, we provide some basic but important concepts. First of all, we give the definition of sub-Gaussian matrix X. 3 Definition 1 (Sub-Gaussian Matrix) X ∈Rm×p is sub-Gaussian if the ψ2-norm below is finite, |||X|||ψ2 = sup v∈Sp−1, u∈Sm−1 vT Γ −1 2 u XT u ψ2 ≤κ < +∞, (7) where Γu = E[XT uuT X]. Further we assume there exist constants µmin and µmax such that 0 < µmin ≤λmin(Γu) ≤λmax(Γu) ≤µmax < +∞, ∀u ∈Sm−1 (8) The definition (7) is also used in earlier work [24], which assumes the left end of (8) implicitly. Lemma 1 gives an example of sub-Gaussian X, showing that condition (7) and (8) are reasonable. Lemma 1 Assume that X ∈Rm×p has dependent anisotropic rows such that X = Ξ 1 2 ˜XΛ 1 2 , where Ξ ∈Rm×m encodes the dependency between rows, ˜X ∈Rm×p has independent isotropic rows, and Λ ∈Rp×p introduces the anisotropy. In this setting, if each row of ˜X satisfies |||˜xi|||ψ2 ≤˜κ, then condition (7) and (8) hold with κ = C˜κ, µmin = λmin(Ξ)λmin(Λ), and µmax = λmax(Ξ)λmax(Λ). The recovery guarantee of GDS relies on an important notion called restricted eigenvalue (RE). In multi-response setting, it is defined jointly for designs Xi and a noise covariance Σ as follows. Definition 2 (Restricted Eigenvalue Condition) The designs X1, X2, . . . , Xn and the covariance Σ together satisfy the restricted eigenvalue condition for set A ⊆Sp−1 with parameter α > 0, if inf v∈A vT 1 n n X i=1 XT i Σ−1Xi ! v ≥α . (9) Apart from RE condition, the analysis of GDS is carried out on the premise that tuning parameter γn is suitably selected, which we define as “admissible”. Definition 3 (Admissible Tuning Parameter) The γn for GDS (6) is said to be admissible if γn is chosen such that θ∗belongs to the constraint set, i.e., 1 n n X i=1 XT i Σ−1(Xiθ∗−yi) ∗ = 1 n n X i=1 XT i Σ−1ηi ∗ ≤γn (10) For structured estimation, one also needs to characterize the structural complexity of θ∗, and an appropriate choice is the Gaussian width [18]. For any set A ⊆Rp, its Gaussian width is given by w(A) = E [supu∈A ⟨u, g⟩], where g ∼N(0, Ip×p) is a standard Gaussian random vector. In the analysis, the set A of our interests typically relies on the structure of θ∗. Previously Gaussian width has been applied to statistical analyses for various problems [11, 6, 39], and recent works [34, 13] show that Gaussian width is computable for many structures. For the rest of the paper, we use C, C0, C1 and so on to denote universal constants, which are different from context to context. 3.1 Estimation of Coefficient Vector In this subsection, we focus on estimating θ∗, i.e., Step 3 of Algorithm 1, using GDS of the form, ˆθ = argmin θ∈Rp ∥θ∥ s.t. 1 n n X i=1 XT i Σ−1(Xiθ −yi) ∗ ≤γn , (11) where Σ is an arbitrary but fixed input noise covariance matrix. The following lemma shows a deterministic error bound for ˆθ under the RE condition and admissible γn defined in (9) and (10). Lemma 2 Suppose the RE condition (9) is satisfied by X1, . . . , Xn and Σ with α > 0 for the set A (θ∗) = cone {v | ∥θ∗+ v∥≤∥θ∗∥} ∩Sp−1. If γn is admissible, ˆθ in (11) satisfies ˆθ −θ∗ 2 ≤2Ψ(θ∗) · γn α , (12) in which Ψ(θ∗) is the restricted norm compatibility defined as Ψ(θ∗) = supv∈A(θ∗) ∥v∥ ∥v∥2 . 4 From Lemma 2, we can find that the L2-norm error is mainly determined by three quantities–Ψ(θ∗), γn and α. The restricted norm compatibility Ψ(θ∗) purely hinges on the geometrical structure of θ∗and ∥· ∥, thus involving no randomness. On the contrary, γn and α need to satisfy their own conditions, which are bound to deal with random Xi and ηi. The set A(θ∗) involved in RE condition and restricted norm compatibility has relatively simple structure, which will favor the derivation of error bound for varieties of norms [13]. If RE condition fails to hold, i.e. α = 0, the error bound is meaningless. Though the error is proportional to the user-specified γn, assigning arbitrarily small value to γn may not be admissible. Hence, in order to further derive the recovery guarantees for GDS, we need to verify RE condition and find the smallest admissible value of γn. Restricted Eigenvalue Condition: Firstly the following lemma characterizes the relation between the expectation and empirical mean of XT Σ−1X. Lemma 3 Given sub-Gaussian X ∈Rm×p with its i.i.d. copies X1, . . . , Xn, and covariance Σ ∈Rm×m with eigenvectors u1, . . . , um, let Γ = E[XT Σ−1X] and ˆΓ = 1 n Pn i=1 XT i Σ−1Xi. Define the set AΓj for A ⊆Sp−1 and each Γj = E[XT ujuT j X] as AΓj = {v ∈Sp−1 | Γ −1 2 j v ∈ cone(A)}. If n ≥C1κ4 · maxj  w2(AΓj) , with probability at least 1 −m exp(−C2n/κ4), we have vT ˆΓv ≥1 2vT Γv, ∀v ∈A . (13) Instead of w(AΓj), ideally we want the condition above on n to be characterized by w(A), which can be easier to compute in general. The next lemma accomplishes this goal. Lemma 4 Let κ0 be the ψ2-norm of standard Gaussian random vector and Γu = E[XT uuT X], where u ∈Sm−1 is fixed. For AΓu defined in Lemma 3, we have w(AΓu) ≤Cκ0 p µmax/µmin · (w(A) + 3) , (14) Lemma 4 implies that the Gaussian width w(AΓj) appearing in Lemma 3 is of the same order as w(A). Putting Lemma 3 and 4 together, we can obtain the RE condition for the analysis of GDS. Corollary 1 Under the notations of Lemma 3 and 4, if n ≥C1κ2 0κ4 · µmax µmin · (w(A) + 3)2, then the following inequality holds for all v ∈A ⊆Sp−1 with probability at least 1 −m exp(−C2n/κ4), vT ˆΓv ≥µmin 2 · Tr(Σ−1) (15) Admissible Tuning Parameter: Finding the admissible γn amounts to estimating the value of ∥1 n Pn i=1 XT i Σ−1ηi∥∗in (10), which involves random Xi and ηi. The next lemma establishes a high-probability bound for this quantity, which can be viewed as the smallest “safe” choice of γn. Lemma 5 Assume that Xi is sub-Gaussian and ηi ∼N(0, Σ∗). The following inequality holds with probability at least 1 −exp  −nτ 2 2  −C2 exp  −C2 1w2(B) 4ρ2  1 n n X i=1 XT i Σ−1ηi ∗ ≤Cκ√µmax √n · p Tr (Σ−1Σ∗Σ−1) · w(B) , (16) where B denotes the unit ball of norm ∥· ∥, ρ = supv∈B ∥v∥2, and τ = ∥Σ−1Σ 1 2∗∥F /∥Σ−1Σ 1 2∗∥2. Estimation Error of GDS: Building on Corollary 1, Lemma 2 and 5, the theorem below characterizes the estimation of GDS for the multi-response linear model. Theorem 1 Under the setting of Lemma 5, if n ≥C1κ2 0κ4 · µmax µmin · (w(A (θ∗)) + 3)2, and γn is set to C2κ q µmax Tr(Σ−1Σ∗Σ−1) n · w(B), the estimation error of ˆθ given by (11) satisfies ∥ˆθ −θ∗∥2 ≤Cκ rµmax µ2 min · p Tr (Σ−1Σ∗Σ−1) Tr (Σ−1) · Ψ(θ∗) · w(B) √n , (17) 5 with probability at least 1 −m exp −C3n κ4  −exp  −nτ 2 2  −C4 exp  −C2 5w2(B) 4ρ2  . Remark: We can see from the theorem above that the noise covariance Σ input to GDS plays a role in the error bound through the multiplicative factor ξ(Σ) = p Tr (Σ−1Σ∗Σ−1)/ Tr Σ−1 . By taking the derivative of ξ2(Σ) w.r.t. Σ−1 and setting it to 0, we have ∂ξ2(Σ) ∂Σ−1 = 2 Tr2 Σ−1 Σ∗Σ−1 −2 Tr Σ−1 Tr Σ−1Σ∗Σ−1 · Im×m Tr4 (Σ−1) = 0 Then we can verify that Σ = Σ∗is the solution to the equation above, and thus is the minimizer of ξ(Σ) with ξ(Σ∗) = 1/ q Tr(Σ−1 ∗). This calculation confirms that multi-response regression could benefit from taking into account the noise covariance, and the best performance is achieved when Σ∗ is known. If we perform ordinary GDS by setting Σ = Im×m, then ξ(Σ) = 1/√m. Therefore using Σ∗will reduce the error by a factor of q m/ Tr(Σ−1 ∗), compared with ordinary GDS. One simple structure of θ∗to consider for Theorem 1 is the sparsity encoded by L1 norm. Given ssparse θ∗, it follows from previous results [31, 11] that Ψ(θ∗) = O(√s), w(A(θ∗)) = O(√s log p) and w(B) = O(√log p). Therefore if n ≥O(s log p), then with high probability we have ∥ˆθ −θ∗∥2 ≤O ξ(Σ) · r s log p n ! (18) Implications for Simple Linear Models: Our general result in multi-response scenario implies some existing results for simple linear models. If we set n = 1 and Σ = Σ∗= Im×m, i.e., only one data point (X, y) is observed and the noise is independent for each response, the GDS is reduced to ˆθsg = argmin θ∈Rp ∥θ∥ s.t. XT (Xθ −y) ∗≤γ , (19) which exactly matches that in [12]. To bound its estimation error, we need X to be more structured beyond the sub-Gaussianity. Essentially we consider the model of X in Lemma 1, where rows of ˜X are additionally assumed to be identical. For such X, a specialized RE condition is as follows. Lemma 6 Assume X is defined as in Lemma 1 such that X = Ξ 1 2 ˜XΛ 1 2 , and rows of ˜X are i.i.d. with |||˜xj||| ≤˜κ. If mn ≥C1κ2 0˜κ4 · λmax(Ξ)λmax(Λ) λmin(Ξ)λmin(Λ) · (w(A) + 3)2, with probability at least 1 −exp(−C2mn/˜κ4), the following inequality is satisfied by all v ∈A ⊆Sp−1, vT ˆΓv ≥m 2 · λmin  Ξ 1 2 Σ−1Ξ 1 2  · λmin (Λ) . (20) Remark: Lemma 6 characterizes the RE condition for a class of specifically structured design X. If we specialize the general RE condition in Corollary 1 for this setting, X = Ξ 1 2 ˜XΛ 1 2 , it becomes n ≥C1κ2 0˜κ4 λmax(Ξ)λmax(Λ) λmin(Ξ)λmin(Λ) (w(A) + 3)2 with probability 1− m exp(−C2n/˜κ4) ==========⇒vT ˆΓv ≥λmin(Ξ)λmin(Λ) 2 Tr(Σ−1) Comparing the general result above with Lemma 6, there are two striking differences. Firstly, Lemma 6 requires the same sample size of mn rather than n, which improves the general one. Secondly, (20) holds with much higher probability 1 −exp(−C2mn/˜κ4) instead of 1 −m exp(−C2n/˜κ4). Given this specialized RE condition, we have the recovery guarantees of GDS for simple linear models, which encompass the settings discussed in [6, 12] as special cases. Corollary 2 Suppose y = Xθ∗+ η ∈Rm, where X is described as in Lemma 6, and η ∼N(0, I). With probability at least 1 −exp −m 2  −C2 exp  −C2 1w2(B) 4ρ2  −exp −C3m/˜κ4 , ˆθsg satisfies ˆθsg −θ∗ 2 ≤C˜κ · s λmax(Ξ)λmax(Λ) λ2 min(Ξ)λ2 min(Λ) · Ψ(θ∗) · w(B) √m , (21) 6 3.2 Estimation of Noise Covariance In this subsection, we consider the estimation of noise covariance Σ∗given an arbitrary parameter vector θ. When m is small, we estimate Σ∗by simply using the sample covariance ˆΣ = 1 n n X i=1 (yi −Xiθ) (yi −Xiθ)T . (22) Theorem 2 reveals the relation between ˆΣ and Σ∗, which is sufficient for our AltEst analysis. Theorem 2 If n ≥C4m · max  4  κ0 + κ q µmax λmin(Σ∗) ∥θ∗−θ∥2 4 , κ4  λmax(Σ∗)µmax λmin(Σ∗)µmin 2 and Xi is sub-Gaussian, with probability at least 1 −2 exp(−C1m), ˆΣ given by (22) satisfies λmax  Σ −1 2 ∗ ˆΣΣ −1 2 ∗  ≤1 + C2κ2 0 p m/n + 2µmax λmin (Σ∗) ∥θ∗−θ∥2 2 (23) λmin  Σ −1 2 ∗ ˆΣΣ −1 2 ∗  ≥1 −C2κ2 0 p m/n (24) Remark: If ˆΣ = Σ∗, then λmax(Σ −1 2 ∗ ˆΣΣ −1 2 ∗ ) = λmin(Σ −1 2 ∗ ˆΣΣ −1 2 ∗ ) = 1. Hence ˆΣ is nearly equal to Σ∗when the upper and lower bounds (23) (24) are close to 1. We would like to point out that there is nothing specific to the particular form of estimator (22), which makes AltEst work. Similar results can be obtained for other methods that estimate the inverse covariance matrix Σ−1 ∗ instead of Σ∗. For instance, when m < n and Σ−1 ∗ is sparse, we can replace (22) with GLasso [16] or CLIME [9], and AltEst only requires the counterparts of (23) and (24) in order to work. 3.3 Error Bound for Alternating Estimation Section 3.1 shows that the noise covariance in GDS affects the error bound by the factor ξ(Σ). In order to bound the error of ˆθT given by AltEst, we need to further quantify how θ affects ξ( ˆΣ). Lemma 7 If ˆΣ is given as (22) and the condition in Theorem 2 holds, then the inequality below holds with probability at least 1 −2 exp(−C1m), ξ  ˆΣ  ≤ξ (Σ∗) ·  1 + 2Cκ0 m n  1 4 + 2 r µmax λmin (Σ∗) ∥θ∗−θ∥2  (25) Based on Lemma 7, the following theorem provides the error bound for ˆθT given by Algorithm 1. Theorem 3 Let eorc = C1κ q µmax µ2 min ξ(Σ∗)·Ψ(θ∗)w(B) √n and emin = eorc· 1+2Cκ0( m n ) 1 4 1−2eorc q µmax λmin(Σ∗) . If n ≥C4m· max ( 4  κ0 + C1 C2 q λmin(Σ∗) λ2max(Σ∗) Ψ(θ∗)w(B) m 4 , κ4  λmax(Σ∗)µmax λmin(Σ∗)µmin 2 ,  2C1κµmax C2µmin · ξ(Σ∗)Ψ(θ∗)w(B) √ m·λmin(Σ∗) 2) and also satisfies the condition in Theorem 1, with high probability, the iterate ˆθT returned by Algorithm 1 satisfies ˆθT −θ∗ 2 ≤emin +  2eorc r µmax λmin (Σ∗) T −1 ·  ˆθ1 −θ∗ 2 −emin  (26) Remark: The three lower bounds for n inside curly braces correspond to three intuitive requirements. The first one guarantees that the covariance estimation is accurate enough, and the other two respectively ensure that the initial error of ˆθ1 and eorc are reasonably small , such that the subsequent errors can contract linearly. eorc is the estimation error incurred by the following oracle estimator, ˆθorc = argmin θ∈Rp ∥θ∥ s.t. 1 n n X i=1 XT i Σ−1 ∗(Xiθ −yi) ∗ ≤γn , (27) which is impossible to implement in practice. On the other hand, emin is the minimum achievable error, which has an extra multiplicative factor compared with eorc. The numerator of the factor compensates 7 for the error of estimated noise covariance provided that θ = θ∗is plugged in (22), which merely depends on sample size. Since having θ = θ∗is also unrealistic for (22), the denominator further accounts for the ballpark difference between θ and θ∗. As we remark after Theorem 1, if we perform ordinary GDS with Σ set to Im×m in (11), its error bound eodn satisfies eodn = eorc q Tr(Σ−1 ∗)/m. Note that this factor q Tr(Σ−1 ∗)/m is independent of n, whereas emin will approach eorc with increasing n as the factor between them converges to one. 4 Experiments In this section, we present some experimental results to support our theoretical analysis. Specifically we focus on the sparse structure of θ∗captured by L1 norm. Throughout the experiment, we fix problem dimension p = 500, sparsity level of θ∗s = 20, and number of iterations for AltEst T = 5. Entries of design X is generated by i.i.d. standard Gaussians, and θ∗= [1, . . . , 1 | {z } 10 , −1, . . . , −1 | {z } 10 , 0, . . . , 0 | {z } 480 ]T . Σ∗is given as a block diagonal matrix with blocks Σ′ = h 1 a a 1 i replicated along diagonal, and number of responses m is assumed to be even. All plots are obtained by averaging 100 trials. In the first set of experiments, we set a = 0.8, m = 10 and investigate the error of ˆθt as n varies from 40 to 90. We run AltEst (with and without resampling), the oracle GDS, and the ordinary GDS with Σ = I. The results are given in Figure 1. For the second experiment, we fix the product mn ≈500, and let m = 2, 4, . . . , 10. For our choice of Σ∗, the error incurred by oracle GDS eorc is the same for every m. We compare AltEst with both oracle and ordinary GDS, and the result is shown in Figure 2(a) and 2(b). In the third experiment, we test AltEst under different covariance matrices Σ∗by varying a from 0.5 to 0.9. m is set to 10 and sample size n is 90. We also compare AltEst against both oracle and ordinary GDS, and the errors are reported in Figure 2(c) and 2(d). 1 1.5 2 2.5 3 3.5 4 4.5 5 Iteration t 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 Normalized Error for ˆθt n = 40 n = 50 n = 60 n = 70 n = 80 n = 90 (a) Error for AltEst 1 1.5 2 2.5 3 3.5 4 4.5 5 Iteration t 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 Normalized Error for ˆθt n = 40 n = 50 n = 60 n = 70 n = 80 n = 90 (b) Error for Resampled AltEst 40 45 50 55 60 65 70 75 80 85 90 Sample Size n 0.04 0.06 0.08 0.1 0.12 0.14 0.16 Normalized Error Oracle GDS Resampled AltEst AltEst Ordinary GDS (c) Comparison of Estimators Figure 1: (a) When n = 40, AltEst is not quite stable due to the large initial error and poor quality of estimated covariance. Then the errors start to decrease for n ≥50. (b) Resampld AltEst does benefit from fresh samples, and its error is slightly smaller than AltEst as well as more stable when n is small. (c) Oracle GDS outperforms the others, but the performance of AltEst is also competitive. Ordinary GDS is unable to utilize the noise correlation, thus resulting in relatively large error. By comparing the two implementations of AltEst, we can see that resampled AltEst yields smaller error especially when data is inadequate, but their errors are very close if n is suitably large. 1 1.5 2 2.5 3 3.5 4 4.5 5 Iteration t 0.04 0.06 0.08 0.1 0.12 0.14 0.16 Normalized Error for ˆθt m = 2 m = 4 m = 6 m = 8 m = 10 (a) AltEst (for m) 2 3 4 5 6 7 8 9 10 Number of Responses m 0.04 0.06 0.08 0.1 0.12 0.14 0.16 Normalized Error Oracle GDS AltEst Ordinary GDS (b) Comparison (for m) 1 1.5 2 2.5 3 3.5 4 4.5 5 Iteration t 0.04 0.06 0.08 0.1 0.12 0.14 0.16 Normalized Error for ˆθt a = 0.9 a = 0.8 a = 0.7 a = 0.6 a = 0.5 (c) AltEst (for a) 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 a 0.02 0.04 0.06 0.08 0.1 0.12 0.14 Normalized Error Oracle GDS AltEst Ordinary GDS (d) Comparison (for a) Figure 2: (a) Larger error comes with bigger m, which confirms that emin is increasing along with m when mn is fixed. (b) The plots for oracle and ordinary GDS imply that eorc and eodn remain unchanged, which matches the error bounds in Theorem 1. Though emin increases, AltEst still outperform the ordinary GDS by a margin. (c) The error goes down when the true noise covariance becomes closer to singular, which is expected in view of Theorem 3. (d) eorc also decreases as a gets larger, and the gap between emin and eodn widens. The definition of emin in Theorem 3 indicates that the ratio between emin and eorc is almost a constant because both n and m are fixed. Here we observe that all the ratios at different a are between 1.05 and 1.1, which supports the theoretical results. Also, Theorem 1 suggests that eodn does not change as Σ∗varies, which is verified here. 8 5 Conclusions In this paper, we propose an alternating estimation (AltEst) procedure for solving the multi-response linear models in high dimension. Our framework is based on the generalized Dantzig selector (GDS) and allows for general structures of the parameter vector, whose recovery guarantees are simply determined by a few geometric measures. Also, by leveraging the noise correlation among responses, AltEst can achieve significantly smaller estimation error than ignoring the noise structure. With moderate sample size and the resampling assumption, we show that the estimation error will converge linearly to a minimal achievable error, which is comparable to the one incurred by the oracle estimator. In the experiment, we demonstrate the numerical superiority of AltEst over the vanilla GDS, and it is also suggested that the resampled version of AltEst give little benefit in practice and we should better use all data in every iteration. Acknowledgements The research was supported by NSF grants IIS-1563950, IIS-1447566, IIS-1447574, IIS-1422557, CCF-1451986, CNS- 1314560, IIS-0953274, IIS-1029711, NASA grant NNX12AQ39A, and gifts from Adobe, IBM, and Yahoo. References [1] A. Agarwal, A. Anandkumar, P. Jain, P. Netrapalli, and R. Tandon. Learning sparsely used overcomplete dictionaries via alternating minimization. CoRR, abs/1310.7991, 2013. [2] T. W. Anderson. An introduction to multivariate statistical analysis. 2003. [3] A. Argyriou, T. Evgeniou, and M. Pontil. Convex multi-task feature learning. Machine Learning, 73(3):243–272, 2008. [4] A. Argyriou, R. Foygel, and N. Srebro. Sparse prediction with the k-support norm. In NIPS, 2012. [5] F. Bach, R. Jenatton, J. Mairal, and G. Obozinski. Convex optimization with sparsity-inducing norms. Optimization for Machine Learning, 5, 2011. [6] A. Banerjee, S. Chen, F. Fazayeli, and V. Sivakumar. Estimation with norm regularization. In Advances in Neural Information Processing Systems (NIPS), 2014. [7] P. J. Bickel, Y. Ritov, and A. B. Tsybakov. Simultaneous analysis of Lasso and Dantzig selector. The Annals of Statistics, 37(4):1705–1732, 2009. [8] L. Breiman and J. H. Friedman. Predicting multivariate responses in multiple linear regression. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 59(1):3–54, 1997. [9] T. T. Cai, W. Liu, and X. Luo. A constrained ℓ1 minimization approach to sparse precision matrix estimation. Journal of the American Statistical Association, 106(494):594–607, 2011. [10] R. Caruana. Multitask learning. Machine Learning, 28(1):41–75, 1997. [11] V. Chandrasekaran, B. Recht, P. A. Parrilo, and A. S. Willsky. The convex geometry of linear inverse problems. Foundations of Computational Mathematics, 12(6):805–849, 2012. [12] S. Chatterjee, S. Chen, and A. Banerjee. Generalized dantzig selector: Application to the k-support norm. In Advances in Neural Information Processing Systems (NIPS), 2014. [13] S. Chen and A. Banerjee. Structured estimation with atomic norms: General bounds and applications. In NIPS, pages 2908–2916, 2015. [14] S. Chen and A. Banerjee. Structured matrix recovery via the generalized dantzig selector. In Advances in Neural Information Processing Systems, 2016. [15] T. Evgeniou and M. Pontil. Regularized multi–task learning. In KDD, pages 109–117, 2004. 9 [16] J. Friedman, T. Hastie, and R. Tibshirani. Sparse inverse covariance estimation with the graphical lasso. Biostatistics, 9(3):432–441, 2008. [17] A. R. Goncalves, P. Das, S. Chatterjee, V. Sivakumar, F. J. Von Zuben, and A. Banerjee. Multi-task sparse structure learning. In CIKM, pages 451–460, 2014. [18] Y. Gordon. Some inequalities for gaussian processes and applications. Israel Journal of Mathematics, 50(4):265–289, 1985. [19] W. H. Greene. Econometric Analysis. Prentice Hall, 7. edition, 2011. [20] A. J. Izenman. Reduced-rank regression for the multivariate linear model. Journal of multivariate analysis, 5(2):248–264, 1975. [21] A. J. Izenman. Modern Multivariate Statistical Techniques: Regression, Classification, and Manifold Learning. Springer, 2008. [22] L. Jacob, G. Obozinski, and J.-P. Vert. Group lasso with overlap and graph lasso. In ICML, 2009. [23] P. Jain, P. Netrapalli, and S. Sanghavi. Low-rank matrix completion using alternating minimization. In STOC, pages 665–674, 2013. [24] P. Jain and A. Tewari. Alternating minimization for regression problems with vector-valued outputs. In Advances in Neural Information Processing Systems (NIPS), pages 1126–1134, 2015. [25] P. Jain, A. Tewari, and P. Kar. On iterative hard thresholding methods for high-dimensional m-estimation. In NIPS, pages 685–693, 2014. [26] A. Jalali, S. Sanghavi, C. Ruan, and P. K. Ravikumar. A dirty model for multi-task learning. In Advances in Neural Information Processing Systems (NIPS), pages 964–972, 2010. [27] R. Jenatton, J. Mairal, G. Obozinski, and F. Bach. Proximal methods for hierarchical sparse coding. J. Mach. Learn. Res., 12:2297–2334, 2011. [28] S. Kim and E. P. Xing. Tree-guided group lasso for multi-response regression with structured sparsity, with an application to eqtl mapping. Ann. Appl. Stat., 6(3):1095–1117, 2012. [29] W. Lee and Y. Liu. Simultaneous multiple response regression and inverse covariance matrix estimation via penalized gaussian maximum likelihood. J. Multivar. Anal., 111:241–255, 2012. [30] H. Liu, M. Palatucci, and J. Zhang. Blockwise coordinate descent procedures for the multi-task lasso, with applications to neural semantic basis discovery. In ICML, pages 649–656, 2009. [31] S. Negahban, P. Ravikumar, M. J. Wainwright, and B. Yu. A unified framework for the analysis of regularized M-estimators. Statistical Science, 27(4):538–557, 2012. [32] P. Netrapalli, P. Jain, and S. Sanghavi. Phase retrieval using alternating minimization. In NIPS, 2013. [33] P. Rai, A. Kumar, and H. Daume. Simultaneously leveraging output and task structures for multiple-output regression. In NIPS, pages 3185–3193, 2012. [34] N. Rao, B. Recht, and R. Nowak. Universal Measurement Bounds for Structured Sparse Signal Recovery. In International Conference on Artificial Intelligence and Statistics (AISTATS), 2012. [35] 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. [36] K.-A. Sohn and S. Kim. Joint estimation of structured sparsity and output structure in multipleoutput regression via inverse-covariance regularization. In AISTATS, pages 1081–1089, 2012. [37] R. Sun and Z.-Q. Luo. Guaranteed matrix completion via nonconvex factorization. In FOCS, 2015. 10 [38] R. Tibshirani. Regression shrinkage and selection via the Lasso. Journal of the Royal Statistical Society, Series B, 58(1):267–288, 1996. [39] J. A. Tropp. Convex Recovery of a Structured Signal from Independent Random Linear Measurements, pages 67–101. Springer International Publishing, 2015. [40] M. Wytock and Z. Kolter. Sparse gaussian conditional random fields: Algorithms, theory, and application to energy forecasting. In International conference on machine learning, pages 1265–1273, 2013. [41] X. Yi, C. Caramanis, and S. Sanghavi. Alternating minimization for mixed linear regression. In ICML, pages 613–621, 2014. [42] X.-T. Yuan and T. Zhang. Partial gaussian graphical model estimation. IEEE Transactions on Information Theory, 60:1673–1687, 2014. 11
2017
650
7,175
Multimodal Learning and Reasoning for Visual Question Answering Ilija Ilievski Integrative Sciences and Engineering National University of Singapore ilija.ilievski@u.nus.edu Jiashi Feng Electrical and Computer Engineering National University of Singapore elefjia@nus.edu.sg Abstract Reasoning about entities and their relationships from multimodal data is a key goal of Artificial General Intelligence. The visual question answering (VQA) problem is an excellent way to test such reasoning capabilities of an AI model and its multimodal representation learning. However, the current VQA models are oversimplified deep neural networks, comprised of a long short-term memory (LSTM) unit for question comprehension and a convolutional neural network (CNN) for learning single image representation. We argue that the single visual representation contains a limited and general information about the image contents and thus limits the model reasoning capabilities. In this work we introduce a modular neural network model that learns a multimodal and multifaceted representation of the image and the question. The proposed model learns to use the multimodal representation to reason about the image entities and achieves a new state-of-the-art performance on both VQA benchmark datasets, VQA v1.0 and v2.0, by a wide margin. 1 Introduction One of the hallmarks of human intelligence is the ability to reason about entities and their relationships using data from different modalities [40]. Humans can easily reason about the entities in a complex scene by building multifaceted mental representations of the scene contents. Thus, any plausible attempt for Artificial General Intelligence must also be able to reason about entities and their relationships. Deep learning models have demonstrated excellent performance on many computer vision tasks such as image classification, object recognition, and scene classification [37, 23]. However, the models are limited to a single task over single data modality and thus are still far from complete scene understanding and reasoning. The visual question answering (VQA), a task to provide answers to natural language questions about the contents of an image, has been proposed to fill this gap [3, 22]. Solving the VQA task requires understanding of the image contents, the question words, and their relationships. The human-posed questions are arbitrary and thus besides being a challenging machine comprehension problem, their answering also involves many computer vision tasks such as scene classification, object detection and classification, and face analysis. Thus, VQA represents a problem comprised of multiple subproblems over multimodal data and as such can serve as a proxy test for the general reasoning capabilities of an AI model [30]. However, the current state-of-the-art VQA approaches employ oversimplified deep neural network models, comprised of a long short-term memory (LSTM) unit [9] for question comprehension and a convolutional neural network (CNN) [24] for learning a single representation of the image. The single visual representation encodes a limited and general information about the image contents and 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. thus hampers the model’s reasoning about the image entities and their relationships. The analysis of the model’s behavior is also made difficult because of the single visual representation, as one does not have evidence of the visual information used by the model to produce the answer. The problem is partially alleviated by incorporating a visual attention module, as most VQA models do [6, 18, 45], but still, the VQA models remain black box in most cases. There have also been approaches that employ modular networks for VQA [2], however they achieved limited success. Most VQA models join the image and text representations via element-wise multiplication [18, 45], exception is the model proposed by Fukui et al. [6], which learns the joint representation via compact bilinear pooling. Goyal et al. [7] recently showed that the current state-of-the-art VQA methods actually learn dataset biases instead of reasoning about the image objects or learning multifaceted image representations. In this work we introduce ReasonNet, a model that learns to reason about entities in an image by learning a multifaceted representation of the image contents. ReasonNet employs a novel multimodal representation learning and fusion module that enables the model to develop a complete image and question understanding. ReasonNet then learns to utilize the multiple image representations, each encoding different visual aspects of the image, by explicitly incorporating a neural reasoning module. In contrast to current VQA models, the ReasonNet model is fully interpretable and provides evidence of its reasoning capabilities. The proposed model outperforms the state-of-the-art by a significant margin on the two largest benchmark VQA datasets, VQA v1.0 [3] and VQA v2.0 [7]. In summary, the contributions of our work are as follows: • We develop a novel multimodal representation learning and fusion method, crucial for obtaining the complete image understanding necessary for multimodal reasoning. • We introduce a new VQA reasoning model that learns multifaceted image representations to reason about the image entities. • We perform an extensive evaluation and achieve new state-of-the-art performance on the two VQA benchmark datasets. 2 Related work Multimodal reasoning models Recently, several works introduced modular neural networks for reasoning evaluated on natural language question answering and visual question answering [2, 1, 11]. The modular networks use conventional natural language parser [21] to obtain a network layout for composing the network architecture [11]. Later work also incorporated a dynamic network layout prediction by learning to rank the parser proposed modules [1]. The neural modules are then jointly trained to execute the task on which they are applied. In contrast to our model, the existing modular networks learn to compose a network architecture using a hand-designed or parser proposed layout structure. These models were shown [2] to be unable to capture the complex nature of the natural language and perform poorly on the complex VQA v1.0 [3]. Concurrently to this work, Hu et al. [10] and Johnson et al. [16] proposed a similar modular network model that learns the network layout structure and thus do not require a parser. However, the models have been applied with success only to the synthetic dataset CLEVR [15] because for training the layout prediction module they require the ground-truth programs that generated the questions. Visual question answering The visual question answering (VQA) task has received great interest [5, 45, 50, 38] since the release of the first large-scale VQA v1.0 dataset by Antol et al. [3]. Typically, a VQA model is comprised of two modules for learning the question and the image representations, and a third module for fusing the representations into a single multimodal representation. The multimodal representation is then fed to multiple fully-connected layers and a softmax layer at the end outputs the probabilities of each answer (e.g. see [12, 6, 44]). The question representation is learned by mapping each question word to a vector via a lookup table matrix, which is often initialized with word2vec [31] or skip-thought [20] vectors. The word vectors are then sequentially fed to a Long Short-Term Memory (LSTM) unit [9], and the final hidden LSTM state is considered as the question representation. The image representation is obtained from a pretrained convolutional neural network (CNN) [24], such as ResNet [8] or VGG [39], and the output from the penultimate layer is regarded as the image representation. Some, increase the information available in the image representation by using feature maps from a convolutional layer [45, 29, 6]. 2 3 ReasonNet We develop a novel modular deep neural network model that learns to reason about entities and their relationships in a complex scene using multifaceted scene representations. The model, named as ReasonNet, takes as inputs an image I and a natural language text L. Then, ReasonNet passes the image and the text through its different modules that encode multiple image aspects into multiple vector representations. At the same time, ReasonNet uses a language encoder module to encode the text into a vector representation. Finally, ReasonNet’s reasoning unit fuses the different representations into a single reasoning vector. In the following we give details of the network modules and its reasoning unit, while in Section 4 we ensemble and describe a ReasonNet applied to the VQA task (Figure 1). 3.1 Multimodal representation learning ReasonNet incorporates two types of representation learning modules: visual classification modules and visual attention modules. A visual classification module outputs a vector that contains the class probabilities of the specific image aspect assigned to that module. While a visual attention module outputs a vector that contains visual features focused on the module’s specific image aspect. We denote the classification modules as φ and the visual attention modules as ϕ. We use bold lower case letters to represent vectors and bold upper case letters to represent tensors. Subscript indices denote countable variables while superscript indices label the variables. For example, P φ k denotes the k-th matrix P of the module φ. In the following we describe each module type. Visual classification modules Each visual classification module maps a different aspect of the image contents to a module specific class representation space. Consequently, ReasonNet needs to transfer the output of each module to a common representation space. For example, if one module classifies the image scene as “train station”, while another module classifies a detected object as “train”, ReasonNet needs to be aware that the outputs are semantically related. For this reason, ReasonNet transfers each classification module’s output to a common representation space using a lookup table matrix. Formally, a classification module φ outputs a matrix P φ of n one-hot vectors with lookup table indices of the n highest probability class labels. The matrix P φ is then mapped to a vector cφ in a common representation space with: cφ = vec(P φW LT), (1) where W LT is the lookup table matrix with learned parameters. Visual attention modules ReasonNet passes the image I through a residual neural network [8] to obtain a visual feature tensor V ∈RF ×W ×H representing the global image contents. Then, each visual attention module ϕ focuses the visual feature tensor to the specific image aspect assigned to the said module using an attention probability distribution αϕ ∈RW ×H. The module-specific visual representation vector vϕ ∈RF is then obtained with: vϕ = W X i=1 H X j=1 αϕ i,jV i,j. (2) Encoder units A problem with this approach is that the common representation vectors cφ from the classification modules, being distributed representations of the modules’ class labels, are highdimensional vectors. On the other hand, the visual feature vectors vϕ of the attention modules are also high-dimensional vectors, but sparse and with different dimensionality and scale. As a solution, ReasonNet appends to each classification and to each attention modules an encoder unit Enc that encodes a module’s output vector x (equal to cφ if classification module and to vϕ if attention module) to a condensed vector r in a common low-dimensional representation space. The encoder units are implemented as two fully-connected layers followed by a non-linear activation function, and max pooling over the magnitude while preserving the sign: r = Enc(x) Enc(x) := sgn(f(x)) · max(|f(x)|), f(x) := σ W E 2 σ(W E 1 x + bE 1 )  + bE 2  , (3) 3 where W E k and bE k are the parameters and biases of the k-th layer in an encoder E, and σ(·) := tanh(·). The max pooling is performed over the row dimension as f(x) outputs a matrix of rowstacked encoded vectors from one mini-batch. Text encoding ReasonNet treats the words in L as class labels and correspondingly uses the lookup table from Eq. (1) and an encoder unit to map the text to a vector rl in the same low-dimensional representation space of the other modules. 3.2 Multimodal reasoning The reasoning capabilities of the ReasonNet model come from its ability to learn the interaction between each module’s representation rk and the question representation rl. The ReasonNet model parameterizes the rk ×rl interaction with a bilinear model [42]. Bilinear models have excellent representational expressiveness by allowing the vector representations to adapt each other multiplicatively. The bilinear model is defined as: sk = r⊤ k W s krl + bs k, (4) where k = 1, . . . , K and K is the number of representation learning modules, provides a rich vector representation sk of the k-th module’s output × language interaction. Note that while other multimodal representation learning works, e.g. [6], have criticized the use of bilinear models for representation fusion because of their high dimensionality as the tensor W s k is cubic in the dimensions of rk, rl, and sk. However, ReasonNet mitigates this issue by employing encoder units to reduce the dimension of the representation vectors and thus also reduce the dimension of the bilinear model. We evaluate different fusion methods with ablation studies in Section 5.3. ReasonNet builds a complete image and language representation by concatenating each interaction vector sk into a vector g = fK k=1 sk, where f denotes concatenation of vectors. The vector concatenation is crucial for disentangling the contributions of each module in the model’s task. By partially ignoring some of the inputs of the vector g, ReasonNet can learn to “softly” utilize the different modules only when their outputs help in predicting the correct answer for the given question. In contrast to the recent works on module networks, e.g. [10, 16], ReasonNet can choose to partially use a module if it is helpful for the task instead of completely removing a module as other module network models do. For example, for the visual question answering (VQA) task, the soft module usage is particularly useful when answering a question which implicitly requires a module, e.g. answering the question “Is it raining?” implicitly requires a scene classification module. The concatenation of the modules’ representations also enables the interpretability of the reasoning behavior of our model. Specifically, by observing which elements of the vector g are most active we can infer which modules ReasonNet used in the reasoning process and thus explain the reasons for its behavior. We visualize the reasoning process on the VQA task in Section 5.4. Finally, the multimodal representation vector g can be used as an input to an answer classification network, when applied to the VQA task, or as an input to an LSTM unit when applied to the image captioning task. In the next section, we use the challenging VQA task as a proxy test for ReasonNet reasoning capabilities. 4 ReasonNet for VQA The visual question answering problem is an excellent way to test the reasoning capabilities of ReasonNet and its use of multifaceted image representations. For example, answering the question “Does the woman look happy?” requires a face detection, gender and emotion classification, while answering the question “How many mice are on the desk?” requires object detection and classification. Thus, for the VQA task, ReasonNet incorporates the following set of modules: 1. question-specific visual attention module, 2. object-specific visual attention module, 3. face-specific visual attention module, 4. object classification module, 5. scene classification module, 6. face analysis classification module. In the following we give a formal definition of the VQA problem and details of the model’s modules when applied on the VQA task. The network architecture is visualized in Figure 1. Namely, the VQA problem can be solved by modeling the likelihood probability distribution pvqa which for each answer a in the answer set Ωoutputs the probability of being the correct answer, given a question Q about an image I: ˆa = arg max a∈Ω pvqa(a|Q, I; θ), (5) 4 Figure 1: Network architecture diagram of the ReasonNet model applied on the VQA task. Round rectangles represent attention modules, squared rectangles represent classification modules, small trapezoids represent encoder units (Eq. (3)), thin rectangles represent the learned multimodal representation vectors, N represents the bilinear interaction model (Eq. (4)), and the big trapezoid is a multi-layer perceptron network that classifies the reasoning vector g to an answer a (Eq. (7)) where θ are the model parameters, ˆa is the predicted answer, and Ωis the set of possible answers. 4.1 ReasonNet VQA modules First, ReasonNet obtains the question representation vector rl and a global visual feature tensor V as described in Section 3.1. ReasonNet then learns a question-specific image representation by using the question representation vector rl to learn an attention probability distribution αv ∈RW ×H over the global visual feature tensor V ∈RF ×W ×H : αv = softmax h W α σ (W vrl + bv) · 1  ◦σ(W V V + bV )  + bαi , where σ(·) := tanh(·), W α, W v, W V and the corresponding biases are learned parameters, 1 ∈ 1W ×H is used to tile the question vector representation to match the V tensor dimensionality, and ◦ denotes element-wise matrix multiplication. The question-specific visual feature vector vv is then obtained with Eq. (2) and the representation vector rv with Eq. (3). Naturally, many of the VQA questions are about image objects so ReasonNet incorporates a fully convolutional network (FCN) [28] for object detection. Given an image, the FCN will output a set of object bounding boxes and their corresponding confidence scores. Each bounding box is represented as a four-element vector d⊤= [x, y, w, h], where (x, y) is the coordinate of the top-left box corner and w, h is the size of the box. Using a confidence score threshold ReasonNet obtains a set B containing high confidence bounding boxes. ReasonNet then uses the set B to compute an attention probability distribution αo that focuses the visual feature tensor V on the image objects. To ground the image pixels to visual feature maps, all images are resized to the same pre-fixed dimension before feeding them to the object detection module. Thus each feature vector v ∈RF from a corresponding element in the tensor slice V slice ∈RW ×H from the feature tensor V ∈RF ×W ×H maps to a fixed sized image region. Formally, for each dk ∈B, ReasonNet calculates a single object attention γk. The |B| object-specific attentions are then used to calculate the overall object attention distribution αo: αo = softmax(ˆαo), ˆαo i,j = max k=1,...,|B|(γk i,j), γk i,j =    1 dk x ≤i ≤(dk x + dk w), dk y ≤j ≤(dk y + dk h), 0.1 otherwise. (6) 5 As before, the object-specific visual feature vector vo is then obtained with Eq. (2) and the representation vector ro with Eq. (3). ReasonNet further uses the object bounding boxes to obtain a vector of object class labels. Namely, for each bounding box in B, ReasonNet crops out the image part corresponding to the box coordinates and then uses a residual network to classify the cropped-out image part and obtain a class label. The n class labels of the boxes with highest class probability are represented as n one-hot vectors of lookup table indices. The matrix P c, obtained by stacking the n vectors, is then mapped to a dense low-dimensional vector rc with Eq. (1) and Eq. (3). Next, ReasonNet uses a scene classification network as many of the questions explicitly or implicitly necessitate the knowledge of the image setting. The scene classification network is implemented as a residual network trained on the scene classification task. As before, the top n predicted class labels are represented as a matrix of n one-hot vectors P s from which the module’s representation vector rs is obtained (Eq. (1) and Eq. (3)). Since the VQA datasets [7, 3] contain human-posed questions, many of the questions are about people. Thus, ReasonNet also incorporates a face detector module, and a face analysis classification module. The face detector module is a fully convolutional network that outputs a set of face bounding boxes and confidence scores. As with the object detector, ReasonNet uses a threshold to filter out bounding boxes with low confidence scores and obtain a set of face detections F. Then, from F, using Eq. (6), ReasonNet obtains an attention probability distribution γf that focuses the visual feature tensor V on people’s faces. The face-specific visual feature vector vf is then obtained with Eq. (2) and the representation vector rf with Eq. (3). The face bounding boxes from F are also used to crop out the image regions that contain a face and using a convolutional neural network to obtain three class labels for each detected face representing the age group, the gender, and the emotion. As with the other classification modules, ReasonNet represents the three class labels as a matrix of one-hot vectors P a and uses Equations (1) and (3) to obtain the face analysis representation vector ra. ReasonNet obtains a complete multimodal understanding by learning the interaction of the learned representations H = {rv, ro, rc, rs, rf, ra} with the question representation rq: g = n rh∈H (r⊤ h W s hrq + bs h), where W s h is a learned bilinear tensor for a representation rh, and f denotes concatenation of vectors. Finally, ReasonNet forwards the vector g, containing the question representation and multifaceted image representations, to a two-layer perceptron network which outputs the probabilities pvqa(Eq. (5)): pvqa(a|Q, I; θ) = softmax h σ W g 2σ(W g 1g + bg 1) + bg 2 i , (7) where θ represents all the model parameters. 5 Experiments 5.1 Datasets We evaluate our model on the two benchmark VQA datasets, VQA v1.0 [3] and VQA v2.0 [7]. The VQA v1.0 dataset is the first large-scale VQA dataset. The dataset contains three human-posed questions and answers for each one of the 204,721 images found in the MS-COCO [27] dataset. We also evaluate our model on the second version of this dataset, the VQA v2.0. The new version includes about twice as many question-answer pairs and addresses the dataset bias issues [7] of the VQA v1.0 dataset. We report results according to the evaluation metric provided by the authors of the VQA datasets, where an answer is counted as correct if at least three annotators gave that answer: Acc(a) = min( P10 j=1 1(a = aj) 3 , 1). For fair evaluation, we use the publicly available VQA evaluation servers to compute the overall and per question type results. 6 Table 1: Results of the ablation study on the VQA v2.0 validation. Method All Y/N Num Other Q-type changed VQA 55.13 69.07 34.29 48.01 VQA+Sc 56.80 70.62 35.14 49.99 +2.74% Which VQA+Sc+oDec 58.46 71.05 36.16 52.86 +5.73% What color is the VQA+Sc+oDec+oCls 59.82 72.88 37.38 54.47 +3.68% How VQA+Sc+oDec+oCls+fDec 60.35 74.21 37.46 53.79 +12.63% Is the man VQA+Sc+oDec+oCls+fDec+fAna 60.60 73.78 36.98 54.81 +0.88% Is he ReasonNet-HadamardProduct 58.37 71.05 35.99 52.72 ReasonNet-MCB [6] 58.78 71.04 36.96 53.35 ReasonNet 60.60 73.78 36.98 54.81 5.2 Implementation details Given a question Q about an image I, our model works as follows. Following [18, 6] the images are scaled and center-cropped to a dimensionality of 3 × 448 × 448, then are fed through a ResNet152 [8] pretrained on ImageNet [36]. We utilize the output of the last convolutional layer as the image representation V ∈R2048×14×14. The question words are converted to lowercase and all punctuation characters are removed. We further remove some uninformative words such as “a, “an”, “the”, etc. We then trim the questions to contain at most ten question words by removing the words after the first ten. The lookup table matrix uses 300-dimensional vectors, initialized with word2vec [31] vectors. The module parameters used to produce the module’s outputs are pretrained on each specific task and are kept fixed when applying ReasonNet to the VQA problem. In the following we give details of each module. The object detection module is implemented and pretrained as in [32, 33]. The object classification and scene classification modules are implemented as ResNet-152, the only difference is the object classification module is pretrained on MS-COCO while the scene classification module is pretrained on Places365 [48, 49]. The object classification module outputs 80 different class labels [27], while the scene classification module outputs 365 class labels [48]. We implement and pretrain the face detection module following Zhang et al. [46, 47], while the age and gender classification is performed as [34, 35] and the emotion recognition following [25, 26]. The output of the age classification network is an integer from zero to hundred, so we group the integers into four named groups, 0 −12 as “child”, 13 −30 as “young”, 31 −65 as “adult” and +65 as “old”. This enables as to map the integer outputs to a class labels. Similarly, the output from the gender classification module is 0 for “woman” and 1 for “man”. Finally, the emotion recognition module classifies a detected face to the following seven emotions “Angry”, “Disgust”, “Fear”, “Happy”, “Neutral”, “Sad”, and “Surprise”. The encoder units encodes the module outputs to 500-dimensional vectors, with a hidden layer of 1,500 dimensions. Each bilinear interaction model outputs a 500-dimensional interaction vector, i.e. 500 × 500 →500. The classification network classifies the reasoning vector g using one hidden layer of 2,500 dimensions to one of 4,096 most common answers in the training set. We jointly optimize the parameters of the encoder units, the bilinear models, and the answer classification network using Adam [19] with a learning rate of 0.0007, without learning rate decay. We apply a gradient clipping threshold of 5 and use dropout[41] (with p(keep) = 0.5) layers before and batch normalization[13] after each fully-conected layer as a regularization. 5.3 Ablation study To assess the contribution of each ReasonNet module we perform an ablation study where we train a model that only uses one module and then subsequently add the rest of the proposed VQA modules. A VQA model with only question-specific attention module is denoted as “VQA”, the addition of the scene classification module is denoted as “Sc”, the object detection module as “oDec”, the object classification module as “oCls”, the face detection module as “fDec”, and the face analysis as “fAna”. 7 To evaluate the bilinear model as representation fusion mechanism, we compare ReasonNet to models where we only swap the bilinear interaction learning (Eq. (4)) with (1) Hadamard product (denoted as ReasonNet-HadamardProduct) and with (2) multimodal compact bilinear pooling [6] (denoted as ReasonNet-MCB). The bilinear interaction model maps the two vectors to an interaction vector, by learning a projection matrix W that projects the vectorized outer product of the two vectors to an interaction vector. When using Hadamard product the interaction vector is just an elementwise multiplication of the two vectors. On the other hand, the MCB uses Count Sketch projection function [4] to project the two vectors to a lower dimension and then applies convolution of the two count sketch vectors to produce an interaction vector. As opposed to a bilinear model, the MCB does not learn a projection matrix. We train the models on the VQA v2.0 train set and evaluate them on the validation set. The results are shown in Table 1. From Table 1 we can observe that each module addition improves the overall score. The results show that the object detection module is responsible for the highest increase in accuracy, specifically for question of type “Other”. The addition of the object classification module further improves the accuracy on the “Other” question types, but the addition of the face detection module reduces the accuracy of “Other” question types and increases the accuracy on the “Yes/No” questions. Possible reasons for this is that the two attention modules (object detection and face detection) bring too much noise in the image representation. The increase in accuracy for the “Yes/No” questions is likely because most “Yes/No” questions are about people. Finally, the addition of the face analysis module brings the highest accuracy by returning the accuracy of the “Other” question types, possibly due to the face class labels help in understanding the face attention. The results in Table 1 clearly show the representational expressiveness of the bilinear models as representation fusion. The bilinear model improves the accuracy for all question types, while there is a small difference between the Hadamard product and compact bilinear pooling, as discussed in [18]. Figure 2: Qualitative results: we visualize the concatenation vector g from Eq. (4.1) to investigate the module utilization given an image and two questions about the same image. The question-image pairs are from the VQA v2.0 test set. 5.4 Qualitative analysis and failure cases To investigate the contribution of each of the network modules, we visualize the concatenation vector g from Eq. (4.1) in Figure 2. We show two images from the VQA v2.0 test set and the corresponding g vector values for two questions. Higher values are displayed with lighter shade of gray. From Figure 2 we can observe that for the question “Does the man look happy?” the network strongly use the representation from the face analysis module and partially use the question-only representation and the question-specific attention representation. We can observe the same trend in the next two questions. It is interesting to observe that for complex questions such as “What color is the building the bikes are in front of?” most of the network modules are used which means the network does actually need multifaceted image representation to answer the questions. The first example in Figure 2 also serves as a failure case. Namely, for the question “Does the man look happy?” the network correctly learns to use the face analysis module when the word “happy” is 8 Table 2: Results on the VQA v1.0 and v2.0 test-standard datasets for single models and without data augmentation. NMN is the only other modular neural. Results are taken from the official VQA evaluation servers. VQA v1.0 test VQA v2.0 test Method All Y/N Num Other All Y/N Num Other VQA-LangOnly 48.9 78.1 34.9 27.0 44.26 67.01 31.55 27.37 D-LSTM-nI [14] 58.2 80.6 36.5 43.7 54.22 73.46 35.18 41.83 NMN [2] 58.7 DMN+ [43] 60.4 80.4 36.8 48.3 MRN [17] 61.8 82.4 38.2 49.4 HieCoAtt [29] 62.1 79.9 38.2 51.9 MCB [6] 1 64.7 82.5 37.6 55.6 62.27 78.82 38.28 53.36 MLB [18] 65.1 84.0 38.0 54.8 ReasonNet2 67.9 84.0 38.7 60.4 64.61 78.86 41.98 57.39 present in the question. However, the face analysis module incorrectly classifies the face as “Angry” misleading the network to give a wrong answer. Such error propagation from individual network modules is the main limitation of the proposed model. Future work can possibly overcome this limitation by backpropagating the error through the network modules. On the other hand, there is a constant improvement by the research community for each individual computer vision sub-task, that the limitation might be alleviated by simply incorporating the latest state-of-the-art network module. 5.5 Comparison with the state-of-the-art Compared with the previous state-of-the-art on the VQA v1.0 dataset, the ReasonNet model achieves 2.8% higher accuracy (Table 2). The improvement in accuracy predominately comes from the ability of the ReasonNet model to answer complex questions as evident from the 5.6% increase in accuracy (denoted as “Other” in Table 2). This validates the ability of the ReasonNet to learn complex question-image relationships and to perform reasoning over the learned multimodal representations. We observe the same improvement in accuracy of 2.34% on the more challenging VQA v2.0 dataset. As on the VQA v1.0, the main improvement comes in answering the questions of type “Other” where there is a 4.03% difference. The improvement in the “Other” questions likely comes from learning complex interactions of all modules outputs. There is also an improvement of 3.7% in the counting questions denoted as “Num”, which serves as evidence of the contribution of the object detection and object classification modules. The new state-of-the-art on these datasets indicates the superiority of ReasonNet and the need for reasoning when answering complicated questions whose answering requires reasoning and understanding the relationship of multiple image objects. 6 Conclusion We have presented a novel model for multimodal representation learning and reasoning. Our proposed reasoning model learns to reason over a learned multifaceted image representation conditioned on a text data. We validated the proposed reasoning neural network on the challenging VQA task and the model achieved a new state-of-the-art performance by a wide margin. The proposed reasoning model is general and probably applicable to other tasks involving multimodal representations, such as image captioning. We leave this promising direction for future work. Acknowledgments The work of Jiashi Feng was partially supported by National University of Singapore startup grant R-263-000-C08-133, Ministry of Education of Singapore AcRF Tier One grant R-263-000-C21-112 and NUS IDS grant R-263-000-C67-646. 1Fukui et al. in [6] only report the test-dev results for VQA v1.0. The VQA v2.0 results are obtained from an implementation of their model. 2Due to a bug in the answer generating script the reviewed draft reported slightly lower VQA v2.0 results. 9 References [1] Jacob Andreas, Marcus Rohrbach, Trevor Darrell, and Dan Klein. Learning to compose neural networks for question answering. In HLT-NAACL, 2016. [2] Jacob Andreas, Marcus Rohrbach, Trevor Darrell, and Dan Klein. Neural module networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition CVPR, 2016. [3] Stanislaw Antol, Aishwarya Agrawal, Jiasen Lu, Margaret Mitchell, Dhruv Batra, C. Lawrence Zitnick, and Devi Parikh. VQA: Visual question answering. In The IEEE International Conference on Computer Vision (ICCV), December 2015. [4] Moses Charikar, Kevin Chen, and Martin Farach-Colton. Finding frequent items in data streams. Automata, languages and programming, pages 784–784, 2002. [5] Kan Chen, Jiang Wang, Liang-Chieh Chen, Haoyuan Gao, Wei Xu, and Ram Nevatia. ABC-CNN: An attention based convolutional neural network for visual question answering. arXiv preprint arXiv:1511.05960, 2015. [6] Akira Fukui, Dong Huk Park, Daylen Yang, Anna Rohrbach, Trevor Darrell, and Marcus Rohrbach. Multimodal compact bilinear pooling for visual question answering and visual grounding. In Conference on Empirical Methods in Natural Language Processing (EMNLP), 2016. [7] Yash Goyal, Tejas Khot, Douglas Summers-Stay, Dhruv Batra, and Devi Parikh. Making the V in VQA matter: Elevating the role of image understanding in Visual Question Answering. In Conference on Computer Vision and Pattern Recognition (CVPR), 2017. [8] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, CVPR, pages 770–778, 2016. [9] Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8):1735–1780, 1997. [10] Ronghang Hu, Jacob Andreas, Marcus Rohrbach, Trevor Darrell, and Kate Saenko. Learning to reason: End-to-end module networks for visual question answering. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), 2017. [11] Ronghang Hu, Marcus Rohrbach, Jacob Andreas, Trevor Darrell, and Kate Saenko. Modeling relationships in referential expressions with compositional modular networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2017. [12] Ilija Ilievski, Shuicheng Yan, and Jiashi Feng. A focused dynamic attention model for visual question answering. arXiv preprint arXiv:1604.01485, 2016. [13] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International Conference on Machine Learning, pages 448–456, 2015. [14] Dhruv Batra Jiasen Lu, Xiao Lin and Devi Parikh. Deeper lstm and normalized cnn visual question answering model. https://github.com/VT-vision-lab/VQA_LSTM_CNN, 2015. [15] Justin Johnson, Bharath Hariharan, Laurens van der Maaten, Li Fei-Fei, C Lawrence Zitnick, and Ross Girshick. CLEVR: A diagnostic dataset for compositional language and elementary visual reasoning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition CVPR, 2017. [16] Justin Johnson, Bharath Hariharan, Laurens van der Maaten, Judy Hoffman, Li Fei-Fei, C Lawrence Zitnick, and Ross Girshick. Inferring and executing programs for visual reasoning. In The IEEE International Conference on Computer Vision (ICCV), 2017. [17] Jin-Hwa Kim, Sang-Woo Lee, Donghyun Kwak, Min-Oh Heo, Jeonghee Kim, Jung-Woo Ha, and ByoungTak Zhang. Multimodal residual learning for visual qa. In Advances in Neural Information Processing Systems, pages 361–369, 2016. [18] Jin-Hwa Kim, Kyoung Woon On, Woosang Lim, Jeonghee Kim, Jung-Woo Ha, and Byoung-Tak Zhang. Hadamard Product for Low-rank Bilinear Pooling. In The 5th International Conference on Learning Representations, 2017. [19] Diederik Kingma and Jimmy Ba. ADAM: A method for stochastic optimization. In International Conference on Learning Representations, 2015. 10 [20] Ryan Kiros, Yukun Zhu, Ruslan R Salakhutdinov, Richard Zemel, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. Skip-thought vectors. In Advances in neural information processing systems, pages 3294–3302, 2015. [21] Dan Klein and Christopher D Manning. Accurate unlexicalized parsing. In Proceedings of the 41st Annual Meeting on Association for Computational Linguistics-Volume 1, pages 423–430. Association for Computational Linguistics, 2003. [22] Ranjay Krishna, Yuke Zhu, Oliver Groth, Justin Johnson, Kenji Hata, Joshua Kravitz, Stephanie Chen, Yannis Kalantidis, Li-Jia Li, David A Shamma, et al. Visual Genome: Connecting language and vision using crowdsourced dense image annotations. International Journal of Computer Vision, 2017. [23] Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, 521(7553):436–444, 2015. [24] Yann LeCun, Bernhard Boser, John S Denker, Donnie Henderson, Richard E Howard, Wayne Hubbard, and Lawrence D Jackel. Backpropagation applied to handwritten zip code recognition. Neural computation, 1(4):541–551, 1989. [25] Gil Levi and Tal Hassner. Emotion recognition in the wild via convolutional neural networks and mapped binary patterns. In Proc. ACM International Conference on Multimodal Interaction (ICMI), November 2015. [26] Gil Levi and Tal Hassner. Emotion recognition in the wild via convolutional neural networks and mapped binary patterns. http://www.openu.ac.il/home/hassner/projects/cnn_emotions/, 2015. [27] Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollár, and C Lawrence Zitnick. Microsoft COCO: Common objects in context. In European Conference on Computer Vision, pages 740–755. Springer, 2014. [28] Jonathan Long, Evan Shelhamer, and Trevor Darrell. Fully convolutional networks for semantic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3431–3440, 2015. [29] Jiasen Lu, Jianwei Yang, Dhruv Batra, and Devi Parikh. Hierarchical question-image co-attention for visual question answering. In Advances in Neural Information Processing Systems 29, pages 289–297, 2016. [30] Mateusz Malinowski and Mario Fritz. A multi-world approach to question answering about real-world scenes based on uncertain input. In Advances in Neural Information Processing Systems, pages 1682–1690, 2014. [31] Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In Advances in neural information processing systems, pages 3111–3119, 2013. [32] Pedro O. Pinheiro, Tsung-Yi Lin, Ronan Collobert, and Piotr Dollár. Learning to refine object segments. In ECCV, 2016. [33] Pedro O. Pinheiro, Tsung-Yi Lin, Ronan Collobert, and Piotr Dollár. Learning to refine object segments. https://github.com/facebookresearch/deepmask, 2016. [34] Rasmus Rothe, Radu Timofte, and Luc Van Gool. Deep expectation of real and apparent age from a single image without facial landmarks. International Journal of Computer Vision (IJCV), July 2016. [35] Rasmus Rothe, Radu Timofte, and Luc Van Gool. Deep expectation of real and apparent age from a single image without facial landmarks. https://data.vision.ee.ethz.ch/cvl/rrothe/imdb-wiki/, 2016. [36] Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. International Journal of Computer Vision, 115(3):211–252, 2015. [37] Jürgen Schmidhuber. Deep learning in neural networks: An overview. Neural networks, 61:85–117, 2015. [38] Kevin J Shih, Saurabh Singh, and Derek Hoiem. Where to look: Focus regions for visual question answering. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2016. [39] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In International Conference on Learning Representations, 2015. 11 [40] Elizabeth S Spelke, Karen Breinlinger, Janet Macomber, and Kristen Jacobson. Origins of knowledge. Psychological review, 99(4):605, 1992. [41] Nitish Srivastava, Geoffrey E Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. Journal of machine learning research, 15(1):1929– 1958, 2014. [42] Joshua B Tenenbaum and William T Freeman. Separating style and content. Advances in neural information processing systems, pages 662–668, 1997. [43] Caiming Xiong, Stephen Merity, and Richard Socher. Dynamic memory networks for visual and textual question answering. In International Conference on Machine Learning, pages 2397–2406, 2016. [44] Huijuan Xu and Kate Saenko. Ask, attend and answer: Exploring question-guided spatial attention for visual question answering. In European Conference on Computer Vision, pages 451–466, 2016. [45] Zichao Yang, Xiaodong He, Jianfeng Gao, Li Deng, and Alex Smola. Stacked attention networks for image question answering. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 21–29, 2016. [46] K. Zhang, Z. Zhang, Z. Li, and Y. Qiao. Joint face detection and alignment using multitask cascaded convolutional networks. IEEE Signal Processing Letters, 23(10):1499–1503, Oct 2016. [47] K. Zhang, Z. Zhang, Z. Li, and Y. Qiao. Joint face detection and alignment using multitask cascaded convolutional networks. https://github.com/kpzhang93/MTCNN_face_detection_alignment, 2016. [48] Bolei Zhou, Agata Lapedriza, Aditya Khosla, Aude Oliva, and Antonio Torralba. Places: A 10 million image database for scene recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017. [49] Bolei Zhou, Agata Lapedriza, Aditya Khosla, Aude Oliva, and Antonio Torralba. Places: A 10 million image database for scene recognition. https://github.com/CSAILVision/places365, 2017. [50] Yuke Zhu, Oliver Groth, Michael Bernstein, and Li Fei-Fei. Visual7w: Grounded question answering in images. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4995–5004, 2016. 12
2017
651
7,176
Generative Local Metric Learning for Kernel Regression Yung-Kyun Noh Seoul National University, Rep. of Korea nohyung@snu.ac.kr Masashi Sugiyama RIKEN / The University of Tokyo, Japan sugi@k.u-tokyo.ac.jp Kee-Eung Kim KAIST, Rep. of Korea kekim@cs.kaist.ac.kr Frank C. Park Seoul National University, Rep. of Korea fcp@snu.ac.kr Daniel D. Lee University of Pennsylvania, USA ddlee@seas.upenn.edu Abstract This paper shows how metric learning can be used with Nadaraya-Watson (NW) kernel regression. Compared with standard approaches, such as bandwidth selection, we show how metric learning can significantly reduce the mean square error (MSE) in kernel regression, particularly for high-dimensional data. We propose a method for efficiently learning a good metric function based upon analyzing the performance of the NW estimator for Gaussian-distributed data. A key feature of our approach is that the NW estimator with a learned metric uses information from both the global and local structure of the training data. Theoretical and empirical results confirm that the learned metric can considerably reduce the bias and MSE for kernel regression even when the data are not confined to Gaussian. 1 Introduction The Nadaraya-Watson (NW) estimator has long been widely used for nonparametric regression [16, 26]. The NW estimator uses paired samples to compute a locally weighted average via a kernel function, K(·, ·): RD × RD →R, where D is the dimensionality of data samples. The resulting estimated output for an input x ∈RD is given by the equation: by(x) = PN i=1 K(xi, x)yi PN i=1 K(xi, x) (1) for data D = {xi, yi}N i=1 with xi ∈RD and yi ∈R, and a translation-invariant kernel K(xi, x) = K((x −xi)2). This estimator is regarded as a fundamental canonical method in supervised learning for modeling non-linear relationships using local information. It has previously been used to interpret predictions using kernel density estimation [11], memory retrieval, decision making models [19], minimum empirical mean square error (MSE) with local weights [10, 23], and sampling-based Bayesian inference [25]. All of these interpretations utilize the fact that the estimator will asymptotically converge to the optimal Ep(y|x)[y] with minimum MSE given an infinite number of data samples. However, with finite samples, the NW output by(x) is no longer optimal and can deviate significantly from the true conditional expectation. In particular, the weights given along the directions of large 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. Figure 1: Metric dependency of kernels. The level curves of kernels are hyper-spheres for isotropic kernels in (a), while they are hyper-ellipsoids for kernels with the Mahalanobis metric as shown in (b). The principal directions of hyper-ellipsoids are the eigenvectors of the symmetric positive definite matrix A which is used in the Mahalanobis distance. When the target variable y varies along the ∇y direction in the figure, the weighted average will give less bias if the metric is extended along the orthogonal direction of ∇y as shown in (b). variability in y—e.g. the direction of ∇y as in Fig. 1(a)—causes significant deviation. In this case, naively changing the kernel shape, as shown in Fig. 1(b), can alleviate the deviation. In this work, we investigate more sophisticated methods for finding appropriate kernel shapes via metric learning. Metric learning is used to find specific directions with increased variability. Using information from the training examples, metric learning shrinks or extends distances in directions that are more or less important. A number of studies have focused on using metric learning for nearest neighbor classification [3, 6, 8, 17, 27], and many recent works have applied it to kernel methods as well [12, 13, 28]. Most of these approaches focus on modifying relative distances using triplet relationships or minimizing empirical error with some regularization. In conventional NW regression, the deviation due to finite sampling is mitigated by controlling the bandwidth of the kernel function. The bandwidth controls the balance between the bias and the variance of the estimator, and the finite-sample deviation is reduced with appropriate selection of the bandwidth [9, 20, 21]. Other approaches include trying to explicitly subtract an estimated bias [5, 24] or using a higher-order kernel which eliminates the leading-order terms of the bias [22]. However, many of these direct approaches behave improperly in high-dimensional spaces for two reasons; distance information is dominated by noise, and by using only nearby data, local algorithms suffer due to the small number of data used effectively by the algorithms. In this work, we apply a metric learning method for mitigating the bias. Differently from conventional metric learning methods, we analyze the metric effect on the asymptotic bias and variance of the NW estimator. Then we apply a generative model to alleviate the bias in a high-dimensional space. Our theoretical analysis shows that with a jointly Gaussian assumption on x and y, the metric learning method reduces to a simple eigenvector problem of finding a two-dimensional embedding space where the noise is effectively removed. Our approach is similar to the previous method in applying a simple generative model to mitigate the bias [18], but our analysis shows that there always exists a metric that eliminates the leading-order bias for any shape of Gaussians, and two dimensionality is enough to achieve the zero bias. The algorithm based on this analysis shows a good performance for many benchmark datasets. We interpret the result to mean that the NW estimator indirectly uses the global information through the rough generative model, and the results are improved because the information from the global covariance structure is additionally used, which would never be used in NW estimation otherwise. One well-known extension of NW regression for reducing its bias is locally linear regression (LLR) [23]. LLR shows a zero-bias as well for data from Gaussian, but the parameter is solely estimated locally, which is prone to overfitting in high-dimensional problems. In our experiments, we compare our method with LLR and demonstrate that our method compares favorably with LLR and other competitive methods.. The rest of the paper is organized as follows. In Section 2, we explain our metric learning formulation for kernel regression. In Section 3, we derive the bias and its relationship to the metric, and our proposed algorithm is introduced in Section 4. In Section 5, we provide experiments with other standard regression methods, and conclude with a discussion in Section 6. 2 2 Metric Learning in Kernel Methods We consider a Mahalanobis-type distance for metric learning. The Mahalanobis-type distance between two data points xi ∈RD and xj ∈RD is defined in this work as ||xi −xj||A = q (xi −xj)⊤A(xi −xj),  A ≻0, A⊤= A, |A| = 1  (2) with a symmetric positive definite matrix A ∈RD×D and |A|, the determinant of A. By using this metric, we consider a metric space where the distance is extended or shrunk along the directions of eigenvectors of A, while the volume of the hypersphere is kept the same due to the determinant constraint. With an identity matrix A = I, we obtain the conventional Euclidean distance. A kernel function capturing the local information typically decays rapidly outside a certain distance; conventionally a bandwidth parameter h is used to control the effective number of data within the range of interests. If we use the Gaussian kernel as an example, with the aforementioned metric and bandwidth, the kernel function can be written as K(xi, x) = K ||xi −x||A h  = 1 √ 2π DhD exp  −1 2h2 (xi −x)⊤A (xi −x)  , (3) where the “relative” bandwidths along individual directions are determined by A, and the overall size of the kernel is determined by h. 3 Bias of Nadaraya-Watson Kernel Estimator We first note that our target function is the conditional expectation y(x) = E[y|x], and it is invariant to metric change. When we consider a D-dimensional vector x ∈RD and its stochastic prediction y ∈R, the conditional expectation y(x) = E[y|x] minimizes the MSE. If we consider two different spaces with coordinates x ∈RD and z ∈RD and a linear transformation between these two spaces, z = L⊤x, with a full-rank square matrix L ∈RD×D, the expectation of y is invariant to the coordinate change satisfying E[y|x] = E[y|z], because the conditional density is preserved by the metric change: p(y|x) = p(y|z) for all corresponding x and z, and E[y|x] = Z y p(y|x)dy = Z y p(y|z)dy = E[y|z]. (4) The equivalence means that the target function is invariant to metric change with A = LL⊤, and considering that the NW estimator achieves the optimal prediction E[y|x] with infinite data, optimal prediction is achieved with infinite data regardless of the choice of metric. Thus the metric dependency is actually a finite sampling effect along with the bias and the variance. 3.1 Metric Effects on Bias The bias is the expected deviation of the estimator from the true mean of the target variable y(x): Bias = E [by(x) −y(x)] = E "PN i=1 K(xi, x)yi PN i=1 K(xi, x) −y(x) # . (5) Standard methods for calculating the bias assume asymptotic concentration around the means, both in the numerator and in the denominator of the NW estimator. Usually, the numerator and denominator of the bias are approximated separately, and the bias of the whole NW estimator is calculated using a plug-in method [15, 23]. We assume a kernel satisfying R K(z)dz = 1, R zK(z)dz = 0, and R zz⊤K(z)dz = I. For example, the Gaussian kernel in Eq. (3) satisfies all of these conditions. Then we can first approximate the denominator as1 Ex1,...,xN " 1 N N X i=1 K(xi, x) # = p(x) + h2 2 ∇2p(x) + O(h4), (6) 1See Appendix in the supplementary material for the detailed derivation. 3 with Laplacian ∇2, the trace of the Hessian with respect to x. Similarly, the expectation of the numerator becomes Ex1, . . . , xN , y1, . . . , yN " 1 N N X i=1 K(x, xi)yi # = p(x)y(x) + h2 2 ∇2[p(x)y(x)] + O(h4). (7) Using the plug-ins of Eq. (6) and Eq. (7), we can find the leading-order terms of the NW estimation, and the bias of the NW estimator can be obtained as follows: E "PN i=1 K(x, xi)yi PN i=1 K(x, xi) −y(x) # = h2 ∇⊤p(x)∇y(x) p(x) + ∇2y(x) 2  + O(h4). (8) Here, all gradients ∇and Laplacians ∇2 are with respect to x. We have noted that the target y(x) = E[y|x] is invariant to the metric change, and the metric dependency comes from the finite sample deviation terms. Here, both the gradient and the Laplacian in the deviation are dependent on the change of metric A. 3.2 Conventional Methods of Reducing Bias Previously, there have been works intended to reduce the deviation [9, 20, 21]. A standard approach is to adapt the size of bandwidth parameter h under the minimum MSE criterion. Bandwidth selection has an intuitive motivation of balancing the tradeoff between the bias and the variance; the bias can be reduced by using a small bandwidth but at the cost of increasing the variance. Therefore, for bandwidth selection, the bias and variance criteria have to be used at the same time. Another straightforward and well-known extension of the NW estimator is the locally linear regression (LLR) [2, 23]. Considering that Eq. (1) is the solution minimizing the local empirical MSE: y(x) = arg min α∈R N X i=1 (yi −α)2K(xi, x), (9) the LLR extends this objective function to [y(x), β∗(x)] = arg min α∈R,β∈RD N X i=1 yi −α −β⊤(xi −x) 2K(xi, x), (10) to eliminate the noise produced by the linear component of the target function. The vector parameter β∗(x) ∈RD is the estimated local gradient using local data, and this vector often overfits in a high-dimensional space resulting in a poor solution of α. However, LLR asymptotically produces the bias of BiasLLR = h2 2 ∇2y(x) + O(h4). (11) Eq. (11) can be compared with the NW bias in Eq. (8), where the bias term from the linear variation of y with respect to x, h2 ∇⊤p∇y p , is eliminated. 4 Metric for Nadaraya-Watson Regression In this section, we propose a metric that appropriately reduces the metric-dependent bias of the NW estimator. 4.1 Nadaraya-Watson Regression for Gaussian In order to obtain a metric, we first provide the following theorem which guarantees the existence of a good metric that eliminates the leading order bias at any point regardless of the configuration of Gaussian. Theorem 1: At any point x, there exists a metric matrix A, such that for data x ∈RD and the output y ∈R jointly generated from any (D + 1)-dimensional Gaussian, the NW regression with distance d(x, x′) = ||x −x′||A, for x, x′ ∈RD, has a zero leading-order bias. 4 Based on the theorem, we will consider using the corresponding metric space for NW regression at each point. The theorem is proven using the following Proposition 2 and Lemma 3, which are general claims without the Gaussian assumptions. Proposition 2: There exists a symmetric positive definite matrix A that eliminates the first term ∇⊤p(x)∇y(x) p(x) inside the bias in Eq. (8), when used with the metric in Eq. (2), and when there exist two linearly independent gradients of p(x) and y(x), and p(x) is away from zero. Proof: We consider a coordinate transformation z = L⊤x with L satisfying A = LL⊤. The gradient of a differentiable function y(.) and a density function p(.) with respect to z is ∇zy(z) z=L⊤x = L−1∇xy(x) , ∇zp(z) z=L⊤x = 1 |L|L−1∇xp(x), (12) and the scalar ∇⊤p(x)∇y(x) in the Euclidean space can be rewritten in the transformed space as ∇⊤ z p(z)∇zy(z) = 1 2 ∇⊤ z p(z)∇zy(z) + ∇⊤ zy(z)∇z p(z)  (13) = 1 2|L| ∇⊤ x p(x)L−⊤L−1∇xy(x) + ∇xy(x)L−⊤L−1∇⊤ x p(x)  (14) = 1 2|A| 1 2 tr  A−1 ∇xy(x)∇⊤ x p(x) + ∇xp(x)∇⊤ x y(x)  . (15) The symmetric matrix B = ∇y(x)∇⊤p(x) + ∇p(x)∇⊤y(x) has rank two with independent ∇y(x) and ∇p(x) and can be eigen-decomposed as B = h u1 u2 i  λ1 0 0 λ2  h u1 u2 i⊤ (16) with eigenvectors u1 and u2 and nonzero eigenvalues λ1 and λ2. A sufficient condition for the existence of A is that the two eigenvalues have different signs, in other words, λ1λ2 < 0. Let λ1 > 0 and λ2 < 0 without loss of generality, and we choose a positive definite matrix having the following eigenvector decomposition: A = h u1 u2 · · · i    λ1 0 · · · 0 −λ2 ... ...    h u1 u2 · · · i⊤ . (17) Then Eq. (15) becomes zero, yielding a zero value for the first term of the bias with nonzero p(x). Therefore, we can always find A that eliminates the first term of the bias once B has one positive and one negative eigenvalue, and the following Lemma 3 proves that B always has one positive and one negative eigenvalue. ■ Lemma 3: A symmetric matrix B = (B′+B′⊤)/2 has two nonzero eigenvalues for a rank one matrix B′ = v1v⊤ 2 with two linearly independent vectors, v1 and v2. Here, one of the two eigenvalues is positive, and the other is negative. Proof: We can reformulate B as B = 1 2(v1v⊤ 2 + v2v⊤ 1 ) = 1 2 h v1 v2 i  0 1 1 0  h v1 v2 i⊤ . (18) If we make a new square matrix of size two, M = h v1 v2 i⊤ B h v1 v2 i , the determinant of the matrix is as follows using the eigen-decomposition of B with eigenvectors u1 and u2 and eigenvalues λ1 and λ2: |M| = h v1 v2 i⊤ B h v1 v2 i (19) = h v1 v2 i⊤h u1 u2 i  λ1 0 0 λ2  h u1 u2 i⊤h v1 v2 i (20) = λ1λ2 v⊤ 1 u1v⊤ 2 u2 −v⊤ 1 u2v⊤ 2 u1 2 , (21) 5 and at the same time, |M| is always negative by the following derivation: |M| = h v1 v2 i⊤ B h v1 v2 i = 1 2 h v1 v2 i⊤h v1 v2 i 2  0 1 1 0  < 0. (22) From these calculations, λ1λ2 < 0, and λ1 and λ2 always have different signs. ■ With Proposition 2 and Lemma 3, we always have a metric space associated with A in Eq. (17) that eliminates the leading order bias of a Gaussian, because ∇2y(x) = 0 is always satisfied for x and y which are jointly Gaussian, eliminating the second term of Eq. (8) as well. 4.2 Gaussian Model for Metric Learning We now know there exists an interesting scaling by a metric change where the NW regression achieves the bias O(h4). The metric we use is as follows: ANW = β[u+u−]  λ+ 0 0 −λ−  [u+u−]⊤+ γI, for |ANW| = 1. (23) Here, β is the constant determined from the constraint |ANW| = 1. We use one positive and one negative eigenvalue, λ+ > 0 and λ−< 0, from matrix B: B = ∇y(x)∇⊤p(x) + ∇p(x)∇⊤y(x), (24) and their corresponding eigenvectors u+ and u−. A small positive regularization constant γ is added after being multiplied by the identity matrix. By adding a regularization term to the metric, the deviation with exact ∇p(x) and ∇y(x) becomes nonzero, but a small value, h2 2p(x)tr[A−1 NWB] = h2 2p(x)β  λ+ λ++γ − λ− λ−+γ  = γh2 2p(x)β  λ+ −λ− λ+λ−  + O(γ2). However, with small γ, the deviation is still low unless p(x) is close to zero, or ∇p(x) and ∇y(x) are parallel. The matrix ANW is obtained for every point of interest, and the NW regression of each point is performed with a different ANW calculated at each point. ANW is a function of x, but the changing part is only the rank two matrix, and the calculation is simple, since we only have to solve the eigenvector problem of a 2 × 2 matrix for each query point regardless of the original dimensionality. Note that the bandwidth h is not yet included for the optimization when we obtain the metric. After we obtain the metric, we can still use bandwidth selection for even better MSE. In order to obtain the metric ANW, at every query, we need the information of ∇p(x) and ∇y(x). The knowledge of true y(x) and p(x) is unknown, and we need to obtain the gradient information from data again. Previously, the gradient information was obtained locally with a small number of samples [4, 7], but such methods are not preferred here because we need to overcome the corruption of the local information in high-dimensional cases. Instead, we use a global parametric model: Using a single Gaussian model for all data, we estimate the gradient of true y(x) and p(x) at each point from the global configuration of data fitted by a single Gaussian: p  y x  = N  µy µx  ,  Σy Σyx Σxy Σx  . (25) In fact, the target function y(x) = ΣyxΣ−1 x (x −µx) + µy (See Appendix) can be analytically obtained in a closed form when we estimate the parameters of the Gaussian, but we reuse y(x) for enhancement of the NW regression, and the NW regression updates y(x) using local information. The gradients for metric learning can be obtained using ∇y(x) = bΣ−1 x bΣxy and ∇p(x) p(x) = −bΣ−1 x (x −bµx) from the estimated parameters bΣx, bΣxy, and bµx if the global model is Gaussian. A pseudo-code of the proposed method is presented in Algorithm 1. 4.3 Interpretation of the Metric The learned metric ANW considers the two-dimensional subspace spanned by ∇p(x) = −p(x)Σ−1 x (x −µx) and ∇y(x) = Σ−1 x Σxy. The two-dimensionality analysis of the metric shows that the distant points are used for those in the space orthogonal to this two-dimensional subspace. 6 Algorithm 1 Generative Local Metric Learning for NW Regression Input: data D = {xi, yi}N i=1 and point for regression x Output: regression output by(x) Procedure: 1: Find joint covariance matrix Σ =  Σy Σyx Σxy Σx  and mean vector µ =  µy µx  from data D. 2: Obtain two eigenvectors u1 = ∇p(x) ||∇p(x)|| + ∇y ||∇y|| and u2 = ∇p(x) ||∇p(x)|| − ∇y ||∇y||, (26) and their corresponding eigenvalues λ1 = 1 2p(x)(∇y⊤∇p + ||∇y||||∇p||) and λ2 = 1 2p(x)(∇y⊤∇p −||∇y||||∇p||), (27) using ∇p(x) = −p(x)Σ−1 x (x −µx) and ∇y = Σ−1 x Σxy. (28) 3: Obtain the transform matrix L using u1, u2, λ1, and λ2: L=     | | u1 ||u1|| u2 ||u2|| Uo | |         √λ1 + γ/T √−λ2 + γ/T√γ/T√γ/T ... √γ/T     (29) with T = (λ1 + 1)(−λ2 + γ)γD−2 1 2D , a small constant γ, and an orthonomal matrix Uo ∈ RD×(D−2) spanning the normal space of u1 and u2. 4: Perform NW regression at z = L⊤x using transformed data zi = L⊤xi, i = 1, . . . , N. This fact has the effect of virtually increasing the amount of data compared with algorithms with isotropic kernels, particularly in high-dimensional space. The following proposition gives an intuitive explanation that the bias reduction is more important in high-dimensional space than the reduction of the variance once the optimal bandwidth has been selected balancing the leading terms of the bias and variance after the change of metric. Proposition 2, Lemma 3, and the following Proposition 4 are obtained without any Gaussian assumption. Proposition 4: Let us simplify the MSE as the squared bias obtained from the leading terms in Eq. (8) and the variance2, i.e., f(h) = h4C1 + 1 NhD C2. (31) Then, at some h∗, it has the the minimum f(h∗) = C1 in the limit with infinite D, where D is the dimensionality of data. Proof: The optimal h can be obtained using ∂f(h) ∂h h=h∗=0, and the optimal h is h∗= N − 1 D+4 D · C2 4 · C1  1 D+4 . (32) 2See Section 6 of the Appendix: C1 = ∇⊤p(x)∇y(x) p(x) + ∇2y(x) 2 2 and C2 = 1 (2√π)D σ2 y(x) p(x) (30) 7 −1 0 1 −1 0 1 ∇y(x) (a) (b) (c) Figure 2: (a) Metric calculation for a Gaussian and gradient ∇y. (b) Empirical MSEs with and without the metric. (c) Leading order terms in MSE with optimal bandwidth for various numbers of data. By plugging h∗into f(h) in Eq. (31), we obtain f(h∗) = N − 4 D+4 D 4  4 D+4 +  4 D  D D+4 ! C D D+4 1 C 4 D+4 2 ≃C1. (for D ≫4). ■ (33) In Proposition 4, the first term h4C1 is the square of the bias, and the second term 1 NhD C2 is the derived variance. The MSE is minimized in a high-dimensional space only through the minimization of the bias when it is accompanied by the optimization with respect to the bandwidth h. The plot of MSE in Fig. 2(c) shows that the MSE with bandwidth selection quickly approaches C1 in particular with a small number of data. The derivation shows that we can ignore the variance optimization with respect to the metric change. We only focus on achieving a small bias and rather than minimizing the variance, the bandwidth selection follows later. 5 Experiments The proposed algorithm is evaluated using both synthetic and real datasets. For a Gaussian, Fig. 2(a) depicts the eigenvectors along with the eigenvalues of the matrix B = ∇y∇⊤p + ∇p∇⊤y at different points in the two-dimensional subspace spanned by ∇y and ∇p. The metric can be compared with the adaptive scaling proposed in [14], which determines the metric according to the average amount of ∇y. Our metric also uses ∇y, but the metric is determined using the relationship with ∇p. Fig. 2(a) shows the metric eigenvalues and eigenvectors at each point for a two-dimensional Gaussian with a covariance contour in the figure. With Gaussian data, the MSE with the proposed metric is shown along with MSE with the Euclidean metric in Fig. 2(b). The metric is obtained from the estimated parameter of a jointly Gaussian model, where the result with a learned metric shows a huge difference in the MSE. For real-data experiments, we used the Delve datasets (Abalone, Bank-8fm, Bank-32fh, CPU), UCI datasets (Community, NavalC, NavalT, Protein, Slice), KEEL datasets (Ailerons, Elevators, Puma32h) [1], and datasets from a previous paper (Pendulum, Pol) [15]. The datasets include dozens of features and several thousands to tens of thousands of data. Using a Gaussian model with regularized maximum likelihood estimated parameters, we apply a metric which minimizes the bias with a fixed γ = max(|λ1|, |λ2|) × 10−2, and we choose h from a pre-chosen validation set. NW estimation with the proposed metric (NW+GMetric) is compared with the conventional NW estimation (NW), LLR (LLR), the previous metric learning method for NW regression (NW+WMetric [28], NW+KMetric [14]), a more flexible Gaussian process regression (GPR) with the Gaussian kernel, and the Gaussian globally linear model (GGL) using y(x) = bΣyxbΣ−1 x (x −bµx) + bµy. For eleven datasets among a total of fourteen datasets, the NW estimation with the proposed metric statistically achieves one of the best performances. Even when the estimation does not achieve the best performance, the metric always reduces the MSE from the original NW estimation. In particular, in the Slice, Pol, CPU, NavalC, and NavalT datasets, GGL performs poorly showing the non-Gaussianity of data, while the metric using the same information effectively reduces the MSE 8 Figure 3: Regression with real-world datasets. NW is the NW regression with conventionial kernels, NW+GMetric is the NW regression with the proposed metric, LLR is the locally linear regression, NW+WMetric [28] and NW+KMetric [14] are different metrics for NW regression, GPR is the Gaussian process regression, and GGL is the Gaussian globally linear model. Normalized MSE (NMSE) is the ratio between the MSE and the variance of the target value. If we constantly choose the mean of the target, we get an NMSE of 1. from the original NW estimator. A detailed discussion comparing the proposed method with other methods for non-Gaussian data is provided in Section 3 and 4 of the Appendix. 6 Conclusions An effective metric function is investigated for reducing the bias of NW regression. Our analysis has shown that the bias can be minimized under certain generative assumptions. The optimal metric is obtained by solving a series of eigenvector problems of size 2 by 2 and needs no explicit gradients or curvature information. The Gaussian model captures only the rough covariance structure of whole data. The proposed approach uses the global covariance to identify the directions that are most likely to have gradient components, and the experiments with real data show that the method is effective for more reliable and less biased estimation. This is in contrast to LLR which attempts to eliminate the linear noise, but the noise elimination relies on a small number of local data. In contrast, our model uses additional information from distant data only if they are close in the projected two-dimensional subspace. As a result, the metric allows a more reliable unbiased estimation of the NW estimator. We have also shown that minimizing the variance is relatively unimportant in high-dimensional spaces compared to minimizing the bias, especially when the bandwidth selection method is used. Consequently, our bias minimization method can achieve sufficiently low MSE without the additional computational cost incurred by empirical MSE minimization. 9 Acknowledgments YKN acknowledges support from NRF/MSIT-2017R1E1A1A03070945, BK21Plus in Korea, MS from KAKENHI 17H01760 in Japan, KEK from IITP/MSIT 2017-0-01778 in Korea, FCP from BK21Plus, MITIP10048320 in Korea, and DDL from the NSF, ONR, ARL, AFOSR, DOT, DARPA in US. References [1] J. Alcalá-Fdez, A. Fernandez, J. Luengo, J. Derrac, S. García, L. Sánchez, and F. Herrera. KEEL data-mining software tool: Data set repository, integration of algorithms and experimental analysis framework. Journal of Multiple-Valued Logic and Soft Computing, 17(2-3):255–287, 2011. [2] C. G. Atkeson, A. W. Moore, and S. Schaal. Locally weighted learning. Artificial Intelligence Review, 11(1-5):11–73, 1997. [3] A. Bellet, A. Habrard, and M. Sebban. A survey on metric learning for feature vectors and structured data. CoRR, abs/1306.6709, 2013. [4] Y. Cheng. Mean shift, mode seeking, and clustering. IEEE Transactions on Pattern Analysis and Machine Intelligence, 17:790–799, 1995. [5] E. Choi, P. Hall, and V. Rousson1. Data sharpening methods for bias reduction in nonparametric regression. Annals of Statistics, 28(5):1339–1355, 2000. [6] J.V. Davis, B. Kulis, P. Jain, S. Sra, and I.S. Dhillon. Information-theoretic metric learning. In Proceedings of the 24th International Conference on Machine Learning, pages 209–216, 2007. [7] K. Fukunaga and D. H. Larry. The estimation of the gradient of a density function, with applications in pattern recognition. IEEE Transactions on Information Theory, 21:32–40, 1975. [8] J. Goldberger, S. Roweis, G. Hinton, and R. Salakhutdinov. Neighbourhood components analysis. In Advances in Neural Information Processing Systems 17, pages 513–520. 2005. [9] P. Hall, S. J. Sheather, M. C. Jones, and J. S. Marron. On optimal data-based bandwidth selection in kernel density estimation. Biometrika, 78:263–269, 1991. [10] T. Hastie, R. Tibshirani, and J. Friedman. The Elements of Statistical Learning. Springer Series in Statistics. Springer New York Inc., New York, NY, USA, 2001. [11] S. Haykin. Neural Networks and Learning Machines (3rd Edition). Prentice Hall, 2008. [12] R. Huang and S. Sun. Kernel regression with sparse metric learning. Journal of Intelligent and Fuzzy Systems, 24(4):775–787, 2013. [13] P. W. Keller, S. Mannor, and D. Precup. Automatic basis function construction for approximate dynamic programming and reinforcement learning. In Proceedings of the 23rd International Conference on Machine Learning, pages 449–456, 2006. [14] S. Kpotufe, A. Boularias, T. Schultz, and K. Kim. Gradients weights improve regression and classification. Journal of Machine Learning Research, 17(22):1–34, 2016. [15] M. Lazaro-Gredilla and A. R. Figueiras-Vidal. Marginalized neural network mixtures for large-scale regression. IEEE Transactions on Neural Networks, 21(8):1345–1351, 2010. [16] E. A. Nadaraya. On estimating regression. Theory of Probability and its Applications, 9:141– 142, 1964. [17] B. Nguyen, C. Morell, and B. De Baets. Large-scale distance metric learning for k-nearest neighbors regression. Neurocomputing, 214:805–814, 2016. [18] Y.-K. Noh, B.-T. Zhang, and D. D. Lee. Generative local metric learning for nearest neighbor classification. IEEE Transactions on Pattern Analysis and Machine Intelligence, 40(1):106–118, 2018. [19] R. M. Nosofsky and T. J. Palmeri. An exemplar-based random walk model of speeded classification. Psychological Review, 104(2):266–300, 1997. [20] B. U. Park and J. S. Marron. Comparison of data-driven bandwidth selectors. Journal of the American Statistical Association, 85:66–72, 1990. [21] B. U. Park and B. A. Turlach. Practical performance of several data driven bandwidth selectors. Computational Statistics, 7:251–270, 1992. 10 [22] E. Parzen. On estimation ofa probability density function and mode. Annals of Mathematical Statistics, 33:1065–1076, 1962. [23] D. Ruppert and M. P. Wand. Multivariate Locally Weighted Least Squares Regression. The Annals of Statistics, 22(3):1346–1370, 1994. [24] W. R. Schucany and John P. Sommers. Improvement of kernel type density estimators. Journal of the American Statistical Association, 72:420–423, 1977. [25] L. Shi, T. L. Griffiths, N. H. Feldman, and A. N. Sanborn. Exemplar models as a mechanism for performing Bayesian inference. Psychonomic bulletin & review, 17(4):443–464, 2010. [26] Geoffrey S. Watson. Smooth regression analysis. Sankhy¯a: The Indian Journal of Statistics, Series A, 26:359–372, 1964. [27] K. Q. Weinberger, J. Blitzer, and L. K. Saul. Distance metric learning for large margin nearest neighbor classification. In Advances in Neural Information Processing Systems 18, pages 1473–1480. 2006. [28] K. Q. Weinberger and G. Tesauro. Metric learning for kernel regression. In Eleventh international conference on artificial intelligence and statistics, pages 608–615, 2007. 11
2017
652
7,177
Overcoming Catastrophic Forgetting by Incremental Moment Matching Sang-Woo Lee1, Jin-Hwa Kim1, Jaehyun Jun1, Jung-Woo Ha2, and Byoung-Tak Zhang1,3 Seoul National University1 Clova AI Research, NAVER Corp2 Surromind Robotics3 {slee,jhkim,jhjun}@bi.snu.ac.kr jungwoo.ha@navercorp.com btzhang@bi.snu.ac.kr Abstract Catastrophic forgetting is a problem of neural networks that loses the information of the first task after training the second task. Here, we propose a method, i.e. incremental moment matching (IMM), to resolve this problem. IMM incrementally matches the moment of the posterior distribution of the neural network which is trained on the first and the second task, respectively. To make the search space of posterior parameter smooth, the IMM procedure is complemented by various transfer learning techniques including weight transfer, L2-norm of the old and the new parameter, and a variant of dropout with the old parameter. We analyze our approach on a variety of datasets including the MNIST, CIFAR-10, Caltech-UCSDBirds, and Lifelog datasets. The experimental results show that IMM achieves state-of-the-art performance by balancing the information between an old and a new network. 1 Introduction Catastrophic forgetting is a fundamental challenge for artificial general intelligence based on neural networks. The models that use stochastic gradient descent often forget the information of previous tasks after being trained on a new task [1, 2]. Online multi-task learning that handles such problems is described as continual learning. This classic problem has resurfaced with the renaissance of deep learning research [3, 4]. Recently, the concept of applying a regularization function to a network trained by the old task to learning a new task has received much attention. This approach can be interpreted as an approximation of sequential Bayesian [5, 6]. Representative examples of this regularization approach include learning without forgetting [7] and elastic weight consolidation [8]. These algorithms succeeded in some experiments where their own assumption of the regularization function fits the problem. Here, we propose incremental moment matching (IMM) to resolve the catastrophic forgetting problem. IMM uses the framework of Bayesian neural networks, which implies that uncertainty is introduced on the parameters in neural networks, and that the posterior distribution is calculated [9, 10]. The dimension of the random variable in the posterior distribution is the number of the parameters in the neural networks. IMM approximates the mixture of Gaussian posterior with each component representing parameters for a single task to one Gaussian distribution for a combined task. To merge the posteriors, we introduce two novel methods of moment matching. One is mean-IMM, which simply averages the parameters of two networks for old and new tasks as the minimization of the average of KL-divergence between one approximated posterior distribution for the combined task 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. 1 µ 2 µ 1:2 Mode µ 1:2 Mean µ 1 1 1 1 1 1:2 1 2 1 1 2 2 ( ) ( ) Mode µ µ µ = S + S S + S 1:2 1 2 ( ) / 2 Mean µ µ µ = + 1 2 µ µ ® 2 2 1 2 µ µ 1 2 1 2 ( ) dropout µ µ µ + × Find !2, which makes !1:2 perform better drop-transfer weight-transfer L2-transfer Figure 1: Geometric illustration of incremental moment matching (IMM). Mean-IMM simply averages the parameters of two neural networks, whereas mode-IMM tries to find a maximum of the mixture of Gaussian posteriors. To make IMM be reasonable, the search space of the loss function between the posterior means µ1 and µ2 should be reasonably smooth and convex-like. To find a µ2 which satisfies this condition of a smooth and convex-like path from µ1, we propose applying various transfer techniques for the IMM procedure. and each Gaussian posterior for the single task [11]. The other is mode-IMM, which merges the parameters of two networks using a Laplacian approximation [9] to approximate a mode of the mixture of two Gaussian posteriors, which represent the parameters of the two networks. In general, it is too naïve to assume that the final posterior distribution for the whole task is Gaussian. To make our IMM work, the search space of the loss function between the posterior means needs to be smooth and convex-like. In other words, there should not be high cost barriers between the means of the two networks for an old and a new task. To make our assumption of Gaussian distribution for neural network reasonable, we applied three main transfer learning techniques on the IMM procedure: weight transfer, L2-norm of the old and the new parameters, and our newly proposed variant of dropout using the old parameters. The whole procedure of IMM is illustrated in Figure 1. 2 Previous Works on Catastrophic Forgetting One of the major approaches preventing catastrophic forgetting is to use an ensemble of neural networks. When a new task arrives, the algorithm makes a new network, and shares the representation between the tasks [12, 13]. However, this approach has a complexity issue, especially in inference, because the number of networks increases as the number of new tasks that need to be learned increases. Another approach studies the methods using implicit distributed storage of information, in typical stochastic gradient descent (SGD) learning. These methods use the idea of dropout, maxout, or neural module to distributively store the information for each task by making use of the large capacity of the neural network [4]. Unfortunately, most studies following this approach had limited success and failed to preserve performance on the old task when an extreme change to the environment occurred [3]. Alternatively, Fernando et al. [14] proposed PathNet, which extends the idea of the ensemble approach for parameter reuse [13] within a single network. In PathNet, a neural network has ten or twenty modules in each layer, and three or four modules are picked for one task in each layer by an evolutionary approach. This method alleviates the complexity issue of the ensemble approach to continual learning in a plausible way. The approach with a regularization term also has received attention. Learning without forgetting (LwF) is one example of this approach, which uses the pseudo-training data from the old task [7]. Before learning the new task, LwF puts the training data of the new task into the old network, and uses the output as pseudo-labels of the pseudo-training data. By optimizing both the pseudotraining data of the old task and the real data of the new task, LwF attempts to prevent catastrophic forgetting. This framework is promising where the properties of the pseudo training set is similar to the ideal training set. Elastic weight consolidation (EWC), another example of this approach, uses sequential Bayesian estimation to update neural networks for continual learning [8]. In EWC, the posterior distribution trained by the previous task is used to update the new prior distribution. This new prior is used for learning the new posterior distribution of the new task in a Bayesian manner. 2 EWC assumes that the covariance matrix of the posterior is diagonal and there are no correlations between the nodes. Though this assumption is fragile, EWC performs well in some domains. EWC is a monumental recent work that uses sequential Bayesian for continual learning of neural networks. However, updating the parameter of complex hierarchical models by sequential Bayesian estimation is not new [5]. Sequential Bayes was used to learn topic models from stream data by Broderick et al. [6]. Huang et al. applied sequential Bayesian to adapt a deep neural network to the specific user in the speech recognition domain [15, 16]. They assigned the layer for the user adaptation and applied MAP estimation to this single layer. Similar to our IMM method, Bayesian moment matching is used for sum-product networks, a kind of deep hierarchical probabilistic model [17]. Though sum-product networks are usually not scalable to large datasets, their online learning method is useful, and it achieves similar performance to the batch learner. Our method using moment matching focuses on continual learning and deals with significantly different statistics between tasks, unlike the previous method. 3 Incremental Moment Matching In incremental moment matching (IMM), the moments of posterior distributions are matched in an incremental way. In our work, we use a Gaussian distribution to approximate the posterior distribution of parameters. Given K sequential tasks, we want to find the optimal parameter µ∗ 1:K and Σ∗ 1:K of the Gaussian approximation function q1:K from the posterior parameter for each kth task, (µk, Σk). p1:K ≡p(θ|X1, · · · , XK, y1, · · · , yK) ≈q1:K ≡q(θ|µ1:K, Σ1:K) (1) pk ≡p(θ|Xk, yk) ≈qk ≡q(θ|µk, Σk) (2) q1:K denotes an approximation of the true posterior distribution p1:K for the whole task, and qk denotes an approximation of the true posterior distribution pk over the training dataset (Xk, yk) for the kth task. θ denotes the vectorized parameter of the neural network. The dimension of µk and µ1:k is D, and the dimension of Σk and Σ1:k is D × D, respectively, where D is the dimension of θ. For example, a multi-layer perceptrons (MLP) with [784-800-800-800-10] has the number of nodes, D = 1917610 including bias terms. Next, we explain two proposed moment matching algorithms for the continual learning of modern deep neural networks. The two algorithms generate two different moments of Gaussian with different objective functions for the same dataset. 3.1 Mean-based Incremental Moment Matching (mean-IMM) Mean-IMM averages the parameters of two networks in each layer, using mixing ratios αk with PK k αk = 1. The objective function of mean-IMM is to minimize the following local KL-distance or the weighted sum of KL-divergence between each qk and q1:K [11, 18]: µ∗ 1:K, Σ∗ 1:K = argmin µ1:K,Σ1:K PK k αkKL(qk||q1:K) (3) µ∗ 1:K = PK k αkµk (4) Σ∗ 1:K = PK k αk(Σk + (µk −µ∗ 1:K)(µk −µ∗ 1:K)T ) (5) µ∗ 1:K and Σ∗ 1:K are the optimal solution of the local KL-distance. Notice that covariance information is not needed for mean-IMM, since calculating µ∗ 1:K does not require any Σk. A series of µk is sufficient to perform the task. The idea of mean-IMM is commonly used in shallow networks [19, 20]. However, the contribution of this paper is to discover when and how mean-IMM can be applied in modern deep neural networks and to show it can performs better with other transfer techniques. Future works may include other measures to merge the networks, including the KL-divergence between q1:K and the mixture of each qk (i.e. KL(q1:K||PK k αkqk)) [18]. 3 3.2 Mode-based Incremental Moment Matching (mode-IMM) Mode-IMM is a variant of mean-IMM which uses the covariance information of the posterior of Gaussian distribution. In general, a weighted average of two mean vectors of Gaussian distributions is not a mode of MoG. In discriminative learning, the maximum of the distribution is of primary interest. According to Ray and Lindsay [21], all the modes of MoG with K clusters lie on (K −1)dimensional hypersurface {θ|θ = (PK k akΣ−1 k )−1(PK k akΣ−1 k µk), 0 < ak < 1 and P k ak = 1}. See Appendix A for more details. Motivated by the above description, a mode-IMM approximate MoG with Laplacian approximation, in which the logarithm of the function is expressed by the Taylor expansion [9]. Using Laplacian approximation, the MoG is approximated as follows: log q1:K ≈PK k αk log qk + C = −1 2θT (PK k αkΣ−1 k )θ + (PK k αkΣ−1 k µk)θ + C′ (6) µ∗ 1:K = Σ∗ 1:K · (PK k αkΣ−1 k µk) (7) Σ∗ 1:K = (PK k αkΣ−1 k )−1 (8) For Equation 8, we add ϵI to the term to be inverted in practice, with an identity matrix I and a small constant ϵ. Here, we assume diagonal covariance matrices, which means that there is no correlation among parameters. This diagonal assumption is useful, since it decreases the number of parameters for each covariance matrix from O(D2) to O(D) for the dimension of the parameters D. For covariance, we use the inverse of a Fisher information matrix, following [8, 22]. The main idea of this approximation is that the square of gradients for parameters is a good indicator of their precision, which is the inverse of the variance. The Fisher information matrix for the kth task, Fk is defined as: Fk = E  ∂ ∂µk ln p(˜y|x, µk) · ∂ ∂µk ln p(˜y|x, µk)T  , (9) where the probability of the expectation follows x ∼πk and ˜y ∼p(y|x, µk), where πk denotes an empirical distribution of Xk. 4 Transfer Techniques for Incremental Moment Matching In general, the loss function of neural networks is not convex. Consider that shuffling nodes and their weights in a neural network preserves the original performance. If the parameters of two neural networks initialized independently are averaged, it might perform poorly because of the high cost barriers between the parameters of the two neural networks [23]. However, we will show that various transfer learning techniques can be used to ease this problem, and make the assumption of Gaussian distribution for neural networks reasonable. In this section, we introduce three practical techniques for IMM, including weight-transfer, L2-transfer, and drop-transfer. 4.1 Weight-Transfer Weight-transfer initialize the parameters for the new task µk with the parameters of the previous task µk−1 [24]. In our experiments, the use of weight-transfer was critical to the continual learning performance. For this reason, the experiments on IMM in this paper use the weight-transfer technique by default. The weight-transfer technique is motivated by the geometrical property of neural networks discovered in the previous work [23]. They found that there is a straight path from the initial point to the solution without any high cost barrier, in various types of neural networks and datasets. This discovery suggests that the weight-transfer from the previous task to the new task makes a smooth loss 4 Figure 2: Experimental results on visualizing the effect of weight-transfer. The geometric property of the parameter space of the neural network is analyzed. Brighter is better. θ1, θ2, and θ3 are the vectorized parameters of trained networks from randomly selected subsets of the CIFAR-10 dataset. This figure shows that there are better solutions between the three locally optimized parameters. surface between two solutions for the tasks, so that the optimal solution for both tasks lies on the interpolated point of the two solutions. To empirically validate the concept of weight-transfer, we use the linear path analysis proposed by Goodfellow et al. [23] (Figure 2). We randomly chose 18,000 instances from the training dataset of CIFAR-10, and divided them into three subsets of 6,000 instances each. These three subsets are used for sequential training by CNN models, parameterized by θ1, θ2, and θ3, respectively. Here, θ2 is initialized from θ1, and then θ3 is initialized from θ2, in the same way as weight-transfer. In this analysis, each loss and accuracy is evaluated at a series of points θ = θ1 + α(θ2 −θ1) + β(θ3 − θ2), varying α and β. In Figure 2, the loss surface of the model on each online subset is nearly convex. The figure shows that the parameter at 1 3(θ1 + θ2 + θ3), which is the same as the solution of mean-IMM, performs better than any other reference points θ1, θ2, or θ3. However, when θ2 is not initialized by θ1, the convex-like shape disappears, since there is a high cost barrier between the loss function of θ1 and θ2. 4.2 L2-transfer L2-transfer is a variant of L2-regularization. L2-transfer can be interpreted as a special case of EWC where the prior distribution is Gaussian with λI as a covariance matrix. In L2-transfer, a regularization term of the distance between µk−1 and µk is added to the following objective function for finding µk, where λ is a hyperparameter: log p(yk|Xk, µk) −λ · ||µk −µk−1||2 2 (10) The concept of L2-transfer is commonly used in transfer learning [25, 26] and continual learning [7, 8] with large λ. Unlike the previous usage of large λ, we use small λ for the IMM procedure. In other words, µk is first trained by Equation 10 with small λ, and then merged to µ1:k in our IMM. Since we want to make the loss surface between µk−1 and µk smooth, and not to minimize the distance between µk−1 and µk. In convex optimization, the L2-regularizer makes the convex function strictly convex. Similarly, we hope L2-transfer with small λ help to find a µk with a convexlike loss space between µk−1 and µk. 4.3 Drop-transfer Drop-transfer is a novel method devised in this paper. Drop-transfer is a variant of dropout where µk−1 is the zero point of the dropout procedure. In the training phase, the following ˆµk,i is used for the weight vector corresponding to the ith node µk,i: ˆµk,i = ( µk−1,i, if ith node is turned off 1 1−p · µk,i − p 1−p · µk−1,i, otherwise (11) where p is the dropout ratio. Notice that the expectation of ˆµk,i is µk,i. 5 Table 1: The averaged accuracies on the disjoint MNIST for two sequential tasks (Top) and the shuffled MNIST for three sequential tasks (Bottom). The untuned setting refers to the most natural hyperparameter in the equation of each algorithm, whereas the tuned setting refers to using heuristic hand-tuned hyperparameters. Hyperparam denotes the main hyperparameter of each algorithm. For IMM with transfer, only α is tuned. The numbers in the parentheses refer to standard deviation. Every IMM uses weight-transfer. Explanation of Untuned Tuned Disjoint MNIST Experiment Hyperparam Hyperparam Accuracy Hyperparam Accuracy SGD [3] epoch per dataset 10 47.72 (± 0.11) 0.05 71.32 (± 1.54) L2-transfer [25] λ in (10) 0.05 85.81 (± 0.52) Drop-transfer p in (11) 0.5 51.72 (± 0.79) 0.5 51.72 (± 0.79) EWC [8] λ in (20) 1.0 47.84 (± 0.04) 600M 52.72 (± 1.36) Mean-IMM α2 in (4) 0.50 90.45 (± 2.24) 0.55 91.92 (± 0.98) Mode-IMM α2 in (7) 0.50 91.49 (± 0.98) 0.45 92.02 (± 0.73) L2-transfer + Mean-IMM λ / α2 0.001 / 0.50 78.34 (± 1.82) 0.001 / 0.60 92.62 (± 0.95) L2-transfer + Mode-IMM λ / α2 0.001 / 0.50 92.52 (± 0.41) 0.001 / 0.45 92.73 (± 0.35) Drop-transfer + Mean-IMM p / α2 0.5 / 0.50 80.75 (± 1.28) 0.5 / 0.60 92.64 (± 0.60) Drop-transfer + Mode-IMM p / α2 0.5 / 0.50 93.35 (± 0.49) 0.5 / 0.50 93.35 (± 0.49) L2, Drop-transfer + Mean-IMM λ / p / α2 0.001 / 0.5 / 0.50 66.10 (± 3.19) 0.001 / 0.5 / 0.75 93.97 (± 0.23) L2, Drop-transfer + Mode-IMM λ / p / α2 0.001 / 0.5 / 0.50 93.97 (± 0.32) 0.001 / 0.5 / 0.45 94.12 (± 0.27) Shuffled MNIST Experiment Hyperparam Accuracy Hyperparam Accuracy SGD [3] epoch per dataset 60 89.15 (± 2.34) ∼95.5 [8] L2-transfer [25] λ in (10) 1e-3 96.37 (± 0.62) Drop-transfer p in (11) 0.5 94.75 (± 0.62) 0.2 96.86 (± 0.21) EWC [8] λ in (20) ∼98.2 [8] Mean-IMM α3 in (4) 0.33 93.23 (± 1.37) 0.55 95.02 (± 0.42) Mode-IMM α3 in (7) 0.33 98.02 (± 0.05) 0.60 98.08 (± 0.08) L2-transfer + Mean-IMM λ / α3 1e-4 / 0.33 90.38 (± 1.74) 1e-4 / 0.65 95.93 (± 0.31) L2-transfer + Mode-IMM λ / α3 1e-4 / 0.33 98.16 (± 0.08) 1e-4 / 0.60 98.30 (± 0.08) Drop-transfer + Mean-IMM p / α3 0.5 / 0.33 90.79 (± 1.30) 0.5 / 0.65 96.49 (± 0.44) Drop-transfer + Mode-IMM p / α3 0.5 / 0.33 97.80 (± 0.07) 0.5 / 0.55 97.95 (± 0.08) L2, Drop-transfer + Mean-IMM λ / p / α3 1e-4 / 0.5 / 0.33 89.51 (± 2.85) 1e-4 / 0.5 / 0.90 97.36 (± 0.19) L2, Drop-transfer + Mode-IMM λ / p / α3 1e-4 / 0.5 / 0.33 97.83 (± 0.10) 1e-4 / 0.5 / 0.50 97.92 (± 0.05) There are studies [27, 20] that have interpreted dropout as an exponential ensemble of weak learners. By this perspective, since the marginalization of output distribution over the whole weak learner is intractable, the parameters multiplied by the inverse of the dropout rate are used for the test phase in the procedure. In other words, the parameters of the weak learners are, in effect, simply averaged oversampled learners by dropout. At the process of drop-transfer in our continual learning setting, we hypothesize that the dropout process makes the averaged point of two arbitrary sampled points using Equation 11 a good estimator. We investigated the search space of the loss function of the MLP trained from the MNIST handwritten digit recognition dataset for with and without dropout regularization, to supplement the evidence of the described hypothesis. Dropout regularization makes the accuracy of a sampled point from dropout distribution and an average point of two sampled parameters, from 0.450 (± 0.084) to 0.950 (± 0.009) and 0.757 (± 0.065) to 0.974 (± 0.003), respectively. For the case of both with and without dropout, the space between two arbitrary samples is empirically convex, and fits to the second-order equation. Based on this experiment, we expect not only that the search space of the loss function between modern neural networks can be easily nearly convex [23], but also that regularizers, such as dropout, make the search space smooth and the point in the search space have a good accuracy in continual learning. 5 Experimental Results We evaluate our approach on four experiments, whose settings are intensively used in the previous works [4, 8, 7, 12]. For more details and experimental results, see Appendix D. The source code for the experiments is available in Github repository1. Disjoint MNIST Experiment. The first experiment is the disjoint MNIST experiment [4]. In this experiment, the MNIST dataset is divided into two datasets: the first dataset consists of only digits {0, 1, 2, 3, 4} and the second dataset consists of the remaining digits {5, 6, 7, 8, 9}. Our task is 101https://github.com/btjhjeon/IMM_tensorflow 6 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 1.2 alpha, for weighing two networks Test Accuracy The disjoint MNIST experiment First Task, Mean−IMM Second Task, Mean−IMM First Task, Mode−IMM Second Task, Mode−IMM 0 0.2 0.4 0.6 0.8 1 0.95 0.955 0.96 0.965 0.97 0.975 0.98 0.985 0.99 0.995 1 alpha, for weighing two networks Test Accuracy The shuffled MNIST experiment First Task, Mean−IMM Second Task, Mean−IMM First Task, Mode−IMM Second Task, Mode−IMM 0 0.2 0.4 0.6 0.8 1 0.52 0.54 0.56 0.58 0.6 0.62 alpha, for weighing two networks Test Accuracy The ImageNet2CUB experiment First Task, Mean−IMM Second Task, Mean−IMM First Task, Mode−IMM Second Task, Mode−IMM Figure 3: Test accuracies of two IMM models with weight-transfer on the disjoint MNIST (Left), the shuffled MNIST (Middle), and the ImageNet2CUB experiment (Right). α is a hyperparameter that balances the information between the old and the new task. 0 0.2 0.4 0.6 0.8 1 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 alpha, for weighing two networks Test Accuracy The disjoint MNIST experiment Mean−IMM Mode−IMM L2−transfer + Mean−IMM L2−transfer + Mode−IMM 0 0.2 0.4 0.6 0.8 1 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 alpha, for weighing two networks Test Accuracy The disjoint MNIST experiment Mean−IMM Mode−IMM Drop−transfer + Mean−IMM Drop−transfer + Mode−IMM L2, Drop−transfer + Mean−IMM L2, Drop−transfer + Mode−IMM Figure 4: Test accuracies of IMM with various transfer techniques on the disjoint MNIST. Both L2transfer and drop-transfer boost the performance of IMM and make the optimal value of α larger than 1/2. However, drop-transfer tends to make the accuracy curve more smooth than L2-transfer does. class joint categorization, unlike the setting in the previous work, which considers two independent tasks of 5-class categorization. Because the inference should decide whether a new instance comes from the first or the second task, our task is more difficult than the task of the previous work. We evaluate the models both on the untuned setting and the tuned setting. The untuned setting refers to the most natural hyperparameter in the equation of each algorithm. The tuned setting refers to using heuristic hand-tuned hyperparameters. Consider that tuned hyperparameter setting is often used in previous works of continual learning as it is difficult to define a validation set in their setting. For example, when the model needs to learn from the new task after learning from the old task, a low learning rate or early stopping without a validation set, or arbitrary hyperparameter for balancing is used [3, 8]. We discover hyperparameters in the tuned setting not only to find the oracle performance of each algorithm, but also to show that there exist some paths consisting of the point that performs reasonably for both tasks. Hyperparam in Table 1 denotes hyperparameter mainly searched in the tuned setting. Table 1 (Top) and Figure 3 (Left) shows the experimental results from the disjoint MNIST experiment. In our experimental setting, the usual SGD-based optimizers always perform less than 50%, because the biases of the output layer for the old task are always pushed to large negative values, which implies that our task is difficult. Figure 4 also shows that mode-IMM is robust with α and the optimal α of mean-IMM is larger than 1/2 in the disjoint MNIST experiment. Shuffled MNIST Experiment. The second experiment is the shuffled MNIST experiment [3, 8] of three sequential tasks. In this experiment, the first dataset is the same as the original MNIST dataset. However, in the second dataset, the input pixels of all images are shuffled with a fixed, random permutation. In previous work, EWC reaches the performance level of the batch learner, and it is argued that EWC overcomes catastrophic forgetting in some domains. The experimental details are similar to the disjoint MNIST experiment, except all models are allowed to use dropout regularization. In the experiment, the first dataset is the same as the original MNIST dataset. However, in the second and the third dataset, the input pixels of all images are shuffled with a fixed, random permutation, 7 Table 2: Experimental results on the Lifelog dataset among different classes (location, sub-location, and activity) and different subjects (A, B, C). Every IMM uses weight-transfer. Location Sub-location Activity A B C Dual memory architecture [12] 78.11 72.36 52.92 67.02 58.80 77.57 Mean-IMM 77.60 73.78 52.74 67.03 57.73 79.35 Mode-IMM 77.14 75.76 54.07 67.97 60.12 78.89 respectively. Therefore, the difficulty of the three datasets is the same, though a different solution is required for each dataset. Table 1 (Bottom) and Figure 3 (Middle) shows the experimental results from the shuffled MNIST experiment. Notice that accuracy of drop-transfer (p = 0.2) alone is 96.86 (± 0.21) and L2-transfer (λ = 1e-4) + drop-transfer (p = 0.4) alone is 97.61 (± 0.15). These results are competitive to EWC without dropout, whose performance is around 97.0. ImageNet to CUB Dataset. The third experiment is the ImageNet2CUB experiment [7], the continual learning problem from the ImageNet dataset to the Caltech-UCSD Birds-200-2011 finegrained classification (CUB) dataset [28]. The numbers of classes of ImageNet and CUB dataset are around 1K and 200, and the numbers of training instances are 1M and 5K, respectively. In the ImageNet2CUB experiment, the last-layer is separated for the ImageNet and the CUB task. The structure of AlexNet is used for the trained model of ImageNet [29]. In our experiment, we match the moments of the last-layer fine-tuning model and the LwF model, with mean-IMM and modeIMM. Figure 3 (Right) shows that mean-IMM moderately balances the performance of two tasks between two networks. However, the balanced hyperparameter of mode-IMM is far from α = 0.5. We think that it is because the scale of the Fisher matrix F is different between the ImageNet and the CUB task. Since the number of training data of the two tasks is different, the mean of the square of the gradient, which is the definition of F, tends to be different. This implies that the assumption of mode-IMM does not always hold for heterogeneous tasks. See Appendix D.3 for more information including the learning methods of IMM where a different class output layer or a different scale of the dataset is used. Our results of IMM with LwF exceed the previous state-of-the-art performance, whose model is also LwF. This is because, in the previous works, the LwF model is initialized by the last-layer finetuning model, not directly by the original AlexNet. In this case, the performance loss of the old task is not only decreased, but also the performance gain of the new task is decreased. The accuracies of our mean-IMM (α = 0.5) are 56.20 and 56.73 for the ImageNet task and the CUB task, respectively. The gains compared to the previous state-of-the-art are +1.13 and -1.14. In the case of mean-IMM (α = 0.8) and mode-IMM (α = 0.99), the accuracies are 55.08 and 59.08 (+0.01, +1.12), and 55.10 and 59.12 (+0.02, +1.35), respectively. Lifelog Dataset. Lastly, we evaluate the proposed methods on the Lifelog dataset [12]. The Lifelog dataset consists of 660,000 instances of egocentric video stream data, collected over 46 days from three participants using Google Glass [30]. Three class categories, location, sub-location, and activity, are labeled on each frame of video. In the Lifelog dataset, the class distribution changes continuously and new classes appear as the day passes. Table 2 shows that mean-IMM and mode-IMM are competitive to the dual-memory architecture, the previous state-of-the-art ensemble model, even though IMM uses single network. 6 Discussion A Shift of Optimal Hyperparameter of IMM. The tuned setting shows there often exists some α which makes the performance of the mean-IMM close to the mode-IMM. However, in the untuned hyperparameter setting, mean-IMM performs worse when more transfer techniques are applied. Our Bayesian interpretation in IMM assumes that the SGD training of the k-th network µk is mainly affected by the k-th task and is rarely affected by the information of the previous tasks. However, transfer techniques break this assumption; thus the optimal α is shifted to larger than 1/k. Fortunately, mode-IMM works more robustly than mean-IMM where transfer techniques are applied. 8 Figure 4 illustrates the change of the test accuracy curve corresponding to the applied transfer techniques and the following shift of the optimal α in mean-IMM and mode-IMM. Bayesian Approach on Continual Learning. Kirkpatrick et al. [8] interpreted that the Fisher matrix F as weight importance in explaining their EWC model. In the shuffled MNIST experiment, since a large number of pixels always have a value of zero, the corresponding elements of the Fisher matrix are also zero. Therefore, EWC does work by allowing weights to change, which are not used in the previous tasks. On the other hand, mode-IMM also works by selectively balancing between two weights using variance information. However, these assumptions on weight importance do not always hold, especially in the disjoint MNIST experiment. The most important weight in the disjoint MNIST experiment is the bias term in the output layer. Nevertheless, these bias parts of the Fisher matrix are not guaranteed to be the highest value nor can they be used to balance the class distribution between the first and second task. We believe that using only the diagonal of the covariance matrix in Bayesian neural networks is too naïve in general and that this is why EWC failed in the disjoint MNIST experiment. We think it could be alleviated in future work by using a more complex prior, such as a matrix Gaussian distribution considering the correlations between nodes in the network [31]. Balancing the Information of an Old and a New Task. The IMM procedure produces a neural network without a performance loss for kth task µk, which is better than the final solution µ1:k in terms of the performance of the kth task. Furthermore, IMM can easily weigh the importance of tasks in IMM models in real time. For example, αt can be easily changed for the solution of meanIMM µ1:k = Pk t αtµt . In actual service situations of IT companies, the importance of the old and the new task frequently changes in real time, and IMM can handle this problem. This property differentiates IMM from the other continual learning methods using the regularization approach, including LwF and EWC. 7 Conclusion Our contributions are four folds. First, we applied mean-IMM to the continual learning of modern deep neural networks. Mean-IMM makes competitive results to comparative models and balances the information between an old and a new network. We also interpreted the success of IMM by the Bayesian framework with Gaussian posterior. Second, we extended mean-IMM to mode-IMM with the interpretation of mode-finding in the mixture of Gaussian posterior. Mode-IMM outperforms mean-IMM and comparative models in various datasets. Third, we introduced drop-transfer, a novel method proposed in the paper. Experimental results showed that drop-transfer alone performs well and is similar to the EWC without dropout, in the domain where EWC rarely forgets. Fourth, We applied various transfer techniques in the IMM procedure to make our assumption of Gaussian distribution reasonable. We argued that not only the search space of the loss function among neural networks can easily be nearly convex, but also regularizers, such as dropout, make the search space smooth, and the point in the search space have good accuracy. Experimental results showed that applying transfer techniques often boost the performance of IMM. Overall, we made state-of-theart performance in various datasets of continual learning and explored geometrical properties and a Bayesian perspective of deep neural networks. Acknowledgments The authors would like to thank Jiseob Kim, Min-Oh Heo, Donghyun Kwak, Insu Jeon, Christina Baek, and Heidi Tessmer for helpful comments and editing. This work was supported by the Naver Corp. and partly by the Korean government (IITP-R0126-16-1072-SW.StarLab, IITP-2017-001772-VTT, KEIT-10044009-HRI.MESSI, KEIT-10060086-RISF). Byoung-Tak Zhang is the corresponding author. References [1] Michael McCloskey and Neal J Cohen. Catastrophic interference in connectionist networks: The sequential learning problem. Psychology of learning and motivation, 24:109–165, 1989. 9 [2] Robert M French. Catastrophic forgetting in connectionist networks. Trends in cognitive sciences, 3(4):128–135, 1999. [3] Ian J Goodfellow, Mehdi Mirza, Da Xiao, Aaron Courville, and Yoshua Bengio. An empirical investigation of catastrophic forgetting in gradient-based neural networks. arXiv preprint arXiv:1312.6211, 2013. [4] Rupesh K Srivastava, Jonathan Masci, Sohrob Kazerounian, Faustino Gomez, and Jürgen Schmidhuber. Compete to compute. In Advances in neural information processing systems, pages 2310–2318, 2013. [5] Zoubin Ghahramani. Online variational bayesian learning. In NIPS workshop on Online Learning, 2000. [6] Tamara Broderick, Nicholas Boyd, Andre Wibisono, Ashia C Wilson, and Michael I Jordan. Streaming variational bayes. In Advances in Neural Information Processing Systems, pages 1727–1735, 2013. [7] Zhizhong Li and Derek Hoiem. Learning without forgetting. In European Conference on Computer Vision, pages 614–629. Springer, 2016. [8] James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, et al. Overcoming catastrophic forgetting in neural networks. Proceedings of the National Academy of Sciences, 2017. [9] David JC MacKay. A practical bayesian framework for backpropagation networks. Neural computation, 4(3):448–472, 1992. [10] Charles Blundell, Julien Cornebise, Koray Kavukcuoglu, and Daan Wierstra. Weight uncertainty in neural network. In Proceedings of the 32nd International Conference on Machine Learning (ICML-15), pages 1613–1622, 2015. [11] Jacob Goldberger and Sam T Roweis. Hierarchical clustering of a mixture model. In Advances in Neural Information Processing Systems, pages 505–512, 2005. [12] Sang-Woo Lee, Chung-Yeon Lee, Dong Hyun Kwak, Jiwon Kim, Jeonghee Kim, and ByoungTak Zhang. Dual-memory deep learning architectures for lifelong learning of everyday human behaviors. In Twenty-Fifth International Joint Conference on Artificial Intelligencee, pages 1669–1675, 2016. [13] Andrei A Rusu, Neil C Rabinowitz, Guillaume Desjardins, Hubert Soyer, James Kirkpatrick, Koray Kavukcuoglu, Razvan Pascanu, and Raia Hadsell. Progressive neural networks. arXiv preprint arXiv:1606.04671, 2016. [14] Chrisantha Fernando, Dylan Banarse, Charles Blundell, Yori Zwols, David Ha, Andrei A Rusu, Alexander Pritzel, and Daan Wierstra. Pathnet: Evolution channels gradient descent in super neural networks. arXiv preprint arXiv:1701.08734, 2017. [15] Zhen Huang, Jinyu Li, Sabato Marco Siniscalchi, I-Fan Chen, Chao Weng, and Chin-Hui Lee. Feature space maximum a posteriori linear regression for adaptation of deep neural networks. In Fifteenth Annual Conference of the International Speech Communication Association, 2014. [16] Zhen Huang, Sabato Marco Siniscalchi, I-Fan Chen, Jinyu Li, Jiadong Wu, and Chin-Hui Lee. Maximum a posteriori adaptation of network parameters in deep models. In Sixteenth Annual Conference of the International Speech Communication Association, 2015. [17] Abdullah Rashwan, Han Zhao, and Pascal Poupart. Online and distributed bayesian moment matching for parameter learning in sum-product networks. In Proceedings of the 19th International Conference on Artificial Intelligence and Statistics, pages 1469–1477, 2016. [18] Kai Zhang and James T Kwok. Simplifying mixture models through function approximation. Neural Networks, IEEE Transactions on, 21(4):644–658, 2010. 10 [19] Manas Pathak, Shantanu Rane, and Bhiksha Raj. Multiparty differential privacy via aggregation of locally trained classifiers. In Advances in Neural Information Processing Systems, pages 1876–1884, 2010. [20] Pierre Baldi and Peter J Sadowski. Understanding dropout. In Advances in Neural Information Processing Systems, pages 2814–2822, 2013. [21] Surajit Ray and Bruce G Lindsay. The topography of multivariate normal mixtures. Annals of Statistics, pages 2042–2065, 2005. [22] Razvan Pascanu and Yoshua Bengio. Revisiting natural gradient for deep networks. arXiv preprint arXiv:1301.3584, 2013. [23] Ian J Goodfellow, Oriol Vinyals, and Andrew M Saxe. Qualitatively characterizing neural network optimization problems. arXiv preprint arXiv:1412.6544, 2014. [24] Jason Yosinski, Jeff Clune, Yoshua Bengio, and Hod Lipson. How transferable are features in deep neural networks? In Advances in neural information processing systems, pages 3320– 3328, 2014. [25] Theodoros Evgeniou and Massimiliano Pontil. Regularized multi–task learning. In Proceedings of the tenth ACM SIGKDD international conference on Knowledge discovery and data mining, pages 109–117. ACM, 2004. [26] Wolf Kienzle and Kumar Chellapilla. Personalized handwriting recognition via biased regularization. In Proceedings of the 23rd international conference on Machine learning, pages 457–464. ACM, 2006. [27] Nitish Srivastava, Geoffrey E Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. Journal of Machine Learning Research, 15(1):1929–1958, 2014. [28] Catherine Wah, Steve Branson, Peter Welinder, Pietro Perona, and Serge Belongie. The caltech-ucsd birds-200-2011 dataset. Tech. Rep. CNS-TR-2011-001, 2011. [29] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pages 1097–1105, 2012. [30] Sang-Woo Lee, Chung-Yeon Lee, Dong-Hyun Kwak, Jung-Woo Ha, Jeonghee Kim, and Byoung-Tak Zhang. Dual-memory neural networks for modeling cognitive activities of humans via wearable sensors. Neural Networks, 2017. [31] Christos Louizos and Max Welling. Structured and efficient variational deep learning with matrix gaussian posteriors. arXiv preprint arXiv:1603.04733, 2016. [32] Surajit Ray and Dan Ren. On the upper bound of the number of modes of a multivariate normal mixture. Journal of Multivariate Analysis, 108:41–52, 2012. [33] Carlos Améndola, Alexander Engström, and Christian Haase. Maximum number of modes of gaussian mixtures. arXiv preprint arXiv:1702.05066, 2017. [34] Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013. 11
2017
653
7,178
Can Decentralized Algorithms Outperform Centralized Algorithms? A Case Study for Decentralized Parallel Stochastic Gradient Descent Xiangru Lian†, Ce Zhang∗, Huan Zhang+, Cho-Jui Hsieh+, Wei Zhang#, and Ji Liu†♮ †University of Rochester, ∗ETH Zurich +University of California, Davis, #IBM T. J. Watson Research Center, ♮Tencent AI lab xiangru@yandex.com, ce.zhang@inf.ethz.ch, victzhang@gmail.com, chohsieh@ucdavis.edu, weiz@us.ibm.com, ji.liu.uwisc@gmail.com Abstract Most distributed machine learning systems nowadays, including TensorFlow and CNTK, are built in a centralized fashion. One bottleneck of centralized algorithms lies on high communication cost on the central node. Motivated by this, we ask, can decentralized algorithms be faster than its centralized counterpart? Although decentralized PSGD (D-PSGD) algorithms have been studied by the control community, existing analysis and theory do not show any advantage over centralized PSGD (C-PSGD) algorithms, simply assuming the application scenario where only the decentralized network is available. In this paper, we study a DPSGD algorithm and provide the first theoretical analysis that indicates a regime in which decentralized algorithms might outperform centralized algorithms for distributed stochastic gradient descent. This is because D-PSGD has comparable total computational complexities to C-PSGD but requires much less communication cost on the busiest node. We further conduct an empirical study to validate our theoretical analysis across multiple frameworks (CNTK and Torch), different network configurations, and computation platforms up to 112 GPUs. On network configurations with low bandwidth or high latency, D-PSGD can be up to one order of magnitude faster than its well-optimized centralized counterparts. 1 Introduction In the context of distributed machine learning, decentralized algorithms have long been treated as a compromise — when the underlying network topology does not allow centralized communication, one has to resort to decentralized communication, while, understandably, paying for the “cost of being decentralized”. In fact, most distributed machine learning systems nowadays, including TensorFlow and CNTK, are built in a centralized fashion. But can decentralized algorithms be faster than their centralized counterparts? In this paper, we provide the first theoretical analysis, verified by empirical experiments, for a positive answer to this question. We consider solving the following stochastic optimization problem min x∈RN f(x) := Eξ∼DF(x; ξ), (1) where D is a predefined distribution and ξ is a random variable usually referring to a data sample in machine learning. This formulation summarizes many popular machine learning models including deep learning [LeCun et al., 2015], linear regression, and logistic regression. Parallel stochastic gradient descent (PSGD) methods are leading algorithms in solving large-scale machine learning problems such as deep learning [Dean et al., 2012, Li et al., 2014], matrix completion 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. (a) Centralized Topology (b) Decentralized Topology Parameter Server Figure 1: An illustration of different network topologies. Algorithm communication complexity on the busiest node computational complexity C-PSGD (mini-batch SGD) O(n) O n ϵ + 1 ϵ2  D-PSGD O (Deg(network)) O n ϵ + 1 ϵ2  Table 1: Comparison of C-PSGD and D-PSGD. The unit of the communication cost is the number of stochastic gradients or optimization variables. n is the number of nodes. The computational complexity is the number of stochastic gradient evaluations we need to get a ϵ-approximation solution, which is defined in (3). [Recht et al., 2011, Zhuang et al., 2013] and SVM. Existing PSGD algorithms are mostly designed for centralized network topology, for example, the parameter server topology [Li et al., 2014], where there is a central node connected with multiple nodes as shown in Figure 1(a). The central node aggregates the stochastic gradients computed from all other nodes and updates the model parameter, for example, the weights of a neural network. The potential bottleneck of the centralized network topology lies on the communication traffic jam on the central node, because all nodes need to communicate with it concurrently iteratively. The performance will be significantly degraded when the network bandwidth is low.1 These motivate us to study algorithms for decentralized topologies, where all nodes can only communicate with its neighbors and there is no such a central node, shown in Figure 1(b). Although decentralized algorithms have been studied as consensus optimization in the control community and used for preserving data privacy [Ram et al., 2009a, Yan et al., 2013, Yuan et al., 2016], for the application scenario where only the decentralized network is available, it is still an open question if decentralized methods could have advantages over centralized algorithms in some scenarios in case both types of communication patterns are feasible — for example, on a supercomputer with thousands of nodes, should we use decentralized or centralized communication? Existing theory and analysis either do not make such comparison [Bianchi et al., 2013, Ram et al., 2009a, Srivastava and Nedic, 2011, Sundhar Ram et al., 2010] or implicitly indicate that decentralized algorithms were much worse than centralized algorithms in terms of computational complexity and total communication complexity [Aybat et al., 2015, Lan et al., 2017, Ram et al., 2010, Zhang and Kwok, 2014]. This paper gives a positive result for decentralized algorithms by studying a decentralized PSGD (D-PSGD) algorithm on the connected decentralized network. Our theory indicates that D-PSGD admits similar total computational complexity but requires much less communication for the busiest node. Table 1 shows a quick comparison between C-PSGD and D-PSGD with respect to the computation and communication complexity. Our contributions are: • We theoretically justify the potential advantage of decentralizedalgorithms over centralized algorithms. Instead of treating decentralized algorithms as a compromise one has to make, we are the first to conduct a theoretical analysis that identifies cases in which decentralized algorithms can be faster than its centralized counterpart. • We theoretically analyze the scalability behavior of decentralized SGD when more nodes are used. Surprisingly, we show that, when more nodes are available, decentralized algorithms can bring speedup, asymptotically linearly, with respect to computational complexity. To our best knowledge, this is the first speedup result related to decentralized algorithms. • We conduct extensive empirical study to validate our theoretical analysis of D-PSGD and different C-PSGD variants (e.g., plain SGD, EASGD [Zhang et al., 2015]). We observe similar computational 1There has been research in how to accommodate this problem by having multiple parameter servers communicating with efficient MPI ALLREDUCE primitives. As we will see in the experiments, these methods, on the other hand, might suffer when the network latency is high. 2 complexity as our theory indicates; on networks with low bandwidth or high latency, D-PSGD can be up to 10× faster than C-PSGD. Our result holds across multiple frameworks (CNTK and Torch), different network configurations, and computation platforms up to 112 GPUs. This indicates promising future direction in pushing the research horizon of machine learning systems from pure centralized topology to a more decentralized fashion. Definitions and notations Throughout this paper, we use following notation and definitions: • ∥· ∥denotes the vector ℓ2 norm or the matrix spectral norm depending on the argument. • ∥· ∥F denotes the matrix Frobenius norm. • ∇f(·) denotes the gradient of a function f. • 1n denotes the column vector in Rn with 1 for all elements. • f ∗denotes the optimal solution of (1). • λi(·) denotes the i-th largest eigenvalue of a matrix. 2 Related work In the following, we use K and n to refer to the number of iterations and the number of nodes. Stochastic Gradient Descent (SGD) SGD is a powerful approach for solving large scale machine learning. The well known convergence rate of stochastic gradient is O(1/ √ K) for convex problems and O(1/K) for strongly convex problems [Moulines and Bach, 2011, Nemirovski et al., 2009]. SGD is closely related to online learning algorithms, for example, Crammer et al. [2006], Shalev-Shwartz [2011], Yang et al. [2014]. For SGD on nonconvex optimization, an ergodic convergence rate of O(1/ √ K) is proved in Ghadimi and Lan [2013]. Centralized parallel SGD For CENTRALIZED PARALLEL SGD (C-PSGD) algorithms, the most popular implementation is based on the parameter server, which is essentially the mini-batch SGD admitting a convergence rate of O(1/ √ Kn) [Agarwal and Duchi, 2011, Dekel et al., 2012, Lian et al., 2015], where in each iteration n stochastic gradients are evaluated. In this implementation there is a parameter server communicating with all nodes. The linear speedup is implied by the convergence rate automatically. More implementation details for C-PSGD can be found in Chen et al. [2016], Dean et al. [2012], Li et al. [2014], Zinkevich et al. [2010]. The asynchronous version of centralized parallel SGD is proved to guarantee the linear speedup on all kinds of objectives (including convex, strongly convex, and nonconvex objectives) if the staleness of the stochastic gradient is bounded [Agarwal and Duchi, 2011, Feyzmahdavian et al., 2015, Lian et al., 2015, 2016, Recht et al., 2011, Zhang et al., 2016b,c]. Decentralized parallel stochastic algorithms Decentralized algorithms do not specify any central node unlike centralized algorithms, and each node maintains its own local model but can only communicate with with its neighbors. Decentralized algorithms can usually be applied to any connected computational network. Lan et al. [2017] proposed a decentralized stochastic algorithm with computational complexities O(n/ϵ2) for general convex objectives and O(n/ϵ) for strongly convex objectives. Sirb and Ye [2016] proposed an asynchronous decentralized stochastic algorithm ensuring complexity O(n/ϵ2) for convex objectives. A similar algorithm to our D-PSGD in both synchronous and asynchronous fashion was studied in Ram et al. [2009a, 2010], Srivastava and Nedic [2011], Sundhar Ram et al. [2010]. The difference is that in their algorithm all node can only perform either communication or computation but not simultaneously. Sundhar Ram et al. [2010] proposed a stochastic decentralized optimization algorithm for constrained convex optimization and the algorithm can be used for non-differentiable objectives by using subgradients. Please also refer to Srivastava and Nedic [2011] for the subgradient variant. The analysis in Ram et al. [2009a, 2010], Srivastava and Nedic [2011], Sundhar Ram et al. [2010] requires the gradients of each term of the objective to be bounded by a constant. Bianchi et al. [2013] proposed a similar decentralized stochastic algorithm and provided a convergence rate for the consensus of the local models when the local models are bounded. The convergence to a solution was also provided by using central limit theorem, but the rate is unclear. HogWild++ [Zhang et al., 2016a] uses decentralized model parameters for parallel asynchronous SGD on multi-socket systems and shows that this algorithm empirically outperforms some centralized algorithms. Yet the convergence or the convergence rate is unclear. The common issue for these work above lies on that the speedup is unclear, that is, we do not know if decentralized algorithms (involving multiple nodes) can improve the efficiency of only using a single node. 3 Other decentralized algorithms In other areas including control, privacy and wireless sensing network, decentralized algorithms are usually studied for solving the consensus problem [Aysal et al., 2009, Boyd et al., 2005, Carli et al., 2010, Fagnani and Zampieri, 2008, Olfati-Saber et al., 2007, Schenato and Gamba, 2007]. Lu et al. [2010] proves a gossip algorithm to converge to the optimal solution for convex optimization. Mokhtari and Ribeiro [2016] analyzed decentralized SAG and SAGA algorithms for minimizing finite sum strongly convex objectives, but they are not shown to admit any speedup. The decentralized gradient descent method for convex and strongly convex problems was analyzed in Yuan et al. [2016]. Nedic and Ozdaglar [2009], Ram et al. [2009b] studied its subgradient variants. However, this type of algorithms can only converge to a ball of the optimal solution, whose diameter depends on the steplength. This issue was fixed by Shi et al. [2015] using a modified algorithm, namely EXTRA, that can guarantee to converge to the optimal solution. Wu et al. [2016] analyzed an asynchronous version of decentralized gradient descent with some modification like in Shi et al. [2015] and showed that the algorithm converges to a solution when K →∞. Aybat et al. [2015], Shi et al., Zhang and Kwok [2014] analyzed decentralized ADMM algorithms and they are not shown to have speedup. From all of these reviewed papers, it is still unclear if decentralized algorithms can have any advantage over their centralized counterparts. 3 Decentralized parallel stochastic gradient descent (D-PSGD) Algorithm 1 Decentralized Parallel Stochastic Gradient Descent (D-PSGD) on the ith node Require: initial point x0,i = x0, step length γ, weight matrix W, and number of iterations K 1: for k = 0, 1, 2, . . . , K −1 do 2: Randomly sample ξk,i from local data of the i-th node 3: Compute the local stochastic gradient ∇Fi(xk,i; ξk,i) ∀i on all nodes a 4: Compute the neighborhood weighted average by fetching optimization variables from neighbors: xk+ 1 2 ,i = Pn j=1 Wijxk,j b 5: Update the local optimization variable xk+1,i ←xk+ 1 2 ,i −γ∇Fi(xk,i; ξk,i)c 6: end for 7: Output: 1 n Pn i=1 xK,i aNote that the stochastic gradient computed in can be replaced with a mini-batch of stochastic gradients, which will not hurt our theoretical results. bNote that the Line 3 and Line 4 can be run in parallel. cNote that the Line 4 and step Line 5 can be exchanged. That is, we first update the local stochastic gradient into the local optimization variable, and then average the local optimization variable with neighbors. This does not hurt our theoretical analysis. When Line 4 is logically before Line 5, then Line 3 and Line 4 can be run in parallel. That is to say, if the communication time used by Line 4 is smaller than the computation time used by Line 3, the communication time can be completely hidden (it is overlapped by the computation time). This section introduces the D-PSGD algorithm. We represent the decentralized communication topology with an undirected graph with weights: (V, W). V denotes the set of n computational nodes: V := {1, 2, · · · , n}. W ∈Rn×n is a symmetric doubly stochastic matrix, which means (i) Wij ∈[0, 1], ∀i, j, (ii) Wij = Wji for all i, j, and (ii) P j Wij = 1 for all i. We use Wij to encode how much node j can affect node i, while Wij = 0 means node i and j are disconnected. To design distributed algorithms on a decentralized network, we first distribute the data onto all nodes such that the original objective defined in (1) can be rewritten into min x∈RN f(x) = 1 n n X i=1 Eξ∼DiFi(x; ξ) | {z } =:fi(x) . (2) There are two simple ways to achieve (2), both of which can be captured by our theoretical analysis and they both imply Fi(·; ·) = F(·; ·), ∀i. Strategy-1 All distributions Di’s are the same as D, that is, all nodes can access a shared database; Strategy-2 n nodes partition all data in the database and appropriately define a distribution for sampling local data, for example, if D is the uniform distribution over all data, Di can be defined to be the uniform distribution over local data. The D-PSGD algorithm is a synchronous parallel algorithm. All nodes are usually synchronized by a clock. Each node maintains its own local variable and runs the protocol in Algorithm 1 concurrently, which includes three key steps at iterate k: 4 • Each node computes the stochastic gradient ∇Fi(xk,i; ξk,i)2 using the current local variable xk,i, where k is the iterate number and i is the node index; • When the synchronization barrier is met, each node exchanges local variables with its neighbors and average the local variables it receives with its own local variable; • Each node update its local variable using the average and the local stochastic gradient. To view the D-PSGD algorithm from a global view, at iterate k, we define the concatenation of all local variables, random samples, stochastic gradients by matrix Xk ∈RN×n, vector ξk ∈Rn, and ∂F(Xk, ξk), respectively: Xk := [ xk,1 · · · xk,n ] ∈RN×n, ξk := [ ξk,1 · · · ξk,n ]⊤∈Rn, ∂F(Xk, ξk) := [ ∇F1(xk,1; ξk,1) ∇F2(xk,2; ξk,2) · · · ∇Fn(xk,n; ξk,n) ] ∈RN×n. Then the k-th iterate of Algorithm 1 can be viewed as the following update Xk+1 ←XkW −γ∂F(Xk; ξk). We say the algorithm gives an ϵ-approximation solution if K−1 PK−1 k=0 E ∇f Xk1n n  2 ⩽ϵ. (3) 4 Convergence rate analysis This section provides the analysis for the convergence rate of the D-PSGD algorithm. Our analysis will show that the convergence rate of D-PSGD w.r.t. iterations is similar to the C-PSGD (or minibatch SGD) [Agarwal and Duchi, 2011, Dekel et al., 2012, Lian et al., 2015], but D-PSGD avoids the communication traffic jam on the parameter server. To show the convergence results, we first define ∂f(Xk) := [ ∇f1(xk,1) ∇f2(xk,2) · · · ∇fn(xk,n) ] ∈RN×n, where functions fi(·)’s are defined in (2). Assumption 1. Throughout this paper, we make the following commonly used assumptions: 1. Lipschitzian gradient: All function fi(·)’s are with L-Lipschitzian gradients. 2. Spectral gap: Given the symmetric doubly stochastic matrix W, we define ρ := (max{|λ2(W)|, |λn(W)|})2. We assume ρ < 1. 3. Bounded variance: Assume the variance of stochastic gradient Ei∼U([n])Eξ∼Di∥∇Fi(x; ξ) − ∇f(x)∥2 is bounded for any x with i uniformly sampled from {1, . . . , n} and ξ from the distribution Di. This implies there exist constants σ, ς such that Eξ∼Di∥∇Fi(x; ξ) −∇fi(x)∥2 ⩽σ2, ∀i, ∀x, Ei∼U([n])∥∇fi(x) −∇f(x)∥2 ⩽ς2, ∀x. Note that if all nodes can access the shared database, then ς = 0. 4. Start from 0: We assume X0 = 0. This assumption simplifies the proof w.l.o.g. Let D1 := 1 2 − 9γ2L2n (1 −√ρ)2D2  , D2 :=  1 − 18γ2 (1 −√ρ)2 nL2  . Under Assumption 1, we have the following convergence result for Algorithm 1. Theorem 1 (Convergence of Algorithm 1). Under Assumption 1, we have the following convergence rate for Algorithm 1: 1 K 1 −γL 2 K−1 X k=0 E ∂f(Xk)1n n 2 + D1 K−1 X k=0 E ∇f Xk1n n  2! ⩽f(0) −f ∗ γK + γL 2n σ2 + γ2L2nσ2 (1 −ρ)D2 + 9γ2L2nς2 (1 −√ρ)2D2 . 2It can be easily extended to mini-batch stochastic gradient descent. 5 Noting that Xk1n n = 1 n Pn i=1 xk,i, this theorem characterizes the convergence of the average of all local optimization variables xk,i. To take a closer look at this result, we appropriately choose the step length in Theorem 1 to obtain the following result: Corollary 2. Under the same assumptions as in Theorem 1, if we set γ = 1 2L+σ√ K/n 3, for Algorithm 1 we have the following convergence rate: PK−1 k=0 E ∇f Xk1n n  2 K ⩽8(f(0) −f ∗)L K + (8f(0) −8f ∗+ 4L)σ √ Kn . (4) if the total number of iterate K is sufficiently large, in particular, K ⩾ 4L4n5 σ6(f(0) −f ∗+ L)2  σ2 1 −ρ + 9ς2 (1 −√ρ)2 2 , and (5) K ⩾ 72L2n2 σ2 1 −√ρ 2 . (6) This result basically suggests that the convergence rate for D-PSGD is O  1 K + 1 √ nK  , if K is large enough. We highlight two key observations from this result: Linear speedup When K is large enough, the 1 K term will be dominated by the 1 √ Kn term which leads to a 1 √ nK convergence rate. It indicates that the total computational complexity4 to achieve an ϵ-approximation solution (3) is bounded by O 1 ϵ2  . Since the total number of nodes does not affect the total complexity, a single node only shares a computational complexity of O 1 nϵ2  . Thus linear speedup can be achieved by D-PSGD asymptotically w.r.t. computational complexity. D-PSGD can be better than C-PSGD Note that this rate is the same as C-PSGD (or mini-batch SGD with mini-batch size n) [Agarwal and Duchi, 2011, Dekel et al., 2012, Lian et al., 2015]. The advantage of D-PSGD over C-PSGD is to avoid the communication traffic jam. At each iteration, the maximal communication cost for every single node is O(the degree of the network) for D-PSGD, in contrast with O(n) for C-PSGD. The degree of the network could be much smaller than O(n), e.g., it could be O(1) in the special case of a ring. The key difference from most existing analysis for decentralized algorithms lies on that we do not use the boundedness assumption for domain or gradient or stochastic gradient. Those boundedness assumptions can significantly simplify the proof but lose some subtle structures in the problem. The linear speedup indicated by Corollary 2 requires the total number of iteration K is sufficiently large. The following special example gives a concrete bound of K for the ring network topology. Theorem 3. (Ring network) Choose the steplength γ in the same as Corollary 2 and consider the ring network topology with corresponding W in the form of W =            1/3 1/3 1/3 1/3 1/3 1/3 1/3 1/3 ... ... ... 1/3 1/3 1/3 1/3 1/3 1/3 1/3            ∈Rn×n. Under Assumption 1, Algorithm 1 achieves the same convergence rate in (4), which indicates a linear speedup can be achieved, if the number of involved nodes is bounded by • n = O(K1/9), if apply strategy-1 distributing data (ς = 0); • n = O(K1/13), if apply strategy-2 distributing data (ς > 0), 3 In Theorem 1 and Corollary 2, we choose the constant steplength for simplicity. Using the diminishing steplength O( p n/k) can achieve a similar convergence rate by following the proof procedure in this paper. For convex objectives, D-PSGD could be proven to admit the convergence rate O(1/ √ nK) which is consistent with the non-convex case. For strongly convex objectives, the convergence rate for D-PSGD could be improved to O(1/nK) which is consistent with the rate for C-PSGD. 4The complexity to compute a single stochastic gradient counts 1. 6 0 50 100 150 200 250 300 0 0.5 1 Seconds/Epoch 1/Bandwidth (1 / 1Mbps) 0 20 40 60 80 100 120 140 0 5 10 Seconds/Epoch Network Latency (ms) (c) Impact of Network Bandwidth (d) Impact of Network Latency Decentralized CNTK CNTK Decentralized Slower Network Slower Network Centralized Centralized 0 0.5 1 1.5 2 2.5 0 500 1000 Training Loss Time (Seconds) Decentralized Centralized CNTK 0 0.5 1 1.5 2 2.5 0 500 1000 Training Loss Time (Seconds) Decentralized CNTK Centralized (a) ResNet-20, 7GPU, 10Mbps (b) ResNet-20, 7GPU, 5ms Figure 2: Comparison between D-PSGD and two centralized implementations (7 and 10 GPUs). 0 0.5 1 1.5 2 2.5 3 0 200 400 600 Training Loss Epochs Decentralized (a) ResNet20, 112GPUs Centralized 0 2 4 6 8 0 2 4 6 8 Speedup # Workers (c) ResNet20, 7GPUs (d) DPSGD Comm. Pattern 0 0.5 1 1.5 2 2.5 3 0 50 100 150 Training Loss Epochs Decentralized Centralized (b) ResNet-56, 7GPU Figure 3: (a) Convergence Rate; (b) D-PSGD Speedup; (c) D-PSGD Communication Patterns. where the capital “O” swallows σ, ς, L, and f(0) −f ∗. This result considers a special decentralized network topology: ring network, where each node can only exchange information with its two neighbors. The linear speedup can be achieved up to K1/9 and K1/13 for different scenarios. These two upper bound can be improved potentially. This is the first work to show the speedup for decentralized algorithms, to the best of our knowledge. In this section, we mainly investigate the convergence rate for the average of all local variables {xk,i}n i=1. Actually one can also obtain a similar rate for each individual xk,i, since all nodes achieve the consensus quickly, in particular, the running average of E 1 n Pn i′=1 xk,i′ −xk,i 2 converges to 0 with a O(1/K) rate, where the “O” swallows n, ρ, σ, ς, L and f(0) −f ∗. See Theorem 6 for more details in Supplemental Material. 5 Experiments We validate our theory with experiments that compare D-PSGD with other centralized implementations. We run experiments on clusters up to 112 GPUs and show that, on some network configurations, D-PSGD can outperform well-optimized centralized implementations by an order of magnitude. 5.1 Experiment setting Datasets and models We evaluate D-PSGD on two machine learning tasks, namely (1) image classification, and (2) Natural Language Processing (NLP). For image classification we train ResNet [He et al., 2015] with different number of layers on CIFAR-10 [Krizhevsky, 2009]; for natural language processing, we train both proprietary and public dataset on a proprietary CNN model that we get from our industry partner [Feng et al., 2016, Lin et al., 2017, Zhang et al., 2017]. Implementations and setups We implement D-PSGD on two different frameworks, namely Microsoft CNTK and Torch. We evaluate four SGD implementations: 1. CNTK. We compare with the standard CNTK implementation of synchronous SGD. The implementation is based on MPI’s AllReduce primitive. 2. Centralized. We implemented the standard parameter server-based synchronous SGD using MPI. One node will serve as the parameter server in our implementation. 3. Decentralized. We implemented our D-PSGD algorithm using MPI within CNTK. 4. EASGD. We compare with the standard EASGD implementation of Torch. All three implementations are compiled with gcc 7.1, cuDNN 5.0, OpenMPI 2.1.1. We fork from CNTK after commit 57d7b9d and enable distributed minibatch reading for all of our experiments. During training, we keep the local batch size of each node the same as the reference configurations provided by CNTK. We tune learning rate for each SGD variant and report the best configuration. 7 Machines/Clusters We conduct experiments on three different machines/clusters: 1. 7GPUs. A single local machine with 8 GPUs, each of which is a Nvidia TITAN Xp. 2. 10GPUs. 10 p2.xlarge EC2 instances, each of which has one Nvidia K80 GPU. 3. 16GPUs. 16 local machines, each of which has two Xeon E5-2680 8-core processors and a NVIDIA K20 GPU. Machines are connected by Gigabit Ethernet in this case. 4. 112GPUs. 4 p2.16xlarge and 6 p2.8xlarge EC2 instances. Each p2.16xlarge (resp. p2.8xlarge) instance has 16 (resp. 8) Nvidia K80 GPUs. In all of our experiments, we use each GPU as a node. 5.2 Results on CNTK End-to-end performance We first validate that, under certain network configurations, D-PSGD converges faster, in wall-clock time, to a solution that has the same quality of centralized SGD. Figure 2(a, b) and Figure 3(a) shows the result of training ResNet20 on 7GPUs. We see that DPSGD converges faster than both centralized SGD competitors. This is because when the network is slow, both centralized SGD competitors take more time per epoch due to communication overheads. Figure 3(a, b) illustrates the convergence with respect to the number of epochs, and D-PSGD shows similar convergence rate as centralized SGD even with 112 nodes. Speedup The end-to-end speedup of D-PSGD over centralized SGD highly depends on the underlying network. We use the tc command to manually vary the network bandwidth and latency and compare the wall-clock time that all three SGD implementations need to finish one epoch. Figure 2(c, d) shows the result. We see that, when the network has high bandwidth and low latency, not surprisingly, all three SGD implementations have similar speed. This is because in this case, the communication is never the system bottleneck. However, when the bandwidth becomes smaller (Figure 2(c)) or the latency becomes higher (Figure 2(d)), both centralized SGD implementations slow down significantly. In some cases, D-PSGD can be even one order of magnitude faster than its centralized competitors. Compared with Centralized (implemented with a parameter server), DPSGD has more balanced communication patterns between nodes and thus outperforms Centralized in low-bandwidth networks; compared with CNTK (implemented with AllReduce), D-PSGD needs fewer number of communications between nodes and thus outperforms CNTK in high-latency networks. Figure 3(c) illustrates the communication between nodes for one run of D-PSGD. We also vary the number of GPUs that D-PSGD uses and report the speed up over a single GPU to reach the same loss. Figure 3(b) shows the result on a machine with 7GPUs. We see that, up to 4 GPUs, D-PSGD shows near linear speed up. When all seven GPUs are used, D-PSGD achieves up to 5× speed up. This subliner speed up for 7 GPUs is due to the synchronization cost but also that our machine only has 4 PCIe channels and thus more than two GPUs will share PCIe bandwidths. 5.3 Results on Torch Due to the space limitation, the results on Torch can be found in Supplement Material. 6 Conclusion This paper studies the D-PSGD algorithm on the decentralized computational network. We prove that D-PSGD achieves the same convergence rate (or equivalently computational complexity) as the C-PSGD algorithm, but outperforms C-PSGD by avoiding the communication traffic jam. To the best of our knowledge, this is the first work to show that decentralized algorithms admit the linear speedup and can outperform centralized algorithms. Limitation and Future Work The potential limitation of D-PSGD lies on the cost of synchronization. Breaking the synchronization barrier could make the decentralize algorithms even more efficient, but requires more complicated analysis. We will leave this direction for the future work. On the system side, one future direction is to deploy D-PSGD to larger clusters beyond 112 GPUs and one such environment is state-of-the-art supercomputers. In such environment, we envision D-PSGD to be one necessary building blocks for multiple “centralized groups” to communicate. It is also interesting to deploy D-PSGD to mobile environments. Acknowledgements Xiangru Lian and Ji Liu are supported in part by NSF CCF1718513. Ce Zhang gratefully acknowledge the support from the Swiss National Science Foundation NRP 75 407540_167266, IBM Zurich, Mercedes-Benz Research & Development North America, Oracle Labs, Swisscom, Chinese Scholarship Council, 8 the Department of Computer Science at ETH Zurich, the GPU donation from NVIDIA Corporation, and the cloud computation resources from Microsoft Azure for Research award program. Huan Zhang and Cho-Jui Hsieh acknowledge the support of NSF IIS-1719097 and the TACC computation resources. References A. Agarwal and J. C. Duchi. Distributed delayed stochastic optimization. NIPS, 2011. N. S. Aybat, Z. Wang, T. Lin, and S. Ma. Distributed linearized alternating direction method of multipliers for composite convex consensus optimization. arXiv preprint arXiv:1512.08122, 2015. T. C. Aysal, M. E. Yildiz, A. D. Sarwate, and A. Scaglione. Broadcast gossip algorithms for consensus. IEEE Transactions on Signal processing, 57(7):2748–2761, 2009. P. Bianchi, G. Fort, and W. Hachem. Performance of a distributed stochastic approximation algorithm. IEEE Transactions on Information Theory, 59(11):7405–7418, 2013. S. Boyd, A. Ghosh, B. Prabhakar, and D. Shah. Gossip algorithms: Design, analysis and applications. In INFOCOM 2005. 24th Annual Joint Conference of the IEEE Computer and Communications Societies. Proceedings IEEE, volume 3, pages 1653–1664. IEEE, 2005. R. Carli, F. Fagnani, P. Frasca, and S. Zampieri. Gossip consensus algorithms via quantized communication. Automatica, 46(1):70–80, 2010. J. Chen, R. Monga, S. Bengio, and R. Jozefowicz. Revisiting distributed synchronous sgd. arXiv preprint arXiv:1604.00981, 2016. K. Crammer, O. Dekel, J. Keshet, S. Shalev-Shwartz, and Y. Singer. Online passive-aggressive algorithms. Journal of Machine Learning Research, 7:551–585, 2006. J. Dean, G. Corrado, R. Monga, K. Chen, M. Devin, M. Mao, A. Senior, P. Tucker, K. Yang, Q. V. Le, et al. Large scale distributed deep networks. In Advances in neural information processing systems, pages 1223–1231, 2012. O. Dekel, R. Gilad-Bachrach, O. Shamir, and L. Xiao. Optimal distributed online prediction using mini-batches. Journal of Machine Learning Research, 13(Jan):165–202, 2012. F. Fagnani and S. Zampieri. Randomized consensus algorithms over large scale networks. IEEE Journal on Selected Areas in Communications, 26(4), 2008. M. Feng, B. Xiang, and B. Zhou. Distributed deep learning for question answering. In Proceedings of the 25th ACM International on Conference on Information and Knowledge Management, pages 2413–2416. ACM, 2016. H. R. Feyzmahdavian, A. Aytekin, and M. Johansson. An asynchronous mini-batch algorithm for regularized stochastic optimization. arXiv, 2015. S. Ghadimi and G. Lan. Stochastic first-and zeroth-order methods for nonconvex stochastic programming. SIAM Journal on Optimization, 23(4):2341–2368, 2013. K. He, X. Zhang, S. Ren, and J. Sun. Deep Residual Learning for Image Recognition. ArXiv e-prints, Dec. 2015. K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 770–778, 2016. A. Krizhevsky. Learning multiple layers of features from tiny images. In Technical Report, 2009. G. Lan, S. Lee, and Y. Zhou. Communication-efficient algorithms for decentralized and stochastic optimization. arXiv preprint arXiv:1701.03961, 2017. Y. LeCun, Y. Bengio, and G. Hinton. Deep learning. Nature, 521(7553):436–444, 2015. M. Li, D. G. Andersen, J. W. Park, A. J. Smola, A. Ahmed, V. Josifovski, J. Long, E. J. Shekita, and B.-Y. Su. Scaling distributed machine learning with the parameter server. In OSDI, volume 14, pages 583–598, 2014. 9 X. Lian, Y. Huang, Y. Li, and J. Liu. Asynchronous parallel stochastic gradient for nonconvex optimization. In Advances in Neural Information Processing Systems, pages 2737–2745, 2015. X. Lian, H. Zhang, C.-J. Hsieh, Y. Huang, and J. Liu. A comprehensive linear speedup analysis for asynchronous stochastic parallel optimization from zeroth-order to first-order. In Advances in Neural Information Processing Systems, pages 3054–3062, 2016. Z. Lin, M. Feng, C. N. d. Santos, M. Yu, B. Xiang, B. Zhou, and Y. Bengio. A structured self-attentive sentence embedding. 5th International Conference on Learning Representations, 2017. J. Lu, C. Y. Tang, P. R. Regier, and T. D. Bow. A gossip algorithm for convex consensus optimization over networks. In American Control Conference (ACC), 2010, pages 301–308. IEEE, 2010. A. Mokhtari and A. Ribeiro. Dsa: decentralized double stochastic averaging gradient algorithm. Journal of Machine Learning Research, 17(61):1–35, 2016. E. Moulines and F. R. Bach. Non-asymptotic analysis of stochastic approximation algorithms for machine learning. NIPS, 2011. A. Nedic and A. Ozdaglar. Distributed subgradient methods for multi-agent optimization. IEEE Transactions on Automatic Control, 54(1):48–61, 2009. A. Nemirovski, A. Juditsky, G. Lan, and A. Shapiro. Robust stochastic approximation approach to stochastic programming. SIAM Journal on Optimization, 19(4):1574–1609, 2009. Nvidia. Nccl: Optimized primitives for collective multi-gpu communication. https://github.com/NVIDIA/nccl. R. Olfati-Saber, J. A. Fax, and R. M. Murray. Consensus and cooperation in networked multi-agent systems. Proceedings of the IEEE, 95(1):215–233, 2007. S. S. Ram, A. Nedi´c, and V. V. Veeravalli. Asynchronous gossip algorithms for stochastic optimization. In Decision and Control, 2009 held jointly with the 2009 28th Chinese Control Conference. CDC/CCC 2009. Proceedings of the 48th IEEE Conference on, pages 3581–3586. IEEE, 2009a. S. S. Ram, A. Nedic, and V. V. Veeravalli. Distributed subgradient projection algorithm for convex optimization. In Acoustics, Speech and Signal Processing, 2009. ICASSP 2009. IEEE International Conference on, pages 3653–3656. IEEE, 2009b. S. S. Ram, A. Nedi´c, and V. V. Veeravalli. Asynchronous gossip algorithm for stochastic optimization: Constant stepsize analysis. In Recent Advances in Optimization and its Applications in Engineering, pages 51–60. Springer, 2010. B. Recht, C. Re, S. Wright, and F. Niu. Hogwild: A lock-free approach to parallelizing stochastic gradient descent. In Advances in Neural Information Processing Systems, pages 693–701, 2011. L. Schenato and G. Gamba. A distributed consensus protocol for clock synchronization in wireless sensor network. In Decision and Control, 2007 46th IEEE Conference on, pages 2289–2294. IEEE, 2007. S. Shalev-Shwartz. Online learning and online convex optimization. Foundations and Trends in Machine Learning, 4(2):107–194, 2011. W. Shi, Q. Ling, K. Yuan, G. Wu, and W. Yin. On the linear convergence of the admm in decentralized consensus optimization. W. Shi, Q. Ling, G. Wu, and W. Yin. Extra: An exact first-order algorithm for decentralized consensus optimization. SIAM Journal on Optimization, 25(2):944–966, 2015. B. Sirb and X. Ye. Consensus optimization with delayed and stochastic gradients on decentralized networks. In Big Data (Big Data), 2016 IEEE International Conference on, pages 76–85. IEEE, 2016. K. Srivastava and A. Nedic. Distributed asynchronous constrained stochastic optimization. IEEE Journal of Selected Topics in Signal Processing, 5(4):772–790, 2011. 10 S. Sundhar Ram, A. Nedi´c, and V. Veeravalli. Distributed stochastic subgradient projection algorithms for convex optimization. Journal of optimization theory and applications, 147(3):516–545, 2010. T. Wu, K. Yuan, Q. Ling, W. Yin, and A. H. Sayed. Decentralized consensus optimization with asynchrony and delays. arXiv preprint arXiv:1612.00150, 2016. F. Yan, S. Sundaram, S. Vishwanathan, and Y. Qi. Distributed autonomous online learning: Regrets and intrinsic privacy-preserving properties. IEEE Transactions on Knowledge and Data Engineering, 25(11):2483–2493, 2013. T. Yang, M. Mahdavi, R. Jin, and S. Zhu. Regret bounded by gradual variation for online convex optimization. Machine learning, 95(2):183–223, 2014. K. Yuan, Q. Ling, and W. Yin. On the convergence of decentralized gradient descent. SIAM Journal on Optimization, 26(3):1835–1854, 2016. H. Zhang, C.-J. Hsieh, and V. Akella. Hogwild++: A new mechanism for decentralized asynchronous stochastic gradient descent. ICDM, 2016a. R. Zhang and J. Kwok. Asynchronous distributed admm for consensus optimization. In International Conference on Machine Learning, pages 1701–1709, 2014. S. Zhang, A. E. Choromanska, and Y. LeCun. Deep learning with elastic averaging sgd. In Advances in Neural Information Processing Systems, pages 685–693, 2015. W. Zhang, S. Gupta, X. Lian, and J. Liu. Staleness-aware async-sgd for distributed deep learning. In Proceedings of the Twenty-Fifth International Joint Conference on Artificial Intelligence, IJCAI 2016, New York, NY, USA, 9-15 July 2016, 2016b. W. Zhang, S. Gupta, and F. Wang. Model accuracy and runtime tradeoff in distributed deep learning: A systematic study. In IEEE International Conference on Data Mining, 2016c. W. Zhang, M. Feng, Y. Zheng, Y. Ren, Y. Wang, J. Liu, P. Liu, B. Xiang, L. Zhang, B. Zhou, and F. Wang. Gadei: On scale-up training as a service for deep learning. In Proceedings of the 25th ACM International on Conference on Information and Knowledge Management. The IEEE International Conference on Data Mining series(ICDM’2017), 2017. Y. Zhuang, W.-S. Chin, Y.-C. Juan, and C.-J. Lin. A fast parallel sgd for matrix factorization in shared memory systems. In Proceedings of the 7th ACM conference on Recommender systems, pages 249–256. ACM, 2013. M. Zinkevich, M. Weimer, L. Li, and A. J. Smola. Parallelized stochastic gradient descent. In Advances in neural information processing systems, pages 2595–2603, 2010. 11
2017
654
7,179
Gradient Descent Can Take Exponential Time to Escape Saddle Points Simon S. Du Carnegie Mellon University ssdu@cs.cmu.edu Chi Jin University of California, Berkeley chijin@berkeley.edu Jason D. Lee University of Southern California jasonlee@marshall.usc.edu Michael I. Jordan University of California, Berkeley jordan@cs.berkeley.edu Barnabás Póczos Carnegie Mellon University bapoczos@cs.cmu.edu Aarti Singh Carnegie Mellon University aartisingh@cmu.edu Abstract Although gradient descent (GD) almost always escapes saddle points asymptotically [Lee et al., 2016], this paper shows that even with fairly natural random initialization schemes and non-pathological functions, GD can be significantly slowed down by saddle points, taking exponential time to escape. On the other hand, gradient descent with perturbations [Ge et al., 2015, Jin et al., 2017] is not slowed down by saddle points—it can find an approximate local minimizer in polynomial time. This result implies that GD is inherently slower than perturbed GD, and justifies the importance of adding perturbations for efficient non-convex optimization. While our focus is theoretical, we also present experiments that illustrate our theoretical findings. 1 Introduction Gradient Descent (GD) and its myriad variants provide the core optimization methodology in machine learning problems. Given a function f(x), the basic GD method can be written as: x(t+1) ←x(t) −η∇f  x(t) , (1) where η is a step size, assumed fixed in the current paper. While precise characterizations of the rate of convergence GD are available for convex problems, there is far less understanding of GD for non-convex problems. Indeed, for general non-convex problems, GD is only known to find a stationary point (i.e., a point where the gradient equals zero) in polynomial time [Nesterov, 2013]. A stationary point can be a local minimizer, saddle point, or local maximizer. In recent years, there has been an increasing focus on conditions under which it is possible to escape saddle points (more specifically, strict saddle points as in Definition 2.4) and converge to a local minimizer. Moreover, stronger statements can be made when the following two key properties hold: 1) all local minima are global minima, and 2) all saddle points are strict. These properties hold for a variety of machine learning problems, including tensor decomposition [Ge et al., 2015], dictionary learning [Sun et al., 2017], phase retrieval [Sun et al., 2016], matrix sensing [Bhojanapalli et al., 2016, Park et al., 2017], matrix completion [Ge et al., 2016, 2017], and matrix factorization [Li et al., 2016]. For these 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. problems, any algorithm that is capable of escaping strict saddle points will converge to a global minimizer from an arbitrary initialization point. Recent work has analyzed variations of GD that include stochastic perturbations. It has been shown that when perturbations are incorporated into GD at each step the resulting algorithm can escape strict saddle points in polynomial time [Ge et al., 2015]. It has also been shown that episodic perturbations suffice; in particular, Jin et al. [2017] analyzed an algorithm that occasionally adds a perturbation to GD (see Algorithm 1), and proved that not only does the algorithm escape saddle points in polynomial time, but additionally the number of iterations to escape saddle points is nearly dimensionindependent1. These papers in essence provide sufficient conditions under which a variant of GD has favorable convergence properties for non-convex functions. This leaves open the question as to whether such perturbations are in fact necessary. If not, we might prefer to avoid the perturbations if possible, as they involve additional hyper-parameters. The current understanding of gradient descent is silent on this issue. The major existing result is provided by Lee et al. [2016], who show that gradient descent, with any reasonable random initialization, will always escape strict saddle points eventually—but without any guarantee on the number of steps required. This motivates the following question: Does randomly initialized gradient descent generally escape saddle points in polynomial time? In this paper, perhaps surprisingly, we give a strong negative answer to this question. We show that even under a fairly natural initialization scheme (e.g., uniform initialization over a unit cube, or Gaussian initialization) and for non-pathological functions satisfying smoothness properties considered in previous work, GD can take exponentially long time to escape saddle points and reach local minima, while perturbed GD (Algorithm 1) only needs polynomial time. This result shows that GD is fundamentally slower in escaping saddle points than its perturbed variant, and justifies the necessity of adding perturbations for efficient non-convex optimization. The counter-example that supports this conclusion is a smooth function defined on Rd, where GD with random initialization will visit the vicinity of d saddle points before reaching a local minimum. While perturbed GD takes a constant amount of time to escape each saddle point, GD will get closer and closer to the saddle points it encounters later, and thus take an increasing amount of time to escape. Eventually, GD requires time that is exponential in the number of saddle points it needs to escape, thus eΩ(d) steps. 1.1 Related Work Over the past few years, there have been many problem-dependent convergence analyses of nonconvex optimization problems. One line of work shows that with smart initialization that is assumed to yield a coarse estimate lying inside a neighborhood of a local minimum, local search algorithms such as gradient descent or alternating minimization enjoy fast local convergence; see, e.g., [Netrapalli et al., 2013, Du et al., 2017, Hardt, 2014, Candes et al., 2015, Sun and Luo, 2016, Bhojanapalli et al., 2016, Yi et al., 2016, Zhang et al., 2017]. On the other hand, Jain et al. [2017] show that gradient descent can stay away from saddle points, and provide global convergence rates for matrix square-root problems, even without smart initialization. Although these results give relatively strong guarantees in terms of rate, their analyses are heavily tailored to specific problems and it is unclear how to generalize them to a wider class of non-convex functions. For general non-convex problems, the study of optimization algorithms converging to minimizers dates back to the study of Morse theory and continuous dynamical systems ([Palis and De Melo, 2012, Yin and Kushner, 2003]); a classical result states that gradient flow with random initialization always converges to a minimizer. For stochastic gradient, this was shown by Pemantle [1990], although without explicit running time guarantees. Lee et al. [2016] established that randomly initialized gradient descent with a fixed stepsize also converges to minimizers almost surely. However, these results are all asymptotic in nature and it is unclear how they might be extended to deliver explicit convergence rates. Moreover, it is unclear whether polynomial convergence rates can be obtained for these methods. Next, we review algorithms that can provably find approximate local minimizers in polynomial time. The classical cubic-regularization [Nesterov and Polyak, 2006] and trust region [Curtis et al., 2014] 1Assuming that the smoothness parameters (see Definition 2.1- 2.3) are all independent of dimension. 2 algorithms require access to the full Hessian matrix. A recent line of work [Carmon et al., 2016, Agarwal et al., 2017, Carmon and Duchi, 2016] shows that the requirement of full Hessian access can be relaxed to Hessian-vector products, which can be computed efficiently in many machine learning applications. For pure gradient-based algorithms without access to Hessian information, Ge et al. [2015] show that adding perturbation in each iteration suffices to escape saddle points in polynomial time. When smoothness parameters are all dimension independent, Levy [2016] analyzed a normalized form of gradient descent with perturbation, and improved the dimension dependence to O(d3). This dependence has been further improved in recent work [Jin et al., 2017] to polylog(d) via perturbed gradient descent (Algorithm 1). 1.2 Organization This paper is organized as follows. In Section 2, we introduce the formal problem setting and background. In Section 3, we discuss some pathological examples and “un-natural" initialization schemes under which the gradient descent fails to escape strict saddle points in polynomial time. In Section 4, we show that even under a fairly natural initialization scheme, gradient descent still needs exponential time to escape all saddle points whereas perturbed gradient descent is able to do so in polynomial time. We provide empirical illustrations in Section 5 and conclude in Section 6. We place most of our detailed proofs in the Appendix. 2 Preliminaries Let ·2 denote the Euclidean norm of a finite-dimensional vector in Rd. For a symmetric matrix A, let Aop denote its operator norm and λmin (A) its smallest eigenvalue. For a function f : Rd →R, let f (·) and 2f (·) denote its gradient vector and Hessian matrix. Let Bx (r) denote the ddimensional 2 ball centered at x with radius r, [−1, 1]d denote the d-dimensional cube centered at 0 with side-length 2, and B∞(x, R) = x + [−R, R]d denote the d-dimensional cube centered at x with side-length 2R. We also use O(·), and Ω(·) as standard Big-O and Big-Omega notation, only hiding absolute constants. Throughout the paper we consider functions that satisfy the following smoothness assumptions. Definition 2.1. A function f(·) is B-bounded if for any x ∈Rd: |f (x) | ≤B. Definition 2.2. A differentiable function f(·) is -gradient Lipschitz if for any x, y ∈Rd: f (x) −f (y)2 ≤ x −y2 . Definition 2.3. A twice-differentiable function f(·) is ρ-Hessian Lipschitz if for any x, y ∈Rd: 2f (x) −2f (y)  op ≤ρ x −y2 . Intuitively, definition 2.1 says function value is both upper and lower bounded; definition 2.2 and 2.3 state the gradients and Hessians of function can not change dramatically if two points are close by. Definition 2.2 is a standard asssumption in the optimization literature, and definition 2.3 is also commonly assumed when studying saddle points and local minima. Our goal is to escape saddle points. The saddle points discussed in this paper are assumed to be “strict” [Ge et al., 2015]: Definition 2.4. A saddle point x∗is called an α-strict saddle point if there exists some α > 0 such that f (x∗)2 = 0 and λmin  2f (x∗)  ≤−α. That is, a strict saddle point must have an escaping direction so that the eigenvalue of the Hessian along that direction is strictly negative. It turns out that for many non-convex problems studied in machine learning, all saddle points are strict (see Section 1 for more details). To escape strict saddle points and converge to local minima, we can equivalently study the approximation of second-order stationary points. For ρ-Hessian Lipschitz functions, such points are defined as follows by Nesterov and Polyak [2006]: 3 Algorithm 1 Perturbed Gradient Descent [Jin et al., 2017] 1: Input: x(0), step size η, perturbation radius r, time interval tthres, gradient threshold gthres. 2: tnoise ←−tthres −1. 3: for t = 1, 2, · · · do 4: if f (xt)2 ≤gthres and t −tnoise > tthres then 5: x(t) ←x(t) + ξt, ξt ∼unif (B0 (r)), tnoise ←t, 6: end if 7: x(t+1) ←x(t) −ηf  x(t) . 8: end for Definition 2.5. A point x is a called a second-order stationary point if f (x)2 = 0 and λmin  2f (x)  ≥0. We also define its -version, that is, an -second-order stationary point for some  > 0, if point x satisfies f (x)2 ≤ and λmin  2f (x)  ≥−√ρ. Second-order stationary points must have a positive semi-definite Hessian in additional to a vanishing gradient. Note if all saddle points x∗are strict, then second-order stationary points are exactly equivalent to local minima. In this paper, we compare gradient descent and one of its variants—the perturbed gradient descent algorithm (Algorithm 1) proposed by Jin et al. [2017]. We focus on the case where the step size satisfies η < 1/, which is commonly required for finding a minimum even in the convex setting [Nesterov, 2013]. The following theorem shows that if GD with random initialization converges, then it will converge to a second-order stationary point almost surely. Theorem 2.6 ([Lee et al., 2016] ). Suppose that f is -gradient Lipschitz, has continuous Hessian, and step size η < 1  . Furthermore, assume that gradient descent converges, meaning limt→∞x(t) exists, and the initialization distribution ν is absolutely continuous with respect to Lebesgue measure. Then limt→∞x(t) = x∗with probability one, where x∗is a second-order stationary point. The assumption that gradient descent converges holds for many non-convex functions (including all the examples considered in this paper). This assumption is used to avoid the case when x(t) 2 goes to infinity, so limt→∞x(t) is undefined. Note the Theorem 2.6 only provides limiting behavior without specifying the convergence rate. On the other hand, if we are willing to add perturbations, the following theorem not only establishes convergence but also provides a sharp convergence rate: Theorem 2.7 ([Jin et al., 2017]). Suppose f is B-bounded, -gradient Lipschitz, ρ-Hessian Lipschitz. For any δ > 0,  ≤2 ρ , there exists a proper choice of η, r, tthres, gthres (depending on B, , ρ, δ, ) such that Algorithm 1 will find an -second-order stationary point, with at least probability 1 −δ, in the following number of iterations: O B 2 log4 dB 2δ  . This theorem states that with proper choice of hyperparameters, perturbed gradient descent can consistently escape strict saddle points and converge to second-order stationary point in a polynomial number of iterations. 3 Warmup: Examples with “Un-natural" Initialization The convergence result of Theorem 2.6 raises the following question: can gradient descent find a second-order stationary point in a polynomial number of iterations? In this section, we discuss two very simple and intuitive counter-examples for which gradient descent with random initialization requires an exponential number of steps to escape strict saddle points. We will also explain that, however, these examples are unnatural and pathological in certain ways, thus unlikely to arise in practice. A more sophisticated counter-example with natural initialization and non-pathological behavior will be given in Section 4. 4 (a) Negative Gradient Field of f(x) = x2 1 −x2 2. (b) Negative Gradient Field for function defined in Equation (2). Figure 1: If the initialization point is in red rectangle then it takes GD a long time to escape the neighborhood of saddle point (0, 0). Initialize uniformly within an extremely thin band. Consider a two-dimensional function f with a strict saddle point at (0, 0). Suppose that inside the neighborhood U = [−1, 1]2 of the saddle point, function is locally quadratic f(x1, x2) = x2 1 −x2 2, For GD with η = 1 4, the update equation can be written as x(t+1) 1 = x(t) 1 2 and x(t+1) 2 = 3x(t) 2 2 . If we initialize uniformly within [−1, 1] × [−( 3 2)−exp( 1  ), ( 3 2)−exp( 1  )] then GD requires at least exp( 1  ) steps to get out of neighborhood U, and thereby escape the saddle point. See Figure 1a for illustration. Note that in this case the initialization region is exponentially thin (only of width 2 · ( 3 2)−exp( 1  )). We would seldom use such an initialization scheme in practice. Initialize far away. Consider again a two-dimensional function with a strict saddle point at (0, 0). This time, instead of initializing in a extremely thin band, we construct a very long slope so that a relatively large initialization region necessarily converges to this extremely thin band. Specifically, consider a function in the domain [−∞, 1] × [−1, 1] that is defined as follows: f(x1, x2) =    x2 1 −x2 2 if −1 < x1 < 1 −4x1 + x2 2 if x1 < −2 h(x1, x2) otherwise, (2) where h(x1, x2) is a smooth function connecting region [−∞, −2] × [−1, 1] and [−1, 1] × [−1, 1] while making f have continuous second derivatives and ensuring x2 does not suddenly increase when x1 ∈[−2, −1].2 For GD with η = 1 4, when −1 < x1 < 1, the dynamics are x(t+1) 1 = x(t) 1 2 and x(t+1) 2 = 3x(t) 2 2 , and when x1 < −2 the dynamics are x(t+1) 1 = x(t) 1 + 1 and x(t+1) 2 = x(t) 2 2 . Suppose we initialize uniformly within [−R−1, −R+1]×[−1, 1] , for R large. See Figure 1b for an illustration. Letting t denote the first time that x(t) 1 ≥−1, then approximately we have t ≈R and so x(t) 2 ≈x(0) 2 ·( 1 2)R. From the previous example, we know that if ( 1 2)R ≈( 3 2)−exp 1  , that is R ≈exp 1  , then GD will need exponential time to escape from the neighborhood U = [−1, 1] × [−1, 1] of the saddle point (0, 0). In this case, we require an initialization region leading to a saddle point at distance R which is exponentially large. In practice, it is unlikely that we would initialize exponentially far away from the saddle points or optima. 2We can construct such a function using splines. See Appendix B. 5 4 Main Result In the previous section we have shown that gradient descent takes exponential time to escape saddle points under “un-natural" initialization schemes. Is it possible for the same statement to hold even under “natural” initialization schemes and non-pathological functions? The following theorem confirms this: Theorem 4.1 (Uniform initialization over a unit cube). Suppose the initialization point is uniformly sampled from [−1, 1]d. There exists a function f defined on Rd that is B-bounded, -gradient Lipschitz and ρ-Hessian Lipschitz with parameters B, , ρ at most poly(d) such that: 1. with probability one, gradient descent with step size η ≤1/ will be Ω(1) distance away from any local minima for any T ≤eΩ(d). 2. for any  > 0, with probability 1 −e−d, perturbed gradient descent (Algorithm 1) will find a point x such that x −x∗2 ≤ for some local minimum x∗in poly(d, 1  ) iterations. Remark: As will be apparent in the next section, in the example we constructed, there are 2d symmetric local minima at locations (±c . . . , ±c), where c is some constant. The saddle points are of the form (±c, . . . , ±c, 0, . . . , 0). Both algorithms will travel across d neighborhoods of saddle points before reaching a local minimum. For GD, the number of iterations to escape the i-th saddle point increases as κi (κ is a multiplicative factor larger than 1), and thus GD requires exponential time to escape d saddle points. On the other hand, PGD takes about the same number of iterations to escape each saddle point, and so escapes the d saddle points in polynomial time. Notice that B, , ρ = O(poly(d)), so this does not contradict Theorem 2.7. We also note that in our construction, the local minimizers are outside the initialization region. We note this is common especially for unconstrained optimization problems, where the initialization is usually uniform on a rectangle or isotropic Gaussian. Due to isoperimetry, the initialization concentrates in a thin shell, but frequently the final point obtained by the optimization algorithm is not in this shell. It turns out in our construction, the only second-order stationary points in the path are the final local minima. Therefore, we can also strengthen Theorem 4.1 to provide a negative result for approximating -second-order stationary points as well. Corollary 4.2. Under the same initialization as in Theorem 4.1, there exists a function f satisfying the requirements of Theorem 4.1 such that for some  = 1/poly(d), with probability one, gradient descent with step size η ≤1/ will not visit any -second-order stationary point in T ≤eΩ(d). The corresponding positive result that PGD to find -second-order stationary point in polynomial time immediately follows from Theorem 2.7. The next result shows that gradient descent does not fail due to the special choice of initializing uniformly in [−1, 1]d. For a large class of initialization distributions ν, we can generalize Theorem 4.1 to show that gradient descent with random initialization ν requires exponential time, and perturbed gradient only requires polynomial time. Corollary 4.3. Let B∞(z, R) = {z} + [−R, R]d be the ∞ball of radius R centered at z. Then for any initialization distribution ν that satisfies ν(B∞(z, R)) ≥1 −δ for any δ > 0, the conclusion of Theorem 4.1 holds with probability at least 1 −δ. That is, as long as most of the mass of the initialization distribution ν lies in some ∞ball, a similar conclusion to that of Theorem 4.1 holds with high probability. This result applies to random Gaussian initialization, ν = N(0, σ2I), with mean 0 and covariance σ2I, where ν(B∞(0, σ log d)) ≥ 1 −1/poly(d). 4.1 Proof Sketch In this section we present a sketch of the proof of Theorem 4.1. The full proof is presented in the Appendix. Since the polynomial-time guarantee for PGD is straightforward to derive from Jin et al. [2017], we focus on showing that GD needs an exponential number of steps. We rely on the following key observation. 6 Key observation: escaping two saddle points sequentially. Consider, for L > γ > 0, f (x1, x2) =    −γx2 1 + Lx2 2 if x1 ∈[0, 1] , x2 ∈[0, 1] L(x1 −2)2 −γx2 2 if x1 ∈[1, 3] , x2 ∈[0, 1] L(x1 −2)2 + L(x2 −2)2 if x1 ∈[1, 3] , x2 ∈[1, 3] . (3) Note that this function is not continuous. In the next paragraph we will modify it to make it smooth and satisfy the assumptions of the Theorem but useful intuition is obtained using this discontinuous function. The function has an optimum at (2, 2) and saddle points at (0, 0) and (2, 0). We call [0, 1] × [0, 1] the neighborhood of (0, 0) and [1, 3] × [0, 1] the neighborhood of (2, 0). Suppose the initialization  x(0), y(0) lies in [0, 1] × [0, 1]. Define t1 = minx(t) 1 ≥1 t to be the time of first departure from the neighborhood of (0, 0) (thereby escaping the first saddle point). By the dynamics of gradient descent, we have x(t1) 1 = (1 + 2ηγ)t1x(0) 1 , x(t1) 2 = (1 −2ηL)t1x(0) 2 . Next we calculate the number of iterations such that x2 ≥1 and the algorithm thus leaves the neighborhood of the saddle point (2, 0) (thus escaping the second saddle point). Letting t2 = minx(t) 2 ≥1 t, we have: x(t1) 2 (1 + 2ηγ)t2−t1 = (1 + 2ηγ)t2−t1(1 −2ηL)t1x(0) 2 ≥1. We can lower bound t2 by t2 ≥ 2η(L + γ)t1 + log( 1 x0 2 ) 2ηγ ≥L + γ γ t1. The key observation is that the number of steps to escape the second saddle point is L+γ γ times the number of steps to escape the first one. Spline: connecting quadratic regions. To make our function smooth, we create buffer regions and use splines to interpolate the discontinuous parts of Equation (3). Formally, we consider the following function, for some fixed constant τ > 1: f (x1, x2) =              −γx2 1 + Lx2 2 if x1 ∈[0, τ] , x2 ∈[0, τ] g(x1, x2) if x1 ∈[τ, 2τ] , x2 ∈[0, τ] L(x1 −4τ)2 −γx2 2 −ν if x1 ∈[2τ, 6τ] , x2 ∈[0, τ] L(x1 −4τ)2 + g1(x2) −ν if x1 ∈[2τ, 6τ] , x2 ∈[τ, 2τ] L(x1 −4τ)2 + L(x2 −4τ)2 −2ν if x1 ∈[2τ, 6τ] , x2 ∈[2τ, 6τ] , (4) where g, g1 are spline polynomials and ν > 0 is a constant defined in Lemma B.2. In this case, there are saddle points at (0, 0), and (4τ, 0) and the optimum is at (4τ, 4τ). Intuitively, [τ, 2τ] × [0, τ] and [2τ, 6τ] × [τ, 2τ] are buffer regions where we use splines (g and g1) to transition between regimes and make f a smooth function. Also in this region there is no stationary point and the smoothness assumptions are still satisfied in the theorem. Figure. 2a shows the surface and stationary points of this function. We call the union of the regions defined in Equation (4) a tube. From two saddle points to d saddle points. We can readily adapt our construction of the tube to d dimensions, such that the function is smooth, the location of saddle points are (0, . . . , 0), (4τ, 0, . . . , 0), . . ., (4τ, . . . , 4τ, 0), and optimum is at (4τ, . . . , 4τ). Let ti be the number of step to escape the neighborhood of the i-th saddle point. We generalize our key observation to this case and obtain ti+1 ≥L+γ γ · ti for all i. This gives td ≥( L+γ γ )d which is exponential time. Figure 2b shows the tube and trajectory of GD. Mirroring trick: from tube to octopus. In the construction thus far, the saddle points are all on the boundary of tube. To avoid the difficulties of constrained non-convex optimization, we would like to make all saddle points be interior points of the domain. We use a simple mirroring trick; i.e., for every coordinate xi we reflect f along its axis. See Figure 2c for an illustration in the case d = 2. 7 0 5 10 15 x1 0 5 10 15 x2 -5 0 5 -120 -110 -110 -110 -100 -100 -100 -100 -90 -90 -90 -90 -80 -80 -70 -70 -60 -60 -50 -50 (a) Contour plot of the objective function and tube defined in 2D. (b) Trajectory of gradient descent in the tube for d = 3. (c) Octopus defined in 2D. Figure 2: Graphical illustrations of our counter-example with τ = e. The blue points are saddle points and the red point is the minimum. The pink line is the trajectory of gradient descent. 0 500 1000 Epochs -400 -300 -200 -100 0 100 Objective Function GD PGD (a) L = 1, γ = 1 0 500 1000 Epochs -600 -400 -200 0 200 Objective Function GD PGD (b) L = 1.5, γ = 1 0 500 1000 Epochs -600 -400 -200 0 200 Objective Function GD PGD (c) L = 2, γ = 1 0 500 1000 Epochs -800 -600 -400 -200 0 200 Objective Function GD PGD (d) L = 3, γ = 1 Figure 3: Performance of GD and PGD on our counter-example with d = 5. 0 1000 2000 Epochs -800 -600 -400 -200 0 200 Objective Function GD PGD (a) L = 1, γ = 1 0 1000 2000 Epochs -1000 -500 0 500 Objective Function GD PGD (b) L = 1.5, γ = 1 0 1000 2000 Epochs -1500 -1000 -500 0 500 Objective Function GD PGD (c) L = 2, γ = 1 0 1000 2000 Epochs -1500 -1000 -500 0 500 Objective Function GD PGD (d) L = 3, γ = 1 Figure 4: Performance of GD and PGD on our counter-example with d = 10 Extension: from octopus to Rd. Up to now we have constructed a function defined on a closed subset of Rd. The last step is to extend this function to the entire Euclidean space. Here we apply the classical Whitney Extension Theorem (Theorem B.3) to finish our construction. We remark that the Whitney extension may lead to more stationary points. However, we will demonstrate in the proof that GD and PGD stay within the interior of “octopus” defined above, and hence cannot converge to any other stationary point. 5 Experiments In this section we use simulations to verify our theoretical findings. The objective function is defined in (14) and (15) in the Appendix. In Figures 3 and Figure 4, GD stands for gradient descent and PGD stands for Algorithm 1. For both GD and PGD we let the stepsize η = 1 4L. For PGD, we choose tthres = 1, gthres = γe 100 and r = e 100. In Figure 3 we fix dimension d = 5 and vary L as considered in Section 4.1; similarly in Figure 4 we choose d = 10 and vary L. First notice that in all experiments, PGD converges faster than GD as suggested by our theorems. Second, observe the “horizontal" segment in each plot represents the number of iterations to escape a saddle point. For GD the length of the segment grows at a fixed rate, which coincides with the result mentioned at the beginning for Section 4.1 (that the number of iterations to escape a saddle point increase at each time with a multiplicative factor L+γ γ ). This phenomenon is also verified in the figures by the fact that as the ratio L+γ γ becomes larger, the rate of growth of the number of iterations to escape increases. On the other hand, the number of iterations for PGD to escape is approximately constant (∼ 1 ηγ ). 8 6 Conclusion In this paper we established the failure of gradient descent to efficiently escape saddle points for general non-convex smooth functions. We showed that even under a very natural initialization scheme, gradient descent can require exponential time to converge to a local minimum whereas perturbed gradient descent converges in polynomial time. Our results demonstrate the necessity of adding perturbations for efficient non-convex optimization. We expect that our results and constructions will naturally extend to a stochastic setting. In particular, we expect that with random initialization, general stochastic gradient descent will need exponential time to escape saddle points in the worst case. However, if we add perturbations per iteration or the inherent randomness is non-degenerate in every direction (so the covariance of noise is lower bounded), then polynomial time is known to suffice [Ge et al., 2015]. One open problem is whether GD is inherently slow if the local optimum is inside the initialization region in contrast to the assumptions of initialization we used in Theorem 4.1 and Corollary 4.3. We believe that a similar construction in which GD goes through the neighborhoods of d saddle points will likely still apply, but more work is needed. Another interesting direction is to use our counterexample as a building block to prove a computational lower bound under an oracle model [Nesterov, 2013, Woodworth and Srebro, 2016]. This paper does not rule out the possibility for gradient descent to perform well for some non-convex functions with special structures. Indeed, for the matrix square-root problem, Jain et al. [2017] show that with reasonable random initialization, gradient updates will stay away from all saddle points, and thus converge to a local minimum efficiently. It is an interesting future direction to identify other classes of non-convex functions that gradient descent can optimize efficiently and not suffer from the negative results described in this paper. 7 Acknowledgements S.S.D. and B.P. were supported by NSF grant IIS1563887 and ARPA-E Terra program. C.J. and M.I.J. were supported by the Mathematical Data Science program of the Office of Naval Research under grant number N00014-15-1-2670. J.D.L. was supported by ARO W911NF-17-1-0304. A.S. was supported by DARPA grant D17AP00001, AFRL grant FA8750-17-2-0212 and a CMU ProSEED/BrainHub Seed Grant. The authors thank Rong Ge, Qing Qu, John Wright, Elad Hazan, Sham Kakade, Benjamin Recht, Nathan Srebro, and Lin Xiao for useful discussions. The authors thank Stephen Wright and Michael O’Neill for pointing out calculation errors in the older version. References Naman Agarwal, Zeyuan Allen-Zhu, Brian Bullins, Elad Hazan, and Tengyu Ma. Finding Approximate Local Minima Faster Than Gradient Descent. In STOC, 2017. Full version available at http://arxiv.org/abs/1611.01146. Srinadh Bhojanapalli, Behnam Neyshabur, and Nati Srebro. Global optimality of local search for low rank matrix recovery. In Advances in Neural Information Processing Systems, pages 3873–3881, 2016. Emmanuel J Candes, Xiaodong Li, and Mahdi Soltanolkotabi. Phase retrieval via Wirtinger flow: Theory and algorithms. IEEE Transactions on Information Theory, 61(4):1985–2007, 2015. Yair Carmon and John C Duchi. Gradient descent efficiently finds the cubic-regularized non-convex Newton step. arXiv preprint arXiv:1612.00547, 2016. Yair Carmon, John C Duchi, Oliver Hinder, and Aaron Sidford. Accelerated methods for non-convex optimization. arXiv preprint arXiv:1611.00756, 2016. Alan Chang. The Whitney extension theorem in high dimensions. arXiv preprint arXiv:1508.01779, 2015. 9 Frank E Curtis, Daniel P Robinson, and Mohammadreza Samadi. A trust region algorithm with a worst-case iteration complexity of O(−3/2) for nonconvex optimization. Mathematical Programming, pages 1–32, 2014. Randall L Dougherty, Alan S Edelman, and James M Hyman. Nonnegativity-, monotonicity-, or convexity-preserving cubic and quintic Hermite interpolation. Mathematics of Computation, 52 (186):471–494, 1989. Simon S Du, Jason D Lee, and Yuandong Tian. When is a convolutional filter easy to learn? arXiv preprint arXiv:1709.06129, 2017. Rong Ge, Furong Huang, Chi Jin, and Yang Yuan. Escaping from saddle points—online stochastic gradient for tensor decomposition. In Proceedings of The 28th Conference on Learning Theory, pages 797–842, 2015. Rong Ge, Jason D Lee, and Tengyu Ma. Matrix completion has no spurious local minimum. In Advances in Neural Information Processing Systems, pages 2973–2981, 2016. Rong Ge, Chi Jin, and Yi Zheng. No spurious local minima in nonconvex low rank problems: A unified geometric analysis. In Proceedings of the 34th International Conference on Machine Learning, pages 1233–1242, 2017. Moritz Hardt. Understanding alternating minimization for matrix completion. In Foundations of Computer Science (FOCS), 2014 IEEE 55th Annual Symposium on, pages 651–660. IEEE, 2014. Prateek Jain, Chi Jin, Sham Kakade, and Praneeth Netrapalli. Global convergence of non-convex gradient descent for computing matrix squareroot. In Artificial Intelligence and Statistics, pages 479–488, 2017. Chi Jin, Rong Ge, Praneeth Netrapalli, Sham M. Kakade, and Michael I. Jordan. How to escape saddle points efficiently. In Proceedings of the 34th International Conference on Machine Learning, pages 1724–1732, 2017. Jason D Lee, Max Simchowitz, Michael I Jordan, and Benjamin Recht. Gradient descent only converges to minimizers. In Conference on Learning Theory, pages 1246–1257, 2016. Kfir Y Levy. The power of normalization: Faster evasion of saddle points. arXiv preprint arXiv:1611.04831, 2016. Xingguo Li, Zhaoran Wang, Junwei Lu, Raman Arora, Jarvis Haupt, Han Liu, and Tuo Zhao. Symmetry, saddle points, and global geometry of nonconvex matrix factorization. arXiv preprint arXiv:1612.09296, 2016. Yurii Nesterov. Introductory Lectures on Convex Optimization: A Basic Course, volume 87. Springer Science & Business Media, 2013. Yurii Nesterov and Boris T Polyak. Cubic regularization of newton method and its global performance. Mathematical Programming, 108(1):177–205, 2006. Praneeth Netrapalli, Prateek Jain, and Sujay Sanghavi. Phase retrieval using alternating minimization. In Advances in Neural Information Processing Systems, pages 2796–2804, 2013. J Jr Palis and Welington De Melo. Geometric Theory of Dynamical Systems: An Introduction. Springer Science & Business Media, 2012. Dohyung Park, Anastasios Kyrillidis, Constantine Carmanis, and Sujay Sanghavi. Non-square matrix sensing without spurious local minima via the Burer-Monteiro approach. In Artificial Intelligence and Statistics, pages 65–74, 2017. Robin Pemantle. Nonconvergence to unstable points in urn models and stochastic approximations. The Annals of Probability, pages 698–712, 1990. Ju Sun, Qing Qu, and John Wright. A geometric analysis of phase retrieval. In Information Theory (ISIT), 2016 IEEE International Symposium on, pages 2379–2383. IEEE, 2016. 10 Ju Sun, Qing Qu, and John Wright. Complete dictionary recovery over the sphere I: Overview and the geometric picture. IEEE Transactions on Information Theory, 63(2):853–884, 2017. Ruoyu Sun and Zhi-Quan Luo. Guaranteed matrix completion via non-convex factorization. IEEE Transactions on Information Theory, 62(11):6535–6579, 2016. Hassler Whitney. Analytic extensions of differentiable functions defined in closed sets. Transactions of the American Mathematical Society, 36(1):63–89, 1934. Blake E Woodworth and Nati Srebro. Tight complexity bounds for optimizing composite objectives. In Advances in Neural Information Processing Systems, pages 3639–3647, 2016. Xinyang Yi, Dohyung Park, Yudong Chen, and Constantine Caramanis. Fast algorithms for robust PCA via gradient descent. In Advances in Neural Information Processing Systems, pages 4152– 4160, 2016. G George Yin and Harold J Kushner. Stochastic Approximation and Recursive Algorithms and Applications, volume 35. Springer, 2003. Xiao Zhang, Lingxiao Wang, and Quanquan Gu. Stochastic variance-reduced gradient descent for low-rank matrix recovery from linear measurements. arXiv preprint arXiv:1701.00481, 2017. 11
2017
655
7,180
Dual Path Networks Yunpeng Chen1, Jianan Li1,2, Huaxin Xiao1,3, Xiaojie Jin1, Shuicheng Yan4,1, Jiashi Feng1 1National University of Singapore 2Beijing Institute of Technology 3National University of Defense Technology 4Qihoo 360 AI Institute Abstract In this work, we present a simple, highly efficient and modularized Dual Path Network (DPN) for image classification which presents a new topology of connection paths internally. By revealing the equivalence of the state-of-the-art Residual Network (ResNet) and Densely Convolutional Network (DenseNet) within the HORNN framework, we find that ResNet enables feature re-usage while DenseNet enables new features exploration which are both important for learning good representations. To enjoy the benefits from both path topologies, our proposed Dual Path Network shares common features while maintaining the flexibility to explore new features through dual path architectures. Extensive experiments on three benchmark datasets, ImagNet-1k, Places365 and PASCAL VOC, clearly demonstrate superior performance of the proposed DPN over state-of-the-arts. In particular, on the ImagNet-1k dataset, a shallow DPN surpasses the best ResNeXt-101(64 × 4d) with 26% smaller model size, 25% less computational cost and 8% lower memory consumption, and a deeper DPN (DPN-131) further pushes the state-of-the-art single model performance with about 2 times faster training speed. Experiments on the Places365 large-scale scene dataset, PASCAL VOC detection dataset, and PASCAL VOC segmentation dataset also demonstrate its consistently better performance than DenseNet, ResNet and the latest ResNeXt model over various applications. 1 Introduction “Network engineering” is increasingly more important for visual recognition research. In this paper, we aim to develop new path topology of deep architectures to further push the frontier of representation learning. In particular, we focus on analyzing and reforming the skip connection, which has been widely used in designing modern deep neural networks and offers remarkable success in many applications [16, 7, 20, 14, 5]. Skip connection creates a path propagating information from a lower layer directly to a higher layer. During the forward propagation, skip connection enables a very top layer to access information from a distant bottom layer; while for the backward propagation, it facilitates gradient back-propagation to the bottom layer without diminishing magnitude, which effectively alleviates the gradient vanishing problem and eases the optimization. Deep Residual Network (ResNet) [5] is one of the first works that successfully adopt skip connections, where each mirco-block, a.k.a. residual function, is associated with a skip connection, called residual path. The residual path element-wisely adds the input features to the output of the same mircoblock, making it a residual unit. Depending on the inner structure design of the mirco-block, the residual network has developed into a family of various architectures, including WRN [22], Inceptionresnet [20], and ResNeXt [21]. More recently, Huang et al. [8] proposed a different network architecture that achieves comparable accuracy with deep ResNet [5], named Dense Convolutional Network (DenseNet). Different from residual networks which add the input features to the output features through the residual path, the 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. DenseNet uses a densely connected path to concatenate the input features with the output features, enabling each micro-block to receive raw information from all previous micro-blocks. Similar with residual network family, DenseNet can be categorized to the densely connected network family. Although the width of the densely connected path increases linearly as it goes deeper, causing the number of parameters to grow quadratically, DenseNet provides higher parameter efficiency compared with the ResNet [5]. In this work, we aim to study the advantages and limitations of both topologies and further enrich the path design by proposing a dual path architecture. In particular, we first provide a new understanding of the densely connected networks from the lens of a higher order recurrent neural network (HORNN) [19], and explore the relations between densely connected networks and residual networks. More specifically, we bridge the densely connected networks with the HORNNs, showing that the densely connected networks are HORNNs when the weights are shared across steps. Inspired by [12] which demonstrates the relations between the residual networks and RNNs, we prove that the residual networks are densely connected networks when connections are shared across layers. With this unified view on the state-of-the-art deep architecture, we find that the deep residual networks implicitly reuse the features through the residual path, while densely connected networks keep exploring new features through the densely connected path. Based on this new view, we propose a novel dual path architecture, called the Dual Path Network (DPN). This new architecture inherits both advantages of residual and densely connected paths, enabling effective feature re-usage and re-exploitation. The proposed DPN also enjoys higher parameter efficiency, lower computational cost and lower memory consumption, and being friendly for optimization compared with the state-of-the-art classification networks. Experimental results validate the outstanding high accuracy of DPN compared with other well-established baselines for image classification on both ImageNet-1k dataset and Places365-Standard dataset. Additional experiments on object detection task and semantic segmentation task also demonstrate that the proposed dual path architecture can be broadly applied for various tasks and consistently achieve the best performance. 2 Related work Designing an advanced neural network architecture is one of the most challenging but effective ways for improving the image classification performance, which can also directly benefit a variety of other tasks. AlexNet [10] and VGG [18] are two most important works that show the power of deep convolutional neural networks. They demonstrate that building deeper networks with tiny convolutional kernels is a promising way to increase the learning capacity of the neural network. Residual Network was first proposed by He et al. [5], which greatly alleviates the optimization difficulty and further pushes the depth of deep neural networks to hundreds of layers by using skipping connections. Since then, different kinds of residual networks arose, concentrating on either building a more efficient micro-block inner structure [3, 21] or exploring how to use residual connections [9]. Recently, Huang et al. [8] proposed a different network, called Dense Convolutional Networks, where skip connections are used to concatenate the input to the output instead of adding. However, the width of the densely connected path linearly increases as the depth rises, causing the number of parameters to grow quadratically and costing a large amount of GPU memory compared with the residual networks if the implementation is not specifically optimized. This limits the building of a deeper and wider densenet that may further improve the accuracy. Besides designing new architectures, researchers also try to re-explore the existing state-of-the-art architectures. In [6], the authors showed the importance of the residual path on alleviating the optimization difficulty. In [12], the residual networks are bridged with recurrent neural networks (RNNs), which helps people better understand the deep residual network from the perspective of RNNs. In [3], several different residual functions are unified, trying to provide a better understanding of designing a better mirco structure with higher learning capacity. But still, for the densely connected networks, in addition to several intuitive explanations on better feature reusage and efficient gradient flow introduced, there have been few works that are able to provide a really deeper understanding. In this work, we provide a deeper understanding of the densely connected network, from the lens of Higher Order RNN, and explain how the residual networks are in indeed a special case of densely connected network. Based on these analysis, we then propose a novel Dual Path Network architecture that not only achieves higher accuracy, but also enjoys high parameter and computational efficiency. 2 Unfold Fold Unfold Fold (a) ResNet with shared weights (b) ResNet in RNN form (c) DenseNet with shared weights (d) DenseNet in HORNN form h1 h2 + + … x0 + Output xt φ(ּ)+I(ּ) z-1 h1 x0 + h2 + … g2(ּ) g1(ּ) f1(ּ) f2(ּ) Output hk z-1 + ... + + z-1 z-1 fk-1k(ּ) fk-2k(ּ) f1k(ּ) f0k(ּ) gk(ּ) x0 Figure 1: The topological relations of different types of neural networks. (a) and (b) show relations between residual networks and RNN, as stated in [12]; (c) and (d) show relations between densely connected networks and higher order recurrent neural network (HORNN), which is explained in this paper. The symbol “z−1” denotes a time-delay unit; “⊕” denotes the element-wise summation; “I(·)” denotes an identity mapping function. 3 Revisiting ResNet, DenseNet and Higher Order RNN In this section, we first bridge the densely connected network [8] with higher order recurrent neural networks [19] to provide a new understanding of the densely connected network. We prove that residual networks [5, 6, 22, 21, 3], essentially belong to the family of densely connected networks except their connections are shared across steps. Then, we present analysis on strengths and weaknesses of each topology architecture, which motivates us to develop the dual path network architecture. For exploring the above relation, we provide a new view on the densely connected networks from the lens of Higher Order RNN, explain their relations and then specialize the analysis to residual networks. Throughout the paper, we formulate the HORNN in a more generalized form. We use ht to denote the hidden state of the recurrent neural network at the t-th step and use k as the index of the current step. Let xt denotes the input at t-th step, h0 = x0. For each step, f k t (·) refers to the feature extracting function which takes the hidden state as input and outputs the extracted information. The gk(·) denotes a transformation function that transforms the gathered information to current hidden state: hk = gk "k−1 X t=0 f k t (ht) # . (1) Eqn. (1) encapsulates the update rule of various network architectures in a generalized way. For HORNNs, weights are shared across steps, i.e. ∀t, k, f k k−t(·) ≡ft(·) and ∀k, gk(·) ≡g(·). For the densely connected networks, each step (micro-block) has its own parameter, which means f k t (·) and gk(·) are not shared. Such observation shows that the densely connected path of DenseNet is essentially a higher order path which is able to extract new information from previous states. Figure 1(c)(d) graphically shows the relations of densely connected networks and higher order recurrent networks. We then explain that the residual networks are special cases of densely connected networks if taking ∀t, k, f k t (·) ≡ft(·). Here, for succinctness we introduce rk to denote the intermediate results and let r0 = 0. Then Eqn. (1) can be rewritten as rk ≜ k−1 X t=1 ft(ht) = rk−1 + fk−1(hk−1), (2) hk = gk rk . (3) Thus, by substituting Eqn. (3) into Eqn. (2), Eqn. (2) can be simplified as rk = rk−1 + fk−1(hk−1) = rk−1 + fk−1(gk−1 rk−1 ) = rk−1 + φk−1(rk−1), (4) where φk(·) = fk(gk(·)). Obviously, Eqn. (4) has the same form as the residual network and the recurrent neural network. Specifically, when ∀k, φk(·) ≡φ(·), Eqn. (4) degenerates to an RNN; when none of φk(·) is shared and xk = 0, k > 1, Eqn. (4) produces a residual network. Figure 1(a)(b) 3 graphically shows the relation. Besides, recall that Eqn. (4) is derived under the condition when ∀t, k, f k t (·) ≡ft(·) from Eqn. (1) and the densely connected networks are in forms of Eqn. (1), meaning that the residual network family essentially belongs to the densely connected network family. Figure 2(a–c) give an example and demonstrate such equivalence, where ft(·) corresponds to the first 1 × 1 convolutional layer and the gk(·) corresponds to the other layers within a micro-block in Figure 2(b). From the above analysis, we observe: 1) both residual networks and densely connected networks can be seen as a HORNN when f k t (·) and gk(·) are shared for all k; 2) a residual network is a densely connected network if ∀t, k, f k t (·) ≡ft(·). By sharing the f k t (·) across all steps, gk(·) receives the same feature from a given output state, which encourages the feature reusage and thus reduces the feature redundancy. However, such an information sharing strategy makes it difficult for residual networks to explore new features. Comparatively, the densely connected networks are able to explore new information from previous outputs since the f k t (·) is not shared across steps. However, different f k t (·) may extract the same type of features multiple times, leading to high redundancy. In the following section, we present the dual path networks which can overcome both inherent limitations of these two state-of-the-art network architectures. Their relations with HORNN also imply that our proposed architecture can be used for improving HORNN, which we leave for future works. 4 Dual Path Networks Above we explain the relations between residual networks and densely connected networks, showing that the residual path implicitly reuses features, but it is not good at exploring new features. In contrast the densely connected network keeps exploring new features but suffers from higher redundancy. In this section, we describe the details of our proposed novel dual path architecture, i.e. the Dual Path Network (DPN). In the following, we first introduce and formulate the dual path architecture, and then present the network structure in details with complexity analysis. 4.1 Dual Path Architecture Sec. 3 discusses the advantage and limitations of both residual networks and densely connected networks. Based on the analysis, we propose a simple dual path architecture which shares the f k t (·) across all blocks to enjoy the benefits of reusing common features with low redundancy, while still remaining a densely connected path to give the network more flexibility in learning new features. We formulate such a dual path architecture as follows: xk ≜ k−1 X t=1 f k t (ht), (5) yk ≜ k−1 X t=1 vt(ht) = yk−1 + φk−1(yk−1), (6) rk ≜xk + yk, (7) hk = gk rk , (8) where xk and yk denote the extracted information at k-th step from individual path, vt(·) is a feature learning function as f k t (·). Eqn. (5) refers to the densely connected path that enables exploring new features, Eqn. (6) refers to the residual path that enables common features re-usage, and Eqn. (7) defines the dual path that integrates them and feeds them to the last transformation function in Eqn. (8). The final transformation function gk(·) generates current state, which is used for making next mapping or prediction. Figure 2(d)(e) show an example of the dual path architecture that is being used in our experiments. More generally, the proposed DPN is a family of convolutional neural networks which contains a residual alike path and a densely connected alike path, as explained later. Similar to these networks, one can customize the micro-block function of DPN for task-specific usage or for further overall performance boosting. 4 (a) Residual Network (b) Densely Connected Network (e) DPN (d) Dual Path Architecture 1×1 + 3×3 1×1 1×1 1×1 3×3 1×1 + + 1×1 3×3 1×1 + 1×1 3×3 1×1 1×1 + 1×1 3×3 + 1×1 ~ 1×1 1×1 + 1×1 3×3 + ~ 1×1 1×1 3×3 ~ + 1×1 1×1 3×3 ~ + (c) Densely Connected Network ( with shared connections ) 1×1 3×3 1×1 1×1 3×3 1×1 + + residual unit Figure 2: Architecture comparison of different networks. (a) The residual network. (b) The densely connected network, where each layer can access the outputs of all previous micro-blocks. Here, a 1 × 1 convolutional layer (underlined) is added for consistency with the micro-block design in (a). (c) By sharing the first 1 × 1 connection of the same output across micro-blocks in (b), the densely connected network degenerates to a residual network. The dotted rectangular in (c) highlights the residual unit. (d) The proposed dual path architecture, DPN. (e) An equivalent form of (d) from the perspective of implementation, where the symbol “≀” denotes a split operation, and “+” denotes element-wise addition. 4.2 Dual Path Networks The proposed network is built by stacking multiple modualized mirco-blocks as shown in Figure 2. In this work, the structure of each micro-block is designed with a bottleneck style [5] which starts with a 1 × 1 convolutional layer followed by a 3 × 3 convolutional layer, and ends with a 1 × 1 convolutional layer. The output of the last 1 × 1 convolutional layer is split into two parts: the first part is element-wisely added to the residual path, and the second part is concatenated with the densly connected path. To enhance the leaning capacity of each micro-block, we use the grouped convolution layer in the second layer as the ResNeXt [21]. Considering that the residual networks are more wildly used than the densely connected networks in practice, we choose the residual network as the backbone and add a thin densely connected path to build the dual path network. Such design also helps slow the width increment of the densely connected path and the cost of GPU memory. Table 1 shows the detailed architecture settings. In the table, G refers to the number of groups, and k refers to the channels increment for the densely connected path. For the new proposed DPNs, we use (+k) to indicate the width increment of the densely connected path. The overall design of DPN inherits backbone architecture of the vanilla ResNet / ResNeXt, making it very easy to implement and apply to other tasks. One can simply implement a DPN by adding one more “slice layer” and “concat layer” upon existing residual networks. Under a well optimized deep learning platform, none of these newly added operations requires extra computational cost or extra memory consumption, making the DPNs highly efficient. In order to demonstrate the appealing effectiveness of the dual path architecture, we intentionally design a set of DPNs with a considerably smaller model size and less FLOPs compared with the sate-of-the-art ResNeXts [21], as shown in Table 1. Due to limited computational resources, we set these hyper-parameters based on our previous experience instead of grid search experiments. Model complexity We measure the model complexity by counting the total number of learnable parameters within each neural network. Table 1 shows the results for different models. The DPN-92 costs about 15% fewer parameters than ResNeXt-101 (32 × 4d), while the DPN-98 costs about 26% fewer parameters than ResNeXt-101 (64 × 4d). Computational complexity We measure the computational cost of each deep neural network using the floating-point operations (FLOPs) with input size of 224 × 224, in the number of multiply-adds following [21]. Table 1 shows the theoretical computational cost. Though the actual time cost might be influenced by other factors, e.g. GPU bandwidth and coding quality, the computational cost shows the speed upper bound. As can be see from the results, DPN-92 consumes about 19% less FLOPs than ResNeXt-101(32 × 4d), and the DPN-98 consumes about 25% less FLOPs than ResNeXt-101(64 × 4d). 5 Table 1: Architecture and complexity comparison of our proposed Dual Path Networks (DPNs) and other state-of-the-art networks. We compare DPNs with two baseline methods: DenseNet [5] and ResNeXt [21]. The symbol (+k) denotes the width increment on the densely connected path. stage output DenseNet-161 (k=48) ResNeXt-101 (32×4d) ResNeXt-101 (64×4d) DPN-92 (32×3d) DPN-98 (40×4d) conv1 112x112 7 × 7, 96, stride 2 7 × 7, 64, stride 2 7 × 7, 64, stride 2 7 × 7, 64, stride 2 7 × 7, 96, stride 2 conv2 56x56 3 × 3 max pool, stride 2 3 × 3 max pool, stride 2 3 × 3 max pool, stride 2 3 × 3 max pool, stride 2 3 × 3 max pool, stride 2  1×1, 192 3×3, 48  × 6   1×1, 128 3×3, 128, G=32 1×1, 256  × 3   1×1, 256 3×3, 256, G=64 1×1, 256  × 3   1×1, 96 3×3, 96, G=32 1×1, 256 (+16)  × 3   1×1, 160 3×3, 160, G=40 1×1, 256 (+16)  × 3 conv3 28×28  1×1, 192 3×3, 48  × 12   1×1, 256 3×3, 256, G=32 1×1, 512  × 4   1×1, 512 3×3, 512, G=64 1×1, 512  × 4   1×1, 192 3×3, 192, G=32 1×1, 512 (+32)  × 4   1×1, 320 3×3, 320, G=40 1×1, 512 (+32)  × 6 conv4 14×14  1×1, 192 3×3, 48  × 36   1×1, 512 3×3, 512, G=32 1×1, 1024  × 23   1×1, 1024 3×3, 1024, G=64 1×1, 1024  × 23   1×1, 384 3×3, 384, G=32 1×1, 1024 (+24)  × 20   1×1, 640 3×3, 640, G=40 1×1, 1024 (+32)  × 20 conv5 7×7  1×1, 192 3×3, 48  × 24   1×1, 1024 3×3, 1024, G=32 1×1, 2048  × 3   1×1, 2048 3×3, 2048, G=64 1×1, 2048  × 3   1×1, 768 3×3, 768, G=32 1×1, 2048 (+128)  × 3   1×1, 1280 3×3, 1280, G=40 1×1, 2048 (+128)  × 3 1×1 global average pool 1000-d fc, softmax global average pool 1000-d fc, softmax global average pool 1000-d fc, softmax global average pool 1000-d fc, softmax global average pool 1000-d fc, softmax # params 28.9 × 106 44.3 × 106 83.7 × 106 37.8 × 106 61.7 × 106 FLOPs 7.7 × 109 8.0 × 109 15.5 × 109 6.5 × 109 11.7 × 109 5 Experiments Extensive experiments are conducted for evaluating the proposed Dual Path Networks. Specifically, we evaluate the proposed architecture on three tasks: image classification, object detection and semantic segmentation, using three standard benchmark datasets: the ImageNet-1k dataset, Places365Standard dataset and the PASCAL VOC datasets. Key properties of the proposed DPNs are studied on the ImageNet-1k object classification dataset [17] and further verified on the Places365-Standard scene understanding dataset [24]. To verify whether the proposed DPNs can benefit other tasks besides image classification, we further conduct experiments on the PASCAL VOC dataset [4] to evaluate its performance in object detection and semantic segmentation. 5.1 Experiments on image classification task We implement the DPNs using MXNet [2] on a cluster with 40 K80 graphic cards. Following [3], we adopt standard data augmentation methods and train the networks using SGD with a mini-batch size of 32 for each GPU. For the deepest network, i.e. DPN-1311, the mini-batch size is limited to 24 because of the 12GB GPU memory constraint. The learning rate starts from √ 0.1 for DPN-92 and DPN-131, and from 0.4 for DPN-98. It drops in a “steps” manner by a factor of 0.1. Following [5], batch normalization layers are refined after training. 5.1.1 ImageNet-1k dataset Firstly, we compare the image classification performance of DPNs with current state-of-the-art models. As can be seen from the first block in Table 2, a shallow DPN with only the depth of 92 reduces the top-1 error rate by an absolute value of 0.5% compared with the ResNeXt-101(32 × 4d) and an absolute value of 1.5% compared with the DenseNet-161 yet provides with considerably less FLOPs. In the second block of Table 2, a deeper DPN (DPN-98) surpasses the best residual network – ResNeXt-101 (64 × 4d), and still enjoys 25% less FLOPs and a much smaller model size (236 MB v.s. 320 MB). In order to further push the state-of-the-art accuracy, we slightly increase the depth of the DPN to 131 (DPN-131). The results are shown in the last block in Table 2. Again, the DPN shows superior accuracy over the best single model – Very Deep PolyNet [23], with a much smaller model size (304 MB v.s. 365 MB). Note that the Very Deep PolyNet adopts numerous tricks, e.g. initialization by insertion, residual scaling, stochastic paths, to assist the training process. In contrast, our proposed DPN-131 is simple and does not involve these tricks, DPN-131 can be trained using a standard training strategy as shallow DPNs. More importantly, the actual training speed of DPN-131 is about 2 times faster than the Very Deep PolyNet, as discussed in the following paragraph. 1The DPN-131 has 128 channels at conv1, 4 blocks at conv2, 8 blocks at conv3, 28 blocks at conv4 and 3 blocks at conv5, which has #params=79.5 × 106 and FLOPs=16.0 × 109. 6 Table 2: Comparison with state-of-the-art CNNs on ImageNet-1k dataset. Single crop validation error rate (%) on validation set. *: Performance reported by [21], †: With Mean-Max Pooling (see supplementary material). Method Model Size GFLOPs x224 x320 / x299 top-1 top-5 top-1 top-5 DenseNet-161(k=48) [8] 111 MB 7.7 22.2 – – – ResNet-101* [5] 170 MB 7.8 22.0 6.0 – – ResNeXt-101 (32 × 4d) [21] 170 MB 8.0 21.2 5.6 – – DPN-92 (32 × 3d) 145 MB 6.5 20.7 5.4 19.3 4.7 ResNet-200 [6] 247 MB 15.0 21.7 5.8 20.1 4.8 Inception-resnet-v2 [20] 227 MB – – – 19.9 4.9 ResNeXt-101 (64 × 4d) [21] 320 MB 15.5 20.4 5.3 19.1 4.4 DPN-98 (40 × 4d) 236 MB 11.7 20.2 5.2 18.9 4.4 Very deep Inception-resnet-v2 [23] 531 MB – – – 19.10 4.48 Very Deep PolyNet [23] 365 MB – – – 18.71 4.25 DPN-131 (40 × 4d) 304 MB 16.0 19.93 5.12 18.62 4.23 DPN-131 (40 × 4d) † 304 MB 16.0 19.93 5.12 18.55 4.16 Table 3: Comparison with state-of-theart CNNs on Places365-Standard dataset. 10 crops validation accuracy rate (%) on validation set. Method Model Size top-1 acc. top-5 acc. AlexNet [24] 223 MB 53.17 82.89 GoogleLeNet [24] 44 MB 53.63 83.88 VGG-16 [24] 518 MB 55.24 84.91 ResNet-152 [24] 226 MB 54.74 85.08 ResNeXt-101 [3] 165 MB 56.21 86.25 CRU-Net-116 [3] 163 MB 56.60 86.55 DPN-92 (32 × 3d) 138 MB 56.84 86.69 50 60 70 80 90 100 Training Speed (samples/sec) 18.5 19 19.5 20 20.5 Single Crop, Top-1 Error ResNet-200 ResNeXt-101 (64x4d) DPN-98 (40x4d) DPN-131 (40x4d) 8 9 10 11 12 Memory Cost (GB), Batch Size = 24 18.5 19 19.5 20 20.5 Single Crop, Top-1 Error ResNet-200 ResNeXt-101 (64x4d) DPN-98 (40x4d)DPN-131 (40x4d) 50 60 70 80 90 100 Training Speed (samples/sec) 8 9 10 11 12 Memory Cost (GB), Batch Size = 24 ResNet-200 ResNeXt-101 (64x4d) DPN-98 (40x4d) DPN-131 (40x4d) (a) (b) (c) Figure 3: Comparison of total actual cost between different models during training. Evaluations are conducted on a single Node with 4 K80 graphic card with all training samples cached into memory. (For the comparison of Training Speed, we push the mini-batch size to its maximum value given a 12GB GPU memory to test the fastest possible training speed of each model.) Secondly, we compare the training cost between the best performing models. Here, we focus on evaluating two key properties – the actual GPU memory cost and the actual training speed. Figure 3 shows the results. As can be seen from Figure 3(a)(b), the DPN-98 is 15% faster and uses 9% less memory than the best performing ResNeXt with a considerably lower testing error rate. Note that theoretically the computational cost of DPN-98 shown in Table 2 is 25% less than the best performing ResNeXt, indicating there is still room for code optimization. Figure 3(c) presents the same result in a more clear way. The deeper DPN-131 only costs about 19% more training time compared with the best performing ResNeXt, but achieves the state-of-the-art single model performance. The training speed of the previous state-of-the-art single model, i.e. Very Deep PolyNet (537 layers) [23], is about 31 samples per second based on our implementation using MXNet, showing that DPN-131 runs about 2 times faster than the Very Deep PolyNet during training. 5.1.2 Place365-Standard dataset In this experiment, we further evaluate the accuracy of the proposed DPN on the scene classification task using the Places365-Standard dataset. The Places365-Standard dataset is a high-resolution scene understanding dataset with more than 1.8 million images of 365 scene categories. Different from object images, scene images do not have very clear discriminative patterns and require a higher level context reasoning ability. Table 3 shows the results of different models on this dataset. To make a fair comparison, we perform the DPN-92 on this dataset instead of using deeper DPNs. As can be seen from the results, DPN achieves the best validation accuracy compared with other methods. The DPN-92 requires much less parameters (138 MB v.s. 163 MB), which again demonstrates its high parameter efficiency and high generalization ability. 5.2 Experiments on the object detection task We further evaluate the proposed Dual Path Network on the object detection task. Experiments are performed on the PASCAL VOC 2007 datasets [4]. We train the models on the union set of VOC 2007 trainval and VOC 2012 trainval following [16], and evaluate them on VOC 2007 test set. We use standard evaluation metrics Average Precision (AP) and mean of AP (mAP) following the PASCAL challenge protocols for evaluation. 7 Table 4: Object detection results on PASCAL VOC 2007 test set. The performance is measured by mean of Average Precision (mAP, in %). Method mAP areo bike bird boat bottle bus car cat chair cow table dog horse mbk prsn plant sheep sofa train tv DenseNet-161 (k=48) 79.9 80.4 85.9 81.2 72.8 68.0 87.1 88.0 88.8 64.0 83.3 75.4 87.5 87.6 81.3 84.2 54.6 83.2 80.2 87.4 77.2 ResNet-101 [16] 76.4 79.8 80.7 76.2 68.3 55.9 85.1 85.3 89.8 56.7 87.8 69.4 88.3 88.9 80.9 78.4 41.7 78.6 79.8 85.3 72.0 ResNeXt-101 (32 × 4d) 80.1 80.2 86.5 79.4 72.5 67.3 86.9 88.6 88.9 64.9 85.0 76.2 87.3 87.8 81.8 84.1 55.5 84.0 79.7 87.9 77.0 DPN-92 (32 × 3d) 82.5 84.4 88.5 84.6 76.5 70.7 87.9 88.8 89.4 69.7 87.0 76.7 89.5 88.7 86.0 86.1 58.4 85.0 80.4 88.2 83.1 Table 5: Semantic segmentation results on PASCAL VOC 2012 test set. The performance is measured by mean Intersection over Union (mIoU, in %). Method mIoU bkg areo bike bird boat bottle bus car cat chair cow table dog horse mbk prsn plant sheep sofa train tv DenseNet-161 (k=48) 68.7 92.1 77.3 37.1 83.6 54.9 70.0 85.8 82.5 85.9 26.1 73.0 55.1 80.2 74.0 79.1 78.2 51.5 80.0 42.2 75.1 58.6 ResNet-101 73.1 93.1 86.9 39.9 87.6 59.6 74.4 90.1 84.7 87.7 30.0 81.8 56.2 82.7 82.7 80.1 81.1 52.4 86.2 52.5 81.3 63.6 ResNeXt-101 (32 × 4d) 73.6 93.1 84.9 36.2 80.3 65.0 74.7 90.6 83.9 88.7 31.1 86.3 62.4 84.7 86.1 81.2 80.1 54.0 87.4 54.0 76.3 64.2 DPN-92 (32 × 3d) 74.8 93.7 88.3 40.3 82.7 64.5 72.0 90.9 85.0 88.8 31.1 87.7 59.8 83.9 86.8 85.1 82.8 60.8 85.3 54.1 82.6 64.6 We perform all experiments based on the ResNet-based Faster R-CNN framework, following [5] and make comparisons by replacing the ResNet, while keeping other parts unchanged. Since our goal is to evaluate DPN, rather than further push the state-of-the-art accuracy on this dataset, we adopt the shallowest DPN-92 and baseline networks at roughly the same complexity level. Table 4 provides the detection performance comparisons of the proposed DPN with several current state-of-the-art models. It can be observed that the DPN obtains the mAP of 82.5%, which makes large improvements, i.e. 6.1% compared with ResNet-101 [16] and 2.4% compared with ResNeXt-101 (32 × 4d). The better results shown in this experiment demonstrate that the Dual Path Network is also capable of learning better feature representations for detecting objects and benefiting the object detection task. 5.3 Experiments on the semantic segmentation task In this experiment, we evaluate the Dual Path Network for dense prediction, i.e. semantic segmentation, where the training target is to predict the semantic label for each pixel in the input image. We conduct experiments on the PASCAL VOC 2012 segmentation benchmark dataset [4] and use the DeepLab-ASPP-L [1] as the segmentation framework. For each compared method in Table 5, we replace the 3 × 3 convolutional layers in conv4 and conv5 of Table 1 with atrous convolution [1] and plug in a head of Atrous Spatial Pyramid Pooling (ASPP) [1] in the final feature maps of conv5. We adopt the same training strategy for all networks following [1] for fair comparison. Table 5 shows the results of different convolutional neural networks. It can be observed that the proposed DPN-92 has the highest overall mIoU accuracy. Compared with the ResNet-101 which has a larger model size and higher computational cost, the proposed DPN-92 further improves the IoU for most categories and improves the overall mIoU by an absolute value 1.7%. Considering the ResNeXt-101 (32 × 4d) only improves the overall mIoU by an absolute value 0.5% compared with the ResNet-101, the proposed DPN-92 gains more than 3 times improvement compared with the ResNeXt-101 (32 × 4d). The better results once again demonstrate the proposed Dual Path Network is capable of learning better feature representation for dense prediction. 6 Conclusion In this paper, we revisited the densely connected networks, bridged the densely connected networks with Higher Order RNNs and proved the residual networks are essentially densely connected networks with shared connections. Based on this new explanation, we proposed a dual path architecture that enjoys benefits from both sides. The novel network, DPN, is then developed based on this dual path architecture. Experiments on the image classification task demonstrate that the DPN enjoys high accuracy, small model size, low computational cost and low GPU memory consumption, thus is extremely useful for not only research but also real-word application. Experiments on the object detection task and semantic segmentation tasks show that the proposed DPN can also benefit other tasks by simply replacing the base network. Acknowledgments The work of Jiashi Feng was partially supported by National University of Singapore startup grant R-263-000-C08-133, Ministry of Education of Singapore AcRF Tier One grant R-263-000-C21-112 and NUS IDS grant R-263-000-C67-646. 8 References [1] Liang-Chieh Chen, George Papandreou, Iasonas Kokkinos, Kevin Murphy, and Alan L Yuille. Deeplab: Semantic image segmentation with deep convolutional nets, atrous convolution, and fully connected crfs. arXiv preprint arXiv:1606.00915, 2016. [2] Tianqi Chen, Mu Li, Yutian Li, Min Lin, Naiyan Wang, Minjie Wang, Tianjun Xiao, Bing Xu, Chiyuan Zhang, and Zheng Zhang. Mxnet: A flexible and efficient machine learning library for heterogeneous distributed systems. arXiv preprint arXiv:1512.01274, 2015. [3] Yunpeng Chen, Xiaojie Jin, Bingyi Kang, Jiashi Feng, and Shuicheng Yan. Sharing residual units through collective tensor factorization in deep neural networks. arXiv preprint arXiv:1703.02180, 2017. [4] Mark Everingham, SM Ali Eslami, Luc Van Gool, Christopher KI Williams, John Winn, and Andrew Zisserman. The pascal visual object classes challenge: A retrospective. IJCV, 111(1):98–136, 2014. [5] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 770–778, 2016. [6] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In European Conference on Computer Vision, pages 630–645. Springer, 2016. [7] Kaiming He, Georgia Gkioxari, Piotr Dollár, and Ross Girshick. Mask r-cnn. arXiv preprint arXiv:1703.06870, 2017. [8] Gao Huang, Zhuang Liu, Kilian Q Weinberger, and Laurens van der Maaten. Densely connected convolutional networks. arXiv preprint arXiv:1608.06993, 2016. [9] Jiwon Kim, Jung Kwon Lee, and Kyoung Mu Lee. Accurate image super-resolution using very deep convolutional networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1646–1654, 2016. [10] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pages 1097–1105, 2012. [11] Chen-Yu Lee, Patrick W Gallagher, and Zhuowen Tu. Generalizing pooling functions in convolutional neural networks: Mixed, gated, and tree. In Artificial Intelligence and Statistics, pages 464–472, 2016. [12] Qianli Liao and Tomaso Poggio. Bridging the gaps between residual learning, recurrent neural networks and visual cortex. arXiv preprint arXiv:1604.03640, 2016. [13] Jonathan Long, Evan Shelhamer, and Trevor Darrell. Fully convolutional networks for semantic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3431–3440, 2015. [14] Alejandro Newell, Kaiyu Yang, and Jia Deng. Stacked hourglass networks for human pose estimation. In European Conference on Computer Vision, pages 483–499. Springer, 2016. [15] Geoff Pleiss, Danlu Chen, Gao Huang, Tongcheng Li, Laurens van der Maaten, and Kilian Q Weinberger. Memory-efficient implementation of densenets. arXiv preprint arXiv:1707.06990, 2017. [16] Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. In Advances in neural information processing systems, pages 91–99, 2015. [17] Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, Alexander C. Berg, and Li Fei-Fei. ImageNet Large Scale Visual Recognition Challenge. International Journal of Computer Vision (IJCV), 115(3):211–252, 2015. doi: 10.1007/s11263-015-0816-y. [18] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. [19] Rohollah Soltani and Hui Jiang. Higher order recurrent neural networks. arXiv preprint arXiv:1605.00064, 2016. [20] Christian Szegedy, Sergey Ioffe, Vincent Vanhoucke, and Alex Alemi. Inception-v4, inception-resnet and the impact of residual connections on learning. arXiv preprint arXiv:1602.07261, 2016. [21] Saining Xie, Ross Girshick, Piotr Dollár, Zhuowen Tu, and Kaiming He. Aggregated residual transformations for deep neural networks. arXiv preprint arXiv:1611.05431, 2016. [22] Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. arXiv preprint arXiv:1605.07146, 2016. [23] Xingcheng Zhang, Zhizhong Li, Chen Change Loy, and Dahua Lin. Polynet: A pursuit of structural diversity in very deep networks. arXiv preprint arXiv:1611.05725, 2016. [24] Bolei Zhou, Aditya Khosla, Agata Lapedriza, Antonio Torralba, and Aude Oliva. Places: An image database for deep scene understanding. arXiv preprint arXiv:1610.02055, 2016. 9
2017
656
7,181
Model-based Bayesian inference of neural activity and connectivity from all-optical interrogation of a neural circuit Laurence Aitchison University of Cambridge Cambridge, CB2 1PZ, UK laurence.aitchison@gmail.com Lloyd Russell University College London London, WC1E 6BT, UK llerussell@gmail.com Adam Packer University College London London, WC1E 6BT, UK adampacker@gmail.com Jinyao Yan Janelia Research Campus Ashburn, VA 20147 yanj11@janelia.hhmi.org Philippe Castonguay Janelia Research Campus Ashburn, VA 20147 ph.castonguay@gmail.com Michael Häusser University College London London, WC1E 6BT, UK m.hausser@ucl.ac.uk Srinivas C. Turaga Janelia Research Campus Ashburn, VA 20147 turagas@janelia.hhmi.org Abstract Population activity measurement by calcium imaging can be combined with cellular resolution optogenetic activity perturbations to enable the mapping of neural connectivity in vivo. This requires accurate inference of perturbed and unperturbed neural activity from calcium imaging measurements, which are noisy and indirect, and can also be contaminated by photostimulation artifacts. We have developed a new fully Bayesian approach to jointly inferring spiking activity and neural connectivity from in vivo all-optical perturbation experiments. In contrast to standard approaches that perform spike inference and analysis in two separate maximum-likelihood phases, our joint model is able to propagate uncertainty in spike inference to the inference of connectivity and vice versa. We use the framework of variational autoencoders to model spiking activity using discrete latent variables, low-dimensional latent common input, and sparse spike-and-slab generalized linear coupling between neurons. Additionally, we model two properties of the optogenetic perturbation: off-target photostimulation and photostimulation transients. Using this model, we were able to fit models on 30 minutes of data in just 10 minutes. We performed an all-optical circuit mapping experiment in primary visual cortex of the awake mouse, and use our approach to predict neural connectivity between excitatory neurons in layer 2/3. Predicted connectivity is sparse and consistent with known correlations with stimulus tuning, spontaneous correlation and distance. 1 Introduction Quantitative mapping of connectivity is an essential prerequisite for understanding the operation of neural circuits. Thus far, it has only been possible to perform neural circuit mapping by using electrophysiological [1, 2], or electron-microscopic [3, 4] techniques. In addition to being extremely 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. involved, these techniques are difficult or impossible to perform in vivo. But a new generation of all-optical techniques enable the simultaneous optical recording and perturbation of neural activity with cellular resolution in vivo [5]. In principle, cellular resolution perturbation experiments can enable circuit mapping in vivo, however several challenges exist. First, while two-photon optogenetics can be used to drive spikes in neurons with cellular resolution, there can be variability in the number of spikes generated from trial to trial and from neuron to neuron. Second, there can be substantial off-target excitation of neurons whose dendrites might pass close to the targeted neurons. Third, there is a transient artifact from the laser pulse used for photostimulation which contaminates the activity imaging, preventing accurate estimates of changes in neural activity at the precise time of the perturbation, when accurate activity estimates are most useful. Fourth, the readout of activity in the stimulated neurons, and their downstream neighbors is a noisy flourescence measurement of the intracellular calcium concentration, which is itself an indirect measure of spiking activity. Fifth, the synaptic input from one neuron is rarely strong enough to generate action potentials on its own. Thus the optogenetic perturbation of single neurons is unlikely to generate changes in the suprathreshold activity of post-synaptic neurons which can be detected via calcium imaging on every trial. Highly sensitive statistical tools are needed to infer neural connectivity in the face of these unique challenges posed by modern all-optical experimental technology. To solve this problem, we develop a global Bayesian inference strategy, jointly inferring a distribution over spikes and unknown connections, and thus allowing uncertainty in the spikes to influence the inferred connections and vice versa. In the past, such methods have not been used because they were computationally intractable, but they are becoming increasingly possible due to three recent advances: the development of GPU computing [6], modern automatic differentiation libraries such as Tensorflow [7], and recent developments in variational autoencoders, including the reparameterization trick [8, 9]. By combining these techniques, we are able to perform inference in a large-scale model of calcium imaging data, including spike inference, photostimulation, low-dimensional activity, and generalized linear synaptic connectivity. 1.1 Prior work Bayesian models have been proposed to infer connectivity from purely observational neural datasets [10, 11], however such approaches do not recover connectivity in the common setting where the population neural activity is low-rank or driven by external unobserved inputs. Perturbations are essential to uncover connectivity in such scenarios, and a combination of electrophysiological readout and optogenetic perturbation has been used successfully [12, 13]. The analysis of such data is far simpler than our setting as electrophysiological measurements of the sub-threshold membrane potential of a post-synaptic neuron can enable highly accurate detection of strong and weak incoming connections. In contrast, we are concerned with the more challenging setting of noisy calcium imaging measurements of suprathreshold post-synaptic spiking activity. Further, we are the first to accurately model artifacts associated with 2-photon optogenetic photostimulation and simultaneous calcium imaging, while performing joint inference of spiking neural activity and sparse connectivity. 2 Methods 2.1 Variational Inference We seek to perform Bayesian inference, i.e. to compute the posterior over latent variables, z, (e.g. weights, spikes) given data, x (i.e. the fluorescence signal), P (z|x) = P (x|z) P (z) P (x) , (1) and, for model comparison, we would like to compute the model evidence, P (x) = Z dz P (x|z) P (z) . (2) However, the computation of these quantities is intractable, and this intractability has hindered the application of Bayesian techniques to large-scale data analysis, such as calcium imaging. Variational 2 A Rest of brain Stim laser GCaMP only GCaMP + opsin B e(t −1) e(t) e(t + 1) e(t + 2) l(t −1) l(t) l(t + 1) l(t + 2) s(t −1) s(t) s(t + 1) s(t + 2) f(t −1) f(t) f(t + 1) f(t + 2) 0.0 0.5 0 10 20 30 t (s) C 0.08 0.12 0 2 t (s) D 0.0 0.5 1.0 0 10 20 30 t (s) E Observations fc(t) Recon. rc(t) Spikes Q(sc(t) = 1) Figure 1: An overview of the data and generative model. A. A schematic diagram displaying the experimental protocol. All cells express a GCaMP calcium indicator, which fluoresces in response to spiking activity. A large subset of the excitatory cells also express channelrhodopsin, which, in combination with two-photon photostimulation, allows cellular resolution activity perturbations [5]. B. A simplified generative model, omitting unknown weights. The observed fluorescence signal, f, depends on spikes, s, at past times, and the external optogenetic perturbation, e (to account for the small photostimulation transient, which lasts only one or two frames). The spikes depend on previous spikes, external optogenetic stimulation, e, and on a low-dimensional dynamical system, l, representing the inputs coming from the rest of the brain. C. Results for spike inference based on spontaneous data. Gray gives the original (very noisy) fluorescence trace, black gives the reconstructed denoised fluorescence trace, based on inferred spikes, and red gives the inferred probability of spiking. D. Average fluorescence signal for cells that are directly perturbed (triggered on the perturbation). We see a large increase and slow decay in the fluorescence signal, driven by spiking activity. The small peaks at 0.5 s intervals are photostimulation transients. E. As in C, but for perturbed data. Note the small peaks in the reconstruction coming from the modelled photostimulation transients. inference is one technique for circumventing this intractability [8, 9, 14], which, in combination with recent work in deep neural networks (DNNs), has proven extremely effective [8, 9]. In variational inference, we create a recognition model/approximate posterior, Q (z|x), intended to approximate the posterior, P (z|x) [14]. This recognition model allows us to write down the evidence lower bound objective (ELBO), log P (x) ≥L = EQ(z|x) [log P (x, z) −log Q (z|x)] , (3) and optimizing this bound allows us to improve the recognition model, to the extent that, if Q (z|x) is sufficiently flexible, the bound becomes tight and the recognition model will match the posterior, Q (z|x) = P (z|x). 2.2 Our model At the broadest possible level, our experimental system has known inputs, observed outputs, and unknown latent variables. The input is optogenetic stimulation of randomly selected cells (Fig. 1A; i.e. we target the cell with a laser, which usually causes it to spike), represented by a binary vector, et, which is 1 if the cell is directly targeted, and 0 if it is not directly targeted. There are three unknown latent variables/parameters over which we infer an approximate posterior. First, there is a synaptic weight matrix, Wss, describing the underlying connectivity between cells. Second, there is a low-dimensional latent common input, lt, which represents input from other brain regions, and changes slowly over time (Fig. 1B). Third, there is a binary latent, st, representing spiking activity, which depends on previous spiking activity through the synaptic weight matrix, optogenetic stimulation and the low-rank latent (Fig. 1B). Finally, we observe spiking activity indirectly through a flourescence signal, ft, which is in essence a noisy convolution of the underlying spikes. As such, the observations and latents can be written, x = f, z = {l, s, Wss}, 3 respectively. Substituting these into the ELBO (Eq. 3), the full variational objective becomes, L = EQ(s,l,Wss|f,e) [log P (f, s, l, Wss|e) −log Q (s, l, Wss|f, e)] , (4) where we have additionally conditioned everything on the known inputs, e. 2.3 Generative model Neglecting initial states, we can factorize the generative model as P (f, s, l, Wss|e) = P (Wss) Y t P (lt|lt−1) P (st|st−1:0, e, lt, Wss) P (ft|st:0, et) , (5) i.e., we first generate a synaptic weight matrix, Wss, then we generate the latent low-rank states, lt based on their values at the previous time-step, then we generate the spikes based on past spikes, the synaptic weights, optogenetic stimulation, e, and the low-rank latents, and finally, we generate the flourescence signal based on past spiking and optogenetic stimulation. To generate synaptic weights, we assume a sparse prior, where there is some probability p that the weight is generated from a zero-mean Gaussian, and there is probability 1 −p that the weight is zero, P W ss ij  = (1 −p)δ W ss ij  + pN W ss ij, 0, σ2 , (6) where δ is the Dirac delta, we set p = 0.1 based on prior information, and learn σ2. To generate the low-rank latent states, we use a simple dynamical system, P (lt|lt−1) = N lt; Wlllt−1, Σl . (7) where Wll is the dynamics matrix, and Σl is a diagonal covariance matrix, representing independent Gaussian noise. To generate spikes, we use, P (st|st−1:0, e, lt, Wss) = Bernoulli (st; σ (ut)) (8) where σ is a vectorised sigmoid, σi (x) = 1/ (1 + e−xi), and the cell’s inputs, ut, are given by, ut = Wseet + Wss t−1 X t′=t−4 κs t−t′st′ + Wsllt + bs. (9) The first term represents the drive from optogenetic input, et, (to reiterate, a binary vector representing whether a cell was directly targeted on this timestep), coupled by weights, Wse, representing the degree to which cells surrounding the targeted cell also respond to the optogenetic stimulation. Note that Wse is structured (i.e. written down in terms of other parameters), and we discuss this structure later. The second term represents synaptic connectivity: how spikes at previous timesteps, st′ might influence spiking at this timestep, via a rapidly-decaying temporal kernel, κs, and a synaptic weight matrix Wss. The third term represents the input from other brain-regions by allowing the low-dimensional latents, lt, to influence spiking activity according to a weight matrix, Wsl. Finally, to generate the observed flourescence signal from the spiking activity, we use, P (ft) = N ft; rt, Σf , (10) where Σf is a learned, diagonal covariance matrix, representing independent noise in the flourescence observations. For computational tractability, the mean flourescence signal, or “reconstruction”, is simply a convolution of the spikes, rt = A t X t′=0 κt−t′ ⊙st′ + br + Wreet, (11) where ⊙represents an entrywise, or Hadamard, product. This expression takes a binary vector representing spiking activity, st′, convolves it with a temporal kernel, κ, representing temporal dynamics of flourescence responses, then scales it with the diagonal matrix, A, and adds a bias, br. The last term models an artifact in which optogenetic photostimulation, represented by a binary vector et describing whether a cell was directly targeted by the stimulation laser on that timestep, directly affects the imaging system according to a weight matrix Wre. The temporal kernel, κc,t−t′ is a sum of two exponentials unique to each cell, κc,t = e−t/τ decay c −e−t/τ rise c , (12) as is typical in e.g. [15]. 4 2.4 Recognition model The recognition model factorises similarly, Q (s, l, Wss|f, e) = Q (Wss) Q (s|f, e) Q (l|f) . (13) To approximate the posterior over weights we use, Q W ss ij  = (1 −pij)δ W ss ij  + pijN W ss ij, µij, σ2 ij  . (14) where pij is the inferred probability that the weight is non-zero, and µij and σ2 ij are the mean and variance of the inferred distribution over the weight, given that it is non-zero. As a recognition model for spikes, we use a multi-layer perceptron to map from the flourescence signal back to an inferred probability of spiking, Q (s(t)|v(t)) = Bernoulli (s(t); σ (v(t))) , (15) where v(t) depends on the fluorescence trace, and the optogenetic input, v(t) = MLPs (f(t −T : t + T)) + DeWsee(t) + bs. (16) Here, De is a diagonal matrix scaling the external input, and MLP (f(t −T : t + T)) is a neural network that, for each cell, takes a window of the fluorescence trace from time t −T to t + T, (for us, T = 100 frames, or about 3 seconds) linearly maps this window onto 20 features, then maps those 20 features through 2 standard neural-network layers with 20 units and Elu non-linearities [16], and finally linearly maps to a single value. To generate the low-rank latents, we use the same MLP, but allow for a different final linear mapping from 20 features to a single output, Q (l(t)|f) = N l(t); WflMLPl (f(t −T : t + T)) , Γl . (17) Here, we use a fixed diagonal covariance, Γl, and we use Wflto reduce the dimensionality of the MLP output to the number of latents. 2.5 Gradient-based optimization of generative and recognition model parameters We used the automatic differentiation routines embedded within TensorFlow to differentiate the ELBO with respect to the parameters of both the generative and recognition models, L = L σ, Wll, Σl, Wsl, bs, Σf, τ decay c , τ rise c , br, Wre, pij, µij, σ2 ij, De, Wfl, MLP, respi, σk  , (18) where the final two variables are defined later. We then used Adam [17] to perform the optimization. Instead of using minibatches consisting of multiple short time-windows, we used a single, relatively large time-window (of 1000 frames, or around 30 s, which minimized any edge-effects at the start or end of the time-window. 3 Results 3.1 All-optical circuit mapping experimental protocol We used a virus to express GCaMP6s pan-neuronally in layer 2/3 of mouse primary visual cortex (V1), and co-expressed C1V1 in excitatory neurons of the same layer. The mouse was awake, headfixed and on a treadmill. As in [5], we used a spatial light modulator to target 2-photon excitation of the C1V1 opsin in a subset of neurons, while simultaneously imaging neural activity in the local circuit by 2-photon calcium imaging of GCaMP6s. With this setup, we designed an experimental protocol to facilitate discovery of a large portion of the connections within a calcium-imaging field of view. In particular, twice every second we selected five cells at random, stimulated them, observed the activity in the rest of the network, and used this information to infer whether the stimulated cells projected to any of the other cells in the network (Fig. 1A). The optogenetic perturbation experiment consisted of 7200 trials and lasted one hour. We also mapped the orientation and direction tuning properties of the imaged neurons, and separately recorded spontaneous neural activity for 40 minutes. Our model was able to infer spikes in spontaneous data (Fig. 1C), and in photostimulation data, was able to both infer spikes and account for photostimulation transients (Fig. 1DE). 5 0.00 0.05 0 200 400 Distance (µm) ∆fc A 0.0 0.5 1.0 0 200 400 Distance (µm) Modelled stim. B 0 200 400 0 200 400 x (µm) y (µm) C 0.0 0.2 0.4 Stim. Direct Indirect Figure 2: Modeling off-target photostimulation, in which stimulating at one location activates surrounding cells. A. The change in average fluorescence based on 500 ms just before and just after stimulation (∆fc) for photostimulation of a target at a specified distance [5]. B. The modelled distance-dependent activation induced by photostimulation. The spatial extent of modelled off-target stimulation is broadly consistent with the raw-data in A. Note that as each cell has a different spatial absorption profile and responsiveness, modelled stimulation is not a simple function of distance from the target cell. C. Modelled off-target photostimulation resulting from stimulation of an example cell. -4 -2 0 2 4 0 10 20 30 Time (s) Norm. Act. A 0 200 400 0 200 400 x µm y µm B 0 200 400 0 200 400 x µm y µm C -0.2 0.0 0.2 Figure 3: Inferred low-rank latent activity. A. Time course of lt for perturbed data. The different lines correspond to different modes. B. The projection weights from the first latent onto cells, where cells are plotted according to their locations on the imaging plane. C. As B but for the second latent. Note that all projection weights are very close to 0, so the points are all gray. 3.2 Inferring the extent of off-target photostimulation Since photostimulation may also directly excite off-target neurons, we explicitly modelled this process (Fig. 2A). We used a sum of five Gaussians with different scales, σk, to flexibly model distance-dependent stimulation, Wse ij = respi 5 X k=1 exp  d2 i (xj)/ 2σ2 k  , (19) where xj describes the x, y position of the “target” cell j, and each cell receiving off-target stimulation has its own degree of responsiveness, respi, and a metric, di(xj, yj), describing that cell’s response to light stimulation in different spatial locations. The metric allows for stimulation to take on an elliptic pattern (given by Pi’s), and have a shifted center (given by ˆxi), d2 i (xj) = (xj −ˆxi)T Pi (xj −ˆxi) (20) After inference, this model gives a similar spatial distribution of perturbation-triggered activity (Fig. 2B). Furthermore, it should be noted that because each cell has its own responsiveness and spatial light absorption profile, if we stimulate in one location, a cell’s responsiveness is not a simple function of distance (Fig. 2BC). Finally, we allow small modifications around this strict spatial profile using a dense weight matrix. 3.3 Joint inference of latent common inputs Our model was able to jointly infer neural activity, latent common inputs (Fig. 3A) and sparse synaptic connectivity. As expected, we found one critical latent variable describing overall activation of all cells (Fig. 3B) [18], and a second, far less important latent (Fig. 3C). Given the considerable difference in magnitude between the impact of these two latents on the system, we can infer that only one latent variable is required to describe the system effectively. However, further work is needed to implement flexible yet interpretable low-rank latent variables in this system. 6 1.00 1.02 1.04 1.06 0 50 100 Epoch Test ELBO A 1.04 1.06 1.08 1.10 0 50 100 Epoch Test ELBO B Model Sparse GLM + LR Dense GLM + LR LR Independent Separate Figure 4: Performance of various models for spontaneous (A) and perturbed (B) data. We consider “Sparse GLM + LR” (the full model), “Dense GLM + LR” (the full model, but with with dense GLM weights), “LR” (a model with no GLM, only the low-rank component), “Independent” (a model with no higher-level structure) and finally “Separate” (the spikes are extracted using the independent model, then the full model is fitted to those spikes). 3.4 The model recovers known properties of biological activity The ELBO forms only a lower bound on the model evidence, so it is possible for models to appear better/worse simply because of changes in the tightness of the bound. As such, it is important to check that the learned model recovers known properties of biological connectivity. We thus compared a group of models, including the full model, a model with dense (as opposed to the usual sparse) synaptic connectivity, a model with only low-rank latents, and a simple model with no higher-level structure, for both spontaneous (Fig. 4A) and perturbed (Fig. 4B) data. We found that the sparse GLM offered a dramatic improvement over the dense GLM, which in turn offered little benefit over a model with only low-rank activity. (Note the reported values are ELBO per cell per timestep, so must be multiplied by 348 cells and around 100,000 time-steps to obtain the raw-ELBO values, which are then highly significant). Thus, the ELBO is able to recover features of real biological connectivity (biological connectivity is also sparse [1, 2]). 3.5 Joint inference is better than a “pipeline” Furthermore, we compared our joint approach, where we jointly infer spikes, low-rank activity, and weights, to a more standard “pipeline” in which one infer spikes using a simple Bayesian model lacking low-rank activity and GLM connectivity, then infer the low-rank activity and weights based on those spikes, similar to [11]. We found that performing inference jointly — allowing information about low-rank activity, GLM connectivity and external stimulation to influence spike inferences greatly improved the quality of our inferences for both spontaneous (Fig. 4A) and perturbed data (Fig. 4B). This improvement is entirely expected within the framework of variational inference, as the “pipeline” has two objectives, one for spike extraction, and another for the high-level generative model, and without the single, unified objective, it is even possible for the ELBO to decrease with more training (Fig. 4B). 3.6 The inferred sparse weights are consistent with known properties of neural circuits Next, we plotted the synaptic “GLM” weights for spontaneous (Fig. 5A–D) and perturbed (Fig. 5E– H) data. These weights are negatively correlated with distance (p < 0.0001; Fig. 5BF) suggesting that short-range connections are predominantly excitatory (though this may be confounded by cells overlapping, such that activity in one cell is recorded as activity in a different cell). The short range excitatory connections can be seen as the diagonal red bands in Fig. 5AE as the neurons are roughly sorted by proximity, with the first 248 being perturbed, and the remainder never being perturbed. The weights are strongly correlated with spontaneous correlation (p < 0.0001; Fig. 5CG), as measured using raw fluorescence traces; a result which is expected, given that the model should use these weights to account for some aspects of the spontaneous correlation. Finally, the weights are positively correlated with signal correlation (p < 0.0001; Fig. 5DH), as measured using 8 drifting gratings, a finding that is consistent with previous results [1, 2]. 7 0 200 0 200 Pre index Post index A 0 1 0 200 400 Distance Weight B 0 1 0.0 0.5 Spont. corr. Weight C 0 1 -0.5 0.0 0.5 Signal corr. Weight D 0 200 0 200 Pre index Post index E 0 1 0 200 400 Distance Weight F 0 1 0.0 0.5 Spont. corr. Weight G 0 1 -0.5 0.0 0.5 Signal corr. Weight H Figure 5: Inferred connection weights. A. Weight matrix inferred from spontaneous data (in particular, the expected value of the weight, under the recognition model, with red representing positive connectivity, and blue representing negative connectivity), plotted against distance (B), spontaneous correlation (C), and signal correlation (D). E–H. As A–D for perturbed data. 3.7 Perturbed data supports stronger inferences than spontaneous data Consistent with our expectations, we found that perturbations considerably increased the number of discovered connections. Our spike-and-slab posterior over weights can be interpreted to yield an estimated confidence probability that a given connection exists. We can use this probability to estimate the number of highly confident connections. In particular, we were able to find 50% more connections in the perturbed dataset than the spontaneous dataset, with a greater than 0.95 probability (1940 vs 1204); twice times as many highly confident connections with probability 0.99 or higher (1107 vs 535); and five times as many with the probability 0.999 or higher (527 vs 101). These results highlight the importance of perturbations to uncovering connections which would otherwise have been missed when analyzing purely observational datasets. 3.8 Simulated data Using the above methods, it is difficult to assess the effectiveness of the model because we do not have ground truth. While the ideal approach would be to obtain ground-truth data experimentally, this is very difficult in practice. An alternative approach is thus to simulate data from the generative model, in which case the ground-truth weights are simply those used to perform the initial simulation. To perform a quantitative comparison, we used the correlation between a binary variable representing whether the true weights were greater than 0.1 (because it is extremely difficult to distinguish between zero, and very small but non-zero weights, and), and the inferred probability of the weight being greater than 0.1, based on a combination of the inferences over the discrete and continuous component. We chose a threshold of 0.1 because it was relatively small in comparison with the standard-deviation for the non-zero weights of around 0.4. We started by trying to replicate our experiments as closely as possible (Fig. 6), i.e. we inferred all the parameters, noise-levels, timescales, priors on weights etc. based on real data, and resampled the weight matrix based on the inferred prior over weights. We then considered repeating the same stimulation pattern 50 times (frozen), as against using 50 times more entirely random simulated data (unfrozen), and found that, as expected, using random stimulation patterns is more effective. As computational constraints prevent us from increasing the data further, we considered reducing the noise by a factor of 40 (low-noise), and then additionally reduced the timescales of the calcium transients by a factor of 10 (fast decay) which improved the correlation to 0.85. These results indicate the model is functioning correctly, but raise issues for future work. In particular, the considerable improvement achieved by reducing the timescales indicates that careful modeling of the calcium transient is essential, and that faster calcium indicators have the potential to dramatically improve the ultimate accuracy of weight inferences. 8 raw frozen unfrozen unfrozen low noise unfrozen low noise fast decay 0 0.2 0.4 0.6 0.8 1 correlation Figure 6: Effectiveness of various variants of the model at finding the underlying ground-truth weights. The correlation compares a binary variable reporting whether the ground-truth weight is above or below 0.1 with a continuous measure reporting the inferred probability of the weight being larger than 0.1. The first condition, raw, uses simulated data that matches the real data as closely as possible including the same length of photostimulated and spontaneous data as we obtained, and matching the parameters such as the noise level to those used in data. The frozen/unfrozen conditions represent using 50 times more data, where, for “frozen” condition, we repeat the same optogenetic stimulation 50 times, and for the “unfrozen” condition we always use fresh, randomly chosen stimulation patterns. The final pair of conditions are photo stimulated data, with 50 times more unfrozen data. For the “low noise” condition we reduce the noise level by a factor of 40, and for the “fast decay” condition, we additionally reduce the calcium decay timeconstants by a factor of 10. 4 Discussion We applied modern variational autoencoder and GPU computing techniques to create a fully Bayesian model of calcium imaging and perturbation data. This model simultaneously and efficiently extracted Bayesian approximate posteriors over spikes, the extent of two optogenetic perturbation artifacts, lowrank activity, and sparse synaptic (GLM) weights. This is the first model designed for perturbation data, and we are not aware of any other model which is able to extract posteriors over such a wide range of parameters with such efficiency. Our inferred weights are consistent with studies using electrophysiological means to measure connectivity in mouse V1 [1, 2]. Further, model selection gives biologically expected results, identifying sparseness, suggesting that these models are identifying biologically relevant structure in the data. However, simply identifying broad properties such as sparseness does not imply that our inferences about individual weights are correct: for this, we need validation using complementary experimental approaches. Finally, we have shown that recent developments in variational autoencoders make it possible to perform inference in “ideal” models: large-scale models describing noisy data-generating processes and complex biological phenomena simultaneously. References [1] H. Ko, S. B. Hofer, B. Pichler, K. A. Buchanan, P. J. Sjöström, and T. D. Mrsic-Flogel, “Functional specificity of local synaptic connections in neocortical networks,” Nature, vol. 473, no. 7345, pp. 87–91, 2011. [2] L. Cossell, M. F. Iacaruso, D. R. Muir, R. Houlton, E. N. Sader, H. Ko, S. B. Hofer, and T. D. Mrsic-Flogel, “Functional organization of excitatory synaptic strength in primary visual cortex,” Nature, vol. 518, no. 7539, pp. 399–403, 2015. [3] S. ya Takemura, A. Bharioke, Z. Lu, A. Nern, S. Vitaladevuni, P. K. Rivlin, W. T. Katz, D. J. Olbris, S. M. Plaza, P. Winston, T. Zhao, J. A. Horne, R. D. Fetter, S. Takemura, K. Blazek, L.-A. Chang, O. Ogundeyi, M. A. Saunders, V. Shapiro, C. Sigmund, G. M. Rubin, L. K. Scheffer, I. A. Meinertzhagen, and D. B. Chklovskii, “A visual motion detection circuit suggested by drosophila connectomics,” Nature, vol. 500, pp. 175–181, aug 2013. [4] W.-C. A. Lee, V. Bonin, M. Reed, B. J. Graham, G. Hood, K. Glattfelder, and R. C. Reid, “Anatomy and function of an excitatory network in the visual cortex,” Nature, vol. 532, no. 7599, pp. 370–374, 2016. 9 [5] A. M. Packer, L. E. Russell, H. W. Dalgleish, and M. Häusser, “Simultaneous all-optical manipulation and recording of neural circuit activity with cellular resolution in vivo,” Nature Methods, vol. 12, no. 2, pp. 140–146, 2015. [6] R. Raina, A. Madhavan, and A. Y. Ng, “Large-scale deep unsupervised learning using graphics processors,” in Proceedings of the 26th annual international conference on machine learning, pp. 873–880, ACM, 2009. [7] M. Abadi, A. Agarwal, P. Barham, E. Brevdo, Z. Chen, C. Citro, G. S. Corrado, A. Davis, J. Dean, M. Devin, S. Ghemawat, I. Goodfellow, A. Harp, G. Irving, M. Isard, Y. Jia, R. Jozefowicz, L. Kaiser, M. Kudlur, J. Levenberg, D. Mané, R. Monga, S. Moore, D. Murray, C. Olah, M. Schuster, J. Shlens, B. Steiner, I. Sutskever, K. Talwar, P. Tucker, V. Vanhoucke, V. Vasudevan, F. Viégas, O. Vinyals, P. Warden, M. Wattenberg, M. Wicke, Y. Yu, and X. Zheng, “TensorFlow: Large-scale machine learning on heterogeneous systems,” 2015. Software available from tensorflow.org. [8] D. P. Kingma and M. Welling, “Auto-encoding variational bayes,” ICLR, 2014. [9] D. J. Rezende, S. Mohamed, and D. Wierstra, “Stochastic backpropagation and approximate inference in deep generative models,” ICML, 2014. [10] Y. Mishchenko, J. T. Vogelstein, and L. Paninski, “A Bayesian approach for inferring neuronal connectivity from calcium fluorescent imaging data,” The Annals of Applied Statistics, vol. 5, pp. 1229–1261, June 2011. [11] D. Soudry, S. Keshri, P. Stinson, M.-H. Oh, G. Iyengar, and L. Paninski, “Efficient "shotgun" inference of neural connectivity from highly sub-sampled activity data,” PLoS computational biology, vol. 11, p. e1004464, Oct. 2015. [12] A. M. Packer, D. S. Peterka, J. J. Hirtz, R. Prakash, K. Deisseroth, and R. Yuste, “Two-photon optogenetics of dendritic spines and neural circuits,” Nat Methods, vol. 9, pp. 1202–U103, Dec. 2012. [13] B. Shababo, B. Paige, A. Pakman, and L. Paninski, “Bayesian inference and online experimental design for mapping neural microcircuits,” in Advances in Neural Information Processing Systems 26 (C. J. C. Burges, L. Bottou, M. Welling, Z. Ghahramani, and K. Q. Weinberger, eds.), pp. 1304–1312, Curran Associates, Inc., 2013. [14] M. I. Jordan, Z. Ghahramani, T. S. Jaakkola, and L. K. Saul, “An introduction to variational methods for graphical models,” Machine Learning, vol. 37, no. 2, pp. 183–233, 1999. [15] J. T. Vogelstein, A. M. Packer, T. A. Machado, T. Sippy, B. Babadi, R. Yuste, and L. Paninski, “Fast nonnegative deconvolution for spike train inference from population calcium imaging,” Journal of neurophysiology, vol. 104, no. 6, pp. 3691–3704, 2010. [16] D.-A. Clevert, T. Unterthiner, and S. Hochreiter, “Fast and accurate deep network learning by exponential linear units (elus),” arXiv preprint arXiv:1511.07289, 2015. [17] D. Kingma and J. Ba, “Adam: A method for stochastic optimization,” ICLR, 2015. [18] M. Okun, N. A. Steinmetz, L. Cossell, M. F. Iacaruso, H. Ko, P. Barthó, T. Moore, S. B. Hofer, T. D. Mrsic-Flogel, M. Carandini, et al., “Diverse coupling of neurons to populations in sensory cortex,” Nature, vol. 521, no. 7553, pp. 511–515, 2015. [19] A. Mnih and D. J. Rezende, “Variational inference for Monte Carlo objectives,” ICML, 2016. [20] C. J. Maddison, A. Mnih, and Y. W. Teh, “The concrete distribution: A continuous relaxation of discrete random variables,” arXiv preprint arXiv:1611.00712, 2016. [21] E. Jang, S. Gu, and B. Poole, “Categorical reparameterization with Gumbel-Softmax,” arXiv preprint arXiv:1611.01144, 2016. 10
2017
657
7,182
Universal consistency and minimax rates for online Mondrian Forests Jaouad Mourtada Centre de Mathématiques Appliquées École Polytechnique, Palaiseau, France jaouad.mourtada@polytechnique.edu Stéphane Gaïffas Centre de Mathématiques Appliquées École Polytechnique,Palaiseau, France stéphane.gaiffas@polytechnique.edu Erwan Scornet Centre de Mathématiques Appliquées École Polytechnique,Palaiseau, France erwan.scornet@polytechnique.edu Abstract We establish the consistency of an algorithm of Mondrian Forests [LRT14, LRT16], a randomized classification algorithm that can be implemented online. First, we amend the original Mondrian Forest algorithm proposed in [LRT14], that considers a fixed lifetime parameter. Indeed, the fact that this parameter is fixed hinders the statistical consistency of the original procedure. Our modified Mondrian Forest algorithm grows trees with increasing lifetime parameters λn, and uses an alternative updating rule, allowing to work also in an online fashion. Second, we provide a theoretical analysis establishing simple conditions for consistency. Our theoretical analysis also exhibits a surprising fact: our algorithm achieves the minimax rate (optimal rate) for the estimation of a Lipschitz regression function, which is a strong extension of previous results [AG14] to an arbitrary dimension. 1 Introduction Random Forests (RF) are state-of-the-art classification and regression algorithms that proceed by averaging the forecasts of a number of randomized decision trees grown in parallel (see [Bre01, Bre04, GEW06, BDL08, Bia12, BS16, DMdF14, SBV15]). Despite their widespread use and remarkable success in practical applications, the theoretical properties of such algorithms are still not fully understood [Bia12, DMdF14]. Among these methods, purely random forests [Bre00, BDL08, Gen12, AG14] that grow the individual trees independently of the sample, are particularly amenable to theoretical analysis; the consistency of such classifiers was obtained in [BDL08]. An important limitation of the most commonly used random forests algorithms, such as Breiman’s Random Forest [Bre01] and the Extra-Trees algorithm [GEW06], is that they are typically trained in a batch manner, using the whole dataset to build the trees. In order to enable their use in situations when large amounts of data have to be incorporated in a streaming fashion, several online adaptations of the decision trees and RF algorithms have been proposed [DH00, TGP11, SLS+09, DMdF13]. Of particular interest in this article is the Mondrian Forest algorithm, an efficient and accurate online random forest classifier [LRT14]. This algorithm is based on the Mondrian process [RT09, Roy11], a natural probability distribution on the set of recursive partitions of the unit cube [0, 1]d. An appealing property of Mondrian processes is that they can be updated in an online fashion: in [LRT14], the use of the conditional Mondrian process enabled to design an online algorithm that matched its batch counterpart. While Mondrian Forest offer several advantages, both computational and in terms of 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. predictive performance, the algorithm proposed in [LRT14] depends on a fixed lifetime parameter λ that guides the complexity of the trees. Since this parameter has to be set in advance, the resulting algorithm is inconsistent, as the complexity of the randomized trees remains bounded. Furthermore, an analysis of the learning properties of Mondrian Forest – and in particular of the influence and proper theoretical tuning of the lifetime parameter λ – is still lacking. In this paper, we propose a modified online random forest algorithm based on Mondrian processes. Our algorithm retains the crucial property of the original method [LRT14] that the decision trees can be updated incrementally. However, contrary to the original approach, our algorithm uses an increasing sequence of lifetime parameters (λn)n⩾1, so that the corresponding trees are increasingly complex, and involves an alternative online updating algorithm. We study such classification rules theoretically, establishing simple conditions on the sequence (λn)n⩾1 to achieve consistency, see Theorem 1 from Section 5 below. In fact, Mondrian Forests achieve much more than what they were designed for: while they were primarily introduced to derive an online algorithm, we show in Theorem 2 (Section 6) that they actually achieve minimax convergence rates for Lipschitz conditional probability (or regression) functions in arbitrary dimension. To the best of our knowledge, such results have only been proved for very specific purely random forests, where the covariate dimension is equal to one. Related work. While random forests were introduced in the early 2000s [Bre01], as noted by [DMdF14] the theoretical analysis of these methods is outpaced by their practical use. The consistency of various simplified random forests algorithms is first established in [BDL08], as a byproduct of the consistency of individual tree classifiers. A recent line of research [Bia12, DMdF14, SBV15] has sought to obtain theoretical guarantees (i.e. consistency) for random forests variants that more closely resembled the algorithms used in practice. Another aspect of the theoretical study of random forests is the bias-variance analysis of simplified versions of random forests [Gen12, AG14], such as the purely random forests (PRF) model that performs splits independently of the data. In particular, [Gen12] shows that some PRF variants achieve the minimax rate for the estimation of a Lipschitz regression functions in dimension 1. Additionally, the bias-variance analysis is extended in [AG14], showing that PRF can also achieve minimax rates for C2 regression functions in dimension one, and considering higher dimensional models of PRF that achieve suboptimal rates. Starting with [SLS+09], online variants of the random forests algorithm have been considered. In [DMdF13], the authors propose an online random forest algorithm and prove its consistency. The procedure relies on a partitioning of the data into two streams: a structure stream (used to grow the tree structure) and an estimation stream (used to compute the prediction in each leaf). This separation of the data into separate streams is a way of simplifying the proof of consistency, but leads to a non-realistic setting in practice. A major development in the design of online random forests is the introduction of the Mondrian Forest (MF) classifier [LRT14, LRT16]. This algorithm makes an elegant use of the Mondrian Process, introduced in [RT09], see also [Roy11, OR15], to draw random trees. Indeed, this process provides a very convenient probability distribution over the set of recursive, tree-based partitions of the hypercube. In [BLG+16], the links between the Mondrian process and the Laplace kernel are used to design random features in order to efficiently approximate kernel ridge regression, leading to the so-called Mondrian kernel algorithm. Our approach differs from the original Mondrian Forest algorithm [LRT14], since it introduces a “dual” construction, that works in the “time” domain (lifetime parameters) instead of the “space” domain (features range). Indeed, in [LRT14], the splits are selected using a Mondrian process on the range of previously observed features vectors, and the online updating of the trees is enabled by the possibility of extending a Mondrian process to a larger cell using conditional Mondrian processes. Our algorithm incrementally grows the trees by extending the lifetime; the online update of the trees exploits the Markov property of the Mondrian process, a consequence of its formulation in terms of competing exponential clocks. 2 Setting and notation We first explain the considered setting allowing to state consistency of our procedure, and we describe and set notation for the main concepts used in the paper, namely trees, forests and partitions. 2 Considered setting. Assume we are given an i.i.d. sequence (X1, Y1), (X2, Y2) . . . of [0, 1]d × {0, 1}-valued random variables that come sequentially, such that each (Xi, Yi) has the same distribution as (X, Y ). This unknown distribution is characterized by the distribution µ of X on [0, 1]d and the conditional probability η(x) = P(Y = 1 | X = x). At each time step n ⩾1, we want to output a 0-1-valued randomized classification rule gn(·, Z, Dn) : [0, 1]d →{0, 1}, where Dn = (X1, Y1), . . . , (Xn, Yn)  and Z is a random variable that accounts for the randomization procedure; to simplify notation, we will generally denote bgn(x, Z) = gn(x, Z, Dn). The quality of a randomized classifier gn is measured by its probability of error L(gn) = P(gn(X, Z, Dn) ̸= Y | Dn) = P(X,Y ),Z(gn(X, Z, Dn) ̸= Y ) (1) where P(X,Y ),Z denotes the integration with respect to (X, Y ), Z alone. The quantity of Equation (1) is minimized by the Bayes classifier g∗(x) = 1{η(x)> 1 2 }, and its loss, the Bayes error, is denoted L∗= L(g∗). We say that a sequence of classification rules (gn)n⩾1 is consistent whenever L(gn) → L∗in probability as n →∞. Remark 1. We restrict ourselves to binary classification, note however that our results and proofs can be extended to multi-class classification. Trees and Forests. The classification rules (gn)n⩾1 we consider take the form of a random forest, defined by averaging randomized tree classifiers. More precisely, let K ⩾1 be a fixed number of randomized classifiers bgn(x, Z1), . . . , bgn(x, ZK) associated to the same randomized mechanism, where the Zk are i.i.d. Set Z(K) = (Z1, . . . , ZK). The averaging classifier bg(K) n (x, Z(K)) is defined by taking the majority vote among the values gn(x, Zk), k = 1, . . . , K. Our individual randomized classifiers are decision trees. A decision tree (T, Σ) is composed of the following components: • A finite rooted ordered binary tree T, with nodes N(T), interior nodes N ◦(T) and leaves L(T) (so that N(T) is the disjoint union of N ◦(T) and L(T)). Each interior node η has a left child left(η) and a right child right(η); • A family of splits Σ = (ση)η∈N ◦(T ) at each interior node, where each split ση = (dη, νη) is characterized by its split dimension dη ∈{1, . . . , d} and its threshold νη. Each randomized classifier bgn(x, Zk) relies on a decision tree T, the random variable Zk is the random sampling of the splits (ση) defining T. This sampling mechanism, based on the Mondrian process, is defined in Section 3. We associate to M = (T, Σ) a partition (Aφ)φ∈L(T ) of the unit cube [0, 1]d, called a tree partition (or guillotine partition). For each node η ∈N(T), we define a hyper-rectangular region Aη recursively: • The cell associated to the root of T is [0, 1]d; • For each η ∈N ◦(T), we define Aleft(η) := {x ∈Aη : xdη ⩽νη} and Aright(η) := Aη \ Aleft(η). The leaf cells (Aφ)φ∈L(T ) form a partition of [0, 1]d by construction. In the sequel, we will identify a tree with splits (T, Σ) with the associated tree partition M(T, Σ), and a node η ∈N(T) with the cell Aη ⊂[0, 1]d. The decision tree classifier outputs a constant prediction of the label in each leaf cell Aη using a simple majority vote of the labels Yi (1 ⩽i ⩽n) such that Xi ∈Aη. 3 A new online Mondrian Forest algorithm We describe the Mondrian Process in Section 3.1, and recall the original Mondrian Forest procedure in Section 3.2. Our procedure is introduced in Section 3.3. 3.1 The Mondrian process The probability distribution we consider on tree-based partitions of the unit cube [0, 1]d is the Mondrian process, introduced in [RT09]. Given a rectangular box C = Qd j=1[aj, bj], we denote 3 |C| := Pd j=1(bj−aj) its linear dimension. The Mondrian process distribution MP(λ, C) is the distribution of the random tree partition of C obtained by the sampling procedure SampleMondrian(λ, C) from Algorithm 1. Algorithm 1 SampleMondrian(λ, C) ; Samples a tree partition distributed as MP(λ, C). 1: Parameters: A rectangular box C ⊂Rd and a lifetime parameter λ > 0. 2: Call SplitCell(C, τC := 0, λ). Algorithm 2 SplitCell(A, τ, λ) ; Recursively split a cell A, starting from time τ, until λ 1: Parameters: A cell A = Q 1⩽j⩽d[aj, bj], a starting time τ and a lifetime parameter λ. 2: Sample an exponential random variable EA with intensity |A|. 3: if τ + EA ⩽λ then 4: Draw at random a split dimension J ∈{1, . . . , d}, with P(J = j) = (bj −aj)/|A|, and a split threshold νJ uniformly in [aJ, bJ]. 5: Split A along the split (J, νJ). 6: Call SplitCell(left(A), τ + EA, λ) and SplitCell(right(A), τ + EA, λ). 7: else 8: Do nothing. 9: end if 3.2 Online tree growing: the original scheme In order to implement an online algorithm, it is crucial to be able to “update” the tree partitions grown at a given time step. The approach of the original Mondrian Forest algorithm [LRT14] uses a slightly different randomization mechanism, namely a Mondrian process supported in the range defined by the past feature points. More precisely, this modification amounts to replacing each call to SplitCell(A, τ, λ) by a call to SplitCell(Arange(n), τ, λ), where Arange(n) is the range of the feature points X1, . . . , Xn that fall in A (i.e. the smallest box that contains them). When a new training point (Xn+1, Yn+1) arrives, the ranges of the training points may change. The online update of the tree partition then relies on the extension properties of the Mondrian process: given a Mondrian partition M1 ∼MP(λ, C1) on a box C1, it is possible to efficiently sample a Mondrian partition M0 ∼MP(λ, C0) on a larger box C0 ⊃C1 that restricts to M1 on the cell C1 (this is called a “conditional Mondrian”, see [RT09]). Remark 2. In [LRT14] a lifetime parameter λ = ∞is actually used in experiments, which essentially amounts to growing the trees completely, until the leaves are homogeneous. We will not analyze this variant here, but this illustrates the problem of using a fixed, finite budget λ in advance. 3.3 Online tree growing: a dual approach An important limitation of the original scheme is the fact that it requires to fix the lifetime parameter λ in advance. In order to obtain a consistent algorithm, it is required to grow increasingly complex trees. To achieve this, we propose to adopt a “dual” point of view: instead of using a Mondrian process with fixed lifetime on a domain that changes as new data points are added, we use a Mondrian process on a fixed domain (the cube [0, 1]d) but with a varying lifetime λn that grows with the sample size n. The rationale is that, as more data becomes available, the classifiers should be more complex and precise. Since the lifetime, rather than the domain, is the parameter that guides the complexity of the trees, it should be this parameter that dynamically adapts to the amount of training data. It turns out that in this approach, quite surprisingly, the trees can be updated incrementally, leading to an online algorithm. The ability to extend a tree partition Mλn ∼MP(λn, [0, 1]d) into a finer tree partition Mλn+1 ∼MP(λn+1, [0, 1]d) relies on a different property of the Mondrian process, namely the fact that for λ < λ′, it is possible to efficiently sample a Mondrian tree partition Mλ′ ∼MP(λ′, C) given its pruning Mλ ∼MP(λ, C) at time λ (obtained by dropping all splits of Mλ′ performed at a time τ > λ). The procedure ExtendMondrian(Mλ, λ, λ′) from Algorithm 3 extends a Mondrian tree partition Mλ ∼MP(λ, C) to a tree partition Mλ′ ∼MP(λ′, C). Indeed, for each leaf cell A of Mλ, the fact 4 Algorithm 3 ExtendMondrian(Mλ, λ, λ′) ; Extend Mλ ∼MP(λ, C) to Mλ′ ∼MP(λ′, C) 1: Parameters: A tree partition Mλ, and lifetimes λ ⩽λ′. 2: for A in L(Mλ) do 3: Call SplitCell(A, λ, λ′) 4: end for that A is a leaf of Mλ means that during the sampling of Mλ, the time of the next candidate split τ + EA (where τ is the time A was formed and EA ∼Exp(|A|)) was strictly larger than λ. Now in the procedure ExtendMondrian(Mλ, λ, λ′), the time of the next candidate split is λ + E′ A, where E′ A ∼Exp(|A|). This is precisely the where the trick resides: by the memory-less property of the exponential distribution, the distribution of τA + EA conditionally on EA > λ −τA is the same as that of λ + E′ A. The procedure ExtendMondrian can be replaced by the following more efficient implementation: • Time of the next split of the tree is sampled as λ+EMλ with EMλ ∼Exp(P φ∈L(Mλ) |Aφ|); • Leaf to split is chosen using a top-down path from the root of the tree, where the choice between left or right child for each interior node is sampled at random, proportionally to the linear dimension of all the leaves in the subtree defined by the child. Remark 3. While we consider Mondrian partitions on the fixed domain [0, 1]d, our increasing lifetime trick can be used in conjunction with a varying domain based on the range of the data (as in the original MF algorithm), simply by applying ExtendMondrian(Mλn, λn, λn+1) after having extended the Mondrian to the new range. In order to keep the analysis tractable and avoid unnecessary complications in the analysis, we will study the procedure on a fixed domain only. Given an increasing sequence (λn)n⩾1 of lifetime parameters, our modified MF algorithm incrementally updates the trees M (k) λ for k = 1, . . . , K by calling ExtendMondrian(M (k) λn , λn, λn+1), and combines the forecasts of the given trees, as explained in Algorithm 4. Algorithm 4 MondrianForest(K, (λn)n⩾1) ; Trains a Mondrian Forest classifier. 1: Parameters: The number of trees K and the lifetime sequence (λn)n⩾1. 2: Initialization: Start with K trivial partitions M (k) λ0 , λ0 := 0, k = 1, . . . , K. Set the counts of the training labels in each cell to 0, and the labels e.g. to 0. 3: for n = 1, 2, . . . do 4: Receive the training point (Xn, Yn). 5: for k = 1, . . . , K do 6: Update the counts of 0 and 1 (depending on Yn) in the leaf cell of Xn in Mλn. 7: Call ExtendMondrian(M (k) λn−1, λn−1, λn). 8: Fit the newly created leaves. 9: end for 10: end for For the prediction of the label given a new feature vector, our algorithm uses a majority vote over the predictions given by all K trees. However, other choices are possible. For instance, the original Mondrian Forest algorithm [LRT14] places a hierarchical Bayesian prior over the label distribution on each node of the tree, and performs approximate posterior inference using the socalled interpolated Kneser-Ney (IKN) smoothing. Another possibility, that will be developed in an extended version of this work, is tree expert aggregation methods, such as the Context-Tree Weighting (CTW) algorithm [WST95, HS97] or specialist aggregation methods [FSSW97] over the nodes of the tree, adapting them to increasingly complex trees. Our modification of the original Mondrian Forest replaces the process of online tree growing with a fixed lifetime by a new process, that allows to increase lifetimes. This modification not only allows to prove consistency, but more surprisingly leads to an optimal estimation procedure, in terms of minimax rates, as illustrated in Sections 5 and 6 below. 5 4 Mondrian Forest with fixed lifetime are inconsistent We state in Proposition 1 the inconsistency of fixed-lifetime Mondrian Forests, such as the original algorithm [LRT14]. This negative result justifies our modified algorithm based on an increasing sequence of lifetimes (λn)n⩾1. Proposition 1. The Mondrian Forest algorithm (Algorithm 4) with a fixed lifetime sequence λn = λ is inconsistent: there exists a distribution of (X, Y ) ∈[0, 1] × {0, 1} such that L∗= 0 and L(gn) = P(gn(X) ̸= Y ) does not tend to 0. This result also holds true for the original Mondrian Forest algorithm with lifetime λ. Proposition 1 is established in Appendix C. The proof uses a result of independent interest (Lemma 3), which states that asymptotically over the sample size, for fixed λ, the restricted domain does not affect the randomization procedure. 5 Consistency of Mondrian Forest with lifetime sequence (λn) The consistency of the Mondrian Forest used with a properly tuned sequence (λn) is established in Theorem 1 below. Theorem 1. Assume that λn →∞and that λd n/n →0. Then, the online Mondrian Forest described in Algorithm 4 is consistent. This consistency result is universal, in the sense that it makes no assumption on the distribution of X nor on the conditional probability η. This contrasts with some consistency results on Random forests, such as Theorem 1 of [DMdF13], which assumes that the density of X is bounded by above and below. Theorem 1 does not require an assumption on K (number of trees). It is well-known for batch Random Forests that this meta-parameter is not a sensitive tuning parameter, and that it suffices to choose it large enough to obtain good accuracy. The only important parameter is the sequence (λn), that encodes the complexity of the trees. Requiring an assumption on this meta-parameter is natural, and confirmed by the well-known fact that the tree-depth is the most important tuning parameter for batch Random Forests, see for instance [BS16]. The proof of Theorem 1 can be found in the supplementary material (see Appendix D). The core of the argument lies in two lemmas describing two novel properties of Mondrian trees. Lemma 1 below provides an upper bound of order O(λ−1) on the diameter of the cell Aλ(x) of a Mondrian partition Mλ ∼MP(λ, [0, 1]d). This is the key to control the bias of Mondrian Forests with lifetime sequence that tend to infinity. Lemma 1 (Cell diameter). Let x ∈[0, 1]d, and let Dλ(x) be the ℓ2-diameter of the cell containing x in a Mondrian partition Mλ ∼MP(λ, [0, 1]d). If λ →∞, then Dλ(x) →0 in probability. More precisely, for every δ, λ > 0, we have P(Dλ(x) ⩾δ) ⩽d  1 + λδ √ d  exp  −λδ √ d  (2) and E  Dλ(x)2 ⩽4d λ2 . (3) The proof of Lemma 1 is provided in the supplementary material (see Appendix A). The second important property needed to carry out the analysis is stated in Lemma 2 and helps to control the “variance” of Mondrian forests. It consists in an upper bound of order O(λd) on the total number of splits performed by a Mondrian partition Mλ ∼MP(λ, [0, 1]d). This ensures that enough data points fall in each cell of the tree, so that the labels of the tree are well estimated. The proof of Lemma 2 is to be found in the supplementary material (see Appendix B). Lemma 2 (Number of splits). If Kλ denotes the number of splits performed by a Mondrian tree partition Mλ ∼MP(λ, [0, 1]d), we have E(Kλ) ⩽(e(λ + 1))d. Remark 4. It is worth noting that controlling the total number of splits ensures that the cell Aλn(X) in which a new random X ∼µ ends up contains enough training points among X1, . . . , Xn 6 (see Lemma 4 in appendix D). This enables to get a distribution-free consistency result. Another approach consists in lower-bounding the volume Vλn(x) of Aλn(x) in probability for any x ∈[0, 1]d, which shows that the cell Aλn(x) contains enough training points, but this would require the extra assumption that the density of X is lower-bounded. Remarkably, owing to the nice restriction properties of the Mondrian process, Lemmas 1 and 2 essentially provide matching upper and lower bounds on the complexity of the partition. Indeed, in order to partition the cube [0, 1]d in cells of diameter O(1/λ), at least Θ(λd) cells are needed; Lemma 2 shows that the Mondrian partition in fact contains only O(λd) cells. 6 Minimax rates over the class of Lipschitz functions The estimates obtained in Lemmas 1 and 2 are quite explicit and sharp in their dependency on λ, and allow to study the convergence rate of our algorithm. Indeed, it turns out that our modified Mondrian Forest, when properly tuned, can achieve the minimax rate in classification over the class of Lipschitz functions (see e.g. Chapter I.3 in [Nem00] for details on minimax rates). We provide two results: a convergence rate for the estimation of the conditional probabilities, measured by the quadratic risk, see Theorem 2, and a control on the distance between the classification error of our classifier and the Bayes error, see Theorem 3. We provide also similar minimax bounds for the regression setting instead of the classification one in the supplementary material, see Proposition 4 in Appendix E. Let bηn be the estimate of the conditional probability η based on the Mondrian Forest (see Algorithm 4) in which: (i) Each leaf label is computed as the proportion of 1 in the corresponding leaf; (ii) Forest prediction results from the average of tree estimates instead of a majority vote. Theorem 2. Assume that the conditional probability function η : [0, 1]d →[0, 1] is Lipschitz on [0, 1]d. Let bηn be a Mondrian Forest as defined in Points (i) and (ii), with a lifetimes sequence that satisfies λn ≍n1/(d+2). Then, the following upper bound holds E(η(X) −bηn(X))2 = O(n−2/(d+2)) (4) for n large enough, which correspond to the minimax rate over the set of Lipschitz functions. To the best of our knowledge, Theorem 2 is the first to exhibit the fact that a classification method based on a purely random forest can be minimax optimal in an arbitrary dimension. The same kind of result is stated for regression estimation in the supplementary material (see Proposition 4 in Appendix E). Minimax rates, but only for d = 1, were obtained in [Gen12, AG14] for models of purely random forests such as Toy-PRF (where the individual partitions corresponded to randomly shifts of the regular partition of [0, 1] in k intervals) and PURF (Purely Uniformly Random Forests, where the partitions were obtained by drawing k random thresholds at random in [0, 1]). However, for d = 1, tree partitions reduce to partitions of [0, 1] in intervals, and do not possess the recursive structure that appears in higher dimensions and makes their precise analysis difficult. For this reason, the analysis of purely random forests for d > 1 has typically produced sub-optimal results: for example, [BDL08] show consistency for UBPRF (Unbalanced Purely Random Forests, that perform a fixed number of splits and randomly choose a leaf to split at each step), but with no rate of convergence. A further step was made by [AG14], who studied the BPRF (Balanced Purely Random Forests algorithm, where all leaves were split, so that the resulting tree was complete), and obtained suboptimal rates. In our approach, the convenient properties of the Mondrian process enable to bypass the inherent difficulties met in previous attempts, thanks to its recursive structure, and allow to obtain the minimax rate with transparent proof. Now, note that the Mondrian Forest classifier corresponds to the plugin classifier bgn(x) = 1{bηn(x)>1/2}, where bηn is defined in Points (i) and (ii). A general theorem (Theorem 6.5 in [DGL96]) allows us to derive upper bounds on the distance between the classification error of bgn and the Bayes error, thanks to Theorem 2. Theorem 3. Under the same assumptions as in Theorem 2, the Mondrian Forest classifier bgn with lifetime sequence λn ≍n1/(d+2) satisfies L(bgn) −L∗= o(n−1/(d+2)). (5) 7 The rate of convergence o(n−1/(d+2)) for the error probability with a Lipschitz conditional probability η turns out to be optimal, as shown by [Yan99]. Note that faster rates can be achieved in classification under low noise assumptions such as the margin assumption [MT99] (see e.g. [Tsy04, AT07, Lec07]). Such specializations of our results are to be considered in a future work, the aim of the present paper being an emphasis on the appealing optimal properties of our modified Mondrian Forest. 7 Experiments We now turn to the empirical evaluation of our algorithm, and examine its predictive performance (test error) as a function of the training size. More precisely, we compare the modified Mondrian Forest algorithm (Algorithm 4) to batch (Breiman RF [Bre01], Extra-Trees-1 [GEW06]) and online (the Mondrian Forest algorithm [LRT14] with fixed lifetime parameter λ) Random Forests algorithms. We compare the prediction accuracy (on the test set) of the aforementioned algorithms trained on varying fractions of the training data from 10% to 100%. Regarding our choice of competitors, we note that Breiman’s RF is well-established and known to achieve state-of-the-art performance. We also included the Extra-Trees-1 (ERT-1) algorithm [GEW06], which is most comparable to the Mondrian Forest classifier since it also draws splits randomly (we note that the ERT-k algorithm [GEW06] with the default tuning k = √ d in the scikit-learn implementation [PVG+11] achieves scores very close to those of Breiman’s RF). In the case of online Mondrian Forests, we included our modified Mondrian Forest classifier with an increasing lifetime parameter λn = n1/(d+2) tuned according to the theoretical analysis (see Theorem 3), as well as a Mondrian Forest classifier with constant lifetime parameter λ = 2. Note that while a higher choice of λ would have resulted in a performance closer to that of the modified version (with increasing λn), our inconsistency result (Proposition 1) shows that its error would eventually stagnate given more training samples. In both cases, the splits are drawn within the range of the training feature, as in the original Mondrian Forest algorithm. Our results are reported in Figure 1. 0.2 0.4 0.6 0.8 1.0 0.65 0.70 0.75 0.80 0.85 0.90 letter Breiman_RF Extra_Trees_1 Mondrian_increasing Mondrian_fixed 0.2 0.4 0.6 0.8 1.0 0.74 0.76 0.78 0.80 0.82 0.84 0.86 0.88 satimage . 0.2 0.4 0.6 0.8 1.0 0.750 0.775 0.800 0.825 0.850 0.875 0.900 usps 0.2 0.4 0.6 0.8 1.0 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 dna Figure 1: Prediction accuracy as a function of the fraction of data used on several datasets. Modified MF (Algorithm 4) outperforms MF with a constant lifetime, and is better than the batch ERT-1 algorithm. It also performs almost as well as Breiman’s RF (a batch algorithm that uses the whole training dataset in order to choose each split) on several datasets, while being incremental and much faster to train. On the dna dataset, as noted in [LRT14], Breiman’s RF outperforms the other algorithms because of the presence of a large number of irrelevant features. 8 8 Conclusion and future work Despite their widespread use in practice, the theoretical understanding of Random Forests is still incomplete. In this work, we show that amending the Mondrian Forest classifier, originally introduced to provide an efficient online algorithm, leads to an algorithm that is not only consistent, but in fact minimax optimal for Lipschitz conditional probabilities in arbitrary dimension. This new result suggests promising improvements in the understanding of random forests methods. A first, natural extension of our results, that will be addressed in a future work, is the study of the rates for smoother regression functions. Indeed, we conjecture that through a more refined study of the local properties of the Mondrian partitions, it is possible to describe exactly the distribution of the cell of a given point. In the spirit of the work of [AG14] in dimension one, this could be used to show improved rates for the bias of forests (e.g. for C2 regression functions) compared to the tree bias, and hence give some theoretical insight to the empirically well-known fact that a forest performs better than individual trees. Second, the optimal upper bound O(n−1/(d+2)) obtained in this paper is very slow when the number of features d is large. This comes from the well-known curse of dimensionality phenomenon, a problem affecting all fully nonparametric algorithms. A standard technique used in high-dimensional settings is to work under a sparsity assumption, where only s ≪d features are informative (i.e. affect the distribution of Y ). In such settings, a natural strategy is to select the splits using the labels Y1, . . . , Yn, as most variants of Random Forests used in practice do. For example, it would be interesting to combine a Mondrian process-based randomization with a choice of the best split among several candidates, as performed by the Extra-Tree algorithm [GEW06]. Since the Mondrian Forest guarantees minimax rates, we conjecture that it should improve feature selection of batch random forest methods, and improve the underlying randomization mechanism of these algorithms. From a theoretical perspective, it could be interesting to see how the minimax rates obtained here could be coupled with results on the ability of forests to select informative variables, see for instance [SBV15]. References [AG14] Sylvain Arlot and Robin Genuer. Analysis of purely random forests bias. arXiv preprint arXiv:1407.3939, 2014. [AT07] Jean-Yves Audibert and Alexandre B. Tsybakov. Fast learning rates for plug-in classifiers. The Annals of Statistics, 35(2):608–633, 2007. [BDL08] Gérard Biau, Luc Devroye, and Gábor Lugosi. Consistency of random forests and other averaging classifiers. Journal of Machine Learning Research, 9:2015–2033, 2008. [Bia12] Gérard Biau. Analysis of a random forests model. Journal of Machine Learning Research, 13(1):1063–1095, 2012. [BLG+16] Matej Balog, Balaji Lakshminarayanan, Zoubin Ghahramani, Daniel M. Roy, and Yee W. Teh. The Mondrian kernel. In 32nd Conference on Uncertainty in Artificial Intelligence (UAI), 2016. [Bre00] Leo Breiman. Some infinity theory for predictor ensembles. Technical Report 577, Statistics departement, University of California Berkeley, 2000. [Bre01] Leo Breiman. Random forests. Machine Learning, 45(1):5–32, 2001. [Bre04] Leo Breiman. Consistency for a simple model of random forests. Technical Report 670, Statistics departement, University of California Berkeley, 2004. [BS16] Gérard Biau and Erwan Scornet. A random forest guided tour. TEST, 25(2):197–227, 2016. [DGL96] Luc Devroye, László Györfi, and Gábor Lugosi. A Probabilistic Theory of Pattern Recognition, volume 31 of Applications of Mathematics. Springer-Verlag, 1996. [DH00] Pedro Domingos and Geoff Hulten. Mining high-speed data streams. In Proceedings of the 6th SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 71–80, 2000. [DMdF13] Misha Denil, David Matheson, and Nando de Freitas. Consistency of online random forests. In Proceedings of the 30th Annual International Conference on Machine Learning (ICML), pages 1256–1264, 2013. 9 [DMdF14] Misha Denil, David Matheson, and Nando de Freitas. Narrowing the gap: Random forests in theory and in practice. In Proceedings of the 31st Annual International Conference on Machine Learning (ICML), pages 665–673, 2014. [FSSW97] Yoav Freund, Robert E. Schapire, Yoram Singer, and Manfred K. Warmuth. Using and combining predictors that specialize. In Proceedings of the 29th Annual ACM Symposium on Theory of Computing, pages 334–343, 1997. [Gen12] Robin Genuer. Variance reduction in purely random forests. Journal of Nonparametric Statistics, 24(3):543–562, 2012. [GEW06] Pierre Geurts, Damien Ernst, and Louis Wehenkel. Extremely randomized trees. Machine learning, 63(1):3–42, 2006. [HS97] David P. Helmbold and Robert E. Schapire. Predicting nearly as well as the best pruning of a decision tree. Machine Learning, 27(1):51–68, 1997. [Lec07] Guillaume Lecué. Optimal rates of aggregation in classification under low noise assumption. Bernoulli, 13(4):1000–1022, 2007. [LRT14] Balaji Lakshminarayanan, Daniel M. Roy, and Yee W. Teh. Mondrian forests: Efficient online random forests. In Advances in Neural Information Processing Systems 27, pages 3140–3148. Curran Associates, Inc., 2014. [LRT16] Balaji Lakshminarayanan, Daniel M. Roy, and Yee W. Teh. Mondrian forests for large-scale regression when uncertainty matters. In Proceedings of the 19th International Workshop on Artificial Intelligence and Statistics (AISTATS), 2016. [MT99] Enno Mammen and Alexandre B. Tsybakov. Smooth discrimination analysis. The Annals of Statistics, 27(6):1808–1829, 1999. [Nem00] Arkadi Nemirovski. Topics in non-parametric statistics. Lectures on Probability Theory and Statistics: Ecole d’Ete de Probabilites de Saint-Flour XXVIII-1998, 28:85–277, 2000. [OR15] Peter Orbanz and Daniel M. Roy. Bayesian models of graphs, arrays and other exchangeable random structures. IEEE transactions on pattern analysis and machine intelligence, 37(2):437–461, 2015. [PVG+11] Fabian Pedregosa, Gaël Varoquaux, Alexandre Gramfort, Vincent Michel, Bertrand Thirion, Olivier Grisel, Mathieu Blondel, Peter Prettenhofer, Ron Weiss, Vincent Dubourg, Jake Vanderplas, Alexandre Passos, David Cournapeau, Matthieu Brucher, Matthieu Perrot, and Édouard Duchesnay. Scikitlearn: Machine learning in Python. Journal of Machine Learning Research, 12:2825–2830, 2011. [Roy11] Daniel M. Roy. Computability, inference and modeling in probabilistic programming. PhD thesis, Massachusetts Institute of Technology, 2011. [RT09] Daniel M. Roy and Yee W. Teh. The Mondrian process. In Advances in Neural Information Processing Systems 21, pages 1377–1384. Curran Associates, Inc., 2009. [SBV15] Erwan Scornet, Gérard Biau, and Jean-Philippe Vert. Consistency of random forests. The Annals of Statistics, 43(4):1716–1741, 2015. [SLS+09] Amir Saffari, Christian Leistner, Jacob Santner, Martin Godec, and Horst Bischof. On-line random forests. In 3rd IEEE ICCV Workshop on On-line Computer Vision, 2009. [TGP11] Matthew A. Taddy, Robert B. Gramacy, and Nicholas G. Polson. Dynamic trees for learning and design. Journal of the American Statistical Association, 106(493):109–123, 2011. [Tsy04] Alexandre B. Tsybakov. Optimal aggregation of classifiers in statistical learning. Annals of Statistics, 32(1):135–166, 2004. [WST95] Frans M. J. Willems, Yuri M. Shtarkov, and Tjalling J. Tjalkens. The context-tree weighting method: Basic properties. IEEE Transactions on Information Theory, 41(3):653–664, 1995. [Yan99] Yuhong Yang. Minimax nonparametric classification. I. Rates of convergence. IEEE Transactions on Information Theory, 45(7):2271–2284, 1999. 10
2017
658
7,183
Gradient Episodic Memory for Continual Learning David Lopez-Paz and Marc’Aurelio Ranzato Facebook Artificial Intelligence Research {dlp,ranzato}@fb.com Abstract One major obstacle towards AI is the poor ability of models to solve new problems quicker, and without forgetting previously acquired knowledge. To better understand this issue, we study the problem of continual learning, where the model observes, once and one by one, examples concerning a sequence of tasks. First, we propose a set of metrics to evaluate models learning over a continuum of data. These metrics characterize models not only by their test accuracy, but also in terms of their ability to transfer knowledge across tasks. Second, we propose a model for continual learning, called Gradient Episodic Memory (GEM) that alleviates forgetting, while allowing beneficial transfer of knowledge to previous tasks. Our experiments on variants of the MNIST and CIFAR-100 datasets demonstrate the strong performance of GEM when compared to the state-of-the-art. 1 Introduction The starting point in supervised learning is to collect a training set Dtr = {(xi, yi)}n i=1, where each example (xi, yi) is composed by a feature vector xi ∈X, and a target vector yi ∈Y. Most supervised learning methods assume that each example (xi, yi) is an identically and independently distributed (iid) sample from a fixed probability distribution P, which describes a single learning task. The goal of supervised learning is to construct a model f : X →Y, used to predict the target vectors y associated to unseen feature vectors x, where (x, y) ∼P. To accomplish this, supervised learning methods often employ the Empirical Risk Minimization (ERM) principle [Vapnik, 1998], where f is found by minimizing 1 |Dtr| P (xi,yi)∈Dtr ℓ(f(xi), yi), where ℓ: Y × Y →[0, ∞) is a loss function penalizing prediction errors. In practice, ERM often requires multiple passes over the training set. ERM is a major simplification from what we deem as human learning. In stark contrast to learning machines, learning humans observe data as an ordered sequence, seldom observe the same example twice, they can only memorize a few pieces of data, and the sequence of examples concerns different learning tasks. Therefore, the iid assumption, along with any hope of employing the ERM principle, fall apart. In fact, straightforward applications of ERM lead to “catastrophic forgetting” [McCloskey and Cohen, 1989]. That is, the learner forgets how to solve past tasks after it is exposed to new tasks. This paper narrows the gap between ERM and the more human-like learning description above. In particular, our learning machine will observe, example by example, the continuum of data (x1, t1, y1), . . . , (xi, ti, yi), . . . , (xn, tn, yn), (1) where besides input and target vectors, the learner observes ti ∈T , a task descriptor identifying the task associated to the pair (xi, yi) ∼Pti. Importantly, examples are not drawn iid from a fixed probability distribution over triplets (x, t, y), since a whole sequence of examples from the current task may be observed before switching to the next task. The goal of continual learning is to construct a model f : X × T able to predict the target y associated to a test pair (x, t), where (x, y) ∼Pt. In this setting, we face challenges unknown to ERM: 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. 1. Non-iid input data: the continuum of data is not iid with respect to any fixed probability distribution P(X, T, Y ) since, once tasks switch, a whole sequence of examples from the new task may be observed. 2. Catastrophic forgetting: learning new tasks may hurt the performance of the learner at previously solved tasks. 3. Transfer learning: when the tasks in the continuum are related, there exists an opportunity for transfer learning. This would translate into faster learning of new tasks, as well as performance improvements in old tasks. The rest of this paper is organized as follows. In Section 2, we formalize the problem of continual learning, and introduce a set of metrics to evaluate learners in this scenario. In Section 3, we propose GEM, a model to learn over continuums of data that alleviates forgetting, while transferring beneficial knowledge to past tasks. In Section 4, we compare the performance of GEM to the state-of-the-art. Finally, we conclude by reviewing the related literature in Section 5, and offer some directions for future research in Section 6. Our source code is available at https://github.com/ facebookresearch/GradientEpisodicMemory. 2 A Framework for Continual Learning We focus on the continuum of data of (1), where each triplet (xi, ti, yi) is formed by a feature vector xi ∈Xti, a task descriptor ti ∈T , and a target vector yi ∈Yti. For simplicity, we assume that the continuum is locally iid, that is, every triplet (xi, ti, yi) satisfies (xi, yi) iid ∼Pti(X, Y ). While observing the data (1) example by example, our goal is to learn a predictor f : X × T →Y, which can be queried at any time to predict the target vector y associated to a test pair (x, t), where (x, y) ∼Pt. Such test pair can belong to a task that we have observed in the past, the current task, or a task that we will experience (or not) in the future. Task descriptors An important component in our framework is the collection of task descriptors t1, . . . , tn ∈T . In the simplest case, the task descriptors are integers ti = i ∈Z enumerating the different tasks appearing in the continuum of data. More generally, task descriptors ti could be structured objects, such as a paragraph of natural language explaining how to solve the i-th task. Rich task descriptors offer an opportunity for zero-shot learning, since the relation between tasks could be inferred using new task descriptors alone. Furthermore, task descriptors disambiguate similar learning tasks. In particular, the same input xi could appear in two different tasks, but require different targets. Task descriptors can reference the existence of multiple learning environments, or provide additional (possibly hierarchical) contextual information about each of the examples. However, in this paper we focus on alleviating catastrophic forgetting when learning from a continuum of data, and leave zero-shot learning for future research. Next, we discuss the training protocol and evaluation metrics for continual learning. Training Protocol and Evaluation Metrics Most of the literature about learning over a sequence of tasks [Rusu et al., 2016, Fernando et al., 2017, Kirkpatrick et al., 2017, Rebuffiet al., 2017] describes a setting where i) the number of tasks is small, ii) the number of examples per task is large, iii) the learner performs several passes over the examples concerning each task, and iv) the only metric reported is the average performance across all tasks. In contrast, we are interested in the “more human-like” setting where i) the number of tasks is large, ii) the number of training examples per task is small, iii) the learner observes the examples concerning each task only once, and iv) we report metrics that measure both transfer and forgetting. Therefore, at training time we provide the learner with only one example at the time (or a small mini-batch), in the form of a triplet (xi, ti, yi). The learner never experiences the same example twice, and tasks are streamed in sequence. We do not need to impose any order on the tasks, since a future task may coincide with a past task. Besides monitoring its performance across tasks, it is also important to assess the ability of the learner to transfer knowledge. More specifically, we would like to measure: 2 1. Backward transfer (BWT), which is the influence that learning a task t has on the performance on a previous task k ≺t. On the one hand, there exists positive backward transfer when learning about some task t increases the performance on some preceding task k. On the other hand, there exists negative backward transfer when learning about some task t decreases the performance on some preceding task k. Large negative backward transfer is also known as (catastrophic) forgetting. 2. Forward transfer (FWT), which is the influence that learning a task t has on the performance on a future task k ≻t. In particular, positive forward transfer is possible when the model is able to perform “zero-shot” learning, perhaps by exploiting the structure available in the task descriptors. For a principled evaluation, we consider access to a test set for each of the T tasks. After the model finishes learning about the task ti, we evaluate its test performance on all T tasks. By doing so, we construct the matrix R ∈RT ×T , where Ri,j is the test classification accuracy of the model on task tj after observing the last sample from task ti. Letting ¯b be the vector of test accuracies for each task at random initialization, we define three metrics: Average Accuracy: ACC = 1 T T X i=1 RT,i (2) Backward Transfer: BWT = 1 T −1 T −1 X i=1 RT,i −Ri,i (3) Forward Transfer: FWT = 1 T −1 T X i=2 Ri−1,i −¯bi. (4) The larger these metrics, the better the model. If two models have similar ACC, the most preferable one is the one with larger BWT and FWT. Note that it is meaningless to discuss backward transfer for the first task, or forward transfer for the last task. For a fine-grained evaluation that accounts for learning speed, one can build a matrix R with more rows than tasks, by evaluating more often. In the extreme case, the number of rows could equal the number of continuum samples n. Then, the number Ri,j is the test accuracy on task tj after observing the i-th example in the continuum. Plotting each column of R results into a learning curve. 3 Gradient of Episodic Memory (GEM) In this section, we propose Gradient Episodic Memory (GEM), a model for continual learning, as introduced in Section 2. The main feature of GEM is an episodic memory Mt, which stores a subset of the observed examples from task t. For simplicity, we assume integer task descriptors, and use them to index the episodic memory. When using integer task descriptors, one cannot expect significant positive forward transfer (zero-shot learning). Instead, we focus on minimizing negative backward transfer (catastrophic forgetting) by the efficient use of episodic memory. In practice, the learner has a total budget of M memory locations. If the number of total tasks T is known, we can allocate m = M/T memories for each task. Conversely, if the number of total tasks T is unknown, we can gradually reduce the value of m as we observe new tasks [Rebuffiet al., 2017]. For simplicity, we assume that the memory is populated with the last m examples from each task, although better memory update strategies could be employed (such as building a coreset per task). In the following, we consider predictors fθ parameterized by θ ∈Rp, and define the loss at the memories from the k-th task as ℓ(fθ, Mk) = 1 |Mk| X (xi,k,yi)∈Mk ℓ(fθ(xi, k), yi). (5) Obviously, minimizing the loss at the current example together with (5) results in overfitting to the examples stored in Mk. As an alternative, we could keep the predictions at past tasks invariant by means of distillation [Rebuffiet al., 2017]. However, this would deem positive backward transfer impossible. Instead, we will use the losses (5) as inequality constraints, avoiding their increase but 3 allowing their decrease. In contrast to the state-of-the-art [Kirkpatrick et al., 2017, Rebuffiet al., 2017], our model therefore allows positive backward transfer. More specifically, when observing the triplet (x, t, y), we solve the following problem: minimizeθ ℓ(fθ(x, t), y) subject to ℓ(fθ, Mk) ≤ℓ(f t−1 θ , Mk) for all k < t, (6) where f t−1 θ is the predictor state at the end of learning of task t −1. In the following, we make two key observations to solve (6) efficiently. First, it is unnecessary to store old predictors f t−1 θ , as long as we guarantee that the loss at previous tasks does not increase after each parameter update g. Second, assuming that the function is locally linear (as it happens around small optimization steps) and that the memory is representative of the examples from past tasks, we can diagnose increases in the loss of previous tasks by computing the angle between their loss gradient vector and the proposed update. Mathematically, we rephrase the constraints (6) as: ⟨g, gk⟩:= ∂ℓ(fθ(x, t), y) ∂θ , ∂ℓ(fθ, Mk) ∂θ  ≥0, for all k < t. (7) If all the inequality constraints (7) are satisfied, then the proposed parameter update g is unlikely to increase the loss at previous tasks. On the other hand, if one or more of the inequality constraints (7) are violated, then there is at least one previous task that would experience an increase in loss after the parameter update. If violations occur, we propose to project the proposed gradient g to the closest gradient ˜g (in squared ℓ2 norm) satisfying all the constraints (7). Therefore, we are interested in: minimize˜g 1 2 ∥g −˜g∥2 2 subject to ⟨˜g, gk⟩≥0 for all k < t. (8) To solve (8) efficiently, recall the primal of a Quadratic Program (QP) with inequality constraints: minimizez 1 2z⊤Cz + p⊤z subject to Az ≥b, (9) where C ∈Rp×p, p ∈Rp, A ∈R(t−1)×p, and b ∈Rt−1. The dual problem of (9) is: minimizeu,v 1 2u⊤Cu −b⊤v subject to A⊤v −Cu = p, v ≥0. (10) If (u⋆, v⋆) is a solution to (10), then there is a solution z⋆to (9) satisfying Cz⋆= Cu⋆[Dorn, 1960]. Quadratic programs are at the heart of support vector machines [Scholkopf and Smola, 2001]. With these notations in hand, we write the primal GEM QP (8) as: minimizez 1 2z⊤z −g⊤z + 1 2g⊤g subject to Gz ≥0, where G = −(g1, . . . , gt−1), and we discard the constant term g⊤g. This is a QP on p variables (the number of parameters of the neural network), which could be measured in the millions. However, we can pose the dual of the GEM QP as: minimizev 1 2v⊤GG⊤v + g⊤G⊤v subject to v ≥0, (11) since u = G⊤v + g and the term g⊤g is constant. This is a QP on t −1 ≪p variables, the number of observed tasks so far. Once we solve the dual problem (11) for v⋆, we can recover the projected gradient update as ˜g = G⊤v⋆+ g. In practice, we found that adding a small constant γ ≥0 to v⋆ biased the gradient projection to updates that favoured benefitial backwards transfer. Algorithm 1 summarizes the training and evaluation protocol of GEM over a continuum of data. The pseudo-code includes the computation of the matrix R, containing the sufficient statistics to compute the metrics ACC, FWT, and BWT described in Section 2. 4 A causal compression view We can interpret GEM as a model that learns the subset of correlations common to a set of distributions (tasks). Furthermore, GEM can (and will in our MNIST experiments) be used to predict target vectors associated to previous or new tasks without making use of task descriptors. This is a desired feature in causal inference problems, since causal predictions are invariant across different environments [Peters et al., 2016], and therefore provide the most compressed representation of a set of distributions [Schölkopf et al., 2016]. Algorithm 1 Training a GEM over an ordered continuum of data procedure TRAIN(fθ, Continuumtrain, Continuumtest) Mt ←{} for all t = 1, . . . , T. R ←0 ∈RT ×T . for t = 1, . . . , T do: for (x, y) in Continuumtrain(t) do Mt ←Mt ∪(x, y) g ←∇θ ℓ(fθ(x, t), y) gk ←∇θ ℓ(fθ, Mk) for all k < t ˜g ←PROJECT(g, g1, . . . , gt−1), see (11). θ ←θ −α˜g. end for Rt,: ←EVALUATE(fθ, Continuumtest) end for return fθ, R end procedure procedure EVALUATE(fθ, Continuum) r ←0 ∈RT for k = 1, . . . , T do rk ←0 for (x, y) in Continuum(k) do rk ←rk +accuracy(fθ(x, k), y) end for rk ←rk / len(Continuum(k)) end for return r end procedure 4 Experiments We perform a variety of experiments to assess the performance of GEM in continual learning. 4.1 Datasets We consider the following datasets: • MNIST Permutations [Kirkpatrick et al., 2017], a variant of the MNIST dataset of handwritten digits [LeCun et al., 1998], where each task is transformed by a fixed permutation of pixels. In this dataset, the input distribution for each task is unrelated. • MNIST Rotations, a variant of MNIST where each task contains digits rotated by a fixed angle between 0 and 180 degrees. • Incremental CIFAR100 [Rebuffiet al., 2017], a variant of the CIFAR object recognition dataset with 100 classes [Krizhevsky, 2009], where each task introduces a new set of classes. For a total number of T tasks, each new task concerns examples from a disjoint subset of 100/T classes. Here, the input distribution is similar for all tasks, but different tasks require different output distributions. For all the datasets, we considered T = 20 tasks. On the MNIST datasets, each task has 1000 examples from 10 different classes. On the CIFAR100 dataset each task has 2500 examples from 5 different classes. The model observes the tasks in sequence, and each example once. The evaluation for each task is performed on the test partition of each dataset. 4.2 Architectures On the MNIST tasks, we use fully-connected neural networks with two hidden layers of 100 ReLU units. On the CIFAR100 tasks, we use a smaller version of ResNet18 [He et al., 2015], with three times less feature maps across all layers. Also on CIFAR100, the network has a final linear classifier per task. This is one simple way to leverage the task descriptor, in order to adapt the output distribution to the subset of classes for each task. We train all the networks and baselines using plain SGD on mini-batches of 10 samples. All hyper-parameters are optimized using a grid-search (see Appendix A), and the best results for each model are reported. 5 ACC BWT FWT 0.2 0.0 0.2 0.4 0.6 0.8 classification accuracy MNIST permutations single independent multimodal EWC GEM 0 2 4 6 8 10 12 14 16 18 20 0.2 0.4 0.6 0.8 MNIST permutations ACC BWT FWT 0.2 0.0 0.2 0.4 0.6 0.8 classification accuracy MNIST rotations single independent multimodal EWC GEM 0 2 4 6 8 10 12 14 16 18 20 0.2 0.4 0.6 0.8 MNIST rotations ACC BWT FWT 0.0 0.2 0.4 0.6 classification accuracy CIFAR-100 single independent iCARL EWC GEM 0 2 4 6 8 10 12 14 16 18 20 0.2 0.3 0.4 0.5 0.6 CIFAR-100 Figure 1: Left: ACC, BWT, and FWT for all datasets and methods. Right: evolution of the test accuracy at the first task, as more tasks are learned. Table 1: CPU Training time (s) of MNIST experiments for all methods. task single independent multimodal EWC GEM permutations 11 11 14 179 77 rotations 11 16 13 169 135 4.3 Methods We compare GEM to five alternatives: 1. a single predictor trained across all tasks. 2. one independent predictor per task. Each independent predictor has the same architecture as “single” but with T times less hidden units than “single”. Each new independent predictor can be initialized at random, or be a clone of the last trained predictor (decided by grid-search). 3. a multimodal predictor, which has the same architecture of “single”, but with a dedicated input layer per task (only for MNIST datasets). 4. EWC [Kirkpatrick et al., 2017], where the loss is regularized to avoid catastrophic forgetting. 5. iCARL [Rebuffiet al., 2017], a class-incremental learner that classifies using a nearestexemplar algorithm, and prevents catastrophic forgetting by using an episodic memory. iCARL requires the same input representation across tasks, so this method only applies to our experiment on CIFAR100. GEM, iCaRL and EWC have the same architecture as “single”, plus episodic memory. 6 Table 2: ACC as a function of the episodic memory size for GEM and iCARL, on CIFAR100. memory size 200 1, 280 2, 560 5, 120 GEM 0.487 0.579 0.633 0.654 iCARL 0.436 0.494 0.500 0.508 Table 3: ACC/BWT on the MNIST Rotations dataset, when varying the number of epochs per task. method 1 epoch 2 epochs 5 epochs single, shuffled data 0.83/-0.00 0.87/-0.00 0.89/-0.00 single 0.53/-0.08 0.49/-0.25 0.43/-0.40 independent 0.56/-0.00 0.64/-0.00 0.67/-0.00 multimodal 0.76/-0.02 0.72/-0.11 0.59/-0.28 EWC 0.55/-0.19 0.59/-0.17 0.61/-0.11 GEM 0.86/+0.05 0.88/+0.02 0.89/-0.02 4.4 Results Figure 1 (left) summarizes the average accuracy (ACC, Equation 2), backward transfer (BWT, Equation 3) and forward transfer (FWT, Equation 4) for all datasets and methods. We provide the full evaluation matrices R in Appendix B. Overall, GEM performs similarly or better than the multimodal model (which is very well suited to the MNIST tasks). GEM minimizes backward transfer, while exhibiting negligible or positive forward transfer. Figure 1 (right) shows the evolution of the test accuracy of the first task throughout the continuum of data. GEM exhibits minimal forgetting, and positive backward transfer in CIFAR100. Overall, GEM performs significantly better than other continual learning methods like EWC, while spending less computation (Table 1). GEM’s efficiency comes from optimizing over a number of variables equal to the number of tasks (T = 20 in our experiments), instead of optimizing over a number of variables equal to the number of parameters (p = 1109240 for CIFAR100 for instance). GEM’s bottleneck is the necessity of computing previous task gradients at each learning iteration. 4.4.1 Importance of memory, number of passes, and order of tasks Table 2 shows the final ACC in the CIFAR-100 experiment for both GEM and iCARL as a function their episodic memory size. Also seen in Table 2, the final ACC of GEM is an increasing function of the size of the episodic memory, eliminating the need to carefully tune this hyper-parameter. GEM outperforms iCARL for a wide range of memory sizes. Table 3 illustrates the importance of memory as we do more than one pass through the data on the MNIST rotations experiment. Multiple training passe exacerbate the catastrophic forgetting problem. For instance, in the last column of Table 3 (except for the result in the first row), each model is shown examples of a task five times (in random order) before switching to the next task. Table 3 shows that memory-less methods (like “single” and “multimodal”) exhibit higher negative BWT, leading to lower ACC. On the other hand, memory-based methods such as EWC and GEM lead to higher ACC as the number of passes through the data increases. However, GEM suffers less negative BWT than EWC, leading to a higher ACC. Finally, to relate the performance of GEM to the best possible performance on the proposed datasets, the first row of Table 3 reports the ACC of “single” when trained with iid data from all tasks. This mimics usual multi-task learning, where each mini-batch contains examples taken from a random selection of tasks. By comparing the first and last row of Table 3, we see that GEM matches the “oracle performance upper-bound” ACC provided by iid learning, and minimizes negative BWT. 7 5 Related work Continual learning [Ring, 1994], also called lifelong learning [Thrun, 1994, Thrun and Pratt, 2012, Thrun, 1998, 1996], considers learning through a sequence of tasks, where the learner has to retain knowledge about past tasks and leverage that knowledge to quickly acquire new skills. This learning setting led to implementations [Carlson et al., 2010, Ruvolo and Eaton, 2013, Ring, 1997], and theoretical investigations [Baxter, 2000, Balcan et al., 2015, Pentina and Urner, 2016], although the latter ones have been restricted to linear models. In this work, we revisited continual learning but proposed to focus on the more realistic setting where examples are seen only once, memory is finite, and the learner is also provided with (potentially structured) task descriptors. Within this framework, we introduced a new set of metrics, a training and testing protocol, and a new algorithm, GEM, that outperforms the current state-of-the-art in terms of limiting forgetting. The use of task descriptors is similar in spirit to recent work in Reinforcement Learning [Sutton et al., 2011, Schaul et al., 2015], where task or goal descriptors are also fed as input to the system. The CommAI project [Mikolov et al., 2015, Baroni et al., 2017] shares our same motivations, but focuses on highly structured task descriptors, such as strings of text. In contrast, we focus on the problem of catastrophic forgetting [McCloskey and Cohen, 1989, French, 1999, Ratcliff, 1990, McClelland et al., 1995, Goodfellow et al., 2013]. Several approaches have been proposed to avoid catastrophic forgetting. The simplest approach in neural networks is to freeze early layers, while cloning and fine-tuning later layers on the new task [Oquab et al., 2014] (which we considered in our “independent” baseline). This relates to methods that leverage a modular structure of the network with primitives that can be shared across tasks [Rusu et al., 2016, Fernando et al., 2017, Aljundi et al., 2016, Denoyer and Gallinari, 2015, Eigen et al., 2014]. Unfortunately, it has been very hard to scale up these methods to lots of modules and tasks, given the combinatorial number of compositions of modules. Our approach is most similar to the regularization approaches that consider a single model, but modify its learning objective to prevent catastrophic forgetting. Within this class of methods, there are approaches that leverage “synaptic” memory [Kirkpatrick et al., 2017, Zenke et al., 2017], where learning rates are adjusted to minimize changes in parameters important for previous tasks. Other approaches are instead based on “episodic” memory [Jung et al., 2016, Li and Hoiem, 2016, Rannen Triki et al., 2017, Rebuffiet al., 2017], where examples from previous tasks are stored and replayed to maintain predictions invariant by means of distillation [Hinton et al., 2015]. GEM is related to these latter approaches but, unlike them, allows for positive backward transfer. More generally, there are a variety of setups in the machine learning literature related to continual learning. Multitask learning [Caruana, 1998] considers the problem of maximizing the performance of a learning machine across a variety of tasks, but the setup assumes simultaneous access to all the tasks at once. Similarly, transfer learning [Pan and Yang, 2010] and domain adaptation [Ben-David et al., 2010] assume the simultaneous availability of multiple learning tasks, but focus at improving the performance at one of them in particular. Zero-shot learning [Lampert et al., 2009, Palatucci et al., 2009] and one-shot learning [Fei-Fei et al., 2003, Vinyals et al., 2016, Santoro et al., 2016, Bertinetto et al., 2016] aim at performing well on unseen tasks, but ignore the catastrophic forgetting of previously learned tasks. Curriculum learning considers learning a sequence of data [Bengio et al., 2009], or a sequence of tasks [Pentina et al., 2015], sorted by increasing difficulty. 6 Conclusion We formalized the scenario of continual learning. First, we defined training and evaluation protocols to assess the quality of models in terms of their accuracy, as well as their ability to transfer knowledge forward and backward between tasks. Second, we introduced GEM, a simple model that leverages an episodic memory to avoid forgetting and favor positive backward transfer. Our experiments demonstrate the competitive performance of GEM against the state-of-the-art. GEM has three points for improvement. First, GEM does not leverage structured task descriptors, which may be exploited to obtain positive forward transfer (zero-shot learning). Second, we did not investigate advanced memory management (such as building coresets of tasks [Lucic et al., 2017]). Third, each GEM iteration requires one backward pass per task, increasing computation time. These are exciting research directions to extend learning machines beyond ERM, and to continuums of data. 8 Acknowledgements We are grateful to M. Baroni, L. Bottou, M. Nickel, Y. Olivier and A. Szlam for their insight. We are grateful to Martin Arjovsky for the QP interpretation of GEM. References R. Aljundi, P. Chakravarty, and T. Tuytelaars. Expert gate: Lifelong learning with a network of experts. CVPR, 2016. M.-F. Balcan, A. Blum, and S. Vempola. Efficient representations for lifelong learning and autoencoding. COLT, 2015. M. Baroni, A. Joulin, A. Jabri, G. Kruszewski, A. Lazaridou, K. Simonic, and T. Mikolov. CommAI: Evaluating the first steps towards a useful general AI. arXiv, 2017. J. Baxter. A model of inductive bias learning. JAIR, 2000. S. Ben-David, J. Blitzer, K. Crammer, A. Kulesza, F. Pereira, and J. Wortman Vaughan. A theory of learning from different domains. Machine Learning Journal, 2010. Y. Bengio, J. Louradour, R. Collobert, and J. Weston. Curriculum learning. ICML, 2009. L. Bertinetto, J. Henriques, J. Valmadre, P. Torr, and A. Vedaldi. Learning feed-forward one-shot learners. NIPS, 2016. A. Carlson, J. Betteridge, B. Kisiel, B. Settles, E. R. Hruschka, and T. M. Mitchell. Toward an architecture for never-ending language learning. AAAI, 2010. R. Caruana. Multitask learning. In Learning to learn. Springer, 1998. L. Denoyer and P. Gallinari. Deep sequential neural networks. EWRL, 2015. W. S. Dorn. Duality in quadratic programming. Quarterly of Applied Mathematics, 1960. D. Eigen, I. Sutskever, and M. Ranzato. Learning factored representations in a deep mixture of experts. ICLR, 2014. L. Fei-Fei, R. Fergus, and P. Perona. A Bayesian approach to unsupervised one-shot learning of object categories. ICCV, 2003. C. Fernando, D. Banarse, C. Blundell, Y. Zwols, D. Ha, A. A. Rusu, A. Pritzel, and D. Wierstra. PathNet: Evolution channels gradient descent in super neural networks. arXiv, 2017. R. M. French. Catastrophic forgetting in connectionist networks. Trends in cognitive sciences, 1999. I. J. Goodfellow, M. Mirza, D. Xiao, A. Courville, and Y. Bengio. An Empirical Investigation of Catastrophic Forgetting in Gradient-Based Neural Networks. arXiv, 2013. K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. arXiv, 2015. G. Hinton, O. Vinyals, and J. Dean. Distilling the knowledge in a neural network. arXiv, 2015. H. Jung, J. Ju, M. Jung, and J. Kim. Less-forgetting Learning in Deep Neural Networks. arXiv, 2016. J. Kirkpatrick, R. Pascanu, N. Rabinowitz, J. Veness, G. Desjardins, A. A. Rusu, K. Milan, J. Quan, T. Ramalho, A. Grabska-Barwinska, et al. Overcoming catastrophic forgetting in neural networks. PNAS, 2017. A. Krizhevsky. Learning multiple layers of features from tiny images. Technical report, Technical report, University of Toronto, 2009. C. Lampert, H. Nickisch, and S. Harmeling. Learning to detect unseen object classes by between-class attribute transfer. CVPR, 2009. Y. LeCun, C. Cortes, and C. J. Burges. The MNIST database of handwritten digits, 1998. URL http: //yann.lecun.com/exdb/mnist/. Z. Li and D. Hoiem. Learning without forgetting. ECCV, 2016. 9 M. Lucic, M. Faulkner , A. Krause, and D. Feldman. Training Mixture Models at Scale via Coresets. arXiv, 2017. J. L. McClelland, B. L. McNaughton, and R. C. O’reilly. Why there are complementary learning systems in the hippocampus and neocortex: insights from the successes and failures of connectionist models of learning and memory. Psychological review, 1995. M. McCloskey and N. J. Cohen. Catastrophic interference in connectionist networks: The sequential learning problem. Psychology of learning and motivation, 1989. T. Mikolov, A. Joulin, and M. Baroni. A roadmap towards machine intelligence. arXiv, 2015. M. Oquab, L. Bottou, I. Laptev, and J. Sivic. Learning and transferring mid-level image representations using convolutional neural networks. CVPR, 2014. M. Palatucci, D. A. Pomerleau, G. E. Hinton, and T. Mitchell. Zero-shot learning with semantic output codes. NIPS, 2009. S. J. Pan and Q. Yang. A survey on transfer learning. TKDE, 2010. A. Pentina and R. Urner. Lifelong learning with weighted majority votes. NIPS, 2016. A. Pentina, V. Sharmanska, and C. H. Lampert. Curriculum learning of multiple tasks. CVPR, 2015. J. Peters, P. Bühlmann, and N. Meinshausen. Causal inference by using invariant prediction: identification and confidence intervals. Journal of the Royal Statistical Society, 2016. A. Rannen Triki, R. Aljundi, M. B. Blaschko, and T. Tuytelaars. Encoder Based Lifelong Learning. arXiv, 2017. R. Ratcliff. Connectionist models of recognition memory: Constraints imposed by learning and forgetting functions. Psychological review, 1990. S.-A. Rebuffi, A. Kolesnikov, G. Sperl, and C. H. Lampert. iCaRL: Incremental classifier and representation learning. CVPR, 2017. M. B. Ring. Continual Learning in Reinforcement Environments. PhD thesis, University of Texas at Austin, Austin, Texas 78712, 1994. M. B. Ring. CHILD: A first step towards continual learning. Machine Learning, 1997. A. A. Rusu, N. C. Rabinowitz, G. Desjardins, H. Soyer, J. Kirkpatrick, K. Kavukcuoglu, R. Pascanu, and R. Hadsell. Progressive neural networks. NIPS, 2016. P. Ruvolo and E. Eaton. ELLA: An Efficient Lifelong Learning Algorithm. ICML, 2013. A. Santoro, S. Bartunov, M. Botvinick, D. Wierstra, and T. Lillicrap. One-shot learning with memory-augmented neural networks. arXiv, 2016. T. Schaul, D. Horgan, K. Gregor, and D. Silver. Universal value function approximators. ICML, 2015. B. Scholkopf and A. J. Smola. Learning with kernels: support vector machines, regularization, optimization, and beyond. MIT press, 2001. B. Schölkopf, D. Janzing, and D. Lopez-Paz. Causal and statistical learning. In Learning Theory and Approximation. Oberwolfach Research Institute for Mathematics, 2016. R. S. Sutton, J. Modayil, M. Delp, T. Degris, P. M. Pilarski, A. White, and D. Precup. Horde: A scalable real-time architecture for learning knowledge from unsupervised sensorimotor interaction. The 10th International Conference on Autonomous Agents and Multiagent Systems, 2011. S. Thrun. A lifelong learning perspective for mobile robot control. Proceedings of the IEEE/RSJ/GI Conference on Intelligent Robots and Systems, 1994. S. Thrun. Is learning the n-th thing any easier than learning the first? NIPS, 1996. S. Thrun. Lifelong learning algorithms. In Learning to learn. Springer, 1998. S. Thrun and L. Pratt. Learning to learn. Springer Science & Business Media, 2012. V. Vapnik. Statistical learning theory. Wiley New York, 1998. O. Vinyals, C. Blundell, T. Lillicrap, and D. Wierstra. Matching networks for one shot learning. NIPS, 2016. F. Zenke, B. Poole, and S. Ganguli. Improved multitask learning through synaptic intelligence. arXiv, 2017. 10
2017
659
7,184
Stein Variational Gradient Descent as Gradient Flow Qiang Liu Department of Computer Science Dartmouth College Hanover, NH 03755 qiang.liu@dartmouth.edu Abstract Stein variational gradient descent (SVGD) is a deterministic sampling algorithm that iteratively transports a set of particles to approximate given distributions, based on a gradient-based update that guarantees to optimally decrease the KL divergence within a function space. This paper develops the first theoretical analysis on SVGD. We establish that the empirical measures of the SVGD samples weakly converge to the target distribution, and show that the asymptotic behavior of SVGD is characterized by a nonlinear Fokker-Planck equation known as Vlasov equation in physics. We develop a geometric perspective that views SVGD as a gradient flow of the KL divergence functional under a new metric structure on the space of distributions induced by Stein operator. 1 Introduction Stein variational gradient descent (SVGD) [1] is a particle-based algorithm for approximating complex distributions. Unlike typical Monte Carlo algorithms that rely on randomness for approximation, SVGD constructs a set of points (or particles) by iteratively applying deterministic updates that is constructed to optimally decrease the KL divergence to the target distribution at each iteration. SVGD has a simple form that efficient leverages the gradient information of the distribution, and can be readily applied to complex models with massive datasets for which typical gradient descent has been found efficient. A nice property of SVGD is that it strictly reduces to the typical gradient ascent for maximum a posteriori (MAP) when using only a single particle (n = 1), while turns into a full sampling method with more particles. Because MAP often provides reasonably good results in practice, SVGD is found more particle-efficient than typical Monte Carlo methods which require much larger numbers of particles to achieve good results. SVGD can be viewed as a variational inference algorithm [e.g., 2], but is significantly different from the typical parametric variational inference algorithms that use parametric sets to approximate given distributions and have the disadvantage of introducing deterministic biases and (often) requiring non-convex optimization. The non-parametric nature of SVGD allows it to provide consistent estimation for generic distributions like Monte Carlo does. There are also particle algorithms based on optimization, or variational principles, with theoretical guarantees [e.g., 3–5], but they often do not use the gradient information effectively and do not scale well in high dimensions. However, SVGD is difficult to analyze theoretically because it involves a system of particles that interact with each other in a complex way. In this work, we take an initial step towards analyzing SVGD. We characterize the SVGD dynamics using an evolutionary process of the empirical measures of the particles that is known as Vlasov process in physics, and establish that empirical measures of the particles weakly converge to the given target distribution. We develop a geometric interpretation of SVGD that views SVGD as a gradient flow of KL divergence, defined on a new Riemannian-like metric structure imposed on the space of density functions. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. 2 Stein Variational Gradient Descent (SVGD) We start with a brief overview of SVGD [1]. Let νp be a probability measure of interest with a positive, (weakly) differentiable density p(x) on an open set X ⊆Rd. We want to approximate νp with a set of particles {xi}n i=1 whose empirical measure ˆµn(dx) = Pn i=1 δ(x −xi)/ndx weakly converges to νp as n →∞(denoted by ˆµn ⇒νp), in the sense that we have Eˆµn[h] →Eνp[h] as n →∞for all bounded, continuous test functions h. To achieve this, we initialize the particles with some simple distribution µ, and update them via map T (x) = x + ϵφ(x), where ϵ is a small step size, and φ(x) is a perturbation direction, or velocity field, which should be chosen to maximally decrease the KL divergence of the particle distribution with the target distribution; this is framed by [1] as solving the following functional optimization, max φ∈H  −d dϵKL(T µ || νp) ϵ=0 s.t. ||φ||H ≤1  . (1) where µ denotes the (empirical) measure of the current particles, and T µ is the measure of the updated particles x′ = T (x) with x ∼µ, or the pushforward measure of µ through map T , and H is a normed function space chosen to optimize over. A key observation is that the objective in (1) is a linear functional of φ that draws connections to ideas in the Stein’s method [6] used for proving limit theorems or probabilistic bounds in theoretical statistics. Liu and Wang [1] showed that −d dϵKL(T µ || νp) ϵ=0 = Eµ[Spφ], with Spφ(x) := ∇log p(x)⊤φ(x) + ∇· φ(x), (2) where ∇· φ := Pd k=1 ∂xkφk(x), and Sp is a linear operator that maps a vector-valued function φ to a scalar-valued function Spφ, and Sp is called the Stein operator in connection with the so-called Stein’s identity, which shows that the RHS of (2) equals zero if µ = νp, Ep[Spφ] = Ep[∇log p⊤φ + ∇· φ] = Z ∇· (pφ)dx = 0; (3) it is the result of integration by parts, assuming proper zero boundary conditions. Therefore, the optimization (1) reduces to D(µ || νp) := max φ∈H  Eµ[Spφ], s.t. ||φ||H ≤1 , (4) where D(µ || νp) is called Stein discrepancy, which provides a discrepancy measure between µ and νp, since D(µ || νp) = 0 if µ = νp and D(µ || νp) > 0 if µ ̸= νp given H is sufficiently large. Because (4) induces an infinite dimensional functional optimization, it is critical to select a nice space H that is both sufficiently rich and also ensures computational tractability in practice. Kernelized Stein discrepancy (KSD) provides one way to achieve this by taking H to be a reproducing kernel Hilbert space (RKHS), for which the optimization yields a closed form solution [7–10]. To be specific, let H0 be a RKHS of scalar-valued functions with a positive definite kernel k(x, x′), and H = H0 × · · · × H0 the corresponding d × 1 vector-valued RKHS. Then it can be shown that the optimal solution of (4) is φ∗ µ,p(·) ∝Ex∼µ[Sp ⊗k(x, ·)], with Sp ⊗k(x, ·) := ∇log p(x)k(x, ·) + ∇xk(x, ·), (5) where Sp⊗is an outer product variant of Stein operator which maps a scalar-valued function to a vector-valued one. Further, it has been shown in [e.g., 7] that D(µ || νp) = ||φ∗ µ,p||H = q Ex,x′∼µ[κp(x, x′)], with κp(x, x′) := Sx p Sx′ p ⊗k(x, x′), (6) where κp(x, x′) is a “Steinalized” positive definite kernel obtained by applying Stein operator twice; Sx p and Sx′ p are the Stein operators w.r.t. variable x and x′, respectively. The key advantage of KSD is its computational tractability: it can be empirically evaluated with samples drawn from µ and the gradient ∇log p, which is independent of the normalization constant in p [see 7, 8]. 2 Algorithm 1 Stein Variational Gradient Descent [1] Input: The score function ∇x log p(x). Goal: A set of particles {xi}n i=1 that approximates p(x). Initialize a set of particles {xi 0}n i=1; pick a positive definite kernel k(x, x′) and step-size {ϵℓ}. For iteration ℓdo xi ℓ+1 ←xi ℓ+ ϵφ∗ ˆµn ℓ,p(xi ℓ), ∀i = 1, . . . , n, where φ∗ ˆµn ℓ,p(x) = 1 n n X j=1  ∇log p(xj ℓ)k(xj ℓ, x) + ∇xj ℓk(xj ℓ, x)  , (8) An important theoretic issue related to KSD is to characterize when H is rich enough to ensure D(µ || νp) = 0 iff µ = νp; this has been studied by Liu et al. [7], Chwialkowski et al. [8], Oates et al. [11]. More recently, Gorham and Mackey [10] (Theorem 8) established a stronger result that Stein discrepancy implies weak convergence on X = Rd: let {µℓ}∞ ℓ=1 be a sequence of probability measures, then D(µℓ|| νp) →0 ⇐⇒µℓ⇒νp as ℓ→∞, (7) for νp that are distantly dissipative (Definition 4 of Gorham and Mackey [10]) and a class of inverse multi-quadric kernels. Since the focus of this work is on SVGD, we will assume (7) holds without further examination. In SVGD algorithm, we iteratively update a set of particles using the optimal transform just derived, starting from certain initialization. Let {xi ℓ}n i=1 be the particles at the ℓ-th iteration. In this case, the exact distributions of {xi ℓ}n i=1 are unknown or difficult to keep track of, but can be best approximated by their empirical measure ˆµn ℓ(dx) = P i δ(x −xi ℓ)dx/n. Therefore, it is natural to think that φ∗ ˆµn ℓ,p, with µ in (5) replaced by ˆµn ℓ, provides the best update direction for moving the particles (and equivalently ˆµn ℓ) “closer to” νp. Implementing this update (8) iteratively, we get the main SVGD algorithm in Algorithm 1. Intuitively, the update in (8) pushes the particles towards the high probability regions of the target probability via the gradient term ∇log p, while maintaining a degree of diversity via the second term ∇k(x, xi). In addition, (8) reduces to the typical gradient descent for maximizing log p if we use only a single particle (n = 1) and the kernel stratifies ∇k(x, x′) = 0 for x = x′; this allows SVGD to provide a spectrum of approximation that smooths between maximum a posterior (MAP) optimization to a full sampling approximation by using different particle sizes, enabling efficient trade-off between accuracy and computation cost. Despite the similarity to gradient descent, we should point out that the SVGD update in (8) does not correspond to minimizing any objective function F({xi ℓ}) in terms of the particle location {xi ℓ}, because one would find ∂xi∂xjF ̸= ∂xj∂xiF if this is true. Instead, it is best to view SVGD as a type of (particle-based) numerical approximation of an evolutionary partial differential equation (PDE) of densities or measures, which corresponds to a special type of gradient flow of the KL divergence functional whose equilibrium state equals the given target distribution νp, as we discuss in the sequel. 3 Density Evolution of SVGD Dynamics This section collects our main results. We characterize the evolutionary process of the empirical measures ˆµn ℓof the SVGD particles and their large sample limit as n →∞(Section 3.1) and large time limit as ℓ→∞(Section 3.2), which together establish the weak convergence of ˆµn ℓto the target measure νp. Further, we show that the large sample limit of the SVGD dynamics is characterized by a Vlasov process, which monotonically decreases the KL divergence to target distributions with a decreasing rate that equals the square of Stein discrepancy (Section 3.2-3.3). We also establish a geometric intuition that interpret SVGD as a gradient flow of KL divergence under a new Riemannian metric structure induced by Stein operator (Section 3.4). Section 3.5 provides a brief discussion on the connection to Langevin dynamics. 3 3.1 Large Sample Asymptotic of SVGD Consider the optimal transform T µ,p(x) = x + ϵφ∗ µ,p(x) with φ∗ µ,p defined in (5). We define its related map Φp : µ 7→T µ,pµ, where T µ,pµ denotes the pushforward measure of µ through transform T µ,p. This map fully characterizes the SVGD dynamics in the sense that the empirical measure ˆµn ℓ can be obtained by recursively applying Φp starting from the initial measure ˆµn 0. ˆµn ℓ+1 = Φp(ˆµn ℓ), ∀ℓ∈N. (9) Note that Φp is a nonlinear map because the transform T µ,p depends on the input map µ. If µ has a density q and ϵ is small enough so that T µ,p is invertible, the density q′ of µ′ = Φp(µ) is given by the change of variables formula: q′(z) = q(T −1 µ,p(z)) · | det(∇T −1 µ,p(z))|. (10) When µ is an empirical measure and q is a Dirac delta function, this equation still holds formally in the sense of distribution (generalized functions). Critically, Φp also fully characterizes the large sample limit property of SVGD. Assume the initial empirical measure ˆµn 0 at the 0-th iteration weakly converges to a measure µ∞ 0 as n →∞, which can be achieved, for example, by drawing {xi 0} i.i.d. from µ∞ 0 , or using MCMC or Quasi Monte Carlo methods. Starting from the limit initial measure µ∞ 0 and applying Φp recursively, we get µ∞ ℓ+1 = Φp(µ∞ ℓ), ∀ℓ∈N. (11) Assuming ˆµn 0 ⇒µ∞ 0 by initialization, we may expect that ˆµn ℓ⇒µ∞ ℓfor all the finite iterations ℓif Φp satisfies certain Lipschitz condition. This is naturally captured by the bounded Lipschitz metric. For two measures µ and ν, their bounded Lipschitz (BL) metric is defined to be their difference of means on the set of bounded, Lipschitz test functions: BL(µ, ν) = sup f  Eµf −Eνf s.t. ||f||BL ≤1 , where ||f||BL = max{||f||∞, ||f||Lip}, where ||f||∞= supx |f(x)| and ||f||Lip = supx̸=y |f(x)−f(y)| ||x−y||2 . For a vector-valued bounded Lipschitz function f = [f1, . . . , fd]⊤, we define its norm by ||f||2 BL = Pd i=1 ||fi||2 BL. It is known that the BL metric metricizes weak convergence, that is, BL(µn, ν) →0 if and only if µn ⇒ν. Lemma 3.1. Assuming g(x, y) := Sx p ⊗k(x, y) is bounded Lipschitz jointly on (x, y) with norm ||g||BL < ∞, then for any two probability measures µ and µ′, we have BL(Φp(µ), Φp(µ′)) ≤(1 + 2ϵ||g||BL) BL(µ, µ′). Theorem 3.2. Let ˆµn ℓbe the empirical measure of {xi ℓ}n i=1 at the ℓ-th iteration of SVGD. Assuming lim n→∞BL(ˆµn 0, µ∞ 0 ) →0, then for µ∞ ℓdefined in (11), at any finite iteration ℓ, we have lim n→∞BL(ˆµn ℓ, µ∞ ℓ) →0. Proof. It is a direct result of Lemma 3.1. Since BL(µ, ν) metricizes weak convergence, our result suggests ˆµn ℓ⇒ˆµ∞ ℓfor ∀ℓ, if ˆµn 0 ⇒ˆµ∞ 0 by initialization. The bound of BL metric in Lemma 3.1 increases by a factor of (1 + 2ϵ||g||BL) at each iteration. We can prevent the explosion of the BL bound by decaying step size sufficiently fast. It may be possible to obtain tighter bounds, however, it is fundamentally impossible to get a factor smaller than one without further assumptions: suppose we can get BL(Φp(µ), Φp(µ′)) ≤αBL(µ, µ′) for some constant α ∈[0, 1), then starting from any initial ˆµn 0, with any fixed particle size n (e.g., n = 1), we would have BL(ˆµn ℓ, νp) = O(αℓ) →0 as ℓ→0, which is impossible because we can not get arbitrarily accurate approximate of νp with finite n. It turns out that we need to look at KL divergence in order to establish convergence towards νp as ℓ→∞, as we discuss in Section 3.2-3.3. 4 Remark Because g(x, y) = ∇x log p(x)k(x, y)+∇xk(x, y), and ∇x log p(x) is often unbounded if the domain X is not unbounded. Therefore, the condition that g(x, y) must be bounded in Lemma 3.1 suggests that it can only be used when X is compact. It is an open question to establish results that can work for more general domain X. 3.2 Large Time Asymptotic of SVGD Theorem 3.2 ensures that we only need to consider the update (11) starting from the limit initial µ∞ 0 , which we can assume to have nice density functions and have finite KL divergence with the target νp. We show that update (11) monotonically decreases the KL divergence between µ∞ ℓand νp and hence allows us to establish the convergence µ∞ ℓ⇒νp. Theorem 3.3. 1. Assuming p is a density that satisfies Stein’s identity (3) for ∀φ ∈H, then the measure νp of p is a fixed point of map Φp in (11). 2. Assume R = supx{ 1 2||∇log p||Lipk(x, x) + 2∇xx′k(x, x)} < ∞, where ∇xx′k(x, x) = P i ∂xi∂x′ ik(x, x′) x=x′, and the step size ϵℓat the ℓ-th iteration is no larger than ϵ∗ ℓ := (2 supx ρ(∇φ∗ µℓ,p + ∇φ∗⊤ µℓ,p))−1, where ρ(A) denotes the spectrum norm of a matrix A. If KL(µ∞ 0 || νp) < ∞by initialization, then 1 ϵℓ  KL(µ∞ ℓ+1 || νp) −KL(µ∞ ℓ|| νp)  ≤−(1 −ϵℓR) D(µ∞ ℓ|| νp)2, (12) that is, the population SVGD dynamics always deceases the KL divergence when using sufficiently small step sizes, with a decreasing rate upper bounded by the squared Stein discrepancy. Further, if we set the step size ϵℓto be ϵℓ∝D(µ∞ ℓ|| νp)β for any β > 0, then (12) implies that D(µ∞ ℓ|| νp) →0 as ℓ→∞. Remark Assuming D(µ∞ ℓ || νp) →0 implies µ∞ ℓ ⇒νp (see (7)), then Theorem 3.3(2) implies µ∞ ℓ ⇒νp. Further, together with Theorem 3.2, we can establish the weak convergence of the empirical measures of the SVGD particles: ˆµn ℓ⇒νp, as ℓ→∞, n →∞. Remark Theorem 3.3 can not be directly applied on the empirical measures ˆµn ℓwith finite sample size n, since it would give KL(ˆµn ℓ|| νp) = ∞in the beginning. It is necessary to use BL metric and KL divergence to establish the convergence w.r.t. sample size n and iteration ℓ, respectively. Remark The requirement that ϵℓ≤ϵ∗ ℓis needed to guarantee that the transform T µℓ,p(x) = x + ϵφ∗ µℓ,p(x) has a non-singular Jacobean matrix everywhere. From the bound in Equation A.6 of the Appendix, we can derive an upper bound of the spectrum radius: sup x ρ(∇φ∗ µℓ,p + ∇φ∗⊤ µℓ,p) ≤2 sup x ||∇φ∗ µℓ,p||F ≤2 sup x p ∇xx′k(x, x) D(µℓ|| νp). This suggest that the step size should be upper bounded by the inverse of Stein discrepancy, i.e., ϵ∗ ℓ∝D(µℓ|| νp)−1 = ||φ∗ µℓ,p||−1 H , where D(µℓ|| νp) can be estimated using (6) (see [7]). 3.3 Continuous Time Limit and Vlasov Process Many properties can be understood more easily as we take the continuous time limit (ϵ →0), reducing our system to a partial differential equation (PDE) of the particle densities (or measures), under which we show that the negative gradient of KL divergence exactly equals the square Stein discrepancy (the limit of (12) as ϵ →0). To be specific, we define a continuous time t = ϵℓ, and take infinitesimal step size ϵ →0, the evolution of the density q in (10) then formally reduces to the following nonlinear Fokker-Planck equation (see Appendix A.3 for the derivation): ∂ ∂tqt(x) = −∇· (φ∗ qt,p(x)qt(x)). (13) This PDE is a type of deterministic Fokker-Planck equation that characterizes the movement of particles under deterministic forces, but it is nonlinear in that the velocity field φ∗ qt,p(x) depends on the current particle density qt through the drift term φ∗ qt,p(x) = Ex′∼qt[Sx′ p ⊗k(x, x′)]. 5 It is not surprising to establish the following continuous version of Theorem 3.3(2), which is of central importance to our gradient flow perspective in Section 3.4: Theorem 3.4. Assuming {µt} are the probability measures whose densities {qt} satisfy the PDE in (13), and KL(µ0 || νp) < ∞, then d dtKL(µt || νp) = −D(µt || νp)2. (14) Remark This result suggests a path integration formula, KL(µ0 || νp) = R ∞ 0 D(µt || νp)2dt, which can be potentially useful for estimating KL divergence or the normalization constant. PDE (13) only works for differentiable densities qt. Similar to the case of Φp as a map between (empirical) measures, one can extend (13) to a measure-value PDE that incorporates empirical measures as weak solutions. Take a differentiable test function h and integrate the both sides of (13): Z ∂ ∂th(x)qt(x)dx = − Z h(x)∇· (φ∗ qt,p(x)qt(x))dx, Using integration by parts on the right side to “shift” the derivative operator from φ∗ qt,pqt to h, we get d dtEµt[h] = Eµt[∇h⊤φ∗ µt,p], (15) which depends on µt only through the expectation operator and hence works for empirical measures as well,. A set of measures {µt} is called the weak solution of (13) if it satisfies (15). Using results in Fokker-Planck equation, the measure process (13)-(15) can be translated to an ordinary differential equation on random particles {xt} whose distribution is µt: dxt = φ∗ µt,p(xt)dt, µt is the distribution of random variable xt, (16) initialized from random variable x0 with distribution µ0. Here the nonlinearity is reflected in the fact that the velocity field depends on the distribution µt of the particle at the current time. In particular, if we initialize (15) using an empirical measure ˆµn 0 of a set of finite particles {xi 0}n i=1, (16) reduces to the following continuous time limit of n-particle SVGD dynamics: dxi t = φ∗ ˆµn t ,p(xi t)dt, ∀i = 1, . . . , n, with ˆµn t (dx) = 1 n n X i=1 δ(x −xi t)dx, (17) where {ˆµn t } can be shown to be a weak solution of (13)-(15), parallel to (9) in the discrete time case. (16) can be viewed as the large sample limit (n →∞) of (17). The process (13)-(17) is a type of Vlasov processes [12, 13], which are (deterministic) interacting particle processes of the particles interacting with each other though the dependency on their “mean field” µt (or ˆµn t ), and have found important applications in physics, biology and many other areas. There is a vast literature on theories and applications of interacting particles systems in general, and we only refer to Spohn [14], Del Moral [15] and references therein as examples. Our particular form of Vlasov process, constructed based on Stein operator in order to approximate arbitrary given distributions, seems to be new to the best of our knowledge. 3.4 Gradient Flow, Optimal Transport, Geometry We develop a geometric view for the Vlasov process in Section 3.3, interpreting it as a gradient flow for minimizing the KL divergence functional, defined on a new type of optimal transport metric on the space of density functions induced by Stein operator. We focus on the set of “nice” densities q paired with a well defined Stein operator Sq, acting on a Hilbert space H. To develop the intuition, consider a density q and its nearby density q′ obtained by applying transform T (x) = x + φ(x)dt on x ∼q with infinitesimal dt and φ ∈H, then we can show that (See Appendix A.3) log q′(x) = log q(x) −Sqφ(x)dt, q′(x) = q(x) −q(x)Sqφ(x)dt, (18) 6 Because one can show that Sqφ = ∇·(φq) q from (2), we define operator qSq by qSqφ(x) = q(x)Sqφ(x) = ∇· (φ(x)q(x)). Eq (18) suggests that the Stein operator Sq (resp. qSq) serves to translate a φ-perturbation on the random variable x to the corresponding change on the log-density (resp. density). This fact plays a central role in our development. Denote by Hq (resp. qHq) the space of functions of form Sqφ (resp. qSqφ) with φ ∈H, that is, Hq = {Sqφ : φ ∈H}, qHq = {qSqφ : φ ∈H}. Equivalently, qHq is the space of functions of form qf where f ∈Hq. This allows us to consider the inverse of Stein operator for functions in Hq. For each f ∈Hq, we can identify an unique function ψf ∈H that has minimum || · ||H norm in the set of ψ that satisfy Sqψ = f, that is, ψq,f = arg min ψ∈H  ||ψ||H s.t. Sqψ = f , where Sqψ = f is known as the Stein equation. This allows us to define inner products on Hq and qHq using the inner product on H: ⟨f1 f2⟩Hq := ⟨qf1, qf2⟩qHq := ⟨ψq,f1, ψq,f2⟩H. (19) Based on standard results in RKHS [e.g., 16], one can show that if H is a RKHS with kernel k(x, x′), then Hq and qHq are both RKHS; the reproducing kernel of Hq is κp(x, x′) in (6), and correspondingly, the kernel of qHq is q(x)κp(x, x′)q(x′). Now consider q and a nearby q′ = q+qfdt, ∀f ∈Hq, obtained by an infinitesimal perturbation on the density function using functions in space Hq. Then the ψq,f can be viewed as the “optimal” transform, in the sense of having minimum || · ||H norm, that transports q to q′ via T (x) = x + ψq,f(x)dt. It is therefore natural to define a notion of distance between q and q′ = q + qfdt via, WH(q, q′) := ||ψq,f||Hdt. From (18) and (19), this is equivalent to WH(q, q′) = ||q −q′||qHqdt = || log q′ −log q||Hqdt. Under this definition, we can see that the infinitesimal neighborhood {q′ : WH(q, q′) ≤dt} of q, consists of densities (resp. log-densities) of form q′ = q + gdt, ∀g ∈qHq, ||g||qHq ≤1, log q′ = log q + fdt, ∀f ∈Hq, ||f||Hq ≤1. Geometrically, this means that qHq (resp. Hq) can be viewed as the tangent space around density q (resp. log-density log q). Therefore, the related inner product ⟨·, ·⟩qHq (resp. ⟨·, ·⟩Hq) forms a Riemannian metric structure that corresponds to WH(q, q′). This also induces a geodesic distance that corresponds to a general, H-dependent form of optimal transport metric between distributions. Consider two densities p and q that can be transformed from one to the other with functions in H, in the sense that there exists a curve of velocity fields {φt : φt ∈ H, t ∈[0, 1]} in H, that transforms random variable x0 ∼q to x1 ∼p via dxt = φt(x)dt. This is equivalent to say that there exists a curve of densities {ρt : t ∈[0, 1]} such that ∂tρt = −∇· (φtρt), and ρ0 = q, ρ1 = p. It is therefore natural to define a geodesic distance between q and p via WH(q, p) = inf {φt, ρt} Z 1 0 ||φt||Hdt, s.t. ∂tρt = −∇· (φtρt), ρ0 = p, ρ1 = q . (20) We call WH(p, q) an H-Wasserstein (or optimal transport) distance between p and q, in connection with the typical 2-Wasserstein distance, which can be viewed as a special case of (20) by taking H to be the L2 ρt space equipped with norm ||f||L2ρt = Eρt[f 2], replacing the cost with R ||φt||L2ρt dt; the 2-Wasserstein distance is widely known to relate to Langevin dynamics as we discuss more in Section 3.5 [e.g., 17, 18]. Now for a given functional F(q), this metric structure induced a notion of functional covariant gradient: the covariant gradient gradHF(q) of F(q) is defined to be a functional that maps q to an element in the tangent space qHq of q, and satisfies F(q + fdt) = F(q) + ⟨gradHF(q), fdt⟩qHq, (21) for any f in the tangent space qHq. 7 Theorem 3.5. Following (21), the gradient of the KL divergence functional F(q) := KL(q || p) is gradHKL(q || p) = ∇· (φ∗ q,pq). Therefore, the SVGD-Valsov equation (13) is a gradient flow of KL divergence under metric WH(·, ·): ∂qt ∂t = −gradHKL(qt || p). In addition, ||gradHKL(q || p)||qHq = D(q || p). Remark We can also definite the functional gradient via gradHF(q) ∝ arg max f : ||f||qHq ≤1  lim ϵ→0+ F(q + ϵf) −F(q) WH(q + ϵf, q)  , which specifies the steepest ascent direction of F(q) (with unit norm). The result in Theorem (3.5) is consistent with this definition. 3.5 Comparison with Langevin Dynamics The theory of SVGD is parallel to that of Langevin dynamics in many perspectives, but with importance differences. We give a brief discussion on their similarities and differences. Langevin dynamics works by iterative updates of form xℓ+1 ←xℓ+ ϵ∇log p(xℓ) + 2√ϵξℓ, ξℓ∼N(0, 1), where a single particle {xℓ} moves along the gradient direction, perturbed with a random Gaussian noise that plays the role of enforcing the diversity to match the variation in p (which is accounted by the deterministic repulsive force in SVGD). Taking the continuous time limit (ϵ →0), We obtain a Ito stochastic differential equation, dxt = −∇log p(xt)dt+2dWt,where Wt is a standard Brownian motion, and x0 is a random variable with initial distribution q0. Standard results show that the density qt of random variable xt is governed by a linear Fokker-Planck equation, following which the KL divergence to p decreases with a rate that equals Fisher divergence: ∂qt ∂t = −∇· (qt∇log p) + ∆qt, d dtKL(qt || p) = −F(qt, p), (22) where F(q, p) = ||∇log(q/p)||2 L2q. This result is parallel to Theorem 3.4, and the role of square Stein discrepancy (and RKHS H) is replaced by Fisher divergence (and L2 q space). Further, parallel to Theorem 3.5, it is well known that (22) can be also treated as a gradient flow of the KL functional KL(q || p), but under the 2-Wasserstein metric W2(q, p) [17]. The main advantage of using RKHS over L2 q is that it allows tractable computation of the optimal transport direction; this is not case when using L2 q and as a result Langevin dynamics requires a random diffusion term in order to form a proper approximation. Practically, SVGD has the advantage of being deterministic, and reduces to exact MAP optimization when using only a single particle, while Langevin dynamics has the advantage of being a standard MCMC method, inheriting its statistical properties, and does not require an O(n2) cost to calculate the n-body interactions as SVGD. However, the connections between SVGD and Langevin dynamics may allow us to develop theories and algorithms that unify the two, or combine their advantages. 4 Conclusion and Open Questions We developed a theoretical framework for analyzing the asymptotic properties of Stein variational gradient descent. Many components of the analysis provide new insights in both theoretical and practical aspects. For example, our new metric structure can be useful for solving other learning problems by leveraging its computational tractability. Many important problems remains to be open. For example, an important open problem is to establish explicit convergence rate of SVGD, for which the existing theoretical literature on Langevin dynamics and interacting particles systems may provide insights. Another problem is to develop finite sample bounds for SVGD that can take the fact that it reduces to MAP optimization when n = 1 into account. It is also an important direction to understand the bias and variance of SVGD particles, or combine it with traditional Monte Carlo whose bias-variance analysis is clearer (see e.g., [19]). 8 Acknowledgement This work is supported in part by NSF CRII 1565796. We thank Lester Mackey and the anonymous reviewers for their comments. References [1] Q. Liu and D. Wang. Stein variational gradient descent: A general purpose bayesian inference algorithm. In Advances in Neural Information Processing Systems, 2016. [2] M. J. Wainwright, M. I. Jordan, et al. Graphical models, exponential families, and variational inference. Foundations and Trends R⃝in Machine Learning, 1(1–2):1–305, 2008. [3] Y. Chen, M. Welling, and A. Smola. Super-samples from kernel herding. In Conference on Uncertainty in Artificial Intelligence (UAI), 2010. [4] J. Dick, F. Y. Kuo, and I. H. Sloan. High-dimensional integration: the quasi-monte carlo way. Acta Numerica, 22:133–288, 2013. [5] B. Dai, N. He, H. Dai, and L. Song. Provable Bayesian inference via particle mirror descent. In The 19th International Conference on Artificial Intelligence and Statistics, 2016. [6] C. Stein. Approximate computation of expectations. Lecture Notes-Monograph Series, 7:i–164, 1986. [7] Q. Liu, J. D. Lee, and M. I. Jordan. A kernelized Stein discrepancy for goodness-of-fit tests and model evaluation. In International Conference on Machine Learning (ICML), 2016. [8] K. Chwialkowski, H. Strathmann, and A. Gretton. A kernel test of goodness-of-fit. In International Conference on Machine Learning (ICML), 2016. [9] C. J. Oates, M. Girolami, and N. Chopin. Control functionals for Monte Carlo integration. Journal of the Royal Statistical Society, Series B, 2017. [10] J. Gorham and L. Mackey. Measuring sample quality with kernels. In International Conference on Machine Learning (ICML), 2017. [11] C. J. Oates, J. Cockayne, F.-X. Briol, and M. Girolami. Convergence rates for a class of estimators based on Stein’s identity. arXiv preprint arXiv:1603.03220, 2016. [12] W. Braun and K. Hepp. The Vlasov dynamics and its fluctuations in the 1/n limit of interacting classical particles. Communications in mathematical physics, 56(2):101–113, 1977. [13] A. A. Vlasov. On vibration properties of electron gas. J. Exp. Theor. Phys, 8(3):291, 1938. [14] H. Spohn. Large scale dynamics of interacting particles. Springer Science & Business Media, 2012. [15] P. Del Moral. Mean field simulation for Monte Carlo integration. CRC Press, 2013. [16] A. Berlinet and C. Thomas-Agnan. Reproducing kernel Hilbert spaces in probability and statistics. Springer Science & Business Media, 2011. [17] F. Otto. The geometry of dissipative evolution equations: the porous medium equation. 2001. [18] C. Villani. Optimal transport: old and new, volume 338. Springer Science & Business Media, 2008. [19] J. Han and Q. Liu. Stein variational adaptive importance sampling. In Uncertainty in Artificial Intelligence, 2017. 9
2017
66
7,185
Variational Inference for Gaussian Process Models with Linear Complexity Ching-An Cheng Institute for Robotics and Intelligent Machines Georgia Institute of Technology Atlanta, GA 30332 cacheng@gatech.edu Byron Boots Institute for Robotics and Intelligent Machines Georgia Institute of Technology Atlanta, GA 30332 bboots@cc.gatech.edu Abstract Large-scale Gaussian process inference has long faced practical challenges due to time and space complexity that is superlinear in dataset size. While sparse variational Gaussian process models are capable of learning from large-scale data, standard strategies for sparsifying the model can prevent the approximation of complex functions. In this work, we propose a novel variational Gaussian process model that decouples the representation of mean and covariance functions in reproducing kernel Hilbert space. We show that this new parametrization generalizes previous models. Furthermore, it yields a variational inference problem that can be solved by stochastic gradient ascent with time and space complexity that is only linear in the number of mean function parameters, regardless of the choice of kernels, likelihoods, and inducing points. This strategy makes the adoption of largescale expressive Gaussian process models possible. We run several experiments on regression tasks and show that this decoupled approach greatly outperforms previous sparse variational Gaussian process inference procedures. 1 Introduction Gaussian process (GP) inference is a popular nonparametric framework for reasoning about functions under uncertainty. However, the expressiveness of GPs comes at a price: solving (approximate) inference for a GP with N data instances has time and space complexities in Θ(N 3) and Θ(N 2), respectively. Therefore, GPs have traditionally been viewed as a tool for problems with small- or medium-sized datasets Recently, the concept of inducing points has been used to scale GPs to larger datasets. The idea is to summarize a full GP model with statistics on a sparse set of M ≪N fictitious observations [18, 24]. By representing a GP with these inducing points, the time and the space complexities are reduced to O(NM 2 + M 3) and O(NM + M 2), respectively. To further process datasets that are too large to fit into memory, stochastic approximations have been proposed for regression [10] and classification [11]. These methods have similar complexity bounds, but with N replaced by the size of a mini-batch Nm. Despite the success of sparse models, the scalability issues of GP inference are far from resolved. The major obstruction is that the cubic complexity in M in the aforementioned upper-bound is also a lower-bound, which results from the inversion of an M-by-M covariance matrix defined on the inducing points. As a consequence, these models can only afford to use a small set of M basis functions, limiting the expressiveness of GPs for prediction. In this work, we show that superlinear complexity is not completely necessary. Inspired by the reproducing kernel Hilbert space (RKHS) representation of GPs [2], we propose a generalized variational GP model, called DGPs (Decoupled Gaussian Processes), which decouples the bases 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. a, B α,β θ α = β N ̸= M Time Space SVDGP SGA SGA SGA FALSE TRUE O(DNMα + NM 2 β + M 3 β) O(NMα + M 2 β) SVI SNGA SGA SGA TRUE TRUE O(DNM + NM 2 + M 3) O(NM + M 2) iVSGPR SMA SMA SGA TRUE TRUE O(DNM + NM 2 + M 3) O(NM + M 2) VSGPR CG CG CG TRUE TRUE O(DNM + NM 2 + M 3) O(NM + M 2) GPR CG CG CG TRUE FALSE O(DN 2 + N 3) O(N 2) Table 1: Comparison between SVDGP and variational GPR algorithms: SVI [10], iVSGPR [2], VSGPR [24], and GPR [19], where N is the number of observations/the size of a mini-batch, M, Mα, Mβ are the number of basis functions, and D is the input dimension. Here it is assumed Mα ≥Mβ 1. (a) M = 10 (b) Mα = 100, Mβ = 10 (c) M = 100 Figure 1: Comparison between models with shared and decoupled basis. (a)(c) denote the models with shared basis of size M. (b) denotes the model of decoupled basis with size (Mα, Mβ). In each figure, the red line denotes the ground truth; the blue circles denote the observations; the black line and the gray area denote the mean and variance in prediction, respectively. for the mean and the covariance functions. Specifically, let Mα and Mβ be the numbers of basis functions used to model the mean and the covariance functions, respectively. Assume Mα ≥Mβ. We show, when DGPs are used as a variational posterior [24], the associated variational inference problem can be solved by stochastic gradient ascent with space complexity O(NmMα + M 2 β) and time complexity O(DNmMα + NmM 2 β + M 3 β), where D is the input dimension. We name this algorithm SVDGP. As a result, we can choose Mα ≫Mβ, which allows us to keep the time and space complexity similar to previous methods (by choosing Mβ = M) while greatly increasing accuracy. To the best of our knowledge, this is the first variational GP algorithm that admits linear complexity in Mα, without any assumption on the choice of kernel and likelihood. While we design SVDGP for general likelihoods, in this paper we study its effectiveness in Gaussian process regression (GPR) tasks. We consider this is without loss of generality, as most of the sparse variational GPR algorithms in the literature can be modified to handle general likelihoods by introducing additional approximations (e.g. in Hensman et al. [11] and Sheth et al. [22]). Our experimental results show that SVDGP significantly outperforms the existing techniques, achieving higher variational lower bounds and lower prediction errors when evaluated on held-out test sets. 1.1 Related Work Our framework is based on the variational inference problem proposed by Titsias [24], which treats the inducing points as variational parameters to allow direct approximation of the true posterior. This is in contrast to Seeger et al. [21], Snelson and Ghahramani [23], Quiñonero-Candela and Rasmussen [18], and Lázaro-Gredilla et al. [15], which all use inducing points as hyper-parameters of a degenerate prior. While both approaches have the same time and space complexity, the latter additionally introduces a large set of unregularized hyper-parameters and, therefore, is more likely to suffer from over-fitting [1]. In Table 1, we compare SVDGP with recent GPR algorithms in terms of the assumptions made and the time and space complexity. Each algorithm can be viewed as a special way to solve the maximization of the variational lower bound (5), presented in Section 3.2. Our algorithm SVDGP generalizes the previous approaches to allow the basis functions for the mean and the covariance to be decoupled, so an approximate solution can be found by stochastic gradient ascent in linear complexity. 1The first three columns show the algorithms to update the parameters: SGA/SNGA/SMA denotes stochastic gradient/natural gradient/mirror ascent, and CG denotes batch nonlinear conjugate gradient ascent. The 4th and the 5th columns indicate whether the bases for mean and covariance are strictly shared, and whether a variational posterior can be used. The last two columns list the time and space complexity. 2 To illustrate the idea, we consider a toy GPR example in Figure 1. The dataset contains 500 noisy observations of a sinc function. Given the same training data, we conduct experiments with three different GP models. Figure 1 (a)(c) show the results of the traditional coupled basis, which can be solved by any of the variational algorithms listed in Table 1, and Figure 1 (b) shows the result using the decoupled approach SVDGP. The sizes of basis and observations are selected to emulate a large dataset scenario. We can observe SVDGP achieves a nice trade-off between prediction performance and complexity: it achieves almost the same accuracy in prediction as the full-scale model in Figure 1(c) and preserves the overall shape of the predictive variance. In addition to the sparse algorithms above, some recent attempts aim to revive the non-parametric property of GPs by structured covariance functions. For example, Wilson and Nickisch [27] proposes to space the inducing points on a multidimensional lattice, so the time and space complexities of using a product kernel becomes O(N +DM 1+1/D) and O(N +DM 1+2/D), respectively. However, because M = cD, where c is the number of grid points per dimension, the overall complexity is exponential in D and infeasible for high-dimensional data. Another interesting approach by Hensman et al. [12] combines variational inference [24] and a sparse spectral approximation [15]. By equally spacing inducing points on the spectrum, they show the covariance matrix on the inducing points have diagonal plus low-rank structure. With MCMC, the algorithm can achieve complexity O(DNM). However, the proposed structure in [12] does not help to reduce the complexity when an approximate Gaussian posterior is favored or when the kernel hyper-parameters need to be updated. Other kernel methods with linear complexity have been proposed using functional gradient descent [14, 5]. However, because these methods use a model strictly the same size as the entire dataset, they fail to estimate the predictive covariance, which requires Ω(N 2) space complexity. Moreover, they cannot learn hyper-parameters online. The latter drawback also applies to greedy algorithms based on rank-one updates, e.g. the algorithm of Csató and Opper [4]. In contrast to these previous methods, our algorithm applies to all choices of inducing points, likelihoods, and kernels, and we allow both variational parameters and hyper-parameters to adapt online as more data are encountered. 2 Preliminaries In this section, we briefly review the inference for GPs and the variational framework proposed by Titsias [24]. For now, we will focus on GPR for simplicity of exposition. We will discuss the case of general likelihoods in the next section when we introduce our framework, DGPs. 2.1 Inference for GPs Let f : X →R be a latent function defined on a compact domain X ⊂RD. Here we assume a priori that f is distributed according to a Gaussian process GP(m, k). That is, ∀x, x′ ∈X, E[f(x)] = m(x) and C[f(x), f(x′)] = k(x, x′). In short, we write f ∼GP(m, k). A GP probabilistic model is composed of a likelihood p(y|f(x)) and a GP prior GP(m, k); in GPR, the likelihood is assumed to be Gaussian i.e. p(y|f(x)) = N(y|f(x), σ2) with variance σ2. Usually, the likelihood and the GP prior are parameterized by some hyper-parameters, which we summarize as θ. This includes, for example, the variance σ2 and the parameters implicitly involved in defining k(x, x′). For notational convenience, and without loss of generality, we assume m(x) = 0 in the prior distribution and omit explicitly writing the dependence of distributions on θ. Assume we are given a dataset D = {(xn, yn)}N n=1, in which xn ∈X and yn ∼p(y|f(xn)). Let2 X = {xn}N n=1 and y = (yn)N n=1. Inference for GPs involves solving for the posterior pθ∗(f(x)|y) for any new input x ∈X, where θ∗= arg maxθ log pθ(y). For example in GPR, because the likelihood is Gaussian, the predictive posterior is also Gaussian with mean and covariance m|y(x) = kx,X(KX + σ2I)−1y, k|y(x, x′) = kx,x′ −kx,X(KX + σ2I)−1kX,x′, (1) and the hyper-parameter θ∗can be found by nonlinear conjugate gradient ascent [19] max θ log pθ(y) = max θ log N(y|0, KX + σ2I), (2) 2In notation, we use boldface to distinguish finite-dimensional vectors (lower-case) and matrices (upper-case) that are used in computation from scalar and abstract mathematical objects. 3 where k·,·, k·,· and K·,· denote the covariances between the sets in the subscript.3 One can show that these two functions, m|y(x) and k|y(x, x′), define a valid GP. Therefore, given observations y, we say f ∼GP(m|y, k|y). Although theoretically GPs are non-parametric and can model any function as N →∞, in practice this is difficult. As the inference has time complexity Ω(N 3) and space complexity Ω(N 2), applying vanilla GPs to large datasets is infeasible. 2.2 Variational Inference with Sparse GPs To scale GPs to large datasets, Titsias [24] introduced a scheme to compactly approximate the true posterior with a sparse GP, GP( ˆm|y, ˆk|y), defined by the statistics on M ≪N function values: {Lmf(˜xm)}M m=1, where Lm is a bounded linear operator4 and ˜xm ∈X. Lmf(·) is called an inducing function and ˜xm an inducing point. Common choices of Lm include the identity map (as used originally by Titsias [24]) and integrals to achieve better approximation or to consider multidomain information [26, 7, 3]. Intuitively, we can think of {Lmf(˜xm)}M m=1 as a set of potentially indirect observations that capture salient information about the unknown function f. Titsias [24] solves for GP( ˆm|y, ˆk|y) by variational inference. Let ˜X = {˜xm}M m=1 and let fX ∈RN and f ˜ X ∈RM be the (inducing) function values defined on X and ˜X, respectively. Let p(f ˜ X) be the prior given by GP(m, k) and define q(f ˜ X) = N(f ˜ X| ˜m, ˜S) to be its variational posterior, where ˜m ∈RM and ˜S ∈RM×M are the mean and the covariance of the approximate posterior of f ˜ X. Titsias [24] proposes to use q(fX, f ˜ X) = p(fX|f ˜ X)q(f ˜ X) as the variational posterior to approximate p(fX, f ˜ X|y) and to solve for q(f ˜ X) together with the hyper-parameter θ through max θ, ˜ X, ˜ m,˜S Lθ( ˜X, ˜m, ˜S) = max θ, ˜ X, ˜ m,˜S Z q(fX, f ˜ X) log p(y|fX)p(fX|f ˜ X)p(f ˜ X) q(fX, f ˜ X) dfXdf ˜ X, (3) where Lθ is a variational lower bound of log pθ(y), p(fX|f ˜ X) = N(fX|KX, ˜ XK−1 ˜ X f ˜ X, KX −ˆKX) is the conditional probability given in GP(m, k), and ˆKX = KX, ˜ XK−1 ˜ X K ˜ X,X. At first glance, the specific choice of variational posterior q(fX, f ˜ X) seems heuristic. However, although parameterized finitely, it resembles a full-fledged GP GP( ˆm|y, ˆk|y): ˆm|y(x) = kx, ˜ XK−1 ˜ X ˜m, ˆk|y(x, x′) = kx,x′ + kx, ˜ XK−1 ˜ X  ˜S −K ˜ X  K−1 ˜ X k ˜ X,x′. (4) This result is further studied in Matthews et al. [16] and Cheng and Boots [2], where it is shown that (3) is indeed minimizing a proper KL-divergence between Gaussian processes/measures. By comparing (2) and (3), one can show that the time and the space complexities now reduce to O(DNM + M 2N + M 3) and O(M 2 + MN), respectively, due to the low-rank structure of ˆK ˜ X [24]. To further reduce complexity, stochastic optimization, such as stochastic natural ascent [10] or stochastic mirror descent [2] can be applied. In this case, N in the above asymptotic bounds would be replaced by the size of a mini-batch Nm. The above results can be modified to consider general likelihoods as in [22, 11]. 3 Variational Inference with Decoupled Gaussian Processes Despite the success of sparse GPs, the scalability issues of GPs persist. Although parameterizing a GP with inducing points/functions enables learning from large datasets, it also restricts the expressiveness of the model. As the time and the space complexities still scale in Ω(M 3) and Ω(M 2), we cannot learn or use a complex model with large M. In this work, we show that these two complexity bounds, which have long accompanied GP models, are not strictly necessary, but are due to the tangled representation canonically used in the GP 3If the two sets are the same, only one is listed. 4Here we use the notation Lmf loosely for the compactness of writing. Rigorously, Lm is a bounded linear operator acting on m and k, not necessarily on all sample paths f. 4 literature. To elucidate this, we adopt the dual representation of Cheng and Boots [2], which treats GPs as linear operators in RKHS. But, unlike Cheng and Boots [2], we show how to decouple the basis representation of mean and covariance functions of a GP and derive a new variational problem, which can be viewed as a generalization of (3). We show that this problem—with arbitrary likelihoods and kernels—can be solved by stochastic gradient ascent with linear complexity in Mα, the number of parameters used to specify the mean function for prediction. In the following, we first review the results in [2]. We next introduce the decoupled representation, DGPs, and its variational inference problem. Finally, we present SVDGP and discuss the case with general likelihoods. 3.1 Gaussian Processes as Gaussian Measures Let an RKHS H be a Hilbert space of functions with the reproducing property: ∀x ∈X, ∃φx ∈H such that ∀f ∈H, f(x) = φT x f.5 A Gaussian process GP(m, k) is equivalent to a Gaussian measure ν on Banach space B which possesses an RKHS H [2]:6 there is a mean functional µ ∈H and a bounded positive semi-definite linear operator Σ : H →H, such that for any x, x′ ∈X, ∃φx, φx′ ∈H, we can write m(x) = φT x µ and k(x, x′) = φT x Σφx′. The triple (B, ν, H) is known as an abstract Wiener space [9, 6], in which H is also called the Cameron-Martin space. Here the restriction that µ, Σ are RKHS objects is necessary, so the variational inference problem in the next section can be well-defined. We call this the dual representation of a GP in RKHS H (the mean function m and the covariance function k are realized as linear operators µ and Σ defined in H). With abuse of notation, we write N(f|µ, Σ) in short. This notation does not mean a GP has a Gaussian distribution in H, nor does it imply that the sample paths from GP(m, k) are necessarily in H. Precisely, B contains the sample paths of GP(m, k) and H is dense in B. In most applications of GP models, B is the Banach space of continuous function C(X; Y) and H is the span of the covariance function. As a special case, if H is finite-dimensional, B and H coincide and ν becomes equivalent to a Gaussian distribution in a Euclidean space. In relation to our previous notation in Section 2.1: suppose k(x, x′) = φT x φx′ and φx : X →H is a feature map to some Hilbert space H. Then we have assumed a priori that GP(m, k) = N(f|0, I) is a normal Gaussian measure; that is GP(m, k) samples functions f in the form f(x) = Pdim H l=1 φl(x)T ϵl, where ϵl ∼N(0, 1) are independent. Note if dim H = ∞, with probability one f is not in H, but fortunately H is large enough for us to approximate the sampled functions. In particular, it can be shown that the posterior GP(m|y, k|y) in GPR has a dual RKHS representation in the same RKHS as the prior GP [2]. 3.2 Variational Inference in Gaussian Measures Cheng and Boots [2] proposes a dual formulation of (3) in terms of Gaussian measures7: max q(f),θ Lθ(q(f)) = max q(f),θ Z q(f) log pθ(y|f)p(f) q(f) df = max q(f),θ Eq[log pθ(y|f)] −KL[q||p], (5) where q(f) = N(f|˜µ, ˜Σ) is a variational Gaussian measure and p(f) = N(f|0, I) is a normal prior. Its connection to the inducing points/functions in (3) can be summarized as follows [2, 3]: Define a linear operator Ψ ˜ X : RM →H as a 7→PM m=1 amψ˜xm, where ψ˜xm ∈H is defined such that ψT ˜xmµ = E[Lmf(˜xm)]. Then (3) and (5) are equivalent, if q(f) has a subspace parametrization, ˜µ = Ψ ˜ Xa, ˜Σ = I + Ψ ˜ XAΨT ˜ X, (6) with a ∈RM and A ∈RM×M satisfying ˜m = K ˜ Xa, and ˜S = K ˜ X + K ˜ XAK ˜ X. In other words, the variational inference algorithms in the literature are all using a variational Gaussian measure in which ˜µ and ˜Σ are parametrized by the same basis {ψ˜xm|˜xm ∈˜X}M i=1. 5To simplify the notation, we write φT x f for ⟨f, φx⟩H, and f T Lg for ⟨f, Lg⟩H, where f, g ∈H and L : H →H, even if H is infinite-dimensional. 6Such H w.l.o.g. can be identified as the natural RKHS of the covariance function of a zero-mean prior GP. 7 We assume q(f) is absolutely continuous wrt p(f), which is true as p(f) is non-degenerate. The integral denotes the expectation of log pθ(y|f) + log p(f) q(f) over q(f), and q(f) p(f) denotes the Radon-Nikodym derivative. 5 Compared with (3), the formulation in (5) is neater: it follows the definition of the very basic variational inference problem. This is not surprising, since GPs can be viewed as Bayesian linear models in an infinite-dimensional space. Moreover, in (5) all hyper-parameters are isolated in the likelihood pθ(y|f), because the prior is fixed as a normal Gaussian measure. 3.3 Disentangling the GP Representation with DGPs While Cheng and Boots [2] treat (5) as an equivalent form of (3), here we show that it is a generalization. By further inspecting (5), it is apparent that sharing the basis Ψ ˜ X between ˜µ and ˜Σ in (6) is not strictly necessary, since (5) seeks to optimize two linear operators, ˜µ and ˜Σ. With this in mind, we propose a new parametrization that decouples the bases for ˜µ and ˜Σ: ˜µ = Ψαa, ˜Σ = (I + ΨβBΨT β )−1 (7) where Ψα : RMα →H and Ψβ : RMβ →H denote linear operators defined similarly to Ψ ˜ X and B ⪰0 ∈RMβ×Mβ. Compared with (6), here we parametrize ˜Σ through its inversion with B so the condition that ˜Σ ⪰0 can be easily realized as B ⪰0. This form agrees with the posterior covariance in GPR [2] and will give a posterior that is strictly less uncertain than the prior. Note the choice of decoupled parametrization is not unique. In particular, the bases can be partially shared, or (a, B) can be further parametrized (e.g. B can be parametrized using the canonical form in (4)) to improve the numerical convergence rate. Please refer to Appendix A for a discussion.8 The decoupled subspace parametrization (7) corresponds to a DGP, GP( ˆmα |y, ˆkβ |y), with mean and covariance functions as 9 ˆmα |y(x) = kx,αa, ˆkβ |y(x, x′) = kx,x′ −kx,β B−1 + Kβ −1 kβ,x′. (8) While the structure of (8) looks similar to (4), directly replacing the basis ˜X in (4) with α and β is not trivial. Because the equations in (4) are derived from the traditional viewpoint of GPs as statistics on function values, the original optimization problem (3) is not defined if α ̸= β and therefore, it is not clear how to learn a decoupled representation traditionally. Conversely, by using the dual RKHS representation, the objective function to learn (8) follows naturally from (5), as we will show next. 3.4 SVDGP: Algorithm and Analysis Substituting the decoupled subspace parametrization (7) into the variational inference problem in (5) results in a numerical optimization problem: maxq(f),θ Eq[log pθ(y|f)] −KL[q||p] with KL[q||p] = 1 2aT Kαa + 1 2 log |I + KβB| + −1 2 tr Kβ(B−1 + Kβ)−1 (9) Eq[log pθ(y|f)] = N X n=1 Eq(f(xn))[log pθ(yn|f(xn))] (10) where each expectation is over a scalar Gaussian q(f(xn)) given by (8) as functions of (a, α) and (B, β). Our objective function contains [11] as a special case, which assumes α = β = ˜X. In addition, we note that Hensman et al. [11] indirectly parametrize the posterior by ˜m and ˜S = LLT , whereas we parametrize directly by (6) with a for scalability and B = LLT for better stability (which always reduces the uncertainty in the posterior compared with the prior). We notice that (a, α) and (B, β) are completely decoupled in (9) and potentially combined again in (10). In particular, if pθ(yn|f(xn)) is Gaussian as in GPR, we have an additional decoupling, i.e. Lθ(a, B, α, β) = Fθ(a, α)+Gθ(B, β) for some Fθ(a, α) and Gθ(B, β). Intuitively, the optimization 8Appendix A is partially based on a discussion with Hugh Salimbeni at the NIPS conference. Here we adopt the fully decoupled, directly parametrized form in (7) to demonstrate the idea. We leave the full comparison of different decoupled parametrizations in future work. 9In practice, we can parametrize B = LLT with Cholesky factor L ∈RMβ×Mβ so the problem is unconstrained. The required terms in (8) and later in (9) can be stably computed as B−1 + Kβ −1 = LH−1LT and log |I + KβB| = log |H|, where H = I + LT KβL. 6 Algorithm 1 Online Learning with DGPs Parameters: Mα, Mβ, Nm, N∆ Input: M(a, B, α, β, θ) , D 1: θ0 ←initializeHyperparameters( sampleMinibatch(D, Nm) ) 2: for t = 1 . . . T do 3: Dt ←sampleMinibatch(D, Nm) 4: M.addBasis(Dt, N∆, Mα, Mβ) 5: M.updateModel(Dt, t) 6: end for over (a, α) aims to minimize the fitting-error, and the optimization over (B, β) aims to memorize the samples encountered so far; the mean and the covariance functions only interact indirectly through the optimization of the hyper-parameter θ. One salient feature of SVDGP is that it tends to overestimate, rather than underestimate, the variance, when we select Mβ ≤Mα. This is inherited from the non-degeneracy property of the variational framework [24] and can be seen in the toy example in Figure 1. In the extreme case when Mβ = 0, we can see the covariance in (8) becomes the same as the prior; moreover, the objective function of SVDGP becomes similar to kernel methods (exactly the same as kernel ridge regression, when the likelihood is Gaussian). The additional inclusion of expected log-likelihoods here allows SVDGP to learn the hyper-parameters in a unified framework, as its objective function can be viewed as minimizing a generalization upper-bound in PAC-Bayes learning [8]. SVDGP solves the above optimization problem by stochastic gradient ascent. Here we purposefully ignore specific details of pθ(y|f) to emphasize that SVDGP can be applied to general likelihoods as it only requires unbiased first-order information, which e.g. can be found in [22]. In addition to having a more adaptive representation, the main benefit of SVDGP is that the computation of an unbiased gradient requires only linear complexity in Mα, as shown below (see Appendix Bfor details). KL-Divergence Assume |α| = O(DMα) and |β| = O(DMβ). By (9), One can show ∇aKL[q||p] = Kαa and ∇BKL[q||p] = 1 2(I+KβB)−1KβBKβ(I+BKβ)−1. Therefore, the time complexity to compute ∇aKL[q||p] can be reduced to O(NmMα) if we sample over the columns of Kα with a mini-batch of size Nm. By contrast, the time complexity to compute ∇BKL[q||p] will always be Θ(M 3 β) and cannot be further reduced, regardless of the parametrization of B.10 The gradient with respect to α and β can be derived similarly and have time complexity O(DNmMα) and O(DM 2 β + M 3 β), respectively. Expected Log-Likelihood Let ˆm(a, α) ∈RN and ˆs(B, β) ∈RN be the vectors of the mean and covariance of scalar Gaussian q(f(xn)) for n ∈{1, . . . , N}. As (10) is a sum over N terms, by sampling with a mini-batch of size Nm, an unbiased gradient of (10) with respect to (θ, ˆm,ˆs) can be computed in O(Nm). To compute the full gradient with respect to (a, B, α, β), we compute the derivative of ˆm and ˆs with respect to (a, B, α, β) and then apply chain rule. These steps take O(DNmMα) and O(DNmMβ + NmM 2 β + M 3 β) for (a, α) and (B, β), respectively. The above analysis shows that the curse of dimensionality in GPs originates in the covariance function. For space complexity, the decoupled parametrization (7) requires memory in O(NmMα + M 2 β); for time complexity, an unbiased gradient with respect to (a, α) can be computed in O(DNmMα), but that with respect to (B, β) has time complexity Ω(DNmMβ + NmM 2 β + M 3 β). This motivates choosing Mβ = O(M) and Mα in O(M 2 β) or O(M 3 β), which maintains the same complexity as previous variational techniques but greatly improves the prediction performance. 4 Experimental Results We compare our new algorithm, SVDGP, with the state-of-the-art incremental algorithms for sparse variational GPR, SVI [10] and iVSGPR [2], as well as the classical GPR and the batch algorithm VSGPR [24]. As discussed in Section 1.1, these methods can be viewed as different ways to optimize (5). Therefore, in addition to the normalized mean square error (nMSE) [19] in prediction, we report 10Due to Kβ, the complexity would remain as O(M 3 β) even if B is constrained to be diagonal. 7 KUKA1 - Variational Lower Bound (105) SVDGP SVI iVSGPR VSGPR GPR mean 1.262 0.391 0.649 0.472 -5.335 std 0.195 0.076 0.201 0.265 7.777 KUKA1 - Prediction Error (nMSE) SVDGP SVI iVSGPR VSGPR GPR mean 0.037 0.169 0.128 0.139 0.231 std 0.013 0.025 0.033 0.026 0.045 MUJOCO1 - Variational Lower Bound (105) SVDGP SVI iVSGPR VSGPR GPR mean 6.007 2.178 4.543 2.822 -10312.727 std 0.673 0.692 0.898 0.871 22679.778 MUJOCO1 - Prediction Error (nMSE) SVDGP SVI iVSGPR VSGPR GPR mean 0.072 0.163 0.099 0.118 0.213 std 0.013 0.053 0.026 0.016 0.061 Table 2: Experimental results of KUKA1 and MUJOCO1 after 2,000 iterations. the performance in the variational lower bound (VLB) (5), which also captures the quality of the predictive variance and hyper-parameter learning.11 These two metrics are evaluated on held-out test sets in all of our experimental domains. Algorithm 1 summarizes the online learning procedure used by all stochastic algorithms,12 where each learner has to optimize all the parameters on-the-fly using i.i.d. data. The hyper-parameters are first initialized heuristically by median trick using the first mini-batch. We incrementally build up the variational posterior by including N∆≤Nm observations in each mini-batch as the initialization of new variational basis functions. Then all the hyper-parameters and the variational parameters are updated online. These steps are repeated for T iterations. For all the algorithms, we assume the prior covariance is defined by the SE-ARD kernel [19] and we use the generalized SE-ARD kernel [2] as the inducing functions in the variational posterior (see Appendix C for details). We note that all algorithms in comparison use the same kernel and optimize both the variational parameters (including inducing points) and the hyperparameters. In particular, we implement SGA by ADAM [13] (with default parameters β1 = 0.9 and β2 = 0.999). The step-size for each stochastic algorithms is scheduled according to γt = γ0(1 + 0.1 √ t)−1, where γ0 ∈{10−1, 10−2, 10−3} is selected manually for each algorithm to maximize the improvement in objective function after the first 100 iterations. We test each stochastic algorithm for T = 2000 iterations with mini-batches of size Nm = 1024 and the increment size N∆= 128. Finally, the model sizes used in the experiments are listed as follows: Mα = 1282 and Mβ = 128 for SVDGP; M = 1024 for SVI; M = 256 for iVSGPR; M = 1024, N = 4096 for VSGPR; N = 1024 for GP. These settings share similar order of time complexity in our current Matlab implementation. 4.1 Datasets Inverse Dynamics of KUKA Robotic Arm This dataset records the inverse dynamics of a KUKA arm performing rhythmic motions at various speeds [17]. The original dataset consists of two parts: KUKA1 and KUKA2, each of which have 17,560 offline data and 180,360 online data with 28 attributes and 7 outputs. In the experiment, we mix the online and the offline data and then split 90% as training data (178,128 instances) and 10% testing data (19,792 instances) to satisfy the i.i.d. assumption. Walking MuJoCo MuJoCo (Multi-Joint dynamics with Contact) is a physics engine for research in robotics, graphics, and animation, created by [25]. In this experiment, we gather 1,000 walking trajectories by running TRPO [20]. In each time frame, the MuJoCo transition dynamics have a 23-dimensional input and a 17-dimensional output. We consider two regression problems to predict 9 of the 17 outputs from the input13: MUJOCO1 which maps the input of the current frame (23 dimensions) to the output, and MUJOCO2 which maps the inputs of the current and the previous frames (46 dimensions) to the output. In each problem, we randomly select 90% of the data as training data (842,745 instances) and 10% as test data (93,608 instances). 4.2 Results We summarize part of the experimental results in Table 2 in terms of nMSE in prediction and VLB. While each output is treated independently during learning, Table 2 present the mean and the standard 11The exact marginal likelihood is computationally infeasible to evaluate for our large model. 12The algorithms differs only in whether the bases are shared and how the model is updated (see Table 1). 13Because of the structure of MuJoCo dynamics, the rest 8 outputs can be trivially known from the input. 8 (a) Sample Complexity (b) Time Complexity Figure 2: An example of online learning results (the 9th output of MUJOCO1 dataset). The blue, red, and yellow lines denote SVDGP, SVI, and iVSGPR, respectively. deviation over all the outputs as the selected metrics are normalized. For the complete experimental results, please refer to Appendix D. We observe that SVDGP consistently outperforms the other approaches with much higher VLBs and much lower prediction errors; SVDGP also has smaller standard deviation. These results validate our initial hypothesis that adopting a large set of basis functions for the mean can help when modeling complicated functions. iVSGPR has the next best result after SVDGP, despite using a basis size of 256, much smaller than that of 1,024 in SVI, VSGPR, and GPR. Similar to SVDGP, iVSGPR also generalizes better than the batch algorithms VSGPR and GPR, which only have access to a smaller set of training data and are more prone to over-fitting. By contrast, the performance of SVI is surprisingly worse than VSGPR. We conjecture this might be due to the fact that the hyper-parameters and the inducing points/functions are only crudely initialized in online learning. We additionally find that the stability of SVI is more sensitive to the choice of step size than other methods. This might explain why in [10, 2] batch data was used to initialize the hyper-parameters and the learning rate to update the hyper-parameters was selected to be much smaller than that for stochastic natural gradient ascent. To further investigate the properties of different stochastic approximations, we show the change of VLB and the prediction error over iterations and time in Figure 2. Overall, whereas iVSGPR and SVI share similar convergence rate, the behavior of SVDGP is different. We see that iVSGPR converges the fastest, both in time and sample complexity. Afterwards, SVDGP starts to descend faster and surpass the other two methods. From Figure 2, we can also observe that although SVI has similar convergence to iVSGPR, it slows down earlier and therefore achieves a worse result. These phenomenon are observed in multiple experiments. 5 Conclusion We propose a novel, fully-differentiable framework, Decoupled Gaussian Processes DGPs, for largescale GP problems. By decoupling the representation, we derive a variational inference problem that can be solved with stochastic gradients with linear time and space complexity. Compared with existing algorithms, SVDGP can adopt a much larger set of basis functions to predict more accurately. Empirically, SVDGP significantly outperforms state-of-the-arts variational sparse GPR algorithms in multiple regression tasks. These encouraging experimental results motivate further application of SVDGP to end-to-end learning with neural networks in large-scale, complex real world problems. Acknowledgments This work was supported in part by NSF NRI award 1637758. The authors additionally thank the reviewers and Hugh Salimbeni for productive discussion which improved the quality of the paper. References [1] Matthias Bauer, Mark van der Wilk, and Carl Edward Rasmussen. Understanding probabilistic sparse Gaussian process approximations. In Advances in Neural Information Processing Systems, 9 pages 1525–1533, 2016. [2] Ching-An Cheng and Byron Boots. Incremental variational sparse Gaussian process regression. In Advances in Neural Information Processing Systems, pages 4403–4411, 2016. [3] Ching-An Cheng and Han-Pang Huang. Learn the Lagrangian: A vector-valued RKHS approach to identifying Lagrangian systems. IEEE Transactions on Cybernetics, 46(12):3247–3258, 2016. [4] Lehel Csató and Manfred Opper. Sparse representation for Gaussian process models. Advances in Neural Information Processing Systems, pages 444–450, 2001. [5] Bo Dai, Bo Xie, Niao He, Yingyu Liang, Anant Raj, Maria-Florina F Balcan, and Le Song. Scalable kernel methods via doubly stochastic gradients. In Advances in Neural Information Processing Systems, pages 3041–3049, 2014. [6] Nathaniel Eldredge. Analysis and probability on infinite-dimensional spaces. arXiv preprint arXiv:1607.03591, 2016. [7] Anibal Figueiras-Vidal and Miguel Lázaro-gredilla. Inter-domain Gaussian processes for sparse inference using inducing features. In Advances in Neural Information Processing Systems, pages 1087–1095, 2009. [8] Pascal Germain, Francis Bach, Alexandre Lacoste, and Simon Lacoste-Julien. Pac-bayesian theory meets bayesian inference. In Advances in Neural Information Processing Systems, pages 1884–1892, 2016. [9] Leonard Gross. Abstract wiener spaces. In Proceedings of the Fifth Berkeley Symposium on Mathematical Statistics and Probability, Volume 2: Contributions to Probability Theory, Part 1, pages 31–42. University of California Press, 1967. [10] James Hensman, Nicolo Fusi, and Neil D. Lawrence. Gaussian processes for big data. arXiv preprint arXiv:1309.6835, 2013. [11] James Hensman, Alexander G. de G. Matthews, and Zoubin Ghahramani. Scalable variational Gaussian process classification. In International Conference on Artificial Intelligence and Statistics, 2015. [12] James Hensman, Nicolas Durrande, and Arno Solin. Variational Fourier features for Gaussian processes. arXiv preprint arXiv:1611.06740, 2016. [13] Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. [14] Jyrki Kivinen, Alexander J Smola, and Robert C Williamson. Online learning with kernels. IEEE transactions on signal processing, 52(8):2165–2176, 2004. [15] Miguel Lázaro-Gredilla, Joaquin Quiñonero-Candela, Carl Edward Rasmussen, and Aníbal R. Figueiras-Vidal. Sparse spectrum Gaussian process regression. Journal of Machine Learning Research, 11(Jun):1865–1881, 2010. [16] Alexander G. de G. Matthews, James Hensman, Richard E. Turner, and Zoubin Ghahramani. On sparse variational methods and the Kullback-Leibler divergence between stochastic processes. In Proceedings of the Nineteenth International Conference on Artificial Intelligence and Statistics, 2016. [17] Franziska Meier, Philipp Hennig, and Stefan Schaal. Incremental local Gaussian regression. In Advances in Neural Information Processing Systems, pages 972–980, 2014. [18] Joaquin Quiñonero-Candela and Carl Edward Rasmussen. A unifying view of sparse approximate Gaussian process regression. The Journal of Machine Learning Research, 6:1939–1959, 2005. [19] Carl Edward Rasmussen and Christopher K. I. Williams. Gaussian processes for machine learning. 2006. [20] John Schulman, Sergey Levine, Pieter Abbeel, Michael I. Jordan, and Philipp Moritz. Trust region policy optimization. In Proceedings of the 32nd International Conference on Machine Learning, pages 1889–1897, 2015. [21] Matthias Seeger, Christopher Williams, and Neil Lawrence. Fast forward selection to speed up sparse Gaussian process regression. In Artificial Intelligence and Statistics 9, number EPFL-CONF-161318, 2003. 10 [22] Rishit Sheth, Yuyang Wang, and Roni Khardon. Sparse variational inference for generalized GP models. In Proceedings of the 32nd International Conference on Machine Learning, pages 1302–1311, 2015. [23] Edward Snelson and Zoubin Ghahramani. Sparse Gaussian processes using pseudo-inputs. In Advances in Neural Information Processing Systems, pages 1257–1264, 2005. [24] Michalis K. Titsias. Variational learning of inducing variables in sparse Gaussian processes. In International Conference on Artificial Intelligence and Statistics, pages 567–574, 2009. [25] Emanuel Todorov, Tom Erez, and Yuval Tassa. Mujoco: A physics engine for model-based control. In IEEE/RSJ International Conference on Intelligent Robots and Systems, pages 5026–5033. IEEE, 2012. [26] Christian Walder, Kwang In Kim, and Bernhard Schölkopf. Sparse multiscale Gaussian process regression. In Proceedings of the 25th international conference on Machine learning, pages 1112–1119. ACM, 2008. [27] Andrew Wilson and Hannes Nickisch. Kernel interpolation for scalable structured Gaussian processes (KISS-GP). In Proceedings of the 32nd International Conference on Machine Learning, pages 1775–1784, 2015. 11
2017
660
7,186
The Reversible Residual Network: Backpropagation Without Storing Activations Aidan N. Gomez∗1, Mengye Ren∗1,2,3, Raquel Urtasun1,2,3, Roger B. Grosse1,2 University of Toronto1 Vector Institute for Artificial Intelligence2 Uber Advanced Technologies Group3 {aidan, mren, urtasun, rgrosse}@cs.toronto.edu Abstract Deep residual networks (ResNets) have significantly pushed forward the state-ofthe-art on image classification, increasing in performance as networks grow both deeper and wider. However, memory consumption becomes a bottleneck, as one needs to store the activations in order to calculate gradients using backpropagation. We present the Reversible Residual Network (RevNet), a variant of ResNets where each layer’s activations can be reconstructed exactly from the next layer’s. Therefore, the activations for most layers need not be stored in memory during backpropagation. We demonstrate the effectiveness of RevNets on CIFAR-10, CIFAR-100, and ImageNet, establishing nearly identical classification accuracy to equally-sized ResNets, even though the activation storage requirements are independent of depth. 1 Introduction Over the last five years, deep convolutional neural networks have enabled rapid performance improvements across a wide range of visual processing tasks [19, 26, 20]. For the most part, the state-of-the-art networks have been growing deeper. For instance, deep residual networks (ResNets) [13] are the state-of-the-art architecture across multiple computer vision tasks [19, 26, 20]. The key architectural innovation behind ResNets was the residual block, which allows information to be passed directly through, making the backpropagated error signals less prone to exploding or vanishing. This made it possible to train networks with hundreds of layers, and this vastly increased depth led to significant performance gains. Nearly all modern neural networks are trained using backpropagation. Since backpropagation requires storing the network’s activations in memory, the memory cost is proportional to the number of units in the network. Unfortunately, this means that as networks grow wider and deeper, storing the activations imposes an increasing memory burden, which has become a bottleneck for many applications [34, 37]. Graphics processing units (GPUs) have limited memory capacity, leading to constraints often exceeded by state-of-the-art architectures, some of which reach over one thousand layers [13]. Training large networks may require parallelization across multiple GPUs [7, 28], which is both expensive and complicated to implement. Due to memory constraints, modern architectures are often trained with a mini-batch size of 1 (e.g. [34, 37]), which is inefficient for stochastic gradient methods [11]. Reducing the memory cost of storing activations would significantly improve our ability to efficiently train wider and deeper networks. ∗These authors contributed equally. Code available at https://github.com/renmengye/revnet-public 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. Figure 1: (left) A traditional residual block as in Equation 2. (right-top) A basic residual function. (right-bottom) A bottleneck residual function. We present Reversible Residual Networks (RevNets), a variant of ResNets which is reversible in the sense that each layer’s activations can be computed from the subsequent reversible layer’s activations. This enables us to perform backpropagation without storing the activations in memory, with the exception of a handful of non-reversible layers. The result is a network architecture whose activation storage requirements are independent of depth, and typically at least an order of magnitude smaller compared with equally sized ResNets. Surprisingly, constraining the architecture to be reversible incurs no noticeable loss in performance: in our experiments, RevNets achieved nearly identical classification accuracy to standard ResNets on CIFAR-10, CIFAR-100, and ImageNet, with only a modest increase in the training time. 2 Background 2.1 Backpropagation Backpropagation [25] is a classic algorithm for computing the gradient of a cost function with respect to the parameters of a neural network. It is used in nearly all neural network algorithms, and is now taken for granted in light of neural network frameworks which implement automatic differentiation [1, 2]. Because achieving the memory savings of our method requires manual implementation of part of the backprop computations, we briefly review the algorithm. We treat backprop as an instance of reverse mode automatic differentiation [24]. Let v1, . . . , vK denote a topological ordering of the nodes in the network’s computation graph G, where vK denotes the cost function C. Each node is defined as a function fi of its parents in G. Backprop computes the total derivative dC/dvi for each node in the computation graph. This total derivative defines the the effect on C of an infinitesimal change to vi, taking into account the indirect effects through the descendants of vk in the computation graph. Note that the total derivative is distinct from the partial derivative ∂f/∂xi of a function f with respect to one of its arguments xi, which does not take into account the effect of changes to xi on the other arguments. To avoid using a small typographical difference to represent a significant conceptual difference, we will denote total derivatives using vi = dC/dvi. Backprop iterates over the nodes in the computation graph in reverse topological order. For each node vi, it computes the total derivative vi using the following rule: vi = X j∈Child(i) ∂fj ∂vi ⊤ vj, (1) where Child(i) denotes the children of node vi in G and ∂fj/∂vi denotes the Jacobian matrix. 2.2 Deep Residual Networks One of the main difficulties in training very deep networks is the problem of exploding and vanishing gradients, first observed in the context of recurrent neural networks [3]. In particular, because a deep network is a composition of many nonlinear functions, the dependencies across distant layers can be highly complex, making the gradient computations unstable. Highway networks [29] circumvented this problem by introducing skip connections. Similarly, deep residual networks (ResNets) [13] use 2 a functional form which allows information to pass directly through the network, thereby keeping the computations stable. ResNets currently represent the state-of-the-art in object recognition [13], semantic segmentation [35] and image generation [32]. Outside of vision, residuals have displayed impressive performance in audio generation [31] and neural machine translation [16], ResNets are built out of modules called residual blocks, which have the following form: y = x + F(x), (2) where F, a function called the residual function, is typically a shallow neural net. ResNets are robust to exploding and vanishing gradients because each residual block is able to pass signals directly through, allowing the signals to be propagated faithfully across many layers. As displayed in Figure 1, residual functions for image recognition generally consist of stacked batch normalization ("BN") [14], rectified linear activation ("ReLU") [23] and convolution layers (with filters of shape three "C3" and one "C1"). As in He et al. [13], we use two residual block architectures: the basic residual function (Figure 1 right-top) and the bottleneck residual function (Figure 1 right-bottom). The bottleneck residual consists of three convolutions, the first is a point-wise convolution which reduces the dimensionality of the feature dimension, the second is a standard convolution with filter size 3, and the final point-wise convolution projects into the desired output feature depth. a(x) = ReLU(BN(x))) ck(x) = Convk×k(a(x)) Basic(x) = c3(c3(x)) Bottleneck(x) = c1(c3(c1(x))) (3) 2.3 Reversible Architectures Various reversible neural net architectures have been proposed, though for motivations distinct from our own. Deco and Brauer [8] develop a similar reversible architecture to ensure the preservation of information in unsupervised learning contexts. The proposed architecture is indeed residual and constructed to produce a lower triangular Jacobian matrix with ones along the diagonal. In Deco and Brauer [8], the residual connections are composed of all ‘prior’ neurons in the layer, while NICE and our own architecture segments a layer into pairs of neurons and additively connect one with a residual function of the other. Maclaurin et al. [21] made use of the reversible nature of stochastic gradient descent to tune hyperparameters via gradient descent. Our proposed method is inspired by nonlinear independent components estimation (NICE) [9, 10], an approach to unsupervised generative modeling. NICE is based on learning a non-linear bijective transformation between the data space and a latent space. The architecture is composed of a series of blocks defined as follows, where x1 and x2 are a partition of the units in each layer: y1 = x1 y2 = x2 + F(x1) (4) Because the model is invertible and its Jacobian has unit determinant, the log-likelihood and its gradients can be tractably computed. This architecture imposes some constraints on the functions the network can represent; for instance, it can only represent volume-preserving mappings. Follow-up work by Dinh et al. [10] addressed this limitation by introducing a new reversible transformation: y1 = x1 y2 = x2 ⊙exp(F(x1)) + G(x1). (5) Here, ⊙represents the Hadamard or element-wise product. This transformation has a non-unit Jacobian determinant due to multiplication by exp (F(x1)). 3 (a) (b) Figure 2: (a) the forward, and (b) the reverse computations of a residual block, as in Equation 8. 3 Methods We now introduce Reversible Residual Networks (RevNets), a variant of Residual Networks which is reversible in the sense that each layer’s activations can be computed from the next layer’s activations. We discuss how to reconstruct the activations online during backprop, eliminating the need to store the activations in memory. 3.1 Reversible Residual Networks RevNets are composed of a series of reversible blocks, which we now define. We must partition the units in each layer into two groups, denoted x1 and x2; for the remainder of the paper, we assume this is done by partitioning the channels, since we found this to work the best in our experiments.2 Each reversible block takes inputs (x1, x2) and produces outputs (y1, y2) according to the following additive coupling rules – inspired by NICE’s [9] transformation in Equation 4 – and residual functions F and G analogous to those in standard ResNets: y1 = x1 + F(x2) y2 = x2 + G(y1) (6) Each layer’s activations can be reconstructed from the next layer’s activations as follows: x2 = y2 −G(y1) x1 = y1 −F(x2) (7) Note that unlike residual blocks, reversible blocks must have a stride of 1 because otherwise the layer discards information, and therefore cannot be reversible. Standard ResNet architectures typically have a handful of layers with a larger stride. If we define a RevNet architecture analogously, the activations must be stored explicitly for all non-reversible layers. 3.2 Backpropagation Without Storing Activations To derive the backprop procedure, it is helpful to rewrite the forward (left) and reverse (right) computations in the following way: z1 = x1 + F(x2) z1 = y1 y2 = x2 + G(z1) x2 = y2 −G(z1) (8) y1 = z1 x1 = z1 −F(x2) Even though z1 = y1, the two variables represent distinct nodes of the computation graph, so the total derivatives z1 and y1 are different. In particular, z1 includes the indirect effect through y2, while y1 does not. This splitting lets us implement the forward and backward passes for reversible blocks in a modular fashion. In the backwards pass, we are given the activations (y1, y2) and their total derivatives (y1, y2) and wish to compute the inputs (x1, x2), their total derivatives (x1, x2), and the total derivatives for any parameters associated with F and G. (See Section 2.1 for our backprop 2The possibilities we explored included columns, checkerboard, rows and channels, as done by [10]. We found that performance was consistently superior using the channel-wise partitioning scheme and comparable across the remaining options. We note that channel-wise partitioning has also been explored in the context of multi-GPU training via ’grouped’ convolutions [18], and more recently, convolutional neural networks have seen significant success by way of ’separable’ convolutions [27, 6]. 4 notation.) We do this by combining the reconstruction formulas (Eqn. 8) with the backprop rule (Eqn. 1). The resulting algorithm is given as Algorithm 1.3 By applying Algorithm 1 repeatedly, one can perform backprop on a sequence of reversible blocks if one is given simply the activations and their derivatives for the top layer in the sequence. In general, a practical architecture would likely also include non-reversible layers, such as subsampling layers; the inputs to these layers would need to be stored explicitly during backprop. However, a typical ResNet architecture involves long sequences of residual blocks and only a handful of subsampling layers; if we mirror the architecture of a ResNet, there would be only a handful of non-reversible layers, and the number would not grow with the depth of the network. In this case, the storage cost of the activations would be small, and independent of the depth of the network. Computational overhead. In general, for a network with N connections, the forward and backward passes of backprop require approximately N and 2N add-multiply operations, respectively. For a RevNet, the residual functions each must be recomputed during the backward pass. Therefore, the number of operations required for reversible backprop is approximately 4N, or roughly 33% more than ordinary backprop. (This is the same as the overhead introduced by checkpointing [22].) In practice, we have found the forward and backward passes to be about equally expensive on GPU architectures; if this is the case, then the computational overhead of RevNets is closer to 50%. Algorithm 1 Reversible Residual Block Backprop 1: function BLOCKREVERSE((y1, y2), (y1, y2)) 2: z1 ←y1 3: x2 ←y2 −G(z1) 4: x1 ←z1 −F(x2) 5: z1 ←y1 +  ∂G ∂z1 ⊤ y2 ▷ordinary backprop 6: x2 ←y2 +  ∂F ∂x2 ⊤ z1 ▷ordinary backprop 7: x1 ←z1 8: wF ←  ∂F ∂wF ⊤ z1 ▷ordinary backprop 9: wG ←  ∂G ∂wG ⊤ y2 ▷ordinary backprop 10: return (x1, x2) and (x1, x2) and (wF, wG) 11: end function Modularity. Note that Algorithm 1 is agnostic to the form of the residual functions F and G. The steps which use the Jacobians of these functions are implemented in terms of ordinary backprop, which can be achieved by calling automatic differentiation routines (e.g. tf.gradients or Theano.grad). Therefore, even though implementing our algorithm requires some amount of manual implementation of backprop, one does not need to modify the implementation in order to change the residual functions. Numerical error. While Eqn. 8 reconstructs the activations exactly when done in exact arithmetic, practical float32 implementations may accumulate numerical error during backprop. We study the effect of numerical error in Section 5.2; while the error is noticeable in our experiments, it does not significantly affect final performance. We note that if numerical error becomes a significant issue, one could use fixed-point arithmetic on the x’s and y’s (but ordinary floating point to compute F and G), analogously to [21]. In principle, this would enable exact reconstruction while introducing little overhead, since the computation of the residual functions and their derivatives (which dominate the computational cost) would be unchanged. 4 Related Work A number of steps have been taken towards reducing the storage requirements of extremely deep neural networks. Much of this work has focused on the modification of memory allocation within the training algorithms themselves [1, 2]. Checkpointing [22, 5, 12] is one well-known technique which 3We assume for notational clarity that the residual functions do not share parameters, but Algorithm 1 can be trivially extended to a network with weight sharing, such as a recurrent neural net. 5 Table 1: Computational and spatial complexity comparisons. L denotes the number of layers. Technique Spatial Complexity Computational (Activations) Complexity Naive O(L) O(L) Checkpointing [22] O( √ L) O(L) Recursive Checkpointing [5] O(log L) O(L log L) Reversible Networks (Ours) O(1) O(L) trades off spatial and temporal complexity; during backprop, one stores a subset of the activations (called checkpoints) and recomputes the remaining activations as required. Martens and Sutskever [22] adopted this technique in the context of training recurrent neural networks on a sequence of length T using backpropagation through time [33], storing every ⌈ √ T⌉layers and recomputing the intermediate activations between each during the backward pass. Chen et al. [5] later proposed to recursively apply this strategy on the sub-graph between checkpoints. Gruslys et al. [12] extended this approach by applying dynamic programming to determine a storage strategy which minimizes the computational cost for a given memory budget. To analyze the computational and memory complexity of these alternatives, assume for simplicity a feed-forward network consisting of L identical layers. Again, for simplicity, assume the units are chosen such that the cost of forward propagation or backpropagation through a single layer is 1, and the memory cost of storing a single layer’s activations is 1. In this case, ordinary backpropagation has computational cost 2L and storage cost L for the activations. The method of Martens and Sutskever [22] requres 2 √ L storage, and it demands an additional forward computation for each layer, leading to a total computational cost of 3L. The recursive algorithm of Chen et al. [5] reduces the required memory to O(log L), while increasing the computational cost to O(L log L). In comparison to these, our method incurs O(1) storage cost — as only a single block must be stored — and computational cost of 3L. The time and space complexities of these methods are summarized in Table 1. Another approach to saving memory is to replace backprop itself. The decoupled neural interface [15] updates each weight matrix using a gradient approximation, termed the synthetic gradient, computed based on only the node’s activations instead of the global network error. This removes any long-range gradient computation dependencies in the computation graph, leading to O(1) activation storage requirements. However, these savings are achieved only after the synthetic gradient estimators have been trained; that training requires all the activations to be stored. 5 Experiments We experimented with RevNets on three standard image classification benchmarks: CIFAR-10, CIFAR-100, [17] and ImageNet [26]. In order to make our results directly comparable with standard ResNets, we tried to match both the computational depth and the number of parameters as closely as possible. We observed that each reversible block has a computation depth of two original residual blocks. Therefore, we reduced the total number of residual blocks by approximately half, while approximately doubling the number of channels per block, since they are partitioned into two. Table 2 shows the details of the RevNets and their corresponding traditional ResNet. In all of our experiments, we were interested in whether our RevNet architectures (which are far more memory efficient) were able to match the classification accuracy of ResNets of the same size. 5.1 Implementation We implemented the RevNets using the TensorFlow library [1]. We manually make calls to TensorFlow’s automatic differentiation method (i.e. tf.gradients) to construct the backward-pass computation graph without referencing activations computed in the forward pass. While building the backward graph, we reconstruct the input activations (ˆx1, ˆx2) for each block (Equation 8); Second, we apply tf.stop_gradient on the reconstructed inputs to prevent auto-diff from traversing into the reconstructions’ computation graph, then call the forward functions again to compute (ˆy1, ˆy2) (Equation 8). Lastly, we use auto-diff to traverse from (ˆy1, ˆy2) to (ˆx1, ˆx2) and the parameters (wF, wG). This 6 Table 2: Architectural details. ’Bottleneck’ indicates whether the residual unit type used was the Bottleneck or Basic variant (see Equation 3). ’Units’ indicates the number of residual units in each group. ’Channels’ indicates the number of filters used in each unit in each group. ’Params’ indicates the number of parameters, in millions, each network uses. Dataset Version Bottleneck Units Channels Params (M) CIFAR-10 (100) ResNet-32 No 5-5-5 16-16-32-64 0.46 (0.47) CIFAR-10 (100) RevNet-38 No 3-3-3 32-32-64-112 0.46 (0.48) CIFAR-10 (100) ResNet-110 No 18-18-18 16-16-32-64 1.73 (1.73) CIFAR-10 (100) RevNet-110 No 9-9-9 32-32-64-128 1.73 (1.74) CIFAR-10 (100) ResNet-164 Yes 18-18-18 16-16-32-64 1.70 (1.73) CIFAR-10 (100) RevNet-164 Yes 9-9-9 32-32-64-128 1.75 (1.79) ImageNet ResNet-101 Yes 3-4-23-3 64-128-256-512 44.5 ImageNet RevNet-104 Yes 2-2-11-2 128-256-512-832 45.2 Table 3: Classification error on CIFAR Architecture CIFAR-10 [17] CIFAR-100 [17] ResNet RevNet ResNet RevNet 32 (38) 7.14% 7.24% 29.95% 28.96% 110 5.74% 5.76% 26.44% 25.40% 164 5.24% 5.17% 23.37% 23.69% implementation leverages the convenience of the auto-diff functionality to avoid manually deriving gradients; however the computational cost becomes 5N, compared with 4N for Algorithm 1, and 3N for ordinary backpropagation (see Section 3.2). The full theoretical efficiency can be realized by reusing the F and G graphs’ activations that were computed in the reconstruction steps (lines 3 and 4 of Algorithm 1). Table 4: Top-1 classification error on ImageNet (single crop) ResNet-101 RevNet-104 23.01% 23.10% 5.2 RevNet performance Our ResNet implementation roughly matches the previously reported classification error rates [13]. As shown in Table 3, our RevNets roughly matched the error rates of traditional ResNets (of roughly equal computational depth and number of parameters) on CIFAR-10 & 100 as well as ImageNet (Table 4). In no condition did the RevNet underperform the ResNet by more than 0.5%, and in some cases, RevNets achieved slightly better performance. Furthermore, Figure 3 compares ImageNet training curves of the ResNet and RevNet architectures; reversibility did not lead to any noticeable per-iteration slowdown in training. (As discussed above, each RevNet update is about 1.5-2× more expensive, depending on the implementation.) We found it surprising that the performance matched so closely, because reversibility would appear to be a significant constraint on the architecture, and one might expect large memory savings to come at the expense of classification error. Impact of numerical error. As described in Section 3.2, reconstructing the activations over many layers causes numerical errors to accumulate. In order to measure the magnitude of this effect, we computed the angle between the gradients computed using stored and reconstructed activations over the course of training. Figure 4 shows how this angle evolved over the course of training for a CIFAR-10 RevNet; while the angle increased during training, it remained small in magnitude. 7 Table 5: Comparison of parameter and activation storage costs for ResNet and RevNet. Task Parameter Cost Activation Cost ResNet-101 ∼178MB ∼5250MB RevNet-104 ∼180MB ∼1440MB 0 20 40 60 80 100 120 No. epochs 100 Train Loss ImageNet Train Loss Original ResNet-101 RevNet-104 0 20 40 60 80 100 120 No. epochs 0.00% 10.00% 20.00% 30.00% 40.00% 50.00% Classification error ImageNet Top-1 Error (Single Crop) Original ResNet-101 RevNet-104 Figure 3: Training curves for ResNet-101 vs. RevNet-104 on ImageNet, with both networks having approximately the same depth and number of free parameters. Left: training cross entropy; Right: classification error, where dotted lines indicate training, and solid lines validation. 0 5 10 15 20 No. epochs 0 2 4 6 8 10 Angle (degrees) RevNet-164 CIFAR-10 Gradient Error 0 2 4 6 8 10 12 14 16 No. epochs 10-4 10-3 10-2 10-1 100 101 Train Loss RevNet-164 CIFAR-10 Train Loss Stored Activations Reconstructed Activations 0 2 4 6 8 10 12 14 16 No. epochs 0.00% 10.00% 20.00% 30.00% 40.00% 50.00% Classification error RevNet-164 CIFAR-10 Top-1 Error Stored Activations Reconstructed Activations Figure 4: Left: angle (degrees) between the gradient computed using stored and reconstructed activations throughout training. While the angle grows during training, it remains small in magnitude. We measured 4 more epochs after regular training length and did not observe any instability. Middle: training cross entropy; Right: classification error, where dotted lines indicate training, and solid lines validation; No meaningful difference in training efficiency or final performance was observed between stored and reconstructed activations. Figure 4 also shows training curves for CIFAR-10 networks trained using both methods of computing gradients. Despite the numerical error from reconstructing activations, both methods performed almost indistinguishably in terms of the training efficiency and the final performance. 6 Conclusion and Future Work We introduced RevNets, a neural network architecture where the activations for most layers need not be stored in memory. We found that RevNets provide considerable reduction in the memory footprint at little or no cost to performance. As future work, we are currently working on applying RevNets to the task of semantic segmentation, the performance of which is limited by a critical memory bottleneck — the input image patch needs to be large enough to process high resolution images; meanwhile, the batch size also needs to be large enough to perform effective batch normalization (e.g. [36]). We also intend to develop reversible recurrent neural net architectures; this is a particularly interesting use case, because weight sharing implies that most of the memory cost is due to storing the activations (rather than parameters). Another interesting direction is predicting the activations of previous layers’ activation, similar to synthetic gradients. We envision our reversible block as a module which will soon enable training larger and more powerful networks with limited computational resources. 8 References [1] M. Abadi, A. Agarwal, P. Barham, E. Brevdo, Z. Chen, C. Citro, G. S. Corrado, A. Davis, J. Dean, M. Devin, et al. TensorFlow: Large-scale machine learning on heterogeneous distributed systems. arXiv preprint arXiv:1603.04467, 2016. [2] R. Al-Rfou, G. Alain, A. Almahairi, C. Angermueller, D. Bahdanau, N. Ballas, F. Bastien, J. Bayer, A. Belikov, A. Belopolsky, et al. Theano: A Python framework for fast computation of mathematical expressions. arXiv preprint arXiv:1605.02688, 2016. [3] 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. [4] J. Chen, R. Monga, S. Bengio, and R. Jozefowicz. Revisiting distributed synchronous sgd. arXiv preprint arXiv:1604.00981, 2016. [5] T. Chen, B. Xu, C. Zhang, and C. Guestrin. Training deep nets with sublinear memory cost. arXiv preprint arXiv:1604.06174, 2016. [6] F. Chollet. Xception: Deep learning with depthwise separable convolutions. arXiv preprint arXiv:1610.02357, 2016. [7] J. Dean, G. Corrado, R. Monga, K. Chen, M. Devin, M. Mao, A. Senior, P. Tucker, K. Yang, Q. V. Le, et al. Large scale distributed deep networks. In NIPS, 2012. [8] G. Deco and W. Brauer. Higher order statistical decorrelation without information loss. In G. Tesauro, D. S. Touretzky, and T. K. Leen, editors, Advances in Neural Information Processing Systems 7, pages 247–254. MIT Press, 1995. URL http://papers.nips.cc/paper/ 901-higher-order-statistical-decorrelation-without-information-loss. pdf. [9] L. Dinh, D. Krueger, and Y. Bengio. NICE: Non-linear independent components estimation. 2015. [10] L. Dinh, J. Sohl-Dickstein, and S. Bengio. Density estimation using real NVP. In ICLR, 2017. [11] P. Goyal, P. Dollár, R. Girshick, P. Noordhuis, L. Wesolowski, A. Kyrola, A. Tulloch, Y. Jia, and K. He. Accurate, large minibatch sgd: Training imagenet in 1 hour. arXiv preprint arXiv:1706.02677, 2017. [12] A. Gruslys, R. Munos, I. Danihelka, M. Lanctot, and A. Graves. Memory-efficient backpropagation through time. In NIPS, 2016. [13] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 770–778, 2016. [14] S. Ioffe and C. Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, 2015. [15] M. Jaderberg, W. M. Czarnecki, S. Osindero, O. Vinyals, A. Graves, and K. Kavukcuoglu. Decoupled neural interfaces using synthetic gradients. arXiv preprint arXiv:1608.05343, 2016. [16] N. Kalchbrenner, L. Espeholt, K. Simonyan, A. v. d. Oord, A. Graves, and K. Kavukcuoglu. Neural machine translation in linear time. arXiv preprint arXiv:1610.10099, 2016. [17] A. Krizhevsky and G. Hinton. Learning multiple layers of features from tiny images. Technical report, University of Toronto, Department of Computer Science, 2009. [18] A. Krizhevsky, I. Sutskever, and G. E. Hinton. ImageNet classification with deep convolutional neural networks. In NIPS, 2012. [19] Y. LeCun, B. E. Boser, J. S. Denker, D. Henderson, R. E. Howard, W. E. Hubbard, and L. D. Jackel. Handwritten digit recognition with a back-propagation network. In Advances in neural information processing systems, pages 396–404, 1990. 9 [20] T.-Y. Lin, M. Maire, S. Belongie, J. Hays, P. Perona, D. Ramanan, P. Dollár, and C. L. Zitnick. Microsoft COCO: Common objects in context. In ECCV, 2014. [21] D. Maclaurin, D. K. Duvenaud, and R. P. Adams. Gradient-based hyperparameter optimization through reversible learning. In ICML, 2015. [22] J. Martens and I. Sutskever. Training deep and recurrent networks with Hessian-free optimization. In Neural networks: Tricks of the trade, pages 479–535. Springer, 2012. [23] V. Nair and G. E. Hinton. Rectified linear units improve restricted Boltzmann machines. In ICML, 2010. [24] L. B. Rall. Automatic differentiation: Techniques and applications. 1981. [25] D. Rumelhart, G. Hinton, and R. Williams. Learning representations by back-propagating errors. Lett. Nat., 323:533–536, 1986. [26] O. Russakovsky, J. Deng, H. Su, J. Krause, S. Satheesh, S. Ma, Z. Huang, A. Karpathy, A. Khosla, M. Bernstein, et al. ImageNet large scale visual recognition challenge. IJCV, 115 (3):211–252, 2015. [27] L. Sifre. Rigid-motion scattering for image classification. PhD thesis, Ph. D. thesis, 2014. [28] K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. [29] R. K. Srivastava, K. Greff, and J. Schmidhuber. Highway networks. arXiv preprint arXiv:1505.00387, 2015. [30] C. Szegedy, W. Liu, Y. Jia, P. Sermanet, S. E. Reed, D. Anguelov, D. Erhan, V. Vanhoucke, and A. Rabinovich. Going deeper with convolutions. In CVPR, 2015. [31] A. van den Oord, S. Dieleman, H. Zen, K. Simonyan, O. Vinyals, A. Graves, N. Kalchbrenner, A. Senior, and K. Kavukcuoglu. Wavenet: A generative model for raw audio. CoRR abs/1609.03499, 2016. [32] A. van den Oord, N. Kalchbrenner, L. Espeholt, O. Vinyals, A. Graves, et al. Conditional image generation with pixelCNN decoders. In NIPS, 2016. [33] R. J. Williams and D. Zipser. A learning algorithm for continually running fully recurrent neural networks. Neural computation, 1(2):270–280, 1989. [34] Z. Wu, C. Shen, and A. v. d. Hengel. High-performance semantic segmentation using very deep fully convolutional networks. arXiv preprint arXiv:1604.04339, 2016. [35] Z. Wu, C. Shen, and A. v. d. Hengel. Wider or deeper: Revisiting the ResNet model for visual recognition. arXiv preprint arXiv:1611.10080, 2016. [36] H. Zhao, J. Shi, X. Qi, X. Wang, and J. Jia. Pyramid scene parsing network. In CVPR, 2017. [37] J.-Y. Zhu, T. Park, P. Isola, and A. A. Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. arXiv preprint arXiv:1703.10593, 2017. 10 7 Appendix 7.1 Experiment details For our CIFAR-10/100 experiments, we fixed the mini-batch size to be 100. The learning rate was initialized to 0.1 and decayed by a factor of 10 at 40K and 60K training steps, training for a total of 80K steps. The weight decay constant was set to 2 × 10−4 and the momentum was set to 0.9. We subtracted the mean image, and augmented the dataset with random cropping and random horizontal flipping. For our ImageNet experiments, we fixed the mini-batch size to be 256, split across 4 Titan X GPUs with data parallelism [28]. We employed synchronous SGD [4] with momentum of 0.9. The model was trained for 600K steps, with factor-of-10 learning rate decays scheduled at 160K, 320K, and 480K steps. Weight decay was set to 1 × 10−4. We applied standard input preprocessing and data augmentation used in training Inception networks [30]: pixel intensity rescaled to within [0, 1], random cropping of size 224 × 224 around object bounding boxes, random scaling, random horizontal flipping, and color distortion, all of which are available in TensorFlow. For the original ResNet-101, We were unable to fit a mini-batch size of 256 on 4 GPUs, so we instead averaged the gradients from two serial runs with mini-batch size 128 (32 per GPU). For the RevNet, we were able to fit a mini-batch size of 256 on 4 GPUs (i.e. 64 per GPU). 7.2 Memory savings Fully realizing the theoretical gains of RevNets can be a non-trivial task and require precise low-level GPU memory management. We experimented with two different implementations within TensorFlow: With the first, we were able to reach reasonable spatial gains using “Tensor Handles” provided by TensorFlow, which preserve the activations of graph nodes between calls to session.run. Multiple session.run calls ensures that TensorFlow frees up activations that will not be referenced later. We segment our computation graph into separate sections and save the bordering activations and gradients into the persistent Tensor Handles. During the forward pass of the backpropagation algorithm, each section of the graph is executed sequentially with the input tensors being reloaded from the previous section and the output tensors being saved for use in the subsequent section. We empirically verified the memory gain by fitting at least twice the number of examples while training ImageNet. Each GPU can now fit a mini-batch size of 128 images, compared the original ResNet, which can only fit a mini-batch size of 32. The graph splitting trick brings only a small computational overhead (around 10%). The second and most significant spatial gains were made by implementing each residual stack as a tf.while_loop with the back_prop parameter set to False. This setting ensures that activations of each layer in the residual stack (aside from the last) are discarded from memory immediately after their utility expires. We use the tf.while_loops for both the forward and backward passes of the layers, ensuring both efficiently discard activations. Using this implementation we were able to train a 600-layer RevNet on the ImageNet image classification challenge on a single GPU; despite being prohibitively slow to train this demonstrates the potential for massive savings in spatial costs of training extremely deep networks. 11
2017
661
7,187
Character-Level Language Modeling with Recurrent Highway Hypernetworks Joseph Suarez Stanford University joseph15@stanford.edu Abstract We present extensive experimental and theoretical support for the efficacy of recurrent highway networks (RHNs) and recurrent hypernetworks complimentary to the original works. Where the original RHN work primarily provides theoretical treatment of the subject, we demonstrate experimentally that RHNs benefit from far better gradient flow than LSTMs in addition to their improved task accuracy. The original hypernetworks work presents detailed experimental results but leaves several theoretical issues unresolved–we consider these in depth and frame several feasible solutions that we believe will yield further gains in the future. We demonstrate that these approaches are complementary: by combining RHNs and hypernetworks, we make a significant improvement over current state-of-the-art character-level language modeling performance on Penn Treebank while relying on much simpler regularization. Finally, we argue for RHNs as a drop-in replacement for LSTMs (analogous to LSTMs for vanilla RNNs) and for hypernetworks as a de-facto augmentation (analogous to attention) for recurrent architectures. 1 Introduction and related works Recurrent architectures have seen much improvement since their inception in the 1990s, but they still suffer significantly from the problem of vanishing gradients [1]. Though many consider LSTMs [2] the de-facto solution to vanishing gradients, in practice, the problem is far from solved (see Discussion). Several LSTM variants have been developed, most notably GRUs [3], which are simpler than LSTM cells but benefit from only marginally better gradient flow. Greff et al. and Britz et al. conducted exhaustive (for all practical purposes) architecture searches over simple LSTM variants and demonstrated that none achieved significant improvement [4] [5]–in particular, the latter work discovered that LSTMs consistently outperform comparable GRUs on machine translation, and no proposed cell architecture to date has been proven significantly better than the LSTM. This result necessitated novel approaches to the problem. One approach is to upscale by simply stacking recurrent cells and increasing the number of hidden units. While there is certainly some optimal trade off between depth and cell size, with enough data, simply upscaling both has yielded remarkable results in neural machine translation (NMT) [6].1 However, massive upscaling is impractical in all but the least hardware constrained settings and fails to remedy fundamental architecture issues, such as poor gradient flow inherent in recurrent cells [8]. We later demonstrate that gradient issues persist in LSTMs (see Results) and that the grid-like architecture of stacked LSTMs is suboptimal. 1For fair comparison, Google’s NMT system does far more than upscaling and includes an explicit attentional mechanism [7]. We do not experiment with attention and/or residual schemes, but we expect the gains made by such techniques to stack with our work. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. The problem of gradient flow can be somewhat mitigated by the adaptation of Batch Normalization [9] to the recurrent case [10] [11]. While effective, it does not solve the problem entirely and also imposes significant overhead in memory and thus in performance, given the efficiency of parallelization over minibatches. This is often offset by a reduction in total epochs over the data required, but recurrent architectures with better gradient flow could ideally provide comparable or better convergence without reliance upon explicit normalization. Zilly et al. recently proposed recurrent highway networks (RHNs) and offered copious theoretical support for the architecture’s improved gradient flow [12]. However, while the authors provided mathematical rigor, we believe that experimental confirmation of the authors’ claims could further demonstrate the model’s simplicity and widespread applicability. Furthermore, we find that the discussion of gradient flow is more nuanced than presented in the original work (see Discussion). Ha et al. recently questioned the weight-sharing paradigm common among recurrent architectures, proposing hypernetworks as a mechanism for allowing weight drift between timesteps [13]. This consideration is highly desirable, given the successes of recent convolutional architectures on language modeling tasks [14] [15], which were previously dominated by recurrent architectures. Both RHNs and hypernetworks achieved state-of-the-art (SOTA) on multiple natural language processing (NLP) tasks at the time. As these approaches address unrelated architectural issues, it should not be surprising that combining them yields SOTA on Penn Treebank [16] (PTB), improving significantly over either model evaluated individually. We consider both RHNs and hypernetworks to be largely overlooked in recent literature on account of apparent rather than extant complexity. Furthermore, the original RHN work lacks sufficient experimental demonstration of improved gradient flow; the original hypernetworks work lacks theoretical generalization of their weight-drift scheme. We present experimental results for RHNs complementary to the original work’s theoretical results and theoretical results for hypernetworks complementary to the original work’s experimental results. Founded on these results, our most important contribution is a strong argument for the utility of RHNs and hypernetworks, both individually and jointly, in constructing improved recurrent architectures. 2 Model architecture 2.1 Recurrent highway networks We make a few notational simplifications to the original RHN equations that will later facilitate extensibility. We find it clearest and most succinct to be programmatic in our notation 2. First, consider the GRU: [h, t] =xiU + si−1W r = tanh(xi ˆU + (si−1 ◦h) ˆW) h, t =σ(h), σ(t) si =(1 −t) ◦r + t ◦si−1 (1) where x ∈Rd, h, t, r, st ∈Rn, and U, ˆU ∈Rd×2n, W, ˆW ∈Rn×2n are weight matrices where d, n are the input and hidden dimensions. σ is the sigmoid nonlinearity, and ◦is the Hadamard (elementwise) product. A one layer RHN cell is a simplified GRU variant: [h, t] =xiU + si−1W si =(1 −t) ◦si−1 + t ◦h h, t = tanh(h), σ(t) (2) where the definitions from above hold. The RHN is extended to arbitrary depth by simply stacking this cell with new hidden weight matrices, with the caveat that xiU is omitted except at the input layer: RHNCell(xi, si−1, l) : [h, t] =1 [l = 0] xiU + si−1W c, t =1 −t, dropout(t) h, t = tanh(h), σ(t) si =c ◦si−1 + t ◦h (3) where l is the layer index, which is used as an indicator. We can introduce recurrent dropout [17] on t across all layers with a single hyperparameter. We later demonstrate strong results without the need for more complex regularization or layer normalization. Finally, unlike stacked LSTMs, RHNs are structurally linear. That is, a depth L RHN applied to a sequence of length M can be unrolled to a simple depth ML network. We restate this fact from the original work only because it is important to our analysis, which we defer to Results and Discussion. 2Note that for purpose of clean alignment, equations are presented top to bottom, then left to right. 2 2.2 Hypernetworks We slightly alter the original notation of recurrent hypernetworks for ease of combination with RHNs. We define a hypervector z as a linear upscaling projection applied to the outputs of a small recurrent network: z(a) = Wpa (4) where a ∈Rh is the activation vector output by an arbitrary recurrent architecture, Wp ∈Rn×h is an upscaling projection from dimension h to n, and h ≪n. The hypervector is then used to scale the weights of the main recurrent network by: f W(z(a)) = z(a) ◦W (5) where we overload ◦as the element-wise product across columns. That is, each element of z scales one column (or row, depending on notation) of W. As this constitutes a direct modification of the weights, hypernetworks have the interpretation of relaxing the weight sharing constraint implicit in RNNs. 2.3 Recurrent highway hypernetworks We adapt hypernetworks to RHNs by directly modifying the RHN cell using (5): RHNCellHyper(xi, si−1, l, z) : [h, t] =1 [l = 0] xi eU(z) + si−1f W(z) c, t =1 −t, dropout(t) h, t = tanh(h), σ(t) si =c ◦si−1 + t ◦h (6) If RHNCell and RHNCellHyper had the same state sizes, we could simply stack them. However, as the hypernetwork is much smaller than the main network by design, we instead must upscale between the networks. Our final architecture at each timestep for layer l can thus be written: sh =RHNCell(sh, l) z =[Mplsh, Mplsh] sn =RHNCellHyper(sn, l, z) (7) where Mpl ∈Rh×n is the upscale projection matrix for layer l and z is the concatenation of Mplsh with itself. Notice the simplicity of this extension–it is at least as straightforward to extend RHNs as GRUs and LSTMs. Again, we use only simple recurrent dropout for regularization. A few notes, for clarity and ease of reproduction: as the internal weight matrices of the main network have different dimensionality (Ul ∈Rd×2n, Wl ∈Rn×2n), we require the concatenation operation to form z in (7). We find this works much better than simply using larger projection matrices. Also, sh, sn in (7) are the hypernetwork and main network states, respectively. This may seem backwards from the notation above, but note that the hypernetwork is a standard, unmodified RHNCell; its outputs are then used in the main network, which is the modified RHNCellHyper. 3 Results (experimental) 3.1 Penn Treebank Penn Treebank (PTB) contains approximately 5.10M/0.40M/0.45M characters in the train/val/test sets respectively and has a small vocabulary of 50 characters. There has recently been some controversy surrounding results on PTB: Jozefowicz et al. went as far to say that performance on such small datasets is dominated by regularization [18]. Radford et al. chose to evaluate language modeling performance only upon the (38GB) Amazon Product Review dataset for this reason [19]. Performance on large, realistic datasets is inarguably a better metric of architecture quality than performance on smaller datasets such as PTB. However, such metrics make comparison among models nearly impossible: performance on large datasets is non-standard because evaluation at this scale is infeasible in many research settings simply because of limited hardware access. While most models can be trained on 1-4 GPUs within a few weeks, this statement is misleading, as significantly more hardware is required for efficient development and hyperparameter search. We therefore emphasize the importance of small datasets for standardized comparison among models. Hutter is a medium sized task (approximately 20 times larger than PTB) that should be feasible in most settings (e.g. the original RHN and Hypernetwork works). We are only reasonably able to 3 Table 1: Comparison of bits per character (BPC) test errors on PTB. We achieve SOTA without layer normalization, improving over vanilla hypernetworks, which require layer normalization Model Test Val Params (M) LSTM 1.31 1.35 4.3 2-Layer LSTM 1.28 1.31 12.2 2-Layer LSTM (1125 hidden, ours) – 1.29 15.6 HyperLSTM 1.26 1.30 4.9 Layer Norm LSTM 1.27 1.30 4.3 Layer Norm HyperLSTM 1.25 1.28 4.9 Layer Norm HyperLSTM (large embed) 1.23 1.26 5.1 2-Layer Norm HyperLSTM, 1000 units 1.22 1.24 14.4 Recurrent Highway Network (ours) 1.24 14.0 HyperRHN (ours) 1.19 1.21 15.5 evaluate on PTB due to a strict hardware limitation of two personally owned GPUs. We therefore take additional precautions to ensure fair comparison: First, we address the critiques of Jozefoqicz et al. by avoiding complex regularization. We use only simple recurrent dropout with a uniform probability across layers. Second, we minimally tune hyperparameters as discussed below. Finally, we are careful with the validation data and run the test set only once on our best model. We believe these precautions prevent overfitting the domain and corroborate the integrity of our result. Furthermore, SOTA performance with suboptimal hyperparameters demonstrates the robustness of our model. 3.2 Architecture and training details In addition to our HyperRHN, we consider our implementations of a 2-Layer LSTM and a plain RHN below. All models, including hypernetworks and their strong baselines, are compared in Table 1. Other known published results are included in the original hypernetworks work, but have test bpc ≥ 1.27. We train all models using Adam [20] with the default learning rate 0.001 and sequence length 100, batch size 256 (the largest that fits in memory for our main model) on a single GTX 1080 Ti until overfitting becomes obvious. We evaluate test performance only once and only on our main model, using the validation set for early stopping. Our data batcher loads the dataset into main memory as a single contiguous block and reshapes it to column size 100. We do not zero pad for efficiency and no distinction is made between sentences for simplicity. Data is embedded into a 27 dimensional vector. We do not cross validate any hyperparameters except for dropout. We first consider our implementation of a 2-Layer LSTM with hidden dimension 1125, which yields approximately as many learnable parameters as our main model. We train for 350 epochs with recurrent dropout probability 0.9. As expected, our model performs slightly better than the slightly smaller baseline in the original hypernetworks work. We use this model in gradient flow comparisons (see Discussion) As the original RHN work presents only word-level results for PTB, we trained a RHN baseline by simply disabling the Hypernetwork augmentation. Convergence was achieved in 618 epochs. Our model consists of a recurrent highway hypernetwork with 7 layers per cell. The main network has 1000 neurons per layer and the hypernetwork has 128 neurons per layer, for a total of approximately 15.2M parameters. Both subnetworks use a recurrent dropout keep probability of 0.65 and no other regularizer/normalizer. We attribute our model’s ability to perform without layer normalization to the improved gradient flow of RHNs (see Discussion). The model converges in 660 epochs, obtaining test perplexity 2.29 (where cross entropy corresponds to loge of perplexity) and 1.19 bits per character (BPC, log2 of perplexity), 74.6 percent accuracy. By epoch count, our model is comparable to a plain RHN but performs better. Training takes 2-3 days (fairly long for PTB) compared to 1-2 days for a plain RHN and a few hours for an LSTM. However, this comparison is unfair: all models require a similar number of floating point operations and differ 4 primarily in backend implementation optimization. We consider possible modifications to our model that take advantage of existing optimization in Results (theoretical), below. Finally, we note that reporting of accuracy is nonstandard. Accuracy is a standard metric in vision; we encourage its adoption in language modeling, as BPC is effectively a change of base applied to standard cross entropy and is exponential in scale. This downplays the significance of gains where the error ceiling is likely small. Accuracy is more immediately comparable to maximum task performance, which we estimate to be well below 80 percent given the recent trend of diminishing returns coupled with genuine ambiguity in the task. Human performance is roughly 55 percent, as measured by our own performance on the task. 4 Results (theoretical) Our final model is a direct adaptation of the original hypervector scaling factor to RHNs. However, we did attempt a generalization of hypernetworks and encountered extreme memory considerations that have important implications for future work. Notice that the original hypernetwork scaling factor is equivalent to element-wise multiplication by a rank-1 matrix (e.g. the outer product of z with a ones vector, which does not include all rank-1 matrices). Ideally, we should be able to scale by any matrix at all. As mentioned by the authors, naively generating different scaling vectors for each column of the weight matrix is prohibitively expensive in both memory and computation time. We propose a low rank-d update inspired by the thin singular value decomposition as follows: f W = W ◦ d X i=1 uiv⊤ i (8) Compared to the original scaling update, our variation has memory and performance cost linear in the rank of the update. As with the SVD, we would expect most of the information relevant to the weight drift scale to be contained in a relatively low-rank update. However, we were unable to verify this hypothesis due to a current framework limitation. All deep learning platforms currently assemble computation graphs, and this low rank approximation is added as a node in the graph. This requires memory equal to the dimensionality of the scaling matrix per training example! The original hypernetworks update is only feasible because of a small mathematical trick: row-wise scaling of the weight matrix is equal to elementwise multiplication after the matrix-vector multiply. Note that this is a practical rather than theoretical limitation. As variations in the weights of the hypernetwork arise only as a function of variations in ui, vi, W, it is possible to define a custom gradient operation that does not need to store the low rank scaling matrices at each time step for backpropagation. Lastly, we note that hypernetworks are a new and largely unexplored area of research. Even without the above addition, hypernetworks have yielded large improvements on a diverse array of tasks while introducing a minimal number of additional parameters. The only reason we cannot currently recommend hypernetworks as a drop-in network augmentation for most tasks (compare to e.g. attention) is another framework limitation. Despite requiring far fewer floating point operations than the larger main network, adding a hypernetwork still incurs nearly a factor of two in performance. This is due to the extreme efficiency of parallelization over large matrix multiplies; the overhead is largely time spent copying data. We propose rolling the hypernetwork into the main network. This could be accomplished by simply increasing the hidden dimension by the desired hypernetwork dimension h. The first h elements of the activation can then be treated as the hypervector. Note that this may require experimentation with matrix blocking and/or weight masking schemes in order to avoid linear interactions between the hypernetwork and main network during matrix multiplication. The issues and solutions above are left as thought experiments; we prioritize our limited computational resources towards experimental efforts on recurrent highway networks. The theoretical results above are included to simultaneously raise and assuage concerns surrounding generalization and efficiency of hypernetworks. We see additional development of hypernetworks as crucial to the continued success of our recurrent model in the same manner that attention is a necessary, de-facto network augmentation in machine translation (and we further expect the gains to stack). Our model’s strong language modeling result using a single graphics card was facilitated by the small size of PTB, which allowed us to afford the 2X computational cost of recurrent hypernetworks. We present methods 5 Figure 1: Visualization of hyper recurrent highway network training convergence for optimizing the representational power and computational cost of hypernetworks; additional engineering will still be required in order to fully enable efficient training on large datasets. 5 Discussion (experimental) 5.1 Training time We visualize training progress in Fig. 1. Notice that validation perplexity seems to remain below training perplexity for nearly 500 epochs. While the validation and test sets in PTB appear slightly easier than the training set, the cause of this artifact is that the validation loss is masked by a minimum 50-character context whereas the training loss is not (we further increase minimum context to 95 after training and observe a small performance gain), therefore the training loss suffers from the first few impossible predictions at the start of each example. The validation data is properly overlapped such that performance is being evaluated over the entire set. It may also seem surprising that the model takes over 600 epochs to converge, and that training progress appears incredibly slow towards the end. We make three observations: first, we did not experiment with different optimizers, annealing the learning rate, or even the fixed learning rate itself. Second, as the maximum task accuracy is unknown, it is likely that gains small on an absolute scale are large on a relative scale. We base this conjecture on the diminishing gains of recent work on an absolute scale: we find that the difference between 1.31 (1 layer LSTM) and 1.19 bpc (our model) is approximately 71.1-74.6 percent accuracy. For reference, our improvement over the original hypernetworks work is approximately 1.0 percent (this figure is obtained from interpolation on the BPC scale). Third and finally, regardless of whether our second observation is true, our architecture exhibits similar convergence to a RHN and begins outperforming the 2-layer LSTM baseline before the latter converges. 5.2 Overview of visualizations Our motivation in the visualizations that follow is to compare desirable and undesirable properties of our RHN-based model and standard recurrent models, namely stacked LSTMs. There are two natural gradient visualizations: within-cell gradients, which are averaged over time but not over all of the weight layers within the recurrent cell, and outside-cell gradients, which are averaged over internal weight layers but not over time. Time-averaged gradients are less useful to our discussion than the norms of raw weight layers; we therefore present these along with outside-cell gradient visualizations. 5.3 Cell visualizations We visualize the 2-norms of the learned weight layers of our RHN-based model in Fig. 2 and of an LSTM baseline (2 layers, 1150 hidden units, recurrent dropout keep p=0.90, 15.6M parameters) in Fig. 3. Notice that in the middle six layers (the first/last layers have different dimensionality and are incomparable) of the RHN block (Fig. 2), weight magnitude decreases with increasing layer depth. We view this as evidence for the iterative-refinement view of deep learning, as smaller updates are 6 Figure 2: L2 norms of learned weights in our recurrent highway hypernetwork model. Increasing depth is shown from left to right in each block of layers. As dimensionality differs between blocks, the middle layers of each block are incomparable to the first/last layers, hence the disparity in norm. Figure 3: L2 norms of learned weights in our 2-layer LSTM baseline, with layer 1 left of layer 2. applied in deeper layers. This is first evidence of this paradigm that we are aware of in the recurrent case, as similar statistics in stacked LSTMs are less conclusive because of horizontal grid connections. This also explains why performance gains diminish as RHN depth increases, as was noted in the original work. 5.4 Gradient visualizations over time We consider the mean L2-norms of the gradients of the activations with respect to the loss at the final timestep. But first, an important digression: when should we visualize gradient flow: at initialization, during training, or after convergence? To our knowledge, this matter has not yet received direct treatment. Fig. 4 is computed at initialization and seems to suggest that RHNs are far inferior to LSTMs in the multilayer case, as the network cannot possibly learn in the presence of extreme vanishing gradients. This line of reasoning lacks the required nuance, which we discuss below. 6 Discussion (theoretical) We address the seemingly inconsistent experimental results surrounding gradient flow in RHN. First, we note that the LSTM/RHN comparison is unfair: multilayer LSTM/GRU cells are laid out in a grid. The length of the gradient path is equal to the sum of the sequence length and the number of layers (minus one); in an RHN, it is equal to the product. In the fair one layer case, we found that the RHN actually possesses far greater initial gradient flow. Second, these intuitions regarding vanishing gradients at initialization are incorrect. As shown in Fig. 5, gradient flow improves dramatically after training for just one epoch. By convergence, as shown in Fig. 6, results shift in the favor of RHNs, confirming experimentally the theoretical gradient flow benefits of RHNs over LSTMs. Third, we address a potential objection. One might argue that while the gradient curves of our RHN based model and the LSTM baseline are similar in shape, the magnitude difference is misleading. For example, if LSTMs naturally have a million times smaller weights, then the factor of a hundred magnitude difference in Fig. 6 would actually demonstrate superiority of the LSTM. This is the reason for our consideration of weight norms in Fig. 2-3, which show that LSTMs have only 100 times smaller weights. Thus the gradient curves in Fig. 6 are effectively comparable in magnitude. However, RHNs maintain gradient flow equal to that of stacked LSTMs while having far greater 7 Figure 4: Layer-averaged gradient comparison between our model and an LSTM baseline. Gradients are computed at initialization at the input layer of each timestep with respect to the final timestep’s loss. Weights are initialized orthogonally. Figure 5: Identical to Fig. 4, but gradients are computed from models trained for one epoch. Figure 6: Identical to Fig. 4, but gradients are computed after convergence. gradient path length, thus the initial comparison is unfair. We believe that this is the basis for the RHN’s performance increase over the LSTM: RHNs allow much greater effective network depth without incurring additional gradient vanishing. Fourth, we experimented with adding the corresponding horizontal grid connections to our RHN, obtaining significantly better gradient flow. With the same parameter budget as our HyperRHN model, this variant obtains 1.40 bpc–far inferior to our HyperRHN, though it could likely be optimized somewhat. It appears that long gradient paths are precisely the advantage in RHNs. We therefore suggest that gradient flow specifically along the deepest gradient path is an important consideration in architecture design: it provides an upper limit on effective network depth. It appears that greater effective depth is precisely the advantage in modeling potential of the RHN. 7 Conclusion We present a cohesive set of contributions to recurrent architectures. First, we provide strong experimental evidence for RHNs as a simple drop-in replacement for stacked LSTMs and a detailed discussion of several engineering optimizations that could further performance. Second, we visualize 8 and discuss the problem of vanishing gradients in recurrent architectures, revealing that gradient flow significantly shifts during training, which can lead to misleading comparisons among models. This demonstrates that gradient flow should be evaluated at or near convergence; using this metric, we confirm that RHNs benefit from far greater effective depth than stacked LSTMs while maintaining equal gradient flow. Third, we suggest multiple expansions upon hypernetworks for future work that have the potential to significantly improve efficiency and generalize the weight-drift paradigm. This could lead to further improvement upon our architecture and, we hope, facilitate general adoption of hypernetworks as a network augmentation. Finally, we demonstrate effectiveness by presenting and open sourcing (code 3) a combined architecture that obtains SOTA on PTB with minimal regularization and tuning which normally compromise results on small datasets. Acknowledgments Special thanks to Ziang Xie, Jeremy Irvin, Dillon Laird, and Hao Sheng for helpful commentary and suggestion during the revision process. References [1] Sepp Hochreiter, Yoshua Bengio, Paolo Frasconi, and Jürgen Schmidhuber. Gradient flow in recurrent nets: the difficulty of learning long-term dependencies, 2001. [2] Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8): 1735–1780, 1997. [3] Junyoung Chung, Caglar Gulcehre, KyungHyun Cho, and Yoshua Bengio. Empirical evaluation of gated recurrent neural networks on sequence modeling. arXiv preprint arXiv:1412.3555, 2014. [4] Klaus Greff, Rupesh K Srivastava, Jan Koutník, Bas R Steunebrink, and Jürgen Schmidhuber. LSTM: A search space odyssey. IEEE transactions on neural networks and learning systems, 2016. [5] Denny Britz, Anna Goldie, Thang Luong, and Quoc Le. Massive exploration of neural machine translation architectures. arXiv preprint arXiv:1703.03906, 2017. [6] Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, et al. Google’s neural machine translation system: Bridging the gap between human and machine translation. arXiv preprint arXiv:1609.08144, 2016. [7] Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, 2014. [8] Sepp Hochreiter, Yoshua Bengio, Paolo Frasconi, and Jürgen Schmidhuber. Gradient flow in recurrent nets: the difficulty of learning long-term dependencies, 2001. [9] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015. [10] Tim Cooijmans, Nicolas Ballas, César Laurent, Ça˘glar Gülçehre, and Aaron Courville. Recurrent batch normalization. arXiv preprint arXiv:1603.09025, 2016. [11] Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016. [12] Julian Georg Zilly, Rupesh Kumar Srivastava, Jan Koutník, and Jürgen Schmidhuber. Recurrent highway networks. arXiv preprint arXiv:1607.03474, 2016. [13] David Ha, Andrew Dai, and Quoc V Le. Hypernetworks. arXiv preprint arXiv:1609.09106, 2016. 3github.com/jsuarez5341/Recurrent-Highway-Hypernetworks-NIPS 9 [14] Yann N Dauphin, Angela Fan, Michael Auli, and David Grangier. Language modeling with gated convolutional networks. arXiv preprint arXiv:1612.08083, 2016. [15] Nal Kalchbrenner, Lasse Espeholt, Karen Simonyan, Aaron van den Oord, Alex Graves, and Koray Kavukcuoglu. Neural machine translation in linear time. arXiv preprint arXiv:1610.10099, 2016. [16] Mitchell P Marcus, Mary Ann Marcinkiewicz, and Beatrice Santorini. Building a large annotated corpus of english: The penn treebank. Computational linguistics, 19(2):313–330, 1993. [17] Stanislau Semeniuta, Aliaksei Severyn, and Erhardt Barth. Recurrent dropout without memory loss. arXiv preprint arXiv:1603.05118, 2016. [18] Rafal Jozefowicz, Oriol Vinyals, Mike Schuster, Noam Shazeer, and Yonghui Wu. Exploring the limits of language modeling. arXiv preprint arXiv:1602.02410, 2016. [19] Alec Radford, Rafal Jozefowicz, and Ilya Sutskever. Learning to generate reviews and discovering sentiment. arXiv preprint arXiv:1704.01444, 2017. [20] Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. 10
2017
662
7,188
Parametric Simplex Method for Sparse Learning Haotian Pang‡ Robert Vanderbei‡ Han Liu?‡ Tuo Zhao⇧ ‡Princeton University ?Tencent AI Lab ‡Northwestern University ⇧Georgia Tech⇤ Abstract High dimensional sparse learning has imposed a great computational challenge to large scale data analysis. In this paper, we are interested in a broad class of sparse learning approaches formulated as linear programs parametrized by a regularization factor, and solve them by the parametric simplex method (PSM). Our parametric simplex method offers significant advantages over other competing methods: (1) PSM naturally obtains the complete solution path for all values of the regularization parameter; (2) PSM provides a high precision dual certificate stopping criterion; (3) PSM yields sparse solutions through very few iterations, and the solution sparsity significantly reduces the computational cost per iteration. Particularly, we demonstrate the superiority of PSM over various sparse learning approaches, including Dantzig selector for sparse linear regression, LAD-Lasso for sparse robust linear regression, CLIME for sparse precision matrix estimation, sparse differential network estimation, and sparse Linear Programming Discriminant (LPD) analysis. We then provide sufficient conditions under which PSM always outputs sparse solutions such that its computational performance can be significantly boosted. Thorough numerical experiments are provided to demonstrate the outstanding performance of the PSM method. 1 Introduction A broad class of sparse learning approaches can be formulated as high dimensional optimization problems. A well known example is Dantzig Selector, which minimizes a sparsity-inducing `1 norm with an `1 norm constraint. Specifically, let X 2 Rn⇥d be a design matrix, y 2 Rn be a response vector, and ✓2 Rd be the model parameter. Dantzig Selector can be formulated as the solution to the following convex program, b✓= argmin ✓ k✓k1 s.t. kX>(y −X✓)k1 λ. (1.1) where k · k1 and k · k1 denote the `1 and `1 norms respectively, and λ > 0 is a regularization factor. Candes and Tao (2007) suggest to rewrite (1.1) as a linear program solved by linear program solvers. Dantzig Selector motivates many other sparse learning approaches, which also apply a regularization factor to tune the desired solution. Many of them can be written as a linear program in the following generic form with either equality constraints: max x (c + λ¯c)>x s.t. Ax = b + λ¯b, x ≥0, (1.2) or inequality constraints: max x (c + λ¯c)>x s.t. Ax b + λ¯b, x ≥0. (1.3) Existing literature usually suggests the popular interior point method (IPM) to solve (1.2) and (1.3). The interior point method is famous for solving linear programs in polynomial time. Specifically, the interior point method uses the log barrier to handle the constraints, and rewrites (1.2) or (1.3) ⇤Correspondence to Tuo Zhao: tuo.zhao@isye.gatech.edu. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. as a unconstrained program, which is further solved by the Newton’s method. Since the log barrier requires the Newton’s method to only iterate within the interior of the feasible region, IPM cannot yield exact sparse iterates, and cannot take advantage of sparsity to boost the computation. An alternative approach is the simplex method. From a geometric perspective, the classical simplex method iterates over the vertices of a polytope. Algebraically, the algorithm involves moving from one partition of the basic and nonbasic variables to another. Each partition deviates from the previous in that one basic variable gets swapped with one nonbasic variable in a process called pivoting. Different variants of the simplex method are defined by different rules of pivoting. The simplex method has been shown to work well in practice, even though its worst-case iteration complexity has been shown to scale exponentially with the problem scale in existing literature. More recently, some researchers propose to use alternating direction methods of multipliers (ADMM) to directly solve (1.1) without reparametrization as a linear program. Although these methods enjoy O(1/T) convergence rates based on variational inequality criteria, where T is the number of iterations. ADMM can be viewed as an exterior point method, and always gives infeasible solutions within finite number of iterations. We often observe that after ADMM takes a large number of iterations, the solutions still suffer from significant feasibility violation. These methods work well only for moderate scale problems (e.g., d < 1000). For larger d, ADMM becomes less competitive. These methods, though popular, are usually designed for solving (1.2) and (1.3) for one single regularization factor. This is not satisfactory, since an appropriate choice of λ is usually unknown. Thus, one usually expects an algorithm to obtain multiple solutions tuned over a reasonable range of values for λ. For each value of λ, we need to solve a linear program from scratch, and it is therefore often very inefficient for high dimensional problems. To overcome the above drawbacks, we propose to solve both (1.2) and (1.3) by a variant of the parametric simplex method (PSM) in a principled manner (Murty, 1983; Vanderbei, 1995). Specifically, the parametric simplex method parametrizes (1.2) and (1.3) using the unknown regularization factor as a “parameter”. This eventually yields a piecewise linear solution path for a sequence of regularization factors. Such a varying parameter scheme is also called homotopy optimization in existing literature. PSM relies some special rules to iteratively choose the pair of variables to swap, which algebraically calculates the solution path during each pivoting. PSM terminates at a value of parameter, where we have successfully solved the full solution path to the original problem. Although in the worst-case scenario, PSM can take an exponential number of pivots to find an optimal solution path. Our empirical results suggest that the number of iterations is roughly linear in the number of nonzero variables for large regularization factors with sparse optima. This means that the desired sparse solutions can often be found using very few pivots. Several optimization methods for solving (1.1) are closely related to PSM. However, there is a lack of generic design in these methods. Their methods, for example, the simplex method proposed in Yao and Lee (2014) can be viewed as a special example of our proposed PSM, where the perturbation is only considered on the right-hand-side of the inequalities in the constraints. DASSO algorithm computes the entire coefficient path of Dantzig selector by a simplex-like algorithm. Zhu et al. (2004) propose a similar algorithm which takes advantage of the piece-wise linearity of the problem and computes the whole solution path on `1-SVM. These methods can be considered as similar algorithms derived from PSM but only applied to special cases, where the entire solution path is computed but an accurate dual certificate stopping criterion is not provided. Notations: We denote all zero and all one vectors by 1 and 0 respectively. Given a vector a = (a1, ..., ad)> 2 Rd, we define the number of nonzero entries kak0 = P j 1(aj 6= 0), kak1 = P j |aj|, kak2 2 = P j a2 j, and kak1 = maxj |aj|. When comparing vectors, “≥” and “” mean component-wise comparison. Given a matrix A 2 Rd⇥d with entries ajk, we use |||A||| to denote entry-wise norms and kAk to denote matrix norms. Accordingly |||A|||0 = P j,k 1(ajk 6= 0), |||A|||1 = P j,k |ajk|, |||A|||1 = maxj,k |ajk|, kAk1 = maxk P j |ajk|, kAk1 = maxj P k |ajk|, kAk2 = maxkak21 kAak2, and kAk2 F = P j,k a2 jk. We denote A\i\j as the submatrix of A with i-th row and j-th column removed. We denote Ai\j as the i-th row of A with its j-th entry removed and A\ij as the j-th column of A with its i-th entry removed. For any subset G of {1, 2, . . . , d}, we let AG denote the submatrix of A 2 Rp⇥d consisting of the corresponding columns of A. The notation A ≥0 means all of A’s entries are nonnegative. Similarly, for a vector a 2 Rd, we let aG denote the subvector of a associated with the indices in G. Finally, Id denotes the d-dimensional identity matrix 2 and ei denotes vector that has a one in its i-th entry and zero elsewhere. In a large matrix, we leave a submatrix blank when all of its entries are zeros. 2 Background Many sparse learning approaches are formulated as convex programs in a generic form: min ✓ L(✓) + λk✓k1, (2.1) where L(✓) is a convex loss function, and λ > 0 is a regularization factor controlling bias and variance. Moreover, if L(✓) is smooth, we can also consider an alternative formulation: min ✓ k✓k1 s.t. krL(✓)k1 λ, (2.2) where rL(✓) is the gradient of L(✓), and λ > 0 is a regularization factor. As will be shown later, both (2.2) and (2.1) are naturally suited for our algorithm, when L(✓) is piecewise linear or quadratic respectively. Our algorithm yields a piecewise-linear solution path as a function of λ by varying λ from large to small. Before we proceed with our proposed algorithm, we first introduce the sparse learning problems of our interests, including sparse linear regression, sparse linear classification, and undirected graph estimation. Due to space limit, we only present three examples, and defer the others to the appendix. Dantzig Selector: The first problem is sparse linear regression. Let y 2 Rn be a response vector and X 2 Rn⇥d be the design matrix. We consider a linear model y = X✓⇤+ ✏, where ✓⇤2 Rd is the unknown regression coefficient vector, and ✏is the observational noise vector. Here we are interested in a high dimensional regime: d is much larger than n, i.e., d ≫n, and many entries in ✓⇤are zero, i.e., k✓⇤k0 = s⇤⌧n. To get a sparse estimator of ✓0, machine learning researchers and statisticians have proposed numerous approaches including Lasso (Tibshirani, 1996), Dantzig Selector (Candes and Tao, 2007) and LAD-Lasso (Wang et al., 2007). The Dantzig selector is formulated as the solution to the following convex program: min ✓ k✓k1 subject to kX>(y −X✓)k1 λ. (2.3) By setting ✓= ✓+ −✓−with ✓+ j = ✓j · 1(✓j > 0) and ✓+ j = ✓j · 1(✓j < 0), we rewrite (2.3) as a linear program: min ✓+,✓−1>(✓+ + ✓−) s.t. ✓ X>X −X>X −X>X X>X ◆✓ ✓+ ✓− ◆  ✓ λ1 + X>y λ1 −X>y ◆ , ✓+, ✓−≥0. (2.4) By complementary slackness, we can guarantee that the optimal ✓+ j ’s and ✓− j ’s are nonnegative and complementary to each other. Note that (2.4) fits into our parametric linear program as (1.3) with A = ✓ X>X −X>X −X>X X>X ◆ , b = ✓ X>y −X>y ◆ , c = −1, ¯b = 1, ¯c = 0, x = ✓ ✓+ ✓− ◆ . Sparse Support Vector Machine: The second problem is Sparse SVM (Support Vector Machine), which is a model-free discriminative modeling approach (Zhu et al., 2004). Given n independent and identically distributed samples (x1, y1), ..., (xn, yn), where xi 2 Rd is the feature vector and yi 2 {1, −1} is the binary label. Similar to sparse linear regression, we are interested in the high dimensional regime. To obtain a sparse SVM classifier, we solve the following convex program: min ✓0,✓ n X i=1 [1 −yi(✓0 + ✓>xi)]+ s.t. k✓k1 λ, (2.5) where ✓0 2 R and ✓2 Rd. Given a new sample z 2 Rd, Sparse SVM classifier predicts its label by sign(✓0 + ✓>z). Let ti = 1 −yi(✓0 + ✓>xi) for i = 1, ..., n. Then ti can be expressed as ti = t+ i −t− i . Notice [1 −yi(✓0 + ✓>xi)]+ can be represented by t+ i . We split ✓and ✓0 into positive and negative parts as well: ✓= ✓+ −✓−and ✓0 = ✓+ 0 + ✓− 0 and add slack variable w to the constraint so that the constraint becomes equality: ✓+ + ✓−+ w = λ1, w ≥0. Now we cast the problem into the equality parametric simplex form (1.2). We identify each component of (1.2) as the following: x = & t+ t− ✓+ ✓− ✓+ 0 ✓− 0 w '> 2 R(n+1)⇥(2n+3d+2), x ≥ 0, c = & −1> 0> 0> 0> 0 0 0>'> 2 R2n+3d+2, ¯c = 0 2 R2n+3d+2, b = & 1> 0 '> 2 Rn+1, ¯b = & 0> 1 '> 2 Rn+1, and A = ✓In −In Z −Z y −y 1> 1> 1> ◆ 2 R(n+1)⇥(2n+3d+2), where Z = (y1x1, . . . , ynxn)> 2 Rn⇥d. 3 Differential Graph Estimation: The third problem is the differential graph estimation, which aims to identify the difference between two undirected graphs (Zhao et al., 2013; Danaher et al., 2013). The related applications in biological and medical research can be found in existing literature (Hudson et al., 2009; Bandyopadhyaya et al., 2010; Ideker and Krogan, 2012). Specifically, given n1 i.i.d. samples x1, ..., xn from Nd(µ0 X, ⌃0 X) and n2 i.i.d. samples y1, ..., yn from Nd(µ0 Y , ⌃0 Y ) We are interested in estimating the difference of the precision matrices of two distributions: ∆0 = (⌃0 X)−1 −(⌃0 Y )−1. We define the empirical covariance matrices as: SX = 1 n1 Pn1 j=1(xj −¯x)(xj −¯x)> andSY = 1 n2 Pn2 j=1(yj −¯y)(yj −¯x)>, where ¯x = 1 n1 Pn j=1 xj and ¯y = 1 n2 Pn j=1 yj. Then Zhao et al. (2013) propose to estimate ∆0 by solving the following problem: min ∆|||∆|||1 s.t. |||SX∆SY −SX + SY |||1 λ, (2.6) where SX and SY are the empirical covariance matrices. As can be seen, (2.6) is essentially a special example of a more general parametric linear program as follows, min D |||D|||1 s.t. |||XDZ −Y |||1 λ, (2.7) where D 2 Rd1⇥d2, X 2 Rm1⇥d1, Z 2 Rd2⇥m2 and Y 2 Rm1⇥m2 are given data matrices. Instead of directly solving (2.7), we consider a reparametrization by introducing an axillary variable C = XD. Similar to CLIME, we decompose D = D+ + D−, and eventually rewrite (2.7) as min D+,D−1>(D+ + D−)1 s.t. |||CZ −Y |||1 λ, X(D+ −D−) = C, D+, D−≥0, (2.8) Let vec(D+), vec(D−), vec(C) and vec(Y ) be the vectors obtained by stacking the columns of matrices D+, D−C and Y , respectively. We write (2.8) as a parametric linear program, A = 0 @ X0 −X0 −Im1d2 Z0 Im1m2 −Z0 Im1m2 1 A with X0 = 0 B @ X ... X 1 C A 2 Rm1d2⇥d1d2, Z0 = 0 B @ z11Im1 · · · zd21Im1 ... ... ... −z1m2Im1 · · · −zd2m2Im1 1 C A 2 Rm1m2⇥m1d2, where zij denotes the (i, j) entry of matrix Z; x = ⇥vec(D+) vec(D−) vec(C) w⇤> 2 R2d1d2+m1d2+2m1m2, where w 2 R2m1m2 is nonnegative slack variable vector used to make the inequality become an equality. Moreover, we also have b = ⇥ 0> vec(Y ) −vec(Y ) ⇤> 2 Rm1d2+2m1m2, where the first m1d2 components of vector b are 0 and the rest components are from matrix Y ; ¯b = & 0> 1> 1>'> 2 Rm1d2+2m1m2, where the first m1d2 components of vector ¯b are 0 and the rest 2m1m2 components are 1; c = & −1> −1> 0> 0>'> 2 R2d1d2+m1d2+2m1m2, where the first 2d1d2 components of vector c are −1 and the rest m1d2 + 2m1m2 components are 0. 3 Homotopy Parametric Simplex Method We first briefly review the primal simplex method for linear programming, and then derive the proposed algorithm. Preliminaries: We consider a standard linear program as follows, max x c>x s.t. Ax = b, x ≥0 x 2 Rn, (3.1) where A 2 Rm⇥n, b 2 Rm and c 2 Rn are given. Without loss of generality, we assume that m n and matrix A has full row rank m. Throughout our analysis, we assume that an optimal solution exists (it needs not be unique). The primal simplex method starts from a basic feasible solution (to be defined shortly—but geometrically can be thought of as any vertex of the feasible polytope) and proceeds step-by-step (vertex-by-vertex) to the optimal solution. Various techniques exist to find the first feasible solution, which is often referred to the Phase I method. See Vanderbei (1995); Murty (1983); Dantzig (1951). 4 Algebraically, a basic solution corresponds to a partition of the indices {1, . . . , n} into m basic indices denoted B and n −m non-basic indices denoted N. Note that not all partitions are allowed— the submatrix of A consisting of the columns of A associated with the basic indices, denoted AB, must be invertible. The submatrix of A corresponding to the nonbasic indices is denoted AN . Suppressing the fact that the columns have been rearranged, we can write A = [AN , AB]. If we rearrange the rows of x and c in the same way, we can introduce a corresponding partition of these vectors: x =  xN xB 1 , c =  cN cB 1 . From the commutative property of addition, we rewrite the constraint as AN xN + ABxB = b. Since the matrix AB is assumed to be invertible, we can express xB in terms of xN as follows: xB = x⇤ B −A−1 B AN xN , (3.2) where we have written x⇤ B as an abbreviation for A−1 B b. This rearrangement of the equality constraints is called a dictionary because the basic variables are defined as functions of the nonbasic variables. Denoting the objective c>x by ⇣, then we also can write: ⇣= c>x = c> BxB + c> N xN = ⇣⇤−(z⇤ N )>xN , (3.3) where ⇣⇤= c> BA−1 B b, x⇤ B = A−1 B b and z⇤ N = (A−1 B AN )>cB −cN . We call equations (3.2) and (3.3) the primal dictionary associated with the current basis B. Corresponding to each dictionary, there is a basic solution (also called a dictionary solution) obtained by setting the nonbasic variables to zero and reading off values of the basic variables: xN = 0, xB = x⇤ B. This particular “solution” satisfies the equality constraints of the problem by construction. To be a feasible solution, one only needs to check that the values of the basic variables are nonnegative. Therefore, we say that a basic solution is a basic feasible solution if x⇤ B ≥0. The dual of (3.1) is given by max y −b>y s.t. A>y −z = c, z ≥0 z 2 Rn, y 2 Rm. (3.4) In this case, we separate variable z into basic and nonbasic parts as before: [z] =  zN zB 1 . The corresponding dual dictionary is given by: zN = z⇤ N + (A−1 B AN )>zB, −⇠= −⇣⇤−(x⇤ B)>zB, (3.5) where ⇠denotes the objective function in the (3.4), ⇣⇤= c> BA−1 B b, x⇤ B = A−1 B b and z⇤ N = (A−1 B AN )>cB −cN . For each dictionary, we set xN and zB to 0 (complementarity) and read off the solutions to xB and zN according to (3.2) and (3.5). Next, we remove one basic index and replacing it with a nonbasic index, and then get an updated dictionary. The simplex method produces a sequence of steps to adjacent bases such that the value of the objective function is always increasing at each step. Primal feasibility requires that xB ≥0, so while we update the dictionary, primal feasibility must always be satisfied. This process will stop when zN ≥0 (dual feasibility), since it satisfies primal feasibility, dual feasibility and complementarity (i.e., the optimality condition). Parametric Simplex Method: We derive the parametric simplex method used to find the full solution path while solving the parametric linear programming problem only once. A few variants of the simplex method are proposed with different rules for choosing the pair of variables to swap at each iteration. Here we describe the rule used by the parametric simplex method: we add some positive perturbations (¯b and ¯c) times a positive parameter λ to both objective function and the right hand side of the primal problem. The purpose of doing this is to guarantee the primal and dual feasibility when λ is large. Since the problem is already primal feasible and dual feasible, there is no phase I stage required for the parametric simplex method. Furthermore, if the i-th entry of b or the j-th entry of c has already satisfied the feasibility condition (bi ≥0 or cj 0), then the corresponding perturbation ¯bi or ¯cj to that entry is allowed to be 0. With these perturbations, (3.1) becomes: max x (c + λ¯c)>x s.t. Ax = b + λ¯b, x ≥0 x 2 Rn. (3.6) We separate the perturbation vectors into basic and nonbasic parts as well and write down the the dictionary with perturbations corresponding to (3.2),(3.3), and (3.5) as: xB = (x⇤ B + λ¯xB) −A−1 B AN xN , ⇣= ⇣⇤−(z⇤ N + λ¯zN )>xN , (3.7) 5 zN = (z⇤ N + λ¯zN ) + (A−1 B AN )>zB, −⇠= −⇣⇤−(x⇤ B + λ¯xB)>zB, (3.8) where x⇤ B = A−1 B b, z⇤ N = (A−1 B AN )>cB −cN , ¯xB = A−1 B ¯b and ¯zN = (A−1 B AN )>¯cB −¯cN . When λ is large, the dictionary will be both primal and dual feasible (x⇤ B +λ¯xB ≥0 and z⇤ N +λ¯zN ≥ 0). The corresponding primal solution is simple: xB = x⇤ B + λ¯xB and xN = 0. This solution is valid until λ hits a lower bound which breaks the feasibility. The smallest value of λ without break any feasibility is given by λ⇤= min{λ : z⇤ N + λ¯zN ≥0 and x⇤ B + λ¯xB ≥0}. (3.9) In other words, the dictionary and its corresponding solution xB = x⇤ B + λ¯xB and xN = 0 is optimal for the value of λ 2 [λ⇤, λmax], where λ⇤= max ✓ maxj2N , ¯zNj >0 − z⇤ Nj ¯zNj , maxi2B,¯xBi>0 − x⇤ Bi ¯xBi ◆ , (3.10) λmax = min ✓ minj2N , ¯zNj <0 − z⇤ Nj ¯zNj , mini2B,¯xBi<0 − x⇤ Bi ¯xBi ◆ . (3.11) Note that although initially the perturbations are nonnegative, as the dictionary gets updated, the perturbation does not necessarily maintain nonnegativity. For each dictionary, there is a corresponding interval of λ given by (3.10) and (3.11). We have characterized the optimal solution for this interval, and these together give us the solution path of the original parametric linear programming problem. Next, we show how the dictionary gets updated as the leaving variable and entering variable swap. We expect that after swapping the entering variable j and leaving variable i, the new solution in the dictionary (3.7) and (3.8) would slightly change to: x⇤ j = t, ¯x⇤ j = ¯t, z⇤ i = s, ¯z⇤ i = ¯s, x⇤ B x⇤ B −t∆xB, ¯xB ¯xB −¯t∆xB, z⇤ N z⇤ N −s∆zN , ¯zN ¯zN −¯s∆zN , where t and ¯t are the primal step length for the primal basic variables and perturbations, s and ¯s are the dual step length for the dual nonbasic variables and perturbations, ∆xB and ∆zN are the primal and dual step directions, respectively. We explain how to find these values in details now. There is either a j 2 N for which z⇤ N + λ¯zN = 0 or an i 2 B for which x⇤ B + λ¯xB = 0 in (3.9). If it corresponds to a nonbasic index j, then we do one step of the primal simplex. In this case, we declare j as the entering variable, then we need to find the primal step direction ∆xB. After the entering variable j has been selected, xN changes from 0 to tej, where t is the primal step length. Then according to (3.7), we have that xB = (x⇤ B + λ¯xB) −A−1 B AN tej. The step direction ∆xB is given by ∆xB = A−1 B AN ej. We next select the leaving variable. In order to maintain primal feasibility, we need to keep xB ≥0, therefore, the leaving variable i is selected such that i 2 B achieves the maximal value of ∆xi x⇤ i +λ⇤¯xi . It only remains to show how zN changes. Since i is the leaving variable, according to (3.8), we have ∆zN = −(A−1 B AN )>ei. After we know the entering variables, the primal and dual step directions, the primal and dual step lengths can be found as t = x⇤ i ∆xi , ¯t = ¯xi ∆xi , s = z⇤ j ∆zj , ¯s = ¯zj ∆zj . If, on the other hand, the constraint in (3.9) corresponds to a basic index i, we declare i as the leaving variable, then similar calculation can be made based on the dual simplex method (apply the primal simplex method to the dual problem). Since it is very similar to the primal simplex method, we omit the detailed description. The algorithm will terminate whenever λ⇤0. The corresponding solution is optimal since our dictionary always satisfies primal feasibility, dual feasibility and complementary slackness condition. The only concern during the entire process of the parametric simplex method is that λ does not equal to zero, so as long as λ can be set to be zero, we have the optimal solution to the original problem. We summarize the parametric simplex method in Algorithm 1: The following theorem shows that the updated basic and nonbasic partition gives the optimal solution. Theorem 3.1. For a given dictionary with parameter λ in the form of (3.7) and (3.8), let B be a basic index set and N be an nonbasic index set. Assume this dictionary is optimal for λ 2 [λ⇤, λmax], where λ⇤and λmax are given by (3.10) and (3.11), respectively. The updated dictionary with basic index set B⇤and nonbasic index set N ⇤is still optimal at λ = λ⇤. 6 Write down the dictionary as in (3.7) and (3.8); Find λ⇤given by (3.10); while λ⇤> 0 do if the constraint in (3.10) corresponds to an index j 2 N then Declare xj as the entering variable; Compute primal step direction. ∆xB = A−1 B AN ej; Select leaving variable. Need to find i 2 B that achieves the maximal value of ∆xi x⇤ i +λ⇤¯xi ; Compute dual step direction. It is given by ∆zN = −(A−1 B AN )>ei; else if the constraint in (3.10) corresponds to an index i 2 B then Declare zi as the leaving variable; Compute dual step direction. ∆zN = −(A−1 B AN )>ei; Select entering variable. Need to find j 2 N that achieves the maximal value of ∆zj z⇤ j +λ⇤¯zj ; Compute primal step direction. It is given by ∆xB = A−1 B AN ej; Compute the dual and primal step lengths for both variables and perturbations: t = x⇤ i ∆xi , ¯t = ¯xi ∆xi , s = z⇤ j ∆zj , ¯s = ¯zj ∆zj . Update the primal and dual solutions: x⇤ j = t, ¯xj = ¯t, z⇤ i = s, ¯zi = ¯s, x⇤ B x⇤ B −t∆xB, ¯xB ¯xB −¯t∆xB z⇤ N z⇤ N −s∆zN , ¯zN ¯zN −¯s∆zN . Update the basic and nonbasic index sets B := B \ {i} \ {j} and N := N \ {j} \ {i}. Write down the new dictionary and compute λ⇤given by (3.10); end Set the nonbasic variables as 0s and read the values of the basic variables. Algorithm 1: The parametric simplex method During each iteration, there is an optimal solution corresponding to λ 2 [λ⇤, λmax]. Notice each of these λ’s range is determined by a partition between basic and nonbasic variables, and the number of the partition into basic and nonbasic variables is finite. Thus after finite steps, we must find the optimal solution corresponding to all λ values. Theory: We present our theoretical analysis on solving Dantzig selector using PSM. Specifically, given X 2 Rn⇥d, y 2 Rn, we consider a linear model y = X✓⇤+ ✏, where ✓⇤is the unknown sparse regression coefficient vector with k✓⇤k0 = s⇤, and ✏⇠N(0, σ2In). We show that PSM always maintains a pair of sparse primal and dual solutions. Therefore, the computation cost within each iteration of PSM can be significantly reduced. Before we proceed with our main result, we introduce two assumptions. The first assumption requires the regularization factor to be sufficiently large. Assumption 3.2. Suppose that PSM solves (2.3) for a regularization sequence {λK}N K=0. The smallest regularization factor λN satisfies λN = Cσ r log d n ≥4kX>✏k1 for some generic constant C. Existing literature has extensively studied Assumption 3.2 for high dimensional statistical theories. Such an assumption enforces all regularization parameters to be sufficiently large in order to eliminate irrelevant coordinates along the regularization path. Note that Assumption 3.2 is deterministic for any given λN. Existing literature has verified that for sparse linear regression models, given ✏⇠N(0, σ2In), Assumption 3.2 holds with overwhelming probability. Before we present the second assumption, we define the largest and smallest s-sparse eigenvalues of n−1X>X respectively as follows. Definition 3.3. Given an integer s ≥1, we define ⇢+(s) = sup k∆k0s ∆T X>X∆ nk∆k2 2 and ⇢−(s) = inf k∆k0s ∆T X>X∆ nk∆k2 2 . 7 Assumption 3.4. Given k✓⇤k0 s⇤, there exists an integer es such that es ≥100s⇤, ⇢+(s⇤+ es) < +1, and e⇢−(s⇤+ es) > 0, where is defined as = ⇢+(s⇤+ es)/e⇢−(s⇤+ es). Assumption 3.4 guarantees that n−1X>X satisfies the sparse eigenvalue conditions as long as the number of active irrelevant blocks never exceeds e2s along the solution path. That is closely related to the restricted isometry property (RIP) and restricted eigenvalue (RE) conditions, which have been extensively studied in existing literature. We then characterize the sparsity of the primal and dual solutions within each iteration. Theorem 3.5 (Primal and Dual Sparsity). Suppose that Assumptions 3.2 and 3.4 hold. We consider an alterantive formulation to the Dantzig selector, b✓λ0 = argmin ✓ k✓k1 subject to −rjL(✓) λ0, rjL(✓) λ0. (3.12) Let bµλ0 = [bµλ0 1 , ..., bµλ0 d , bγλ0 d+1, ..., bγλ0 2d]> denote the optimal dual variables to (3.12). For any λ0 ≥λ, we have kbµλ0k0 + kbγλ0k0 s⇤+ es. Moreover, given design matrix satisfying kX> S XS(X> S XS)−1k1 1 −⇣, where ⇣> 0 is a generic constant, S = {j | ✓⇤ j 6= 0} and S = {j | ✓⇤ j = 0}, we have kb✓λ0k0 s⇤. The proof of Theorem 3.5 is provided in Appendix B. Theorem 3.5 shows that within each iteration, both primal and dual variables are sparse, i.e., the number of nonzero entries are far smaller than d. Therefore, the computation cost within each iteration of PSM can be significantly reduced by a factor of O(d/s⇤). This partially justifies the superior performance of PSM in sparse learning. 4 Numerical Experiments In this section, we present some numerical experiments and give some insights about how the parametric simplex method solves different linear programming problems. We verify the following assertions: (1) The parametric simplex method requires very few iterations to identify the nonzero component if the original problem is sparse. (2) The parametric simplex method is able to find the full solution path with high precision by solving the problem only once in an efficient and scalable manner. (3) The parametric simplex method maintains the feasibility of the problem up to machine precision along the solution path. 0 5 10 15 −3 −2 −1 0 1 2 Iteration Nonzero Entries of the Response Vector ● ● ● ● ● ● ● ● ● True Value Estimated Path (a) Solution Path 0 5 10 15 0 100 200 300 400 500 Iteration Values of Lambda along the Path (b) Parameter Path (Rescaled by n) 0 100 200 300 400 500 0 100 200 300 400 Iteration Infeasibility Flare PSM (c) Feasibility Violation Figure 1: Dantzig selector method: (a) The solution path of the parametric simplex method; (b) The parameter path of the parametric simplex method; (c) Feasibility violation along the solution path. Solution path of Dantzig selector: We start with a simple example that illustrates how the recovered solution path of the Dantzig selector model changes as the parametric simplex method iterates. We adopt the example used in Candes and Tao (2007). The design matrix X has n = 100 rows and d = 250 columns. The entries of X are generated from an array of independent Gaussian random variables that are then Gaussianized so that each column has a given norm. We randomly select s = 8 entries from the response vector ✓0, and set them as ✓0 i = si(1 + ai), where si = 1 or −1, with probability 1/2 and ai ⇠N(0, 1). The other entries of ✓0 are set to zero. We form y = X✓0 + ✏, where ✏i ⇠N(0, σ), with σ = 1. We stop the parametric simplex method when λ σn p log d/n. The solution path of the result is shown in Figure 1(a). We see that our method correctly identifies all nonzero entries of ✓in less than 10 iterations. Some small overestimations occur in a few iterations after all nonzero entries have been identified. We also show how the parameter λ evolves as the parametric simplex method iterates in Figure 1(b). As we see, λ decreases sharply to less than 5 8 after all nonzero components have been identified. This reconciles with the theorem we developed. The algorithm itself only requires a very small number of iterations to correctly identify the nonzero entries of ✓. In our example, each iteration in the parametric simplex method identifies one or two non-sparse entries in ✓. Feasibility of Dantzig Selector: Another advantage of the parametric simplex method is that the solution is always feasible along the path while other estimating methods usually generate infeasible solutions along the path. We compare our algorithm with “flare” (Li et al., 2015) which uses the Alternating Direction Method of Multipliers (ADMM) using the same example described above. We compute the values of kX>X✓i −X>yk1 −λi along the solution path, where ✓i is the i-th basic solution (with corresponding λi) obtained while the parametric simplex method is iterating. Without any doubts, we always obtain 0s during each iteration. We plug the same list of λi into “flare” and compute the solution path for this list as well. As shown in Table 1, the parametric simplex method is always feasible along the path since it is solving each iteration up to machine precision; while the solution path of the ADMM is almost always breaking the feasibility by a large amount, especially in the first few iterations which correspond to large λ values. Each experiment is repeated for 100 times. Table 1: Average feasibility violation with standard errors along the solution path Maximum violation Minimum Violation ADMM 498(122) 143(73.2) PSM 0(0) 0(0) Performance Benchmark of Dantzig Selector: In this part, we compare the timing performance of our algorithm with R package “flare”. We fix the sample size n to be 200 and vary the data dimension d from 100 to 5000. Again, each entries of X is independent Gaussian and Gaussianized such that the column has uniform norm. We randomly select 2% entries from vector ✓to be nonzero and each entry is chosen as ⇠N(0, 1). We compute y = X✓+ ✏, with ✏i ⇠N(0, 1) and try to recover vector ✓, given X and y. Our method stops when λ is less than 2σ p log d/n, such that the full solution path for all the values of λ up to this value is computed by the parametric simplex method. In “flare”, we estimate ✓when λ is equal to the value in the Dantzig selector model. This means “flare” has much less computation task than the parametric simplex method. As we can see in Table 2, our method has a much better performance than “flare” in terms of speed. We compare and present the timing performance of the two algorithms in seconds and each experiment is repeated for 100 times. In practice, only very few iterations is required when the response vector ✓is sparse. Table 2: Average timing performance (in seconds) with standard errors in the parentheses on Dantzig selector 500 1000 2000 5000 Flare 19.5(2.72) 44.4(2.54) 142(11.5) 1500(231) PSM 2.40(0.220) 29.7(1.39) 47.5(2.27) 649(89.8) Performance Benchmark of Differential Network: We now apply this optimization method to the Differential Network model. We need the difference between two inverse covariance matrices to be sparse. We generate ⌃0 x = U >⇤U, where ⇤2 Rd⇥d is a diagonal matrix and its entries are i.i.d. and uniform on [1, 2], and U 2 Rd⇥d is a random matrix with i.i.d. entries from N(0, 1). Let D1 2 Rd⇥d be a random sparse symmetric matrix with a certain sparsity level. Each entry of D1 is i.i.d. and from N(0, 1). We set D = D1 + 2|λmin(D1)|Id in order to guarantee the positive definiteness of D, where λmin(D1) is the smallest eigenvalue of D1. Finally, we let ⌦0 x = (⌃0 x)−1 and ⌦0 y = ⌦0 x + D. We then generate data of sample size n = 100. The corresponding sample covariance matrices SX and SY are also computed based on the data. We are not able to find other software which can efficiently solve this problem, so we only list the timing performance of our algorithm as dimension d varies from 25 to 200 in Table 3. We stop our algorithm whenever the solution achieved the desired sparsity level. When d = 25, 50 and 100, the sparsity level of D1 is set to be 0.02 and when d = 150 and 200, the sparsity level of D1 is set to be 0.002. Each experiment is repeated for 100 times. Table 3: Average timing performance (in seconds) and iteration numbers with standard errors in the parentheses on differential network 25 50 100 150 200 Timing 0.0185(0.00689) 0.376(0.124) 6.81(2.38) 13.41(1.26) 46.88(7.24) Iteration Number 15.5(7.00) 55.3(18.8) 164(58.2) 85.8(16.7) 140(26.2) 9 References BANDYOPADHYAYA, S., MEHTA, M., KUO, D., SUNG, M.-K., CHUANG, R., JAEHNIG, E. J., BODENMILLER, B., LICON, K., COPELAND, W., SHALES, M., FIEDLER, D., DUTKOWSKI, J., GUÉNOLÉ, A., ATTIKUM, H. V., SHOKAT, K. M., KOLODNER, R. D., HUH, W.-K., AEBERSOLD, R., KEOGH, M.-C. and KROGAN, N. J. (2010). Rewiring of genetic networks in response to dna damage. Science Signaling 330 1385–1389. BÜHLMANN, P. and VAN DE GEER, S. (2011). Statistics for high-dimensional data: methods, theory and applications. Springer Science &amp; Business Media. CAI, T. and LIU, W. (2011). A direct estimation approach to sparse linear discriminant analysis. Journal of the American Statistical Association 106 1566–1578. CAI, T., LIU, W. and LUO, X. (2011). A constrained l1 minimization approach to sparse precision matrix estimation. Journal of the American Statistical Association 106 594–607. CANDES, E. and TAO, T. (2007). The dantzig selector: Statistical estimation when p is much larger than n. The Annals of Statistics 35 2313–2351. DANAHER, P., WANG, P. and WITTEN, D. M. (2013). The joint graphical lasso for inverse covariance estimation across multiple classes. Journal of the Royal Statistical Society Series B 7 373–397. DANTZIG, G. (1951). Linear Programming and Extensions. Princeton University Press. DEMPSTER, A. (1972). Covariance selection. Biometrics 28 157–175. GAI, Y., ZHU, L. and LIN, L. (2013). Model selection consistency of dantzig selector. Statistica Sinica 615–634. HUDSON, N. J., REVERTER, A. and DALRYMPLE, B. P. (2009). A differential wiring analysis of expression data correctly identifies the gene containing the causal mutation. PLoS Computational Biology. 5. IDEKER, T. and KROGAN, N. (2012). Differential network biology. Molecular Systems Biology 5 565. LI, X., ZHAO, T., YUAN, X. and LIU, H. (2015). The flare package for hign dimensional linear regression and precision matrix estimation in r. Journal of Machine Learning Research 16 553–557. MURTY, K. (1983). Linear Programming. Wiley, New York, NY. TIBSHIRANI, R. (1996). Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society 101 267–288. VANDERBEI, R. (1995). Linear Programming, Foundations and Extensions. Kluwer. WANG, H., LI, G. and JIANG, G. (2007). Robust regression shrinkage and consistent variable selection through the lad-lasso. Journal of Business & Economic Statistics 25 347–355. YAO, Y. and LEE, Y. (2014). Another look at linear programming for feature selection via methods of regularization. Statistics and Computing 24 885–905. ZHAO, S. D., CAI, T. and LI, H. (2013). Direct estimation of differential networks. Biometrika 58 253–268. ZHOU, H. and HASTIE, T. (2005). Regularization and variable selection via the elastic net. Journal of the Royal Statistical Society 67 301–320. ZHU, J., ROSSET, S., HASTIE, T. and TIBSHIRANI, R. (2004). 1-norm support vector machines. Advances in Neural Information Processing Systems 16. 10
2017
663
7,189
Filtering Variational Objectives Chris J. Maddison1,3,*, Dieterich Lawson,2,* George Tucker2,* Nicolas Heess1, Mohammad Norouzi2, Andriy Mnih1, Arnaud Doucet3, Yee Whye Teh1 1DeepMind, 2Google Brain, 3University of Oxford {cmaddis, dieterichl, gjt}@google.com Abstract When used as a surrogate objective for maximum likelihood estimation in latent variable models, the evidence lower bound (ELBO) produces state-of-the-art results. Inspired by this, we consider the extension of the ELBO to a family of lower bounds defined by a particle filter’s estimator of the marginal likelihood, the filtering variational objectives (FIVOs). FIVOs take the same arguments as the ELBO, but can exploit a model’s sequential structure to form tighter bounds. We present results that relate the tightness of FIVO’s bound to the variance of the particle filter’s estimator by considering the generic case of bounds defined as log-transformed likelihood estimators. Experimentally, we show that training with FIVO results in substantial improvements over training the same model architecture with the ELBO on sequential data. 1 Introduction Learning in statistical models via gradient descent is straightforward when the objective function and its gradients are tractable. In the presence of latent variables, however, many objectives become intractable. For neural generative models with latent variables, there are currently a few dominant approaches: optimizing lower bounds on the marginal log-likelihood [1, 2], restricting to a class of invertible models [3], or using likelihood-free methods [4, 5, 6, 7]. In this work, we focus on the first approach and introduce filtering variational objectives (FIVOs), a tractable family of objectives for maximum likelihood estimation (MLE) in latent variable models with sequential structure. Specifically, let x denote an observation of an X-valued random variable. We assume that the process generating x involves an unobserved Z-valued random variable z with joint density p(x, z) in some family P. The goal of MLE is to recover p ∈P that maximizes the marginal log-likelihood, log p(x) = log R p(x, z) dz 1. The difficulty in carrying out this optimization is that the loglikelihood function is defined via a generally intractable integral. To circumvent marginalization, a common approach [1, 2] is to optimize a variational lower bound on the marginal log-likelihood [8, 9]. The evidence lower bound L(x, p, q) (ELBO) is the most common such bound and is defined by a variational posterior distribution q(z|x) whose support includes p’s, L(x, p, q) = E q(z|x)  log p(x, z) q(z|x)  = log p(x) −KL(q(z|x) ∥p(z|x)) ≤log p(x) . (1) L(x, p, q) lower-bounds the marginal log-likelihood for any choice of q, and the bound is tight when q is the true posterior p(z|x). Thus, the joint optimum of L(x, p, q) in p and q is the MLE. In practice, it is common to restrict q to a tractable family of distributions (e.g., a factored distribution) and to *Equal contribution. 1We reuse p to denote the conditionals and marginals of the joint density. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. jointly optimize the ELBO over p and q with stochastic gradient ascent [1, 2, 10, 11]. Because of the KL penalty from q to p, optimizing (1) under these assumptions tends to force p’s posterior to satisfy the factorizing assumptions of the variational family which reduces the capacity of the model p. One strategy for addressing this is to decouple the tightness of the bound from the quality of q. For example, [12] observed that Eq. (1) can be interpreted as the log of an unnormalized importance weight with the proposal given by q, and that using N samples from the same proposal produces a tighter bound, known as the importance weighted auto-encoder bound, or IWAE. Indeed, it follows from Jensen’s inequality that the log of any unbiased positive Monte Carlo estimator of the marginal likelihood results in a lower bound that can be optimized for MLE. The filtering variational objectives (FIVOs) build on this idea by treating the log of a particle filter’s likelihood estimator as an objective function. Following [13], we call objectives defined as log-transformed likelihood estimators Monte Carlo objectives (MCOs). In this work, we show that the tightness of an MCO scales like the relative variance of the estimator from which it is constructed. It is well-known that the variance of a particle filter’s likelihood estimator scales more favourably than simple importance sampling for models with sequential structure [14, 15]. Thus, FIVO can potentially form a much tighter bound on the marginal log-likelihood than IWAE. The main contributions of this work are introducing filtering variational objectives and a more careful study of Monte Carlo objectives. In Section 2, we review maximum likelihood estimation via maximizing the ELBO. In Section 3, we study Monte Carlo objectives and provide some of their basic properties. We define filtering variational objectives in Section 4, discuss details of their optimization, and present a sharpness result. Finally, we cover related work and present experiments showing that sequential models trained with FIVO outperform models trained with ELBO or IWAE in practice. 2 Background We briefly review techniques for optimizing the ELBO as a surrogate MLE objective. We restrict our focus to latent variable models in which the model pθ(x, z) factors into tractable conditionals pθ(z) and pθ(x|z) that are parameterized differentiably by parameters θ. MLE in these models is then the problem of optimizing log pθ(x) in θ. The expectation-maximization (EM) algorithm is an approach to this problem which can be seen as coordinate ascent, fully maximizing L(x, pθ, q) alternately in q and θ at each iteration [16, 17, 18]. Yet, EM rarely applies in general, because maximizing over q for a fixed θ corresponds to a generally intractable inference problem. Instead, an approach with mild assumptions on the model is to perform gradient ascent following a Monte Carlo estimator of the ELBO’s gradient [19, 10]. We assume that q is taken from a family of distributions parameterized differentiably by parameters φ. We can follow an unbiased estimator of the ELBO’s gradient by sampling z ∼qφ(z|x) and updating the parameters by θ′ = θ +η∇θ log pθ(x, z) and φ′ = φ + η(log pθ(x, z) −log qφ(z|x))∇φ log qφ(z|x), where the gradients are computed conditional on the sample z and η is a learning rate. Such estimators follow the ELBO’s gradient in expectation, but variance reduction techniques are usually necessary [10, 20, 13]. A lower variance gradient estimator can be derived if qφ is a reparameterizable distribution [1, 2, 21]. Reparameterizable distributions are those that can be simulated by sampling from a distribution ϵ ∼d(ϵ), which does not depend on φ, and then applying a deterministic transformation z = fφ(x, ϵ). When pθ, qφ, and fφ are differentiable, an unbiased estimator of the ELBO gradient consists of sampling ϵ and updating the parameter by (θ′, φ′) = (θ, φ) + η∇(θ,φ)(log pθ(x, fφ(x, ϵ)) − log qφ(fφ(x, ϵ)|x)). Given ϵ, the gradients of the sampling process can flow through z = fφ(x, ϵ). Unfortunately, when the variational family of qφ is restricted, following gradients of −KL(qφ(z|x) ∥pθ(z|x)) tends to reduce the capacity of the model pθ to match the assumptions of the variational family. This KL penalty can be “removed” by considering generalizations of the ELBO whose tightness can be controlled by means other than the closenesss of p and q, e.g., [12]. We consider this in the next section. 3 Monte Carlo Objectives (MCOs) Monte Carlo objectives (MCOs) [13] generalize the ELBO to objectives defined by taking the log of a positive, unbiased estimator of the marginal likelihood. The key property of MCOs is that 2 they are lower bounds on the marginal log-likelihood, and thus can be used for MLE. Motivated by the previous section, we present results on the convergence of generic MCOs to the marginal log-likelihood and show that the tightness of an MCO is closely related to the variance of the estimator that defines it. One can verify that the ELBO is a lower bound by using the concavity of log and Jensen’s inequality, E q(z|x)  log p(x, z) q(z|x)  ≤log Z p(x, z) q(z|x) q(z|x) dz = log p(x). (2) This argument only relies only on unbiasedness of p(x, z)/q(z|x) when z ∼q(z|x). Thus, we can generalize this by considering any unbiased marginal likelihood estimator ˆpN(x) and treating E[log ˆpN(x)] as an objective function over models p. Here N ∈N indexes the amount of computation needed to simulate ˆpN(x), e.g., the number of samples or particles. Definition 1. Monte Carlo Objectives. Let ˆpN(x) be an unbiased positive estimator of p(x), E[ˆpN(x)] = p(x), then the Monte Carlo objective LN(x, p) over p ∈P defined by ˆpN(x) is LN(x, p) = E[log ˆpN(x)] (3) For example, the ELBO is constructed from a single unnormalized importance weight ˆp(x) = p(x, z)/q(z|x). The IWAE bound [12] takes ˆpN(x) to be N averaged i.i.d. importance weights, L IWAE N (x, p, q) = E q(zi|x) " log 1 N N X i=1 p(x, zi) q(zi|x) !# (4) We consider additional examples in the Appendix. To avoid notational clutter, we omit the arguments to an MCO, e.g., the observations x or model p, when the default arguments are clear from context. Whether we can compute stochastic gradients of LN efficiently depends on the specific form of the estimator and the underlying random variables that define it. Many likelihood estimators ˆpN(x) converge to p(x) almost surely as N →∞(known as strong consistency). The advantage of a consistent estimator is that its MCO can be driven towards log p(x) by increasing N. We present sufficient conditions for this convergence and a description of the rate: Proposition 1. Properties of Monte Carlo Objectives. Let LN(x, p) be a Monte Carlo objective defined by an unbiased positive estimator ˆpN(x) of p(x). Then, (a) (Bound) LN(x, p) ≤log p(x). (b) (Consistency) If log ˆpN(x) is uniformly integrable (see Appendix for definition) and ˆpN(x) is strongly consistent, then LN(x, p) →log p(x) as N →∞. (c) (Asymptotic Bias) Let g(N) = E[(ˆpN(x) −p(x))6] be the 6th central moment. If the 1st inverse moment is bounded, lim supN→∞E[ˆpN(x)−1] < ∞, then log p(x) −LN(x, p) = 1 2 var  ˆpN(x) p(x)  + O( p g(N)). (5) Proof. See the Appendix for the proof and a sufficient condition for controlling the first inverse moment when ˆpN(x) is the average of i.i.d. random variables. In some cases, convergence of the bound to log p(x) is monotonic, e.g., IWAE [12], but this is not true in general. The relative variance of estimators, var(ˆpN(x)/p(x)), tends to be well studied, so property (c) gives us a tool for comparing the convergence rate of distinct MCOs. For example, [14, 15] study marginal likelihood estimators defined by particle filters and find that the relative variance of these estimators scales favorably in comparison to naive importance sampling. This suggests that a particle filter’s MCO, introduced in the next section, will generally be a tighter bound than IWAE. 3 Algorithm 1 Simulating LFIVO N (x1:T , p, q) 1: FIVO(x1:T , p, q, N): 2: {wi 0}N i=1 = {1/N}N i=1 3: for t ∈{1, . . . , T} do 4: for i ∈{1, . . . , N} do 5: zi t ∼qt(zt|x1:t, zi 1:t−1) 6: zi 1:t = CONCAT(zi 1:t−1, zi t) 7: ˆpt = PN i=1 wi t−1αt(zi 1:t)  8: ˆpN(x1:t) = ˆpN(x1:t−1)ˆpt 9: {wi t}N i=1 = {wi t−1αt(zi 1:t)/ˆpt}N i=1 10: if resampling criteria satisfied by {wi t}N i=1 then 11: {wi t, zi 1:t}N i=1 = RSAMP({wi t, zi 1:t}N i=1) 12: return log ˆpN(x1:T ) 13: RSAMP({wi, zi}N i=1): 14: for i ∈{1, . . . , N} do 15: a ∼Categorical({wi}N i=1) 16: yi = za 17: return { 1 N , yi}N i=1 4 Filtering Variational Objectives (FIVOs) The filtering variational objectives (FIVOs) are a family of MCOs defined by the marginal likelihood estimator of a particle filter. For models with sequential structure, e.g., latent variable models of audio and text, the relative variance of a naive importance sampling estimator tends to scale exponentially in the number of steps. In contrast, the relative variance of particle filter estimators can scale more favorably with the number of steps—linearly in some cases [14, 15]. Thus, the results of Section 3 suggest that FIVOs can serve as tighter objectives than IWAE for MLE in sequential models. Let our observations be sequences of T X-valued random variables denoted x1:T , where xi:j ≡ (xi, . . . , xj). We also assume that the data generation process relies on a sequence of T unobserved Z-valued latent variables denoted z1:T . We focus on sequential latent variable models that factor as a series of tractable conditionals, p(x1:T , z1:T ) = p1(x1, z1) QT t=2 pt(xt, zt|x1:t−1, z1:t−1). A particle filter is a sequential Monte Carlo algorithm, which propagates a population of N weighted particles for T steps using a combination of importance sampling and resampling steps, see Alg. 1. In detail, the particle filter takes as arguments an observation x1:T , the number of particles N, the model distribution p, and a variational posterior q(z1:T |x1:T ) factored over t, q(z1:T |x1:T ) = T Y t=1 qt(zt|x1:t, z1:t−1) . (6) The particle filter maintains a population {wi t−1, zi 1:t−1}N i=1 of particles zi 1:t−1 with weights wi t−1. At step t, the filter independently proposes an extension zi t ∼qt(zt|x1:t, zi 1:t−1) to each particle’s trajectory zi 1:t−1. The weights wi t−1 are multiplied by the incremental importance weights, αt(zi 1:t) = pt(xt, zi t|x1:t−1, zi 1:t−1) qt(zi t|x1:t, zi 1:t−1) , (7) and renormalized. If the current weights wi t satisfy a resampling criteria, then a resampling step is performed and N particles zi 1:t are sampled in proportion to their weights from the current population with replacement. Common resampling schemes include resampling at every step and resampling if the effective sample size (ESS) of the population (PN i=1(wi t)2)−1 drops below N/2 [22]. After resampling the weights are reset to 1. Otherwise, the particles zi 1:t are copied to the next step along with the accumulated weights. See Fig. 1 for a visualization. Instead of viewing Alg. 1 as an inference algorithm, we treat the quantity E[log ˆpN(x1:T )] as an objective function over p. Because ˆpN(x1:T ) is an unbiased estimator of p(x1:T ), proven in the Appendix and in [23, 24, 25, 26], it defines an MCO, which we call FIVO: Definition 2. Filtering Variational Objectives. Let log ˆpN(x1:T ) be the output of Alg. 1 with inputs (x1:T , p, q, N), then LFIVO N (x1:T , p, q) = E[log ˆpN(x1:T )] is a filtering variational objective. ˆpN(x1:T ) is a strongly consistent estimator [23, 24]. So if log ˆpN(x1:T ) is uniformly integrable, then LFIVO N (x1:T , p, q) →log p(x1:T ) as N →∞. Resampling is the distinguishing feature of LFIVO N ; if resampling is removed, then FIVO reduces to IWAE. Resampling does add an amount of immediate variance, but it allows the filter to discard low weight particles with high probability. This has the 4 z2 1 z3 1 z1 1 z3 2 z2 2 z1 2 z3 3 z2 3 z1 3 log ˆp1 log ˆp2 log ˆp3 resample {zi 1:3}3 i=1 ∼wi 3 z2 1 z2 2 z2 3 z2 4 log ˆp1 log ˆp2 log ˆp3 log ˆp4 propose zi 4 ∼q4(z4|x1:4, zi 1:3) z2 1 z2 2 z2 3 z2 4 ∇log ˆp4 log ˆp4∇log wi 3 gradients Figure 1: Visualizing FIVO; (Left) Resample from particle trajectories to determine inheritance in next step, (middle) propose with qt and accumulate loss log ˆpt, (right) gradients (in the reparameterized case) flow through the lattice, objective gradients in solid red and resampling gradients in dotted blue. effect of refocusing the distribution of particles to regions of higher mass under the posterior, and in some sequential models can reduce the variance from exponential to linear in the number of time steps [14, 15]. Resampling is a greedy process, and it is possible that a particle discarded at step t, could have attained a high mass at step T. In practice, the best trade-off is to use adaptive resampling schemes [22]. If for a given x1:T , p, q a particle filter’s likelihood estimator improves over simple importance sampling in terms of variance, we expect LFIVO N to be a tighter bound than L or LIWAE N . 4.1 Optimization The FIVO bound can be optimized with the same stochastic gradient ascent framework used for the ELBO. We found in practice it was effective simply to follow a Monte Carlo estimator of the biased gradient E[∇(θ,φ) log ˆpN(x1:T )] with reparameterized zi t. This gradient estimator is biased, as the full FIVO gradient has three kinds of terms: it has the term E[∇θ,φ log ˆpN(x1:T )], where ∇θ,φ log ˆpN(x1:T ) is defined conditional on the random variables of Alg. 1; it has gradient terms for every distribution of Alg. 1 that depends on the parameters; and, if adaptive resampling is used, then it has additional terms that account for the change in FIVO with respect to the decision to resample. In this section, we derive the FIVO gradient when zi t are reparameterized and a fixed resampling schedule is followed. We derive the full gradient in the Appendix. In more detail, we assume that p and q are parameterized in a differentiable way by θ and φ. Assume that q is from a reparameterizable family and that zi t of Alg. 1 are reparameterized. Assume that we use a fixed resampling schedule, and let I(resampling at step t) be an indicator function indicating whether a resampling occured at step t. Now, LFIVO N depends on the parameters via log ˆpN(x1:T ) and the resampling probabilities wi t in the density. Thus, ∇(θ,φ) LFIVO N = E  ∇(θ,φ) log ˆpN(x1:T ) + XT t=1 XN i=1 I(resampling at step t) log ˆpN(x1:T ) ˆpN(x1:t) ∇(θ,φ) log wi t  (8) Given a single forward pass of Alg. 1 with reparameterized zi t, the terms inside the expectation form a Monte Carlo estimator of Eq. (8). However, the terms from resampling events contribute to the majority of the variance of the estimator. Thus, the gradient estimator that we found most effective in practice consists only of the gradient ∇(θ,φ) log ˆpN(x1:T ), the solid red arrows of Figure 1. We explore this experimentally in Section 6.3. 4.2 Sharpness As with the ELBO, FIVO is a variational objective taking a variational posterior q as an argument. An important question is whether FIVO achieves the marginal log-likelihood at its optimal q. We can only guarantee this for models in which z1:t−1 and xt are independent given x1:t−1. Proposition 2. Sharpness of Filtering Variational Objectives. Let LFIVO N (x1:T , p, q) be a FIVO, and q∗(x1:T , p) = argmaxq LFIVO N (x1:T , p, q). If p has independence structure such that p(z1:t−1|x1:t) = p(z1:t−1|x1:t−1) for t ∈{2, . . . , T}, then q∗(x1:T , p)(z1:T ) = p(z1:T |x1:T ) and L FIVO N (x1:T , p, q∗(x1:T , p)) = log p(x1:T ) . Proof. See Appendix. 5 Most models do not satisfy this assumption, and deriving the optimal q in general is complicated by the resampling dynamics. For the restricted the model class in Proposition 2, the optimal qt does not condition on future observations xt+1:T . We explored this experimentally with richer models in Section 6.4, and found that allowing qt to condition on xt+1:T does not reliably improve FIVO. This is consistent with the view of resampling as a greedy process that responds to each intermediate distribution as if it were the final. Still, we found that the impact of this effect was outweighed by the advantage of optimizing a tighter bound. 5 Related Work The marginal log-likelihood is a central quantity in statistics and probability, and there has long been an interest in bounding it [27]. The literature relating to the bounds we call Monte Carlo objectives has typically focused on the problem of estimating the marginal likelihood itself. [28, 29] use Jensen’s inequality in a forward and reverse estimator to detect the failure of inference methods. IWAE [12] is a clear influence on this work, and FIVO can be seen as an extension of this bound. The ELBO enjoys a long history [8] and there have been efforts to improve the ELBO itself. [30] generalize the ELBO by considering arbitrary operators of the model and variational posterior. More closely related to this work is a body of work improving the ELBO by increasing the expressiveness of the variational posterior. For example, [31, 32] augment the variational posterior with deterministic transformations with fixed Jacobians, and [33] extend the variational posterior to admit a Markov chain. Other approaches to learning in neural latent variable models include [34], who use importance sampling to approximate gradients under the posterior, and [35], who use sequential Monte Carlo to approximate gradients under the posterior. These are distinct from our contribution in the sense that for them inference for the sake of estimation is the ultimate goal. To our knowledge the idea of treating the output of inference as an objective in and of itself, while not completely novel, has not been fully appreciated in the literature. Although, this idea shares inspiration with methods that optimize the convergence of Markov chains [36]. We note that the idea to optimize the log estimator of a particle filter was independently and concurrently considered in [37, 38]. In [37] the bound we call FIVO is cast as a tractable lower bound on the ELBO defined by the particle filter’s non-parameteric approximation to the posterior. [38] additionally derive an expression for FIVO’s bias as the KL between the filter’s distribution and a certain target process. Our work is distinguished by our study of the convergence of MCOs in N, which includes FIVO, our investigation of FIVO sharpness, and our experimental results on stochastic RNNs. 6 Experiments In our experiments, we sought to: (a) compare models trained with ELBO, IWAE, and FIVO bounds in terms of final test log-likelihoods, (b) explore the effect of the resampling gradient terms on FIVO, (c) investigate how the lack of sharpness affects FIVO, and (d) consider how models trained with FIVO use the stochastic state. To explore these questions, we trained variational recurrent neural networks (VRNN) [39] with the ELBO, IWAE, and FIVO bounds using TensorFlow [40] on two benchmark sequential modeling tasks: natural speech waveforms and polyphonic music. These datasets are known to be difficult to model without stochastic latent states [41]. The VRNN is a sequential latent variable model that combines a deterministic recurrent neural network (RNN) with stochastic latent states zt at each step. The observation distribution over xt is conditioned directly on zt and indirectly on z1:t−1 via the RNN’s state ht(zt−1, xt−1, ht−1). For a length T sequence, the model’s posterior factors into the conditionals QT t=1 pt(zt|ht(zt−1, xt−1, ht−1))gt(xt|zt, ht(zt−1, xt−1, ht−1)), and the variational posterior factors as QT t=1 qt(zt|ht(zt−1, xt−1, ht−1), xt). All distributions over latent variables are factorized Gaussians, and the output distributions gt depend on the dataset. The RNN is a single-layer LSTM and the conditionals are parameterized by fully connected neural networks with one hidden layer of the same size as the LSTM hidden layer. We used the residual parameterization [41] for the variational posterior. 6 N Bound Nottingham JSB MuseData Piano-midi.de 4 ELBO -3.00 -8.60 -7.15 -7.81 IWAE -2.75 -7.86 -7.20 -7.86 FIVO -2.68 -6.90 -6.20 -7.76 8 ELBO -3.01 -8.61 -7.19 -7.83 IWAE -2.90 -7.40 -7.15 -7.84 FIVO -2.77 -6.79 -6.12 -7.45 16 ELBO -3.02 -8.63 -7.18 -7.85 IWAE -2.85 -7.41 -7.13 -7.79 FIVO -2.58 -6.72 -5.89 -7.43 TIMIT N Bound 64 units 256 units 4 ELBO 0 10,438 IWAE -160 11,054 FIVO 5,691 17,822 8 ELBO 2,771 9,819 IWAE 3,977 11,623 FIVO 6,023 21,449 16 ELBO 1,676 9,918 IWAE 3,236 13,069 FIVO 8,630 21,536 Table 1: Test set marginal log-likelihood bounds for models trained with ELBO, IWAE, and FIVO. For ELBO and IWAE models, we report max{L, LIWAE 128 , LFIVO 128 }. For FIVO models, we report LFIVO 128 . Pianoroll results are in nats per timestep, TIMIT results are in nats per sequence relative to ELBO with N = 4. For details on our evaluation methodology and absolute numbers see the Appendix. For FIVO we resampled when the ESS of the particles dropped below N/2. For FIVO and IWAE we used a batch size of 4, and for the ELBO, we used batch sizes of 4N to match computational budgets (resampling is O(N) with the alias method). For all models we report bounds using the variational posterior trained jointly with the model. For models trained with FIVO we report LFIVO 128 . To provide strong baselines, we report the maximum across bounds, max{L, LIWAE 128 , LFIVO 128 }, for models trained with ELBO and IWAE. Additional details in the Appendix. 6.1 Polyphonic Music We evaluated VRNNs trained with the ELBO, IWAE, and FIVO bounds on 4 polyphonic music datasets: the Nottingham folk tunes, the JSB chorales, the MuseData library of classical piano and orchestral music, and the Piano-midi.de MIDI archive [42]. Each dataset is split into standard train, valid, and test sets and is represented as a sequence of 88-dimensional binary vectors denoting the notes active at the current timestep. We mean-centered the input data and modeled the output as a set of 88 factorized Bernoulli variables. We used 64 units for the RNN hidden state and latent state size for all polyphonic music models except for JSB chorales models, which used 32 units. We report bounds on average log-likelihood per timestep in Table 1. Models trained with the FIVO bound significantly outperformed models trained with either the ELBO or the IWAE bounds on all four datasets. In some cases, the improvements exceeded 1 nat per timestep, and in all cases optimizing FIVO with N = 4 outperformed optimizing IWAE or ELBO for N = {4, 8, 16}. 6.2 Speech The TIMIT dataset is a standard benchmark for sequential models that contains 6300 utterances with an average duration of 3.1 seconds spoken by 630 different speakers. The 6300 utterances are divided into a training set of size 4620 and a test set of size 1680. We further divided the training set into a validation set of size 231 and a training set of size 4389, with the splits exactly as in [41]. Each TIMIT utterance is represented as a sequence of real-valued amplitudes which we split into a sequence of 200-dimensional frames, as in [39, 41]. Data preprocessing was limited to mean centering and variance normalization as in [41]. For TIMIT, the output distribution was a factorized Gaussian, and we report the average log-likelihood bound per sequence relative to models trained with ELBO. Again, models trained with FIVO significantly outperformed models trained with IWAE or ELBO, see Table 1. 6.3 Resampling Gradients All models in this work (except those in this section) were trained with gradients that did not include the term in Eq. (8) that comes from resampling steps. We omitted this term because it has an outsized effect on gradient variance, often increasing it by 6 orders of magnitude. To explore the effects of this term experimentally, we trained VRNNs with and without the resampling gradient term on the TIMIT and polyphonic music datasets. When using the resampling term, we attempted to control its variance 7 0 1 2 3 4 5 6 1M Gradient Updates 8 6 4 2 0 2 4 6 Train Log-likelihood 1e4 Without Resampling Gradient Term With Resampling Gradient Term 0 10 20 30 40 50 60 1k Gradient Updates 10-5 10-4 10-3 10-2 10-1 100 101 KL Divergence FIVO IWAE ELBO Figure 2: (Left) Graph of LFIVO 128 over training comparing models trained with and without the resampling gradient terms on TIMIT with N = 4. (Right) KL divergence from q(z1:T |x1:T ) to p(z1:T ) for models trained on the JSB chorales with N = 16. Bound Nottingham JSB MuseData Piano-midi.de TIMIT ELBO -2.40 -5.48 -6.54 -6.68 0 ELBO+s -2.59 -5.53 -6.48 -6.77 -925 IWAE -2.52 -5.77 -6.54 -6.74 1,469 IWAE+s -2.37 -4.63 -6.47 -6.74 2,630 FIVO -2.29 -4.08 -5.80 -6.41 6,991 FIVO+s -2.34 -3.83 -5.87 -6.34 9,773 Table 2: Train set marginal log-likelihood bounds for models comparing smoothing (+s) and nonsmoothing variational posteriors. We report max{L, LIWAE 128 , LFIVO 128 } for ELBO and IWAE models and LFIVO 128 for FIVO models. All models were trained with N = 4. Pianoroll results are in nats per timestep, TIMIT results are in nats per sequence relative to non-smoothing ELBO. For details on our evaluation methodology and absolute numbers see the Appendix. using a moving-average baseline linear in the number of timesteps. For all datasets, models trained without the resampling gradient term outperformed models trained with the term by a large margin on both the training set and held-out data. Many runs with resampling gradients failed to improve beyond random initialization. A representative pair of train log-likelihood curves is shown in Figure 2 — gradients without the resampling term led to earlier convergence and a better solution. We stress that this is an empirical result — in principle biased gradients can lead to divergent behaviour. We leave exploring strategies to reduce the variance of the unbiased estimator to future work. 6.4 Sharpness FIVO does not achieve the marginal log-likelihood at its optimal variational posterior q∗, because the optimal q∗does not condition on future observations (see Section 4.2). In contrast, ELBO and IWAE are sharp, and their q∗s depend on future observations. To investigate the effects of this, we defined a smoothing variant of the VRNN in which q takes as additional input the hidden state of a deterministic RNN run backwards over the observations, allowing q to condition on future observations. We trained smoothing VRNNs using ELBO, IWAE, and FIVO, and report evaluation on the training set (to isolate the effect on optimization performance) in Table 2 . Smoothing helped models trained with IWAE, but not enough to outperform models trained with FIVO. As expected, smoothing did not reliably improve models trained with FIVO. Test set performance was similar, see the Appendix for details. 6.5 Use of Stochastic State A known pathology when training stochastic latent variable models with the ELBO is that stochastic states can go unused. Empirically, this is associated with the collapse of variational posterior q(z|x) network to the model prior p(z) [43]. To investigate this, we plot the KL divergence from q(z1:T |x1:T ) to p(z1:T ) averaged over the dataset (Figure 2). Indeed, the KL of models trained with 8 ELBO collapsed during training, whereas the KL of models trained with FIVO remained high, even while achieving a higher log-likelihood bound. 7 Conclusions We introduced the family of filtering variational objectives, a class of lower bounds on the log marginal likelihood that extend the evidence lower bound. FIVOs are suited for MLE in neural latent variable models. We trained models with the ELBO, IWAE, and FIVO bounds and found that the models trained with FIVO significantly outperformed other models across four polyphonic music modeling tasks and a speech waveform modeling task. Future work will include exploring control variates for the resampling gradients, FIVOs defined by more sophisticated filtering algorithms, and new MCOs based on differentiable operators like leapfrog operators with deterministically annealed temperatures. In general, we hope that this paper inspires the machine learning community to take a fresh look at the literature of marginal likelihood estimators—seeing them as objectives instead of algorithms for inference. Acknowledgments We thank Matt Hoffman, Matt Johnson, Danilo J. Rezende, Jascha Sohl-Dickstein, and Theophane Weber for helpful discussions and support in this project. A. Doucet was partially supported by the EPSRC grant EP/K000276/1. Y. W. Teh’s research leading to these results has received funding from the European Research Council under the European Union’s Seventh Framework Programme (FP7/2007-2013) ERC grant agreement no. 617071. References [1] Diederik P Kingma and Max Welling. Auto-encoding variational Bayes. ICLR, 2014. [2] Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. ICML, 2014. [3] Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using real nvp. arXiv preprint arXiv:1605.08803, 2016. [4] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In NIPS, 2014. [5] Sebastian Nowozin, Botond Cseke, and Ryota Tomioka. f-gan: Training generative neural samplers using variational divergence minimization. arXiv preprint arXiv:1606.00709, 2016. [6] Dustin Tran, Rajesh Ranganath, and David M Blei. Deep and hierarchical implicit models. arXiv preprint arXiv:1702.08896, 2017. [7] Shakir Mohamed and Balaji Lakshminarayanan. Learning in implicit generative models. arXiv preprint arXiv:1610.03483, 2016. [8] Michael I Jordan, Zoubin Ghahramani, Tommi S Jaakkola, and Lawrence K Saul. An introduction to variational methods for graphical models. Machine learning, 37(2):183–233, 1999. [9] Matthew J. Beal. Variational algorithms for approximate Bayesian inference. 2003. [10] Rajesh Ranganath, Sean Gerrish, and David Blei. Black box variational inference. In AISTATS, 2014. [11] Alp Kucukelbir, Dustin Tran, Rajesh Ranganath, Andrew Gelman, and David M Blei. Automatic differentiation variational inference. arXiv preprint arXiv:1603.00788, 2016. [12] Yuri Burda, Roger Grosse, and Ruslan Salakhutdinov. Importance weighted autoencoders. ICLR, 2016. [13] Andriy Mnih and Danilo J Rezende. Variational inference for Monte Carlo objectives. arXiv preprint arXiv:1602.06725, 2016. [14] Frédéric Cérou, Pierre Del Moral, and Arnaud Guyader. A nonasymptotic theorem for unnormalized Feynman–Kac particle models. Ann. Inst. H. Poincaré B, 47(3):629–649, 2011. 9 [15] Jean Bérard, Pierre Del Moral, and Arnaud Doucet. A lognormal central limit theorem for particle approximations of normalizing constants. Electron. J. Probab., 19(94):1–28, 2014. [16] Arthur P Dempster, Nan M Laird, and Donald B Rubin. Maximum likelihood from incomplete data via the EM algorithm. J. R. Stat. Soc. Ser. B Stat. Methodol., pages 1–38, 1977. [17] CF Jeff Wu. On the convergence properties of the EM algorithm. Ann. Stat., pages 95–103, 1983. [18] Radford M Neal and Geoffrey E Hinton. A view of the EM algorithm that justifies incremental, sparse, and other variants. In Learning in graphical models, pages 355–368. Springer, 1998. [19] Matthew D Hoffman, David M Blei, Chong Wang, and John William Paisley. Stochastic variational inference. Journal of Machine Learning Research, 14(1):1303–1347, 2013. [20] Andriy Mnih and Karol Gregor. Neural variational inference and learning in belief networks. arXiv preprint arXiv:1402.0030, 2014. [21] Yarin Gal. Uncertainty in Deep Learning. PhD thesis, University of Cambridge, 2016. [22] Arnaud Doucet and Adam M. Johansen. A tutorial on particle filtering and smoothing: Fifteen years later. In D. Crisan and B. Rozovsky, editors, The Oxford Handbook of Nonlinear Filtering, pages 656–704. Oxford University Press, 2011. [23] Pierre Del Moral. Feynman-Kac formulae: genealogical and interacting particle systems with applications. Springer Verlag, 2004. [24] Pierre Del Moral. Mean field simulation for Monte Carlo integration. CRC Press, 2013. [25] Christophe Andrieu, Arnaud Doucet, and Roman Holenstein. Particle Markov chain Monte Carlo methods. J. R. Stat. Soc. Ser. B Stat. Methodol., 72(3):269–342, 2010. [26] Michael K Pitt, Ralph dos Santos Silva, Paolo Giordani, and Robert Kohn. On some properties of Markov chain Monte Carlo simulation methods based on the particle filter. J. Econometrics, 171(2):134–151, 2012. [27] Martin J Wainwright, Michael I Jordan, et al. Graphical models, exponential families, and variational inference. Foundations and Trends in Machine Learning, 1(1–2):1–305, 2008. [28] Roger B Grosse, Zoubin Ghahramani, and Ryan P Adams. Sandwiching the marginal likelihood using bidirectional Monte Carlo. arXiv preprint arXiv:1511.02543, 2015. [29] Yuri Burda, Roger Grosse, and Ruslan Salakhutdinov. Accurate and conservative estimates of MRF log-likelihood using reverse annealing. In AISTATS, 2015. [30] Rajesh Ranganath, Dustin Tran, Jaan Altosaar, and David Blei. Operator variational inference. In NIPS, 2016. [31] Danilo Jimenez Rezende and Shakir Mohamed. Variational inference with normalizing flows. ICML, 2015. [32] Diederik P Kingma, Tim Salimans, Rafal Jozefowicz, Xi Chen, Ilya Sutskever, and Max Welling. Improved variational inference with inverse autoregressive flow. In NIPS, 2016. [33] Tim Salimans, Diederik Kingma, and Max Welling. Markov chain Monte Carlo and variational inference: Bridging the gap. In ICML, 2015. [34] Jörg Bornschein and Yoshua Bengio. Reweighted wake-sleep. ICLR, 2015. [35] Shixiang Gu, Zoubin Ghahramani, and Richard E Turner. Neural adaptive sequential Monte Carlo. In NIPS, 2015. [36] Yoshua Bengio, Li Yao, Guillaume Alain, and Pascal Vincent. Generalized denoising autoencoders as generative models. In NIPS, 2013. [37] Christian A Naesseth, Scott W Linderman, Rajesh Ranganath, and David M Blei. Variational sequential Monte Carlo. arXiv preprint arXiv:1705.11140, 2017. [38] Tuan Anh Le, Maximilian Igl, Tom Jin, Tom Rainforth, and Frank Wood. Auto-encoding sequential Monte Carlo. arXiv preprint arXiv:1705.10306, 2017. [39] Junyoung Chung, Kyle Kastner, Laurent Dinh, Kratarth Goel, Aaron C Courville, and Yoshua Bengio. A recurrent latent variable model for sequential data. In NIPS, 2015. 10 [40] Martín Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, et al. Tensorflow: Large-scale machine learning on heterogeneous distributed systems. arXiv preprint arXiv:1603.04467, 2016. [41] Marco Fraccaro, Søren Kaae Sønderby, Ulrich Paquet, and Ole Winther. Sequential neural models with stochastic layers. In NIPS, 2016. [42] Nicolas Boulanger-Lewandowski, Yoshua Bengio, and Pascal Vincent. Modeling temporal dependencies in high-dimensional sequences: Application to polyphonic music generation and transcription. ICML, 2012. [43] Samuel R Bowman, Luke Vilnis, Oriol Vinyals, Andrew M Dai, Rafal Jozefowicz, and Samy Bengio. Generating sentences from a continuous space. arXiv preprint arXiv:1511.06349, 2015. 11
2017
664
7,190
Cold-Start Reinforcement Learning with Softmax Policy Gradient Nan Ding Google Inc. Venice, CA 90291 dingnan@google.com Radu Soricut Google Inc. Venice, CA 90291 rsoricut@google.com Abstract Policy-gradient approaches to reinforcement learning have two common and undesirable overhead procedures, namely warm-start training and sample variance reduction. In this paper, we describe a reinforcement learning method based on a softmax value function that requires neither of these procedures. Our method combines the advantages of policy-gradient methods with the efficiency and simplicity of maximum-likelihood approaches. We apply this new cold-start reinforcement learning method in training sequence generation models for structured output prediction problems. Empirical evidence validates this method on automatic summarization and image captioning tasks. 1 Introduction Reinforcement learning is the study of optimal sequential decision-making in an environment [16]. Its recent developments underpin a large variety of applications related to robotics [11, 5] and games [20]. Policy search in reinforcement learning refers to the search for optimal parameters for a given policy parameterization [5]. Policy search based on policy-gradient [26, 21] has been recently applied to structured output prediction for sequence generations. These methods alleviate two common problems that approaches based on training with the Maximum-likelihood Estimation (MLE) objective exhibit, namely the exposure-bias problem [24, 19] and the wrong-objective problem [19, 15] (more on this in Section 2). As a result of addressing these problems, policy-gradient methods achieve improved performance compared to MLE training in various tasks, including machine translation [19, 7], text summarization [19], and image captioning [19, 15]. Policy-gradient methods for sequence generation work as follows: first the model proposes a sequence, and the ground-truth target is used to compute a reward for the proposed sequence with respect to the reward of choice (using metrics known to correlate well with human-rated correctness, such as ROUGE [13] for summarization, BLEU [18] for machine translation, CIDEr [23] or SPICE [1] for image captioning, etc.). The reward is used as a weight for the log-likelihood of the proposed sequence, and learning is done by optimizing the weighted average of the log-likelihood of the proposed sequences. The policy-gradient approach works around the difficulty of differentiating the reward function (the majority of which are non-differentiable) by using it as a weight. However, since sequences proposed by the model are also used as the target of the model, they are very noisy and their initial quality is extremely poor. The difficulty of aligning the model output distribution with the reward distribution over the large search space of possible sequences makes training slow and inefficient∗. As a result, overhead procedures such as warm-start training with the MLE objective and sophisticated methods for sample variance reduction are required to train with policy gradient. ∗Search space size is O(V T ), where V is the number of word types in the vocabulary (typically between 104 and 106) and T is the the sequence length (typically between 10 and 50), hence between 1040 and 10300. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. The fundamental reason for the inefficiency of policy-gradient–based reinforcement learning is the large discrepancy between the model-output distribution and the reward distribution, especially in the early stages of training. If, instead of generating the target based solely on the model-output distribution, we generate it based on a proposal distribution that incorporates both the model-output distribution and the reward distribution, learning would be efficient, and neither warm-start training nor sample variance reduction would be needed. The outstanding problem is finding a value function that induces such a proposal distribution. In this paper, we describe precisely such a value function, which in turn gives us a Softmax Policy Gradient (SPG) method. The softmax terminology comes from the equation that defines this value function, see Section 3. The gradient of the softmax value function is equal to the average of the gradient of the log-likelihood of the targets whose proposal distribution combines both model output distribution and reward distribution. Although this distribution is infeasible to sample exactly, we show that one can draw samples approximately, based on an efficient forward-pass sampling scheme. To balance the importance between the model output distribution and the reward distribution, we use a bang-bang [8] mixture model to combine the two distributions. Such a scheme removes the need of fine-tuning the weights across different datasets and throughout the learning epochs. In addition to using a main metric as the task reward (ROUGE, CIDEr, etc.), we show that one can also incorporate additional, task-specific metrics to enforce various properties on the output sequences (Section 4). We numerically evaluate our method on two sequence generation benchmarks, a headline-generation task and an image-caption–generation task (Section 5). In both cases, the SPG method significantly improves the accuracy, compared to maximum-likelihood and other competing methods. Finally, it is worth noting that although the training and inference of the SPG method in the paper is mainly based on sequence learning, the idea can be extended to other reinforcement learning applications. 2 Limitations of Existing Sequence Learning Regimes One of the standard approaches to sequence-learning training is Maximum-likelihood Estimation (MLE). Given a set of inputs X =  xi and target sequences Y =  yi , the MLE loss function is: LMLE(θ) = X i Li MLE(θ), where Li MLE(θ) = −log pθ(yi|xi). (1) Here xi and yi =  yi 1, . . . , yi T denote the input and the target sequence of the i-th example, respectively. For instance, in the image captioning task, xi is the image of the i-th example, and yi is the groundtruth caption of the i-th example. Although widely used in many different applications, MLE estimation for sequence learning suffers from the exposure-bias problem [24, 19]. Exposure-bias refers to training procedures that produce brittle models that have only been exposed to their training data distribution but not to their own predictions. At training-time, log pθ(yi|xi) = P t log pθ(yi t|xi, yi 1...t−1), i.e. the loss of the t-th word is conditional on the true previous-target tokens yi 1...t−1. However, since yi 1...t−1 are unavailable during inference, replacing them with tokens zi 1...t−1 generated by pθ(zi 1...t−1|xi) yields a significant discrepancy between how the model is used at training time versus inference time. The exposure-bias problem has recently received attention in neural-network settings with the “data as demonstrator” [24] and “scheduled sampling” [3] approaches. Although improving model performance in practice, such proposals have been shown to be statistically inconsistent [10], and still need to perform MLE-based warm-start training. A more general approach to MLE is the Reward Augmented Maximum Likelihood (RAML) method [17]. RAML makes the correct observation that, under MLE, all alternative outputs are equally penalized through normalization, regardless of their relationship to the ground-truth target. Instead, RAML corrects for this shortcoming using an objective of the form: Li RAML(θ) = − X zi rR(zi|yi) log pθ(zi|xi). (2) where rR(zi|yi) = exp(R(zi|yi)/τ) P zi exp(R(zi|yi)/τ). This formulation uses R(zi|yi) to denote the value of a similarity metric R between zi and yi (the reward), with yi = argmaxzi R(zi|yi); τ is a temperature hyper-parameter to control the peakiness of this reward distribution. Since the sum over all zi for 2 the reward distribution rR(zi|yi) in Eq. (2) is infeasible to compute, a standard approach is to draw J samples zij from the reward distribution, and approximate the expectation by Monte Carlo integration: Li RAML(θ) ≃−1 J J X j=1 log pθ(zij|xi). (3) Although a clear improvement over Eq. (1), the sampling for zij in Eq. (3) is solely based on rR(zi|yi) and completely ignores the model probability. At the same time, this technique does not address the exposure bias problem at all. A different approach, based on reinforcement learning methods, achieves sequence learning following a policy-gradient method [21]. Its appeal is that it not only solves the exposure-bias problem, but also directly alleviates the wrong-objective problem [19, 15] of MLE approaches. Wrong-objective refers to the critique that MLE-trained models tend to have suboptimal performance because such models are trained on a convenient objective (i.e., maximum likelihood) rather than a desirable objective (e.g., a metric known to correlate well with human-rated correctness). The policy-gradient method uses a value function VP G, which is equivalent to a loss LP G defined as: Li P G(θ) = −V i P G(θ), V i P G(θ) = Epθ(zi|xi)[R(zi|yi)]. (4) The gradient for Eq. (4) is: ∂ ∂θLi P G(θ) = − X zi pθ(zi|xi)R(zi|yi) ∂ ∂θ log pθ(zi|xi). (5) Similar to (3), one can draw J samples zij from pθ(zi|xi) to approximate the expectation by MonteCarlo integration: ∂ ∂θLi P G(θ) ≃−1 J J X j=1 R(zij|yi) ∂ ∂θ log pθ(zij|xi). (6) However, the large discrepancy between the model prediction distribution pθ(zi|xi) and the reward R(zi|yi)’s values, which is especially acute during the early training stages, makes the Monte-Carlo integration extremely inefficient. As a result, this method also requires a warm-start phase in which the model distribution achieves some local maximum with respect to a reward-metric–free objective (e.g., MLE), followed by a model refinement phase in which reward-metric–based PG updates are used to refine the model [19, 7, 15]. Although this combination achieves better results in practice compared to pure likelihood-based approaches, it is unsatisfactory from a theoretical and modeling perspective, as well as inefficient from a speed-to-convergence perspective. Both these issues are addressed by the value function we describe next. 3 Softmax Policy Gradient (SPG) Method In order to smoothly incorporate both the model distribution pθ(zi|xi) and the reward metric R(zi|yi), we replace the value function from Eq. 4 with a Softmax value function for Policy Gradient (SPG), VSP G, equivalent to a loss LSP G defined as: Li SP G(θ) = −V i SP G(θ), V i SP G(θ) = log Epθ(zi|xi)[exp(R(zi|yi))]  . (7) Because the value function for example i is equal to Softmaxzi(log pθ(zi|xi) + R(zi|yi)), where Softmaxzi(·) = log P zi exp(·), we call it the softmax value function. Note that the softmax value function from Eq. (7) is the dual of the entropy-regularized policy search (REPS) objective [5, 16] L(q) = Eq[R] + KL(q|pθ). However, our learning and sampling procedures are significantly different from REPS, as shown in what follows. The gradient for Eq. (7) is: ∂ ∂θLi SP G(θ) = − 1 P zi pθ(zi|xi) exp(R(zi|yi)) X zi pθ(zi|xi) exp(R(zi|yi)) ∂ ∂θ log pθ(zi|xi) ! = − X zi qθ(zi|xi, yi) ∂ ∂θ log pθ(zi|xi) (8) where qθ(zi|xi, yi) = 1 P zi pθ(zi|xi) exp(R(zi|yi))pθ(zi|xi) exp(R(zi|yi)). 3 MLE target RAML targets PG targets SPG targets ᬍᶚ ᳋ᶚ rR Figure 1: Comparing the target samples for MLE, RAML (the rR distribution), PG (the pθ distribution), and SPG (the qθ distribution). There are several advantages associated with the gradient from Eq. (8). First, qθ(zi|xi, yi) takes into account both pθ(zi|xi) and R(zi|yi). As a result, Monte Carlo integration over qθ-samples approximates Eq. (8) better, and has smaller variance compared to Eq. (5). This allows our model to start learning from scratch without the warm-start and variance-reduction crutches needed by previously-proposed PG approaches. Second, as Figure 1 shows, the samples for the SPG method (pentagons) lie between the ground-truth target distribution (triangle and circles) and the model distribution (squares). These targets are both easier to learn by pθ compared to ground-truth–only targets like the ones for MLE (triangle) and RAML (circles), and also carry more information about the ground-truth target compared to model-only samples (PG squares). This formulation allows us to directly address the exposure-bias problem, by allowing the model distribution to learn at training time how to deal with events conditioned on model-generated tokens, similar with what happens at inference time (more on this in Section 3.2). At the same time, the updates used for learning rely heavily on the influence of the reward metric R(zi|yi), therefore directly addressing the wrong-objective problem. Together, these properties allow the model to achieve improved accuracy. Third, although qθ is infeasible for exact sampling, since both pθ(zi|xi) and exp(R(zi|yi)) are factorizable across zi t (where zi t denotes the t-th word of the i-th output sequence), we can apply efficient approximate inference for the SPG method as shown in the next section. 3.1 Inference In order to estimate the gradient from Eq. (8) with Monte-Carlo integration, one needs to be able to draw samples from qθ(zi|xi, yi). To tackle this problem, we first decompose R(zi|yi) along the t-axis: R(zi|yi) = T X t=1 R(zi 1:t|yi) −R(zi 1:t−1|yi) | {z } ≜∆ri t(zi t|yi,zi 1:t−1) , where R(zi 1:t|yi) −R(zi 1:t−1|yi) characterizes the reward increment for zi t. Using the reward increment notation, we can rewrite: qθ(zi|xi, yi) = 1 Zθ(xi, yi) T Y t=1 exp(log pθ(zi t|zi 1:t−1, xi) + ∆ri t(zi t|yi, zi 1:t−1)) where Zθ(xi, yi) is the partition function equal to the sum over all configurations of zi. Since the number of such configurations grows exponentially with respect to the sequence-length T, directly drawing from qθ(zi|xi, yi) is infeasible. To make the inference efficient, we replace qθ(zi|xi, yi) with the following approximate distribution: ˜qθ(zi|xi, yi) = T Y t=1 ˜qθ(zi t|xi, yi, zi 1:t−1), where ˜qθ(zi t|xi, yi, zi 1:t−1) = 1 ˜Zθ(xi, yi, zi 1:t−1) exp(log pθ(zi t|zi 1:t−1, xi) + ∆ri t(zi t|yi, zi 1:t−1)). By replacing qθ in Eq. (8) with ˜qθ, we obtain: ∂ ∂θLi SP G(θ) = − X zi qθ(zi|xi, yi) ∂ ∂θ log pθ(zi|xi) ≃− X zi ˜qθ(zi|xi, yi) ∂ ∂θ log pθ(zi|xi) ≜∂ ∂θ ˜Li SP G(θ) (9) 4 Compared to Zθ(xi, yi), ˜Zθ(xi, yi, zi 1:t−1) sums over the configurations of one zi t only. Therefore, the cost of drawing one zi from ˜qθ(zi|xi, yi) grows only linearly with respect to T. Furthermore, for common reward metrics such as ROUGE and CIDEr, the computation of ∆ri t(zi t|yi, zi 1:t−1) can be done in O(T) instead of O(V ) (where V is the size of the state space for zi t, i.e., vocabulary size). That is because the maximum number of unique words in yi is T, and any words not in yi have the same reward increment. When we limit ourselves to J = 1 sample for each example in Eq. (9), the approximate SPG inference time of each example is similar to the inference time for the gradient of the MLE objective. Combined with the empirical findings in Section 5 (Figure 3) where the steps for convergence are comparable, we conclude that the time for convergence for the SPG method is similar to the MLE based method. 3.2 Bang-bang Rewarded SPG Method One additional difficulty for the SPG method is that the model’s log-probability values log pθ(zi t|zi 1:t−1, xi) and the reward-increment values R(zi 1:t|yi) −R(zi 1:t−1|yi) are not on the same scale. In order to balance the impact of these two factors, we need to weigh them appropriately. Formally, we achieve this by adding a weight wi t to the reward increments: ∆ri t(zi t|yi, zi 1:t−1, wi t) ≜ wi t·∆ri t(zi t|yi, zi 1:t−1) so that the total reward R(zi|yi, wi) = PT t=1 ∆ri t(zi t|yi, zi 1:t−1, wi t). The approximate proposal distribution becomes ˜qθ(zi|xi, yi, wi) = QT t=1 ˜qθ(zi t|xi, yi, zi 1:t−1, wi t), where ˜qθ(zi t|xi, yi, zi 1:t−1, wi t) ∝exp(log pθ(zi t|zi 1:t−1, xi) + ∆ri t(zi t|yi, zi 1:t−1, wi t)). The challenge in this case is to choose an appropriate weight wi t, because log pθ(zi t|zi 1:t−1, xi) varies heavily for different i, t, as well as across different iterations and tasks. In order to minimize the efforts for fine-tuning the reward weights, we propose a bang-bang rewarded softmax value function, equivalent to a loss LBBSP G defined as: Li BBSP G(θ) = − X wi p(wi) log Epθ(zi|xi)[exp(R(zi|yi, wi))]  , (10) and ∂ ∂θ ˜Li BBSP G(θ) = − X wi p(wi) X zi ˜qθ(zi|xi, yi, wi) ∂ ∂θ log pθ(zi|xi) | {z } ≜−∂ ∂θ ˜Li SP G(θ|wi) , (11) where p(wi) = Q t p(wi t) and p(wi t = 0) = pdrop = 1 −p(wi t = W). Here W is a sufficiently large number (e.g., 10,000), pdrop is a hyper-parameter in [0, 1]. The name bang-bang is borrowed from control theory [8], and refers to a system which switches abruptly between two extreme states (namely W and 0). t 1 2 3 4 5 6 7 yt a man is sitting in the park W W W 0 W ... ... wt zt a man is in the ... ... argmax ᵂr5(z5|y, z1:4) = ‘the’ ≠ y5 = ‘in’ Figure 2: An example of sequence generation with the bang-bang reward weights. z4 = ”in” is sampled from the model distribution since w4 = 0. Although w5 = W, z5 = ”the” ̸= y5 because z4 = ”in”. When wi t = W, the term ∆ri t(zi t|yi, zi 1:t−1, wi t) overwhelms log pθ(zi t|zi 1:t−1, xi), so the sampling of zi t is decided by the reward increment of zi t. It is important to emphasize that in general the groundtruth label yi t ̸= argmaxzi t ∆ri t(zi t|yi, zi 1:t−1), because zi 1:t−1 may not be the same as yi 1:t−1 (see an example in Figure 2). The only special case is when pdrop = 0, which forces wi t to always equal W, and implies zi t is always equal† to yi t (and therefore the SPG method reduces to the MLE method). On the other hand, when wi t = 0, by definition ∆ri t(zi t|yi, zi 1:t−1, wi t) = 0. In this case, the sampling of zi t is based only on the model prediction distribution pθ(zi t|zi 1:t−1, xi), the same situation we have at inference time. Furthermore, we have the following lemma (with the proof provided in the Supplementary Material): †This follows from recursively applying R’s property that yi t = argmaxzi t ∆ri t(zi t|yi, zi 1:t−1 = yi 1:t−1). 5 Lemma 1 When wi t = 0, X zi ˜qθ(zi|xi, yi, wi) ∂ ∂θ log pθ(zi t|xi, zi 1:t−1) = 0. As a result, ∂ ∂θ ˜Li SP G(θ|wi) is very different from traditional PG-method gradients, in that only the zi t with wi t ̸= 0 are included. To see that, using the fact that log pθ(zi|xi) = PT t=1 log pθ(zi t|xi, zi 1:t−1), ∂ ∂θ ˜Li SP G(θ|wi) = − X t X zi ˜qθ(zi|xi, yi, wi) ∂ ∂θ log pθ(zi t|xi, zi 1:t−1), (12) Using the result of Lemma 1, Eq. (12) is equal to: ∂ ∂θ ˜Li SP G(θ|wi) = − X {t:wi t̸=0} X zi ˜qθ(zi|xi, yi, wi) ∂ ∂θ log pθ(zi t|xi, zi 1:t−1) = − X zi ˜qθ(zi|xi, yi, wi) X {t:wi t̸=0} ∂ ∂θ log pθ(zi t|xi, zi 1:t−1) (13) Using Monte-Carlo integration, we approximate Eq. (11) by first drawing wij from p(wi) and then iteratively drawing zij t from ˜qθ(zi t|xi, zi 1:t−1, yi, wij t ) for t = 1, . . . , T. For larger values of pdrop, the wij sample contains more wij t = 0 and the resulting zij contains proportionally more samples from the model prediction distribution (with a direct effect on alleviating the exposure-bias problem). After zij is obtained, only the log-likelihood of zij t when wij t ̸= 0 are included in the loss: ∂ ∂θ ˜Li BBSP G(θ) ≃−1 J J X j=1 X n t:w ij t ̸=0 o ∂ ∂θ log pθ(zij t |xi, zij 1:t−1). (14) The details about the gradient evaluation for the bang-bang rewarded softmax value function are described in Algorithm 1 of the Supplementary Material. 4 Additional Reward Functions Besides the main reward function R(zi|yi), additional reward functions can be used to enforce desirable properties for the output sequences. For instance, in summarization, we occasionally find that the decoded output sequence contains repeated words, e.g. "US R&B singer Marie Marie Marie Marie ...". In this framework, this can be directly fixed by using an additional auxiliary reward function that simply rewards negatively two consecutive tokens in the generated sequence: DUPi t = −1 if zi t = zi t−1, 0 otherwise. In conjunction with the bang-bang weight scheme, the introduction of such a reward function has the immediate effect of severely penalizing such “stuttering” in the model output; the decoded sequence after applying the DUP negative reward becomes: "US R&B singer Marie Christina has ...". Additionally, we can use the same approach to correct for certain biases in the forward sampling approximation. For example, the following function negatively rewards the end-of-sentence symbol when the length of the output sequence is less than that of the ground-truth target sequence |yi|: EOSi t = −1 if zi t = </S> and t < |yi|, 0 otherwise. A more detailed discussion about such reward functions is available in the Supplementary Material. During training, we linearly combine the main reward function with the auxiliary functions: ∆ri t(zi t|yi, zi 1:t−1, wi t) = wi t · R(zi 1:t|yi) −R(zi 1:t−1|yi) + DUPi t + EOSi t  , with W = 10, 000. During testing, since the ground-truth target yi is unavailable, this becomes: ∆ri t(zi t|yi, zi 1:t−1, W) = W · DUPi t. 6 5 Experiments We numerically evaluate the proposed softmax policy gradient (SPG) method on two sequence generation benchmarks: a document-summarization task for headline generation, and an automatic image-captioning task. We compare the results of the SPG method against the standard maximum likelihood estimation (MLE) method, as well as the reward augmented maximum likelihood (RAML) method [17]. Our experiments indicate that the SPG method outperforms significantly the other approaches on both the summarization and image-captioning tasks. We implemented all the algorithms using TensorFlow 1.0 [6]. For the RAML method, we used τ = 0.85 which was the best performer in [17]. For the SPG algorithm, all the results were obtained using a variant of ROUGE [13] as the main reward metric R, and J = 1 (sample one target for each example, see Eq. (14)). We report the impact of the pdrop for values in {0.2, 0.4, 0.6, 0.8}. In addition to using the main reward-metric for sampling targets, we also used it to weight the loss for target zij, as we found that it improved the performance of the SPG algorithm. We also applied a naive version of the policy gradient (PG) algorithm (without any variance reduction) by setting pdrop = 0.0, W →0, but failed to train any meaningful model with cold-start. When starting from a pre-trained MLE checkpoint, we found that it was unable to improve the original MLE result. This result confirms that variance-reduction is a requirement for the PG method to work, whereas our SPG method is free of such requirements. 5.1 Summarization Task: Headline Generation Headline generation is a standard text generation task, taking as input a document and generating a concise summary/headline for it. In our experiments, the supervised data comes from the English Gigaword [9], and consists of news-articles paired with their headlines. We use a training set of about 6 million article-headline pairs, in addition to two randomly-extracted validation and evaluation sets of 10K examples each. In addition to the Gigaword evaluation set, we also report results on the standard DUC-2004 test set. The DUC-2004 consists of 500 news articles paired with four different human-generated groundtruth summaries, capped at 75 bytes.‡ The expected output is a summary of roughly 14 words, created based on the input article. Method Gigaword-10K DUC-2004 MLE 35.2 ± 0.3 22.6 ± 0.6 RAML 36.4 ± 0.2 23.1 ± 0.6 SPG 0.2 36.6 ± 0.2 23.5 ± 0.6 SPG 0.4 37.8 ± 0.2 24.3 ± 0.5 SPG 0.6 37.4 ± 0.2 24.1 ± 0.5 SPG 0.8 37.3 ± 0.2 24.6 ± 0.5 Table 1: The F1 ROUGE-L scores (with standard errors) for headline generation. We use the sequence-to-sequence recurrent neural network with attention model [2]. For encoding, we use a three-layer, 512-dimensional bidirectional RNN architecture, with a Gated Recurrent Unit (GRU) as the unit-cell [4]; for decoding, we use a similar three-layer, 512-dimensional GRU-based architecture. Both the encoder and decoder networks use a shared vocabulary and embedding matrix for encoding/decoding the word sequences, with a vocabulary consisting of 220K word types and a 512-dimensional embedding. We truncate the encoding sequences to a maximum of 30 tokens, and the decoding sequences to a maximum of 15 tokens. The model is optimized using ADAGRAD with a mini-batch size of 200, a learning rate of 0.01, and gradient clipping with norm equal to 4. We use 40 workers for computing the updates, and 10 parameter servers for model storing and (asynchronous and distributed) updating. We run the training procedure for 10M steps and pick the checkpoint with the best ROUGE-2 score on the Gigaword validation set. We report ROUGE-L scores on the Gigaword evaluation set, as well as the DUC-2004 set, in Table 1. The scores are computed using the standard pyrouge package§, with standard errors computed using bootstrap resampling [12]. As the numerical values indicate, the maximum performance is achieved when pdrop is in mid-range, with 37.8 F1 ROUGE-L at pdrop = 0.4 on the large Gigaword evaluation set (a larger range for pdrop between 0.4 and 0.8 gives comparable scores on the smaller DUC-2004 set). These numbers are significantly better compared to RAML (36.4 on Gigaword-10K), which in turn is significantly better compared to MLE (35.2). ‡This dataset is available by request at http://duc.nist.gov/data.html. §Available at pypi.python.org/pypi/pyrouge/0.1.3 7 5.2 Automatic Image-Caption Generation Validation-4K C40 Method CIDEr ROUGE-L CIDEr MLE 0.968 37.7 ± 0.1 0.94 RAML 0.997 38.0 ± 0.1 0.97 SPG 0.2 1.001 38.0 ± 0.1 0.98 SPG 0.4 1.013 38.1 ± 0.1 1.00 SPG 0.6 1.033 38.2 ± 0.1 1.01 SPG 0.8 1.009 37.7 ± 0.1 1.00 Table 2: The CIDEr (with the coco-caption package) and ROUGE-L (with the pyrouge package) scores for image captioning on MSCOCO. For the image-captioning task, we use the standard MSCOCO dataset [14]. The MSCOCO dataset contains 82K training images and 40K validation images, each with at least 5 groundtruth captions. The results are reported using the numerical values for the C40 testset reported by the MSCOCO online evaluation server¶. Following standard practice, we combine the training and validation datasets for training our model, and hold out a subset of 4K images as our validation set. Our model architecture is simple, following the approach taken by the Show-and-Tell approach [25]. We use a one 512-dimensional RNN architecture with an LSTM unit-cell, with a dropout rate equal of 0.3 applied to both input and output of the LSTM layer. We use the same vocabulary size of 8,854 word-types as in [25], with 512-dimensional word-embeddings. We truncate the decoding sequences to a maximum of 15 tokens. The input image is embedded by first passing it through a pretrained Inception-V3 network [22], and then projected to a 512-dimensional vector. The model is optimized using ADAGRAD with a mini-batch size of 25, a learning rate of 0.01, and gradient clipping with norm equal to 4. We run the training procedure for 4M steps and pick the checkpoint of the best CIDEr score [23] on our held-out 4K validation set. 0 500000 1000000 1500000 2000000 2500000 Steps 0.90 0.92 0.94 0.96 0.98 1.00 1.02 1.04 CIDER Score MLE RAML SPG 0.6 Figure 3: Number of training steps vs. CIDEr scores (on Validation-4K) for various learning regimes. We report both CIDEr and ROUGE-L scores on our 4K Validation set, as well as CIDEr scores on the official C40 testset as reported by the MSCOCO online evaluation server, in Table 2. The CIDEr scores are reported using the coco-caption evaluation toolkit∥, while ROUGE-L scores are reported using the standard pyrouge package (note that these ROUGE-L scores are generally lower than those reported by the coco-caption toolkit, as it reports an average score over multiple reference, while the latter reports the maximum). The evaluation results indicate that the SPG method is superior to both the MLE and RAML methods. The maximum score is obtained with pdrop = 0.6, with a CIDEr score of 1.01 on the C40 testset. In contrast, on the same testset, the RAML method has a CIDEr score of 0.97, and the MLE method a score of 0.94. In Figure 3, we show that the number of steps for SPG to converge is similar to the one for MLE/RAML. With the per-step inference cost of those methods being similar (see Section 3.1), the overall convergence time for the SPG method is similar to the MLE and RAML methods. 6 Conclusion The reinforcement learning method presented in this paper, based on a softmax value function, is an efficient policy-gradient approach that eliminates the need for warm-start training and sample variance reduction during policy updates. We show that this approach allows us to tackle sequence generation tasks by training models that avoid two long-standing issues: the exposure-bias problem and the wrong-objective problem. Experimental results confirm that the proposed method achieves superior performance on two different structured output prediction problems, one for text-to-text (automatic summarization) and one for image-to-text (automatic image captioning). We plan to explore and exploit the properties of this method for other reinforcement learning problems as well as the impact of various, more-advanced reward functions on the performance of the learned models. ¶Available at http://mscoco.org/dataset/#captions-eval. ∥Available at https://github.com/tylin/coco-caption. 8 Acknowledgments We greatly appreciate Sebastian Goodman for his contributions to the experiment code. We would also like to acknowledge Ning Ye and Zhenhai Zhu for their help with the image captioning model calibration as well as the anonymous reviewers for their valuable comments. References [1] Peter Anderson, Basura Fernando, Mark Johnson, and Stephen Gould. SPICE: semantic propositional image caption evaluation. In ECCV, 2016. [2] D. Bahdanau, K. Cho, and Y. Bengio. Neural machine translation by jointly learning to align and translate. In Proceedings of ICLR, 2015. [3] Samy Bengio, Oriol Vinyals, Navdeep Jaitly, and Noam Shazeer. Scheduled sampling for sequence prediction with recurrent neural networks. In Advances in Neural Information Processing Systems 28, pages 1171–1179. 2015. [4] K. Cho, B. van Merrienboer, C. Gülçehre, D. Bahdanau, F. Bougares, H. Schwenk, and Y. Bengio. Learning phrase representations using RNN encoder-decoder for statistical machine translation. In Proceedings of EMNLP, pages 1724–1734, 2014. [5] Marc P. Deisenroth, Gerhard Neumann, and Jan Peters. A survey on policy search for robotics. Foundations and Trends R⃝in Robotics, 2(1–2):1–142, 2013. ISSN 1935-8253. [6] M. Abadi et al. TensorFlow: Large-scale machine learning on heterogeneous systems, 2015. URL http://tensorflow.org/. [7] Y. Wu et al. Google’s neural machine translation system: Bridging the gap between human and machine translation. CoRR, abs/1609.08144, 2016. [8] L. C. Evans. An introduction to mathematical optimal control theory. Preprint, version 0.2. [9] David Graff and Christopher Cieri. English Gigaword Fifth Edition LDC2003T05. In Linguistic Data Consortium, Philadelphia, 2003. [10] Ferenc Huszar. How (not) to train your generative model: Scheduled sampling, likelihood, adversary? CoRR, abs/1511.05101, 2015. [11] Jens Kober, J Andrew Bagnell, and Jan Peters. Reinforcement learning in robotics: A survey. The International Journal of Robotics Research, 32(11):1238–1274, 2013. [12] Philipp Koehn. Statistical significance tests for machine translation evaluation. In Proceedings of EMNLP, pages 388—-395, 2004. [13] Chin-Yew Lin and Franz Josef Och. Automatic evaluation of machine translation quality using longest common subsequence and skip-bigram statistics. In Proceedings of ACL, 2004. [14] Tsung-Yi Lin, Michael Maire, Serge J. Belongie, Lubomir D. Bourdev, Ross B. Girshick, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollár, and C. Lawrence Zitnick. Microsoft COCO: common objects in context. CoRR, abs/1405.0312, 2014. [15] Siqi Liu, Zhenhai Zhu, Ning Ye, Sergio Guadarrama, and Kevin Murphy. Optimization of image description metrics using policy gradient methods. In International Conference on Computer Vision (ICCV), 2017. [16] Gergely Neu, Anders Jonsson, and Vicenç Gómez. A unified view of entropy-regularized markov decision processes. CoRR, abs/1705.07798, 2017. [17] M. Norouzi, S. Bengio, Z. Chen, N. Jaitly, M. Schuster, Y. Wu, and D. Schuurmans. Reward augmented maximum likelihood for neural structured prediction. In Advances in Neural Information Processing Systems 29, pages 1723–1731, 2016. [18] Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. Bleu: A method for automatic evaluation of machine translation. In Proceedings of ACL, 2002. 9 [19] Marc’Aurelio Ranzato, Sumit Chopra, Michael Auli, and Wojciech Zaremba. Sequence level training with recurrent neural networks. CoRR, abs/1511.06732, 2015. [20] David Silver, Aja Huang, Chris J Maddison, Arthur Guez, Laurent Sifre, George Van Den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Veda Panneershelvam, Marc Lanctot, et al. Mastering the game of Go with deep neural networks and tree search. Nature, 529(7587):484–489, 2016. [21] RS Sutton, D McAllester, S Singh, and Y Mansour. Policy gradient methods for reinforcement learning with function approximation. In NIPS, 1999. [22] Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jonathon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. volume abs/1512.00567, 2015. [23] Ramakrishna Vedantam, C. Lawrence Zitnick, and Devi Parikh. Cider: Consensus-based image description evaluation. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2015. [24] Arun Venkatraman, Martial Hebert, and J. Andrew Bagnell. Improving multi-step prediction of learned time series models. In Proceedings of the Twenty-Ninth AAAI Conference on Artificial Intelligence, pages 3024–3030. AAAI Press, 2015. [25] Oriol Vinyals, Alexander Toshev, Samy Bengio, and Dumitru Erhan. Show and tell: A neural image caption generator. In Proc. of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2015. [26] Ronald J. Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine Learning, 8(3):229–256, 1992. 10
2017
665
7,191
Bridging the Gap Between Value and Policy Based Reinforcement Learning Ofir Nachum1 Mohammad Norouzi Kelvin Xu1 Dale Schuurmans {ofirnachum,mnorouzi,kelvinxx}@google.com, daes@ualberta.ca Google Brain Abstract We establish a new connection between value and policy based reinforcement learning (RL) based on a relationship between softmax temporal value consistency and policy optimality under entropy regularization. Specifically, we show that softmax consistent action values correspond to optimal entropy regularized policy probabilities along any action sequence, regardless of provenance. From this observation, we develop a new RL algorithm, Path Consistency Learning (PCL), that minimizes a notion of soft consistency error along multi-step action sequences extracted from both on- and off-policy traces. We examine the behavior of PCL in different scenarios and show that PCL can be interpreted as generalizing both actor-critic and Q-learning algorithms. We subsequently deepen the relationship by showing how a single model can be used to represent both a policy and the corresponding softmax state values, eliminating the need for a separate critic. The experimental evaluation demonstrates that PCL significantly outperforms strong actor-critic and Q-learning baselines across several benchmarks.2 1 Introduction Model-free RL aims to acquire an effective behavior policy through trial and error interaction with a black box environment. The goal is to optimize the quality of an agent’s behavior policy in terms of the total expected discounted reward. Model-free RL has a myriad of applications in games [22, 37], robotics [16, 17], and marketing [18, 38], to name a few. Recently, the impact of model-free RL has been expanded through the use of deep neural networks, which promise to replace manual feature engineering with end-to-end learning of value and policy representations. Unfortunately, a key challenge remains how best to combine the advantages of value and policy based RL approaches in the presence of deep function approximators, while mitigating their shortcomings. Although recent progress has been made in combining value and policy based methods, this issue is not yet settled, and the intricacies of each perspective are exacerbated by deep models. The primary advantage of policy based approaches, such as REINFORCE [45], is that they directly optimize the quantity of interest while remaining stable under function approximation (given a sufficiently small learning rate). Their biggest drawback is sample inefficiency: since policy gradients are estimated from rollouts the variance is often extreme. Although policy updates can be improved by the use of appropriate geometry [14, 27, 32], the need for variance reduction remains paramount. Actor-critic methods have thus become popular [33, 34, 36], because they use value approximators to replace rollout estimates and reduce variance, at the cost of some bias. Nevertheless, on-policy learning remains inherently sample inefficient [10]; by estimating quantities defined by the current policy, either on-policy data must be used, or updating must be sufficiently slow to avoid significant bias. Naive importance correction is hardly able to overcome these shortcomings in practice [28, 29]. 1Work done as a member of the Google Brain Residency program (g.co/brainresidency) 2An implementation of PCL can be found at https://github.com/tensorflow/models/tree/ master/research/pcl_rl 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. By contrast, value based methods, such as Q-learning [44, 22, 30, 42, 21], can learn from any trajectory sampled from the same environment. Such “off-policy” methods are able to exploit data from other sources, such as experts, making them inherently more sample efficient than on-policy methods [10]. Their key drawback is that off-policy learning does not stably interact with function approximation [35, Chap.11]. The practical consequence is that extensive hyperparameter tuning can be required to obtain stable behavior. Despite practical success [22], there is also little theoretical understanding of how deep Q-learning might obtain near-optimal objective values. Ideally, one would like to combine the unbiasedness and stability of on-policy training with the data efficiency of off-policy approaches. This desire has motivated substantial recent work on off-policy actor-critic methods, where the data efficiency of policy gradient is improved by training an offpolicy critic [19, 21, 10]. Although such methods have demonstrated improvements over on-policy actor-critic approaches, they have not resolved the theoretical difficulty associated with off-policy learning under function approximation. Hence, current methods remain potentially unstable and require specialized algorithmic and theoretical development as well as delicate tuning to be effective in practice [10, 41, 8]. In this paper, we exploit a relationship between policy optimization under entropy regularization and softmax value consistency to obtain a new form of stable off-policy learning. Even though entropy regularized policy optimization is a well studied topic in RL [46, 39, 40, 47, 5, 4, 6, 7]–in fact, one that has been attracting renewed interest from concurrent work [25, 11]–we contribute new observations to this study that are essential for the methods we propose: first, we identify a strong form of path consistency that relates optimal policy probabilities under entropy regularization to softmax consistent state values for any action sequence; second, we use this result to formulate a novel optimization objective that allows for a stable form of off-policy actor-critic learning; finally, we observe that under this objective the actor and critic can be unified in a single model that coherently fulfills both roles. 2 Notation & Background We model an agent’s behavior by a parametric distribution πθ(a | s) defined by a neural network over a finite set of actions. At iteration t, the agent encounters a state st and performs an action at sampled from πθ(a | st). The environment then returns a scalar reward rt and transitions to the next state st+1. Note: Our main results identify specific properties that hold for arbitrary action sequences. To keep the presentation clear and focus attention on the key properties, we provide a simplified presentation in the main body of this paper by assuming deterministic state dynamics. This restriction is not necessary, and in the Supplementary Material we provide a full treatment of the same concepts generalized to stochastic state dynamics. All of the desired properties continue to hold in the general case and the algorithms proposed remain unaffected. For simplicity, we assume the per-step reward rt and the next state st+1 are given by functions rt = r(st, at) and st+1 = f(st, at) specified by the environment. We begin the formulation by reviewing the key elements of Q-learning [43, 44], which uses a notion of hard-max Bellman backup to enable off-policy TD control. First, observe that the expected discounted reward objective, OER(s, π), can be recursively expressed as, OER(s, π) = X a π(a | s) [r(s, a) + γOER(s′, π)] , where s′ = f(s, a) . (1) Let V ◦(s) denote the optimal state value at a state s given by the maximum value of OER(s, π) over policies, i.e., V ◦(s) = maxπOER(s, π). Accordingly, let π◦denote the optimal policy that results in V ◦(s) (for simplicity, assume there is one unique optimal policy), i.e., π◦= argmaxπ OER(s, π). Such an optimal policy is a one-hot distribution that assigns a probability of 1 to an action with maximal return and 0 elsewhere. Thus we have V ◦(s) = OER(s, π◦) = max a (r(s, a) + γV ◦(s′)). (2) This is the well-known hard-max Bellman temporal consistency. Instead of state values, one can equivalently (and more commonly) express this consistency in terms of optimal action values, Q◦: Q◦(s, a) = r(s, a) + γ max a′ Q◦(s′, a′) . (3) 2 Q-learning relies on a value iteration algorithm based on (3), where Q(s, a) is bootstrapped based on successor action values Q(s′, a′). 3 Softmax Temporal Consistency In this paper, we study the optimal state and action values for a softmax form of temporal consistency [48, 47, 7], which arises by augmenting the standard expected reward objective with a discounted entropy regularizer. Entropy regularization [46] encourages exploration and helps prevent early convergence to sub-optimal policies, as has been confirmed in practice (e.g., [21, 24]). In this case, one can express regularized expected reward as a sum of the expected reward and a discounted entropy term, OENT(s, π) = OER(s, π) + τH(s, π) , (4) where τ ≥0 is a user-specified temperature parameter that controls the degree of entropy regularization, and the discounted entropy H(s, π) is recursively defined as H(s, π) = X a π(a | s) [−log π(a | s) + γ H(s′, π)] . (5) The objective OENT(s, π) can then be re-expressed recursively as, OENT(s, π) = X a π(a | s) [r(s, a) −τ log π(a | s) + γOENT(s′, π)] . (6) Note that when γ = 1 this is equivalent to the entropy regularized objective proposed in [46]. Let V ∗(s) = maxπOENT(s, π) denote the soft optimal state value at a state s and let π∗(a | s) denote the optimal policy at s that attains the maximum of OENT(s, π). When τ > 0, the optimal policy is no longer a one-hot distribution, since the entropy term prefers the use of policies with more uncertainty. We characterize the optimal policy π∗(a | s) in terms of the OENT-optimal state values of successor states V ∗(s′) as a Boltzmann distribution of the form, π∗(a | s) ∝exp{(r(s, a) + γV ∗(s′))/τ} . (7) It can be verified that this is the solution by noting that the OENT(s, π) objective is simply a τ-scaled constant-shifted KL-divergence between π and π∗, hence the optimum is achieved when π = π∗. To derive V ∗(s) in terms of V ∗(s′), the policy π∗(a | s) can be substituted into (6), which after some manipulation yields the intuitive definition of optimal state value in terms of a softmax (i.e., log-sum-exp) backup, V ∗(s) = OENT(s, π∗) = τ log X a exp{(r(s, a) + γV ∗(s′))/τ} . (8) Note that in the τ →0 limit one recovers the hard-max state values defined in (2). Therefore we can equivalently state softmax temporal consistency in terms of optimal action values Q∗(s, a) as, Q∗(s, a) = r(s, a) + γV ∗(s′) = r(s, a) + γτ log X a′ exp(Q∗(s′, a′)/τ) . (9) Now, much like Q-learning, the consistency equation (9) can be used to perform one-step backups to asynchronously bootstrap Q∗(s, a) based on Q∗(s′, a′). In the Supplementary Material we prove that such a procedure, in the tabular case, converges to a unique fixed point representing the optimal values. We point out that the notion of softmax Q-values has been studied in previous work (e.g., [47, 48, 13, 5, 3, 7]). Concurrently to our work, [11] has also proposed a soft Q-learning algorithm for continuous control that is based on a similar notion of softmax temporal consistency. However, we contribute new observations below that lead to the novel training principles we explore. 4 Consistency Between Optimal Value & Policy We now describe the main technical contributions of this paper, which lead to the development of two novel off-policy RL algorithms in Section 5. The first key observation is that, for the softmax 3 value function V ∗in (8), the quantity exp{V ∗(s)/τ} also serves as the normalization factor of the optimal policy π∗(a | s) in (7); that is, π∗(a | s) = exp{(r(s, a) + γV ∗(s′))/τ} exp{V ∗(s)/τ} . (10) Manipulation of (10) by taking the log of both sides then reveals an important connection between the optimal state value V ∗(s), the value V ∗(s′) of the successor state s′ reached from any action a taken in s, and the corresponding action probability under the optimal log-policy, log π∗(a | s). Theorem 1. For τ >0, the policy π∗that maximizes OENT and state values V ∗(s)=maxπOENT(s, π) satisfy the following temporal consistency property for any state s and action a (where s′ =f(s, a)), V ∗(s) −γV ∗(s′) = r(s, a) −τ log π∗(a | s) . (11) Proof. All theorems are established for the general case of a stochastic environment and discounted infinite horizon problems in the Supplementary Material. Theorem 1 follows as a special case. Note that one can also characterize π∗in terms of Q∗as π∗(a | s) = exp{(Q∗(s, a) −V ∗(s))/τ} . (12) An important property of the one-step softmax consistency established in (11) is that it can be extended to a multi-step consistency defined on any action sequence from any given state. That is, the softmax optimal state values at the beginning and end of any action sequence can be related to the rewards and optimal log-probabilities observed along the trajectory. Corollary 2. For τ > 0, the optimal policy π∗and optimal state values V ∗satisfy the following extended temporal consistency property, for any state s1 and any action sequence a1, ..., at−1 (where si+1 = f(si, ai)): V ∗(s1) −γt−1V ∗(st) = t−1 X i=1 γi−1[r(si, ai) −τ log π∗(ai | si)] . (13) Proof. The proof in the Supplementary Material applies (the generalized version of) Theorem 1 to any s1 and sequence a1, ..., at−1, summing the left and right hand sides of (the generalized version of) (11) to induce telescopic cancellation of intermediate state values. Corollary 2 follows as a special case. Importantly, the converse of Theorem 1 (and Corollary 2) also holds: Theorem 3. If a policy π(a|s) and state value function V (s) satisfy the consistency property (11) for all states s and actions a (where s′ = f(s, a)), then π = π∗and V = V ∗. (See the Supplementary Material.) Theorem 3 motivates the use of one-step and multi-step path-wise consistencies as the foundation of RL algorithms that aim to learn parameterized policy and value estimates by minimizing the discrepancy between the left and right hand sides of (11) and (13). 5 Path Consistency Learning (PCL) The temporal consistency properties between the optimal policy and optimal state values developed above lead to a natural path-wise objective for training a policy πθ, parameterized by θ, and a state value function Vφ, parameterized by φ, via the minimization of a soft consistency error. Based on (13), we first define a notion of soft consistency for a d-length sub-trajectory si:i+d ≡(si, ai, . . . , si+d−1, ai+d−1, si+d) as a function of θ and φ: C(si:i+d, θ, φ) = −Vφ(si)+γdVφ(si+d)+ Xd−1 j=0 γj[r(si+j, ai+j)−τ log πθ(ai+j |si+j)] . (14) The goal of a learning algorithm can then be to find Vφ and πθ such that C(si:i+d, θ, φ) is as close to 0 as possible for all sub-trajectories si:i+d. Accordingly, we propose a new learning algorithm, called 4 Path Consistency Learning (PCL), that attempts to minimize the squared soft consistency error over a set of sub-trajectories E, OPCL(θ, φ) = X si:i+d∈E 1 2C(si:i+d, θ, φ)2. (15) The PCL update rules for θ and φ are derived by calculating the gradient of (15). For a given trajectory si:i+d these take the form, ∆θ = ηπ C(si:i+d, θ, φ) Xd−1 j=0 γj∇θ log πθ(ai+j | si+j) , (16) ∆φ = ηv C(si:i+d, θ, φ) ∇φVφ(si) −γd∇φVφ(si+d)  , (17) where ηv and ηπ denote the value and policy learning rates respectively. Given that the consistency property must hold on any path, the PCL algorithm applies the updates (16) and (17) both to trajectories sampled on-policy from πθ as well as trajectories sampled from a replay buffer. The union of these trajectories comprise the set E used in (15) to define OPCL. Specifically, given a fixed rollout parameter d, at each iteration, PCL samples a batch of on-policy trajectories and computes the corresponding parameter updates for each sub-trajectory of length d. Then PCL exploits off-policy trajectories by maintaining a replay buffer and applying additional updates based on a batch of episodes sampled from the buffer at each iteration. We have found it beneficial to sample replay episodes proportionally to exponentiated reward, mixed with a uniform distribution, although we did not exhaustively experiment with this sampling procedure. In particular, we sample a full episode s0:T from the replay buffer of size B with probability 0.1/B + 0.9 · exp(α PT −1 i=0 r(si, ai))/Z, where we use no discounting on the sum of rewards, Z is a normalization factor, and α is a hyper-parameter. Pseudocode of PCL is provided in the Appendix. We note that in stochastic settings, our squared inconsistency objective approximated by Monte Carlo samples is a biased estimate of the true squared inconsistency (in which an expectation over stochastic dynamics occurs inside rather than outside the square). This issue arises in Q-learning as well, and others have proposed possible remedies which can also be applied to PCL [2]. 5.1 Unified Path Consistency Learning (Unified PCL) The PCL algorithm maintains a separate model for the policy and the state value approximation. However, given the soft consistency between the state and action value functions (e.g.,in (9)), one can express the soft consistency errors strictly in terms of Q-values. Let Qρ denote a model of action values parameterized by ρ, based on which one can estimate both the state values and the policy as, Vρ(s) = τ log X a exp{Qρ(s, a)/τ} , (18) πρ(a | s) = exp{(Qρ(s, a) −Vρ(s))/τ} . (19) Given this unified parameterization of policy and value, we can formulate an alternative algorithm, called Unified Path Consistency Learning (Unified PCL), which optimizes the same objective (i.e., (15)) as PCL but differs by combining the policy and value function into a single model. Merging the policy and value function models in this way is significant because it presents a new actor-critic paradigm where the policy (actor) is not distinct from the values (critic). We note that in practice, we have found it beneficial to apply updates to ρ from Vρ and πρ using different learning rates, very much like PCL. Accordingly, the update rule for ρ takes the form, ∆ρ = ηπC(si:i+d, ρ) Xd−1 j=0 γj∇ρ log πρ(ai+j | si+j) + (20) ηvC(si:i+d, ρ) ∇ρVρ(si) −γd∇ρVρ(si+d)  . (21) 5.2 Connections to Actor-Critic and Q-learning To those familiar with advantage-actor-critic methods [21] (A2C and its asynchronous analogue A3C) PCL’s update rules might appear to be similar. In particular, advantage-actor-critic is an on-policy method that exploits the expected value function, V π(s) = X a π(a | s) [r(s, a) + γV π(s′)] , (22) 5 to reduce the variance of policy gradient, in service of maximizing the expected reward. As in PCL, two models are trained concurrently: an actor πθ that determines the policy, and a critic Vφ that is trained to estimate V πθ. A fixed rollout parameter d is chosen, and the advantage of an on-policy trajectory si:i+d is estimated by A(si:i+d, φ) = −Vφ(si) + γdVφ(si+d) + Xd−1 j=0 γjr(si+j, ai+j) . (23) The advantage-actor-critic updates for θ and φ can then be written as, ∆θ = ηπEsi:i+d|θ [A(si:i+d, φ)∇θ log πθ(ai|si)] , (24) ∆φ = ηvEsi:i+d|θ [A(si:i+d, φ)∇φVφ(si)] , (25) where the expectation Esi:i+d|θ denotes sampling from the current policy πθ. These updates exhibit a striking similarity to the updates expressed in (16) and (17). In fact, if one takes PCL with τ →0 and omits the replay buffer, a slight variation of A2C is recovered. In this sense, one can interpret PCL as a generalization of A2C. Moreover, while A2C is restricted to on-policy samples, PCL minimizes an inconsistency measure that is defined on any path, hence it can exploit replay data to enhance its efficiency via off-policy learning. It is also important to note that for A2C, it is essential that Vφ tracks the non-stationary target V πθ to ensure suitable variance reduction. In PCL, no such tracking is required. This difference is more dramatic in Unified PCL, where a single model is trained both as an actor and a critic. That is, it is not necessary to have a separate actor and critic; the actor itself can serve as its own critic. One can also compare PCL to hard-max temporal consistency RL algorithms, such as Q-learning [43]. In fact, setting the rollout to d = 1 in Unified PCL leads to a form of soft Q-learning, with the degree of softness determined by τ. We therefore conclude that the path consistency-based algorithms developed in this paper also generalize Q-learning. Importantly, PCL and Unified PCL are not restricted to single step consistencies, which is a major limitation of Q-learning. While some have proposed using multi-step backups for hard-max Q-learning [26, 21], such an approach is not theoretically sound, since the rewards received after a non-optimal action do not relate to the hard-max Q-values Q◦. Therefore, one can interpret the notion of temporal consistency proposed in this paper as a sound generalization of the one-step temporal consistency given by hard-max Q-values. 6 Related Work Connections between softmax Q-values and optimal entropy-regularized policies have been previously noted. In some cases entropy regularization is expressed in the form of relative entropy [4, 6, 7, 31], and in other cases it is the standard entropy [47]. While these papers derive similar relationships to (7) and (8), they stop short of stating the single- and multi-step consistencies over all action choices we highlight. Moreover, the algorithms proposed in those works are essentially single-step Q-learning variants, which suffer from the limitation of using single-step backups. Another recent work [25] uses the softmax relationship in the limit of τ →0 and proposes to augment an actor-critic algorithm with offline updates that minimize a set of single-step hard-max Bellman errors. Again, the methods we propose are differentiated by the multi-step path-wise consistencies which allow the resulting algorithms to utilize multi-step trajectories from off-policy samples in addition to on-policy samples. The proposed PCL and Unified PCL algorithms bear some similarity to multi-step Q-learning [26], which rather than minimizing one-step hard-max Bellman error, optimizes a Q-value function approximator by unrolling the trajectory for some number of steps before using a hard-max backup. While this method has shown some empirical success [21], its theoretical justification is lacking, since rewards received after a non-optimal action no longer relate to the hard-max Q-values Q◦. In contrast, the algorithms we propose incorporate the log-probabilities of the actions on a multi-step rollout, which is crucial for the version of softmax consistency we consider. Other notions of temporal consistency similar to softmax consistency have been discussed in the RL literature. Previous work has used a Boltzmann weighted average operator [20, 5]. In particular, this operator has been used by [5] to propose an iterative algorithm converging to the optimal maximum reward policy inspired by the work of [15, 39]. While they use the Boltzmann weighted average, they briefly mention that a softmax (log-sum-exp) operator would have similar theoretical properties. More recently [3] proposed a mellowmax operator, defined as log-average-exp. These log-averageexp operators share a similar non-expansion property, and the proofs of non-expansion are related. 6 Synthetic Tree Copy DuplicatedInput RepeatCopy 0 50 100 0 5 10 15 20 Synthetic Tree 0 1000 2000 0 5 10 15 20 25 30 35 Copy 0 1000 2000 3000 0 2 4 6 8 10 12 14 16 DuplicatedInput 0 2000 4000 0 20 40 60 80 100 RepeatCopy Reverse ReversedAddition ReversedAddition3 Hard ReversedAddition 0 5000 10000 0 5 10 15 20 25 30 Reverse 0 5000 10000 0 5 10 15 20 25 30 35 ReversedAddition 0 20000 40000 60000 0 5 10 15 20 ReversedAddition3 0 5000 10000 0 5 10 15 20 25 30 Hard ReversedAddition PCL A3C DQN Figure 1: The results of PCL against A3C and DQN baselines. Each plot shows average reward across 5 random training runs (10 for Synthetic Tree) after choosing best hyperparameters. We also show a single standard deviation bar clipped at the min and max. The x-axis is number of training iterations. PCL exhibits comparable performance to A3C in some tasks, but clearly outperforms A3C on the more challenging tasks. Across all tasks, the performance of DQN is worse than PCL. Additionally it is possible to show that when restricted to an infinite horizon setting, the fixed point of the mellowmax operator is a constant shift of the Q∗investigated here. In all these cases, the suggested training algorithm optimizes a single-step consistency unlike PCL and Unified PCL, which optimizes a multi-step consistency. Moreover, these papers do not present a clear relationship between the action values at the fixed point and the entropy regularized expected reward objective, which was key to the formulation and algorithmic development in this paper. Finally, there has been a considerable amount of work in reinforcement learning using off-policy data to design more sample efficient algorithms. Broadly speaking, these methods can be understood as trading off bias [36, 34, 19, 9] and variance [28, 23]. Previous work that has considered multi-step off-policy learning has typically used a correction (e.g., via importance-sampling [29] or truncated importance sampling with bias correction [23], or eligibility traces [28]). By contrast, our method defines an unbiased consistency for an entire trajectory applicable to on- and off-policy data. An empirical comparison with all these methods remains however an interesting avenue for future work. 7 Experiments We evaluate the proposed algorithms, namely PCL & Unified PCL, across several different tasks and compare them to an A3C implementation, based on [21], and an implementation of double Q-learning with prioritized experience replay, based on [30]. We find that PCL can consistently match or beat the performance of these baselines. We also provide a comparison between PCL and Unified PCL and find that the use of a single unified model for both values and policy can be competitive with PCL. These new algorithms are easily amenable to incorporate expert trajectories. Thus, for the more difficult tasks we also experiment with seeding the replay buffer with 10 randomly sampled expert trajectories. During training we ensure that these trajectories are not removed from the replay buffer and always have a maximal priority. The details of the tasks and the experimental setup are provided in the Appendix. 7.1 Results We present the results of each of the variants PCL, A3C, and DQN in Figure 1. After finding the best hyperparameters (see the Supplementary Material), we plot the average reward over training iterations for five randomly seeded runs. For the Synthetic Tree environment, the same protocol is performed but with ten seeds instead. 7 Synthetic Tree Copy DuplicatedInput RepeatCopy 0 50 100 0 5 10 15 20 Synthetic Tree 0 1000 2000 0 5 10 15 20 25 30 35 Copy 0 1000 2000 3000 0 2 4 6 8 10 12 14 16 DuplicatedInput 0 2000 4000 0 20 40 60 80 100 RepeatCopy Reverse ReversedAddition ReversedAddition3 Hard ReversedAddition 0 5000 10000 0 5 10 15 20 25 30 Reverse 0 5000 10000 0 5 10 15 20 25 30 ReversedAddition 0 20000 40000 60000 0 5 10 15 20 25 30 ReversedAddition3 0 5000 10000 0 5 10 15 20 25 30 Hard ReversedAddition PCL Unified PCL Figure 2: The results of PCL vs. Unified PCL. Overall we find that using a single model for both values and policy is not detrimental to training. Although in some of the simpler tasks PCL has an edge over Unified PCL, on the more difficult tasks, Unified PCL preforms better. Reverse ReversedAddition ReversedAddition3 Hard ReversedAddition 0 2000 4000 0 5 10 15 20 25 30 Reverse 0 2000 4000 0 5 10 15 20 25 30 ReversedAddition 0 20000 40000 60000 0 5 10 15 20 25 30 ReversedAddition3 0 5000 10000 0 5 10 15 20 25 30 Hard ReversedAddition PCL PCL + Expert Figure 3: The results of PCL vs. PCL augmented with a small number of expert trajectories on the hardest algorithmic tasks. We find that incorporating expert trajectories greatly improves performance. The gap between PCL and A3C is hard to discern in some of the more simple tasks such as Copy, Reverse, and RepeatCopy. However, a noticeable gap is observed in the Synthetic Tree and DuplicatedInput results and more significant gaps are clear in the harder tasks, including ReversedAddition, ReversedAddition3, and Hard ReversedAddition. Across all of the experiments, it is clear that the prioritized DQN performs worse than PCL. These results suggest that PCL is a competitive RL algorithm, which in some cases significantly outperforms strong baselines. We compare PCL to Unified PCL in Figure 2. The same protocol is performed to find the best hyperparameters and plot the average reward over several training iterations. We find that using a single model for both values and policy in Unified PCL is slightly detrimental on the simpler tasks, but on the more difficult tasks Unified PCL is competitive or even better than PCL. We present the results of PCL along with PCL augmented with expert trajectories in Figure 3. We observe that the incorporation of expert trajectories helps a considerable amount. Despite only using a small number of expert trajectories (i.e., 10) as opposed to the mini-batch size of 400, the inclusion of expert trajectories in the training process significantly improves the agent’s performance. We performed similar experiments with Unified PCL and observed a similar lift from using expert trajectories. Incorporating expert trajectories in PCL is relatively trivial compared to the specialized methods developed for other policy based algorithms [1, 12]. While we did not compare to other algorithms that take advantage of expert trajectories, this success shows the promise of using pathwise consistencies. Importantly, the ability of PCL to incorporate expert trajectories without requiring adjustment or correction is a desirable property in real-world applications such as robotics. 8 8 Conclusion We study the characteristics of the optimal policy and state values for a maximum expected reward objective in the presence of discounted entropy regularization. The introduction of an entropy regularizer induces an interesting softmax consistency between the optimal policy and optimal state values, which may be expressed as either a single-step or multi-step consistency. This softmax consistency leads to the development of Path Consistency Learning (PCL), an RL algorithm that resembles actor-critic in that it maintains and jointly learns a model of the state values and a model of the policy, and is similar to Q-learning in that it minimizes a measure of temporal consistency error. We also propose the variant Unified PCL which maintains a single model for both the policy and the values, thus upending the actor-critic paradigm of separating the actor from the critic. Unlike standard policy based RL algorithms, PCL and Unified PCL apply to both on-policy and off-policy trajectory samples. Further, unlike value based RL algorithms, PCL and Unified PCL can take advantage of multi-step consistencies. Empirically, PCL and Unified PCL exhibit a significant improvement over baseline methods across several algorithmic benchmarks. 9 Acknowledgment We thank Rafael Cosman, Brendan O’Donoghue, Volodymyr Mnih, George Tucker, Irwan Bello, and the Google Brain team for insightful comments and discussions. References [1] P. Abbeel and A. Y. Ng. Apprenticeship learning via inverse reinforcement learning. In Proceedings of the twenty-first international conference on Machine learning, page 1. ACM, 2004. [2] A. Antos, C. Szepesvári, and R. Munos. Learning near-optimal policies with bellman-residual minimization based fitted policy iteration and a single sample path. Machine Learning, 71(1):89– 129, 2008. [3] K. Asadi and M. L. Littman. A new softmax operator for reinforcement learning. arXiv:1612.05628, 2016. [4] M. G. Azar, V. Gómez, and H. J. Kappen. Dynamic policy programming with function approximation. AISTATS, 2011. [5] M. G. Azar, V. Gómez, and H. J. Kappen. Dynamic policy programming. JMLR, 13(Nov), 2012. [6] M. G. Azar, V. Gómez, and H. J. Kappen. Optimal control as a graphical model inference problem. Mach. Learn. J., 87, 2012. [7] R. Fox, A. Pakman, and N. Tishby. G-learning: Taming the noise in reinforcement learning via soft updates. UAI, 2016. [8] A. Gruslys, M. G. Azar, M. G. Bellemare, and R. Munos. The reactor: A sample-efficient actor-critic architecture. arXiv preprint arXiv:1704.04651, 2017. [9] S. Gu, E. Holly, T. Lillicrap, and S. Levine. Deep reinforcement learning for robotic manipulation with asynchronous off-policy updates. ICRA, 2016. [10] S. Gu, T. Lillicrap, Z. Ghahramani, R. E. Turner, and S. Levine. Q-Prop: Sample-efficient policy gradient with an off-policy critic. ICLR, 2017. [11] T. Haarnoja, H. Tang, P. Abbeel, and S. Levine. Reinforcement learning with deep energy-based policies. arXiv:1702.08165, 2017. [12] J. Ho and S. Ermon. Generative adversarial imitation learning. In Advances in Neural Information Processing Systems, pages 4565–4573, 2016. 9 [13] D.-A. Huang, A.-m. Farahmand, K. M. Kitani, and J. A. Bagnell. Approximate maxent inverse optimal control and its application for mental simulation of human interactions. 2015. [14] S. Kakade. A natural policy gradient. NIPS, 2001. [15] H. J. Kappen. Path integrals and symmetry breaking for optimal control theory. Journal of statistical mechanics: theory and experiment, 2005(11):P11011, 2005. [16] J. Kober, J. A. Bagnell, and J. Peters. Reinforcement learning in robotics: A survey. IJRR, 2013. [17] S. Levine, C. Finn, T. Darrell, and P. Abbeel. End-to-end training of deep visuomotor policies. JMLR, 17(39), 2016. [18] L. Li, W. Chu, J. Langford, and R. E. Schapire. A contextual-bandit approach to personalized news article recommendation. 2010. [19] T. P. Lillicrap, J. J. Hunt, A. Pritzel, N. Heess, T. Erez, Y. Tassa, D. Silver, and D. Wierstra. Continuous control with deep reinforcement learning. ICLR, 2016. [20] M. L. Littman. Algorithms for sequential decision making. PhD thesis, Brown University, 1996. [21] V. Mnih, A. P. Badia, M. Mirza, A. Graves, T. P. Lillicrap, T. Harley, D. Silver, and K. Kavukcuoglu. Asynchronous methods for deep reinforcement learning. ICML, 2016. [22] V. Mnih, K. Kavukcuoglu, D. Silver, et al. Human-level control through deep reinforcement learning. Nature, 2015. [23] R. Munos, T. Stepleton, A. Harutyunyan, and M. Bellemare. Safe and efficient off-policy reinforcement learning. NIPS, 2016. [24] O. Nachum, M. Norouzi, and D. Schuurmans. Improving policy gradient by exploring underappreciated rewards. ICLR, 2017. [25] B. O’Donoghue, R. Munos, K. Kavukcuoglu, and V. Mnih. PGQ: Combining policy gradient and Q-learning. ICLR, 2017. [26] J. Peng and R. J. Williams. Incremental multi-step Q-learning. Machine learning, 22(1-3):283– 290, 1996. [27] J. Peters, K. Müling, and Y. Altun. Relative entropy policy search. AAAI, 2010. [28] D. Precup. Eligibility traces for off-policy policy evaluation. Computer Science Department Faculty Publication Series, page 80, 2000. [29] D. Precup, R. S. Sutton, and S. Dasgupta. Off-policy temporal-difference learning with function approximation. 2001. [30] T. Schaul, J. Quan, I. Antonoglou, and D. Silver. Prioritized experience replay. ICLR, 2016. [31] J. Schulman, X. Chen, and P. Abbeel. Equivalence between policy gradients and soft Q-learning. arXiv:1704.06440, 2017. [32] J. Schulman, S. Levine, P. Moritz, M. Jordan, and P. Abbeel. Trust region policy optimization. ICML, 2015. [33] J. Schulman, P. Moritz, S. Levine, M. Jordan, and P. Abbeel. High-dimensional continuous control using generalized advantage estimation. ICLR, 2016. [34] D. Silver, G. Lever, N. Heess, T. Degris, D. Wierstra, and M. Riedmiller. Deterministic policy gradient algorithms. ICML, 2014. [35] R. S. Sutton and A. G. Barto. Introduction to Reinforcement Learning. MIT Press, 2nd edition, 2017. Preliminary Draft. [36] R. S. Sutton, D. A. McAllester, S. P. Singh, Y. Mansour, et al. Policy gradient methods for reinforcement learning with function approximation. NIPS, 1999. 10 [37] G. Tesauro. Temporal difference learning and TD-gammon. CACM, 1995. [38] G. Theocharous, P. S. Thomas, and M. Ghavamzadeh. Personalized ad recommendation systems for life-time value optimization with guarantees. IJCAI, 2015. [39] E. Todorov. Linearly-solvable Markov decision problems. NIPS, 2006. [40] E. Todorov. Policy gradients in linearly-solvable MDPs. NIPS, 2010. [41] Z. Wang, V. Bapst, N. Heess, V. Mnih, R. Munos, K. Kavukcuoglu, and N. de Freitas. Sample efficient actor-critic with experience replay. ICLR, 2017. [42] Z. Wang, N. de Freitas, and M. Lanctot. Dueling network architectures for deep reinforcement learning. ICLR, 2016. [43] C. J. Watkins. Learning from delayed rewards. PhD thesis, University of Cambridge England, 1989. [44] C. J. Watkins and P. Dayan. Q-learning. Machine learning, 8(3-4):279–292, 1992. [45] R. J. Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Mach. Learn. J., 1992. [46] R. J. Williams and J. Peng. Function optimization using connectionist reinforcement learning algorithms. Connection Science, 1991. [47] B. D. Ziebart. Modeling purposeful adaptive behavior with the principle of maximum causal entropy. PhD thesis, CMU, 2010. [48] B. D. Ziebart, A. L. Maas, J. A. Bagnell, and A. K. Dey. Maximum entropy inverse reinforcement learning. AAAI, 2008. 11
2017
666
7,192
Asynchronous Coordinate Descent under More Realistic Assumption∗ Tao Sun National University of Defense Technology Changsha, Hunan 410073, China nudtsuntao@163.com Robert Hannah University of California, Los Angeles Los Angeles, CA 90095, USA RobertHannah89@math.ucla.edu Wotao Yin University of California, Los Angeles Los Angeles, CA 90095, USA wotaoyin@math.ucla.edu Abstract Asynchronous-parallel algorithms have the potential to vastly speed up algorithms by eliminating costly synchronization. However, our understanding of these algorithms is limited because the current convergence theory of asynchronous block coordinate descent algorithms is based on somewhat unrealistic assumptions. In particular, the age of the shared optimization variables being used to update blocks is assumed to be independent of the block being updated. Additionally, it is assumed that the updates are applied to randomly chosen blocks. In this paper, we argue that these assumptions either fail to hold or will imply less efficient implementations. We then prove the convergence of asynchronous-parallel block coordinate descent under more realistic assumptions, in particular, always without the independence assumption. The analysis permits both the deterministic (essentially) cyclic and random rules for block choices. Because a bound on the asynchronous delays may or may not be available, we establish convergence for both bounded delays and unbounded delays. The analysis also covers nonconvex, weakly convex, and strongly convex functions. The convergence theory involves a Lyapunov function that directly incorporates both objective progress and delays. A continuous-time ODE is provided to motivate the construction at a high level. 1 Introduction In this paper, we consider the asynchronous-parallel block coordinate descent (async-BCD) algorithm for solving the unconstrained minimization problem min x∈RN f(x) = f(x1, . . . , xN), (1) where f is a differentiable function and ∇f is L-Lipschitz continuous. Async-BCD [14, 13, 16] has virtually the same implementation as regular BCD. The difference is that the threads doing the parallel computation do not wait for all others to finish and share their updates before starting the next iteration, but merely continue to update with the most recent solution-vector information available2. ∗The work is supported in part by the National Key R&D Program of China 2017YFB0202902, China Scholarship Council, NSF DMS-1720237, and ONR N000141712162 2Additionally, the step size needs to be modified to ensure convergence results hold. However in practice traditional step sizes appear to still allow convergence, barring extreme circumstances. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. In traditional algorithms, latency, bandwidth limits, and unexpected drains on resources, that delay the update of even a single thread will cause the entire system to wait. By eliminating this costly idle time, asynchronous algorithms can be much faster than traditional ones. In async-BCD, each agent continually updates the solution vector, one block at a time, leaving all other blocks unchanged. Each block update is a read-compute-update cycle. It begins with an agent reading x from shared memory or a parameter server, and saving it in a local cache as ˆx. The agent then computes −1 L∇if(ˆx), a block partial gradient3. The final step of the cycle depends on the parallel system setup. In a shared memory setup, the agent reads block xi again and writes xi −γk L ∇if(ˆx) to xi (where γk is the step size). In parameter-server setup, the agent can send −1 L∇if(ˆx) and let the server update xi. Other setups are possible, too. The iteration counter k increments upon the completion of any block update, and the updating block is denoted as ik. Many iterations may occur between the time a computing node reads the solution vector ˆx into memory, and the time that the node’s corresponding update is applied to the shared solution vector. Because of this, the iteration of asyn-BCD is, therefore, modeled [14] as xk+1 ik = xk ik −γk L ∇ikf(ˆxk), (2) where ˆxk is a potentially outdated version of xk, and xk+1 j = xk j for all non-updating blocks j ̸= ik. The convergence behavior of this algorithm depends on the sequence of updated blocks ik, the step size sequence γk, as well as the ages of the blocks of ˆxk relative to xk. We define the delay vector ⃗j(k) = (j(k, 1), j(k, 2), . . . , j(k, N)) ∈ZN, which represents the how outdated each of the blocks are. Specifically, we have define: ˆxk = (xk−j(k,1) 1 , xk−j(k,2) 2 , . . . , xk−j(k,N) N ). (3) The k’th delay (or current delay) is j(k) = max1≤i≤N{j(k, i)}. 1.1 Dependence between delays and blocks In previous analyses [13, 14, 16, 9], it is assumed that the block index ik and the delay ⃗j(k) were independent sequences. This simplifies proofs, for example, giving Eik(Pik∇f(ˆxk)) = 1 N ∇f(ˆxk) when ik is chosen at random, where Pi denotes the projection to the ith block. Without independence, ⃗j(k) will depend on ik, causing the distribution of ˆxk to be different for each possible ik, thus breaking the previous equality. However, the independence assumption is unrealistic in practice. Consider a problem where some blocks are more expensive to update than others4. Blocks that take longer to update should have greater delays when they are updated because more other updates will have occurred between the time that ˆx is read and when the update is applied. For the same reason, updates on blocks assigned to slower or busier agents will generally have greater delays. Indeed this turns out to be the case in practice. Experiments were performed on a cluster with 2 nodes, each with 16 threads running on an Intel Xeon CPU E5-2690 v2. The algorithm was applied to the logistic regression problem on the “news20” data set from LIBSVM, with 64 contiguous coordinate blocks of equal size. Over 2000 epochs, blocks 0, 1, and 15 had average delays of 351, 115, and 28, respectively. ASync-BCD completed this over 7x faster than the corresponding synchronous algorithm using the same computing resources, with a nearly equal decrease in objective function. Even when blocks have balanced difficulty, and the computing nodes have equal computing power, this dependence persists. We assigned 20 threads to each core, with each thread assigned to a block of 40 coordinates with an equal numbers of nonzeros. The mean delay varied from 29 to 50 over the threads. This may be due to the cluster scheduler or issues of data locality, which were hard to examine. Clearly, there is strong dependence of the delays ⃗j(k) on the updated block ik. 1.2 Stochastic and deterministic block rules This paper considers two different block rules: deterministic and stochastic. For the stochastic block rule, at each update, a block is chosen from {1, 2, . . . , N} uniformly at random5, for instance in 3The computing can start before the reading is completed. If ∇if(ˆx) does not require all components of ˆx, only the required ones are read. 4say, because they are larger, bear more nonzero entries in the training set, or suffer poorer data locality. 5The distribution doesn’t have to be uniform. We need only assume that every block has a nonzero probability of being updated. It is easy to adjust our analysis to this case. 2 [14, 13, 16]. For the deterministic rule, ik is an arbitrary sequence that is assumed to be essentially cyclic. That is, there is an N ′ ∈N, N ′ ≥N, such that each block i ∈{1, 2, . . . , N} is updated at least once in a window of N ′, that is, For each t ∈Z+, ∃integer K(i, t) ∈{tN ′, tN ′ + 1, . . . , (1 + t)N ′ −1} such that iK(i,t) = i. This encompasses different kinds of cyclic rules such as fixed ordering, random permutation, and greedy selection. The stochastic block rule is easier to analyze because taking expectation will yield a good approximation to the full gradient. It ensures the every block is updated at the specified frequency. However, it can be expensive or even infeasible to implement for the following reasons. In the shared memory setup, stochastic block rules require random data access, which is not only significantly slower than sequential data access but also cause frequent cache misses (waiting for data being fetched from slower cache or the main memory). The cyclic rules clearly avoid these issues since data requirements are predictable. In the parameter-server setup where workers update randomly assigned blocks at each step, each worker must either store all the problem data necessary to update any block (which may mean massive storage requirements) or read the required data from the server at every step (which may mean massive bandwidth requirements). Clearly this permanently assigning blocks to agents avoids these issues. On the other hand, the analysis of cyclic rules generally has to consider the worst-case ordering and necessarily gives worse performance in the worst case[19]. In practice, worst-case behavior is rare, and cyclic rules often lead to good performance [7, 8, 3]. 1.3 Bounded and unbounded delays We consider different delay assumptions as well. Bounded delay is when j(k) ≤τ for some fixed τ ∈Z+ and all iterations k; while the unbounded delay allows supk{j(k)} = +∞. Bounded and unbounded delays can be further divided into deterministic and stochastic. Deterministic delays refer to a sequence of delay vectors⃗j(0),⃗j(1),⃗j(2), . . . that is arbitrary or follows an unknown distribution so is treated as arbitrary. Our stochastic delay results apply to distributions that decay faster than O(k−3). Deterministic unbounded delays apply to the case when async-BCD runs on unfamiliar hardware platforms. For convergence, we require a finite lim infk{j(k)} and the current step size ηk to be adaptively chosen to the current delay j(k), which must be measured or overestimated. Bounded delays and stochastic unbounded delays apply when the user can provide a bound or delay distribution, respectively. The user can obtain these from previous experience or by running a pilot test. In return, a fixed step size allows convergence, and measuring the current delay is not needed. 1.4 Contributions Our contributions are mainly convergence results for three kinds of delays: bounded, stochastic unbounded, deterministic unbounded, that are obtained without the artificial independence between the block index and the delay. The results are provided for nonconvex, convex, and strongly convex functions with Lipschitz gradients. Sublinear rates and linear rates are provided, which match the rates for the corresponding synchronous algorithms in terms of order of magnitude. Due to space limitation, we restrict ourselves to Lipschitz differentiable functions and leave out nonsmooth proximable functions. Like many analyses of asynchronous algorithms, our proofs are built on the construction of Lyapunov functions. We provide a simple ODE-based (i.e., continuous time) construction for bounded delays to motivate the construction of the Lyapunov function in the standard discrete setting. Our analysis brings great news to the practitioner. Roughly speaking, in a variety of setting, even when there is no load balancing (thus the delays may depend on the block index) or bound on the delays, convergence of async-BCD can be assured by using our provided step sizes. Our proofs do not treat asynchronicity as noise, as many papers do6, because modelling delays in this way appears to destroy valuable information, and leads to inequalities that are too blunt to obtain stronger results. This is why sublinear and linear rates can be established for weak and strong convex problems respectively, even when delays depend on the blocks and are potentially unbounded. Our main focus was to prove new convergence results in a new setting, not to obtain the best possible rates. Space limitations make this difficult, and we leave it for future work. The main message is that even without the independence assumption, convergence of the same order as for the corresponding synchronous algorithm occurs. The step sizes and rates obtained may be overly pessimistic for the 6See, for example, (5.1) and (A.10) in [18], and (14) and Lemma 4 in [6]. 3 practitioner to use. In practice, we find that using the standard synchronous step size results in convergence, and the observed rate of convergence is extremely close to that of the synchronous counterpart. With the independence assumption, convergence rates for asynchronous algorithms have recently been proven to be asymptotically the same as their synchronous counterparts[10]. 1.5 Related work Our work extends the theory on asynchronous BCD algorithms such as [18, 14, 13]. However, their analyses rely on the independence assumption and assume bounded delays. The bounded delay assumption was weakened by recent papers [9, 17], but independence and random blocks were still needed. Recently [12] proposes (in the SGD setting) an innovative “read after” sequence relabeling technique to create the independence. However, enforcing independence in this way creates other artificial implementation requirements that may be problematic: For instances, agents must read “all shared data parameters and historical gradients before starting iterations”, even if not all of this is required to compute updates. Our analysis does not require these kinds of implementation fixes. Also, our analysis also works for unbounded delays and deterministic block choices. Related recent works also include [1, 2], which solve our problem with additional convex blockseparable terms in the objective. In the first paper [1], independence between blocks and delays is avoided. However, they require a step size that diminishes at 1/k and that the sequence of iterate is bounded (which in general may not be true). The second paper [2] relaxes independence by using a different set of assumptions. In particular, their assumption D3 assumes that, regardless of the previous updates, there is a universally positive chance for every block to be updated in the next step. This Markov-type assumption relaxes the independence assumption but does not avoid it. Paper [15] addressed this issue by decoupling the parameters read by each core from the virtual parameters on which progress is actually defined. Based on the idea of [16], [12] addressed the dependence problem in related work. In the convex case with a bounded delay τ, the step size in paper [14] is O( 1 τ 2/N ). In their proofs, the Lyapunov function is based on ∥xk −x∗∥2 2. Our analysis uses a Lyapunov function consisting of both the function value and the sequence history, where the latter vanishes when delays vanish. If the τ is much larger than the blocks of the problem, our step size O( 1 τ ) is better even under our much weaker conditions. The step size bound in [16, 9, 4] is O( 1 1+2τ/ √ N ), which is better than ours, but they need the independence assumption and the stochastic block rule. Recently, [20] introduces an asynchronous primal-dual method for a problem similar to ours but having additional affine linear constraints. The analysis assumes bounded delays, random blocks, and independence. 1.6 Notation We let x∗denote any minimizer of f. For the update in (2), we use the following notation: ∆k := xk+1 −xk (2)= −γk L ∇ikf(ˆxk), dk := xk −ˆxk. (4) We also use the convention ∆k := 0 if k < 0. Let χk be the sigma algebra generated by {x0, x1, . . . , xk}. Let E⃗j(k) denote the expectation over the value of ⃗j(k) (when it is a random variable). E denotes the expectation over all random variables. 2 Bounded delays In this part, we present convergence results for the bounded delays. If the gradient of the function is L-Lipschitz (even if the function is nonconvex), we present the convergence for both the deterministic and stochastic block rule. If the function is convex, we can obtain a sublinear convergence rate. Further, if the function is restricted strongly convex, a linear convergence rate is obtained. 2.1 Continuous-time analysis Let t be time in this subsection. Consider the ODE ˙x(t) = −η∇f(ˆx(t)), (5) where η > 0. If we set ˆx(t) ≡x(t), this system describes a gradient flow, which monotonically decreases f(x(t)), and its discretization is the gradient descent iteration. Indeed, we have 4 d dtf(x(t)) = ⟨∇f(x(t)), ˙x(t)⟩ (5)= −1 η∥˙x(t)∥2 2. Instead, we allow delays (i.e., ˆx(t) ̸= x(t)) and impose the bound c > 0 on the delays: ∥ˆx(t) −x(t)∥2 ≤ Z t t−c ∥˙x(s)∥2ds. (6) The delays introduce inexactness to the gradient flow f(x(t)). We lose monotonicity. Indeed, d dtf(x(t)) = ⟨∇f(x(t)), ˙x(t)⟩= ⟨∇f(ˆx(t)), ˙x(t)⟩+ ⟨∇f(x(t)) −∇f(ˆx(t)), ˙x(t)⟩ (7) a) ≤−1 η ∥˙x(t)∥2 2 + L∥x(t) −ˆx(t)∥2 · ∥˙x(t)∥2 b) ≤−1 2η ∥˙x(t)∥2 2 + ηcL2 2 Z t t−c ∥˙x(s)∥2 2ds, Here a) is from (5) and Lipschitzness of ∇f and b) is from the Cauchy-Schwarz inequality L∥x(t) − ˆx(t)∥2·∥˙x(t)∥2 ≤∥˙x(t)∥2 2 2η + ηL2∥x(t)−ˆx(t)∥2 2 2 and ∥x(t)−ˆx(t)∥2 2 (6) ≤c R t t−c ∥˙x(s)∥2 2ds. The inequalities are generally unavoidable. Therefore, we design an energy function with both f and a weighted total kinetic term, where γ > 0 will be decided below: ξ(t) = f(x(t)) + γ Z t t−c s −(t −c)  ∥˙x(s)∥2 2ds. (8) By substituting the bound on d dtf(x(t)) in (7), we get the time derivative: ˙ξ(t) = d dtf(x(t)) + γc∥˙x(t)∥2 2 −γ Z t t−c ∥˙x(s)∥2 2ds ≤−( 1 2η −γc)∥˙x(t)∥2 2 −(γ −ηcL2 2 ) Z t t−c ∥˙x(s)∥2 2ds (9) As long as η < 1 Lc, there exists γ > 0 such that ( 1 2η −γc) > 0 and (γ −ηcL2 2 ) > 0, so ξ(t) is monotonically nonincreasing. Assume min f is finite. Since ξ(t) is lower bounded by min f, ξ(t) must converge, hence ˙ξ →0, ˙x(t) →0 by (8). ∇f(ˆx(t)) →0 by (5), and ˆx(t) −x(t) →0 by (6). The last two results further yield ∇f(x(t)) →0. 2.2 Discrete analysis The analysis for our discrete iteration (2) is based on the following Lyapunov function: ξk := f(xk) + L 2ε k−1 X i=k−τ (i −(k −τ) + 1)∥∆i∥2 2. (10) for some ε > 0 determined later based on the step size and τ, the bound on the delays. The constant ε is not an algorithm parameter. In the lemma below, we present a fundamental inequality, which states, regardless of which block ik is updated and which ˆxk is used to compute the update in (2), there is a sufficient descent in our Lyapunov function. Lemma 1 (sufficient descent for bounded delays) Conditions: Let f be a function (possibly nonconvex) with L-Lipschitz gradient and finite min f. Let (xk)k≥0 be generated by the async-BCD algorithm (2), and the delays be bounded by τ. Choose the step size γk ≡γ = 2c 2τ+1 for arbitrary fixed 0 < c < 1. Result: we can choose ε > 0 to obtain ξk −ξk+1 ≥1 2( 1 γ −1 2 −τ)L · ∥∆k∥2 2, (11) Consequently, lim k ∥∆k∥2 = 0 (12) and min 1≤i≤k ∥∆i∥2 = o(1/ √ k). (13) So we have that the smallest gradient obtained by step k decays faster than O(1/ √ k). Based on the lemma, we obtain a very general result for nonconvex problems. 5 Theorem 1 Assume the conditions of Lemma 1, for f that may be nonconvex. Under the deterministic block rule, we have lim k ∥∇f(xk)∥2 = 0, min 1≤i≤k ∥∇f(xk)∥2 = o(1/ √ k). (14) This rate has the same order of magnitude as standard gradient descent for a nonconvex function. 2.3 Stochastic block rule Under the stochastic block rule, an agent picks a block from {1, 2, ..., N} uniformly randomly at the beginning of each update. For the kth completed update, the index of the chosen block is ik. Our result in this subsection relies on the following assumption on the random variable ik: Eik(∥∇ikf(xk−τ)∥2 | χk−τ) = 1 N N X i=1 ∥∇if(xk−τ)∥2, (15) where χk = σ(x0, x1, . . . , xk,⃗j(0),⃗j(1), . . . ,⃗j(k)), k = 0, 1, . . ., is the filtration that represents the information that is accumulated as our algorithm runs. It is important to note that (15) uses xk−τ instead of ˆxk because ˆxk may depend on ik. This condition essentially states that, given the information at iteration k −τ and earlier, ik is uniform at step k. We can relax (15) to nearly-uniform distributions. Indeed, Theorem 2 below only needs that every block has a nonzero probability of being updated given χk−τ, that is, E(∥∇ikf(xk−τ)∥2 | χk−τ) ≥¯ε N N X i=1 ∥∇if(xk−τ)∥2, (16) for some universal ¯ε > 0. The interpretation is that though ik and ∇f(xk−τ) are dependent, since τ iterations have passed, ∇f(xk−τ) has a limited influence on the distribution ik: There is a minimum probability that each index is chosen given sufficient time. For convenience and simplicity, we assume (15) instead of (16) . Next, we present a general result for a possibly nonconvex objective f. Theorem 2 Assume the conditions of Lemma 1.Under the stochastic block rule and assumption (15), we have: lim k E∥∇f(xk)∥2 = 0, min 1≤i≤k E∥∇f(xk)∥2 2 = o(1/k). (17) 2.3.1 Sublinear rate under convexity When the function f is convex, we can obtain convergence rates, for which we need a slightly modified Lyapunov function Fk := f(xk) + δ · k−1 X i=k−τ (i −(k −τ) + 1)∥∆i∥2 2, (18) where δ := [1 + ε 2τ ( 1 γ −1 2 −τ)] L 2ε. Here, we assume τ ≥1. Since τ is just an upper bound of the delays, the delays can be 0. We also define πk := E(Fk −min f), S(k, τ) := Pk−1 i=k−τ ∥∆i∥2 2. Lemma 2 Assume the conditions of Lemma 1. Furthermore, let f be convex and use the stochastic block rule. Let xk denote the projection of xk to argmin f, assumed to exist, and let β := max{ 8NL2 γ2 , (12N + 2)L2τ + δτ}, α := β/[ L 4τ ( 1 γ −1 2 −τ)]. Then we have: (πk)2 ≤α(πk −πk+1) · (δτES(k, τ) + E∥xk −xk∥2 2). (19) When τ = 1 (nearly no delay), we can obtain β = O(NL2/γ2) and α = O(βγ/L) = O(NL/γ), which matches the result of standard BCD. This is used to prove sublinear convergence. Theorem 3 Assume the conditions of Lemma 1. Furthermore, let f be convex and coercive7, and use the stochastic block rule. Then we have: E(f(xk) −min f) = O(1/k). (20) 7A function f is coercive if ∥x∥→∞means f(x) →∞. 6 2.3.2 Linear rate under convexity We next consider when f is ν-restricted strongly convex8 in addition to having L-Lipschitz gradient. That is, for x ∈dom(f), ⟨∇f(x), x −Projargmin f(x)⟩≥ν · dist2(x, argmin f). Theorem 4 Assume the conditions of Lemma 1. Furthermore, let f be ν-strongly convex, and use the stochastic block rule. Then we have: E(f(xk) −min f) = O(ck), (21) where c := α min{ν,1}  (1 + α min{ν,1}) < 1 for α given in Lemma 2. 3 Stochastic unbounded delay In this part, the delay vector ⃗j(k) is allowed to be an unbounded random variable. Under some mild restrictions on the distribution of ⃗j(k), we can still establish convergence. In light of our continuous-time analysis, we must develop a new bound for the last inner product in (7), which requires the tail distribution of j(k) to decay sufficiently fast. Specifically, we define a sequence of fixed parameters pj such that pj ≥P(j(k) = j), ∀k, sl = P+∞ j=l jpj, and ci := P+∞ l=i sl. Clearly, c0 is larger than c1, c2, . . ., and we need c0 to be finite. Distributions with pj = O(j−t), for t > 3, and exponential-decay distributions satisfy this requirement. Define the Lyapunov function Gk as Gk := f(xk) + ¯δ · Pk−1 i=0 ck−1−i∥∆i∥2 2, where ¯δ := L 2ε + ( 1 γ −1 2) L c0 − L √c0 . To simplify the presentation, we define R(k) := Pk i=0 ck−iE∥∆i∥2 2. Lemma 3 (Sufficient descent for stochastic unbounded delays) Conditions: Let f be a function (which may be nonconvex) with L-Lipschitz gradient and finite min f. Let delays be stochastic unbounded. Use step size γk ≡γ = 2c 2√c0+1 for arbitrary fixed 0 < c < 1. Results: we can set ε > 0 to ensures sufficient descent: E[Gk −Gk+1] ≥ L c0 ( 1 γ −1 2 −√c0)R(k). (22) And we have lim k E∥∆k∥2 = 0 and lim k E∥dk∥2 = 0. (23) 3.1 Deterministic block rule Theorem 5 Let the conditions of Lemma 3 hold for f. Under the deterministic block rule (§1.2), we have: lim k E∥∇f(xk)∥2 = 0. (24) 3.2 Stochastic block rule Recall that under the stochastic block rule, the block to update is selected uniformly at random from {1, 2, . . . , N}. The previous assumption (15), which is made for bounded delays, need to be updated into the following assumption for unbounded delays: Eik(∥∇ikf(xk−j(k))∥2 2) = 1 N N X i=1 ∥∇if(xk−j(k))∥2 2, (25) where j(k) is still a variable on both sides. As argued below (15), the uniform distribution can easily be relaxed to a nearly-uniform distribution, but we use the former for simplicity. Theorem 6 Let the conditions of Lemma 3 hold. Under the stochastic block rule and assumption (25), we have lim k E∥∇f(xk)∥2 = 0. (26) 8A condition weaker than ν-strong convexity and useful for problems involving an underdetermined linear mapping Ax; see [11, 13]. 7 3.2.1 Convergence rate When f is convex, we can derive convergence rates for φk := E(Gk −min f). Lemma 4 Let the conditions of Lemma 3 hold, and let f be convex. Let xk denote the projection of xk to argmin f. Let β = max{ 8NL2 γ2c0 , (12N + 2)L2 + ¯δ} and α = β/[ L 2 ( 1 γ −1 2 −√c0)]. Then we have (φk)2 ≤¯α(φk −φk+1) · (¯δR(k) + E∥xk −xk∥2 2), (27) A sublinear convergence rate can be obtained if supk{E∥xk −xk∥2 2} < +∞, which can be ensured by adding a projection to a large artificial box set that surely contains the solution. Here we only present a linear convergence result. Theorem 7 Let the conditions of Lemma 3 hold. In addition, let f be ν-restricted strongly convex and set step size γk ≡γ < 2 2√c0+1, with c = ¯α max{1, 1 ν } 1+¯α max{1, 1 ν } < 1. Then, E(f(xk) −min f) = O(ck). (28) 4 Deterministic unbounded delays In this part, we consider deterministic unbounded delays, which require delay-adaptive step sizes. Set positive sequence (ϵi)i≥0 (which can be optimized later given actual delays) such that κi := P+∞ j=i ϵj obeys κ1 < +∞. Set Dj := 1 2 + κ1 2 + Pj i=1 1 2ϵi . We use a new Lyapunov function Hk := f(xk) + L 2 P+∞ i=1 κi∥∆k−i∥2 2. Let T ≥lim inf j(k), and let QT be the subsequence of N where the current delay is less than T. We prove convergence on the family of subsequences xk, k ∈QT . The algorithm is independent of the choice of T. The algorithm is run as before, and after completion, an arbitrarily large T ≥lim inf j(k) can be chosen. Extending the result to standard sequence convergence has proven intractable. Lemma 5 (sufficient descent for unbounded deterministic delays) Conditions: Let f be a function (which may be nonconvex) with L-Lipschitz gradient and finite min f. The delays j(k) are deterministic and obey lim inf j(k) < ∞. Use step size γk = c/Dj(k) for arbitrary fixed 0 < c < 1. Results: We have Hk −Hk+1 ≥L( 1 γk −Dj(k))∥∆k∥2 2, lim k ∥∆k∥2 = 0. (29) On any subsequence QT (for arbitrarily large T ≥lim inf j(k)), we have: lim (k∈QT )→∞∥dk∥2 = 0, lim (k∈QT )→∞∥∇ikf(ˆxk)∥2 = 0, To prove our next result, we need a new assumption: essentially cyclically semi-unbounded delay (ECSD), which is slightly stronger than the essentially cyclic assumption. In every window of N ′ steps, every index i is updated at least once with a delay less than B (at iteration K(i, t)). The number B just needs to exist and can be arbitrarily large. It does not affect the step size. Theorem 8 Let the conditions of Lemma 5 hold. For the deterministic index rule under the ECSD assumption, for T ≥B, we have: lim (k∈QT )→∞∥∇f(xk)∥2 = 0. (30) 5 Conclusion In summary, we have proven a selection of convergence results for async-BCD under bounded and unbounded delays, and stochastic and deterministic block choices. These results do not require the independence assumption that occurs in the vast majority of other work so far. Therefore they better model the behavior of real asynchronous solvers. These results were obtained with the use of Lyapunov function techniques, and treating delays directly, rather than modelling them as noise. Future work may involve obtaining a more exhaustive list of convergence results, sharper convergence rates, and an extension to asynchronous stochastic gradient descent-like algorithms, such as SDCA. 8 References [1] Loris Cannelli, Francisco Facchinei, Vyacheslav Kungurtsev, and Gesualdo Scutari. Asynchronous parallel algorithms for nonconvex big-data optimization: Model and convergence. arXiv preprint arXiv:1607.04818, 2016. [2] Loris Cannelli, Francisco Facchinei, Vyacheslav Kungurtsev, and Gesualdo Scutari. Asynchronous parallel algorithms for nonconvex big-data optimization. Part II: Complexity and numerical results. arXiv preprint arXiv:1701.04900, 2017. [3] Yat Tin Chow, Tianyu Wu, and Wotao Yin. Cyclic coordinate update algorithms for fixed-point problems: Analysis and applications. SIAM Journal on Scientific Computing, accepted, 2017. [4] Damek Davis. The asynchronous palm algorithm for nonsmooth nonconvex problems. arXiv preprint arXiv:1604.00526, 2016. [5] Damek Davis and Wotao Yin. Convergence rate analysis of several splitting schemes. In Splitting Methods in Communication, Imaging, Science, and Engineering, pages 115–163. Springer, 2016. [6] Christopher M De Sa, Ce Zhang, Kunle Olukotun, and Christopher Ré. Taming the wild: A unified analysis of hogwild-style algorithms. In Advances in neural information processing systems, pages 2674–2682, 2015. [7] Jerome Friedman, Trevor Hastie, Holger Höfling, Robert Tibshirani, et al. Pathwise coordinate optimization. The Annals of Applied Statistics, 1(2):302–332, 2007. [8] Jerome Friedman, Trevor Hastie, and Rob Tibshirani. Regularization paths for generalized linear models via coordinate descent. Journal of statistical software, 33(1):1, 2010. [9] Robert Hannah and Wotao Yin. On unbounded delays in asynchronous parallel fixed-point algorithms. arXiv preprint arXiv:1609.04746, 2016. [10] Robert Hannah and Wotao Yin. More Iterations per Second, Same Quality – Why Asynchronous Algorithms may Drastically Outperform Traditional Ones. arXiv preprint arXiv:1708.05136, 2017. [11] Ming-Jun Lai and Wotao Yin. Augmented ℓ1 and nuclear-norm models with a globally linearly convergent algorithm. SIAM Journal on Imaging Sciences, 6(2):1059–1091, 2013. [12] Rémi Leblond, Fabian Pedregosa, and Simon Lacoste-Julien. ASAGA: Asynchronous Parallel SAGA. In Proceedings of the 20th International Conference on Artificial Intelligence and Statistics, pages 46–54, 2017. [13] J. Liu and S. Wright. Asynchronous stochastic coordinate descent: Parallelism and convergence properties. SIAM Journal on Optimization, 25(1):351–376, 2015. [14] Ji Liu, Stephen J. Wright, Christopher Ré, Victor Bittorf, and Srikrishna Sridhar. An asynchronous parallel stochastic coordinate descent algorithm. J. Mach. Learn. Res., 16(1):285–322, 2015. [15] Horia Mania, Xinghao Pan, Dimitris Papailiopoulos, Benjamin Recht, Kannan Ramchandran, and Michael I Jordan. Perturbed iterate analysis for asynchronous stochastic optimization. arXiv preprint arXiv:1507.06970, 2015. [16] Zhimin Peng, Yangyang Xu, Ming Yan, and Wotao Yin. Arock: an algorithmic framework for asynchronous parallel coordinate updates. SIAM Journal on Scientific Computing, 38(5):A2851–A2879, 2016. [17] Zhimin Peng, Yangyang Xu, Ming Yan, and Wotao Yin. On the convergence of asynchronous parallel iteration with arbitrary delays. arXiv preprint arXiv:1612:04425, 2016. [18] Benjamin Recht, Christopher Re, Stephen Wright, and Feng Niu. Hogwild!: A lock-free approach to parallelizing stochastic gradient descent. In J. Shawe-Taylor, R. S. Zemel, P. L. Bartlett, F. Pereira, and K. Q. Weinberger, editors, Advances in Neural Information Processing Systems 24, pages 693–701. Curran Associates, Inc., 2011. [19] Ruoyu Sun and Yinyu Ye. Worst-case Complexity of Cyclic Coordinate Descent: O(n2) Gap with Randomized Version. arXiv preprint arXiv:1604.07130, 2017. [20] Yangyang Xu. Asynchronous parallel primal-dual block update methods. arXiv preprint arXiv:1705.06391, 2017. 9
2017
667
7,193
EEG-GRAPH: A Factor-Graph-Based Model for Capturing Spatial, Temporal, and Observational Relationships in Electroencephalograms Yogatheesan Varatharajah ∗ Min Jin Chong∗ Krishnakant Saboo∗ Brent Berry† Benjamin Brinkmann† Gregory Worrell† Ravishankar Iyer∗ Abstract This paper presents a probabilistic-graphical model that can be used to infer characteristics of instantaneous brain activity by jointly analyzing spatial and temporal dependencies observed in electroencephalograms (EEG). Specifically, we describe a factor-graph-based model with customized factor-functions defined based on domain knowledge, to infer pathologic brain activity with the goal of identifying seizure-generating brain regions in epilepsy patients. We utilize an inference technique based on the graph-cut algorithm to exactly solve graph inference in polynomial time. We validate the model by using clinically collected intracranial EEG data from 29 epilepsy patients to show that the model correctly identifies seizure-generating brain regions. Our results indicate that our model outperforms two conventional approaches used for seizure-onset localization (5–7% better AUC: 0.72, 0.67, 0.65) and that the proposed inference technique provides 3–10% gain in AUC (0.72, 0.62, 0.69) compared to sampling-based alternatives. 1 Introduction Studying the neurophysiological processes within the brain is an important step toward understanding the human brain. Techniques such as electroencephalography are exceptional tools for studying the neurophysiological processes, because of their high temporal and spatial resolution. An electroencephalogram (EEG) typically contains several types of rhythms and discrete neurophysiological events that describe instantaneous brain activity. On the other hand, the neural activity taking place in a brain region is very likely dependent on activities that took place in the same region at previous time instances. Furthermore, some EEG channels show inter-channel correlation due to their spatial arrangement [1]. Those three characteristics are related, respectively, to the observational, temporal, and spatial dependencies observed in time-series EEG signals. The majority of the literature focuses on identifying and developing detectors for features relating to the different rhythms and discrete neurophysiological events in the EEG signal [2]. Some effort has been made to understand the inter-channel correlations [3] and temporal dependencies [4] observed in EEG. Despite these separate efforts, very little effort has been made to combine those dependencies into a single model. Since those dependencies possess complementary information, using only one of them generally results in poor understanding of the underlying neurophysiological phenomena. Hence, a unified framework that jointly captures all three dependencies in EEG, addresses an important research problem in electrophysiology. In this paper, we describe a graphical-modelbased approach to capture all three dependencies, and we analyze its efficacy by applying it to a critical problem in clinical neurology. ∗Department of Electrical and Computer Engineering, University of Illinois at Urbana-Champaign, Urbana, Illinois 61801. Email: {varatha2, mchong6, ksaboo2, rkiyer}@illinois.edu †Department of Neurology, Mayo Clinic, Rochester, Minnesota 55904. Email: {Berry.Brent, Brinkmann.Benjamin, Worrell.Gregory}@mayo.edu 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. Graphical models in general are useful for representing dependencies between random variables. Factor graphs are a specific type of graphical models that have random variables and factor functions as the vertices in the graph [5]. A factor function is used to describe the relationship between two or more random variables in the graph. Factor graphs are particularly useful when custom definitions of the dependencies, such as in our case, need to be encoded in the graph. Hence, we have chosen to adopt a factor graph model to represent the three kinds of dependencies described previously. These dependencies are represented via three different factor functions, namely observational, spatial, and temporal factor functions. We assess the applicability of this model in localization of seizure onset zones (SOZ), which is a critical step in treating patients with epilepsy [6]. In particular, our model is utilized to isolate those neural events in EEG that are associated with the SOZ, and are eventually used to deduce the location of the SOZ. However, in a general setting, with appropriate definitions of factor functions, one can utilize our model to describe other neural events of interest (e.g., events related to behavioral states or memory processing). Major contributions of our work are the following. 1. A framework based on factor graphs that jointly represents instantaneous observationbased, temporal, and spatial dependencies in EEG. This is the first attempt to combine these three aspects into a single model in the context of EEG analysis. 2. A lightweight and exact graph inference technique based on customized definitions of factor functions. Exact graph inference is typically intractable in most graphical model representations because of exponentially growing state spaces. 3. A markedly improved technique for localizing SOZ based on the factor-graph-based model developed in this paper. Existing approaches utilize only the observations made in the EEG to determine the SOZ and do not utilize spatial and temporal dependencies. Our study establishes the feasibility of the factor-graph-based model and demonstrates its application in SOZ localization on a real EEG dataset collected from epilepsy patients who underwent epilepsy surgery. Our results indicate that utilizing the spatial and temporal dependencies in addition to observations made in the EEG provides a 5–7% improvement in the AUC (0.72, 0.67, 0.65) and outperforms alternative approaches utilized for SOZ localization. Furthermore, our experiments demonstrate that the lightweight graph inference technique provides a considerable improvement (3–10%) in SOZ localization compared to sampling-based alternatives (AUC: 0.72, 0.62, 0.69). 2 Related work Identifying features (or biomarkers) that describe underlying neurophysiological phenomena has been a major focus of research in the EEG literature [2]. Spectral features [7], interictal spikes [8], high-frequency oscillations [2], and phase-amplitude coupling [4] are some of the widely used features. Although feature identification is an important step in any electrophysiologic study, features alone often cannot completely describe the underlying physiological phenomena. Researchers have also looked at spatial connectivity between EEG channels as means of describing neurophysiological activities [3]. In recent times, because of the availability of long-term EEG recordings, understanding of the temporal dependencies within various brain activities has also advanced significantly [4]. A recent attempt at combining spatial and temporal constraints has shown promise despite lacking comprehensive validation [9]. Regardless, a throughly validated and general model that captures all the factors, and is applicable to a variety of problems has not, to our knowledge, been proposed in the EEG literature. Since the three factors are complementary to each other, a model that jointly represents them addresses an important research gap in the field of electrophysiology. Graphical models have been widely used in medical informatics [10], intrusion detection [11], social network modeling [12], and many other areas. Although factor graphs are applicable in all these settings, their applications in practice are still very much dependent on problem-specific custom definitions of factor functions. Nevertheless, with some level of customization, our work provides a general framework to describe the different dependencies observed in EEG signals. A similar framework for emotion prediction is described in Moodcast [12], for which the authors used a factor graph model to describe the influences of historical information, other users, and dynamic status to predict a user’s emotions in a social network setting. Although our factor functions are derived in a similar fashion, we show that graph inference can be performed exactly using the proposed lightweight algorithm, and that it outperforms the sampling-based inference method utilized in Moodcast. Our 2 algorithm for inference was inspired by [13], in which the authors used an energy-minimizationbased approach for performing exact graph inference in a Markov random field-based model. 3 Model description Here we provide a mathematical description of the model and the inference procedure. In a nutshell, we are interested in inferring the presence of a neurophysiological phenomenon of interest by observing rhythms and discrete events (referred to as observations) present in the EEG, and by utilizing their spatial and temporal patterns as represented by a probabilistic graph. Since the generality of our model relies on the ability to customize the definitions of specific dependencies described by the model, we have adopted a factor-graph-based setting to represent our model. Definitions: Suppose that EEG data of a subject are recorded through M channels. Initially, the data is discretized by dividing the recording duration into N epochs. We represent the interactions between the channels at an epoch n as a dynamic graph Gn = (V, En), where V is the set of |V | = M channels and En ⊂V × V is the set of undirected links between channels. The state of a channel k in the nth epoch is denoted by Yn(k), which might represent a phenomenon of interest. For example, in the case of SOZ localization, the state might be a binary value representing whether the kth channel in the nth epoch exhibits a SOZ-likely phenomenon. We also use Yn to denote the states of all the channels at epoch n, and use Y to denote the set of all possible values that Yn(k) can take. We refer to the EEG rhythm or discrete event present in the EEG as observations and use Xn(k) to denote the observation present in the nth epoch of the kth channel. Depending on the number of rhythms and/or events, Xn(k) could be a scalar or vector random variable. The observations made in all the channels at epoch n are denoted by Xn. Inference: Given a dynamic network Gn, and the observations Xn, our goal is to infer the states of the channels at epoch n, i.e., Yn. In our approach, we derive the inference model using a factor graph with factor functions defined as shown in Table 1. The factor functions are defined using exponential relationships so that they attain their maximum values when the exponents are zero, and exponentially decay otherwise. All factor functions range in [0, 1]. Table 1: Factor functions used in our EEG model and their descriptions, definitions, and notations. Function Description Defnition Notations Observational: f(Yn(k), φ(Xn(k))) Measures the direct contribution of the observations made in a channel to the phenomenon of interest. e−(Yn(k)−φ(Xn(k)))2 φ : X →Y is a mapping from the observations to the phenomenon of interest. In general, it is not an accurate map, because it is based on observations alone. Spatial: g(Yn(k), Yn(l)) Measures the correlation between the states of two channels at the same epoch. e − 1 d2 kl (Yn(k)−Yn(l))2 dkl denotes the physical distance between electrodes (or channels) k and l. Temporal: h(Yn(k), Ωn−1(k)) Measures the correlation between a channel’s current state and its previous states. e−(Yn(k)−Ωn−1(k)) 2 Ωn−1(k) is a function of all previous states of channel k. E.g., Ωn−1(k) = Pn−1 i=1 Yi(k) n−1 With these definitions, the state of a channel is spatially related to the states of every other channel, temporally related to a function of all its previous states, and, at the same time, explained by the current observation of the channel. These dependencies and the factor functions that represent them are illustrated in Fig. 1a and 1b respectively. (Note that Fig. 1b illustrates only the factor functions related to Channel 1 and that similar factor functions exist for other channels although they are not shown in the figure.) Provided with that information, for a particular state vector Y , we can write P(Y |Gn) as in Eq. 1, where Z is a normalizing factor. In general, it is infeasible to find the normalizing constant Z, because it would require exploration of the space |Y|M. P(Y |Gn) = 1 Z M Y k=1  Y i̸=k g (Y (k), Y (i)) × f (Y (k), φ(Xn(k))) × h (Y (k), Ωn−1(k))   (1) 3 Current state of a brain region States of nearby regions Current observation (events, rhythms) Previous states of the same region (a) Factors that explain the state of a brain region. (b) Dependencies as factor functions. Figure 1: The dependencies observed in brain activity and a representative factor graph model. Therefore, we define the following predictive function (Eq. 2) for inferring Yn with the highest likelihood per Eq. 1. Yn = arg max Y ∈YM M Y k=1  Y i̸=k g (Y (k), Y (i)) × f (Y (k), φ(Xn(k))) × h (Y (k), Ωn−1(k))   (2) Still, finding a Y that maximizes this objective function involves a discrete optimization over the space |Y|M. A brute-force approach to finding an exact solution is infeasible when M is large. Several methods, such as junction trees [14], belief propagation [15], and sampling-based methods such as Markov Chain Monte Carlo (MCMC) [16, 17], have been proposed to find approximate solutions. However, we show that this can be calculated exactly when the aforementioned definitions of the factor functions are utilized. We can rewrite Eq. 2 using the definitions in Table 1 as follows. Yn = arg max Y ∈YM M Y k=1  Y l̸=k e − 1 d2 kl (Y (k)−Y (l))2 × e−(Y (k)−φ(Xn(k)))2 × e−(Y (k)−Ωn−1(k))2   (3) Now, representing the product terms as summations inside the exponent and using the facts that the exponential function is monotonically increasing and that maximizing a function is equivalent to minimizing the negative of that function, we can rewrite Eq. 3 as: Yn = arg min Y ∈YM PM k=1 P l̸=k 1 d2 kl (Y (k)−Y (l))2+(Y (k)−φ(Xn(k)))2+(Y (k)−Ωn−1(k))2  (4) Although the individual components in this objective function are solvable optimization problems, the combination of them makes it difficult to solve. However, the objective function resembles that of a standard graph energy minimization problem and hence can be solved using graph-cut algorithms [18]. In this paper, we describe a solution for minimizing this objective function when |Y| = 2, i.e., the brain states are binary. Although that is a limitation, the majority of the brain state classification problems can be reduced to binary state cases when the time window of classification is appropriately chosen. Regardless, potential solutions for |Y| > 2 are discussed in Section 6. Graph inference using min-cut for the binary state case: We constructed the graph shown in Fig. 2a with two special nodes in addition to the EEG channels as vertices. The additional nodes function as source (marked by 1) and sink (marked by 0) nodes in the conventional min-cut/max-flow problem. Weights in this graph are assigned as follows: • Every channel is connected with every other channel, and the link between channels k and l is assigned a weight of 1 d2 kl (Y (k) −Y (l))2 based on the distance between them. • Every channel is connected with the source node, and the link between channel k and the source is assigned a weight of (1 −Ωn−1(k))2 + (1 −φ (Xn(k)))2. • Every channel is also connected with the sink node, and the link between channel k and the sink is assigned a weight of Ω2 n−1(k) + (φ (Xn(k)))2. Proposition 1. An optimal min-cut partitioning of the graph shown in Fig. 2a minimizes the objective function given in Eq. 4. 4 (a) New graphical structure (b) Min-cut partitioning Figure 2: Graph inference using the min-cut algorithm. Proof: Suppose that we perform an arbitrary cut on the graph shown in Fig. 2a, resulting in two sets of vertices S and T . The energy of the graph after the cut is performed is: Ecut = M X k=1 h (Y (k) −Ωn−1(k))2 + (Y (k) −φ (Xn(k)))2i + X k∈T X l∈S  1 d2 kl (Y (k) −Y (l))2  It can be seen that, for the same partition of vertices, the objective function given in Eq. 4 attains the same quantity as Ecut. Therefore, since the optimal min-cut partition minimizes the energy Ecut, it minimizes the objective function given in Eq. 4. Now suppose that we are given two sets of nodes {S∗, T ∗} as the optimal partitioning of the graph. Without loss of generality, let us assume that S∗contains the source and T ∗contains the sink. Then, the other vertices in S∗and T ∗, are assigned 1 and 0 as their respective states to obtain the optimal Y that minimizes the objective function given in Eq. 4. 4 Application of the model in seizure onset localization Background: Epilepsy is a neurological disorder characterized by spontaneously occurring seizures. It affects roughly 1% of the world’s population, and many do not respond to drug treatment [19]. Epilepsy surgery, which involves resection of a portion of the patient’s brain, can reduce and often eliminate seizures [20]. The success of resective surgery depends on accurate localization of the seizure-onset zone [21]. The conventional practice is to identify the EEG channels that show the earliest seizure discharge via visual inspection of the EEG recorded during seizures, and to remove some tissue around these channels during the resective surgery. This method, despite being the current clinical standard, is very costly, time-consuming, and burdensome to the patients, as it requires a lengthy ICU stay so that an adequate number of seizures can be captured. One approach, which has recently become a widely researched topic, utilizes between-seizure (interictal) intracranial EEG (iEEG) recording to localize the seizure onset zones [22, 6]. This type of localization is preferable to the conventional method, as it does not require a lengthy ICU stay. Interictal SOZ identification methodology: Like that of the conventional approach, the goal here is to identify a few channels that are likely to be in the SOZ. Channels situated directly on or close to a SOZ exhibit different forms of transient electrophysiologic events (or abnormal events) between seizures [23]. The frequency of such abnormal neural events plays a major role in determining the SOZ. However, capturing these abnormal neural events that occur in distinct locations of the brain alone is often not sufficient to establish an area in the brain as the SOZ. The reason is that insignificant artifacts present in the EEG may show characteristics of those abnormal events that are associated with SOZ (referred to as SOZ-likely events). In order to set apart the SOZ-likely events, their spatial and temporal patterns could be utilized. It is known that SOZ-likely events occur in a repetitive and spatially correlated fashion (i.e., neighboring channels exhibit such events at the same time) [6]. Hence, the factor-graph-based model described in Section 3 can be applied to capture and utilize the spatial and temporal correlations in isolating the SOZ-likely events. 5 Identifying abnormal neural events: Spectral characteristics of iEEG measured in the form of power-in-bands (PIB) features have been widely utilized to identify abnormal neural events [24, 6, 7]. In this paper, PIB features are extracted as spectral power in the frequency bands Delta (0–3 Hz), Low-Theta (3–6 Hz), High-Theta (6–9 Hz), Alpha (9–14 Hz), Beta (14–25 Hz), LowGamma (30–55 Hz), High-Gamma (65–115 Hz), and Ripple (125–150 Hz) and utilized to make observations from channels. As described in Section 3, a φ function is used to relate the observations to abnormal events. In Section 6, we evaluate different techniques for obtaining a mapping from extracted PIB features to the presence of an abnormal neural event. However, a mapping obtained using observations alone is not sufficient to deduce SOZ because in addition to SOZ-likely events, signal artifacts will also be captured by this mapping. This phenomenon is illustrated in Fig.3, in which PIB features show similar characteristics for the events related to both SOZ and non-SOZ. Therefore, we utilize the factor graph model presented in this paper to further filter the detected abnormal events based on their spatial and temporal patterns and isolate the SOZ-likely events. 1 2 3 4 5 Time (sec) SOZ SOZ SOZ Non-SOZ Channels 0 0.5 1 1.5 Time(sec) -0.5 0 0.5 Non-SOZ Signal 0 0.5 1 1.5 Time(sec) 1 2 3 4 5 6 7 8 Normalized PIB 0 0.5 1 1.5 Time(sec) -0.5 0 0.5 1 SOZ Signal 0 0.5 1 1.5 Time(sec) 1 2 3 4 5 6 7 8 Normalized PIB Figure 3: EEG events related to both SOZ and non-SOZ are captured by PIB features because they possess similar spectral characteristics. Spatial and temporal dependencies in SOZ localization: Although artifacts show spectral characteristics similar to those of SOZ-likely events, unlike the latter, the former do not occur in a spatially correlated manner. This spatial correlation is measured with respect to the physical distances between the electrodes placed in the brain. Therefore, the same definition of the spatial factor function described in Section 3 is applicable. If a channel’s observation is classified as an abnormal neural event and the spatial factor function attains a large value with an adjacent channel, it would mean that both channels likely show similar patterns of abnormalities which therefore must be SOZ-likely events. In addition, the SOZ-likely events show a repetitive pattern, which artifacts usually do not. In Section 3, we described the temporal correlation as a function of all previous states. As such, the temporal correlation here is established with the intuition that a channel that previously exhibited a large number of SOZ-likely events is likely to exhibit more because of the repetitive pattern. Hence, temporal correlation is measured as the correlation between the state of a channel and the observed frequency of SOZ-likely events in that channel until the previous epoch, i.e., Ωn−1(k) = Pn−1 i=1 Yi(k) n−1 . Therefore, when Ωn−1(k) is close to 1 and the observation made from channel k is classified as an abnormal neural event, the event is more likely to be a SOZ-likely event than an artifact. 5 Experiments Data: The data used in this work are from a study approved by the Mayo Clinic Institutional Review Board. The dataset consists of iEEG recordings collected from 29 epilepsy patients. The iEEG sensors were surgically implanted in potentially epileptogenic regions in the brain. Patients were 6 implanted with different numbers of sensors, and they all had different SOZs. Ground truth (the true SOZ channels) was established from clinical reports and verified independently through visual inspection of the seizure iEEGs. During data collection, basic preprocessing was performed to remove line-noise and other forms of signal contamination from the data. 2-hour data segment Channel k 3-sec window 3-sec window 3-sec window PIB feature extraction Feature classification Factor graph inference Figure 4: A flow diagram illustrating the SOZ determination process. Analytic scheme: Two-hour between-seizure segments were chosen for each patient to represent a monitoring duration that could be achieved during surgery. The two-hour iEEG recordings were divided into non-overlapping three-second epochs. This epoch length was chosen because it would likely accommodate at least one abnormal neural event that could be associated with the SOZ [6]. Spectral domain features (PIB) were extracted in the 3-second epochs to capture abnormal neural events [6]. Based on the features extracted in a 3-second recording of a channel, a binary value φ (Xn(k)) ∈{0, 1} was assigned to that channel, indicating whether or not an abnormal event was present. Section 6 provides a comparison of supervised and unsupervised techniques used to create this mapping. In the case of supervised techniques, a classification model was trained using the PIB features extracted from an existing corpus of manually annotated abnormal neural events. In the case of unsupervised techniques, channels were clustered into two groups based on the PIB features extracted during an epoch, and the cluster with the larger cluster center (measured as the Euclidean distance from the origin) was labeled as the abnormal cluster. Consequently, the respective epochs of those channels in the abnormal cluster were classified as abnormal neural events. The factor graph model was then used to filter the SOZ-likely events out of all the detected abnormal neural events. A factor graph is generated using the observational, spatial, and temporal factor functions described above specifically for this application. The best combination of states that minimizes the objective function given in Eq. 4, Yn, is found by using the min-cut algorithm. In our approach, we used the Boykov-Kolmogorov algorithm [25] to obtain the optimal partition of the graph. The states Yn here are binary values and represent the presence or absence of SOZ-likely events in the channels. This process is repeated for all the 3-second epochs and the SOZ is deduced at the end using a maximum likelihood (ML) approach (described in the following). This whole process is illustrated in Fig. 4. Maximum likelihood SOZ deduction: We model the occurrences of SOZ-likely events in channel k as independent Bernoulli random variables with probability π(k). Here, π(k) denotes the true bias of the channel’s being in SOZ. We estimate π(k) using a maximum likelihood (ML) approach and use ˆπ(k) to denote the estimate. Each Yn(k) that results from the factor graph inference is treated as an outcome of a Bernoulli trial and the log-likelihood function after N such trials is defined as: log (L(π(k))) = log " N Y n=1 π(k)Yn(k)(1 −π(k))1−Yn(k) # (5) An estimate for π(k) that maximizes the above likelihood function (known as MLE, i.e., maximum likelihood estimate) after N epochs is derived as ˆπ(k) = PN n=1 Yn(k) N . Evaluation: The ML approach generates a likelihood probability for each channel k for being in the SOZ. We compared these probabilities against the ground truth (binary values with 1 meaning 7 that the channel is in the SOZ and 0 otherwise) to generate the area under the ROC curve (AUC), sensitivity, specificity, precision, recall, and F1-score metrics. First, we evaluated a number of techniques for generating a mapping from the extracted PIB features to the presence of abnormal events. We evaluated three unsupervised approaches, namely k-means, spectral, and hierarchical clustering methods and two supervised approaches, namely support vector machine (SVM) and generalized linear model (GLM), for this task. Second, we evaluated the benefits of utilizing the min-cut algorithm for inferring instantaneous states. Here we compared our results using the mincut algorithm against those of two sampling-based techniques [12]: MCMC with random sampling, and MCMC with sampling per prior distribution. Belief-propagation-based methods are not suitable here because our factor graph contains cycles [26]. Third, we compared our results against two recent solutions for interictal SOZ localization, including a summation approach [6] and a clustering approach [22]. In the summation approach, summation of the features of a channel normalized by the maximum feature summation was used as the likelihood of that channel’s being in the SOZ. In the clustering approach, the features of all the channels during the whole 2-hour period were clustered into two classes by a k-means algorithm, and the cluster with the larger cluster mean was chosen as the abnormal cluster. For each channel, the fraction of all its features that were in the abnormal cluster was used as the likelihood of that channel being in the SOZ. Both of these approaches utilize only the observations and lack the additional information of the spatial and temporal correlations. 6 Results & discussion Table 2 lists the results obtained for the experiments explained in Section 5, performed using a dataset containing non-seizure (interictal) iEEG data from 29 epilepsy patients. First, a comparison of supervised and unsupervised techniques for the mapping from PIB features to the presence of abnormal events was performed. The results indicate that using a k-means clustering approach for mapping PIB features to abnormal events is better than any other supervised or unsupervised approach, while other approaches also prove useful. Second, a comparison between sampling-based methods and the min-cut approach was performed for the task of graph inference. Our results indicate that utilizing the min-cut approach to infer instantaneous states is considerably better than a random-sampling-based MCMC approach (with a 10% higher AUC and 14% higher F1-score) and marginally better than an MCMC approach with sampling per a prior distribution (with a 3% higher AUC and a similar F1-score), when used with k-means algorithm for abnormal event classification. However, unlike this approach, our method does not require a prior distribution to sample from. Third, we show that our factor-graph-based model for interictal SOZ localization performs significantly better than either of the traditional approaches (with 5% and 7% higher AUCs) when used with k-means algorithm for abnormal event classification and min-cut algorithm for graph inference. Table 2: Goodness-of-fit metrics obtained for unsupervised and supervised methods for PIB-toabnormal-event mapping (φ); sampling-based approaches for instantaneous state estimation; and conventional approaches utilized for interictal SOZ localization. (“FG/kmeans/min-cut" means that we utilized a factor-graph-based method, with a k-means clustering algorithm for mapping PIB featuers to abnormal neural events and the min-cut algorithm for performing graph inference.) Method AUC Sensitivity Specificity Precision Recall F1-score Evaluation: techniques for PIB to abnormal event mapping (φ) FG/kmeans/min-cut 0.72±0.03 0.74±0.03 0.61±0.02 0.39±0.05 0.74±0.03 0.46±0.04 FG/spectral/min-cut 0.68±0.03 0.60±0.07 0.48±0.05 0.31±0.05 0.60±0.07 0.36±0.05 FG/hierarch/min-cut 0.69±0.03 0.52±0.06 0.51±0.05 0.29±0.05 0.52±0.06 0.34±0.05 FG/svm/min-cut 0.71±0.03 0.68±0.06 0.54±0.05 0.36±0.05 0.68±0.06 0.43±0.05 FG/glm/min-cut 0.69±0.03 0.62±0.07 0.47±0.05 0.31±0.05 0.62±0.08 0.37±0.05 Evaluation: sampling vs. min-cut FG/kmeans/Random 0.62±0.03 0.51±0.08 0.40±0.07 0.35±0.06 0.51±0.08 0.32±0.05 FG/kmeans/Prior 0.69±0.03 0.65±0.04 0.66±0.04 0.40±0.04 0.65±0.04 0.46±0.04 Evaluation: comparison against conventional approaches Summation 0.67±0.04 0.59±0.05 0.67±0.03 0.38±0.05 0.59±0.05 0.43±0.05 Clustering 0.65±0.04 0.49±0.06 0.72±0.04 0.42±0.06 0.49±0.06 0.44±0.05 8 Significance: Overall, the factor-graph-based model with k-means clustering for abnormal event classification and the min-cut algorithm for instantaneous state inference outperforms all other methods for the application of interictal SOZ localization. Utilization of spatial and temporal factor functions improves the localization AUC by 5–7%, relative to pure observation-based approaches (summation and clustering). On the other hand, the runtime complexity of instantaneous state inference is greatly reduced by the min-cut approach. The complexity of a brute-force approach grows exponentially with the number of nodes in the graph, while the min-cut approach has a reasonable runtime complexity of O(|V ||E|2), where |V | is the number of nodes and |E| is the number of edges in the graph. Although sampling-based methods are able to provide approximate solutions with moderate complexity, the min-cut method provided superior performance in our experiments. Future work: Significant domain knowledge is required to come up with manual definitions of graphical models, and in many situations, almost no domain knowledge is available. Hence, the manually defined factor-graphical model and associated factor functions are a potential limitation of our work, as a framework that automatically learns the graphical representation might result in a more generalizable model. Dynamic Bayesian networks [27] may provide a platform that can be used to learn dependencies from the data while allowing the types of dependencies we described. Another potential limitation of our work is the binary-brain-state assumption made while solving the graph energy minimization task. We surmise that extensions of the min-cut algorithm such as the one proposed in [28] are applicable for non-binary cases. In addition, we also believe that optimal weighting of the different factor functions could further improve localization accuracy and provide insights on the contributions of spatial, temporal, and observational relationships to a specific application that involves EEG signal analysis. We plan to investigate those in our future work. 7 Conclusion We described a factor-graph-based model to encode observational, temporal, and spatial dependencies observed in EEG-based brain activity analysis. This model utilizes manually defined factor functions to represent the dependencies, which allowed us to derive a lightweight graph inference technique. This is a significant advancement in the field of electrophysiology because a general and comprehensively validated model that encodes different forms of dependencies in EEG does not exist at present. We validated our model for the application of interictal seizure onset zone (SOZ) and demonstrated the feasibility in a clinical setting. Our results indicate that our approach outperforms two widely used conventional approaches for the application of SOZ localization. In addition, the factor functions and the technology for exactly inferring the states described in this paper can be extended to other applications of factor graphs in fields such as medical diagnoses, social network analysis, and preemptive attack detection. Therefore, we assert that further investigation is necessary to understand the different usecases of this model. Acknowledgements: This work was partly supported by National Science Foundation grants CNS1337732 and CNS-1624790, National Institute of Health grants NINDS-U01-NS073557, NINDSR01-NS92882, NHLBI-HL105355, and NINDS-UH2-NS095495-01, Mayo Clinic and Illinois Alliance Fellowships for Technology-based Healthcare Research and an IBM faculty award. We thank Subho Banerjee, Phuong Cao, Jenny Applequist, and the reviewers for their valuable feedback. References [1] C. P. Warren, S. Hu, M. Stead, B. H. Brinkmann, M. R. Bower, and G. A. Worrell, “Synchrony in normal and focal epileptic brain: The seizure onset zone is functionally disconnected,” Journal of Neurophysiology, vol. 104, no. 6, pp. 3530–3539, 2010. [2] G. A. Worrell, A. B. Gardner, S. M. Stead, S. Hu, S. Goerss, G. J. Cascino, F. B. Meyer, R. Marsh, and B. Litt, “High-frequency oscillations in human temporal lobe: Simultaneous microwire and clinical macroelectrode recordings,” Brain, vol. 131, no. 4, pp. 928–937, 2008. [3] M. Rubinov and O. Sporns, “Complex network measures of brain connectivity: Uses and interpretations,” Neuroimage, vol. 52, no. 3, pp. 1059–1069, 2010. [4] C. Alvarado-Rojas, M. Valderrama, A. Fouad-Ahmed, H. Feldwisch-Drentrup, M. Ihle, C. Teixeira, F. Sales, A. Schulze-Bonhage, C. Adam, A. Dourado, S. Charpier, V. Navarro, and M. Le Van Quyen, “Slow modulations of high-frequency activity (40–140 [emsp14] hz) discriminate preictal changes in human focal epilepsy,” Scientific Reports, vol. 4, 2014. 9 [5] B. J. Frey, F. R. Kschischang, H.-A. Loeliger, and N. Wiberg, “Factor graphs and algorithms,” in Proceedings of the 35th Annual Allerton Conference on Communication Control and Computing. University of Illinois, 1997, pp. 666–680. [6] Y. Varatharajah, B. M. Berry, Z. T. Kalbarczyk, B. H. Brinkmann, G. A. Worrell, and R. K. Iyer, “Interictal seizure onset zone localization using unsupervised clustering and bayesian filtering,” in 8th International IEEE/EMBS Conference on Neural Engineering (NER). IEEE, 2017, pp. 533–539. [7] Y. Varatharajah, R. K. Iyer, B. M. Berry, G. A. Worrell, and B. H. Brinkmann, “Seizure forecasting and the preictal state in canine epilepsy,” International Journal of Neural Systems, vol. 27, p. 1650046, 2017. [8] R. Katznelson, “EEG recording, electrode placement, and aspects of generator localization,” Electric Fields of the Brain, pp. 176–213, 1981. [9] J. D. Martinez-Vargas, G. Strobbe, K. Vonck, P. van Mierlo, and G. Castellanos-Dominguez, “Improved localization of seizure onset zones using spatiotemporal constraints and time-varying source connectivity,” Frontiers in Neuroscience, vol. 11, p. 156, 2017. [10] L. R. Andersen, J. H. Krebs, and J. D. Andersen, “Steno: An expert system for medical diagnosis based on graphical models and model search,” Journal of Applied Statistics, vol. 18, no. 1, pp. 139–153, 1991. [11] P. Cao, E. Badger, Z. Kalbarczyk, R. Iyer, and A. Slagell, “Preemptive intrusion detection: Theoretical framework and real-world measurements,” in Proceedings of the 2015 Symposium and Bootcamp on the Science of Security. ACM, 2015, pp. 21:1–21:2. [12] Y. Zhang, J. Tang, J. Sun, Y. Chen, and J. Rao, “Moodcast: Emotion prediction via dynamic continuous factor graph model,” in 10th International Conference on Data Mining (ICDM), 2010, pp. 1193–1198. [13] J. Liu, C. Zhang, C. McCarty, P. Peissig, E. Burnside, and D. Page, “High-dimensional structured feature screening using binary Markov random fields,” in Artificial Intelligence and Statistics, 2012, pp. 712–721. [14] W. Wiegerinck, “Variational approximations between mean field theory and the junction tree algorithm,” in Proceedings of the 16th conference on Uncertainty in artificial intelligence, 2000, pp. 626–633. [15] J. S. Yedidia, W. T. Freeman, Y. Weiss et al., “Generalized belief propagation,” in Advances in Neural Information Processing Systems, vol. 13, 2000, pp. 689–695. [16] W. R. Gilks, S. Richardson, and D. Spiegelhalter, Markov chain Monte Carlo in practice. CRC Press, 1995. [17] S. Chib and E. Greenberg, “Understanding the Metropolis-Hastings algorithm,” The American Statistician, vol. 49, no. 4, pp. 327–335, 1995. [18] V. Kolmogorov and R. Zabin, “What energy functions can be minimized via graph cuts?” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 26, no. 2, pp. 147–159, 2004. [19] R. G. Andrzejak, D. Chicharro, C. E. Elger, and F. Mormann, “Seizure prediction: Any better than chance?” Clinical Neurophysiology, vol. 120, no. 8, pp. 1465–1478, 2009. [20] R. W. Lee, G. A. Worrell, W. R. Marsh, G. D. Cascino, N. M. Wetjen, F. B. Meyer, E. C. Wirrell, and E. L. So, “Diagnostic outcome of surgical revision of intracranial electrode placements for seizure localization,” Journal of Clinical Neurophysiology, vol. 31, no. 3, pp. 199–202, 2014. [21] N. M. Wetjen, W. R. Marsh, F. B. Meyer, G. D. Cascino, E. So, J. W. Britton, S. M. Stead, and G. A. Worrell, “Intracranial electroencephalography seizure onset patterns and surgical outcomes in nonlesional extratemporal epilepsy,” Journal of Neurosurgery, vol. 110, no. 6, pp. 1147–1152, 2009. [22] S. Liu, Z. Sha, A. Sencer, A. Aydoseli, N. Bebek, A. Abosch, T. Henry, C. Gurses, and N. F. Ince, “Exploring the time–frequency content of high frequency oscillations for automated identification of seizure onset zone in epilepsy,” Journal of Neural Engineering, vol. 13, no. 2, p. 026026, 2016. [23] M. Stead, M. Bower, B. H. Brinkmann, K. Lee, W. R. Marsh, F. B. Meyer, B. Litt, J. Van Gompel, and G. A. Worrell, “Microseizures and the spatiotemporal scales of human partial epilepsy,” Brain, pp. 2789–2797, 2010. [24] G. P. Kalamangalam, L. Cara, N. Tandon, and J. D. Slater, “An interictal eeg spectral metric for temporal lobe epilepsy lateralization,” Epilepsy Research, vol. 108, no. 10, pp. 1748–1757, 2014. [25] Y. Boykov and V. Kolmogorov, “An experimental comparison of min-cut/max-flow algorithms for energy minimization in vision,” IEEE transactions on Pattern Analysis and Machine Intelligence, vol. 26, no. 9, pp. 1124–1137, 2004. [26] Y. Weiss and W. T. Freeman, “On the optimality of solutions of the max-product belief-propagation algorithm in arbitrary graphs,” IEEE Transactions on Information Theory, vol. 47, pp. 736–744, 2001. [27] P. Dagum, A. Galper, and E. Horvitz, “Dynamic network models for forecasting,” in Proceedings of the 8th International Conference on Uncertainty in Artificial Intelligence, 1992, pp. 41–48. [28] A. Delong and Y. Boykov, “Globally optimal segmentation of multi-region objects,” in 2009 12th IEEE International Conference on Computer Vision. IEEE, 2009, pp. 285–292. 10
2017
668
7,194
Natural Value Approximators: Learning when to Trust Past Estimates Zhongwen Xu DeepMind zhongwen@google.com Joseph Modayil DeepMind modayil@google.com Hado van Hasselt DeepMind hado@google.com Andre Barreto DeepMind andrebarreto@google.com David Silver DeepMind davidsilver@google.com Tom Schaul DeepMind schaul@google.com Abstract Neural networks have a smooth initial inductive bias, such that small changes in input do not lead to large changes in output. However, in reinforcement learning domains with sparse rewards, value functions have non-smooth structure with a characteristic asymmetric discontinuity whenever rewards arrive. We propose a mechanism that learns an interpolation between a direct value estimate and a projected value estimate computed from the encountered reward and the previous estimate. This reduces the need to learn about discontinuities, and thus improves the value function approximation. Furthermore, as the interpolation is learned and state-dependent, our method can deal with heterogeneous observability. We demonstrate that this one change leads to significant improvements on multiple Atari games, when applied to the state-of-the-art A3C algorithm. 1 Motivation The central problem of reinforcement learning is value function approximation: how to accurately estimate the total future reward from a given state. Recent successes have used deep neural networks to approximate the value function, resulting in state-of-the-art performance in a variety of challenging domains [9]. Neural networks are most effective when the desired target function is smooth. However, value functions are, by their very nature, discontinuous functions with sharp variations over time. In this paper we introduce a representation of value that matches the natural temporal structure of value functions. A value function represents the expected sum of future discounted rewards. If non-zero rewards occur infrequently but reliably, then an accurate prediction of the cumulative discounted reward rises as such rewarding moments approach and drops immediately after. This is depicted schematically with the dashed black line in Figure 1. The true value function is quite smooth, except immediately after receiving a reward when there is a sharp drop. This is a pervasive scenario because many domains associate positive or negative reinforcements to salient events (like picking up an object, hitting a wall, or reaching a goal position). The problem is that the agent’s observations tend to be smooth in time, so learning an accurate value estimate near those sharp drops puts strain on the function approximator – especially when employing differentiable function approximators such as neural networks that naturally make smooth maps from observations to outputs. To address this problem, we incorporate the temporal structure of cumulative discounted rewards into the value function itself. The main idea is that, by default, the value function can respect the reward sequence. If no reward is observed, then the next value smoothly matches the previous value, but 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. Figure 1: After the same amount of training, our proposed method (red) produces much more accurate estimates of the true value function (dashed black), compared to the baseline (blue). The main plot shows discounted future returns as a function of the step in a sequence of states; the inset plot shows the RMSE when training on this data, as a function of network updates. See section 4 for details. becomes a little larger due to the discount. If a reward is observed, it should be subtracted out from the previous value: in other words a reward that was expected has now been consumed. The natural value approximator (NVA) combines the previous value with the observed rewards and discounts, which makes this sequence of values easy to represent by a smooth function approximator such as a neural network. Natural value approximators may also be helpful in partially observed environments. Consider a situation in which an agent stands on a hill top. The goal is to predict, at each step, how many steps it will take until the agent has crossed a valley to another hill top in the distance. There is fog in the valley, which means that if the agent’s state is a single observation from the valley it will not be able to accurately predict how many steps remain. In contrast, the value estimate from the initial hill top may be much better, because the observation is richer. This case is depicted schematically in Figure 2. Natural value approximators may be effective in these situations, since they represent the current value in terms of previous value estimates. 2 Problem definition We consider the typical scenario studied in reinforcement learning, in which an agent interacts with an environment at discrete time intervals: at each time step t the agent selects an action as a function of the current state, which results in a transition to the next state and a reward. The goal of the agent is to maximize the discounted sum of rewards collected in the long run from a set of initial states [12]. The interaction between the agent and the environment is modelled as a Markov Decision Process (MDP). An MDP is a tuple (S, A, R, γ, P) where S is a state space, A is an action space, R : S ×A×S →D(R) is a reward function that defines a distribution over the reals for each combination of state, action, and subsequent state, P : S × A →D(S) defines a distribution over subsequent states for each state and action, and γt ∈[0, 1] is a scalar, possibly time-dependent, discount factor. One common goal is to make accurate predictions under a behaviour policy π : S →D(A) of the value vπ(s) ≡E [R1 + γ1R2 + γ1γ2R3 + . . . | S0 = s] . (1) The expectation is over the random variables At ∼π(St), St+1 ∼P(St, At), and Rt+1 ∼ R(St, At, St+1), ∀t ∈N+. For instance, the agent can repeatedly use these predictions to improve its policy. The values satisfy the recursive Bellman equation [2] vπ(s) = E [Rt+1 + γt+1vπ(St+1) | St = s] . We consider the common setting where the MDP is not known, and so the predictions must be learned from samples. The predictions made by an approximate value function v(s; θ), where θ are parameters that are learned. The approximation of the true value function can be formed by temporal 2 difference (TD) learning [10], where the estimate at time t is updated towards Z1 t ≡Rt+1 + γt+1v(St+1; θ) or Zn t ≡ n X i=1 (Πi−1 k=1γt+k)Rt+i + (Πn k=1γt+k)v(St+n; θ) ,(2) where Zn t is the n-step bootstrap target, and the TD-error is δn t ≡Zn t −v(St; θ). 3 Proposed solution: Natural value approximators The conventional approach to value function approximation produces a value estimate from features associated with the current state. In states where the value approximation is poor, it can be better to rely more on a combination of the observed sequence of rewards and older but more reliable value estimates that are projected forward in time. Combining these estimates can potentially be more accurate than using one alone. These ideas lead to an algorithm that produces three estimates of the value at time t. The first estimate, Vt ≡v(St; θ), is a conventional value function estimate at time t. The second estimate, Gp t ≡Gβ t−1 −Rt γt if γt > 0 and t > 0 , (3) is a projected value estimate computed from the previous value estimate, the observed reward, and the observed discount for time t. The third estimate, Gβ t ≡βtGp t + (1 −βt)Vt = (1 −βt)Vt + βt Gβ t−1 −Rt γt , (4) is a convex combination of the first two estimates1 formed by a time-dependent blending coefficient βt. This coefficient is a learned function of state β(·; θ) : S →[0, 1], over the same parameters θ, and we denote βt ≡β(St; θ). We call Gβ t the natural value estimate at time t and we call the overall approach natural value approximators (NVA). Ideally, the natural value estimate will become more accurate than either of its constituents from training. The value is learned by minimizing the sum of two losses. The first loss captures the difference between the conventional value estimate Vt and the target Zt, weighted by how much it is used in the natural value estimate, JV ≡E  [[1 −βt]]([[Zt]] −Vt)2 , (5) where we introduce the stop-gradient identity function [[x]] = x that is defined to have a zero gradient everywhere, that is, gradients are not back-propagated through this function. The second loss captures the difference between the natural value estimate and the target, but it provides gradients only through the coefficient βt, Jβ ≡E  ([[Zt]] −(βt [[Gp t ]] + (1 −βt)[[Vt]]))2 . (6) These two losses are summed into a joint loss, J = JV + cβJβ, (7) where cβ is a scalar trade-off parameter. When conventional stochastic gradient descent is applied to minimize this loss, the parameters of Vt are adapted with the first loss and parameters of βt are adapted with the second loss. When bootstrapping on future values, the most accurate value estimate is best, so using Gβ t instead of Vt leads to refined prediction targets Zβ,1 t ≡Rt+1 + γt+1Gβ t+1 or Zβ,n t ≡ n X i=1 (Πi−1 k=1γt+k)Rt+i + (Πn k=1γt+k)Gβ t+n . (8) 4 Illustrative Examples We now provide some examples of situations where natural value approximations are useful. In both examples, the value function is difficult to estimate well uniformly in all states we might care about, and the accuracy can be improved by using the natural value estimate Gβ t instead of the direct value estimate Vt. 1Note the mixed recursion in the definition, Gp depends on Gβ, and vice-versa. 3 Sparse rewards Figure 1 shows an example of value function approximation. To separate concerns, this is a supervised learning setup (regression) with the true value targets provided (dashed black line). Each point 0 ≤t ≤100 on the horizontal axis corresponds to one state St in a single sequence. The shape of the target values stems from a handful of reward events, and discounting with γ = 0.9. We mimic observations that smoothly vary across time by 4 equally spaced radial basis functions, so St ∈R4. The approximators v(s) and β(s) are two small neural networks with one hidden layer of 32 ReLU units each, and a single linear or sigmoid output unit, respectively. The input to β is augmented with the last k = 16 rewards. For the baseline experiment, we fix βt = 0. The networks are trained for 5000 steps using Adam [5] with minibatch size 32. Because of the small capacity of the v-network, the baseline struggles to make accurate predictions and instead it makes systematic errors that smooth over the characteristic peaks and drops in the value function. The natural value estimation obtains ten times lower root mean squared error (RMSE), and it also closely matches the qualitative shape of the target function. Heterogeneous observability Our approach is not limited to the sparse-reward setting. Imagine an agent that stands on the top of a hill. By looking in the distance, the agent may be able to predict how many steps should be taken to take it to the next hill top. When the agent starts descending the hill, it walks into fog in the valley between the hills. There, it can no longer see where it is. However, it could still determine how many steps until the next hill by using the estimate from the first hill and then simply counting steps. This is exactly what the natural value estimate Gβ t will give us, assuming βt = 1 on all steps in the fog. Figure 2 illustrates this example, where we assumed each step has a reward of −1 and the discount is one. The best observation-dependent value v(St) is shown in dashed blue. In the fog, the agent can then do no better than to estimate the average number of steps from a foggy state until the next hill top. In contrast, the true value, shown in red, can be achieved exactly with natural value estimates. Note that in contrast to Figure 1, rewards are dense rather than sparse. In both examples, we can sometimes trust past value functions more than current estimations, either because of function approximation error, as in the first example, or partial observability. 0 50 100 step 100 50 0 value fog Figure 2: The value is the negative number of steps until reaching the destination at t = 100. In some parts of the state space, all states are aliased (in the fog). For these aliased states, the best estimate based only on immediate observations is a constant value (dashed blue line). Instead, if the agent relies on the value just before the fog and then decrements it by encountered rewards, while ignoring observations, then the agent can match the true value (solid red line). 5 Deep RL experiments In this section, we integrate our method within A3C (Asynchronous advantage actor-critic [9]), a widely used deep RL agent architecture that uses a shared deep neural network to both estimate the policy π (actor) and a baseline value estimate v (critic). We modify it to use Gβ t estimates instead of the regular value baseline Vt. In the simplest, feed-forward variant, the network architecture is composed of three layers of convolutions, followed by a fully connected layer with output h, which feeds into the two separate heads (π with an additional softmax, and a scalar v, see the black components in the diagram below). The updates are done online with a buffer of the past 20-state transitions. The value targets are n-step targets Zn t (equation 2) where each n is chosen such that it bootstraps on the state at the end of the 20-state buffer. In addition, there is a loss contribution from the actor’s policy gradient update on π. We refer the reader to [9] for details. 4 Table 1: Mean and median human-normalized scores on 57 Atari games, for the A3C baselines and our method, using both evaluation metrics. N75 indicates the number of games that achieve at least 75% human performance. human starts no-op starts Agent N75 median mean N75 median mean A3C baseline 28/57 68.5% 310.4% 31/57 91.6% 334.0% A3C + NVA 30/57 93.5% 373.3% 32/57 117.0% 408.4% π v β h Gβt Rt-k:t Rt γt St Gβt-1 Our method differs from the baseline A3C setup in the form of the value estimator in the critic (Gβ t instead of Vt), the bootstrap targets (Zβ,n t instead of Zn t ) and the value loss (J instead of JV ) as discussed in section 3. The diagram on the right shows those new components in green; thick arrows denote functions with learnable parameters, thin ones without. In terms of the network architecture, we parametrize the blending coefficient β as a linear function of the hidden representation h concatenated with a window of past rewards Rt−k:t followed by a sigmoid: β(St; θ) ≡ γt 1 + exp  θ⊤ β [h(St); Rt−k:t] , (9) where θβ are the parameters of the β head of the network, and we set k to 50. The extra factor of γt handles the otherwise undefined beginnings of episode (when γ0 = 0), and it ensures that the time-scale across which estimates can be projected forward cannot exceed the time-scale induced by the discounting2. We investigate the performance of natural value estimates on a collection of 57 video games games from the Atari Learning Environment [1], which has become a standard benchmark for Deep RL methods because of the rich diversity of challenges present in the various games. We train agents for 80 Million agent steps (320 Million Atari game frames) on a single machine with 16 cores, which corresponds to the number of frames denoted as ‘1 day on CPU’ in the original A3C paper. All agents are run with one seed and a single, fixed set of hyper-parameters. Following [8], the performance of the final policy is evaluated under two modes, with a random number of no-ops at the start of each episode, and from randomized starting points taken from human trajectories. 5.1 Results Table 1 summarizes the aggregate performance results across all 57 games, normalized by human performance. The evaluation results are presented under two different conditions, the human starts condition evaluates generalization to a different starting state distribution than the one used in training, and the no-op starts condition evaluates performance on the same starting state distribution that was used in training. We summarize normalized performance improvements in Figure 3. In the appendix, we provide full results for each game in Table 2 and Table 3. Across the board, we find that adding NVA improves the performance on a number of games, and improves the median normalized score by 25% or 25.4% for the respective evaluation metrics. The second measure of interest is the change in value error when using natural value estimates; this is shown in Figure 4. The summary across all games is that the the natural value estimates are more accurate, sometimes substantially so. Figure 4 also shows detailed plots from a few representative games, showing that large accuracy gaps between Vt and Gβ lead to the learning of larger blending proportions β. The fact that more accurate value estimates improve final performance on only some games should not be surprising, as they only directly affect the critic and they affect the actor indirectly. It is also 2This design choice may not be ideal in all circumstances, sometimes projecting old estimates further can perform better—our variant however has the useful side-effect that the weight for the Vt update (Equation 5) is now greater than zero independently of β. This prevents one type of vicious cycle, where an initially inaccurate Vt leads to a large β, which in turn reduces the learning of Vt, and leads to an unrecoverable situation. 5 -12% assault -12% ms_pacman -10% chopper_command -8% tutankham -5% battle_zone -5% centipede -4% ice_hockey -3% star_gunner -2% alien -1% boxing -1% gravitar -0% bank_heist -0% pong -0% pitfall -0% solaris -0% beam_rider -0% montezuma_revenge enduro 0% freeway 0% venture 0% private_eye 0% seaquest 0% frostbite 1% skiing 1% bowling 1% yars_revenge 1% robotank 1% double_dunk 1% riverraid 2% kung_fu_master 2% fishing_derby 2% kangaroo 2% zaxxon 3% road_runner 4% jamesbond 4% surround 5% gopher 5% amidar 7% hero 8% krull 9% defender 9% qbert 10% crazy_climber 11% time_pilot 11% wizard_of_wor 18% asterix 20% phoenix 24% tennis 25% atlantis 25% demon_attack 25% name_this_game 25% breakout 31% berzerk 36% up_n_down 38% asteroids 50% space_invaders 70% video_pinball 453% Figure 3: The performance gains of the proposed architecture over the baseline system, with the performance normalized for each game with the formula proposed−baseline max(human,baseline)−random used previously in the literature [15]. unclear for how many games the bottleneck is value accuracy instead of exploration, memory, local optima, or sample efficiency. 6 Variants We explored a number of related variants on the subset of tuning games, with mostly negative results, and report our findings here, with the aim of adding some additional insight into what makes NVA work—and to prevent follow-up efforts from blindly repeating our mistakes. β-capacity We experimented with adding additional capacity to the β-network in Equation 9, namely inserting a hidden ReLU layer with nh ∈{16, 32, 64}; this neither helped nor hurt performance, so opted for the simplest architecture (no hidden layer). We hypothesize that learning a binary gate is much easier than learning the value estimate, so no additional capacity is required. Weighted v-updates We also validated the design choice of weighting the update to v by its usage (1 −β) (see Equation 5). On the 6 tuning games, weighting by usage obtains slightly higher performance than an unweighted loss on v. One hypothesis is that the weighting permits the direct estimates to be more accurate in some states than in others, freeing up function approximation capacity for where it is most needed. Semantic versus aggregate losses Our proposed method separates the semantically different updates on β and v, but of course a simpler alternative would be to directly regress the natural value estimate Gβ t toward its target, and back-propagate the aggregate loss into both β and v jointly. This alternative performs substantially worse, empirically. We hypothesize one reason for this: in a state where Gp t structurally over-estimates the target value, an aggregate loss will encourage v to compensate by under-estimating it. In contrast, the semantic losses encourage v to simply be more accurate and then reduce β. Training by back-propagation through time The recursive form of Equation 4 lends itself to an implementation as a specific form of recurrent neural network, where the recurrent connection transmits a single scalar Gβ t . In this form, the system can be trained by back-propagation through time (BPTT [17]). This is semantically subtly different from our proposed method, as the gates β no longer make a local choice between Vt and Gp t , but instead the entire sequence of βt−k to βt is 6 0% -25% -50% Relative change in value loss centipede enduro venture seaquest atlantis surround pong up_n_down jamesbond time_pilot hero beam_rider bank_heist asterix frostbite tennis demon_attack space_invaders wizard_of_wor defender name_this_game breakout battle_zone fishing_derby freeway amidar qbert road_runner riverraid zaxxon crazy_climber robotank double_dunk alien asteroids solaris tutankham assault video_pinball berzerk phoenix kung_fu_master yars_revenge krull ice_hockey montezuma_revenge gopher star_gunner ms_pacman gravitar chopper_command private_eye bowling boxing skiing pitfall kangaroo 0 20 40 60 80 100 average squared TD error error on v error on G β 0 10 20 30 40 50 60 70 80 average squared TD error error on v error on G β 0 1000 2000 3000 4000 5000 6000 average squared TD error error on v error on G β 0 10 20 30 40 average squared TD error error on v error on G β 0.0 0.5 1.0 average β seaquest 0.0 0.5 1.0 average β time_pilot 0.0 0.5 1.0 average β up_n_down 0.0 0.5 1.0 average β surround Figure 4: Reduction in value estimation error compared to the baseline. The proxies we use are average squared TD-errors encountered during training, comparing ϵv = 1 2(Zt −v(St; θ))2 and ϵβ = 1 2(Zt −Gβ t )2. Top: Summary graph for all games, showing relative change in error (ϵβ −ϵv)/ϵv, averaged over the full training run. As expected, the natural value estimate consistently has equal or lower error, validating our core hypothesis. Bottom: Detailed plots on a handful of games. It shows the direct estimate error ϵv (blue) and natural value estimate error ϵβ (red). In addition, the blending proportion β (cyan) adapts over time to use more of the prospective value estimate if that is more accurate. trained to provide the best estimate Gβ t at time t (where k is the truncation horizon of BPTT). We experimented with this variant as well: it led to a clear improvement over the baseline as well, but its performance was substantially below the simpler feed-forward setup with reward buffer in Equation 9 (median normalized scores of 78% and 103% for the human and no-op starts respectively). 7 Discussion Relation to eligibility traces In TD(λ) [11], a well-known and successful variant of TD, the value function (1) is not learned by a one-step update, but instead relies on multiple value estimates from further in the future. Concretely, the target for the update of the estimate Vt is then Gλ t , which can be defined recursively by Gλ t = Rt+1 + γt+1(1 −λ)Vt+1 + γt+1λGλ t+1, or as a mixture of several n-step targets [12]. The trace parameter λ is similar to our β parameter, but faces backwards in time rather than forwards. A quantity very similar to Gβ t was discussed by van Hasselt and Sutton [13], where this quantity was then used to update values prior to time t. The inspiration was similar, in the sense that it was acknowledged that Gβ t may be a more accurate target to use than either the Monte Carlo return or any single estimated state value. The use of Gβ t itself for online predictions, apart from using it as a target to update towards, was not yet investigated. Extension to action-values There is no obstacle to extend our approach to estimators of actionvalues q(St, At, θ). One generalization from TD to SARSA is almost trivial. The quantity Gβ t then has the semantics of the value of action At in state St. It is also possible to consider off-policy learning. Consider the Bellman optimality equation Q∗(s, a) = E [Rt+1 + γt+1 maxa′ Q∗(St+1, a′)]. This implies that for the optimal value function Q∗, E h max a Q∗(St, a) i = E Q∗(St−1, At−1) −Rt γt  . 7 This implies that we may be able to use the quantity (Q(St−1, At−1) −Rt)/γt as an estimate for the greedy value maxa Q(St, a). For instance, we could blend the value as in SARSA, and define Gβ t = (1 −βt)Q(St, At) + βt Gβ t−1 −Rt γt . Perhaps we could require βt = 0 whenever At ̸= arg maxa Q(St, a), in a similar vein as Watkins’ Q(λ) [16] that zeros the eligibility trace for non-greedy actions. We leave this and other potential variants for more detailed consideration in future work. Memory NVA adds a small amount of memory to the system (a single scalar), which raises the question of whether other forms of memory, such as the LSTM [4], provide a similar benefit. We do not have a conclusive answer, but the existing empirical evidence indicates that the benefit of natural value estimation goes beyond just memory. This can be seen by comparing to the A3C+LSTM baseline (also proposed in [9]), which has vastly larger memory and number of parameters, yet did not achieve equivalent performance (median normalized scores of 81% for the human starts). To some extent this may be caused by the fact that recurrent neural networks are more difficult to optimize. Regularity and structure Results from the supervised learning literature indicate that computing a reasonable approximation of a given target function is feasible when the learning algorithm exploits some kind of regularity in the latter [3]. For example, one may assume that the target function is bounded, smooth, or lies in a low-dimensional manifold. These assumptions are usually materialised in the choice of approximator. Making structural assumptions about the function to approximate is both a blessing and a curse. While a structural assumption makes it possible to compute an approximation with a reasonable amount of data, or using a smaller number of parameters, it can also compromise the quality of the solution from the outset. We believe that while our method may not be the ideal structural assumption for the problem of approximating value functions, it is at least better than the smooth default. Online learning By construction, the natural value estimates are an online quantity, that can only be computed from a trajectory. This means that the extension to experience replay [6] is not immediately obvious. It may be possible to replay trajectories, rather than individual transitions, or perhaps it suffices to use stale value estimates at previous states, which might still be of better quality than the current value estimate at the sampled state. We leave a full investigation of the combination of these methods to future work. Predictions as state In our proposed method the value is estimated in part as a function of a single past prediction, and this has some similarity to past work in predictive state representations [7]. Predictive state representations are quite different in practice: their state consists of only predictions, the predictions are of future observations and actions (not rewards), and their objective is to provide a sufficient representation of the full environmental dynamics. The similarities are not too strong with the work proposed here, as we use a single prediction of the actual value, this prediction is used as a small but important part of the state, and the objective is to estimate only the value function. 8 Conclusion This paper argues that there is one specific structural regularity that underlies the value function of many reinforcement learning problems, which arises from the temporal nature of the problem. We proposed natural value approximation, a method that learns how to combine a direct value estimate with ones projected from past estimates. It is effective and simple to implement, which we demonstrated by augmenting the value critic in A3C, and which significantly improved median performance across 57 Atari games. Acknowledgements The authors would like to thank Volodymyr Mnih for his suggestions and comments on the early version of the paper, the anonymous reviewers for constructive suggestions to improve the paper. The authors also thank the DeepMind team for setting up the environments and building helpful tools used in the paper. 8 References [1] Marc G Bellemare, Yavar Naddaf, Joel Veness, and Michael Bowling. The arcade learning environment: An evaluation platform for general agents. Journal of Artificial Intelligence Research, 47:253–279, 2013. [2] Richard Bellman. A Markovian decision process. Technical report, DTIC Document, 1957. [3] László Györfi. A Distribution-Free Theory of Nonparametric Regression. Springer Science & Business Media, 2002. [4] Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8): 1735–1780, 1997. [5] Diederik Kingma and Jimmy Ba. ADAM: A method for stochastic optimization. In ICLR, 2014. [6] Long-Ji Lin. Self-improving reactive agents based on reinforcement learning, planning and teaching. Machine learning, 8(3-4):293–321, 1992. [7] Michael L Littman, Richard S Sutton, and Satinder Singh. Predictive representations of state. In NIPS, pages 1555–1562, 2002. [8] Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G Bellemare, Alex Graves, Martin Riedmiller, Andreas K Fidjeland, Georg Ostrovski, Stig Petersen, Charles Beattie, Amir Sadik, Ioannis Antonoglou, Helen King, Dharshan Kumaran, Daan Wierstra, Shane Legg, and Demis Hassabis. Human-level control through deep reinforcement learning. Nature, 518(7540):529–533, 2015. [9] Volodymyr Mnih, Adria Puigdomenech Badia, Mehdi Mirza, Alex Graves, Timothy Lillicrap, Tim Harley, David Silver, and Koray Kavukcuoglu. Asynchronous methods for deep reinforcement learning. In ICML, pages 1928–1937, 2016. [10] Richard S Sutton. Temporal credit assignment in reinforcement learning. PhD thesis, University of Massachusetts Amherst, 1984. [11] Richard S Sutton. Learning to predict by the methods of temporal differences. Machine learning, 3(1):9–44, 1988. [12] Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction, volume 1. 1998. [13] Hado van Hasselt and Richard S. Sutton. Learning to predict independent of span. CoRR, abs/1508.04582, 2015. [14] Hado van Hasselt, Arthur Guez, and David Silver. Deep reinforcement learning with double Q-learning. In AAAI, pages 2094–2100, 2016. [15] Ziyu Wang, Tom Schaul, Matteo Hessel, Hado van Hasselt, Marc Lanctot, and Nando de Freitas. Dueling network architectures for deep reinforcement learning. In ICML, pages 1995–2003, 2016. [16] Christopher John Cornish Hellaby Watkins. Learning from delayed rewards. PhD thesis, University of Cambridge England, 1989. [17] Paul J Werbos. Backpropagation through time: what it does and how to do it. Proceedings of the IEEE, 78(10):1550–1560, 1990. 9
2017
669
7,195
Expectation Propagation for t-Exponential Family Using q-Algebra Futoshi Futami The University of Tokyo, RIKEN futami@ms.k.u-tokyo.ac.jp Issei Sato The University of Tokyo, RIKEN sato@k.u-tokyo.ac.jp Masashi Sugiyama RIKEN, The University of Tokyo sugi@k.u-tokyo.ac.jp Abstract Exponential family distributions are highly useful in machine learning since their calculation can be performed efficiently through natural parameters. The exponential family has recently been extended to the t-exponential family, which contains Student-t distributions as family members and thus allows us to handle noisy data well. However, since the t-exponential family is defined by the deformed exponential, an efficient learning algorithm for the t-exponential family such as expectation propagation (EP) cannot be derived in the same way as the ordinary exponential family. In this paper, we borrow the mathematical tools of q-algebra from statistical physics and show that the pseudo additivity of distributions allows us to perform calculation of t-exponential family distributions through natural parameters. We then develop an expectation propagation (EP) algorithm for the t-exponential family, which provides a deterministic approximation to the posterior or predictive distribution with simple moment matching. We finally apply the proposed EP algorithm to the Bayes point machine and Student-t process classification, and demonstrate their performance numerically. 1 Introduction Exponential family distributions play an important role in machine learning, due to the fact that their calculation can be performed efficiently and analytically through natural parameters or expected sufficient statistics [1]. This property is particularly useful in the Bayesian framework since a conjugate prior always exists for an exponential family likelihood and the prior and posterior are often in the same exponential family. Moreover, parameters of the posterior distribution can be evaluated only through natural parameters. As exponential family members, Gaussian distributions are most commonly used because their moments, conditional distribution, and joint distribution can be computed analytically. Gaussian processes are a typical Bayesian method based on Gaussian distributions, which are used for various purposes such as regression, classification, and optimization [8]. However, Gaussian distributions are sensitive to outliers and heavier-tailed distributions are often more preferred in practice. For example, Student-t distributions and Student-t processes are good alternatives to Gaussian distributions [4] and Gaussian processes [10], respectively. A technical problem of the Student-t distribution is that it does not belong to the exponential family unlike the Gaussian distribution and thus cannot enjoy good properties of the exponential family. To cope with this problem, the exponential family was recently generalized to the t-exponential family [3], 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. which contains Student-t distributions as family members. Following this line, the Kullback-Leibler divergence was generalized to the t-divergence, and approximation methods based on t-divergence minimization have been explored [2]. However, the t-exponential family does not allow us to employ standard useful mathematical tricks, e.g., logarithmic transformation does not reduce the product of texponential family functions into summation. For this reason, the t-exponential family unfortunately does not inherit an important property of the original exponential family, that is, calculation can be performed through natural parameters. Furthermore, while the dimensionality of sufficient statistics is the same as that of the natural parameters in the exponential family and thus there is no need to increase the parameter size to incorporate new information [9], this useful property does not hold in the t-exponential family. The purpose of this paper is to further explore mathematical properties of natural parameters of the t-exponential family through pseudo additivity of distributions based on q-algebra used in statistical physics [7, 11]. More specifically, our contributions in this paper are three-fold: 1. We show that, in the same way as ordinary exponential family distributions, q-algebra allows us to handle the calculation of t-exponential family distributions through natural parameters. 2. Our q-algebra based method enables us to extend assumed density filtering (ADF) [2] and develop an algorithm of expectation propagation (EP) [6] for the t-exponential family. In the same way as the original EP algorithm for ordinary exponential family distributions, our EP algorithm provides a deterministic approximation to the posterior or predictive distribution for t-exponential family distributions with simple moment matching. 3. We apply the proposed EP algorithm to the Bayes point machine [6] and Student-t process classification, and we demonstrate their usefulness as alternatives to the Gaussian approaches numerically. 2 t-exponential Family In this section, we review the t-exponential family [3, 2], which is a generalization of the exponential family. The t-exponential family is defined as, p(x; θ) = expt(⟨Φ(x), θ⟩−gt(θ)), (1) where expt(x) is the deformed exponential function defined as expt(x) = { exp(x) if t = 1, [1 + (1 −t)x] 1 1−t otherwise, (2) and gt(θ) is the log-partition function that satisfies ∇θgt(θ) = Epes[Φ(x)]. (3) The notation Epes denotes the expectation over pes(x), where pes(x) is the escort distribution of p(x) defined as pes(x) = p(x)t ∫ p(x)tdx. (4) We call θ a natural parameter and Φ(x) sufficient statistics. Let us express the k-dimensional Student-t distribution with v degrees of freedom as St(x; v, µ, Σ) = Γ((v + k)/2) (πv)k/2Γ(v/2)|Σ|1/2 ( 1 + (x −µ)⊤(vΣ)−1(x −µ) )−v+k 2 , (5) where Γ(x) is the gamma function, |A| is the determinant of matrix A, and A⊤is the transpose of matrix A. We can confirm that the Student-t distribution is a member of the t-exponential family as follows. First, we have St(x; v, µ, Σ) = ( Ψ + Ψ · (x −µ)⊤(vΣ)−1(x −µ) ) 1 1−t , (6) where Ψ = ( Γ((v + k)/2) (πv)k/2Γ(v/2)|Σ|1/2 )1−t . (7) 2 Note that relation −(v + k)/2 = 1/(1 −t) holds, from which we have ⟨Φ(x), θ⟩= ( Ψ 1 −t ) (x⊤Kx −2µ⊤Kx), (8) gt(θ) = − ( Ψ 1 −t ) (µ⊤Kµ + 1) + 1 1 −t, (9) where K = (vΣ)−1. Then, we can express the Student-t distribution as a member of the t-exponential family as: St(x; v, µ, Σ) = ( 1 + (1 −t)⟨Φ(x), θ⟩−gt(θ) ) 1 1−t = expt ( ⟨Φ(x), θ⟩−gt(θ) ) . (10) If t = 1, the deformed exponential function is reduced to the ordinary exponential function, and therefore the t-exponential family is reduced to the ordinary exponential family, which corresponds to the Student-t distribution with infinite degrees of freedom. For t-exponential family distributions, the t-divergence is defined as follows [2]: Dt(p∥ep) = ∫( pes(x) lnt p(x) −pes(x) lnt ep(x) ) dx, (11) where lnt x := x1−t−1 1−t (x ≥0, t ∈R+) and pes(x) is the escort function of p(x). 3 Assumed Density Filtering and Expectation Propagation We briefly review the assumed density filtering (ADF) and expectation propagation (EP) [6]. Let D = {(x1, y1), . . . , (xi, yi)} be input-output paired data. We denote the likelihood for the i-th data as li(w) and the prior distribution of parameter w as p0(w). The total likelihood is given as ∏ i li(w) and the posterior distribution can be expressed as p(w|D) ∝p0(w) ∏ i li(w). 3.1 Assumed Density Filtering ADF is an online approximation method for the posterior distribution. Suppose that i −1 samples (x1, y1), . . . , (xi−1, yi−1) have already been processed and an approximation to the posterior distribution, epi−1(w), has already been obtained. Given the i-th sample (xi, yi), the posterior distribution pi(w) can be obtained as pi(w) ∝epi−1(w)li(w). (12) Since the true posterior distribution pi(w) cannot be obtained analytically, it is approximated in ADF by minimizing the Kullback-Leibler (KL) divergence from pi(w) to its approximation: epi = arg min ep KL(pi∥ep). (13) Note that if pi and ep are both exponential family members, the above calculation is reduced to moment matching. 3.2 Expectation Propagation Although ADF is an effective method for online learning, it is not favorable for non-online situations, because the approximation quality depends heavily on the permutation of data [6]. To overcome this problem, EP was proposed [6]. In EP, an approximation of the posterior that contains whole data terms is prepared beforehand, typically as a product of data-corresponding terms: ep(w) = 1 Z ∏ i eli(w), (14) 3 where Z is the normalizing constant. In the above expression, factor eli(w), which is often called a site approximation [9], corresponds to the local likelihood li(w). If each eli(w) is an exponential family member, the total approximation also belongs to the exponential family. Differently from ADF, EP has these site approximation with the following four steps, which is iteratively updated. First, when we update site elj(w), we eliminate the effect of site j from the total approximation as ep\j(w) = ep(w) elj(w) , (15) where ep\j(w) is often called a cavity distribution [9]. If an exponential family distribution is used, the above calculation is reduced to subtraction of natural parameters. Second, we incorporate likelihood lj(w) by minimizing the divergence KL(ep\j(w)lj(w)/Z\j∥ep(w)), where Z\j is the normalizing constant. Note that this minimization is reduced to moment matching for the exponential family. After this step, we obtain ep(w). Third, we exclude the effect of terms other than j, which is equivalent to calculating a cavity distribution as elj(w)new ∝ ep(w) ep\j(w). Finally, we update the site approximation by replacing elj(w) by elj(w)new. Note again that calculation of EP is reduced to addition or subtraction of natural parameters for the exponential family. 3.3 ADF for t-exponential Family ADF for the t-exponential family was proposed in [2], which uses the t-divergence instead of the KL divergence: ep = arg min p′ Dt(p∥p′) = ∫( pes(x) lnt p(x) −pes(x) lnt p′(x; θ) ) dx. (16) When an approximate distribution is chosen from the t-exponential family, we can utilize the property ∇θgt(θ) = E f pes(Φ(x)), where f pes is the escort function of ep(x). Then, minimization of the t-divergence yields Epes[Φ(x)] = E f pes[Φ(x)]. (17) This is moment matching, which is a celebrated property of the exponential family. Since the expectation is taken with respect to the escort function, this is called escort moment matching. As an example, let us consider the situation where the prior is the Student-t distribution and the posterior is approximated by the Student-t distribution: p(w|D) ∼= ep(w) = St(w; eµ, eΣ, v). Then the approximated posterior epi(w) = St(w; eµ(i), eΣi, v) can be obtained by minimizing the t-divergence from pi(w) ∝epi−1(w)eli(w) as arg min µ′,Σ′ Dt(pi(w)∥St(w; µ′, Σ′, v)). (18) This allows us to obtain an analytical update expression for t-exponential family distributions. 4 Expectation Propagation for t-exponential Family As shown in the previous section, ADF has been extended to EP (which resulted in moment matching for the exponential family) and to the t-exponential family (which yielded escort moment matching for the t-exponential family). In this section, we combine these two extensions and propose EP for the t-exponential family. 4.1 Pseudo Additivity and q-Algebra Differently from ordinary exponential functions, deformed exponential functions do not satisfy the product rule: expt(x) expt(y) ̸= expt(x + y). (19) 4 For this reason, the cavity distribution cannot be computed analytically for the t-exponential family. On the other hand, the following equality holds for the deformed exponential functions: expt(x) expt(y) = expt(x + y + (1 −t)xy), (20) which is called pseudo additivity. In statistical physics [7, 11], a special algebra called q-algebra has been developed to handle a system with pseudo additivity. We will use the q-algebra for efficiently handling t-exponential distributions. Definition 1 (q-product) Operation ⊗q called the q-product is defined as x ⊗q y := { [x1−q + y1−q −1] 1 1−q if x > 0, y > 0, x1−q + y1−q −1 > 0, 0 otherwise. (21) Definition 2 (q-division) Operation ⊘q called the q-division is defined as x ⊘q y := { [x1−q −y1−q −1] 1 1−q if x > 0, y > 0, x1−q −y1−q −1 > 0, 0 otherwise. (22) Definition 3 (q-logarithm) The q-logarithm is defined as lnq x := x1−q −1 1 −q (x ≥0, q ∈R+). (23) The q-division is the inverse of the q-product (and visa versa), and the q-logarithm is the inverse of the q-exponential (and visa versa). From the above definitions, the q-logarithm and q-exponential satisfy the following relations: lnq(x ⊗q y) = lnq x + lnq y, (24) expq(x) ⊗q expq(y) = expq(x + y), (25) which are called the q-product rules. Also for the q-division, similar properties hold: lnq(x ⊘q y) = lnq x −lnq y, (26) expq(x) ⊘q expq(y) = expq(x −y), (27) which are called the q-division rules. 4.2 EP for t-exponential Family The q-algebra allows us to recover many useful properties from the ordinary exponential family. For example, the q-product of t-exponential family distributions yields an unnormalized t-exponential distribution: expt(⟨Φ(x), θ1⟩−gt(θ1))⊗t expt(⟨Φ(x), θ2⟩−gt(θ2)) = expt(⟨Φ(x), (θ1 + θ2)⟩−egt(θ1, θ2)). (28) Based on this q-product rule, we develop EP for the t-exponential family. Consider the situation where prior distribution p(0)(w) is a member of the t-exponential family. As an approximation to the posterior, we choose a t-exponential family distribution ep(w; θ) = expt(⟨Φ(w), θ⟩−gt(θ)). (29) In the original EP for the ordinary exponential family, we considered an approximate posterior of the form ep(w) ∝p(0)(w) ∏ i eli(w), (30) that is, we factorized the posterior to a product of site approximations corresponding to data. On the other hand, in the case of the t-exponential family, we propose to use the following form called the t-factorization: ep(w) ∝p(0)(w) ⊗t ∏ i ⊗teli(w). (31) 5 The t-factorization is reduced to the original factorization form when t = 1. This t-factorization enables us to calculate EP update rules through natural parameters for the texponential family in the same way as the ordinary exponential family. More specifically, consider the case where factor j of the t-factorization is updated in four steps in the same way as original EP. (I) First, we calculate the cavity distribution by using the q-division as ep\j(w) ∝ep(w) ⊘t elj(w) ∝p(0)(w) ⊗t ∏ i̸=j ⊗teli(w). (32) The above calculation is reduced to subtraction of natural parameters by using the q-algebra rules: θ\j = θ −θ(j). (33) (II) The second step is inclusion of site likelihood lj(w), which can be performed by ep\j(w)lj(w). The site likelihood lj(w) is incorporated to approximate the posterior by the ordinary product not the q-product. Thus moment matching is performed to obtain a new approximation. For this purpose, the following theorem is useful. Theorem 1 The expected sufficient statistic, η = ∇θgt(θ) = E f pes[Φ(w)], (34) can be derived as η = η\j + 1 Z2 ∇θ\jZ1, (35) where Z1 = ∫ ep\j(w)(lj(w))tdw, Z2 = ∫ f pes\j(w)(lj(w))tdw. (36) A proof of Theorem 1 is given in Appendix A of the supplementary material. After moment matching, we obtain an approximation, epnew(w). (III) Third, we exclude the effect of sites other than j. This is achieved by elnew j (w) ∝epnew(w) ⊘t ep\j(w), (37) which is reduced to subtraction of natural parameter θ\j new = θnew −θ\j. (38) (IV) Finally, we update the site approximation by replacing elj(w) with elj(w)new. These four steps are our proposed EP method for the t-exponential family. As we have seen, these steps are reduced to the ordinary EP steps if t = 1. Thus, the proposed method can be regarded as an extention of the original EP to the t-exponential family. 4.3 Marginal Likelihood for t-exponential Family In the above, we omitted the normalization term of the site approximation to simplify the derivation. Here, we derive the marginal likelihood, which requires us to explicitly take into account the normalization term eCi: eli(w| eCi, eµi, eσ2 i ) = eCi ⊗t expt(⟨Φ(w), θ⟩). (39) We assume that this normalizer corresponds to Z1, which is the same assumption as that for the ordinary EP. To calculate Z1, we use the following theorem (its proof is available in Appendix B of the supplementary material): Theorem 2 For the Student-t distribution, we have ∫ expt(⟨Φ(w), θ⟩−g)dw = ( expt(gt(θ)/Ψ −g/Ψ) ) 3−t 2 , (40) where g is a constant, g(θ) is the log-partition function and Ψ is defined in (7). 6 Figure 1: Boundaries obtained by ADF (left two, with different sample orders) and EP (right). This theorem yields logt Z 2 3−t 1 = gt(θ)/Ψ −g\j t (θ)/Ψ + logt eCj/Ψ, (41) and therefore the marginal likelihood can be calculated as follows (see Appendix C for details): ZEP = ∫ p(0)(w) ⊗t ∏ i ⊗teli(w)dw = ( expt (∑ i logt eCi/Ψ + gt(θ)/Ψ −gprior t (θ)/Ψ )) 3−t 2 . (42) By substituting eCi in Eq.(42), we obtain the marginal likelihood. Note that, if t = 1, the above expression of ZEP is reduced to the ordinary marginal likelihood expression [9]. Therefore, this marginal likelihood can be regarded as a generalization of the ordinary exponential family marginal likelihood to the t-exponential family. In Appendices D and E of the supplementary material, we derive specific EP algorithms for the Bayes point machine (BPM) and Student-t process classification. 5 Numerical Experiments In this section, we numerically illustrate the behavior of our proposed EP applied to BPM and Studentt process classification. Suppose that data (x1, y1), . . . , (xn, yn) are given, where yi ∈{+1, −1} expresses a class label for covariate xi. We consider a model whose likelihood term can be expressed as li(w) = p(yi|xi, w) = ϵ + (1 −2ϵ)Θ(yi⟨w, xi⟩), (43) where Θ(x) is the step function taking 1 if x > 0 and 0 otherwise. 5.1 BPM We compare EP and ADF to confirm that EP does not depend on data permutation. We generate a toy dataset in the following way: 1000 data points x are generated from Gaussian mixture model 0.05N(x; [1, 1]⊤, 0.05I) + 0.25N(x; [−1, 1]⊤, 0.05I) + 0.45N(x; [−1, −1]⊤, 0.05I) + 0.25N(x; [1, −1]⊤, 0.05I), where N(x; µ, Σ) denotes the Gaussian density with respect to x with mean µ and covariance matrix Σ, and I is the identity matrix. For x, we assign label y = +1 when x comes from N(x; [1, 1]⊤, 0.05I) or N(x; [1, −1]⊤, 0.05I) and label y = −1 when x comes from N(x; [−1, 1]⊤, 0.05I) or N(x; [−1, −1]⊤, 0.05I). We evaluate the dependence of the performance of BPM (see Appendix D of the supplementary material for details) on data permutation. Fig.1 shows labeled samples by blue and red points, decision boundaries by black lines which are derived from ADF and EP for the Student-t distribution with v = 10 by changing data permutations. The top two graphs show obvious dependence on data permutation by ADF (to clarify the dependence on data permutation, we showed the most different boundary in the figure), while the bottom graph exhibits almost no dependence on data permutations by EP. 7 Figure 2: Classification boundaries. 5.2 Student-t Process Classification We compare the robustness of Student-t process classification (STC) and Gaussian process classification (GPC) visually. We apply our EP method to Student-t process binary classification, where the latent function follows the Student-t process (see Appendix E of the supplementary material for details). We compare this model with Gaussian process binary classification with the likelihood expressed Eq.(43). This kind of model is called robust Gaussian process classification [5]. Since the posterior distribution cannot be obtained analytically even for the Gaussian process, we use EP for the ordinary exponential family to approximate the posterior. We use a two-dimensional toy dataset, where we generate a two-dimensional data point xi (i = 1, . . . , 300) following the normal distributions: p(x|yi = +1) = N(x; [1.5, 1.5]⊤, 0.5I) and p(x|yi = −1) = N(x; [−1, −1]⊤, 0.5I). We add eight outliers to the dataset and evaluate the robustness against outliers (about 3% outliers). In the experiment, we used v = 10 for Student-t processes. We furthermore used the following kernel: k(xi, xj) = θ0 exp { − D ∑ d=1 θd 1(xd i −xd j)2 } + θ2 + θ3δi,j, (44) where xd i is the dth element of xi, and θ0, θ1, θ2, θ3 are hyperparameters to be optimized. Fig.2 shows the labeled samples by blue and red points, the obtained decision boundaries by black lines, and added outliers by blue and red stars. As we can see, the decision boundaries obtained by the Gaussian process classifier is heavily affected by outliers, while those obtained by the Student-t process classifier are more stable. Thus, as expected, Student-t process classification is more robust 8 Table 1: Classification Error Rates (%) Dataset Outliers GPC STC Pima 0 34.0(3.0) 32.3(2.6) 5% 34.9(3.1) 32.9(3.1) 10% 36.2(3.3) 34.4(3.5) Ionosphere 0 9.6(1.7) 7.5(2.0) 5% 9.9(2.8) 9.6(3.2) 10% 13.0(5.2) 11.9(5.4) Thyroid 0 4.3(1.3) 4.4(1.3) 5% 4.8(1.8) 5.5(2.3) 10% 5.4(1.4) 7.2(3.4) Sonar 0 15.4(3.6) 15.0(3.2) 5% 18.3(4.4) 17.5(3.3) 10% 19.4(3.8) 19.4(3.1) Table 2: Approximate log evidence Dataset Outliers GPC STC Pima 0 -74.1(2.4) -37.1(6.1) 5% -77.8(2.9) -37.2(6.5) 10% -78.6(1.8) -36.8(6.5) Ionosphere 0 -59.5(5.2) -36.9(7.4) 5% -75.0(3.6) -35.8(7.0) 10% -90.3(5.2) -37.4(7.2) Thyroid 0 -32.5(1.6) -41.2(4.3) 5% -39.1(2.3) -45.8(5.5) 10% -46.9(1.8) -45.8(4.5) Sonar 0 -55.8(1.2) -41.6(1.2) 5% -59.4(2.5) -41.3(1.6) 10% -65.8(1.1) -67.8(2.1) against outliers compared to Gaussian process classification, thanks to the heavy-tailed structure of the Student-t distribution. 5.3 Experiments on the Benchmark dataset We compared the performance of Gaussian process and Student-t process classification on the UCI datasets1. We used the kernel given in Eq.(44). The detailed explanation about experimental settings are given in Appendix F. Results are shown in Tables 1 and 2, where outliers mean how many percentages we randomly flip training dataset labels to make additional outliers. As we can see Student-t process classification outperforms Gaussian process classification in many cases. 6 Conclusions In this work, we enabled the t-exponential family to inherit the important property of the exponential family whose calculation can be efficiently performed thorough natural parameters by using the q-algebra. With this natural parameter based calculation, we developed EP for the t-exponential family by introducing the t-factorization approach. The key concept of our proposed approach is that the t-exponential family has pseudo additivity. When t = 1, our proposed EP for the t-exponential family is reduced to the original EP for the ordinary exponential family and t-factorization yields the ordinary data-dependent factorization. Therefore, our proposed EP method can be viewed as a generalization of the original EP. Through illustrative experiments, we confirmed that our proposed EP applied to the Bayes point machine can overcome the drawback of ADF, i.e., the proposed EP method is independent of data permutations. We also experimentally illustrated that proposed EP applied to Student-t process classification exhibited high robustness to outliers compared to Gaussian process classification. Experiments on benchmark data also demonstrated superiority of Student-t process. In our future work, we will further extend the proposed EP method to more general message passing methods or double-loop EP. We would like also to make our method more scalable to large datasets and develop another approximation method such as variational inference. Acknowledgement FF acknowledges support by JST CREST JPMJCR1403 and MS acknowledges support by KAKENHI 17H00757. 1https://archive.ics.uci.edu/ml/index.php 9 References [1] Christopher M Bishop. Pattern Recognition and Machine Learning. Springer, 2006. [2] Nan Ding, Yuan Qi, and SVN Vishwanathan. t-divergence based approximate inference. In Advances in Neural Information Processing Systems, pages 1494–1502, 2011. [3] Nan Ding and SVN Vishwanathan. t-logistic regression. In Advances in Neural Information Processing Systems, pages 514–522, 2010. [4] Pasi Jylänki, Jarno Vanhatalo, and Aki Vehtari. Robust Gaussian process regression with a student-t likelihood. Journal of Machine Learning Research, 12(Nov):3227–3257, 2011. [5] Hyun-Chul Kim and Zoubin Ghahramani. Outlier robust Gaussian process classification. Structural, Syntactic, and Statistical Pattern Recognition, pages 896–905, 2008. [6] Thomas Peter Minka. A family of algorithms for approximate Bayesian inference. PhD Thesis, Massachusetts Institute of Technology, 2001. [7] Laurent Nivanen, Alain Le Mehaute, and Qiuping A Wang. Generalized algebra within a nonextensive statistics. Reports on Mathematical Physics, 52(3):437–444, 2003. [8] Carl Edward Rasmussen and Christopher KI Williams. Gaussian Processes for Machine Learning, volume 1. MIT press Cambridge, 2006. [9] Matthias Seeger. Expectation propagation for exponential families. Technical Report, 2005. URL https://infoscience.epfl.ch/record/161464/files/epexpfam.pdf [10] Amar Shah, Andrew Wilson, and Zoubin Ghahramani. Student-t processes as alternatives to gaussian processes. In Artificial Intelligence and Statistics, pages 877–885, 2014. [11] Hiroki Suyari and Makoto Tsukada. Law of error in Tsallis statistics. IEEE Transactions on Information Theory, 51(2):753–757, 2005. 10
2017
67
7,196
Active Exploration for Learning Symbolic Representations Garrett Andersen PROWLER.io Cambridge, United Kingdom garrett@prowler.io George Konidaris Department of Computer Science Brown University gdk@cs.brown.edu Abstract We introduce an online active exploration algorithm for data-efficiently learning an abstract symbolic model of an environment. Our algorithm is divided into two parts: the first part quickly generates an intermediate Bayesian symbolic model from the data that the agent has collected so far, which the agent can then use along with the second part to guide its future exploration towards regions of the state space that the model is uncertain about. We show that our algorithm outperforms random and greedy exploration policies on two different computer game domains. The first domain is an Asteroids-inspired game with complex dynamics but basic logical structure. The second is the Treasure Game, with simpler dynamics but more complex logical structure. 1 Introduction Much work has been done in artificial intelligence and robotics on how high-level state abstractions can be used to significantly improve planning [19]. However, building these abstractions is difficult, and consequently, they are typically hand-crafted [15, 13, 7, 4, 5, 6, 20, 9]. A major open question is then the problem of abstraction: how can an intelligent agent learn highlevel models that can be used to improve decision making, using only noisy observations from its high-dimensional sensor and actuation spaces? Recent work [11, 12] has shown how to automatically generate symbolic representations suitable for planning in high-dimensional, continuous domains. This work is based on the hierarchical reinforcement learning framework [1], where the agent has access to high-level skills that abstract away the low-level details of control. The agent then learns representations for the (potentially abstract) effect of using these skills. For instance, opening a door is a high-level skill, while knowing that opening a door typically allows one to enter a building would be part of the representation for this skill. The key result of that work was that the symbols required to determine the probability of a plan succeeding are directly determined by characteristics of the skills available to an agent. The agent can learn these symbols autonomously by exploring the environment, which removes the need to hand-design symbolic representations of the world. It is therefore possible to learn the symbols by naively collecting samples from the environment, for example by random exploration. However, in an online setting the agent shall be able to use its previously collected data to compute an exploration policy which leads to better data efficiency. We introduce such an algorithm, which is divided into two parts: the first part quickly generates an intermediate Bayesian symbolic model from the data that the agent has collected so far, while the second part uses the model plus Monte-Carlo tree search to guide the agent’s future exploration towards regions of the state space that the model is uncertain about. We show that our algorithm is significantly more data-efficient than more naive methods in two different computer game domains. The first domain is an Asteroids-inspired game with complex dynamics but basic logical structure. The second is the Treasure Game, with simpler dynamics but more complex logical structure. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. 2 Background As a motivating example, imagine deciding the route you are going to take to the grocery store; instead of planning over the various sequences of muscle contractions that you would use to complete the trip, you would consider a small number of high-level alternatives such as whether to take one route or another. You also would avoid considering how your exact low-level state affected your decision making, and instead use an abstract (symbolic) representation of your state with components such as whether you are at home or an work, whether you have to get gas, whether there is traffic, etc. This simplification reduces computational complexity, and allows for increased generalization over past experiences. In the following sections, we introduce the frameworks that we use to represent the agent’s high-level skills, and symbolic models for those skills. 2.1 Semi-Markov Decision Processes We assume that the agent’s environment can be described by a semi-Markov decision process (SMDP), given by a tuple D = (S, O, R, P, γ), where S ⊆Rd is a d-dimensional continuous state space, O(s) returns a set of temporally extended actions, or options [19] available in state s ∈S, R(s′, t, s, o) and P(s′, t | s, o) are the reward received and probability of termination in state s′ ∈S after t time steps following the execution of option o ∈O(s) in state s ∈S, and γ ∈(0, 1] is a discount factor. In this paper, we are not concerned with the time taken to execute o, so we use P(s′ | s, o) = R P(s′, t | s, o)dt. An option o is given by three components: πo, the option policy that is executed when the option is invoked, Io, the initiation set consisting of the states where the option can be executed from, and βo(s) →[0, 1], the termination condition, which returns the probability that the option will terminate upon reaching state s. Learning models for the initiation set, rewards, and transitions for each option, allows the agent to reason about the effect of its actions in the environment. To learn these option models, the agent has the ability to collect observations of the forms (s, O(s)) when entering a state s and (s, o, s′, r, t) upon executing option o from s. 2.2 Abstract Representations for Planning We are specifically interested in learning option models which allow the agent to easily evaluate the success probability of plans. A plan is a sequence of options to be executed from some starting state, and it succeeds if and only if it is able to be run to completion (regardless of the reward). Thus, a plan {o1, o2, ..., on} with starting state s succeeds if and only if s ∈Io1 and the termination state of each option (except for the last) lies in the initiation set of the following option, i.e. s′ ∼P(s′ | s, o1) ∈Io2, s′′ ∼P(s′′ | s′, o2) ∈Io3, and so on. Recent work [11, 12] has shown how to automatically generate a symbolic representation that supports such queries, and is therefore suitable for planning. This work is based on the idea of a probabilistic symbol, a compact representation of a distribution over infinitely many continuous, low-level states. For example, a probabilistic symbol could be used to classify whether or not the agent is currently in front of a door, or one could be used to represent the state that the agent would find itself in after executing its ‘open the door’ option. In both cases, using probabilistic symbols also allows the agent to be uncertain about its state. The following two probabilistic symbols are provably sufficient for evaluating the success probability of any plan [12]; the probabilistic precondition: Pre(o) = P(s ∈Io), which expresses the probability that an option o can be executed from each state s ∈S, and the probabilistic image operator: Im(o, Z) = R S P(s′ | s, o)Z(s)P(Io | s)ds R S Z(s)P(Io | s)ds , which represents the distribution over termination states if an option o is executed from a distribution over starting states Z. These symbols can be used to compute the probability that each successive option in the plan can be executed, and these probabilities can then be multiplied to compute the overall success probability of the plan; see Figure 1 for a visual demonstration of a plan of length 2. Subgoal Options Unfortunately, it is difficult to model Im(o, Z) for arbitrary options, so we focus on restricted types of options. A subgoal option [17] is a special class of option where the distribution over termination states (referred to as the subgoal) is independent of the distribution over starting 2 (a) (b) (c) Pre(o1) Z0 Im(o1, Z0) o1 o1? Pre(o2) o2? Figure 1: Determining the probability that a plan consisting of two options can be executed from a starting distribution Z0. (a): Z0 is contained in Pre(o1), so o1 can definitely be executed. (b): Executing o1 from Z0 leads to distribution over states Im(o1, Z0). (c): Im(o1, Z0) is not completely contained in Pre(o2), so the probability of being able to execute o2 is less than 1. Note that Pre is a set and Im is a distribution, and the agent typically has uncertain models for them. states that it was executed from, e.g. if you make the decision to walk to your kitchen, the end result will be the same regardless of where you started from. For subgoal options, the image operator can be replaced with the effects distribution: Eff(o) = Im(o, Z), ∀Z(S), the resulting distribution over states after executing o from any start distribution Z(S). Planning with a set of subgoal options is simple because for each ordered pair of options oi and oj, it is possible to compute and store G(oi, oj), the probability that oj can be executed immediately after executing oi: G(oi, oj) = R S Pre(oj, s)Eff(oi)(s)ds. We use the following two generalizations of subgoal options: abstract subgoal options model the more general case where executing an option leads to a subgoal for a subset of the state variables (called the mask), leaving the rest unchanged. For example, walking to the kitchen leaves the amount of gas in your car unchanged. More formally, the state vector can be partitioned into two parts s = [a, b], such that executing o leaves the agent in state s′ = [a, b′], where P(b′) is independent of the distribution over starting states. The second generalization is the (abstract) partitioned subgoal option, which can be partitioned into a finite number of (abstract) subgoal options. For instance, an option for opening doors is not a subgoal option because there are many doors in the world, however it can be partitioned into a set of subgoal options, with one for every door. The subgoal (and abstract subgoal) assumptions propose that the exact state from which option execution starts does not really affect the options that can be executed next. This is somewhat restrictive and often does not hold for options as given, but can hold for options once they have been partitioned. Additionally, the assumptions need only hold approximately in practice. 3 Online Active Symbol Acquisition Previous approaches for learning symbolic models from data [11, 12] used random exploration. However, real world data from high-level skills is very expensive to collect, so it is important to use a more data-efficient approach. In this section, we introduce a new method for learning abstract models data-efficiently. Our approach maintains a distribution over symbolic models which is updated after every new observation. This distribution is used to choose the sequence of options that in expectation maximally reduces the amount of uncertainty in the posterior distribution over models. Our approach has two components: an active exploration algorithm which takes as input a distribution over symbolic models and returns the next option to execute, and an algorithm for quickly building a distribution over symbolic models from data. The second component is an improvement upon previous approaches in that it returns a distribution and is fast enough to be updated online, both of which we require. 3.1 Fast Construction of a Distribution over Symbolic Option Models Now we show how to construct a more general model than G that can be used for planning with abstract partitioned subgoal options. The advantages of our approach versus previous methods are that our algorithm is much faster, and the resulting model is Bayesian, both of which are necessary for the active exploration algorithm introduced in the next section. Recall that the agent can collect observations of the forms (s, o, s′) upon executing option o from s, and (s, O(s)) when entering a state s, where O(s) is the set of available options in state s. Given a sequence of observations of this form, the first step of our approach is to find the factors [12], 3 partitions of state variables that always change together in the observed data. For example, consider a robot which has options for moving to the nearest table and picking up a glass on an adjacent table. Moving to a table changes the x and y coordinates of the robot without changing the joint angles of the robot’s arms, while picking up a glass does the opposite. Thus, the x and y coordinates and the arm joint angles of the robot belong to different factors. Splitting the state space into factors reduces the number of potential masks (see end of Section 2.2) because we assume that if state variables i and j always change together in the observations, then this will always occur, e.g. we assume that moving to the table will never move the robot’s arms.1 Finding the Factors Compute the set of observed masks M from the (s, o, s′) observations: each observation’s mask is the subset of state variables that differ substantially between s and s′. Since we work in continuous, stochastic domains, we must detect the difference between minor random noise (independent of the action) and a substantial change in a state variable caused by action execution. In principle this requires modeling action-independent and action-dependent differences, and distinguishing between them, but this is difficult to implement. Fortunately we have found that in practice allowing some noise and having a simple threshold is often effective, even in more noisy and complex domains. For each state variable i, let Mi ⊆M be the subset of the observed masks that contain i. Two state variables i and j belong to the same factor f ∈F if and only if Mi = Mj. Each factor f is given by a set of state variables and thus corresponds to a subspace Sf. The factors are updated after every new observation. Let S∗be the set of states that the agent has observed and let S∗ f be the projection of S∗onto the subspace Sf for some factor f, e.g. in the previous example there is a S∗ f which consists of the set of observed robot (x, y) coordinates. It is important to note that the agent’s observations come only from executing partitioned abstract subgoal options. This means that S∗ f consists only of abstract subgoals, because for each s ∈S∗, sf was either unchanged from the previous state, or changed to another abstract subgoal. In the robot example, all (x, y) observations must be adjacent to a table because the robot can only execute an option that terminates with it adjacent to a table or one that does not change its (x, y) coordinates. Thus, the states in S∗can be imagined as a collection of abstract subgoals for each of the factors. Our next step is to build a set of symbols for each factor to represent its abstract subgoals, which we do using unsupervised clustering. Finding the Symbols For each factor f ∈F, we find the set of symbols Zf by clustering S∗ f. Let Zf(sf) be the corresponding symbol for state s and factor f. We then map the observed states s ∈S∗ to their corresponding symbolic states sd = {Zf(sf), ∀f ∈F}, and the observations (s, O(s)) and (s, o, s′) to (sd, O(s)) and (sd, o, s′d), respectively. In the robot example, the (x, y) observations would be clustered around tables that the robot could travel to, so there would be a symbol corresponding to each table. We want to build our models within the symbolic state space Sd. Thus we define the symbolic precondition, Pre(o, sd), which returns the probability that the agent can execute an option from some symbolic state, and the symbolic effects distribution for a subgoal option o, Eff(o), maps to a subgoal distribution over symbolic states. For example, the robot’s ‘move to the nearest table’ option maps the robot’s current (x, y) symbol to the one which corresponds to the nearest table. The next step is to partition the options into abstract subgoal options (in the symbolic state space), e.g. we want to partition the ‘move to the nearest table’ option in the symbolic state space so that the symbolic states in each partition have the same nearest table. Partitioning the Options For each option o, we initialize the partitioning P o so that each symbolic state starts in its own partition. We use independent Bayesian sparse Dirichlet-categorical models [18] for the symbolic effects distribution of each option partition.2 We then perform Bayesian Hierarchical Clustering [8] to merge partitions which have similar symbolic effects distributions.3 1The factors assumption is not strictly necessary as we can assign each state variable to its own factor. However, using this uncompressed representation can lead to an exponential increase in the size of the symbolic state space and a corresponding increase in the sample complexity of learning the symbolic models. 2We use sparse Dirichlet-categorical models because there are a combinatorial number of possible symbolic state transitions, but we expect that each partition has non-zero probability for only a small number of them. 3We use the closed form solutions for Dirichlet-multinomial models provided by the paper. 4 Algorithm 1 Fast Construction of a Distribution over Symbolic Option Models 1: Find the set of observed masks M. 2: Find the factors F. 3: ∀f ∈F, find the set of symbols Zf. 4: Map the observed states s ∈S∗to symbolic states sd ∈S∗d. 5: Map the observations (s, O(s)) and (s, o, s′) to (sd, O(s)) and (sd, o, s′d). 6: ∀o ∈O, initialize P o and perform Bayesian Hierarchical Clustering on it. 7: ∀o ∈O, find Ao and F o ∗. There is a special case where the agent has observed that an option o was available in some symbolic states Sd a, but has yet to actually execute it from any sd ∈Sd a. These are not included in the Bayesian Hierarchical Clustering, instead we have a special prior for the partition of o that they belong to. After completing the merge step, the agent has a partitioning P o for each option o. Our prior is that with probability qo,4 each sd ∈Sd a belongs to the partition po ∈P o which contains the symbolic states most similar to sd, and with probability 1 −qo each sd belongs to its own partition. To determine the partition which is most similar to some symbolic state, we first find Ao, the smallest subset of factors which can still be used to correctly classify P o. We then map each sd ∈Sd a to the most similar partition by trying to match sd masked by Ao with a masked symbolic state already in one of the partitions. If there is no match, sd is placed in its own partition. Our final consideration is how to model the symbolic preconditions. The main concern is that many factors are often irrelevant for determining if some option can be executed. For example, whether or not you have keys in your pocket does not affect whether you can put on your shoe. Modeling the Symbolic Preconditions Given an option o and subset of factors F o, let Sd F o be the symbolic state space projected onto F o. We use independent Bayesian Beta-Bernoulli models for the symbolic precondition of o in each masked symbolic state sd F o ∈Sd F o. For each option o, we use Bayesian model selection to find the the subset of factors F o ∗which maximizes the likelihood of the symbolic precondition models. The final result is a distribution over symbolic option models H, which consists of the combined sets of independent symbolic precondition models {Pre(o, sd F o ∗); ∀o ∈O, ∀sd F o ∗∈Sd F o ∗} and independent symbolic effects distribution models {Eff(o, po); ∀o ∈O, ∀po ∈P o}. The complete procedure is given in Algorithm 1. A symbolic option model h ∼H can be sampled by drawing parameters for each of the Bernoulli and categorical distributions from the corresponding Beta and sparse Dirichlet distributions, and drawing outcomes for each qo. It is also possible to consider distributions over other parts of the model such as the symbolic state space and/or a more complicated one for the option partitionings, which we leave for future work. 3.2 Optimal Exploration In the previous section we have shown how to efficiently compute a distribution over symbolic option models H. Recall that the ultimate purpose of H is to compute the success probabilities of plans (see Section 2.2). Thus, the quality of H is determined by the accuracy of its predicted plan success probabilities, and efficiently learning H corresponds to selecting the sequence of observations which maximizes the expected accuracy of H. However, it is difficult to calculate the expected accuracy of H over all possible plans, so we define a proxy measure to optimize which is intended to represent the amount of uncertainty in H. In this section, we introduce our proxy measure, followed by an algorithm for finding the exploration policy which optimizes it. The algorithm operates in an online manner, building H from the data collected so far, using H to select an option to execute, updating H with the new observation, and so on. First we define the standard deviation σH, the quantity we use to represent the amount of uncertainty in H. To define the standard deviation, we need to also define the distance and mean. 4This is a user specified parameter. 5 We define the distance K from h2 ∈H to h1 ∈H, to be the sum of the Kullback-Leibler (KL) divergences5 between their individual symbolic effect distributions plus the sum of the KL divergences between their individual symbolic precondition distributions:6 K(h1, h2) = X o∈O [ X sd F o ∗∈Sd F o ∗ DKL(Preh1(o, sd F o ∗) || Preh2(o, sd F o ∗)) + X po∈P o DKL(Effh1(o, po) || Effh2(o, po))]. We define the mean, E[H], to be the symbolic option model such that each Bernoulli symbolic precondition and categorical symbolic effects distribution is equal to the mean of the corresponding Beta or sparse Dirichlet distribution: ∀o ∈O, ∀po ∈P o, EffE[H](o, po) = Eh∼H[Effh(o, po)], ∀o ∈O, ∀sd F o ∗∈Sd F o ∗, PreE[H](o, sd F o ∗)) = Eh∼H[Preh(o, sd F o ∗))]. The standard deviation σH is then simply: σH = Eh∼H[K(h, E[H])]. This represents the expected amount of information which is lost if E[H] is used to approximate H. Now we define the optimal exploration policy for the agent, which aims to maximize the expected reduction in σH after H is updated with new observations. Let H(w) be the posterior distribution over symbolic models when H is updated with symbolic observations w (the partitioning is not updated, only the symbolic effects distribution and symbolic precondition models), and let W(H, i, π) be the distribution over symbolic observations drawn from the posterior of H if the agent follows policy π for i steps. We define the optimal exploration policy π∗as: π∗= argmax π σH −Ew∼W (H,i,π)[σH(w)]. For the convenience of our algorithm, we rewrite the second term by switching the order of the expectations: Ew∼W (H,i,π)[Eh∼H(w)[K(h, E[H(w)])]] = Ew∼W (h,i,π)[K(h, E[H(w)])]]. Note that the objective function is non-Markovian because H is continuously updated with the agent’s new observations, which changes σH. This means that π∗is non-stationary, so Algorithm 2 approximates π∗in an online manner using Monte-Carlo tree search (MCTS) [3] with the UCT tree policy [10]. πT is the combined tree and rollout policy for MCTS, given tree T. There is a special case when the agent simulates the observation of a previously unobserved transition, which can occur under the sparse Dirichlet-categorical model. In this case, the amount of information gained is very large, and furthermore, the agent is likely to transition to a novel symbolic state. Rather than modeling the unexplored state space, instead, if an unobserved transition is encountered during an MCTS update, it immediately terminates with a large bonus to the score, a similar approach to that of the R-max algorithm [2]. The form of the bonus is -zg, where g is the depth that the update terminated and z is a constant. The bonus reflects the opportunity cost of not experiencing something novel as quickly as possible, and in practice it tends to dominate (as it should). 4 The Asteroids Domain The Asteroids domain is shown in Figure 2a and was implemented using physics simulator pybox2d. The agent controls a ship by either applying a thrust in the direction it is facing or applying a torque in either direction. The goal of the agent is to be able to navigate the environment without colliding with any of the four “asteroids.” The agent’s starting location is next to asteroid 1. The agent is given the following 6 options (see Appendix A for additional details): 1. move-counterclockwise and move-clockwise: the ship moves from the current face it is adjacent to, to the midpoint of the face which is counterclockwise/clockwise on the same asteroid from the current face. Only available if the ship is at an asteroid. 5The KL divergence has previously been used in other active exploration scenarios [16, 14]. 6Similarly to other active exploration papers, we define the distance to depend only on the transition models and not the reward models. 6 Algorithm 2 Optimal Exploration Input: Number of remaining option executions i. 1: while i ≥0 do 2: Build H from observations (Algorithm 1). 3: Initialize tree T for MCTS. 4: while number updates < threshold do 5: Sample a symbolic model h ∼H. 6: Do an MCTS update of T with dynamics given by h. 7: Terminate current update if depth g is ≥i, or unobserved transition is encountered. 8: Store simulated observations w ∼W(h, g, πT ). 9: Score = K(h, E[H]) −K(h, E[H(w)]) −zg. 10: end while 11: return most visited child of root node. 12: Execute corresponding option; Update observations; i--. 13: end while 2. move-to-asteroid-1, move-to-asteroid-2, move-to-asteroid-3, and move-to-asteroid-4: the ship moves to the midpoint of the closest face of asteroid 1-4 to which it has an unobstructed path. Only available if the ship is not already at the asteroid and an unobstructed path to some face exists. Exploring with these options results in only one factor (for the entire state space), with symbols corresponding to each of the 35 asteroid faces as shown in Figure 2a. (a) (b) Figure 2: (a): The Asteroids Domain, and the 35 symbols which can be encountered while exploring with the provided options. (b): The Treasure Game domain. Although the game screen is drawn using large image tiles, sprite movement is at the pixel level. Results We tested the performance of three exploration algorithms: random, greedy, and our algorithm. For the greedy algorithm, the agent first computes the symbolic state space using steps 1-5 of Algorithm 1, and then chooses the option with the lowest execution count from its current symbolic state. The hyperparameter settings that we use for our algorithm are given in Appendix A. Figures 3a, 3b, and 3c show the percentage of time that the agent spends on exploring asteroids 1, 3, and 4, respectively. The random and greedy policies have difficulty escaping asteroid 1, and are rarely able to reach asteroid 4. On the other hand, our algorithm allocates its time much more proportionally. Figure 4d shows the number of symbolic transitions that the agent has not observed (out of 115 possible).7 As we discussed in Section 3, the number of unobserved symbolic transitions is a good representation of the amount of information that the models are missing from the environment. Our algorithm significantly outperforms random and greedy exploration. Note that these results are using an uninformative prior and the performance of our algorithm could be significantly improved by 7We used Algorithm 1 to build symbolic models from the data gathered by each exploration algorithms. 7 200 400 600 800 1000 1200 1400 1600 1800 2000 Option Executions 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Fraction of Time Spent Asteroid 1 random greedy MCTS (a) 200 400 600 800 1000 1200 1400 1600 1800 2000 Option Executions 0.00 0.05 0.10 0.15 0.20 0.25 Fraction of Time Spent Asteroid 3 random greedy MCTS (b) 200 400 600 800 1000 1200 1400 1600 1800 2000 Option Executions 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 Fraction of Time Spent Asteroid 4 random greedy MCTS (c) 200 400 600 800 1000 1200 1400 1600 1800 2000 Option Executions 0 10 20 30 40 50 60 No. Unobserved Symbolic Transitions Unobserved Transitions random greedy MCTS (d) Figure 3: Simulation results for the Asteroids domain. Each bar represents the average of 100 runs. The error bars represent a 99% confidence interval for the mean. (a), (b), (c): The fraction of time that the agent spends on asteroids 1, 3, and 4, respectively. The greedy and random exploration policies spend significantly more time than our algorithm exploring asteroid 1 and significantly less time exploring asteroids 3 and 4. (d): The number of symbolic transitions that the agent has not observed (out of 115 possible). The greedy and random policies require 2-3 times as many option executions to match the performance of our algorithm. starting with more information about the environment. To try to give additional intuition, in Appendix A we show heatmaps of the (x, y) coordinates visited by each of the exploration algorithms. 5 The Treasure Game Domain The Treasure Game [12], shown in Figure 2b, features an agent in a 2D, 528 × 528 pixel video-game like world, whose goal is to obtain treasure and return to its starting position on a ladder at the top of the screen. The 9-dimensional state space is given by the x and y positions of the agent, key, and treasure, the angles of the two handles, and the state of the lock. The agent is given 9 options: go-left, go-right, up-ladder, down-ladder, jump-left, jump-right, downright, down-left, and interact. See Appendix A for a more detailed description of the options and the environment dynamics. Given these options, the 7 factors with their corresponding number of symbols are: player-x, 10; player-y, 9; handle1-angle, 2; handle2-angle, 2; key-x and key-y, 3; bolt-locked, 2; and goldcoin-x and goldcoin-y, 2. Results We tested the performance of the same three algorithms: random, greedy, and our algorithm. Figure 4a shows the fraction of time that the agent spends without having the key and with the lock still locked. Figures 4b and 4c show the number of times that the agent obtains the key and treasure, respectively. Figure 4d shows the number of unobserved symbolic transitions (out of 240 possible). Again, our algorithm performs significantly better than random and greedy exploration. The data 8 200 400 600 800 1000 1200 1400 1600 1800 2000 Option Executions 0.0 0.2 0.4 0.6 0.8 1.0 Fraction of Time Spent No Key random greedy MCTS (a) 200 400 600 800 1000 1200 1400 1600 1800 2000 Option Executions 0 1 2 3 4 5 6 7 8 Number of Times Key Obtained random greedy MCTS (b) 200 400 600 800 1000 1200 1400 1600 1800 2000 Option Executions 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 Number of Times Treasure Obtained random greedy MCTS (c) 200 400 600 800 1000 1200 1400 1600 1800 2000 Option Executions 0 25 50 75 100 125 150 175 200 No. Unobserved Symbolic Transitions Unobserved Transitions random greedy MCTS (d) Figure 4: Simulation results for the Treasure Game domain. Each bar represents the average of 100 runs. The error bars represent a 99% confidence interval for the mean. (a): The fraction of time that the agent spends without having the key and with the lock still locked. The greedy and random exploration policies spend significantly more time than our algorithm exploring without the key and with the lock still locked. (b), (c): The average number of times that the agent obtains the key and treasure, respectively. Our algorithm obtains both the key and treasure significantly more frequently than the greedy and random exploration policies. There is a discrepancy between the number of times that our agent obtains the key and the treasure because there are more symbolic states where the agent can try the option that leads to a reset than where it can try the option that leads to obtaining the treasure. (d): The number of symbolic transitions that the agent has not observed (out of 240 possible). The greedy and random policies require 2-3 times as many option executions to match the performance of our algorithm. from our algorithm has much better coverage, and thus leads to more accurate symbolic models. For instance in Figure 4c you can see that random and greedy exploration did not obtain the treasure after 200 executions; without that data the agent would not know that it should have a symbol that corresponds to possessing the treasure. 6 Conclusion We have introduced a two-part algorithm for data-efficiently learning an abstract symbolic representation of an environment which is suitable for planning with high-level skills. The first part of the algorithm quickly generates an intermediate Bayesian symbolic model directly from data. The second part guides the agent’s exploration towards areas of the environment that the model is uncertain about. This algorithm is useful when the cost of data collection is high, as is the case in most real world artificial intelligence applications. Our results show that the algorithm is significantly more data efficient than using more naive exploration policies. 9 7 Acknowledgements This research was supported in part by the National Institutes of Health under award number R01MH109177. The U.S. Government is authorized to reproduce and distribute reprints for Governmental purposes notwithstanding any copyright notation thereon. The content is solely the responsibility of the authors and does not necessarily represent the official views of the National Institutes of Health. References [1] A.G. Barto and S. Mahadevan. Recent advances in hierarchical reinforcement learning. Discrete Event Dynamic Systems, 13(4):341–379, 2003. [2] Ronen I Brafman and Moshe Tennenholtz. R-max-a general polynomial time algorithm for near-optimal reinforcement learning. Journal of Machine Learning Research, 3(Oct):213–231, 2002. [3] C.B. Browne, E. Powley, D. Whitehouse, S.M. Lucas, P.I. Cowling, P. Rohlfshagen, S. Tavener, D. Perez, S. Samothrakis, and S. Colton. A survey of Monte-Carlo tree search methods. IEEE Transactions on Computational Intelligence and AI in Games, 4(1):1–43, 2012. [4] S. Cambon, R. Alami, and F. Gravot. A hybrid approach to intricate motion, manipulation and task planning. International Journal of Robotics Research, 28(1):104–126, 2009. [5] J. Choi and E. Amir. Combining planning and motion planning. In Proceedings of the IEEE International Conference on Robotics and Automation, pages 4374–4380, 2009. [6] Christian Dornhege, Marc Gissler, Matthias Teschner, and Bernhard Nebel. Integrating symbolic and geometric planning for mobile manipulation. In IEEE International Workshop on Safety, Security and Rescue Robotics, November 2009. [7] E. Gat. On three-layer architectures. In D. Kortenkamp, R.P. Bonnasso, and R. Murphy, editors, Artificial Intelligence and Mobile Robots. AAAI Press, 1998. [8] K.A. Heller and Z. Ghahramani. Bayesian hierarchical clustering. In Proceedings of the 22nd international conference on Machine learning, pages 297–304. ACM, 2005. [9] L. Kaelbling and T. Lozano-Pérez. Hierarchical planning in the Now. In Proceedings of the IEEE Conference on Robotics and Automation, 2011. [10] L. Kocsis and C. Szepesvári. Bandit based Monte-Carlo planning. In Machine Learning: ECML 2006, pages 282–293. Springer, 2006. [11] G.D. Konidaris, L.P. Kaelbling, and T. Lozano-Perez. Constructing symbolic representations for high-level planning. In Proceedings of the Twenty-Eighth Conference on Artificial Intelligence, pages 1932–1940, 2014. [12] G.D. Konidaris, L.P. Kaelbling, and T. Lozano-Perez. Symbol acquisition for probabilistic high-level planning. In Proceedings of the Twenty Fourth International Joint Conference on Artificial Intelligence, pages 3619–3627, 2015. [13] C. Malcolm and T. Smithers. Symbol grounding via a hybrid architecture in an autonomous assembly system. Robotics and Autonomous Systems, 6(1-2):123–144, 1990. [14] S.A. Mobin, J.A. Arnemann, and F. Sommer. Information-based learning by agents in unbounded state spaces. In Advances in Neural Information Processing Systems, pages 3023–3031, 2014. [15] N.J. Nilsson. Shakey the robot. Technical report, SRI International, April 1984. [16] L. Orseau, T. Lattimore, and M. Hutter. Universal knowledge-seeking agents for stochastic environments. In International Conference on Algorithmic Learning Theory, pages 158–172. Springer, 2013. 10 [17] D. Precup. Temporal Abstraction in Reinforcement Learning. PhD thesis, Department of Computer Science, University of Massachusetts Amherst, 2000. [18] N.F.Y. Singer. Efficient Bayesian parameter estimation in large discrete domains. In Advances in Neural Information Processing Systems 11: Proceedings of the 1998 Conference, volume 11, page 417. MIT Press, 1999. [19] R.S. Sutton, D. Precup, and S.P. Singh. Between MDPs and semi-MDPs: A framework for temporal abstraction in reinforcement learning. Artificial Intelligence, 112(1-2):181–211, 1999. [20] J. Wolfe, B. Marthi, and S.J. Russell. Combined task and motion planning for mobile manipulation. In International Conference on Automated Planning and Scheduling, 2010. 11
2017
670
7,197
Balancing information exposure in social networks Kiran Garimella Aalto University & HIIT Helsinki, Finland kiran.garimella@aalto.fi Aristides Gionis Aalto University & HIIT Helsinki, Finland aristides.gionis@aalto.fi Nikos Parotsidis University of Rome Tor Vergata Rome, Italy nikos.parotsidis@uniroma2.it Nikolaj Tatti Aalto University & HIIT Helsinki, Finland nikolaj.tatti@aalto.fi Abstract Social media has brought a revolution on how people are consuming news. Beyond the undoubtedly large number of advantages brought by social-media platforms, a point of criticism has been the creation of echo chambers and filter bubbles, caused by social homophily and algorithmic personalization. In this paper we address the problem of balancing the information exposure in a social network. We assume that two opposing campaigns (or viewpoints) are present in the network, and that network nodes have different preferences towards these campaigns. Our goal is to find two sets of nodes to employ in the respective campaigns, so that the overall information exposure for the two campaigns is balanced. We formally define the problem, characterize its hardness, develop approximation algorithms, and present experimental evaluation results. Our model is inspired by the literature on influence maximization, but there are significant differences from the standard model. First, balance of information exposure is modeled by a symmetric difference function, which is neither monotone nor submodular, and thus, not amenable to existing approaches. Second, while previous papers consider a setting with selfish agents and provide bounds on bestresponse strategies (i.e., move of the last player), we consider a setting with a centralized agent and provide bounds for a global objective function. 1 Introduction Social-media platforms have revolutionized many aspects of human culture, among others, the way people are exposed to information. A recent survey estimates that 62% of adults in the US get their news on social media [15]. Despite providing many desirable features, such as, searching, personalization, and recommendations, one point of criticism is that social media amplify echo chambers and filter bubbles: users get less exposure to conflicting viewpoints and are isolated in their own informational bubble. This phenomenon is contributed to social homophily and algorithmic personalization, and is more acute for controversial topics [9, 12, 14]. In this paper we address the problem of reducing the filter-bubble effect by balancing information exposure among users. We consider social-media discussions around a topic that are characterized by two or more conflicting viewpoints. Let us refer to these viewpoints as campaigns. Our approach follows the popular paradigm of influence propagation [18]: we want to select a small number of seed users for each campaign so as to maximize the number of users who are exposed to both campaigns. In contrast to existing work on competitive viral marketing, we do not consider the 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. problem of finding an optimal selfish strategy for each campaign separately. Instead we consider a centralized agent responsible for balancing information exposure for the two campaigns Consider the following motivating examples. Example 1: Social-media companies have been called to act as arbiters so as to prevent ideological isolation and polarization in the society. The motivation for companies to assume this role could be for improving their public image or due to legislation.1 Consider a controversial topic being discussed in social-media platform X, which has led to polarization and filter bubbles. As part of a new filter-bubble bursting service, platform X would like to disseminate two high-quality and thought-provoking dueling op-eds, articles, one for each side, which present the arguments of the other side in a fair manner. Assume that X is interested in following a viral-marketing approach. Which users should X target, for each of the two articles, so that people in the network are informed in the most balanced way? Example 2: Government organization Y is initiating a program to help assimilate foreigners who have newly arrived in the country. Part of the initiative focuses on bringing the communities of foreigners and locals closer in social media. Organization Y is interested in identifying individuals who can help spreading news of one community into the other. From the technical standpoint, we consider the following problem setting: We assume that information is propagated in the network according to the independent-cascade model [18]. We assume that there are two opposing campaigns, and for each one there is a set of initial seed nodes, I1 and I2, which are not necessarily distinct. Furthermore, we assume that the users in the network are exposed to information about campaign i via diffusion from the set of seed nodes Ii. The diffusion in the network occurs according to some information-propagation model. The objective is to recruit two additional sets of seed nodes, S1 and S2, for the two campaigns, with |S1| + |S2| ≤k, for a given budget k, so as to maximize the expected number of balanced users, i.e., the users who are exposed to information from both campaigns (or from none). We show that the problem of balancing the information exposure is NP-hard. We develop different approximation algorithms for the different settings we consider, as well as heuristic variants of the proposed algorithm. We experimentally evaluate our methods, on several real-world datasets. Although our approach is inspired by the large body of work on information propagation, and resembles previous problem formulations for competitive viral marketing, there are significant differences. In particular: • This is the first paper to address the problem of balancing information exposure and breaking filter bubbles, using the information-propagation methodology. • The objective function that best suits our problem setting is related to the size of the symmetric difference of users exposed to the two campaigns. This is in contrast to previous settings that consider functions related to the size of the coverage of the campaigns. • As a technical consequence of the previous point, our objective function is neither monotone nor submodular making our problem more challenging. Yet we are able to analyze the problem structure and provide algorithms with approximation guarantees. • While most previous papers consider selfish agents, and provide bounds on best-response strategies (i.e., move of the last player), we consider a centralized setting and provide bounds for a global objective function. Omitted proofs, figures, and tables are provided as supplementary material. Moreover, our datasets and implementations are publicly available.2 2 Related Work Detecting and breaking filter bubbles. Several studies have observed that users in online social networks prefer to associate with like-minded individuals and consume agreeable content. This phenomenon leads to filter bubbles, echo chambers [25], and to online polarization [1, 9, 12, 22]. 1For instance, Germany is now fining Facebook for the spread of fake news. 2https://users.ics.aalto.fi/kiran/BalanceExposure/ 2 Once these filter bubbles are detected, the next step is to try to overcome them. One way to achieve this is by making recommendations to individuals of opposing viewpoints. This idea has been explored, in different ways, by a number of studies in the literature [13, 19]. However, previous studies address the problem of breaking filter bubbles by the means of content recommendation. To the best of our knowledge, this is the first paper that considers an information diffusion approach. Information diffusion. Following a large body of work, we model diffusion using the independentcascade model [18]. In the basic model a single item propagates in the network. An extension is when multiple items propagate simultaneously. All works that study optimization problems in the case of multiple items, consider that items compete for being adopted by users. In other words, every user adopts at most one of the existing items and participates in at most one cascade. Myers and Leskovec [23] argue that spreading processes may either cooperate or compete. Competing contagions decrease each other’s probability of diffusion, while cooperating ones help each other in being adopted. They propose a model that quantifies how different spreading cascades interact with each other. Carnes et al. [7] propose two models for competitive diffusion. Subsequently, several other models have been proposed [4, 10, 11, 17, 21, 27, 28]. Most of the work on competitive information diffusion consider the problem of selecting the best k seeds for one campaign, for a given objective, in the presence of competing campaigns [3, 6]. Bharathi et al. [3] show that, if all campaigns but one have fixed sets of seeds, the problem for selecting the seeds for the last player is submodular, and thus, obtain an approximation algorithm for the strategy of the last player. Game theoretic aspects of competitive cascades in social networks, including the investigation of conditions for the existence of Nash equilibrium, have also been studied [2, 16, 26]. The work that is most related to ours, in the sense of considering a centralized authority, is the one by Borodin et al. [5]. They study the problem where multiple campaigns wish to maximize their influence by selecting a set of seeds with bounded cardinality. They propose a centralized mechanism to allocate sets of seeds (possibly overlapping) to the campaigns so as to maximize the social welfare, defined as the sum of the individual’s selfish objective functions. One can choose any objective functions as long as it is submodular and non-decreasing. Under this assumption they provide strategyproof (truthful) algorithms that offer guarantees on the social welfare. Their framework applies for several competitive influence models. In our case, the number of balanced users is not submodular, and so we do not have any approximation guarantees. Nevertheless, we can use this framework as a heuristic baseline, which we do in the experimental section. 3 Problem Definition Preliminaries: We start with a directed graph G = (V, E, p1, p2) representing a social network. We assume that there are two distinct campaigns that propagate through the network. Each edge e = (u, v) ∈E is assigned two probabilities, p1(e) and p2(e), representing the probability that a post from vertex u will propagate (e.g., it will be reposted) to vertex v in the respective campaigns. Cascade model: We assume that information on the two campaigns propagates in the network following the independent-cascade model [18]. For instance, consider the first campaign (the process for the second campaign is analogous): we assume that there exists a set of seeds I1 from which the process begins. Propagation proceeds in rounds. At each round, there exists a set of active vertices A1 (initially, A1 = I1), where each vertex u ∈A1 attempts to activate each vertex v /∈A1, such that (u, v) ∈E, with probability p1(u, v). If the propagation attempt from a vertex u to a vertex v is successful, we say that v propagates the first campaign. At the end of each round, A1 is set to be the set of vertices that propagated the campaign during the current round. Given a seed set S, we write r1(S) and r2(S) for the vertices that are reached from S using the aforementioned cascade process, for the respective campaign. Note that since this process is random, both r1(S) and r2(S) are random variables. Computing the expected number of active vertices is a #P-hard problem [8], however, we can approximate it within an arbitrary small factor ϵ, with high probability, via Monte-Carlo simulations. Due to this obstacle, all approximation algorithms that evaluate an objective function over diffusion processes reduce their approximation by an additive ϵ. Throughout this work we avoid repeating this fact for the sake of simplicity of the notation. 3 Heterogeneous vs. correlated propagations: We also need to specify how the propagation on the two campaigns interact with each other. We consider two settings: In the first setting, we assume that the campaign messages propagate independently of each other. Given an edge e = (u, v), the vertex v is activated on the first campaign with probability p1(e), given that vertex u is activated on the first campaign. Similarly, v is activated on the second campaign with probability p2(e), given that u is activated on the second campaign. We refer to this setting as heterogeneous.3 In the second setting we assume that p1(e) = p2(e), for each edge e. We further assume that the coin flips for the propagation of the two campaigns are totally correlated. Namely, consider an edge e = (u, v), where u is reached by either or both campaigns. Then with probability p1(e), any campaign that has reached u, will also reach v. We refer to this second setting as correlated. Note that in both settings, a vertex may be active by none, either, or both campaigns. This is in contrast to most existing work in competitive viral marketing, where it is assumed that a vertex can be activated by at most one campaign. The intuition is that in our setting activation means merely passing a message or posting an article, and it does not imply full commitment to the campaign. We also note that the heterogeneous setting is more realistic than the correlated, however, we also study the correlated model as it is mathematically simpler. Problem definition: We are now ready to state our problem for balancing information exposure (BALANCE). Given a directed graph, initial seed sets for both campaigns and a budget, we ask to find additional seeds that would balance the vertices. More formally: Problem 3.1 (BALANCE). Let G = (V, E, p1, p2) be a directed graph, and two sets I1 and I2 of initial seeds of the two campaigns. Assume that we are given a budget k. Find two sets S1 and S2, where |S1| + |S2| ≤k maximizing Φ(S1, S2) = E[|V \ (r1(I1 ∪S1) △r2(I2 ∪S2))|] . The objective function Φ(S1, S2) is the expected number of vertices that are either reached by both campaigns or remain oblivious to both campaigns. Problem 3.1 is defined for both settings, heterogeneous and correlated. When we need to make explicit the underlying setting we refer to the respective problems by BALANCE-H and BALANCE-C. When referring to BALANCE-H, we denote the objective by ΦH . Similarly, when referring to BALANCE-C, we write ΦC. We drop the indices, when we are referring to both models simultaneously. Computational complexity: As expected, the optimization problem BALANCE turns out to be NP-hard for both settings, heterogeneous and correlated. A straightforward way to prove it is by setting I2 = V , so the problems reduce to standard influence maximization. However, we provide a stronger result. Note that instead of maximizing balanced vertices we can equivalently minimize the imbalanced vertices. However, this turns to be a more difficult problem. Proposition 1. Assume a graph G = (V, E, p1, p2) with two sets I1 and I2 and a budget k. It is an NP-hard problem to decide whether there are sets S1 and S2 such that |S1| + |S2| ≤k and E[|r1(I1 ∪S1) △r2(I2 ∪S2)|] = 0. This result holds for both models, even when p1 = p2 = 1. This result implies that the minimization version of the problem is NP-hard, and there is no algorithm with multiplicative approximation guarantee. It also implies that BALANCE-H and BALANCE-C are also NP-hard. However, we will see later that we can obtain approximation guarantees for these maximization problems. 4 Greedy algorithms yielding approximation guarantees In this section we propose three greedy algorithms. The first algorithm yields an approximation guarantee of (1 −1/e)/2 for both models. The remaining two algorithms yield a guarantee for the correlated model only. Decomposing the objective: Recall that the objective function of the BALANCE problem is Φ(S1, S2). In order to show that this function admits an approximation guarantee, we decompose it into two components. To do that, assume that we are given initial seeds I1 and I2, and let us write 3Although independent is probably a better term than heterogeneous, we adopt the latter to avoid any confusion with the independent-cascade model. 4 X = r1(I1) ∪r2(I2), Y = V \ X. Here X are vertices reached by any initial seed in the two campaigns and Y are the vertices that are not reached at all. Note that X and Y are random variables. Since X and Y partition V , we can decompose the score Φ(S1, S2) as Φ(S1, S2) = Ω(S1, S2) + Ψ(S1, S2), where Ω(S1, S2) = E[|X \ (r1(I1 ∪S1) △r2(I2 ∪S2))|] , Ψ(S1, S2) = E[|Y \ (r1(I1 ∪S1) △r2(I2 ∪S2))|] . We first show that Ω(S1, S2) is monotone and submodular. It is well-known that for maximizing a function that has these two properties under a size constraint, the greedy algorithm computes an (1 −1 e) approximate solution [24]. Lemma 2. Ω(S1, S2) is monotone and submodular. We are ready to discuss our algorithms. Algorithm 0: ignore Ψ. Our first algorithm is very simple: instead of maximizing Φ, we maximize Ω, i.e., we ignore any vertices that are made imbalanced during the process. Since Ωis submodular and monotone we can use the greedy algorithm. If we then compare the obtained result with the empty solution, we get the promised approximation guarantee. We refer to this algorithm as Cover. Proposition 3. Let ⟨S∗ 1, S∗ 2⟩be the optimal solution maximizing Φ. Let ⟨S1, S2⟩be the solution obtained via greedy algorithm maximizing Ω. Then max{Φ(S1, S2), Φ(∅, ∅)} ≥1 −1/e 2 Φ(S∗ 1, S∗ 2). Algorithm 1: force common seeds. Ignoring the Ψ term may prove costly as it is possible to introduce a lot of new imbalanced vertices. The idea behind the second algorithm is to force Ψ = 0. We do this by either adding the same seeds to both campaigns, or adding a seed that is covered by an opposing campaign. This algorithm has guarantees only in the correlated setting with even budget k but in practice we can use the algorithm also for the heterogeneous setting. We refer to this algorithm as Common and the pseudo-code is given in Algorithm 1. Algorithm 1: Common, greedy algorithm that only adds common seeds 1 S1 ←S2 ←∅; 2 while |S1| + |S2| ≤k do 3 c ←arg maxc Φ(S1 ∪{c} , S2 ∪{c}); 4 s1 ←arg maxs∈I1 Φ(S1, S2 ∪{s}); 5 s2 ←arg maxs∈I2 Φ(S1 ∪{s} , S2); 6 add the best option among ⟨c, c⟩, ⟨∅, s1⟩, ⟨s2, ∅⟩to ⟨S1, S2⟩while respecting the budget. We first show in the following lemma that adding common seeds may halve the score, in the worst case. Then, we use this lemma to prove the approximation guarantee Lemma 4. Let ⟨S1, S2⟩be a solution to BALANCE-C, with an even budget k. There exists a solution ⟨S′ 1, S′ 2⟩with S′ 1 = S′ 2 such that ΦC(S′ 1, S′ 2) ≥ΦC(S1, S2)/2. It is easy to see that the greedy algorithm satisfies the conditions of the following proposition. Proposition 5. Assume an iterative algorithm where at each iteration, we add one or two vertices to our solution until our constraints are met. Let Si 1, Si 2 be the sets after the i-th iteration, S0 1 = S0 2 = ∅. Let ηi = ΦC(Si 1, Si 2) be the cost after the i-th iteration. Assume that ηi ≥ηi−1. Assume further that for i = 1, . . . , k/2 it holds that ηi ≥ΦC(Si−1 1 ∪{c} , Si−1 2 ∪{c}). Then the algorithm yields (1 −1/e)/2 approximation. Algorithm 2: common seeds as baseline. Not allowing new imbalanced vertices may prove to be too restrictive. We can relax this condition by allowing new imbalanced vertices as long as the gain is at least as good as adding a common seed. We refer to this algorithm as Hedge and the pseudo-code is given in Algorithm 2. The approximation guarantee for this algorithm—in the correlated setting and with even budget—follows immediately from Proposition 5 as it also satisfies the conditions. 5 Algorithm 2: Hedge, greedy algorithm, where each step is as good as adding the best common seed 1 S1 ←S2 ←∅; 2 while |S1| + |S2| ≤k do 3 c ←arg maxc Φ(S1 ∪{c} , S2 ∪{c}); 4 s1 ←arg maxs Φ(S1, S2 ∪{s}); 5 s2 ←arg maxs Φ(S1 ∪{s} , S2); 6 add the best option among ⟨c, c⟩, ⟨∅, s1⟩, ⟨s2, ∅⟩, ⟨s2, s1⟩, to ⟨S1, S2⟩while respecting the budget. 5 Experimental evaluation In this section, we evaluate the effectiveness of our algorithms on real-world datasets. We focus on (i) analyzing the quality of the seeds picked by our algorithms in comparison to other heuristic approaches and baselines; (ii) analyzing the efficiency and the scalability of our algorithms; and (iii) providing anecdotal examples of the obtained results. Although we setup our experiments in order to mimic social behavior, we note that fully realistic experiments would entail the ability to intervene in the network, select seeds, and observe the resulting cascades. This, however, is well beyond our capacity and the scope of the paper. In all experiments we set k to range between 5 and 50 with a step of 5. We report averages over 1 000 random simulations of the cascade process. Datasets: To evaluate the effectiveness of our algorithms, we run experiments on real-world data collected from twitter. Let G = (V, E) be the twitter follower graph. A directed edge (u, v) ∈E indicates that user v follows u; note that the edge direction indicates the “information flow” from a user to their followers. We define a cascade GX = (X, EX) as a graph over the set of users X ⊆V who have retweeted at least one hashtag related to a topic (e.g., US elections). An edge (u, v) ∈EX ⊆E indicates that v retweeted u. We use datasets from six topics with opposing viewpoints, covering politics (US-elections, Brexit, ObamaCare), policy (Abortion, Fracking), and lifestyle (iPhone, focusing on iPhone vs. Samsung). All datasets are collected by filtering the twitter streaming API (1% random sample of all tweets) for a set of keywords used in previous work [20]. For each dataset, we identify two sides (indicating the two view-points) on the retweet graph, which has been shown to capture best the two opposing sides of a controversy [12]. Details on the statistics of the dataset can be found at the supplementary material. After building the graphs, we need to estimate the diffusion probabilities for the heterogeneous and correlated models. Note that the estimation of the diffusion probabilities is orthogonal to our contribution in this paper. For the sake of concreteness we have used the approach described below. One could use a different, more advanced, method; our methods are still applicable. Let q1(v) and q2(v) be an a priori probability of a user v retweeting sides 1 and 2, respectively. These are measured from the data by looking at how often a user retweets content from users and keywords that are discriminative of each side. For example, for US-elections, the discriminative users and keywords for side Hillary would be @hillaryclinton and #imwither, and for Trump, @realdonaldtrump and #makeamericagreatagain. The probability that user v retweets user u (cascade probability) is then defined as pi(u, v) = α qi(v) + (1 −α) R(u, v) + 1 R(v) + 2  , i = 1, 2, where R(u, v) is the number of times v has retweeted u, and R(v) is the total number of retweets of user v. The cascade probabilities pi capture the fact that users retweet content if they see it from their friends (term R(u,v)+1 R(v)+2 ) or based on their own biases (term qi(v)). The additive terms in the numerator and denominator provide an additive smoothing by Laplace’s rule of succession. We set the value of α to 0.8 for the heterogeneous setting. For α = 0 the edge probabilities become equal for the two campaigns, which is our assumption for the correlated setting. 6 10 20 30 40 50 300 400 500 600 budget k symm. diff. iPhone 10 20 30 40 50 1 500 2 000 2 500 budget k symm. diff. ObamaCare 10 20 30 40 50 500 1 000 1 500 budget k symm. diff. US-elections Cover Hedge Common Greedy 10 20 30 40 50 0 20 40 60 80 budget k symm. diff. iPhone 10 20 30 40 50 200 400 budget k symm. diff. ObamaCare 10 20 30 40 50 0 500 1 000 1 500 2 000 budget k symm. diff. US-elections Figure 1: Expected symmetric difference n −ΦC as a function of the budget k. Top row, heterogeneous model, bottom row: Correlated model. Low values are better. Baselines. We use 5 different baselines. The first baseline, BBLO, is an adaptation of the framework by Borodin et al. [5]. This framework requires an objective function as input, and here we use our objective function Φ. The framework works as follows: The two campaigns are given a budget k/2 on the number of seeds that they can select. At each round, we select a vertex v for S1, optimizing Φ(S1 ∪{v} , S2), and a vertex w for S2, optimizing Φ(S1, S2 ∪{w}). We should stress that the theoretical guarantees by [5] do not apply because our objective is not submodular. The next two heuristics add a set of common seeds to both campaigns. We run a greedy algorithm for campaign i = 1, 2 to select the set S′ i with the ℓ≫k vertices Pi that optimizes the function ri(S′ i ∪Ii). We consider two heuristics: Union selects S1 and S2 to be equal to the k/2 first distinct vertices in S′ 1 ∪S′ 2 while Intersection selects S1 and S2 to be equal to k/2 first vertices in S′ 1 ∩S′ 2. Here the vertices are ordered based on their discovery time. Finally, HighDegree selects the vertices with the largest number of followers and assigns them alternately to the two cascades; and Random assigns k/2 random seeds to each campaign. In addition to the baselines, we also consider a simple greedy algorithm Greedy. The difference between Cover and Greedy is that, in each iteration, Cover adds the seed that maximizes Ω, while Greedy adds the seed that maximizes Φ. We can only show an approximation guarantee for Cover but Greedy is a more intuitive approach, and we use it as a heuristic. Comparison of the algorithms. We start by evaluating the quality of the sets of seeds computed by our algorithms, i.e., the number of equally-informed vertices. Heterogeneous setting. We consider first the case of heterogeneous networks. The results for the selected datasets are shown in Figure 1. Full results are shown in the supplementary material. Instead of plotting Φ, we plot the number of the remaining unbalanced vertices, n−Φ, as it makes the results easier to distinguish; i.e., an optimal solution achieves the value 0. The first observation is that the approximation algorithm Cover performs, in general, worse than the other two heuristics. This is due to the fact that Cover does not optimize directly the objective function. Hedge performs better than Greedy, in general, since it examines additional choices to select. The only deviation from this picture is for the US-elections dataset, where the Greedy outperforms Hedge by a small factor. This may due to the fact that while Hedge has more options, it allocates seeds in batches of two. Correlated setting. Next we consider correlated networks. We experiment with the three approximation algorithms Cover, Common, Hedge, and the heuristic Greedy. The results are shown in Figure 1. Cover performs again the worst since it is the only method that introduces new unbalanced vertices without caring about their cardinality. Its variant, Greedy, performs much better in practice even though it does not provide an approximation guarantee. The algorithms Common, Greedy, and Hedge perform very similar to each other without a clear winner. 7 0 2 4 6 ×103 Abortion Brexit Fracking iPhoneObamaCare US symm. diff. Heterogeneous 0 1 2 3 4 ×103 Hedge BBLO Intersection Union HighDegree Random Abortion Brexit Fracking iPhoneObamaCare US symm. diff. Correlated Figure 2: Expected symm. diff. n −Φ of Hedge and the baselines. k = 20. Low values are better. Comparison with baselines. Our next step is to compare against the baselines. For simplicity, we focus on k = 20; the overall conclucions hold for other budgets. The results for Hedge versus the five baselines are shown in Figure 2. From the results we see that BBLO is the best competitor: its scores are the closest to Hedge, and it receives slightly better scores in 3 out of 12 cases. The competitiveness is not surprising because we specifically set the objective function in BBLO to be Φ(S1, S2). The Intersection and Union also perform well but are always worse than Hedge. Random is unpredictable but always worse than Hedge. In the case of heterogeneous networks, Hedge selects seeds that leave less unbalanced vertices, by a factor of two on average, compared to the seeds selected by the HighDegree method. For correlated networks, our method outperforms the two baselines by an order of magnitude. The actual values of this experiment can be found in the supplementary material. Running time. We proceed to evaluate the efficiency and the scalability of our algorithms. We observe that all algorithms have comparable running times and good scalability. More information can be found in the supplementary material. Use case with Fracking. We present a qualitative case-study analysis for the seeds selected by our algorithm. We highlight the Fracking dataset, even though we applied similar analysis to the other datasets as well (the results are given in the supplementary material of the paper). Recall that for each dataset we identify two sides with opposing views, and a set of initial seeds for each side (I1 and I2). We consider the users in the initial seeds I1 (side supporting fracking), and summarize the text of all their Twitter profile descriptions in a word cloud. The result, contains words that are used to emphasize the benefits of fracking (energy, oil, gas, etc.). We then draw a similar word cloud for the users identified by the Hedge algorithm as seed nodes in the sets S1 and S2 (k = 50). The result, contains a more balanced set of words, which includes many words used to underline the environmental dangers of fracking. We use word clouds as a qualitative case study to complement our quantitative results and to provide more intuition about our problem statement, rather than an alternative quantitative measure. 6 Conclusion We presented the first study of the problem of balancing information exposure in social networks using techniques from the area of information diffusion. Our approach has several novel aspects. In particular, we formulate our problem by seeking to optimize a symmetric difference function, which is neither monotone nor submodular, and thus, not amenable to existing approaches. Additionally, while previous studies consider a setting with selfish agents and provide bounds on best-response strategies (i.e., move of the last player), we consider a centralized setting and provide bounds for a global objective function. Our work provides several directions for future work. One interesting problem is to improve the approximation guarantee for the problem we define. Second, we would like to extend the problem definition for more than two campaigns and design approximation algorithms for that case. Finally, we believe that it is worth studying the BALANCE problem under complex diffusion models that capture more realistic social behavior in the presence of multiple campaigns. One such extension is to consider propagation probabilities on the edges that are dependent in the past behavior of the nodes with respect to the two campaigns, e.g., one could consider Hawkes processes [28]. Acknowledgments. This work has been supported by the Academy of Finland projects “Nestor” (286211) and “Agra” (313927), and the EC H2020 RIA project “SoBigData” (654024). 8 References [1] L. A. Adamic and N. Glance. The political blogosphere and the 2004 us election: divided they blog. In LinkKDD, pages 36–43, 2005. [2] N. Alon, M. Feldman, A. D. Procaccia, and M. Tennenholtz. A note on competitive diffusion through social networks. IPL, 110(6):221–225, 2010. [3] S. Bharathi, D. Kempe, and M. Salek. Competitive influence maximization in social networks. In WINE, 2007. [4] A. Borodin, Y. Filmus, and J. Oren. Threshold models for competitive influence in social networks. In WINE, 2010. [5] A. Borodin, M. Braverman, B. Lucier, and J. Oren. Strategyproof mechanisms for competitive influence in networks. In WWW, pages 141–150, 2013. [6] C. Budak, D. Agrawal, and A. El Abbadi. Limiting the spread of misinformation in social networks. In WWW, pages 665–674, 2011. [7] T. Carnes, C. Nagarajan, S. M. Wild, and A. Van Zuylen. Maximizing influence in a competitive social network: a follower’s perspective. In EC, 2007. [8] W. Chen, C. Wang, and Y. Wang. Scalable influence maximization for prevalent viral marketing in largescale social networks. In KDD, pages 1029–1038, 2010. [9] M. Conover, J. Ratkiewicz, M. Francisco, B. Gonc¸alves, F. Menczer, and A. Flammini. Political Polarization on Twitter. In ICWSM, 2011. [10] P. Dubey, R. Garg, and B. De Meyer. Competing for customers in a social network: The quasi-linear case. In WINE, 2006. [11] M. Farajtabar, X. Ye, S. Harati, L. Song, and H. Zha. Multistage campaigning in social networks. In NIPS, pages 4718–4726. 2016. [12] K. Garimella, G. De Francisci Morales, A. Gionis, and M. Mathioudakis. Quantifying controversy in social media. In WSDM, pages 33–42, 2016. [13] K. Garimella, G. De Francisci Morales, A. Gionis, and M. Mathioudakis. Reducing controversy by connecting oppposing views. In WSDM, 2017. [14] R. K. Garrett. Echo chambers online?: Politically motivated selective exposure among internet news users1. JCMC, 14(2):265–285, 2009. [15] J. Gottfried and E. Shearer. News use across social media platforms 2016. Pew Research Center, 2016. [16] S. Goyal, H. Heidari, and M. Kearns. Competitive contagion in networks. Games and Economic Behavior, 2014. [17] R. Jie, J. Qiao, G. Xu, and Y. Meng. A study on the interaction between two rumors in homogeneous complex networks under symmetric conditions. Physica A, 454:129–142, 2016. [18] D. Kempe, J. Kleinberg, and ´E. Tardos. Maximizing the spread of influence through a social network. In KDD, pages 137–146, 2003. [19] Q. V. Liao and W.-T. Fu. Expert voices in echo chambers: effects of source expertise indicators on exposure to diverse opinions. In CHI, pages 2745–2754, 2014. [20] H. Lu, J. Caverlee, and W. Niu. Biaswatch: A lightweight system for discovering and tracking topicsensitive opinion bias in social media. In CIKM, pages 213–222, 2015. [21] W. Lu, W. Chen, and L. V. Lakshmanan. From competition to complementarity: comparative influence diffusion and maximization. PVLDB, 9(2):60–71, 2015. [22] A. Morales, J. Borondo, J. Losada, and R. Benito. Measuring political polarization: Twitter shows the two sides of Venezuela. Chaos, 25(3), 2015. [23] S. A. Myers and J. Leskovec. Clash of the contagions: Cooperation and competition in information diffusion. In ICDM, pages 539–548, 2012. [24] G. Nemhauser, L. Wolsey, and M. Fisher. An analysis of approximations for maximizing submodular set functions – I. Mathematical Programming, 14(1):265–294, 1978. [25] E. Pariser. The filter bubble: What the Internet is hiding from you. Penguin UK, 2011. [26] V. Tzoumas, C. Amanatidis, and E. Markakis. A game-theoretic analysis of a competitive diffusion process over social networks. In WINE, 2012. [27] I. Valera and M. Gomez-Rodriguez. Modeling adoption of competing products and conventions in social media. In ICDM, 2015. [28] A. Zarezade, A. Khodadadi, M. Farajtabar, H. R. Rabiee, and H. Zha. Correlated cascades: Compete or cooperate. In AAAI, pages 238–244, 2017. 9
2017
671
7,198
Nonlinear Acceleration of Stochastic Algorithms Damien Scieur INRIA, ENS, PSL Research University, Paris France damien.scieur@inria.fr Francis Bach INRIA, ENS, PSL Research University, Paris France francis.bach@inria.fr Alexandre d’Aspremont CNRS, ENS, PSL Research University, Paris France aspremon@ens.fr Abstract Extrapolation methods use the last few iterates of an optimization algorithm to produce a better estimate of the optimum. They were shown to achieve optimal convergence rates in a deterministic setting using simple gradient iterates. Here, we study extrapolation methods in a stochastic setting, where the iterates are produced by either a simple or an accelerated stochastic gradient algorithm. We first derive convergence bounds for arbitrary, potentially biased perturbations, then produce asymptotic bounds using the ratio between the variance of the noise and the accuracy of the current point. Finally, we apply this acceleration technique to stochastic algorithms such as SGD, SAGA, SVRG and Katyusha in different settings, and show significant performance gains. 1 Introduction We focus on the problem min x∈Rd f(x) (1) where f is a L-smooth and µ-strongly convex function with respect to the Euclidean norm, i.e., µ 2 ∥y −x∥2 ≤f(y) −f(x) −∇f(x)T (y −x) ≤L 2 ∥y −x∥2. We consider a stochastic first-order oracle, which gives a noisy estimate of the gradient of f(x), with ∇εf(x) = ∇f(x) + ε, (2) where ε is a noise term with bounded variance. This is the case for example when f is a sum of strongly convex functions, and we only have access to the gradient of one randomly selected function. Stochastic optimization (2) is typically challenging as classical algorithms are not convergent (for example, gradient descent or Nesterov’s accelerated gradient). Even the averaged version of stochastic gradient descent with constant step size does not converge to the solution of (1), but to another point whose proximity to the real minimizer depends of the step size [Nedi´c and Bertsekas, 2001; Moulines and Bach, 2011]. When f is a finite sum of N functions, then algorithms such as SAG [Schmidt et al., 2013], SAGA [Defazio et al., 2014], SDCA [Shalev-Shwartz and Zhang, 2013] and SVRG [Johnson and Zhang, 2013] accelerate convergence using a variance reduction technique akin to control variate in MonteCarlo methods. Their rate of convergence depends on 1 −µ/L and thus does not exhibit an accelerated rate on par with the deterministic setting (in 1 − p µ/L). Recently a generic acceleration algorithm called Catalyst [Lin et al., 2015], based on the proximal point method improved this rate of convergence, but the practical performances highly depends on the input parameters. On the other hand, recent papers, for example [Shalev-Shwartz and Zhang, 2014] (Accelerated SDCA) and 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. [Allen-Zhu, 2016] (Katyusha), propose algorithms with accelerated convergence rates, if the strong convexity parameter is given. When f is a quadratic function then averaged SGD converges, but the rate of decay of initial conditions is very slow. Recently, some results have focused on accelerated versions of SGD for quadratic optimization, showing that with a two step recursion it is possible to enjoy both the optimal rate for the bias and variance terms [Flammarion and Bach, 2015], given an estimate of the ratio between the distance to the solution and the variance of ε. A novel generic acceleration technique was recently proposed by Scieur et al. [2016] in the deterministic setting. This uses iterates from a slow algorithm to extrapolate estimates of the solution with asymptotically optimal convergence rate. Moreover, this rate is reached without prior knowledge of the strong convexity constant, whose online estimation is still a challenge (even in the deterministic case [Fercoq and Qu, 2016]) but required if one wants to obtain optimal rates of convergence. Convergence bounds are derived by Scieur et al. [2016], tracking the difference between the deterministic first-order oracle of (1) and iterates from a linearized model. The main contribution of this paper is to extend the analysis to arbitrary perturbations, including stochastic ones, and to present numerical results when this acceleration method is used to speed up stochastic optimization algorithms. In Section 2 we recall the extrapolation algorithm, and quickly summarize its main convergence bounds in Section 3. In Section 4, we consider a stochastic oracle and analyze its asymptotic convergence in Section 5. Finally, in Section 6 we describe numerical experiments which confirm the theoretical bounds and show the practical efficiency of this acceleration. 2 Regularized Nonlinear Acceleration Consider the optimization problem min x∈Rd f(x) where f is a L−smooth and µ−strongly convex function [Nesterov, 2013]. Applying the fixed-step gradient method to this problem yields the following iterates ˜xt+1 = ˜xt −1 L∇f(˜xt). (3) Let x∗be the unique optimal point, this algorithm is proved to converge with ∥˜xt −x∗∥≤(1 −κ)t∥˜x0 −x∗∥ (4) where ∥· ∥stands for the ℓ2 norm and κ = µ/L ∈[0, 1[ is the (inverse of the) condition number of f [Nesterov, 2013]. Using a two-step recurrence, the accelerated gradient descent by Nesterov [2013] achieves the improved convergence rate ∥˜xt −x∗∥≤O  (1 −√κ)t∥˜x0 −x∗∥  . (5) Indeed, (5) converges faster than (4) but the accelerated algorithm requires the knowledge of µ and L. Extrapolation techniques however obtain a similar convergence rate, but do not need estimates of the parameters µ and L. The idea is based on the comparison between the process followed by ˜xi with a linearized model around the optimum (obtained by the first-order approximation of ∇f(x)), written xt+1 = xt −1 L  ∇f(x∗) | {z } =0 +∇2f(x∗)(xt −x∗)  , x0 = ˜x0. which can be rewritten as xt+1 −x∗= (I −∇2f(x∗)/L)(xt −x∗), x0 = ˜x0. (6) A better estimate of the optimum in (6) can be obtained by forming a linear combination of the iterates (see [Anderson, 1965; Cabay and Jackson, 1976; Mešina, 1977]), with t X i=0 cixi −x∗ ≪∥xt −x∗∥, 2 for some specific ci (either data driven, or derived from Chebyshev polynomials). These procedures were limited to quadratic functions only, i.e. when ˜xi = xi but this was recently extended to generic convex problems by Scieur et al. [2016] and we briefly recall these results below. To simplify the notations, we write ˜xt+1 = g(˜xt) (7) to be one step of algorithm g. We have that g is differentiable, Lipchitz-continuous with constant (1 −κ) < 1, g(x∗) = x∗and g′(x∗) is symmetric. For example, the gradient method (3) matches exactly this definition with g(x) = x −∇f(x)/L. Running k steps of (7) produces a sequence {˜x0, ..., ˜xk}, which we extrapolate using Algorithm 1 from Scieur et al. [2016]. Algorithm 1 Regularized Nonlinear Acceleration (RNA) Input: Iterates ˜x0, ˜x1, ..., ˜xk+1 ∈Rd produced by (7), and a regularization parameter λ > 0. 1: Compute ˜R = [˜r0, ..., ˜rk], where ˜ri = ˜xi+1 −˜xi is the ith residue. 2: Solve ˜cλ = argmin cT 1=1 ∥˜Rc∥2 + λ∥c∥2, or equivalently solve ( ˜RT ˜R + λI)z = 1 then set ˜cλ = z/1T z. Output: Approximation of x∗computed as Pk i=0 ˜cλ i ˜xi For a good choice of λ, the output of Algorithm (1) is a much better estimate of the optimum than ˜xk+1 (or any other points of the sequence). Using a simple grid search on a few values of λ is usually sufficient to improve convergence (see [Scieur et al., 2016] for more details). 3 Convergence of Regularized Nonlinear Acceleration We quickly summarize the argument behind the convergence of Algorithm (1). The theoretical bound compares ˜xi to the iterates produced by the linearized model xt+1 = x∗+ ∇g(x∗)(xt −x∗), x0 = ˜x0. (8) This sequence is useful to extend the convergence results to the nonlinear case, using sensivity analysis. We write cλ the coefficients computed by Algorithm (1) from the “linearized” sequence {x0, ..., xk+1} and the error term can be decomposed into three parts, k X i=0 ˜cλ i ˜xi −x∗ ≤ k X i=0 cλ i xi −x∗ | {z } Acceleration + k X i=0  ˜cλ i −cλ i  (xi −x∗) | {z } Stability + k X i=0 ˜cλ i  ˜xi −xi  | {z } Nonlinearity . (9) Scieur et al. [2016] show that convergence is guaranteed as long as the errors (˜xi −x∗) and (xi −˜xi) converge to zero fast enough, which ensures a good rate of decay for the regularization parameter λ, leading to an asymptotic rate equivalent to the accelerated rate in (5). In this section, we will use results from Scieur et al. [2016] to bound each individual term, but in this paper we improve the final convergence result. The stability term (in ˜cλ −cλ) is bounded using the perturbation matrix P ≜RT R −˜RT ˜R, (10) where R and ˜R are the matrices of residuals, R ≜[r0...rk] rt = xt+1 −xt, (11) ˜R ≜[˜r0...˜rk] ˜rt = ˜xt+1 −˜xt. (12) The proofs of the following propositions were obtained by Scieur et al. [2016]. 3 Proposition 3.1 (Stability). Let ∆cλ = ˜cλ −cλ be the gap between the coefficients computed by Algorithm (1) using the sequences {˜xi} and {xi} with regularization parameter λ. Let P = RT R −˜RT ˜R be defined in (10), (11) and (12). Then ∥∆cλ∥ ≤ ∥P ∥ λ ∥cλ∥. (13) This implies that the stability term is bounded by ∥Pk i=0 ∆cλ i (xi −x∗)∥ ≤ ∥P ∥ λ ∥cλ∥O(∥x0 −x∗∥). (14) The term Nonlinearity is bounded by the norm of the coefficients ˜cλ (controlled thanks to the regularization parameter) times the norm of the noise matrix E = [x0 −˜x0, x1 −˜x1, ..., xk −˜xk]. (15) Proposition 3.2 (Nonlinearity). Let ˜cλ be computed by Algorithm 1 using the sequence {˜x0, ..., ˜xk+1} with regularization parameter λ and ˜R be defined in (12). The norm of ˜cλ is bounded by ∥˜cλ∥≤ q ∥˜ R∥2+λ (k+1)λ ≤ 1 √k+1 q 1 + ∥˜ R∥2 λ . (16) This bounds the nonlinearity term because Pk i=0 ˜cλ i (˜xi −xi) ≤ q 1 + ∥˜ R∥2 λ ∥E∥ √k+1, (17) where E is defined in (15). These two propositions show that the regularization in Algorithm 1 limits the impact of the noise: the higher λ is, the smaller these terms are. It remains to control the acceleration term. For small λ, this term decreases as fast as the accelerated rate (5), as shown in the following proposition. Proposition 3.3 (Acceleration). Let Pk be the subspace of real polynomials of degree at most k and Sκ(k, α) be the solution of the Regularized Chebychev Polynomial problem, Sκ(k, α) ≜min p∈Pk max x∈[0,1−κ] p2(x) + α∥p∥2 s.t. p(1) = 1. (18) Let ¯λ ≜ λ ∥x0−x∗∥2 be the normalized value of λ. The acceleration term is bounded by Pk i=0 cλ i xi −x∗ ≤1 κ p Sκ(k, ¯λ)∥x0 −x∗∥2 −λ∥cλ∥2. (19) We also get the following corollary, which will be useful for the asymptotic analysis of the rate of convergence of Algorithm 1. Corollary 3.4. If λ →0, the bound (19) becomes Pk i=0 cλ i xi −x∗ ≤1 κ  1−√κ 1+√κ k ∥x0 −x∗∥. Proof. When λ = 0, (19) becomes 1 κ p Sκ(k, 0)∥x0−x∗∥. The exact value of p Sκ(k, 0) is obtained by using the coefficients of a re-scaled Chebyshev polynomial, derived by Golub and Varga [1961]; Scieur et al. [2016], and is equal to 1−√κ 1+√κ. These last results controlling stability, nonlinearity and acceleration are proved by Scieur et al. [2016]. We now refine the final step of Scieur et al. [2016] to produce a global bound on the error that will allow us to extend these results to the stochastic setting in the next sections. Theorem 3.5. If Algorithm 1 is applied to the sequence ˜xi with regularization parameter λ, it converges with rate k X i=0 ˜cλ i ˜xi ≤∥x0 −x∗∥S 1 2κ (k, ¯λ) r 1 κ2 + O(∥x −x∗∥2)∥P∥2 λ3 + ∥E∥ √ k + 1 s 1 + ∥˜R∥2 λ . (20) 4 Proof. The proof is inspired by Scieur et al. [2016] and is straightforward. We can bound (9) using (14) (Stability), (17) (Nonlinearity) and (19) (Acceleration). It remains to maximize over the value of ∥cλ∥using the result of Proposition A.2. This last bound is not very explicit, in particular because of the regularized Chebyshev term Sκ(k, ¯λ). The solution is well known when ¯λ = 0 since it corresponds exactly to the rescaled Chebyshev polynomial [Golub and Varga, 1961], but as far as we know there is no known result about its regularized version, thus making the "finite-step" version hard to analyze. However, an asymptotic analysis simplifies it considerably. The next new proposition shows that when x0 is close to x∗, then extrapolation converges as fast as in (5) in some cases. Proposition 3.6. Assume ∥˜R∥= O(∥x0 −x∗∥), ∥E∥= O(∥x0 −x∗∥2) and ∥P∥= O(∥x0 −x∗∥3). If we chose λ = O(∥x0 −x∗∥s) with s ∈[2, 8 3] then the bound (20) becomes lim ∥x0−x∗∥→0 ∥Pk i=0 ˜cλ i ˜xi∥ ∥x0 −x∗∥ ≤1 κ 1 −√κ 1 + √κ k . Proof. (Sketch) The proof is based on the fact that λ decreases slowly enough to ensure that the Stability and Nonlinearity terms vanish over time, but fast enough to have ¯λ = λ ∥x0−x∗∥2 →0. Then it remains to bound Sκ(k, 0) with Corollary 3.4. The complete proof can be found in the Supplementary materials. Note: The assumptions are satisfied if we apply the gradient method on a twice differentiable, smooth and strongly convex function with Lipchitz-continuous Hessian [Scieur et al., 2016]. The efficiency of Algorithm 1 is thus ensured by two conditions. First, we need to be able to bound ∥˜R∥, ∥P∥and ∥E∥by decreasing quantities. Second, we have to find a proper rate of decay for λ and ¯λ such that the stability and nonlinearity terms go to zero when perturbations also go to zero. If these two conditions are met, then the accelerated rate in Proposition 3.6 holds. 4 Nonlinear and Noisy Updates In (7) we defined g(x) to be non linear, which generates a sequence ˜xi. We now consider noisy iterates ˜xt+1 = g(˜xt) + ηt+1, (21) where ηt is a stochastic noise. To simplify notations, we write (21) as ˜xt+1 = x∗+ G(˜xt −x∗) + εt+1, (22) where εt is a stochastic noise (potentially correlated with the iterates xi) with bounded mean νt, ∥νt∥≤ν and bounded covariance Σt ⪯(σ2/d)I. We also assume 0I ⪯G ⪯(1 −κ)I and G is symmetric. For example, (22) can be linked to (21) if we set εt = ηt + O(∥˜xt −x∗∥2), which corresponds to the combination of the noise ηt+1 with the Taylor remainder of g(x) around x∗, i.e., ˜xt+1 = g(˜xt) + ηt+1 = g(x∗) | {z } =x∗ + ∇g(x∗) | {z } =G (˜xt −x∗) + O(∥˜xt −x∗∥) + ηt+1 | {z } =ϵt+1 . The recursion (22) is also valid when we apply the stochastic gradient method with fixed step size h to the quadratic problem minx 1 2∥Ax −b∥2. This corresponds to (22) with G = I −hAT A and mean ν = 0. For the theoretical results, we will compare ˜xt with their noiseless counterpart to control convergence, xt+1 = x∗+ G(xt −x∗), x0 = ˜x0. (23) 5 5 Convergence Analysis when Accelerating Stochastic Algorithms We will control convergence in expectation. Bound (9) now becomes E " k X i=0 ˜cλ i ˜xi −x∗ # ≤ k X i=0 cλ i xi −x∗ + O(∥x0 −x∗∥)E h ∥∆cλ∥ i + E h ∥˜cλ∥∥E∥ i . (24) We now need to enforce bounds (14), (17) and (19) in expectation. The proofs of the two next propositions are in the supplementary material. For simplicity, we will omit all constants in what follows. Proposition 5.1. Consider the sequences xi and ˜xi generated by (21) and (23). Then, E[∥˜R∥] ≤ O(∥x0 −x∗∥) + O(ν + σ), (25) E[∥E∥] ≤ O(ν + σ), (26) E[∥P∥] ≤ O((σ + ν)∥x0 −x∗∥) + O((ν + σ)2). (27) We define the following stochastic condition number τ ≜ ν + σ ∥x0 −x∗∥. The Proposition 5.2 gives the result when injecting these bounds in (24). Proposition 5.2. The accuracy of extrapolation Algorithm 1 applied to the sequence {˜x0, ..., ˜xk} generated by (21) is bounded by E h ∥Pk i=0 ˜cλ i ˜xi −x∗∥ i ∥x0 −x∗∥ ≤ Sκ(k, ¯λ) r 1 κ2 + O(τ 2(1 + τ)2) ¯λ3 + O r τ 2 + τ 2(1 + τ 2) ¯λ !! . (28) Consider a situation where τ is small, e.g. when using stochastic gradient descent with fixed step-size, with x0 far from x∗. The following proposition details the dependence between ¯λ and τ ensuring the upper convergence bound remains stable when τ goes to zero. Proposition 5.3. When τ →0, if ¯λ = Θ(τ s) with s ∈]0, 2 3[, we have the accelerated rate E  ∥Pk i=0 ˜cλ i ˜xi −x∗∥  ≤1 κ  1−√κ 1+√κ k ∥x0 −x∗∥. (29) Moreover, if λ →∞, we recover the averaged gradient, E  ∥Pk i=0 ˜cλ i ˜xi −x∗∥  = E h 1 k+1 Pk i=0 ˜xi −x∗ i . Proof. Let ¯λ = Θ(τ s), using (28) we have E h Pk i=0 ˜cλ i ˜xi −x∗ i ≤ ∥x0 −x∗∥Sκ(k, τ s) q 1 κ2 O(τ 2−3s(1 + τ)2) +∥x0 −x∗∥O( p τ 2 + τ 2−3s(1 + τ 2)). Because s ∈]0, 2 3[, means 2 −3s > 0, thus limτ→0 τ 2−3s = 0. The limits when τ →0 is thus exactly (29). If λ →∞, we have also lim λ→∞˜cλ = lim λ→∞argminc:1T c=1 ∥˜Rc∥+ λ∥c∥2 = argminc:1T c=1 ∥c∥2 = 1 k+1 which yields the desired result. Proposition 5.3 shows that Algorithm 1 is thus asymptotically optimal provided λ is well chosen because it recovers the accelerated rate for smooth and strongly convex functions when the perturbations goes to zero. Moreover, we recover Proposition 3.6 when ϵt is the Taylor remainder, i.e. with ν = O(∥x0 −x∗∥2) and σ = 0, which matches the deterministic results. Algorithm 1 is particularly efficient when combined with a restart scheme [Scieur et al., 2016]. From a theoretical point of view, the acceleration peak arises for small values of k. Empirically, the 6 improvement is usually more important at the beginning, i.e. when k is small. Finally, the algorithmic complexity is O(k2d), which is linear in the problem dimension when k remains bounded. The benefits of extrapolation are limited in a regime where the noise dominates. However, when τ is relatively small then we can expect a significant speedup. This condition is satisfied in many cases, for example at the initial phase of the stochastic gradient descent or when optimizing a sum of functions with variance reduction techniques, such as SAGA or SVRG. 6 Numerical Experiments 6.1 Stochastic gradient descent We want to solve the least-squares problem min x∈Rd F(x) = 1 2∥Ax −b∥2, where AT A satisfies µI ⪯(AT A) ⪯LI. To solve this problem, we have access to the stochastic first-order oracle ∇εF(x) = ∇F(x) + ε, where ε is a zero-mean noise of covariance matrix Σ ⪯σ2 d I. We will compare several methods. • SGD. Fixed step-size, xt+1 = xt −1 L∇εF(xt). • Averaged SGD. Iterate xk is the mean of the k first iterations of SGD. • AccSGD. The optimal two-step algorithm in Flammarion and Bach [2015], with optimal parameters (this implies ∥x0 −x∗∥and σ are known exactly). • RNA+SGD. The regularized nonlinear acceleration Algorithm 1 applied to a sequence of k iterates of SGD, with k = 10 and λ = ∥˜RT ˜R∥/10−6. By Proposition 5.2, we know that RNA+SGD will not converge to arbitrary precision because the noise is additive with a non-vanishing variance. However, Proposition 5.3 predicts an improvement of the convergence at the beginning of the process. We illustrate this behavior in Figure 1. We clearly see that at the beginning, the performance of RNA+SGD is comparable to that of the optimal accelerated algorithm. However, because of the restart strategy, in the regime where the level of noise becomes more important the acceleration becomes less effective and finally the convergence stalls, as for SGD. Of course, for practical purposes, the first regime is the most important because it effectively minimizes the generalization error [Défossez and Bach, 2015; Jain et al., 2016]. 6.2 Finite sums of functions We focus on the composite problem minx∈Rd F(x) = PN i=1 1 N fi(x) + µ 2 ∥x∥2, where fi are convex and L-smooth functions and µ is the regularization parameter. We will use classical methods for minimizing F(x) such as SGD (with fixed step size), SAGA [Defazio et al., 2014], SVRG [Johnson and Zhang, 2013], and also the accelerated algorithm Katyusha [Allen-Zhu, 2016]. We will compare their performance with and without the (potential) acceleration provided by Algorithm 1 with restart after k data passes. The parameter λ is found by a grid search of size k, the size of the input sequence, but it adds only one data pass at each extrapolation. Actually, the grid search can be faster if we approximate F(x) with fewer samples, but we choose to present Algorithm 1 in its simplest version. We set k = 10 for all the experiments. In order to balance the complexity of the extrapolation algorithm and the optimization method we wait several data queries before adding the current point (the “snapshot”) of the method to the sequence. Indeed, the extrapolation algorithm has a complexity of O(k2d) + O(N) (computing the coefficients ˜cλ and the grid search over λ). If we wait at least O(N) updates, then the extrapolation method is of the same order of complexity as the optimization algorithm. • SGD. We add the current point after N data queries (i.e. one epoch) and k snapshots of SGD cost kN data queries. 7 PSfrag replacements SGD Ave. SGD Acc. SGD RNA + SGD 10 0 10 2 10 4 10 -2 10 0 10 2 PSfrag replacements SGD Ave. SGD Acc. SGD RNA + SGD Iteration f(x) −f(x∗) 10 0 10 2 10 4 10 0 10 2 PSfrag replacements SGD Ave. SGD Acc. SGD RNA + SGD Iteration f(x) −f(x∗) 10 0 10 2 10 4 10 1 10 2 10 3 10 4 PSfrag replacements SGD Ave. SGD Acc. SGD RNA + SGD Iteration f(x) −f(x∗) Left: σ = 10, κ = 10−2. Center: σ = 1000, κ = 10−2. Right: σ = 1000, κ = 10−6. 10 0 10 2 10 4 10 -2 10 0 10 2 PSfrag replacements SGD Ave. SGD Acc. SGD RNA + SGD Iteration f(x) −f(x∗) f(x) −f(x∗) 10 0 10 2 10 4 10 0 10 2 PSfrag replacements SGD Ave. SGD Acc. SGD RNA + SGD Iteration f(x) −f(x∗) f(x) −f(x∗) 10 0 10 2 10 4 10 0 10 1 10 2 10 3 PSfrag replacements SGD Ave. SGD Acc. SGD RNA + SGD Iteration f(x) −f(x∗) f(x) −f(x∗) Left: σ = 10, κ = 1/d. Center: σ = 100, κ = 1/d. Right: σ = 1000, κ = 1/d. Figure 1: Comparison of performance between SGD, averaged SGD, Accelerated SGD [Flammarion and Bach, 2015] and RNA+SGD. We tested the performance on a matrix AT A of size d = 500, with (top) random eigenvalues between κ and 1 and (bottom) decaying eigenvalues from 1 to 1/d. We start at ∥x0 −x∗∥= 104, where x0 and x∗are generated randomly. • SAGA. We compute the gradient table exactly, then we add a new point after N queries, and k snapshots of SAGA cost (k + 1)N queries. Since we optimize a sum of quadratic or logistic losses, we used the version of SAGA which stores O(N) scalars. • SVRG. We compute the gradient exactly, then perform N queries (the inner-loop of SVRG), and k snapshots of SVRG cost 2kN queries. • Katyusha. We compute the gradient exactly, then perform 4N gradient calls (the inner-loop of Katyusha), and k snapshots of Katyusha cost 3kN queries. We compare these various methods for solving least-squares regression and logistic regression on several datasets (Table 1), with several condition numbers κ: well (κ = 100/N), moderately (κ = 1/N) and badly (κ = 1/100N) conditioned. In this section, we present the numerical results on Sid (Sido0 dataset, where N = 12678 and d = 4932) with bad conditioning, see Figure 2. The other experiments are highlighted in the supplementary material. In Figure 2, we clearly see that both SGD and RNA+SGD do not converge. This is mainly due to the fact that we do not average the points. In any case, except for quadratic problems, the averaged version of SGD does not converge to the minimum of F with arbitrary precision. We also notice that Algorithm 1 is unable to accelerate Katyusha. This issue was already raised by Scieur et al. [2016]: when the algorithm has a momentum term (like Nesterov’s method), the underlying dynamical system is harder to extrapolate, in particular because the matrix presents in the linearized version of such systems is not symmetric. Because the iterates of SAGA and SVRG have low variance, their accelerated version converges faster to the optimum, and their performance are then comparable to Katyusha. In our experiments, Katyusha was faster than RNA+SAGA only once, when solving a least square problem on Sido0 8 0 200 400 10 -10 10 -5 PSfrag replacements f(x) −f(x∗) Epoch 0 50 100 150 200 10 -10 10 -5 PSfrag replacements f(x) −f(x∗) Epoch Time (sec) 0 200 400 10 -10 10 -5 PSfrag replacements f(x) −f(x∗) Epoch Time (sec) f(x) −f(x∗) Epoch 0 100 200 300 10 -10 10 -5 PSfrag replacements f(x) −f(x∗) Epoch Time (sec) f(x) −f(x∗) Epoch Time (sec) PSfrag replacements f(x) −f(x∗) Epoch Time (sec) f(x) −f(x∗) Epoch Time (sec) SAGA SGD SVRG Katyusha RNA+SAGA RNA+SGD RNA+SVRG RNA+Kat. Figure 2: Optimization of quadratic loss (Top) and logistic loss (Bottom) with several algorithms, using the Sid dataset with bad conditioning. The experiments are done in Matlab. Left: Error vs epoch number. Right: Error vs time. with a bad condition number. Recall however that the acceleration Algorithm 1 does not require the specification of the strong convexity parameter, unlike Katyusha. Acknowledgments The authors would like to acknowledge support from a starting grant from the European Research Council (ERC project SIPA), from the European Union’s Seventh Framework Programme (FP7PEOPLE-2013-ITN) under grant agreement number 607290 SpaRTaN, as well as support from the chaire Économie des nouvelles données with the data science joint research initiative with the fonds AXA pour la recherche and a gift from Société Générale Cross Asset Quantitative Research. 9 References Allen-Zhu, Z. [2016], ‘Katyusha: The first direct acceleration of stochastic gradient methods’, arXiv preprint arXiv:1603.05953 . Anderson, D. G. [1965], ‘Iterative procedures for nonlinear integral equations’, Journal of the ACM (JACM) 12(4), 547–560. Cabay, S. and Jackson, L. [1976], ‘A polynomial extrapolation method for finding limits and antilimits of vector sequences’, SIAM Journal on Numerical Analysis 13(5), 734–752. Defazio, A., Bach, F. and Lacoste-Julien, S. [2014], Saga: A fast incremental gradient method with support for non-strongly convex composite objectives, in ‘Advances in Neural Information Processing Systems’, pp. 1646–1654. Défossez, A. and Bach, F. [2015], Averaged least-mean-squares: Bias-variance trade-offs and optimal sampling distributions, in ‘Artificial Intelligence and Statistics’, pp. 205–213. Fercoq, O. and Qu, Z. [2016], ‘Restarting accelerated gradient methods with a rough strong convexity estimate’, arXiv preprint arXiv:1609.07358 . Flammarion, N. and Bach, F. [2015], From averaging to acceleration, there is only a step-size, in ‘Conference on Learning Theory’, pp. 658–695. Golub, G. H. and Varga, R. S. [1961], ‘Chebyshev semi-iterative methods, successive overrelaxation iterative methods, and second order richardson iterative methods’, Numerische Mathematik 3(1), 147–156. Jain, P., Kakade, S. M., Kidambi, R., Netrapalli, P. and Sidford, A. [2016], ‘Parallelizing stochastic approximation through mini-batching and tail-averaging’, arXiv preprint arXiv:1610.03774 . Johnson, R. and Zhang, T. [2013], Accelerating stochastic gradient descent using predictive variance reduction, in ‘Advances in Neural Information Processing Systems’, pp. 315–323. Lin, H., Mairal, J. and Harchaoui, Z. [2015], A universal catalyst for first-order optimization, in ‘Advances in Neural Information Processing Systems’, pp. 3384–3392. Mešina, M. [1977], ‘Convergence acceleration for the iterative solution of the equations x= ax+ f’, Computer Methods in Applied Mechanics and Engineering 10(2), 165–173. Moulines, E. and Bach, F. R. [2011], Non-asymptotic analysis of stochastic approximation algorithms for machine learning, in ‘Advances in Neural Information Processing Systems’, pp. 451–459. Nedi´c, A. and Bertsekas, D. [2001], Convergence rate of incremental subgradient algorithms, in ‘Stochastic optimization: algorithms and applications’, Springer, pp. 223–264. Nesterov, Y. [2013], Introductory lectures on convex optimization: A basic course, Vol. 87, Springer Science & Business Media. Schmidt, M., Le Roux, N. and Bach, F. [2013], ‘Minimizing finite sums with the stochastic average gradient’, Mathematical Programming pp. 1–30. Scieur, D., d’Aspremont, A. and Bach, F. [2016], Regularized nonlinear acceleration, in ‘Advances In Neural Information Processing Systems’, pp. 712–720. Shalev-Shwartz, S. and Zhang, T. [2013], ‘Stochastic dual coordinate ascent methods for regularized loss minimization’, Journal of Machine Learning Research 14(Feb), 567–599. Shalev-Shwartz, S. and Zhang, T. [2014], Accelerated proximal stochastic dual coordinate ascent for regularized loss minimization., in ‘ICML’, pp. 64–72. 10
2017
672
7,199
Multi-way Interacting Regression via Factorization Machines Mikhail Yurochkin Department of Statistics University of Michigan moonfolk@umich.edu XuanLong Nguyen Department of Statistics University of Michigan xuanlong@umich.edu Nikolaos Vasiloglou LogicBlox nikolaos.vasiloglou@logicblox.com Abstract We propose a Bayesian regression method that accounts for multi-way interactions of arbitrary orders among the predictor variables. Our model makes use of a factorization mechanism for representing the regression coefficients of interactions among the predictors, while the interaction selection is guided by a prior distribution on random hypergraphs, a construction which generalizes the Finite Feature Model. We present a posterior inference algorithm based on Gibbs sampling, and establish posterior consistency of our regression model. Our method is evaluated with extensive experiments on simulated data and demonstrated to be able to identify meaningful interactions in applications in genetics and retail demand forecasting.1 1 Introduction A fundamental challenge in supervised learning, particularly in regression, is the need for learning functions which produce accurate prediction of the response, while retaining the explanatory power for the role of the predictor variables in the model. The standard linear regression method is favored for the latter requirement, but it fails the former when there are complex interactions among the predictor variables in determining the response. The challenge becomes even more pronounced in a high-dimensional setting – there are exponentially many potential interactions among the predictors, for which it is simply not computationally feasible to resort to standard variable selection techniques (cf. Fan & Lv (2010)). There are numerous examples where accounting for the predictors’ interactions is of interest, including problems of identifying epistasis (gene-gene) and gene-environment interactions in genetics (Cordell, 2009), modeling problems in political science (Brambor et al., 2006) and economics (Ai & Norton, 2003). In the business analytics of retail demand forecasting, a strong prediction model that also accurately accounts for the interactions of relevant predictors such as seasons, product types, geography, promotions, etc. plays a critical role in the decision making of marketing design. A simple way to address the aforementioned issue in the regression problem is to simply restrict our attention to lower order interactions (i.e. 2- or 3-way) among predictor variables. This can be achieved, for instance, via a support vector machine (SVM) using polynomial kernels (Cristianini & Shawe-Taylor, 2000), which pre-determine the maximum order of predictor interactions. In practice, for computational reasons the degree of the polynomial kernel tends to be small. Factorization machines (Rendle, 2010) can be viewed as an extension of SVM to sparse settings where most 1Code is available at https://github.com/moonfolk/MiFM. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. interactions are observed only infrequently, subject to a constraint that the interaction order (a.k.a. interaction depth) is given. Neither SVM nor FM can perform any selection of predictor interactions, but several authors have extended the SVM by combining it with ℓ1 penalty for the purpose of feature selection (Zhu et al., 2004) and gradient boosting for FM (Cheng et al., 2014) to select interacting features. It is also an option to perform linear regression on as many interactions as we can and combine it with regularization procedures for selection (e.g. LASSO (Tibshirani, 1996) or Elastic net (Zou & Hastie, 2005)). It is noted that such methods are still not computationally feasible for accounting for interactions that involve a large number of predictor variables. In this work we propose a regression method capable of adaptive selection of multi-way interactions of arbitrary order (MiFM for short), while avoiding the combinatorial complexity growth encountered by the methods described above. MiFM extends the basic factorization mechanism for representing the regression coefficients of interactions among the predictors, while the interaction selection is guided by a prior distribution on random hypergraphs. The prior, which does not insist on the upper bound on the order of interactions among the predictor variables, is motivated from but also generalizes Finite Feature Model, a parametric form of the well-known Indian Buffet process (IBP) (Ghahramani & Griffiths, 2005). We introduce a notion of the hypergraph of interactions and show how a parametric distribution over binary matrices can be utilized to express interactions of unbounded order. In addition, our generalized construction allows us to exert extra control on the tail behavior of the interaction order. IBP was initially used for infinite latent feature modeling and later utilized in the modeling of a variety of domains (see a review paper by Griffiths & Ghahramani (2011)). In developing MiFM, our contributions are the following: (i) we introduce a Bayesian multi-linear regression model, which aims to account for the multi-way interactions among predictor variables; part of our model construction includes a prior specification on the hypergraph of interactions — in particular we show how our prior can be used to model the incidence matrix of interactions in several ways; (ii) we propose a procedure to estimate coefficients of arbitrary interactions structure; (iii) we establish posterior consistency of the resulting MiFM model, i.e., the property that the posterior distribution on the true regression function represented by the MiFM model contracts toward the truth under some conditions, without requiring an upper bound on the order of the predictor interactions; and (iv) we present a comprehensive simulation study of our model and analyze its performance for retail demand forecasting and case-control genetics datasets with epistasis. The unique strength of the MiFM method is the ability to recover meaningful interactions among the predictors while maintaining a competitive prediction quality compared to existing methods that target prediction only. The paper proceeds as follows. Section 2 introduces the problem of modeling interactions in regression, and gives a brief background on the Factorization Machines. Sections 3 and 4 carry out the contributions outlined above. Section 5 presents results of the experiments. We conclude with a discussion in Section 6. 2 Background and related work Our starting point is a model which regresses a response variable y ∈R to observed covariates (predictor variables) x ∈RD by a non-linear functional relationship. In particular, we consider a multi-linear structure to account for the interactions among the covariates in the model: E(Y |x) = w0 + D X i=1 wixi + J X j=1 βj Y i∈Zj xi. (1) Here, wi for i = 0, . . . , D are bias and linear weights as in the standard linear regression model, J is the number of multi-way interactions where Zj, βj for j = 1, . . . , J represent the interactions, i.e., sets of indices of interacting covariates and the corresponding interaction weights, respectively. Fitting such a model is very challenging even if dimension D is of magnitude of a dozen, since there are 2D −1 possible interactions to choose from in addition to other parameters. The goal of our work is to perform interaction selection and estimate corresponding weights. Before doing so, let us first discuss a model that puts a priori assumptions on the number and the structure of interactions. 2 2.1 Factorization Machines Factorization Machines (FM) (Rendle, 2010) is a special case of the general interactions model defined in Eq. (1). Let J = Pd l=2 D l  and Z := SJ j=1 Zj = Sd l=2{(i1, . . . , il)|i1 < . . . < il; i1, . . . , il ∈{1, . . . , D}}. I.e., restricting the set of interactions to 2, . . . , d-way, so (1) becomes: E(Y |x) = w0 + D X i=1 wixi + d X l=2 D X i1=1 . . . D X il=il−1+1 βi1,...,il lY t=1 xit, (2) where coefficients βj := βi1,...,il quantify the interactions. In order to reduce model complexity and handle sparse data more effectively, Rendle (2010) suggested to factorize interaction weights using PARAFAC (Harshman, 1970): βi1,...,il := Pkl f=1 Ql t=1 v(l) it,f, where V (l) ∈RD×kl, kl ∈N and kl ≪D for l = 2, . . . , d. Advantages of the FM over SVM are discussed in details by Rendle (2010). FMs turn out to be successful in the recommendation systems setups, since they utilize various context information (Rendle et al., 2011; Nguyen et al., 2014). Parameter estimation is typically achieved via stochastic gradient descent technique, or in the case of Bayesian FM (Freudenthaler et al., 2011) via MCMC. In practice only d = 2 or d = 3 are typically used, since the number of interactions and hence the computational complexity grow exponentially. We are interested in methods that can adapt to fewer interactions but of arbitrarily varying orders. 3 MiFM: Multi-way Factorization Machine We start by defining a mathematical object that can encode sets of interacting variables Z1, . . . , ZJ of Eq. (1) and selecting an appropriate prior to model it. 3.1 Modeling hypergraph of interactions Multi-way interactions are naturally represented by hypergraphs, which are defined as follows. Definition 1. Given D vertices indexed by S = {1, . . . , D}, let Z = {Z1, . . . , ZJ} be the set of J subsets of S. Then we say that G = (S, Z) is a hypergraph with D vertices and J hyperedges. A hypergraph can be equivalently represented as an incidence binary matrix. Therefore, with a bit abuse of notation, we recast Z as the matrix of interactions, i.e., Z ∈{0, 1}D×J, where Zi1j = Zi2j = 1 iff i1 and i2 are part of a hyperedge indexed by column/interaction j. Placing a prior on multi-way interactions is the same as specifying the prior distribution on the space of binary matrices. We will at first adopt the Finite Feature Model (FFM) prior (Ghahramani & Griffiths, 2005), which is based on the Beta-Bernoulli construction: πj|γ1, γ2 iid ∼Beta(γ1, γ2) and Zij|πj iid ∼Bernoulli(πj). This simple prior has the attractive feature of treating the variables involved in each interaction (hyperedge) in an symmetric fashion and admits exchangeabilility among the variables inside interactions. In Section 4 we will present an extension of FFM which allows to incorporate extra information about the distribution of the interaction degrees and explain the choice of the parametric construction. 3.2 Modeling regression with multi-way interactions Now that we know how to model unknown interactions of arbitrary order, we combine it with the Bayesian FM to arrive at a complete specification of MiFM, the Multi-way interacting Factorization Machine. Starting with the specification for hyperparameters: σ ∼Γ(α1/2, β1/2), λ ∼Γ(α0/2, β0/2), µ ∼N(µ0, 1/γ0), λk ∼Γ(α0/2, β0/2), µk ∼N(µ0, 1/γ0) for k = 1, . . . , K. Interactions and their weights: wi|µ, λ ∼N(µ, 1/λ) for i = 0, . . . , D, Z ∼FFM(γ1, γ2), vik|µk, λk ∼N(µk, 1/λk) for i = 1, . . . , D; k = 1, . . . , K. 3 Likelihood specification given data pairs (yn, xn = (xn1, . . . , xnD))N n=1: yn|Θ ∼N(y(xn, Θ), σ), where y(x, Θ) := w0 + PD i=1 wixi + PJ j=1 PK k=1 Q i∈Zj xivik, (3) for n = 1, . . . , N, and Θ = {Z, V, σ, w0,...,D}. Note that while the specification above utilizes Gaussian distributions, the main innovation of MiFM is the idea to utilize incidence matrix of the hypergraph of interactions Z with a low rank matrix V to model the mean response as in Eq. 1. Therefore, within the MiFM framework, different distributional choices can be made according to the problem at hand — e.g. Poisson likelihood and Gamma priors for count data or logistic regression for classification. Additionally, if selection of linear terms is desired, PD i=1 wixi can be removed from the model since FFM can select linear interactions besides higher order ones. 3.3 MiFM for Categorical Variables In numerous real world scenarios such as retail demand forecasting, recommender systems, genotype structures, most predictor variables may be categorical (e.g. color, season). Categorical variables with multiple attributes are often handled by so-called “one-hot encoding”, via vectors of binary variables (e.g., IS_blue; IS_red), which must be mutually exclusive. The FFM cannot immediately be applied to such structures since it assigns positive probability to interactions between attributes of the same category. To this end, we model interactions between categories in Z, while with V we model coefficients of interactions between attributes. For example, for an interaction between “product type” and “season” in Z, V will have individual coefficients for “jacket-summer” and “jacket-winter” leading to a more refined predictive model of jackets sales (see examples in Section 5.2). We proceed to describe MiFM for the case of categorical variables as follows. Let U be the number of categories and du be the set of attributes for the category u, for u = 1, . . . , U. Then D = PU u=1 card(du) is the number of binary variables in the one-hot encoding and FU u=1 du = {1, . . . , D}. In this representation the input data of predictors is X, a N × U matrix, where xnu is an active attribute of category u of observation n. Coefficients matrix V ∈RD×K and interactions Z ∈{0, 1}U×J. All priors and hyperpriors are as before, while the mean response (3) is replaced by: y(x, Θ) := w0 + U X u=1 wxu + K X k=1 J X j=1 Y u∈Zj vxuk. (4) Note that this model specification is easy to combine with continuous variables, allowing MiFM to handle data with different variable types. 3.4 Posterior Consistency of the MiFM In this section we shall establish posterior consistency of MiFM model, namely: the posterior distribution Π of the conditional distribution P(Y |X), given the training N-data pairs, contracts in a weak sense toward the truth as sample size N increases. Suppose that the data pairs (xn, yn)N n=1 ∈RD × R are i.i.d. samples from the joint distribution P ∗(X, Y ), according to which the marginal distribution for X and the conditional distribution of Y given X admit density functions f ∗(x) and f ∗(y|x), respectively, with respect to Lebesgue measure. In particular, f ∗(y|x) is defined by Y = yn|X = xn, Θ∗∼N(y(xn, Θ∗), σ), where Θ∗= {β∗ 1, . . . , β∗ J, Z∗ 1, . . . , Z∗ J}, y(x, Θ∗) := J X j=1 β∗ j Y i∈Z∗ j xi, and xn ∈RD, yn ∈R, β∗ j ∈R, Z∗ j ⊂{1, . . . , D} (5) for n = 1, . . . , N, j = 1, . . . , J. In the above Θ∗represents the true parameter for the conditional density f ∗(y|x) that generates data sample yn given xn, for n = 1, . . . , N. A key step in establishing posterior consistency for the MiFM (here we omit linear terms since, as mentioned earlier, they can be absorbed into the interaction structure) is to show that our PARAFAC type structure can approximate arbitrarily well the true coefficients β∗ 1, . . . , β∗ J for the model given by (1). Lemma 1. Given natural number J ≥1, βj ∈R \ {0} and Zj ⊂{1, . . . , D} for j = 1, . . . J, exists K0 < J such that for all K ≥K0 system of polynomial equations βj = PK k=1 Q i∈Zj vik, j = 1, . . . , m has at least one solution in terms of v11, . . . , vDK. 4 The upper bound K0 = J −1 is only required when all interactions are of the depth D −1. This is typically not expected to be the case in practice, therefore smaller values of K are often sufficient. By conditioning on the training data pairs (xn, yn) to account for the likelihood induced by the PARAFAC representation, the statistician obtains the posterior distribution on the parameters of interest, namely, Θ := (Z, V ), which in turn induces the posterior distribution on the conditional density, to be denoted by f(y|x), according to the MiFM model (3) without linear terms. The main result of this section is to show that under some conditions this posterior distribution Π will place most of its mass on the true conditional density f ∗(y|x) as N →∞. To state the theorem precisely, we need to adopt a suitable notion of weak topology on the space of conditional densities, namely the set of f(y|x), which is induced by the weak topology on the space of joint densities on X, Y , that is the set of f(x, y) = f ∗(x)f(y|x), where f ∗(x) is the true (but unknown) marginal density on X (see Ghosal et al. (1999), Sec. 2 for a formal definition). Theorem 1. Given any true conditional density f ∗(y|x) given by (5), and assuming that the support of f ∗(x) is bounded, there is a constant K0 < J such that by setting K ≥K0, the following statement holds: for any weak neighborhood U of f ∗(y|x), under the MiFM model, the posterior probability Π(U|(Xn, Yn)N n=1) →1 with P ∗-probability one, as N →∞. The proof’s sketch for this theorem is given in the Supplement. 4 Prior constructions for interactions: FFM revisited and extended The adoption of the FFM prior on the hypergraph of interactions carries a distinct behavior in contrast to the typical Latent Feature modeling setting. In a standard Latent Feature modeling setting (Griffiths & Ghahramani, 2011), each row of Z describes one of the data points in terms of its feature representation; controlling row sums is desired to induce sparsity of the features. By contrast, for us a column of Z is identified with an interaction; its sum represents the interaction depth, which we want to control a priori. Interaction selection using MCMC sampler One interesting issue of practical consequence arises in the aggregation of the MCMC samples (details of the sampler are in the Supplement). When aggregating MCMC samples in the context of latent feature modeling one would always obtain exactly J latent features. However, in interaction modeling, different samples might have no interactions in common (i.e. no exactly matching columns), meaning that support of the resulting posterior estimate can have up to min{2D −1, IJ} unique interactions, where I is the number of MCMC samples. In practice, we can obtain marginal distributions of all interactions across MCMC samples and use those marginals for selection. One approach is to pick J interactions with highest marginals and another is to consider interactions with marginal above some threshold (e.g. 0.5). We will resort to the second approach in our experiments in Section 5 as it seems to be in more agreement with the concept of "selection". Lastly, we note that while a data instance may a priori possess unbounded number of features, the number of possible interactions in the data is bounded by 2D −1, therefore taking J →∞might not be appropriate. In any case, we do not want to encourage the number of interactions to be too high for regression modeling, which would lead to overfitting. The above considerations led us to opt for a parametric prior such as the FFM for interactions structure Z, as opposed to going fully nonparametric. J can then be chosen using model selection procedures (e.g. cross validation), or simply taken as the model input parameter. Generalized construction and induced distribution of interactions depths We now proceed to introduce a richer family of prior distributions on hypergraphs of which the FFM is one instance. Our construction is motivated by the induced distribution on the column sums and the conditional probability updates that arise in the original FFM. Recall that under the FFM prior, interactions are a priori independent. Fix an interaction j, for the remainder of this section let Zi denote the indicator of whether variable i is present in interaction j or not (subscript j is dropped from Zij to simplify notation). Let Mi = Z1 + . . . + Zi denote the number of variables among the first i present in the corresponding interaction. By the Beta-Bernoulli conjugacy, one obtains P(Zi = 1|Z1, . . . , Zi−1) = Mi−1+γ1 i−1+γ1+γ2 . This highlights the “rich-gets-richer” effect of the FFM prior, which encourages the existence of very deep interactions while most other interactions have very small depths. In some situations we may prefer a relatively larger number of interactions of depths in the medium range. 5 An intuitive but somewhat naive alternative sampling process is to allow a variable to be included into an interaction according to its present "shallowness" quantified by (i −1 −Mi−1) (instead of Mi−1 in the FFM). It can be verified that this construction will lead to a distribution of interactions which concentrates most its mass around D/2; moreover, exchangeability among Zi would be lost. To maintain exchangeability, we define the sampling process for the sequence Z = (Z1, . . . , ZD) ∈{0, 1}D as follows: let σ(·) be a random uniform permutation of {1, . . . , D} and let σ1 = σ−1(1), . . . , σD = σ−1(D). Note that σ1, . . . , σD are discrete random variables and P(σk = i) = 1/D for any i, k = 1, . . . , D. For i = 1, . . . , D, set P(Zσi = 1|Zσ1, . . . , Zσi−1) = αMi−1+(1−α)(i−1−Mi−1)+γ1 i−1+γ1+γ2 , P(Zσi = 0|Zσ1, . . . , Zσi−1) = (1−α)Mi−1+α(i−1−Mi−1)+γ2 i−1+γ1+γ2 , (6) where γ1 > 0, γ2 > 0, α ∈[0, 1] are given parameters and Mi = Zσ1 + . . . + Zσi. The collection of Z generated by this process shall be called to follow FFMα. When α = 1 we recover the original FFM prior. When α = 0, we get the other extremal behavior mentioned at the beginning of the paragraph. Allowing α ∈[0, 1] yields a richer spectrum spanning the two distinct extremal behaviors. Details of the process and some of its properties are given in the Supplement. Here we briefly describe how FFMα a priori ensures "poor gets richer" behavior and offers extra flexibility in modeling interaction depths compared to the original FFM. The depth of an interaction of D variables is described by the distribution of MD. Consider the conditionals obtained for a Gibbs sampler where index of a variable to be updated is random and based on P(σD = i|Z) (it is simply 1/D for FFM1). Suppose we want to assess how likely it is to add a variable into an existing interaction via the expression P i:Z(k) i =0 P(Z(k+1) i = 1, σD = i|Z(k)), where k + 1 is the next iteration of the Gibbs sampler’s conditional update. This probability is a function of M (k) D ; for small values of M (k) D it quantifies the tendency for the "poor gets richer" behavior. For the FFM1 it is given by D−M (k) D D M (k) D +γ1 D−1+γ1+γ2 . In Fig. 1(a) we show that FFM1’s behavior is opposite of "poor gets richer", while α ≤0.7 appears to ensure the desired property. Next, in Fig.1 (b-f) we show the distribution of MD for various α, which exhibits a broader spectrum of behavior. 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 0.00 0.25 0.50 0.75 1.00 0 10 20 30 Current interaction depth alpha G 0.0 0.5 0.7 0.9 1.0 alpha=0.0 0.00 0.05 0.10 0.15 0.20 0.25 0 10 20 30 mean = 15.0, variance = 2.6 alpha=0.5 0.00 0.05 0.10 0.15 0.20 0.25 0 10 20 30 mean = 13.5, variance = 7.4 alpha=0.7 0.00 0.05 0.10 0.15 0.20 0.25 0 10 20 30 mean = 11.9, variance = 15.4 alpha=0.9 0.00 0.05 0.10 0.15 0.20 0.25 0 10 20 30 mean = 8.3, variance = 38.7 alpha=1.0 0.00 0.05 0.10 0.15 0.20 0.25 0 10 20 30 mean = 5.0, variance = 60.0 Figure 1: D = 30, γ1 = 0.2, γ2 = 1 (a) Probability of increasing interaction depth; (b-f) FFMα MD distributions with different α. 5 Experimental Results 5.1 Simulation Studies We shall compare MiFM methods against a variety of other regression techniques in the literature, including Bayesian Factorization Machines (FM), lasso-type regression, Support Vector Regression (SVR), multilayer perceptron neural network (MLP).2 The comparisons are done on the basis of prediction accuracy of responses (Root Mean Squared Error on the held out data), quality of regression coefficient estimates and the interactions recovered. 5.1.1 Predictive Performance In this set of experiments we demonstrate that MiFMs with either α = 0.7 or α = 1 have dominant predictive performance when high order interactions are in play. In Fig. 2(a) we analyzed 70 random interactions of varying orders. We see that MiFM can handle arbitrary complexity of the interactions, while other methods are comparative only when interaction structure is simple (i.e. linear or 2-way on the right of the Fig. 2(a)). 2Random Forest Regression and optimization based FM showed worse results than other methods. 6 G G G G G G G G G 1.0 1.5 2.0 2.5 3.0 3.5 0.4 0.6 0.8 1.0 Proportion of 1− and 2−way interactions RMSE G MiFM_1 MiFM_0.7 SVR MLP FM G G G G G G G G G G 1.0 1.5 2.0 2.5 3.0 0.00 0.25 0.50 0.75 1.00 Proportion of continues variables G MiFM_1 MiFM_0.7 SVR MLP FM G G G G G G G G G G 1.0 1.1 1.2 1.3 1.4 0.4 0.6 0.8 1.0 Proportion of 1− and 2−way interactions G G MiFM_1 OLS_MiFM_1 MiFM_0.7 OLS_MiFM_0.7 Elastic_Net OLS_Elastic G G G G G G G G G G G G G G 0.00 0.25 0.50 0.75 1.00 0.00 0.25 0.50 0.75 1.00 alpha Exact recovery proportion G G Binary Continues Binary _6 Continues_6 Binary _4 Continues_4 Figure 2: RMSE for experiments: (a) interactions depths; (b) data with different ratio of continuous to categorical variables; (c) quality of the MiFM1 and MiFM0.7 coefficients; (d) MiFMα exact recovery of the interactions with different α and data scenarios Next, to assess the effectiveness of MiFM in handling categorical variables (cf. Section 3.3) we vary the number of continuous variables from 1 (and 29 attributes across categories) to 30 (no categorical variables). Results in Fig. 2(b) demonstrate that our models can handle both variable types in the data (including continuous-categorical interactions), and still exhibit competitive RMSE performance. 5.1.2 Interactions Quality Coefficients of the interactions This experiment verifies the posterior consistency result of Theorem 1 and validates our factorization model for coefficients approximation. In Fig. 2(c) we compare MiFMs versus OLS fitted with the corresponding sets of chosen interactions. Additionally we benchmark against Elastic net (Zou & Hastie, 2005) based on the expanded data matrix with interactions of all depths included, that is 2D −1 columns, and a corresponding OLS with only selected interactions. Selection of the interactions In this experiments we assess how well MiFM can recover true interactions. We consider three interaction structures: a realistic one with five linear, five 2-way, three 3-way and one of each 4, . . . , 8-way interactions, and two artificial ones with 15 either only 4- or only 6-way interactions to challenge our model. Both binary and continuous variables are explored. Fig. 2(d) shows that MiFM can exactly recover up to 83% of the interactions and with α = 0.8 it recovers 75% of the interaction in 4 out of 6 scenarios. Situation with 6-way interactions is more challenging, where 36% for binary data is recovered and almost half for continuous. It is interesting to note that lower values of α handle binary data better, while higher values are more appropriate for continuous, which is especially noticeable on the "only 6-way" case. We think it might be related to the fact that high order interactions between binary variables are very rare in the data (i.e. product of 6 binary variables is equal to 0 most of the times) and we need a prior eager to explore (α = 0) to find them. 5.2 Real world applications 5.2.1 Finding epistasis Identifying epistasis (i.e. interactions between genes) is one of the major questions in the field of human genetics. Interactions between multiple genes and environmental factors can often tell a lot more about the presence of a certain disease than any of the genes individually (Templeton, 2000). Our analysis of the epistasis is based on the data from Himmelstein et al. (2011). These authors show that interactions between single nucleotide polymorphisms (SNPs) are often powerful predictors of various diseases, while individually SNPs might not contain important information at all. They developed a model free approach to simulate data mimicking relationships between complex gene interactions and the presence of a disease. We used datasets with five SNPs and either 3-,4- and 5-way interactions or only 5-way interactions. For this experiment we compared MiFM1, MiFM0; refitted logistic regression for each of our models based on the selected interactions (LMiFM1 and LMiFM0), Multilayer Perceptron with 3 layers and Random Forest.3 Results in Table 1 demonstrate that MiFM produces competitive performance compared to the very best black-box techniques on this data set, while it also selects interacting genes (i.e. finds epistasis). We don’t know which of the 3and 4-way interactions are present in the data, but since there is only one possible 5-way interaction we can check if it was identified or not — both MiFM1 and MiFM0 had a 5-way interaction in at least 95% of the posterior samples. 3FM, SVM and logistic regression had low accuracy of around 50% and are not reported. 7 Table 1: Prediction Accuracy on the Held-out Samples for the Gene Data MiFM1 MiFM0 LMiFM1 LMiFM0 MLP RF 3-, 4-, 5-way 0.775 0.771 0.883 0.860 0.870 0.887 only 5-way 0.649 0.645 0.628 0.623 0.625 0.628 −0.25 0.00 0.25 0.50 1 4 7 10 12 Month of the year MiFM_1 coefficient 2013 2014 2015 −0.25 0.00 0.25 0.50 1 4 7 10 12 Month of the year 2013 2014 2015 −1.0 −0.5 0.0 0.5 1.0 0 10 20 30 40 50 Week of the year MiFM_0 coefficient Fri Sat Sun −1.0 −0.5 0.0 0.5 1.0 0 10 20 30 40 50 Week of the year Fri Sat Sun Figure 3: MiFM1 store - month - year interaction: (a) store in Merignac; (b) store in Perols; MiFM0 city - store - day of week - week of year interaction: (c) store in Merignac; (d) store in Perols. 5.2.2 Understanding retail demand We finally report the analysis of data obtained from a major retailer with stores in multiple locations all over the world. This dataset has 430k observations and 26 variables spanning over 1100 binary variables after the one-hot encoding. Sales of a variety of products on different days and in different stores are provided as response. We will compare MiFM1 and MiFM0, both fitted with K = 12 and J = 150, versus Factorization Machines in terms of adjusted mean absolute percent error AMAPE = 100 P n |ˆyn−yn| P n yn , a common metric for evaluating sales forecasts. FM is currently a method of choice by the company for this data set, partly because the data is sparse and is similar in nature to the recommender systems. AMAPE for MiFM1 is 92.4; for MiFM0 - 92.45; for FM - 92.0. Posterior analysis of predictor interactions The unique strength of MiFM is the ability to provide valuable insights about the data through its posterior analysis. MiFM1 recovered 62 non-linear interactions among which there are five 3-way and three 4-way. MiFM0 selected 63 non-linear interactions including nine 3-way and four 4-way. We note that choice α = 0 was made to explore deeper interactions and as we see MiFM0 has more deeper interactions than MiFM1. Coefficients for a 3-way interaction of MiFM1 for two stores in France across years and months are shown in Fig. 3(a,b). We observe different behavior, which would not be captured by a low order interaction. In Fig. 3(c,d) we plot coefficients of a 4-way MiFM0 interaction for the same two stores in France. It is interesting to note negative correlation between Saturday and Sunday coefficients for the store in Merignac, while the store in Perols is not affected by this interaction - this is an example of how MiFM can select interactions between attributes across categories. 6 Discussion We have proposed a novel regression method which is capable of learning interactions of arbitrary orders among the regression predictors. Our model extends Finite Feature Model and utilizes the extension to specify a hypergraph of interactions, while adopting a factorization mechanism for representing the corresponding coefficients. We found that MiFM performs very well when there are some important interactions among a relatively high number (higher than two) of predictor variables. This is the situation where existing modeling techniques may be ill-equipped at describing and recovering. There are several future directions that we would like to pursue. A thorough understanding of the fully nonparametric version of the FFMα is of interest, that is, when the number of columns is taken to infinity. Such understanding may lead to an extension of the IBP and new modeling approaches in various domains. Acknowledgments This research is supported in part by grants NSF CAREER DMS-1351362, NSF CNS-1409303, a research gift from Adobe Research and a Margaret and Herman Sokol Faculty Award. 8 References Ai, Chunrong and Norton, Edward C. Interaction terms in logit and probit models. Economics letters, 80(1): 123–129, 2003. Brambor, Thomas, Clark, William Roberts, and Golder, Matt. Understanding interaction models: Improving empirical analyses. Political analysis, 14(1):63–82, 2006. Cheng, Chen, Xia, Fen, Zhang, Tong, King, Irwin, and Lyu, Michael R. Gradient boosting factorization machines. In Proceedings of the 8th ACM Conference on Recommender systems, pp. 265–272. ACM, 2014. Cordell, Heather J. Detecting gene–gene interactions that underlie human diseases. Nature Reviews Genetics, 10 (6):392–404, 2009. Cristianini, Nello and Shawe-Taylor, John. An introduction to support vector machines and other kernel-based learning methods. Cambridge university press, 2000. Fan, Jianqing and Lv, Jinchi. A selective overview of variable selection in high dimensional feature space. Statistica Sinica, 20(1):101, 2010. Freudenthaler, Christoph, Schmidt-Thieme, Lars, and Rendle, Steffen. Bayesian factorization machines. 2011. Ghahramani, Zoubin and Griffiths, Thomas L. Infinite latent feature models and the Indian buffet process. In Advances in neural information processing systems, pp. 475–482, 2005. Ghosal, Subhashis, Ghosh, Jayanta K, Ramamoorthi, RV, et al. Posterior consistency of Dirichlet mixtures in density estimation. The Annals of Statistics, 27(1):143–158, 1999. Griffiths, Thomas L and Ghahramani, Zoubin. The Indian buffet process: An introduction and review. The Journal of Machine Learning Research, 12:1185–1224, 2011. Harshman, Richard A. Foundations of the PARAFAC procedure: Models and conditions for an" explanatory" multi-modal factor analysis. 1970. Himmelstein, Daniel S, Greene, Casey S, and Moore, Jason H. Evolving hard problems: generating human genetics datasets with a complex etiology. BioData mining, 4(1):1, 2011. Nguyen, Trung V, Karatzoglou, Alexandros, and Baltrunas, Linas. Gaussian process factorization machines for context-aware recommendations. In Proceedings of the 37th international ACM SIGIR conference on Research & development in information retrieval, pp. 63–72. ACM, 2014. Rendle, Steffen. Factorization machines. In Data Mining (ICDM), 2010 IEEE 10th International Conference on, pp. 995–1000. IEEE, 2010. Rendle, Steffen, Gantner, Zeno, Freudenthaler, Christoph, and Schmidt-Thieme, Lars. Fast context-aware recommendations with factorization machines. In Proceedings of the 34th international ACM SIGIR conference on Research and development in Information Retrieval, pp. 635–644. ACM, 2011. Templeton, Alan R. Epistasis and complex traits. Epistasis and the evolutionary process, pp. 41–57, 2000. Tibshirani, Robert. Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society. Series B (Methodological), pp. 267–288, 1996. Zhu, Ji, Rosset, Saharon, Hastie, Trevor, and Tibshirani, Rob. 1-norm support vector machines. Advances in neural information processing systems, 16(1):49–56, 2004. Zou, Hui and Hastie, Trevor. Regularization and variable selection via the elastic net. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 67(2):301–320, 2005. 9
2017
673