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,200
The Expxorcist: Nonparametric Graphical Models Via Conditional Exponential Densities Arun Sai Suggala ∗ Carnegie Mellon University Pittsburgh, PA 15213 Mladen Kolar † University of Chicago Chicago, IL 60637 Pradeep Ravikumar ‡ Carnegie Mellon University Pittsburgh, PA 15213 Abstract Non-parametric multivariate density estimation faces strong statistical and computational bottlenecks, and the more practical approaches impose near-parametric assumptions on the form of the density functions. In this paper, we leverage recent developments to propose a class of non-parametric models which have very attractive computational and statistical properties. Our approach relies on the simple function space assumption that the conditional distribution of each variable conditioned on the other variables has a non-parametric exponential family form. 1 Introduction Let X = (X1, . . . , Xp) be a p-dimensional random vector. Let G = (V, E) be the graph that encodes conditional independence assumptions underlying the distribution of X, that is, each node of the graph corresponds to a component of vector X and (a, b) ∈E if and only if Xa ̸⊥⊥Xb | X¬ab with X¬ab := {Xc | c ∈V \{a, b}}. The graphical model represented by G is then the set of distributions over X that satisfy the conditional independence assumptions specified by the graph G. There has been a considerable line of work on learning parametric families of such graphical model distributions from data [22, 20, 13, 28], where the distribution is indexed by a finite-dimensional parameter vector. The goal of this paper, however, is on specifying and learning nonparametric families of graphical model distributions, indexed by infinite-dimensional parameters, and for which there has been comparatively limited work. Non-parametric multivariate density estimation broadly, even without the graphical model constraint, has not proved as popular in practical machine learning contexts, for both statistical and computational reasons. Loosely, estimating a non-parametric multivariate density, with mild assumptions, typically requires the number of samples to scale exponentially in the dimension p of the data, which is infeasible even in the big-data era when n is very large. And the resulting estimators are typically computationally expensive or intractable, for instance requiring repeated computations of multivariate integrals. We present a review of multivariate density estimation, that is necessarily incomplete but sets up our proposed approach. A common approach dating back to [15] uses the logistic density transform to satisfy the unity and positivity constraints for densities, and considers densities of the form f(X) = exp(η(X)) R X exp(η(x))dx, with some constraints on η for identifiability such as η(X0) = 0 for some X0 ∈X or R X η(x)dx = 0. With the logistic density transform, differing approaches for non-parametric density estimation can be contrasted in part by their assumptions on the infinite-dimensional function space domain of η(·). An early approach [8] considered function spaces of functions with bounded “roughness” functionals. The predominant line of work however has focused on the setting where η(·) lies in a Reproducing Kernel Hilbert Space (RKHS), dating back to [21]. Consider the estimation of these logistic density ∗asuggala@cs.cmu.edu †mkolar@chicagobooth.edu ‡pradeepr@cs.cmu.edu 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. transforms η(X) given n i.i.d. samples Xn = {X(i)}n i=1 drawn from fη(X). A natural loss functional is penalized log likelihood, with a penalty functional that ensures a smooth fit with respect to the function space domain: ℓ(η; Xn) := −1 n P i∈[n] η(X(i)) +log R exp(η(x))dx+λ pen(η), for functions η(·) that lie in an RKHS H, and where pen(η) = ∥η∥2 H is the squared RKHS norm. This was studied by many [21, 11, 6]. A crucial caveat is that the representer theorem for RKHSs does not hold. Nonetheless, one can consider finite-dimensional function space approximations consisting of the linear span of kernel functions evaluated at the sample points [12]. Computationally this still scales poorly with the dimension due to the need to compute multidimensional integrals of the form R exp(η(x)dx which do not, in general, decompose. These approximations also do not come with strong statistical guarantees. We briefly note that the function space assumption that η(·) lies in an RKHS could also be viewed from the lens of an infinite-dimensional exponential family [4]. Specifically, let H be a Reproducing Kernel Hilbert Space with reproducing kernel k(·, ·), and inner product ⟨·, ·⟩H. Then η(X) = ⟨θ(·), k(X, ·)⟩H, so that the density f(X) can in turn be viewed as a member of an infinite-dimensional exponential family with sufficient statistics k(X, ·) : X 7→H, and natural parameter θ(·) ∈H. Following this viewpoint, [4] propose estimators via linear span approximations similar to [11]. Due to the computational caveat with exact likelihood based functionals, a line of approaches have focused on penalized surrogate likelihoods instead. [14] study the following loss functional: ℓ(η; Xn) := 1 n P i∈[n] exp(−η(X(i)))+ R η(x)ρ(x)dx+λpen(η), where ρ(X) is some fixed known density with the same support as the unknown density f(X). While this estimation procedure is much more computationally amenable than minimizing the exact penalized likelihood, the caveat, however, is that for a general RKHS this requires solving higher order integrals. The next level of simplification has thus focused on the form of the logistic transform function itself. There has been a line of work on an ANOVA type decomposition of the logistic density function into node-wise and pairwise terms: η(X) = Pp s=1 ηs(Xs) + Pp s=1 Pp t=s+1 ηst(Xs, Xt). A line of work has coupled such a decomposition with the assumption that each of the terms lie in an RKHS. This does not immediately provide a computational benefit: with penalized likelihood based loss functionals, the loss functional does not necessarily decompose into such node and pairwise terms. [24] thus couple this ANOVA type pairwise decomposition with a score matching based objective. [10] use the above decomposition with the surrogate loss functional of [14] discussed above, but note that this still requires the aforementioned function space approximation as a linear span of kernel evaluations, as well as two-dimensional integrals. A line of recent work has thus focused on further stringent assumptions on the density function space, by assuming some components of the logistic transform to be finite-dimensional. [30] use an ANOVA decomposition but assume the terms belong to finite-dimensional function spaces instead of RKHSs, specified by a pre-defined finite set of basis functions. [29] consider logistic transform functions η(·) that have the pairwise decomposition above, with a specific class of parametric pairwise functions βstXsXt, and non-parametric node-wise functions. [17, 16] consider the problem of estimating monotonic node-wise functions such that the transformed random vector is multivariate Gaussian; which could also be viewed as estimating a Gaussian copula density. To summarize the (necessarily incomplete) review above, non-parametric density estimation faces strong statistical and computational bottlenecks, and the more practical approaches impose stringent near-parametric assumptions on the form of the (logistic transform of the) density functions. In this paper, we leverage recent developments to propose a very computationally simple non-parametric density estimation algorithm, that still comes with strong statistical guarantees. Moreover, the density could be viewed as a graphical model distribution, with a corresponding sparse conditional independence graph. Our approach relies on the following simple function space assumption: that the conditional distribution of each variable conditioned on the other variables has a non-parametric exponential family form. As we show, for there to exist a consistent joint density, the logistic density transform with respect to a particular base measure necessarily decomposes into the following semi-parametric form: η(X) = Pp s=1 θsBs(Xs) + Pp s=1 Pp t=s+1 θst Bs(Xs) Bt(Xt) in the pairwise case, with both a parametric component {θs : s = 1, . . . , p}, {θst : s < t; s, t = 1, . . . , p}, as well as non-parametric components {Bs : s = 1, . . . , p}. We call this class of models the “expxorcist”, fol2 lowing other “ghostbusting” semi-parametric models such as the nonparanormal and nonparanormal skeptic [17, 16]. Since the conditional distributions are exponential families, we show that there exist computationally amenable estimators, even in our more general non-parametric setting, where the sufficient statistics have to be estimated as well. The statistical analysis in our non-parametric setting however is more subtle, due in part to non-convexity and in part to the non-parametric setting. We also show how the Expxorcist class of densities is closely related to a semi-parametric exponential family copula density that generalizes the Gaussian copula density of [17, 16]. We corroborate the applicability of our class of models with experiments on synthetic and real data sets. 2 Multivariate Density Specification via Conditional Densities We are interested in the approach of estimating a multivariate density by estimating node-conditional densities. Since node-conditional densities focus on the density of a single variable, though conditioned on the rest of the variables, estimating these is potentially a simpler problem, both statistically and computationally, than estimating the entire joint density itself. Let us consider the general non-parametric conditional density estimation problem. Given the general multivariate density f(X) = exp(η(X)) R X exp(η(x))dx, the conditional density of a variable Xs given the rest of the variables X−s is given by f(Xs | X−s) = exp(η((Xs,X−s))) R Xs exp(η((x,X−s)))dx, which does not have a multi-dimensional integral, but otherwise does not have a computationally amenable form. There has been a line of work on such conditional density estimation, mirroring developments in multivariate density estimation [9, 18, 23], but unlike parametric settings, there are no large sample complexity gains with non-parametric conditional density estimation under general settings. There have also been efforts to use ANOVA decompositions in a conditional density context [31, 26]. In addition to computational and sample complexity caveats, recall that in our context, we would like to use conditional density estimates to infer a joint multivariate density. A crucial caveat with using the above estimates to do so is that it is not clear when the estimated node-conditional densities would be consistent with a joint multivariate density. There has been a line of work on this question (of when conditional densities are consistent with a joint density) for parametric densities; see [1] for an overview, with more recent results in [27, 5, 2, 25]. Overall, while estimating node-conditional densities could be viewed as surrogate estimation of a joint density, arbitrary node-conditional distributions need not be consistent in general with any joint density. There has however been a line of work in recent years [3, 28], where it was shown that when the node-conditional distributions belong to an exponential family, then under certain conditions on their parameterization, there do exist multivariate densities consistent with the node-conditional densities. In the next section, we leverage these results towards non-parametric estimation of conditional densities. 3 Conditional Densities of an Exponential Family Form We first recall the definition of an exponential family in the context of a conditional density. Definition 1. A conditional density of a random variable Y ∈Y given covariates Z := (Z1, . . . , Zm) ∈Z is said to have an exponential family form if it can be written as f(Y | Z) = exp(B(Y )T E(Z) +C(Y ) +D(Z)), for some functions B : Y 7→Rk (for some finite integer k > 0), E : Z 7→Rk, C : Y 7→R and D : Z 7→R. Thus, f(Y | Z) belongs to a finite-dimensional exponential family with sufficient statistics B(Y ), base measure exp(C(Y )), and with natural parameter E(Z) and where −D(Z) is the log-partition function. Contrast this with a general conditional density f(Y | Z) = exp(h(Y, Z)+C(Y )+D(Z)) with respect to the base measure exp(C(Y )) and −D(Z) being the log-normalization constant, and it can be seen that a conditional density of the exponential family form has its logistic density transform h(Y, Z) that factorizes as B(Y )T E(Z). Consider the case where the sufficient statistic function is real-valued. The non-parametric estimation problem of a conditional density of exponential form then reduces to the estimation of the sufficient statistics function B(·), the exponential natural parameter function E(·), assuming the base measure C(·) is given. But when would such estimated conditional densities be consistent with a joint density? 3 To answer this question, we draw upon developments in [28]. Suppose that the node-conditional distributions of each random variable Xs conditioned on the rest of random variables have the exponential family form as in Definition 1, so that for each s ∈V P(Xs | X−s) ∝exp{Es(X−s)Bs(Xs) + Cs(Xs)} , (1) for some arbitrary functions Es(·), Bs(·), Cs(·) that specify a valid conditional density. Then [28] show that these node-conditional densities are consistent with a unique joint density over the random vector X, that moreover factors according to a set of cliques C in the graph G, if and only if the functions {Es(·)}s∈V specifying the node-conditional distributions have the form Es(X−s) = θs + P C∈C:s∈C θC Q t∈C,t̸=s Bt(Xt), where {θs} ∪{θC}C∈C is a set of parameters. Moreover, the corresponding consistent joint distribution has the following form P(X) ∝exp nX s∈V θsBs(Xs) + X C∈C θC Y s∈C Bs(Xs) + X s∈V Cs(Xs) o . (2) In this paper, we are interested in the non-parametric estimation of the Expxorcist class of densities in (2), where we estimate both the finite-dimensional parameters {θs} ∪{θC}C∈C, as well as the functions {Bs(Xs)}s∈V . We assume we are given the base measures {Cs(Xs)}s∈V , so that the joint density is with respect to a given product base measure Q s∈V exp(Cs(XS)), as is common in the multivariate density estimation literature. Note that this is not a very restrictive assumption. In practice the base measure at each node can be well approximated using the empirical univariate marginal density of that node. We could also extend our algorithm, which we present next, to estimate the base measures along with sufficient statistic functions. 4 Regularized Conditional Likelihood Estimation for Exponential Family Form Densities We consider the nonparametric estimation problem of estimating a joint density of the form in (2), focusing on the pairwise case where the factors have size at most k = 2, so that the joint density takes the form P(X) ∝exp X s∈V θsBs(Xs) + X (s,t)∈E θstBs(Xs) Bt(Xt) + X s∈V Cs(Xs)  . (3) As detailed in the previous section, estimating this joint density can be reduced to estimating its node-conditional densities, which take the form P(Xs | X−s) ∝exp  Bs(Xs)  θs + X t∈NG(s) θstBt(Xt)  + Cs(Xs)  . (4) We now introduce some notation which we use in the sequel. Let Θ = {θs}s∈V ∪{θst}s̸=t and Θs = θs ∪{θst}t∈V \{s}. Let B = {Bs}s∈V be the set of sufficient statistics. Let Xs be the domain of Xs, which we assume is bounded and L2(Xs) be the Hilbert space of square integrable functions over Xs with respect to Lebesgue measure. We assume that the sufficient statistics Bs(·) ∈L2(Xs). Note that the model in Equation (3) is unidentifiable. To overcome this issue we impose additional constraints on its parameters. Specifically, we require Bs(Xs) to satisfy R Xs Bs(X)dX = 0, R Xs Bs(X)2dX = 1 and θs ≥0, ∀s ∈V . Optimization objective: Let Xn = {X(1), . . . X(n)} be n i.i.d. samples drawn from a joint density of the form in Equation (3), with parameters Θ∗, B∗. And let Ls(Θs, B; Xn) be the node conditional negative log likelihood at node s Ls(Θs, B; Xn) = 1 n Xn i=1  −Bs(X(i) s )  θs + X t∈V \s θstBt(X(i) t )  + A(X(i) −s; Θs, B)  , where A(X−s; Θs, B) is the log partition function. To estimate the unknown parameters, we solve the following regularized node conditional log-likelihood estimation problem at each node s ∈V min Θs,B Ls(Θs, B; Xn) + λn∥Θs∥1 s.t. θs ≥0, R Xt Bt(X)dX = 0, R Xt Bt(X)2dX = 1 ∀t ∈V. (5) 4 The equality constraints on the norm of functions Bt(·) makes the above optimization problem a difficult one to solve. While the norm constraints on Bt(·), ∀t ∈V \ s can be handled through reparametrization, the constraint on Bs(·) can not be handled efficiently. To make the optimization more amenable for numerical optimization techniques, we solve a closely related optimization problem. At each node s ∈V , we consider the following re-parametrization of B: Bs(Xs) ←θsBs(Xs), Bt(Xt) ←(θst/θs)Bt(Xt), ∀t ∈V \ {s}. With a slight abuse of notation we redefine Ls using this re-parametrization as Ls(B; Xn) = 1 n Xn i=1  −Bs(X(i) s )  1 + X t∈V \s Bt(X(i) t )  + A(X(i) −s; B)  , (6) where A(X−s; B) is the log partition function. We solve the following optimization problem, which is closely related to the original optimization in Equation (5) min B Ls(B; Xn) + λn P t∈V qR Xt Bt(X)2dX s.t. R Xt Bt(X)dX = 0 ∀t ∈V. (7) For more details on the relation between (5) and (7), please refer to Appendix. Algorithm: We now present our algorithm for optimization of (7). In the sequel, for simplicity, we assume that the domains Xt of random variables Xt are all the same and equal to X. In order to estimate functions Bt, we expand them over a uniformly bounded, orthonormal basis {φk(·)}∞ k=0 of L2(X) with φ0(·) ∝1. Expansion of the functions Bt(·) over this basis yields Bt(X) = Xm k=1 αt,kφk(X)+ρt,m(X) where ρt,m(X) = αt,0φ0(X)+ X∞ k=m+1 αt,kφk(X). Note that the constraint R X Bt(X)dX = 0 in Equation (7), translates to αt,0 = 0. To convert the infinite dimensional optimization problem in (7) into a finite dimensional problem, we truncate the basis expansion to the top m terms and approximate Bt(·) as Pm k=1 αt,kφk(·). The optimization problem in Equation (7) can then be rewritten as min αm Ls,m(αm; Xn) + λn X t∈V ∥αt,m∥2, (8) where αt,m = {αt,k}m k=1, αm = {αt,m}t∈V and Ls,m is defined as Ls,m(αm; Xn) = 1 n n X i=1   − m X k=1 αs,kφk(X(i) s )  1 + X t∈V \{s} m X l=1 αt,lφl(X(i) t )  + A(X(i) −s; αm)   . Iterative minimization of (8): Note that the objective in (8) is non-convex. In this work, we use a simple alternating minimization technique for its optimization. In this technique, we alternately minimize αs,m, {αt,m}t∈V \s while fixing the other parameters. The resulting optimization problem in each of the alternating steps is convex. We use Proximal Gradient Descent to optimize these sub-problems. To compute the objective and its gradients, we need to numerically evaluate the one-dimensional integrals in the log partition function. To do this, we choose a uniform grid of points over the domain and use quadrature rules to approximate the integrals. Convergence: Although (8) is non-convex, we can show that under certain conditions on the objective function, the alternating minimization procedure converges to the global minimum. In a recent work [32] analyze alternating minimization for low rank matrix factorization problems and show that it converges to a global minimum if the sequence of convex problems are strongly convex and satisfy certain other regularity condition. The analysis of [32] can be extended to show global convergence of alternating minimization for (8). 5 Statistical Properties In this section we provide parameter estimation error rates for the node conditional estimator in Equation (8). Note that these rates are for the re-parameterized model described in Equation (6) and can be easily translated to guarantees on the original model described in Equations (3), (4). 5 Notation: Let B2(x, r) = {y : ∥y −x∥2 ≤r} be the ℓ2 ball with center x and radius r. Let {B∗ t (·)}t∈V be the true functions of the re-parametrized model, which we would like to estimate from the data. Denote the basis expansion coefficients of Bt(·) with respect to orthonormal basis {φk(·)}∞ k=0 by αt, which is an infinite dimensional vector and let α∗ t be the coefficients of B∗ t (·). And let αt,m be the coefficients corresponding to the top m basis in the basis expansion of Bt(·). Note that R Bt(X)2dX = ∥αt∥2 2. Let α = {αt}t∈V and αm = {αt,m}t∈V . Let ¯Ls,m(αm) = E [Ls,m(αm; Xn)] be the population version of the sample loss defined in Equation (8). We will often omit Xn from Ls,m(αm; Xn) when clear from the context. We let (αt −αt,m) be the difference between infinite dimensional vector αt and the vector obtained by appropriately padding αt,m with zeros. Finally, we define the norm R(·) as R(αm) = P t∈V ∥αt,m∥2 and its dual as R∗(αm) = supt∈V ∥αt,m∥2. The norms on infinite dimensional vector α are similarly defined. We now state our key assumption on the loss function Ls,m(·). This assumption imposes strong curvature condition on Ls,m along certain directions in a ball around α∗ m. Assumption 1. There exists rm > 0 and constants c, κ > 0 such that for any ∆m ∈B2(0, rm) the gradient of the sample loss Ls,m satisfies: ⟨∇Ls,m(α∗ m + ∆m) −∇Ls,m(α∗ m), ∆m⟩≥κ∥∆m∥2 2 − c q m log(p) n R(∆m). Similar assumptions are increasingly common in analysis of non-convex estimators, see [19] and references therein. We are now ready to state our results which give the parameter estimation error rates, the proofs of which can be found in Appendix. We first provide a deterministic bound on the error ∥αm −α∗ m∥2 in terms of the random quantity R∗(∇Ls,m(α∗ m)). We derive probabilistic results in the subsequent corollaries. Theorem 2. Let Ns be the true neighborhood of node s, with |Ns| = d. Suppose Ls,m satisfies Assumption 1. If the regularization parameter λn is chosen such that λn ≥2R∗(∇Ls,m(α∗ m)) + 2c q m log(p) n , then any stationary point ˆαm of (8) in B2(α∗ m, rm) satisfies: ∥ˆαm −α∗ m∥2 ≤6 √ 2 κ √ dλn. We now provide a set of sufficient conditions under which the random quantity R∗(∇Ls,m(α∗ m)) can be bounded. Assumption 2. There exists a constant L > 0 such that the gradient of the population loss ¯Ls,m at α∗ m satisfies: R∗(∇¯Ls,m(α∗ m)) ≤LR∗(α∗−α∗ m). Corollary 3. Suppose the conditions in Theorem 2 are satisfied. Moreover, let γ = supi∈N,X∈X |φi(X)| and τm = supt∈V,X∈X | Pm i=1 α∗ t,iφi(X)|. Suppose Ls,m satisfies Assumption 2. If the regularization parameter λn is chosen such that λn ≥2LR∗(α∗−α∗ m)+cγτm q md2 log(p) n , then then with probability at least 1−2m/p2 any stationary point ˆαm of (8) in B2(α∗ m, rm) satisfies: ∥ˆαm −α∗ m∥2 ≤6 √ 2 κ √ dλn. Theorem 2 and Corollary 3 bound the error of the estimated coefficients in the truncated expansion. The approximation error of the truncated expansion itself depends on the function space assumption, as well as the basis chosen, but can be simply combined with the statement of the above corollary to derive the overall error. As an instance, we present a corollary below for the specific case of Sobolev space of order two, and the trigonometric basis. Corollary 4. Suppose the conditions in Corollary 3 are satisfied. Moreover, suppose the true functions B∗ t (·) lie in a Sobolev space of order two. Let {φk}∞ k=0 be the trigonometric basis of L2(X). If the optimization problem (8) is solved with λn = c1(d2 log(p)/n)2/5 and m = c2(n/d2 log(p))1/5, then with probability at least 1 −2m/p2 any stationary point ˆαm of (8) in B2(α∗ m, rm) satisfies: ∥ˆαm −α∗∥2 ≤c3 d13/4 log(p) n 2/5 , where c1, c2, c3 depend on L, κ, γ, τm. 6 Discussion on Assumption 1: We now provide a set of sufficient conditions which ensure the restricted strong convexity (RSC) condition. Suppose the population risk ¯Ls,m(·) is strongly convex in a ball of radius rm around α∗ m ∇¯Ls,m(α∗ m + ∆m) −∇¯Ls,m(α∗ m), ∆m ≥κ∥∆m∥2 2 ∀∆m ∈B2(0, rm). (9) Moreover, suppose the empirical gradients converge uniformly to the population gradients sup αm∈B2(α∗m,rm) R∗∇Ls,m(αm) −∇¯Ls,m(αm)  ≤c r m log p n . (10) For example, this condition holds with high probability when the gradient of Ls,m(αm) w.r.t αt,m, for any t ∈[p] is a sub-Gaussian process. Equations (9),(10) are easier to check and ensure that Ls,m(αm) satisfies the RSC property in Assumption 1. 6 Connections to Exponential Family MRF Copulas The Expxorcist class of models could be viewed as being closely related to an exponential family MRF [28] copula density. Consider the parametric exponential family MRF joint density in (3): PMRF;θ(X) ∝exp nP s∈V θsBs(Xs) + P (s,t)∈E(G) θstBs(Xs) Bt(Xt) + P s∈V Cs(Xs) o , where the distribution is indexed by the finite-dimensional parameters {θs}s∈V , {θst}(s,t)∈E, and where in contrast to the previous sections, we assume we are given the sufficient statistics functions {Bs(·)}s∈V as well as the nodewise base measures {Cs(·)}s∈V . Now consider the following nonparametric problem. Given a random vector X, suppose we are interested in estimating monotonic node-wise functions {fs(Xs)}s∈V such that (f1(X1), . . . , fp(Xp)) follows PMRF;θ for some θ. Letting f(X) = (f1(X1), . . . , fp(Xp)), we have that P(f(X)) = PMRF;θ(f(X)), so that the density of X can be written as P(X) ∝P(f(X)) Q s∈V f ′ s(Xs). This is now a semi-parametric estimation problem, where the unknowns are the functions {fs(Xs)}s∈V as well as the finite-dimensional parameters θ. To simplify this density, suppose we assume that the given node-wise sufficient statistics are linear, so that Bs(z) = z, for all s ∈V , so that density reduces to P(X) ∝exp    X s∈V θsfs(Xs) + X (s,t)∈E(G) θstfs(Xs) ft(Xt) + X s∈V (Cs(fs(Xs)) + log f ′ s(Xs))   . (11) In contrast, the Expxorcist nonparametric exponential family graphical model takes the form P(X) ∝exp    X s∈V θsfs(Xs) + X (s,t)∈E(G) θstfs(Xs) ft(Xt) + X s∈V Cs(Xs)   . (12) It can be seen that the two densities have very similar forms, except that the density in (11) has a more complex base measure that depends on the unknown functions {fs}s∈V and importantly the functions {fs}s∈V in (11) are monotonic. The class of densities in (11) can be cast as an exponential family MRF copula density. Suppose we denote the CDF of the parametric exponential family MRF joint density by FMRF;θ(X), with nodewise marginal CDFs FMRF;θ,s(Xs). Then the marginal CDF of the density (11) can be written as Fs(xs) = P[Xs ≤xs] = P[fs(Xs) ≤fs(xs)] = FMRF;θ,s(fs(xs)), so that fs(xs) = F −1 MRF;θ,s(Fs(xs)). (13) It then follows that: F(X) = FMRF;θ  F −1 MRF;θ,1(F1(X1)), . . . , F −1 MRF;θ,p(Fp(Xp))  , where F(X) is the CDF of density (11). By letting FCOP;θ(U) = FMRF;θ  F −1 MRF;θ,1(U1), . . . , F −1 MRF;θ,p(Up)  be the exponential family MRF copula density function, we see that the CDF of X is precisely: F(X) = FCOP;θ(F1(X1), . . . , Fp(Xp)), which is specified by the marginal CDFs {Fs(Xs)}s∈V and the copula density FCOP;θ corresponding to the exponential family MRF density. In other words, the non-parametric extension in (11) of the exponential family MRF densities is precisely an exponential family MRF copula density. This development thus generalizes the non-parametric extension of Gaussian MRF densities via the Gaussian copula nonparanormal densities [17]. The caveats with the copula density however are two-fold: the node-wise functions are restricted to be monotonic, but 7 also the estimation of these as in (13) requires the estimation of inverses of marginal CDFs of an exponential family MRF, which is intractable in general. Thus, minor differences in the expressions of the Expxorcist density (12) and an exponential family MRF copula density (11) nonetheless have seemingly large consequences for tractable estimation of these densities from data. 7 Experiments We present experimental results on both synthetic and real datasets. We compare our estimator, Expxorcist, with the Nonparanormal model of [17] and Gaussian Graphical Model (GGM). We use glasso [7] to estimate GGM and the two step estimator of [17] to estimate Nonparanormal model. 7.1 Synthetic Experiments Data: We generated synthetic data from the Expxorcist model with chain and grid graph structures. For both the graph structures, we set θs = 1, ∀s ∈V ,θst = 1, ∀(s, t) ∈E and fix the domain X to [−1, 1]. We experimented with two choices for sufficient statistics Bs(X): sin(4πX) and  exp −20(X −0.5)2 + exp −20(X + 0.5)2 −1  and picked the log base measure Cs(X) to be 0. The grid graph we considered has a 10 × (p/10) structure. We used Gibbs sampling to sample data from these models. We also generated data from Gaussian distribution with chain and grid graph structures. To generate this data we set the off diagonal non-zero entries of inverse covariance matrix to 0.49 for chain graph and 0.25 for grid graph and diagonal entries to 1. Evaluation Metric: We compared the performance of Expxorcist against baselines, on graph structure recovery, using ROC curves. The ROC curve plots the true positive rate (TPR) against false positive rate (FPR) over different choices of regularization parameter, where TPR is the fraction of correctly detected edges and FPR is the fraction of mis-identified non edges. Experiment Settings: For this experiment we set p = 50 and n ∈{100, 200, 500} and varied the regularization parameter λ from 10−2 to 1. To fit the data to the non parametric model (3), we used cosine basis and truncated the basis expansion to top 30 terms. In practice, one could choose the number of basis (m) based on domain knowledge (e.g. “smooth” functions), or in the absence of which, one could use hold-out validation/cross validation. Given ˆN(s), the estimated neighborhood for node s, we estimated the overall graph structure as: ∪s∈V ∪t∈ˆ N(s) {(s, t)}. To reduce the variance in the ROC plots, we averaged results over 10 repetitions. Results: Figure 1 shows the ROC plots obtained from this experiment. Due to the lack of space, we present more experimental results in Appendix. It can be seen that Expxorcist has much better performance on non-Gaussian data. On these datasets, even at n = 500 the baselines chose edges at random. This suggests that in the presence of multiple modes and fat tails, Expxorcist is a better model. Expxorcist has slightly poor performance than baselines on Gaussian data. However, this is expected because it learns a broader family of distributions than Nonparanormal. 7.2 Futures Intraday Data We now present our analysis on the Futures price returns. This dataset was downloaded from http://www.kibot.com/. We focus on the Top-26 most liquid instruments being traded at the Chicago Mercantile Exchange (CME). The instruments span different sectors like Energy, Agriculture, Currencies, Equity Indices, Metals and Interest Rates. We focus on the hours of maximum liquidity (9am Eastern to 3pm Eastern) and look at the 1 minute price returns. The return distribution is a mixture of 1 minute returns with the overnight return. Since overnight returns tend to be bigger than the 1 minute return within the day, the return distribution is multimodal and fat-tailed. We treat each instrument as a random variable and the 1 minute returns as independent samples drawn from these random variables. We use the data collected in February 2010 as training data and data from March 2010 as held out data for tuning parameter selection. After removing samples with missing entries we are left with 894 training and 650 held out data samples. We fit Expxorcist and baselines on this data with the same parameter settings described above. For each of these models, we select the best tuning parameter through log likelihood on held out data. However, this criteria resulted in complete graphs for Nonparanormal and GGM (325 edges) and a relatively sparser graph for Expxorcist (168 edges). So for a better comparison of these models, we selected tuning parameters for each of the models such that the resulting graphs have almost the same number of edges. Figure 2 shows the 8 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 Gaussian(n = 200) Expxorcist GGM Nonparanormal 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 TPR Sine(n = 500) 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 Exp (n = 500) 0 0.2 0.4 0.6 0.8 1 FPR 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 FPR 0 0.2 0.4 0.6 0.8 1 TPR 0 0.2 0.4 0.6 0.8 1 FPR 0 0.2 0.4 0.6 0.8 1 Figure 1: ROC plots from synthetic experiments. Top and bottom rows show plots for chain and grid graphs respectively. Left column shows plots for data generated from our non-parametric model with Bs(X) = sin(X), n = 500 and center column shows plots for the other choice of sufficient statistic with n = 500. Right column shows plots for Gaussian data with n = 200. (a) Nonparanormal (b) Expxorcist Figure 2: Graph Structures learned for the Futures Intraday Data. The Expxorcist graph shown here was obtained by selecting λ = 0.1. Nodes are colored based on their categories. Edge thickness is proportional to the magnitude of the interaction. learned graphs for one such choice of tuning parameters, which resulted in ∼52 edges in the graphs. Nonparanormal and GGM resulted in very similar graphs, so we only present Nonparanormal here. It can be seen that Expxorcist is able to identify the clusters better than Nonparanormal. More detailed graphs and comparison with GGM can be found in Appendix. 8 Conclusion In this work we considered the problem of non-parametric density estimation and introduced Expxorcist, a new family of non-parametric graphical models. Our approach relies on a simple function space assumption that the conditional distribution of each variable conditioned on the other variables has a non-parametric exponential family form. We proposed an estimator for Expxorcist that is computationally efficient and comes with statistical guarantees. Our empirical results suggest that, in the presence of multiple modes and fat tails in the data, our non-parametric model is a better choice than the Nonparanormal model of [17]. 9 Acknowledgement A.S. and P.R. acknowledge the support of ARO via W911NF-12-1-0390 and NSF via IIS-1149803, IIS-1447574, DMS-1264033, and NIH via R01 GM117594-01 as part of the Joint DMS/NIGMS Initiative to Support Research at the Interface of the Biological and Mathematical Sciences. M. K. acknowledges support by an IBM Corporation Faculty Research Fund at the University of Chicago Booth School of Business. 9 References [1] Barry C. Arnold, Enrique Castillo, and José María Sarabia. Conditionally specified distributions: an introduction. Stat. Sci., 16(3):249–274, 2001. With comments and a rejoinder by the authors. [2] Patrizia Berti, Emanuela Dreassi, and Pietro Rigo. Compatibility results for conditional distributions. J. Multivar. Anal., 125:190–203, 2014. [3] Julian Besag. Spatial interaction and the statistical analysis of lattice systems. J. R. Stat. Soc. B, pages 192–236, 1974. [4] Stéphane Canu and Alex Smola. Kernel methods and the exponential family. Neurocomputing, 69(79):714–720, Mar 2006. [5] Hua Yun Chen. Compatibility of conditionally specified models. Statist. Probab. Lett., 80(7-8):670–677, 2010. [6] Ronaldo Dias. Density estimation via hybrid splines. J. Statist. Comput. Simulation, 60(4):277–293, 1998. [7] Jerome H. Friedman, Trevor J. Hastie, and Robert J. Tibshirani. Sparse inverse covariance estimation with the graphical lasso. Biostatistics, 9(3):432–441, 2008. [8] I. J. Good and R. A. Gaskins. Nonparametric roughness penalties for probability densities. Biometrika, 58:255–277, 1971. [9] Chong Gu. Smoothing spline density estimation: conditional distribution. Stat. Sinica, 5(2):709–726, 1995. [10] Chong Gu, Yongho Jeon, and Yi Lin. Nonparametric density estimation in high-dimensions. Stat. Sinica, 23:1131–1153, 2013. [11] Chong Gu and Chunfu Qiu. Smoothing spline density estimation: theory. Ann. Stat., 21(1):217–234, 1993. [12] Chong Gu and Jingyuan Wang. Penalized likelihood density estimation: direct cross-validation and scalable approximation. Stat. Sinica, 13(3):811–826, 2003. [13] Ali Jalali, Pradeep Ravikumar, Vishvas Vasuki, and Sujay Sanghavi. On learning discrete graphical models using group-sparse regularization. In AISTATS, pages 378–387, 2011. [14] Yongho Jeon and Yi Lin. An effective method for high-dimensional log-density anova estimation, with application to nonparametric graphical model building. Stat. Sinica, 16(2):353–374, 2006. [15] Tom Leonard. Density estimation, stochastic processes and prior information. J. R. Stat. Soc. B, 40(2):113– 146, 1978. With discussion. [16] Han Liu, Fang Han, Ming Yuan, John D. Lafferty, and Larry A. Wasserman. High-dimensional semiparametric Gaussian copula graphical models. Ann. Stat., 40(4):2293–2326, 2012. [17] Han Liu, John D. Lafferty, and Larry A. Wasserman. The nonparanormal: Semiparametric estimation of high dimensional undirected graphs. J. Mach. Learn. Res., 10:2295–2328, 2009. [18] Benoît R. Mâsse and Young K. Truong. Conditional logspline density estimation. Canad. J. Statist., 27(4):819–832, 1999. [19] Song Mei, Yu Bai, and Andrea Montanari. The landscape of empirical risk for non-convex losses. arXiv preprint arXiv:1607.06534, 2016. [20] Pradeep Ravikumar, Martin J Wainwright, John D Lafferty, et al. High-dimensional ising model selection using l1-regularized logistic regression. The Annals of Statistics, 38(3):1287–1319, 2010. [21] B. W. Silverman. On the estimation of a probability density function by the maximum penalized likelihood method. Ann. Stat., 10(3):795–810, 1982. [22] TP Speed and HT Kiiveri. Gaussian markov distributions over finite graphs. The Annals of Statistics, pages 138–150, 1986. [23] Charles J. Stone, Mark H. Hansen, Charles Kooperberg, and Young K. Truong. Polynomial splines and their tensor products in extended linear modeling. Ann. Stat., 25(4):1371–1470, 1997. With discussion and a rejoinder by the authors and Jianhua Z. Huang. [24] Siqi Sun, Jinbo Xu, and Mladen Kolar. Learning structured densities via infinite dimensional exponential families. In Advances in Neural Information Processing Systems, pages 2287–2295, 2015. [25] Cristiano Varin, Nancy Reid, and David Firth. An overview of composite likelihood methods. Stat. Sinica, 21(1):5–42, 2011. [26] Arend Voorman, Ali Shojaie, and Daniela M. Witten. Graph estimation with joint additive models. Biometrika, 101(1):85–101, Mar 2014. [27] Yuchung J. Wang and Edward H. Ip. Conditionally specified continuous distributions. Biometrika, 95(3):735–746, 2008. [28] Eunho Yang, Pradeep Ravikumar, Genevera I Allen, and Zhandong Liu. Graphical models via univariate exponential family distributions. Journal of Machine Learning Research, 16(1):3813–3847, 2015. [29] Zhuoran Yang, Yang Ning, and Han Liu. On semiparametric exponential family graphical models. arXiv preprint arXiv:1412.8697, 2014. 10 [30] Xiaotong Yuan, Ping Li, Tong Zhang, Qingshan Liu, and Guangcan Liu. Learning additive exponential family graphical models via ℓ_{2, 1}-norm regularized m-estimation. In Advances in Neural Information Processing Systems, pages 4367–4375, 2016. [31] Hao Helen Zhang and Yi Lin. Component selection and smoothing for nonparametric regression in exponential families. Stat. Sinica, 16(3):1021–1041, 2006. [32] Tuo Zhao, Zhaoran Wang, and Han Liu. Nonconvex low rank matrix factorization via inexact first order oracle. Advances in Neural Information Processing Systems, 2015. 11
2017
674
7,201
Generating steganographic images via adversarial training Jamie Hayes University College London j.hayes@cs.ucl.ac.uk George Danezis University College London The Alan Turing Institute g.danezis@ucl.ac.uk Abstract Adversarial training has proved to be competitive against supervised learning methods on computer vision tasks. However, studies have mainly been confined to generative tasks such as image synthesis. In this paper, we apply adversarial training techniques to the discriminative task of learning a steganographic algorithm. Steganography is a collection of techniques for concealing the existence of information by embedding it within a non-secret medium, such as cover texts or images. We show that adversarial training can produce robust steganographic techniques: our unsupervised training scheme produces a steganographic algorithm that competes with state-of-the-art steganographic techniques. We also show that supervised training of our adversarial model produces a robust steganalyzer, which performs the discriminative task of deciding if an image contains secret information. We define a game between three parties, Alice, Bob and Eve, in order to simultaneously train both a steganographic algorithm and a steganalyzer. Alice and Bob attempt to communicate a secret message contained within an image, while Eve eavesdrops on their conversation and attempts to determine if secret information is embedded within the image. We represent Alice, Bob and Eve by neural networks, and validate our scheme on two independent image datasets, showing our novel method of studying steganographic problems is surprisingly competitive against established steganographic techniques. 1 Introduction Steganography and cryptography both provide methods for secret communication. Authenticity and integrity of communications are central aims of modern cryptography. However, traditional cryptographic schemes do not aim to hide the presence of secret communications. Steganography conceals the presence of a message by embedding it within a communication the adversary does not deem suspicious. Recent details of mass surveillance programs have shown that meta-data of communications can lead to devastating privacy leakages1. NSA officials have stated that they “kill people based on meta-data” [8]; the mere presence of a secret communication can have life or death consequences even if the content is not known. Concealing both the content as well as the presence of a message is necessary for privacy sensitive communication. Steganographic algorithms are designed to hide information within a cover message such that the cover message appears unaltered to an external adversary. A great deal of effort is afforded to designing steganographic algorithms that minimize the perturbations within a cover message when a secret message is embedded within, while allowing for recovery of the secret message. In this work we ask if a steganographic algorithm can be learned in an unsupervised manner, without 1See EFF’s guide: https://www.eff.org/files/2014/05/29/unnecessary_and_ disproportionate.pdf. human domain knowledge. Note that steganography only aims to hide the presence of a message. Thus, it is nearly always the case that the message is encrypted prior to embedding using a standard cryptographic scheme; the embedded message is therefore indistinguishable from a random string. The receiver of the steganographic image will then decode to reveal the ciphertext of the message and then decrypt using an established shared key. For the unsupervised design of steganographic techniques, we leverage ideas from the field of adversarial training [7]. Typically, adversarial training is used to train generative models on tasks such as image generation and speech synthesis. We design a scheme that aims to embed a secret message within an image. Our task is discriminative, the embedding algorithm takes in a cover image and produces a steganographic image, while the adversary tries to learn weaknesses in the embedding algorithm, resulting in the ability to distinguish cover images from steganographic images. The success of a steganographic algorithm or a steganalysis technique over one another amounts to ability to model the cover distribution correctly [5]. So far, steganographic schemes have used human-based rules to ‘learn’ this distribution and perturb it in a way that disrupts it least. However, steganalysis techniques commonly use machine learning models to learn the differences in distributions between the cover and steganographic images. Based on this insight we pursue the following hypothesis: Hypothesis: Machine learning is as capable as human-based rules for the task of modeling the cover distribution, and so naturally lends itself to the task of designing steganographic algorithms, as well as performing steganalysis. In this paper, we introduce the first steganographic algorithm produced entirely in an unsupervised manner, through a novel adversarial training scheme. We show that our scheme can be successfully implemented in practice between two communicating parties, and additionally that with supervised training, the steganalyzer, Eve, can compete against state-of-the-art steganalysis methods. To the best of our knowledge, this is one of the first real-world applications of adversarial training, aside from traditional adversarial learning applications such as image generation tasks. 2 Related work 2.1 Adversarial learning Two recent designs have applied adversarial training to cryptographic and steganographic problems. Abadi and Andersen [2] used adversarial training to teach two neural networks to encrypt a short message, that fools a discriminator. However, it is hard to offer an evaluation to show that the encryption scheme is computationally difficult to break, nor is there evidence that this encryption scheme is competitive against readily available public key encryption schemes. Adversarial training has also been applied to steganography [4], but in a different way to our scheme. Whereas we seek to train a model that learns a steganographic technique by itself, Volkhonskiy et al’s. work augments the original GAN process to generate images which are more susceptible to established steganographic algorithms. In addition to the normal GAN discriminator, they introduce a steganalyzer that receives examples from the generator that may or may not contain secret messages. The generator learns to generate realistic images by fooling the discriminator of the GAN, and learns to be a secure container by fooling the steganalyzer. However, they do not measure performance against state-of-the-art steganographic techniques making it difficult to estimate the robustness of their scheme. 2.2 Steganography Steganography research can be split into two subfields: the study of steganographic algorithms and the study of steganalyzers. Research into steganographic algorithms concentrates on finding methods to embed secret information within a medium while minimizing the perturbations within that medium. Steganalysis research seeks to discover methods to detect such perturbations. Steganalysis is a binary classification task: discovering whether or not secret information is present with a message, and so machine learning classifiers are commonly used as steganalyzers. Least significant bit (LSB) [16] is a simple steganographic algorithm used to embed a secret message within a cover image. Each pixel in an image is made up of three RGB color channels (or one for grayscale images), and each color channel is represented by a number of bits. For example, it is 2 Alice Eve Bob M C C′ M ′ p (a) Alice Eve Bob M C C′ M ′ p Alice Alice Eve Bob M C C′ M ′ p Bob (1) (2) (3) (b) Figure 1: (a) Diagram of the training game. (b) How two parties, Carol and David, use the scheme in practice: (1) Two parties establish a shared key. (2) Carol trains the scheme on a set of images. Information about model weights, architecture and the set of images used for training is encrypted under the shared key and sent to David, who decrypts to create a local copy of the models. (3) Carol then uses the Alice model to embed a secret encrypted message, creating a steganographic image. This is sent to David, who uses the Bob model to decode the encrypted message and subsequently decrypt. common to represent a pixel in a grayscale image with an 8-bit binary sequence. The LSB technique then replaces the least significant bits of the cover image by the bits of the secret message. By only manipulating the least significant bits of the cover image, the variation in color of the original image is minimized. However, information from the original image is always lost when using the LSB technique, and is known to be vulnerable to steganalysis [6]. Most steganographic schemes for images use a distortion function that forces the embedding process to be localized to parts of the image that are considered noisy or difficult to model. Advanced steganographic algorithms attempt to minimize the distortion function between a cover image, C, and a steganographic image, C′, d(C, C′) = f(C, C′) · |C −C′| It is the choice of the function f, the cost of distorting a pixel, which changes for different steganographic algorithms. HUGO [18] is considered to be one of the most secure steganographic techniques. It defines a distortion function domain by assigning costs to pixels based on the effect of embedding some information within a pixel, the space of pixels is condensed into a feature space using a weighted norm function. WOW (Wavelet Obtained Weights) [9] is another advanced steganographic method that embeds information into a cover image according to regions of complexity. If a region of an image is more texturally complex than another, the more pixel values within that region will be modified. Finally, S-UNIWARD [10] proposes a universal distortion function that is agnostic to the embedding domain. However, the end goal is much the same: to minimize this distortion function, and embed information in noisy regions or complex textures, avoiding smooth regions of the cover images. In Section 4.2, we compare out results against a state-of-the-art steganalyzer, ATS [13]. ATS uses labeled data to build artificial training sets of cover and steganographic images, and is trained using an SVM with a Gaussian kernel. They show that this technique outperforms other popular steganalysis tools. 3 Steganographic adversarial training This section discusses our steganographic scheme, the models we use and the information each party wishes to conceal or reveal. After laying this theoretical groundwork, we present experiments supporting our claims. 3.1 Learning objectives Our training scheme involves three parties: Alice, Bob and Eve. Alice sends a message to Bob, Eve can eavesdrop on the link between Alice and Bob and would like to discover if there is a secret message embedded within their communication. In classical steganography, Eve (the Steganalyzer) is passed both unaltered images, called cover images, and images with secret messages embedded 3 within, called steganographic images. Given an image, Eve places a confidence score of how likely this is a cover or steganographic image. Alice embeds a secret message within the cover image, producing a steganographic image, and passes this to Bob. Bob knows the embedding process and so can recover the message. In our scheme, Alice, Bob and Eve are neural networks. Alice is trained to learn to produce a steganographic image such that Bob can recover the secret message, and such that Eve can do no better than randomly guess if a sample is a cover or steganographic image. The full scheme is depicted in Figure 1a: Alice receives a cover image, C, and a secret encrypted message, M, as inputs. Alice outputs a steganographic image, C′, which is given to both Bob and Eve. Bob outputs M ′, the secret message he attempts to recover from C′. We say Bob performs perfectly if M = M ′. In addition to the steganographic images, Eve also receives the cover images. Given an input X, Eve outputs the probability, p, that X = C. Alice tries to learn an embedding scheme such that Eve always outputs p = 1 2. We do not train Eve to maximize her prediction error, since she can then simply flip her decision and perform with perfect classification accuracy. Figure 1b shows how the scheme should be used in pratice if two people wish to communicate a steganographic message using our scheme. The cost of sending the encrypted model information from Carol to David is low, with an average of 70MB. Note that in Figure 1b, steps (1) and (2), the set-up of the shared key and sharing of model information, is perfomed offline. We assume, as is common in cryptographic research, that this initial set-up phase is not visible to an adversary. At the beginning of training, a human can easily separate cover images from steganographic images, as Alice has not learned yet how to embed the secret message such that there is no visible difference in the cover image. However, we train Eve much like a discriminator in a GAN, where we tie her predictive power to the embedding capacity of Alice. When Alice produces a steganographic image that does not resemble the cover image, Eve does not have the ability to perfectly separate cover from steganographic images. As training continues, Eve becomes better at her task, but then so does Alice as her weights are updated, in part, based on the loss of Eve. Similarly to Abadi and Andersen [2], we let θA, θB, θC denote the parameters of Alice, Bob and Eve, respectively. We write A(θA, C, M) for Alice’s output on C and M, B(θb, C′) for Bob’s output on C′, and E(θE, C, C′) for Eve’s output on C and C′. Let LA, LB, LC denote the loss of Alice, Bob and Eve, respectively. Then, we have the following relations: B(θb, C′) = B(θb, A(θA, C, M)) E(θE, C, C′) = E(θE, C, A(θA, C, M)) We set Bob’s loss (the secret message reconstruction loss), to be the Euclidean distance between M and M ′: LB(θA, θB, M, C) = d(M, B(θb, C′)) = d(M, B(θb, A(θA, C, M)) = d(M, M ′) As is common with GAN discriminator implementations, we set the Eve’s loss to be sigmoid cross entropy loss: LE(θE, C, C′) = −y · log(E(θE, x)) −(1 −y) · log(1 −E(θE, x)), where y = 0 if x = C′ and y = 1 if x = C. Alice’s loss is given as a weighted sum of Bob’s loss, Eve’s loss on steganographic images, and an additional reconstructive loss term: LA(θA, C, M) = λA · d(C, C′) + λB · LB + λE · LE(θE, C, C′), where d(C, C′) is the Euclidean distance between the cover image and the steganographic image, and λA, λB, λE ∈R define the weight given to each respective loss term. Our goal is not only to explore whether neural networks can produce steganographic embedding algorithms in an unsupervised manner, but whether they are competitive against steganographic algorithms like HUGO, WOW and S-UNIWARD, that have been designed by steganography experts. We did not intend to encode a specific algorithm within the neural network, rather we would like to give the networks the opportunity to devise their own. 4 (a) Cover images. (b) Steganographic images (0.1bpp). (c) Steganographic images (0.4bpp). Figure 2: Cover and steganographic images from the celebA dataset, with embedding rates of 0.1bpp and 0.4bpp. 0 20 40 60 80 100 120 140 Steps 0.5 1.0 1.5 2.0 Loss Alice Bob Eve (a) Alice, Bob and Eve error for 0.1bpp. 0 20 40 60 80 100 120 140 Steps 0.2 0.4 0.6 0.8 1.0 1.2 1.4 Loss Alice Bob Eve (b) Alice, Bob and Eve error for 0.4bpp. 0 20 40 60 80 100 120 140 Steps 0 20 40 60 80 100 Number of bits correctly decoded (out of 100) (c) Bob decoding success for 0.1bpp. 0 20 40 60 80 100 120 140 Steps 0 50 100 150 200 250 300 350 400 Number of bits correctly decoded (out of 400) (d) Bob decoding success for 0.4bpp. Figure 3: Results on celebA dataset at an embedding rate of 0.1bpp and 0.4bpp. 3.2 Architecture Alice (Steganographic Encoder). Alice accepts as input a cover image and a random n-bit binary message. The cover image is flattened and concatenated with the secret message, which is then fed into the neural network. We would like the locality of the embedding process to be learned instead of fixed; the first layer is fully connected to the next, allowing the secret message to be combined with any region of the cover image. We then reshape to 4 × 4 × I · 8, where I is width of the cover image. Each of the next four layers are a sequence of upsampling fractionally-strided convolutions, batch normalization and ReLU [17], except for the final layer where tanh [12] is used as the activation function. Bob (Steganographic Decoder). Bob accepts as input the steganographic image output by Alice. Bob uses a deep convolutional architecture to extract the important bits from the output of Alice. It is made up of four fractionally-strided convolutions and one final fully connected layer. Leaky ReLU [15] is used in all but the final layer, where tanh is used. Batch normalization is applied at each layer. Eve (Steganalyzer). Eve accepts as input both cover images and steganographic images. Eve has a similar architecture to Bob but uses the sigmoid activation function instead of tanh at the final layer to output probabilities from the logits. 5 4 Experiments As a proof of concept, we implemented our adversarial training scheme on two image datasets: celebrity faces in the wild (celebA) [14] and a standard steganography research dataset, BOSS2. We concatenate an n-bit random message, with each sample of each dataset. We vary the size of the message, n, to test the limits of the amount of information that can be effectively hidden inside a cover image. This corresponds to the number of bits per pixel (bpp) that can be hidden by a steganographic algorithm, a common measure of the success of a steganographic research. On average, steganographic algorithms can successfully hide approximately 0.4bpp. Our datasets are formed of 32 × 32 pixel images, and so we vary n from 100 to 400, this corresponds to hiding between approximately 0.1bpp to 0.4bpp. We intentionally randomize the secret message so that the network does not learn a specific function associated with a specific group of messages. We want to be sure that our model can generalize to any message that is less than n bits3. For each experiment, we performed grid search to find the optimum loss weights, λA, λB, λE, for Alice. All experiments in this section were performed in TensorFlow [1, 3], on a workstation with a Tesla K40 GPU card. 4.1 CelebA dataset We first motivate our work by showing our model can produce steganographic images that are almost indistinguishable from the cover images. We vary the size of the embedded secret message, to explore how many bits may be stored in a cover image while remaining undetected by a steganalyzer. As expected, we find that a larger perturbation in the cover image results in more communicated bits but carries a greater risk of detection. The celebA dataset consists of 202, 599 images of celebrity faces from 10, 177 unique identities. We train in batches of 32, and use the Adam optimizer [11] with a learning rate of 2 · 10−4. At each batch we alternate training either Alice and Bob, or Eve. Figure 2b and Figure 2c show the steganographic images output by Alice after 150 training steps, for embedding rates of 0.1bpp and 0.4bpp, respectively. Our scheme easily copes with an embedding rate of 0.1bpp for a 32 × 32 image, which is equivalent to communicating a short 12 character ASCII message. Figure 3a and Figure 3c shows the training loss of each model, and the success of Bob decoding the secret message over time, respectively. In the first few rounds of training, the visual quality of Alice’s output is low and Bob is essentially randomly guessing the message. After approximately 30 steps, Alice learns to successfully embed information in a cover image such that Eve is fooled, and Bob learns to correctly decode the message. After 150 training steps, Bob decodes the message with an average success of 100%, while Eve’s loss remains the same. Figure 3b and Figure 3d show similar results, with both sample quality and success of decoding both high by the end of training. Concealing 0.4bpp corresponds to successfully hiding a message of 51 ASCII characters. Due to the larger amount of information communicated between Alice and Bob, it takes a longer period of time for Alice to discover an effective embedding scheme, and for Bob to correctly discover the secret message. After 150 training steps, Bob can successfully decode 100% of the message. There is no noticeable image quality decrease between 0.1bpp and 0.4bpp, however we found after 0.4bpp, image quality suffered and it was no longer possible to balance realistic image creation capable of fooling Eve, and convergence of message decoding. For both embedding rates of 0.1bpp and 0.4bpp, Eve’s loss remained constant at approximately 1.4. Eve’s loss is the sum of losses on both steganographic images and cover images, which both remained steady at approximately 0.69. Due to the logarithmic term in the loss function, this is equivalent to randomly guessing if an image carries a secret message. 4.2 BOSS dataset In addition to our experiments on the celebA dataset, we trained our steganographic scheme on the BOSS image dataset, which is commonly used as a benchmark in steganography research. BOSS is made up of 10, 000 grayscale images depicting a variety of scenes such as landscapes, buildings and animals. We expected our scheme to perform worse than on the celebA dataset, since the cover 2http://agents.fel.cvut.cz/boss/index.php?mode=VIEW&tmpl=materials 3This ensures our scheme can embed ciphertexts of messages, which appear as random strings. 6 (a) Cover images of buildings, birds, skies and the ocean. (b) Steganographic images (0.1bpp). 0 20 40 60 80 100 120 140 Steps 0.2 0.4 0.6 0.8 1.0 1.2 1.4 Loss Alice Bob Eve (c) Alice, Bob and Eve error for 0.1bpp. 0 20 40 60 80 100 120 140 Steps 0 20 40 60 80 100 Number of bits correctly decoded (out of 100) (d) Bob decoding success for 0.1bpp. Figure 4: Results on BOSS dataset at an embedding rate of 0.1bpp. images do not come from a single distribution. However, we found our scheme is still capable of embedding secret information successfully. Figure 4b shows the sample quality of steganographic images with an embedding rate of 0.1bpp, while Figure 4c and Figure 4d show the error rates of Alice, Bob and Eve, and the success of Bob decoding the secret message, respectively. While image quality suffers slightly more than on the celebA dataset, our scheme is still able to learn a steganographic algorithm. Our scheme is output samples that are not dissimilar from the original dataset, while Bob is able to learn to successfully decode the message. Alice and Bob both learn their respective tasks in a relatively short period of time, after which there is not much improvement in terms of hiding or recovering the secret message. At the end of training, Bob is able to successfully decode the secret message with 99.8% accuracy. 4.3 Comparison with related work Fooling a steganalyzer, Eve, is easy by design, since we train in such a way that Eve never has a significant competitive advantage. Thus, we additionally show that the resultant trained steganographic model, Alice, can fool an independent steganalyzer. We compare our scheme against both state-of-the-art steganographic algorithms and steganalysis tools and show that it performs competitively. For both BOSS and CelebA, we compare our scheme against steganographic algorithms HUGO, WOW and S-UNIWARD. Additionally, we implement the Eve model using supervised training and compare against the steganalyzer ATS in Table 1. By design, Eve only performs slightly better than random. One may wonder whether the choice of model for Eve is wise; why not use an established steganalyzer in place of the Eve model? By training Eve in a supervised fashion, we show that Eve has the capacity to become a strong steganalyzer, competing against established techniques like ATS, and so is a good choice for the steganalyzer. Furthermore, Eve does not require a feature extraction preprocessing step as with ATS, and, from our experiments, is an order of magnitude quicker to train. For both the BOSS and CelebA datasets, we use 10, 000 samples and split in half, creating a training set and a test set. Alice was then trained on the 5000 samples from the training set. We then created an additional 10, 000 steganographic images for each steganographic algorithm (Alice, HUGO, WOW and S-UNIWARD). Now each steganographic algorithm has an associated training 7 Table 1: Accuracy of distinguishing between cover and steganographic images for the steganalyzers, Eve and ATS, on the BOSS and CelebA datasets at an embedding rate of 0.4bpp. BOSS CELEBA STEGANOGRAPHIC ALGORITHM STEGANALYZER STEGANALYZER ATS EVE ATS EVE ALICE 0.83 0.79 0.95 0.90 HUGO 0.66 0.59 0.94 0.89 WOW 0.75 0.74 0.89 0.85 S-UNIWARD 0.77 0.72 0.91 0.84 set and test set, each consisting of 5000 cover images and 5000 steganographic images. For each steganographic algorithm we train both ATS and Eve on the associated training set, and then report accuracy of the steganalyzer on the test set. From Table 1, Eve performs competitively against the steganalyzer, ATS, and Alice also performs well against other steganographic techniques. While our scheme does not substantially improve on current popular steganographic methods, it is clear that it does not perform significantly worse, and that unsupervised training methods are capable of competing with expert domain knowledge. 4.4 Evaluating robust decryption Due to the non-convexity of the models in the training scheme, we cannot guarantee that two separate parties training on the same images will converge to the same model weights, and so learn the same embedding and decoding algorithms. Thus, prior to steganographic communication, we require one of the communicating parties to train the scheme locally, encrypt model information and pass it to the other party along with information about the set of training images. This ensures both parties learn the same model weights. To validate the practicality of our idea, we trained the scheme locally (Machine A) and then sent model information to another workstation (Machine B) that reconstructed the learned models. We then passed steganographic images, embedded by the Alice model from Machine A, to Machine B, who used the Bob model to recover the secret messages. Using messages of length corresponding to hiding 0.1bpp, and randomly selecting 10% of the CelebA dataset, Machine B was able to recover 99.1% of messages sent by Machine A, over 100 trials; our scheme can successfully decode the secret encrypted message from the steganographic image. Note that our scheme does not require perfect decoding accuracy to subsequently decrypt the message. A receiver of a steganographic message can successfully decode and decrypt the secret message if the mode of encryption can tolerate errors. For example, using a stream cipher such as AES-CTR guarantees that incorrectly decoded bits will not affect the ability to decrypt the rest of the message. 5 Discussion & conclusion We have offered substantial evidence that our hypothesis is correct and machine learning can be used effectively for both steganalysis and steganographic algorithm design. In particular, it is competitive against designs using human-based rules. By leveraging adversarial training games, we confirm that neural networks are able to discover steganographic algorithms, and furthermore, these steganographic algorithms perform well against state-of-the-art techniques. Our scheme does not require domain knowledge for designing steganographic schemes. We model the attacker as another neural network and show that this attacker has enough expressivity to perform well against a state-of-the-art steganalyzer. We expect this work to lead to fruitful avenues of further research. Finding the balance between cover image reconstruction loss, Bob’s loss and Eve’s loss to discover an effective embedding scheme is currently done via grid search, which is a time consuming process. Discovering a more refined method would greatly improve the efficiency of the training process. Indeed, discovering a method to quickly check whether the cover image has the capacity to accept a secret message would be a great improvement over the trial-and-error approach currently implemented. It also became clear that Alice and Bob learn their tasks after a relatively small number of training steps, further research is needed to explore if Alice and Bob fail to improve due to limitations in the model or because of shortcomings in the training scheme. 8 6 Acknowledgements The authors would like to acknowledge financial support from the UK Government Communications Headquarters (GCHQ), as part of University College London’s status as a recognised Academic Centre of Excellence in Cyber Security Research. Jamie Hayes is supported by a Google PhD Fellowship in Machine Learning. We thank the anonymous reviewers for their comments. References [1] 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. [2] Martín Abadi and David G Andersen. Learning to protect communications with adversarial neural cryptography. arXiv preprint arXiv:1610.06918, 2016. [3] Martín Abadi, Paul Barham, Jianmin Chen, Zhifeng Chen, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Geoffrey Irving, Michael Isard, et al. Tensorflow: A system for large-scale machine learning. 2016. [4] Boris Borisenko Denis Volkhonskiy and Evgeny Burnaev. Generative adversarial networks for image steganography. ICLR 2016 Open Review, 2016. [5] Tomáš Filler, Andrew D Ker, and Jessica Fridrich. The square root law of steganographic capacity for markov covers. In IS&T/SPIE Electronic Imaging, pages 725408–725408. International Society for Optics and Photonics, 2009. [6] Jessica Fridrich, Miroslav Goljan, and Rui Du. Detecting lsb steganography in color, and gray-scale images. IEEE multimedia, 8(4):22–28, 2001. [7] 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 Neural Information Processing Systems 27, pages 2672–2680. Curran Associates, Inc., 2014. [8] M. Hayden. The price of privacy: Re-evaluating the nsa, 2014. [9] Vojtech Holub and Jessica Fridrich. Designing steganographic distortion using directional filters. In Information Forensics and Security (WIFS), 2012 IEEE International Workshop on, pages 234–239. IEEE, 2012. [10] Vojtˇech Holub, Jessica Fridrich, and Tomáš Denemark. Universal distortion function for steganography in an arbitrary domain. EURASIP Journal on Information Security, 2014(1):1, 2014. [11] Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. [12] Yann A LeCun, Léon Bottou, Genevieve B Orr, and Klaus-Robert Müller. Efficient backprop. In Neural networks: Tricks of the trade, pages 9–48. Springer, 2012. [13] Daniel Lerch-Hostalot and David Megías. Unsupervised steganalysis based on artificial training sets. Eng. Appl. Artif. Intell., 50(C):45–59, April 2016. [14] Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In Proceedings of the IEEE International Conference on Computer Vision, pages 3730–3738, 2015. [15] Andrew L Maas, Awni Y Hannun, and Andrew Y Ng. Rectifier nonlinearities improve neural network acoustic models. In Proc. ICML, volume 30, 2013. [16] Jarno Mielikainen. Lsb matching revisited. IEEE signal processing letters, 13(5):285–287, 2006. 9 [17] Vinod Nair and Geoffrey E Hinton. Rectified linear units improve restricted boltzmann machines. In Proceedings of the 27th international conference on machine learning (ICML-10), pages 807–814, 2010. [18] Tomáš Pevn`y, Tomáš Filler, and Patrick Bas. Using high-dimensional image models to perform highly undetectable steganography. In International Workshop on Information Hiding, pages 161–177. Springer, 2010. 10
2017
675
7,202
NeuralFDR: Learning Discovery Thresholds from Hypothesis Features Fei Xia⇤, Martin J. Zhang⇤, James Zou†, David Tse† Stanford University {feixia,jinye,jamesz,dntse}@stanford.edu Abstract As datasets grow richer, an important challenge is to leverage the full features in the data to maximize the number of useful discoveries while controlling for false positives. We address this problem in the context of multiple hypotheses testing, where for each hypothesis, we observe a p-value along with a set of features specific to that hypothesis. For example, in genetic association studies, each hypothesis tests the correlation between a variant and the trait. We have a rich set of features for each variant (e.g. its location, conservation, epigenetics etc.) which could inform how likely the variant is to have a true association. However popular empirically-validated testing approaches, such as Benjamini-Hochberg’s procedure (BH) and independent hypothesis weighting (IHW), either ignore these features or assume that the features are categorical or uni-variate. We propose a new algorithm, NeuralFDR, which automatically learns a discovery threshold as a function of all the hypothesis features. We parametrize the discovery threshold as a neural network, which enables flexible handling of multi-dimensional discrete and continuous features as well as efficient end-to-end optimization. We prove that NeuralFDR has strong false discovery rate (FDR) guarantees, and show that it makes substantially more discoveries in synthetic and real datasets. Moreover, we demonstrate that the learned discovery threshold is directly interpretable. 1 Introduction In modern data science, the analyst is often swarmed with a large number of hypotheses — e.g. is a mutation associated with a certain trait or is this ad effective for that section of the users. Deciding which hypothesis to statistically accept or reject is a ubiquitous task. In standard multiple hypothesis testing, each hypothesis is boiled down to one number, a p-value computed against some null distribution, with a smaller value indicating less likely to be null. We have powerful procedures to systematically reject hypotheses while controlling the false discovery rate (FDR) Note that here the convention is that a “discovery” corresponds to a “rejected” null hypothesis. These FDR procedures are widely used but they ignore additional information that is often available in modern applications. Each hypothesis, in addition to the p-value, could also contain a set of features pertinent to the objects being tested in the hypothesis. In the genetic association setting above, each hypothesis tests whether a mutation is correlated with the trait and we have a p-value for this. Moreover, we also have other features about both the mutation (e.g. its location, epigenetic status, conservation etc.) and the trait (e.g. if the trait is gene expression then we have features on the gene). Together these form a feature representation of the hypothesis. This feature vector is ignored by the standard multiple hypotheses testing procedures. In this paper, we present a flexible method using neural networks to learn a nonlinear mapping from hypothesis features to a discovery threshold. Popular procedures for multiple hypotheses ⇤These authors contributed equally to this work and are listed in alphabetical order. †These authors contributed equally. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. H1 p1 x1 H2 p2 x2 H3 p3 x3 H4 p4 x4 Input Discovery Threshold H1 yes true H2 yes true H3 no false H4 yes false discovery true alternative FDP = 1/3 End-to-end learning of the neural network t(x; θ) Covariate X Figure 1: NeuralFDR: an end-to-end learning procedure. testing correspond to having one constant threshold for all the hypotheses (BH [3]), or a constant for each group of hypotheses (group BH [13], IHW [14, 15]). Our algorithm takes account of all the features to automatically learn different thresholds for different hypotheses. Our deep learning architecture enables efficient optimization and gracefully handles both continuous and discrete multidimensional hypothesis features. Our theoretical analysis shows that we can control false discovery proportion (FDP) with high probability. We provide extensive simulation on synthetic and real datasets to demonstrate that our algorithm makes more discoveries while controlling FDR compared to state-of-the-art methods. Contribution. As shown in Fig. 1, we provide NeuralFDR, a practical end-to-end algorithm to the multiple hypotheses testing problem where the hypothesis features can be continuous and multi-dimensional. In contrast, the currently widely-used algorithms either ignore the hypothesis features (BH [3], Storey’s BH [21]) or are designed for simple discrete features (group BH [13], IHW [15]). Our algorithm has several innovative features. We learn a multi-layer perceptron as the discovery threshold and use a mirroring technique to robustly estimate false discoveries. We show that NeuralFDR controls false discovery with high probability for independent hypotheses and asymptotically under weak dependence [13, 21], and we demonstrate on both synthetic and real datasets that it controls FDR while making substantially more discoveries. Another advantage of our end-to-end approach is that the learned discovery threshold are directly interpretable. We will illustrate in Sec. 4 how the threshold conveys biological insights. Related works. Holm [12] investigated the use of p-value weights, where a larger weight suggests that the hypothesis is more likely to be an alternative. Benjamini and Hochberg [4] considered assigning different losses to different hypotheses according to their importance. Some more recent works are [9, 10, 13]. In these works, the features are assumed to have some specific forms, either prespecified weights for each hypothesis or the grouping information. The more general formulation considered in this paper was purposed quite recently [15, 16, 18, 19]. It assumes that for each hypothesis, we observe not only a p-value Pi but also a feature Xi lying in some generic space X. The feature is meant to capture some side information that might bear on the likelihood of a hypothesis to be significant, or on the power of Pi under the alternative, but the nature of this relationship is not fully known ahead of time and must be learned from the data. The recent work most relevant to ours is IHW [15]. In IHW, the data is grouped into G groups based on the features and the decision threshold is a constant for each group. IHW is similar to NeuralFDR in that both methods optimize the parameters of the decision rule to increase the number of discoveries while using cross validation for asymptotic FDR control. IHW has several limitations: first, binning the data into G groups can be difficult if the feature space X is multi-dimensional; second, the decision rule, restricted to be a constant for each group, is artificial for continuous features; and third, the asymptotic FDR control guarantee requires the number of groups going to infinity, which can be unrealistic. In contrast, NeuralFDR uses a neural network to parametrize the decision rule which is much more general and fits the continuous features. As demonstrated in the empirical results, it works well with multi-dimensional features. In addition to asymptotic FDR control, NeuralFDR also has high-probability false discovery proportion control guarantee with a finite number of hypotheses. SABHA [19] and AdaPT [16] are two recent FDR control frameworks that allow flexible methods to explore the data and compute the feature dependent decision rules. The focus there is the framework rather than the end-to-end algorithm as compared to NueralFDR. For the empirical experiment, SABHA estimates the null proportion using non-parametric methods while AdaPT estimates the 2 distribution of the p-value and the features with a two-group Gamma GLM mixture model and spline regression. The multi-dimensional case is discussed without empirical validation. Hence both methods have a similar limitation to IHW in that they do not provide an empirically validated end-to-end approach for multi-dimensional features. This issue is addressed in [5], where the null proportion is modeled as a linear combination of some hand-crafted transformation of the features. NeuralFDR models this relation in a more flexible way. 2 Preliminaries We have n hypotheses and each hypothesis i is characterized by a tuple (Pi, Xi, Hi), where Pi 2 (0, 1) is the p-value, Xi 2 X is the hypothesis feature, and Hi 2 {0, 1} indicates if this hypothesis is null ( Hi = 0) or alternative ( Hi = 1). The p-value Pi represents the probability of observing an equally or more extreme value compared to the testing statistic when the hypothesis is null, and is calculated based on some data different from Xi. The alternate hypotheses (Hi = 1) are the true signals that we would like to discover. A smaller p-value presents stronger evidence for a hypothesis to be alternative. In practice, we observe Pi and Xi but do not know Hi. We define the null proportion ⇡0(x) to be the probability that the hypothesis is null conditional on the feature Xi = x. The standard assumption is that under the null (Hi = 0), the p-value is uniformly distributed in (0, 1). Under the alternative (Hi = 1), we denote the p-value distribution by f1(p|x). In most applications, the p-values under the alternative are systematically smaller than those under the null. A detailed discussion of the assumptions can be found in Sec. 5. The general goal of multiple hypotheses testing is to claim a maximum number of discoveries based on the observations {(Pi, Xi)}n i=1 while controlling the false positives. The most popular quantities that conceptualize the false positives are the family-wise error rate (FWER) [8] and the false discovery rate (FDR) [3]. We specifically consider FDR in this paper. FDR is the expected proportion of false discoveries, and one closely related quantity, the false discovery proportion (FDP), is the actual proportion of false discoveries. We note that FDP is the actual realization of FDR. Formally, Definition 1. (FDP and FDR) For any decision rule t, let D(t) and FD(t) be the number of discoveries and the number of false discoveries. The false discovery proportion FDP(t) and the false discovery rate FDR(t) are defined as FDP(t) , FD(t)/D(t) and FDR(t) , E[FDP(t)]. In this paper, we aim to maximize D(t) while controlling FDP(t) ↵with high probability. This is a stronger statement than those in FDR control literature of controlling FDR under the level ↵. Motivating example. Consider a genetic association study where the genotype and phenotype (e.g. height) are measured in a population. Hypothesis i corresponds to testing the correlation between the variant i and the individual’s height. The null hypothesis is that there is no correlation, and Pi is the probability of observing equally or more extreme values than the empirically observed correlation conditional on the hypothesis is null Hi = 0. Small Pi indicates that the null is unlikely. Here Hi = 1 (or 0) corresponds to the variant truly is (or is not) associated with height. The features Xi could include the location, conservation, etc. of the variant. Note that Xi is not used to compute Pi, but it could contain information about how likely the hypotheses is to be an alternative. Careful readers may notice that the distribution of Pi given Xi is uniform between 0 and 1 under the null and f1(p|x) under the alternative, which depends on x. This implies that Pi and Xi are independent under the null and dependent under the alternative. To illustrate why modeling the features could improve discovery power, suppose hypothetically that all the variants truly associated with height reside on a single chromosome j⇤and the feature is the chromosome index of each SNP (see Fig. 2 (a)). Standard multiple testing methods ignore this feature and assign the same discovery threshold to all the chromosomes. As there are many purely noisy chromosomes, the p-value threshold must be very small in order to control FDR. In contrast, a method that learns the threshold t(x) could learn to assign a higher threshold to chromosome j⇤and 0 to other chromosomes. As a higher threshold leads to more discoveries and vice versa, this would effectively ignore much of the noise and make more discoveries under the same FDR. 3 Algorithm Description Since a smaller p-value presents stronger evidence against the null hypothesis, we consider the threshold decision rule without loss of generality. As the null proportion ⇡0(x) and the alternative 3 (a) Train CV Test t*(x; θ) γ*t*(x; θ) Optimize (3) Rescale Mirroring estimator D(t) d FD(t) Covariate X p (b) Train CV Test t*(x; θ) γ*t*(x; θ) Optimize (3) Rescale Mirroring estimato (c) Figure 2: (a) Hypothetical example where small p-values are enriched at chromosome j⇤. (b) The mirroring estimator. (c) The training and cross validation procedure. distribution f1(p|x) vary with x, the threshold should also depend on x. Therefore, we can write the rule as t(x) in general, which claims hypothesis i to be significant if Pi < t(Xi). Let I be the indicator function. For t(x), the number of discoveries D(t) and the number of false discoveries FD(t) can be expressed as D(t) = Pn i=1 I{Pi<t(Xi)} and FD(t) = Pn i=1 I{Pi<t(Xi),Hi=0}. Note that computing FD(t) requires the knowledge of Hi, which is not available from the observations. Ideally we want to solve t for the following problem: maximizet D(t), s.t. FDP(t) ↵. (1) Directly solving (1) is not possible. First, without a parametric representation, t can not be optimized. Second, while D(t) can be calculated from the data, FD(t) can not, which is needed for evaluating FDP(t). Third, while each decision rule candidate tj controls FDP, optimizing over them may yield a rule that overfits the data and loses FDP control. We next address these three difficulties in order. First, the representation of the decision rule t(x) should be flexible enough to address different structures of the data. Intuitively, to have maximal discoveries, the landscape of t(x) should be similar to that of the alternative proportion ⇡1(x): t(x) is large in places where the alternative hypotheses abound. As discussed in detail in Sec. 4, two structures of ⇡1(x) are typical in practice. The first is bumps at a few locations, and the second is slopes that vary with x. Hence the representation should at least be able to address these two structures. In addition, the number of parameters needed for the representation should not grow exponentially with the dimensionality of x. Hence non-parametric models, such as the spline-based methods or the kernel based methods, are infeasible. Take kernel density estimation in 5D as example. If we let the kernel width be 0.1, each kernel contains on average 0.001% of the data. Then we need at least a million alternative hypothesis data to have a reasonable estimate of the landscape of ⇡1(x). In this work, we investigate the idea of modeling t(x) using a multilayer perceptron (MLP), which has a high expressive power and has a number of parameters that does not grow exponentially with the dimensionality of the features. As demonstrated in Sec. 4, it can efficiently recover the two common structures, bumps and slopes, and yield promising results in all real data experiments. Second, although FD(t) can not be calculated from the data, if it can be overestimated by some d FD(t), then the corresponding estimate of FDP, namely \ FDP(t) = d FD(t)/D(t), is also an overestimate. Then if \ FDP(t) ↵, then FDP(t) ↵, yielding the desired FDP control. Moreover, if d FD(t) is close to FD(t), the FDP control is tight. Conditional on X = x, the rejection region of p, namely (0, t(x)), contains a mixture of nulls and alternatives. As the null distribution Unif(0, 1) is symmetrical w.r.t. p = 0.5 while the alternative distribution f1(p|x) is highly asymmetrical, the mirrored region (1 −t(x), 1) will contain roughly the same number of nulls but very few alternatives. Then the number of hypothesis in (t(x), 1) can be a proxy of the number of nulls in (0, t(x)). This idea is illustrated in Fig. 2 (b) and we refer to this estimator as the mirroring estimator. This estimator is also used in [1, 16, 17]. Definition 2. (The mirroring estimator) For any decision rule t, let C(t) = {(p, x) : p < t(x)} be the rejection region of t over (Pi, Xi) and let its mirrored region be CM(t) = {(p, x) : p > 1−t(x)}.The mirroring estimator of FD(t) is defined as d FD(t) = P i I{(Pi,Xi)2CM(t)}. The mirroring estimator overestimates the number of false discoveries in expectation: 4 Lemma 1. (Positive bias of the mirroring estimator) E[d FD(t)] −E[FD(t)] = n X i=1 P ⇥ (Pi, Xi) 2 CM(t), Hi = 1 ⇤ ≥0. (2) Remark 1. In practice, t(x) is always very small and f1(p|x) approaches 0 very fast as p ! 1. Then for any hypothesis with (Pi, Xi) 2 CM(t), Pi is very close to 1 and hence P(Hi = 1) is very small. In other words, the bias in (2) is much smaller than E[FD(t)]. Thus the estimator is accurate. In addition, d FD(t) and FD(t) are both sums of n terms. Under mild conditions, they concentrate well around their means. Thus we should expect that d FD(t) approximates FD(t) well most of the times. We make this precise in Sec. 5 in the form of the high probability FDP control statement. Third, we use cross validation to address the overfitting problem introduced by optimization. To be more specific, we divide the data into M folds. For fold j, the decision rule tj(x; ✓), before applied on fold j, is trained and cross validated on the rest of the data. The cross validation is done by rescaling the learned threshold tj(x) by a factor γj so that the corresponding mirror estimate \ FDP on the CV set is ↵. This will not introduce much of additional overfitting since we are only searching over a scalar γ. The discoveries in all M folds are merged as the final result. We note here distinct folds correspond to subsets of hypotheses rather than samples used to compute the corresponding p-values. This procedure is shown in Fig. 2 (c). The details of the procedure as well as the FDP control property are also presented in Sec. 5. Algorithm 1 NeuralFDR 1: Randomly divide the data {(Pi, Xi)}n i=1 into M folds. 2: for fold j = 1, · · · , M do 3: Let the testing data be fold j, the CV data be fold j0 6= j, and the training data be the rest. 4: Train tj(x; ✓) based on the training data by optimizing maximize✓D(t(✓)) s.t. \ FDP(t⇤ j(✓)) ↵. (3) 5: Rescale t⇤ j(x; ✓) by γ⇤ j so that the estimated FDP on the CV data \ FDP(γ⇤ j t⇤ j(✓)) = ↵. 6: Apply γ⇤ j t⇤ j(✓) on the data in fold j (the testing data). 7: Report the discoveries in all M folds. The proposed method NeuralFDR is summarized as Alg. 1. There are two techniques that enabled robust training of the neural network. First, to have non-vanishing gradients, the indicator functions in (3) are substituted by sigmoid functions with the intensity parameters automatically chosen based on the dataset. Second, the training process of the neural network may be unstable if we use random initialization. Hence, we use an initialization method called the k-cluster initialization: 1) use k-means clustering to divide the data into k clusters based on the features; 2) compute the optimal threshold for each cluster based on the optimal group threshold condition ((7) in Sec. 5); 3) initialize the neural network by training it to fit a smoothed version of the computed thresholds. See Supp. Sec. 2 for more implementation details. 4 Empirical Results We evaluate our method using both simulated data and two real-world datasets3. The implementation details are in Supp. Sec. 2. We compare NeuralFDR with three other methods: BH procedure (BH) [3], Storey’s BH procedure (SBH) with threshold λ = 0.4 [21], and Independent Hypothesis Weighting (IHW) with number of bins and folds set as default [15]. BH and SBH are two most popular methods without using the hypothesis features and IHW is the state-of-the-art method that utilizes hypothesis features. For IHW, in the multi-dimensional feature case, k-means is used to group the hypotheses. In all experiments, k is set to 20 and the group index is provided to IHW as the hypothesis feature. Other than the FDR control experiment, we set the nominal FDR level ↵= 0.1. 3We released the software at https://github.com/fxia22/NeuralFDR 5 5/19/17, 12)45 AM Page 1 of 1 http://localhost:8894/files/sideinfo/FDR2.svg (a) 5/19/17, 12)44 AM Page 1 of 1 http://localhost:8894/files/sideinfo/FDR1.svg (b) Figure 3: FDP for (a) DataIHW and (b) 1DGM. Dashed line indicate 45 degrees, which is optimal. Table 1: Simulated data: # of discoveries and gain over BH at FDR = 0.1. DataIHW DataIHW(WD) 1D GM BH 2259 6674 8266 SBH 2651(+17.3%) 7844(+17.5%) 9227(+11.62%) IHW 5074(+124.6%) 10382(+55.6%) 11172(+35.2%) NeuralFDR 6222(+175.4%) 12153(+82.1%) 14899(+80.2%) 1D slope 2D GM 2D slope 5D GM BH 11794 9917 8473 9917 SBH 13593(+15.3%) 11334(+14.2%) 9539(+12.58%) 11334(+14.28%) IHW 12658(+7.3%) 12175(+22.7%) 8758(+3.36%) 11408(+15.0%) NeuralFDR 15781(+33.8%) 18844(+90.0%) 10318(+21.7%) 18364(+85.1%) Simulated data. We first consider DataIHW, the simulated data in the IHW paper ( Supp. 7.2.2 [15]). Then, we use our own data that are generated to have two feature structures commonly seen in practice, the bumps and the slopes. For the bumps, the alternative proportion ⇡1(x) is generated from a Gaussian mixture (GM) to have a few peaks with abundant alternative hypotheses. For the slopes, ⇡1(x) is generated linearly dependent with the features. After generating ⇡1(x), the p-values are generated following a beta mixture under the alternative and uniform (0, 1) under the null. We generated the data for both 1D and 2D cases, namely 1DGM, 2DGM, 1Dslope, 2Dslope. For example, Fig. 4 (a) shows the alternative proportion of 2Dslope. In addition, for the high dimensional feature scenario, we generated a 5D data, 5DGM, which contains the same alternative proportion as 2DGM with 3 addition non-informative directions. We first examine the FDR control property using DataIHW and 1DGM. Knowing the ground truth, we plot the FDP (actual FDR) over different values of the nominal FDR ↵in Fig. 3. For a perfect FDR control, the curve should be along the 45-degree dashed line. As we can see, all the methods control FDR. NeuralFDR controls FDR accurately while IHW tends to make overly conservative decisions. Second, we visualize the learned threshold by both NeuralFDR and IWH. As mentioned in Sec. 3, to make more discoveries, the learned threshold should roughly have the same shape as ⇡1(x). The learned thresholds of NeuralFDR and IHW for 2Dslope are shown in Fig. 3 (b,c). As we can see, NeuralFDR well recovers the slope structure while IHW fails to assign the highest threshold to the bottom right block. IHW is forced to be piecewise constant while NeuralFDR can learn a smooth threshold, better recovering the structure of ⇡1(x). In general, methods that partition the hypotheses into discrete groups would not scale for higher-dimensional features. In Appendix 1, we show that NeuralFDR is also able to recover the correct threshold for the Gaussian signal. Finally, we report the total numbers of discoveries in Tab. 1. In addition, we ran an experiment with dependent p-values with the same dependency structure as Sec. 3.2 in [15]. We call this dataset DataIHW(WD). The number of discoveries are shown in Tab. 1. NeuralFDR has the actual FDP 9.7% while making more discoveries than SBH and IHW. This empirically shows that NeuralFDR also works for weakly dependent data. All numbers are averaged over 10 runs of the same simulation setting. We can see that NeuralFDR outperforms IHW in all simulated datasets. Moreover, it outperforms IHW by a large margin multi-dimensional feature settings. 6 5/19/17, 12)58 AM Page 1 of 1 http://localhost:8894/files/sideinfo/2dslope1.png (a) Actual alternative proportion for 2Dslope. 5/19/17, 12)58 AM Page 1 of 1 http://localhost:8894/files/sideinfo/2dslope2.png (b) NeuralFDR’s learned threshold. 5/19/17, 12)57 AM Page 1 of 1 http://localhost:8894/files/sideinfo/2dslope3.png (c) IHW’s learned threshold 5/19/17, 1(06 AM Page 1 of 1 http://deepfei:8894/files/airway.png (d) NeuralFDR’s learned threshold for Airway log count. 5/19/17, 11(02 AM Page 1 of 1 http://deep.fxia.me:8894/files/gtex-distance.png (e) NeuralFDR’s learned threshold for GTEx log distance. 5/19/17, 11(02 AM Page 1 of 1 http://deep.fxia.me:8894/files/gtex-expression.png (f) NeuralFDR’s learned threshold for GTEx expression level. Figure 4: (a-c) Results for 2Dslope: (a) the alternative proportion for 2Dslope; (b) NeuralFDR’s learned threshold; (c) IHW’s learned threshold. (d-f): Each dot corresponds to one hypothesis. The red curves shows the learned threshold by NeuralFDR: (d) for log count for airway data; (e) for log distance for GTEx data; (f) for expression level for GTEx data. Table 2: Real data: # of discoveries at FDR = 0.1. Airway GTEx-dist GTEx-exp BH 4079 29348 29348 SBH 4038(-1.0%) 29758(+1.4%) 29758(+1.4%) IHW 4873(+19.5%) 35771(+21.9%) 32195(+9.7%) NeuralFDR 6031(+47.9%) 36127(+23.1%) 32214(+9.8%) GTEx-PhastCons GTEx-2D GTEx-3D BH 29348 29348 29348 SBH 29758(+1.4%) 29758(+1.4%) 29758(+1.4%) IHW 30241(+3.0%) 35705(+21.7%) 35598(+21.3%) NeuralFDR 30525(+4.0%) 37095(+26.4%) 37195(+26.7%) Airway RNA-Seq data. Airway data [11] is a RNA-Seq dataset that contains n = 33469 genes and aims to identify glucocorticoid responsive (GC) genes that modulate cytokine function in airway smooth muscle cells. The p-values are obtained by a standard two-group differential analysis using DESeq2 [20]. We consider the log count for each gene as the hypothesis feature. As shown in the first column in Tab. 2, NeuralFDR makes 800 more discoveries than IHW. The learned threshold by NeuralFDR is shown in Fig. 4 (d). It increases monotonically with the log count, capturing the positive dependency relation. Such learned structure is interpretable: low count genes tend to have higher variances, usually dominating the systematic difference between the two conditions; on the contrary, it is easier for high counts genes to show a strong signal for differential expression [15, 20]. GTEx data. A major component of the GTEx [6] study is to quantify expression quantitative trait loci (eQTLs) in human tissues. In such an eQTL analysis, each pair of single nucleotide polymorphism (SNP) and nearby gene forms one hypothesis. Its p-value is computed under the null hypothesis that the SNP’s genotype is not correlated with the gene expression.We obtained all the GTEx p-values from chromosome 1 in a brain tissue (interior caudate), corresponding to 10, 623, 893 SNP-gene combinations. In the original GTEx eQTL study, no features were considered in the FDR analysis, corresponding to running the standard BH or SBH on the p-values. However, we know many biological features affect whether a SNP is likely to be a true eQTL; i.e. these features could vary the alternative proportion ⇡1(x) and accounting for them could increase the power to discover true eQTL’s while guaranteeing that the FDR remains the same. For each hypothesis, we generated three 7 features: 1) the distance (GTEx-dist) between the SNP and the gene (measured in log base-pairs) ; 2) the average expression (GTEx-exp) of the gene across individuals (measured in log rpkm); 3) the evolutionary conservation measured by the standard PhastCons scores (GTEx-PhastCons). The numbers of discoveries are shown in Tab. 2. For GTEx-2D, GTEx-dist and GTEx-exp are used. For NeuralFDR, the number of discoveries increases as we put in more and more features, indicating that it can work well with multi-dimensional features. For IHW, however, the number of discoveries decreases as more features are incorporated. This is because when the feature dimension becomes higher, each bin in IHW will cover a larger space, decreasing the resolution of the piecewise constant function, preventing it from capturing the informative part of the feature. The learned discovery thresholds of NeuralFDR are directly interpretable and match prior biological knowledge. Fig. 4 (e) shows that the threshold is higher when SNP is closer to the gene. This allows more discoveries to be made among nearby SNPs, which is desirable since we know there most of the eQTLs tend to be in cis (i.e. nearby) rather than trans (far away) from the target gene [6]. Fig. 4 (f) shows that the NeuralFDR threshold for gene expression decreases as the gene expression becomes large. This also confirms known biology: the highly expressed genes tend to be more housekeeping genes which are less variable across individuals and hence have fewer eQTLs [6]. Therefore it is desirable that NeuralFDR learns to place less emphasis on these genes. We also show that NeuralFDR learns to give higher threshold to more conserved variants in Supp. Sec. 1, which also matches biology. 5 Theoretical Guarantees We assume the tuples {(Pi, Xi, Hi)}n i=1 are i.i.d. samples from an empirical Bayes model: Xi i.i.d. ⇠µ(X), [Hi|Xi = x] ⇠Bern(1 −⇡0(x)), ⇢ [Pi|Hi = 0, X = x] ⇠ Unif(0, 1) [Pi|Hi = 1, X = x] ⇠ f1(p|x) (4) The features Xi are drawn i.i.d. from some unknown distribution µ(x). Conditional on the feature Xi = x, hypothesis i is null with probability ⇡0(x) and is alternative otherwise. The conditional distributions of p-values are Unif(0, 1) under the null and f1(p|x) under the alternative. FDR control via cross validation. The cross validation procedure is described as follows. The data is divided randomly into M folds of equal size m = n/M. For fold j, let the testing set Dte(j) be itself, the cross validation set Dcv(j) be any other fold, and the training set Dtr(j) be the remaining. The size of the three are m, m, (M −2)m respectively. For fold j, suppose at most L decision rules are calculated based on the training set, namely tj1, · · · , tjL. Evaluated on the cross validation set, let l⇤-th rule be the rule with most discoveries among rules that satisfies 1) its mirroring estimate \ FDP(tjl) ↵; 2) D(tjl)/m > c0, for some small constant c0 > 0. Then, tjl⇤is selected to apply on the testing set (fold j). Finally, discoveries from all folds are combined. The FDP control follows a standard argument of cross validation. Intuitively, the FDP of the rules {tjl}L l=1 are estimated based on Dcv(j), a dataset independent of the training set. Hence there is no overfitting and the overestimation property of the mirroring estimator, as in Lemma 1, is statistical valid, leading to a conservative decision that controls FDP. This is formally stated as below. Theorem 1. (FDP control) Let M be the number of folds and let L be the maximum number of decision rule candidates evaluated by the cross validation set. Then with probability at least 1 −β, the overall FDP is less than (1 + ∆)↵, where ∆= O ⇣q M ↵n log ML β ⌘ . Remark 2. There are two subtle points. First, L can not be too large. Otherwise Dcv(j) may eventually be overfitted by being used too many times for FDP estimation. Second, the FDP estimates may be unstable if the probability of discovery E[D(tjl)/m] approaches 0. Indeed, the mirroring method estimates FDP by \ FDP(tjl) = d F D(tjl) D(tjl) , where both d FD(tjl) and D(tjl) are i.i.d. sums of n Bernoulli random variables with mean roughly ↵E[D(tjl)/m] and E[D(tjl)/m]. When their means are small, the concentration property will fail. So we need E[D(tjl)/m] to be bounded away from zero. Nevertheless this is required in theory but may not be used in practice. Remark 3. (Asymptotic FDR control under weak dependence) Besides the i.i.d. case, NeuralFDR can also be extended to control FDR asymptotically under weak dependence [13, 21]. Generalizing the concept in [13] from discrete groups to continuous features X, the data are under weak dependence 8 if the CDF of (Pi, Xi) for both the null and the alternative proportion converge almost surely to their true values respectively. The linkage disequilibrium (LD) in GWAS and the correlated genes in RNA-Seq can be addressed by such dependence structure. In this case, if learned threshold is c-Lipschitz continuous for some constant c, NeuralFDR will control FDR asymptotically. The Lipschitz continuity can be achieved, for example, by weight clipping [2], i.e. clamping the weights to a bounded set after each gradient update when training the neural network. See Supp. 3 for details. Optimal decision rule with infinite hypotheses. When n = 1, we can recover the joint density fP X(p, x). Based on that, the explicit form of the optimal decision rule can be obtained if we are willing to further assumer f1(p|x) is monotonically non-increasing w.r.t. p. This rule is used for the k-cluster initialization for NeuralFDR as mentioned in Sec. 3. Now suppose we know fP X(p, x). Then µ(x) and fP |X(p|x) can also be determined. Furthermore, as f1(p|x) = 1 1−⇡0(x)(fP |X(p|x) −⇡0(x)), once we specify ⇡0(x), the entire model is specified. Let S(fP X) be the set of null proportions ⇡0(x) that produces the model consistent with fP X. Because f1(p|x) ≥0, we have 8p, x, ⇡0(x) fP |X(p|x). This can be further simplified as ⇡0(x) fP |X(1|x) by recalling that fP |X(p|x) is monotonically decreasing w.r.t. p. Then we know S(fP X) = {⇡0(x) : 8x, ⇡0(x) fP |X(1|x)}. (5) Given fP X(p, x), the model is not fully identifiable. Hence we should look for a rule t that maximizes the power while controlling FDP for all elements in S(fP X). For (P1, X1, H1) ⇠ (fP X, ⇡0, f1) following (4), the probability of discovery and the probability of false discovery are PD(t, fP X) = P(P1 t(X1)), PF D(t, fP X, ⇡0) = P(P1 t(X1), H1 = 0). Then the FDP is FDP(t, fP X, ⇡0) = PF D(t,fP X,⇡0) PD(t,fP X) . In this limiting case, all quantities are deterministic and FDP coincides with FDR. Given that the FDP is controlled, maximizing the power is equivalent to maximizing the probability of discovery. Then we have the following minimax problem: max t min ⇡02S(fP X) PD(t, fP X) s.t. max ⇡02S(fP X) FDP(t, fP X, ⇡0) ↵, (6) where S(fP X) is the set of possible null proportions consistent with fP X, as defined in (5). Theorem 2. Fixing fP X and let ⇡⇤ 0(x) = fP |X(1|x). If f1(p|x) is monotonically non-increasing w.r.t. p, the solution to problem (6), t⇤(x), satisfies 1. fP X(1, x) fP X(t⇤(x), x) = const, almost surely w.r.t. µ(x) 2. FDR(t⇤, fP X, ⇡⇤ 0) = ↵. (7) Remark 4. To compute the optimal rule t⇤by the conditions (7), consider any t that satisfies (7.1). According to (7.1), once we specify the value of t(x) at any location x, say t(0), the entire function is determined. Also, FDP(t, fP X, ⇡⇤ 0) is monotonically non-decreasing w.r.t. t(0). These suggests the following strategy: starting with t(0) = 0, keep increasing t(0) until the corresponding FDP equals ↵, which gives us the optimal threshold t⇤. Similar conditions are also mentioned in [15, 16]. 6 Discussion We proposed NeuralFDR, an end-to-end algorithm to the learn discovery threshold from hypothesis features. We showed that the algorithm controls FDR and makes more discoveries on synthetic and real datasets with multi-dimensional features. While the results are promising, there are also a few challenges. First, we notice that NeuralFDR performs better when both the number of hypotheses and the alternative proportion are large. Indeed, in order to have large gradients for the optimization, we need a lot of elements at the decision boundary t(x) and the mirroring boundary 1 −t(x). It is important to improve the performance of NeuralFDR on small datasets with small alternative proportion. Second, we found that a 10-layer MLP performed well to model the decision threshold and that shallower networks performed more poorly. A better understanding of which network architectures optimally capture signal in the data is also an important question. References [1] Ery Arias-Castro, Shiyun Chen, et al. Distribution-free multiple testing. Electronic Journal of Statistics, 11(1):1983–2001, 2017. 9 [2] Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein gan. arXiv preprint arXiv:1701.07875, 2017. [3] Yoav Benjamini and Yosef Hochberg. Controlling the false discovery rate: a practical and powerful approach to multiple testing. Journal of the royal statistical society. Series B (Methodological), pages 289–300, 1995. [4] Yoav Benjamini and Yosef Hochberg. Multiple hypotheses testing with weights. Scandinavian Journal of Statistics, 24(3):407–418, 1997. [5] Simina M Boca and Jeffrey T Leek. A regression framework for the proportion of true null hypotheses. bioRxiv, page 035675, 2015. [6] GTEx Consortium et al. The genotype-tissue expression (gtex) pilot analysis: Multitissue gene regulation in humans. Science, 348(6235):648–660, 2015. [7] John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning and stochastic optimization. Journal of Machine Learning Research, 12(Jul):2121–2159, 2011. [8] Olive Jean Dunn. Multiple comparisons among means. Journal of the American Statistical Association, 56(293):52–64, 1961. [9] Bradley Efron. Simultaneous inference: When should hypothesis testing problems be combined? The annals of applied statistics, pages 197–223, 2008. [10] Christopher R Genovese, Kathryn Roeder, and Larry Wasserman. False discovery control with p-value weighting. Biometrika, pages 509–524, 2006. [11] Blanca E Himes, Xiaofeng Jiang, Peter Wagner, Ruoxi Hu, Qiyu Wang, Barbara Klanderman, Reid M Whitaker, Qingling Duan, Jessica Lasky-Su, Christina Nikolos, et al. Rna-seq transcriptome profiling identifies crispld2 as a glucocorticoid responsive gene that modulates cytokine function in airway smooth muscle cells. PloS one, 9(6):e99625, 2014. [12] Sture Holm. A simple sequentially rejective multiple test procedure. Scandinavian journal of statistics, pages 65–70, 1979. [13] James X Hu, Hongyu Zhao, and Harrison H Zhou. False discovery rate control with groups. Journal of the American Statistical Association, 105(491):1215–1227, 2010. [14] Nikolaos Ignatiadis and Wolfgang Huber. Covariate-powered weighted multiple testing with false discovery rate control. arXiv preprint arXiv:1701.05179, 2017. [15] Nikolaos Ignatiadis, Bernd Klaus, Judith B Zaugg, and Wolfgang Huber. Data-driven hypothesis weighting increases detection power in genome-scale multiple testing. Nature methods, 13(7):577–580, 2016. [16] Lihua Lei and William Fithian. Adapt: An interactive procedure for multiple testing with side information. arXiv preprint arXiv:1609.06035, 2016. [17] Lihua Lei and William Fithian. Power of ordered hypothesis testing. In International Conference on Machine Learning, pages 2924–2932, 2016. [18] Lihua Lei, Aaditya Ramdas, and William Fithian. Star: A general interactive framework for fdr control under structural constraints. arXiv preprint arXiv:1710.02776, 2017. [19] Ang Li and Rina Foygel Barber. Multiple testing with the structure adaptive benjamini-hochberg algorithm. arXiv preprint arXiv:1606.07926, 2016. [20] Michael I Love, Wolfgang Huber, and Simon Anders. Moderated estimation of fold change and dispersion for rna-seq data with deseq2. Genome biology, 15(12):550, 2014. [21] John D Storey, Jonathan E Taylor, and David Siegmund. Strong control, conservative point estimation and simultaneous conservative consistency of false discovery rates: a unified approach. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 66(1):187–205, 2004. 10
2017
676
7,203
A Scale Free Algorithm for Stochastic Bandits with Bounded Kurtosis Tor Lattimore∗ tor.lattimore@gmail.com Abstract Existing strategies for finite-armed stochastic bandits mostly depend on a parameter of scale that must be known in advance. Sometimes this is in the form of a bound on the payoffs, or the knowledge of a variance or subgaussian parameter. The notable exceptions are the analysis of Gaussian bandits with unknown mean and variance by Cowan et al. [2015] and of uniform distributions with unknown support [Cowan and Katehakis, 2015]. The results derived in these specialised cases are generalised here to the non-parametric setup, where the learner knows only a bound on the kurtosis of the noise, which is a scale free measure of the extremity of outliers. 1 Introduction SpaceBandits is a fictional company that specialises in optimising the power output of satellitemounted solar panels. The data science team wants to use a bandit algorithm to adjust the knobs on a legacy satellite, but they don’t remember the units of the sensors, and have limited knowledge about the noise distribution of the panel output or sensors. The SpaceBandits data science team searches the literature for an algorithm that does not depend on the scale or location of the means of the arms, and find this simple paper, in NIPS 2017. It turns out that logarithmic regret is possible for finite-armed bandits with no assumptions on the noise of the payoffs except for a known finite bound on the kurtosis, which corresponds to knowing the likelihood/magnitude of outliers [DeCarlo, 1997]. Importantly, the kurtosis is independent of the location of the mean and scale of the central tendency (the variance). This generalises the ideas of Cowan et al. [2015] beyond the Gaussian case with unknown mean and variance to the nonparametric setting. The setup is as follows. Let k ≥2 be the number of bandits (or arms). In each round 1 ≤t ≤n the player should choose an action At ∈{1, . . . , k} and subsequently receives a reward Xt ∼νAt, where ν1, . . . , νk are a set of distributions that are not known in advance. Let µi be the mean payoff of the ith arm and µ∗= maxi µi and ∆i = µ∗−µi. The regret measures the expected deficit of the player relative to the optimal choice of distribution: Rn = E " n X t=1 ∆At # . (1) The table below summarises many of the known results on the optimal achievable asymptotic regret under different assumptions on (νi)i. A reference for each of the upper bounds is given in Table 1, while the lower bounds are mostly due to Lai and Robbins [1985] and Burnetas and Katehakis [1996]. An omission from the table is when the distributions are known to lie in a single-parameter exponential family (which does not fit well with the columns). Details are by Capp´e et al. [2013]. ∗Now at DeepMind, London. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. Assumption Known Unknown limn→∞Rn/ log(n) 1 Bernoulli Lai and Robbins [1985] Supp(νi) ⊆{0, 1} µi ∈[0, 1] X i:∆i>0 1 d(µi, µ∗) 2 Bounded Honda and Takemura [2010] Supp(νi) ⊆[0, 1] distribution it’s complicated 3 Discrete Burnetas and Katehakis [1996] Supp(νi) ⊆A |A| < ∞ distribution it’s complicated 4 Semi-bounded Honda and Takemura [2015] Supp(νi) ⊆(−∞, 1] distribution it’s complicated 5 Gaussian (known var.) Katehakis and Robbins [1995] νi = N(µi, σ2 i ) µi ∈R X i:∆i>0 2σ2 i ∆i 6 Uniform Cowan and Katehakis [2015] νi = U(ai, bi) ai, bi X i:∆i>0 ∆i log  1 + 2∆i bi−ai  7 Subgaussian Bubeck and Cesa-Bianchi [2012] log Mνi(λ) ≤ λ2σ2 i 2 ∀λ distribution X i:∆i>0 2σ2 i ∆i 8 Known variance Bubeck et al. [2013] V[νi] ≤σ2 i distribution O  X i:∆i>0 σ2 i ∆i   9 Gaussian Cowan et al. [2015] νi = N(µi, σ2) µi ∈R, σ2 i > 0 X i:∆i>0 2∆i log (1 + ∆2 i /σ2 i ) d(p, q) = p log(p/q) + (1 −p) log((1 −p)/(1 −q)) and Mν(λ) = EX∼ν exp((X −µ)λ) with µ the mean of ν is the centered moment generating function. All asymptotic results are optimal except for the grey cells. Table 1: Typical distributional assumptions and asymptotic regret With the exception of rows 6 and 9 in Table 1, all entries essentially depend on some kind of scale parameter. Missing is an entry for a non-parametric assumption that is scale free. This paper fills that gap with the following assumption and regret guarantee. Assumption 1. There exists a known κ◦∈R such that for all 1 ≤i ≤k, the kurtosis of X ∼νi is at most Kurt[X] = E[(X −E[X])4]/V[X]2 ≤κ◦. Theorem 2. If Assumption 1 holds, then the algorithm described in §2 satisfies lim sup n→∞ Rn log(n) ≤C X i:∆i>0 ∆i  κ◦−1 + σ2 i ∆2 i  , where σ2 i is the variance of νi and C > 0 is a universal constant. What are the implications of this result? The first point is that the algorithm in §2 is scale and translation invariant in the sense that its behaviour does not change if the payoffs are multiplied by a positive constant or shifted. The regret also depends appropriately on the scale so that multiplying the rewards of all arms by a positive constant factor also multiplies the regret by this factor. As far as I know, this is the first scale free bandit algorithm for a non-parametric class. The assumption on the boundedness of the kurtosis is much less restrictive than assuming an exact Gaussian model (which has kurtosis 3) or uniform (kurtosis 9/5). See Table 2 for other examples. As mentioned, the kurtosis is a measure of the likelihood/existence of outliers of a distribution, and it makes intuitive sense that a bandit strategy might depend on some kind of assumption on this quantity. How else to know whether or not to cease exploring an unpromising action? The assumption can also be justified from a mathematical perspective. If the variance of an arm is not assumed known, then calculating confidence intervals requires an estimate of the variance from the data. Let X, X1, X2, . . . , Xn be a sequence of i.i.d. centered random variables with variance σ2 and 2 kurtosis κ. A reasonable estimate of σ2 is ˆσ2 = 1 n n X t=1 X2 t . (2) Clearly this estimator is unbiased and has variance V[ˆσ2] = E[X4] −E[X2]2 n = σ4 (κ −1) n . Distribution Parameters Kurtosis Gaussian µ ∈R, σ2 > 0 3 Bernoulli µ ∈[0, 1] 1−3µ(1−µ) µ(1−µ) Exponential λ > 0 9 Laplace µ ∈R, b > 0 9 Uniform a < b ∈R 9/5 Table 2: Kurtosis Therefore, if we are to expect good estimation of σ2, then the kurtosis should be finite. Note that if σ2 is estimated by (2), then the central limit theorem combined with finite kurtosis is enough for an estimation error of O(σ2((κ −1)/n)1/2) asymptotically. For bandits, however, finite-time bounds are required, which are not available using (2) without additional moment assumptions (for example, on the moment generating function). An example demonstrating the necessity of the limit in the standard central limit theorem is as follows. Suppose that X1, . . . , Xn are Bernoulli with bias p = 1/n, then for large n the distribution of the sum is closely approximated by a Poisson distribution with parameter 1, which is very different to a Gaussian. Finite kurtosis alone is enough if the classical empirical estimator is replaced by a robust estimator such as the median-of-means estimator [Alon et al., 1996] or Catoni’s estimator [Catoni, 2012]. Of course, if the kurtosis were not known, then you could try and estimate it with assumptions on the eighth moment, and so on. Is there any justification to stop here? The main reason is that this seems like a useful place to stop. Large classes of distributions have known bounds on their kurtosis (see table) and the independence of scale is a satisfying property. Contributions The main contribution is the new assumption, algorithm, and the proof of Theorem 2 (see §2). The upper bound is also complemented by an asymptotic lower bound (§3) that applies to all strategies with sub-polynomial regret and all bandit problems with bounded kurtosis. Additional notation Let Ti(t) = Pt s=1 1 {As = i} be the number of times arm i has been played after round t. For measures P, Q on the same probability space, KL(P, Q) is the relative entropy between P and Q and χ2(P, Q) is the χ2 distance. The following lemma is well known. Lemma 3. Let X1, X2 be independent random variables with Xi having variance σ2 i and kurtosis κi < ∞and skewness γi = E[(Xi −E[Xi])3/σ3 i ], then: (a) Kurt[X1 + X2] = 3 + σ4 1(κ1 −3) + σ4 2(κ2 −3) (σ2 1 + σ2 2)2 (b) γ1 ≤ √ κ1 −1 . 2 Algorithm and upper bound Like the robust upper confidence bound algorithm by Bubeck et al. [2013], the new algorithm makes use of the robust median-of-means estimator. Median-of-means estimator Let Y1, Y2, . . . , Yn be a sequence of independent and identically distributed random variables. The median-of-means estimator first partitions the data into m blocks of equal size (up to rounding errors). The empirical mean of each block is then computed and the estimate is the median of the means of each of the blocks. The number of blocks depends on the desired confidence level and should be O(log(1/δ)). The median-of-means estimator at confidence level δ ∈(0, 1) is denoted by [ MMδ((Yt)n t=1). Lemma 4 (Bubeck et al. 2013). Let Y1, Y2, . . . , Yn be a sequence of independent and identically distributed random variables with mean µ and variance σ2 < ∞. P [ MMδ ((Yt)n t=1) −µ ≥C1 s σ2 n log C2 δ ! ≤δ , 3 where C1 = √ 12 · 16 and C2 = exp(1/8) are universal constants. Upper confidence bounds The new algorithm is a generalisation of UCB, but with optimistic estimates of the mean and variance using confidence bounds about the median-of-means estimator. Let δ ∈(0, 1) and Y1, Y2, . . . , Yt be a sequence of independent and identically distributed random variables with mean µ, variance σ2 and kurtosis κ < κ◦. Furthermore, let ˜µ((Ys)t s=1, δ) = sup ( θ ∈R : θ ≤[ MMδ  (Ys)t s=1  + C1 s ˜σ2 t ((Ys)t s=1, θ, δ) t log C2 δ ) . where ˜σ2((Ys)t s=1, θ, δ) = [ MMδ (Ys −θ)2t s=1  max  0, 1 −C1 q κ◦−1 t log C2 δ  . Note that ˜µ((Ys)t s=1, δ) may be (positive) infinity if t is insufficiently large. The computation of ˜µ(·) seems non-trivial and is discussed in the summary at the end of the paper where a roughly equivalent and efficiently computable alternative is given. The following two lemmas show that ˜µ is indeed optimistic with high probability, and also that it concentrates with reasonable speed around the true mean. Lemma 5. P ˜µ((Ys)t s=1, δ) ≤µ  ≤2δ . Proof. By Lemma 4 and the fact that V[(Ys −µ)2] = σ4(κ −1) ≤σ4(κ◦−1) it holds with probability at least 1 −δ that ˜σ2((Ys)t s=1, µ, δ) ≥σ2. Another application of Lemma 4 along with a union bound ensures that with probability at least 1 −2δ, [ MMδ((Ys)t s=1) ≤C1 s σ2 t log C2 δ  ≤C1 s ˜σ2 t ((Ys)t s=1, µ, δ) t log C2 δ  . Therefore with probability at least 1 −2δ the true mean µ is in the set of which ˜µ is the supremum and in this case ˜µ((Ys)t s=1, δ) ≥µ as required. Lemma 6. Let δt be monotone decreasing and ˜µt = ˜µ((Ys)t s=1, δt). Then there exists a universal constant C3 > 0 such that for any ε > 0, n X t=1 P (˜µt ≥µ + ε) ≤C3 max  κ◦−1, σ2 ε2  log C2 δn  + 2 n X t=1 δt . Proof. First, by Lemma 4 n X t=1 P [ MMδt  (Ys)t s=1  −µ ≥C1 s σ2 t log C2 δt ! ≤ n X t=1 δt . (3) Similarly, n X t=1 P [ MMδt (Ys −µ)2t s=1  −σ2 ≥C1σ2 s κ◦−1 t log C2 δ ! ≤ n X t=1 δt . (4) Suppose that t is a round where all of the following hold: (a) [ MMδt  (Ys)t s=1  −µ < C1 s σ2 t log C2 δt  . (b) [ MMδt (Ys −µ)2t s=1  −σ2 < C1σ2 s κ◦−1 t log C2 δt  . (c) t ≥16C2 1(κ◦−1) log C2 δt  . 4 Abbreviating ˜σ2 t = ˜σ2((Ys)t s=1, ˜µt, δt) and ˆµt = [ MMδt  (Ys)t s=1  , ˜σ2 t = [ MMδt (Ys −˜µs)2t s=1  1 −C1 r κ◦−1 t log  C2 δt  ≤2[ MMδt (Ys −˜µt)2t s=1  ≤4[ MMδt (Ys −µ)2t s=1  + 4(˜µt −µ)2 ≤4[ MMδt (Ys −µ)2t s=1  + 8(˜µt −ˆµt)2 + 8(ˆµt −µ)2 < 4σ2 + 4C1σ2 s κ◦−1 t log C2 δt  + 8C2 1(σ2 + ˜σ2 t )(κ◦−1) t log C2 δt  ≤11 2 σ2 + ˜σ2 t 2 , where the first inequality follows from (c), the second since (x −y)2 ≤2x2 + 2y2 and the fact that [ MMδ((aYs + b)t s=1) = a[ MMδ((Ys)t s=1) + b . The third inequality again uses (x −y)2 ≤2x2 + 2y2, while the last uses the definition of ˜µt and (a,b). Therefore ˜σ2 t ≤11σ2, which means that if (a,b,c) and additionally (d) t ≥19C2 1σ2 ε2 log  1 δn  . Then |˜µt −µ| ≤|˜µt −ˆµt| + |ˆµt −µ| < C1 s ˜σ2 t t log C2 δn  + C1 s σ2 t log C2 δn  ≤C1 s 11σ2 t log C2 δn  + C1 s σ2 t log C2 δn  ≤ε . Combining this with (3) and (4) and choosing C3 = 19C2 1 completes the result. Algorithm and Proof of Theorem 2 Let δt = 1/(t2 log(1+t)) and ˜µi(t) = ˜µ((Xs)s∈[t],As=i, δt). In each round the algorithm chooses At = arg maxi∈[k] ˜µi(t −1), where ties are broken arbitrarily. Proof of Theorem 2. Assume without loss of generality that µ1 = µ∗. Then suboptimal arm i is only played in round t if either ˜µ1(t −1) ≤µ1 or ˜µi(t −1) ≥µ1. Therefore E[Ti(n)] ≤ n X t=1 P (˜µ1(t −1) ≤µ1) + n X t=1 P (˜µi(t −1) ≥µ1 and At = i) (5) The two sums are bounded using Lemmas 5 and 6 respectively: n X t=1 P (˜µ1(t −1) ≤µ1) ≤ n X t=1 t X u=1 P (˜µ1(t −1) ≤µ1 and T1(t −1) = u) ≤2 n X t=1 t X u=1 δt = 2 n X t=1 tδt = o(log(n)) . (By Lem. 5) n X t=1 P (˜µi(t −1) ≥µ1 and At = i) ≤ n X t=1 P (˜µi(t −1) −µi ≥∆i) ≤C3 max  κ◦−1, σ2 i ∆2 i  log C2 δn  + 2 n X t=1 δt = o(log(n)) . (By Lem. 6) And the result follows by substituting the above bounds into Eq. (5) and then into the regret decomposition Rn = Pk i=1 ∆iE[Ti(n)]. 5 3 Lower bound Let Hκ◦= {ν : ν has kurtosis less than κ◦} be the class of all distributions with kurtosis bounded by κ◦. Following the nomenclature of Lai and Robbins [1985], a bandit strategy is called consistent over H if Rn = o(np) for all p ∈(0, 1) and bandits (νi)i with νi ∈Hκ◦for all i. The next theorem shows that the upper bound derived in the previous section is nearly tight up to constant factors. Let H be a family of distributions and let (νi)i be a bandit with νi ∈H for all i. Burnetas and Katehakis [1996] showed that for any consistent strategy, for all i ∈[k] : lim inf n→∞ E[Ti(n)] log(n) ≥ inf  KL(νi, ν′ i) : ν′ i ∈H and EX∼ν′ i[X] > µ∗ −1 . (6) In parameterised families of distributions, the optimisation problem can often be evaluated analytically (eg., Bernoulli, Gaussian with known variance, Gaussian with unknown variance, Exponential). For non-parametric families the calculation is much more challenging. The following theorem takes the first steps towards understanding this problem for the class of distributions Hκ◦ for κ◦≥7/2. Theorem 7. Let κ◦≥7/2 and ∆> 0 and ν ∈Hκ◦with mean µ, variance σ2 > 0 and kurtosis κ. Then for appropriately chosen universal constant C, C′ > 0, inf {KL(ν, ν′) : ν′ ∈Hκ and EX∼ν′[X] > µ + ∆} ≤7 5 min  1 κ◦ , ∆ σ  . If additionally it holds that κ + C′∆κ1/2(κ + 1) ≤κ◦, then inf {KL(ν, ν′) : ν′ ∈Hκ and EX∼ν′[X] > µ + ∆} ≤C ∆2 σ2 Therefore provided that ν ∈Hκ◦is not too close to the boundary of Hκ◦in the sense that its kurtosis is not too close to κ◦, then the lower bound derived from Theorem 7 and Eq. (6) matches the upper bound up to constant factors. This condition is probably necessary because distributions like the Bernoulli with kurtosis close to κ◦have barely any wiggle room to increase the mean without also increasing the kurtosis. Proof of Theorem 7. Let ∆ε = ∆+ ε for small ε > 0. Assume without loss of generality that ν is centered and has variance σ2 = 1, which can always be achieved by shifting and scaling (neither effects the kurtosis or the relative entropy). The first part of the claim is established by considering the perturbed distribution obtained by adding a Bernoulli ‘outlier’. Let X be a random variable sampled from ν and B be a Bernoulli with parameter p = min {∆ε, 1/κ◦}. Let Z = X + Y where Y = ∆εB/p. Then E[Z] = ∆ε > ∆and Kurt[Z] = 3 + κ −3 + V[Y ]2(Kurt[Y ] −3) (1 + V[Y ])2 = 3 + κ −3 +  (1−p)∆2 ε p 2 1−6p(1−p) p(1−p)  1 + (1−p)∆2ε p 2 ≤3 + κ◦−3 +  (1−p)∆2 ε p 2 1−6p(1−p) p(1−p)  1 + (1−p)∆2ε p 2 ≤κ◦, where the first inequality used Lemma 3 and the final inequality follows from simple case-based analysis, calculus and the assumption that κ◦≥7/2 (see Lemma 9 in the appendix). Let ν′ = L(Y ) be the law of Y . Then KL(ν, ν′) = Z R log dν dν′ dν ≤ Z R log 1 1 −pdν = log 1 1 −p ≤ p 1 −p ≤7 5 min  ∆ε, 1 κ◦  . Taking the limit as ε tends to 0 completes the proof of the first part of the theorem. Moving onto the second claim and using C for a universal positive constant that changes from equation to equation. Let a > 0 be a constant to be chosen later and A = {x : |x| ≤√aκ} and ¯A = R −A. Define 6 alternative measure ν′(E) = R E(1 + g)dν where g(x) = (α + βx)1 {x ∈A} for some constants α and β chosen so that Z R g(x)dν(x) = α Z A dν(x) + β Z A xdν(x) = 0 . Z R g(x)xdν(x) = α Z A xdν(x) + β Z A x2dν(x) = ∆ε . Solving for α and β shows that β = ∆ε R A x2dν(x) −( R A xdν(x)) 2 ν(A) and α = − ∆ε R A xdν(x) ν(A) R A x2dν(x) − R A xdν(x) 2 . This implies that R R dν′(x) = 1 and R R xdν′(x) = ∆ε > ∆. It remains to show that ν′ is a probability measure with kurtosis bounded by κ◦. That ν′ is a probability measure will follow from the positivity of 1 −g(·). The first step is to control each of the terms appearing in the definitions of α and β. By Cauchy-Schwarz and Chebyshev’s inequalities, ν( ¯A) = ν(x2 ≥aκ) ≤1/(κa2) and Z A x2dν(x) = 1 − Z ¯ A x2dν(x) ≥1 − q κν( ¯A) ≥1 −1 a . Similarly, since ν is centered, Z A xdν(x) = Z ¯ A xdν(x) ≤ q σ2ν( ¯A) ≤ 1 a√κ . Therefore by choosing a = 2 and using the fact that the kurtosis is always larger than 1, |α| = ∆ε R A xdν(x) ν(A) R A x2dν(x) − R A xdν(x) 2 ≤ ∆ε/√κ a 1 − 1 κa2  1 −1 a  − 1 a2κ  ≤4∆ε √κ |β| = ∆ε R A x2dν(x) −( R A xdν(x)) 2 ν(A) ≤ ∆ε 1 −1 a − 1 κa2(1− 1 a2κ) ≤6∆ε . Now g(x) is a linear function supported on compact set A, so max x∈R |g(x)| = max  |g(√aκ)|, |g(−√aκ)| ≤|α| + √aκ|β| ≤4∆ε √κ + 6∆ε √ 2κ ≤1 2 , where the last inequality follows by assuming that ∆ε ≤√κ/(4(2 + 3 √ 2κ)) = O(κ−1/2), which is reasonable without loss of generality, since if ∆ε is larger than this quantity, then we would prefer the bound that depends on κ◦derived in the first part of the proof. The relative entropy between ν and ν′ is bounded by KL(ν, ν′) ≤χ2(ν, ν′) = Z R  dν(x) dν′(x) −1 2 dν′(x) = Z A g(x)2 1 + g(x)dν(x) ≤2 Z A g(x)2dν(x) ≤4 Z A α2dν(x) + 4 Z A β2x2dν(x) ≤4α2 + 4β2 ≤4 · 16∆2 ε κ + 4 · 36∆2 ε ≤C∆2 ε . In order to bound the kurtosis we need to evaluate the moments: Z R x2dν′ = Z R x2dν + Z A g(x)x2dν = 1 + α Z A x2dν(x) + β Z A x3dν(x) ≤1 + C∆ε √κ . Z R x2dν′ = Z R x2dν + Z A g(x)x2dν ≥1 −C∆ε √κ . Z R x4dν′ = Z R x4dν + Z A g(x)x4dν = κ + α Z A x4dν(x) + β Z A x5dν(x) ≤κ 1 + C∆ε √κ  . Z R x3dν′(x) ≤ sZ R x2dν′(x) Z R x4dν′(x) ≤ √ Cκ . 7 Therefore if κ′ is the kurtosis of ν′, then κ′ = R R(x −∆ε)4dν′(x) R R x2dν′(x) −∆2ε 2 = R R x4dν′(x) −3∆4 ε + 6∆2 ε R R x2dν′(x) −4∆ε R R x3dν′(x) 1 −∆2ε + α R A x2dν(x) + β R A x3dν(x) 2 Therefore κ′ = R R x4dν′(x) −3∆4 ε + 6∆2 ε R R x2dν′(x) −4∆ε R R x3dν′(x) R R x2dν′(x) −∆2ε 2 ≤κ 1 + C∆εκ1/2 + 6∆2 ε(1 + C∆εκ1/2) + C∆εκ1/2 1 −C∆εκ1/2 −∆2ε 2 ≤κ + C∆εκ1/2(κ + 1) 1 −C∆εκ1/2 ≤κ + C∆εκ1/2(κ + 1) . Therefore κ′ ≤κ◦provided ∆ε is sufficiently small, which after taking the limit as ε →0 completes the proof. 4 Summary The assumption of finite kurtosis generalises the parametric Gaussian assumption to a comparable non-parametric setup with a similar basic structure. Of course there are several open questions. Optimal constants The leading constants in the main results (Theorem 2 and Theorem 7) are certainly quite loose. Deriving the optimal form of the regret is an interesting challenge, with both lower and upper bounds appearing quite non-trivial. It may be necessary to resort to an implicit analysis showing that (6) is (or is not) achievable when H is the class of distributions with kurtosis bounded by some κ◦. Even then, constructing an efficient algorithm would remain a challenge. Certainly what has been presented here is quite far from optimal. At the very least the median-ofmeans estimator needs to be replaced, or the analysis improved. An excellent candidate is Catoni’s estimator [Catoni, 2012], which is slightly more complicated than the median-of-means, but also comes with smaller constants and could be plugged into the algorithm with very little effort. An alternative approach is to use the theory of self-normalised processes [Pe˜na et al., 2008], but even this seems to lead to suboptimal constants. For the lower bound, there appears to be almost no work on the explicit form of the lower bounds presented by Burnetas and Katehakis [1996] in interesting nonparametric classes beyond rewards with bounded or semi-bounded support [Honda and Takemura, 2010, 2015]. Absorbing other improvements There has recently been a range of improvements to the confidence level for the classical upper confidence bound algorithms that shave logarithmic terms from the worst-case regret or improve the lower-order terms in the finite-time bounds [Audibert and Bubeck, 2009, Lattimore, 2015]. Many of these enhancements can be incorporated into the algorithm presented here, which may lead to practical and theoretical improvements. Computation complexity The main challenge is the computation of the index, which as written seems challenging. The easiest solution is to change the algorithm slightly by estimating ˆµi(t) = [ MMδt((Xs)s∈[t],As=i) ˆσ2 i (t) = [ MMδt((X2 s)s∈[t],As=i) −ˆµi(t)2 . Then an upper confidence bound on ˆµi(t) is easily derived from Lemma 4 and the rest of the analysis goes through in about the same way. Naively the computational complexity of the above is Ω(t) in round t, which would lead to a running time over n rounds of Ω(n2). Provided the number of buckets used between rounds t and t + 1 is the same, then the median-of-means estimator can be updated incrementally in O(Bt) time, where Bt is the number of buckets. Now Bt = O(log(1/δt)) = O(log(t)) so there are at most O(log(n)) changes over n rounds. Therefore the total computation is O(nk + n log(n)). 8 Comparison to Bernoulli Table 2 shows that the kurtosis for a Bernoulli random variable with mean µ is κ = O(1/(µ(1 −µ))), which is obviously not bounded as µ tends towards the boundaries. The optimal asymptotic regret for the Bernoulli case is limn→∞Rn/ log(n) = P i:∆i>0 ∆i/d(µi, µ∗). The interesting differences occur near the boundary of the parameter space. Suppose that µi ≈0 for some arm i and µ∗> 0 is close to zero. An easy calculation shows that d(µi, µ∗) ≈log(1/(1 −∆i)) ≈∆i. Therefore lim inf n→∞ E[Ti(n)] log(n) ≈ 1 log(1/(1 −∆i)) ≈1 ∆i . Here we see an algorithm is enjoying logarithmic regret on a class with infinite kurtosis! But this is a special case and is not possible in general. The reason is that the structure of the hypothesis class allows strategies to (essentially) estimate the kurtosis with reasonable accuracy and anticipate outliers more/less depending on the data observed so far. Another way of saying it is that when the kurtosis is actually small, the algorithms can learn this fact by examining the empirical mean. A Technical calculations This section completes some of the calculations required in the proof of Theorem 7. Lemma 8. Let κ◦≥7/2 and f(x) = 3 + (κ◦−3 + x)/(1 + x)2. Then f(x) ≤κ◦for all x ≥0. Proof. Clearly f(0) = κ◦and for κ◦≥7/2 and x ≥0, f ′(x) = 1 (1 + x)2  1 −2(κ◦−3 + x) 1 + x  ≤0 . Therefore f(x) = κ◦+ R x 0 f ′(y)dy ≤κ◦. Lemma 9. If κ◦≥7/2 and p = min {∆, 1/κ◦}, then 3 + κ◦−3 +  (1−p)∆2 p 2 1−6p(1−p) p(1−p)  1 + (1−p)∆2 p 2 ≤κ◦. Proof. Suppose that p = ∆. Then since κ◦≥7/2 ≥1, p ≤1. Therefore 3 + κ◦−3 +  (1−p)∆2 p 2 1−6p(1−p) p(1−p)  1 + (1−p)∆2 p 2 = 3 + κ◦−3 + ∆(1 −∆)(1 −6∆(1 −∆)) (1 + ∆(1 −∆))2 ≤3 + κ◦−3 + ∆(1 −∆) (1 + ∆(1 −∆))2 ≤κ◦, where the last inequality follows from Lemma 8. Now suppose that p = 1/κ◦. Then 3 + κ◦−3 +  (1−p)∆2 p 2 1−6p(1−p) p(1−p)  1 + (1−p)∆2 p 2 ≤3 + κ◦−3 +  (1−p)∆2 p 2 1−6p(1−p) p(1−p) 1 +  (1−p)∆2 p 2 ≤max ( κ◦, κ◦ 1 − 1 κ◦ −3 ) ≤κ◦, where the first inequality follows since (a+b)2 ≥a2+b2 for a, b ≥0. The second since the average is less than the maximum. The third since κ◦≥7/2 > 4/3. 9 References Noga Alon, Yossi Matias, and Mario Szegedy. The space complexity of approximating the frequency moments. In Proceedings of the twenty-eighth annual ACM symposium on Theory of computing, pages 20–29. ACM, 1996. Jean-Yves Audibert and S´ebastien Bubeck. Minimax policies for adversarial and stochastic bandits. In Proceedings of Conference on Learning Theory (COLT), pages 217–226, 2009. Sebastian Bubeck, Nicolo Cesa-Bianchi, and G´abor Lugosi. Bandits with heavy tail. Information Theory, IEEE Transactions on, 59(11):7711–7717, 2013. S´ebastien Bubeck and Nicol`o Cesa-Bianchi. Regret Analysis of Stochastic and Nonstochastic Multiarmed Bandit Problems. Foundations and Trends in Machine Learning. Now Publishers Incorporated, 2012. ISBN 9781601986269. Apostolos N Burnetas and Michael N Katehakis. Optimal adaptive policies for sequential allocation problems. Advances in Applied Mathematics, 17(2):122–142, 1996. Olivier Capp´e, Aur´elien Garivier, Odalric-Ambrym Maillard, R´emi Munos, and Gilles Stoltz. Kullback–Leibler upper confidence bounds for optimal sequential allocation. The Annals of Statistics, 41(3):1516–1541, 2013. Olivier Catoni. Challenging the empirical mean and empirical variance: a deviation study. In Annales de l’Institut Henri Poincar´e, Probabilit´es et Statistiques, volume 48, pages 1148–1185. Institut Henri Poincar´e, 2012. Wesley Cowan and Michael N Katehakis. An asymptotically optimal policy for uniform bandits of unknown support. arXiv preprint arXiv:1505.01918, 2015. Wesley Cowan, Junya Honda, and Michael N Katehakis. Normal bandits of unknown means and variances: Asymptotic optimality, finite horizon regret bounds, and a solution to an open problem. arXiv preprint arXiv:1504.05823v2, 2015. Lawrence T DeCarlo. On the meaning and use of kurtosis. Psychological methods, 2(3):292, 1997. Junya Honda and Akimichi Takemura. An asymptotically optimal bandit algorithm for bounded support models. In Proceedings of Conference on Learning Theory (COLT), pages 67–79, 2010. Junya Honda and Akimichi Takemura. Non-asymptotic analysis of a new bandit algorithm for semibounded rewards. Journal of Machine Learning Research, 16:3721–3756, 2015. Michael N Katehakis and Herbert Robbins. Sequential choice from several populations. Proceedings of the National Academy of Sciences of the United States of America, 92(19):8584, 1995. Tze Leung Lai and Herbert Robbins. Asymptotically efficient adaptive allocation rules. Advances in applied mathematics, 6(1):4–22, 1985. Tor Lattimore. Optimally confident UCB: Improved regret for finite-armed bandits. arXiv preprint arXiv:1507.07880, 2015. Victor H Pe˜na, Tze Leung Lai, and Qi-Man Shao. Self-normalized processes: Limit theory and Statistical Applications. Springer Science & Business Media, 2008. 10
2017
677
7,204
Value Prediction Network Junhyuk Oh† Satinder Singh† Honglak Lee∗,† †University of Michigan ∗Google Brain {junhyuk,baveja,honglak}@umich.edu, honglak@google.com Abstract This paper proposes a novel deep reinforcement learning (RL) architecture, called Value Prediction Network (VPN), which integrates model-free and model-based RL methods into a single neural network. In contrast to typical model-based RL methods, VPN learns a dynamics model whose abstract states are trained to make option-conditional predictions of future values (discounted sum of rewards) rather than of future observations. Our experimental results show that VPN has several advantages over both model-free and model-based baselines in a stochastic environment where careful planning is required but building an accurate observation-prediction model is difficult. Furthermore, VPN outperforms Deep Q-Network (DQN) on several Atari games even with short-lookahead planning, demonstrating its potential as a new way of learning a good state representation. 1 Introduction Model-based reinforcement learning (RL) approaches attempt to learn a model that predicts future observations conditioned on actions and can thus be used to simulate the real environment and do multi-step lookaheads for planning. We will call such models an observation-prediction model to distinguish it from another form of model introduced in this paper. Building an accurate observationprediction model is often very challenging when the observation space is large [23, 5, 13, 4] (e.g., highdimensional pixel-level image frames), and even more difficult when the environment is stochastic. Therefore, a natural question is whether it is possible to plan without predicting future observations. In fact, raw observations may contain information unnecessary for planning, such as dynamically changing backgrounds in visual observations that are irrelevant to their value/utility. The starting point of this work is the premise that what planning truly requires is the ability to predict the rewards and values of future states. An observation-prediction model relies on its predictions of observations to predict future rewards and values. What if we could predict future rewards and values directly without predicting future observations? Such a model could be more easily learnable for complex domains or more flexible for dealing with stochasticity. In this paper, we address the problem of learning and planning from a value-prediction model that can directly generate/predict the value/reward of future states without generating future observations. Our main contribution is a novel neural network architecture we call the Value Prediction Network (VPN). The VPN combines model-based RL (i.e., learning the dynamics of an abstract state space sufficient for computing future rewards and values) and model-free RL (i.e., mapping the learned abstract states to rewards and values) in a unified framework. In order to train a VPN, we propose a combination of temporal-difference search [28] (TD search) and n-step Q-learning [20]. In brief, VPNs learn to predict values via Q-learning and rewards via supervised learning. At the same time, VPNs perform lookahead planning to choose actions and compute bootstrapped target Q-values. Our empirical results on a 2D navigation task demonstrate the advantage of VPN over model-free baselines (e.g., Deep Q-Network [21]). We also show that VPN is more robust to stochasticity in the environment than an observation-prediction model approach. Furthermore, we show that our VPN outperforms DQN on several Atari games [2] even with short-lookahead planning, which suggests 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. that our approach can be potentially useful for learning better abstract-state representations and reducing sample-complexity. 2 Related Work Model-based Reinforcement Learning. Dyna-Q [32, 34, 39] integrates model-free and modelbased RL by learning an observation-prediction model and using it to generate samples for Q-learning in addition to the model-free samples obtained by acting in the real environment. Gu et al. [7] extended these ideas to continuous control problems. Our work is similar to Dyna-Q in the sense that planning and learning are integrated into one architecture. However, VPNs perform a lookahead tree search to choose actions and compute bootstrapped targets, whereas Dyna-Q uses a learned model to generate imaginary samples. In addition, Dyna-Q learns a model of the environment separately from a value function approximator. In contrast, the dynamics model in VPN is combined with the value function approximator in a single neural network and indirectly learned from reward and value predictions through backpropagation. Another line of work [23, 4, 8, 30] uses observation-prediction models not for planning, but for improving exploration. A key distinction from these prior works is that our method learns abstract-state dynamics not to predict future observations, but instead to predict future rewards/values. For continuous control problems, deep learning has been combined with model predictive control (MPC) [6, 18, 26], a specific way of using an observation-prediction model. In cases where the observation-prediction model is differentiable with respect to continuous actions, backpropagation can be used to find the optimal action [19] or to compute value gradients [11]. In contrast, our work focuses on learning and planning using lookahead for discrete control problems. Our VPNs are related to Value Iteration Networks [35] (VINs) which perform value iteration (VI) by approximating the Bellman-update through a convolutional neural network (CNN). However, VINs perform VI over the entire state space, which in practice requires that 1) the state space is small and representable as a vector with each dimension corresponding to a separate state and 2) the states have a topology with local transition dynamics (e.g., 2D grid). VPNs do not have these limitations and are thus more generally applicable, as we will show empirically in this paper. VPN is close to and in-part inspired by Predictron [29] in that a recurrent neural network (RNN) acts as a transition function over abstract states. VPN can be viewed as a grounded Predictron in that each rollout corresponds to the transition in the environment, whereas each rollout in Predictron is purely abstract. In addition, Predictrons are limited to uncontrolled settings and thus policy evaluation, whereas our VPNs can learn an optimal policy in controlled settings. Model-free Deep Reinforcement Learning. Mnih et al. [21] proposed the Deep Q-Network (DQN) architecture which learns to estimate Q-values using deep neural networks. A lot of variations of DQN have been proposed for learning better state representation [37, 16, 9, 22, 36, 24], including the use of memory-based networks for handling partial observability [9, 22, 24], estimating both state-values and advantage-values as a decomposition of Q-values [37], learning successor state representations [16], and learning several auxiliary predictions in addition to the main RL values [12]. Our VPN can be viewed as a model-free architecture which 1) decomposes Q-value into reward, discount, and the value of the next state and 2) uses multi-step reward/value predictions as auxiliary tasks to learn a good representation. A key difference from the prior work listed above is that our VPN learns to simulate the future rewards/values which enables planning. Although STRAW [36] can maintain a sequence of future actions using an external memory, it cannot explicitly perform planning by simulating future rewards/values. Monte-Carlo Planning. Monte-Carlo Tree Search (MCTS) methods [15, 3] have been used for complex search problems, such as the game of Go, where a simulator of the environment is already available and thus does not have to be learned. Most recently, AlphaGo [27] introduced a value network that directly estimates the value of state in Go in order to better approximate the value of leaf-node states during tree search. Our VPN takes a similar approach by predicting the value of abstract future states during tree search using a value function approximator. Temporal-difference search [28] (TD search) combined TD-learning with MCTS by computing target values for a value function approximator through MCTS. Our algorithm for training VPN can be viewed as an instance of TD search, but it learns the dynamics of future rewards/values instead of being given a simulator. 2 (a) One-step rollout (b) Multi-step rollout Figure 1: Value prediction network. (a) VPN learns to predict immediate reward, discount, and the value of the next abstract-state. (b) VPN unrolls the core module in the abstract-state space to compute multi-step rollouts. 3 Value Prediction Network The value prediction network is developed for semi-Markov decision processes (SMDPs). Let xt be the observation or a history of observations for partially observable MDPs (henceforth referred to as just observation) and let ot be the option [33, 31, 25] at time t. Each option maps observations to primitive actions, and the following Bellman equation holds for all policies π: Qπ(xt, ot) = E[Pk−1 i=0 γirt+i + γkV π(xt+k)], where γ is a discount factor, rt is the immediate reward at time t, and k is the number of time steps taken by the option ot before terminating in observation xt+k. A VPN not only learns an option-value function Qθ (xt, ot) through a neural network parameterized by θ like model-free RL, but also learns the dynamics of the rewards/values to perform planning. We describe the architecture of VPN in Section 3.1. In Section 3.2, we describe how to perform planning using VPN. Section 3.3 describes how to train VPN in a Q-Learning-like framework [38]. 3.1 Architecture The VPN consists of the following modules parameterized by θ = {θenc, θvalue, θout, θtrans}: Encoding f enc θ : x 7→s Value f value θ : s 7→Vθ(s) Outcome f out θ : s, o 7→r, γ Transition f trans θ : s, o 7→s′ • Encoding module maps the observation (x) to the abstract state (s ∈Rm) using neural networks (e.g., CNN for visual observations). Thus, s is an abstract-state representation which will be learned by the network (and not an environment state or even an approximation to one). • Value module estimates the value of the abstract-state (Vθ(s)). Note that the value module is not a function of the observation, but a function of the abstract-state. • Outcome module predicts the option-reward (r ∈R) for executing the option o at abstract-state s. If the option takes k primitive actions before termination, the outcome module should predict the discounted sum of the k immediate rewards as a scalar. The outcome module also predicts the option-discount (γ ∈R) induced by the number of steps taken by the option. • Transition module transforms the abstract-state to the next abstract-state (s′ ∈Rm) in an optionconditional manner. Figure 1a illustrates the core module which performs 1-step rollout by composing the above modules: f core θ : s, o 7→r, γ, Vθ(s′), s′. The core module takes an abstract-state and option as input and makes separate option-conditional predictions of the option-reward (henceforth, reward), the option-discount (henceforth, discount), and the value of the abstract-state at option-termination. By combining the predictions, we can estimate the Q-value as follows: Qθ(s, o) = r + γVθ(s′). In addition, the VPN recursively applies the core module to predict the sequence of future abstract-states as well as rewards and discounts given an initial abstract-state and a sequence of options as illustrated in Figure 1b. 3.2 Planning VPN has the ability to simulate the future and plan based on the simulated future abstract-states. Although many existing planning methods (e.g., MCTS) can be applied to the VPN, we implement a simple planning method which performs rollouts using the VPN up to a certain depth (say d), henceforth denoted as planning depth, and aggregates all intermediate value estimates as described in Algorithm 1 and Figure 2. More formally, given an abstract-state s = f enc θ (x) and an option o, the 3 (a) Expansion (b) Backup Figure 2: Planning with VPN. (a) Simulate b-best options up to a certain depth (b = 2 in this example). (b) Aggregate all possible returns along the best sequence of future options. Algorithm 1 Q-value from d-step planning function Q-PLAN(s, o, d) r, γ, V (s′), s′ ←f core θ (s, o) if d = 1 then return r + γV (s′) end if A ←b-best options based on Q1(s′, o′) for o′ ∈A do qo′ ←Q-PLAN(s′, o′, d −1) end for return r+γ  1 dV (s′) + d−1 d maxo′∈A qo′ end function Q-value calculated from d-step planning is defined as: Qd θ(s, o) = r + γV d θ (s′) V d θ (s) = Vθ(s) if d = 1 1 dVθ(s) + d−1 d maxo Qd−1 θ (s, o) if d > 1, (1) where s′ = f trans θ (s, o), Vθ(s) = f value θ (s), and r, γ = f out θ (s, o). Our planning algorithm is divided into two steps: expansion and backup. At the expansion step (see Figure 2a), we recursively simulate options up to a depth of d by unrolling the core module. At the backup step, we compute the weighted average of the direct value estimate Vθ(s) and maxo Qd−1 θ (s, o) to compute V d θ (s) (i.e., value from d-step planning) in Equation 1. Note that maxo Qd−1 θ (s, o) is the average over d −1 possible value estimates. We propose to compute the uniform average over all possible returns by using weights proportional to 1 and d −1 for Vθ(s) and maxo Qd−1 θ (s, o) respectively. Thus, V d θ (s) is the uniform average of d expected returns along the path of the best sequence of options as illustrated in Figure 2b. To reduce the computational cost, we simulate only b-best options at each expansion step based on Q1(s, o). We also find that choosing only the best option after a certain depth does not compromise the performance much, which is analogous to using a default policy in MCTS beyond a certain depth. This heuristic visits reasonably good abstract states during planning, though a more principled way such as UCT [15] can also be used to balance exploration and exploitation. This planning method is used for choosing options and computing target Q-values during training, as described in the following section. 3.3 Learning Figure 3: Illustration of learning process. VPN can be trained through any existing valuebased RL algorithm for the value predictions combined with supervised learning for reward and discount predictions. In this paper, we present a modification of n-step Q-learning [20] and TD search [28]. The main idea is to generate trajectories by following ϵ-greedy policy based on the planning method described in Section 3.2. Given an n-step trajectory x1, o1, r1, γ1, x2, o2, r2, γ2, ..., xn+1 generated by the ϵ-greedy policy, k-step predictions are defined as follows: sk t = f enc θ (xt) if k = 0 f trans θ (sk−1 t−1 , ot−1) if k > 0 vk t = f value θ (sk t ) rk t , γk t = f out θ (sk−1 t , ot). Intuitively, sk t is the VPN’s k-step prediction of the abstract-state at time t predicted from xt−k following options ot−k, ..., ot−1 in the trajectory as illustrated in Figure 3. By applying the value and the outcome module, VPN can compute the k-step prediction of the value, the reward, and the discount. The k-step prediction loss at step t is defined as: Lt = k X l=1 Rt −vl t 2 + rt −rl t 2 + logγ γt −logγ γl t 2 4 where Rt = rt + γtRt+1 if t ≤n maxo Qd θ−(sn+1, o) if t = n + 1 is the target value, and Qd θ−(sn+1, o) is the Qvalue computed by the d-step planning method described in 3.2. Intuitively, Lt accumulates losses over 1-step to k-step predictions of values, rewards, and discounts. We find that applying logγ for the discount prediction loss helps optimization, which amounts to computing the squared loss with respect to the number of steps. Our learning algorithm introduces two hyperparameters: the number of prediction steps (k) and planning depth (dtrain) used for choosing options and computing bootstrapped targets. We also make use of a target network parameterized by θ−which is synchronized with θ after a certain number of steps to stabilize training as suggested by [20]. The loss is accumulated over n-steps and the parameter is updated by computing its gradient as follows: ∇θL = Pn t=1 ∇θLt. The full algorithm is described in the supplementary material. 3.4 Relationship to Existing Approaches VPN is model-based in the sense that it learns an abstract-state transition function sufficient to predict rewards/discount/values. Meanwhile, VPN can also be viewed as model-free in the sense that it learns to directly estimate the value of the abstract-state. From this perspective, VPN exploits several auxiliary prediction tasks, such as reward and discount predictions to learn a good abstract-state representation. An interesting property of VPN is that its planning ability is used to compute the bootstrapped target as well as choose options during Q-learning. Therefore, as VPN improves the quality of its future predictions, it can not only perform better during evaluation through its improved planning ability, but also generate more accurate target Q-values during training, which encourages faster convergence compared to conventional Q-learning. 4 Experiments Our experiments investigated the following questions: 1) Does VPN outperform model-free baselines (e.g., DQN)? 2) What is the advantage of planning with a VPN over observation-based planning? 3) Is VPN useful for complex domains with high-dimensional sensory inputs, such as Atari games? 4.1 Experimental Setting Network Architecture. A CNN was used as the encoding module of VPN, and the transition module consists of one option-conditional convolution layer which uses different weights depending on the option followed by a few more convolution layers. We used a residual connection [10] from the previous abstract-state to the next abstract-state so that the transition module learns the change of the abstract-state. The outcome module is similar to the transition module except that it does not have a residual connection and two fully-connected layers are used to produce reward and discount. The value module consists of two fully-connected layers. The number of layers and hidden units vary depending on the domain. These details are described in the supplementary material. Implementation Details. Our algorithm is based on asynchronous n-step Q-learning [20] where n is 10 and 16 threads are used. The target network is synchronized after every 10K steps. We used the Adam optimizer [14], and the best learning rate and its decay were chosen from {0.0001, 0.0002, 0.0005, 0.001} and {0.98, 0.95, 0.9, 0.8} respectively. The learning rate is multiplied by the decay every 1M steps. Our implementation is based on TensorFlow [1].1 VPN has four more hyperparameters: 1) the number of predictions steps (k) during training, 2) the plan depth (dtrain) during training, 3) the plan depth (dtest) during evaluation, and 4) the branching factor (b) which indicates the number of options to be simulated for each expansion step during planning. We used k = dtrain = dtest throughout the experiment unless otherwise stated. VPN(d) represents our model which learns to predict and simulate up to d-step futures during training and evaluation. The branching factor (b) was set to 4 until depth of 3 and set to 1 after depth of 3, which means that VPN simulates 4-best options up to depth of 3 and only the best option after that. Baselines. We compared our approach to the following baselines. 1The code is available on https://github.com/junhyukoh/value-prediction-network. 5 (a) Observation (b) DQN’s trajectory (c) VPN’s trajectory Figure 4: Collect domain. (a) The agent should collect as many goals as possible within a time limit which is given as additional input. (b-c) DQN collects 5 goals given 20 steps, while VPN(5) found the optimal trajectory via planning which collects 6 goals. (a) Plan with 20 steps (b) Plan with 12 steps Figure 5: Example of VPN’s plan. VPN can plan the best future options just from the current state. The figures show VPN’s different plans depending on the time limit. • DQN: This baseline directly estimates Q-values as its output and is trained through asynchronous n-step Q-learning. Unlike the original DQN, however, our DQN baseline takes an option as additional input and applies an option-conditional convolution layer to the top of the last encoding convolution layer, which is very similar to our VPN architecture.2 • VPN(1): This is identical to our VPN with the same training procedure except that it performs only 1-step rollout to estimate Q-value as shown in Figure 1a. This can be viewed as a variation of DQN that predicts reward, discount, and the value of the next state as a decomposition of Q-value. • OPN(d): We call this Observation Prediction Network (OPN), which is similar to VPN except that it directly predicts future observations. More specifically, we train two independent networks: a model network (f model : x, o 7→r, γ, x′) which predicts reward, discount, and the next observation, and a value network (f value : x 7→V (x)) which estimates the value from the observation. The training scheme is similar to our algorithm except that a squared loss for observation prediction is used to train the model network. This baseline performs d-step planning like VPN(d). 4.2 Collect Domain Task Description. We defined a simple but challenging 2D navigation task where the agent should collect as many goals as possible within a time limit, as illustrated in Figure 4. In this task, the agent, goals, and walls are randomly placed for each episode. The agent has four options: move left/right/up/down to the first crossing branch or the end of the corridor in the chosen direction. The agent is given 20 steps for each episode and receives a positive reward (2.0) when it collects a goal by moving on top of it and a time-penalty (−0.2) for each step. Although it is easy to learn a sub-optimal policy which collects nearby goals, finding the optimal trajectory in each episode requires careful planning because the optimal solution cannot be computed in polynomial time. An observation is represented as a 3D tensor (R3×10×10) with binary values indicating the presence/absence of each object type. The time remaining is normalized to [0, 1] and is concatenated to the 3rd convolution layer of the network as a channel. We evaluated all architectures first in a deterministic environment and then investigated the robustness in a stochastic environment separately. In the stochastic environment, each goal moves by one block with probability of 0.3 for each step. In addition, each option can be repeated multiple times with probability of 0.3. This makes it difficult to predict and plan the future precisely. Overall Performance. The result is summarized in Figure 6. To understand the quality of different policies, we implemented a greedy algorithm which always collects the nearest goal first and a shortest-path algorithm which finds the optimal solution through exhaustive search assuming that the environment is deterministic. Note that even a small gap in terms of reward can be qualitatively substantial as indicated by the small gap between greedy and shortest-path algorithms. The results show that many architectures learned a better-than-greedy policy in the deterministic and stochastic environments except that OPN baselines perform poorly in the stochastic environment. In addition, the performance of VPN is improved as the plan depth increases, which implies that deeper predictions are reliable enough to provide more accurate value estimates of future states. As a result, VPN with 5-step planning represented by ‘VPN(5)’ performs best in both environments. 2This architecture outperformed the original DQN architecture in our preliminary experiments. 6 0.0 0.5 1.0 1.5 Step 1e7 7.0 7.5 8.0 8.5 9.0 9.5 10.0 Average reward (a) Deterministic 0.0 0.5 1.0 1.5 Step 1e7 6.0 6.5 7.0 7.5 8.0 8.5 Average reward (b) Stochastic Greedy Shortest DQN OPN(1) OPN(2) OPN(3) OPN(5) VPN(1) VPN(2) VPN(3) VPN(5) Figure 6: Learning curves on Collect domain. ‘VPN(d)’ represents VPN with d-step planning, while ‘DQN’ and ‘OPN(d)’ are the baselines. Comparison to Model-free Baselines. Our VPNs outperform DQN and VPN(1) baselines by a large margin as shown in Figure 6. Figure 4 (b-c) shows an example of trajectories of DQN and VPN(5) given the same initial state. Although DQN’s behavior is reasonable, it ended up with collecting one less goal compared to VPN(5). We hypothesize that 6 convolution layers used by DQN and VPN(1) are not expressive enough to find the best route in each episode because finding an optimal path requires a combinatorial search in this task. On the other hand, VPN can perform such a combinatorial search to some extent by simulating future abstract-states, which has advantages over model-free approaches for dealing with tasks that require careful planning. Comparison to Observation-based Planning. Compared to OPNs which perform planning based on predicted observations, VPNs perform slightly better or equally well in the deterministic environment. We observed that OPNs can predict future observations very accurately because observations in this task are simple and the environment is deterministic. Nevertheless, VPNs learn faster than OPNs in most cases. We conjecture that it takes additional training steps for OPNs to learn to predict future observations. In contrast, VPNs learn to predict only minimal but sufficient information for planning: reward, discount, and the value of future abstract-states, which may be the reason why VPNs learn faster than OPNs. In the stochastic Collect domain, VPNs significantly outperform OPNs. We observed that OPNs tend to predict the average of possible future observations (Ex[x]) because OPN is deterministic. Estimating values on such blurry predictions leads to estimating Vθ(Ex[x]) which is different from the true expected value Ex[V (x)]. On the other hand, VPN is trained to approximate the true expected value because there is no explicit constraint or loss for the predicted abstract state. We hypothesize that this key distinction allows VPN to learn different modes of possible future states more flexibly in the abstract state space. This result suggests that a value-prediction model can be more beneficial than an observation-prediction model when the environment is stochastic and building an accurate observation-prediction model is difficult. Table 1: Generalization performance. Each number represents average reward. ‘FGs’ and ‘MWs’ represent unseen environments with fewer goals and more walls respectively. Bold-faced numbers represent the highest rewards with 95% confidence level. Deterministic Stochastic Original FGs MWs Original FGs MWs Greedy 8.61 5.13 7.79 7.58 4.48 7.04 Shortest 9.71 5.82 8.98 7.64 4.36 7.22 DQN 8.66 4.57 7.08 7.85 4.11 6.72 VPN(1) 8.94 4.92 7.64 7.84 4.27 7.15 OPN(5) 9.30 5.45 8.36 7.55 4.09 6.79 VPN(5) 9.29 5.43 8.31 8.11 4.45 7.46 Generalization Performance. One advantage of model-based RL approach is that it can generalize well to unseen environments as long as the dynamics of the environment remains similar. To see if our VPN has such a property, we evaluated all architectures on two types of previously unseen environments with either reduced number of goals (from 8 to 5) or increased number of walls. It turns out that our VPN is much more robust to the unseen environments compared to model-free baselines (DQN and VPN(1)), as shown in Table 1. The model-free baselines perform worse than the greedy algorithm on unseen environments, whereas VPN still performs well. In addition, VPN generalizes as well as OPN which can learn a near-perfect model in the deterministic setting, and VPN significantly outperforms OPN in the stochastic setting. This suggests that VPN has a good generalization property like model-based RL methods and is robust to stochasticity. 7 Table 2: Performance on Atari games. Each number represents average score over 5 top agents. Frostbite Seaquest Enduro Alien Q*Bert Ms. Pacman Amidar Krull Crazy Climber DQN 3058 2951 326 1804 12592 2804 535 12438 41658 VPN 3811 5628 382 1429 14517 2689 641 15930 54119 1 2 3 4 5 6 7 8 9 10 Plan depth (dtest) −2 0 2 4 6 8 10 Average reward VPN(1) VPN(2) VPN(3) VPN(5) VPN(5)* Figure 7: Effect of evaluation planning depth. Each curve shows average reward as a function of planning depth, dtest, for each architecture that is trained with a fixed number of prediction steps. ‘VPN(5)*’ was trained to make 10-step predictions but performed 5-step planning during training (k = 10, dtrain = 5). Effect of Planning Depth. To further investigate the effect of planning depth in a VPN, we measured the average reward in the deterministic environment by varying the planning depth (dtest) from 1 to 10 during evaluation after training VPN with a fixed number of prediction steps and planning depth (k, dtrain), as shown in Figure 7. Since VPN does not learn to predict observations, there is no guarantee that it can perform deeper planning during evaluation (dtest) than the planning depth used during training (dtrain). Interestingly, however, the result in Figure 7 shows that if k = dtrain > 2, VPN achieves better performance during evaluation through deeper tree search (dtest > dtrain). We also tested a VPN with k = 10 and dtrain = 5 and found that a planning depth of 10 achieved the best performance during evaluation. Thus, with a suitably large number of prediction steps during training, our VPN is able to benefit from deeper planning during evaluation relative to the planning depth during training. Figure 5 shows examples of good plans of length greater than 5 found by a VPN trained with planning depth 5. Another observation from Figure 7 is that the performance of planning depth of 1 (dtest = 1) degrades as the planning depth during training (dtrain) increases. This means that a VPN can improve its value estimations through long-term planning at the expense of the quality of short-term planning. 4.3 Atari Games To investigate how VPN deals with complex visual observations, we evaluated it on several Atari games [2]. Unlike in the Collect domain, in Atari games most primitive actions have only small value consequences and it is difficult to hand-design useful extended options. Nevertheless, we explored if VPNs are useful in Atari games even with short-lookahead planning using simple options that repeat the same primitive action over extended time periods by using a frame-skip of 10.3 We pre-processed the game screen to 84 × 84 gray-scale images. All architectures take last 4 frames as input. We doubled the number of hidden units of the fully-connected layer for DQN to approximately match the number of parameters. VPN learns to predict rewards and values but not discount (since it is fixed), and was trained to make 3-option-step predictions for planning which means that the agent predicts up to 0.5 seconds ahead in real-time. As summarized in Table 2 and Figure 8, our VPN outperforms DQN baseline on 7 out of 9 Atari games and learned significantly faster than DQN on Seaquest, QBert, Krull, and Crazy Climber. One possible reason why VPN outperforms DQN is that even 3-step planning is indeed helpful for learning a better policy. Figure 9 shows an example of VPN’s 3-step planning in Seaquest. Our VPN predicts reasonable values given different sequences of actions, which can potentially help choose a better action by looking at the short-term future. Another hypothesis is that the architecture of VPN itself, which has several auxiliary prediction tasks for multi-step future rewards and values, is useful for learning a good abstract-state representation as a model-free agent. Finally, our algorithm which performs planning to compute the target Q-value can potentially speed up learning by generating more accurate targets as it performs value backups multiple times from the simulated futures, as discussed in Section 3.4. These results show that our approach is applicable to complex visual environments without needing to predict observations. 3Much of the previous work on Atari games has used a frame-skip of 4. Though using a larger frame-skip generally makes training easier, it may make training harder in some games if they require more fine-grained control [17]. 8 0 1 2 3 4 1e7 0 500 1000 1500 2000 2500 3000 3500 4000 Frostbite 0 1 2 3 4 1e7 0 1000 2000 3000 4000 5000 6000 Seaquest 0 1 2 3 4 1e7 0 50 100 150 200 250 300 350 400 Enduro 0 1 2 3 4 1e7 0 500 1000 1500 2000 Alien 0 1 2 3 4 1e7 0 2000 4000 6000 8000 10000 12000 14000 16000 QBert 0 1 2 3 4 1e7 0 500 1000 1500 2000 2500 3000 Ms. Pacman 0 1 2 3 4 1e7 0 100 200 300 400 500 600 700 Amidar 0 1 2 3 4 1e7 0 2000 4000 6000 8000 10000 12000 14000 16000 18000 Krull 0 1 2 3 4 1e7 0 10000 20000 30000 40000 50000 60000 Crazy Climber DQN VPN Figure 8: Learning curves on Atari games. X-axis and y-axis correspond to steps and average reward over 100 episodes respectively. (a) State (b) Plan 1 (19.3) (c) Plan 2 (18.7) (d) Plan 3 (18.4) (e) Plan 4 (17.1) Figure 9: Examples of VPN’s value estimates. Each figure shows trajectories of different sequences of actions from the initial state (a) along with VPN’s value estimates in the parentheses: r1 + γr2 + γ2r3 + γ3V (s4). The action sequences are (b) DownRight-DownRightFire-RightFire, (c) Up-Up-Up, (d) Left-Left-Left, and (e) Up-Right-Right. VPN predicts the highest value for (b) where the agent kills the enemy and the lowest value for (e) where the agent is killed by the enemy. 5 Conclusion We introduced value prediction networks (VPNs) as a new deep RL way of integrating planning and learning while simultaneously learning the dynamics of abstract-states that make option-conditional predictions of future rewards/discount/values rather than future observations. Our empirical evaluations showed that VPNs outperform model-free DQN baselines in multiple domains, and outperform traditional observation-based planning in a stochastic domain. An interesting future direction would be to develop methods that automatically learn the options that allow good planning in VPNs. Acknowledgement This work was supported by NSF grant IIS-1526059. Any opinions, findings, conclusions, or recommendations expressed here are those of the authors and do not necessarily reflect the views of the sponsor. 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. arXiv preprint arXiv:1603.04467, 2016. [2] M. G. Bellemare, Y. Naddaf, J. Veness, and M. Bowling. The arcade learning environment: An evaluation platform for general agents. arXiv preprint arXiv:1207.4708, 2012. [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. Computational Intelligence and AI in Games, IEEE Transactions on, 4(1):1–43, 2012. 9 [4] S. Chiappa, S. Racaniere, D. Wierstra, and S. Mohamed. Recurrent environment simulators. In ICLR, 2017. [5] C. Finn, I. J. Goodfellow, and S. Levine. Unsupervised learning for physical interaction through video prediction. In NIPS, 2016. [6] C. Finn and S. Levine. Deep visual foresight for planning robot motion. In ICRA, 2017. [7] S. Gu, T. P. Lillicrap, I. Sutskever, and S. Levine. Continuous deep q-learning with model-based acceleration. In ICML, 2016. [8] X. Guo, S. P. Singh, R. L. Lewis, and H. Lee. Deep learning for reward design to improve monte carlo tree search in atari games. In IJCAI, 2016. [9] M. Hausknecht and P. Stone. Deep recurrent q-learning for partially observable MDPs. arXiv preprint arXiv:1507.06527, 2015. [10] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In CVPR, 2016. [11] N. Heess, G. Wayne, D. Silver, T. P. Lillicrap, Y. Tassa, and T. Erez. Learning continuous control policies by stochastic value gradients. In NIPS, 2015. [12] M. Jaderberg, V. Mnih, W. Czarnecki, T. Schaul, J. Z. Leibo, D. Silver, and K. Kavukcuoglu. Reinforcement learning with unsupervised auxiliary tasks. In ICLR, 2017. [13] N. Kalchbrenner, A. van den Oord, K. Simonyan, I. Danihelka, O. Vinyals, A. Graves, and K. Kavukcuoglu. Video pixel networks. arXiv preprint arXiv:1610.00527, 2016. [14] D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. In ICLR, 2015. [15] L. Kocsis and C. Szepesvári. Bandit based monte-carlo planning. In ECML, 2006. [16] T. D. Kulkarni, A. Saeedi, S. Gautam, and S. Gershman. Deep successor reinforcement learning. arXiv preprint arXiv:1606.02396, 2016. [17] A. S. Lakshminarayanan, S. Sharma, and B. Ravindran. Dynamic action repetition for deep reinforcement learning. In AAAI, 2017. [18] I. Lenz, R. A. Knepper, and A. Saxena. Deepmpc: Learning deep latent features for model predictive control. In RSS, 2015. [19] N. Mishra, P. Abbeel, and I. Mordatch. Prediction and control with temporal segment models. In ICML, 2017. [20] 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. In ICML, 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, S. Petersen, C. Beattie, A. Sadik, I. Antonoglou, H. King, D. Kumaran, D. Wierstra, S. Legg, and D. Hassabis. Human-level control through deep reinforcement learning. Nature, 518(7540):529–533, 2015. [22] J. Oh, V. Chockalingam, S. Singh, and H. Lee. Control of memory, active perception, and action in minecraft. In ICML, 2016. [23] J. Oh, X. Guo, H. Lee, R. L. Lewis, and S. Singh. Action-conditional video prediction using deep networks in atari games. In NIPS, 2015. [24] E. Parisotto and R. Salakhutdinov. Neural map: Structured memory for deep reinforcement learning. arXiv preprint arXiv:1702.08360, 2017. [25] D. Precup. Temporal abstraction in reinforcement learning. PhD thesis, University of Massachusetts, Amherst, 2000. [26] T. Raiko and M. Tornio. Variational bayesian learning of nonlinear hidden state-space models for model predictive control. Neurocomputing, 72(16):3704–3712, 2009. [27] D. Silver, A. Huang, C. J. Maddison, A. Guez, L. Sifre, G. van den Driessche, J. Schrittwieser, I. Antonoglou, V. Panneershelvam, M. Lanctot, S. Dieleman, D. Grewe, J. Nham, N. Kalchbrenner, I. Sutskever, T. Lillicrap, M. Leach, K. Kavukcuoglu, T. Graepel, and D. Hassabis. Mastering the game of go with deep neural networks and tree search. Nature, 529(7587):484–489, 2016. 10 [28] D. Silver, R. S. Sutton, and M. Müller. Temporal-difference search in computer go. Machine Learning, 87:183–219, 2012. [29] D. Silver, H. van Hasselt, M. Hessel, T. Schaul, A. Guez, T. Harley, G. Dulac-Arnold, D. Reichert, N. Rabinowitz, A. Barreto, and T. Degris. The predictron: End-to-end learning and planning. In ICML, 2017. [30] B. C. Stadie, S. Levine, and P. Abbeel. Incentivizing exploration in reinforcement learning with deep predictive models. arXiv preprint arXiv:1507.00814, 2015. [31] M. Stolle and D. Precup. Learning options in reinforcement learning. In SARA, 2002. [32] R. S. Sutton. Integrated architectures for learning, planning, and reacting based on approximating dynamic programming. In ICML, 1990. [33] R. S. Sutton, D. Precup, and S. Singh. Between MDPs and semi-MDPs: A framework for temporal abstraction in reinforcement learning. Artificial intelligence, 112(1):181–211, 1999. [34] R. S. Sutton, C. Szepesvári, A. Geramifard, and M. H. Bowling. Dyna-style planning with linear function approximation and prioritized sweeping. In UAI, 2008. [35] A. Tamar, S. Levine, P. Abbeel, Y. Wu, and G. Thomas. Value iteration networks. In NIPS, 2016. [36] A. Vezhnevets, V. Mnih, S. Osindero, A. Graves, O. Vinyals, J. Agapiou, and K. Kavukcuoglu. Strategic attentive writer for learning macro-actions. In NIPS, 2016. [37] Z. Wang, T. Schaul, M. Hessel, H. van Hasselt, M. Lanctot, and N. de Freitas. Dueling network architectures for deep reinforcement learning. In ICML, 2016. [38] C. J. Watkins and P. Dayan. Q-learning. Machine learning, 8(3-4):279–292, 1992. [39] H. Yao, S. Bhatnagar, D. Diao, R. S. Sutton, and C. Szepesvári. Multi-step dyna planning for policy evaluation and control. In NIPS, 2009. 11
2017
678
7,205
Detrended Partial Cross Correlation for Brain Connectivity Analysis Jaime S Ide∗ Yale University New Haven, CT 06519 jaime.ide@yale.edu Fabio A Cappabianco Federal University of Sao Paulo S.J. dos Campos, 12231, Brazil cappabianco@unifesp.br Fabio A Faria Federal University of Sao Paulo S.J. dos Campos, 12231, Brazil ffaria@unifesp.br Chiang-shan R Li Yale University New Haven, CT chiang-shan.li-yale.edu Abstract Brain connectivity analysis is a critical component of ongoing human connectome projects to decipher the healthy and diseased brain. Recent work has highlighted the power-law (multi-time scale) properties of brain signals; however, there remains a lack of methods to specifically quantify short- vs. long- time range brain connections. In this paper, using detrended partial cross-correlation analysis (DPCCA), we propose a novel functional connectivity measure to delineate brain interactions at multiple time scales, while controlling for covariates. We use a rich simulated fMRI dataset to validate the proposed method, and apply it to a real fMRI dataset in a cocaine dependence prediction task. We show that, compared to extant methods, the DPCCA-based approach not only distinguishes short and long memory functional connectivity but also improves feature extraction and enhances classification accuracy. Together, this paper contributes broadly to new computational methodologies in understanding neural information processing. 1 Introduction Brain connectivity is crucial to understanding the healthy and diseased brain states [15, 1]. In recent years, investigators have pursued the construction of human connectomes and made large datasets available in the public domain [23, 24]. Functional Magnetic Resonance Imaging (fMRI) has been widely used to examine complex processes of perception and cognition. In particular, functional connectivity derived from fMRI signals has proven to be effective in delineating biomarkers for many neuropsychiatric conditions [15]. One of the challenges encountered in functional connectivity analysis is the precise definition of nodes and edges of connected brain regions [21]. Functional nodes can be defined based on activation maps or with the use of functional or anatomical atlases. Once nodes are defined, the next step is to estimate the weights associated with the edges. Traditionally, these functional connectivity weights are measured using correlation-based metrics. Previous simulation studies have shown that they can be quite successful, outperforming higher-order statistics (e.g. linear non-gaussian acyclic causal models) and lag-based approaches (e.g. Granger causality) [20]. On the other hand, very few studies have investigated the power-law cross-correlation properties (equivalent to multi-time scale measures) of brain connectivity. Recent research suggested that fMRI ∗Corresponding author: Department of Psychiatry, 34 Park St. S110. New Haven CT 06519. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. signals have power-law properties (e.g. their power-spectrum follows a power law) [8, 3] and that the deviations from the typical range of power-exponents have been noted in neuropsychiatric disorders [11]. For instance, in [3], using wavelet-based multivariate methods, authors observed that scale-free properties are characteristic not only of univariate fMRI signals but also of pairwise cross-temporal dynamics. Moreover, they found an association between the magnitude of scale-free dynamics and task performance. We hypothesize that power-law correlation measures may capture additional dimensions of brain connectivity not available from conventional analyses and thus enhance clinical prediction. In this paper, we aim to answer three key open questions: (i) whether and how brain networks are cross-correlated at different time scales with long-range dependencies (“long-memory” process, equivalent to power-law in the frequency domain); (ii) how to extract the intrinsic association between two regions controlling for the influence of other interconnected regions; and (iii) whether multi-time scale connectivity measures can improve clinical prediction. We address the first two questions by using the detrended partial cross-correlation analsyis (DPCCA) coefficient [25], a measure that quantifies correlations on multiple time scales between non-stationary time series, as is typically the case with task-related fMRI signals. DPCCA is an extension of detrended cross-correlation analysis [17, 13], and has been successfully applied to analyses of complex systems, including climatological [26] and financial [18] data. Unlike methods based on filtering particular frequency bands, DPCCA directly informs correlations across multiple time scales, and unlike wavelet-based approaches (e.g. cross wavelet transformation and wavelet transform coherence [2]), DPCCA has the advantage of estimating pairwise correlations controlling for the influence of other regions. This is critical because brain regions and thus fMRI signals thereof are highly interconnected. To answer the third question, we use the correlation profiles, generated from DPCCA, as input features for different machine learning methods in classification tasks and compare the performance of DPCCA-based features with all other competing features. In Section 2, we describe the simulated and real data sets used in this study, and show how features of the classification task are extracted from the fMRI signals. In Section 3, we provide further details about DPCCA (Section 3.1), and present the proposed multi-time scale functional connectivity measure (Section 3.2). In Section 4, we describe core experiments designed to validate the effectiveness of DPCCA in brain connectivity analysis and clinical prediction. We demonstrate that DPCCA (i) detects connectivity at multiple-time scales while controlling for covariates (Sections 4.1 and 4.3), (ii) accurately identifies functional connectivity in well-known gold-standard simulated data (Section 4.2), and (iii) improves classification accuracy of cocaine dependence with fMRI data of seventy-five cocaine dependent and eighty-eight healthy control individuals (Section 4.4). In Section 5, we conclude by highlighting the significance of the study as well as the limitations and future work. 2 Material and Methods 2.1 Simulated dataset: NetSim fMRI data We use fMRI simulation data - NetSim [20] - previously developed for the evaluation of network modeling methods. Simulating rich and realistic fMRI time series, NetSim is comprised of twentyeight different brain networks, with different levels of complexity. These signals are generated using dynamic causal modeling (DCM [6]), a generative network model aimed to quantify neuronal interactions and neurovascular dynamics, as measured by the fMRI signals. NetSim graphs have 5 to 50 nodes organized with “small-world” topology, in order to reflect real brain networks. NetSim signals have 200 time points (mostly) sampled with repetition time (TR) of 3 seconds. For each network, 50 separate realizations (“subjects”) are generated. Thus, we have a total of 1400 synthetic dataset for testing. Finally, once the signals are generated, white noise of standard deviation 0.1-1% is added to reproduce the scan thermal noise. 2.2 Real-world dataset: Cocaine dependence prediction Seventy-five cocaine dependent (CD) and eighty-eight healthy control (HC) individuals matched in age and gender participated in this study. CD were recruited from the local, greater New Haven area in a prospective study and met criteria for current cocaine dependence, as diagnosed by the Structured Clinical Interview for DSM-IV. They were drug-free while staying in an inpatient treatment unit. 2 The Human Investigation committee at Yale University School of Medicine approved the study, and all subjects signed an informed consent prior to participation. In the MR scanner, they performed a simple cognitive control paradigm called stop-signal task [14]. FMRI data were collected with 3T Siemens Trio scanner. Each scan comprised four 10-min runs of the stop signal task. Functional blood oxygenation level dependent (BOLD) signals were acquired with a single-shot gradient echo echo-planar imaging (EPI) sequence, with 32 axial slices parallel to the AC-PC line covering the whole brain: TR=2000 ms, TE=25 ms, bandwidth=2004 Hz/pixel, flip angle=85◦, FOV=220×220 mm2, matrix=66×64, slice thickness=4 mm and no gap. A high-resolution 3D structural image (MPRAGE; 1 mm resolution) was also obtained for anatomical co-registration. Three hundred images were acquired in each session. Functional MRI data was pre-processed with standard pipeline using Statistical Parametric Mapping 12 (SPM12) (Wellcome Department of Imaging Neuroscience, University College London, U.K.). 2.2.1 Brain activation We constructed general linear models and localized brain regions responding to conflict (stop signal) anticipation (encoded by the probability P(stop)) at the group level [10]. The regions responding to P(stop) comprised the bilateral parietal cortex, the inferior frontal gyrus (IFG) and the right middle frontal gyrus (MFG); and regions responding to motor slowing bilateral insula, the left precentral cortex (L.PC), and the supplementary motor area (SMA) (Fig. 1(a))2. These regions of interest (ROIs) were used as masks to extract average activation time courses for functional connectivity analyses. 2.2.2 Functional connectivity We analyzed the frontoparietal circuit involved in conflict anticipation and response adjustment using a standard Pearson correlation analysis and multivariate Granger causality analysis or mGCA [19]. In Fig. 1(b), we illustrate fifteen correlation coefficients derived from the six ROIs for each individual CD and HC as shown in Fig. 1(a). According to mGCA, connectivities from bilateral parietal to L.PC and SMA were disrupted in CD (Fig. 1(b)). These findings offer circuit-level evidence of altered cognitive control in cocaine addiction. (a) (b) Figure 1: Disrupted frontoparietal circuit in cocaine addicts. The frontoparietal circuit included six regions responding to Bayesian conflict anticipation (“S”) and regions of motor slowing (“RT”): (a) CD and HC shared connections (orange arrows). (b) Connectivity strengths between nodes in the frontoparietal circuit. We show connectivity strengths between nodes for each individual subject in CD (red line) and HC (blue line) groups. 3 A Novel Measure of Brain Functional Connectivity 3.1 Detrended partial cross-correlation analysis (DPCCA) Detrended partial cross-correlation is a novel measure recently proposed by [25]. DPCCA combines the advantages of detrended cross-correlation analysis (DCCA) [17] and standard partial correlation. Given two time series {x(a)}, {x(b)} ∈Xt, where Xt ∈IRm, t = 1, 2, ..., N time points, DPCCA is given by Equation 1: ρDP CCA(a, b; s) = −Ca,b(s) p Ca,a(s).Cb,b(s) , (1) 2Peak MNI coordinates for IFG:[39,53,-1], MFG:[42,23,38],bilateral insula:[-33,17,8] and [30,20,2], L.PC:[36,-13,56], and SMA:[-9,-1,50] in mm. 3 where s is the time scale and each term Ca,b(s) is obtained by inverting the matrix ρ(s), e.g. C(s) =ρ−1(s). The coefficient ρa,b ∈ρ(s) is the so called DCCA coefficient [13]. The DCCA coefficient is an extension of the detrented cross correlation analysis [17] combined with detrended fluctuation analysis (DFA) [12]. Given two time series {x}, {y} ∈Xt (indices omitted for the sake of simplicity) with N time points and time scale s, DCCA coefficient is given by Equation 2: ρ(s) = F 2 DCCA(s) FDF A,x(s)FDF A,y(s), (2) where the numerator and denominator are the average of detrended covariances and variances of the N −s + 1 windows (partial sums), respectively, as described in Equations 3-4: F 2 DCCA(s) = PN−s+1 j=1 f 2 DCCA(s, j) N −s (3) F 2 DF A,x(s) = PN−s+1 j=1 f 2 DF A,x(s, j) N −s . (4) The partial sums (profiles) are obtained with sliding windows across the integrated time series Xt = Pt i=1 xi and Yt = Pt i=1 yi. For each time window j with size s, detrended covariances and variances are computed according to Equations 5-6: f 2 DCCA(s, j) = Pj+s−1 t=j (Xt −[ Xt,j)(Yt −d Yt,j) s −1 , (5) f 2 DF A,x(s, j) = Pj+s−1 t=j (Xt −[ Xt,j)2 s −1 , (6) where [ Xt,j and d Yt,j are polynomial fits of time trends. We used a linear fit as originally proposed [13], but higher order fits could also be used [25]. DCCA can be used to measure power-law cross-correlations. However, we focus on DCCA coefficient as a robust measure to detect pairwise cross-correlation in multiple time scales, while controlling for covariates. Importantly, DPCCA quantifies correlations among time series with varying levels of non-stationarity [13]. 3.2 DPCCA for functional connectivity analysis In this section, we propose the use of DPCCA as a novel measure of brain functional connectivity. First, we show in simulation experiments that the measure satisfies desired connectivity properties. Further, we define the proposed connectivity measure. Although these properties are expected by mathematical definition of DPCCA, it is critical to confirm its validity on real fMRI data. Additionally, it is necessary to establish the statistical significance of the computed measures at the group level. 3.2.1 Desired properties Given real fMRI signals, the measure should accurately detect the time scale in which the pairwise connections occur, while controlling for the covariates. To verify this, we create synthetic data by combining real fMRI signals and sinusoidal waves (Fig. 2). To simplify, we assume additive property of signals and sinusoidal waves reflecting the time onset of the connections. For each simulation, we randomly sample 100 sets of time series or “subjects”. a) Distinction of short and long memory connections. Given two fMRI signals {xA}, {xB}, we derive three pairs with known connectivity profiles: short-memory {XA = xA + sin(T1) + e}, {XB = xB + sin(T1) + e}, long-memory {XA = xA + sin(T2) + e}, {XB = xB + sin(T2) + e} and mixed {XA = xA + sin(T1) + sin(T2) + e}, {XB = xB + sin(T1) + sin(T2) + e}, where T1 << T2 and e is a Gaussian signal to simulate measurement noise. We hypothesize that the two nodes A and B are functionally connected at time scales T1 and T2. 4 b) Control for covariates. Given three fMRI signals {xA}, {xB}, {xC}, we derive three signals with known connectivity {XAC = xA+xC+sin(T )+e}, {XBC = xB+xC+sin(T )+e}, {XC = xC + e}, where e is the measurement noise. We hypothesize that the two nodes A and B are functionally connected mostly at scale T, once the mutual influence of node C is controlled. (a) (b) Figure 2: Illustration of synthetic fMRI signals generated by combining real fMRI signals and sinusoidal waves. (a) Original fMRI signals, (b) original signals with sin(T = 10s) and sin(T = 30s) waves added. 3.2.2 Statistical significance Given two nodes and their time series, we assume that they are functionally connected if the max |ρDP CCA|, within a time range srange, is significantly greater than the null distribution. Empirical null distributions are estimated from the original data by randomly shuffling time series across different subjects and nodes, as proposed in [20]. In this way, we generate realistic distributions of connectivity weights occurring by chance. Since we have a multivariate measure, the null dataset is always generated with the same number of nodes as the tested network. Multiple comparisons are controlled by estimating the false discovery rate. Importantly, the null distribution is also computed on max |ρDP CCA| within the time range srange. We use a srange from 6 to 18 seconds, assuming that functional connections transpire in this range. Thus, we allow connections with different time-scales. We use this binary definition of functional connectivity for the current approach to be comparable with other methods, but it is also possible to work with the whole temporal profile of ρDP CCA(s), as is done in the classification experiment (Section 4.4). To keep the same statistical criteria, we also generate null distributions for all the other connectivity measures. 3.2.3 DPCCA + Canonical correlation analysis As further demonstrated by simulation results (Table 1), DPCCA alone has lower true positive rate (TPR) compared to other competing methods, likely because of its restrictive statistical thresholds. In order to increase the sensitivity of DPCCA, we augmented the method by including an additional canonical correlation analysis (CCA) [7]. CCA was previously used in fMRI in different contexts to detect brain activations [5], functional connectivity [27], and for multimodal information fusion [4]. In short, given two sets of multivariate time series {XA(t) ∈IRm, t = 1, 2, ..., N} and {XB(t) ∈IRn, t = 1, 2, ..., N}, where m and n are the respective dimensions of the two sets A and B, and N is the number of time points, CCA seeks the linear transformations u and v so that the correlation between the linear combinations XA(t)u and XB(t)v is maximized. In this work, we propose the use of CCA to define the existence of a true connection, in addition to the DPCCA connectivity results. The proposed method is summarized in Algorithm 1. With CCA (Lines 8-14), we identify the nodes that are strongly connected after linear transformations. In Line 18, we use CCA to inform DPCCA in terms of positive connections. 4 Experiments and Results 4.1 Connectivity properties: Controlling time scales and covariates In Figure 3, we observe that DPCCA successfully captured the time scales of the correlations between time series {XA}, {XB}, despite the noisy nature of fMRI signals. For instance, it distinguished between short and long-memory connections, represented using T1 = 10s and T2 = 30s, respectively (Figs. 3a-c). Importantly, it clearly detected the peak connection at 10s after controlling for the influence of covariate signal XC (Fig. 3f). Further, unlike DPCCA, the original DCCA method did not rule out the mutual influence of XC with peak at 30s (Fig. 3e). 5 Algorithm 1 DPCCA+CCA Input: Time series {Xt ∈IRm, t = 1, 2, ..., N}, where m is the number of vectors and N is the number of time points; time range srange with k values Output: Connectivity matrix F C : [m × m] and associated matrices 1: Step: DPCCA(Xt) ▷Compute pairwise DPCCA 2: for pair of vectors {x(a)}, {x(b)} ∈Xt do 3: for s in srange do 4: Compute the coefficient ρDP CCA(a, b; s) ▷Equation(1) 5: F C[a, b] ←max |ρDP CCA| in srange 6: P [a, b] ←statistical significance of F C[a, b] given the null empirical distribution 7: return F C and P ▷Matrix of connection weights and p-values 8: Step: CCA(Xt) ▷Compute CCA connectivity 9: for x(a) ∈Xt do 10: for x(b) ∈Xt, b ̸= a do 11: rCCA[a, b] ←(1−CCA between {x(a)}, {x(c)}, c ̸= a, b) ▷Effect of excluding node b 12: indexcon ←k-means(rCCA[a]) ▷Split connections into binary groups 13: CCA[a, indexcon] ←1 14: return CCA ▷CCA is a binary connectivity matrix 15: Step: DPCCA+CCA(P,CCA) ▷Augment DPCCA with CCA results 16: for pair of nodes {a, b} do 17: F C∗[a, b] ←1, if P [a, b] < 0.05 ▷DPCCA significant connections 18: F C∗[a, b] ←max(F C∗[a, b], CCA[a, b]) ▷Fill missing connections 19: return F C∗, F C and P ▷F C∗is a binary matrix Figure 3: DPCCA temporal profiles among the synthetic signals (details in Section 3.2.1). (a)-(c): DPCCA with peak at T=10s and T=30s, and mixed. (d) DPCCA of the original fMRI signals used to generate the synthetics signals. (e) Temporal profile obtained with DCCA without partial correlation. (f) DPCCA peak at T=10s after controlling for XC. Dashed lines are the 95% confidence interval of DPCCA for the empirical null distribution. 4.2 Simulated networks: Improved connectivity accuracy The goal of this experiment is to validate the proposed methods in an extensive dataset designed to test functional connectivity methods. In this dataset, ground truth networks are known with the architectures aimed to reflect real brain networks. We use the full NetSim dataset comprised of 28 different brain circuits and 50 subjects. For each sample of time series, we compute the partial correlation (parCorr) and the regularized inverse covariance (ICOV), reported as the best performers in [20], as well as the proposed DPCCA and DPCCA+CCA methods. For each measure, we construct empirical null distributions, as described in Section 3.2.2, and generate the binary connectivity matrix using threshold α = 0.05. To evaluate their connectivity accuracy, given the ground truth networks, we compute the true positive and negative rates (TPR and TNR, respectively) and the balanced accuracy BAcc= (T P R+T NR) 2 . Using NetSim fMRI data as the testing benchmark, we observed that the proposed DPCCA+CCA method provided more accurate functional connectivity results than the best methods reported in the original paper [20]. Results are summarized in Table 1. Here we use the balanced accuracy (BAcc) 6 as the evaluation metric, since it is a straightforward way to quantify both true positive and negative connections. Table 1: Comparison of functional connectivity methods using NetSim dataset. Mean and standard deviation of balanced accuracy (BAcc), true positive rate (TPR) and true negative rate (TNR) are reported. ParCorr: partial correlation, ICOV: regularized inverse covariance, DPCCA: detrended cross correlation analysis, DPCCA+CCA: DPCCA augmented with CCA. DPCCA+CCA balanced accuracy is significantly higher than the best competing method ICOV (Wilcoxon signed paired test, Z=3.35 and p=8.1e-04). Metrics Functional connectivity measures ParCorr ICOV DPCCA DPCCA+CCA BAcc TPR TNR BAcc TPR TNR BAcc TPR TNR BAcc TPR TNR Mean 0.834 0.866 0.804 0.841 0.866 0.817 0.846 0.835 0.855 0.859 0.893 0.824 Std 0.096 0.129 0.188 0.095 0.131 0.181 0.095 0.150 0.177 0.091 0.081 0.169 4.3 Real-world dataset: Learning connectivity temporal profiles We use unsupervised methods to (i) learn representative temporal profiles of connectivity from DPCCAF ull, and (ii) perform dimensionality reduction. The use of temporal profiles may capture additional information (such as short- and long-memory connectivity). However, it increases the feature set dimensionality, imposing additional challenges on classifier training, particularly with small dataset. The first natural choice for this task is principal component analysis (PCA), which can represent original features by their linear combination. Additionally, we use two popular non-linear dimensionality reduction methods Isomap [22] and autoencoders [9]. With Isomap, we attempt to learn the intrinsic geometry (manifold) of the temporal profile data. With autoencoders, we seek to represent the data using restricted Boltzmann machines stacked into layers. In Figure 4, we show some representative correlation profiles obtained by computing DPPCA among frontoparietal regions (circuit presented in Fig. 1), and the first three principal components. Interestingly, PCA seemed to learn some of the characteristic temporal profiles. For instance, as expected, the first components captured the main trend, while the second components captured some of the short (task-related) and long (resting-state) memory connectivity trends (Figs.4a-b). Figure 4: Illustration of some DPCCA profiles and their principal components. IFG: inferior frontal gyrus, SMA: supplementary motor area, PC: premotor cortex. Explained variances of the components are also reported. 4.4 Real-world dataset: Cocaine dependence prediction The classification task consists of predicting the class membership, cocaine dependence (CD) and healthy control (HC), given each individual’s fMRI data. After initial preprocessing (Section 2.2), we extract average time series within the frontoparietal circuit of 6 regions 3 (Figure 1), and compute the different cross-correlation measures. These coefficients are used as features to train and test (leave-one-out cross-validation) a set of popular classifiers available in scikit-learn toolbox [16] (version 0.18.1), including k-nearest neighbors (kNN), support vector machine (SVM), multilayer perceptron (MLP), Gaussian processes (GP), naive Bayes (NB) and the ensemble method Adaboost (Ada). For the DPCCA coefficients, we test both peak values DPCCAmax as well as the rich temporal profiles DPCCAF ull. Finally, we also include the brain activation maps (Section 2.2.1) as feature set, thus allowing comparison with popular fMRI classification softwares such as PRONTO (http://www.mlnl.cs.ucl.ac.uk/pronto/). Features are summarized in Table 2. 3Although these regions are obtained from the whole-group, no class information is used to avoid inflated classification rates. 7 Table 2: Features used in the cocaine dependence classification task. Type Name Size Description Activation P(stop) 1042 Brain regions responding to anticipation of stop signals UPE 1042 Brain regions responding to unsigned prediction error of P(stop) Connectivity Corr 15 Pearson cross-correlation among the six frontoparietal regions ParCorr 15 Partial cross-correlation among the six frontoparietal regions ICOV 15 Regularized inverse covariance among the six frontoparietal regions DPCCAmax 15 Maximum DPCCA within the range 6-40 seconds DPCCAF ull 270 Temporal profile of DPCCA within the range 6-40 seconds DPCCAIso 135-180 Isomap with 9-12 components and 30 neighbors DPCCAAutoE 30-45 Autoencoders with 2-3 hidden layers, 5-20 neurons, batch=100, epoch=1000 DPCCAP CA 135-180 PCA with 9-12 components Classification results are summarized in Table 3 and Figure 5. We used the area under curve (AUC) as an evaluation metric in order to consider both sensitivity and specificity of the classifiers, as well as balanced accuracy (BAcc). Here we tested all features described in Table 2, including the DPCCA full profiles after dimensionality reduction (Isomap, autoencoders and PCA). Activation maps produced poor classification results (P(stop): 0.525±0.048 and UPE: 0.509±0.032), comparable to the results obtained with PRONTO software using the same features (accuracy 0.556). Features Mean AUC (± std) Mean BAcc (± std) Top classifier (AUC / BAcc) Accuracy (AUC / BAcc) Corr 0.757 (± 0.041) 0.674 (± 0.037) GP / NB 0.794 / 0.710 ParCorr 0.901 (± 0.034) 0.848 (± 0.025) GP / Ada 0.948 / 0.875 ICOV 0.900 (± 0.030) 0.838 (± 0.023) GP / SVM 0.948 / 0.858 DPCCAmax 0.906 (± 0.019) 0.831 (± 0.022) GP / Ada 0.929 / 0.857 DPCCAF ull 0.899 (± 0.028) 0.820 (± 0.052) GP / GP 0.957 / 0.874 DPCCAIso 0.902 (± 0.030) 0.827 (± 0.068) GP / MLP 0.954 / 0.894 DPCCAAutoE 0.815 (± 0.149) 0.813 (± 0.106) SVM / kNN5 0.939 / 0.863 DPCCAP CA 0.928 (± 0.035) 0.844 (± 0.064) Ada / NB 0.963 / 0.911 Table 3: Comparison of classification results for different features. The DPCCA features combined with PCA produced the top classifiers according to both criteria (0.963/0.911). However, DPCCAP CA is not statistically better than ParCorr or ICOV (Wilcoxon signed paired test, p>0.05). See Figure 5 for accuracy across different classification methods. Figure 5: Comparison of classification results for different features and methods (described in Section 4.4). 5 Conclusions In summary, as a multi-time scale approach to characterize brain connectivity, the proposed method (DPCCA+CCA) (i) identified connectivity peak-times (Fig. 3), (ii) produced higher connectivity accuracy than the best competing method ICOV (Table 1), and (iii) distinguished short/long memory connections between brain regions involved in cognitive control (IFC&SMA and SMA&PC) (Fig. 4). Second, using the connectivity weights as features, DPCCA measures combined with PCA produced the highest individual accuracies (Table 3). However, it was not statistically different from the second best feature (ParCorr) across different classifiers. Further separate test set would be necessary to identify the best classifiers. We performed extensive experiments with a large simulated fMRI dataset to validate DPCCA as a promising functional connectivity analytic. On the other hand, our conclusions on clinical prediction (classification task) are still limited to one case. Finally, further optimization of Isomap and autoencoders methods could improve the learning of connectivity temporal profiles produced by DPCCA. Acknowledgments Supported by FAPESP (2016/21591-5), CNPq (408919/2016-7), NSF (BCS1309260) and NIH (AA021449, DA023248). References [1] DS Bassett and ET Bullmore. Human Brain Networks in Health and Disease. Current opinion in neurology, 22(4):340–347, 2009. 8 [2] C Chang and GH Glover. Time–Frequency Dynamics of Resting-State Brain Connectivity Measured with fMRI . NeuroImage, 50(1):81 – 98, 2010. [3] P Ciuciu, P Abry, and BJ He. Interplay between Functional Connectivity and Scale-Free Dynamics in Intrinsic fMRI Networks. Neuroimage, 95:248–63, 2014. [4] NM Correa et al. Fusion of fMRI, sMRI, and EEG Data using Canonical Correlation Analysis. In 2009 IEEE International Conference on Acoustics, Speech and Signal Processing, pages 385–388, April 2009. [5] O Friman et al. Detection of neural activity in functional MRI using Canonical Correlation Analysis. Magnetic Resonance in Medicine, 45(2):323–330, February 2001. [6] KJ Friston, L Harrison, and W Penny. Dynamic Causal Modelling. NeuroImage, 19(4):1273, 2003. [7] DR Hardoon, SR Szedmak, and JR Shawe-Taylor. Canonical Correlation Analysis: An Overview with Application to Learning Methods. Neural Comput., 16(12):2639–2664, December 2004. [8] B. J. He. Scale-free brain activity: past, present, and future. Trends Cogn Sci, 18(9):480–7, 2014. [9] GE Hinton and RR Salakhutdinov. Reducing the Dimensionality of Data with Neural Networks. Science, 313(5786):504–507, 2006. [10] S Hu, JS Ide, S Zhang, and CR Li. Anticipating conflict: Neural correlates of a bayesian belief and its motor consequence. NeuroImage, 119:286–295, 2015. doi: 10.1016/j.neuroimage.2015.06.032. [11] JS Ide, S Hu, S Zhang, LR Mujica-Parodi, and CR Li. Power spectrum scale invariance as a neural marker of cocaine misuse and altered cognitive control. NeuroImage: Clinical, 11:349 – 356, 2016. [12] JW Kantelhardt et al. Multifractal Detrended Fluctuation Analysis of Nonstationary Time Series. Physica A: Statistical Mechanics and its Applications, 316(1–4):87 – 114, 2002. [13] L Kristoufek. Measuring Correlations between Non-Stationary Series with DCCA Coefficient. Physica a-Statistical Mechanics and Its Applications, 402:291–298, 2014. [14] GD Logan, WB Cowan, and KA Davis. On the Ability to Inhibit Simple and Choice Reaction Time Responses: a Model and a Method. J Exp Psychol Hum Percept Perform, 10(2):276–91, 1984. [15] PM Matthews and A Hampshire. Clinical Concepts Emerging from fMRI Functional Connectomics. Neuron, 91(3):511 – 528, 2016. [16] F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825–2830, 2011. [17] B Podobnik and HE Stanley. Detrended Cross-Correlation Analysis: a New Method for Analyzing two Nonstationary Time Series. Phys Rev Lett, 100(8):084102, 2008. [18] XY Qian et al. Detrended Partial Cross-Correlation Analysis of two Nonstationary Time Series Influenced by Common External Forces. Phys Rev E Stat Nonlin Soft Matter Phys, 91(6):062816, 2015. [19] AK. Seth, AB. Barrett, and L Barnett. Granger Causality Analysis in Neuroscience and Neuroimaging. Journal of Neuroscience, 35(8):3293–3297, 2015. [20] SM Smith et al. Network Modelling Methods for FMRI. Neuroimage, 54(2):875–91, 2011. [21] O Sporns. The Human Connectome: Origins and Challenges. NeuroImage, 80:53 – 61, 2013. Mapping the Connectome. [22] JB Tenenbaum, V de Silva, and JC Langford. A Global Geometric Framework for Nonlinear Dimensionality Reduction. Science, 290(5500):2319–2323, 2000. [23] DC Van Essen et al. The WU-Minn Human Connectome Project: An overview. NeuroImage, 80:62 – 79, 2013. Mapping the Connectome. [24] M Xia and Y He. Functional Connectomics from a “Big Data” Perspective. NeuroImage, pages –, 2017. [25] N Yuan et al. Detrended Partial-Cross-Correlation Analysis: a New Method for Analyzing Correlations in Complex System. Sci Rep, 5:8143, 2015. [26] N Yuan et al. A Novel Way to Detect Correlations on Multi-Time Scales, with Temporal Evolution and for Multi-Variables. Sci Rep, 6:27707, 2016. [27] D Zhou, WK Thompson, and G Siegle. MATLAB Toolbox for Functional Connectivity. NeuroImage, 47 (4):1590 – 1607, 2009. 9
2017
679
7,206
Collaborative PAC Learning Avrim Blum Toyota Technological Institute at Chicago Chicago, IL 60637 avrim@ttic.edu Nika Haghtalab Computer Science Department Carnegie Mellon University Pittsburgh, PA 15213 nhaghtal@cs.cmu.edu Ariel D. Procaccia Computer Science Department Carnegie Mellon University Pittsburgh, PA 15213 arielpro@cs.cmu.edu Mingda Qiao Institute for Interdisciplinary Information Sciences Tsinghua University Beijing, China 100084 qmd14@mails.tsinghua.edu.cn Abstract We consider a collaborative PAC learning model, in which k players attempt to learn the same underlying concept. We ask how much more information is required to learn an accurate classifier for all players simultaneously. We refer to the ratio between the sample complexity of collaborative PAC learning and its non-collaborative (single-player) counterpart as the overhead. We design learning algorithms with O(ln(k)) and O(ln2(k)) overhead in the personalized and centralized variants our model. This gives an exponential improvement upon the naïve algorithm that does not share information among players. We complement our upper bounds with an Ω(ln(k)) overhead lower bound, showing that our results are tight up to a logarithmic factor. 1 Introduction According to Wikipedia, collaborative learning is a “situation in which two or more people learn ... something together,” e.g., by “capitalizing on one another’s resources” and “asking one another for information.” Indeed, it seems self-evident that collaboration, and the sharing of information, can make learning more efficient. Our goal is to formalize this intuition and study its implications. As an example, suppose k branches of a department store, which have sales data for different items in different locations, wish to collaborate on learning which items should be sold at each location. In this case, we would like to use the sales information across different branches to learn a good policy for each branch. Another example is given by k hospitals with different patient demographics, e.g., in terms of racial or socio-economic factors, which want to predict occurrence of a disease in patients. In addition to requiring a classifier that performs well on the population served by each hospital, it is natural to assume that all hospitals deploy a common classifier. Motivated by these examples, we consider a model of collaborative PAC learning, in which k players attempt to learn the same underlying concept. We then ask how much information is needed for all players to simultaneously succeed in learning a desirable classifier. Specifically, we focus on the classic probably approximately correct (PAC) setting of Valiant [14], where there is an unknown target function f ∗∈F. We consider k players with distributions D1, . . . , Dk that are labeled according to f ∗. Our goal is to learn f ∗up to an error of ϵ on each and every player distribution while requiring only a small number of samples overall. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. A natural but naïve algorithm that forgoes collaboration between players can achieve our objective by taking, from each player distribution, a number of samples that is sufficient for learning the individual task, and then training a classifier over all samples. Such an algorithm uses k times as many samples as needed for learning an individual task — we say that this algorithm incurs O(k) overhead in sample complexity. By contrast, we are interested in algorithms that take advantage of the collaborative environment, learn k tasks by sharing information, and incur o(k) overhead in sample complexity. We study two variants of the aforementioned model: personalized and centralized. In the personalized setting (as in the department store example), we allow the learning algorithm to return different functions for different players. That is, our goal is to return classifiers f1, . . . , fk that have error of at most ϵ on player distributions D1, . . . , Dk, respectively. In the centralized setting (as in the hospital example), the learning algorithm is required to return a single classifier f that has an error of at most ϵ on all player distributions D1, . . . , Dk. Our results provide upper and lower bounds on the sample complexity overhead required for learning in both settings. 1.1 Overview of Results In Section 3, we provide algorithms for personalized and centralized collaborative learning that obtain exponential improvements over the sample complexity of the naïve approach. In Theorem 3.1, we introduce an algorithm for the personalized setting that has O(ln(k)) overhead in sample complexity. For the centralized setting, in Theorem 3.2, we develop an algorithm that has O(ln2(k)) overhead in sample complexity. At a high level, the latter algorithm first learns a series of functions on adaptively chosen mixtures of player distributions. These mixtures are chosen such that for any player a large majority of the functions perform well. This allows us to combine all functions into one classifier that performs well on every player distribution. Our algorithm is an improper learning algorithm, as the combination of these functions may not belong to F. In Section 4, we present lower bounds on the sample complexity of collaborative PAC learning for the personalized and centralized variants. In particular, in Theorem 4.1 we show that any algorithm that learns in the collaborative setting requires Ω(ln(k)) overhead in sample complexity. This shows that our upper bound for the personalized setting, as stated in Theorem 3.1, is tight. Furthermore, in Theorem 4.5, we show that obtaining uniform convergence across F over all k player distributions requires Ω(k) overhead in sample complexity. Interestingly, our centralized algorithm (Theorem 3.2) bypasses this lower bound by using arguments that do not depend on uniform convergence. Indeed, this can be seen from the fact that it is an improper learning algorithm. In Appendix D, we discuss the extension of our results to the non-realizable setting. Specifically, we consider a setting where there is a “good” but not “perfect” target function f ∗∈F that has a small error with respect to every player distribution, and prove that our upper bounds carry over. 1.2 Related Work Related work in computational and statistical learning has examined some aspects of the general problem of learning multiple related tasks simultaneously. Below we discuss papers on multi-task learning [4, 3, 7, 5, 10, 13], domain adaptation [11, 12, 6], and distributed learning [2, 8, 15], which are most closely related. Multi-task learning considers the problem of learning multiple tasks in series or in parallel. In this space, Baxter [4] studied the problem of model selection for learning multiple related tasks. In their work, each learning task is itself randomly drawn from a distribution over related tasks, and the learner’s goal is to find a hypothesis space that is appropriate for learning all tasks. Ben-David and Schuller [5] also studied the sample complexity of learning multiple related tasks. However, in their work similarity between two tasks is represented by existence of “transfer” functions though which underlying distributions are related. Mansour et al. [11, 12] consider a multi-source domain adaptation problem, where the learner is given k distributions and k corresponding predictors that have error at most ϵ on individual distributions. The goal of the learner is to combine these predictors to obtain error of kϵ on any unknown mixture of player distributions. Our work is incomparable to this line of work, as our goal is to learn classifiers, rather than combining existing ones, and our benchmark is to obtain error ϵ on each individual distribution. Indeed, in our setting one can learn a hypothesis that has error kϵ on any mixture of players with no overhead in sample complexity. 2 Distributed learning [2, 8, 15] also considers the problem of learning from k different distributions simultaneously. However, the main objective in this space is to learn with limited communication between the players, rather than with low sample complexity. 2 Model Let X be an instance space and Y = {0, 1} be the set of labels. A hypothesis is a function f : X →Y that maps any instance x ∈X to a label y ∈Y. We consider a hypothesis class F with VC dimension d. Given a distribution D over X × Y, the error of a hypothesis f is defined as errD(f) = Pr(x,y)∼D [f(x) ̸= y]. In the collaborative learning setting, we consider k players with distributions D1, . . . , Dk over X × Y. We focus on the realizable setting, where all players’ distributions are labeled according to a common target function f ∗∈F, i.e., errDi(f ∗) = 0 for all i ∈[k] (but see Appendix D for an extension to the non-realizable setting). We represent an instance of the collaborative PAC learning setting with the 3-tuple (F, f ∗, {D}i∈[k]). Our goal is to learn a good classifier with respect to every player distribution. We call this (ϵ, δ)learning in the collaborative PAC setting, and study two variants: the personalized setting, and the centralized setting. In the personalized setting, our goal is to learn functions f1, . . . , fk, such that with probability 1 −δ, errDi(fi) ≤ϵ for all i ∈[k]. In the centralized setting, we require all the output functions to be identical. Put another way, our goal is to return a single f, such that with probability 1 −δ, errDi(f) ≤ϵ for all i ∈[k]. In both settings, we allow our algorithm to be improper, that is, the learned functions need not belong to F. We compare the sample complexity of our algorithms to their PAC counterparts in the realizable setting. In the traditional realizable PAC setting, mϵ,δ denotes the number of samples needed for (ϵ, δ)-learning F. That is, mϵ,δ is the total number of samples drawn from a realizable distribution D, such that, with probability 1 −δ, any classifier f ∈F that is consistent with the sample set satisfies errD(f) ≤ϵ. We denote by OF(·) the function that, for any set S of labeled samples, returns a function f ∈F that is consistent with S if such a function exists (and outputs “none” otherwise). It is well-known that sampling a set S of size mϵ,δ = O 1 ϵ d ln 1 ϵ  + ln 1 δ  , and applying OF(S), is sufficient for (ϵ, δ)-learning a hypothesis class F of VC dimension d [1]. We refer to the ratio of the sample complexity of an algorithm in the collaborative PAC setting to that of the (non-collaborative) realizable PAC setting as the overhead. For ease of exposition, we only consider the dependence of the overhead on parameters k, d, and ϵ. 3 Sample Complexity Upper Bounds In this section, we prove upper bounds on the sample complexity of (ϵ, δ)-learning in the collaborative PAC setting. We begin by providing a simple algorithm with O(ln(k)) overhead (in terms of sample complexity, see Section 2) for the personalized setting. We then design and analyze an algorithm for the centralized setting with O(ln2(k)) overhead, following a discussion of additional challenges that arise in this setting. 3.1 Personalized Setting The idea underlying the algorithm for the personalized setting is quite intuitive: If we were to learn a classifier that is on average good for the players, then we have learned a classifier that is good for a large fraction of the players. Therefore, a large fraction of the players can be simultaneously satisfied by a single good global classifier. This process can be repeated until each player receives a good classifier. In more detail, let us consider an algorithm that pools together a sample set of total size mϵ/4,δ from the uniform mixture D = 1 k P i∈[k] Di over individual player distributions, and finds f ∈F that is consistent with this set. Clearly, with probability 1 −δ, f has a small error of ϵ/4 with respect to distribution D. However, we would like to understand how well f performs on each individual player’s distribution. Since errD(f) ≤ϵ/4 is also the average error of f on player distributions, with probability 1 −δ, f must have error of at most ϵ/2 on at least half of the players. Indeed, one can identify such players by taking additional ˜O( 1 ϵ ) samples from each player and asking whether the empirical error of f on these sample sets is at most 3ϵ/4. Using a variant of the VC theorem, it is not hard to see that 3 for any player i such that errDi(f) ≤ϵ/2, the empirical error of f is at most 3ϵ/4, and no player with empirical error at most 3ϵ/4 has true error that is worst than ϵ. Once players with empirical error 3ϵ/4 are identified, one can output fi = f for any such player, and repeat the procedure for the remaining players. After log(k) rounds, this process terminates with all players having received functions with error of at most ϵ on their respective distributions, with probability 1 −log(k)δ. We formalize the above discussion via Algorithm 1 and Theorem 3.1. For completeness, a more rigorous proof of the theorem is given in Appendix A. Algorithm 1 PERSONALIZED LEARNING N1 ←[k]; δ′ ←δ/2 log(k); for r = 1, . . . , ⌈log(k)⌉do ˜Dr ← 1 |Nr| P i∈Nr Di; Let S be a sample of size mϵ/4,δ′ drawn from ˜Dr, and f (r) ←OF(S); Let Gr ←TEST(f (r), Nr, ϵ, δ′); Nr+1 ←Nr \ Gr; for i ∈Gr do fi ←f (r); end return f1, . . . , fk TEST(f, N, ϵ, δ): for i ∈N do take sample set Ti of size O  1 ϵ ln  |N| ϵδ  from Di ; return {i | errTi(f) ≤3 4ϵ} Theorem 3.1. For any ϵ, δ > 0, and hypothesis class F of VC dimension d, Algorithm 1 (ϵ, δ)-learns F in the personalized collaborative PAC setting using m samples, where m = O ln(k) ϵ  (d + k) ln 1 ϵ  + k ln k δ  . Note that Algorithm 1 has O(ln(k)) overhead when k = O(d). 3.2 Centralized Setting We next present a learning algorithm with O(ln2(k)) overhead in the centralized setting. Recall that our goal is to learn a single function f that has an error of ϵ on every player distribution, as opposed to the personalized setting where players can receive different functions. A natural first attempt at learning in the centralized setting is to combine the classifiers f1, . . . , fk that we learned in the personalized setting (Algorithm 1), say, through a weighted majority vote. One challenge with this approach is that, in general, it is possible that many of the functions fj perform poorly on the distribution of a different player i. The reason is that when Algorithm 1 finds a suitable f (r) for players in Gr, it completely removes them from consideration for future rounds; subsequent functions may perform poorly with respect to the distributions associated with those players. Therefore, this approach may lead to a global classifier with large error on some player distributions. To overcome this problem, we instead design an algorithm that continues to take additional samples from players for whom we have already found suitable classifiers. The key idea behind the centralized learning algorithm is to group the players at every round based on how many functions learned so far have large error rates on those players’ distributions, and to learn from data sampled from all the groups simultaneously. This ensures that the function learned in each round performs well on a large fraction of the players in each group, thereby reducing the likelihood that in later stages of this process a player appears in a group for which a large fraction of the functions perform poorly. In more detail, our algorithm learns t = Θ(ln(k)) classifiers f (1), f (2), . . . , f (t), such that for any player i ∈[k], at least 0.6t functions among them achieve an error below ϵ′ = ϵ/6 on Di. The algorithm then returns the classifier maj({f (r)}t r=1), where, for a set of hypotheses F, maj(F) denotes the classifier that, given x ∈X, returns the label that the majority of hypotheses in F assign to x. Note that any instance that is mislabeled by this classifier must be mislabeled by at least 0.1t 4 functions among the 0.6t good functions, i.e., 1/6 of the good functions. Hence, maj({f (r)}t r=1) has an error of at most 6ϵ′ = ϵ on each distribution Di. Throughout the algorithm, we keep track of counters α(r) i for any round r ∈[t] and player i ∈[k], which, roughly speaking, record the number of classifiers among f (1), f (2), . . . , f (r) that have an error of more than ϵ′ on distribution Di. To learn f (r+1), we first group distributions D1, . . . , Dk based on the values of α(r) i , draw about mϵ′,δ samples from the mixture of the distributions in each group, and return a function f (r+1) that is consistent with all of the samples. Similarly to Section 3.1, one can show that f (r+1) achieves O(ϵ′) error with respect to a large fraction of player distributions in each group. Consequently, the counters are increased, i.e., α(r+1) i > α(r) i , only for a small fraction of players. Finally, we show that with high probability, α(t) i ≤0.4t for any player i ∈[k], i.e., on each distribution Di, at least 0.6t functions achieve error of at most ϵ′. The algorithm is formally described in Algorithm 2. The next theorem states our sample complexity upper bound for the centralized setting. Algorithm 2 CENTRALIZED LEARNING α(0) i ←0 for each i ∈[k]; t ← l 5 2 log8/7(k) m ; ϵ′ ←ϵ/6; N (0) 0 ←[k]; N (0) c ←∅for each c ∈[t]; for r = 1, 2, . . . , t do for c = 0, 1, . . . , t −1 do if N (r−1) c ̸= ∅then Draw a sample set S(r) c of size mϵ′/16,δ/(2t2) from eD(r−1) c = 1 |N (r−1) c | P i∈N (r−1) c Di; else S(r) c ←∅; end f (r) ←OF St−1 c=0 S(r) c  ; Gr ←TEST(f (r), [k], ϵ′, δ/(2t)); for i = 1, . . . , k do α(r) i ←α(r−1) i + I [i /∈Gr]; for c = 0, . . . , t do N (r) c ←{i ∈[k] : α(r) i = c}; end return maj({f (r)}t r=1); Theorem 3.2. For any ϵ, δ > 0, and hypothesis class F of VC dimension d, Algorithm 2 (ϵ, δ)-learns F in the centralized collaborative PAC setting using m samples, where m = O ln2(k) ϵ  (d + k) ln 1 ϵ  + k ln 1 δ  . In particular, Algorithm 2 has O(ln2(k)) overhead when k = O(d). Turning to the theorem’s proof, note that in Algorithm 2, N (r−1) c represents the set of players for whom c out of the r −1 functions learned so far have a large error, and eD(r−1) c represents the mixture of distribution of players in N (r−1) c . Moreover, Gr is the set of players for whom f (r) has a small error. The following lemma, whose proof appears in Appendix B.1, shows that with high probability each function f (r) has a small error on eD(r−1) c for all c. Here and in the following, t stands for l 5 2 log8/7(k) m as in Algorithm 2. Lemma 3.3. With probability 1 −δ, the following two properties hold for all r ∈[t]: 1. For any c ∈{0, . . . , t −1} such that N (r−1) c is non-empty, err e D(r−1) c (f (r)) ≤ϵ′/16. 2. For any i ∈Gr, errDi(f (r)) ≤ϵ′, and for any i /∈Gr, errDi(f (r)) > ϵ′/2. 5 The next lemma gives an upper bound on |N (r) c | — the number of players for whom c out of the r learned functions have a large error. Lemma 3.4. With probability 1 −δ, for any r, c ∈{0, . . . , t}, we have |N (r) c | ≤ r c  · k 8c . Proof. Let nr,c = |N (r) c | = |{i ∈[k] : α(r) i = c}| be the number of players for whom c functions in f (1), . . . , f (r) do not have a small error. We note that n0,0 = k and n0,c = 0 for c ∈{1, . . . , t}. The next technical claim, whose proof appears in Appendix B.2, asserts that to prove this lemma, it is sufficient to show that for any r ∈{1, . . . , t} and c ∈{0, . . . , t}, nr,c ≤nr−1,c + 1 8nr−1,c−1. Here we assume that nr−1,−1 = 0. Claim 3.5. Suppose that n0,0 = k, n0,c = 0 for c ∈{1, . . . , t}, and nr,c ≤nr−1,c + 1 8nr−1,c−1 holds for any r ∈{1, . . . , t} and c ∈{0, . . . , t}. Then for any r, c ∈{0, . . . , t}, nr,c ≤ r c  · k 8c . By definition of α(r) c , N (r) c , and nr,c, we have nr,c = {i ∈[k] : α(r) i = c} ≤ {i ∈[k] : α(r−1) i = c} + {i ∈[k] : α(r−1) i = c −1 ∧i /∈Gr} =nr−1,c + N (r−1) c−1 \ Gr . It remains to show that |N (r−1) c−1 \ Gr| ≤ 1 8nr−1,c−1. Recall that eD(r−1) c−1 is the mixture of all distributions in N (r−1) c−1 . By Lemma 3.3, with probability 1−δ, err e D(r−1) c−1 (f (r)) < ϵ′/16. Put another way, P i∈N (r−1) c−1 errDi(f (r)) < ϵ′ 16 · |N (r−1) c−1 |. Thus, at most 1 8|N (r−1) c−1 | players i ∈N (r−1) c−1 can have errDi(f (r)) > ϵ′/2. Moreover, by Lemma 3.3, for any i /∈Gr, we have that errDi(f (r)) > ϵ′/2. Therefore, N (r−1) c−1 \ Gr ≤ {i ∈N (r−1) c−1 : errDi(f (r)) > ϵ′/2} ≤1 8 N (r−1) c−1 = 1 8nr−1,c−1. This completes the proof. We now prove Theorem 3.2 using Lemma 3.4. Proof of Theorem 3.2. We first show that, with high probability, for any i ∈[k], at most 0.4t functions among f (1), . . . , f (t) have error greater than ϵ′, i.e., α(t) i < 0.4t for all i ∈[k]. Note that by our choice of t = l 5 2 log8/7(k) m , we have (8/7)0.4t ≥k. By Lemma 3.4 and an upper bound on binomial coefficients, with probability 1 −δ, for any integer c ∈[0.4t, t], |N (t) c | ≤ t c  · k 8c < et c c · k 8c < k (8/7)c ≤1, which implies that N (t) c = ∅. Therefore, with probability 1 −δ, α(t) i < 0.4t for all i ∈[k]. Next, we prove that f = maj({f (r)}t r=1) has error at most ϵ on every player distribution. Consider distribution Di of player i. By definition, t −α(t) i functions have error at most ϵ′ on Di. We refer to these functions as “good” functions. Note that for any instance x that is mislabeled by f, at least 0.5t −α(t) i good functions must make a wrong prediction. Therefore, (t −α(t) i )ϵ′ ≥ (0.5t −α(t) i ) · errDi(f). Moreover, with probability 1 −δ, α(t) i < 0.4t for all i ∈[k]. Hence, errDi(f) ≤ t −α(t) i 0.5t −α(t) i ϵ′ ≤0.6t 0.1tϵ′ ≤ϵ, with probability 1 −δ. This proves that Algorithm 2 (ϵ, δ)-learns F in the centralized collaborative PAC setting. 6 Finally, we bound the sample complexity of Algorithm 2. Recall that t = Θ(ln(k)) and ϵ′ = ϵ/6. At each iteration of Algorithm 2, we draw total of t · mϵ′/16,δ/(4t2) samples from t mixtures. Therefore, over t time steps, we draw a total of t2 · mϵ′/16,δ/(4t2) = O ln2(k) ϵ ·  d ln 1 ϵ  + ln 1 δ  + ln ln(k)  samples for learning f (1), . . . , f (t). Moreover, the total number samples requested for subroutine TEST(f (r), [k], ϵ′, δ/(4t)) for r = 1 . . . , t is O tk ϵ · ln  k ϵδ  = O ln(k) ϵ ·  k ln 1 ϵ  + k ln 1 δ  + ln2(k) ϵ k  . We conclude that the total sample complexity is O ln2(k) ϵ  (d + k) ln 1 ϵ  + k ln 1 δ  . We remark that Algorithm 2 is inspired by the classic boosting scheme. Indeed, an algorithm that is directly adapted from boosting attains a similar performance guarantee as in Theorem 3.2. The algorithm assigns a uniform weight to each player, and learns a classifier with O(ϵ) error on the mixture distribution. Then, depending on whether the function achieves an O(ϵ) error on each distribution, the algorithm updates the players’ weights, and learns the next classifier from the weighted mixture of all distributions. An analysis similar to that of AdaBoost [9] shows that the majority vote of all the classifiers learned over Θ(ln(k)) iterations of the above procedure achieves a small error on every distribution. Similar to Algorithm 2, this algorithm achieves an O(ln2(k)) overhead for the centralized setting. 4 Sample Complexity Lower Bounds In this section, we present lower bounds on the sample complexity of collaborative PAC learning. In Section 4.1, we show that any learning algorithm for the collaborative PAC setting incurs Ω(log(k)) overhead in terms of sample complexity. In Section 4.2, we consider the sample complexity required for obtaining uniform convergence across F in the collaborative PAC setting. We show that Ω(k) overhead is necessary to obtain such results. 4.1 Tight Lower Bound for the Personalized Setting We now turn to establishing the Ω(log(k)) lower bound mentioned above. This lower bound implies the tightness of the O(log(k)) overhead upper bound obtained by Theorem 3.1 in the personalized setting. Moreover, the O(log2(k)) overhead obtained by Theorem 3.2 in the centralized setting is nearly tight, up to a log(k) multiplicative factor. Formally, we prove the following theorem. Theorem 4.1. For any k ∈N, ϵ, δ ∈(0, 0.1), and (ϵ, δ)-learning algorithm A in the collaborative PAC setting, there exist an instance with k players, and a hypothesis class of VC-dimension k, on which A requires at least 3k ln[9k/(10δ)]/(20ϵ) samples in expectation. Hard instance distribution. We show that for any k ∈N and ϵ, δ ∈(0, 0.1), there is a distribution Dk,ϵ of “hard” instances, each with k players and a hypothesis class with VC-dimension k, such that any (ϵ, δ)-learning algorithm A requires Ω(k log(k)/ϵ) samples in expectation on a random instance drawn from the distribution, even in the personalized setting. This directly implies Theorem 4.1, since A must take Ω(k log(k)/ϵ) samples on some instance in the support of Dk,ϵ. We define Dk,ϵ as follows: • Instance space: Xk = {1, 2, . . . , k, ⊥}. • Hypothesis class: Fk is the collection of all binary functions on Xk that map ⊥to 0. • Target function: f ∗is chosen from Fk uniformly at random. • Players’ distributions: The distribution Di of player i is either a degenerate distribution that assigns probability 1 to ⊥, or a Bernoulli distribution on {i, ⊥} with Di(i) = 2ϵ and Di(⊥) = 1 −2ϵ. Di is chosen from these two distributions independently and uniformly at random. 7 Note that the VC-dimension of Fk is k. Moreover, on any instance in the support of Dk,ϵ, learning in the personalized setting is equivalent to learning in the centralized setting. This is due to the fact that given functions f1, f2, . . . , fk for the personalized setting, where fi is the function assigned to player i, we can combine these functions into a single function f ∈Fk for the centralized setting by defining f(⊥) = 0 and f(i) = fi(i) for all i ∈[k]. Then, errDi(f) ≤errDi(fi) for all i ∈[k].1 Therefore, without loss of generality we focus below on the centralized setting. Lower bound for k = 1. As a building block in our proof of Theorem 4.1, we establish a lower bound for the special case of k = 1. For brevity, let Dϵ denote the instance distribution D1,ϵ. We say that A is an (ϵ, δ)-learning algorithm for the instance distribution Dϵ if and only if on any instance in the support of Dϵ, with probability at least 1 −δ, A outputs a function f with error below ϵ. The following lemma, proved in Appendix C, states that any (ϵ, δ)-learning algorithm for Dϵ takes Ω(log(1/δ)/ϵ) samples on a random instance drawn from Dϵ.2 Lemma 4.2. For any ϵ, δ ∈(0, 0.1) and (ϵ, δ)-learning algorithm A for Dϵ, A takes at least ln(1/δ)/(6ϵ) samples in expectation on a random instance drawn from Dϵ. Here the expectation is taken over both the randomness in the samples and the randomness in drawing the instance from Dϵ. Now we prove Theorem 4.1 by Lemma 4.2 and a reduction from a random instance sampled from Dϵ to instances sampled from Dk,ϵ. Intuitively, a random instance drawn from Dk,ϵ is equivalent to k independent instances from Dϵ. We show that any learning algorithm A that simultaneously solves k tasks (i.e., an instance from Dk,ϵ) with probability 1 −δ can be transformed into an algorithm A′ that solves a single task (i.e., an instance from Dϵ) with probability 1 −O(δ/k). Moreover, the expected sample complexity of A′ is only an O(1/k) fraction of the complexity of A. This transformation, together with Lemma 4.2, gives a lower bound on the sample complexity of A. Proof Sketch of Theorem 4.1. We construct an algorithm A′ for the instance distribution Dϵ from an algorithm A that (ϵ, δ)-learns in the centralized setting. Recall that on an instance drawn from Dϵ, A′ has access to a distribution D, i.e., the single player’s distribution. • A′ generates an instance (Fk, f ∗, {Di}i∈[k]) from the distribution Dk,ϵ (specifically, A′ knows the target function f ∗and the distributions), and then chooses l ∈[k] uniformly at random. • A′ simulates A on instance (Fk, f ∗, {Di}i∈[k]), with Dl replaced by the distribution D. Specifically, every time A draws a sample from Dj for some j ̸= l, A′ samples Dj and forwards the sample to A. When A asks for a sample from Dl, A′ samples the distribution D instead and replies to A accordingly, i.e., A′ returns l, together with the label, if the sample is 1 (recall that X1 = {1, ⊥}), and returns ⊥otherwise. • Finally, when A terminates and returns a function f on Xk, A′ checks whether errDj(f) < ϵ for every j ̸= l. If so, A′ returns the function f ′ defined as f ′(1) = f(l) and f ′(⊥) = f(⊥). Otherwise, A′ repeats the simulation process on a new instance drawn from Dk,ϵ. Let mi be the expected number of samples drawn from the i-th distribution when A runs on an instance drawn from Dk,ϵ. We have the following two claims, whose proofs are relegated to Appendix C. Claim 4.3. A′ is an (ϵ, 10δ/(9k))-learning algorithm for Dϵ. Claim 4.4. A′ takes at most 10/(9k) Pk i=1 mi samples in expectation. Applying Lemma 4.2 to A′ gives Pk i=1 mi ≥3k ln[9k/(10δ)] 20ϵ , which proves Theorem 4.1. 4.2 Lower Bound for Uniform Convergence We next examine the sample complexity required for obtaining uniform convergence across the hypothesis class F in the centralized collaborative PAC setting, and establish an overhead lower bound of Ω(k). Interestingly, our centralized learning algorithm (Algorithm 2) achieves O(log2(k)) overhead — it circumvents the lower bound by not relying on uniform convergence. 1In fact, when fi ∈Fk, errDi(f) = errDi(fi) for all i ∈[k]. 2 Here we only assume that A is correct for instances in the support of Dϵ, rather than being correct on every instance. 8 To be more formal, we first need to define uniform convergence in the cooperative PAC learning setting. We say that a hypothesis class F has the uniform convergence property with sample size m(k) ϵ,δ if for any k distributions D1, . . . , Dk, there exist integers m1, . . . , mk that sum up to m(k) ϵ,δ , such that when mi samples are drawn from Di for each i ∈[k], with probability 1 −δ, any function in F that is consistent with all the m(k) ϵ,δ samples achieves error at most ϵ on every distribution Di. Note that the foregoing definition is a relatively weak adaptation of uniform convergence to the cooperative setting, as the integers mi are allowed to depend on the distributions Di. But this observation only strengthens our lower bound, which holds despite the weak requirement. Theorem 4.5. For any k, d ∈N and (ϵ, δ) ∈(0, 0.1), there exists a hypothesis class F of VCdimension d, such that m(k) ϵ,δ ≥dk(1 −δ)/(4ϵ). Proof Sketch of Theorem 4.5. Fix k, d ∈N and ϵ, δ ∈(0, 0.1). We define instance (F, f ∗, {Di}k i=1) as follows. The instance space is X = ([k]×[d])∪{⊥}, and the hypothesis class F contains all binary functions on X that map ⊥to 0 and take value 1 on at most d points. The target function f ∗maps every element in X to 0. Finally, the distribution of each player i ∈[k] is given by Di((i, j)) = 2ϵ/d for any j ∈[d] and Di(⊥) = 1 −2ϵ. Note that if a sample set contains strictly less than d/2 elements in {(i∗, 1), (i∗, 2), . . . , (i∗, d)} for some i∗, there is a consistent function in F with error strictly greater than ϵ on Di∗, namely, the function that maps (i, j) to 1 if and only if i = i∗and (i∗, j) is not in the sample set. Therefore, to achieve uniform convergence, at least d/2 elements from X \ {⊥} must be drawn from each distribution. Since the probability that each sample is different from ⊥is 2ϵ, drawing d/2 such samples from k distribution requires Ω(dk/ϵ) samples. A complete proof of Theorem 4.5 appears in Appendix C. Acknowledgments We thank the anonymous reviewers for their helpful remarks and suggesting an alternative boostingbased approach for the centralized setting. This work was partially supported by the NSF grants CCF-1525971, CCF-1536967, CCF-1331175, IIS-1350598, IIS-1714140, CCF-1525932, and CCF1733556, Office of Naval Research grants N00014-16-1-3075 and N00014-17-1-2428, a Sloan Research Fellowship, and a Microsoft Research Ph.D. fellowship. This work was done while Avrim Blum was working at Carnegie Mellon University. References [1] M. Anthony and P. L. Bartlett. Neural Network Learning: Theoretical Foundations. Cambridge University Press, 1999. [2] Maria Florina Balcan, Avrim Blum, Shai Fine, and Yishay Mansour. Distributed learning, communication complexity and privacy. In Proceedings of the 25th Conference on Computational Learning Theory (COLT), pages 26.1–26.22, 2012. [3] Jonathan Baxter. A Bayesian/information theoretic model of learning to learn via multiple task sampling. Machine learning, 28(1):7–39, 1997. [4] Jonathan Baxter. A model of inductive bias learning. Journal of Artificial Intelligence Research, 12:149–198, 2000. [5] Shai Ben-David and Reba Schuller. Exploiting task relatedness for mulitple task learning. In Proceedings of the 16th Conference on Computational Learning Theory (COLT), pages 567–580, 2003. [6] Shai Ben-David, John Blitzer, Koby Crammer, Alex Kulesza, Fernando Pereira, and Jennifer Wortman Vaughan. A theory of learning from different domains. Machine learning, 79(1): 151–175, 2010. [7] Rich Caruana. Multitask learning. Machine Learning, 28(1):41–75, 1997. 9 [8] Ofer Dekel, Ran Gilad-Bachrach, Ohad Shamir, and Lin Xiao. Optimal distributed online prediction. In Proceedings of the 28th International Conference on Machine Learning (ICML), pages 713–720, 2011. [9] Yoav Freund and Robert E Schapire. A desicion-theoretic generalization of on-line learning and an application to boosting. In Proceedings of the 2nd European Conference on Computational Learning Theory (EuroCOLT), pages 23–37, 1995. [10] Abhishek Kumar and Hal Daumé III. Learning task grouping and overlap in multi-task learning. In Proceedings of the 29th International Conference on Machine Learning (ICML), pages 1103–1110, 2012. [11] Yishay Mansour, Mehryar Mohri, and Afshin Rostamizadeh. Domain adaptation: Learning bounds and algorithms. In Proceedings of the 22nd Conference on Computational Learning Theory (COLT), pages 19–30, 2009. [12] Yishay Mansour, Mehryar Mohri, and Afshin Rostamizadeh. Domain adaptation with multiple sources. In Proceedings of the 23rd Annual Conference on Neural Information Processing Systems (NIPS), pages 1041–1048, 2009. [13] Massimiliano Pontil and Andreas Maurer. Excess risk bounds for multitask learning with trace norm regularization. In Proceedings of the 26th Conference on Computational Learning Theory (COLT), pages 55–76, 2013. [14] Leslie G. Valiant. A theory of the learnable. Communications of the ACM, 27(11):1134–1142, 1984. [15] Jialei Wang, Mladen Kolar, and Nathan Srerbo. Distributed multi-task learning. In Proceedings of the 19th International Conference on Artificial Intelligence and Statistics (AISTATS), pages 751–760, 2016. 10
2017
68
7,207
Polynomial time algorithms for dual volume sampling Chengtao Li MIT ctli@mit.edu Stefanie Jegelka MIT stefje@csail.mit.edu Suvrit Sra MIT suvrit@mit.edu Abstract We study dual volume sampling, a method for selecting k columns from an n ⇥m short and wide matrix (n k m) such that the probability of selection is proportional to the volume spanned by the rows of the induced submatrix. This method was proposed by Avron and Boutsidis (2013), who showed it to be a promising method for column subset selection and its multiple applications. However, its wider adoption has been hampered by the lack of polynomial time sampling algorithms. We remove this hindrance by developing an exact (randomized) polynomial time sampling algorithm as well as its derandomization. Thereafter, we study dual volume sampling via the theory of real stable polynomials and prove that its distribution satisfies the “Strong Rayleigh” property. This result has numerous consequences, including a provably fast-mixing Markov chain sampler that makes dual volume sampling much more attractive to practitioners. This sampler is closely related to classical algorithms for popular experimental design methods that are to date lacking theoretical analysis but are known to empirically work well. 1 Introduction A variety of applications share the core task of selecting a subset of columns from a short, wide matrix A with n rows and m > n columns. The criteria for selecting these columns typically aim at preserving information about the span of A while generating a well-conditioned submatrix. Classical and recent examples include experimental design, where we select observations or experiments [38]; preconditioning for solving linear systems and constructing low-stretch spanning trees (here A is a version of the node-edge incidence matrix and we select edges in a graph) [6, 4]; matrix approximation [11, 13, 24]; feature selection in k-means clustering [10, 12]; sensor selection [25] and graph signal processing [14, 41]. In this work, we study a randomized approach that holds promise for all of these applications. This approach relies on sampling columns of A according to a probability distribution defined over its submatrices: the probability of selecting a set S of k columns from A, with n k m, is P(S; A) / det(ASA> S ), (1.1) where AS is the submatrix consisting of the selected columns. This distribution is reminiscent of volume sampling, where k < n columns are selected with probability proportional to the determinant det(A> S AS) of a k ⇥k matrix, i.e., the squared volume of the parallelepiped spanned by the selected columns. (Volume sampling does not apply to k > n as the involved determinants vanish.) In contrast, P(S; A) uses the determinant of an n ⇥n matrix and uses the volume spanned by the rows formed by the selected columns. Hence we refer to P(S; A)-sampling as dual volume sampling (DVS). Contributions. Despite the ostensible similarity between volume sampling and DVS, and despite the many practical implications of DVS outlined below, efficient algorithms for DVS are not known and were raised as open questions in [6]. In this work, we make two key contributions: – We develop polynomial-time randomized sampling algorithms and their derandomization for DVS. Surprisingly, our proofs require only elementary (but involved) matrix manipulations. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. – We establish that P(S; A) is a Strongly Rayleigh measure [8], a remarkable property that captures a specific form of negative dependence. Our proof relies on the theory of real stable polynomials, and the ensuing result implies a provably fast-mixing, practical MCMC sampler. Moreover, this result implies concentration properties for dual volume sampling. In parallel with our work, [16] also proposed a polynomial time sampling algorithm that works efficiently in practice. Our work goes on to further uncover the hitherto unknown “Strong Rayleigh” property of DVS, which has important consequences, including those noted above. 1.1 Connections and implications. The selection of k ≥n columns from a short and wide matrix has many applications. Our algorithms for DVS hence have several implications and connections; we note a few below. Experimental design. The theory of optimal experiment design explores several criteria for selecting the set of columns (experiments) S. Popular choices are S 2 argminS✓{1,...,m}J(AS), with J(AS) = kA† SkF = k(ASA> S )−1kF (A-optimal design) , J(AS) = kA† Sk2 (E-optimal design) , J(AS) = −log det(ASA> S ) (D-optimal design). (1.2) Here, A† denotes the Moore-Penrose pseudoinverse of A, and the minimization ranges over all S such that AS has full row rank n. A-optimal design, for instance, is statistically optimal for linear regression [38]. Finding an optimal solution for these design problems is NP-hard; and most discrete algorithms use local search [33]. Avron and Boutsidis [6, Theorem 3.1] show that dual volume sampling yields an approximation guarantee for both A- and E-optimal design: if S is sampled from P(S; A), then E h kA† Sk2 F i m −n + 1 k −n + 1 kA†k2 F ; E h kA† Sk2 2 i  ✓ 1 + n(m −k) k −n + 1 ◆ kA†k2 2. (1.3) Avron and Boutsidis [6] provide a polynomial time sampling algorithm only for the case k = n. Our algorithms achieve the bound (1.3) in expectation, and the derandomization in Section 2.3 achieves the bound deterministically. Wang et al. [43] recently (in parallel) achieved approximation bounds for A-optimality via a different algorithm combining convex relaxation and a greedy method. Other methods include leverage score sampling [30] and predictive length sampling [45]. Low-stretch spanning trees and applications. Objectives 1.2 also arise in the construction of low-stretch spanning trees, which have important applications in graph sparsification, preconditioning and solving symmetric diagonally dominant (SDD) linear systems [40], among others [18]. In the node-edge incidence matrix ⇧2 Rn⇥m of an undirected graph G with n nodes and m edges, the column corresponding to edge (u, v) is p w(u, v)(eu −ev). Let ⇧= U⌃Y be the SVD of ⇧with Y 2 Rn−1⇥m. The stretch of a spanning tree T in G is then given by StT (G) = kY −1 T k2 F [6]. In those applications, we hence search for a set of edges with low stretch. Network controllability. The problem of sampling k ≥n columns in a matrix also arises in network controllability. For example, Zhao et al. [44] consider selecting control nodes S (under certain constraints) over time in complex networks to control a linear time-invariant network. After transforming the problem into a column subset selection problem from a short and wide controllability matrix, the objective becomes essentially an E-optimal design problem, for which the authors use greedy heuristics. Notation. From a matrix A 2 Rn⇥m with m ≫n columns, we sample a set S ✓[m] of k columns (n k m), where [m] := {1, 2, . . . , m}. We denote the singular values of A by {σi(A)}n i=1, in decreasing order. We will assume A has full row rank r(A) = n, so σn(A) > 0. We also assume that r(AS) = r(A) = n for every S ✓[m] where |S| ≥n. By ek(A), we denote the k-th elementary symmetric polynomial of A, i.e., the k-th coefficient of the characteristic polynomial det(λI −A) = PN j=0(−1)jej(A)λN−j. 2 Polynomial-time Dual Volume Sampling We describe in this section our method to sample from the distribution P(S; A). Our first method relies on the key insight that, as we show, the marginal probabilities for DVS can be computed in polynomial time. To demonstrate this, we begin with the partition function and then derive marginals. 2 2.1 Marginals The partition function has a conveniently simple closed form, which follows from the Cauchy-Binet formula and was also derived in [6]. Lemma 1 (Partition Function [6]). For A 2 Rn⇥m with r(A) = n and n |S| = k m, we have ZA := X |S|=k,S✓[m] det(ASA> S ) = ✓m −n k −n ◆ det(AA>). Next, we will need the marginal probability P(T ✓S; A) = P S:T ✓S P(S; A) that a given set T ✓[m] is a subset of the random set S. In the following theorem, the set Tc = [m] \ T denotes the (set) complement of T, and Q? denotes the orthogonal complement of Q. Theorem 2 (Marginals). Let T ✓[m], |T| k, and " > 0. Let AT = Q⌃V > be the singular value decomposition of AT where Q 2 Rn⇥r(AT ), and Q? 2 Rn⇥(n−r(AT )). Further define the matrices B = (Q?)>ATc 2 R(n−r(AT ))⇥(m−|T |), C = 2 664 1 p σ2 1(AT )+" 0 . . . 0 1 p σ2 2(AT )+" . . . ... ... ... 3 775 Q>ATc 2 Rr(AT )⇥(m−|T |). Let QBdiag(σ2 i (B))Q> B be the eigenvalue decomposition of B>B where QB 2 R|Tc|⇥r(B). Moreover, let W > = ⇥ ITc; C>⇤ and Γ = ek−|T |−r(B)(W((Q? B)>Q? B)W >). Then the marginal probability of T in DVS is P(T ✓S; A) = hQr(AT ) i=1 σ2 i (AT ) i ⇥ hQr(B) j=1 σ2 j (B) i ⇥Γ ZA . We prove Theorem 2 via a perturbation argument that connects DVS to volume sampling. Specifically, observe that for ✏> 0 and |S| ≥n it holds that det(ASA> S + "In) = "n−k det(A> S AS + "Ik) = "n−k det  AS p"(Im)S 3>  AS p"(Im)S 3! . (2.1) Carefully letting ✏! 0 bridges volumes with “dual” volumes. The technical remainder of the proof further relates this equality to singular values, and exploits properties of characteristic polynomials. A similar argument yields an alternative proof of Lemma 1. We show the proofs in detail in Appendix A and B respectively. Complexity. The numerator of P(T ✓S; A) in Theorem 2 requires O(mn2) time to compute the first term, O(mn2) to compute the second and O(m3) to compute the third. The denominator takes O(mn2) time, amounting in a total time of O(m3) to compute the marginal probability. 2.2 Sampling The marginal probabilities derived above directly yield a polynomial-time exact DVS algorithm. Instead of k-sets, we sample ordered k-tuples −! S = (s1, . . . , sk) 2 [m]k. We denote the k-tuple variant of the DVS distribution by −! P (·; A): −! P ((sj = ij)k j=1; A) = 1 k!P({i1, . . . , ik}; A) = Yk j=1 −! P (sj = ij|s1 = i1, . . . , sj−1 = ij−1; A). Sampling −! S is now straightforward. At the jth step we sample sj via −! P (sj = ij|s1 = i1, . . . , sj−1 = ij−1; A); these probabilities are easily obtained from the marginals in Theorem 2. Corollary 3. Let T = {i1, . . . , it−1}, and P(T ✓S; A) as in Theorem 2. Then, −! P (st = i; A|s1 = i1, . . . , st−1 = it−1) = P(T [ {i} ✓S; A) (k −t + 1) P(T ✓S; A). As a result, it is possible to draw an exact dual volume sample in time O(km4). The full proof may be found in the appendix. The running time claim follows since the sampling algorithm invokes O(mk) computations of marginal probabilities, each costing O(m3) time. 3 Remark A potentially more efficient approximate algorithm could be derived by noting the relations between volume sampling and DVS. Specifically, we add a small perturbation to DVS as in Equation 2.1 to transform it into a volume sampling problem, and apply random projection for more efficient volume sampling as in [17]. Please refer to Appendix C for more details. 2.3 Derandomization Next, we derandomize the above sampling algorithm to deterministically select a subset that satisfies the bound (1.3) for the Frobenius norm, thereby answering another question in [6]. The key insight for derandomization is that conditional expectations can be computed in polynomial time, given the marginals in Theorem 2: Corollary 4. Let (i1, . . . , it−1) 2 [m]t−1 be such that the marginal distribution satisfies −! P (s1 = i1, . . . , st−1 = it−1; A) > 0. The conditional expectation can be expressed as E h kA† Sk2 F | s1 = i1, . . . , st−1 = it−1 i = Pn j=1 P 0({i1, . . . , it−1} ✓S|S ⇠P(S; A[n]\{j})) P 0({i1, . . . , it−1} ✓S|S ⇠P(S; A)) , where P 0 are the unnormalized marginal distributions, and it can be computed in O(nm3) time. We show the full derivation in Appendix D. Corollary 4 enables a greedy derandomization procedure. Starting with the empty tuple −! S 0 = ;, in the ith iteration, we greedily select j⇤2 argmaxj E[kA† S[jk2 F | (s1, . . . , si) = −! S i−1 ◦j] and append it to our selection: −! S i = −! S i−1 ◦j. The final set is the non-ordered version Sk of −! S k. Theorem 5 shows that this greedy procedure succeeds, and implies a deterministic version of the bound (1.3). Theorem 5. The greedy derandomization selects a column set S satisfying kA† Sk2 F m −n + 1 k −n + 1 kA†k2 F ; kA† Sk2 2 n(m −n + 1) k −n + 1 kA†k2 2. In the proof, we construct a greedy algorithm. In each iteration, the algorithm computes, for each column that has not yet been selected, the expectation conditioned on this column being included in the current set. Then it chooses the element with the lowest conditional expectation to actually be added to the current set. This greedy inclusion of elements will only decrease the conditional expectation, thus retaining the bound in Theorem 5. The detailed proof is deferred to Appendix E. Complexity. Each iteration of the greedy selection requires O(nm3) to compute O(m) conditional expectations. Thus, the total running time for k iterations is O(knm4). The approximation bound for the spectral norm is slightly worse than that in (1.3), but is of the same order if k = O(n). 3 Strong Rayleigh Property and Fast Markov Chain Sampling Next, we investigate DVS more deeply and discover that it possesses a remarkable structural property, namely, the Strongly Rayleigh (SR) [8] property. This property has proved remarkably fruitful in a variety of recent contexts, including recent progress in approximation algorithms [23], fast sampling [2, 27], graph sparsification [22, 39], extensions to the Kadison-Singer problem [1], and certain concentration of measure results [37], among others. For DVS, the SR property has two major consequences: it leads to a fast mixing practical MCMC sampler, and it implies results on concentration of measure. Strongly Rayleigh measures. SR measures were introduced in the landmark paper of Borcea et al. [8], who develop a rich theory of negatively associated measures. In particular, we say that a probability measure µ : 2[n] ! R+ is negatively associated if R Fdµ R Gdµ ≥ R FGdµ for F, G increasing functions on 2[n] with disjoint support. This property reflects a “repelling” nature of µ, a property that occurs more broadly across probability, combinatorics, physics, and other fields—see [36, 8, 42] and references therein. The negative association property turns out to be quite subtle in general; the class of SR measures captures a strong notion of negative association and provides a framework for analyzing such measures. 4 Specifically, SR measures are defined via their connection to real stable polynomials [36, 8, 42]. A multivariate polynomial f 2 C[z] where z 2 Cm is called real stable if all its coefficients are real and f(z) 6= 0 whenever Im(zi) > 0 for 1 i m. A measure is called an SR measure if its multivariate generating polynomial fµ(z) := P S✓[n] µ(S) Q i2S zi is real stable. Notable examples of SR measures are Determinantal Point Processes [31, 29, 9, 26], balanced matroids [19, 37], Bernoullis conditioned on their sum, among others. It is known (see [8, pg. 523]) that the class of SR measures is exponentially larger than the class of determinantal measures. 3.1 Strong Rayleigh Property of DVS Theorem 6 establishes the SR property for DVS and is the main result of this section. Here and in the following, we use the notation zS = Q i2S zi. Theorem 6. Let A 2 Rn⇥m and n k m. Then the multiaffine polynomial p(z) := X |S|=k,S✓[m] det(ASA> S ) Y i2S zi = X |S|=k,S✓[m] det(ASA> S )zS, (3.1) is real stable. Consequently, P(S; A) is an SR measure. The proof of Theorem 6 relies on key properties of real stable polynomials and SR measures established in [8]. Essentially, the proof demonstrates that the generating polynomial of P(Sc; A) can be obtained by applying a few carefully chosen stability preserving operations to a polynomial that we know to be real stable. Stability, although easily destroyed, is closed under several operations noted in the important proposition below. Proposition 7 (Prop. 2.1 [8]). Let f : Cm ! C be a stable polynomial. The following properties preserve stability: (i) Substitution: f(µ, z2, . . . , zm) for µ 2 R; (ii) Differentiation: @Sf(z1, . . . , zm) for any S ✓[m]; (iii) Diagonalization: f(z, z, z3 . . . , zm) is stable, and hence f(z, z, . . . , z); and (iv) Inversion: z1 · · · znf(z−1 1 , . . . , z−1 n ). In addition, we need the following two propositions for proving Theorem 6. Proposition 8 (Prop. 2.4 [7]). Let B be Hermitian, z 2 Cm and Ai (1 i m) be Hermitian semidefinite matrices. Then, the following polynomial is stable: f(z) := det(B + X i ziAi). (3.2) Proposition 9. For n |S| m and L := A>A, we have det(ASA> S ) = en(LS,S). Proof. Let Y = Diag([yi]m i=1) be a diagonal matrix. Using the Cauchy-Binet identity we have det(AY A>) = X |T |=n,T ✓[m] det((AY ):,T ) det((A>)T,:) = X |T |=n,T ✓[m] det(A> T AT )yT . Thus, when Y = IS, the (diagonal) indicator matrix for S, we obtain AY A> = ASA> S . Consequently, in the summation above only terms with T ✓S survive, yielding det(ASA> S ) = X |T |=n,T ✓S det(A> T AT ) = X |T |=n,T ✓S det(LT,T ) = en(LS,S). We are now ready to sketch the proof of Theorem 6. Proof. (Theorem 6). Notationally, it is more convenient to prove that the “complement” polynomial pc(z) := P |S|=k,S✓[m] det(ASA> S )zSc is stable; subsequently, an application of Prop. 7-(iv) yields stability of (3.1). Using matrix notation W = Diag(w1, . . . , wm), Z = Diag(z1, . . . , zm), our starting stable polynomial (this stability follows from Prop. 8) is h(z, w) := det(L + W + Z), w 2 Cm, z 2 Cm, which can be expanded as h(z, w) = X S✓[m] det(WS + LS)zSc = X S✓[m] ⇣X T ✓S wS\T det(LT,T ) ⌘ zSc. 5 Thus, h(z, w) is real stable in 2m variables, indexed below by S and R where R := S\T. Instead of the form above, We can sum over S, R ✓[m] but then have to constrain the support to the case when Sc \ T = ; and Sc \ R = ;. In other words, we may write (using Iverson-brackets J·K) h(z, w) = X S,R✓[m] JSc \ R = ; ^ Sc \ T = ;K det(LT,T )zScwR. (3.3) Next, we truncate polynomial (3.3) at degree (m−k)+(k−n) = m−n by restricting |Sc[R| = m−n. By [8, Corollary 4.18] this truncation preserves stability, whence H(z, w) := X S,R✓[m] |Sc[R|=m−n JSc \ R = ;K det(LS\R,S\R)zScwR, is also stable. Using Prop. 7-(iii), setting w1 = . . . = wm = y retains stability; thus g(z, y) : = H(z, (y, y, . . . , y | {z } m times )) = X S,R✓[m] |Sc[R|=m−n JSc \ R = ;K det(LS\R,S\R)zScy|R| = X S✓[m] ⇣X |T |=n,T ✓S det(LT,T ) ⌘ y|S|−|T |zSc = X S✓[m] en(LS,S)y|S|−nzSc, is also stable. Next, differentiating g(z, y), k −n times with respect to y and evaluating at 0 preserves stability (Prop. 7-(ii) and (i)). In doing so, only terms corresponding to |S| = k survive, resulting in @k−n @yk−n g(z, y) ==== y=0 = (k −n)! X |S|=k,S✓[m] en(LS,S)zSc = (k −n)! X |S|=k,S✓[m] det(ASA> S )zSc, which is just pc(z) (up to a constant); here, the last equality follows from Prop. 9. This establishes stability of pc(z) and hence of p(z). Since p(z) is in addition multiaffine, it is the generating polynomial of an SR measure, completing the proof. 3.2 Implications: MCMC The SR property of P(S; A) established in Theorem 6 implies a fast mixing Markov chain for sampling S. The states for the Markov chain are all sets of cardinality k. The chain starts with a randomly-initialized active set S, and in each iteration we swap an element sin 2 S with an element sout /2 S with a specific probability determined by the probability of the current and proposed set. The stationary distribution of this chain is the one induced by DVS, by a simple detailed-balance argument. The chain is shown in Algorithm 1. Algorithm 1 Markov Chain for Dual Volume Sampling Input: A 2 Rn⇥m the matrix of interest, k the target cardinality, T the number of steps Output: S ⇠P(S; A) Initialize S ✓[m] such that |S| = k and det(ASA> S ) > 0 for i = 1 to T do draw b 2 {0, 1} uniformly if b = 1 then Pick sin 2 S and sout 2 [m]\S uniformly randomly q(sin, sout, S) min n 1, det(AS[{sout}\{sin}A> S[{sout}\{sin})/ det(ASA> S ) o S S [ {sout}\{sin} with probability q(sin, sout, S) end if end for The convergence of the markov chain is measured via its mixing time: The mixing time of the chain indicates the number of iterations t that we must perform (starting from S0) before we can consider St as an approximately valid sample from P(S; A). Formally, if δS0(t) is the total variation distance between the distribution of St and P(S; A) after t steps, then ⌧S0(") := min{t : δS0(t0) ", 8t0 ≥t} 6 is the mixing time to sample from a distribution "-close to P(S; A) in terms of total variation distance. We say that the chain mixes fast if ⌧S0 is polynomial in the problem size. The fast mixing result for Algorithm 1 is a corollary of Theorem 6 combined with a recent result of [3] on fast-mixing Markov chains for homogeneous SR measures. Theorem 10 states this precisely. Theorem 10 (Mixing time). The mixing time of Markov chain shown in Algorithm 1 is given by ⌧S0(") 2k(m −k)(log P(S0; A)−1 + log "−1). Proof. Since P(S; A) is k-homogeneous SR by Theorem 6, the chain constructed for sampling S following that in [3] mixes in ⌧S0(") 2k(m −k)(log P(S0; A)−1 + log "−1) time. Implementation. To implement Algorithm 1 we need to compute the transition probabilities q(sin, sout, S). Let T = S\{sin} and assume r(AT ) = n. By the matrix determinant lemma we have the acceptance ratio det(AS[{sout}\{sin}A> S[{sout}\{sin}) det(ASA> S ) = (1 + A> {sout}(AT A> T )−1A{sout}) (1 + A> {sin}(AT A> T )−1A{sin}) . Thus, the transition probabilities can be computed in O(n2k) time. Moreover, one can further accelerate this algorithm by using the quadrature techniques of [28] to compute lower and upper bounds on this acceptance ratio to determine early acceptance or rejection of the proposed move. Initialization. A remaining question is initialization. Since the mixing time involves log P(S0; A)−1, we need to start with S0 such that P(S0; A) is sufficiently bounded away from 0. We show in Appendix F that by a simple greedy algorithm, we are able to initialize S such that log P(S; A)−1 ≥log(2nk! >m k ? ) = O(k log m), and the resulting running time for Algorithm 1 is e O(k3n2m), which is linear in the size of data set m and is efficient when k is not too large. 3.3 Further implications and connections Concentration. Pemantle and Peres [37] show concentration results for strong Rayleigh measures. As a corollary of our Theorem 6 together with their results, we directly obtain tail bounds for DVS. Algorithms for experimental design. Widely used, classical algorithms for finding an approximate optimal design include Fedorov’s exchange algorithm [20, 21] (a greedy local search) and simulated annealing [34]. Both methods start with a random initial set S, and greedily or randomly exchange a column i 2 S with a column j /2 S. Apart from very expensive running times, they are known to work well in practice [35, 43]. Yet so far there is no theoretical analysis, or a principled way of determining when to stop the greedy search. Curiously, our MCMC sampler is essentially a randomized version of Fedorov’s exchange method. The two methods can be connected by a unified, simulated annealing view, where we define P β(S; A) / exp{log det(ASA> S )/β} with temperature parameter β. Driving β to zero essentially recovers Fedorov’s method, while our results imply fast mixing for β = 1, together with approximation guarantees. Through this lens, simulated annealing may be viewed as initializing Fedorov’s method with the fast-mixing sampler. In practice, we observe that letting β < 1 improves the approximation results, which opens interesting questions for future work. 4 Experiments We report selection performance of DVS on real regression data (CompAct, CompAct(s), Abalone and Bank32NH1) for experimental design. We use 4,000 samples from each dataset for estimation. We compare against various baselines, including uniform sampling (Unif), leverage score sampling (Lev) [30], predictive length sampling (PL) [45], the sampling (Smpl)/greedy (Greedy) selection methods in [43] and Fedorov’s exchange algorithm [20]. We initialize the MCMC sampler with Kmeans++ [5] for DVS and run for 10,000 iterations, which empirically yields selections that are 1http://www.dcc.fc.up.pt/?ltorgo/Regression/DataSets.html 7 sufficiently good. We measure performances via (1) the prediction error ky −X ˆ↵k, and 2) running times. Figure 1 shows the results for these three measures with sample sizes k varying from 60 to 200. Further experiments (including for the interpolation β < 1), may be found in the appendix. k 100 150 200 Error 0.15 0.2 0.25 0.3 0.35 0.4 Prediction Error Unif Lev PL Smpl Greedy DVS Fedorov k 100 150 200 Seconds 0 20 40 60 80 100 Running Time Seconds 0 10 20 30 40 50 Error 0.18 0.2 0.22 0.24 0.26 0.28 Time-Error Trade-off Figure 1: Results on the CompAct(s) dataset. Results are the median of 10 runs, except Greedy and Fedorov. Note that Unif, Lev, PL and DVS use less than 1 second to finish experiments. In terms of prediction error, DVS performs well and is comparable with Lev. Its strength compared to the greedy and relaxation methods (Smpl, Greedy, Fedorov) is running time, leading to good time-error tradeoffs. These tradeoffs are illustrated in Figure 1 for k = 120. In other experiments (shown in Appendix G) we observed that in some cases, the optimization and greedy methods (Smpl, Greedy, Fedorov) yield better results than sampling, however with much higher running times. Hence, given time-error tradeoffs, DVS may be an interesting alternative in situations where time is a very limited resource and results are needed quickly. 5 Conclusion In this paper, we study the problem of DVS and develop an exact (randomized) polynomial time sampling algorithm as well as its derandomization. We further study dual volume sampling via the theory of real-stable polynomials and prove that its distribution satisfies the “Strong Rayleigh” property. This result has remarkable consequences, especially because it implies a provably fastmixing Markov chain sampler that makes dual volume sampling much more attractive to practitioners. Finally, we observe connections to classical, computationally more expensive experimental design methods (Fedorov’s method and SA); together with our results here, these could be a first step towards a better theoretical understanding of those methods. Acknowledgement This research was supported by NSF CAREER award 1553284, NSF grant IIS-1409802, DARPA grant N66001-17-1-4039, DARPA FunLoL grant (W911NF-16-1-0551) and a Siebel Scholar Fellowship. The views, opinions, and/or findings contained in this article are those of the author and should not be interpreted as representing the official views or policies, either expressed or implied, of the Defense Advanced Research Projects Agency or the Department of Defense. References [1] N. Anari and S. O. Gharan. The Kadison-Singer problem for strongly Rayleigh measures and applications to asymmetric TSP. arXiv:1412.1143, 2014. [2] N. Anari and S. O. Gharan. Effective-resistance-reducing flows and asymmetric TSP. In IEEE Symposium on Foundations of Computer Science (FOCS), 2015. [3] N. Anari, S. O. Gharan, and A. Rezaei. Monte Carlo Markov chain algorithms for sampling strongly Rayleigh distributions and determinantal point processes. In COLT, pages 23–26, 2016. [4] M. Arioli and I. S. Duff. Preconditioning of linear least-squares problems by identifying basic variables. SIAM J. Sci. Comput., 2015. [5] D. Arthur and S. Vassilvitskii. k-means++: The advantages of careful seeding. In Proceedings of the eighteenth annual ACM-SIAM symposium on Discrete algorithms, 2007. 8 [6] H. Avron and C. Boutsidis. Faster subset selection for matrices and applications. SIAM Journal on Matrix Analysis and Applications, 34(4):1464–1499, 2013. [7] J. Borcea and P. Brändén. Applications of stable polynomials to mixed determinants: Johnson’s conjectures, unimodality, and symmetrized Fischer products. Duke Mathematical Journal, pages 205–223, 2008. [8] J. Borcea, P. Brändén, and T. Liggett. Negative dependence and the geometry of polynomials. Journal of the American Mathematical Society, 22:521–567, 2009. [9] A. Borodin. Determinantal point processes. arXiv:0911.1153, 2009. [10] C. Boutsidis and M. Magdon-Ismail. Deterministic feature selection for k-means clustering. IEEE Transactions on Information Theory, pages 6099–6110, 2013. [11] C. Boutsidis, M. W. Mahoney, and P. Drineas. An improved approximation algorithm for the column subset selection problem. In SODA, pages 968–977, 2009. [12] C. Boutsidis, A. Zouzias, M. W. Mahoney, and P. Drineas. Stochastic dimensionality reduction for k-means clustering. arXiv preprint arXiv:1110.2897, 2011. [13] C. Boutsidis, P. Drineas, and M. Magdon-Ismail. Near-optimal column-based matrix reconstruction. SIAM Journal on Computing, pages 687–717, 2014. [14] S. Chen, R. Varma, A. Sandryhaila, and J. Kovaˇcevi´c. Discrete signal processing on graphs: Sampling theory. IEEE Transactions on Signal Processing, 63(24):6510–6523, 2015. [15] A. Çivril and M. Magdon-Ismail. On selecting a maximum volume sub-matrix of a matrix and related problems. Theoretical Computer Science, pages 4801–4811, 2009. [16] M. Derezinski and M. K. Warmuth. Unbiased estimates for linear regression via volume sampling. Advances in Neural Information Processing Systems (NIPS), 2017. [17] A. Deshpande and L. Rademacher. Efficient volume sampling for row/column subset selection. In Foundations of Computer Science (FOCS), 2010 51st Annual IEEE Symposium on, pages 329–338. IEEE, 2010. [18] M. Elkin, Y. Emek, D. A. Spielman, and S.-H. Teng. Lower-stretch spanning trees. SIAM Journal on Computing, 2008. [19] T. Feder and M. Mihail. Balanced matroids. In Symposium on Theory of Computing (STOC), pages 26–38, 1992. [20] V. Fedorov. Theory of optimal experiments. Preprint 7 lsm, Moscow State University, 1969. [21] V. Fedorov. Theory of optimal experiments. Academic Press, 1972. [22] A. Frieze, N. Goyal, L. Rademacher, and S. Vempala. Expanders via random spanning trees. SIAM Journal on Computing, 43(2):497–513, 2014. [23] S. O. Gharan, A. Saberi, and M. Singh. A randomized rounding approach to the traveling salesman problem. In IEEE Symposium on Foundations of Computer Science (FOCS), pages 550–559, 2011. [24] N. Halko, P.-G. Martinsson, and J. A. Tropp. Finding structure with randomness: Probabilistic algorithms for constructing approximate matrix decompositions. SIAM review, 53(2):217–288, 2011. [25] S. Joshi and S. Boyd. Sensor selection via convex optimization. IEEE Transactions on Signal Processing, pages 451–462, 2009. [26] A. Kulesza and B. Taskar. Determinantal Point Processes for machine learning, volume 5. Foundations and Trends in Machine Learning, 2012. [27] C. Li, S. Jegelka, and S. Sra. Fast mixing markov chains for strongly Rayleigh measures, DPPs, and constrained sampling. In Advances in Neural Information Processing Systems (NIPS), 2016. [28] C. Li, S. Sra, and S. Jegelka. Gaussian quadrature for matrix inverse forms with applications. In ICML, pages 1766–1775, 2016. [29] R. Lyons. Determinantal probability measures. Publications Mathématiques de l’Institut des Hautes Études Scientifiques, 98(1):167–212, 2003. 9 [30] P. Ma, M. Mahoney, and B. Yu. A statistical perspective on algorithmic leveraging. In Journal of Machine Learning Research (JMLR), 2015. [31] O. Macchi. The coincidence approach to stochastic point processes. Advances in Applied Probability, 7(1), 1975. [32] A. Magen and A. Zouzias. Near optimal dimensionality reductions that preserve volumes. In Approximation, Randomization and Combinatorial Optimization. Algorithms and Techniques, pages 523–534. Springer, 2008. [33] A. J. Miller and N.-K. Nguyen. A fedorov exchange algorithm for d-optimal design. Journal of the royal statistical society, 1994. [34] M. D. Morris and T. J. Mitchell. Exploratory designs for computational experiments. Journal of Statistical Planning and Inference, 43:381–402, 1995. [35] N.-K. Nguyen and A. J. Miller. A review of some exchange algorithms for constructng discrete optimal designs. Computational Statistics and Data Analysis, 14:489–498, 1992. [36] R. Pemantle. Towards a theory of negative dependence. Journal of Mathematical Physics, 41: 1371–1390, 2000. [37] R. Pemantle and Y. Peres. Concentration of Lipschitz functionals of determinantal and other strong Rayleigh measures. Combinatorics, Probability and Computing, 23:140–160, 2014. [38] F. Pukelsheim. Optimal design of experiments. SIAM, 2006. [39] D. Spielman and N. Srivastava. Graph sparsification by effective resistances. SIAM J. Comput., 40(6):1913–1926, 2011. [40] D. A. Spielman and S.-H. Teng. Nearly-linear time algorithms for graph partitioning, graph sparsification, and solving linear systems. In STOC, 2004. [41] M. Tsitsvero, S. Barbarossa, and P. D. Lorenzo. Signals on graphs: Uncertainty principle and sampling. IEEE Transactions on Signal Processing, 64(18):4845–4860, 2016. [42] D. Wagner. Multivariate stable polynomials: theory and applications. Bulletin of the American Mathematical Society, 48(1):53–84, 2011. [43] Y. Wang, A. W. Yu, and A. Singh. On Computationally Tractable Selection of Experiments in Regression Models. ArXiv e-prints, 2016. [44] Y. Zhao, F. Pasqualetti, and J. Cortés. Scheduling of control nodes for improved network controllability. In 2016 IEEE 55th Conference on Decision and Control (CDC), pages 1859– 1864, 2016. [45] R. Zhu, P. Ma, M. W. Mahoney, and B. Yu. Optimal subsampling approaches for large sample linear regression. arXiv preprint arXiv:1509.05111, 2015. 10
2017
69
7,208
2017
7
7,209
Premise Selection for Theorem Proving by Deep Graph Embedding Mingzhe Wang∗ Yihe Tang∗ Jian Wang Jia Deng University of Michigan, Ann Arbor Abstract We propose a deep learning-based approach to the problem of premise selection: selecting mathematical statements relevant for proving a given conjecture. We represent a higher-order logic formula as a graph that is invariant to variable renaming but still fully preserves syntactic and semantic information. We then embed the graph into a vector via a novel embedding method that preserves the information of edge ordering. Our approach achieves state-of-the-art results on the HolStep dataset, improving the classification accuracy from 83% to 90.3%. 1 Introduction Automated reasoning over mathematical proofs is a core question of artificial intelligence that dates back to the early days of computer science [1]. It not only constitutes a key aspect of general intelligence, but also underpins a broad set of applications ranging from circuit design to compilers, where it is critical to verify the correctness of a computer system [2, 3, 4]. A key challenge of theorem proving is premise selection [5]: selecting relevant statements that are useful for proving a given conjecture. Theorem proving is essentially a search problem with the goal of finding a sequence of deductions leading from presumed facts to the given conjecture. The space of this search is combinatorial—with today’s large mathematical knowledge bases [6, 7], the search can quickly explode beyond the capability of modern automated theorem provers, despite the fact that often only a small fraction of facts in the knowledge base are relevant for proving a given conjecture. Premise selection thus plays a critical role in narrowing down the search space and making it tractable. Premise selection has been mainly tackled as hand-designed heuristics based on comparing and analyzing symbols [8]. Recently, some machine learning methods have emerged as a promising alternative for premise selection, which can naturally be cast as a classification or ranking problem. Alama et al. [9] trained a kernel-based classifier using essentially bag-of-words features, and demonstrated large improvement over the state of the art system. Alemi et al. [5] were the first to apply deep learning approaches to premise selection and demonstrated competitive results without manual feature engineering. Kaliszyk et al. [10] introduced HolStep, a large dataset of higher-order logic proofs, and provided baselines based on logistic regression and deep networks. In this paper we propose a new deep learning approach to premise selection. The key idea of our approach is to represent mathematical formulas as graphs and embed them into vector space. This is different from prior work on premise selection that directly applies deep networks to sequences of characters or tokens [5, 10]. Our approach is motivated by the observation that a mathematical formula can be represented as a graph that encodes the syntactic and semantic structure of the formula. For example, the formula ∀x∃y(P(x) ∧Q(x, y)) can be expressed as the graph shown in Fig. 1, where edges link terms to their constituents and connect quantifiers to their variables. ∗Equal contribution. VAR VAR P Q Figure 1: The formula ∀x∃y(P(x) ∧Q(x, y)) can be represented as a graph. Our hypothesis is that such graph representations are better than sequential forms because a graph makes explicit key syntactic and semantic structures such as composition, variable binding, and co-reference. Such an explicit representation helps the learning of invariant feature representations. For example, P(x, T(f(z) + g(z), v)) ∧Q(y) and P(y) ∧Q(x) share the same top level structure P ∧Q, but such similarity would be less apparent and harder to detect from a sequence of tokens because syntactically close terms can be far apart in the sequence. Another benefit of a graph representation is that we can make it invariant to variable renaming while preserving the semantics. For example, the graph for ∀x∃y(P(x) ∧Q(x, y) (Fig. 1) is the same regardless of how the variables are named in the formula, but the semantics of quantifiers and co-reference is completely preserved—the quantifier ∀binds a variable that is the first argument of both P and Q, and the quantifier ∃binds a variable that is the second argument of Q. It is worth noting that although a sequential form encodes the same information, and a neural network may well be able to learn to convert a sequence of tokens into a graph, such a neural conversion is unnecessary—unlike parsing natural language sentences, constructing a graph out of a formula is straightforward and unambiguous. Thus there is no obvious benefit to be gained through an end-to-end approach that starts from the textual representation of formulas. To perform premise selection, we convert a formula into a graph, embed the graph into a vector, and then classify the relevance of the formula. To embed a graph into a vector, we assign an initial embedding vector for each node of the graph, and then iteratively update the embedding of each node using the embeddings of its neighbors. We then pool the embeddings of all nodes to form the embedding of the entire graph. The parameters of each update are learned end to end through backpropagation. In other words, we learn a deep network that embeds a graph into a vector; the topology of the unrolled network is determined by the input graph. We perform experiments using the HolStep dataset [10], which consists of over two million conjecturestatement pairs that can be used to evaluate premise selection. The results show that our graphembedding approach achieves large improvement over sequence-based models. In particular, our approach improves the state-of-the-art accuracy on HolStep by 7.3%. Our main contributions of this work are twofold. First, we propose a novel approach to premise selection that represents formulas as graphs and embeds them into vectors. To the best our knowledge, this is the first time premise selection is approached using deep graph embedding. Second, we improve the state-of-the-art classification accuracy on the HolStep dataset from 83% to 90.3%. 2 Related Work Research on automated theorem proving has a long history [11]. Decades of research has resulted in a variety of well-developed automated theorem provers such as Vampire [12] and E [13]. However, no existing automated provers can scale to large mathematical libraries due to combinatorial explosion of the search space. This limitation gave rise to the development of interactive theorem proving [11] such as Coq [14] and Isabelle [15], which combines humans and machines in theorem proving and has led to impressive achievements such as the proof of the Kepler conjecture [16] and the formal proof of the Feit-Thompson problem [17]. Premise selection as a machine learning problem was introduced by Alama et al. [9], who constructed a corpus of proofs to train a kernelized classifier using bag-of-word features that represent the occurrences of terms in a vocabulary. Deep learning techniques were first applied to premise selection in the DeepMath work by Alemi et al. [5], who applied recurrent networks and convolutional to formulas represented as textual sequences, and showed that deep learning approaches can achieve competitive results against baselines using hand-engineered features. Serving the needs for large 2 datasets for training deep models, Kaliszyk et al. [10] introduced the HolStep dataset that consists of 2M statements and 10K conjectures, an order of magnitude larger than the DeepMath dataset [5]. A related task to premise selection is internal guidance of ATPs [18, 19, 20, 21, 22, 23, 24], the selection of the next clause to process inside an automated theorem prover. Internal guidance differs from premise selection in that internal guidance depends on the logical representation, inference algorithm, and current state inside a theorem prover, whereas premise selection is only about picking relevant statements as the initial input to a theorem prover that is treated as a black box. Because internal guidance is tightly integrated with proof search and is invoked repeatedly, efficiency is as important as accuracy, whereas for premise selection efficiency is not as critical. Loos et al. [25] were the first to apply deep networks to internal guidance of ATPs. They experimented with both sequential representations and tree representations (recursive neural networks [26, 27]). Note that their tree representations are simply the parse trees, which, unlike our graphs, are not invariant to variable renaming and do not capture how quantifiers bind variables. Whalen [23] uses GRU networks to guide the exploration of partial proof trees, with formulas represented as sequences of tokens. In addition to premise selection and internal guidance, other aspects of theorem proving have also benefited from machine learning. For example, Kühlwein & Urban [28] applied kernel methods to strategy finding, the problem of searching for good parameter configurations for an automated prover. Similarly, Bridge et al. [29] applied SVM and Gaussian Processes to select good heuristics, which are collections of standard settings for parameters and other decisions. Our graph embedding method is related to a large body of prior work on embeddings and graphs. Deepwalk [30], LINE [31] and Node2Vec [32] focus on learning node embeddings. Similar to Word2Vec [33, 34], they optimize the embedding of a node to predict nodes in a neighborhood. Recursive neural networks [35, 27] and Tree LSTMs [36] consider embeddings of trees, a special type of graphs. Misra & Artzi [37] embed tree representations of typed lambda calculus expressions into vectors, with variable nodes labeled with only their types. This leads to invariance to variable renaming, but is not entirely lossless in terms of semantics. If a formula contains multiple variables of the same type but with different names, it is not possible to know which lambda abstraction binds which variable. Neural networks on general graphs were first introduced by Gori et al [38] and Scarselli et al [39]. Many follow-up works [40, 41, 42, 43, 44, 45] proposed specific architectures to handle graph-based input by extending recurrent neural network to graph data [38, 41, 42] or making use of graph convolutions based on spectral graph theories [40, 43, 44, 45, 46]. Our approach is most similar to the work of [40], where they encode molecular fragments as neural fingerprints with graph-based convolutions for chemical applications. But to the best of our knowledge, no previous deep learning approaches on general graphs preserve the order of edges. In contrast, we propose a novel way of graph embedding that can preserve the information of edge ordering, and demonstrate its effectiveness for premise selection. 3 FormulaNet: Formulas to Graphs to Embeddings 3.1 Formulas to Graphs We consider formulas in higher-order logic [47]. A higher-order formula can be defined recursively based on a vocabulary of constants, variables, and quantifiers. A variable or a constant can act as a value or a function. For example, ∀f∃x(f(x, c) ∧P(f)) is a higher-order formula where ∀and ∃are quantifiers, c is a constant value, P, ∧are constant functions, x is a variable value, and f is both a variable function and a variable value. To construct a graph from a formula, we first parse the formula into a tree, where each internal node represents a constant function, a variable function, or a quantifier, and each leaf node represents a variable value or a constant value. We then add edges that connect a quantifier node to all instances of its quantified variables, after which we merge (leaf) nodes that represent the same constant or variable. Finally, for each occurrence of a variable, we replace its original name with VAR, or VARFUNC if it acts as a function. Fig. 2 illustrates these steps. 3 x f f P x x f c VAR f f P c x P c VARFUNC (a) (b) (c) (d) VAR Figure 2: From a formula to a graph: (a) the input formula; (b) parsing the formula into a tree; (c) merging leaves and connecting quantifiers to variables; (d) renaming variables. Formally, let S be the set of all formulas, Cv be the set of constant values, Cf the set of constant functions, Vv the set of variable values, Vf the set of variable functions, and Q the set of quantifiers. Let s be a higher-order logic formula with no free variables—any free variables can be bounded by adding quantifiers ∀to the front of the formula. The graph Gs = (Vs, Es) of formula s can be recursively constructed as follows: • if s = α, where α ∈Cv ∪Vv, then Gs ←({α}, ∅), i.e. the graph contains a single node α. • if s = f(s1, s2, . . . , sn), where f ∈Cf ∪Vf and s1, . . . , sn ∈S, then we perform G′ s ←(Sn i Vsi ∪{f}, Sn i Esi ∪{(f, ν(si))}i) followed by Gs ←MERGE_C(G′ s), where ν(si) is the “head node” of si and MERGE_C is an operation that merges the same constant (leaf) nodes in the graph. • if s = φxt, where φ ∈Q, t ∈S, x ∈Vv ∪Vf, then we perform G′′ s ←  Vt ∪{f}, Et ∪{(φ, ν(t)) S v∈Vt[x]{(φ, v)}  , followed by G′ s ←MERGEx(G′′ s) if x ∈ Vv ∪Vf and Gs ←RENAMEx(G′ s), where Vt[x] is the nodes that represent the variable x in the graph of t, MERGEx is an operation that merges all nodes representing the variable x into a single node, and RENAMEx is an operation that renames x to VAR (or VARFUNC if x acts as a function). By construction, our graph is invariant to variable renaming, yet no syntactic or semantic information is lost. This is because for a variable node (either as a function or value), its original name in the formula is irrelevant in the graph—the graph structure already encodes where it is syntactically and which quantifier binds it. 3.2 Graphs to Embeddings To embed a graph to a vector, we take an approach similar to performing convolution or message passing on graphs [40]. The overall idea is to associate each node with an initial embedding and iteratively update them. As shown in Fig. 3, suppose v and each node around v has an initial embedding. We update the embedding of v by the node embeddings in its neighborhood. After multi-step updates, the embedding of v will contain information from its local strcuture. Then we max-pool the node embeddings across all of nodes in the graph to form an embedding for the graph. To initialize the embedding for each node, we use the one-hot vector that represents the name of the node. Note that in our graph all variables have the same name VAR (or VARFUNC if the variable acts as a function), so their initial embeddings are the same. All other nodes (constants and quantifiers) each have their names and thus their own one-hot vectors. We then repeatedly update the embedding of each node using the embeddings of its neighbors. Given a graph G = (V, E), at step t + 1 we update the embedding xt+1 v of node v as follows: xt+1 v = F t P  xt v + 1 dv h X (u,v)∈E F t I(xt u, xt v) + X (v,u)∈E F t O(xt v, xt u) i , (1) where dv is the degree of node v, F t I and F t O are update functions using incoming edges and outgoing edges, and F t P is an update function to conbine the old embeddings with the new update from neighbor 4 v u u u u u u Figure 3: An example of applying the order-preserving updates in Eqn. 2. To update node v, we consider its neighbors and its position in all treelets (see Sec. 3.3) it belongs to. nodes. We parametrize these update functions as neural networks; the detailed configurations will be given in Sec. 4.2. It is worth noting that all node embeddings are updated in parallel using the same update functions, but the update functions can be different across steps to allow more flexibility. Repeated updates allow each embedding to incorporate information from a bigger neighborhood and thus capture more global structures. Interestingly, with zero updates, our model reduces to a bag-of-words representation, that is, a max pooling of individual node embeddings. To predict the usefulness of a statement for a conjecture, we send the concatenation of their embeddings to a classifier. The classification can also be done in the unconditional setting where only the statement is given; in this case we directly send the embedding of the statement to a classifier. The parameters of the update functions and the classifiers are learned end to end through backpropagation. 3.3 Order-Preserving Embeddings For functions in a formula, the order of its arguments matters. That is, f(x, y) cannot generally be presumed to mean the same as f(y, x). But our current embedding update as defined in Eqn. 1 is invariant to the ordering of arguments. Given that it is possible that the ordering of arguments can be a useful feature for premise selection, we now consider a variant of our basic approach to make our graph embeddings sensitive to the ordering of arguments. In this variant, we update each node considering the ordering of its incoming edges and outgoing edges. Before we define our new update equation, we need to introduce the notion of a treelet. Given a node v in graph G = (V, E), let (v, w) ∈E be an outgoing edge of v, and let rv(w) ∈{1, 2, . . .} be the rank of edge (v, w) among all outgoing edges of v. We define a treelet of graph G = (V, E) as a tuple of nodes (u, v, w) ∈V × V × V such that (1) both (v, u) and (v, w) are edges in the graph and (2) (v, u) is ranked before (v, w) among all outgoing edges of v. In other words, a treelet is a subgraph that consists of a head node v, a left child u and a right child w. We use TG to denote all treelets of graph G, that is, TG = {(u, v, w) : (v, u) ∈E, (v, w) ∈E, rv(u) < rv(w)}. Now, when we update a node embedding, we consider not only its direct neighbors, but also its roles in all the treelets it belongs to: xt+1 v = F t P  xt v + 1 dv h X (u,v)∈E F t I(xt u, xt v) + X (v,u)∈E F t O(xt v, xt u) i + 1 ev h X (v,u,w)∈TG F t L(xt v, xt u, xt w) + X (u,v,w)∈TG F t H(xt u, xt v, xt w) + X (u,w,v)∈TG F t R(xt u, xt w, xt v) i (2) where ev = |{(u, v, w) : (u, v, w) ∈TG ∨(v, u, w) ∈TG ∨(u, w, v) ∈TG}| is the number of total treelets containing v. In this new update equation, FL is an update function that considers a treelet where node v is the left child. Similarly, FH considers a treelet where node v is the head and FR considers a treelet where node v is the right child. As in Sec. 3.2, the same update functions are applied to all nodes at each step, but across steps the update functions can be different. Fig. 3 shows the update equation of a concrete example. Our design of Eqn. 2 now allows a node to be embedded differently dependent on the ordering of its own arguments and dependent on which argument slot it takes in a parent function. For example, the function node f can now be embedded differently for f(a, b) and f(b, a) because of the output of FH can be different. As another example, in the formula g(f(a), f(a)), there are two function 5 FH / FL / FR FC dim=256 BN ReLU FC dim=256 BN ReLU concat FC dim=256 BN ReLU FC dim=128 BN ReLU FC dim=2 FC dim=2 FC 256 BN ReLU (a) (b) (c) (d) FI / FO concat concat FP xv xu xv xu xw Figure 4: Configurations of the update functions and classifiers: (a) FP in Eqn. 1 and 2; (b) FI, FO in Eqn. 1 and 2, and FL, FH, FR in Eqn. 2; (c) conditional classifier; (d) unconditional classifier. nodes with the same name f, same parent g, and same child a, but they can be embedded differently because only FL will be applied to the f as the first argument of g and only FR will be applied to the f as the second argument of g. To distinguish the two variants of our approach, we call the method with the treelet update terms FormulaNet, as opposed to the basic FormulaNet-basic without considering edge ordering. 4 Experiments 4.1 Dataset and Evaluation We evaluate our approach on the HolStep dataset [10], a recently introduced benchmark for evaluating machine learning approaches for theorem proving. It was constructed from the proof trace files of the HOL Light theorem prover [7] on its multivariate analysis library [48] and the formal proof of the Kepler conjecture. The dataset contains 11,410 conjectures, including 9,999 in the training set and 1,411 in the test set. Each conjecture is associated with a set of statements, each with a ground truth label on whether the statement is useful for proving the conjecture. There are 2,209,076 conjecture-statement pairs in total. We hold out 700 conjectures from the training set as the validation set to tune hyperparameters and perform ablation analysis. Following the evaluation setup proposed in [10], we treat premise selection as a binary classification task and evaluate classification accuracy. Also following [10], we evaluate two settings, the conditional setting where both the conjecture and the statement are given, and the unconditional setting where the conjecture is ignored. In HolStep, each conjecture is associated with an equal number of positive statements and negative statements, so the accuracy of random prediction is 50%. 4.2 Network Configurations The initial one-hot vector for each node has 1909 dimensions, representing 1909 unique tokens. These 1909 tokens include 1906 unique constants from the training set and three special tokens, "VAR", "VARFUNC", and "UNKNOWN" (representing all novel tokens during testing). We use a linear layer to map one-hot encodings to 256-dimensional vectors. All of the following intermediate embeddings are 256-dimensional. The update functions in Eqn. 1 and Eqn. 2 are parametrized as neural networks. Fig. 4 (a), (b) shows their configurations. All update functions are configured the same: concatenation of inputs followed by two fully connected layers with ReLUs, Batch Normalizations [49]. The classifier for the conditional setting takes in the embeddings from the conjecture and the statement. Its configuration is shown in Fig. 4 (c). The classifier for the unconditional setting uses only the embedding of the statement; its configuration is shown in Fig. 4 (d). 4.3 Model Training We train our networks using RMSProp [50] with 0.001 learning rate and 1 × 10−4 weight decay. We lower the learning rate by 3X after each epoch. We train all models for five epochs and all networks converge after about three or four epochs. It is worth noting that there are two levels of batching in our approach: intra-graph batching and inter-graph batching. Intra-graph batching arises from the fact that to embed a graph, each update 6 Table 1: Classification accuracy on the test set of our approach versus baseline methods on HolStep in the unconditional setting (conjecture unknown) and the conditional setting (conjecture given). CNN [10] CNN-LSTM [10] FormulaNet-basic FormulaNet Unconditional 83 83 89.0 90.0 Conditional 82 83 89.1 90.3 function (FP , FI, FO, FL, FH, FR in Eqn. 2) is applied to all nodes in parallel. This is the same as training each update function as a standalone network with a batch of input examples. Thus regular batch normalization can be directly applied to the inputs of each update function within a single graph, as shown in Fig. 4(a)(b). Furthermore, this batch normalization within a graph can be run in the training mode even when we are only performing inference to embed a graph, because there are multiple input examples to each update function within a graph. Another level of batching is the regular batching of multiple graphs in training, as is necessary for training the classifier. As usual, batch normalization across graphs is done in the evaluation mode in test time. We also apply intermediate supervision after each step of embedding update using a separate classifier. For training, our loss function is the sum of cross-entropy losses for each step. We use the prediction from the last step as our final predictions. 4.4 Main Results Table 1 compares the accuracy of our approach versus the best existing results [10]. Our approach improves the best existing result by a large margin from 83% to 90.3% in the conditional setting and from 83% to 90.0% in the unconditional setting. We also see that FormulaNet gives a 1% improvement over the FormulaNet-basic, validating our hypothesis that the order of function arguments provides useful cues. Consistent with prior work [10], conditional and unconditional selection have similar performances. This is likely due to the data distribution in HolStep. In the training set, only 0.8% of the statements appear in both a positive statement-conjecture pair and a negative statement-conjecture pair, and the upper performance bound of unconditional selection is 97%. In addition, HolStep contains 9,999 unique conjectures but 1,304,888 unique statements for training, so it is likely easier for the network to learn useful patterns from statements than from conjectures. We also apply Deepwalk [30], an unsupervised approach for generating node embeddings that is purely based on graph topology without considering the token associated with each node. For each formula graph, we max-pool its node embeddings and train a classifier. The accuracy is 61.8% (conditional) and 61.7% (unconditional). This result suggests that for embedding formulas it is important to use token information and end-to-end supervision. 4.5 Ablation Experiments Invariance to Variable Renaming One motivation for our graph representation is that the meaning of formulas should be invariant to the renaming of variable values and variable functions. To achieve such invariance, we perform two main transformations of a parse tree to generate a graph: (1) we convert the tree to a graph by linking quantifiers and variables, and (2) we discard the variable names. We now study the effect of these steps on the premise selection task. We compare FormulaNet-basic with the following three variants whose only difference is the format of the input graph: • Tree-old-names: Use the parse tree as the graph and keep all original names for the nodes. An example is the tree in Fig. 2 (b). • Tree-renamed: Use the parse tree as the graph but rename all variable values to VAR and variable functions to VARFUNC. • Graph-old-names: Use the same graph as FormulaNet-basic but keep all original names for the nodes, thus making the graph embedding dependent on the original variable names. An example is the graph in Fig. 2 (c). 7 Table 2: The accuracy of FormulaNet-basic and its ablated versions on original and renamed validation set. Tree-old-names Tree-renamed Graph-old-names Our Graph Original Validation 89.7 84.7 89.8 89.9 Renamed Validation 82.3 84.7 83.5 89.9 Table 3: Validation accuracy of proposed models with different numbers of update steps on conditional premise selection. Number of steps 0 1 2 3 4 FormulaNet-basic 81.5 89.3 89.8 89.9 90.0 FormulaNet 81.5 90.4 91.0 91.1 90.8 We train these variants on the same training set as FormulaNet-basic. To compare with FormulaNetbasic, we evaluate them on the same held-out validation set. In addition, we generate a new validation set (Renamed Validation) by randomly permutating the variable names in the formulas—the textual representation is different but the semantics remains the same. We also compare all models on this renamed validation set to evaluate their robustness to variable renaming. Table 2 reports the results. If we use a tree with the original names, there is a slight drop when evaluate on the original validation set, but there is a very large drop when evaluated on the renamed validation set. This shows that there are features exploitable in the original variable names and the model is exploiting it, but the model is essentially overfitting to the bias in the original names and cannot generalize to renamed formulas. The same applies to the model trained on graphs with the original names, whose performance also drops drastically on renamed formulas. It is also interesting to note that the model trained on renamed trees performs poorly, although it is invariant to variable renaming. This shows that the syntactic and semantic information encoded in the graph on variables—particularly their quantifiers and coreferences—is important. 4.6 Visualization of Embeddings Number of Update Steps An important hyperparameter of our approach is the number of steps to update the embeddings. Zero steps can only embed a bag of unstructured tokens, while more steps can embed information from larger graph structures. Table 3 compares the accuracy of models with different numbers of update steps. Perhaps surprisingly, models with zero steps can already real_gt extreme_point_of IN T = hull DISJOINT VAR NOT NOT NOT NOT NOT NOT NOT NOT NOT => => => => => => => => VAR VAR VAR VAR VAR VARFUNC VARFUNC VARFUNC VARFUNC VARFUNC = complex_mul condensation_point_of => ALL vector_sub VAR casn VAR =_c VAR continuous VAR FST VAR NUMERAL VAR = = = = = = => => => => => => Figure 5: Nearest neighbors of node embeddings after step 1 with FormulaNet. Query nodes are in the first column. The color of each node is coded by a t-SNE [51] projection of its step-0 embedding into 2D. The closer the colors, the nearer two nodes are in the step-0 embedding space. 8 achieve an accuracy of 81.5%, showing that much of the performance comes from just the names of constant functions and values. More steps lead to notable increases of accuracy, showing that the structures in the graph are important. There is a diminishing return after 3 steps, but this can be reasonably expected because a radius of 3 in a graph is a fairly sizable neighborhood and can encompass reasonably complex expressions—a node can influence its grand-grandchildren and grand-grandparents. In addition, it would naturally be more difficult to learn generalizable features from long-range patterns because they are more varied and each of them occurs much less frequently. To qualitatively examine the learned embeddings, we find out a set of nodes with similar embeddings and visualize their local structures in Fig. 5. In each row, we use a node as the query and find the nearest neighbors across all nodes from different graphs. We can see that the nearest neighbors have similar structures in terms of topology and naming. This demonstrates that our graph embeddings can capture syntactic and semantic structures of a formula. 5 Conclusion In this work, we have proposed a deep learning-based approach to premise selection. We represent a higher-order logic formula as a graph that is invariant to variable renaming but fully preserves syntactic and semantic information. We then embed the graph into a continuous vector through a novel embedding method that preserves the information of edge ordering. Our approach has achieved state-of-the-art results on the HolStep dataset, improving the classification accuracy from 83% to 90.3%. Acknowledgements This work is partially supported by the National Science Foundation under Grant No. 1633157. References [1] Alan JA Robinson and Andrei Voronkov. Handbook of automated reasoning, volume 1. Elsevier, 2001. [2] Christoph Kern and Mark R Greenstreet. Formal verification in hardware design: a survey. ACM Transactions on Design Automation of Electronic Systems (TODAES), 4(2):123–193, 1999. [3] Gerwin Klein, Kevin Elphinstone, Gernot Heiser, June Andronick, David Cock, Philip Derrin, Dhammika Elkaduwe, Kai Engelhardt, Rafal Kolanski, Michael Norrish, et al. sel4: Formal verification of an os kernel. In Proceedings of the ACM SIGOPS 22nd symposium on Operating systems principles, pages 207–220. ACM, 2009. [4] Xavier Leroy. Formal verification of a realistic compiler. Communications of the ACM, 52(7):107–115, 2009. [5] Alexander A Alemi, Francois Chollet, Niklas Een, Geoffrey Irving, Christian Szegedy, and Josef Urban. Deepmath - deep sequence models for premise selection. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett, editors, Advances in Neural Information Processing Systems 29, pages 2235–2243. Curran Associates, Inc., 2016. [6] Adam Naumowicz and Artur Korniłowicz. A Brief Overview of Mizar, pages 67–72. Springer Berlin Heidelberg, Berlin, Heidelberg, 2009. [7] John Harrison. HOL Light: An Overview, pages 60–66. Springer Berlin Heidelberg, Berlin, Heidelberg, 2009. [8] Kryštof Hoder and Andrei Voronkov. Sine qua non for large theory reasoning. In International Conference on Automated Deduction, pages 299–314. Springer, 2011. [9] Jesse Alama, Tom Heskes, Daniel Kühlwein, Evgeni Tsivtsivadze, and Josef Urban. Premise selection for mathematics by corpus analysis and kernel methods. Journal of Automated Reasoning, 52(2):191–213, 2014. [10] Cezary Kaliszyk, François Chollet, and Christian Szegedy. Holstep: A machine learning dataset for higher-order logic theorem proving. arXiv preprint arXiv:1703.00426, 2017. [11] John Harrison, Josef Urban, and Freek Wiedijk. History of interactive theorem proving. In Computational Logic, volume 9, pages 135–214, 2014. 9 [12] Laura Kovács and Andrei Voronkov. First-order theorem proving and vampire. In International Conference on Computer Aided Verification, pages 1–35. Springer, 2013. [13] Stephan Schulz. E–a brainiac theorem prover. Ai Communications, 15(2, 3):111–126, 2002. [14] Gilles Dowek, Amy Felty, Hugo Herbelin, Gérard Huet, Chetan Murthy, Catherin Parent, Christine Paulin-Mohring, and Benjamin Werner. The COQ Proof Assistant: User’s Guide: Version 5.6. INRIA, 1992. [15] Makarius Wenzel, Lawrence C Paulson, and Tobias Nipkow. The isabelle framework. In International Conference on Theorem Proving in Higher Order Logics, pages 33–38. Springer, 2008. [16] Thomas Hales, Mark Adams, Gertrud Bauer, Dat Tat Dang, John Harrison, Truong Le Hoang, Cezary Kaliszyk, Victor Magron, Sean McLaughlin, Thang Tat Nguyen, et al. A formal proof of the kepler conjecture. arXiv preprint arXiv:1501.02155, 2015. [17] Georges Gonthier, Andrea Asperti, Jeremy Avigad, Yves Bertot, Cyril Cohen, François Garillot, Stéphane Le Roux, Assia Mahboubi, Russell O’Connor, Sidi Ould Biha, Ioana Pasca, Laurence Rideau, Alexey Solovyev, Enrico Tassi, and Laurent Théry. A Machine-Checked Proof of the Odd Order Theorem, pages 163–179. Springer Berlin Heidelberg, Berlin, Heidelberg, 2013. [18] Christian Suttner and Wolfgang Ertel. Automatic acquisition of search guiding heuristics. In International Conference on Automated Deduction, pages 470–484. Springer, 1990. [19] Jörg Denzinger, Matthias Fuchs, Christoph Goller, and Stephan Schulz. Learning from previous proof experience: A survey. Citeseer, 1999. [20] SA Schulz. Learning search control knowledge for equational deduction, volume 230. IOS Press, 2000. [21] Michael Färber and Chad Brown. Internal guidance for satallax. In International Joint Conference on Automated Reasoning, pages 349–361. Springer, 2016. [22] Cezary Kaliszyk and Josef Urban. Femalecop: fairly efficient machine learning connection prover. In Logic for Programming, Artificial Intelligence, and Reasoning, pages 88–96. Springer, 2015. [23] Daniel Whalen. Holophrasm: a neural automated theorem prover for higher-order logic. arXiv preprint arXiv:1608.02644, 2016. [24] Jan Jakub˚uv and Josef Urban. Enigma: Efficient learning-based inference guiding machine. arXiv preprint arXiv:1701.06532, 2017. [25] Sarah Loos, Geoffrey Irving, Christian Szegedy, and Cezary Kaliszyk. Deep network guided proof search. arXiv preprint arXiv:1701.06972, 2017. [26] Richard Socher, Eric H. Huang, Jeffrey Pennin, Christopher D Manning, and Andrew Y. Ng. Dynamic pooling and unfolding recursive autoencoders for paraphrase detection. 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 801–809. Curran Associates, Inc., 2011. [27] Richard Socher, Cliff C Lin, Chris Manning, and Andrew Y Ng. Parsing natural scenes and natural language with recursive neural networks. In Proceedings of the 28th international conference on machine learning (ICML-11), pages 129–136, 2011. [28] Daniel Kühlwein and Josef Urban. Males: A framework for automatic tuning of automated theorem provers. Journal of Automated Reasoning, 55(2):91–116, 2015. [29] James P. Bridge, Sean B. Holden, and Lawrence C. Paulson. Machine learning for first-order theorem proving. Journal of Automated Reasoning, 53(2):141–172, 2014. [30] Bryan Perozzi, Rami Al-Rfou, and Steven Skiena. Deepwalk: Online learning of social representations. In Proceedings of the 20th ACM SIGKDD international conference on Knowledge discovery and data mining, pages 701–710. ACM, 2014. [31] Jian Tang, Meng Qu, Mingzhe Wang, Ming Zhang, Jun Yan, and Qiaozhu Mei. Line: Large-scale information network embedding. In Proceedings of the 24th International Conference on World Wide Web, pages 1067–1077. ACM, 2015. [32] Aditya Grover and Jure Leskovec. node2vec: Scalable feature learning for networks. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 855–864. ACM, 2016. 10 [33] 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. [34] Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781, 2013. [35] Christoph Goller and Andreas Kuchler. Learning task-dependent distributed representations by backpropagation through structure. In Neural Networks, 1996., IEEE International Conference on, volume 1, pages 347–352. IEEE, 1996. [36] Kai Sheng Tai, Richard Socher, and Christopher D Manning. Improved semantic representations from tree-structured long short-term memory networks. arXiv preprint arXiv:1503.00075, 2015. [37] Dipendra Kumar Misra and Yoav Artzi. Neural shift-reduce ccg semantic parsing. In EMNLP, pages 1775–1786, 2016. [38] Marco Gori, Gabriele Monfardini, and Franco Scarselli. A new model for learning in graph domains. In Neural Networks, 2005. IJCNN’05. Proceedings. 2005 IEEE International Joint Conference on, volume 2, pages 729–734. IEEE, 2005. [39] Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele Monfardini. The graph neural network model. IEEE Transactions on Neural Networks, 20(1):61–80, 2009. [40] 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. [41] Yujia Li, Daniel Tarlow, Marc Brockschmidt, and Richard Zemel. Gated graph sequence neural networks. arXiv preprint arXiv:1511.05493, 2015. [42] Ashesh Jain, Amir R Zamir, Silvio Savarese, and Ashutosh Saxena. Structural-rnn: Deep learning on spatiotemporal graphs. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5308–5317, 2016. [43] Mikael Henaff, Joan Bruna, and Yann LeCun. Deep convolutional networks on graph-structured data. arXiv preprint arXiv:1506.05163, 2015. [44] Michaël Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on graphs with fast localized spectral filtering. In Advances in Neural Information Processing Systems, pages 3837–3845, 2016. [45] Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016. [46] 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. [47] Alonzo Church. A formulation of the simple theory of types. The journal of symbolic logic, 5(02):56–68, 1940. [48] John Harrison. The hol light theory of euclidean space. Journal of Automated Reasoning, pages 1–18, 2013. [49] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015. [50] Geoffrey Hinton, Nitish Srivastava, and Kevin Swersky. Lecture 6a overview of mini–batch gradient descent. Coursera Lecture slides https://class. coursera. org/neuralnets-2012-001/lecture,[Online, 2012. [51] Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of Machine Learning Research, 9(Nov):2579–2605, 2008. 11
2017
70
7,210
Differentiable Learning of Submodular Models Josip Djolonga Department of Computer Science ETH Zurich josipd@inf.ethz.ch Andreas Krause Department of Computer Science ETH Zurich krausea@ethz.ch Abstract Can we incorporate discrete optimization algorithms within modern machine learning models? For example, is it possible to incorporate in deep architectures a layer whose output is the minimal cut of a parametrized graph? Given that these models are trained end-to-end by leveraging gradient information, the introduction of such layers seems very challenging due to their non-continuous output. In this paper we focus on the problem of submodular minimization, for which we show that such layers are indeed possible. The key idea is that we can continuously relax the output without sacrificing guarantees. We provide an easily computable approximation to the Jacobian complemented with a complete theoretical analysis. Finally, these contributions let us experimentally learn probabilistic log-supermodular models via a bi-level variational inference formulation. 1 Introduction Discrete optimization problems are ubiquitous in machine learning. While the majority of them are provably hard, a commonly exploitable trait that renders some of them tractable is that of submodularity [1, 2]. In addition to capturing many useful phenomena, submodular functions can be minimized in polynomial time and also enjoy a powerful connection to convex optimization [3]. Both of these properties have been used to great effect in both computer vision and machine learning, to e.g. compute the MAP configuration in undirected graphical models with long-reaching interactions [4] and higher-order factors [5], clustering [6], to perform variational inference in log-supermodular models [7, 8], or to design norms useful for structured sparsity problems [9, 10]. Despite all the benefits of submodular functions, the question of how to learn them in a practical manner remains open. Moreover, if we want to open the toolbox of submodular optimization to modern practitioners, an intriguing question is how to to use them in conjunction with deep learning networks. For instance, we need to develop mechanisms that would enable them to be trained together in a fully end-to-end fashion. As a concrete example from the computer vision domain, consider the problem of image segmentation. Namely, we are given as input an RGB representation x ∈Rn×3 of an image captured by say a dashboard camera, and the goal is to identify the set of pixels A ⊆{1, 2, . . . , n} that are occupied by pedestrians. While we could train a network θ: x →v ∈Rn to output per-pixel scores, it would be helpful, especially in domains with limited data, to bias the predictions by encoding some prior beliefs about the expected output. For example, we might prefer segmentations that are spatially consistent. One common approach to encourage such configurations is to first define a graph over the image G = (V, E) by connecting neighbouring pixels, specify weights w over the edges, and then solve the following graph-cut problem A∗(w, v) = arg min A⊆V F(A) = arg min A⊆V X {i,j}∈E wi,j JA ∩{i, j} = 1K | {z } 1 iff the predictions disagree + X i∈A vi |{z} pixel score . (1) While this can be easily seen as a module computing the best configuration as a function of the edge weights and per-pixel scores, incorporating it as a layer in a deep network seems at a first glance to 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. be a futile task. Even though the output is easily computable, it will be discontinuous and have no Jacobian, which is necessary for backpropagation. However, as the above problem is an instance of submodular minimization, we can leverage its relationship to convexity and relax it to y∗(w, v) = arg min y∈Rn f(y) + 1 2∥y∥2 = arg min y∈Rn X {i,j}∈E wi,j|yi −yj| + vT y + 1 2∥y∥2. (2) In addition to having a continuous output, this relaxation has a very strong connection with the discrete problem as the discrete optimizer can be obtained by thresholding y∗as A∗= {i ∈V | y∗ i > 0}. Moreover, as explained in §2, for every submodular function F there exists an easily computable convex function f so that this relationship holds. For general submodular functions, the negation of the solution to the relaxed problem (2) is known as the min-norm point [11]. In this paper we consider the problem of designing such modules that solve discrete optimization problems by leveraging this continuous formulation. To this end, our key technical contribution is to analyze the sensitivity of the min-norm point as a function of the parametrization of the function f. For the specific case above we will show how to compute ∂y∗/∂w and ∂y∗/∂v. Continuing with the segmentation example, we might want to train a conditional model P(A | x) that can model the uncertainty in the predictions to be used in downstream decision making. A rich class of models are log-supermodular models, i.e., those of the form P(A | x) = exp(−Fθ(x)(A))/Z(θ) for some parametric submodular function Fθ. While they can capture very useful interactions, they are very hard to train in the maximum likelihood setting due to the presence of the intractable normalizer Z(θ). However, Djolonga and Krause [8] have shown that for any such distribution we can find the closest fully factorized distribution Q(· | x) minimizing a specific information theoretic divergence D∞. In other words, we can exactly compute Q(· | x) = arg minQ∈Q D∞(P(· | x) ∥Q), where Q is the family of fully factorized distributions. Most importantly, the optimal Q can also be computed from the min-norm point. Thus, a reasonable objective would be to learn a model θ(x) so that the best approximate distribution Q(· | x) gives high likelihood to the training data point. This is a complicated bi-level optimization problem (as Q implicitly depends on θ) with an inner variational inference procedure, which we can again train end-to-end using our results. In other words, we can optimize the following algorithm end-to-end with respect to θ. xi θ(x) −−−→θi −→P = exp(−Fθi(A))/Z(θi) −→Q = arg min Q∈Q D∞(P ∥Q) −→Q(Ai | xi). (3) Related work. Sensitivity analysis of the set of optimal solutions has a long history in optimization theory [12]. The problem of argmin-differentiation of the specific case resulting from graph cuts (i.e. eq. (2)) has been considered in the computer vision literature, either by smoothing the objective [13], or by unrolling iterative methods [14]. The idea to train probabilistic models by evaluating them using the marginals produced by an approximate inference algorithm has been studied by Domke [15] for tree-reweighted belief propagation and mean field, and for continuous models by Tappen [16]. These methods either use the implicit function theorem, or unroll iterative optimization algorithms. The benefits of using an inconsistent estimator, which is what we do by optimizing eq. (3), at the benefit of using computationally tractable inference methods has been discussed by Wainwright [17]. Amos and Kolter [18] discuss how to efficiently argmin-differentiate quadratic programs by perturbing the KKT conditions, an idea that goes back to Boot [19]. We make an explicit connection to their work in Theorem 4. In Section 4 we harness the connection between the min-norm problem and isotonic regression, which has been exploited to obtain better duality certificates [2], and by Kumar and Bach [20] to design an active-set algorithm for the min-norm problem. Chakravarti [21] analyzes the sensitivity of the optimal isotonic regression point with respect to perturbations of the input, but does not discuss the directional derivatives of the problem. Recently, Dolhansky and Bilmes [22] have used deep networks to parametrize submodular functions. Discrete optimization is also used in structured prediction [23, 24] for the computation of the loss function, which is closely related to our work if we use discrete optimization only at the last layer. However, in this case we have the advantage in that we allow for arbitrary loss functions to be applied to the solution of the relaxation. Contributions. We develop a very efficient approximate method (§4) for the computation of the Jacobian of the min-norm problem inspired by our analysis of isotonic regression in §3, where we derive results that might be of independent interest. Even more importantly, from a practical perspective, this Jacobian has a very nice structure and we can multiply with it in linear time. This 2 means that we can efficiently perform back-propagation if we use these layers in a modern deep architectures. In §5 we show how to compute directional derivatives exactly in polynomial time, and give conditions under which our approximation is correct. This is also an interesting theoretical result as it quantifies the stability of the min-norm point with respect to the model parameters. Lastly, we use our results to learn log-supermodular models in §6. 2 Background on Submodular Minimization Let us introduce the necessary background on submodular functions. They are defined over subsets of some ground set, which in the remaining of this paper we will w.l.o.g. assume to be V = {1, 2, . . . , n}. Then, a function F : 2V →R is said to be submodular iff for all A, B ⊆V it holds that F(A ∪B) + F(A ∩B) ≤F(A) + F(B). (4) We will furthermore w.l.o.g. assume that F is normalized so that F(∅) = 0. A very simple family of submodular functions are modular functions. These, seen as discrete analogues of linear functions, satisfy the above with equality and are given as F(A) = P i∈A mi for some real numbers mi. As common practice in combinatorial optimization, we will treat any vector m ∈Rn as a modular function 2V →R defined as m(A) = P i∈A mi. In addition to the graph cuts from the introduction (eq. (1)), another widely used class of functions are concave-of-cardinality functions, i.e. those of the form F(|A|) = h(|A|) for some concave h: R →R [5]. From eq. (4) we see that if we want to define a submodular function over a collection D ⊊2V it has to be closed under union and intersection. Such collections are known as lattices, and two examples that we will use are the simple lattice 2V and the trivial lattice {∅, V }. In the theory of submodular minimization, a critical object defined by a pair consisting of a submodular function F and a lattice D ⊇{∅, V } is the base polytope B(F | D) = {x ∈Rn | x(A) ≤F(A) for all A ∈D} ∩{x ∈Rn | x(V ) = F(V )}. (5) We will also use the shorthand B(F) = B(F | 2V ). Using the result of Edmonds [25], we know how to maximize a linear function over B(F) in O(n log n) time with n function evaluations of F. Specifically, to compute maxy∈B(F ) zT y, we first choose a permutation σ: V →V that sorts z, i.e. so that zσ(1) ≥zσ(2) ≥· · · ≥zσ(n). Then, a maximizer f(σ) ∈B(F) can be computed as [f(σ)]σ(i) = F({σ(i)} | {σ(1), . . . , σ(i −1)}), (6) where the marginal gain of A given B is defined as F(A | B) = F(A ∪B) −F(B). Hence, we know how to compute the support function f(z) = supy∈B(F ) zT y, which is known as the Lovász extension [3]. First, this function is indeed an extension as f(1A) = F(A) for all A ⊆V , where 1A ∈{0, 1}n is the indicator vector for the set A. Second, it is convex as it is a supremum of linear functions. Finally, and most importantly, it lets us minimize submodular functions in polynomial time with convex optimization because minA∈2V F(A) = minz∈[0,1] f(z) and we can efficiently round the optimal continuous point to a discrete optimizer. Another problem, with a smooth objective, which is also explicitly tied to the problem of minimizing F is that of computing the min-norm point, which can be defined in two different ways as y∗= arg min y∈B(F ) 1 2∥y∥2, or equivalently as −y∗= arg min y f(y) + 1 2∥y∥2, (7) where the equivalence comes from strong Fenchel duality [2]. The connection with submodular minimization comes from the following lemma, which we have already hinted at in the introduction. Lemma 1 ([1, Lem. 7.4]). Define A−= {i | y∗ i < 0} and A0 = {i | y∗ i ≤0}. Then A−(A0) is the unique smallest (largest) minimizer of F. Moreover, if instead of hard-thresholding we send the min-norm point through a sigmoid, the result has the following variational inference interpretation, which lets us optimize the pipeline in eq. (3). Lemma 2 ([8, Thm. 3]). Define the infinite Rényi divergence between any distributions P and Q over 2V as D∞(P || Q) = supA⊆V log  P(A)/Q(A)  . For P(A) ∝exp(−F(A)), the distribution Q∗ minimizing D∞over all fully factorized distributions Q is given as Q(A) = Y i∈A σ(−y∗ i ) Y i/∈A σ(y∗ i ), where σ(u) = 1/(1 + exp(−u)) is the sigmoid function. 3 3 Argmin-Differentiation of Isotonic Regression We will first analyze a simpler problem, i.e., that of isotonic regression, defined as y(x) = arg min y∈O 1 2∥y −x∥2, (8) where O = {y ∈Rn | yi ≤yi+1 for i = 1, 2, . . . , n −1}. The connection to our problem will be made clear in Section 4, and it essentially follows from the fact that the Lovász extension is linear on O. In this section, we will be interested in computing the Jacobian ∂y/∂x, i.e., in understanding how the solution y changes with respect to the input x. The function is well-defined because of the strict convexity of the objective and the non-empty convex feasible set. Moreover, it can be easily computed in O(n) time using the pool adjacent violators algorithm (PAVA) [26]. This is a well-studied problem in statistics, see e.g. [27]. To understand the behaviour of y(x), we will start by stating the optimality conditions of problem (8). To simplify the notation, for any A ⊆V we will define Meanx(A) = 1 |A| P i∈A xi. The optimality conditions can be stated via ordered partitions Π = (B1, B2, . . . , Bm) of V , meaning that the sets Bi are disjoint, ∪k j=1Bj = V , and Π is ordered so that 1 + maxi∈Bj i = mini∈Bj+1 i. Specifically, for any such partition we define yΠ = (y1, y2, . . . , ym), where yj = Meanx(Bj)1|Bj| and 1k = {1}k is the vector of all ones. In other words, yΠ is defined by taking block-wise averages of x with respect to Π. By analyzing the KKT conditions of problem (8), we obtain the following well-known condition. Lemma 3 ([26]). An ordered partition Π = (B1, B2, . . . , Bm) is optimal iff the following hold 1. (Primal feasibility) For any two blocks Bj and Bj+1 we have Meanx(Bj) ≤Meanx(Bj+1). (9) 2. (Dual feasibility) For every block B ∈Π and each i ∈B define PreB(i) = {j ∈B | j ≤i}. Then, the condition reads Meanx(PreB(i)) −Meanx(B) ≥0. (10) Points where eq. (9) is satisfied with equality are of special interest, because of the following result. Lemma 4. If for some Bj and Bj+1 the first condition is satisfied with equality, we can merge the two sets so that the new coarser partition Π′ will also be optimal. Thus, in the remaining of this section we will assume that the sets Bj are chosen maximally. We will now introduce a notion that will be crucial in the subsequent analysis. Definition 1. For any block B, we say that i ∈B is a breakpoint if Meanx(PreB(i)) = Meanx(B) and it is not the right end-point of B (i.e., i < maxi′∈B i′). From an optimization perspective, any breakpoint is equivalent to non-strict complementariness of the corresponding Lagrange multiplier. From a combinatorial perspective, they correspond to positions where we can refine Π into a finer partition Π′ that gives rise to the same point, i.e., yΠ = yΠ′ (if we merge blocks using Lemma 4, the point where we merge them will become a breakpoint). We can now discuss the differentiability of y(x). Because projecting onto convex sets is a proximal operator and thus non-expansive, we have the following as an immediate consequence of Rademacher’s theorem. Lemma 5. The function y(x) is 1-Lipschitz continuous and differentiable almost everywhere. We will denote by ∂− xk and ∂+ xk the left and right partial derivatives with respect to xk. For any index k we will denote by u(k) (l(k)) the breakpoint with the smallest (largest) coordinate larger (smaller) than k. Define it as +∞(−∞) if no such point exists. Moreover, denote by Π(z) the collection of indices where z takes on distinct values, i.e., Π(z) = ∪n i=1{{i′ ∈V | zi = zi′}}. Theorem 1. Let k be any coordinate and let B ∈Π(y(x)) be the block containing coordinate i. Also define B+ = {i ∈B | i ≥u(k)} and B−= {i ∈B | i ≤l(k)}. Hence, for any i ∈B ∂+ xk(yi) = Ji ∈B \ B−K/|B \ B−|, and ∂− xk(yi) = Ji ∈B \ B+K/|B \ B+|. 4 Note that all of these derivatives will agree iff there are no breakpoints, which means that the existence of breakpoints is an isolated phenomenon due to Lemma 5. In this case the Jacobian exists and has a very simple block-diagonal form. Namely, it is equal to ∂y ∂x = Λ(y(x)) ≡blkdiag(C|B1|, C|B2|, . . . , C|Bm|), (11) where Ck = 1k×k/k is the averaging matrix with elements 1/k. We will use Λ(z) for the matrix taking block-wise averages with respect to the blocks Π(z). As promised in the introduction, Jacobian multiplication Λ(y(x))u is linear as we only have to perform block-wise averages. 4 Min-Norm Differentiation In this section we will assume that we have a function Fθ parametrized by some θ ∈Rd that we seek to learn. For example, we could have a mixture model Fθ(A) = d X j=1 θjGj(A), (12) for some fixed submodular functions Gj : 2V →R. In this case, to ensure that the resulting function is submodular we also want to enforce θj ≥0 unless Gj is modular. We would like to note that the discussion in this section goes beyond such models. Remember that the min-norm point is defined as yθ = −arg min y fθ(y) + 1 2∥y∥2, (13) where fθ is the Lovász extension of Fθ. Hence, we want to compute ∂y/∂θ. To make the connection with isotonic regression, remember how we evaluate the Lovász extension at y. First, we pick a permutation σ that sorts y, and then evaluate it as fθ(y) = fθ(σ)T y, where fθ(σ) is defined in eq. (6). Hence, the Lovász extension is linear on the set of all vectors that are sorted by σ. Formally, for any permutation σ the Lovász extension is equal to fθ(σ)T y on the order cone O(σ) = {y | yσ(n) ≤yσ(n−1) ≤. . . ≤yσ(1)}. Given a permutation σ, if we constrain eq. (13) to O(σ) we can replace fθ(y) by the linear function fθ(σ)T , so that the problem reduces to yθ(σ) = −arg min y∈O(σ) 1 2∥y + fθ(σ)∥2, (14) which is an instance of isotonic regression if we relabel the elements of V using σ. Roughly, the idea is to instead differentiate eq. (14) with fθ(σ) computed at the optimal point yθ. However, because we can choose an arbitrary order among the elements with equal values, there may be multiple permutations that sort yθ, and this extra choice we have seems very problematic. Nevertheless, let us continue with this strategy and analyze the resulting approximations to the Jacobian. We propose the following approximation to the Jacobian ∂yθ ∂θ ≈bJσ ≡Λ(yθ) | {z } ≈ ∂yθ(σ) ∂fθ(σ) ×∂fθ(σ) ∂θ = Λ(yθ) × [∂θ1fθ(σ) | ∂θ2fθ(σ) | · · · | ∂θdfθ(σ)] , where Λ(yθ) is used as an approximation of a Jacobian which might not exist. Fortunately, due to the special structure of the linearizations, we have the following result that the gradient obtained using the above strategy does not depend on the specific permutation σ that was chosen. Theorem 2. If ∂θkF(A) exists for all A ⊆V the approximate Jacobians bJσ are equal and do not depend on the choice of σ. Specifically, the j-th block of any element i ∈B ∈Π(yθ) is equal to 1 |B|∂θjFθ(B | {i′ | [yθ]i′ < [yθ]i}). (15) Proof sketch, details in supplement. Remember that Λ(yθ) averages fθ(σ) within each B ∈Π(yθ). Moreover, as σ sorts yθ, the elements in B must be placed consecutively. The coordinates of fθ(σ) are marginal gains (6) and they will telescope inside the mean, which yields the claimed quantity. 5 Graph cuts. As a special, but important case, let us analyze how the approximate Jacobian looks like for a cut function (eq. (1)), in which case eq. (13) reduces to eq. (2). Let Π(y(w, v)) = (B1, B2, . . . , Bm). For any element i ∈V we will denote by η(i) ∈{1, 2, . . . , m} the index of the block where it belongs to. Then, the approximate Jacobian bJ at θ = (w, v) has entries b∂vj(yi) = Jη(i) = η(j)K/|Bη(i)|, and b∂wi,j(yk) =      sign(yi −yj) 1 |Bη(k)| if η(k) = η(i), or sign(yj −yi) 1 |Bη(k)| if η(k) = η(j), and 0 otherwise, where the sign function is defined to be zero if the argument is zero. Intuitively, increasing the modular term vi by δ will increase all the coordinates B in y that are in the same segment by δ/|B|. On the other hand, increasing the weight of an edge wi,j will have no effect if i and j are already on y in the same segment, and otherwise it will pull the segments containing i and j together by increasing the smaller one and decreasing the larger one. In the supplementary we provide a pytorch module that executes the back propagation pass in O(|V | + |E|) time in about 10 lines of code, and we also derive the approximate Jacobians for concave-of-cardinality and facility location functions. 5 Analysis We will now theoretically analyze the conditions under which our approximation is correct, and then give a characterization of the exact directional derivative together with a polynomial algorithm that computes it. The first notion that will have implications for our analysis is that of (in)separability. Definition 2. The function F : 2V →R is said to be separable if there exists some B ⊆V such that B /∈{∅, V } and F(V ) = F(B) + F(V \ B). The term separable is indeed appropriate as it implies that F(A) = F(A ∩B) + F((V \ B) ∩A) for all A ⊆V [2, Prop. 4.3], i.e., the function splits as a sum of two functions on disjoint domains. Hence, we can split the problem into two (on B and V \ B) and analyze them independently. We would like to point out that separability is checkable in cubic time using the algorithm of Queyranne [28]. To simplify the notation, we will assume that we want to compute the derivative at point θ′ ∈Rd which results in the min-norm point y′ = yθ ∈Rn. We will furthermore assume that y′ takes on unique values γ1 < γ2 < · · · < γk on sets B1, B2, . . . , Bk respectively, and we will define the chain ∅= A0 ⊆A1 ⊆A2 ⊆· · · ⊆Ak = V by Aj = ∪j j′=1Bj′. A central role in the analysis will be played by the set of constraints in B(Fθ) (see (5)) that are active at yθ, which makes sense given that we expect small perturbations in θ′ to result in small changes in yθ′ as well. Definition 3. For any submodular function F : 2V →R and any point z ∈B(F) we shall denote by DF (z) the lattice of tight sets of z on B(F), i.e. DF (z) = {A ⊆V | z(A) = F(A)}. The fact that the above set is indeed a lattice is well-known [1]. Moreover, note that DF (z) ⊇{∅, V }. We will also define D′ = DFθ′ (y′), i.e., the lattice of tight sets at the min-norm point. 5.1 When will the approximate approach work? We will analyze sufficient conditions so that irrespective of the choice of σ, the isotonic regression problem eq. (14) has no breakpoints, and the left and right derivatives agree. To this end, for any j ∈{1, 2, . . . , k} we define the submodular function Fj : 2Bj as Fj(H) = Fθ′(H | Aj−1), where we have dropped the dependence on θ′ as it will remain fixed throughout this section. Theorem 3. The approximate problem (14) is argmin-continuously differentiable irrespective of the chosen permutation σ sorting yθ if and only if any of the following equivalent conditions hold. (a) arg minH∈Bj  Fj(H) −Fj(Bj)|H|/|Bj|  = {∅, Bj}. (b) y′ Bj ∈relint(B(Fj)), i.e. DFj(y′ Bj) = {∅, Bj}, which is only possible if Fj is inseparable. 6 In other words, we can equivalently say that the optimum has to lie on the interior of the face. Moreover, if θ →yθ is continuous1, this result implies that the min-norm point is locally defined as averaging within the same blocks using (15), so that the approximate Jacobian is exact. We would like to point out that one can obtain the same derivatives as the ones suggested in §4, if we perturb the KKT conditions, as done by Amos and Kolter [18]. If we use that approach, in addition to the computational challenges, there is the problem of non-uniqueness of the Lagrange multiplier, and moreover, some valid multipliers might be zero for some of the active constraints. This would render the resulting linear system rank deficient, and it is not clear how to proceed. Remember that when we analyzed the isotonic regression problem in §3 we had non-differentiability due to the exactly same reason — zero multipliers for active constraints, which in that case correspond to the breakpoints. Theorem 4. For a specific Lagrange multiplier there exists a solution to the perturbed KKT conditions derived by [18] that gives rise to the approximate Jacobians from Section 4. Moreover, this multiplier is unique if the conditions of Theorem 3 are satisfied. 5.2 Exact computation Unfortunately, computing the gradients exactly seems very complicated for arbitrary parametrizations Fθ, and we will focus our attention to mixture models of the form given in eq. (12). The directions v where we will compute the directional derivatives will have in general non-negative components vj, unless Fj is modular. By leveraging the theory of Shapiro [29], and exploiting the structure of both the min-norm point and the polyhedron B(Fv | D′) we obtain at the following result. Theorem 5. Assume that Fθ′ is inseparable and let v be any direction so that Fv is submodular. The directional derivative ∂y/∂θj at θ′ in direction v is given by the solution of the following problem. minimize d 1 2∥d∥2, subject to d ∈B(Fv | D′), and d(Bj) = Fv(Aj) for j ∈{1, 2, . . . , k}. (16) First, note that this is again a min-norm problem, but now defined over a reduced lattice D′ with k additional equality constraints. Fortunately, due to these additional equalities, we can split the above problem into k separate min-norm problems. Namely, for each j ∈{1, 2, . . . , k} collect the lattice of tight sets that intersect Bj as D′ j = {H ∩Bj | H ∈D′}, and define the function Gj : 2Bj →R as Gj(A) = Fv(A | Aj−1), where note that the parameter vector θ is taken as the direction v in which we want to compute the derivative. Then, the block of the optimal solution of problem (16) corresponding to Bj is equal to d∗ Bj = arg min yj∈B(Gj|D′ j) 1 2∥yj∥2, (17) which is again a min-norm point problem where the base polytope is defined using the lattice D′ j. We can then immediately draw a connection with the results from the previous subsection. Corollary 1. If all latices are trivial, the solution of (17) agrees with the approximate Jacobian (15). How to solve problem (16)? Fortunately, the divide-and-conquer algorithm of Groenevelt [30] can be used to find the min-norm point over arbitrary lattices. To do this, we have to compute for each i ∈Bj the unique smallest set H∗ i in arg minHj∋i Fj(Hj) −y′(Hj), which can be done using submodular minimization after applying the reduction of Schrijver [31]. To highlight the difference with the approximation from section 4, let us consider a very simple case. Lemma 6. Assume that Gj is equal to Gj(A) = Ji ∈AK for some i ∈Bj. Then, the directional derivative is equal to 1|D|/|D| where D = {i′ | i ∈H∗ i′}. Hence, while the approximate directional derivative would average over all elements in Bj, the true one averages only over a subset D ⊆Bj and is possibly sparser. Lemma 6 gives us the exact directional derivatives for the graph cuts, as each component Gj will be either a cut function on 1For example if the correspondence θ ↠B(Fθ) is hemicontinuous due to Berge’s theorem. 7 two vertices, or a function of the form in Lemma 6. In the first case the directional derivative is zero because 0 ∈B(Gj) ⊆B(Gj | D′ j). In the second case, we can can either solve exactly using Lemma 6 or use a more sophisticated approximation, generalizing the result from [32] — given that Fj is separable over 2Bj iff the graph is disconnected, we can first separate the graph into connected components, and then take averages within each connected component instead of over Bj. 5.3 Structured attention and constraints Recently, there has been an interest in the design of structured attention mechanisms, which, as we will now show, can be derived and furthermore generalized using the results in this paper. The first mechanism is the sparsemax of Martins and Astudillo [33]. It takes as input a vector and projects it to the probability simplex, which is the base polytope corresponding to G(A) = min{|A|, 1}. Concurrently with this work, Niculae and Blondel [32] have analyzed the following problem y∗= min y∈B(G) f(y) + 1 2∥y −z∥2, (18) for the special case when B(G) is the simplex and f is the Lovász extension of one of two specific submodular functions. We will consider the general case when G can be any concave-of-cardinality function and F is an arbitrary submodular function. Note that, if either f(y) or the constraint were not present in problem (18), we could have simply leveraged the theory we have developed so far to differentiate it. Fortunately, as done by Niculae and Blondel [32], we can utilize the result of Yu [34] to significantly simplify (18). Namely, because projection onto B(G) preserves the order of the coordinates [35, Lemma 1], we can write the optimal solution y∗to (18) as y∗= min x∈B(G) 1 2∥y −y′∥, where y′ = arg min y f(y) + 1 2∥y −z∥2. We can hence split problem (18) into two subtasks — first, compute y′ and then project it onto B(G). As each operation can reduces to a minimum-norm problem, we can differentiate each of them separately, and thus solve (18) by stacking two submodular layers one after the other. 6 Experiments CNN CNN+GC Mean Std. Dev. Mean Std. Dev. Accuracy 0.8103 0.1391 0.9121 0.1034 NLL 0.3919 0.1911 0.2681 0.2696 # Fg. Objs. 96.9 65.8 25.3 30.6 Figure 1: Test set results. We see that incorporating a graph cut solver improves both the accuracy and negative log-likelihood (NLL), while having consistent segmentations with fewer foreground objects. We consider the image segmentation tasks from the introduction, where we are given an RGB image x ∈Rn×3 and are supposed to predict those pixels y ∈{0, 1}n containing the foreground object. We used the Weizmann horse segmentation dataset [36], which we split into training, validation and test splits of sizes 180, 50 and 98 respectively. The implementation was done in pytorch2, and to compute the min-norm point we used the algorithm from [37]. To make the problem more challenging, at training time we randomly selected and revealed only 0.1% of the training set labels. We first trained a convolutional neural network with two hidden layers that directly predicts the per-pixel labels, which we refer to as CNN. Then, we added a second model, which we call CNN+GC, that has the same architecture as the first one, but with an additional graph cut layer, whose weights are parametrized by a convolutional neural network with one hidden layer. Details about the architectures can be found in the supplementary. We train the models by maximizing the log-likelihood of the revealed pixels, which corresponds to the variational bi-level strategy (eq. (3)) due to Lemma 2. We trained using SGD, Adagrad [38] and Adam [39], and chose the model with the best validation score. As evident from the results presented in Section 6, adding the discrete layer improves not only the accuracy (after thresholding the marginals at 0.5) and log-likelihood, but it gives more coherent results as it makes predictions with fewer connected components (i.e., foreground objects). Moreover, if we have a look at the predictions themselves in Figure 2, we can observe that the optimization layer not only removes spurious predictions, but there is is also a qualitative difference in the marginals as they are spatially more consistent. 2The code will be made available at https://www.github.com/josipd/nips-17-experiments. 8 Figure 2: Comparison of results from both models on four instances from the test set (up: CNN, down: CNN+GC). We can see that adding the graph-cut layers helps not only quantitatively, but also qualitatively, as the predictions are more spatially regular and vary smoothly inside the segments. 7 Conclusion We have analyzed the sensitivity of the min-norm point for parametric submodular functions and provided both a very easy-to-implement practical approximate algorithm for general objectives, and strong theoretical result characterizing the true directional derivatives for mixtures. These results allow the use of submodular minimization inside modern deep architectures, and they are also immediately applicable to bi-level variational learning of log-supermodular models of arbitrarily high order. Moreover, we believe that the theoretical results open the new problem of developing algorithms that can compute not only the min-norm point, but also solve for the associated derivatives. Acknowledgements. The research was partially supported by ERC StG 307036 and a Google European PhD Fellowship. References [1] S. Fujishige. Submodular functions and optimization. Annals of Discrete Mathematics vol. 58. 2005. [2] F. Bach. “Learning with submodular functions: a convex optimization perspective”. Foundations and Trends R⃝in Machine Learning 6.2-3 (2013). [3] L. Lovász. “Submodular functions and convexity”. Mathematical Programming The State of the Art. Springer, 1983, pp. 235–257. [4] 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 26.9 (2004), pp. 1124–1137. [5] P. Kohli, L. Ladicky, and P. H. Torr. “Robust higher order potentials for enforcing label consistency”. Computer Vision and Pattern Recognition (CVPR). 2008. [6] M. Narasimhan, N. Jojic, and J. A. Bilmes. “Q-clustering”. Advances in Neural Information Processing Systems (NIPS). 2006, pp. 979–986. [7] J. Djolonga and A. Krause. “From MAP to Marginals: Variational Inference in Bayesian Submodular Models”. Advances in Neural Information Processing Systems (NIPS). 2014. [8] J. Djolonga and A. Krause. “Scalable Variational Inference in Log-supermodular Models”. International Conference on Machine Learning (ICML). 2015. [9] F. R. Bach. “Shaping level sets with submodular functions”. Advances in Neural Information Processing Systems (NIPS). 2011. [10] F. R. Bach. “Structured sparsity-inducing norms through submodular functions”. Advances in Neural Information Processing Systems (NIPS). 2010. 9 [11] S. Fujishige, T. Hayashi, and S. Isotani. The minimum-norm-point algorithm applied to submodular function minimization and linear programming. Kyoto University. Research Institute for Mathematical Sciences [RIMS], 2006. [12] R. T. Rockafellar and R. J.-B. Wets. Variational analysis. Vol. 317. Springer Science & Business Media, 2009. [13] K. Kunisch and T. Pock. “A bilevel optimization approach for parameter learning in variational models”. SIAM Journal on Imaging Sciences 6.2 (2013), pp. 938–983. [14] P. Ochs, R. Ranftl, T. Brox, and T. Pock. “Bilevel optimization with nonsmooth lower level problems”. International Conference on Scale Space and Variational Methods in Computer Vision. Springer. 2015, pp. 654–665. [15] J. Domke. “Learning graphical model parameters with approximate marginal inference”. IEEE Transactions on Pattern Analysis and Machine Intelligence 35.10 (2013), pp. 2454–2467. [16] M. F. Tappen. “Utilizing variational optimization to learn markov random fields”. Computer Vision and Pattern Recognition (CVPR). 2007. [17] M. J. Wainwright. “Estimating the wrong graphical model: Benefits in the computation-limited setting”. Journal of Machine Learning Research (JMLR) 7 (2006). [18] B. Amos and J. Z. Kolter. “OptNet: Differentiable Optimization as a Layer in Neural Networks”. International Conference on Machine Learning (ICML). 2017. [19] J. C. Boot. “On sensitivity analysis in convex quadratic programming problems”. Operations Research 11.5 (1963), pp. 771–786. [20] K. Kumar and F. Bach. “Active-set Methods for Submodular Minimization Problems”. arXiv preprint arXiv:1506.02852 (2015). [21] N. Chakravarti. “Sensitivity analysis in isotonic regression”. Discrete Applied Mathematics 45.3 (1993), pp. 183–196. [22] B. Dolhansky and J. Bilmes. “Deep Submodular Functions: Definitions and Learning”. Neural Information Processing Society (NIPS). Barcelona, Spain, Dec. 2016. [23] I. Tsochantaridis, T. Joachims, T. Hofmann, and Y. Altun. “Large margin methods for structured and interdependent output variables”. Journal of Machine Learning Research (JMLR) 6.Sep (2005), pp. 1453–1484. [24] B. Taskar, C. Guestrin, and D. Koller. “Max-margin Markov networks”. Advances in Neural Information Processing Systems (NIPS). 2004, pp. 25–32. [25] J. Edmonds. “Submodular functions, matroids, and certain polyhedra”. Combinatorial structures and their applications (1970), pp. 69–87. [26] M. J. Best and N. Chakravarti. “Active set algorithms for isotonic regression; a unifying framework”. Mathematical Programming 47.1-3 (1990), pp. 425–439. [27] T. Robertson and T. Robertson. Order restricted statistical inference. Tech. rep. 1988. [28] M. Queyranne. “Minimizing symmetric submodular functions”. Mathematical Programming 82.1-2 (1998), pp. 3–12. [29] A. Shapiro. “Sensitivity Analysis of Nonlinear Programs and Differentiability Properties of Metric Projections”. SIAM Journal on Control and Optimization 26.3 (1988), pp. 628–645. [30] H. Groenevelt. “Two algorithms for maximizing a separable concave function over a polymatroid feasible region”. European Journal of Operational Research 54.2 (1991). [31] A. Schrijver. “A combinatorial algorithm minimizing submodular functions in strongly polynomial time”. Journal of Combinatorial Theory, Series B 80.2 (2000), pp. 346–355. [32] V. Niculae and M. Blondel. “A Regularized Framework for Sparse and Structured Neural Attention”. arXiv preprint arXiv:1705.07704 (2017). [33] A. Martins and R. Astudillo. “From softmax to sparsemax: A sparse model of attention and multi-label classification”. International Conference on Machine Learning (ICML). 2016. [34] Y.-L. Yu. “On decomposing the proximal map”. Advances in Neural Information Processing Systems. 2013, pp. 91–99. [35] D. Suehiro, K. Hatano, S. Kijima, E. Takimoto, and K. Nagano. “Online prediction under submodular constraints”. International Conference on Algorithmic Learning Theory. 2012. [36] E. Borenstein and S. Ullman. “Combined top-down/bottom-up segmentation”. IEEE Transactions on Pattern Analysis and Machine Intelligence 30.12 (2008), pp. 2109–2125. 10 [37] A. Barbero and S. Sra. “Modular proximal optimization for multidimensional total-variation regularization”. arXiv preprint arXiv:1411.0589 (2014). [38] J. Duchi, E. Hazan, and Y. Singer. “Adaptive subgradient methods for online learning and stochastic optimization”. Journal of Machine Learning Research (JMLR) 12.Jul (2011), pp. 2121–2159. [39] D. Kingma and J. Ba. “Adam: A method for stochastic optimization”. arXiv preprint arXiv:1412.6980 (2014). 11
2017
71
7,211
YASS: Yet Another Spike Sorter JinHyung Lee1, David Carlson2, Hooshmand Shokri1, Weichi Yao1, Georges Goetz3, Espen Hagen4, Eleanor Batty1, EJ Chichilnisky3, Gaute Einevoll5, and Liam Paninski1 1Columbia University, 2Duke University, 3Stanford University, 4University of Oslo, 5Norwegian University of Life Sciences Abstract Spike sorting is a critical first step in extracting neural signals from large-scale electrophysiological data. This manuscript describes an efficient, reliable pipeline for spike sorting on dense multi-electrode arrays (MEAs), where neural signals appear across many electrodes and spike sorting currently represents a major computational bottleneck. We present several new techniques that make dense MEA spike sorting more robust and scalable. Our pipeline is based on an efficient multistage “triage-then-cluster-then-pursuit” approach that initially extracts only clean, high-quality waveforms from the electrophysiological time series by temporarily skipping noisy or “collided” events (representing two neurons firing synchronously). This is accomplished by developing a neural network detection method followed by efficient outlier triaging. The clean waveforms are then used to infer the set of neural spike waveform templates through nonparametric Bayesian clustering. Our clustering approach adapts a “coreset” approach for data reduction and uses efficient inference methods in a Dirichlet process mixture model framework to dramatically improve the scalability and reliability of the entire pipeline. The “triaged” waveforms are then finally recovered with matching-pursuit deconvolution techniques. The proposed methods improve on the state-of-the-art in terms of accuracy and stability on both real and biophysically-realistic simulated MEA data. Furthermore, the proposed pipeline is efficient, learning templates and clustering faster than real-time for a ' 500-electrode dataset, largely on a single CPU core. 1 Introduction The analysis of large-scale multineuronal spike train data is crucial for current and future neuroscience research. These analyses are predicated on the existence of reliable and reproducible methods that feasibly scale to the increasing rate of data acquisition. A standard approach for collecting these data is to use dense multi-electrode array (MEA) recordings followed by “spike sorting” algorithms to turn the obtained raw electrical signals into spike trains. A crucial consideration going forward is the ability to scale to massive datasets: MEAs currently scale up to the order of 104 electrodes, but efforts are underway to increase this number to 106 electrodes1. At this scale any manual processing of the obtained data is infeasible. Therefore, automatic spike sorting for dense MEAs has enjoyed significant recent attention [15, 9, 51, 24, 36, 20, 33, 12]. Despite these efforts, spike sorting remains the major computational bottleneck in the scientific pipeline when using dense MEAs, due both to the high computational cost of the algorithms and the human time spent on manual postprocessing. To accelerate progress on this critical scientific problem, our proposed methodology is guided by several main principles. First, robustness is critical, since hand-tuning and post-processing is not 1DARPA Neural Engineering System Design program BAA-16-09 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. Algorithm 1 Pseudocode for the complete proposed pipeline. Input: time-series of electrophysiological data V 2 RT ⇥C, locations 2 R3 [waveforms, timestamps] Detection(V) % (Section 2.2) % “Triage” noisy waveforms and collisions (Section 2.4): [cleanWaveforms, cleanTimestamps] Triage(waveforms, timestamps) % Build a set of representative waveforms and summary statistics (Section 2.5) [representativeWaveforms, sufficientStatistics] coresetConstruction(cleanWaveforms) % DP-GMM clustering via divide-and-conquer (Sections 2.6 and 2.7) [{representativeWaveformsi, sufficientStatisticsi}i=1,...] splitIntoSpatialGroups(representativeWaveforms, sufficientStatistics, locations) for i=1,... do % Run efficient inference for the DP-GMM [clusterAssignmentsi] SplitMergeDPMM(representativeWaveformsi, sufficientStatisticsi) end for % Merge spatial neighborhoods and similar templates [allClusterAssignments, templates] mergeTemplates({clusterAssignmentsi}i=1,..., {representativeWaveformsi}i=1,..., locations) % Pursuit stage to recover collision and noisy waveforms [finalTimestamps, finalClusterAssignments] deconvolution(templates) return [finalTimestamps, finalClusterAssignments] feasible at scale. Second, scalability is key. To feasibly process the oncoming data deluge, we use efficient data summarizations wherever possible and focus computational power on the “hard cases,” using cheap fast methods to handle easy cases. Next, the pipeline should be modular. Each stage in the pipeline has many potential feasible solutions, and the pipeline is improved by rapidly iterating and updating each stage as methodology develops further. Finally, prior information is leveraged as much as possible; we share information across neurons, electrodes, and experiments in order to extract information from the MEA datastream as efficiently as possible. We will first outline the methodology that forms the core of our pipeline in Section 2.1, and then we demonstrate the improvements in performance on simulated data and a 512-electrode recording in Section 3. Further supporting results appear in the appendix. 2 Methods 2.1 Overview The inputs to the pipeline are the band-pass filtered voltage recordings from all C electrodes and their spatial layout, and the end result of the pipeline is the set of K (where K is determined by the algorithm) binary neural spike trains, where a “1” in the time series reflects a neural action potential from the kth neuron at the corresponding time point. The voltage signals are spatially whitened prior to processing and are modeled as the superposition of action potentials and background Gaussian noise [12]. Spatial whitening is performed by removing potential spikes using amplitude thresholding and estimating the whitening filter under a Gaussianity assumption. Succinctly, the pipeline is a multistage procedure as follows: (i) detecting waveforms and extracting features, (ii) screening outliers and collided waveforms, (iii) clustering, and (iv) inferring missed and collided spikes. Pseudocode for the flow of the pipeline can be found in Algorithm 1. A brief overview is below, followed by additional details. Our overall strategy can be considered a hybrid of a matching pursuit approach (similar to that employed by [36]) and a classical clustering approach, generalized and adapted to the large dense MEA setting. Our guiding philosophy is that it is essential to properly handle “collisions” between simultaneous spikes [37, 12], since collisions distort the extracted feature space and hinder clustering. A typical approach to this issue utilizes matching pursuit methods (or other sparse deconvolution strategies), but these methods are relatively computationally expensive compared to clustering primitives. This led us to a “triage-then-cluster-then-pursuit” approach: we “triage” collided or overly noisy waveforms, putting them aside during the feature extraction and clustering stages, and later recover these spikes during a final “pursuit” or deconvolution stage. The triaging begins during the detection stage in Section 2.2, where we develop a neural network based detection method that 2 significantly improves sensitivity and selectivity. For example, on a simulated 30 electrode dataset with low SNR, the new approach reduces false positives and collisions by 90% for the same rate of true positives. Furthermore, the neural network is significantly better at the alignment of signals, which improves the feature space and signal-to-noise power. The detected waveforms then are projected to a feature space and restricted to a local spatial subset of electrodes as in [24] in Section 2.3. Next, in Section 2.4 an outlier detection method further “triages” the detected waveforms and reduces false positives and collisions by an additional 70% while removing only a small percentage of real detections. All of these steps are achievable in nearly linear time. Simulations demonstrate that this large reduction in false positives and collisions dramatically improves accuracy and stability. Following the above steps, the remaining waveforms are partitioned into distinct neurons via clustering. Our clustering framework is based on the Dirichlet Process Gaussian Mixture Model (DP-GMM) approach [48, 9], and we modify existing inference techniques to improve scalability and performance. Succinctly, each neuron is represented by a distinct Gaussian distribution in the feature space. Directly calculating the clustering on all of the channels and all of the waveforms is computationally infeasible. Instead, the inference first utilizes the spatial locality via masking [24] from Section 2.3. Second, the inference procedure operates on a coreset of representative points [13] and the resulting approximate sufficient statistics are used in lieu of the full dataset (Section 2.5). Remarkably, we can reduce a dataset with 100k points to a coreset of ' 10k points with trivial accuracy loss. Next, split and merge methods are adapted to efficiently explore the clustering space [21, 24] in Section 2.6. Using these modern scalable inference techniques is crucial for robustness because they empirically find much more sensible and accurate optima and permit Bayesian characterization of posterior uncertainty. For very large arrays, instead of operating on all channels simultaneously, each distinct spatial neighborhood is processed by a separate clustering algorithm that may be run in parallel. This parallelization is crucial for processing very large arrays because it allows greater utilization of computer resources (or multiple machines). It also helps improve the efficacy of the split-merge inference by limiting the search space. This divide-and-conquer approach and the post-processing to stitch the results together is discussed in Section 2.7. The computational time required for the clustering algorithm scales nearly linearly with the number of electrodes C and the experiment time. After the clustering stage is completed, the means of clusters are used as templates and collided and missed spikes are inferred using the deconvolution (or “pursuit” [37]) algorithm from Kilosort [36], which recovers the final set of binary spike trains. We limit this computationally expensive approach only to sections of the data that are not well handled by the rest of the pipeline, and use the faster clustering approach to fill in the well-explained (i.e. easy) sections. We note finally that when memory is limited compared to the size of the dataset, the preprocessing, spike detection, and final deconvolution steps are performed on temporal minibatches of data; the other stages operate on significantly reduced data representations, so memory management issues typically do not arise here. See Section B.4 for further details on memory management. 2.2 Detection The detection stage extracts temporal and spatial windows around action potentials from the noisy raw electrophysiological signal V to use as inputs in the following clustering stage. The number of clean waveform detections (true positives) should be maximized for a given level of detected collision and noise events (false positives). Because collisions corrupt feature spaces [37, 12] and will simply be recovered during pursuit stage, they are not included as true positives at this stage. In contrast to the plethora of prior work on hand-designed detection rules (detailed in Section C.1), we use a data-driven approach with neural networks to dramatically improve both detection efficacy and alignment quality. The neural network is trained to return only clean waveforms on real data, not collisions, so it de facto performs a preliminary triage prior to the main triage stage in Section 2.4. The crux of the data-driven approach is the availability of prior training data. We are targeting the typical case that an experimental lab performs repeated experiments using the same recording setup from day to day. In this setting hand-curated or otherwise validated prior sorts are saved, resulting in abundant training data for a given experimental preparation. In the supplemental material, we discuss the construction of a training set (including data augmentation approaches) in Section C.2, the architecture and training of the network in Section C.3, the detection using the network in Section C.4, empirical performance in Section C.5, and scalability in Section C.5. This strategy is effective when 3 this training data exists; however, many research groups are currently using single electrodes and do not have dense MEA training data. Thus it is worth emphasizing that here we train the detector only on a single electrode. We have also experimented with training and evaluating on multiple electrodes with good success; however, these results are more specialized and are not shown here. A key result is that our neural network dramatically improves both the temporal and spatial alignment of detected waveforms. This improved alignment improves the fidelity of the feature space and the signal-to-noise power, and the result of the improved feature space can clearly be seen by comparing the detected waveform features from one standard detection approach (SpikeDetekt [24]) in Figure 1 (left) to the detected waveform features from our neural network in Figure 1 (middle). Note that the output of the neural net detection is remarkably more Gaussian compared to SpikeDetekt. 2.3 Feature Extraction and Mask Creation Following detection we have a collection of N events defined as Xn 2 RR⇥C for n = 1, . . . , N, each with an associated detection time tn. Recall that C is the total number of electrodes, and R is the number of time samples, in our case chosen to correspond to 1.5ms. Next features are extracted by using uncentered Principal Components Analysis (PCA) on each channel separately with P features per channel. Each waveform Xn is transformed to the feature space Yn. To handle duplicate spikes, Yn is kept only if cn = arg max{||ync||c2Ncn }, where Ncn contains all electrodes in the local neighborhood of electrode cn . To address the increasing dimensionality, spikes are localized by using the sparse masking vector {mn} 2 [0, 1]C method of [24], where the mask should be set to 1 only where the signal exists. The sparse vector reduces the dimensionality and facilitates sparse updates to improve computational efficiency. We give additional mathematical details in Supplemental Section D. We have also experimented with an autoencoder framework to standardize the feature extraction across channels and facilitate online inference. This approach performed similarly to PCA and is not shown here, but will be addressed in depth in future work. 2.4 Collision Screening and Outlier Triaging Many collisions and outliers remain even after our improved detection algorithm. Because these events destabilize the clustering algorithms, the pipeline benefits from a “triage” stage to further screen collisions and noise events. Note that triaging out a small fraction of true positives is a minor concern at this stage because they will be recovered in the final deconvolution step. We use a two-fold approach to perform this triaging. First, obvious collisions with nearly overlapping spike times and spatial locations are removed. Second, k-Nearest Neighbors (k-NN) is used to detect outliers in the masked feature space based on [27]. To develop a computationally efficient and effective approach, waveforms are grouped based on their primary (highest-energy) channel, and then k-NN is run for each channel. Empirically, these approximations do not suffer in efficacy compared to using the full spatial area. When the dimensionality of P, the number of features per channel, is low, a kd-tree can find neighbors in O(N log N) average time. We demonstrate that this method is effective for triaging false positives and collisions in Figure 1 (middle). 2.5 Coreset Construction “Big data” improves density estimates for clustering, but the cost per iteration naively scales with the amount of data. However, often data has some redundant features, and we can take advantage of these redundancies to create more efficient summarizations of the data. Then running the clustering algorithm on the summarized data should scale only with the number of summary points. By choosing representative points (or a “coreset") carefully we can potentially describe huge datasets accurately with a relatively small number of points [19, 13, 2]. There is a sizable literature on the construction of coresets for clustering problems; however, the number of required representative points to satisfy the theoretical guarantees is infeasible in this problem domain. Instead, we propose a simple approach to build coresets that empirically outperforms existing approaches in our experiments by forcing adequate coverage of the complete dataset. We demonstrate in Supplemental Figure S6 that this approach can cover clusters completely missed by existing approaches, and show the chosen representative points on data in Figure 1 (right). This algorithm is based on recursively performing k-means; we provide pseudocode and additional details 4 SpikeDetekt NN-triaged NN-kept coreset PC 1 PC 2 Figure 1: Illustration of Neural Network Detection, Triage, and Coreset from a primate retinal ganglion cell recording. The first column shows spike waveforms from SpikeDetekt in their PCA space. Due to poor alignment, clusters have a non-Gaussian shape with many outliers. The second column shows spike waveforms from our proposed neural network detection in the PCA space. After triaging outliers, the clusters have cleaner Gaussian shapes in the recomputed feature space. The last column illustrates the coreset. The size of each coreset diamond represents its weight. For visibility, only 10% of data are plotted. in in Supplemental Section E. The worst case time complexity is nearly linear with respect to the number of representative points, the number of detected spikes, and the number of channels. The algorithm ends by returning G representative points, their sufficient statistics, and masks. 2.6 Efficient Inference for the Dirichlet Process Gaussian Mixture Model For the clustering step we use a Dirichlet Process Gaussian Mixture Model (DP-GMM) formulation, which has been previously used in spike sorting [48, 9], to adaptively choose the number of mixture components (visible neurons). In contrast to these prior approaches, here we adopt a Variational Bayesian split-merge approach to explore the clustering space [21] and to find a more robust and higher-likelihood optimum. We address the high computational cost of this approach with several key innovations. First, following [24], we fit a mixture model on the virtual masked data to exploit the localized nature of the data. Second, following [9, 24], the covariance structure is approximated as a block-diagonal to reduce the parameter space and computation. Finally, we adapted the methodology to work with the representative points (coreset) rather than the raw data, resulting in a highly scalable algorithm. A more complete description of this stage can be found in Supplemental Section F, with pseudocode in Supplemental Algorithm S2. In terms of computational costs, the dominant cost per iteration in the DPMM algorithm is the calculation of data to cluster assignments, which in our framework will scale at O(G ¯mP 2K), where ¯m is the average number of channels maintained in the mask for each of the representative points, G is the number of representative points, and P is the number of features per channel. This is in stark contrast to a scaling of O(NC2P 2K + P 3) without our above modifications. Both K and G are expected to scale linearly with the number of electrodes and sublinearly with the length of the recording. Without further modification, the time complexity in the above clustering algorithm would depend on the square of the number of electrodes for each iteration; fortunately, this can be reduced to a linear dependency based on a divide-and-conquer approach discussed below in Section 2.7. 5 50 60 70 80 90 100 Stability % Threshold 0 20 40 60 80 % of x(%) Stable Clusters Stability (High Collision ViSAPy) 50 60 70 80 90 100 Stability % Threshold 0 20 40 60 % of x(%) Stable Clusters Stability (Low SNR ViSAPy) YASS Kilosort Mountain SpyKing 50 60 70 80 90 100 True Positive % Threshold 0 5 10 15 # of x(%) Accurate Clusters Accuracy (High Collision ViSAPy) YASS KiloSort Mountain SpyKING 50 60 70 80 90 100 True Positive % Threshold 0 5 10 15 # of x(%) Accurate Clusters Accuracy (Low SNR ViSAPy) Figure 2: Simulation results on 30-channel ViSAPy datasets. Left panels show the result on ViSAPy with high collision rate and Right panels show the result on ViSAPy with low SNR setting. (Top) stability metric (following [5]) and percentage of total discovered clusters above a certain stability measure. The noticeable gap between stability of YASS and the other methods results from a combination of high number of stable clusters and lower number of total clusters. (Bottom) These results show the number of clusters (out of a ground truth of 16 units) above a varying quality threshold for each pipeline. For each level of accuracy, the number of clusters that pass that threshold is calculated to demonstrate the relative quality of the competing algorithms on this dataset. Empirically, our pipeline (YASS) outperforms other methods. 2.7 Divide and Conquer and Template Merging Neural action potentials have a finite spatial extent [6]. Therefore, the spikes can be divided into distinct groups based on the geometry of the MEA and the local position of each neuron, and each group is then processed independently. Thus, each group can be processed in parallel, allowing for high data throughput. This is crucial for exploiting parallel computer resources and limited memory structures. Second, the split-and-merge approach in a DP-GMM is greatly hindered when the numbers of clusters is very high [21]. The proposed divide and conquer approach addresses this problem by greatly reducing the number of clusters within each subproblem, allowing the split and merge algorithm to be targeted and effective. To divide the data based on the spatial location of each spike, the primary channel cn is determined for every point in the coreset based on the channel with maximum energy, and clustering is applied on each channel. Because neurons may now end up on multiple channels, it is necessary to merge templates from nearby channels as a post-clustering step. When the clustering is completed, the mean of each cluster is taken as a template. Because waveforms are limited to their primary channel, some neurons may have “overclustered” and have a distinct mixture component on distinct channels. Also, overclustering can occur from model mismatch (non-Gaussianity). Therefore, it is necessary to merge waveforms. Template merging is performed based on two criteria, the angle and the amplitude of templates, using the best alignment on all temporal shifts between two templates. The pseudocode to perform this merging is shown in Supplemental Algorithm S3. Additional details can be found in Supplemental Section G. 6 50 60 70 80 90 100 Stability % Threshold 0 20 40 60 % of x(%) Stable Clusters Stability YASS Kilosort Mountain SpyKing 50 60 70 80 90 100 True Positive % Threshold 0 10 20 30 # of x(%) Accurate Clusters Accuracy Figure 3: Performance comparison of spike sorting pipelines on primate retina data. (Left) The same type of plot as in the top panels of Figure 2. (Right) The same type of plot as in the bottom panels of Figure 2 compared to the “gold standard” sort. YASS demonstrates both improved stability and also per-cluster accuracy. 2.8 Recovering Triaged Waveforms and Collisions After the previous steps, we apply matching pursuit [36] to recover triaged waveforms and collisions. We detail the available choices for this stage in Supplemental Section I. 3 Performance Comparison We evaluate performance to compare several algorithms (detailed in Section 3.1) to our proposed methodology on both synthetic (Section 3.2) and real (Section 3.3) dense MEA recordings. For each synthetic dataset we evaluate the ability to capture ground truth in addition to the per-cluster stability metrics. For the ground truth, inferred clusters are matched with ground truth clusters via the Hungarian algorithm, and then the per-cluster accuracy is calculated as the number of assignments shared between the inferred cluster and the ground truth cluster over the total number of waveforms in the inferred cluster. For the per-cluster stability metric, we use the method from Section 3.3 of [5] with the rate scaling parameter of the Poisson processes set to 0.25. This method evaluates how robust individual clusters are to perturbations of the dataset. In addition, we provide runtime information to empirically evaluate the computational scaling of each approach. The CPU runtime was calculated on a single core of a six-core i7 machine with 32GB of RAM. GPU runtime is given from a Nvidia Titan X within the same machine. 3.1 Competing Algorithms We compare our proposed pipeline to three recently proposed approaches for dense MEA spike sorting: KiloSort [36], Spyking Circus [51], and MountainSort [31]. Kilosort, Spyking Cricus, and MountainSort were downloaded on January 30, 2017, May 26th, 2017, and June 7th, 2017, respectively. We dub our algorithm Yet Another Spike Sorter (YASS). We discuss additional details on the relationships between these approaches and our pipeline in Supplemental Section I. All results are shown with no manual post-processing. 3.2 Synthetic Datasets First, we used the biophysics-based spike activity generator ViSAPy [18] to generate multiple 30channel datasets with different noise levels and collision rates. The detection network was trained on the ground truth from a low signal-to-noise level recording. Then, the trained neural network is applied to all signal-to-noise levels. The neural network dramatically outperforms existing detection methodologies on these datasets. For a given level of true positives, the number of false positives can be reduced by an order of magnitude. The properties of the learned network are shown in Supplemental Figures S4 and S5. Performance is evaluated on the known ground truth. For each level of accuracy, the number of clusters that pass that threshold is calculated to demonstrate the relative quality of the competing 7 Detection (GPU) Data Ext. Triage Coreset Clustering Template Ext. Total 1m7s 42s 11s 34s 3m12s 54s 6m40s Table 1: Running times of the main processes on 512-channel primate retinal recording of 30 minutes duration. Results shown using a single CPU core, except for the detection step (2.2), which was run on GPU. We found that full accuracy was achieved after processing just one-fifth of this dataset, leading to significant speed gains. Data Extraction refers to waveform extraction and Performing PCA (2.3). Triage, Coreset, and Clustering refer to 2.4, 2.5, and 2.6, respectively. Template Extraction describes revisiting the recording to estimate templates and merging them (2.7). Each step scales approximately linearly (Section B.3). algorithms on this dataset. Empirically, our pipeline (YASS) outperforms other methods. This is especially true in low SNR settings, as shown in Figure 2. The per-cluster stability metric is also shown in Figure 2. The stability result demonstrates that YASS has significantly fewer low-quality clusters than competing methods. 3.3 Real Datasets To examine real data, we focused on 30 minutes of extracellular recordings of the peripheral primate retina, obtained ex-vivo using a high-density 512-channel recording array [30]. The half-hour recording was taken while the retina was stimulated with spatiotemporal white noise. A “gold standard" sort was constructed for this dataset by extensive hand validation of automated techniques, as detailed in Supplemental Section H. Nonstationarity effects (time-evolution of waveform shapes) were found to be minimal in this recording (data not shown). We evaluate the performance of YASS and competing algorithms using 4 distinct sets of 49 spatially contiguous electrodes. Note that the gold standard sort here uses the information from the full 512-electrode array, while we examine the more difficult problem of sorting the 49-electrode data; we have less information about the cells near the edges of this 49-electrode subset, allowing us to quantify the performance of the algorithms over a range of effective SNR levels. By comparing the inferred results to the gold standard, the cluster-specific true positives are determined in addition to the stability metric. The results are shown in Figure 3 for one of the four sets of electrodes, and the remaining three sets are shown in Supplemental Section B.1. As in the simulated data, compared to KiloSort, which had the second-best overall performance on this dataset, YASS has dramatically fewer low-stability clusters. Finally, we evaluate the time required for each step in the YASS pipeline (Table 1). Importantly, we found that YASS is highly robust to data limitations: as shown in Supplemental Figure S3 and Section B.3, using only a fraction of the 30 minute dataset has only a minor impact on performance. We exploit this to speed up the pipeline. Remarkably, running primarily on a single CPU core (only the detect step utilizes a GPU here), YASS achieves a several-fold speedup in template and cluster estimation compared to the next fastest competitor2, Kilosort, which was run in full GPU mode and spent about 30 minutes on this dataset. We plan to further parallelize and GPU-ize the remaining steps in our pipeline next, and expect to achieve significant further speedups. 4 Conclusion YASS has demonstrated state-of-the-art performance in accuracy, stability, and computational efficiency; we believe the tools presented here will have a major practical and scientific impact in large-scale neuroscience. In our future work, we plan to continue iteratively updating our modular pipeline to better handle template drift, refractory violations, and dense collisions. Lastly, YASS is available online at https://github.com/paninski-lab/yass 2Spyking Circus took over a day to process this dataset. Assuming linear scaling based on smaller-scale experiments, Mountainsort is expected to take approximately 10 hours. 8 Acknowledgements This work was partially supported by NSF grants IIS-1546296 and IIS-1430239, and DARPA Contract No. N66001-17-C-4002. References [1] D. Arthur and S. Vassilvitskii. k-means++: The advantages of careful seeding. In ACM-SIAM Symposium on Discrete Algorithms. Society for Industrial and Applied Mathematics, 2007. [2] O. Bachem, M. Lucic, and A. Krause. Coresets for nonparametric estimation-the case of dp-means. In ICML, 2015. [3] B. Bahmani, B. Moseley, A. Vattani, R. Kumar, and S. Vassilvitskii. Scalable k-means++. Proceedings of the VLDB Endowment, 2012. [4] I. N. Bankman, K. O. Johnson, and W. Schneider. Optimal detection, classification, and superposition resolution in neural waveform recordings. IEEE Trans. Biomed. Eng. 1993. [5] A. H. Barnett, J. F. Magland, and L. F. Greengard. Validation of neural spike sorting algorithms without ground-truth information. J. Neuro. Methods, 2016. [6] G. Buzsáki. Large-scale recording of neuronal ensembles. Nature neuroscience, 2004. [7] T. Campbell, J. Straub, J. W. F. III, and J. P. How. Streaming, Distributed Variational Inference for Bayesian Nonparametrics. In NIPS, 2015. [8] D. Carlson, V. Rao, J. Vogelstein, and L. Carin. Real-Time Inference for a Gamma Process Model of Neural Spiking. NIPS, 2013. [9] D. E. Carlson, J. T. Vogelstein, Q. Wu, W. Lian, M. Zhou, C. R. Stoetzner, D. Kipke, D. Weber, D. B. Dunson, and L. Carin. Multichannel electrophysiological spike sorting via joint dictionary learning and mixture modeling. IEEE TBME, 2014. [10] B. Chen, D. E. Carlson, and L. Carin. On the analysis of multi-channel neural spike data. In NIPS, 2011. [11] D. M. Dacey, B. B. Peterson, F. R. Robinson, and P. D. Gamlin. Fireworks in the primate retina: in vitro photodynamics reveals diverse lgn-projecting ganglion cell types. Neuron, 2003. [12] C. Ekanadham, D. Tranchina, and E. P. Simoncelli. A unified framework and method for automatic neural spike identification. J. Neuro. Methods 2014. [13] D. Feldman, M. Faulkner, and A. Krause. Scalable training of mixture models via coresets. In NIPS, 2011. [14] J. Fournier, C. M. Mueller, M. Shein-Idelson, M. Hemberger, and G. Laurent. Consensus-based sorting of neuronal spike waveforms. PloS one, 2016. [15] F. Franke, M. Natora, C. Boucsein, M. H. J. Munk, and K. Obermayer. An online spike detection and spike classification algorithm capable of instantaneous resolution of overlapping spikes. J. Comp. Neuro. 2010. [16] S. Gibson, J. W. Judy, and D. Markovi. Spike Sorting: The first step in decoding the brain. IEEE Signal Processing Magazine, 2012. [17] I. Goodfellow, Y. Bengio, and A. Courville. Deep learning. MIT Press, 2016. [18] E. Hagen, T. V. Ness, A. Khosrowshahi, C. Sørensen, M. Fyhn, T. Hafting, F. Franke, and G. T. Einevoll. ViSAPy: a Python tool for biophysics-based generation of virtual spiking activity for evaluation of spike-sorting algorithms. J. Neuro. Methods 2015. [19] S. Har-Peled and S. Mazumdar. On coresets for k-means and k-median clustering. In ACM Theory of Computing. ACM, 2004. [20] G. Hilgen, M. Sorbaro, S. Pirmoradian, J.-O. Muthmann, I. Kepiro, S. Ullo, C. J. Ramirez, A. Maccione, L. Berdondini, V. Murino, et al. Unsupervised spike sorting for large scale, high density multielectrode arrays. Cell Reports, 2017. [21] M. C. Hughes and E. Sudderth. Memoized Online Variational Inference for Dirichlet Process Mixture Models. In NIPS, 2013. [22] H. Ishwaran and L. F. James. Gibbs sampling methods for stick-breaking priors. JASA, 2001. 9 [23] J. J. Jun, C. Mitelut, C. Lai, S. Gratiy, C. Anastassiou, and T. D. Harris. Real-time spike sorting platform for high-density extracellular probes with ground-truth validation and drift correction. bioRxiv, 2017. [24] S. N. Kadir, D. F. M. Goodman, and K. D. Harris. High-dimensional cluster analysis with the masked EM algorithm. Neural computation 2014. [25] K. H. Kim and S. J. Kim. Neural spike sorting under nearly 0-db signal-to-noise ratio using nonlinear energy operator and artificial neural-network classifier. IEEE TBME, 2000. [26] D. Kingma and J. Ba. Adam: A method for stochastic optimization. ICLR, 2015. [27] E. M. Knox and R. T. Ng. Algorithms for mining distance-based outliers in large datasets. In VLDB. Citeseer, 1998. [28] K. C. Knudson, J. Yates, A. Huk, and J. W. Pillow. Inferring sparse representations of continuous signals with continuous orthogonal matching pursuit. In NIPS, 2014. [29] M. S. Lewicki. A review of methods for spike sorting: the detection and classification of neural action potentials. Network: Computation in Neural Systems, 1998. [30] A. Litke, N. Bezayiff, E. Chichilnisky, W. Cunningham, W. Dabrowski, A. Grillo, M. Grivich, P. Grybos, P. Hottowy, S. Kachiguine, et al. What does the eye tell the brain?: Development of a system for the large-scale recording of retinal output activity. IEEE Trans. Nuclear Science, 2004. [31] J. F. Magland and A. H. Barnett. Unimodal clustering using isotonic regression: Iso-split. arXiv preprint arXiv:1508.04841, 2015. [32] S. Mukhopadhyay and G. C. Ray. A new interpretation of nonlinear energy operator and its efficacy in spike detection. IEEE TBME 1998. [33] J.-O. Muthmann, H. Amin, E. Sernagor, A. Maccione, D. Panas, L. Berdondini, U. S. Bhalla, and M. H. Hennig. Spike detection for large neural populations using high density multielectrode arrays. Frontiers in neuroinformatics, 2015. [34] R. M. Neal. Markov chain sampling methods for dirichlet process mixture models. Journal of computational and graphical statistics, 2000. [35] A. Y. Ng, M. I. Jordan, et al. On spectral clustering: Analysis and an algorithm. [36] M. Pachitariu, N. A. Steinmetz, S. N. Kadir, M. Carandini, and K. D. Harris. Fast and accurate spike sorting of high-channel count probes with kilosort. In NIPS, 2016. [37] J. W. Pillow, J. Shlens, E. J. Chichilnisky, and E. P. Simoncelli. A model-based spike sorting algorithm for removing correlation artifacts in multi-neuron recordings. PloS one 2013. [38] R. Q. Quiroga, Z. Nadasdy, and Y. Ben-Shaul. Unsupervised spike detection and sorting with wavelets and superparamagnetic clustering. Neural computation 2004. [39] H. G. Rey, C. Pedreira, and R. Q. Quiroga. Past, present and future of spike sorting techniques. Brain research bulletin, 2015. [40] A. Rodriguez and A. Laio. Clustering by fast search and find of density peaks. Science, 2014. [41] E. M. Schmidt. Computer separation of multi-unit neuroelectric data: a review. J. Neuro. Methods 1984. [42] R. Tarjan. Depth-first search and linear graph algorithms. SIAM journal on computing, 1972. [43] P. T. Thorbergsson, M. Garwicz, J. Schouenborg, and A. J. Johansson. Statistical modelling of spike libraries for simulation of extracellular recordings in the cerebellum. In IEEE EMBC. IEEE, 2010. [44] V. Ventura. Automatic Spike Sorting Using Tuning Information. Neural Computation, 2009. [45] R. J. Vogelstein, K. Murari, P. H. Thakur, C. Diehl, S. Chakrabartty, and G. Cauwenberghs. Spike sorting with support vector machines. In IEEE EMBS, volume 1. IEEE, 2004. [46] L. Wang and D. B. Dunson. Fast bayesian inference in dirichlet process mixture models. J. Comp. and Graphical Stat., 2011. [47] A. B. Wiltschko, G. J. Gage, and J. D. Berke. Wavelet filtering before spike detection preserves waveform shape and enhances single-unit discrimination. J. Neuro. Methods, 2008. 10 [48] F. Wood and M. J. Black. A nonparametric bayesian alternative to spike sorting. J. Neuro. Methods, 2008. [49] F. Wood, M. J. Black, C. Vargas-Irwin, M. Fellows, and J. P. Donoghue. On the variability of manual spike sorting. IEEE TBME 2004. [50] X. Yang and S. A. Shamma. A totally automated system for the detection and classification of neural spikes. IEEE Trans. Biomed. Eng. 1988. [51] P. Yger, G. L. Spampinato, E. Esposito, B. Lefebvre, S. Deny, C. Gardella, M. Stimberg, F. Jetter, G. Zeck, S. Picaud, et al. Fast and accurate spike sorting in vitro and in vivo for up to thousands of electrodes. bioRxiv, 2016. [52] L. Zelnik-Manor and P. Perona. Self-tuning spectral clustering. In NIPS, volume 17, 2004. 11
2017
72
7,212
Variational Laws of Visual Attention for Dynamic Scenes Dario Zanca DINFO, University of Florence DIISM, University of Siena dario.zanca@unifi.it Marco Gori DIISM, University of Siena marco@diism.unisi.it Abstract Computational models of visual attention are at the crossroad of disciplines like cognitive science, computational neuroscience, and computer vision. This paper proposes a model of attentional scanpath that is based on the principle that there are foundational laws that drive the emergence of visual attention. We devise variational laws of the eye-movement that rely on a generalized view of the Least Action Principle in physics. The potential energy captures details as well as peripheral visual features, while the kinetic energy corresponds with the classic interpretation in analytic mechanics. In addition, the Lagrangian contains a brightness invariance term, which characterizes significantly the scanpath trajectories. We obtain differential equations of visual attention as the stationary point of the generalized action, and we propose an algorithm to estimate the model parameters. Finally, we report experimental results to validate the model in tasks of saliency detection. 1 Introduction Eye movements in humans constitute an essential mechanism to disentangle the tremendous amount of information that reaches the retina every second. This mechanism in adults is very sophisticated. In fact, it involves both bottom-up processes, which depend on raw input features, and top-down processes, which include task dependent strategies [2; 3; 4]. It turns out that visual attention is interwound with high level cognitive processes, so as its deep understanding seems to be trapped into a sort of eggs-chicken dilemma. Does visual scene interpretation drive visual attention or the other way around? Which one “was born” first? Interestingly, this dilemma seems to disappears in newborns: despite their lack of knowledge of the world, they exhibit mechanisms of attention to extract relevant information from what they see [5]. Moreover, there are evidences that the very first fixations are highly correlated among adult subjects who are presented with a new input [25]. This shows that they still share a common mechanism that drive early fixations, while scanpaths diverge later under top-down influences. Many attempts have been made in the direction of modeling visual attention. Based on the feature integration theory of attention [14], Koch and Ullman in [9] assume that human attention operates in the early representation, which is basically a set of feature maps. They assume that these maps are then combined in a central representation, namely the saliency map, which drives the attention mechanisms. The first complete implementation of this scheme was proposed by Itti et al. in [10]. In that paper, feature maps for color, intensity and orientation are extracted at different scales. Then center-surround differences and normalization are computed for each pixel. Finally, all this information is combined linearly in a centralized saliency map. Several other models have been proposed by the computer vision community, in particular to address the problem of refining saliency maps estimation. They usually differ in the definition of saliency, while they postulate a centralized control of the attention mechanism through the saliency map. For instance, it has been claimed that 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. the attention is driven according to a principle of information maximization [16] or by an opportune selection of surprising regions [17]. A detailed description of the state of the art is given in [8]. Machine learning approaches have been used to learn models of saliency. Judd et al. [1] collected 1003 images observed by 15 subjects and trained an SVM classifier with low-, middle-, and high-level features. More recently, automatic feature extraction methods with convolutional neural networks achieved top level performance on saliency estimation [26; 18]. Most of the referred papers share the idea that saliency is the product of a global computation. Some authors also provide scanpaths of image exploration, but to simulate them over the image, they all use the procedure defined by [9]. The winner-take-all algorithm is used to select the most salient location for the first fixation. Then three rules are introduced to select the next location: inhibition-of-return, similarity preference, and proximity preference. An attempt of introducing biological biases has been made by [6] to achieve more realistic saccades and improve performance. In this paper, we present a novel paradigm in which visual attention emerges from a few unifying functional principles. In particular, we assume that attention is driven by the curiosity for regions with many details, and by the need to achieve brightness invariance, which leads to fixation and motion tracking. These principles are given a mathematical expression by a variational approach based on a generalization of least action, whose stationary point leads to the correspondent Euler-Lagrange differential equations of the focus of attention. The theory herein proposed offers an intriguing model for capturing a mechanisms behind saccadic eye movements, as well as object tracking within the same framework. In order to compare our results with the state of the art in the literature, we have also computed the saliency map by counting the visits in each pixel over a given time window, both on static and dynamic scenes. It is worth mentioning that while many papers rely on models that are purposely designed to optimize the approximation of the saliency map, for the proposed approach such a computation is obtained as a byproduct of a model of scanpath. The paper is organized as follows. Section 2 provides a mathematical description of the model and the Euler-Lagrange equations of motion that describe attention dynamics. The technical details, including formal derivation of the motion equations, are postponed to the Appendix. In the Section 3 we describe the experimental setup and show performance of the model in a task of saliency detection on two popular dataset of images [12; 11] and one dataset of videos [27]. Some conclusions and critical analysis are finally drawn in Section 4. 2 The model In this section, we propose a model of visual attention that takes place in the earliest stage of vision, which we assume to be completely data driven. We begin discussing the driving principles. 2.1 Principles of visual attention The brightness signal b(t, x) can be thought of as a real-valued function b : R+ × R2 →R (1) where t is the time and x = (x1, x2) denotes the position. The scanpath over the visual input is defined as x : R+ →R2 (2) The scanpath x(t) will be also referred to as trajectory or observation. Three fundamental principles drive the model of attention. They lead to the introduction of the correspondent terms of the Lagrangian of the action. i) Boundedness of the trajectory Trajectory x(t) is bounded into a defined area (retina). This is modeled by a harmonic oscillator at the borders of the image which constraints the motion within the retina1: V (x) = k X i=1,2 (li −xi)2 · [xi > li] + (xi)2 · [xi < 0]  (3) 1Here, we use Iverson’s notation, according to which if p is a proposition then [p] = 1 if p=true and [p] = 0 otherwise 2 where k is the elastic constant, li is the i-th dimension of the rectangle which represents the retina2. ii) Curiosity driven principle Visual attention is attracted by regions with many details, that is where the magnitude of the gradient of the brightness is high. In addition to this local field, the role of peripheral information is included by processing a blurred version p(t, x) of the brightness b(t, x). The modulation of these two terms is given by C(t, x) = b2 x cos2(ωt) + p2 x sin2(ωt), (4) where bx and px denote the gradient w.r.t. x. Notice that the alternation of the local and peripheral fields has a fundamental role in avoiding trapping into regions with too many details. iii) brightness invariance Trajectories that exhibit brightness invariance are motivated by the need to perform fixation. Formally, we impose the constraint ˙b = bt + bx ˙x = 0. This is in fact the classic constraint that is widely used in computer vision for the estimation of the optical flow [20]. Its soft-satisfaction can be expressed by the associated term B(t, x, ˙x) = bt + bx ˙x 2. (5) Notice that, in the case of static images, bt = 0, and the term is fully satisfied for trajectory x(t) whose velocity ˙x is perpendicular to the gradient, i.e.when the focus is on the borders of the objects. This kind of behavior favors coherent fixation of objects. Interestingly, in case of static images, the model can conveniently be simplified by using the upper bound of the brightness as follows: B(t, x, ˙x) = ˙b2(t, x) = (∂bt + bx ˙x)2 ≤ ≤2b2 t + 2b2 x ˙x2 := ¯B(t, x, ˙x) (6) This inequality comes from the parallelogram law of Hilbert spaces. As it will be seen the rest of the paper, this approximation significantly simplifies the motion equations. 2.2 Least Action Principle Visual attention scanpaths are modeled as the motion of a particle of mass m within a potential field. This makes it possible to construct the generalized action S = Z T 0 L(t, x, ˙x) dt (7) where L = K −U, where K is the kinetic energy K( ˙x) = 1 2m ˙x2 (8) and U is a generalized potential energy defined as U(t, x, ˙x) = V (x) −ηC(t, x) + λB(t, x, ˙x). (9) Here, we assume that η, λ > 0. Notice, in passing that while V and B get the usual sign of potentials, C comes with the flipped sign. This is due to the fact that, whenever it is large, it generates an attractive field. In addition, we notice that the brightness invariance term is not a truly potential, since it depends on both the position and the velocity. However, its generalized interpretation as a “potential” comes from considering that it generates a force field. In order to discover the trajectory we look for a stationary point of the action in Eq. (7), which corresponds to the Euler-Lagrange equations d dt ∂L ∂˙xi = ∂L ∂xi , (10) 2A straightforward extension can be given for circular retina. 3 where i = 1, 2 for the two motion coordinates. The right-hand term in (10) can be written as ∂L ∂x = ηCx −Vx −λBx. (11) Likewise we have d dt ∂L ∂˙x = m¨x −λ d dtB ˙x (12) so as the general motion equation turns out to be m¨x −λ d dtB ˙x + Vx −ηCx + λBx = 0. (13) These are the general equations of visual attention. In the Appendix we give the technical details of the derivations. Throughout the paper, the proposed model is referred to as the EYe MOvement Laws (EYMOL). 2.3 Parameters estimation with simulated annealing Different choices of parameters lead to different behaviors of the system. In particular, weights can emphasize the contribution of curiosity or brightness invariance terms. To better control the system we use two different parameters for the curiosity term, namely ηb and ηp, to weight b and p contributions respectively. The best values for the three parameters (ηb, ηp, λ) are estimated using the algorithm of simulated annealing (SA). This method allows to perform iterative improvements, starting from a known state i. At each step, the SA considers some neighbouring state j of the current state, and probabilistically moves to the new state j or stays on the current state i. For our specific problem, we limit our search to a parallelepiped-domain D of possible values, due to theoretical bounds and numerical3 issues. Distance between states i and j is proportional with a temperature T, which is initialized to 1 and decreases over time as Tk = α ∗Tk−1, where k identifies the iteration step, and 0 << α < 1. The iteration step is repeated until the system reaches a state that is good enough for the application, which in our case is to maximize the NSS similarity between human saliency maps and simulated saliency maps. Only a batch of a 100 images from CAT2000-TRAIN is used to perform the SA algorithm4. This batch is created by randomly selecting 5 images from each of the 20 categories of the dataset. To start the SA, parameters are initialized in the middle point of the 3-dimensional parameters domain D. The process is repeated 5 times, on different sub-samples, to select 5 parameters configurations. Finally, those configurations together with the average configuration are tested on the whole dataset, to select the best one. Algorithm 1 In the psedo-code, P() is the acceptance probability and score() is computed as the average of NSS scores on the sample batch of 100 images. 1: procedure SIMULATEDANNEALING 2: Select an initial state i ∈D 3: T ←1 4: do 5: Generate random state j, neighbor of i 6: if P(score(i), score(j)) ≥Random(0, 1) then 7: i ←j 8: end if 9: T ←α ∗T 10: while T ≥0.01 11: end procedure 3Too high values for ηb or ηp produce numerically unstable and unrealistic trajectories for the focus of attention. 4Each step of the SA algorithm needs evaluation over all the selected images. Considering the whole dataset would be very expensive in terms of time. 4 Model version MIT1003 CAT2000-TRAIN AUC NSS AUC NSS V1 (approx. br. inv.) 0.7996 (0.0002) 1.2784 (0.0003) 0.8393 (0.0001) 1.8208 (0.0015) V2 (exact br. inv.) 0.7990 (0.0003) 1.2865 (0.0039) 0.8376 (0.0013) 1.8103 (0.0137) Table 1: Results on MIT1003 [1] and CAT2000-TRAIN [11] of the two different version of EYMOL. Between brackets is indicated the standard error. 3 Experiments To quantitative evaluate how well our model predicts human fixations, we defined an experimental setup for salient detection both in images and in video. We used images from MIT1003 [1], MIT300 [12] and CAT2000 [11], and video from SFU [27] eye-tracking database. Many of the design choices were common to both experiments; when they differ, it is explicitly specified. 3.1 Input pre-processing All input images are converted to gray-scale. Peripheral input p is implemented as a blurred versions of the brightness b. This blurred version is obtained by convolving the original gray-scale image with a Gaussian kernel. For the images only, an algorithm identifies the rectangular zone of the input image in which the totality of information is contained in order to compute li in (14). Finally both b and p are multiplied by a Gaussian blob centered in the middle of the frame in order to make brightness gradients smaller as we move toward periphery and produce a center bias. 3.2 Saliency maps computation Differently by many of the most popular methodologies in the state-of-the-art [10; 16; 1; 24; 18], the saliency map is not itself the central component of our model but it can be naturally calculated from the visual attention laws in (13). The output of the model is a trajectory determined by a system of two second ordered differential equations, provided with a set of initial conditions. Since numerical integration of (13) does not raise big numerical difficulties, we used standard functions of the python scientific library SciPy [21]. Saliency map is then calculated by summing up the most visited locations during a sufficiently large number of virtual observations. For images, we collected data by running the model 199 times, each run was randomly initialized almost at the center of the image and with a small random velocity, and integrated for a running time corresponding to 1 second of visual exploration. For videos, we collected data by running the model 100 times, each run was initialized almost at the center of the first frame of the clip and with a small random velocity. Model that have some blur and center bias on the saliency map can improve their score with respect to some metrics. A grid search over blur radius and center parameter σ have been used, in order to maximize AUC-Judd and NSS score on the training data of CAT2000 in the case of images, and on SFU in case of videos. 3.3 Saliency detection on images Two versions of the the model have been evaluated. The first version V1 implementing brightness invariance in the approximated form (6), the second version V2 implementing the brightness invariance in its exact form, as described in the Appendix. Model V1 and V2 have been compared on the MIT1003 and CAT2000-TRAIN datasets, since they provide public data about fixations. Parameters estimation have been conducted independently for the two models and the best configuration for each one is used in this comparison. Results are statistically equivalent (see Table2) and this proves that, in the case of static images, the approximation is very good and does not cause loss in the score. For further experiments we decided to use the approximated form V1 due to its simpler form of the equation that also reduces time of computation. Model V1 has been evaluated in two different dataset of eye-tracking data: MIT300 and CAT2000TEST. In this case, scores were officially provided by MIT Saliency Benchmark Team [15]. Description of the metrics used is provided in [13]. Table 2 and Table 3 shows the scores of our 5 MIT300 AUC SIM EMD CC NSS KL Itti-Koch [10], implem. by [19] 0.75 0.44 4.26 0.37 0.97 1.03 AIM [16] 0.77 0.40 4.73 0.31 0.79 1.18 Judd Model [1] 0.81 0.42 4.45 0.47 1.18 1.12 AWS [24] 0.74 0.43 4.62 0.37 1.01 1.07 eDN [18] 0.82 0.44 4.56 0.45 1.14 1.14 EYMOL 0.77 0.46 3.64 0.43 1.06 1.53 Table 2: Results on MIT300 [12] provided by MIT Saliency Benchmark Team [15]. The models are sorted chronologically. In bold, the best results for each metric and benchmarks. CAT2000-TEST AUC SIM EMD CC NSS KL Itti-Koch [10], implem. by [19] 0.77 0.48 3.44 0.42 1.06 0.92 AIM [16] 0.76 0.44 3.69 0.36 0.89 1.13 Judd Model [1] 0.84 0.46 3.60 0.54 1.30 0.94 AWS [24] 0.76 0.49 3.36 0.42 1.09 0.94 eDN [18] 0.85 0.52 2.64 0.54 1.30 0.97 EYMOL 0.83 0.61 1.91 0.72 1.78 1.67 Table 3: Results on CAT2000 [11] provided by MIT Saliency Benchmark Team [15]. The models are sorted chronologically. In bold, the best results for each metric and benchmarks. model compared with five other popular method [10; 16; 1; 24; 18], which have been selected to be representative of different approaches. Despite its simplicity, our model reaches best score in half of the cases and for different metrics. 3.4 Saliency detection on dynamic scenes We evaluated our model in a task of saliency detection with the dataset SFU [27]. The dataset contains 12 clips and fixations of 15 observers, each of them have watched twice every video. Table 4 provides a comparison with other four model. Also in this case, despite of its simplicity and even if it was not designed for the specific task, our model competes well with state-of-the-art models. Our model can be easily run in real-time to produce an attentive scanpath. In some favorable case, it shows evidences of tracking moving objects on the scene. SFU Eye-Tracking Database EYMOL Itti-Koch [10] Surprise [17] Judd Model [1] HEVC [28] Mean AUC 0.817 0.70 0.66 0.77 0.83 Mean NSS 1.015 0.28 0.48 1.06 1.41 Table 4: Results on the video dataset SFU [27]. Scores are calculated as the mean of AUC and NSS metrics of all frames of each clip, and then averaged for the 12 clips. 4 Conclusions In this paper we investigated how human attention mechanisms emerge in the early stage of vision, which we assume completely data-driven. The proposed model consists of differential equations, which provide a real-time model of scanpath. These equations are derived in a generalized framework of least action, which nicely resembles related derivations of laws in physics. A remarkable novelty concerns the unified interpretation of curiosity-driven movements and the brightness invariance term for fixation and tracking, that are regarded as mechanisms that jointly contribute to optimize the acquisition of visual information. Experimental results on both image and video datasets of saliency are very promising, especially if we consider that the proposed theory offers a truly model of eye movements, whereas the computation of the saliency maps only arises as a byproduct. 6 In future work, we intend to investigate behavioural data, not only in terms of saliency maps, but also by comparing actual generated scanpaths with human data in order to discover temporal correlations. We aim at providing the integration of the presented model with a theory of feature extraction that is still expressed in terms of variational-based laws of learning [29]. Appendix: Euler-Lagrange equations In this section we explicitly compute the differential laws of visual attention that describe the visual attention scanpath, as the Euler-Lagrange equations of the action functional (7). First, we compute the partial derivatives of the different contributions w.r.t. x, in order to compute the exact contributions of (11). For the retina boundaries, Vx = k X i=1,2 −2 (li −xi) · [xi > li] + 2xi · [xi < 0]  (14) The curiosity term (4) Cx =2cos2(ωt)bx · bxx + 2sin2(ωt)px · pxx (15) For the term of brightness invariance, Bx = ∂ ∂x (bt + bx ˙x)2 (16) = 2 (bt + bx ˙x) (btx + bxx ˙x) (17) Since we assume b ∈C2(t, x), by the Schwarz’s theorem5, we have that btx = bxt, so that Bx = 2 (bt + bx ˙x) (bxt + bxx ˙x) (18) = 2(˙b)(˙bx) (19) We proceed by computing the contribution in (12). Derivative w.r.t. ˙x of the brightness invariance term is B ˙x = ∂ ∂˙x (bt + bx ˙x)2 (20) = 2 (bt + bx ˙x) bx (21) = 2(˙b)(bx) (22) So that, total derivative w.r.t. t can be write as d dtB ˙x =2  ¨bbx + ˙b˙bx  (23) We observe that ¨b ≡¨b(t, x, ˙x, ¨x) is the only term which depends on second derivatives of x. Since we are interested in expressing EL in an explicit form for the variable ¨x, we explore more closely its contribution ¨b(t, x, ˙x, ¨x) = d dt ˙b (24) = d dt(bt + bx ˙x) (25) =˙bt + ˙bx · ˙x + bx · ¨x (26) (27) Substituting it in (23) we have d dtB ˙x =2  (˙bt + ˙bx · ˙x + bx · ¨x)bx + ˙b˙bx  (28) =2  (˙bt + ˙bx · ˙x)bx + ˙b˙bx  + 2(bx · ¨x)bx (29) 5Schwarz’s theorem states that, if f : Rn →R has continuous second partial derivatives at any given point in Rn, then ∀i, j ∈{1, ..., n} it holds fxixj = fxjxi 7 So that, from (12) we get d dt ∂L ∂˙x = m¨x −2λ  (˙bt + ˙bx · ˙x)bx + ˙b˙bx + (bx · ¨x)bx  (30) Euler-Lagrange equations. Combining (11) and (30), we get Euler-Lagrange equation of attention m¨x −2λ  (˙bt + ˙bx · ˙x)(bx) + (˙b)(˙bx) + (bx · ¨x)bx  = ηCx −Vx −λBx (31) In order to obtain explicit form for the variable ¨x, we re-write the equation as to move to the left all contributes which do not depend on that variable. m¨x −2λ(bx · ¨x)bx =ηCx −Vx −λBx + 2λ((˙bt + ˙bx · ˙x)(bx) + (˙b)(˙bx)) (32) = ηCx −Vx + 2λ(˙bt + ˙bx · ˙x)(bx) | {z } A=(A1,A2) (33) In matrix form, the equation is  m¨x1 m¨x2  −  2λ(bx1 ¨x1 + bx2 ¨x2)bx1 2λ(bx1 ¨x1 + bx2 ¨x2)bx2  =  A1 A2  (34) which gives us the system of two differential equations m¨x1 −2λ(bx1 ¨x1 + bx2 ¨x2)bx1 = A1 m¨x2 −2λ(bx1 ¨x1 + bx2 ¨x2)bx2 = A2 (35) Grouping by same variable, (m −2λb2 x1)¨x1 −2λ(bx1bx2)¨x2 = A1 −2λ(bx1bx2)¨x1 + (m −2λb2 x2)¨x2 = A2 (36) We define D = (m −2λb2 x1) −2λ(bx1bx2) −2λ(bx1bx2) (m −2λb2 x2) (37) D1 = A1 −2λ(bx1bx2) A2 (m −2λb2 x2) , D2 = (m −2λb2 x1) A1 −2λ(bx1bx2) A2 (38) By the Cramer’s method we get differential equation of visual attention for the two spatial component, i.e.          ¨x1 = D1 D ¨x2 = D2 D (39) Notice that, this raise to a further condition over the parameter λ. In particular, in the case values of b(t, x) are normalized in the range [0, 1], it imposes to chose D ̸= 0 =⇒λ < m 4 (40) In fact, D = (m −2λb2 x1)(m −2λb2 x2) −4λ2(bx1bx2)2 (41) = m  m −2λ(b2 x1 + b2 x1)  (42) For values of bx = 0, we have that D = m2 > 0 (43) so that ∀t, we must impose D > 0. (44) 8 If λ > 0, then m −2λ(b2 x1 + b2 x1) > 0 (45) λ < m 2(b2x1 + b2x1) (46) The quantity on the right reaches its minimum at m 4 , so that the condition 0 < λ < m 4 (47) guarantees the well-posedness of the problem. References [1] Judd, T., Ehinger, K., Durand, F., Torralba, A.: Learning to Predict Where Humans Look. IEEE International Conference on Computer Vision (2009) [2] Itti, L., Koch, C.: Computational modelling of visual attention. Nature Reviews Neuroscience, vol 3, n 3, pp 194–203. (2001) [3] Connor, C.E., Egeth, H.E., Yantis, S.: Visual Attention: Bottom-Up Versus Top-Down. Current Biology, vol 14, n 19, pp R850–R852. (2004) [4] McMains, S., Kastner, S.: Interactions of Top-Down and Bottom-Up Mechanisms in Human Visual Cortex. Society for Neuroscience, vol 31, n 2, pp 587–597. (2011) [5] Hainline, L., Turkel, J., Abramov, I., Lemerise, E., Harris, C.M.: Characteristics of saccades in human infants. Vision Research, vol 24, n 12, pp 1771–1780. (1984) [6] Le Meur, O., Liu, Z.: Saccadic model of eye movements for free-viewing condition. Vision Research, vol 116, pp 152–164. (2015) [7] Gelfand, I.M., Fomin, S.V.: Calculus of Variation. Englewood : Prentice Hall (1993) [8] Borji, A., Itti, L.: State-of-the-Art in Visual Attention Modeling. IEEE Transactions on Pattern Analysis and Machine Intelligence, vol 35, n 1. (2013) [9] Koch, C., Ullman, S.: Shifts in selective visual attention: towards the underlying neural circuitry. Springer Human Neurobiology, vol 4, n 4, pp 219-227. (1985) [10] Itti, L., Koch, C.: A Model of Saliency-Based Visual Attention for Rapid Scene Analysis. IEEE Transactions on Pattern Analysis and Machine Intelligence, vol 20, n 11. (1998) [11] Borji, A., Itti, L.: CAT2000: A Large Scale Fixation Dataset for Boosting Saliency Research. arXiv:1505.03581. (2015) [12] Judd, T., Durand, F., Torralba, A.:: A Benchmark of Computational Models of Saliency to Predict Human Fixations. MIT Technical Report. (2012) [13] Bylinskii, Z., Judd, T., Oliva, A., Torralba, A.: What do different evaluation metrics tell us about saliency models? arXiv:1604.03605. (2016) [14] Treisman, A.M., Gelade, G.: A Feature Integration Theory of Attention. Cognitive Psychology, vol 12, pp 97-136. (1980) [15] Bylinskii, Z., Judd, T., Borji, A., Itti, L., Durand, F., Torralba, A.: MIT Saliency Benchmark. http://saliency.mit.edu/ [16] Bruce, N., Tsotsos, J.: Attention based on information maximization. J. Vis., vol 7, n 9. (2007) [17] Itti, L., Baldi, P.: Bayesian Surprise Attracts Human Attention. Vision Research, vol 49, n 10, pp 1295–1306. (2009) 9 [18] Vig, E., Dorr, M., Cox, D.: Large-Scale Optimization of Hierarchical Features for Saliency Prediction in Natural Images. IEEE Conference on Computer Vision and Pattern Recognition. (2014) [19] Harel, J.: A Saliency Implementation in MATLAB . http://www.klab.caltech.edu/ harel/share/gbvs.php [20] Horn, B.K.P., Schunck, B.G.: Determining optical flow. Artificial Intelligence, vol 17, n 1, pp 185-203. (1981) [21] Jones, E., Travis, O., Peterson, P.: SciPy: Open source scientific tools for Python. http://www.scipy.org/. (2001) [22] Zhang, J., Sclaroff, S.: Saliency detection: a Boolean map approach . Proc. of the IEEE International Conference on Computer Vision. (2013) [23] Cornia, M., Baraldi, L., Serra, G., Cucchiara, R.: Predicting Human Eye Fixations via an LSTM-based Saliency Attentive Model. http://arxiv.org/abs/1611.09571. (2016) [24] Garcia-Diaz, A., Leborán, V., Fdez-Vida, X.R., Pardo, X.M.: On the relationship between optical variability, visual saliency, and eye fixations: Journal of Vision, vol 12, n 6, pp 17. (2012) [25] Tatler, B.W., Baddeley, R.J., Gilchrist, I.D.: Visual correlates of fixation selection: Effects of scale and time. Vision Research, vol 45, n 5, pp 643-659. (2005) [26] Kruthiventi, S.S.S., Ayush, K., Venkatesh, R.:DeepFix: arXiv:1510.02927. (2015) [27] Hadizadeh, H., Enriquez, M.J., Bajic, I.V.: Eye-Tracking Database for a Set of Standard Video Sequences. IEEE Transactions on Image Processing. (2012) [28] Xu, M., Jiang, L., Ye, Z., Wang, Z.: Learning to Detect Video Saliency With HEVC Features. IEEE Transactions on Image Processing. (2017) [29] Maggini, M., Rossi, A.: On-line Learning on Temporal Manifolds. AI*IA 2016 Advances in Artificial Intelligence Springer International Publishing, pp 321–333. (2016) 10
2017
73
7,213
How regularization affects the critical points in linear networks Amirhossein Taghvaei∗ Coordinated Science Laboratory University of Illinois at Urbana-Champaign Urbana, IL, 61801 taghvae2@illinois.edu Jin W. Kim Coordinated Science Laboratory University of Illinois at Urbana-Champaign Urbana, IL, 61801 jkim684@illinois.edu Prashant G. Mehta Coordinated Science Laboratory University of Illinois at Urbana-Champaign Urbana, IL, 61801 mehtapg@illinois.edu Abstract This paper is concerned with the problem of representing and learning a linear transformation using a linear neural network. In recent years, there is a growing interest in the study of such networks, in part due to the successes of deep learning. The main question of this body of research (and also of our paper) is related to the existence and optimality properties of the critical points of the mean-squared loss function. An additional primary concern of our paper pertains to the robustness of these critical points in the face of (a small amount of) regularization. An optimal control model is introduced for this purpose and a learning algorithm (backprop with weight decay) derived for the same using the Hamilton’s formulation of optimal control. The formulation is used to provide a complete characterization of the critical points in terms of the solutions of a nonlinear matrix-valued equation, referred to as the characteristic equation. Analytical and numerical tools from bifurcation theory are used to compute the critical points via the solutions of the characteristic equation. 1 Introduction This paper is concerned with the problem of representing and learning a linear transformation with a linear neural network. Although a classical problem (Baldi and Hornik [1989, 1995]), there has been a renewed interest in such networks (Saxe et al. [2013], Kawaguchi [2016], Hardt and Ma [2016], Gunasekar et al. [2017]) because of the successes of deep learning. The motivation for studying linear networks is to gain insight into the optimization problem for the more general nonlinear networks. A ∗Financial support from the NSF CMMI grant 1462773 is gratefully acknowledged. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. focus of the recent research on these (and also nonlinear) networks has been on the analysis of the critical points of the non-convex loss function (Dauphin et al. [2014], Choromanska et al. [2015a,b], Soudry and Carmon [2016], Bhojanapalli et al. [2016]). This is also the focus of our paper. Problem: The input-output model is assumed to be of the following linear form: Z = RX0 + ξ (1) where X0 ∈Rd×1 is the input, Z ∈Rd×1 is the output, and ξ ∈Rd×1 is the noise. The input X0 is modeled as a random variable whose distribution is denoted as p0. Its second moment is denoted as Σ0 := E[X0X⊤ 0 ] and assumed to be finite. The noise ξ is assumed to be independent of X0, with zero mean and finite variance. The linear transformation R ∈Md(R) is assumed to satisfy a property (P1) introduced in Sec. 3 (Md(R) denotes the set of d × d matrices). The problem is to learn the weights of a linear neural network from i.i.d. input-output samples {(Xk 0 , Zk)}K k=1. Solution architecture: is a continuous-time linear feedforward neural network model: dXt dt = AtXt (2) where At ∈Md(R) are the network weights indexed by continuous-time (surrogate for layer) t ∈[0, T], and X0 is the initial condition at time t = 0 (same as the input data). The parameter T denotes the network depth. The optimization problem is to choose the weights At over the time-horizon [0, T] to minimize the mean-squared loss function: E[|XT −Z|2] (3) This problem is referred to as the [λ = 0] problem. Backprop is a stochastic gradient descent algorithm for learning the weights At. In general, one obtains (asymptotic) convergence of the learning algorithm to a (local) minimum of the optimization problem Lee et al. [2016], Ge et al. [2015]. This has spurred investigation of the critical points of the loss function (3) and the optimality properties (local vs. global minima, saddle points) of these points. For linear multilayer (discrete) neural networks (MNN), strong conclusions have been obtained under rather mild conditions: every local minimum is a global minimum and every critical point that is not a local minimum is a saddle point Kawaguchi [2016], Baldi and Hornik [1989]. For the discrete counterpart of the [λ = 0] problem (referred to as the linear residual network in Hardt and Ma [2016]), an even stronger conclusion is possible: all critical points of the [λ = 0] problem are global minimum. In experiments, some of these properties are also empirically observed in deep nonlinear networks; cf., Choromanska et al. [2015b], Dauphin et al. [2014], Saxe et al. [2013]. In this paper, we consider the following regularized form of the optimization problem: Minimize: A J[A] = E[ λ Z T 0 1 2tr (A⊤ t At) dt + 1 2|XT −Z|2 ] Subject to: dXt dt = AtXt, X0 ∼p0 (4) where λ ∈R+ := {x ∈R : x ≥0} is a regularization parameter. In literature, this form of regularization is referred to as weight decay [Goodfellow et al., 2016, Sec. 7.1.1]. Eq. (4) is an example of an optimal control problem and is referred to as such. The limit λ ↓0 is referred to as [λ = 0+] problem. The symbol tr(·) and superscript ⊤are used to denote matrix trace and matrix transpose, respectively. The regularized problem is important because of the following reasons: 2 (i) The learning algorithms are believed to converge to the critical points of the regularized [λ = 0+] problem, a phenomenon known as implicit regularization Neyshabur et al. [2014], Zhang et al. [2016], Gunasekar et al. [2017]. (ii) It is shown in the paper that the stochastic gradient descent (for the functional J) yields the following learning algorithm for the weights At: A(k+1) t = A(k) t + ηk(−λA(k) t + backprop update) (5) for k = 1, 2, . . ., where ηk is the learning rate parameter. Thus, the parameter λ models dissipation (or weight decay) in backprop. In an implementation of backprop, one would expect to obtain critical points of the [λ = 0+] problem. The outline of the remainder of this paper is as follows: The Hamilton’s formulation is introduced for the optimal control problem (4) in Sec. 2; cf., LeCun et al. [1988], Farotimi et al. [1991] for related constructions. The Hamilton’s equations are used to obtain a formula for the gradient of J, and subsequently derive the stochastic gradient descent learning algorithm of the form (5). The equations for the critical points of J are obtained by applying the Maximum Principle of optimal control (Prop. 1). Remarkably, the Hamilton’s equations for the critical points can be solved in closed-form to obtain a characterization of the critical points in terms of the solutions of a nonlinear matrix-valued equation, referred to as the characteristic equation (Prop. 2). For a certain special case, where the matrix R is normal, analytical results are obtained based on the use of the implicit function theorem (Thm. 2). Numerical continuation is employed to compute the solutions for this and the more general non-normal cases (Examples 1 and 2). 2 Hamilton’s formulation and the learning algorithm Definition 1. The control Hamiltonian is the function H(x, y, B) = y⊤Bx −λ 2 tr(B⊤B) (6) where x ∈Rd is the state, y ∈Rd is the co-state, and B ∈Md(R) is the weight matrix. The partial derivatives are denoted as ∂H ∂x (x, y, B) := B⊤y, ∂H ∂y (x, y, B) := Bx, and ∂H ∂B (x, y, B) := yx⊤−λB. Pontryagin’s Maximum Principle (MP) is used to obtain the Hamilton’s equations for the solution of the optimal control problem (4). The MP represents a necessary condition satisfied by any minimizer. Conversely, a solution of the Hamilton’s equation is a critical point of the functional J. The proof of the following proposition appears in the supplementary material. Proposition 1. Consider the terminal cost optimal control problem (4) with λ ≥0. Suppose At is the minimizer and Xt is the corresponding trajectory. Then there exists a random process Y : [0, T] →Rd such that dXt dt = +∂H ∂y (Xt, Yt, At) = +AtXt, X0 ∼p0 (7) dYt dt = −∂H ∂x (Xt, Yt, At) = −A⊤ t Yt, YT = Z −XT (8) and At maximizes the expected value of the Hamiltonian At = arg max B ∈Md(R) E[H(Xt, Yt, B)] (λ>0) = 1 λE[Yt X⊤ t ] (9) Conversely, if there exists At and the pair (Xt, Yt) such that equations (7)-(8)-(9) are satisfied, then At is a critical point of the optimization problem (4). 3 Remark 1. The Maximum Principle can also be used to derive analogous (difference) equations in discrete-time as well as nonlinear settings. It is equivalent to the method of Lagrange multipliers that is used to derive the backprop algorithm in MNN, e.g., LeCun et al. [1988]. The continuous-time limit is considered here because the computations are simpler and the results are more insightful. Similar considerations have also motivated the study of continuous-time limit of other types of optimization algorithms, e.g., Su et al. [2014], Wibisono et al. [2016]. The Hamiltonian is also used to express the first order variation in the functional J. For this purpose, define the Hilbert space of matrix-valued functions L2([0, T]; Md(R)) := {A : [0, T] →Md(R) | R T 0 tr(A⊤ t At) dt < ∞} with the inner product ⟨A, V ⟩L2 := R T 0 tr(A⊤ t Vt) dt. For any A ∈L2, the gradient of the functional J evaluated at A is denoted as ∇J[A] ∈L2. It is defined using the directional derivative formula: ⟨∇J[A], V ⟩L2 := lim ϵ→0 J(A + ϵV ) −J(A) ϵ where V ∈L2 prescribes the direction (variation) along which the derivative is being computed. The explicit formula for ∇J is given by ∇J[A] := −E  ∂H ∂B (Xt, Yt, At)  = λAt −E  Yt X⊤ t  (10) where Xt and Yt are the obtained by solving the Hamilton’s equations (7)-(8) with the prescribed (not necessarily optimal) weight matrix A ∈L2. The significance of the formula is that the steepest descent in the objective function J is obtained by moving in the direction of the steepest (for each fixed t ∈[0, T]) ascent in the Hamiltonian H. Consequently, a stochastic gradient descent algorithm to learn the weights is as follows: A(k+1) t = A(k) t −ηk(λA(k) t −Y (k) t X(k) t ⊤), (11) where ηk is the step-size at iteration k and X(k) t and Y (k) t are obtained by solving the Hamilton’s equations (7)-(8): (Forward propagation) d dtX(k) t = +A(k) t X(k) t , with init. cond. X(k) 0 (12) (Backward propagation) d dtY (k) t = −A(k)⊤ t Y (k) t , Y (k) T = Z(k) −X(k) T | {z } error (13) based on the sample input-output (X(k), Z(k)). Note the forward-backward structure of the algorithm: In the forward pass, the network output X(k) T is obtained given the input X(k) 0 ; In the backward pass, the error between the network output X(k) T and true output Z(k) is computed and propagated backwards. The regularization parameter is also interpreted as the dissipation or the weight decay parameter. By setting λ = 0, the standard backprop algorithm is obtained. A convergence result for the learning algorithm for the [λ = 0] case appears as part of the supplementary material. In the remainder of this paper, the focus is on the analysis of the critical points. 3 Critical points For continuous-time networks, the critical points of the [λ = 0] problem are all global minimizers (An analogous result for residual MNN appears in [Hardt and Ma, 2016, Thm. 2.3]). Theorem 1. Consider the [λ = 0] optimization problem (4) with non-singular Σ0. For this problem (provided a minimizer exists) every critical point is a global minimizer. That is, ∇J[A] = 0 ⇐⇒ J(A) = J∗:= min A J[A] 4 Moreover, for any given (not necessarily optimal) A ∈L2, ∥∇J[A]∥2 L2 ≥T e−2 R T 0 √tr(A⊤ t At) dt λmin(Σ0)(J(A) −J∗) (14) where λmin(Σ0) is the smallest eigenvalue of Σ0. Proof. (Sketch) For the linear system (2), the fundamental solution matrix is denoted as φt;t0. The solutions of the Hamilton’s equations (7)-(8) are given by Xt = φt;0X0, Yt = φ⊤ T ;t(Z −XT ) Using the formula (10) upon taking an expectation ∇J[A] = −φ⊤ T ;t(R −φT ;0)Σ0φ⊤ t;0 which (because φ is invertible) proves that: ∇J[A] = 0 ⇐⇒ φT ;0 = R ⇐⇒ J(A) = J∗:= min A J[A] The derivation of the bound (14) is equally straightforward and appears as part of the supplementary material. Although the result is attractive, the conclusion is somewhat misleading because (as we will demonstrate with examples) even a small amount of regularization can lead to local (but not global) minimum as well as saddle point solutions. Assumption: The following assumption is made throughout the remainder of this paper: (i) Property P1: The matrix R has no eigenvalues on R−:= {x ∈R : x ≤0}. The matrix R is non-derogatory. That is, no eigenvalue of R appears in more than one Jordan block. For the scalar (d = 1) case, this property means R is strictly positive. For the scalar case, the fundamental solution is given by the closed form formula φT,0 = e R T 0 At dt. Thus, the positivity of R is seen to be necessary to obtain a meaningful solution. For the vector case, this property represents a sufficient condition such that log(R) can be defined as a real-valued matrix. That is, under property (P1), there exists a (not necessarily unique2) matrix log(R) ∈Md(R) whose matrix exponential elog(R) = R; cf., Culver [1966], Higham [2014]. The logarithm is trivially a minimum for the [λ = 0] problem. Indeed, At ≡ 1 T log(R) gives Xt = e log(R) T tX0 and thus XT = elog(R)X0 = RX0. This shows At can be made arbitrarily small by choosing a large enough depth T of the network. An analogous result for the linear residual MNN appears in [Hardt and Ma, 2016, Thm. 2.1]. The question then is whether the constant solution At ≡1 T log(R) is also obtained as a critical point for the [λ = 0+] problem? The following proposition provides a complete characterization of the critical points (for the general λ ∈R+ problem) in terms of the solutions of a matrix-valued characteristic equation: Proposition 2. The general solution of the Hamilton’s equations (7)-(9) is given by Xt = e2tΩetC⊤X0 (15) Yt = e2tΩe(T −t)C e−2T Ω(Z −XT ) (16) At = e2tΩCe−2tΩ (17) 2Under Property (P1), log(R) is uniquely defined if and only if all the eigenvalues of R are positive. When not unique there are countably many matrix logarithms, all denoted as log(R). The principal logarithm of R is the unique such matrix whose eigenvalues lie in the strip {z ∈C : −π < Im(z) < π}. 5 where C ∈Md(R) is an arbitrary solution of the characteristic equation λC = F ⊤(R −F)Σ0 (18) where F := e2T ΩeT C⊤and the matrix Ω:= 1 2(C −C⊤) is the skew-symmetric component of C. The associated cost is given by J[A] = λT 2 tr C⊤C  + 1 2tr (F −R)⊤(F −R)Σ0  + 1 2E[|ξ|2] And the following holds: At ≡C ⇐⇒C is normal (Σ0=I) =⇒ R is normal Proof. (Sketch) Differentiating both sides of (9) with respect to t and using the Hamilton’s equations (7)-(8), one obtains dAt dt = −A⊤ t At + AtA⊤ t whose general solution is given by (17). The remainder of the analysis is straightforward and appears as part of the supplementary material. Remark 2. Prop. 2 shows that the answer to the question posed above concerning the constant solution At ≡ 1 T log(R) is false in general for the [λ = 0+] problem: For λ > 0 and Σ0 = I, a constant solution is a critical point only if R is a normal matrix. For the generic case of non-normal R, any critical point is necessarily non-constant for any positive choice of the parameter λ. Some of these non-constant critical points are described as part of the Example 2. Remark 3. The linear structure of the input-output model (1) is not necessary to derive the results in Prop. 2. For correlated input-output random variables (X, Z), the general form of the characteristic equation is as follows: λC = F ⊤(E[ZX⊤ 0 ] −FΣ0) where (as before) Σ0 = E[X0X⊤ 0 ], and F := e2T ΩeT C⊤where Ω:= 1 2(C −C⊤). Prop. 2 is useful because it helps reduce the infinite-dimensional problem to a finite-dimensional characteristic equation (18). The solutions C of the characteristic equation fully parametrize the solutions of the Hamilton’s equations (7)-(9) which in turn represent the critical points of the optimal control problem (4). The matrix-valued nonlinear characteristic equation (18) is still formidable. To gain analytical and numerical insight into the matrix case, the following strategy is employed: (i) A solution C is obtained by setting λ = 0 in the characteristic equation. The corresponding equation is eT (C−C⊤)eT C⊤= R This solution is denoted as C(0). (ii) Implicit function theorem is used to establish (local) existence of a solution branch C(λ) in a neighborhood of the λ = 0 solution. (iii) Numerical continuation is used to compute the solution C(λ) as a function of the parameter λ. The following theorem provides a characterization of normal solutions C for the case where R is assumed to be a normal matrix and Σ = I. Its proof appears as part of the supplementary material. Theorem 2. Consider the characteristic equation (18) where R is assumed to be a normal matrix that satisfies the Property (P1) and Σ0 = I. 6 Figure 1: (a) Critical points in Example 1 (the (2, 1) entry of the solution matrix C(λ; n) is depicted for n = 0, ±1, ±2); (b) The cost J[A] for these solutions. (i) For λ = 0 the normal solutions of (18) are given by 1 T log(R). (ii) For each such solution, there exists a neighborhood N ⊂R+ of λ = 0 such that the solution of the characteristic equation (18) is well-defined as a continuous map from λ ∈N →C(λ) ∈ Md(R) with C(0) = 1 T log(R). This solution is given by the asymptotic formula C(λ) = 1 T log(R) −λ T 2 (RR⊤)−1 log(R) + O(λ2) Remark 4. For the scalar case log(·) is a single-valued function. Therefore, At ≡C = 1 T log(R) is the unique critical point (minimizer) for the [λ = 0+] problem. While the [λ = 0+] problem admits a unique minimizer, the [λ = 0] problem does not. In fact, any At of the form At = 1 T log(R) + ˜At where R T 0 ˜At dt = 0 is also a minimizer of the [λ = 0] problem. So, while there are infinitely many minimizers of the [λ = 0] problem, only one of these survives with even a small amount of regularization. A global characterization of critical points as a function of parameters (λ, R, Σ0, T) ∈ R+ × R+ × R+ × R+ is possible and appears as part of the supplementary material. Example 1 (Normal matrix case). Consider the characteristic equation (18) with R = " 0 −1 1 0 # (rotation in the plane by π/2), Σ0 = I and T = 1. For λ = 0, the normal solutions of the characteristic equation are given by the multi-valued matrix logarithm function: log(R) = (π/2 + 2nπ) " 0 −1 1 0 # =: C(0; n), n = 0, ±1, ±2, . . . It is easy to verify that eC(0;n) = R. C(0; 0) is referred to as the principal logarithm. The software package PyDSTool Clewley et al. [2007] is used to numerically continue the solution C(λ; n) as a function of the parameter λ. Fig. 1(a) depicts the solutions branches in terms of the (2, 1) entry of the matrix C(λ; n) for n = 0, ±1, ±2. The following observations are made concerning these solutions: (i) For each fixed n ̸= 0, there exist a range (0, ¯λn) for which there exist two solutions, a local minimum and a saddle point. At the limit (turning) point λ = ¯λn, there is a qualitative change in the solution from a minimum to a saddle point. (ii) As a function of n, ¯λn decreases monotonically as |n| increases. For λ > ¯λ−1, only a single solution, the principal branch C(λ; 0) was found using numerical continuation. 7 Figure 2: (a) Numerical continuation of the solution in Example 2; (b) The cost J[A] for the critical point (minimum) and the constant 1 T log(R) solution. (iii) Along the branch with a fixed n ̸= 0, as λ ↓0, the saddle point solution escapes to infinity. That is as λ ↓0, the saddle point solution C(λ; n) →(π/2 + (2n −1)π) " −∞ −1 1 −∞ # . The associated cost J[A] ↓1 (The cost of global minimizer J∗= 0). (iv) Among the numerically obtained solution branches, the principal branch C(λ; 0) has the lowest cost. Fig. 1 (b) depicts the cost for the solutions depicted in Fig. 1 (a). The numerical calculations indicate that while the [λ = 0] problem has infinitely many critical points (all global minimizers), only a finitely many critical points persist for any finite positive value of λ. Moreover, there exists both local (but not global) minimum as well as saddle points for this case. Among the solutions computed, the principal branch (continued from the principal logarithm C(0; 0)) has the minimum cost. Example 2 (Non-normal matrix case). Numerical continuation is used to obtain solutions for nonnormal R = " 0 −1 1 µ # , where µ is a continuation parameter and T = 1. Fig. 2(a) depicts a solution branch as a function of parameter µ. The solution is initialized with the normal solution C(0; 0) described in Example 1. By varying µ, the solution is continued to µ = π/2 (indicated as ⋄in part (a)). This way, the solution C = " 0 0 π 2 0 # is found for R = " 0 −1 1 π 2 # . It is easy to verify that C is a solution of the characteristic equation (18) for λ = 0 and T = 1. For this solution, the critical point of the optimal control problem At = " −π sin(πt) π cos(πt) −π π cos(πt) + π π sin(πt) # is non-constant. The principal logarithm log(R) = " −γ tan γ −γ sec γ γ sec γ γ tan γ # , where γ = sin−1 π 4  . The regularization cost for the non-constant solution At is strictly smaller than the constant 1 T log(R) solution: Z 1 0 tr(AtA⊤ t ) dt = Z 1 0 tr(CC⊤) dt = π2 4 < 3.76 = Z 1 0 tr(log(R) log(R)⊤) dt Next, the parameter µ = π 2 is fixed, and the solution continued in the parameter λ. Fig. 2(b) depicts the cost J[A] for the resulting solution branch of critical points (minimum). The cost with the constant 1 T log(R) is also depicted. It is noted that the latter is not a critical point of the optimal control problem for any positive value of λ. 8 4 Conclusions and directions for future work In this paper, we studied the optimization problem of learning the weights of a linear neural network with mean-squared loss function. In order to do so, we introduced a novel formulation: (i) The linear network is modeled as a continuous time (surrogate for layer) optimal control problem; (ii) A weight decay type regularization is considered where the interest is in the limit as the regularization parameter λ ↓0 (the limit is referred to as the [λ = 0+] problem). The Maximum Principle of optimal control theory is used to derive the Hamilton’s equations for the critical points. A remarkable result of our paper is that the critical point solutions of the infinite-dimensional problem are completely characterized via the solutions of a finite-dimensional characteristic equation (Eq. (18)). That such a reduction is possible is unexpected because the weight update equation is nonlinear (even in the settings of linear networks). Based on the analysis of the characteristic equation, several conclusions are obtained3: (i) It has been noted in literature that, for linear networks, all critical points are global minimum. While this is also true here for the [λ = 0] and the [λ = 0+] problems, even a small amount of regularization alters the picture, e.g., saddle points emerge (Example 1). (ii) The critical points of the regularized [λ = 0+] problem is qualitatively very different compared to the non-regularized [λ = 0] problem (Remark 4). Several quantitative results on the critical points of the regularized problem are described in Theorem 2 and Examples 1 and 2. (iii) The study of the characteristic equation revealed an unexpected qualitative difference in the critical points between the two cases where R := E[ZX⊤ 0 ] is a normal or non-normal matrix. In the latter (generic) case, the network weights are necessarily non-constant (Prop. 2). We believe that the ideas and tools introduced in this paper will be useful for the researchers working on the analysis of deep learning. In particular, the paper is expected to highlight and spur work on implicit regularization. Some directions for future work are briefly noted next: (i) Non-normal solutions of the characteristic equation: Analysis of the non-normal solutions of the characteristic equation remains an open problem. The non-normal solutions are important because of the following empirical observation (summarized as part of the supplementary material): In numerical experiments with learning, the weights can get stuck at non-normal critical points before eventually converging to a “good” minimum. (ii) Generalization error: With a finite number of samples (Xi 0, Zi)N i=1, the characteristic equation λC = F ⊤(R −F)Σ(N) 0 + F ⊤Q(N) where Σ(N) 0 := 1 N PN i=1 Xi 0Xi 0 ⊤and Q(N) := 1 N PN i=1 Xi 0ξi⊤. Sensitivity analysis of the solution of the characteristic equation, with respect to variations in Σ(N) 0 and Q(N), can shed light on the generalization error for different critical points. (iii) Second order analysis: The paper does not contain second order analysis of the critical points – to determine whether they are local minimum or saddle points. Based on certain preliminary results for the scalar case, it is conjectured that the second order analysis is possible in terms of the first order variation for the characteristic equation. 3Qualitative aspects of some of the conclusions may be obvious to experts in Deep Learning. The objective here is to obtain quantitative characterization in the (relatively tractable) setting of linear networks. 9 References P. F. Baldi and K. Hornik. Neural networks and principal component analysis: Learning from examples without local minima. Neural networks, 2(1):53–58, 1989. P. F. Baldi and K. Hornik. Learning in linear neural networks: A survey. IEEE Transactions on neural networks, 6(4):837–858, 1995. S. Bhojanapalli, B. Neyshabur, and N. Srebro. Global optimality of local search for low rank matrix recovery. In Advances in Neural Information Processing Systems, pages 3873–3881, 2016. A. Choromanska, M. Henaff, M. Mathieu, G. B. Arous, and Y. LeCun. The loss surfaces of multilayer networks. In AISTATS, 2015a. A. Choromanska, Y. LeCun, and G. B. Arous. Open problem: The landscape of the loss surfaces of multilayer networks. In COLT, pages 1756–1760, 2015b. R. Clewley, W. E. Sherwood, M. D. LaMar, and J. Guckenheimer. Pydstool, a software environment for dynamical systems modeling, 2007. URL http://pydstool.sourceforge.net. W. J. Culver. On the existence and uniqueness of the real logarithm of a matrix. Proceedings of the American Mathematical Society, 17(5):1146–1151, 1966. 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. O. Farotimi, A. Dembo, and T. Kailath. A general weight matrix formulation using optimal control. IEEE Transactions on neural networks, 2(3):378–394, 1991. R. Ge, F. Huang, C. Jin, and Y. Yuan. Escaping From Saddle Points — Online Stochastic Gradient for Tensor Decomposition. arXiv:1503.02101, March 2015. I. Goodfellow, Y. Bengio, and A. Courville. Deep learning. MIT press, 2016. S. Gunasekar, B. Woodworth, S. Bhojanapalli, B. Neyshabur, and N. Srebro. Implicit regularization in matrix factorization. arXiv preprint arXiv:1705.09280, 2017. M. Hardt and T. Ma. Identity matters in deep learning. arXiv:1611.04231, November 2016. N. J. Higham. Functions of matrices. CRC Press, 2014. K. Kawaguchi. Deep learning without poor local minima. In Advances In Neural Information Processing Systems, pages 586–594, 2016. Y. LeCun, D. Touresky, G. Hinton, and T. Sejnowski. A theoretical framework for back-propagation. In The Connectionist Models Summer School, volume 1, pages 21–28, 1988. J. D. Lee, M. Simchowitz, M. I. Jordan, and B. Recht. Gradient Descent Converges to Minimizers. arXiv:1602.04915, February 2016. B. Neyshabur, R. Tomioka, and N. Srebro. In search of the real inductive bias: On the role of implicit regularization in deep learning. arXiv preprint arXiv:1412.6614, 2014. 10 A. M. Saxe, J. L. McClelland, and S. Ganguli. Exact solutions to the nonlinear dynamics of learning in deep linear neural networks. arXiv:1312.6120, December 2013. D. Soudry and Y. Carmon. No bad local minima: Data independent training error guarantees for multilayer neural networks. arXiv:1605.08361, May 2016. W. Su, S. Boyd, and E. Candes. A differential equation for modeling nesterov’s accelerated gradient method: Theory and insights. In Advances in Neural Information Processing Systems, pages 2510–2518, 2014. A. Wibisono, A. Wilson, and M. Jordan. A variational perspective on accelerated methods in optimization. Proceedings of the National Academy of Sciences, page 201614734, 2016. C. Zhang, S. Bengio, M. Hardt, B. Recht, and O. Vinyals. Understanding deep learning requires rethinking generalization. arXiv preprint arXiv:1611.03530, 2016. 11
2017
74
7,214
On Tensor Train Rank Minimization: Statistical Efficiency and Scalable Algorithm Masaaki Imaizumi Institute of Statistical Mathematics RIKEN Center for Advanced Intelligence Project imaizumi@ism.ac.jp Takanori Maehara RIKEN Center for Advanced Intelligence Project takanori.maehara@riken.jp Kohei Hayashi National Institute of Advanced Industrial Science and Technology RIKEN Center for Advanced Intelligence Project hayashi.kohei@gmail.com Abstract Tensor train (TT) decomposition provides a space-efficient representation for higher-order tensors. Despite its advantage, we face two crucial limitations when we apply the TT decomposition to machine learning problems: the lack of statistical theory and of scalable algorithms. In this paper, we address the limitations. First, we introduce a convex relaxation of the TT decomposition problem and derive its error bound for the tensor completion task. Next, we develop a randomized optimization method, in which the time complexity is as efficient as the space complexity is. In experiments, we numerically confirm the derived bounds and empirically demonstrate the performance of our method with a real higher-order tensor. 1 Introduction Tensor decomposition is an essential tool for dealing with data represented as multidimensional arrays, or simply, tensors. Through tensor decomposition, we can determine latent factors of an input tensor in a low-dimensional multilinear space, which saves the storage cost and enables predicting missing elements. Note that, a different multilinear interaction among latent factors defines a different tensor decomposition model, which yields several variations of tensor decomposition. For general purposes, however, either Tucker decomposition [29] or CANDECOMP/PARAFAC (CP) decomposition [8] model is commonly used. In the past three years, an alternative tensor decomposition model, called tensor train (TT) decomposition [21] has actively been studied in machine learning communities for such as approximating the inference on a Markov random field [18], modeling supervised learning [19, 24], analyzing restricted Boltzmann machine [4], and compressing deep neural networks [17]. A key property is that, for higher-order tensors, TT decomposition provides more space-saving representation called TT format while preserving the representation power. Given an order-K tensor (i.e., a K-dimensional tensor), the space complexity of Tucker decomposition is exponential in K, whereas that of TT decomposition 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. is linear in K. Further, on TT format, several mathematical operations including the basic linear algebra operations can be performed efficiently [21]. Despite its potential importance, we face two crucial limitations when applying this decomposition to a much wider class of machine learning problems. First, its statistical performance is unknown. In Tucker decomposition and its variants, many authors addressed the generalization error and derived statistical bounds (e.g. [28, 27]). For example, Tomioka et al.[28] clarify the way in which using the convex relaxation of Tucker decomposition, the generalization error is affected by the rank (i.e., the dimensionalities of latent factors), dimension of an input, and number of observed elements. In contrast, such a relationship has not been studied for TT decomposition yet. Second, standard TT decomposition algorithms, such as alternating least squares (ALS) [6, 30] , require a huge computational cost. The main bottleneck arises from the singular value decomposition (SVD) operation to an “unfolding” matrix, which is reshaped from the input tensor. The size of the unfolding matrix is huge and the computational cost grows exponentially in K. In this paper, we tackle the above issues and present a scalable yet statistically-guaranteed TT decomposition method. We first introduce a convex relaxation of the TT decomposition problem and its optimization algorithm via the alternating direction method of multipliers (ADMM). Based on this, a statistical error bound for tensor completion is derived, which achieves the same statistical efficiency as the convex version of Tucker decomposition does. Next, because the ADMM algorithm is not sufficiently scalable, we develop an alternative method by using a randomization technique. At the expense of losing the global convergence property, the dependency of K on the time complexity is reduced from exponential to quadratic. In addition, we show that a similar error bound is still guaranteed. In experiments, we numerically confirm the derived bounds and empirically demonstrate the performance of our method using a real higher-order tensor. 2 Preliminaries 2.1 Notation Let X ⇢RI1⇥···⇥IK be the space of order-K tensors, where Ik denotes the dimensionality of the k-th mode for k = 1, . . . , K. For brevity, we define I<k := Q k0<k Ik0; similarly, Ik, Ik< and Ikare defined. For a vector Y 2 Rd, [Y ]i denotes the i-th element of Y . Similarly, [X]i1,...,iK denotes the (i1, . . . , iK) elements of a tensor X 2 X. Let [X]i1,...,ik−1,:,ik+1,...,iK denote an Ikdimensional vector (Xi1,...,ik−1,j,ik+1,...,iK)Ik j=1 called the mode-k fiber. For a vector Y 2 Rd, kY k = (Y T Y )1/2 denotes the `2-norm and kY k1 = maxi |[Y ]i| denotes the max norm. For tensors X, X0 2 X, an inner product is defined as hX, X0i := PI1...IK i1,...,iK=1 X(i1, . . . , iK)X0(i1, . . . , iK) and kXkF = hX, Xi1/2 denotes the Frobenius norm. For a matrix Z, kZks := P j σj(Z) denotes the Schatten-1 norm, where σj(·) is a j-th singular value of Z. 2.2 Tensor Train Decomposition Let us define a tuple of positive integers (R1, . . . , RK−1) and an order-3 tensor Gk 2 RIk⇥Rk−1⇥Rk for each k = 1, . . . , K. Here, we set R0 = RK = 1. Then, TT decomposition represents each element of X as follows: Xi1,...,iK = [G1]i1,:,:[G2]i2,:,: · · · [GK]iK,:,:. (1) Note that [Gk]ik,:,: is an Rk−1 ⇥Rk matrix. We define G := {Gk}K k=1 as a set of the tensors, and let X(G) be a tensor whose elements are represented by G as (1). The tuple (R1, . . . , RK−1) controls the complexity of TT decomposition, and it is called a Tensor Train (TT) rank. Note that TT decomposition is universal, i.e., any tensor can be represented by TT decomposition with sufficiently large TT rank [20]. When we evaluate the computational complexity, we assume the shape of G is roughly symmetric. That is, we assume there exist I, R 2 N such that Ik = O(I) for k = 1, . . . , K and Rk = O(R) for k = 1, . . . , K −1. 2 2.3 Tensor Completion Problem Suppose there exists a true tensor X⇤2 X that is unknown, and a part of the elements of X⇤is observed with some noise. Let S ⇢{(j1, j2, . . . , jK)}I1,...,IK j1,...,jK=1 be a set of indexes of the observed elements and n := |S| QK k=1 Ik be the number of observations. Let j(i) be an i-th element of S for i = 1, . . . , n, and yi denote i-th observation from X⇤with noise. We consider the following observation model: yi = [X⇤]j(i) + ✏i, (2) where ✏i is i.i.d. noise with zero mean and variance σ2. For simplicity, we introduce observation vector Y := (y1, . . . , yn), noise vector E := (✏1, . . . , ✏n), and rearranging operator X : X ! Rn that randomly picks the elements of X. Then, the model (2) is rewritten as follows: Y = X(X⇤) + E. The goal of tensor completion is to estimate the true tensor X⇤from the observation vector Y . Because the estimation problem is ill-posed, we need to restrict the degree of freedom of X⇤, such as rank. Because the direct optimization of rank is difficult, its convex surrogation is alternatively used [2, 3, 11, 31, 22]. For tensor completion, the convex surrogation yields the following optimization problem [5, 14, 23, 26]: min X2⇥ 1 2nkY −X(X)k2 + λnkXks⇤ $ , (3) where ⇥⇢X is a convex subset of X, λn ≥0 is a regularization coefficient, and k · ks⇤is the overlapped Schatten norm defined as kXks⇤:= 1 K PK k=1 k e X(k)ks. Here, e X(k) is the k-unfolding matrix defined by concatenating the mode-k fibers of X. The overlapped Schatten norm regularizes the rank of X in terms of Tucker decomposition [16, 28]. Although the Tucker rank of X⇤is unknown in general, the convex optimization adjusts the rank depending on λn. To solve the convex problem (3), the ADMM algorithm is often employed [1, 26, 28]. Since the overlapped Schatten norm is not differentiable, the ADMM algorithm avoids the differentiation of the regularization term by alternatively minimizing the augmented Lagrangian function iteratively. 3 Convex Formulation of TT Rank Minimization To adopt TT decomposition to the convex optimization problem as (3), we need the convex surrogation of TT rank. For that purpose, we introduce the Schatten TT norm [22] as follows: kXks,T := 1 K −1 K−1 X k=1 kQk(X)ks := 1 K −1 K−1 X k=1 X j σj(Qk(X)), (4) where Qk : X ! RIk⇥Ik< is a reshaping operator that converts a tensor to a large matrix where the first k modes are combined into the rows and the rest K −k modes are combined into the columns. Oseledets et al.[21] shows that the matrix rank of Qk(X) can bound the k-th TT rank of X, implying that the Schatten TT norm surrogates the sum of the TT rank. Putting the Schatten TT norm into (3), we obtain the following optimization problem: min X2X 1 2nkY −X(X)k2 + λnkXks,T $ . (5) 3.1 ADMM Algorithm To solve (5), we consider the augmented Lagrangian function L(x, {Zk}K−1 k=1 , {↵k}K−1 k=1 ), where x 2 R Q k Ik is the vectorization of X, Zk is a reshaped matrices with size Ik⇥Ik<, and ↵k 2 R Q k Ik is a coefficient for constraints. Given initial points (x(0), {Z(0) k }k, {↵(0) k }k), the `-th step of ADMM 3 is written as follows: x(`+1) = e⌦T Y + n⌘ 1 K −1 K−1 X k=1 (Vk(Z(`) k ) −↵(`) k ) ! /(1 + n⌘K), Z(`+1) k = proxλn/⌘(V −1 k (x(`+1) + ↵(`) k )), k = 1, . . . , K, ↵(`+1) k = ↵(`) k + (x(`+1) −Vk(Z(`+1) k )), k = 1, . . . , K. Here, e⌦is an n ⇥QIk k=1 matrix that works as the inversion mapping of X; Vk is a vectorizing operator of an Ik ⇥Ik< matrix; prox(·) is the shrinkage operation of the singular values as proxb(W) = U max{S −bI, 0}V T , where USV T is the singular value decomposition of W; ⌘> 0 is a hyperparameter for a step size. We stop the iteration when the convergence criterion is satisfied (e.g. as suggested by Tomioka et al.[28]). Since the Schatten TT norm (4) is convex, the sequence of the variables of ADMM is guaranteed to converge to the optimal solution ([5, Theorem 5.1]). We refer to this algorithm as TT-ADMM. TT-ADMM requires huge resources in terms of both time and space. For the time complexity, the proximal operation of the Schatten TT norm, namely the SVD thresholding of V −1 k , yields the dominant complexity, which is O(I3K/2) time. For the space complexity, we have O(K) variables of size O(IK), which requires O(KIK) space. 4 Alternating Minimization with Randomization In this section, we consider reducing the space complexity for handling higher order tensors. The idea is simple: we only maintain the TT format of the input tensor rather than the input tensor itself. This leads the following optimization problem: min G 1 2nkY −X(X(G))k2 + λnkX(G)ks,T $ . (6) Remember that G = {Gk}k is the set of TT components and X(G) is the tensor given by the TT format with G. Now we only need to store the TT components G, which drastically improves the space efficiency. 4.1 Randomized Schatten TT norm We approximate the optimization of the Schatten TT norm. To avoid the computation of exponentially large-scale SVDs in the Schatten TT norm, we employ a technique called the “very sparse random projection” [12]. The main idea is that, if the size of a matrix is sufficiently larger than its rank, then its singular values (and vectors) are well preserved even after the projection by a sparse random matrix. This motivates us to use the Schatten TT norm over the random projection. Preliminary, we introduce tensors for the random projection. Let D1, D2 2 N be the size of the matrix after projection. For each k = 1, . . . , K −1 and parameters, let ⇧k,1 2 RD1⇥I1⇥···⇥Ik be a tensor whose elements are independently and identically distributed as follows: [⇧k,1]d1,i1,...,ik = 8 < : + p s/d1 with probability 1/2s, 0 with probability 1 −1/s, − p s/d1 with probability 1/2s, (7) for i1, . . . , ik and d1 = 1, . . . , D1. Here, s > 0 is a hyperparameter controlling sparsity. Similarly, we introduce a tensor ⇧k,2 2 RD2⇥Ik+1⇥···⇥IK−1 that is defined in the same way as ⇧k,1. With ⇧k,1 and ⇧k,2, let Pk : X ! RD1⇥D2 be a random projection operator whose element is defined as follows: [Pk(X)]d1,d2 = I1 X j1=1 · · · IK X jK=1 [⇧k,1]d1,j1,...,jk[X]j1,...,jK[⇧k,2]d2,jk+1,...,jK. (8) 4 Note that we can compute the above projection by using the facts that X has the TT format and the projection matrices are sparse. Let ⇡(k) j be a set of indexes of non-zero elements of ⇧k,j. Then, using the TT representation of X, (8) is rewritten as [Pk(X(G))]d1,d2 = X (j1,...,jk)2⇡(k) 1 [⇧k,1]d1,j1,...,jk[G1]j1 · · · [Gk]jk X (jk+1,...,jK)2⇡(k) 2 [Gk]jk+1 · · · [GK]jK[⇧k,2]d2,jk+1,...,jK, If the projection matrices have only S nonzero elements (i.e., S = |⇡(1) j | = |⇡(2) j |), the computational cost of the above equation is O(D1D2SKR3). The next theorem guarantees that the Schatten-1 norm of Pk(X) approximates the original one. Theorem 1. Suppose X 2 X has TT rank (R1, . . . , Rk). Consider the reshaping operator Qk in (4), and the random operator Pk as (8) with tensors ⇧k,1 and ⇧k,2 defined as (7). If D1, D2 ≥ max{Rk, 4(log(6Rk) + log(1/✏))/✏2}, and all the singular vectors u of Q(X)k are well-spread as P j |uj|3 ✏/(1.6kps), we have 1 −✏ Rk kQk(X)ks kPk(X)ks (1 + ✏)kQk(X)ks, with probability at least 1 −✏. Note that the well-spread condition can be seen as a stronger version of the incoherence assumption which will be discussed later. 4.2 Alternating Minimization Note that the new problem (6) is non-convex because X(G) does not form a convex set on X. However, if we fix G except for Gk, it becomes convex with respect to Gk. Combining with the random projection, we obtain the following minimization problem: min Gk " 1 2nkY −X(X(G))k2 + λn K −1 K−1 X k0=1 kPk0(X(G))ks # . (9) We solve this by the ADMM method for each k = 1, . . . , K. Let gk 2 RIkRk−1Rk be the vectorization of Gk, and Wk0 2 RD1⇥D2 be a matrix for the randomly projected matrix. The augmented Lagrangian function is then given by Lk(gk, {Wk0}K−1 k0=1, {βk0}K−1 k0=1), where {βk0 2 RD1D2}K−1 k0=1 are the Lagrange multipliers. Starting from initial points (g(0) k , {W (0) k0 }K−1 k0=1, {β(0) k0 }K−1 k0=1), the `-th ADMM step is written as follows: g(`+1) k = ⌦T ⌦/n + ⌘ K−1 X k0=1 ΓT k0Γk0 !−1 ⌦T Y/n + 1 K −1 K−1 X k0=1 ΓT k0(⌘eVk(W (`) k0 ) −β(`) k0 ) ! , W (`+1) k0 = proxλn/⌘ ⇣ eV −1 k (Γk0g(`+1) k + β(`) k0 ) ⌘ , k0 = 1, . . . , K −1, β(`+1) k0 = β(`) k0 + (Γk0g(`+1) k −eVk(W (`+1) k0 )), k0 = 1, . . . , K −1. Here, Γ(k) 2 RD1D2⇥IkRk−1Rk is the matrix imitating the mapping Gk 7! Pk(X(Gk; G\{Gk})), eVk is a vectorizing operator of D1 ⇥D2 matrix, and ⌦is an n ⇥IkRk−1Rk matrix of the operator X ◦X(·; G\{Gk}) with respect to gk. Similarly to the convex approach, we iterate the ADMM steps until convergence. We refer to this algorithm as TT-RAM, where RAM stands for randomized least square. The time complexity of TT-RAM at the `-th iteration is O((n + KD2)KI2R4); the details are deferred to Supplementary material. The space complexity is O(n + KI2R4), where O(n) is for Y and O(KI2R4) is for the parameters. 5 5 Theoretical Analysis In this section, we investigate how the TT rank and the number of observations affect to the estimation error. Note that all the proofs of this section are deferred to Supplementary material. 5.1 Convex Solution To analyze the statistical error of the convex problem (5), we assume the incoherence of the reshaped version of X⇤. Assumption 2. (Incoherence Assumption) There exists k 2 {1, . . . , K} such that a matrix Qk(X⇤) has orthogonal singular vectors {ur 2 RIk, vr 2 RIk<}Rk r=1 satisfying max 1iI<k kPUeik (µRk/Ik) 1 2 and max 1iI<k kPV eik (µRk/Ik<) 1 2 with some 0 µ < 1. Here, PU and PV are linear projections onto spaces spanned by {ur}r and {vr}r; {ei}i is the natural basis. Intuitively, the incoherence assumption requires that the singular vectors for the matrix Qk(X⇤) are well separated. This type of assumption is commonly used in the matrix and tensor completion studies [2, 3, 31]. Under the incoherence assumption, the error rate of the solution of (5) is derived. Theorem 3. Let X⇤2 X be a true tensor with TT rank (R1, . . . , RK−1), and let b X 2 X be the minimizer of (3). Suppose that λn ≥kX⇤(E)k1/n and that Assumption 2 for some k0 2 {1, 2, . . . , K} is satisfied. If n ≥Cm0µ2 k0 max{Ik0, Ik0<}Rk0 log3 max{Ik0, Ik0<} with a constant Cm0, then with probability at least 1 −(max{Ik0, Ik0<})−3 and with a constant CX, k b X −X⇤kF CX λn K K−1 X k=1 p Rk. Theorem 3 states that the bound for the statistical error gets larger as the TT rank increases. In other words, completing a tensor is relatively easy as long as the tensor has small TT rank. Also, when we set λn ! 0 as n increases, we can state the consistency of the minimizer. The result of Theorem 3 is similar to that obtained from the studies on matrix completion [3, 16] and tensor completion with the Tucker decomposition or SVD [28, 31]. Note that, although Theorem 3 is for tensor completion, the result can easily be generalized to other settings such as the tensor recovery or the compressed sensing problems. 5.2 TT-RAM Solution Prior to the analysis, let G⇤be the true TT components such that X⇤= X(G⇤). For simplification, we assume that the elements of G⇤are normalized, i.e., kGkk = 1, 8k, and an Rk ⇥Ik−1Ik matrix reshaped from G⇤ k has a Rk row rank. In addition to the incoherence property (Assumption 2), we introduce an additional assumption on the initial point of the ALS iteration. Assumption 4. (Initial Point Assumption) Let Ginit := {Ginit k }K k=1 be the initial point of the ALS iteration procedure. Then, there exists a finite constant Cγ that satisfies max k2{1,...,K} kGinit k −G⇤ kkF Cγ. Assumption 4 requires that the initial point is sufficiently close to the true solutions G⇤. Although the ALS method is not guaranteed to converge to the global optimum in general, Assumption 4 guarantees the convergence to the true solutions [25]. Now we can evaluate the error rate of the solution obtained by TT-RAM. 6 Theorem 5. Let X(G⇤) be the true tensor generated by G⇤with TT rank (R1, . . . , RK−1), and bG = Gt be the solution of TT-RAM at the t-th iteration. Further, suppose that Assumption 2 for some k0 2 {1, 2, . . . , K} and Assumption 4 are satisfied, and suppose that Theorem (1) holds with ✏> 0 for k = 1, . . . , K. Let Cm, CA, CB > 0 be 0 < χ < 1 be some constants. If n ≥Cmµ2 k0Rk0 max{Ik0, Ik0<} log3 max{Ik0, Ik0<}, and the number of iterations t satisfies t ≥(log χ)−1{log(CBλnK−1(1 + ✏) P k pRk) −log Cγ}, then with probability at least 1 −✏(max{Ik0, Ik0<})−3 and for λn ≥kX⇤(E)k1/n, kX( bG) −X(G⇤)kF CA(1 + ✏)λn K−1 X k=1 p Rk. (10) Again, we can obtain the consistency of TT-RAM by setting λn ! 0 as n increases. Since the setting of λn corresponds to that of Theorem 3, the speed of convergence of TT-RAM in terms of n is equivalent to the speed of TT-ADMM. By comparing with the convex approach (Theorem 3), the error rate becomes slightly worse. Here, the term λn PK−1 k=1 pRk in (10) comes from the estimation by the alternating minimization, which linearly increases by K. This is because there are K optimization problems and their errors are accumulated to the final solution. The term (1 + ✏) in (10) comes from the random projection. The size of the error ✏can be arbitrary small by controlling the parameters of the random projection D1, D2 and s. 6 Related Work To solve the tensor completion problem with TT decomposition, Wang et al.[30] and Grasedyck et al.[6] developed algorithms that iteratively solve minimization problems with respect to Gk for each k = 1, . . . , K. Unfortunately, the adaptivity of the TT rank is not well discussed. [30] assumed that the TT rank is given. Grasedyck et al.[6] proposed a grid search method. However, the TT rank is determined by a single parameter (i.e., R1 = · · · = RK−1) and the search method lacks its generality. Furthermore, the scalability problem remains in both methods—they require more than O(IK) space. Phien et al. [22] proposed a convex optimization method using the Schatten TT norm. However, because they employed an alternating-type optimization method, the global convergence of their method is not guaranteed. Moreover, since they maintain X directly and perform the reshape of X several times, their method requires O(IK) time. Table 1 highlights the difference between the existing and our methods. We emphasize that our study is the first attempt to analyze the statistical performance of TT decomposition. In addition, TT-RAM is only the method that both time and space complexities do not grow exponentially in K. Method Global Convergence Rank Adaptivity Time Complexity Space Complexity Statistical Bounds TCAM-TT[30] O(nIKR4) O(IK) ADF for TT[6] (search) O(KIR3 + nKR2) O(IK) SiLRTC-TT[22] X O(I3K/2) O(KIK) TT-ADMM X X O(KI3K/2) O(IK) X TT-RAM X O((n + KD2)KI2R4) O(n + KI2R4) X Table 1: Comparison of TT completion algorithms, with R is a parameter for the TT rank such that R = R1 = · · · = RK−1, I = I1 = · · · = IK is dimension, K is the number of modes, n is the number of observed elements, and D is the dimension of random projection. 7 Experiments 7.1 Validation of Statistical Efficiency Using synthetic data, we verify the theoretical bounds derived in Theorems 3 and 5. We first generate TT components G⇤; each component G⇤ k is generated as G⇤ k = G† k/kG† kkF where each 7 Figure 1: Synthetic data: the estimation error k b X −X⇤kF against SRR P k pRk with the order-4 tensor (K = 4) and the order-5 tensor (K = 5). For each rank and λn, we measure the error by 10 trials with different random seeds, which affect both the missing pattern and the initial points. Table 2: Electricity data: the prediction error and the runtime (in seconds). K = 5 K = 7 K = 8 K = 10 Method Error Time Error Time Error Time Error Time Tucker 0.219 7.125 0.371 610.61 N/A N/A N/A N/A TCAM-TT 0.219 2.174 0.928 27.497 0.928 146.651 N/A N/A ADF for TT 0.998 1.221 1.160 23.211 1.180 278.712 N/A N/A SiLRTC-TT 0.339 1.478 0.928 206.708 N/A N/A N/A N/A TT-ADMM 0.221 0.289 1.019 154.991 1.061 2418.00 N/A N/A TT-RAM 0.219 4.644 0.928 4.726 0.928 7.654 1.173 7.968 element of G† k is sampled from the i.i.d. standard normal distribution. Then we generate Y by following the generative model (2) with the observation ratio n/ Q k Ik = 0.5 and the noise variance 0.01. We prepare two tensors of different size: an order-4 tensor of size 8 ⇥8 ⇥10 ⇥10 and an order-5 tensor of size 5 ⇥5 ⇥7 ⇥7 ⇥7. At the order-4 tensor, the TT rank is set as (R1, R2, R3) where R1, R2, R3 2 {3, 5, 7}. At the order-5 tensor, the TT rank is set as (R1, R2, R3, R4) where R1, R2, R3, R4 2 {2, 4}. For estimation, we set the size of Gk and ⇧k as 10, which is larger than the true TT rank. The regularization coefficient λn is selected from {1, 3, 5}. The parameters for random projection are set as s = 20 and D1 = D2 = 10. Figure 1 shows the relation between the estimation error and the sum of root rank (SRR) P k pRk. The result of TT-ADMM shows that the empirical errors are linearly related to SSR which is shown by the theoretical result. The result of TT-RAM roughly replicates the theoretical relationship. 7.2 Higher-Order Markov Chain for Electricity Data We apply the proposed tensor completion methods for analyzing the electricity consumption data [13]. The dataset contains time series measurements of household electric power consumption for every minutes from December 2006 to November 2010 and it contains over 200, 000 observations. The higher-order Markov chain is a suitable method to represent long-term dependency, and it is a common tool of time-series analysis [7] and natural language processing [9]. Let {Wt}t be discrete-time random variables take values in a finite set B, and the order-K Markov chain describes the conditional distribution of Wt with given {W⌧}⌧<t as P(Wt|{W⌧}⌧<t) = P(Wt|Wt−1, . . . , Wt−K). As K increases, the conditional distribution of Wt can include more information from the past observations. We complete the missing values of K-th Markov transition of the electricity dataset. We discretize the value of the dataset into 10 values and set K 2 {5, 7, 8, 10}. Next, we empirically estimate the conditional distribution of size 10K using 200, 000 observations. Then, we create X by randomly selecting n = 10, 000 elements from the the conditional distribution and regarding the other elements as missing. After completion, the prediction error is measured. We select hyperparameters using a grid search with cross-validation. 8 Figure 2 compares the prediction error and the runtime by the related studies with TT decomposition. For reference, we also report those values by Tucker decomposition without TT. When K = 5, the rank adaptive methods achieve low estimation errors. As K increases, however, all the methods except for TT-RAM suffers from the scalability issue. Indeed, at K = 10, only TT-RAM works and the others does not due to exhausting memory. 8 Conclusion In this paper, we investigated TT decomposition from the statistical and computational viewpoints. To analyze its statistical performance, we formulated the convex tensor completion problem via the low-rank TT decomposition using the TT Schatten norm. In addition, because the optimization of the convex problem is infeasible, we developed an alternative algorithm called TT-RAM by combining with the ideas of random projection and alternating minimization. Based on this, we derived the error bounds of estimation for both the convex minimizer and the solution obtained by TT-RAM. The experiments supported our theoretical results and demonstrated the scalability of TT-RAM. Acknowledgement We thank Prof. Taiji Suzuki for comments that greatly improved the manuscript. M. Imaizumi is supported by Grant-in-Aid for JSPS Research Fellow (15J10206) from the JSPS. K. Hayashi is supported by ONR N62909-17-1-2138. References [1] 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. [2] E. Candes and B. Recht. Exact matrix completion via convex optimization. Communications of the ACM, 55(6):111–119, 2012. [3] E. J. Candes and Y. Plan. Matrix completion with noise. Proceedings of the IEEE, 98(6):925– 936, 2010. [4] J. Chen, S. Cheng, H. Xie, L. Wang, and T. Xiang. On the equivalence of restricted boltzmann machines and tensor network states. arXiv preprint arXiv:1701.04831, 2017. [5] S. Gandy, B. Recht, and I. Yamada. Tensor completion and low-n-rank tensor recovery via convex optimization. Inverse Problems, 27(2):025010, 2011. [6] L. Grasedyck, M. Kluge, and S. Krämer. Alternating least squares tensor completion in the TT-format. arXiv preprint arXiv:1509.00311, 2015. [7] J. D. Hamilton. Time series analysis, volume 2. Princeton University Press, Princeton, 1994. [8] R. A. Harshman. Foundations of the parafac procedure: Models and conditions for an “explanatory” multi-modal factor analysis. UCLA Working Papers in Phonetics, 16:1–84, 1970. [9] D. Jurafsky and J. H. Martin. Speech and language processing, volume 3. Pearson, 2014. [10] T. G. Kolda and B. W. Bader. Tensor decompositions and applications. SIAM review, 51(3):455– 500, 2009. [11] A. Krishnamurthy and A. Singh. Low-rank matrix and tensor completion via adaptive sampling. In Advances in Neural Information Processing Systems, pages 836–844, 2013. [12] P. Li, T. J. Hastie, and K. W. Church. Very sparse random projections. In Proceedings of the 12th International Conference on Knowledge Discovery and Data Mining, pages 287–296. ACM, 2006. [13] M. Lichman. UCI machine learning repository, 2013. 9 [14] J. Liu, P. Musialski, P. Wonka, and J. Ye. Tensor completion for estimating missing values in visual data. Transactions on Pattern Analysis and Machine Intelligence, 35(1):208–220, 2013. [15] Y. Mu, J. Dong, X. Yuan, and S. Yan. Accelerated low-rank visual recovery by random projection. In IEEE Conference on Computer Vision and Pattern Recognition, pages 2609–2616, 2011. [16] S. Negahban, M. J. Wainwright, et al. Estimation of (near) low-rank matrices with noise and high-dimensional scaling. The Annals of Statistics, 39(2):1069–1097, 2011. [17] A. Novikov, D. Podoprikhin, A. Osokin, and D. P. Vetrov. Tensorizing neural networks. In Advances in Neural Information Processing Systems, pages 442–450, 2015. [18] A. Novikov, A. Rodomanov, A. Osokin, and D. Vetrov. Putting mrfs on a tensor train. In International Conference on Machine Learning, pages 811–819. JMLR W&CP, 2014. [19] A. Novikov, M. Trofimov, and I. Oseledets. Exponential machines. arXiv preprint arXiv:1605.03795, 2016. [20] I. Oseledets and E. Tyrtyshnikov. TT-cross approximation for multidimensional arrays. Linear Algebra and its Applications, 432(1):70–88, 2010. [21] I. V. Oseledets. Tensor-train decomposition. SIAM Journal on Scientific Computing, 33(5):2295– 2317, 2011. [22] H. N. Phien, H. D. Tuan, J. A. Bengua, and M. N. Do. Efficient tensor completion: Low-rank tensor train. arXiv preprint arXiv:1601.01083, 2016. [23] M. Signoretto, R. Van de Plas, B. De Moor, and J. A. Suykens. Tensor versus matrix completion: a comparison with application to spectral data. Signal Processing Letters, 18(7):403–406, 2011. [24] E. Stoudenmire and D. J. Schwab. Supervised learning with tensor networks. In Advances in Neural Information Processing Systems, pages 4799–4807, 2016. [25] T. Suzuki, H. Kanagawa, H. Kobayashi, N. Shimizu, and Y. Tagami. Minimax optimal alternating minimization for kernel nonparametric tensor learning. In Advances in Neural Information Processing Systems, pages 3783–3791, 2016. [26] R. Tomioka, K. Hayashi, and H. Kashima. Estimation of low-rank tensors via convex optimization. arXiv preprint arXiv:1010.0789, 2010. [27] R. Tomioka and T. Suzuki. Convex tensor decomposition via structured schatten norm regularization. In Advances in Neural Information Processing Systems, pages 1331–1339, 2013. [28] R. Tomioka, T. Suzuki, K. Hayashi, and H. Kashima. Statistical performance of convex tensor decomposition. In Advances in Neural Information Processing Systems (NIPS. Citeseer, 2011. [29] L. R. Tucker. Some mathematical notes on three-mode factor analysis. Psychometrika, 31(3):279–311, 1966. [30] W. Wang, V. Aggarwal, and S. Aeron. Tensor completion by alternating minimization under the tensor train (TT) model. arXiv preprint arXiv:1609.05587, 2016. [31] Z. Zhang and S. Aeron. Exact tensor completion using t-svd. Transactions on Signal Processing, 2016. 10
2017
75
7,215
EX2: Exploration with Exemplar Models for Deep Reinforcement Learning Justin Fu∗ John D. Co-Reyes∗ Sergey Levine University of California Berkeley {justinfu,jcoreyes,svlevine}@eecs.berkeley.edu Abstract Deep reinforcement learning algorithms have been shown to learn complex tasks using highly general policy classes. However, sparse reward problems remain a significant challenge. Exploration methods based on novelty detection have been particularly successful in such settings but typically require generative or predictive models of the observations, which can be difficult to train when the observations are very high-dimensional and complex, as in the case of raw images. We propose a novelty detection algorithm for exploration that is based entirely on discriminatively trained exemplar models, where classifiers are trained to discriminate each visited state against all others. Intuitively, novel states are easier to distinguish against other states seen during training. We show that this kind of discriminative modeling corresponds to implicit density estimation, and that it can be combined with countbased exploration to produce competitive results on a range of popular benchmark tasks, including state-of-the-art results on challenging egocentric observations in the vizDoom benchmark. 1 Introduction Recent work has shown that methods that combine reinforcement learning with rich function approximators, such as deep neural networks, can solve a range of complex tasks, from playing Atari games (Mnih et al., 2015) to controlling simulated robots (Schulman et al., 2015). Although deep reinforcement learning methods allow for complex policy representations, they do not by themselves solve the exploration problem: when the reward signals are rare and sparse, such methods can struggle to acquire meaningful policies. Standard exploration strategies, such as ϵ-greedy strategies (Mnih et al., 2015) or Gaussian noise (Lillicrap et al., 2015), are undirected and do not explicitly seek out interesting states. A promising avenue for more directed exploration is to explicitly estimate the novelty of a state, using predictive models that generate future states (Schmidhuber, 1990; Stadie et al., 2015; Achiam & Sastry, 2017) or model state densities (Bellemare et al., 2016; Tang et al., 2017; Abel et al., 2016). Related concepts such as count-based bonuses have been shown to provide substantial speedups in classic reinforcement learning (Strehl & Littman, 2009; Kolter & Ng, 2009), and several recent works have proposed information-theoretic or probabilistic approaches to exploration based on this idea (Houthooft et al., 2016; Chentanez et al., 2005) by drawing on formal results in simpler discrete or linear systems (Bubeck & Cesa-Bianchi, 2012). However, most novelty estimation methods rely on building generative or predictive models that explicitly model the distribution over the current or next observation. When the observations are complex and high-dimensional, such as in the case of raw images, these models can be difficult to train, since generating and predicting images and other high-dimensional objects is still an open problem, despite recent progress (Salimans et al., 2016). Though successful results with generative novelty models have been reported with simple synthetic images, such as in Atari games (Bellemare et al., 2016; Tang et al., 2017), we show in our ∗equal contribution. experiments that such generative methods struggle with more complex and naturalistic observations, such as the ego-centric image observations in the vizDoom benchmark. How can we estimate the novelty of visited states, and thereby provide an intrinsic motivation signal for reinforcement learning, without explicitly building generative or predictive models of the state or observation? The key idea in our EX2 algorithm is to estimate novelty by considering how easy it is for a discriminatively trained classifier to distinguish a given state from other states seen previously. The intuition is that, if a state is easy to distinguish from other states, it is likely to be novel. To this end, we propose to train exemplar models for each state that distinguish that state from all other observed states. We present two key technical contributions that make this into a practical exploration method. First, we describe how discriminatively trained exemplar models can be used for implicit density estimation, allowing us to unify this intuition with the theoretically rigorous framework of count-based exploration. Our experiments illustrate that, in simple domains, the implicitly estimated densities provide good estimates of the underlying state densities without any explicit generative training. Second, we show how to amortize the training of exemplar models to prevent the total number of classifiers from growing with the number of states, making the approach practical and scalable. Since our method does not require any explicit generative modeling, we can use it on a range of complex image-based tasks, including Atari games and the vizDoom benchmark, which has complex 3D visuals and extensive camera motion due to the egocentric viewpoint. Our results show that EX2 matches the performance of generative novelty-based exploration methods on simpler tasks, such as continuous control benchmarks and Atari, and greatly exceeds their performance on the complex vizDoom domain, indicating the value of implicit density estimation over explicit generative modeling for intrinsic motivation. 2 Related Work In finite MDPs, exploration algorithms such as E3 (Kearns & Singh, 2002) and R-max (Brafman & Tennenholtz, 2002) offer theoretical optimality guarantees. However, these methods typically require maintaining state-action visitation counts, which can make extending them to high dimensional and/or continuous states very challenging. Exploring in such state spaces has typically involved strategies such as introducing distance metrics over the state space (Pazis & Parr, 2013; Kakade et al., 2003), and approximating the quantities used in classical exploration methods. Prior works have employed approximations for the state-visitation count (Tang et al., 2017; Bellemare et al., 2016; Abel et al., 2016), information gain, or prediction error based on a learned dynamics model (Houthooft et al., 2016; Stadie et al., 2015; Achiam & Sastry, 2017). Bellemare et al. (2016) show that count-based methods in some sense bound the bonuses produced by exploration incentives based on intrinsic motivation, such as model uncertainty or information gain, making count-based or density-based bonuses an appealing and simple option. Other methods avoid tackling the exploration problem directly and use randomness over model parameters to encourage novel behavior (Chapelle & Li, 2011). For example, bootstrapped DQN (Osband et al., 2016) avoids the need to construct a generative model of the state by instead training multiple, randomized value functions and performs exploration by sampling a value function, and executing the greedy policy with respect to the value function. While such methods scale to complex state spaces as well as standard deep RL algorithms, they do not provide explicit novelty-seeking behavior, but rather a more structured random exploration behavior. Another direction explored in prior work is to examine exploration in the context of hierarchical models. An agent that can take temporally extended actions represented as action primitives or skills can more easily explore the environment (Stolle & Precup, 2002). Hierarchical reinforcement learning has traditionally tried to exploit temporal abstraction (Barto & Mahadevan, 2003) and relied on semiMarkov decision processes. A few recent works in deep RL have used hierarchies to explore in sparse reward environments (Florensa et al., 2017; Heess et al., 2016). However, learning a hierarchy is difficult and has generally required curriculum learning or manually designed subgoals (Kulkarni et al., 2016). In this work, we discuss a general exploration strategy that is independent of the design of the policy and applicable to any architecture, though our experiments focus specifically on deep reinforcement learning scenarios, including image-based navigation, where the state representation is not conducive to simple count-based metrics or generative models. 2 Concurrently with this work, Pathak et al. (2017) proposed to use discriminatively trained exploration bonuses by learning state features which are trained to predict the action from state transition pairs. Then given a state and action, their model predicts the features of the next state and the bonus is calculated from the prediction error. In contrast to our method, this concurrent work does not attempt to provide a probabilistic model of novelty and does not perform any sort of implicit density estimation. Since their method learns an inverse dynamics model, it does not provide for any mechanism to handle novel events that do not correlate with the agent’s actions, though it does succeed in avoiding the need for generative modeling. 3 Preliminaries In this paper, we consider a Markov decision process (MDP), defined by the tuple (S, A, T , R, γ, ρ0). S, A are the state and action spaces, respectively. The transition distribution T (s′|a, s), initial state distribution ρ0(s), and reward function R(s, a) are unknown in the reinforcement learning (RL) setting and can only be queried through interaction with the MDP. The goal of reinforcement learning is to find the optimal policy π∗that maximizes the expected sum of discounted rewards, π∗= arg maxπ Eτ∼π[PT t=0 γtR(st, at)] , where, τ denotes a trajectory (s0, a0, ...sT , aT ) and π(τ) = ρ0(s0) QT t=0 π(at|st)T(st+1|st, at). Our experiments evaluate episodic tasks with a policy gradient RL algorithm, though extensions to infinite horizon settings or other algorithms, such as Q-learning and actor-critic, are straightforward. Count-based exploration algorithms maintain a state-action visitation count N(s, a), and encourage the agent to visit rarely seen states, operating on the principle of optimism under uncertainty. This is typically achieved by adding a reward bonus for visiting rare states. For example, MBIE-EB (Strehl & Littman, 2009) uses a bonus of β/ p N(s, a), where β is a constant, and BEB (Kolter & Ng, 2009) uses a β/(N(s, a) + |S|). In the finite state and action spaces, these methods are PAC-MDP (for MBIE-EB) or PAC-BAMDP (for BEB), roughly meaning that the agent acts suboptimally for only a polynomial number of steps. In domains where explicit counting is impractical, pseudo-counts can be used based on a density estimate p(s, a), which typically is done using some sort of generatively trained density estimation model (Bellemare et al., 2016). We will describe how we can estimate densities using only discriminatively trained classifiers, followed by a discussion of how this implicit estimator can be incorporated into a pseudo-count novelty bonus method. 4 Exemplar Models and Density Estimation We begin by describing our discriminative model used to predict novelty of states visited during training. We highlight a connection between this particular form of discriminative model and density estimation, and in Section 5 describe how to use this model to generate reward bonuses. 4.1 Exemplar Models To avoid the need for explicit generative models, our novelty estimation method uses exemplar models. Given a dataset X = {x1, ...xn}, an exemplar model consists of a set of n classifiers or discriminators {Dx1, ....Dxn}, one for each data point. Each individual discriminator Dxi is trained to distinguish a single positive data point xi, the “exemplar,” from the other points in the dataset X. We borrow the term “exemplar model” from Malisiewicz et al. (2011), which coined the term “exemplar SVM” to refer to a particular linear model trained to classify each instance against all others. However, to our knowledge, our work is the first to apply this idea to exploration for reinforcement learning. In practice, we avoid the need to train n distinct classifiers by amortizing through a single exemplar-conditioned network, as discussed in Section 6. Let PX (x) denote the data distribution over X, and let Dx∗(x) : X →[0, 1] denote the discriminator associated with exemplar x∗. In order to obtain correct density estimates, as discussed in the next section, we present each discriminator with a balanced dataset, where half of the data consists of the exemplar x∗and half comes from the background distribution PX (x). Each discriminator is then trained to model a Bernoulli distribution Dx∗(x) = P(x = x∗|x) via maximum likelihood. Note that the label x = x∗is noisy because data that is extremely similar or identical to x∗may also occur in the background distribution PX (x), so the classifier does not always output 1. To obtain the 3 maximum likelihood solution, the discriminator is trained to optimize the following cross-entropy objective Dx∗= arg max D∈D (Eδx∗[log D(x)] + EPX [log 1 −D(x)]) . (1) We discuss practical amortized methods that avoid the need to train n discriminators in Section 6, but to keep the derivation in this section simple, we consider independent discriminators for now. 4.2 Exemplar Models as Implicit Density Estimation To show how the exemplar model can be used for implicit density estimation, we begin by considering an infinitely powerful, optimal discriminator, for which we can make an explicit connection between the discriminator and the underlying data distribution PX (x): Proposition 1. (Optimal Discriminator) For a discrete distribution PX (x), the optimal discriminator Dx∗for exemplar x∗satisfies Dx∗(x) = δx∗(x) δx∗(x) + PX (x) and Dx∗(x∗) = 1 1 + PX (x∗). Proof. The proof is obtained by taking the derivative of the loss in Eq. (1) with respect to D(x), setting it to zero, and solving for D(x). It follows that, if the discriminator is optimal, we can recover the probability of a data point PX (x∗) by evaluating the discriminator at its own exemplar x∗, according to PX (x∗) = 1 −Dx∗(x∗) Dx∗(x∗) . (2) For continuous domains, δx∗(x∗) →∞, so D(x) →1. This means we are unable to recover PX (x) via Eq. (2). However, we can smooth the delta by adding noise ϵ ∼q(ϵ) to the exemplar x∗during training, which allows us to recover exact density estimates by solving for PX (x). For example, if we let q = N(0, σ2I), then the optimal discriminator evaluated at x∗satisfies Dx∗(x∗) = h 1/ √ 2πσ2di / h 1/ √ 2πσ2d + PX (x) i . Even if we do not know the noise variance, we have PX (x∗) ∝1 −Dx∗(x∗) Dx∗(x∗) . (3) This proportionality holds for any noise q as long as (δx∗∗q)(x∗) (where ∗denotes convolution) is the same for every x∗. The reward bonus we describe in Section 5 is invariant to the normalization factor, so proportional estimates are sufficient. In practice, we can get density estimates that are better suited for exploration by introducing smoothing, which involves adding noise to the background distribution PX , to produce the estimator Dx∗(x) = (δx∗∗q)(x) (δx∗∗q)(x) + (PX ∗q)(x∗). We then recover our density estimate as (PX ∗q)(x∗). In the case when PX is a collection of delta functions around data points, this is equivalent to kernel density estimation using the noise distribution as a kernel. With Gaussian noise q = N(0, σ2I), this is equivalent to using an RBF kernel. 4.3 Latent Space Smoothing with Noisy Discriminators In the previous section, we discussed how adding noise can provide for smoothed density estimates, which is especially important in complex or continuous spaces, where all states might be distinguishable with a powerful enough discriminator. Unfortunately, for high-dimensional states, such as images, adding noise directly to the state often does not produce meaningful new states, since the distribution of states lies on a thin manifold, and any added noise will lift the noisy state off of this manifold. In this section, we discuss how we can learn a smoothing distribution by injecting the noise into a learned latent space, rather than adding it to the original states. 4 Formally, we introduce a latent variable z. We wish to train an encoder distribution q(z|x), and a latent space classifier p(y|z) = D(z)y(1 −D(z))1−y, where y = 1 when x = x∗and y = 0 when x ̸= x∗. We additionally regularize the noise distribution against a prior distribution p(z), which in our case is a unit Gaussian. Letting ep(x) = 1 2δx∗(x) + 1 2pX (x) denote the balanced training distribution from before, we can learn the latent space by maximizing the objective max py|z,qz|x Eep[Eqz|x[log p(y|z)] −DKL(q(z|x)||p(z))] . (4) Intuitively, this objective optimizes the noise distribution so as to maximize classification accuracy while transmitting as little information through the latent space as possible. This causes z to only capture the factors of variation in x that are most informative for distinguish points from the exemplar, resulting in noise that stays on the state manifold. For example, in the Atari domain, latent space noise might correspond to smoothing over the location of the player and moving objects on the screen, in contrast to performing pixel-wise Gaussian smoothing. Letting q(z|y = 1) = R x δx∗(x)q(z|x)dx and q(z|y = 0) = R x pX (x)q(z|x)dx denote the marginalized positive and negative densities over the latent space, we can characterize the optimal discriminator and encoder distributions as follows. For any encoder q(z|x), the optimal discriminator D(z) satisfies: p(y = 1|z) = D(z) = q(z|y = 1) q(z|y = 1) + q(z|y = 0) , and for any discriminator D(z), the optimal encoder distribution satisfies: q(z|x) ∝D(z)ysoft(x)(1 −D(z))1−ysoft(x)p(z) , where ysoft(x) = p(y = 1|x) = δx∗(x) δx∗(x)+pX (x) is the average label of x. These can be obtained by differentiating the objective, and the full derivation is included in Appendix A.1. Intuitively, q(z|x) is equal to the prior p(z) by default, which carries no information about x. It then scales up the probability on latent codes z where the discriminator is confident and correct. To recover a density estimate, we estimate D(x) = Eq[D(z)] and apply Eq. (3) to obtain the density. 4.4 Smoothing from Suboptimal Discriminators In our previous derivations, we assume an optimal, infinitely powerful discriminator which can emit a different value D(x) for every input x. However, this is typically not possible except for small, countable domains. A secondary but important source of density smoothing occurs when the discriminator has difficulty distinguishing two states x and x′. In this case, the discriminator will average over the outputs of the infinitely powerful discriminator. This form of smoothing comes from the inductive bias of the discriminator, which is difficult to quantify. In practice, we typically found this effect to be beneficial for our model rather than harmful. An example of such smoothed density estimates is shown in Figure 2. Due to this effect, adding noise is not strictly necessary to benefit from smoothing, though it provides for significantly better control over the degree of smoothing. 5 EX2: Exploration with Exemplar Models We can now describe our exploration algorithm based on implicit density models. Pseudocode for a batch policy search variant using the single exemplar model is shown in Algorithm 1. Online variants for other RL algorithms, such as Q-learning, are also possible. In order to apply the ideas from count-based exploration described in Section 3, we must approximate the state visitation counts N(s) = nP(s), where P(s) is the distribution over states visited during training. Note that we can easily use state-action counts N(s, a), but we omit the action for simplicity of notation. To generate approximate samples from P(s), we use a replay buffer B, which is a first-in first-out (FIFO) queue that holds previously visited states. Our exemplars are the states we wish to score, which are the states in the current batch of trajectories. In an online algorithm, we would instead train a discriminator after receiving every new observation one at a time, and compute the bonus in the same manner. Given the output from discriminators trained to optimize Eq (1), we augment the reward with a function of the “novelty” of the state (where β is a hyperparameter that can be tuned to the magnitude of the task reward): R′(s, a) = R(s, a) + βf(Ds(s)). 5 Algorithm 1 EX2 for batch policy optimization 1: Initialize replay buffer B 2: for iteration i in {1, ..., N} do 3: Sample trajectories {τj} from policy πi 4: for state s in {τ} do 5: Sample a batch of negatives {s′ k} from B. 6: Train discriminator Ds to minimize Eq. (1) with positive s, and negatives {s′ k}. 7: Compute reward R′(s, a) = R(s, a) + βf(Ds(s)) 8: end for 9: Improve πi with respect to R′(s, a) using any policy optimization method. 10: B ←B ∪{τi} 11: end for In our experiments, we use the heuristic bonus −log p(s), due to the fact that normalization constants become absorbed by baselines used in typical RL algorithms. For discrete domains, we can also use a count-based 1/ p N(s) (Tang et al., 2017), where N(s) = nP(s), and n being the size of the replay buffer B. A summary of EX2 for a generic batch reinforcement learner is shown in Algorithm 1. 6 Model Architecture To process complex observations such as images, we implement our exemplar model using neural networks, with convolutional models used for image-based domains. To reduce the computational cost of training such large per-exemplar classifiers, we explore two methods for amortizing the computation across multiple exemplars. 6.1 Amortized Multi-Exemplar Model Instead of training a separate classifier for each exemplar, we can instead train a single model that is conditioned on the exemplar x∗. When using the latent space formulation, we condition the latent space discriminator p(y|z) on an encoded version of x∗given by q(z∗|x∗), resulting in a classifier for the form p(y|z, z∗) = D(z, z∗)y(1 −D(z, z∗))1−y. The advantage of this amortized model is that it does not require us to train new discriminators from scratch at each iteration, and provides some degree of generalization for density estimation at new states. A diagram of this architecture is shown in Figure 1. The amortized architecture has the appearance of a comparison operator: it is trained to output 0 when x∗̸= x, and the optimal discriminator values covered in Section 4 when x∗= x, subject to the smoothing imposed by the latent space noise. 6.2 K-Exemplar Model As long as the distribution of positive examples is known, we can recover density estimates via Eq. (3). Thus, we can also consider a batch of exemplars x1, ..., xK, and sample from this batch uniformly during training. We refer to this model as the "K-Exemplar" model, which allows us to interpolate smoothly between a more powerful model with one discriminator per state (K = 1) with a weaker model that uses a single discriminator for all states (K = # states). A more detailed discussion of this method is included in Appendix A.2. In our experiments, we batch adjacent states in a trajectory into the same discriminator which corresponds to a form of temporal regularization that assumes that adjacent states in time are similar. We also share the majority of layers between discriminators in the neural networks similar to (Osband et al., 2016), and only allow the final linear layer to vary amongst discriminators, which forces the shared layers to learn a joint feature representation, similarly to the amortized model. An example architecture is shown in Figure 1. 6.3 Relationship to Generative Adverserial Networks (GANs) Our exploration algorithm has an interesting interpretation related to GANs (Goodfellow et al., 2014). The policy can be viewed as the generator of a GAN, and the exemplar model serves as the discriminator, which is trying to classify states from the current batch of trajectories against previous 6 a) Amortized Architecture b) K-Exemplar Architecture Figure 1: A diagram of our a) amortized model architecture and b) the K-exemplar model architecture. Noise is injected after the encoder module (a) or after the shared layers (b). Although possible, we do not tie the encoders of (a) in our experiments. states. Using the K-exemplar version of our algorithm, we can train a single discriminator for all states in the current batch (rather than one for each state), which mirrors the GAN setup. In GANs, the generator plays an adverserial game with the discriminator by attempting to produce indistinguishable samples in order to fool the discriminator. However, in our algorithm, the generator is rewarded for helping the discriminator rather than fooling it, so our algorithm plays a cooperative game instead of an adverserial one. Instead, they are competing with the progression of time: as a novel state becomes visited frequently, the replay buffer will become saturated with that state and it will lose its novelty. This property is desirable in that it forces the policy to continually seek new states from which to receive exploration bonuses. 7 Experimental Evaluation The goal of our experimental evaluation is to compare the EX2 method to both a naïve exploration strategy and to recently proposed exploration schemes for deep reinforcement learning based on explicit density modeling. We present results on both low-dimensional benchmark tasks used in prior work, and on more complex vision-based tasks, where prior density-based exploration bonus methods are difficult to apply. We use TRPO (Schulman et al., 2015) for policy optimization, because it operates on both continuous and discrete action spaces, and due to its relative robustness to hyperparameter choices (Duan et al., 2016). Our code and additional supplementary material including videos will be available at https://sites.google.com/view/ex2exploration. Experimental Tasks Our experiments include three low-dimensional tasks intended to assess whether EX2 can successfully perform implicit density estimation and computer exploration bonuses, and four high-dimensional image-based tasks of varying difficulty intended to evaluate whether implicit density estimation provides improvement in domains where generative modeling is difficult. The first low-dimensional task is a continuous 2D maze with a sparse reward function that only provides a reward when the agent is within a small radius of the goal. Because this task is 2D, we can use it to directly visualize the state visitation densities and compare to an upper bound histogram method for density estimation. The other two low-dimensional tasks are benchmark tasks from the OpenAI gym benchmark suite, SparseHalfCheetah and SwimmerGather, which provide for a comparison against prior work on generative exploration bonuses in the presence of sparse rewards. For the vision-based tasks, we include three Atari games, as well as a much more difficult ego-centric navigation task based on vizDoom (DoomMyWayHome+). The Atari games are included for easy comparison with prior methods based on generative models, but do not provide especially challenging visual observations, since the clean 2D visuals and relatively low visual diversity of these tasks makes generative modeling easy. In fact, prior work on video prediction for Atari games easily achieves accurate predictions hundreds of frames into the future (Oh et al., 2015), while video prediction on natural images is challenging even a couple of frames into the future (Mathieu et al., 2015). The vizDoom maze navigation task is intended to provide a comparison against prior methods with substantially more challenging observations: the game features a first-person viewpoint, 3D visuals, and partial observability, as well as the usual challenges associated with sparse rewards. We make the task particularly difficult by initializing the agent in the furthest room from the goal location, 7 a) Exemplar b) Empirical c) Varying Smoothing Figure 2: a, b) Illustration of estimated densities on the 2D maze task produced by our model (a), compared to the empirical discretized distribution (b). Our method provides reasonable, somewhat smoothed density estimates. c) Density estimates produced with our implicit density estimator on a toy dataset (top left), with increasing amounts of noise regularization. Figure 3: Example task images. From top to bottom, left to right: Doom, map of the MyWayHome task (goal is green, start is blue), Venture, HalfCheetah. requiring it to navigate through 8 rooms before reaching the goal. Sample images taken from several of these tasks are shown in Figure 3 and detailed task descriptions are given in Appendix A.3. We compare the two variants of our method (K-exemplar and amortized) to standard random exploration, kernel density estimation (KDE) with RBF kernels, a method based on Bayesian neural network generative models called VIME (Houthooft et al., 2016), and exploration bonuses based on hashing of latent spaces learned via an autoencoder (Tang et al., 2017). 2D Maze On the 2D maze task, we can visually compare the estimated state density from our exemplar model and the empirical state-visitation distribution sampled from the replay buffer, as shown in Figure 2. Our model generates sensible density estimates that smooth out the true empirical distribution. For exploration performance, shown in Table 1,TRPO with Gaussian exploration cannot find the sparse reward goal, while both variants of our method perform similarly to VIME and KDE. Since the dimensionality of the task is low, we also use a histogram-based method to estimate the density, which provides an upper bound on the performance of count-based exploration on this task. Continuous Control: SwimmerGather and SparseHalfCheetah SwimmerGather and SparseHalfCheetah are two challenging continuous control tasks proposed by Houthooft et al. (2016). Both environments feature sparse reward and medium-dimensional observations (33 and 20 dimensions respectively). SwimmerGather is a hierarchical task in which no previous algorithms using naïve exploration have made any progress. Our results demonstrate that, even on medium-dimensional tasks where explicit generative models should perform well, our implicit density estimation approach achieves competitive results. EX2, VIME, and Hashing significantly outperform the naïve TRPO algorithm and KDE on SwimmerGather, and amortized EX2outperforms all other methods on SparseHalfCheetah by a significant margin. This indicates that the implicit density estimates obtained by our method provide for exploration bonuses that are competitive with a variety of explicit density estimation techniques. Image-Based Control: Atari and Doom In our final set of experiments, we test the ability of our algorithm to scale to rich sensory inputs and high dimensional image-based state spaces. We chose several Atari games that have sparse rewards and present an exploration challenge, as well as a maze navigation benchmark based on vizDoom. Each domain presents a unique set of challenges. The vizDoom domain contains the most realistic images, and the environment is viewed from an egocentric perspective which makes building dynamics models difficult and increases the importance of intelligent smoothing and generalization. The Atari games (Freeway, Frostbite, Venture) contain simpler images from a third-person viewpoint, but often contain many moving, distractor objects that a density model must generalize to. Freeway and Venture contain sparse reward, and Frostbite contains a small amount of dense reward but attaining higher scores typically requires exploration. Our results demonstrate that EX2 is able to generate coherent exploration behavior even highdimensional visual environments, matching the best-performing prior methods on the Atari games. On the most challenging task, DoomMyWayHome+, our method greatly exceeds all of the prior 8 Task K-Ex.(ours) Amor.(ours) VIME1 TRPO2 Hashing3 KDE Histogram 2D Maze -104.2 -132.2 -135.5 -175.6 -117.5 -69.6 SparseHalfCheetah 3.56 173.2 98.0 0 0.5 0 SwimmerGather 0.228 0.240 0.196 0 0.258 0.098 Freeway (Atari) 33.3 16.5 33.5 Frostbite (Atari) 4901 2869 5214 Venture (Atari) 900 121 445 DoomMyWayHome 0.740 0.788 0.443 0.250 0.331 0.195 1 Houthooft et al. (2016) 2 Schulman et al. (2015) 3 Tang et al. (2017) Table 1: Mean scores (higher is better) of our algorithm (both K-exemplar and amortized) versus VIME (Houthooft et al., 2016), baseline TRPO, Hashing, and kernel density estimation (KDE). Our approach generally matches the performance of previous explicit density estimation methods, and greatly exceeds their performance on the challenging DoomMyWayHome+ task, which features camera motion, partial observability, and extremely sparse rewards. We did not run VIME or KExemplar on Atari games due to computational cost. Atari games are trained for 50 M time steps. Learning curves are included in Appendix A.5 exploration techniques, and is able to guide the agent through multiple rooms to the goal. This result indicates the benefit of implicit density estimation: while explicit density estimators can achieve good results on simple, clean images in the Atari games, they begin to struggle with the more complex egocentric observations in vizDoom, while our EX2 is able to provide reasonable density estimates and achieves good results. 8 Conclusion and Future Work We presented EX2, a scalable exploration strategy based on training discriminative exemplar models to assign novelty bonuses. We also demonstrate a novel connection between exemplar models and density estimation, which motivates our algorithm as approximating pseudo-count exploration. This density estimation technique also does not require reconstructing samples to train, unlike most methods for training generative or energy-based models. Our empirical results show that EX2 tends to achieve comparable results to the previous state-of-the-art for continuous control tasks on lowdimensional environments, and can scale gracefully to handle rich sensory inputs such as images. Since our method avoids the need for generative modeling of complex image-based observations, it exceeds the performance of prior generative methods on domains with more complex observation functions, such as the egocentric Doom navigation task. To understand the tradeoffs between discriminatively trained exemplar models and generative modeling, it helps to consider the behavior of the two methods when overfitting or underfitting. Both methods will assign flat bonuses when underfitting and high bonuses to all new states when overfitting. However, in the case of exemplar models, overfitting is easy with high dimensional observations, especially in the amortized model where the network simply acts as a comparator. Underfitting is also easy to achieve, simply by increasing the magnitude of the noise injected into the latent space. Therefore, although both approach can suffer from overfitting and underfitting, the exemplar method provides a single hyperparameter that interpolates between these extremes without changing the model. An exciting avenue for future work would be to adjust this smoothing factor automatically, based on the amount of available data. More generally, implicit density estimation with exemplar models is likely to be of use in other density estimation applications, and exploring such applications would another exciting direction for future work. Acknowledgement We would like to thank Adam Stooke, Sandy Huang, and Haoran Tang for providing efficient and parallelizable policy search code. We thank Joshua Achiam for help with setting up benchmark tasks. This research was supported by NSF IIS-1614653, NSF IIS-1700696, an ONR Young Investigator Program award, and Berkeley DeepDrive. 9 References Abel, David, Agarwal, Alekh, Diaz, Fernando, Krishnamurthy, Akshay, and Schapire, Robert E. Exploratory gradient boosting for reinforcement learning in complex domains. In Advances in Neural Information Processing Systems (NIPS), 2016. Achiam, Joshua and Sastry, Shankar. Surprise-based intrinsic motivation for deep reinforcement learning. CoRR, abs/1703.01732, 2017. Barto, Andrew G. and Mahadevan, Sridhar. Recent advances in hierarchical reinforcement learning. Discrete Event Dynamic Systems, 13(1-2), 2003. Bellemare, Marc G., Srinivasan, Sriram, Ostrovski, Georg, Schaul, Tom, Saxton, David, and Munos, Remi. Unifying count-based exploration and intrinsic motivation. In Advances in Neural Information Processing Systems (NIPS), 2016. Brafman, Ronen I. and Tennenholtz, Moshe. R-max – a general polynomial time algorithm for near-optimal reinforcement learning. Journal of Machine Learning Research (JMLR), 2002. Bubeck, Sébastien and Cesa-Bianchi, Nicolò. Regret analysis of stochastic and nonstochastic multi-armed bandit problems. Foundations and Trends R⃝in Machine Learning, 5, 2012. Chapelle, O. and Li, Lihong. An empirical evaluation of thompson sampling. In Advances in Neural Information Processing Systems (NIPS), 2011. Chentanez, Nuttapong, Barto, Andrew G, and Singh, Satinder P. Intrinsically Motivated Reinforcement Learning. In Advances in Neural Information Processing Systems (NIPS). MIT Press, 2005. Duan, Yan, Chen, Xi, Houthooft, Rein, Schulman, John, and Abbeel, Pieter. Benchmarking deep reinforcement learning for continuous control. In International Conference on Machine Learning (ICML), 2016. Florensa, Carlos Campo, Duan, Yan, and Abbeel, Pieter. Stochastic neural networks for hierarchical reinforcement learning. In International Conference on Learning Representations (ICLR), 2017. Goodfellow, Ian, Pouget-Abadie, Jean, Mirza, Mehdi, Xu, Bing, Warde-Farley, David, Ozair, Sherjil, Courville, Aaron, and Bengio, Yoshua. Generative adversarial nets. In Advances in Neural Information Processing Systems (NIPS). 2014. Heess, Nicolas, Wayne, Gregory, Tassa, Yuval, Lillicrap, Timothy P., Riedmiller, Martin A., and Silver, David. Learning and transfer of modulated locomotor controllers. CoRR, abs/1610.05182, 2016. Houthooft, Rein, Chen, Xi, Duan, Yan, Schulman, John, Turck, Filip De, and Abbeel, Pieter. Vime: Variational information maximizing exploration. In Advances in Neural Information Processing Systems (NIPS), 2016. Kakade, Sham, Kearns, Michael, and Langford, John. Exploration in metric state spaces. In International Conference on Machine Learning (ICML), 2003. Kearns, Michael and Singh, Satinder. Near-optimal reinforcement learning in polynomial time. Machine Learning, 2002. Kolter, J. Zico and Ng, Andrew Y. Near-bayesian exploration in polynomial time. In International Conference on Machine Learning (ICML), 2009. Kulkarni, Tejas D, Narasimhan, Karthik, Saeedi, Ardavan, and Tenenbaum, Josh. Hierarchical deep reinforcement learning: Integrating temporal abstraction and intrinsic motivation. In Advances in Neural Information Processing Systems (NIPS). 2016. Lillicrap, Timothy P., Hunt, Jonathan J., Pritzel, Alexander, Heess, Nicolas, Erez, Tom, Tassa, Yuval, Silver, David, and Wierstra, Daan. Continuous control with deep reinforcement learning. In International Conference on Learning Representations (ICLR), 2015. 10 Malisiewicz, Tomasz, Gupta, Abhinav, and Efros, Alexei A. Ensemble of exemplar-svms for object detection and beyond. In International Conference on Computer Vision (ICCV), 2011. Mathieu, Michaël, Couprie, Camille, and LeCun, Yann. Deep multi-scale video prediction beyond mean square error. CoRR, abs/1511.05440, 2015. URL http://arxiv.org/abs/1511.05440. Mnih, Volodymyr, Kavukcuoglu, Koray, Silver, David, Rusu, Andrei A., Veness, Joel, Bellemare, Marc G., Graves, Alex, Riedmiller, Martin, Fidjeland, Andreas K., Ostrovski, Georg, Petersen, Stig, Beattie, Charles, Sadik, Amir, Antonoglou, Ioannis, King, Helen, Kumaran, Dharshan, Wierstra, Daan, Legg, Shane, and Hassabis, Demis. Human-level control through deep reinforcement learning. Nature, 518(7540):529–533, 02 2015. Oh, Junhyuk, Guo, Xiaoxiao, Lee, Honglak, Lewis, Richard, and Singh, Satinder. Action-conditional video prediction using deep networks in atari games. In Advances in Neural Information Processing Systems (NIPS), 2015. Osband, Ian, Blundell, Charles, and Alexander Pritzel, Benjamin Van Roy. Deep exploration via bootstrapped DQN. In Advances in Neural Information Processing Systems (NIPS), 2016. Pathak, Deepak, Agrawal, Pulkit, Efros, Alexei A., and Darrell, Trevor. Curiosity-driven exploration by self-supervised prediction. In International Conference on Machine Learning (ICML), 2017. Pazis, Jason and Parr, Ronald. Pac optimal exploration in continuous space markov decision processes. In AAAI Conference on Artificial Intelligence (AAAI), 2013. Salimans, Tim, Goodfellow, Ian J., Zaremba, Wojciech, Cheung, Vicki, Radford, Alec, and Chen, Xi. Improved techniques for training gans. In Advances in Neural Information Processing Systems (NIPS), 2016. Schmidhuber, Jürgen. A possibility for implementing curiosity and boredom in model-building neural controllers. In Proceedings of the First International Conference on Simulation of Adaptive Behavior on From Animals to Animats, Cambridge, MA, USA, 1990. MIT Press. ISBN 0-26263138-5. Schulman, John, Levine, Sergey, Moritz, Philipp, Jordan, Michael I., and Abbeel, Pieter. Trust region policy optimization. In International Conference on Machine Learning (ICML), 2015. Stadie, Bradly C., Levine, Sergey, and Abbeel, Pieter. Incentivizing exploration in reinforcement learning with deep predictive models. CoRR, abs/1507.00814, 2015. Stolle, Martin and Precup, Doina. Learning Options in Reinforcement Learning. Springer Berlin Heidelberg, Berlin, Heidelberg, 2002. ISBN 978-3-540-45622-3. doi: 10.1007/3-540-45622-8_16. Strehl, Alexander L. and Littman, Michael L. An analysis of model-based interval estimation for markov decision processes. Journal of Computer and System Sciences, 2009. Tang, Haoran, Houthooft, Rein, Foote, Davis, Stooke, Adam, Chen, Xi, Duan, Yan, Schulman, John, Turck, Filip De, and Abbeel, Pieter. #exploration: A study of count-based exploration for deep reinforcement learning. In Advances in Neural Information Processing Systems (NIPS), 2017. 11
2017
76
7,216
Training Quantized Nets: A Deeper Understanding Hao Li1∗, Soham De1∗, Zheng Xu1, Christoph Studer2, Hanan Samet1, Tom Goldstein1 1Department of Computer Science, University of Maryland, College Park 2School of Electrical and Computer Engineering, Cornell University {haoli,sohamde,xuzh,hjs,tomg}@cs.umd.edu, studer@cornell.edu Abstract Currently, deep neural networks are deployed on low-power portable devices by first training a full-precision model using powerful hardware, and then deriving a corresponding lowprecision model for efficient inference on such systems. However, training models directly with coarsely quantized weights is a key step towards learning on embedded platforms that have limited computing resources, memory capacity, and power consumption. Numerous recent publications have studied methods for training quantized networks, but these studies have mostly been empirical. In this work, we investigate training methods for quantized neural networks from a theoretical viewpoint. We first explore accuracy guarantees for training methods under convexity assumptions. We then look at the behavior of these algorithms for non-convex problems, and show that training algorithms that exploit high-precision representations have an important greedy search phase that purely quantized training methods lack, which explains the difficulty of training using low-precision arithmetic. 1 Introduction Deep neural networks are an integral part of state-of-the-art computer vision and natural language processing systems. Because of their high memory requirements and computational complexity, networks are usually trained using powerful hardware. There is an increasing interest in training and deploying neural networks directly on battery-powered devices, such as cell phones or other platforms. Such low-power embedded systems are memory and power limited, and in some cases lack basic support for floating-point arithmetic. To make neural nets practical on embedded systems, many researchers have focused on training nets with coarsely quantized weights. For example, weights may be constrained to take on integer/binary values, or may be represented using low-precision (8 bits or less) fixed-point numbers. Quantized nets offer the potential of superior memory and computation efficiency, while achieving performance that is competitive with state-of-the-art high-precision nets. Quantized weights can dramatically reduce memory size and access bandwidth, increase power efficiency, exploit hardware-friendly bitwise operations, and accelerate inference throughput [1–3]. Handling low-precision weights is difficult and motivates interest in new training methods. When learning rates are small, stochastic gradient methods make small updates to weight parameters. Binarization/discretization of weights after each training iteration “rounds off” these small updates and causes training to stagnate [1]. Thus, the naïve approach of quantizing weights using a rounding procedure yields poor results when weights are represented using a small number of bits. Other approaches include classical stochastic rounding methods [4], as well as schemes that combine full-precision floating-point weights with discrete rounding procedures [5]. While some of these schemes seem to work in practice, results in this area are largely experimental, and little work has been devoted to explaining the excellent performance of some methods, the poor performance of others, and the important differences in behavior between these methods. ∗Equal contribution. Author ordering determined by a cryptographically secure random number generator. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. Contributions This paper studies quantized training methods from a theoretical perspective, with the goal of understanding the differences in behavior, and reasons for success or failure, of various methods. In particular, we present a convergence analysis showing that classical stochastic rounding (SR) methods [4] as well as newer and more powerful methods like BinaryConnect (BC) [5] are capable of solving convex discrete problems up to a level of accuracy that depends on the quantization level. We then address the issue of why algorithms that maintain floating-point representations, like BC, work so well, while fully quantized training methods like SR stall before training is complete. We show that the long-term behavior of BC has an important annealing property that is needed for non-convex optimization, while classical rounding methods lack this property. 2 Background and Related Work The arithmetic operations of deep networks can be truncated down to 8-bit fixed-point without significant deterioration in inference performance [4, 6–9]. The most extreme scenario of quantization is binarization, in which only 1-bit (two states) is used for weight representation [10, 5, 1, 3, 11, 12]. Previous work on obtaining a quantized neural network can be divided into two categories: quantizing pre-trained models with or without retraining [7, 13, 6, 14, 15], and training a quantized model from scratch [4, 5, 3, 1, 16]. We focus on approaches that belong to the second category, as they can be used for both training and inference under constrained resources. For training quantized NNs from scratch, many authors suggest maintaining a high-precision floating point copy of the weights while feeding quantized weights into backprop [5, 11, 3, 16], which results in good empirical performance. There are limitations in using such methods on low-power devices, however, where floating-point arithmetic is not always available or not desirable. Another widely used solution using only low-precision weights is stochastic rounding [17, 4]. Experiments show that networks using 16-bit fixed-point representations with stochastic rounding can deliver results nearly identical to 32-bit floating-point computations [4], while lowering the precision down to 3-bit fixed-point often results in a significant performance degradation [18]. Bayesian learning has also been applied to train binary networks [19, 20]. A more comprehensive review can be found in [3]. 3 Training Quantized Neural Nets We consider empirical risk minimization problems of the form: min w∈W F(w) := 1 m m X i=1 fi(w), (1) where the objective function decomposes into a sum over many functions fi : Rd →R. Neural networks have objective functions of this form where each fi is a non-convex loss function. When floating-point representations are available, the standard method for training neural networks is stochastic gradient descent (SGD), which on each iteration selects a function ˜f randomly from {f1, f2, . . . , fm}, and then computes SGD: wt+1 = wt −αt∇˜f(wt), (2) for some learning rate αt. In this paper, we consider the problem of training convolutional neural networks (CNNs). Convolutions are computationally expensive; low precision weights can be used to accelerate them by replacing expensive multiplications with efficient addition and subtraction operations [3, 9] or bitwise operations [11, 16]. To train networks using a low-precision representation of the weights, a quantization function Q(·) is needed to convert a real-valued number w into a quantized/rounded version ˆw = Q(w). We use the same notation for quantizing vectors, where we assume Q acts on each dimension of the vector. Different quantized optimization routines can be defined by selecting different quantizers, and also by selecting when quantization happens during optimization. The common options are: Deterministic Rounding (R) A basic uniform or deterministic quantization function snaps a floating point value to the closest quantized value as: Qd(w) = sign(w) · ∆· |w| ∆+ 1 2  , (3) 2 where ∆denotes the quantization step or resolution, i.e., the smallest positive number that is representable. One exception to this definition is when we consider binary weights, where all weights are constrained to have two values w ∈{−1, 1} and uniform rounding becomes Qd(w) = sign(w). The deterministic rounding SGD maintains quantized weights with updates of the form: Deterministic Rounding: wt+1 b = Qd wt b −αt∇˜f(wt b)  , (4) where wb denotes the low-precision weights, which are quantized using Qd immediately after applying the gradient descent update. If gradient updates are significantly smaller than the quantization step, this method loses gradient information and weights may never be modified from their starting values. Stochastic Rounding (SR) The quantization function for stochastic rounding is defined as: Qs(w) = ∆· ⌊w ∆⌋+ 1 for p ≤w ∆−⌊w ∆⌋, ⌊w ∆⌋ otherwise, (5) where p ∈[0, 1] is produced by a uniform random number generator. This operator is nondeterministic, and rounds its argument up with probability w/∆−⌊w/∆⌋, and down otherwise. This quantizer satisfies the important property E[Qs(w)] = w. Similar to the deterministic rounding method, the SR optimization method also maintains quantized weights with updates of the form: Stochastic Rounding: wt+1 b = Qs wt b −αt∇˜f(wt b)  . (6) BinaryConnect (BC) The BinaryConnect algorithm [5] accumulates gradient updates using a full-precision buffer wr, and quantizes weights just before gradient computations as follows. BinaryConnect: wt+1 r = wt r −αt∇˜f Q(wt r)  . (7) Either stochastic rounding Qs or deterministic rounding Qd can be used for quantizing the weights wr, but in practice, Qd is the common choice. The original BinaryConnect paper constrains the low-precision weights to be {−1, 1}, which can be generalized to {−∆, ∆}. A more recent method, Binary-Weights-Net (BWN) [3], allows different filters to have different scales for quantization, which often results in better performance on large datasets. Notation For the rest of the paper, we use Q to denote both Qs and Qd unless the situation requires this to be distinguished. We also drop the subscripts on wr and wb, and simply write w. 4 Convergence Analysis We now present convergence guarantees for the Stochastic Rounding (SR) and BinaryConnect (BC) algorithms, with updates of the form (6) and (7), respectively. For the purposes of deriving theoretical guarantees, we assume each fi in (1) is differentiable and convex, and the domain W is convex and has dimension d. We consider both the case where F is µ-strongly convex: ⟨∇F(w′), w −w′⟩≤F(w) −F(w′) −µ 2 ∥w −w′∥2, as well as where F is weakly convex. We also assume the (stochastic) gradients are bounded: E∥∇˜f(wt)∥2 ≤G2. Some results below also assume the domain of the problem is finite. In this case, the rounding algorithm clips values that leave the domain. For example, in the binary case, rounding returns bounded values in {−1, 1}. 4.1 Convergence of Stochastic Rounding (SR) We can rewrite the update rule (6) as: wt+1 = wt −αt∇˜f(wt) + rt, where rt = Qs(wt −αt∇˜f(wt)) −wt + αt∇˜f(wt) denotes the quantization error on the t-th iteration. We want to bound this error in expectation. To this end, we present the following lemma. Lemma 1. The stochastic rounding error rt on each iteration can be bounded, in expectation, as: E rt 2 ≤ √ d∆αtG, where d denotes the dimension of w. 3 Proofs for all theoretical results are presented in the Appendices. From Lemma 1, we see that the rounding error per step decreases as the learning rate αt decreases. This is intuitive since the probability of an entry in wt+1 differing from wt is small when the gradient update is small relative to ∆. Using the above lemma, we now present convergence rate results for Stochastic Rounding (SR) in both the strongly-convex case and the non-strongly convex case. Our error estimates are ergodic, i.e., they are in terms of ¯wT = 1 T PT t=1 wt, the average of the iterates. Theorem 1. Assume that F is µ-strongly convex and the learning rates are given by αt = 1 µ(t+1). Consider the SR algorithm with updates of the form (6). Then, we have: E[F( ¯wT ) −F(w⋆)] ≤(1 + log(T + 1))G2 2µT + √ d∆G 2 , where w⋆= arg minw F(w). Theorem 2. Assume the domain has finite diameter D, and learning rates are given by αt = c √ t, for a constant c. Consider the SR algorithm with updates of the form (6). Then, we have: E[F( ¯wT ) −F(w⋆)] ≤ 1 c √ T D2 + √ T + 1 2T cG2 + √ d∆G 2 . We see that in both cases, SR converges until it reaches an “accuracy floor.” As the quantization becomes more fine grained, our theory predicts that the accuracy of SR approaches that of highprecision floating point at a rate linear in ∆. This extra term caused by the discretization is unavoidable since this method maintains quantized weights. 4.2 Convergence of Binary Connect (BC) When analyzing the BC algorithm, we assume that the Hessian satisfies the Lipschitz bound: ∥∇2fi(x) −∇2fi(y)∥≤L2∥x −y∥for some L2 ≥0. While this is a slightly non-standard assumption, we will see that it enables us to gain better insights into the behavior of the algorithm. The results here hold for both stochastic and uniform rounding. In this case, the quantization error r does not approach 0 as in SR-SGD. Nonetheless, the effect of this rounding error diminishes with shrinking αt because αt multiplies the gradient update, and thus implicitly the rounding error as well. Theorem 3. Assume F is L-Lipschitz smooth, the domain has finite diameter D, and learning rates are given by αt = c √ t. Consider the BC-SGD algorithm with updates of the form (7). Then, we have: E[F( ¯wT ) −F(w⋆)] ≤ 1 2c √ T D2 + √ T + 1 2T cG2 + √ d∆LD. As with SR, BC can only converge up to an error floor. So far this looks a lot like the convergence guarantees for SR. However, things change when we assume strong convexity and bounded Hessian. Theorem 4. Assume that F is µ-strongly convex and the learning rates are given by αt = 1 µ(t+1). Consider the BC algorithm with updates of the form (7). Then we have: E[F( ¯wT ) −F(w⋆)] ≤(1 + log(T + 1))G2 2µT + DL2 √ d∆ 2 . Now, the error floor is determined by both ∆and L2. For a quadratic least-squares problem, the gradient of F is linear and the Hessian is constant. Thus, L2 = 0 and we get the following corollary. Corollary 1. Assume that F is quadratic and the learning rates are given by αt = 1 µ(t+1). The BC algorithm with updates of the form (7) yields E[F( ¯wT ) −F(w⋆)] ≤(1 + log(T + 1))G2 2µT . We see that the real-valued weights accumulated in BC can converge to the true minimizer of quadratic losses. Furthermore, this suggests that, when the function behaves like a quadratic on the distance 4 Figure 1: The SR method starts at some location x (in this case 0), adds a perturbation to x, and then rounds. As the learning rate α gets smaller, the distribution of the perturbation gets “squished” near the origin, making the algorithm less likely to move. The “squishing” effect is the same for the part of the distribution lying to the left and to the right of x, and so it does not effect the relative probability of moving left or right. scale ∆, one would expect BC to perform fundamentally better than SR. While this may seem like a restrictive condition, there is evidence that even non-convex neural networks become well approximated as a quadratic in the later stages of optimization within a neighborhood of a local minimum [21]. Note, our convergence results on BC are for wr instead of wb, and these measures of convergence are not directly comparable. It is not possible to bound wb when BC is used, as the values of wb may not converge in the usual sense (e.g., in the +/-1 binary case wr might converge to 0, in which case arbitrarily small perturbations to wr might send wb to +1 or -1). 5 What About Non-Convex Problems? The global convergence results presented above for convex problems show that, in general, both the SR and BC algorithms converge to within O(∆) accuracy of the minimizer (in expected value). However, these results do not explain the large differences between these methods when applied to non-convex neural nets. We now study how the long-term behavior of SR differs from BC. Note that this section makes no convexity assumptions, and the proposed theoretical results are directly applicable to neural networks. Typical (continuous-valued) SGD methods have an important exploration-exploitation tradeoff. When the learning rate is large, the algorithm explores by moving quickly between states. Exploitation happens when the learning rate is small. In this case, noise averaging causes the algorithm more greedily pursues local minimizers with lower loss values. Thus, the distribution of iterates produced by the algorithm becomes increasingly concentrated near minimizers as the learning rate vanishes (see, e.g., the large-deviation estimates in [22]). BC maintains this property as well—indeed, we saw in Corollary 1 a class of problems for which the iterates concentrate on the minimizer for small αt. In this section, we show that the SR method lacks this important tradeoff: as the stepsize gets small and the algorithm slows down, the quality of the iterates produced by the algorithm does not improve, and the algorithm does not become progressively more likely to produce low-loss iterates. This behavior is illustrated in Figures 1 and 2. To understand this problem conceptually, consider the simple case of a one-variable optimization problem starting at x0 = 0 with ∆= 1 (Figure 1). On each iteration, the algorithm computes a stochastic approximation ∇˜f of the gradient by sampling from a distribution, which we call p. This gradient is then multiplied by the stepsize to get α∇˜f. The probability of moving to the right (or left) is then roughly proportional to the magnitude of α∇˜f. Note the random variable α∇˜f has distribution pα(z) = α−1p(z/α). Now, suppose that α is small enough that we can neglect the tails of pα(z) that lie outside the interval [−1, 1]. The probability of transitioning from x0 = 0 to x1 = 1 using stochastic rounding, denoted by Tα(0, 1), is then Tα(0, 1) ≈ Z 1 0 zpα(z)dz = 1 α Z 1 0 zp(z/α) dz = α Z 1/α 0 p(x)x dx ≈α Z ∞ 0 p(x)x dx, where the first approximation is because we neglected the unlikely case that α∇˜f > 1, and the second approximation appears because we added a small tail probability to the estimate. These 5 -2 0 2 4 6 8 Weight w 0 2 4 6 8 10 12 Loss Value (a) α = 1.0 (b) α = 0.1 (c) α = 0.01 (d) α = 0.001 Figure 2: Effect of shrinking the learning rate in SR vs BC on a toy problem. The left figure plots the objective function (8). Histograms plot the distribution of the quantized weights over 106 iterations. The top row of plots correspond to BC, while the bottom row is SR, for different learning rates α. As the learning rate α shrinks, the BC distribution concentrates on a minimizer, while the SR distribution stagnates. approximations get more accurate for small α. We see that, assuming the tails of p are “light” enough, we have Tα(0, 1) ∼α R ∞ 0 p(x)x dx as α →0. Similarly, Tα(0, −1) ∼α R 0 −∞p(x)x dx as α →0. What does this observation mean for the behavior of SR? First of all, the probability of leaving x0 on an iteration is Tα(0, −1) + Tα(0, 1) ≈α Z ∞ 0 p(x)x dx + Z 0 −∞ p(x)x dx  , which vanishes for small α. This means the algorithm slows down as the learning rate drops off, which is not surprising. However, the conditional probability of ending up at x1 = 1 given that the algorithm did leave x0 is Tα(0, 1|x1 ̸= x0) ≈ Tα(0, 1) Tα(0, −1) + Tα(0, 1) = R ∞ 0 p(x)x dx R 0 −∞p(x)x dx + R ∞ 0 p(x)x dx , which does not depend on α. In other words, provided α is small, SR, on average, makes the same decisions/transitions with learning rate α as it does with learning rate α/10; it just takes 10 times longer to make those decisions when α/10 is used. In this situation, there is no exploitation benefit in decreasing α. 5.1 Toy Problem To gain more intuition about the effect of shrinking the learning rate in SR vs BC, consider the following simple 1-dimensional non-convex problem: min w f(w) :=    w2 + 2, if w < 1, (w −2.5)2 + 0.75, if 1 ≤w < 3.5, (w −4.75)2 + 0.19, if w ≥3.5. (8) Figure 2 shows a plot of this loss function. To visualize the distribution of iterates, we initialize at w = 4.0, and run SR and BC for 106 iterations using a quantization resolution of 0.5. Figure 2 shows the distribution of the quantized weight parameters w over the iterations when optimized with SR and BC for different learning rates α. As we shift from α = 1 to α = 0.001, the distribution of BC iterates transitions from a wide/explorative distribution to a narrow distribution in which iterates aggressively concentrate on the minimizer. In contrast, the distribution produced by SR concentrates only slightly and then stagnates; the iterates are spread widely even when the learning rate is small. 5.2 Asymptotic Analysis of Stochastic Rounding The above argument is intuitive, but also informal. To make these statements rigorous, we interpret the SR method as a Markov chain. On each iteration, SR starts at some state (iterate) x, and moves to 6 A B C 0.2 0.2 0.4 0.4 0.2 0.6 0.6 0.2 0.2 A B C 0.1 0.1 0.2 0.2 0.1 0.3 0.8 0.6 0.6 Figure 3: Markov chain example with 3 states. In the right figure, we halved each transition probability for moving between states, with the remaining probability put on the self-loop. Notice that halving all the transition probabilities would not change the equilibrium distribution, and instead would only increase the mixing time of the Markov chain. a new state y with some transition probability Tα(x, y) that depends only on x and the learning rate α. For fixed α, this is clearly a Markov process with transition matrix2 Tα(x, y). The long-term behavior of this Markov process is determined by the stationary distribution of Tα(x, y). We show below that for small α, the stationary distribution of Tα(x, y) is nearly invariant to α, and thus decreasing α below some threshold has virtually no effect on the long term behavior of the method. This happens because, as α shrinks, the relative transition probabilities remain the same (conditioned on the fact that the parameters change), even though the absolute probabilities decrease (see Figure 3). In this case, there is no exploitation benefit to decreasing α. Theorem 5. Let px,k denote the probability distribution of the kth entry in ∇˜f(x), the stochastic gradient estimate at x. Assume there is a constant C1 such that for all x, k, and ν we have R ∞ ν px,k(z) dz ≤C1 ν2 , and some C2 such that both R C2 0 px,k(z) dz > 0 and R 0 −C2 px,k(z) dz > 0. Define the matrix ˜U(x, y) =      R ∞ 0 px,k(z) z ∆dz, if x and y differ only at coordinate k, and yk = xk + ∆ R 0 −∞px,k(z) z ∆dz, if x and y differ only at coordinate k, and yk = xk −∆ 0, otherwise, and the associated markov chain transition matrix ˜Tα0 = I −α0 · diag(1T ˜U) + α0 ˜U, (9) where α0 is the largest constant that makes ˜Tα0 non-negative. Suppose ˜Tα has a stationary distribution, denoted ˜π. Then, for sufficiently small α, Tα has a stationary distribution πα, and lim α→0 πα = ˜π. Furthermore, this limiting distribution satisfies ˜π(x) > 0 for any state x, and is thus not concentrated on local minimizers of f. While the long term stationary behavior of SR is relatively insensitive to α, the convergence speed of the algorithm is not. To measure this, we consider the mixing time of the Markov chain. Let πα denote the stationary distribution of a Markov chain. We say that the ϵ-mixing time of the chain is Mϵ if Mϵ is the smallest integer such that [23] |P(xMϵ ∈A|x0) −π(A)| ≤ϵ, for all x0 and all subsets of states A ⊆X. (10) We show below that the mixing time of the Markov chain gets large for small α, which means exploration slows down, even though no exploitation gain is being realized. Theorem 6. Let px,k satisfy the assumptions of Theorem 5. Choose some ϵ sufficiently small that there exists a proper subset of states A ⊂X with stationary probability πα(A) greater than ϵ. Let Mϵ(α) denote the ϵ-mixing time of the chain with learning rate α. Then, lim α→0 Mϵ(α) = ∞. 2Our analysis below does not require the state space to be finite, so Tα(x, y) may be a linear operator rather than a matrix. Nonetheless, we use the term “matrix” as it is standard. 7 Table 1: Top-1 test error after training with full-precision (ADAM), binarized weights (R-ADAM, SR-ADAM, BC-ADAM), and binarized weights with big batch size (Big SR-ADAM). CIFAR-10 CIFAR-100 ImageNet VGG-9 VGG-BC ResNet-56 WRN-56-2 ResNet-56 ResNet-18 ADAM 7.97 7.12 8.10 6.62 33.98 36.04 BC-ADAM 10.36 8.21 8.83 7.17 35.34 52.11 Big SR-ADAM 16.95 16.77 19.84 16.04 50.79 77.68 SR-ADAM 23.33 20.56 26.49 21.58 58.06 88.86 R-ADAM 23.99 21.88 33.56 27.90 68.39 91.07 6 Experiments To explore the implications of the theory above, we train both VGG-like networks [24] and Residual networks [25] with binarized weights on image classification problems. On CIFAR-10, we train ResNet-56, wide ResNet-56 (WRN-56-2, with 2X more filters than ResNet-56), VGG-9, and the high capacity VGG-BC network used for the original BC model [5]. We also train ResNet-56 on CIFAR-100, and ResNet-18 on ImageNet [26]. We use Adam [27] as our baseline optimizer as we found it to frequently give better results than well-tuned SGD (an observation that is consistent with previous papers on quantized models [1–5]), and we train with the three quantized algorithms mentioned in Section 3, i.e., R-ADAM, SR-ADAM and BC-ADAM. The image pre-processing and data augmentation procedures are the same as [25]. Following [3], we only quantize the weights in the convolutional layers, but not linear layers, during training (See Appendix H.1 for a discussion of this issue, and a detailed description of experiments). We set the initial learning rate to 0.01 and decrease the learning rate by a factor of 10 at epochs 82 and 122 for CIFAR-10 and CIFAR-100 [25]. For ImageNet experiments, we train the model for 90 epochs and decrease the learning rate at epochs 30 and 60. See Appendix H for additional experiments. Results The overall results are summarized in Table 1. The binary model trained by BC-ADAM has comparable performance to the full-precision model trained by ADAM. SR-ADAM outperforms R-ADAM, which verifies the effectiveness of Stochastic Rounding. There is a performance gap between SR-ADAM and BC-ADAM across all models and datasets. This is consistent with our theoretical results in Sections 4 and 5, which predict that keeping track of the real-valued weights as in BC-ADAM should produce better minimizers. Exploration vs exploitation tradeoffs Section 5 discusses the exploration/exploitation tradeoff of continuous-valued SGD methods and predicts that fully discrete methods like SR are unable to enter a greedy phase. To test this effect, we plot the percentage of changed weights (signs different from the initialization) as a function of the training epochs (Figures 4 and 5). SR-ADAM explores aggressively; it changes more weights in the conv layers than both R-ADAM and BC-ADAM, and keeps changing weights until nearly 40% of the weights differ from their starting values (in a binary model, randomly re-assigning weights would result in 50% change). The BC method never changes more than 20% of the weights (Fig 4(b)), indicating that it stays near a local minimizer and explores less. Interestingly, we see that the weights of the conv layers were not changed at all by R-ADAM; when the tails of the stochastic gradient distribution are light, this method is ineffective. 6.1 A Way Forward: Big Batch Training We saw in Section 5 that SR is unable to exploit local minima because, for small learning rates, shrinking the learning rate does not produce additional bias towards moving downhill. This was illustrated in Figure 1. If this is truly the cause of the problem, then our theory predicts that we can improve the performance of SR for low-precision training by increasing the batch size. This shrinks the variance of the gradient distribution in Figure 1 without changing the mean and concentrates more of the gradient distribution towards downhill directions, making the algorithm more greedy. To verify this, we tried different batch sizes for SR including 128, 256, 512 and 1024, and found that the larger the batch size, the better the performance of SR. Figure 5(a) illustrates the effect of a batch size of 1024 for BC and SR methods. We find that the BC method, like classical SGD, performs best 8 0 20 40 60 80 100 120 140 160 180 Epochs 0 10 20 30 40 50 Percentage of changed weights (%) conv_1 conv_2 conv_3 conv_4 conv_5 conv_6 linear_1 linear_2 linear_3 (a) R-ADAM 0 20 40 60 80 100 120 140 160 180 Epochs 0 10 20 30 40 50 Percentage of changed weights (%) conv_1 conv_2 conv_3 conv_4 conv_5 conv_6 linear_1 linear_2 linear_3 (b) BC-ADAM 0 20 40 60 80 100 120 140 160 180 Epochs 0 10 20 30 40 50 Percentage of changed weights (%) conv_1 conv_2 conv_3 conv_4 conv_5 conv_6 linear_1 linear_2 linear_3 (c) SR-ADAM Figure 4: Percentage of weight changes during training of VGG-BC on CIFAR-10. 0 20 40 60 80 100 120 140 160 Epochs 0 10 20 30 40 50 60 Error (%) BC-ADAM 128 BC-ADAM 1024 SR-ADAM 128 SR-ADAM 1024 (a) BC-ADAM vs SR-ADAM 0 20 40 60 80 100 120 140 160 Epochs 0 10 20 30 40 50 60 Percentage of changed weights (%) BC-ADAM 128 BC-ADAM 1024 SR-ADAM 128 SR-ADAM 1024 (b) Weight changes since beginning 0 20 40 60 80 100 120 140 160 Epochs 0 10 20 30 40 50 Percentage of changed weights (%) BC-ADAM 128 BC-ADAM 1024 SR-ADAM 128 SR-ADAM 1024 (c) Weight changes every 5 epochs Figure 5: Effect of batch size on SR-ADAM when tested with ResNet-56 on CIFAR-10. (a) Test error vs epoch. Test error is reported with dashed lines, train error with solid lines. (b) Percentage of weight changes since initialization. (c) Percentage of weight changes per every 5 epochs. with a small batch size. However, a large batch size is essential for the SR method to perform well. Figure 5(b) shows the percentage of weights changed by SR and BC during training. We see that the large batch methods change the weights less aggressively than the small batch methods, indicating less exploration. Figure 5(c) shows the percentage of weights changed during each 5 epochs of training. It is clear that small-batch SR changes weights much more frequently than using a big batch. This property of big batch training clearly benefits SR; we see in Figure 5(a) and Table 1 that big batch training improved performance over SR-ADAM consistently. In addition to providing a means of improving fixed-point training, this suggests that recently proposed methods using big batches [28, 29] may be able to exploit lower levels of precision to further accelerate training. 7 Conclusion The training of quantized neural networks is essential for deploying machine learning models on portable and ubiquitous devices. We provide a theoretical analysis to better understand the BinaryConnect (BC) and Stochastic Rounding (SR) methods for training quantized networks. We proved convergence results for BC and SR methods that predict an accuracy bound that depends on the coarseness of discretization. For general non-convex problems, we proved that SR differs from conventional stochastic methods in that it is unable to exploit greedy local search. Experiments confirm these findings, and show that the mathematical properties of SR are indeed observable (and very important) in practice. Acknowledgments T. Goldstein was supported in part by the US National Science Foundation (NSF) under grant CCF1535902, by the US Office of Naval Research under grant N00014-17-1-2078, and by the Sloan Foundation. C. Studer was supported in part by Xilinx, Inc. and by the US NSF under grants ECCS-1408006, CCF-1535897, and CAREER CCF-1652065. H. Samet was supported in part by the US NSF under grant IIS-13-20791. 9 References [1] Courbariaux, M., Hubara, I., Soudry, D., El-Yaniv, R., Bengio, Y.: Binarized neural networks: Training deep neural networks with weights and activations constrained to +1 or -1. arXiv preprint arXiv:1602.02830 (2016) [2] Marchesi, M., Orlandi, G., Piazza, F., Uncini, A.: Fast neural networks without multipliers. IEEE Transactions on Neural Networks 4(1) (1993) 53–62 [3] Rastegari, M., Ordonez, V., Redmon, J., Farhadi, A.: XNOR-Net: ImageNet Classification Using Binary Convolutional Neural Networks. ECCV (2016) [4] Gupta, S., Agrawal, A., Gopalakrishnan, K., Narayanan, P.: Deep learning with limited numerical precision. In: ICML. (2015) [5] Courbariaux, M., Bengio, Y., David, J.P.: Binaryconnect: Training deep neural networks with binary weights during propagations. In: NIPS. (2015) [6] Lin, D., Talathi, S., Annapureddy, S.: Fixed point quantization of deep convolutional networks. In: ICML. (2016) [7] Hwang, K., Sung, W.: Fixed-point feedforward deep neural network design using weights+ 1, 0, and- 1. In: IEEE Workshop on Signal Processing Systems (SiPS). (2014) [8] Lin, Z., Courbariaux, M., Memisevic, R., Bengio, Y.: Neural networks with few multiplications. ICLR (2016) [9] Li, F., Zhang, B., Liu, B.: Ternary weight networks. arXiv preprint arXiv:1605.04711 (2016) [10] Kim, M., Smaragdis, P.: Bitwise neural networks. In: ICML Workshop on Resource-Efficient Machine Learning. (2015) [11] Hubara, I., Courbariaux, M., Soudry, D., El-Yaniv, R., Bengio, Y.: Quantized neural networks: Training neural networks with low precision weights and activations. arXiv preprint arXiv:1609.07061 (2016) [12] Baldassi, C., Ingrosso, A., Lucibello, C., Saglietti, L., Zecchina, R.: Subdominant dense clusters allow for simple learning and high computational performance in neural networks with discrete synapses. Physical review letters 115(12) (2015) 128101 [13] Anwar, S., Hwang, K., Sung, W.: Fixed point optimization of deep convolutional neural networks for object recognition. In: ICASSP, IEEE (2015) [14] Zhu, C., Han, S., Mao, H., Dally, W.J.: Trained ternary quantization. ICLR (2017) [15] Zhou, A., Yao, A., Guo, Y., Xu, L., Chen, Y.: Incremental network quantization: Towards lossless CNNs with low-precision weights. ICLR (2017) [16] Zhou, S., Wu, Y., Ni, Z., Zhou, X., Wen, H., Zou, Y.: Dorefa-net: Training low bitwidth convolutional neural networks with low bitwidth gradients. arXiv preprint arXiv:1606.06160 (2016) [17] Höhfeld, M., Fahlman, S.E.: Probabilistic rounding in neural network learning with limited precision. Neurocomputing 4(6) (1992) 291–299 [18] Miyashita, D., Lee, E.H., Murmann, B.: Convolutional neural networks using logarithmic data representation. arXiv preprint arXiv:1603.01025 (2016) [19] Soudry, D., Hubara, I., Meir, R.: Expectation backpropagation: Parameter-free training of multilayer neural networks with continuous or discrete weights. In: NIPS. (2014) [20] Cheng, Z., Soudry, D., Mao, Z., Lan, Z.: Training binary multilayer neural networks for image classification using expectation backpropagation. arXiv preprint arXiv:1503.03562 (2015) [21] Martens, J., Grosse, R.: Optimizing neural networks with kronecker-factored approximate curvature. In: International Conference on Machine Learning. (2015) 2408–2417 [22] Lan, G., Nemirovski, A., Shapiro, A.: Validation analysis of mirror descent stochastic approximation method. Mathematical programming 134(2) (2012) 425–458 [23] Levin, D.A., Peres, Y., Wilmer, E.L.: Markov chains and mixing times. American Mathematical Soc. (2009) 10 [24] Simonyan, K., Zisserman, A.: Very Deep Convolutional Networks for Large-Scale Image Recognition. In: ICLR. (2015) [25] He, K., Zhang, X., Ren, S., Sun, J.: Deep Residual Learning for Image Recognition. In: CVPR. (2016) [26] Russakovsky, O., Deng, J., Su, H., Krause, J., Satheesh, S., Ma, S., Huang, Z., Karpathy, A., Khosla, A., Bernstein, M., et al.: Imagenet Large Scale Visual Recognition Challenge. IJCV (2015) [27] Kingma, D., Ba, J.: Adam: A method for stochastic optimization. ICLR (2015) [28] De, S., Yadav, A., Jacobs, D., Goldstein, T.: Big batch SGD: Automated inference using adaptive batch sizes. arXiv preprint arXiv:1610.05792 (2016) [29] Goyal, P., Dollár, P., Girshick, R., Noordhuis, P., Wesolowski, L., Kyrola, A., Tulloch, A., Jia, Y., He, K.: Accurate, large minibatch sgd: Training imagenet in 1 hour. arXiv preprint arXiv:1706.02677 (2017) [30] Lax, P.: Linear Algebra and Its Applications. Number v. 10 in Linear algebra and its applications. Wiley (2007) [31] Krizhevsky, A.: Learning multiple layers of features from tiny images. (2009) [32] Zagoruyko, S., Komodakis, N.: Wide residual networks. arXiv preprint arXiv:1605.07146 (2016) [33] Collobert, R., Kavukcuoglu, K., Farabet, C.: Torch7: A matlab-like environment for machine learning. In: BigLearn, NIPS Workshop. (2011) [34] Ioffe, S., Szegedy, C.: Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift. (2015) 11
2017
77
7,217
Convolutional Gaussian Processes Mark van der Wilk Department of Engineering University of Cambridge, UK mv310@cam.ac.uk Carl Edward Rasmussen Department of Engineering University of Cambridge, UK cer54@cam.ac.uk James Hensman prowler.io Cambridge, UK james@prowler.io Abstract We present a practical way of introducing convolutional structure into Gaussian processes, making them more suited to high-dimensional inputs like images. The main contribution of our work is the construction of an inter-domain inducing point approximation that is well-tailored to the convolutional kernel. This allows us to gain the generalisation benefit of a convolutional kernel, together with fast but accurate posterior inference. We investigate several variations of the convolutional kernel, and apply it to MNIST and CIFAR-10, where we obtain significant improvements over existing Gaussian process models. We also show how the marginal likelihood can be used to find an optimal weighting between convolutional and RBF kernels to further improve performance. This illustration of the usefulness of the marginal likelihood may help automate discovering architectures in larger models. 1 Introduction Gaussian processes (GPs) [1] can be used as a flexible prior over functions, which makes them an elegant building block in Bayesian nonparametric models. In recent work, there has been much progress in addressing the computational issues preventing GPs from scaling to large problems [2, 3, 4, 5]. However, orthogonal to being able to algorithmically handle large quantities of data is the question of how to build GP models that generalise well. The properties of a GP prior, and hence its ability to generalise in a specific problem, are fully encoded by its covariance function (or kernel). Most common kernel functions rely on rather rudimentary and local metrics for generalisation, like the Euclidean distance. This has been widely criticised, notably by Bengio [6], who argued that deep architectures allow for more non-local generalisation. While deep architectures have seen enormous success in recent years, it is an interesting research question to investigate what kind of non-local generalisation structures can be encoded in shallow structures like kernels, while preserving the elegant properties of GPs. Convolutional structures have non-local influence and have successfully been applied in neural networks to improve generalisation for image data [see e.g. 7, 8]. In this work, we investigate how Gaussian processes can be equipped with convolutional structures, together with accurate approximations that make them applicable in practice. A previous approach by Wilson et al. [9] transforms the inputs to a kernel using a convolutional neural network. This produces a valid kernel since applying a deterministic transformation to kernel inputs results in a valid kernel [see e.g. 1, 10], with the (many) parameters of the transformation becoming kernel hyperparameters. We stress that our approach is different in that the process itself is convolved, which does not require the introduction of additional parameters. Although our method does have inducing points that play a similar role to the filters in a convolutional neural network (convnet), these are variational parameters and are therefore more protected from over-fitting. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. 2 Background Interest in Gaussian processes in the machine learning community started with the realisation that a shallow but infinitely wide neural network with Gaussian weights was a Gaussian process [11] – a nonparametric model with analytically tractable posteriors and marginal likelihoods. This gives two main desirable properties. Firstly, the posterior gives uncertainty estimates, which, combined with having an infinite number of basis functions, results in sensibly large uncertainties far from the data (see Quiñonero-Candela and Rasmussen [12, fig. 5] for a useful illustration). Secondly, the marginal likelihood can be used to select kernel hyperparameters. The main drawback is an O N 3 computational cost for N observations. Because of this, much attention over recent years has been devoted to scaling GP inference to large datasets through sparse approximations [2, 13, 14], minibatch-based optimisation [3], exploiting structure in the covariance matrix [e.g. 15] and Fourier methods [16, 17]. In this work, we adopt the variational framework for approximation in GP models, because it can simultaneously give a computational speed-up to O NM 2 (with M ≪N) through sparse approximations [2] and approximate posteriors due to non-Gaussian likelihoods [18]. The variational choice is both elegant and practical: it can be shown that the variational objective minimises the KL divergence across the entire latent process [4, 19], which guarantees that the exact model will be approximated given enough resources. Other methods, such as EP/FITC [14, 20, 21, 22], can be seen as approximate models that do not share this property, leading to behaviour that would not be expected from the model that is to be approximated [23]. It is worth noting however, that our method for convolutional GPs is not specific to the variational framework, and can be used without modification with other objective functions, such as variations on EP. 2.1 Gaussian variational approximation We adopt the popular choice of combining a sparse GP approximation with a Gaussian assumption, using a variational objective as introduced in [24]. We choose our model to be f(·) | θ ∼GP (0, k(·, ·)) , (1) yi | f, xi iid ∼p(yi | f(xi)) , (2) where p(yi | f(xi)) is some non-Gaussian likelihood, for example a Bernoulli distribution through a probit link function for classification. The kernel parameters θ are to be estimated by approximate maximum likelihood, and we drop them from the notation hereon. Following Titsias [2], we choose the approximate posterior to be a GP with its marginal distribution specified at M “inducing inputs” Z = {zm}M m=1. Denoting the value of the GP at those points as u = {f(zm)}M m=1, the approximate posterior process is constructed from the specified marginal and the prior conditional1: u ∼N m, S  , (3) f(·) | u ∼GP ku(·)⊤K−1 uuu, k(·, ·) −ku(·)⊤K−1 uuku(·)  . (4) The vector-valued function ku(·) gives the covariance between u and the remainder of f, and is constructed from the kernel: ku(·) = [k(zm, ·)]M m=1. The matrix Kuu is the prior covariance of u. The variational parameters m, S and Z are then optimised with respect to the evidence lower bound (ELBO): ELBO = X i Eq(f(xi)) [log p(yi | f(xi))] −KL[q(u)||p(u)] . (5) Here, q(u) is the density of u associated with equation (3), and p(u) is the prior density from (1). Expectations are taken with respect to the marginals of the posterior approximation, given by q(f(xi)) = N µi, σ2 i  , (6) µi = ku(xi)⊤K−1 uum , (7) σ2 i = k(xi, xi) + KfuK−1 uu(S −Kuu)K−1 uuKuf . (8) 1The construction of the approximate posterior can alternatively be seen as a GP posterior to a regression problem, where the q(u) indirectly specifies the likelihood. Variational inference will then adjust the inputs and likelihood of this regression problem to make the approximation close to the true posterior in KL divergence. 2 The matrices Kuu and Kfu are obtained by evaluating the kernel as k(zm, zm′) and k(xn, zm) respectively. The KL divergence term of the ELBO is analytically tractable, whilst the expectation term can be computed using one-dimensional quadrature. The form of the ELBO means that stochastic optimisation using minibatches is applicable. A full discussion of the methodology is given by Matthews [19]. We optimise the ELBO instead of the marginal likelihood to find the hyperparameters. 2.2 Inter-domain variational GPs Inter-domain Gaussian processes [25] work by replacing the variables u, which we have above assumed to be observations of the function at the inducing inputs Z, with more complicated variables made by some linear operator on the function. Using linear operators ensures that the inducing variables u are still jointly Gaussian with the other points on the GP. Implementing inter-domain inducing variables can therefore be a drop-in replacement to inducing points, requiring only that the appropriate (cross-)covariances Kfu and Kuu are used. The key advantage of the inter-domain approach is that the approximate posterior mean’s (7) effective basis functions ku(·) can be manipulated by the linear operator which constructs u. This can make the approximation more flexible, or give other computational benefits. For example, Hensman et al. [17] used the Fourier transform to construct u such that the Kuu matrix becomes easier to invert. Inter-domain inducing variables are usually constructed using a weighted integral of the GP: um = Z φ(x; zm)f(x) dx , (9) where the weighting function φ depends on some parameters zm. The covariance between the inducing variable um and a point on the function is then cov(um, f(xn)) = k(zm, xn) = Z φ(x; zm)k(x, xn) dx , (10) and the covariance between two inducing variables is cov(um, um′) = k(zm, zm′) = ZZ φ(x; zm)φ(x′; zm′)k(x, x′) dx dx′ . (11) Using inter-domain inducing variables in the variational framework is straightforward if the above integrals are tractable. The results are substituted for the kernel evaluations in equations (7) and (8). Our proposed method will be an inter-domain approximation in the sense that the inducing input space is different from the input space of the kernel. However, instead of relying on an integral transformation of the GP, we construct the inducing variables u alongside the new kernel such that the effective basis functions contain a convolution operation. 2.3 Additive GPs We would like to draw attention to previously studied additive models [26, 27], in order to highlight the similarity with the convolutional kernels we will introduce later. Additive models construct a prior GP as a sum of functions over subsets of the input dimensions, resulting in a kernel with the same additive structure. For example, summing over each input dimension i, we get f(x) = X i fi(x[i]) =⇒k(x, x′) = X i ki(x[i], x′[i]) . (12) This kernel exhibits some non-local generalisation, as the relative function values along one dimension will be the same regardless of the input along other dimensions. In practice, this specific additive model is rather too restrictive to fit data well, since it assumes that all variables affect the response y independently. At the other extreme, the popular squared exponential kernel allows interactions between all dimensions, but this turns out to be not restrictive enough: for high-dimensional problems we need to impose some restriction on the form of the function. In this work, we build an additive kernel inspired by the convolution operator found in convnets. The same function is applied to patches from the input, which allows adjacent pixels to interact, but imposes an additive structure otherwise. 3 3 Convolutional Gaussian Processes We begin by constructing the exact convolutional Gaussian process model, highlighting its connections to existing neural network models, and challenges in performing inference. Convolutional kernel construction Our aim is to construct a GP prior on functions on images of size D = W × H to real valued responses: f : RD →R. We start with a patch-response function, g : RE →R, mapping from patches of size E. We use a stride of 1 to extract all patches, so for patches of size E = w × h, we get a total of P = (W −w + 1) × (H −h + 1) patches. We can start by simply making the overall function f the sum of all patch responses. If g(·) is given a GP prior, a GP prior will also be induced on f(·): g ∼GP (0, kg(z, z′)) , f(x) = X p g  x[p] , (13) =⇒f ∼GP  0, P X p=1 P X p′=1 kg  x[p], x′[p′]  , (14) where x[p] indicates the pth patch of the image x. This construction is reminiscent of the additive models discussed earlier, since a function is applied to subsets of the input. However, in this case, the same function g(·) is applied to all input subsets. This allows all patches in the image to inform the value of the patch-response function, regardless of their location. Comparison to convnets This approach is similar in spirit to convnets. Both methods start with a function that is applied to each patch. In the construction above, we introduce a single patch-response function g(·) that is non-linear and nonparametric. Convnets, on the other hand, rely on many linear filters, followed by a non-linearity. The flexibility of a single convolutional layer is controlled by the number of filters, while depth is important in order to allow for enough non-linearity. In our case, adding more non-linear filters to the construction of f(·) does not increase the capacity to learn. The patch responses of the multiple filters would be summed, resulting in simply a summed kernel for the prior over g. Computational issues Similar kernels have been proposed in various forms [28, 29], but have never been applied directly in GPs, probably due to the prohibitive costs. Direct implementation of a GP using kf would be infeasible not only due to the usual cubic cost w.r.t. the number of data points, but also due to it requiring P 2 evaluations of kg per element of Kff. For MNIST with patches of size 5, P 2 ≈3.3 · 105, resulting in the kernel evaluations becoming a significant bottleneck. Sparse inducing point methods require M 2 + NM kernel evaluations of kf. As an illustration, the Kuu matrix for 750 inducing points (which we use in our experiments) would require ∼700 GB of memory for backpropagation. Luckily, this can largely be avoided. 4 Inducing patch approximations In the next few sections, we will introduce several variants of the convolutional Gaussian process, and illustrate their properties using toy and real datasets. Our main contribution is showing that convolutional structure can be embedded in kernels, and that they can be used within the framework of nonparametric Gaussian process approximations. We do so by constructing the kernel in tandem with a suitable domain in which to place the inducing variables. Implementation2 requires minimal changes to existing implementations of sparse variational GP inference, and can leverage GPU implementations of convolution operations (see appendix). In the appendix we also describe how the same inference method can be applied to kernels with general invariances. 4.1 Translation invariant convolutional GP Here we introduce the simplest version of our method. We start with the construction from section 3, with an RBF kernel for kg. In order to obtain a tractable method, we want to approximate the 2Ours can be found on https://github.com/markvdw/convgp, together with code for replicating the experiments, and trained models. It is based on GPflow [30], allowing utilisation of GPUs. 4 (a) Rectangles dataset. (b) MNIST 0-vs-1 dataset. Figure 1: The optimised inducing patches for the translation invariant kernel. The inducing patches are sorted by the value of their corresponding inducing output, illustrating the evidence each patch has in favour of a class. true posterior using a small set of inducing points. The main idea is to place these inducing points in the input space of patches, rather than images. This corresponds to using inter-domain inducing points. In order to use this approximation we simply need to find the appropriate inter-domain (cross-) covariances Kuu and Kfu, which are easily found from the construction of the convolutional kernel in equation 14: kfu(x, z) = Eg [f(x)g(z)] = Eg "X p g(x[p])g(z) # = X p kg  x[p], z  , (15) kuu(z, z′) = Eg [g(z)g(z′)] = kg(z, z′) . (16) This improves on the computation from the standard inducing point method, since only covariances between the image patches and inducing patches are needed, allowing Kfu to be calculated with NMP instead of NMP 2 kernel evaluations. Since Kuu now only requires the covariances between inducing patches, its cost is M 2 instead of M 2P 2 evaluations. However, evaluating diag [Kff] does still require NP 2 evaluations, although N can be small when using minibatch optimisation. This brings the cost of computing the kernel matrices down significantly compared to the O NM 2 cost of the calculation of the ELBO. In order to highlight the capabilities of the new kernel, we now consider two toy tasks: classifying rectangles and distinguishing zeros from ones in MNIST. Toy demo: rectangles The rectangles dataset is an artificial dataset containing 1200 images of size 28×28. Each image contains the outline of a randomly generated rectangle, and is labelled according to whether the rectangle has larger width or length. Despite its simplicity, the dataset is tricky for standard kernel-based methods, including Gaussian processes, because of the high dimensionality of the input, and the strong dependence of the label on multiple pixel locations. To tackle the rectangles dataset with the convolutional GP, we used a patch size of 3 × 3 and 16 inducing points initialised with uniform random noise. We optimised using Adam [31] (0.01 learning rate & 100 data points per minibatch) and obtained 1.4% error and a negative log predictive probability (nlpp) of 0.055 on the test set. For comparison, an RBF kernel with 1200 optimally placed inducing points, optimised with BFGS, gave 5.0% error and an nlpp of 0.258. Our model is both better in terms of performance, and uses fewer inducing points. The model works because it is able to recognise and count vertical and horizontal bars in the patches. The locations of the inducing points quickly recognise the horizontal and vertical lines in the images – see Figure 1a. Illustration: Zeros vs ones MNIST We perform a similar experiment for classifying MNIST 0 and 1 digits. This time, we initialise using patches from the training data and use 50 inducing features, shown in figure 1b. Features in the top left are in favour of classifying a zero, and tend to be diagonal or bent lines, while features for ones tend to be blank space or vertical lines. We get 0.3% error. 5 Full MNIST Next, we turn to the full multi-class MNIST dataset. Our setup follows Hensman et al. [5], with 10 independent latent GPs using the same convolutional kernel, and constraining q(u) to a Gaussian (see section 2). It seems that this translation invariant kernel is too restrictive for this task, since the error rate converges at around 2.1%, compared to 1.9% for the RBF kernel. 4.2 Weighted convolutional kernels We saw in the previous section that although the translation invariant kernel excelled at the rectangles task, it under-performed compared to the RBF on MNIST. Full translation invariance is too strong a constraint, which makes intuitive sense for image classification, as the same feature in different locations of the image can imply different classes. This can be remedied without leaving the family of Gaussian processes by relaxing the constraint of requiring each patch to give the same contribution, regardless of its position in the image. We do so by introducing a weight for each patch. Denoting again the underlying patch-based GP as g, the image-based GP f is given by f(x) = X p wpg(x[p]) . (17) The weights {wp}P p=1 adjust the relative importance of the response for each location in the image. Only kf and kfu differ from the invariant case, and can be found to be: kf(x, x) = X pq wpwqkg(x[p], xq) , (18) kfu(x, z) = X p wpkg(x[p], z) . (19) The patch weights w ∈RP are now kernel hyperparameters, and we optimise them with respect the the ELBO in the same fashion as the underlying parameters of the kernel kg. This introduces P hyperparameters into the kernel – slightly less than the number of input pixels, which is how many hyperparameters an automatic relevance determination kernel would have. Toy demo: rectangles The errors in the previous section were caused by rectangles along the edge of the image, which contained bars which only contribute once to the classification score. Bars in the centre contribute to multiple patches. The weighting allows some up-weighting of patches along the edge. This results in near-perfect classification, with no classification errors and an nlpp of 0.005. Full MNIST The weighting causes a significant reduction in error over the translation invariant and RBF kernels (table 1 & figure 2). The weighted convolutional kernel obtains 1.22% error – a significant improvement over 1.9% for the RBF kernel [5]. Krauth et al. [32] report 1.55% error using an RBF kernel, but using a leave-one-out objective for finding the hyperparameters. 4.3 Does convolution capture everything? As discussed earlier, the additive nature of the convolutional kernel places constraints on the possible functions in the prior. While these constraints have been shown to be useful for classifying MNIST, we lose the guarantee (that e.g. the RBF provides) of being able to model any continuous function arbitrarily well in the large-data limit. This is because convolutional kernels are not universal [33, 34] in the image input space, despite being nonparametric. This places convolutional kernels in a middle ground between parametric and universal kernels (see the appendix for a discussion). A kernel that is universal and has some amount of convolutional structure can be obtained by summing an RBF component: k(x, x′) = krbf(x, x′) + kconv(x, x′). Equivalently, the GP is constructed by the sum f(x) = fconv(x) + frbf(x). This allows the universal RBF to model any residuals that the convolutional structure cannot explain. We use the marginal likelihood estimate to automatically weigh how much of the process should be explained by each of the components, in the same way as is done in other additive models [27, 35]. Inference in such a model is straightforward under the usual inducing point framework – it only requires evaluating the sum of kernels. The case considered here is more complicated since we want the inducing inputs for the RBF to lie in the space of images, while we want to use inducing patches 6 for the convolutional kernel. This forces us to use a slightly different form for the approximating GP, representing the inducing inputs and outputs separately, as  uconv urbf  ∼N  µconv µrbf  , S  , (20) f(·) | u = fconv(·) | uconv + frbf(·) | urbf . (21) The variational lower bound changes only through the equations (7) and (8), which must now contain contributions of the two component Gaussian processes. If covariances in the posterior between fconv and frbf are to be allowed, S must be a full-rank 2M × 2M matrix. A mean-field approximation can be chosen as well, in which case S can be M × M block-diagonal, saving some parameters. Note that regardless of which approach is chosen, the largest matrix to be inverted is still M × M, as uconv and urbf are independent in the prior (see the appendix for more details). Full MNIST By adding an RBF component, we indeed get an extra reduction in error and nlpp from 1.22% to 1.17% and 0.048 to 0.039 respectively (table 1 & figure 2). The variances for the convolutional and RBF kernels are 14.3 and 0.011 respectively, showing that the convolutional kernel explains most of the variance in the data. 0 5 10 1 1.5 2 2.5 3 Time (hrs) Test error (%) 0 5 10 0.04 0.06 0.08 0.1 0.12 Time (hrs) Test nlpp Figure 2: Test error (left) and negative log predictive probability (nlpp, right) for MNIST, using RBF (blue), translation invariant convolutional (orange), weighted convolutional (green) and weighted convolutional + RBF (red) kernels. Kernel M Error (%) NLPP Invariant 750 2.08% 0.077 RBF 750 1.90% 0.068 Weighted 750 1.22% 0.048 Weighted + RBF 750 1.17% 0.039 Table 1: Final results for MNIST. 4.4 Convolutional kernels for colour images Our final variants of the convolutional kernel handle images with multiple colour channels. The addition of colour presents an interesting modelling challenge, as the input dimensionality increases significantly, with a large amount of redundant information. As a baseline, the weighted convolutional kernel from section 4.2 can be used by taking all patches from each colour channel together, resulting in C times more patches, where C is the number of colour channels. This kernel can only account for linear interactions between colour channels through the weights, and is also constrained to give the same patch response regardless of the colour channel. A step up in flexibility would be to define g(·) to take a w × h × C patch with all C colour channels. This trades off increasing the dimensionality of the patch-response function input with allowing it to learn non-linear interactions between the colour channels. We call this the colour-patch variant. A middle ground that does not increase the dimensionality as much, is to use a different patch-response function gc(·) for each colour channel. 7 We will refer to this as the multi-channel convolutional kernel. We construct the overall function f as f(x) = P X p=1 C X c=1 wpcgc  x[pc] . (22) For this variant, inference becomes similar to section 4.3, although for a different reason. While all gc(·)s can use the same inducing patch inputs, we need access to each gc(x[pc]) separately in order to fully specify f(x). This causes us to require separate inducing outputs for each gc. In our approximation, we share the inducing inputs, while, as was done in section 4.3, representing the inducing outputs separately. The equations for f(·)|u are changed only through the matrices Kfu and Kuu being N × MC and MC × MC respectively. Given that the gc(·) are independent in the prior, and the inducing inputs are constrained to be the same, Kuu is a block-diagonal repetition of kg (zm, zm′). All the elements of Kfu are given by kfgc(x, z) = E{gc}C c=1 "X p wpcgc  x[pc] gc(z) # = X p wpckg(x[pc], z) . (23) As in section 4.3, we have the choice to represent a full CM ×CM covariance matrix for all inducing variables u, or go for a mean-field approximation requiring only C M × M matrices. Again, both versions require no expensive matrix operations larger than M × M (see appendix). Finally, a simplification can be made in order to avoid representing C patch-response functions. If the weighting of each of the colour channels is constant w.r.t. the patch location (i.e. wpc = wpwc), the model is equivalent to using a patch-response function with an additive kernel: f(x) = X p wp X c wcgc(x[pc]) = X p wp˜g(x[pc]) , (24) ˜g(·) ∼GP 0, X c wckc(·, ·) ! . (25) CIFAR-10 We conclude the experiments by an investigation of CIFAR-10 [36], where 32 × 32 sized RGB images are to be classified. We use a similar setup to the previous MNIST experiments, by using 5 × 5 patches. Again, all latent functions share the same kernel for the prior, including the patch weights. We compare an RBF kernel to 4 variants of the convolutional kernel: the baseline “weighted”, the colour-patch, the colour-patch variant with additive structure (equation 24), and the multi-channel with mean-field inference. All models use 1000 inducing inputs and are trained using Adam. Due to memory constraints on the GPU, a minibatch size of 40 had to be used for the weighted, additive and multi-channel models. Test errors and nlpps during training are shown in figure 3. Any convolutional structure significantly improves classification performance, with colour interactions seeming particularly important, as the best performing model is the multi-channel GP. The final error rate of the multi-channel kernel was 35.4%, compared to 48.6% for the RBF kernel. While we acknowledge that this is far from state of the art using deep nets, it is a significant improvement over existing Gaussian process models, including the 44.95% error reported by Krauth et al. [32], where an RBF kernel was used together with their leave-one-out objective for the hyperparameters. This improvement is orthogonal to the use of a new kernel. 5 Conclusion We introduced a method for efficiently using convolutional structure in Gaussian processes, akin to how it has been used in neural nets. Our main contribution is showing how placing the inducing inputs in the space of patches gives rise to a natural inter-domain approximation that fits in sparse GP approximation frameworks. We discuss several variations of convolutional kernels and show how they can be used to push the performance of Gaussian process models on image datasets. Additionally, we show how the marginal likelihood can be used to assess to what extent a dataset can be explained with only convolutional structure. We show that convolutional structure is not sufficient, and that performance can be improved by adding a small amount of “fully connected” (RBF). The ability to do this, and automatically tune the hyperparameters is a real strength of Gaussian processes. It would be great if this ability could be incorporated in larger or deeper models as well. 8 0 10 20 30 40 40 50 60 Time (hrs) Test error (%) 0 10 20 30 40 1.8 2.0 2.2 2.4 2.6 Time (hrs) Test nlpp Figure 3: Test error (left) and nlpp (right) for CIFAR-10, using RBF (blue), baseline weighted convolutional (orange), full-colour weighted convolutional (green), additive (red), and multi-channel (purple). Acknowledgements CER gratefully acknowledges support from EPSRC grant EP/J012300. MvdW is generously supported by a Qualcomm Innovation Fellowship. References [1] Carl Edward Rasmussen and Christopher K.I. Williams. Gaussian Processes for Machine Learning. MIT Press, 2006. [2] Michalis K. Titsias. Variational learning of inducing variables in sparse Gaussian processes. In Proceedings of the 12th International Conference on Artificial Intelligence and Statistics, pages 567–574, 2009. [3] James Hensman, Nicolò Fusi, and Neil D. Lawrence. Gaussian processes for big data. In Proceedings of the 29th Conference on Uncertainty in Artificial Intelligence (UAI), pages 282–290, 2013. [4] 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 19th International Conference on Artificial Intelligence and Statistics, pages 231–238, 2016. [5] James Hensman, Alexander G. de G. Matthews, Maurizio Filippone, and Zoubin Ghahramani. MCMC for variationally sparse Gaussian processes. In Advances in Neural Information Processing Systems 28, pages 1639–1647, 2015. [6] Yoshua Bengio. Learning deep architectures for AI. Foundations and Trends in Machine Learning, 2(1): 1–127, January 2009. ISSN 1935-8237. [7] Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998. [8] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. Advances in Neural Information Processing Systems 25, pages 1097–1105, 2012. [9] Andrew G. Wilson, Zhiting Hu, Ruslan R. Salakhutdinov, and Eric P. Xing. Stochastic variational deep kernel learning. In Advances in Neural Information Processing Systems, pages 2586–2594, 2016. [10] Roberto Calandra, Jan Peters, Carl Edward Rasmussen, and Marc Peter Deisenroth. Manifold gaussian processes for regression. In 2016 International Joint Conference on Neural Networks (IJCNN), pages 3338–3345, 2016. [11] Radford M. Neal. Bayesian learning for neural networks, volume 118. Springer, 1996. [12] Joaquin Quiñonero-Candela and Carl Edward Rasmussen. A unifying view of sparse approximate Gaussian process regression. Journal of Machine Learning Research, 6:1939–1959, 2005. [13] Matthias Seeger, Christopher K. I. Williams, and Neil D. Lawrence. Fast forward selection to speed up sparse Gaussian process regression. In Proceedings of the Ninth International Workshop on Artificial Intelligence and Statistics, 2003. [14] Edward Snelson and Zoubin Ghahramani. Sparse Gaussian processes using pseudo-inputs. In Advances in Neural Information Processing Systems 18, pages 1257–1264, 2005. [15] Andrew Wilson and Hannes Nickisch. Kernel interpolation for scalable structured Gaussian processes (KISS-GP). In Proceedings of the 32nd International Conference on Machine Learning (ICML), pages 1775–1784, 2015. [16] Miguel Lázaro-Gredilla, Joaquin Quiñonero-Candela, Carl Edward Rasmussen, and Aníbal R FigueirasVidal. Sparse spectrum Gaussian process regression. Journal of Machine Learning Research, 11:1865–1881, 2010. 9 [17] James Hensman, Nicolas Durrande, and Arno Solin. Variational fourier features for gaussian processes. arXiv preprint arXiv:1611.06740, 2016. [18] Manfred Opper and Cédric Archambeau. The variational Gaussian approximation revisited. Neural Computation, 21(3):786–792, 2009. [19] Alexander G. de G. Matthews. Scalable Gaussian Process Inference Using Variational Methods. PhD thesis, University of Cambridge, Cambridge, UK, 2016. available at http://mlg.eng.cam.ac.uk/ matthews/thesis.pdf. [20] Daniel Hernández-Lobato and José Miguel Hernández-Lobato. Scalable gaussian process classification via expectation propagation. In Artificial Intelligence and Statistics, pages 168–176, 2016. [21] Thang D. Bui, Josiah Yan, and Richard E. Turner. A unifying framework for sparse gaussian process approximation using power expectation propagation. arXiv preprint arXiv:1605.07066, May 2016. [22] Carlos Villacampa-Calvo and Daniel Hernández-Lobato. Scalable multi-class Gaussian process classification using expectation propagation. In Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pages 3550–3559, 2017. [23] Matthias Stephan Bauer, Mark van der Wilk, and Carl Edward Rasmussen. Understanding probabilistic sparse gaussian process approximations. In Advances in neural information processing systems, 2016. [24] James Hensman, Alexander G. de G. Matthews, and Zoubin Ghahramani. Scalable variational Gaussian process classification. In Proceedings of the 18th International Conference on Artificial Intelligence and Statistics, pages 351–360, 2015. [25] 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 22, pages 1087–1095. Curran Associates, Inc., 2009. [26] Nicolas Durrande, David Ginsbourger, and Olivier Roustant. Additive covariance kernels for highdimensional Gaussian process modeling. In Annales de la Faculté de Sciences de Toulouse, volume 21, pages p–481, 2012. [27] David K. Duvenaud, Hannes Nickisch, and Carl E. Rasmussen. Additive Gaussian processes. In Advances in neural information processing systems, pages 226–234, 2011. [28] Julien Mairal, Piotr Koniusz, Zaid Harchaoui, and Cordelia Schmid. Convolutional kernel networks. Advances in Neural Information Processing Systems 27, pages 2627–2635, 2014. [29] Gaurav Pandey and Ambedkar Dukkipati. Learning by stretching deep networks. In Tony Jebara and Eric P. Xing, editors, Proceedings of the 31st International Conference on Machine Learning (ICML-14), pages 1719–1727. JMLR Workshop and Conference Proceedings, 2014. [30] Alexander G. de G. Matthews, Mark van der Wilk, Tom Nickson, Keisuke. Fujii, Alexis Boukouvalas, Pablo León-Villagrá, Zoubin Ghahramani, and James Hensman. GPflow: A Gaussian process library using TensorFlow. Journal of Machine Learning Research, 18(40):1–6, 2017. [31] Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. [32] Karl Krauth, Edwin V. Bonilla, Kurt Cutajar, and Maurizio Filippone. AutoGP: Exploring the capabilities and limitations of Gaussian process models, 2016. [33] Ingo Steinwart. On the Influence of the Kernel on the Consistency of Support Vector Machines. Journal of Machine Learning Research, 2:67–93, 2001. [34] Bharath K. Sriperumbudur, Kenji Fukumizu, and Gert R. G. Lanckriet. Universality, characteristic kernels and rkhs embedding of measures. Journal of Machine Learning Research, 12:2389–2410, July 2011. [35] David K. Duvenaud, James R. Lloyd, Roger B. Grosse, Joshua B. Tenenbaum, and Zoubin Ghahramani. Structure discovery in nonparametric regression through compositional kernel search. In ICML (3), pages 1166–1174, 2013. [36] Alex Krizhevsky, Vinod Nair, and Geoffrey Hinton. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009. URL http://www.cs.toronto.edu/~kriz/cifar. html. 10
2017
78
7,218
Best Response Regression Omer Ben-Porat Technion - Israel Institute of Technology Haifa 32000 Israel omerbp@campus.technion.ac.il Moshe Tennenholtz Technion - Israel Institute of Technology Haifa 32000 Israel moshet@ie.technion.ac.il Abstract In a regression task, a predictor is given a set of instances, along with a real value for each point. Subsequently, she has to identify the value of a new instance as accurately as possible. In this work, we initiate the study of strategic predictions in machine learning. We consider a regression task tackled by two players, where the payoff of each player is the proportion of the points she predicts more accurately than the other player. We first revise the probably approximately correct learning framework to deal with the case of a duel between two predictors. We then devise an algorithm which finds a linear regression predictor that is a best response to any (not necessarily linear) regression algorithm. We show that it has linearithmic sample complexity, and polynomial time complexity when the dimension of the instances domain is fixed. We also test our approach in a high-dimensional setting, and show it significantly defeats classical regression algorithms in the prediction duel. Together, our work introduces a novel machine learning task that lends itself well to current competitive online settings, provides its theoretical foundations, and illustrates its applicability. 1 Introduction Prediction is fundamental to machine learning and statistics. In a prediction task, an algorithm is given a sequence of examples composed of labeled instances, and its goal is to learn a general rule that maps instances to labels. When the labels take continuous values, the task is typically referred to as regression. The quality of a regression algorithm is measured by its success in predicting the value of an unlabeled instance. Literature on regression is mostly concerned with minimizing the discrepancy of the prediction, i.e. the difference between the true value and the predicted one. Despite the tremendous amount of work on prediction and regression, online commerce presents new challenges. In this context, prediction is not carried out in isolation. New entrants can utilize knowledge of previous expert predictions and the corresponding true values, to maximize their probability of predicting better than that expert, treated as the new entrant’s opponent. This fundamental task is the main challenge we tackle in this work. We initiate the study of strategic predictions in machine learning. We present a regression learning setting that stems from a game-theoretic point of view, where the goal of the learner is to maximize the probability of being the most accurate among a set of predictors. Note that this approach may be in conflict with the traditional prediction goal. Consider an online real estate expert, who frequently predicts the sale value of apartments. This expert, having been in the market for a while, has historical data on the values and characteristics of similar apartments. For simplicity, assume the expert uses simple linear regression to predict the value of an apartment as a function of its size. When a new apartment comes on the market, the expert uses her gathered historical data to predict the new apartment’s value. When the apartment is sold, the true value (and the accuracy of the prediction) is revealed. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. Size (square feet) Value (dollars) Expert Agent Figure 1: A case where minimizing the square error can be easily beaten. Each point is an instancevalue pair, where the circles are historical points (i.e. their value has been revealed) and the triangles are new points, unseen by either the expert and the agent. The red (solid) line represents the linear least squares estimators, employed by the expert. After collecting a sufficient amount of historical data (circles) on apartments along with their true value and the value predicted by the expert, the agent comes up with the response represented by the green (dashed) line. For each of the unseen apartment sizes, both the expert and the agent declare their predictions of the apartment’s value. Notice that the agent outperforms the expert in the majority of the historical points. In addition, the agent produces a more accurate prediction in the majority of the new (unseen) points. At first glance this seems extremely effective, however it is also extremely fragile. An agent who enters the real estate business may come up with a linear predictor for which the probability (over all apartments and their values) of being more accurate is high, making it the preferable predictor. Figure 1 illustrates our approach. The expert uses linear least square estimators (LSE) to minimize the mean square error (MSE). The agent, after having collected "enough" historical data (circles) and having observed the predictions of the expert, produces a strategy (regression line). Both the expert and the agent predict the value of new apartments coming on the market (triangles). As illustrated, the prediction of the agent is the most accurate in the majority of new instances. One criticism of this novel approach is that while maximizing the probability of being the most accurate, the agent may produce "embarrassing" predictions for some instances. Current prediction algorithms are designed to minimize some measure of overall loss, such as the MSE. Notice that in many, and perhaps even most, practical scenarios, being a better predictor on more instances is more important than avoiding such sporadic "embarrassing predictions". In particular, our approach fits any commerce and advertising setting where the agent offers predictions to users on the value of different goods or services, aiming at maximizing the number of users that will find her predictions more accurate than the one provided by the expert. For example, an agent, serving users searching for small apartments, would be happy to fail completely in predicting the value of very large sized apartments if this allowed predicting the value of smaller apartments better than an opponent. Our novel perspective suggests several new fundamental problems: 1. Given a prediction algorithm ALG (e.g. LSE), what would be the best response to ALG, if we aim at maximizing the probability that the new algorithm would be more accurate than ALG? 2. In case ALG is unknown, but the agent has access to a labeled set of instances along with the prediction made by ALG for each instance, how many i.i.d. samples are needed in order to learn a best response to ALG over the whole population? 3. How poorly do classical regression algorithms preform against such a best response algorithm? In this work, we focus on a two player scenario and analyze the best response of the agent against an opponent. We examine the agent’s perspective, and introduce a rigorous treatment of Problems 1-3 above. We model the task of finding a best response as a supervised learning task, and show that it 2 fits the probably approximately correct (PAC) learning framework. Specifically, we show that when the strategy space of the agent is restricted, a best response over a large enough sample set is likely to be an approximate best response over the unknown distribution. Our main result deals with an agent employing linear regression in Rn for any constant n. We present a polynomial time algorithm which computes a linear best response (i.e. from the set of all linear predictors) to any regression algorithm employed by the opponent. We also show a linearithmic bound in the number of training samples needed in order to successfully learn a best response. In addition, we show that in some cases our algorithm can be adapted to have an MSE score arbitrarily close to that of the given regression algorithm ALG. The theoretical analysis is complemented by an experimental study, which illustrates the effectiveness of our approach. In order to find a best linear response in high dimensional space, we provide a mixed integer linear programming (MILP) algorithm. The MILP algorithm is tested on the Boston housing dataset [5]. Indeed, we show that we can outperform classical regression algorithms in up to 70% of the points. Moreover, we outperform classical regression algorithms even in the case where they have full access to both training and test data, while we restrict our responder algorithm to the use of the training data only. Our contribution. Our contributions are 3-fold. The main conceptual contribution of this paper is the explicit suggestion that a prediction task may have strategic aspects. We introduce the setting of best response regression, applicable to a huge variety of scenarios, and revise the PAC-learning framework to deal with such a duel framework. Then, we show an efficient algorithm dealing with finding a best-response linear regression in Rn for any constant n, against any regression algorithm. This best response algorithm maximizes the probability of beating the latter on new instances. Finally, we present an experimental study showing the applicability of our approach. Together, this work offers a new machine learning challenge, addresses some of its theoretical properties and algorithmic challenges, while also showing its applicability. 1.1 Related work The intersection of learning theory with multi-agent systems is expanding with the rise of data science. In the field of mechanism design [8], [3, 7] considered prediction tasks with strategic aspects. In their model, the instances domain is to be labeled by one agent, and the dataset is constructed of points controlled by selfish users, who have their own view on how to label the instances domain. Hence, the users can misreport the points in order to sway decisions in their favor. A different line of work that is related to our model is the analysis of sample complexity in revenue maximizing auctions. In a recent work [2] the authors reconsider an auction setting where the auctioneer can sample from the valuation functions of the bidders, thereby relaxing the ubiquitous assumption of knowing the underlying distribution over bidders’ valuations. While the above papers consider mechanism design problems inspired by machine learning, our work considers a novel machine learning problem inspired by game theory. In work on dueling algorithms [6], an optimization problem is analyzed from the perspective of competition, rather than from the point of view of a single optimizer. That work examines the dueling form of several optimization problems, e.g. the shortest path from the source vertex to the target vertex in a graph with random weights. While minimizing the expected length is a probable solution concept for a single optimizer, this is no longer the case in the defined duel. While [6] assumes a commonly-known distribution over a finite set of instances, we have no such assumption. Instead, we consider a sample set drawn from the underlying distribution with the aim of predicting a new instance better than the opponent. Our formulation is also related to the Learning Using Privileged Information paradigm (see, e.g., [9, 14, 15]), in which the learner (agent) is supplied with additional information along with the label of each instance. In this paper, we assume the agent has access to predictions made by another algorithm (the opponent’s), which can be treated as additional information. 2 Problem formulation The environment is composed of instances and labels. In the motivating example given above, the instances are the characteristics of the apartments, and the labels are the values of these apartments. 3 A set of N players offer predictive services, where a strategy of a player is a labeling function. For each instance-label pair (x, y), the players see x, and subsequently each player i, predicts the value of the y. We call this label estimate ˆyi. The player who wins a point (x, y) is the one with the smallest discrepancy, i.e. mini | ˆyi −y|. Under the strategy profile (h1, . . . hN), where each entry is the labeling function chosen by the corresponding player, the payoff of Player i is Pr ({(x, y) : Player i wins (x, y)}). A strategy of a player is called a best response if it maximizes the payoff of that player, when the strategies of all the other players are fixed. In this work, we analyze the best response of a player, and w.l.o.g. we assume she has only one opponent. The model is as follows: 1. We assume a distribution over the examples domain, which is the cross product of the instances domain X ⊂Rn and the labels domain Y ⊂R. 2. The agent and the opponent both predict the label of each instance. The opponent uses a strategy ¯h, which is a conditional distribution over R given x ∈X. 3. The agent is unaware of the distribution over X × Y or the strategy of the opponent ¯h. Hence, we explicitly address the joint distribution D over Z = X × Y × R, where a triplet (x, y, p) represents an instance x, its label y, and the discrepancy of the opponent’s predicted value p, i.e. p = |¯h(x) −y|. We stress that D is unknown to the agent. 4. The payoff of the agent under the strategy h : X →Y is given by πD(h) = E (x,y,p)∼D 1|h(x)−y)|<p  . 5. The agent has access to a sequence of examples S, with which she wishes to maximize her payoff. Note that a strategy which outputs yi for every instance xi in S may look promising, but will probably lead to overfitting, and low payoff for the agent. Since the agent wishes to generalize from S to D, restricting the strategy set to H ⊂YX seems justified. We define the goal of the agent: 6. The agent is willing to restrict herself to a strategy from H ⊂YX . Her goal: to find an algorithm which, given ϵ, δ ∈(0, 1) and a sequence of m = m(ϵ, δ) examples S sampled i.i.d. from D, outputs a strategy h∗such that with probability at least 1 −δ (over the choices of S) it holds that πD(h∗) ≥sup h∈H πD(h) −ϵ. Indeed, the access to a sequence of examples seems realistic, and the size of S depends on the amount of resources at the agent’s disposal. The size of S also affects the selection of H: if the agent can gather "many" examples, she might be able to learn a "good" strategy from a more complex strategy space. We say that h ∈H is an approximate best response with factor ϵ if for all h′ ∈H it holds that πD(h′) −πD(h) ≤ϵ. Note that the goal of the agent can be interpreted as finding an approximate best response with high probability. The empirical payoff of the agent is defined by πS(h) = 1 m · {i : 1|h(xi)−yi)|<pi} , and a strategy h ∈arg maxh′∈H πS(h′) is called an empirical best response (w.r.t S). Next, we adopt the PAC framework [12] to define under which strategy spaces an empirical best response is likely to be an approximate best response. 2.1 Approximate best response with PAC learnability The field of statistical learning addresses the problem of finding a predictive function based on data. We briefly define some key concepts in learning theory, that will be used later. For a more gentle introduction the reader is referred to [11]. Let G be a class of functions from Z to {0, 1} and let S = {z1, . . . , zm} ⊂Z. The restriction of G to S, denoted G(S), is defined by G(S) = {(g(z1), g(z2), . . . , g(zm)) : g ∈G}. Namely, G(S) contains all the binary vectors induced by the functions in G on the items of S. We say that G shatters S if G(S) contains all binary vectors of size m, i.e. |G(S)| = 2m. 4 Definition 1 (VC dimension,[13]). The VC dimension of a class G, denoted VCdim(G), is the maximal size of a set S ⊂Z that can be shattered by G. Definition 2 (PAC learnability,[12]). A hypothesis class H is PAC-learnable with respect to a domain set Z and a loss function l : H × Z →R+ , if there exists a function τH : (0, 1)2 →N and a learning algorithm ALG such that for every ϵ, δ ∈(0, 1) and for every distribution D over Z, when running ALG on m ≥τH(ϵ, δ) i.i.d. examples generated by D, it returns a hypothesis h ∈H such that with probability of at least 1 −δ it holds that LD(h) ≤inf h′∈H LD(h′) + ϵ, (1) where LD(h) = Ez∼Zl(h, z). Let H be a class of functions from X to Y, and let Z = X × Y × R, as defined earlier in this section. Typically in a regression task, the hypothesis class is restricted in order to decrease the distance between the predicted labels and the true label. In the aforementioned model, however, the agent may want to deliberately harm her accuracy on some subset of the instances domain. She will do this as long as it increases the number of instances having a better prediction, thereby improving her payoff. Since h ∈H can either win a point (x, y, p) or lose it, the model resembles a binary classification task, where the "label" of (x, y, p) is the identity of the winner. That is, a triplet (x, y, p) would be labeled 1 if the agent produced a better prediction than the opponent, and zero otherwise. However, notice that the agent’s strategy is involved in the labeling. This is, of course, not the case of binary classification. Our approach is to introduce a corresponding binary classification problem, and by leveraging former results obtained on binary classification, deduce sufficient learnability conditions for our model. The complete reduction is described in detail in the appendix. Adjusting to the loss function framework, define: ∀z = (x, y, p) ∈Z : l(h, z) = 1 |h(x) −y| ≥p 0 |h(x) −y| < p . Observe that l(h, z) = 0 whenever the agent wins a point and l(h, z) = 1 otherwise. If we set LD(h) = Ez∼D l(h, z), Equation (1) can be reformulated as πD(h) ≥suph′∈H πD(h′) −ϵ. Our goal is to find sufficient conditions for H to be PAC-learnable w.r.t Z and l. Given H, let GH = {gh : h ∈H} such that ∀h ∈H, ∀z ∈Z : gh(z) = 1 −l(h, z) = 1 |h(x) −y| < p 0 |h(x) −y| ≥p . Note that GH is a class of functions from Z to {0, 1}. Sufficient learnability conditions can now be stated. Lemma 1. Let H be a class of functions from X to Y with VCdim(GH) = d < ∞. Then there is a constant C, such that for every ϵ, δ ∈(0, 1) and every distribution D over Z = X × Y × R, if we sample a sequence of examples S of size m ≥C · d+log 1 δ ϵ2 i.i.d. from D and pick an empirical best response h ∈H w.r.t. S, then with probability of at least 1 −δ it holds that πD(h) ≥sup h′∈H πD(h′) −ϵ. 3 Best linear response We assume throughout this section that the agent uses a linear response. In what follows, we first show that H is PAC-learnable with respect to Z and the payoff function. Afterwards, we devise an empirical best response algorithm with respect to a sequence of examples. Hence, according to the previous section, this empirical payoff maximization algorithm outputs, with high probability, an approximate best response with respect to D. The proofs of all theorems and the supporting lemmas are in the appendix. For ease of presentation, we re-denote the dimension of the instances domain to be n −1, i.e. X ⊂Rn−1. Every h ∈Rn defines a linear predictor of a point x ∈Rn−1 via dot product, namely 5 h · (xi, 1). Thus, Rn is referred to as the strategy space H, where axis i represents the i’th entry in h, 1 ≤i ≤n + 1. We study the case where n is fixed, although the complementary case is discussed in the end of the section. Recall that the empirical payoff of the agent w.r.t to a sequence of examples S = (xi, yi, pi)m i=1 is defined as πS(h) = 1 m Pm i=1 1|h·(xi,1)−yi|<pi, and the best response w.r.t. to S is arg maxh∈H πS(h). Observe that there is a mapping MH S : H →{0, 1}m from any h ∈H to a vector v ∈{0, 1}m such that entry i in v equals one if h gains the i’th point, and zero otherwise. Put differently, MH S (h) = v = (v1, . . . vm) such that: ∀i ∈[m] : vi = 1 ⇔|h · (xi, 1) −yi| < pi. Hence, the target set of MH S is GH(S), which is the restriction of GH to S. The size of GH(S) is essentially the effective size of H, since any two strategies which are mapped to the same vector will gain the same points, and thus are equivalent. The following theorem puts a bound on the size of GH(S). Theorem 1. Let H be the hypothesis class of all linear functions in Rn−1. For any sequence of examples S of size m, GH(S) is polynomial in m. Specifically, |GH(S)| ≤Pn i=0 2im i  . The VC-dimension of GH can be bounded using the Sauer - Shelah lemma [10]: Lemma 2. It holds that VCdim(GH) ≤max{⌊2n · log(n)⌋, 20}. We now devise an empirical payoff maximizing algorithm. Our approach is to first explicitly characterize the vectors in GH(S), and afterwards to pick a strategy from  h : MH S (h) 1 = max v∈GH(S) ∥v∥1  . For each vector v, one can formulate a linear program which outputs a strategy in {h : MH S (h) = v} in case this set is not empty, or outputs none in case it is. Naively, 2m such feasibility problems can be solved, although this is very inefficient. Instead, we will recursively construct the set of feasible vectors. The Partial Vector Feasibility problem aids in recursively partitioning the hypothesis space. Note that it is solvable in time poly(n, m) using Linear Programming. Problem: PARTIAL VECTOR FEASIBILITY (PVF) Input: a sequence of examples S = (xi, yi, pi)m i=1, and a vector v ∈{1, 0, a, b}m Output: a point h ∈Rn satisfying 1. If vi = 1 then |h · (xi, 1) −yi| < pi. 2. If vi = a then h · (xi, 1) −yi > pi. 3. If vi = b then h · (xi, 1) −yi < −pi. if such exists, and φ otherwise. The following algorithm partitions Rn according to GH(S), where in each iteration it "discovers" one more point in the sequence S. Algorithm: EMPIRICAL PAYOFF MAXIMIZATION (EPM) Input: S = (xi, yi, pi)m i=1 Output: Empirical payoff maximizer w.r.t. S 1 v ←{0}m // v = (v1, v2, . . . , vm) 2 R0 ←{v} 3 for i = 1 to m do 4 Ri ←∅ 5 for v ∈Ri−1 do 6 for α ∈{1, a, b} do 7 if PVF (S, (v−i, α)) ̸= φ then 8 add (v−i, α) to Ri // (v−i, α) = (v1, . . . vi−1, α, vi+1, . . . , vm) 9 return v∗∈arg maxv∈Rm ∥v∥1 Theorem 2. When running EPM on a sequence of examples S, it finds an empirical best response in poly(|S|) time. 6 1 2 3 x y y = ¯a · x + ¯b y = a∗· x + b∗ R1 R2 R3 (a∗, b∗) (¯a,¯b) a b Figure 2: An example of simple linear regression with linear strategies. On the left we have a sample sequence of size 3, along with the strategy ¯h = (¯a,¯b) of the opponent (the solid line) and a best response strategy of the agent (the dashed line). On the right the hypothesis space is presented, where each pair (a, b) represents a possible strategy, and each bounded set Ri is defined by Ri =  (a, b) ∈R2 : |a · xi + b −yi| < pi , i.e. the set of hypotheses which give xi better prediction than ¯h. Notice that (¯a,¯b) relies on the boundaries of all Ri, 1 ≤i ≤3. In addition, since (a∗, b∗) is inside R1 ∩R2 ∩R3, the strategy h∗= (a∗, b∗), i.e. the line y = a∗· x + b∗, predicts all the points better than the opponent. Observe that by taking any convex combination of h∗, ¯h, the agent not only perserves her empirical payoff but also improves her MSE score. When we combine Theorem 2 with Lemmas 2 and 1, we get: Corollary 1. Given ϵ, δ ∈(0, 1), if we run EPM on m ≥C ϵ2 · max{⌊2n · log(n)⌋, 20} + log 1 δ  examples sampled i.i.d. from D (for a constant C), then it outputs h∗such that with probability at least 1 −δ satisfies πD(h∗) ≥sup h′∈H πD(h′) −ϵ. A desirable achievement would be if the best response prediction algorithm would also keep the loss small in the original (e.g. MSE) measure. We now show that in some cases the agent can, by slightly modifying the output of EPM, find a strategy that is not only an approximate best response, but is also robust with respect to additive functions of discrepancies. See Figure 2 for illustration. Lemma 3. Assume the opponent uses a linear predictor ¯h, and denote by h∗the strategy output by EPM. Then, h∗can be efficiently modified to a strategy which is not only an empirical best response, but also performs arbitrarily close to ¯h w.r.t. to any additive function of the discrepancies. Finaly, we discuss the case where the dimension of the instances domain is a part of the input. It is known that learning the best halfspace is NP-hard in binary classification (w.r.t. to a given sequence of points), when the dimension of the data is not fixed (see e.g. [1]). We show that the empirical best (linear) response problem is of the same flavor. Lemma 4. In case H is the set of linear functions in Rn−1 and n is not fixed, the empirical best response problem is NP-hard. 4 Experimental results We note that when n is large, the proposed method for finding an empirical best response may not be suitable. Nevertheless, if the agent is interested in finding a "good" response to her opponents, she should come up with something. With slight modifications, the linear best response problem can be formulated as a mixed integer linear program (MILP).1 Hence, the agent can exploit sophisticated solvers and use clever heuristics. Further, one implication of Lemma 1 is that the true payoffs 1See the appendix for the mixed integer linear programming formulation. 7 Table 1: Experiments on Boston Housing dataset The opponent’s strategy Scenario Train payoff Test payoff Least square errors (LSE) TRAIN 0.699 0.641 ALL 0.711 0.645 Least absolute errors (LAE) TRAIN 0.621 0.570 ALL 0.625 0.528 Results obtained on the Boston Housing dataset. Each cell in the table represents the average payoff of the agent over 1000 simulations (splits into 80% train and 20% test). The "train payoff" is the proportion of points in the training set on which the agent is more accurate, and the "test payoff" payoff is the equivalent proportion with respect to the test (unseen) data. uniformly converge, and hence any empirical payoff obtained by the MILP is close to its real payoff with high probability. In this section, we show the extent to which classical linear regression algorithms can be beaten using the Boston housing dataset [5], a built-in dataset in the leading data science packages (e.g. scikit-learn in Python and MASS in R). The Boston housing dataset contains 506 instances, where each instance has 13 continuous attributes and one binary attribute. The label is the median value of owner-occupied homes, and among the attributes are the per capita crime rate, the average number of rooms per dwelling, the pupil-teacher ratio by town and more. The R-squared measure for minimizing the square error in the Boston housing dataset is 0.74, indicating that the use of linear regression is reasonable. As possible strategies of the opponent, we analyzed the linear least squares estimators (LSE) and linear least absolute estimators (LAE). The dataset was split into training (80%) and test (20%) sets, and two scenarios were considered: Scenario TRAIN - the opponent’s model is learned from the training set only. Scenario ALL - the opponent’s model is learned from both the training and the test sets. In both scenarios the agent had access to the training set only, along with the opponent’s discrepancy for each point in the training set. Obviously, achieving payoff of more than 0.5 (that is, more than 50% of the points) in the ALL scenario is a real challenge, since the opponent has seen the test set in her learning process. We ran 1000 simulations, where each simulation is a random split of the dataset. We employed the MILP formulation, and used Gurobi software [4] in order to find a response, where the running time of the solver was limited to one minute.2 Our findings are reported in Table 1. Notice that against both opponent strategies, and even in case where the opponent had seen the test set, the agent still gets more than 50% of the points. In both scenarios, LAE guarantees the opponent more than LSE. This is because absolute error is less sensitive to large deviations. We also noticed that when the opponent learns from the whole dataset, the empirical payoff of the agent is greater. Indeed, the latter is reasonable as in the ALL scenario the agent’s strategy fits the training set while the opponent strategy does not. Beyond the main analysis, we examined the success (or lack thereof) of the agent with respect to the additive loss function optimized by the opponent (corresponding to the MSE for LSE, and the MAE (mean absolute error) for LAE), hereby referred to as the "classical loss". Recall that Lemma 3 guarantees that the agent’s classical loss can be arbitrarily close to that of the opponent when she plays a best response; however, the response we consider in this section (using the MILP) does not necessarily converge to a best response. Therefore, we find it interesting to consider the classical loss as well, thereby presenting the complementary view. We report in Table 2 the average ratio between the agent’s classical loss and that of the opponent under the TRAIN scenario with respect to the training and test sets. Notice that the agent suffers from less than a 0.7% increase with respect to the classical loss optimized by the opponent. In particular, 2Code for reproducing the experiments is available at https://github.com/omerbp/ Best-Response-Regression 8 Table 2: Ratio of the classical loss The opponent’s strategy LSE LAE Training set 1.007 1.005 Test set 0.999 1.002 Ratio of the agent’s loss and the opponent’s loss, where the loss function corresponds to the original optimization function of the opponent, under scenario TRAIN. For example, the upper leftmost cell represents the agent’s MSE divided by the opponents MSE on the training set, where the opponent uses LSE. Similarly, the lower rightmost cell represents the agent’s MAE (mean absolute error) divided by the opponents MAE on the test data, when the opponent uses LAE. the MSE of the agent (when she responds to LSE) on the test set is less than that of the opponent. The same phenomenon, albeit on a smaller scale, occurs against LAE: the training set ratio is greater than the test set ratio. To conclude, the agent is not only able to obtain the majority of the points (and in some cases, up to 70%), but also to keep the classical loss optimized by her opponent within less than 0.2% from the optimum on the test set. 5 Discussion This work introduces a game theoretic view of a machine learning task. After finding sufficient conditions for learning to occur, we analyzed the induced learning problem, when the agent is restricted to a linear response. We showed that a best response with respect to a sequence of examples can be computed in polynomial time in the number of examples, as long as the instance domain has a constant dimension. Further, we showed an algorithm that for any ϵ, δ computes an ϵ-best response with a probability of at least 1 −δ, when it is given a sequence of poly 1 ϵ2 n log n + log 1 δ  examples drawn i.i.d. As the reader may notice, our analysis holds as long as the hypothesis is linear in its parameters, and therefore is much more general than linear regression. Interestingly, this is a novel type of optimization problem and so rich hypothesis, which are somewhat unnatural in the traditional task of regression, might be successfully employed in the proposed setting. From an empirical standpoint, the gap between the empirical payoff and the true payoff calls for applying regularization methods for the best response problem and encourages further algorithmic research. Exploring whether or not a response in the form of hyperplanes can be effective against a more complex strategy employed by the opponent will be intriguing. For instance, showing that a deep learner is beatable in this setting will be remarkable. The main direction to follow is the analysis of the competitive environment introduced in the beginning of Section 2 as a simultaneous game: is there an equilibrium strategy? Namely, is there a linear predictor which, when used by both the agent and the opponent, is a best response to one another? Acknowledgments We thank Gili Baumer and Argyris Deligkas for helpful discussions, and anonymous reviewers for their useful suggestions. This project has received funding from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (grant agreement n◦ 740435). References [1] E. Amaldi and V. Kann. The complexity and approximability of finding maximum feasible subsystems of linear relations. Theoretical computer science, 147(1-2):181–210, 1995. [2] R. Cole and T. Roughgarden. The sample complexity of revenue maximization. In Proceedings of the 46th Annual ACM Symposium on Theory of Computing, pages 243–252. ACM, 2014. 9 [3] O. Dekel, F. Fischer, and A. D. Procaccia. Incentive compatible regression learning. Journal of Computer and System Sciences, 76(8):759–777, 2010. [4] I. Gurobi Optimization. Gurobi optimizer reference manual, 2016. [5] D. Harrison and D. L. Rubinfeld. Hedonic housing prices and the demand for clean air. Journal of environmental economics and management, 5(1):81–102, 1978. [6] N. Immorlica, A. T. Kalai, B. Lucier, A. Moitra, A. Postlewaite, and M. Tennenholtz. Dueling algorithms. In Proceedings of the forty-third annual ACM symposium on Theory of computing, pages 215–224. ACM, 2011. [7] R. Meir, A. D. Procaccia, and J. S. Rosenschein. Algorithms for strategyproof classification. Artificial Intelligence, 186:123–156, 2012. [8] N. Nisan and A. Ronen. Algorithmic mechanism design. In Proceedings of the thirty-first annual ACM symposium on Theory of computing, pages 129–140. ACM, 1999. [9] D. Pechyony and V. Vapnik. On the theory of learnining with privileged information. In Advances in neural information processing systems, pages 1894–1902, 2010. [10] N. Sauer. On the density of families of sets. Journal of Combinatorial Theory, Series A, 13(1): 145–147, 1972. [11] S. Shalev-Shwartz and S. Ben-David. Understanding machine learning: From theory to algorithms. Cambridge University Press, 2014. [12] L. G. Valiant. A theory of the learnable. Communications of the ACM, 27(11):1134–1142, 1984. [13] V. Vapnik and A. Chervonenkis. On the uniform convergence of relative frequencies of events to their probabilities. Theory of Probability and its Applications, 16(2):264, 1971. [14] V. Vapnik and A. Vashist. A new learning paradigm: Learning using privileged information. Neural networks, 22(5):544–557, 2009. [15] V. Vapnik, A. Vashist, and N. Pavlovitch. Learning using hidden information: Master class learning. NATO Science for Peace and Security Series, D: Information and Communication Security, 19:3–14, 2008. 10
2017
79
7,219
Beyond Worst-case: A Probabilistic Analysis of Affine Policies in Dynamic Optimization Omar El Housni IEOR Department Columbia University oe2148@columbia.edu Vineet Goyal IEOR Department Columbia University vg2277@columbia.edu Abstract Affine policies (or control) are widely used as a solution approach in dynamic optimization where computing an optimal adjustable solution is usually intractable. While the worst case performance of affine policies can be significantly bad, the empirical performance is observed to be near-optimal for a large class of problem instances. For instance, in the two-stage dynamic robust optimization problem with linear covering constraints and uncertain right hand side, the worst-case approximation bound for affine policies is O(pm) that is also tight (see Bertsimas and Goyal [8]), whereas observed empirical performance is near-optimal. In this paper, we aim to address this stark-contrast between the worst-case and the empirical performance of affine policies. In particular, we show that affine policies give a good approximation for the two-stage adjustable robust optimization problem with high probability on random instances where the constraint coefficients are generated i.i.d. from a large class of distributions; thereby, providing a theoretical justification of the observed empirical performance. On the other hand, we also present a distribution such that the performance bound for affine policies on instances generated according to that distribution is ⌦(pm) with high probability; however, the constraint coefficients are not i.i.d.. This demonstrates that the empirical performance of affine policies can depend on the generative model for instances. 1 Introduction In most real word problems, parameters are uncertain at the optimization phase and decisions need to be made in the face of uncertainty. Stochastic and robust optimization are two widely used paradigms to handle uncertainty. In the stochastic optimization approach, uncertainty is modeled as a probability distribution and the goal is to optimize an expected objective [13]. We refer the reader to Kall and Wallace [19], Prekopa [20], Shapiro [21], Shapiro et al. [22] for a detailed discussion on stochastic optimization. On the other hand, in the robust optimization approach, we consider an adversarial model of uncertainty using an uncertainty set and the goal is to optimize over the worst-case realization from the uncertainty set. This approach was first introduced by Soyster [23] and has been extensively studied in recent past. We refer the reader to Ben-Tal and Nemirovski [3, 4, 5], El Ghaoui and Lebret [14], Bertsimas and Sim [10, 11], Goldfarb and Iyengar [17], Bertsimas et al. [6] and Ben-Tal et al. [1] for a detailed discussion of robust optimization. However, in both these paradigms, computing an optimal dynamic solution is intractable in general due to the “curse of dimensionality”. This intractability of computing the optimal adjustable solution necessitates considering approximate solution policies such as static and affine policies where the decision in any period t is restricted to a particular function of the sample path until period t. Both static and affine policies have been 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. studied extensively in the literature and can be computed efficiently for a large class of problems. While the worst-case performance of such approximate policies can be significantly bad as compared to the optimal dynamic solution, the empirical performance, especially of affine policies, has been observed to be near-optimal in a broad range of computational experiments. Our goal in this paper is to address this stark contrast between the worst-case performance bounds and near-optimal empirical performance of affine policies. In particular, we consider the following two-stage adjustable robust linear optimization problems with uncertain demand requirements: zAR (c, d, A, B, U) = min x cT x + max h2U min y(h) dT y(h) Ax + By(h) ≥h 8h 2 U x 2 Rn +, y(h) 2 Rn + 8h 2 U (1) where A 2 Rm⇥n + , c 2 Rn +, d 2 Rn +, B 2 Rm⇥n + . The right-hand-side h belongs to a compact convex uncertainty set U ✓Rm +. The goal in this problem is to select the first-stage decision x, and the second-stage recourse decision, y(h), as a function of the uncertain right hand side realization, h such that the worst-case cost over all realizations of h 2 U is minimized. We assume without loss of generality that c = e and d = ¯d · e (by appropriately scaling A and B). Here, ¯d can interpreted as the inflation factor for costs in the second-stage. This model captures many important applications including set cover, facility location, network design, inventory management, resource planning and capacity planning under uncertain demand. Here the right hand side, h models the uncertain demand and the covering constraints capture the requirement of satisfying the uncertain demand. However, the adjustable robust optimization problem (1) is intractable in general. In fact, Feige et al. [16] show that ⇧AR(U) (1) is hard to approximate within any factor that is better than ⌦(log n). Both static and affine policy approximations have been studied in the literature for (1). In a static solution, we compute a single optimal solution (x, y) that is feasible for all realizations of the uncertain right hand side. Bertsimas et al. [9] relate the performance of static solution to the symmetry of the uncertainty set and show that it provides a good approximation to the adjustable problem if the uncertainty is close to being centrally symmetric. However, the performance of static solutions can be arbitrarily large for a general convex uncertainty set with the worst case performance being ⌦(m). El Housni and Goyal [15] consider piecewise static policies for two-stage adjustable robust problem with uncertain constraint coefficients. These are a generalization of static policies where we divide the uncertainty set into several pieces and specify a static solution for each piece. However, they show that, in general, there is no piecewise static policy with a polynomial number of pieces that has a significantly better performance than an optimal static policy. An affine policy restricts the second-stage decisions, y(h) to being an affine function of the uncertain right-hand-side h, i.e., y(h) = P h + q for some P 2 Rn⇥m and q 2 Rm are decision variables. Affine policies in this context were introduced in Ben-Tal et al. [2] and can be formulated as: zA↵(c, d, A, B, U) = min x,P ,q cT x + max h2U dT (P h + q) Ax + B (P h + q) ≥h 8h 2 U P h + q ≥0 8h 2 U x 2 Rn + (2) An optimal affine policy can be computed efficiently for a large class of problems. Bertsimas and Goyal [8] show that affine policies give a O(pm)-approximation to the optimal dynamic solution for (1). Furthermore, they show that the approximation bound O(pm) is tight. However, the observed empirical performance for affine policies is near-optimal for a large set of synthetic instances of (1). 1.1 Our Contributions Our goal in this paper is to address this stark contrast by providing a theoretical analysis of the performance of affine policies on synthetic instances of the problem generated from a probabilistic model. In particular, we consider random instances of the two-stage adjustable problem (1) where the entries of the constraint matrix B are random from a given distribution and analyze the performance of affine policies for a large class of distributions. Our main contributions are summarized below. 2 Independent and Identically distributed Constraint Coefficients. We consider random instances of the two-stage adjustable problem where the entries of B are generated i.i.d. according to a given distribution and show that an affine policy gives a good approximation for a large class of distributions including distributions with bounded support and unbounded distributions with Gaussian and sub-gaussian tails. In particular, for distributions with bounded support in [0, b] and expectation µ, we show that for sufficiently large values of m and n, affine policy gives a b/µ-approximation to the adjustable problem (1). More specifically, with probability at least (1 −1/m), we have that zA↵(c, d, A, B, U)  b µ(1 −✏) · zAR(c, d, A, B, U), where ✏= b/µ p log m/n (Theorem 2.1). Therefore, if the distribution is symmetric, affine policy gives a 2-approximation for the adjustable problem (1). For instance, for the case of uniform or Bernoulli distribution with parameter p = 1/2, affine gives a nearly 2-approximation for (1). While the above bound leads to a good approximation for many distributions, the ratio b µ can be significantly large in general; for instance, for distributions where extreme values of the support are extremely rare and significantly far from the mean. In such instances, the bound b/µ can be quite loose. We can tighten the analysis by using the concentration properties of distributions and can extend the analysis even for the case of unbounded support. More specifically, we show that if Bij are i.i.d. according to an unbounded distribution with a sub-gaussian tail, then for sufficiently large values of m and n, with probability at least (1 −1/m), zA↵(c, d, A, B, U) O( p log mn) · zAR(c, d, A, B, U). We prove the case of folded normal distribution in Theorem 2.6. Here we assume that the parameters of the distributions are constants independent of the problem dimension and we would like to emphasis that the i.i.d. assumption on the entries of B is for the scaled problem where c = e and d = ¯de. We would like to note that the above performance bounds are in stark contrast with the worst case performance bound O(pm) for affine policies which is tight. For the random instances where Bij are i.i.d. according to above distributions, the performance is significantly better. Therefore, our results provide a theoretical justification of the good empirical performance of affine policies and close the gap between worst case bound of O(pm) and observed empirical performance. Furthermore, surprisingly these performance bounds are independent of the structure of the uncertainty set, U unlike in previous work where the performance bounds depend on the geometric properties of U. Our analysis is based on a dual-reformulation of (1) introduced in [7] where (1) is reformulated as an alternate two-stage adjustable optimization and the uncertainty set in the alternate formulation depends on the constraint matrix B. Using the probabilistic structure of B, we show that the alternate dual uncertainty set is close to a simplex for which affine policies are optimal. We would also like to note that our performance bounds are not necessarily tight and the actual performance on particular instances can be even better. We test the empirical performance of affine policies for random instances generated according to uniform and folded normal distributions and observe that affine policies are nearly optimal with a worst optimality gap of 4% (i.e. approximation ratio of 1.04) on our test instances as compared to the optimal adjustable solution that is computed using a Mixed Integer Program (MIP). Worst-case distribution for Affine policies. While for a large class of commonly used distributions, affine policies give a good approximation with high probability for random i.i.d. instances according to the given distribution, we present a distribution where the performance of affine policies is ⌦(pm) with high probability for instances generated from this distribution. Note that this matches the worst-case deterministic bound for affine policies. We would like to remark that in the worst-case distribution, the coefficients Bij are not identically distributed. Our analysis suggests that to obtain bad instances for affine policies, we need to generate instances using a structured distribution where the structure of the distribution might depend on the problem structure. 2 Random instances with i.i.d. coefficients In this section, we theoretically characterize the performance of affine policies for random instances of (1) for a large class of generative distributions including both bounded and unbounded support 3 distributions. In particular, we consider the two-stage problem where constraint coefficients A and B are i.i.d. according to a given distribution. We consider a polyhedral uncertainty set U given as U = {h 2 Rm + | Rh r} (3) where R 2 RL⇥m + and r 2 RL +. This is a fairly general class of uncertainty sets that includes many commonly used sets such as hypercube and budget uncertainty sets. Our analysis of the performance of affine policies does not depend on the structure of first stage constraint matrix A or cost c. The second-stage cost, as already mentioned, is wlog of the form d = ¯de. Therefore, we restrict our attention only to the distribution of coefficients of the second stage matrix B. We will use the notation ˜B to emphasis that B is random. For simplicity, we refer to zAR (c, d, A, B, U) as zAR (B) and to zA↵(c, d, A, B, U) as zA↵(B). 2.1 Distributions with bounded support We first consider the case when ˜Bij are i.i.d. according to a bounded distribution with support in [0, b] for some constant b independent of the dimension of the problem. We show a performance bound of affine policies as compared to the optimal dynamic solution. The bound depends only on the distribution of ˜B and holds for any polyhedral uncertainty set U. In particular, we have the following theorem. Theorem 2.1. Consider the two-stage adjustable problem (1) where ˜Bij are i.i.d. according to a bounded distribution with support in [0, b] and E[ ˜Bij] = µ 8i 2 [m] 8j 2 [n]. For n and m sufficiently large, we have with probability at least 1 −1 m, zA↵( ˜B)  b µ(1 −✏) · zAR( ˜B) where ✏= b µ q log m n . The above theorem shows that for sufficiently large values of m and n, the performance of affine policies is at most b/µ times the performance of an optimal adjustable solution. Moreover, we know that zAR( ˜B) zA↵( ˜B) for any B since the adjustable problem is a relaxation of the affine problem. This shows that affine policies give a good approximation (and significantly better than the worst-case bound of O(pm)) for many important distributions. We present some examples below. Example 1. [Uniform distribution] Suppose for all i 2 [m] and j 2 [n] ˜Bij are i.i.d. uniform in [0, 1]. Then µ = 1/2 and from Theorem 2.1 we have with probability at least 1 −1/m, zA↵( ˜B)  2 1 −✏· zAR( ˜B) where ✏= 2 p log m/n. Therefore, for sufficiently large values of n and m affine policy gives a 2-approximation to the adjustable problem in this case. Note that the approximation bound of 2 is a conservative bound and the empirical performance is significantly better. We demonstrate this in our numerical experiments. Example 2. [Bernoulli distribution] Suppose for all i 2 [m] and j 2 [n], ˜Bij are i.i.d. according to a Bernoulli distribution of parameter p. Then µ = p, b = 1 and from Theorem 2.1 we have with probability at least 1 −1 m, zA↵( ˜B)  1 p(1 −✏) · zAR( ˜B) where ✏= 1 p q log m n . Therefore for constant p, affine policy gives a constant approximation to the adjustable problem (for example 2-approximation for p = 1/2). Note that these performance bounds are in stark contrast with the worst case performance bound O(pm) for affine policies which is tight. For these random instances, the performance is significantly better. We would like to note that the above distributions are very commonly used to generate instances for testing the performance of affine policies and exhibit good empirical performance. 4 Here, we give a theoretical justification of the good empirical performance of affine policies on such instances, thereby closing the gap between worst case bound of O(pm) and observed empirical performance. We discuss the intuition and the proof of Theorem 2.1 in the following subsections. 2.1.1 Preliminaries In order to prove Theorem 2.1, we need to introduce certain preliminary results. We first introduce the following formulation for the adjustable problem (1) based on ideas in Bertsimas and de Ruiter [7]. zd−AR(B) = min x cT x + max w2W min λ(w) −(Ax)T w + rT λ(w) RT λ(w) ≥w 8w 2 W x 2 Rn +, λ(w) 2 RL +, 8w 2 W (4) where the set W is defined as W = {w 2 Rm + | BT w d}. (5) We show that the above problem is an equivalent formulation of (1). Lemma 2.2. Let zAR(B) be as defined in (1) and zd−AR(B) as defined in (4). Then, zAR(B) = zd−AR(B). The proof follows from [7]. For completeness, we present it in Appendix A. Reformulation (4) can be interpreted as a new two-stage adjustable problem over dualized uncertainty set W and decision λ(w). Following [7], we refer to (4) as the dualized formulation and to (1) as the primal formulation. Bertsimas and de Ruiter [7] show that even the affine approximations of (1) and (4) (where recourse decisions are restricted to be affine functions of respective uncertainties) are equivalent. In particular, we have the following Lemma which is a restatement of Theorem 2 in [7]. Lemma 2.3. (Theorem 2 in Bertsimas and de Ruiter [7]) Let zd−A↵(B) be the objective value when λ(w) is restricted to be affine function of w and zA↵(B) as defined in (2). Then zd−A↵(B) = zA↵(B). Bertsimas and Goyal [8] show that affine policy is optimal for the adjustable problem (1) when the uncertainty set U is a simplex. In fact, optimality of affine policies for simplex uncertainty sets holds for more general formulation than considered in [8]. In particular, we have the following lemma Lemma 2.4. Suppose the set W is a simplex, i.e. a convex combination of m+1 affinely independent points, then affine policy is optimal for the adjustable problem (4), i.e. zd−A↵(B) = zd−AR(B). The proof proceeds along similar lines as in [8]. For completeness, we provide it in Appendix A. In fact, if the uncertainty set is not simplex but can be approximated by a simplex within a small scaling factor, affine policies can still be shown to be a good approximation, in particular we have the following lemma. Lemma 2.5. Denote W the dualized uncertainty set as defined in (5) and suppose there exists a simplex S and ≥1 such that S ✓W ✓·S. Therefore, zd−AR(B) zd−A↵(B) ·zd−AR(B). Furthermore, zAR(B) zA↵(B) · zAR(B). The proof of Lemma 2.5 is presented in Appendix A. 2.1.2 Proof of Theorem 2.1 We consider instances of problem (1) where ˜Bij are i.i.d. according to a bounded distribution with support in [0, b] and E[ ˜Bij] = µ for all i 2 [m], j 2 [n]. Denote the dualized uncertainty set ˜ W = {w 2 Rm + | ˜ B T w ¯d · e}. Our performance bound is based on showing that ˜ W can be sandwiched between two simplicies with a small scaling factor. In particular, consider the following simplex, S = ( w 2 Rm + $$$$$ m X i=1 wi  ¯d b ) . (6) we will show that S ✓˜ W ✓ b µ(1−✏) · S with probability at least 1 −1 m where ✏= b µ q log m n . 5 First, we show that S ✓˜ W. Consider any w 2 S. For any any i = 1, . . . , n m X j=1 ˜Bjiwj b m X j=1 wj ¯d The first inequality holds because all components of ˜ B are upper bounded by b and the second one follows from w 2 S. Hence, we have ˜ B T w ¯de and consequently S ✓˜ W. Now, we show that the other inclusion holds with high probability. Consider any w 2 ˜ W. We have ˜ B T w ¯d · e. Summing up all the inequalities and dividing by n, we get m X j=1 Pn i=1 ˜Bji n ! · wj ¯d. (7) Using Hoeffding’s inequality [18] (see Appendix B) with ⌧= b q log m n , we have P Pn i=1 ˜Bji n −µ ≥−⌧ ! ≥1 −exp ✓−2n⌧2 b2 ◆ = 1 −1 m2 and a union bound over j = 1, . . . , m gives us P Pn i=1 ˜Bji n ≥µ −⌧8j = 1, . . . , m ! ≥ ✓ 1 −1 m2 ◆m ≥1 −1 m. where the last inequality follows from Bernoulli’s inequality. Therefore, with probability at least 1 −1 m, we have m X j=1 wj  m X j=1 1 µ −⌧ Pn i=1 ˜Bji n ! · wj  ¯d (µ −⌧) = b µ(1 −✏) · ¯d b where the second inequality follows from (7). Note that for m sufficiently large , we have µ −⌧> 0. Then, w 2 b µ(1−✏) · S for any w 2 ˜ W and consequently S ✓˜ W ✓ b µ(1−✏) · S with probability at least 1 −1/m. Finally, we apply the result of Lemma 2.5 to conclude. ⇤ 2.2 Unbounded distributions While the approximation bound in Theorem 2.1 leads to a good approximation for many distributions, the ratio b/µ can be significantly large in general. We can tighten the analysis by using the concentration properties of distributions and can extend the analysis even for the case of distributions with unbounded support and sub-gaussian tails. In this section, we consider the special case where ˜Bij are i.i.d. according to absolute value of a standard Gaussian, also called the folded normal distribution, and show a logarithmic approximation bound for affine policies. In particular, we have the following theorem. Theorem 2.6. Consider the two-stage adjustable problem (1) where 8i 2 [n], j 2 [m], ˜Bij = | ˜Gij| and ˜Gij are i.i.d. according to a standard Gaussian distribution. For n and m sufficiently large, we have with probability at least 1 −1 m, zA↵( ˜B) · zAR( ˜B) where = O ,plog m + log n . The proof of Theorem 2.6 is presented in Appendix C. We can extend the analysis and show a similar bound for the class of distributions with sub-gaussian tails. The bound of O ,plog m + log n depends on the dimension of the problem unlike the case of uniform bounded distribution. But, it is significantly better than the worst-case of O(pm) [8] for general instances. Furthermore, this bound holds for all uncertainty sets with high probability. We would like to note though that the bounds are not necessarily tight. In fact, in our numerical experiments where the uncertainty set is a budget of uncertainty, we observe that affine policies are near optimal. 6 3 Family of worst-case distribution: perturbation of i.i.d. coefficients For any m sufficiently large, the authors in [8] present an instance where affine policy is ⌦(m 1 2 −δ) away from the optimal adjustable solution. The parameters of the instance in [8] were carefully chosen to achieve the gap ⌦(m 1 2 −δ). In this section, we show that the family of worst-case instances is not measure zero set. In fact, we exhibit a distribution and an uncertainty set such that a random instance from that distribution achieves a worst-case bound of ⌦(pm) with high probability. The coefficients ˜Bij in our bad family of instances are independent but not identically distributed. The instance can be given as follows. n = m, A = 0, c = 0, d = e U = conv (0, e1, . . . , em, ⌫1, . . . , ⌫m) where ⌫i = 1 pm(e −ei) 8i 2 [m]. ˜Bij = ⇢1 if i = j 1 pm · ˜uij if i 6= j where for all i 6= j, ˜uij are i.i.d. uniform[0, 1]. (8) Theorem 3.1. For the instance defined in (8), we have with probability at least 1 −1/m, zA↵( ˜B) = ⌦(pm) · zAR( ˜B). We present the proof of Theorem 3.1 in Appendix D. As a byproduct, we also tighten the lower bound on the performance of affine policy to ⌦(pm) improving from the lower bound of ⌦(m 1 2 −δ) in [8]. We would like to note that both uncertainty set and distribution of coefficients in our instance (8) are carefully chosen to achieve the worst-case gap. Our analysis suggests that to obtain bad instances for affine policies, we need to generate instances using a structured distribution as above and it may not be easy to obtain bad instances in a completely random setting. 4 Performance of affine policy: Empirical study In this section, we present a computational study to test the empirical performance of affine policy for the two-stage adjustable problem (1) on random instances. Experimental setup. We consider two classes of distributions for generating random instances: i) Coefficients of ˜B are i.i.d. uniform [0, 1], and ii) Coefficients of ˜B are absolute value of i.i.d. standard Gaussian. We consider the following budget of uncertainty set. U = ( h 2 [0, 1]m $$$$ m X i=1 hi pm ) . (9) Note that the set (9) is widely used in both theory and practice and arises naturally as a consequence of concentration of sum of independent uncertain demand requirements. We would like to also note that the adjustable problem over this budget of uncertainty, U is hard to approximate within a factor better than O(log n) [16]. We consider n = m, d = e. Also, we consider c = 0, A = 0. We restrict to this case in order to compute the optimal adjustable solution in a reasonable time by solving a single Mixed Integer Program (MIP). For the general problem, computing the optimal adjustable solution requires solving a sequence of MIPs each one of which is significantly challenging to solve. We would like to note though that our analysis does not depend on the first stage cost c and matrix A and affine policy can be computed efficiently even without this assumption. We consider values of m from 10 to 50 and consider 20 instances for each value of m. We report the ratio r = zA↵( ˜B)/zAR( ˜B) in Table 1. In particular, for each value of m, we report the average ratio ravg, the maximum ratio rmax, the running time of adjustable policy TAR(s) and the running time of affine policy TA↵(s). We first give a compact LP formulation for the affine problem (2) and a compact MIP formulation for the separation of the adjustable problem(1). LP formulations for the affine policies. The affine problem (2) can be reformulated as follows zA↵(B) = min 8 > < > : cT x + z $$$$$$$ z ≥dT (P h + q) 8h 2 U Ax + B (P h + q) ≥h 8h 2 U P h + q ≥0 8h 2 U x 2 Rn + 9 > = > ; . 7 Note that this formulation has infinitely many constraints but we can write a compact LP formulation using standard techniques from duality. For example, the first constraint is equivalent to z −dT q ≥ max {dT P h | Rh r, h ≥0}. By taking the dual of the maximization problem, the constraint becomes z −dT q ≥min {rT v | RT v ≥P T d, v ≥0}. We can then drop the min and introduce v as a variable, hence we obtain the following linear constraints z −dT q ≥rT v , RT v ≥P T d and v ≥0. We can apply the same techniques for the other constraints. The complete LP formulation and its proof of correctness is presented in Appendix E. Mixed Integer Program Formulation for the adjustable problem (1). For the adjustable problem (1), we show that the separation problem (10) can be formulated as a mixed integer program. The separation problem can be formulated as follows: Given ˆx and ˆz decide whether max {(h −Aˆx)T w | w 2 W, h 2 U} > ˆz (10) The correctness of formulation (10) follows from equation (11) in the proof of Lemma 2.2 in Appendix A. The constraints in (10) are linear but the objective function contains a bilinear term, hT w. We linearize this using a standard digitized reformulation. In particular, we consider finite bit representations of continuous variables, hi nd wi to desired accuracy and introduce additional binary variables, ↵ik, βik where ↵ik and βik represents the kth bits of hi and wi respectively. Now, for any i 2 [m], hi · wi can be expressed as a bilinear expression with products of binary variables, ↵ik · βij which can be linearized using additional variable γijk and standard linear inequalities: γijk βij, γijk ↵ik, γijk + 1 ≥↵ik + βij. The complete MIP formulation and the proof of correctness is presented in Appendix E. For general A 6= 0, we need to solve a sequence of MIPs to find the optimal adjustable solution. In order to compute the optimal adjustable solution in a reasonable time, we assume A = 0, c = 0 in our experimental setting so that we only need to solve one MIP. Results. In our experiments, we observe that the empirical performance of affine policy is nearoptimal. In particular, the performance is significantly better than the theoretical performance bounds implied in Theorem 2.1 and Theorem 2.6. For instance, Theorem 2.1 implies that affine policy is a 2-approximation with high probability for random instances from a uniform distribution. However, in our experiments, we observe that the optimality gap for affine policies is at most 4% (i.e. approximation ratio of at most 1.04). The same observation holds for Gaussian distributions as well Theorem 2.6 gives an approximation bound of O( p log(mn)). We would like to remark that we are not able to report the ratio r for large values of m because the adjustable problem is computationally very challenging and for m ≥40, MIP does not solve within a time limit of 3 hours for most instances . On the other hand, affine policy scales very well and the average running time is few seconds even for large values of m. This demonstrates the power of affine policies that can be computed efficiently and give good approximations for a large class of instances. m ravg rmax TAR(s) TA↵(s) 10 1.01 1.03 10.55 0.01 20 1.02 1.04 110.57 0.23 30 1.01 1.02 761.21 1.29 50 ** ** ** 14.92 (a) Uniform m ravg rmax TAR(s) TA↵(s) 10 1.00 1.03 12.95 0.01 20 1.01 1.03 217.08 0.39 30 1.01 1.03 594.15 1.15 50 ** ** ** 13.87 (b) Folded Normal Table 1: Comparison on the performance and computation time of affine policy and optimal adjustable policy for uniform and folded normal distributions. For 20 instances, we compute zA↵( ˜B)/zAR( ˜B) and present the average and max ratios. Here, TAR(s) denotes the running time for the adjustable policy and TA↵(s) denotes the running time for affine policy in seconds. ** Denotes the cases when we set a time limit of 3 hours. These results are obtained using Gurobi 7.0.2 on a 16-core server with 2.93GHz processor and 56GB RAM. 8 References [1] A. Ben-Tal, L. El Ghaoui, and A. Nemirovski. Robust optimization. Princeton University press, 2009. [2] A. Ben-Tal, A. Goryashko, E. Guslitzer, and A. Nemirovski. Adjustable robust solutions of uncertain linear programs. Mathematical Programming, 99(2):351–376, 2004. [3] A. Ben-Tal and A. Nemirovski. Robust convex optimization. Mathematics of Operations Research, 23(4):769–805, 1998. [4] A. Ben-Tal and A. Nemirovski. Robust solutions of uncertain linear programs. Operations Research Letters, 25(1):1–14, 1999. [5] A. Ben-Tal and A. Nemirovski. Robust optimization–methodology and applications. Mathematical Programming, 92(3):453–480, 2002. [6] D. Bertsimas, D. Brown, and C. Caramanis. Theory and applications of robust optimization. SIAM review, 53(3):464–501, 2011. [7] D. Bertsimas and F. J. de Ruiter. Duality in two-stage adaptive linear optimization: Faster computation and stronger bounds. INFORMS Journal on Computing, 28(3):500–511, 2016. [8] D. Bertsimas and V. Goyal. On the Power and Limitations of Affine Policies in Two-Stage Adaptive Optimization. Mathematical Programming, 134(2):491–531, 2012. [9] D. Bertsimas, V. Goyal, and X. Sun. A geometric characterization of the power of finite adaptability in multistage stochastic and adaptive optimization. Mathematics of Operations Research, 36(1):24–54, 2011. [10] D. Bertsimas and M. Sim. Robust Discrete Optimization and Network Flows. Mathematical Programming Series B, 98:49–71, 2003. [11] D. Bertsimas and M. Sim. The Price of Robustness. Operations Research, 52(2):35–53, 2004. [12] F. Chung and L. Lu. Concentration inequalities and martingale inequalities: a survey. Internet Mathematics, 3(1):79–127, 2006. [13] G. Dantzig. Linear programming under uncertainty. Management Science, 1:197–206, 1955. [14] L. El Ghaoui and H. Lebret. Robust solutions to least-squares problems with uncertain data. SIAM Journal on Matrix Analysis and Applications, 18:1035–1064, 1997. [15] O. El Housni and V. Goyal. Piecewise static policies for two-stage adjustable robust linear optimization. Mathematical Programming, pages 1–17, 2017. [16] U. Feige, K. Jain, M. Mahdian, and V. Mirrokni. Robust combinatorial optimization with exponential scenarios. Lecture Notes in Computer Science, 4513:439–453, 2007. [17] D. Goldfarb and G. Iyengar. Robust portfolio selection problems. Mathematics of Operations Research, 28(1):1–38, 2003. [18] W. Hoeffding. Probability inequalities for sums of bounded random variables. Journal of the American statistical association, 58(301):13–30, 1963. [19] P. Kall and S. Wallace. Stochastic programming. Wiley New York, 1994. [20] A. Prékopa. Stochastic programming. Kluwer Academic Publishers, Dordrecht, Boston, 1995. [21] A. Shapiro. Stochastic programming approach to optimization under uncertainty. Mathematical Programming, Series B, 112(1):183–220, 2008. [22] A. Shapiro, D. Dentcheva, and A. Ruszczy´nski. Lectures on stochastic programming: modeling and theory. Society for Industrial and Applied Mathematics, 2009. [23] A. Soyster. Convex programming with set-inclusive constraints and applications to inexact linear programming. Operations research, 21(5):1154–1157, 1973. 9
2017
8
7,220
Elementary Symmetric Polynomials for Optimal Experimental Design Zelda Mariet Massachusetts Institute of Technology Cambridge, MA 02139 zelda@csail.mit.edu Suvrit Sra Massachusetts Institute of Technology Cambridge, MA 02139 suvrit@mit.edu Abstract We revisit the classical problem of optimal experimental design (OED) under a new mathematical model grounded in a geometric motivation. Specifically, we introduce models based on elementary symmetric polynomials; these polynomials capture “partial volumes” and offer a graded interpolation between the widely used A-optimal design and D-optimal design models, obtaining each of them as special cases. We analyze properties of our models, and derive both greedy and convex-relaxation algorithms for computing the associated designs. Our analysis establishes approximation guarantees on these algorithms, while our empirical results substantiate our claims and demonstrate a curious phenomenon concerning our greedy method. Finally, as a byproduct, we obtain new results on the theory of elementary symmetric polynomials that may be of independent interest. 1 Introduction Optimal Experimental Design (OED) develops the theory of selecting experiments to perform in order to estimate a hidden parameter as well as possible. It operates under the assumption that experiments are costly and cannot be run as many times as necessary or run even once without tremendous difficulty [33]. OED has been applied in a large number of experimental settings [35, 9, 28, 46, 36], and has close ties to related machine-learning problems such as outlier detection [15, 22], active learning [19, 18], Gaussian process driven sensor placement [27], among others. We revisit the classical setting where each experiment depends linearly on a hidden parameter θ ∈ Rm. We assume there are n possible experiments whose outcomes yi ∈R can be written as yi = x⊤ i θ + ϵi 1 ≤i ≤n, where the xi ∈Rm and ϵi are independent, zero mean, and homoscedastic noises. OED seeks to answer the question: how to choose a set S of k experiments that allow us to estimate θ without bias and with minimal variance? Given a feasible set S of experiments (i.e., ∑ i∈S xix⊤ i is invertible), the Gauss-Markov theorem shows that the lowest variance for an unbiased estimate ˆθ satisfies Var[ˆθ] = (∑ i∈S xix⊤ i )−1. However, Var[ˆθ] is a matrix, and matrices do not admit a total order, making it difficult to compare different designs. Hence, OED is cast as an optimization problem that seeks an optimal design S∗ S∗∈ argmin S∈[n],|S|≤k Φ ((∑ i∈S xix⊤ i )−1) , (1.1) where Φ maps positive definite matrices to R to compare the variances for each design, and may help elicit different properties that a solution should satisfy, either statistical or structural. Elfving [16] derived some of the earliest theoretical results for the linear dependency setting, focusing on the case where one is interested in reconstructing a predefined linear combination of the 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. underlying parameters c⊤θ (C-optimal design). Kiefer [26] introduced a more general approach to OED, by considering matrix means on positive definite matrices as a general way of evaluating optimality [33, Ch. 6], and Yu [48] derived general conditions for a map Φ under which a class of multiplicative algorithms for optimal design has guaranteed monotonic convergence. Nonetheless, the theory of OED branches into multiple variants of (1.1) depending on the choice of Φ, among which A-optimal design (Φ = trace) and D-optimal design (Φ = determinant) are probably the two most popular choices. Each of these choices has a wide range of applications as well as statistical, algorithmic, and other theoretical results. We refer the reader to the classic book [33], which provides an excellent overview and introduction to the topic; see also the summaries in [1, 35]. For A-optimal design, recently Wang et al. [44] derived greedy and convex-relaxation approaches; [11] considers the problem of constrained adaptive sensing, where θ is supposed sparse. D-optimal design has historically been more popular, with several approaches to solving the related optimization problem [17, 38, 31, 20]. The dual problem of D-optimality, Minimum Volume Covering Ellipsoid (MVCE) is also a well-known and deeply studied optimization problem [3, 34, 43, 41, 14, 42]. Experimental design has also been studied in more complex settings: [8] considers Bayesian optimal design; under certain conditions, non-linear settings can be approached with linear OED [13, 25]. Due to the popularity of A- and D-optimal design, the theory surrounding these two sub-problems has diverged significantly. However, both the trace and the determinant are special cases of fundamental spectral polynomials of matrices: elementary symmetric polynomials (ESP), which have been extensively studied in matrix theory, combinatorics, information theory, and other areas due to their importance in the theory of polynomials [24, 30, 21, 6, 23, 4]. These considerations motivate us to derive a broader view of optimal design which we call ESPDesign, where Φ is obtained from an elementary symmetric polynomial. This allows us to consider A-optimal design and D-optimal design as special cases of ESP-design, and thus treat the entire ESP-class in a unified manner. Let us state the key contributions of this paper more precisely below. Contributions • We introduce ESP-design, a new, general framework for OED that leverages geometric properties of positive definite matrices to interpolate between A- and D-optimality. ESP-design offers an intuitive setting in which to gradually scale between A-optimal and D-optimal design. • We develop a convex relaxation as well as greedy algorithms to compute the associated designs. As a byproduct of our convex relaxation, we prove that ESPs are geodesically log-convex on the Riemannian manifold of positive definite matrices; this result may be of independent interest. • We extend a result of Avron and Boutsidis [2] on determinantal column-subset selection to ESPs; as a consequence we obtain a greedy algorithm with provable optimality bounds for ESP-design. Experiments on synthetic and real data illustrate the performance of our algorithms and confirm that ESP-design can be used to obtain designs with properties that scale between those of both A- and D-optimal designs, allowing users to tune trade-offs between their different benefits (e.g. predictive error, sparsity, etc.). We show that our greedy algorithm generates designs of equal quality to the famous Fedorov exchange algorithm [17], while running in a fraction of the time. 2 Preliminaries We begin with some background material that also serves to set our notation. We omit proofs for brevity, as they can be found in standard sources such as [6]. We define [n] ≜{1, 2, . . . , n}. For S ⊆[n] and M ∈Rn×m, we write MS the |S| × m matrix created by keeping only the rows of M indexed by S, and M[S|S′] the submatrix with rows indexed by S and columns indexed by S′; by x(i) we denote the vector x with its i-th component removed. For a vector v ∈Rm, the elementary symmetric polynomial (ESP) of order ℓ∈N is defined by eℓ(v) ≜ ∑ 1≤i1<...<iℓ≤m ∏ℓ j=1 vij = ∑ I⊆[m],|I|=ℓ ∏ j∈I vj, (2.1) where eℓ≡0 for ℓ= 0 and ℓ> m. Let S+ m (S++ m ) be the cone of positive semidefinite (positive definite) matrices of order m. We denote by λ(M) the eigenvalues (in decreasing order) of a symmetric matrix M. Def. (2.1) extends to matrices naturally; ESPs are spectral functions, as we set 2 Eℓ(M) ≜eℓ◦λ(M); additionally, they enjoy another representation that allows us to interpret them as “partial volumes”, namely, Eℓ(M) = ∑ S⊆[n],|S|=ℓdet(M[S|S]). (2.2) The following proposition captures basic properties of ESPs that we will require in our analysis. Proposition 2.1. Let M ∈Rm×m be symmetric and 1 ≤ℓ≤m; also let A, B ∈S+ m. We have the following properties: (i) If A ⪰B in Löwner order, then Eℓ(A) ≥Eℓ(B); (ii) If M is invertible, then Eℓ(M −1) = det(M −1)Em−ℓ(M); (iii) ∇eℓ(λ) = [eℓ−1(λ(i))]1≤i≤m. 3 ESP-design A-optimal design uses Φ ≡tr in (1.1), and thus selects designs with low average variance. Geometrically, this translates into selecting confidence ellipsoids whose bounding boxes have a small diameter. Conversely, D-optimal design uses Φ ≡det in (1.1), and selects vectors that correspond to the ellipsoid with the smallest volume; as a result it is more sensitive to outliers in the data1. We introduce a natural model that scales between A- and D-optimal design. Indeed, by recalling that both the trace and the determinant are special cases of ESPs, we obtain a new model as fundamental as A- and D-optimal design, while being able to interpolate between the two in a graded manner. Unless otherwise indicated, we consider that we are selecting experiments without repetition. 3.1 Problem formulation Let X ∈Rn×m (m ≪n) be a design matrix with full column rank, and k ∈N be the budget (m ≤k ≤n). Define Γk = {S ⊆[n] s.t. |S| ≤k, X⊤ S XS ≻0} to be the set of feasible designs that allow unbiased θ estimates. For ℓ∈{1, . . . , m}, we introduce the ESP-design model: min S∈Γk fℓ(S) ≜1 ℓlog Eℓ ( (X⊤ S XS)−1) . (3.1) We keep the 1/ℓ-factor in (3.1) to highlight the homogeneity (Eℓis a polynomial of degree ℓ) of our design criterion, as is advocated in [33, Ch. 6]. For ℓ= 1, (3.1) yields A-optimal design, while for ℓ= m, it yields D-optimal design. For 1 < ℓ< m, ESP-design interpolates between these two extremes. Geometrically, we may view it as seeking an ellipsoid with the smallest average volume for ℓ-dimensional slices (taken across sets of size ℓ). Alternatively, ESP-design can be also be interpreted as a regularized version of D-optimal design via Prop. 2.1-(ii). In particular, for ℓ= m −1, we recover a form of regularized D-optimal design: fm−1(S) = 1 m−1 [ log det ( (X⊤ S XS)−1) + log ∥XS∥2 2 ] . (3.1) is a known hard combinatorial optimization problem (in particular for ℓ= m), which precludes an exact optimal solution. However, its objective enjoys remarkable properties that help us derive efficient algorithms for its approximate solution. The first one of these is based on a natural convex relaxation obtained below. 3.2 Continuous relaxation We describe below a traditional approach of relaxing (3.1) by relaxing the constraint on S, allowing elements in the set to have fractional multiplicities. The new optimization problem takes the form min z∈Γc k 1 ℓlog Eℓ ( (X⊤Diag(z)X)−1) , (3.2) where we Γc k denotes the set of vectors {z ∈Rn | 0 ≤zi ≤1} such that X⊤Diag(z)X remains invertible and 1⊤z ≤k. The following is a direct consequence of Prop 2.1-(i): Proposition 3.1. Let z∗be the optimal solution to (3.2). Then ∥z∗∥1 = k. Convexity of fℓon Γc k (where by abuse of notation, fℓalso denotes the continuous relaxation in (3.2)) can be obtained as a consequence of [32]; however, we obtain it as a corollary Lemma 3.3, which shows that log Eℓis geodesically convex; this result seems to be new, and is stronger than convexity of fℓ; hence it may be of independent interest. 1For a more in depth discussion of the geometric interpretation of various optimal designs, refer to e.g. [7, Section 7.5]. 3 Definition 3.2 (geodesic-convexity). A function f : S++ m →R defined on the Riemannian manifold S++ m is called geodesically convex if it satisfies f(P#tQ) ≤(1 −t)f(P) + tf(Q), t ∈[0, 1], and P, Q ≻0. where we use the traditional notation P#tQ := P 1/2(P −1/2QP −1/2)tP 1/2 to denote the geodesic between P and Q ∈S++ m under the Riemannian metric gP (X, Y ) = tr(P −1XP −1Y ). Lemma 3.3. The function Eℓis geodesically log-convex on the set of positive definite matrices. Corollary 3.4. The map M 7→E1/ℓ ℓ ((X⊤MX)−1) is log-convex on the set of PD matrices. For further details on the theory of geodesically convex functions on S+ m and their optimization, we refer the reader to [40]. We prove Lemma 3.3 and Corollary 3.4 in Appendix A. From Corollary 3.4, we immediately obtain that (3.2) is a convex optimization problem, and can therefore be solved using a variety of efficient algorithms. Projected gradient descent turns out to be particularly easy to apply because we only require projection onto the intersection of the cube 0 ≤z ≤1 and the plane {z | z⊤1 = k} (as a consequence of Prop 3.1). Projection onto this intersection is a special case of the so-called continuous quadratic knapsack problem, which is a very well-studied problem and can be solved essentially in linear time [10, 12]. Remark 3.5. The convex relaxation remains log-convex when points can be chosen with multiplicity, in which case the projection step is also significantly simpler, requiring only z ≥0. We conclude the analysis of the continuous relaxation by showing a bound on the support of its solution under some mild assumptions: Theorem 3.6. Let ϕ be the mapping from Rm to Rm(m+1)/2 such that ϕ(x) = (ξijxixj))1≤i,j≤m with ξij = 1 if i = j and 2 otherwise. Let ˜ϕ(x) = (ϕ(x), 1) be the affine version of ϕ. If for any set of m(m + 1)/2 distinct rows of X, the mapping under ˜ϕ is independent, then the support of the optimum z∗of (3.2) satisfies ∥z∗∥0 ≤k + m(m+1) 2 . The proof is identical to that of [44, Lemma 3.5], which shows such a result for A-optimal design; we relegate it to Appendix B. 4 Algorithms and analysis Solving the convex relaxation (3.2) does not directly provide a solution to (3.1); first, we must round the relaxed solution z∗∈Γc k to a discrete solution S ∈Γk. We present two possibilities: (i) rounding the solution of the continuous relaxation (§4.1); and (ii) a greedy approach (§4.2). 4.1 Sampling from the continuous relaxation For conciseness, we concentrate on sampling without replacement, but note that these results extend with minor changes to with replacement sampling (see [44]). Wang et al. [44] discuss the sampling scheme described in Alg. 1) for A-optimal design; the same idea easily extends to ESP-design. In particular, Alg. 1, applied to a solution of (3.2), provides the same asymptotic guarantees as those proven in [44, Lemma 3.2] for A-optimal design. Algorithm 1: Sample from z∗ Data: budget k, z∗∈Rn Result: S of size k S ←∅ while |S| < k do Sample i ∈[n] \ S uniformly at random Sample x ∼Bernoulli(z∗ i ) if x = 1 then S ←S ∪{i} return S Theorem 4.1. Let Σ∗= X⊤Diag(z∗)X. Suppose ∥Σ−1 ∗∥2κ(Σ∗)∥X∥2 ∞log m = O(1). The subset S constructed by sampling as above verifies with probability p = 0.8 Eℓ ( ( X⊤ S XS )−1 )1/ℓ ≤O(1) · Eℓ ( ( X⊤ S∗XS∗)−1 )1/ℓ . 4 Theorem 4.1 shows that under reasonable conditions, we can probabilistically construct a good approximation to the optimal solution in linear time, given the solution z∗to the convex relaxation. 4.2 Greedy approach In addition to the solution based on convex relaxation, ESP-design admits an intuitive greedy approach, despite not being a submodular optimization problem in general. Here, elements are removed one-by-one from a base set of experiments; this greedy removal, as opposed to greedy addition, turns out to be much more practical. Indeed, since fℓis not defined for sets of size smaller than k, it is hard to greedily add experiments to the empty set and then bound the objective function after k items have been added. This difficulty precludes analyses such as [45, 39] for optimizing non-submodular set functions by bounding their “curvature”. Algorithm 2: Greedy algorithm Data: matrix X, budget k, initial set S0 Result: S of size k S ←S0 while |S| > k do Find i ∈S such that S \ {i} is feasible and i minimizes fℓ(S \ {i}) S ←S \ {i} return S Bounding the performance of Algorithm 2 relies on the following lemma. Lemma 4.2. Let X ∈Rn×m(n ≥m) be a matrix with full column rank, and let k be a budget m ≤k ≤n. Let S of size k be subset of [n] drawn with probability P ∝det(X⊤ S XS). Then ES∼P [ Eℓ ( ( X⊤ S XS )−1 )] ≤ ∏ℓ i=1 n −m + i k −m + i · Eℓ ( ( X⊤X )−1 ) , (4.1) with equality if X⊤ S XS ≻0 for all subsets S of size k. Lemma 4.2 extends a result from [2, Lemma 3.9] on column-subset selection via volume sampling to all ESPs. In particular, it follows that removing one element (by volume sampling a set of size n −1) will in expectation decrease f by a multiplicative factor which is clearly also attained by a greedy minimization. This argument then entails the following bound on Algorithm 2’s performance. Proofs of both results are in Appendix C. Theorem 4.3. Algorithm 2 initialized with a set S0 of size n0 produces a set S+ of size k such that Eℓ ( ( X⊤ S+XS+)−1 ) ≤ ∏ℓ j=1 n0 −m + j k −m + j · Eℓ ( ( X⊤ S0XS0 )−1 ) (4.2) As Wang et al. [44] note regarding A-optimal design, (4.2) provides a trivial optimality bound on the greedy algorithm when initialized with S0 = {1, . . . , n} (S∗denotes the optimal set): Eℓ ( ( X⊤ S+XS+)−1 )1/ℓ ≤n −m + ℓ k −m + 1f({1, . . . , n}) ≤n −m + ℓ k −m + 1Eℓ ( ( X⊤ S∗XS∗)−1 )1/ℓ (4.3) However, this naive initialization can be replaced by the support ∥z∗∥0 of the convex relaxation solution; in the common scenario described by Theorem 3.6, we then obtain the following result: Theorem 4.4. Let ˜ϕ be the mapping defined in 3.6, and assume that all choices of m(m + 1)/2 distinct rows of X always have their mapping independent mappings for ˜ϕ. Then the outcome of the greedy algorithm initialized with the support of the solution to the continuous relaxation verifies fℓ(S+) ≤log (k + m(m −1)/2 + ℓ k −m + 1 ) + fℓ(S∗). 4.3 Computational considerations Computing the ℓ-th elementary symmetric polynomial on a vector of size m can be done in O(m log2 ℓ) using Fast Fourier Transform for polynomial multiplication, due to the construction introduced by Ben-Or (see [37]); hence, computing fℓ(S) requires O(nm2) time, where the cost is dominated by computing X⊤ S XS. Alg. 1 runs in expectation in O(n); Alg. 2 costs O(m2n3). 5 5 Further Implications We close our theoretical presentation by discussing a potentially important geometric problem related to ESP-design. In particular, our motivation here is the dual problem of D-optimal design (i.e., dual to the convex relaxation of D-optimal design): this is nothing but the well-known Minimum Volume Covering Ellipsoid (MVCE) problem, which is a problem of great interest to the optimization community in its own right—see the recent book [42] for an excellent account. With this motivation, we develop the dual formulation for ESP-design now. We start by deriving ∇Eℓ(A), for which we recall that Eℓ(·) is a spectral function, whereby the spectral calculus of Lewis [29] becomes applicable, saving us from intractable multilinear algebra [23]. More precisely, say U ⊤ΛU is the eigendecomposition of A, with U unitary. Then, as Eℓ(A) = eℓ◦λ(A), ∇Eℓ(A) = U ⊤Diag(∇eℓ(Λ))U = U ⊤Diag(eℓ−1(Λ−(i)))U. (5.1) We can now derive the dual of ESP-design (we consider only z ≥0); in this case problem (3.2) is sup A≻0,z≥0 inf µ∈R,H −1 ℓlog Eℓ(A) −tr(H(A−1 −X⊤Diag(z)X)) −µ(1⊤z −k), which admits as dual inf µ∈R,H sup A≻0,z≥0 −1 ℓlog Eℓ(A) −tr(HA−1) | {z } g(A) + tr(HX⊤Diag(z)X) −µ(1⊤z −k). (5.2) We easily show that H ⪰0 and that g reaches its maximum on S++ m for A such that ∇g = 0. Rewriting A = U ⊤ΛU, we have ∇g(A) = 0 ⇐⇒Λ Diag ( eℓ−1(Λ(i)) ) Λ = eℓ(Λ)UHU ⊤. In particular, H and A are co-diagonalizable, with Λ Diag(eℓ−1(Λ(i)))Λ = Diag(h1, . . . , hm). The eigenvalues of A must thus satisfy the system of equations λ2 i eℓ−1(λ1, . . . , λi−1, λi+1, . . . , λm) = hieℓ(λ1, . . . , λm), 1 ≤i ≤m. Let a(H) be such a matrix (notice, a(H) = ∇g∗(0)). Since fℓis convex, g(a(H)) = f ⋆ ℓ(−H) where f ⋆ ℓis the Fenchel conjugate of fℓ. Finally, the dual optimization problem is given by sup x⊤ i Hxi≤1,H⪰0 f ⋆ ℓ(−H) = sup x⊤ i Hxi≤1,H⪰0 1 ℓlog Eℓ(a(H)) Details of the calculation are provided in Appendix D. In the general case, deriving a(H) or even Eℓ(a(H)) does not admit a closed form that we know of. Nevertheless, we recover the well-known duals of A-optimal design and D-optimal design as special cases. Corollary 5.1. For ℓ= 1, a(H) = tr(H1/2)H1/2 and for ℓ= m, a(H) = H. Consequently, we recover the dual formulations of A- and D-optimal design. 6 Experimental results We compared the following methods to solving (3.1): – UNIF / UNIFFDV: k experiments are sampled uniformly / with Fedorov exchange – GREEDY / GREEDYFDV: greedy algorithm (relaxed init.) / with Fedorov exchange – SAMPLE: sampling (relaxed init.) as in Algorithm 1. We also report the results for solution of the continuous relaxation (RELAX); the convex optimization was solved using projected gradient descent, the projection being done with the code from [12]. 6.1 Synthetic experiments: optimization comparison We generated the experimental matrix X by sampling n vectors of size m from the multivariate Gaussian distribution of mean 0 and sparse precision Σ−1 (density d ranging from 0.3 to 0.9). Due to the runtime of Fedorov methods, results are reported for only one run; results averaged over multiple iterations (as well as for other distributions over X) are provided in Appendix E. 6 As shown in Fig. 1, the greedy algorithm applied to the convex relaxation’s support outperforms sampling from the convex relaxation solution, and does as well as the usual Fedorov algorithm UNIFFDV; GREEDYFDV marginally improves upon the greedy algorithm and UNIFFDV. Strikingly, GREEDY provides designs of comparable quality to UNIFFDV; furthermore, as very few local exchanges improve upon its design, running the Fedorov algorithm with GREEDY initialization is much faster (Table 1); this is confirmed by Table 2, which shows the number of experiments in common for different algorithms: GREEDY and GREEDYFDV only differ on very few elements. As the budget k increases, the difference in performances between SAMPLE, GREEDY and the continuous relaxation decreases, and the simpler SAMPLE algorithm becomes competitive. Table 3 reports the support of the continuous relaxation solution for ESP-design with ℓ= 10. Table 1: Runtimes (s) (ℓ= 10, d = 0.6) k 40 80 120 160 200 GREEDY 2.8 101 2.7 101 3.1 101 4.0 101 5.2 101 GREEDYFDV 6.6 101 2.2 102 3.2 102 1.2 102 1.3 102 UNIFFDV 1.6 103 4.1 103 6.0 103 6.2 103 4.7 103 Table 2: Common items between solutions (ℓ= 10, d = 0.6) k 40 80 120 160 200 |GREEDY ∩UNIFFDV| 26 76 114 155 200 |GREEDY ∩GREEDYFDV| 40 78 117 160 200 |UNIFFDV ∩GREEDYFDV| 26 75 113 155 200 Table 3: ∥z∗∥0 (ℓ= 10, d = 0.6) k 40 80 120 160 200 d = 0.3 93 ± 3 117 ± 3 148 ± 2 181 ± 3 213 ± 2 d = 0.6 92 ± 7 117 ± 4 145 ± 4 180 ± 3 214 ± 4 d = 0.9 88 ± 3 116 ± 3 147 ± 4 179 ± 3 214 ± 1 6.2 Real data We used the Concrete Compressive Strength dataset [47] (with column normalization) from the UCI repository to evaluate ESP-design on real data; this dataset consists in 1030 possible experiments to model concrete compressive strength as a linear combination of 8 physical parameters. In Figure 2 (a), OED chose k experiments to run to estimate θ, and we report the normalized prediction error on the remaining n −k experiments. The best choice of OED for this problem is of course A-optimal design, which shows the smallest predictive error. In Figure 2 (b), we report the fraction of non-zero entries in the design matrix XS; higher values of ℓcorrespond to increasing sparsity. This confirms that OED allows us to scale between the extremes of A-optimal design and D-optimal design to tune desirable side-effects of the design; for example, sparsity in a design matrix can indicate not needing to tune a potentially expensive experimental parameter, which is instead left at its default value. 7 Conclusion and future work We introduced the family of ESP-design problems, which evaluate the quality of an experimental design using elementary symmetric polynomials, and showed that typical approaches to optimal design such as continuous relaxation and greedy algorithms can be extended to this broad family of problems, which covers A-optimal design and D-optimal design as special cases. We derived new properties of elementary symmetric polynomials: we showed that they are geodesically log-convex on the space of positive definite matrices, enabling fast solutions to solving the relaxed ESP optimization problem. We furthermore showed in Lemma 4.2 that volume sampling, applied to the columns of the design matrix X has a constant multiplicative impact on the objective function Eℓ( ( X⊤ S XS )−1), extending Avron and Boutsidis [2]’s result from the trace to all el7 . GREEDY . GREEDYFDV . SAMPLE . RELAX . UNIF . UNIFFDV . 40 . 80 . 120 . 160 . 200 . 0.0 . 1.0 . 2.0 . ℓ= 1 (A-Opt) . fℓ(S) . 40 . 80 . 120 . 160 . 200 . 0.0 . 1.0 . 2.0 . 40 . 80 . 120 . 160 . 200 . 1.0 . 2.0 . 40 . 80 . 120 . 160 . 200 . -2.0 . -1.0 . 0.0 . ℓ= 10 . fℓ(S) . 40 . 80 . 120 . 160 . 200 . -1.0 . 0.0 . 40 . 80 . 120 . 160 . 200 . -1.0 . 0.0 . 40 . 80 . 120 . 160 . 200 . budget k . -3.0 . -2.0 . ℓ= 20 (D-Opt) . fℓ(S) . d = 0.3 . 40 . 80 . 120 . 160 . 200 . budget k . -3.0 . -2.0 . -1.0 . d = 0.6 . 40 . 80 . 120 . 160 . 200 . budget k . -3.0 . -2.0 . -1.0 . d = 0.9 Figure 1: Synthetic experiments, n = 500, m = 30. The greedy algorithm performs as well as the classical Fedorov approach; as k increases, all designs except UNIF converge towards the continuous relaxation, making SAMPLE the best approach for large designs. . ℓ= 1 (A-opt) . ℓ= 3 . ℓ= 6 . ℓ= 8 (D-opt) . 100 . 120 . 140 . 160 . 180 . 200 . budget k . 2.8 . 3.0 . 3.2 . predictive error . ×10−4 . (a) MSE . 100 . 120 . 140 . 160 . 180 . 200 . budget k . 0.80 . 0.81 . 0.82 . ratio of non zero entries . (b) Sparsity Figure 2: Predicting concrete compressive strength via the greedy method; higher ℓincreases the sparsity of the design matrix XS, at the cost of marginally decreasing predictive performance. ementary symmetric polynomials. This allows us to derive a greedy algorithm with performance guarantees, which empirically performs as well as Fedorov exchange, in a fraction of the runtime. However, our work still includes some open questions: in deriving the Lagrangian dual of the optimization problem, we had to introduce the function a(H) which maps S++ m ; however, although a(H) is known for ℓ= 1, m, its form for other values of ℓis unknown, making the dual form a purely theoretical object in the general case. Whether the closed form of a can be derived, or whether Eℓ(a(H)) can be obtained with only knowledge of H, remains an open problem. Due to the importance of the dual form of D-optimal design as the Minimum Volume Covering Ellipsoid, we believe that further investigation of the general dual form of ESP-design will provide valuable insight, both into optimal design and for the general theory of optimization. 8 ACKNOWLEDGEMENTS Suvrit Sra acknowledges support from NSF grant IIS-1409802 and DARPA Fundamental Limits of Learning grant W911NF-16-1-0551. References [1] A. Atkinson, A. Donev, and R. Tobias. Optimum Experimental Designs, With SAS. Oxford Statistical Science Series. OUP Oxford, 2007. [2] H. Avron and C. Boutsidis. Faster subset selection for matrices and applications. SIAM J. Matrix Analysis Applications, 34(4):1464–1499, 2013. [3] E. R. Barnes. An algorithm for separating patterns by ellipsoids. IBM Journal of Research and Development, 26:759–764, 1982. [4] H. H. Bauschke, O. Güler, A. S. Lewis, and H. S. Sendov. Hyperbolic polynomials and convex analysis. Canad. J. Math., 53(3):470–488, 2001. [5] R. Bhatia. Matrix Analysis. Springer, 1997. [6] R. Bhatia. Positive Definite Matrices. Princeton University Press, 2007. [7] S. Boyd and L. Vandenberghe. Convex Optimization. Cambridge University Press, 2004. [8] K. Chaloner and I. Verdinelli. Bayesian experimental design: A review. Statistical Science, 10:273–304, 1995. [9] D. A. Cohn. Neural network exploration using optimal experiment design. In Neural Networks, pages 679–686. Morgan Kaufmann, 1994. [10] R. Cominetti, W. F. Mascarenhas, and P. J. S. Silva. A newton’s method for the continuous quadratic knapsack problem. Mathematical Programming Computation, 6(2):151–169, 2014. [11] M. A. Davenport, A. K. Massimino, D. Needell, and T. Woolf. Constrained adaptive sensing. IEEE Transactions on Signal Processing, 64(20):5437–5449, 2016. [12] T. A. Davis, W. W. Hager, and J. T. Hungerford. An efficient hybrid algorithm for the separable convex quadratic knapsack problem. ACM Trans. Math. Softw., 42(3):22:1–22:25, 2016. [13] H. Dette, V. B. Melas, and W. K. Wong. Locally d-optimal designs for exponential regression models. Statistica Sinica, 16(3):789–803, 2006. [14] A. N. Dolia, T. De Bie, C. J. Harris, J. Shawe-Taylor, and D. M. Titterington. The minimum volume covering ellipsoid estimation in kernel-defined feature spaces. In European Conference on Machine Learning, pages 630–637, 2006. [15] E. N. Dolia, N. M. White, and C. J. Harris. D-optimality for minimum volume ellipsoid with outliers. In In Proceedings of the Seventh International Conference on Signal/Image Processing and Pattern Recognition, pages 73–76, 2004. [16] G. Elfving. Optimum allocation in linear regression theory. Ann. Math. Statist., 23(2):255–262, 1952. [17] V. Fedorov. Theory of optimal experiments. Probability and mathematical statistics. Academic Press, 1972. [18] Y. Gu and Z. Jin. Neighborhood preserving d-optimal design for active learning and its application to terrain classification. Neural Computing and Applications, 23(7):2085–2092, 2013. [19] X. He. Laplacian regularized d-optimal design for active learning and its application to image retrieval. IEEE Trans. Image Processing, 19(1):254–263, 2010. [20] T. Horel, S. Ioannidis, and S. Muthukrishnan. Budget Feasible Mechanisms for Experimental Design, pages 719–730. Springer Berlin Heidelberg, 2014. [21] R. A. Horn and C. R. Johnson. Matrix Analysis. Cambridge University Press, 1985. [22] D. A. Jackson and Y. Chen. Robust principal component analysis and outlier detection with ecological data. Environmetrics, 15(2):129–139, 2004. [23] T. Jain. Derivatives for antisymmetric tensor powers and perturbation bounds. Linear Algebra and its Applications, 435(5):1111 – 1121, 2011. [24] R. Jozsa and G. Mitchison. Symmetric polynomials in information theory: Entropy and subentropy. Journal of Mathematical Physics, 56(6), 2015. [25] A. I. Khuri, B. Mukherjee, B. K. Sinha, and M. Ghosh. Design issues for generalized linear models: A review. Statist. Sci., 21(3):376–399, 2006. [26] J. Kiefer. Optimal design: Variation in structure and performance under change of criterion. Biometrika, 62:277–288, 1975. 9 [27] A. Krause, A. Singh, and C. Guestrin. Near-optimal sensor placements in gaussian processes: Theory, efficient algorithms and empirical studies. Journal of Machine Learning Research, 9(Feb):235–284, 2008. [28] F. S. Lasheras, J. V. Vilán, P. G. Nieto, and J. del Coz Díaz. The use of design of experiments to improve a neural network model in order to predict the thickness of the chromium layer in a hard chromium plating process. Mathematical and Computer Modelling, 52(78):1169 – 1176, 2010. [29] A. S. Lewis. Derivatives of spectral functions. Math. Oper. Res., 21(3):576–588, 1996. [30] I. G. Macdonald. Symmetric functions and Hall polynomials. Oxford university press, 1998. [31] A. J. Miller and N.-K. Nguyen. A fedorov exchange algorithm for d-optimal design. Applied Statistics, 43:669–677, 1994. [32] W. W. Muir. Inequalities concerning the inverses of positive definite matrices. Proceedings of the Edinburgh Mathematical Society, 19(2):109113, 1974. [33] F. Pukelsheim. Optimal Design of Experiments. Society for Industrial and Applied Mathematics, 2006. [34] P. J. Rousseeuw and A. M. Leroy. Robust Regression and Outlier Detection. John Wiley & Sons, Inc., 1987. [35] G. Sagnol. Optimal design of experiments with application to the inference of traffic matrices in large networks: second order cone programming and submodularity. Theses, École Nationale Supérieure des Mines de Paris, 2010. [36] A. Schein and L. Ungar. A-Optimality for Active Learning of Logistic Regression Classifiers, 2004. [37] A. Shpilka and A. Wigderson. Depth-3 arithmetic circuits over fields of characteristic zero. computational complexity, 10(1):1–27, 2001. [38] S. Silvey, D. Titterington, and B. Torsney. An algorithm for optimal designs on a design space. Communications in Statistics - Theory and Methods, 7(14):1379–1389, 1978. [39] J. D. Smith and M. T. Thai. Breaking the bonds of submodularity: Empirical estimation of approximation ratios for monotone non-submodular greedy maximization. CoRR, abs/1702.07002, 2017. [40] S. Sra and R. Hosseini. Conic Geometric Optimization on the Manifold of Positive Definite Matrices. SIAM J. Optimization (SIOPT), 25(1):713–739, 2015. [41] P. Sun and R. M. Freund. Computation of minimum-volume covering ellipsoids. Operations Research, 52(5):690–706, 2004. [42] M. Todd. Minimum-Volume Ellipsoids. Society for Industrial and Applied Mathematics, 2016. [43] L. Vandenberghe, S. Boyd, and S.-P. Wu. Determinant maximization with linear matrix inequality constraints. SIAM J. Matrix Anal. Appl., 19(2):499–533, 1998. [44] Y. Wang, A. W. Yu, and A. Singh. On computationally tractable selection of experiments in regression models, 2016. [45] Z. Wang, B. Moran, X. Wang, and Q. Pan. Approximation for maximizing monotone non-decreasing set functions with a greedy method. J. Comb. Optim., 31(1):29–43, 2016. [46] T. C. Xygkis, G. N. Korres, and N. M. Manousakis. Fisher information based meter placement in distribution grids via the d-optimal experimental design. IEEE Transactions on Smart Grid, PP(99), 2016. [47] I.-C. Yeh. Modeling of strength of high-performance concrete using artificial neural networks. Cement and Concrete Research, 28(12):1797 – 1808, 1998. [48] Y. Yu. Monotonic convergence of a general algorithm for computing optimal designs. Ann. Statist., 38 (3):1593–1606, 2010. 10
2017
80
7,221
Learning from Complementary Labels Takashi Ishida1,2,3 Gang Niu2,3 Weihua Hu2,3 Masashi Sugiyama3,2 1 Sumitomo Mitsui Asset Management, Tokyo, Japan 2 The University of Tokyo, Tokyo, Japan 3 RIKEN, Tokyo, Japan {ishida@ms., gang@ms., hu@ms., sugi@}k.u-tokyo.ac.jp Abstract Collecting labeled data is costly and thus a critical bottleneck in real-world classification tasks. To mitigate this problem, we propose a novel setting, namely learning from complementary labels for multi-class classification. A complementary label specifies a class that a pattern does not belong to. Collecting complementary labels would be less laborious than collecting ordinary labels, since users do not have to carefully choose the correct class from a long list of candidate classes. However, complementary labels are less informative than ordinary labels and thus a suitable approach is needed to better learn from them. In this paper, we show that an unbiased estimator to the classification risk can be obtained only from complementarily labeled data, if a loss function satisfies a particular symmetric condition. We derive estimation error bounds for the proposed method and prove that the optimal parametric convergence rate is achieved. We further show that learning from complementary labels can be easily combined with learning from ordinary labels (i.e., ordinary supervised learning), providing a highly practical implementation of the proposed method. Finally, we experimentally demonstrate the usefulness of the proposed methods. 1 Introduction In ordinary supervised classification problems, each training pattern is equipped with a label which specifies the class the pattern belongs to. Although supervised classifier training is effective, labeling training patterns is often expensive and takes a lot of time. For this reason, learning from less expensive data has been extensively studied in the last decades, including but not limited to, semisupervised learning [4, 38, 37, 13, 1, 21, 27, 20, 35, 16, 18], learning from pairwise/triple-wise constraints [34, 12, 6, 33, 25], and positive-unlabeled learning [7, 11, 32, 2, 8, 9, 26, 17]. In this paper, we consider another weakly supervised classification scenario with less expensive data: instead of any ordinary class label, only a complementary label which specifies a class that the pattern does not belong to is available. If the number of classes is large, choosing the correct class label from many candidate classes is laborious, while choosing one of the incorrect class labels would be much easier and thus less costly. In the binary classification setup, learning with complementary labels is equivalent to learning with ordinary labels, because complementary label 1 (i.e., not class 1) immediately means ordinary label 2. On the other hand, in K-class classification for K > 2, complementary labels are less informative than ordinary labels because complementary label 1 only means either of the ordinary labels 2, 3, . . . , K. The complementary classification problem may be solved by the method of learning from partial labels [5], where multiple candidate class labels are provided to each training pattern—complementary label y can be regarded as an extreme case of partial labels given to all K −1 classes other than class y. Another possibility to solve the complementary classification problem is to consider a multi-label 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. setup [3], where each pattern can belong to multiple classes—complementary label y is translated into a negative label for class y and positive labels for the other K −1 classes. Our contribution in this paper is to give a direct risk minimization framework for the complementary classification problem. More specifically, we consider a complementary loss that incurs a large loss if a predicted complementary label is not correct. We then show that the classification risk can be empirically estimated in an unbiased fashion if the complementary loss satisfies a certain symmetric condition—the sigmoid loss and the ramp loss (see Figure 1) are shown to satisfy this symmetric condition. Theoretically, we establish estimation error bounds for the proposed method, showing that learning from complementary labels is also consistent; the order of these bounds achieves the optimal parametric rate Op(1/pn), where Op denotes the order in probability and n is the number of complementarily labeled data. We further show that our proposed complementary classification can be easily combined with ordinary classification, providing a highly data-efficient classification method. This combination method is particularly useful, e.g., when labels are collected through crowdsourcing [14]: Usually, crowdworkers are asked to give a label to a pattern by selecting the correct class from the list of all candidate classes. This process is highly time-consuming when the number of classes is large. We may instead choose one of the classes randomly and ask crowdworkers whether a pattern belongs to the chosen class or not. Such a yes/no question can be much easier and quicker to be answered than selecting the correct class out of a long list of candidates. Then the pattern is treated as ordinarily labeled if the answer is yes; otherwise, the pattern is regarded as complementarily labeled. Finally, we demonstrate the practical usefulness of the proposed methods through experiments. 2 Review of ordinary multi-class classification Suppose that d-dimensional pattern x 2 Rd and its class label y 2 {1, . . . , K} are sampled independently from an unknown probability distribution with density p(x, y). The goal of ordinary multi-class classification is to learn a classifier f(x) : Rd ! {1, . . . , K} that minimizes the classification risk with multi-class loss L ! f(x), y " : R(f) = Ep(x,y) ⇥ L ! f(x), y "⇤ , (1) where E denotes the expectation. Typically, a classifier f(x) is assumed to take the following form: f(x) = arg max y2{1,...,K} gy(x), (2) where gy(x) : Rd ! R is a binary classifier for class y versus the rest. Then, together with a binary loss `(z) : R ! R that incurs a large loss for small z, the one-versus-all (OVA) loss1 or the pairwise-comparison (PC) loss defined as follows are used as the multi-class loss [36]: LOVA(f(x), y) = ` ! gy(x) " + 1 K −1 X y06=y ` ! −gy0(x) " , (3) LPC ! f(x), y " = X y06=y ` ! gy(x) −gy0(x) " . (4) Finally, the expectation over unknown p(x, y) in Eq.(1) is empirically approximated using training samples to give a practical classification formulation. 3 Classification from complementary labels In this section, we formulate the problem of complementary classification and propose a risk minimization framework. We consider the situation where, instead of ordinary class label y, we are given only complementary label y which specifies a class that pattern x does not belong to. Our goal is to still learn a classifier 1We normalize the “rest” loss by K −1 to be consistent with the discussion in the following sections. 2 that minimizes the classification risk (1), but only from complementarily labeled training samples {(xi, yi)}n i=1. We assume that {(xi, yi)}n i=1 are drawn independently from an unknown probability distribution with density:2 p(x, y) = 1 K −1 X y6=y p(x, y). (5) Let us consider a complementary loss L(f(x), y) for a complementarily labeled sample (x, y). Then we have the following theorem, which allows unbiased estimation of the classification risk from complementarily labeled samples: Theorem 1. The classification risk (1) can be expressed as R(f) = (K −1)Ep(x,y) ⇥ L ! f(x), y "⇤ −M1 + M2, (6) if there exist constants M1, M2 ≥0 such that for all x and y, the complementary loss satisfies K X y=1 L ! f(x), y " = M1 and L ! f(x), y " + L ! f(x), y " = M2. (7) Proof. According to (5), (K −1)Ep(x,y)[L(f(x), y)] = (K −1) Z K X y=1 L(f(x), y)p(x, y)dx = (K −1) Z K X y=1 L(f(x), y) 0 @ 1 K −1 X y6=y p(x, y) 1 A dx = Z K X y=1 X y6=y L(f(x), y)p(x, y)dx = Ep(x,y) 2 4X y6=y L(f(x), y) 3 5 = Ep(x,y)[M1 −L(f(x), y)] = M1 −Ep(x,y)[L(f(x), y)], where the fifth equality follows from the first constraint in (7). Subsequently, (K −1)Ep(x,y)[L(f(x), y)] −Ep(x,y)[L(f(x), y)] = M1 −Ep(x,y)[L(f(x), y) + L(f(x), y)] = M1 −Ep(x,y)[M2] = M1 −M2, where the second equality follows from the second constraint in (7). The first constraint in (7) can be regarded as a multi-class loss version of a symmetric constraint that we later use in Theorem 2. The second constraint in (7) means that the smaller L is, the larger L should be, i.e., if “pattern x belongs to class y” is correct, “pattern x does not belong to class y” should be incorrect. With the expression (6), the classification risk (1) can be naively approximated in an unbiased fashion by the sample average as bR(f) = K −1 n n X i=1 L ! f(xi), yi " −M1 + M2. (8) Let us define the complementary losses corresponding to the OVA loss LOVA(f(x), y) and the PC loss LPC ! f(x), y " as LOVA(f(x), y) = 1 K −1 X y6=y ` ! gy(x) " + ` ! −gy(x) " , (9) LPC ! f(x), y " = X y6=y ` ! gy(x) −gy(x) " . (10) Then we have the following theorem (its proof is given in Appendix A): 2The coefficient 1/(K −1) is for the normalization purpose: it would be natural to assume p(x, y) = (1/Z) P y6=y p(x, y) since all p(x, y) for y 6= y equally contribute to p(x, y); in order to ensure that p(x, y) is a valid joint density such that Ep(x,y)[1] = 1, we must take Z = K −1. 3 Figure 1: Examples of binary losses that satisfy the symmetric condition (11). Theorem 2. If binary loss `(z) satisfies `(z) + `(−z) = 1, (11) then LOVA satisfies conditions (7) with M1 = K and M2 = 2, and LPC satisfies conditions (7) with M1 = K(K −1)/2 and M2 = K −1. For example, the following binary losses satisfy the symmetric condition (11) (see Figure 1): Zero-one loss: `0-1(z " = ⇢0 if z > 0, 1 if z 0, (12) Sigmoid loss: `S(z " = 1 1 + ez , (13) Ramp loss: `R ! z " = 1 2 max ⇣ 0, min ! 2, 1 −z "⌘ . (14) Note that these losses are non-convex [8]. In practice, the sigmoid loss or ramp loss may be used for training a classifier, while the zero-one loss may be used for tuning hyper-parameters (see Section 6 for the details). 4 Estimation Error Bounds In this section, we establish the estimation error bounds for the proposed method. Let G = {g(x)} be a function class for empirical risk minimization, σ1, . . . , σn be n Rademacher variables, then the Rademacher complexity of G for X of size n drawn from p(x) is defined as follows [23]: Rn(G) = EX Eσ1,...,σn " sup g2G 1 n X xi2X σig(xi) # ; define the Rademacher complexity of G for X of size n drawn from p(x) as Rn(G) = EX Eσ1,...,σn 2 4sup g2G 1 n X xi2X σig(xi) 3 5 . Note that p(x) = p(x) and thus Rn(G) = Rn(G), which enables us to express the obtained theoretical results using the standard Rademacher complexity Rn(G). To begin with, let e`(z) = `(z) −`(0) be the shifted loss such that e`(0) = 0 (in order to apply the Talagrand’s contraction lemma [19] later), and eLOVA and eLPC be losses defined following (9) and 4 (10) but with e` instead of `; let L` be any (not necessarily the best) Lipschitz constant of `. Define the corresponding function classes as follows: HOVA = {(x, y) 7! eLOVA(f(x), y) | g1, . . . , gK 2 G}, HPC = {(x, y) 7! eLPC(f(x), y) | g1, . . . , gK 2 G}. Then we can obtain the following lemmas (their proofs are given in Appendices B and C): Lemma 3. Let Rn(HOVA) be the Rademacher complexity of HOVA for S of size n drawn from p(x, y) defined as Rn(HOVA) = ESEσ1,...,σn 2 4 sup h2HOVA 1 n X (xi,yi)2S σih(xi, yi) 3 5 . Then, Rn(HOVA) KL`Rn(G). Lemma 4. Let Rn(HPC) be the Rademacher complexity of HPC defined similarly to Rn(HOVA). Then, Rn(HPC) 2K(K −1)L`Rn(G). Based on Lemmas 3 and 4, we can derive the uniform deviation bounds of bR(f) as follows (its proof is given in Appendix D): Lemma 5. For any δ > 0, with probability at least 1 −δ, sup g1,...,gK2G 666 bR(f) −R(f) 666 2K(K −1)L`Rn(G) + (K −1) r 2 ln(2/δ) n , where bR(f) is w.r.t. LOVA, and sup g1,...,gK2G 666 bR(f) −R(f) 666 4K(K −1)2L`Rn(G) + (K −1)2 r ln(2/δ) 2n , where bR(f) is w.r.t. LPC. Let (g⇤ 1, . . . , g⇤ K) be the true risk minimizer and (bg1, . . . , bgK) be the empirical risk minimizer, i.e., (g⇤ 1, . . . , g⇤ K) = arg min g1,...,gK2G R(f) and (bg1, . . . , bgK) = arg min g1,...,gK2G bR(f). Let also f ⇤(x) = arg max y2{1,...,K} g⇤ y(x) and bf(x) = arg max y2{1,...,K} bgy(x). Finally, based on Lemma 5, we can establish the estimation error bounds as follows: Theorem 6. For any δ > 0, with probability at least 1 −δ, R( bf) −R(f ⇤) 4K(K −1)L`Rn(G) + (K −1) r 8 ln(2/δ) n , if (bg1, . . . , bgK) is trained by minimizing bR(f) is w.r.t. LOVA, and R( bf) −R(f ⇤) 8K(K −1)2L`Rn(G) + (K −1)2 r 2 ln(2/δ) n , if (bg1, . . . , bgK) is trained by minimizing bR(f) is w.r.t. LPC. 5 Proof. Based on Lemma 5, the estimation error bounds can be proven through R( bf) −R(g⇤) = ⇣ bR( bf) −bR(f ⇤) ⌘ + ⇣ R( bf) −bR( bf) ⌘ + ⇣ bR(f ⇤) −R(f ⇤) ⌘ 0 + 2 sup g1,...,gK2G 666 bR(f) −R(f) 666 , where we used that bR( bf) bR(f ⇤) by the definition of bf. Theorem 6 also guarantees that learning from complementary labels is consistent: as n ! 1, R( bf) ! R(f ⇤). Consider a linear-in-parameter model defined by G = {g(x) = hw, φ(x)iH | kwkH Cw, kφ(x)kH Cφ}, where H is a Hilbert space with an inner product h·, ·iH, w 2 H is a normal, φ : Rd ! H is a feature map, and Cw > 0 and Cφ > 0 are constants [29]. It is known that Rn(G) CwCφ/pn [23] and thus R( bf) ! R(f ⇤) in Op(1/pn) if this G is used, where Op denotes the order in probability. This order is already the optimal parametric rate and cannot be improved without additional strong assumptions on p(x, y), ` and G jointly. 5 Incorporation of ordinary labels In many practical situations, we may also have ordinarily labeled data in addition to complementarily labeled data. In such cases, we want to leverage both kinds of labeled data to obtain more accurate classifiers. To this end, motivated by [28], let us consider a convex combination of the classification risks derived from ordinarily labeled data and complementarily labeled data: R(f) = ↵Ep(x,y)[L(f(x), y)] + (1 −↵) h (K −1)Ep(x,y)[L(f(x), y)] −M1 + M2 i , (15) where ↵2 [0, 1] is a hyper-parameter that interpolates between the two risks. The combined risk (15) can be naively approximated by the sample averages as bR(f) = ↵ m m X j=1 L(f(xj), yj) + (1 −↵)(K −1) n n X i=1 L(f(xi), yi), (16) where {(xj, yj)}m j=1 are ordinarily labeled data and {(xi, yi)}n i=1 are complementarily labeled data. As explained in the introduction, we can naturally obtain both ordinarily and complementarily labeled data through crowdsourcing [14]. Our risk estimator (16) can utilize both kinds of labeled data to obtain better classifiers3. We will experimentally demonstrate the usefulness of this combination method in Section 6. 6 Experiments In this section, we experimentally evaluate the performance of the proposed methods. 6.1 Comparison of different losses Here we first compare the performance among four variations of the proposed method with different loss functions: OVA (9) and PC (10), each with the sigmoid loss (13) and ramp loss (14). We used the MNIST hand-written digit dataset, downloaded from the website of the late Sam Roweis4 (with all patterns standardized to have zero mean and unit variance), with different number of classes: 3 classes (digits “1” to “3”) to 10 classes (digits “1” to “9” and “0”). From each class, we randomly sampled 500 data for training and 500 data for testing, and generated complementary labels by randomly selecting one of the complementary classes. From the training dataset, we left out 25% of the data for validating hyperparameter based on (8) with the zero-one loss plugged in (9) or (10). 3 Note that when pattern x has already been equipped with ordinary label y, giving complementary label y does not bring us any additional information (unless the ordinary label is noisy). 4See http://cs.nyu.edu/~roweis/data.html. 6 Table 1: Means and standard deviations of classification accuracy over five trials in percentage, when the number of classes (“cls”) is changed for the MNIST dataset. “PC” is (10), “OVA” is (9), “Sigmoid” is (13), and “Ramp” is (14). Best and equivalent methods (with 5% t-test) are highlighted in boldface. Method 3 cls 4 cls 5 cls 6 cls 7 cls 8 cls 9 cls 10 cls OVA Sigmoid 95.2 (0.9) 91.4 (0.5) 87.5 (2.2) 82.0 (1.3) 74.5 (2.9) 73.9 (1.2) 63.6 (4.0) 57.2 (1.6) OVA Ramp 95.1 (0.9) 90.8 (1.0) 86.5 (1.8) 79.4 (2.6) 73.9 (3.9) 71.4 (4.0) 66.1 (2.1) 56.1 (3.6) PC Sigmoid 94.9 (0.5) 90.9 (0.8) 88.1 (1.8) 80.3 (2.5) 75.8 (2.5) 72.9 (3.0) 65.0 (3.5) 58.9 (3.9) PC Ramp 94.5 (0.7) 90.8 (0.5) 88.0 (2.2) 81.0 (2.2) 74.0 (2.3) 71.4 (2.4) 69.0 (2.8) 57.3 (2.0) For all the methods, we used a linear-in-input model gk(x) = w> k x + bk as the binary classifier, where > denotes the transpose, wk 2 Rd is the weight parameter, and bk 2 R is the bias parameter for class k 2 {1, . . . , K}. We added an `2-regularization term, with the regularization parameter chosen from {10−4, 10−3, . . . , 104}. Adam [15] was used for optimization with 5,000 iterations, with mini-batch size 100. We reported the test accuracy of the model with the best validation score out of all iterations. All experiments were carried out with Chainer [30]. We reported means and standard deviations of the classification accuracy over five trials in Table 1. From the results, we can see that the performance of all four methods deteriorates as the number of classes increases. This is intuitive because supervised information that complementary labels contain becomes weaker with more classes. The table also shows that there is no significant difference in classification accuracy among the four losses. Since the PC formulation is regarded as a more direct approach for classification [31] (it takes the sign of the difference of the classifiers, instead of the sign of each classifier as in OVA) and the sigmoid loss is smooth, we use PC with the sigmoid loss as a representative of our proposed method in the following experiments. 6.2 Benchmark experiments Next, we compare our proposed method, PC with the sigmoid loss (PC/S), with two baseline methods. The first baseline is one of the state-of-the-art partial label (PL) methods [5] with the squared hinge loss5: ` ! z " = (max(0, 1 −z))2. The second baseline is a multi-label (ML) method [3], where every complementary label y is translated into a negative label for class y and positive labels for the other K −1 classes. This yields the following loss: LML(f(x), y) = X y6=y ` ! gy(x) " + ` ! −gy(x) " , where we used the same sigmoid loss as the proposed method for `. We used a one-hidden-layer neural network (d-3-1) with rectified linear units (ReLU) [24] as activation functions, and weight decay candidates were chosen from {10−7, 10−4, 10−1}. Standardization, validation and optimization details follow the previous experiments. We evaluated the classification performance on the following benchmark datasets: WAVEFORM1, WAVEFORM2, SATIMAGE, PENDIGITS, DRIVE, LETTER, and USPS. USPS can be downloaded from the website of the late Sam Roweis6, and all other datasets can be downloaded from the UCI machine learning repository7. We tested several different settings of class labels, with equal number of data in each class. 5We decided to use the squared hinge loss (which is convex) here since it was reported to work well in the original paper [5]. 6See http://cs.nyu.edu/~roweis/data.html. 7See http://archive.ics.uci.edu/ml/. 7 Table 2: Means and standard deviations of classification accuracy over 20 trials in percentage. “PC/S” is the proposed method for the pairwise comparison formulation with the sigmoid loss, “PL” is the partial label method with the squared hinge loss, and “ML” is the multi-label method with the sigmoid loss. Best and equivalent methods (with 5% t-test) are highlighted in boldface. “Class” denotes the class labels used for the experiment and “Dim” denotes the dimensionality d of patterns to be classified. “# train” denotes the total number of training and validation samples in each class. “# test” denotes the number of test samples in each class. Dataset Class Dim # train # test PC/S PL ML WAVEFORM1 1 ⇠3 21 1226 398 85.8(0.5) 85.7(0.9) 79.3(4.8) WAVEFORM2 1 ⇠3 40 1227 408 84.7(1.3) 84.6(0.8) 74.9(5.2) SATIMAGE 1 ⇠7 36 415 211 68.7(5.4) 60.7(3.7) 33.6(6.2) PENDIGITS 1 ⇠5 16 719 336 87.0(2.9) 76.2(3.3) 44.7(9.6) 6 ⇠10 719 335 78.4(4.6) 71.1(3.3) 38.4(9.6) even # 719 336 90.8(2.4) 76.8(1.6) 43.8(5.1) odd # 719 335 76.0(5.4) 67.4(2.6) 40.2(8.0) 1 ⇠10 719 335 38.0(4.3) 33.2(3.8) 16.1(4.6) DRIVE 1 ⇠5 48 3955 1326 89.1(4.0) 77.7(1.5) 31.1(3.5) 6 ⇠10 3923 1313 88.8(1.8) 78.5(2.6) 30.4(7.2) even # 3925 1283 81.8(3.4) 63.9(1.8) 29.7(6.3) odd # 3939 1278 85.4(4.2) 74.9(3.2) 27.6(5.8) 1 ⇠10 3925 1269 40.8(4.3) 32.0(4.1) 12.7(3.1) LETTER 1 ⇠5 16 565 171 79.7(5.3) 75.1(4.4) 28.3(10.4) 6 ⇠10 550 178 76.2(6.2) 66.8(2.5) 34.0(6.9) 11 ⇠15 556 177 78.3(4.1) 67.4(3.3) 28.6(5.0) 16 ⇠20 550 184 77.2(3.2) 68.4(2.1) 32.7(6.4) 21 ⇠25 585 167 80.4(4.2) 75.1(1.9) 32.0(5.7) 1 ⇠25 550 167 5.1(2.1) 5.0(1.0) 5.2(1.1) USPS 1 ⇠5 256 652 166 79.1(3.1) 70.3(3.2) 44.4(8.9) 6 ⇠10 542 147 69.5(6.5) 66.1(2.4) 37.3(8.8) even # 556 147 67.4(5.4) 66.2(2.3) 35.7(6.6) odd # 542 147 77.5(4.5) 69.3(3.1) 36.6(7.5) 1 ⇠10 542 127 30.7(4.4) 26.0(3.5) 13.3(5.4) In Table 2, we summarized the specification of the datasets and reported the means and standard deviations of the classification accuracy over 10 trials. From the results, we can see that the proposed method is either comparable to or better than the baseline methods on many of the datasets. 6.3 Combination of ordinary and complementary labels Finally, we demonstrate the usefulness of combining ordinarily and complementarily labeled data. We used (16), with hyperparameter ↵fixed at 1/2 for simplicity. We divided our training dataset by 1 : (K −1) ratio, where one subset was labeled ordinarily while the other was labeled complementarily8. From the training dataset, we left out 25% of the data for validating hyperparameters based on the zero-one loss version of (16). Other details such as standardization, the model and optimization, and weight-decay candidates follow the previous experiments. We compared three methods: the ordinary label (OL) method corresponding to ↵= 1, the complementary label (CL) method corresponding to ↵= 0, and the combination (OL & CL) method with ↵= 1/2. The PC and sigmoid losses were commonly used for all methods. We reported the means and standard deviations of the classification accuracy over 10 trials in Table 3. From the results, we can see that OL & CL tends to outperform OL and CL, demonstrating the usefulnesses of combining ordinarily and complementarily labeled data. 8We used K−1 times more complementarily labeled data than ordinarily labeled data since a single ordinary label corresponds to (K −1) complementary labels. 8 Table 3: Means and standard deviations of classification accuracy over 10 trials in percentage. “OL” is the ordinary label method, “CL” is the complementary label method, and “OL & CL” is a combination method that uses both ordinarily and complementarily labeled data. Best and equivalent methods are highlighted in boldface. “Class” denotes the class labels used for the experiment and “Dim” denotes the dimensionality d of patterns to be classified. # train denotes the number of ordinarily/complementarily labeled data for training and validation in each class. # test denotes the number of test data in each class. Dataset Class Dim # train # test OL CL OL & CL (↵= 1) (↵= 0) (↵= 1 2) WAVEFORM1 1 ⇠3 21 413/826 408 85.3(0.8) 86.0(0.4) 86.9(0.5) WAVEFORM2 1 ⇠3 40 411/821 411 82.7(1.3) 82.0(1.7) 84.7(0.6) SATIMAGE 1 ⇠7 36 69/346 211 74.9(4.9) 70.1(5.6) 81.2(1.1) PENDIGITS 1 ⇠5 16 144/575 336 91.3(2.1) 84.7(3.2) 93.1(2.0) 6 ⇠10 144/575 335 86.3(3.5) 78.3(6.2) 87.8(2.8) even # 144/575 336 94.3(1.7) 91.0(4.3) 95.8(0.6) odd # 144/575 335 85.6(2.0) 75.9(3.1) 86.9(1.1) 1 ⇠10 72/647 335 61.7(4.3) 41.1(5.7) 66.9(2.0) DRIVE 1 ⇠5 48 780/3121 1305 92.1(2.6) 89.0(2.1) 94.2(1.0) 6 ⇠10 795/3180 1290 87.0(3.0) 86.5(3.1) 89.5(2.1) even # 657/3284 1314 91.4(2.9) 81.8(4.6) 91.8(3.3) odd # 790/3161 1255 91.1(1.5) 86.7(2.9) 93.4(0.5) 1 ⇠10 397/3570 1292 75.2(2.8) 40.5(7.2) 77.6(2.2) LETTER 1 ⇠5 16 113/452 171 85.2(1.3) 77.2(6.1) 89.5(1.6) 6 ⇠10 110/440 178 81.0(1.7) 77.6(3.7) 84.6(1.0) 11 ⇠15 111/445 177 81.1(2.7) 76.0(3.2) 87.3(1.6) 16 ⇠20 110/440 184 81.3(1.8) 77.9(3.1) 84.7(2.0) 21 ⇠25 117/468 167 86.8(2.7) 81.2(3.4) 91.1(1.0) 1 ⇠25 22/528 167 11.9(1.7) 6.5(1.7) 31.0(1.7) USPS 1 ⇠5 256 130/522 166 83.8(1.7) 76.5(5.3) 89.5(1.3) 6 ⇠10 108/434 147 79.2(2.1) 67.6(4.3) 85.5(2.4) even # 108/434 166 79.6(2.7) 67.4(4.4) 84.8(1.4) odd # 111/445 147 82.7(1.9) 72.9(6.2) 87.3(2.2) 1 ⇠10 54/488 147 43.7(2.6) 28.5(3.6) 59.3(2.2) 7 Conclusions We proposed a novel problem setting called learning from complementary labels, and showed that an unbiased estimator to the classification risk can be obtained only from complementarily labeled data, if the loss function satisfies a certain symmetric condition. Our risk estimator can easily be minimized by any stochastic optimization algorithms such as Adam [15], allowing large-scale training. We theoretically established estimation error bounds for the proposed method, and proved that the proposed method achieves the optimal parametric rate. We further showed that our proposed complementary classification can be easily combined with ordinary classification. Finally, we experimentally demonstrated the usefulness of the proposed methods. The formulation of learning from complementary labels may also be useful in the context of privacyaware machine learning [10]: a subject needs to answer private questions such as psychological counseling which can make him/her hesitate to answer directly. In such a situation, providing a complementary label, i.e., one of the incorrect answers to the question, would be mentally less demanding. We will investigate this issue in the future. It is noteworthy that the symmetric condition (11), which the loss should satisfy in our complementary classification framework, also appears in other weakly supervised learning formulations, e.g., in positive-unlabeled learning [8]. It would be interesting to more closely investigate the role of this symmetric condition to gain further insight into these different weakly supervised learning problems. 9 Acknowledgements GN and MS were supported by JST CREST JPMJCR1403. We thank Ikko Yamane for the helpful discussions. References [1] M. Belkin, P. Niyogi, and V. Sindhwani. Manifold regularization: a geometric framework for learning from labeled and unlabeled examples. Journal of Machine Learning Research, 7:2399–2434, 2006. [2] G. Blanchard, G. Lee, and C. Scott. Semi-supervised novelty detection. Journal of Machine Learning Research, 11:2973–3009, 2010. [3] M. R. Boutell, J. Luo, X. Shen, and C. M. Brown. Learning multi-label scene classification. Pattern Recognition, 37(9):1757–1771, 2004. [4] O. Chapelle, B. Schölkopf, and A. Zien, editors. Semi-Supervised Learning. MIT Press, 2006. [5] T. Cour, B. Sapp, and B. Taskar. Learning from partial labels. Journal of Machine Learning Research, 12:1501–1536, 2011. [6] J. Davis, B. Kulis, P. Jain, S. Sra, and I. Dhillon. Information-theoretic metric learning. In ICML, 2007. [7] F. Denis. PAC learning from positive statistical queries. In ALT, 1998. [8] M. C. du Plessis, G. Niu, and M. Sugiyama. Analysis of learning from positive and unlabeled data. In NIPS, 2014. [9] M. C. du Plessis, G. Niu, and M. Sugiyama. Convex formulation for learning from positive and unlabeled data. In ICML, 2015. [10] C. Dwork. Differential privacy: A survey of results. In TAMC, 2008. [11] C. Elkan and K. Noto. Learning classifiers from only positive and unlabeled data. In KDD, 2008. [12] J. Goldberger, S. Roweis, G. Hinton, and R. Salakhutdinov. Neighbourhood components analysis. In NIPS, 2004. [13] Y. Grandvalet and Y. Bengio. Semi-supervised learning by entropy minimization. In NIPS, 2004. [14] J. Howe. Crowdsourcing: Why the power of the crowd is driving the future of business. Crown Publishing Group, 2009. [15] D. P. Kingma and J. L. Ba. Adam: A method for stochastic optimization. In ICLR, 2015. [16] T. N. Kipf and M. Welling. Semi-supervised classification with graph convolutional networks. In ICLR, 2017. [17] R. Kiryo, G. Niu, M. C. du Plessis, and M. Sugiyama. Positive-unlabeled learning with non-negative risk estimator. In NIPS, 2017. [18] S. Laine and T. Aila. Temporal ensembling for semi-supervised learning. In ICLR, 2017. [19] M. Ledoux and M. Talagrand. Probability in Banach Spaces: Isoperimetry and Processes. Springer, 1991. [20] Y.-F. Li and Z.-H. Zhou. Towards making unlabeled data never hurt. IEEE Transactions on Pattern Analysis and Machine Intelligence, 37(1):175–188, 2015. [21] G. Mann and A. McCallum. Simple, robust, scalable semi-supervised learning via expectation regularization. In ICML, 2007. [22] C. McDiarmid. On the method of bounded differences. In J. Siemons, editor, Surveys in Combinatorics, pages 148–188. Cambridge University Press, 1989. [23] M. Mohri, A. Rostamizadeh, and A. Talwalkar. Foundations of Machine Learning. MIT Press, 2012. [24] V. Nair and G. Hinton. Rectified linear units improve restricted boltzmann machines. In ICML, 2010. 10 [25] G. Niu, B. Dai, M. Yamada, and M. Sugiyama. Information-theoretic semi-supervised metric learning via entropy regularization. Neural Computation, 26(8):1717–1762, 2014. [26] G. Niu, M. C. du Plessis, T. Sakai, Y. Ma, and M. Sugiyama. Theoretical comparisons of positiveunlabeled learning against positive-negative learning. In NIPS, 2016. [27] G. Niu, W. Jitkrittum, B. Dai, H. Hachiya, and M. Sugiyama. Squared-loss mutual information regularization: A novel information-theoretic approach to semi-supervised learning. In ICML, 2013. [28] T. Sakai, M. C. du Plessis, G. Niu, and M. Sugiyama. Semi-supervised classification based on classification from positive and unlabeled data. In ICML, 2017. [29] B. Schölkopf and A. Smola. Learning with Kernels. MIT Press, 2001. [30] S. Tokui, K. Oono, S. Hido, and J. Clayton. Chainer: a next-generation open source framework for deep learning. In Proceedings of Workshop on Machine Learning Systems in NIPS, 2015. [31] V. N. Vapnik. Statistical learning theory. John Wiley and Sons, 1998. [32] G. Ward, T. Hastie, S. Barry, J. Elith, and J. Leathwick. Presence-only data and the EM algorithm. Biometrics, 65(2):554–563, 2009. [33] K. Weinberger, J. Blitzer, and L. Saul. Distance metric learning for large margin nearest neighbor classification. Journal of Machine Learning Research, 10:207–244, 2009. [34] E. P. Xing, A. Y. Ng, M. I. Jordan, and S. Russell. Distance metric learning with application to clustering with side-information. In NIPS, 2002. [35] Z. Yang, W. W. Cohen, and R. Salakhutdinov. Revisiting semi-supervised learning with graph embeddings. In ICML, 2016. [36] T. Zhang. Statistical analysis of some multi-category large margin classification methods. Journal of Machine Learning Research, 5:1225–1251, 2004. [37] D. Zhou, O. Bousquet, T. Navin Lal, J. Weston, and B. Schölkopf. Learning with local and global consistency. In NIPS, 2003. [38] X. Zhu, Z. Ghahramani, and J. Lafferty. Semi-supervised learning using Gaussian fields and harmonic functions. In ICML, 2003. 11
2017
81
7,222
Dynamic Importance Sampling for Anytime Bounds of the Partition Function Qi Lou Computer Science Univ. of California, Irvine Irvine, CA 92697, USA qlou@ics.uci.edu Rina Dechter Computer Science Univ. of California, Irvine Irvine, CA 92697, USA dechter@ics.uci.edu Alexander Ihler Computer Science Univ. of California, Irvine Irvine, CA 92697, USA ihler@ics.uci.edu Abstract Computing the partition function is a key inference task in many graphical models. In this paper, we propose a dynamic importance sampling scheme that provides anytime finite-sample bounds for the partition function. Our algorithm balances the advantages of the three major inference strategies, heuristic search, variational bounds, and Monte Carlo methods, blending sampling with search to refine a variationally defined proposal. Our algorithm combines and generalizes recent work on anytime search [16] and probabilistic bounds [15] of the partition function. By using an intelligently chosen weighted average over the samples, we construct an unbiased estimator of the partition function with strong finite-sample confidence intervals that inherit both the rapid early improvement rate of sampling and the long-term benefits of an improved proposal from search. This gives significantly improved anytime behavior, and more flexible trade-offs between memory, time, and solution quality. We demonstrate the effectiveness of our approach empirically on real-world problem instances taken from recent UAI competitions. 1 Introduction Probabilistic graphical models, including Bayesian networks and Markov random fields, provide a framework for representing and reasoning with probabilistic and deterministic information [5, 6, 8]. Reasoning in a graphical model often requires computing the partition function, or normalizing constant of the underlying distribution. Exact computation of the partition function is known to be #P-hard [19] in general, leading to the development of many approximate schemes. Two important properties for a good approximation are that (1) it provides bounds or confidence guarantees on the result, so that the degree of approximation can be measured; and that (2) it can be improved in an anytime manner, so that the approximation becomes better as more computation is available. In general, there are three major paradigms for approximate inference: variational bounds, heuristic search, and Monte Carlo sampling. Each method has advantages and disadvantages. Variational bounds [21], and closely related approximate elimination methods [7, 14] provide deterministic guarantees on the partition function. However, these bounds are not anytime; their quality often depends on the amount of memory available, and do not improve without additional memory. Search algorithms [12, 20, 16] explicitly enumerate over the space of configurations and eventually provide an exact answer; however, while some problems are well-suited to search, others only improve their quality very slowly with more computation. Importance sampling [e.g., 4, 15] gives probabilistic bounds that improve with more samples at a predictable rate; in practice this means bounds that improve rapidly at first, but are slow to become very tight. Several algorithms combine two strategies: approximate hash-based counting combines sampling (of hash functions) with CSP-based search [e.g., 3, 2] or other MAP queries [e.g., 9, 10], although these are not typically formulated to provide anytime 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. behavior. Most closely related to this work are [16] and [15], which perform search and sampling, respectively, guided by variational bounds. In this work, we propose a dynamic importance sampling algorithm that provides anytime probabilistic bounds (i.e., they hold with probability 1 −δ for some confidence parameter δ). Our algorithm interleaves importance sampling with best first search [16], which is used to refine the proposal distribution of successive samples. In practice, our algorithm enjoys both the rapid bound improvement characteristic of importance sampling [15], while also benefiting significantly from search on problems where search is relatively effective, or when given enough computational resources, even when these points are not known in advance. Since our samples are drawn from a sequence of different, improving proposals, we devise a weighted average estimator that upweights higher-quality samples, giving excellent anytime behavior. 10 2 10 4 −78 −76 −74 −72 −70 −68 −66 −64 time (sec) upper bound search sampling two-stage DIS [16] [15] Figure 1: Example: bounds on logZ for protein instance 1bgc. Motivating example. We illustrate the focus and contributions of our work on an example problem instance (Fig. 1). Search [16] provides strict bounds (gray) but may not improve rapidly, particularly once memory is exhausted; on the other hand, importance sampling [15] provides probabilistic bounds (green) that improve at a predictable rate, but require more and more samples to become tight. We first describe a “two stage” sampling process that uses a search tree to improve the baseline bound from which importance sampling starts (blue), greatly improving its long-term performance, then present our dynamic importance sampling (DIS) algorithm, which interleaves the search and sampling processes (sampling from a sequence of proposal distributions) to give bounds that are strong in an anytime sense. 2 Background Let X = (X1, . . . , XM) be a vector of random variables, where each Xi takes values in a discrete domain Xi; we use lower case letters, e.g. xi ∈Xi, to indicate a value of Xi, and x to indicate an assignment of X. A graphical model over X consists of a set of factors F = {fα(Xα) | α ∈I}, where each factor fα is defined on a subset Xα = {Xi | i ∈α} of X, called its scope. We associate an undirected graph G = (V, E) with F, where each node i ∈V corresponds to a variable Xi and we connect two nodes, (i, j) ∈E, iff {i, j} ⊆α for some α. The set I then corresponds to cliques of G. We can interpret F as an unnormalized probability measure, so that f(x) = Y α∈I fα(xα), Z = X x Y α∈I fα(xα) Z is called the partition function, and normalizes f(x). Computing Z is often a key task in evaluating the probability of observed data, model selection, or computing predictive probabilities. 2.1 AND/OR search trees We first require some notations from search. AND/OR search trees are able to exploit the conditional independence properties of the model, as expressed by a pseudo tree: Definition 1 (pseudo tree). A pseudo tree of an undirected graph G = (V, E) is a directed tree T = (V, E′) sharing the same set of nodes as G. The tree edges E′ form a subset of E, and we require that each edge (i, j) ∈E \ E′ be a “back edge”, i.e., the path from the root of T to j passes through i (denoted i ≤j). G is called the primal graph of T. Fig. 2(a)-(b) show an example primal graph and pseudo tree. Guided by the pseudo tree, we can construct an AND/OR search tree T consisting of alternating levels of OR and AND nodes. Each OR node s is associated with a variable, which we slightly abuse notation to denote Xs; the children of s, ch(s), are AND nodes corresponding to the possible values of Xs. The root ∅of the AND/OR search tree corresponds to the root of the pseudo tree. Let pa(c) = s indicate the parent of c, and an(c) = {n | n ≤c} be the ancestors of c (including itself) in the tree. 2 A" B" C" D" E" F" G" (a) A B C F G D E (b) A B B 0 1 0 1 0 1 F 0 1 G 0 1 G 0 1 F 0 1 G 0 1 G 0 1 C 0 1 E 0 1 D 0 1 E 0 1 D 0 1 C 0 1 E 0 1 D 0 1 E 0 1 D 0 1 C 0 1 E 0 1 D 0 1 E 0 1 D 0 1 C 0 1 E 0 1 D 0 1 E 0 1 D 0 1 F 0 1 G 0 1 G 0 1 F 0 1 G 0 1 G 0 1 (c) Figure 2: (a) A primal graph of a graphical model over 7 variables. (b) A pseudo tree for the primal graph consistent with elimination order G, F, E, D, C, B, A. (c) AND/OR search tree guided by the pseudo tree. One full solution tree is marked red and one partial solution tree is marked blue. As the pseudo tree defines a partial ordering on the variables Xi, the AND/OR tree extends this to one over partial configurations of X. Specifically, any AND node c corresponds to a partial configuration x≤c of X, defined by its assignment and that of its ancestors: x≤c = x≤p ∪{Xs = xc}, where s = pa(c), p = pa(s). For completeness, we also define x≤s for any OR node s, which is the same as that of its AND parent, i.e., x≤s = x≤pa(s). For any node n, the corresponding variables of x≤n is denoted as X≤n. Let de(Xn) be the set of variables below Xn in the pseudo tree; we define X>n = de(Xn) if n is an AND node; X>n = de(Xn) ∪{Xn} if n is an OR node. The notion of a partial solution tree captures partial configurations of X respecting the search order: Definition 2 (partial solution tree). A partial solution tree T of an AND/OR search tree T is a subtree satisfying three conditions: (1) T contains the root of T ; (2) if an OR node is in T, at most one of its children is in T; (3) if an AND node is in T, all of its children or none of its children are in T. Any partial solution tree T defines a partial configuration xT of X; if xT is a complete configuration of X, we call T a full solution tree, and use Tx to denote the corresponding solution tree of a complete assignment x. Fig. 2(c) illustrates these concepts. We also associate a weight wc with each AND node, defined to be the product of all factors fα that are instantiated at c but not before: wc = Y α∈Ic fα(xα), Ic = {α | Xc ∈Xα ⊆X≤c} For completeness, define ws = 1 for any OR node s. It is then easy to see that, for any node n, the product of weights on a path to the root, gn = Q a≤n wa (termed the cost of the path), equals the value of the factors whose scope is fully instantiated at n, i.e., fully instantiated by x≤n. We can extend this cost notion to any partial solution tree T by defining g(T) as the product of all factors fully instantiated by xT ; we will slightly abuse notation by using g(T) and g(xT ) interchangeably. Particularly, the cost of any full solution tree equals the value of its corresponding complete configuration. We use g(x>n|x≤n) (termed the conditional cost) to denote the quotient g([x≤n, x>n])/g(x≤n), where x>n is any assignment of X>n, the variables below n in the search tree. We give a “value” vn to each node n equal to the total conditional cost of all configurations below n: vn = X x>n g(x>n|x≤n). (1) The value of the root is simply the partition function, v∅= Z. Equivalently, vn can be defined recursively: if n is an AND node corresponding to a leaf of the pseudo tree, let vn = 1; otherwise, vn = (Q c∈ch(n) vc, if AND node n P c∈ch(n) wcvc, if OR node n (2) 2.2 AND/OR best-first search for bounding the partition function AND/OR best-first search (AOBFS) can be used to bound the partition function in an anytime fashion by expanding and updating bounds defined on the search tree [16]. Beginning with only the root 3 ∅, AOBFS expands the search tree in a best-first manner. More precisely, it maintains an explicit AND/OR search tree of visited nodes, denoted S. For each node n in the AND/OR search tree, AOBFS maintains un, an upper bound on vn, initialized via a pre-compiled heuristic vn ≤h+ n , and subsequently updated during search using information propagated from the frontier: un = (Q c∈ch(n) uc, if AND node n P c∈ch(n) wcuc, if OR node n (3) Thus, the upper bound at the root, u∅, is an anytime deterministic upper bound of Z. Note that this upper bound depends on the current search tree S, so we write U S = u∅. If all nodes below n have been visited, then un = vn; we call n solved and can remove the subtree below n from memory. Hence we can partition the frontier nodes into two sets: solved frontier nodes, SOLVED(S), and unsolved ones, OPEN(S). AOBFS assigns a priority to each node and expands a top-priority (unsolved) frontier node at each iteration. We use the “upper priority” from [16], Un = gnun Y s∈branch(n) us (4) where branch(n) are the OR nodes that are siblings of some node ≤n. Un quantifies n’s contribution to the global bound U S, so this priority attempts to reduce the upper bound on Z as quickly as possible. We can also interpret our bound U S as a sum of bounds on each of the partial configurations covered by S. Concretely, let TS be the set of projections of full solution trees on S (in other words, TS are partial solution trees whose leaves are frontier nodes of S); then, U S = X T ∈TS UT where UT = g(T) Y s∈leaf(T ) us (5) and leaf(T) are the leaf nodes of the partial solution tree T. 2.3 Weighted mini-bucket for heuristics and sampling To construct a heuristic function for search, we can use a class of variational bounds called weighted mini-bucket (WMB, [14]). WMB corresponds to a relaxed variable elimination procedure, respecting the search pseudo tree order, that can be tightened using reparameterization (or “cost-shifting”) operations. Importantly for this work, this same relaxation can also be used to define a proposal distribution for importance sampling that yields finite-sample bounds [15]. We describe both properties here. Let n be any node in the search tree; then, one can show that WMB yields the following reparametrization of the conditional cost below n [13]: g(x>n|x≤n) = h+ n Y k Y j bkj(xk|xanj(k))ρkj, Xk ∈X>n (6) where Xanj(k) are the ancestors of Xk in the pseudo tree that are included in the j-th mini-bucket of Xk. The size of Xanj(k) is controlled by a user-specified parameter called the ibound. The bkj(xk|xanj(k)) are conditional beliefs, and the non-negative weights ρkj satisfy P j ρkj = 1. Suppose that we define a conditional distribution q(x>n|x≤n) by replacing the geometric mean over the bkj in (6) with their arithmetic mean: q(x>n|x≤n) = Y k X j ρkjbkj(xk|xanj(k)) (7) Applying the arithmetic-geometric mean inequality, we see that g(x>n|x≤n)/h+ n ≤q(x>n|x≤n). Summing over x>n shows that h+ n is a valid upper bound heuristic for vn: vn = X x>n g(x>n|x≤n) ≤h+ n The mixture distribution q can be also used as a proposal for importance sampling, by drawing samples from q and averaging the importance weights, g/q. For any node n, we have that g(x>n|x≤n)/q(x>n|x≤n) ≤h+ n , E h g(x>n|x≤n)/q(x>n|x≤n) i = vn (8) 4 i.e., the importance weight g(x>n|x≤n)/q(x>n|x≤n) is an unbiased and bounded estimator of vn. In [15], this property was used to give finite-sample bounds on Z which depended on the WMB bound, h+ ∅. To be more specific, note that g(x>n|x≤n) = f(x) when n is the root ∅, and thus f(x)/q(x) ≤h+ ∅; the boundedness of f(x)/q(x) results in the following finite-sample upper bound on Z that holds with probability at least 1 −δ: Z ≤1 N N X i=1 f(xi) q(xi) + s 2d Var({f(xi)/q(xi)}N i=1) ln(2/δ) N + 7 ln(2/δ)h+ ∅ 3(N −1) (9) where {xi}N i=1 are i.i.d. samples drawn from q(x), and d Var({f(xi)/q(xi)}N i=1) is the unbiased empirical variance. This probabilistic upper bound usually becomes tighter than h+ ∅very quickly. A corresponding finite-sample lower bound on Z exists as well [15]. 3 Two-step sampling The finite-sample bound (9) suggests that improvements to the upper bound on Z may be translatable into improvements in the probabilistic, sampling bound. In particular, if we define a proposal that uses the search tree S and its bound U S, we can improve our sample-based bound as well. This motivates us to design a two-step sampling scheme that exploits the refined upper bound from search; it is a top-down procedure starting from the root: Step 1 For an internal node n: if it is an AND node, all its children are selected; if n is an OR node, one child c ∈ch(n) is randomly selected with probability wcuc/un. Step 2 When a frontier node n is reached, if it is unsolved, draw a sample of X>n from q(x>n|x≤n); if it is solved, quit. The behavior of Step 1 can be understood by the following proposition: Proposition 1. Step 1 returns a partial solution tree T ∈TS with probability UT /U S (see (5)). Any frontier node of S will be reached with probability proportional to its upper priority defined in (4). Note that at Step 2, although the sampling process terminates when a solved node n is reached, we associate every configuration x>n of X>n with probability g(x>n|x≤n)/vn which is appropriate in lieu of (1). Thus, we can show that this two-step sampling scheme induces a proposal distribution, denoted qS(x), which can be expressed as: qS(x) = Y n∈AND(Tx∩S) wnun/upa(n) Y n′∈OPEN(S)∩Tx q(x>n′|x≤n′) Y n′′∈SOLVED(S)∩Tx g(x>n′′|x≤n′′)/vn′′ where AND(Tx ∩S) is the set of all AND nodes of the partial solution tree Tx ∩S. By applying (3), and noticing that the upper bound is the initial heuristic for any node in OPEN(S) and is exact at any solved node, we re-write qS(x) as qS(x) = g(Tx ∩S) U S Y n′∈OPEN(S)∩Tx h+ n′ q(x>n′|x≤n′) Y n′′∈SOLVED(S)∩Tx g(x>n′′|x≤n′′) (10) qS(x) actually provides bounded importance weights that can use the refined upper bound U S: Proposition 2. Importance weights from qS(x) are bounded by the upper bound of S, and are unbiased estimators of Z, i.e., f(x)/qS(x) ≤U S, E h f(x)/qS(x) i = Z (11) Proof. Note that f(x) can be written as f(x) = g(Tx ∩S) Y n′∈OPEN(S)∩Tx g(x>n′|x≤n′) Y n′′∈SOLVED(S)∩Tx g(x>n′′|x≤n′′) (12) Noticing that for any n′ ∈OPEN(S), g(x>n′|x≤n′) ≤h+ n′ q(x>n′|x≤n′) by (8), and comparing with (10), we see f(x)/qS(x) is bounded by U S. Its unbiasedness is trivial. 5 Algorithm 1 Dynamic importance sampling (DIS) Require: Control parameters Nd, Nl; memory budget, time budget. Ensure: N, HM(U), d Var({ bZi/Ui}N i=1), bZ, ∆. 1: Initialize S ←{∅} with the root ∅. 2: while within the time budget 3: if within the memory budget // update S and its associated upper bound U S 4: Expand Nd nodes via AOBFS (Alg. 1 of [16]) with the upper priority defined in (4). 5: end if 6: Draw Nl samples via TWOSTEPSAMPLING(S). 7: After drawing each sample: 8: Update N, HM(U), d Var({ bZi/Ui}N i=1). 9: Update bZ, ∆via (13), (14). 10: end while 11: function TWOSTEPSAMPLING(S) 12: Start from the root of the search tree S: 13: For an internal node n: select all its children if it is an AND node; select exactly 14: one child c ∈ch(n) with probability wcuc/un if it is an OR node. 15: At any unsolved frontier node n, draw one sample from q(x>n|x≤n) in (7). 16: end function Thus, importance weights resulting from our two-step sampling can enjoy the same type of bounds described in (9). Moreover, note that at any solved node, our sampling procedure incorporates the “exact” value of that node into the importance weights, which serves as Rao-Blackwellisation and can potentially reduce variance. We can see that if S = ∅(before search), qS(x) is the proposal distribution of [15]; as search proceeds, the quality of the proposal distribution improves (gradually approaching the underlying distribution f(x)/Z as S approaches the complete search tree). If we perform search first, up to some memory limit, and then sample, which we refer to as two-stage sampling, our probabilistic bounds will proceed from an improved baseline, giving better bounds at moderate to long computation times. However, doing so sacrifices the quick improvement early on given by basic importance sampling. In the next section, we describe our dynamic importance sampling procedure, which balances these two properties. 4 Dynamic importance sampling To provide good anytime behavior, we would like to do both sampling and search, so that early samples can improve the bound quickly, while later samples obtain the benefits of the search tree’s improved proposal. To do so, we define a dynamic importance sampling (DIS) scheme, presented in Alg. 1, which interleaves drawing samples and expanding the search tree. One complication of such an approach is that each sample comes from a different proposal distribution, and thus has a different bound value entering into the concentration inequality. Moreover, each sample is of a different quality – later samples should have lower variance, since they come from an improved proposal. To this end, we construct an estimator of Z that upweights higher-quality samples. Let {xi}N i=1 be a series of samples drawn via Alg. 1, with { bZi = f(xi)/qSi(xi)}N i=1 the corresponding importance weights, and {Ui = U Si}N i=1 the corresponding upper bounds on the importance weights respectively. We introduce an estimator bZ of Z: bZ = HM(U) N N X i=1 bZi Ui , HM(U) = h 1 N N X i=1 1 Ui i−1 (13) where HM(U) is the harmonic mean of the upper bounds Ui. bZ is an unbiased estimator of Z (since it is a weighted average of independent, unbiased estimators). Additionally, since Z/ HM(U), bZ/ HM(U), and bZi/Ui are all within the interval [0, 1], we can apply an empirical Bernstein bound [17] to derive finite-sample bounds: 6 Theorem 1. Define the deviation term ∆= HM(U)  s 2d Var({ bZi/Ui}N i=1) ln(2/δ) N + 7 ln(2/δ) 3(N −1)  (14) where d Var({ bZi/Ui}N i=1) is the unbiased empirical variance of { bZi/Ui}N i=1. Then bZ + ∆and bZ −∆ are upper and lower bounds of Z with probability at least 1 −δ, respectively, i.e., Pr[Z ≤bZ + ∆] ≥ 1 −δ and Pr[Z ≥bZ −∆] ≥1 −δ. It is possible that bZ −∆< 0 at first; if so, we may replace bZ −∆with any non-trivial lower bound of Z. In the experiments, we use bZδ, a (1 −δ) probabilistic bound by the Markov inequality [11]. We can also replace bZ + ∆with the current deterministic upper bound if the latter is tighter. Intuitively, our DIS algorithm is similar to Monte Carlo tree search (MCTS) [1], which also grows an explicit search tree while sampling. However, in MCTS, the sampling procedure is used to grow the tree, while DIS uses a classic search priority. This ensures that the DIS samples are independent, since samples do not influence the proposal distribution of later samples. This also distinguishes DIS from methods such as adaptive importance sampling (AIS) [18]. 5 Empirical evaluation We evaluate our approach (DIS) against AOBFS (search, [16]) and WMB-IS (sampling, [15]) on several benchmarks of real-world problem instances from recent UAI competitions. Our benchmarks include pedigree, 22 genetic linkage instances from the UAI’08 inference challenge1; protein, 50 randomly selected instances made from the “small” protein side-chains of [22]; and BN, 50 randomly selected Bayesian networks from the UAI’06 competition2. These three sets are selected to illustrate different problem characteristics; for example protein instances are relatively small (M = 100 variables on average, and average induced width 11.2) but high cardinality (average max |Xi| = 77.9), while pedigree and BN have more variables and higher induced width (average M 917.1 and 838.6, average width 25.5 and 32.8), but lower cardinality (average max |Xi| 5.6 and 12.4). We alloted 1GB memory to all methods, first computing the largest ibound that fits the memory budget, and using the remaining memory for search. All the algorithms used the same upper bound heuristics, which also means DIS and AOBFS had the same amount of memory available for search. For AOBFS, we use the memory-limited version (Alg. 2 of [16]) with “upper” priority, which continues improving its bounds past the memory limit. Additionally, we let AOBFS access a lower bound heuristic for no cost, to facilitate comparison between DIS and AOBFS. We show DIS for two settings, (Nl=1, Nd=1) and (Nl=1, Nd=10), balancing the effort between search and sampling. Note that WMB-IS can be viewed as DIS with (Nl=Inf, Nd=0), i.e., it runs pure sampling without any search, and two-stage sampling viewed as DIS with (Nl=1, Nd=Inf), i.e., it searches to the memory limit then samples. We set δ = 0.025 and ran each algorithm for 1 hour. All implementations are in C/C++. Anytime bounds for individual instances. Fig. 3 shows the anytime behavior of all methods on two instances from each benchmark. We observe that compared to WMB-IS, DIS provides better upper and lower bounds on all instances. In 3(d)–(f), WMB-IS is not able to produce tight bounds within 1 hour, but DIS quickly closes the gap. Compared to AOBFS, in 3(a)–(c),(e), DIS improves much faster, and in (d),(f) it remains nearly as fast as search. Note that four of these examples are sufficiently hard to be unsolved by a variable elimination-based exact solver, even with several orders of magnitude more computational resources (200GB memory, 24 hour time limit). Thus, DIS provides excellent anytime behavior; in particular, (Nl=1, Nd=10) seems to work well, perhaps because expanding the search tree is slightly faster than drawing a sample (since the tree depth is less than the number of variables). On the other hand, two-stage sampling gives weaker early bounds, but is often excellent at longer time settings. Aggregated results across the benchmarks. To quantify anytime performance of the methods in each benchmark, we introduce a measure based on the area between the upper and lower bound of 1http://graphmod.ics.uci.edu/uai08/Evaluation/Report/Benchmarks/ 2http://melodi.ee.washington.edu/~bilmes/uai06InferenceEvaluation/ 7 10 1 10 2 10 3 10 4 −130 −125 −120 time (sec) logZ ( −124.979 ) AOBFS WMB-IS DIS (Nl=1, Nd=1) DIS (Nl=1, Nd=10) two-stage (a) pedigree/pedigree33 10 0 10 2 10 4 −105 −100 −95 −90 −85 time (sec) logZ ( unknown ) AOBFS WMB-IS DIS (Nl=1, Nd=1) DIS (Nl=1, Nd=10) two-stage (b) protein/1co6 10 0 10 2 10 4 −35 −30 −25 −20 time (sec) logZ ( unknown ) AOBFS WMB-IS DIS (Nl=1, Nd=1) DIS (Nl=1, Nd=10) two-stage (c) BN/BN_30 10 1 10 2 10 3 10 4 −280 −275 −270 −265 −260 time (sec) logZ ( −268.435 ) AOBFS WMB-IS DIS (Nl=1, Nd=1) DIS (Nl=1, Nd=10) two-stage (d) pedigree/pedigree37 10 0 10 2 10 4 −95 −90 −85 −80 −75 −70 −65 time (sec) logZ ( unknown ) AOBFS WMB-IS DIS (Nl=1, Nd=1) DIS (Nl=1, Nd=10) two-stage (e) protein/1bgc 10 1 10 2 10 3 10 4 −160 −150 −140 −130 −120 time (sec) logZ ( unknown ) AOBFS WMB-IS DIS (Nl=1, Nd=1) DIS (Nl=1, Nd=10) two-stage (f) BN/BN_129 Figure 3: Anytime bounds on logZ for two instances per benchmark. Dotted line sections on some curves indicate Markov lower bounds. In examples where search is very effective (d,f), or where sampling is very effective (a), DIS is equal or nearly so, while in (b,c,e) DIS is better than either. Table 1: Mean area between upper and lower bounds of logZ, normalized by WMB-IS, for each benchmark. Smaller numbers indicate better anytime bounds. The best for each benchmark is bolded. AOBFS WMB-IS DIS (Nl=1, Nd=1) DIS (Nl=1, Nd=10) two-stage pedigree 16.638 1 0.711 0.585 1.321 protein 1.576 1 0.110 0.095 2.511 BN 0.233 1 0.340 0.162 0.865 logZ. For each instance and method, we compute the area of the interval between the upper and lower bound of logZ for that instance and method. To avoid vacuous lower bounds, we provide each algorithm with an initial lower bound on logZ from WMB. To facilitate comparison, we normalize the area of each method by that of WMB-IS on each instance, then report the geometric mean of the normalized areas across each benchmark in Table 1. This shows the average relative quality compared to WMB-IS; smaller values indicate tighter anytime bounds. We see that on average, search is more effective than sampling on the BN instances, but much less effective on pedigree. Across all three benchmarks, DIS (Nl=1, Nd=10) produces the best result by a significant margin, while DIS (Nl=1, Nd=1) is also very competitive, and two-stage sampling does somewhat less well. 6 Conclusion We propose a dynamic importance sampling algorithm that embraces the merits of best-first search and importance sampling to provide anytime finite-sample bounds for the partition function. The AOBFS search process improves the proposal distribution over time, while our particular weighted average of importance weights gives the resulting estimator quickly decaying finite-sample bounds, as illustrated on several UAI problem benchmarks. Our work also opens up several avenues for future research, including investigating different weighting schemes for the samples, more flexible balances between search and sampling (for example, changing over time), and more closely integrating the variational optimization process into the anytime behavior. 8 Acknowledgements We thank William Lam, Wei Ping, and all the reviewers for their helpful feedback. This work is sponsored in part by NSF grants IIS-1526842, IIS-1254071, and by the United States Air Force under Contract No. FA8750-14-C-0011 and FA9453-16-C-0508. References [1] 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. [2] S. Chakraborty, K. S. Meel, and M. Y. Vardi. Algorithmic improvements in approximate counting for probabilistic inference: From linear to logarithmic SAT calls. IJCAI’16. [3] S. Chakraborty, D. J. Fremont, K. S. Meel, S. A. Seshia, and M. Y. Vardi. Distribution-aware sampling and weighted model counting for SAT. AAAI’14, pages 1722–1730. AAAI Press, 2014. [4] P. Dagum and M. Luby. An optimal approximation algorithm for Bayesian inference. Artificial Intelligence, 93(1-2):1–27, 1997. [5] A. Darwiche. Modeling and Reasoning with Bayesian Networks. Cambridge University Press, 2009. [6] R. Dechter. Reasoning with probabilistic and deterministic graphical models: Exact algorithms. Synthesis Lectures on Artificial Intelligence and Machine Learning, 7(3):1–191, 2013. [7] R. Dechter and I. Rish. Mini-buckets: A general scheme of approximating inference. Journal of ACM, 50 (2):107–153, 2003. [8] R. Dechter, H. Geffner, and J. Y. Halpern. Heuristics, Probability and Causality. A Tribute to Judea Pearl. College Publications, 2010. [9] S. Ermon, C. Gomes, A. Sabharwal, and B. Selman. Taming the curse of dimensionality: Discrete integration by hashing and optimization. In International Conference on Machine Learning, pages 334–342, 2013. [10] S. Ermon, C. Gomes, A. Sabharwal, and B. Selman. Low-density parity constraints for hashing-based discrete integration. In International Conference on Machine Learning, pages 271–279, 2014. [11] V. Gogate and R. Dechter. Sampling-based lower bounds for counting queries. Intelligenza Artificiale, 5 (2):171–188, 2011. [12] M. Henrion. Search-based methods to bound diagnostic probabilities in very large belief nets. In Proceedings of the 7th conference on Uncertainty in Artificial Intelligence, pages 142–150, 1991. [13] Q. Liu. Reasoning and Decisions in Probabilistic Graphical Models–A Unified Framework. PhD thesis, University of California, Irvine, 2014. [14] Q. Liu and A. Ihler. Bounding the partition function using Hölder’s inequality. In Proceedings of the 28th International Conference on Machine Learning (ICML), New York, NY, USA, 2011. [15] Q. Liu, J. W. Fisher, III, and A. T. Ihler. Probabilistic variational bounds for graphical models. In Advances in Neural Information Processing Systems, pages 1432–1440, 2015. [16] Q. Lou, R. Dechter, and A. Ihler. Anytime anyspace AND/OR search for bounding the partition function. In Proceedings of the 31st AAAI Conference on Artificial Intelligence, 2017. [17] A. Maurer and M. Pontil. Empirical Bernstein bounds and sample variance penalization. In COLT, 2009. [18] M.-S. Oh and J. O. Berger. Adaptive importance sampling in Monte Carlo integration. Journal of Statistical Computation and Simulation, 41(3-4):143–168, 1992. [19] L. Valiant. The complexity of computing the permanent. Theoretical Computer Science, 8(2):189 – 201, 1979. [20] C. Viricel, D. Simoncini, S. Barbe, and T. Schiex. Guaranteed weighted counting for affinity computation: Beyond determinism and structure. In International Conference on Principles and Practice of Constraint Programming, pages 733–750. Springer, 2016. [21] M. Wainwright and M. Jordan. Graphical models, exponential families, and variational inference. Foundations and Trends R⃝in Machine Learning, 1(1-2):1–305, 2008. [22] C. Yanover and Y. Weiss. Approximate inference and protein-folding. In Advances in Neural Information Processing Systems, pages 1457–1464, 2002. 9
2017
82
7,223
Process-constrained batch Bayesian Optimisation Pratibha Vellanki1, Santu Rana1, Sunil Gupta1, David Rubin2 Alessandra Sutti2, Thomas Dorin2, Murray Height2,Paul Sandars3, Svetha Venkatesh1 1Centre for Pattern Recognition and Data Analytics Deakin University, Geelong, Australia [pratibha.vellanki, santu.rana, sunil.gupta, svetha.venkatesh@deakin.edu.au] 2Institute for Frontier Materials, GTP Research Deakin University, Geelong, Australia [d.rubindecelisleal, alessandra.sutti, thomas.dorin, murray.height@deakin.edu.au] 3Materials Science and Engineering, Michigan Technological University, USA [sanders@mtu.edu] Abstract Prevailing batch Bayesian optimisation methods allow all control variables to be freely altered at each iteration. Real-world experiments, however, often have physical limitations making it time-consuming to alter all settings for each recommendation in a batch. This gives rise to a unique problem in BO: in a recommended batch, a set of variables that are expensive to experimentally change need to be fixed, while the remaining control variables can be varied. We formulate this as a process-constrained batch Bayesian optimisation problem. We propose two algorithms, pc-BO(basic) and pc-BO(nested). pc-BO(basic) is simpler but lacks convergence guarantee. In contrast pc-BO(nested) is slightly more complex, but admits convergence analysis. We show that the regret of pc-BO(nested) is sublinear. We demonstrate the performance of both pc-BO(basic) and pc-BO(nested) by optimising benchmark test functions, tuning hyper-parameters of the SVM classifier, optimising the heat-treatment process for an Al-Sc alloy to achieve target hardness, and optimising the short polymer fibre production process. 1 Introduction Experimental optimisation is used to design almost all products and processes, scientific and industrial, around us. Experimental optimisation involves optimising input control variables in order to achieve a target output. Design of experiments (DOE) [16] is the conventional laboratory and industrial standard methodology used to efficiently plan experiments. The method is rigid - not adaptive based on the completed experiments so far. This is where Bayesian optimisation offers an effective alternative. Bayesian optimisation [13, 17] is a powerful probabilistic framework for efficient, global optimisation of expensive, black box functions. The field is undergoing a recent resurgence, spurred by new theory and problems and is impacting computer science broadly - tuning complex algorithms [3, 22, 18, 21], combinatorial optimisation [24, 12], reinforcement learning [4]. Usually, a prior belief in the form of Gaussian process is maintained over the possible set of objective functions and the posterior is the refined belief after updating the model with experimental data. The updated model is used to seek the most promising location of function extrema by using a variety of criteria, e.g. expected improvement (EI), and upper confidence bound (UCB). The maximiser of such a criteria function is then recommended for the function evaluation. Iteratively the model is updated and recommendations are made till the target outcome is achieved. When concurrent function evaluations are possible, Bayesian optimisation returns multiple suggestions, and this is termed as the batch 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. Temperature (T) t1 t2 Time (t) t3 t4 T1 T2 T3 T4 (a) Heat treatment for Al-Sc - temperature time profile Coagulant flow (𝑣𝑣𝑐𝑐) Polymer flow (𝑣𝑣𝑝𝑝) Constriction angle (𝛼𝛼) Channel width(ℎ) Device position(𝑑𝑑) Short Nano-fibers (b) Experimental setup for short polymer fibre production. Figure 1: Examples of real-world applications requiring process constraints. setting. Bayesian optimisation with batch setting has been investigated by [10, 5, 6, 9, 1] wherein different strategies are used to recommend multiple settings at each iteration. In all these methods, all the control variables are free to be altered at each iteration. However, in some situations needing to change all the variables for a single batch may not be efficient and this leads to the motivation of our process-constrained Bayesian optimisation. This work has been directly influenced from the way experiments are conducted in many real-world scenarios with a typical limitation on resources. For example, in our work with metallurgists, we were given a task to find the optimal heat-treatment schedule of an alloy which maximises the strength. Heat-treatment involves taking the alloy through a series of exposures to different temperatures for a variable amount of durations as shown in Figure 1a. Typically, a heat treatment schedule can last for multiple days, so doing one experiment at a time is not efficient. Fortunately, a furnace is big enough to hold multiple samples at the same time. If we have to perform multiple experiments in one batch yet using only one furnace, then we must design our Bayesian optimisation recommendations in such a way that the temperatures across a batch remain the same, whilst still allowing the durations to vary. Samples would be put in the same oven, but would be taken out after different elapsed time for each step of the heat treatment. Similar examples abound in other domains of process and product design. For short polymer fibre production a polymer is injected axially within another flow of a solvent in a particular geometric manifold [20]. A representation of the experimental setup marked with the parameters involved is shown in Figure 1b. When optimising for the yield it is generally easy to change the flow parameters (pump speed setting) than changing the device geometry (opening up the enclosure and modifying the physical configuration). Hence in this case as well, it is beneficial to recommend a batch of suggested experiments at a fixed geometry but allowing flow parameters to vary. Many such examples where the batch recommendations are constrained by the processes involved have been encountered by the authors in realising the potential of Bayesian optimisation for real-world applications. To construct a more familiar application we use the hyper-parameter tuning problem for Support Vector Machines (SVM). When we use parallel tuning using batch Bayesian optimisation, it may be useful if all the parallel training runs finished at the same time. This would require fixing the cost parameter, while allowing the the other hyper-parameters to vary. Whist this may or may not be a real concern depending on the use cases, we use it here as a case study. We formulate this unique problem as process-constrained batch Bayesian optimisation. The recommendation schedule needs to constrain a set of variables corresponding to control variables that are experimentally expensive (time, cost, difficulty) to change (constrained set) and varies all the remaining control variables (unconstrained set). Our approach involves incorporating constraints on stipulated control parameters and allowing the others to change in an unconstrained manner. The mathematical formulation of our optimisation problem is as follows. x∗= argmaxx∈X f(x) and we want a batch Bayesian optimisation sequence {{xt,0, xt,1, ..., xt,K−1}}T t=1 such that ∀t and xt,k = [xuc t,kxc t,k], xc t,k = xc t,k′ ∀k, k ′ ∈[0, ..., K −1] Where xc t,k is the kth constrained variable in tth batch and similarly xuc t,k is the kth unconstrained variable in the tth batch. T is the total number of iterations and K is the batch-size. 2 We propose two approaches to the solve this problem: basic process-constrained Bayesian optimisation (pc-BO(basic)) and nested process-constrained batch Bayesian optimisation (pc-BO(nested)). pc-BO(basic) is an intuitive modification motivated by the work of [5] and pc-BO(nested) is based on a nested Bayesian optimisation method we will describe in section 3. We formulate the algorithms pc-BO(basic) and pc-BO(nested), and for pc-BO(nested) we present the theoretic analysis to show that the average regret vanishes superlinearly with iterations. We demonstrate the performance of pc-BO(basic) and pc-BO(nested) on both benchmark test functions and real world problems that involve hyper-parameter tuning for SVM classification for two datasets: breast cancer and biodegradable waste, the industrial problem of heat treatment process for an Aluminium-Scandium (Al-Sc) alloy, and another industrial problem of short polymer fibre production process. 2 Related background 2.1 Bayesian optimisation Bayesian optimisation is a sequential method of global optimisation of an expensive and unknown black-box function f whose domain is X, to find its maxima x∗= argmax x∈X f(x) (or minima). It is especially powerful when the function is expensive to evaluate and it does not have a closed-form expression, but it is possible to generate noisy observations from experiments. The Gaussian process (GP) is commonly used as a flexible way to place a prior over the unknown function [14]. It is are completely described by the mean function m(x) and the covariance function k(x, x′) and they imply our belief and uncertainties about the objective function. Noisy observations from the experiments are sequentially appended into the model, that in turn updates our belief about the objective function. The acquisition function is a surrogate utility function that takes a known tractable closed form and allows us to choose the next query point. It is maximised in the place of the unknown objective function and constructed such that it balances between exploring regions of high value (mean) and exploiting regions of high uncertainties (variances) across the objective function. Gaussian process based Upper Confidence Bound (GP-UCB) proposed by [19] is one of the acquisition functions which is shown to achieve sublinear growth in cumulative regret. It is define at tthiteration as αt GP −UCB(x) = µt−1(x) + p βtσt−1(x) (1) where, v = 1 and βt = 2log(td/2+2π2/3δ) is the confidence parameter, wherein t denotes the iteration number, d represents the dimensionality of the data and δ ∈(0, 1). We are motivated by GP-UCB based methods. Although our approach can be intuitively extended to other acquisition function, we do not explore this in the current work. 2.2 Batch Bayesian optimisation methods The GP exhibits an interesting characteristic that its predictive variance is dependent on only the input attributes while updating its mean requires knowledge about the outcome of the experiment. This leads us to a direction of strategies for multiple recommendations. There are several batch Bayesian optimisation algorithms for an unconstrained case. GP-BUCB by [6] recommends multiple batch points using the UCB strategy and the aforementioned characteristic. To fill up a batch, it updates the variances with the available attribute information and appends the outcomes temporarily by substituting them with most recently computed posterior mean. A similar strategy is used in the GP-UCB-PE by [5] that optimises the unknown function by incorporating some batch elements where uncertainty is high. GP-UCB-PE computes the first batch element by using the UCB strategy and recommends the rest of the points by relying on only the predictive variance, and not the mean. It has been shown that for these GP-UCB based algorithms the regret can be bounded tighter than the single recommendation methods. To the best of our knowledge these existing batch Bayesian optimisation techniques do not address the process-constrained problem presented in this work. The algorithms proposed in this paper are inspired by the previous approaches but address it in context of a process-constrained setting. 3 2.3 Constrained-batch vs. constrained-space optimisation We refer to the parameters that are not allowed to change (eg. temperatures for heat treatment, or device geometry for fibre production) as constrained set and the other parameters (heat treatment durations or flow parameters) as unconstrained set. We emphasise that our usage of constraint differs from the problem settings presented in literature, for example in [2, 11, 7, 8], where the parameters values are constrained or the function evaluations are constrained by inequalities. In the problem setting that we present, all the parameters exist in unconstrained space; for each individual batch, the constrained variables should have the same value. 3 Proposed method We recall the maximisation problem from Section 1 as x∗= argmaxx∈X f(x). In our case X = X uc ∪X c, where X c is the constrained subspace and X uc is the unconstrained subspace. Algorithm 1 pc-BO(basic): Basic process-constrained pure exploration batch Bayesian optimisation algorithm. while (t < MaxIter) xt,0 =  xuc t,0xc t,0  = argmaxx∈X αGP −UCB (xt,0 | D) for k = 1, .., K −1 xuc t,k = argmax xuc∈X ucσ  xuc t,k | D, xc t,0,  xuc t,k′ k′<k end D = D ∪  xuc t,kxc t,1  , f  xuc t,kxc t,1  K−1 k=0 end Algorithm 2 pc-BO(nested): Nested process-constrained batch Bayesian optimisation algorithm. while (t < MaxIter) xc t = argmaxxc∈X cαGP −UCB c (xc t | DO) xuc t,0 = argmaxxuc∈X ucαGP −UCB uc (xuc t | DI, xc t) for k = 1, ..., K-1 xuc t,k = argmaxxuc∈X ucσuc  xuc t | DI, xc t,  xuc t,k′ k′<k end DO = DO ∪  xc t, f  (xuc t )+ xc t  DI = DI ∪  xuc t,kxc t  , f  xuc t,kxc t  K−1 k=0 end A naïve approach to solving the process is to employ any standard batch Bayesian optimisation algorithm where the first member is generated and then subsequent members are filled up by setting the constraint variables to that of the first member. We describe this approach as the basic processconstrained pure exploration batch Bayesian optimisation (pc-BO(basic)) algorithm as detailed in algorithm 1, where αGP −UCB(x | D) is the acquisition function as defined in Equation 1. We note that pc-BO(basic) is an improvisation over the work of [5]. During each iteration, the first batch element is recommended using the UCB strategy. The remaining batch elements, as in GP-UCBPE, are generated by updating the posterior variance of the GP, after the constrained set attributes are fixed to those of the first batch element. We provide an alternate formulation via a nested optimisation problem called nested processconstrained batch Bayesian optimisation (pc-BO(nested)) with two stages. For each batch, in the outer stage optimisation is performed to find the optimal values of the constrained variables and in the inner stage optimisation is performed to find optimal values of the unconstrained variables. The algorithm is detailed in algorithm 2, where αGP −UCB c (x | D) is the acquisition function for the outer stage, and αGP −UCB uc (x | D) is the acquisition function for the inner stage as defined in Equation 1, and (xuc t )+ = argmax xuc t ∈ n xuc t,k oK−1 k=0 f ([xuc t xc t]), is the unconstrained batch parameter that yields the best target goal for the given constrained parameter xc. We are able to analyse the convergence of 4 pc-BO(nested). It can be expected that in some cases the performance of the pc-BO(basic) and pcBO(nested) are close. The pc-BO(basic) method maybe considered simpler, but it lacks guaranteed convergence. 3.1 Convergence analysis for pc-BO(nested) We now present the analysis of the convergence of pc-BO(nested) as described in Algorithm 2. The outer stage optimisation problem for xc and observation Do is expressed as follows. (xc)∗ = argmaxxc∈X cg(xc), where, g(xc) ≜ max xuc∈X uc f ([xucxc]) ≃ max xuc∈Xuc f([xucxc]) = f([(xuc)+xc]), where, Xuc ≜ {{xt,0, xt,1, ..., xt,K−1}}T t=1 such that, xc t,k = xc, DO ≜ n xc t, f hxuc t,k + xc t, ioT t=1 And the inner stage optimisation problem for xuc and observation DI is expressed as follows. (xuc)∗ = argmaxxuc∈X uch (xuc) , where, h(xuc) ≜ f ([xucxc]) DI ≜ n xuc t,kxc t  , f  xuc t,kxc t  K−1 k=0 oT t=1 This is solved using a Bayesian optimisation routine. Here,(xuc)+ is the unconstrained batch parameter that yields the best target goal for the given constrained parameter xc. Unfortunately as g(xc) is not easily measurable, we use f([(xuc)+xc]) as an approximation to it. To address this we use a provable batch Bayesian optimisation such as GP-UCB-PE [5] in the inner stage. The loops are performed together where in each iteration t, the outer loop first recommends a single recommendation of xc t and then the inner loop suggests a batch,  xuc t,k K k=1. Combining them we get processconstrained set of recommendations. We show that together these two Bayesian optimisation loops converge to the optimal solution. Let us denote (xuc t )+ = argmaxxuc∈{xuc k } K k=1 f([xucxc t]). Following that we can write g(xc) as, g(xc) = f  (xuc t )∗xc t,  = f h (xuc t )+ xc t, i + f  (xuc t )∗xc t,  −f h (xuc t )+ xc t, i = f h (xuc t )+ xc t, i + ruc t (2) where ruc t is the regret of the inner loop. The observational model is given as yc = g(xc) + ϵ = f h (xuc t )+ xc t, i + ruc t + ϵ where ϵ ∼N(0, σ2) (3) Lemma 1. For regret of the inner loop, PT t=1 rK t 2 ≤βuc 1 Cuc 1 γuc T + π2 6 Proof. As we use GP-UCB-PE for unconstrained parameter optimisation, we can say that the regret rK t = min rk t ∀k = 0, ..., K −1 (Lemma 1, [5]). Hence, rK t ≤r0 t ≤2√β1σ0 t . Now, even though every batch recommendation for xc will always be run for one iteration only, the σ0 t (xt) is computed from the updated GP. Hence the sum of (σ0 t )2 can be upper bounded by γT. Thus, T X t=1  rK t 2 ≤βuc 1 Cuc 1 γuc T + π2 6 (4) Here, β1 = 2log(1d/2+2π2/3δ) is the confidence parameter; C1 = 8/log(1 + σ−2); γT = max A∈X c,|A|=T I(yA : fA) assuming y = f + ϵ, where ϵ ∼ N(0, σ2/2) is the maximum information gain after T rounds. (Please see supplementary material 5 for derivation) Lemma 2. For the variance of ruc t has the order of σ2 rt ∼O(Cuc 1 βuc 1 γuc t + Cuc 2 ) 5 Proof. We use PE algorithm [5] to compute K-recommendation, hence the variance of the regret ruc t can be bounded above by σ2 ruc t ≤E((ruc t )2) ≤E 1 t t X t′=0 (ruc t′ )2 ! = E 1 t t X t′=0 min k<K(ruc t′k)2 ! The second inequality holds since on an average the gap ruc t = g(xc) −f([(xuc t )+xc]) decreases with iteration t, ∀xc ∈X c. From equation 3, equation 4 and using the Lemma 4 and 5 of [5] we can write E 1 t t X t′=0 min k<K(ruc t′k)2 ! ∼O(1 t Cuc 1 βuc 1 γuc t + Cuc 2 ) (5) for some Cuc, 1 Cuc 2 ∈R. γt is the maximum information gain over t samples. This concludes the proof. The following lemma guarantees an existence of a finite T0 after which the noise variance coming from the inner optimisation loop becomes smaller than the noise in the observation model. Lemma 3. ∃T0 < ∞for which σ2 ruc T0 ≤σ2. Proof. In Lemma 1,Cuc, 1 Cuc 2 and βuc 1 are fixed constant and γuc tK is sublinear in t. Therefore, any quantity of the form M1 × 1 t Cuc 1 βuc 1 γuc t + Cuc 2 also decreases sublinearly with t for ∀M1 ∈R. Hence the lemma is proved. Let us denote the instantaneous regret for the outer Bayesian optimisation loop as rc t = g((xc)∗) − g(xc t), we can write the average regret after T iterations as, ¯ RT = 1 T T X t=0 rc t ≤1 T X (2 p βc t σc t−1(xc t) + 1 t2 ) ≤ 2 r βc T P(σc t−1(xc t))2 T + 1 T X 1 t2 (6) using the Lemma 5.8 of [19] and Cauchy-Schwartz inequality. Lemma 4. For the outer Bayesian optimisation lim T →∞ ¯ RT →0 Proof. From the equation 6 ¯ RT ≤ 2 s βc T PT t=1(σc t−1(xc t))2 T + 1 T T X t=1 1 t2 = 2 v u u tβc T T T0 X t=1 ((σc t−1(xc t))2 + T X t=T0+1 (σc t−1(xc t))2 ! + 1 T T X t=1 1 t2 ≤ 2 r βc T T (AT0 + BT ) + 1 T T X t=1 1 t2 (7) We then show that AT0 is upper bounded by a constant irrespective of T as long as T ≥T0 and BT is sublinear with T. βc T is sublinear in T and lim T →∞ T X t=1 1 t2 = π2 6 . Hence the right hand side vanishes as T →∞. The details of the proof is presented in the supplementary material. However, in reality using regret as the upper bound on ruc t is not necessary, as a tighter upper bound may exist when we know the maximum value of the function1 and we can safely alter the upper bound as, ruc t ≤min(f max −f([(xuc t )+xc]), 2 p β1σuc t−1(xuc 0 )) (8) The above results holds since Lemma 2 still holds. 1e.g. for hyper-parameter tuning we know that maximum value of accuracy is 1. 6 0 10 20 30 40 50 60 70 80 number of iterations 0.85 0.9 0.95 1 best value so far Branin (normalised) pc-BO(nested) pc-BO(basic) s-BO 0 10 20 30 40 50 60 70 80 number of iterations 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 best value so far Ackley (normalised) pc-BO(nested) pc-BO(basic) s-BO 0 10 20 30 40 50 60 70 8 0 number of iterations 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1 best value so far Goldstein-Price (normalised) pc-BO(nested) pc-BO(basic) s-BO 0 10 20 30 40 50 60 70 80 number of iterations 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1 best value so far Egg-holder (normalised) pc-BO(nested) pc-BO(basic) s-BO Figure 2: Synthetic test function optimisation using pc-BO(nested), pc-BO(basic) and s-BO. The zoomed area on the respective scale is shown for Branin and Goldstein-Price. 4 Experiments We conducted a set of experiments using both synthetic data and real data to demonstrate the performance of pc-BO(basic) and pc-BO(nested). To the best of our knowledge, there are no other methods that can selectively constrain parameters in each batch during Bayesian optimisation. Further, we also show the results for the test function optimisation using sequential BO (s-BO) using GP-UCB. The code is implemented in MATLAB and all the experiments are run on an Intel CPU E5-2640 v3 @2.60GHz machine. We use the squared exponential distance kernel. To show the performance, we plot the results as the best outcome so far against the number of iterations performed. The uncertainty bars in the figures pertain to 10 runs of BO algorithms with different initialisations for a batch of 3 recommendations. The errors bars show the standard error and the graph shows the mean best outcome until the respective iteration. 4.1 Benchmark test function optimisation In this section, we use benchmark test functions and demonstrate the performance of pc-BO(basic) and pc-BO(nested). We apply the test functions by constraining the second parameter and finding the best configuration across the first parameter (unconstrained). The Branin, Ackley, GoldsteinPrice and the Egg-holder functions were optimised using pc-BO(basic) and pc-BO(nested), and the results are shown in Figure 2. From the results, we note that the pc-BO(nested) is marginally better or similar in performance when compared with pc-BO(basic). It also shows that batch Bayesian optimisation is more efficient in terms of number of iterations than a purely sequential approach for the problem at hand. 4.2 Hyper-parameter tuning for SVM Support vector machines with RBF kernel require hyper-parameter tuning for Cost (C) and Gamma (γ). Out of these parameters, the cost is a critical parameter that trades off error for generalisation. Consider tuning SVM’s in parallel. The cost parameter strongly affects the time required for training SVM. It would be inconvenient if one training process took much longer than the other. Thus constraining the cost parameter for a single batch maybe a good idea. We use our algorithms to tune 7 both the hyper-parameters C and γ, at each batch only varying γ, but not C. This is demonstrated on the classification using SVM problem using two datasets downloaded from UCI machine learning repository: Breast cancer dataset (BCW) and Bio-degradation dataset (QSAR). BCW has 683 instances with 9 attributes each of the data, where the instances are labelled as benign or malign tumour as per the diagnosis. The QSAR dataset categorises 1055 chemicals with 42 attributes as ready or not ready biodegradable waste. The results are plotted as best accuracy obtained across number of iterations. We observe from the results in Figure 3, that pc-BO(nested) again performs marginally better than pc-BO(basic) for the BCW dataset. For the QSAR dataset, pc-BO(nested) higher accuracy with lesser iterations than what pc-BO(basic) requires. 4.3 Heat treatment for an Al-Sc alloy Alloy casting involves heat treatment process - exposing the cast to different temperatures for select times, that ensures target hardness of the alloy. This process is repeated in steps. The underlying physics of heat-treatment of an alloy is based on nucleation and growth. During the nucleation process, “new phases” or precipitates are formed when clusters of atom self organise. This is a difficult stochastic process that happens at lower temperatures. These precipitates then diffuse together to achieve the requisite target alloy characteristics in the growth step. KWN [15, 23] is the industrial standard precipitation model for the kinetics of nucleation and growth steps. As a preliminary study we use this simulator to demonstrate the strength of our algorithm. As explained in the introduction, it is cost efficient to test heat treatment in the real world by varying the time and keeping the temperature constrained in each batch. This will allow us to test multiple samples at one go in a single oven. We use the same constrains for our simulator driven study. We consider a two stage heat treatment process. The input to first stage is the alloy composition, the temperature and time. The nucleation output of this stage is input to the the second stage along with the temperature and time for the second stage. The final output is hardness of the material (strength in kPa). To optimise this two stage heat treatment process our inputs are [T1, T2, t1, t2], where [T1, T2] represent temperatures in Celsius, [t1, t2] represent the time in minutes for each stage. Figure 4 shows the results of the heat-treatment process optimisation. 4.4 Short polymer fibre polymer production Short polymer fibre production is a set of experiments we conducted in collaboration with material scientists at Deakin University. For production of short polymer fibres, a polymer rich fluid is injected coaxially into the flow of another solvent in a particular geometric manifold. The parameters included in this experiment are device position in mm, constriction angle in degrees, channel width in mm, polymer flow in ml/hr, and coagulant speed in cm/s. The final output, the combined utility is the distance of the length and diameter of the polymer from target polymer. The goal is to optimise the input parameters to obtain a polymer fibre of a desired length and diameter. As explained in the introduction, it is efficient to test multiple combinations of polymer flow and coagulant speed for a fixed geometric setup than in a single batch. 0 10 20 60 70 80 30 40 50 number of iterations 0.85 0.9 0.95 1 accuracy SVM with BCW pc-BO(nested) pc-BO(basic) 0 10 20 60 70 80 30 40 50 number of iterations 0.7 0.75 0.8 0.85 0.9 SVM with QSAR pc-BO(nested) pc-BO(basic) accuracy Figure 3: Hyper-parameter tuning for SVM based classification on Breast Cancer Data (BCW) and bio-degradable waste data (QSAR) using pc-BO(nested) and pc-BO(basic) 8 0 5 10 20 25 30 0 number of iterations iterations 75 90 105 120 Hardness of the alloy pc-BO(nested) pc-BO(basic) Al-Sc alloy heat treatment 15 0 5 10 15 20 25 30 35 40 number of iterations 0 0.2 0.4 0.6 0.8 1 best combined utility of polymer short polymer fibre production pc-BO(nested) pc-BO(basic) Figure 4: Results for heat-treatment and short polymer fibre production processes. (a) Experimental result for Al-Sc heat treatment profile for a two stage heat-treatment process using pc-BO(nested) and pc-BO(basic). (b) Optimisation for short polymer fibre production with position, constriction angle and channel width constrained for each batch. Polymer flow and coagulant speed are unconstrained. The optimisation is shown for pc-BO(nested) and pc-BO(basic) algorithms. The parameters in this experiments are discrete, where every parameter takes 3 discrete values, except the constriction angle which takes 2 discrete values. Coagulant speed and polymer flow are unconstrained parameters and channel width, constriction angle and position are the constrained parameters. We conducted the experiment in batches of 3. The Figure 4 shows the optimisation results for this experiment over 53 iterations. 5 Conclusion We have identified a new problem in batch Bayesian optimisation, motivated from physical limitations in real world experiments while conducting batch experiments. It is not feasible and resourcefriendly to change all available settings in scientific and industrial experiments for a batch. We propose process-constrained batch Bayesian optimisation for such applications, where it is preferable to fix the values of some variables in a batch. We propose two approaches to solve the problem of process-constrained batches pc-BO(basic) and pc-BO(nested). We present analytical proof for convergence of pc-BO(nested). Synthetic functions, and real world experiments: hyper-parameter tuning for SVM, alloy heat treatment process, and short polymer fiber production process were optimised using the proposed algorithms. We found that pc-BO(nested) in each of these scenarios is either more efficient or equally well performing compared with pc-BO(basic). Acknowledgements This research was partially funded by the Australian Government through the Australian Research Council (ARC) and the Telstra-Deakin Centre of Excellence in Big Data and Machine Learning. Prof Venkatesh is the recipient of an ARC Australian Laureate Fellowship (FL170100006). References [1] J. Azimi, A. Fern, and X. Z. Fern. Batch bayesian optimization via simulation matching. In Advances in Neural Information Processing Systems, pages 109–117, 2010. [2] J. Azimi, X. Fern, and A. Fern. Budgeted optimization with constrained experiments. Journal of Artificial Intelligence Research, 56:119–152, 2016. [3] J. Bergstra, R. Bardenet, Y. Bengio, and B. Kégl. Algorithms for hyper-parameter optimization. In Advances in Neural Information Processing Systems, pages 2546–2554, 2011. [4] E. Brochu, V. M. Cora, and N. de Freitas. A tutorial on Bayesian optimization of expensive cost functions, with application to active user modeling and hierarchical reinforcement learning. arXiv:1012.2599, (UBC TR-2009-023 and arXiv:1012.2599), 2010. [5] E. Contal, D. Buffoni, A. Robicquet, and N. Vayatis. Parallel gaussian process optimization with upper confidence bound and pure exploration. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pages 225–240. Springer, 2013. 9 [6] T. Desautels, A. Krause, and J. W. Burdick. Parallelizing exploration-exploitation tradeoffs in gaussian process bandit optimization. Journal of Machine Learning Research, 15(1):3873–3923, 2014. [7] J. R. Gardner, M. J. Kusner, Z. E. Xu, K. Q. Weinberger, and J. P. Cunningham. Bayesian optimization with inequality constraints. In International Conference on Machine Learning, pages 937–945, 2014. [8] M. A. Gelbart, J. Snoek, and R. P. Adams. Bayesian optimization with unknown constraints. In Uncertainty in Artificial Intelligence, pages 250–259, 2014. [9] D. Ginsbourger, R. Le Riche, and L. Carraro. A multi-points criterion for deterministic parallel global optimization based on gaussian processes. Technical report, 2008. [10] J. González, Z. Dai, P. Hennig, and N. D. Lawrence. Batch bayesian optimization via local penalization. In Artificial Intelligence and Statistics, pages 648–657, 2015. [11] J. M. Hernández-Lobato, M. A. Gelbart, R. P. Adams, M. W. Hoffman, and Z. Ghahramani. A general framework for constrained bayesian optimization using information-based search. Journal of Machine Learning Research, 17(160):1–53, 2016. [12] F. Hutter, H. H. Hoos, and K. Leyton-Brown. Sequential model-based optimization for general algorithm configuration. In Learning and Intelligent Optimization, pages 507–523, 2011. [13] D. R. Jones, M. Schonlau, and W. J. Welch. Efficient global optimization of expensive black-box functions. Journal of Global optimization, 13(4):455–492, 1998. [14] C. E. Rasmussen. Gaussian processes for machine learning. 2006. [15] J. Robson, M. Jones, and P. Prangnell. Extension of the n-model to predict competing homogeneous and heterogeneous precipitation in al-sc alloys. Acta Materialia, 51(5):1453–1468, 2003. [16] J. Sacks, W. J. Welch, T. J. Mitchell, and H. P. Wynn. Design and analysis of computer experiments. Statistical science, pages 409–423, 1989. [17] B. Shahriari, K. Swersky, Z. Wang, R. P. Adams, and N. de Freitas. Taking the human out of the loop: A review of bayesian optimization. Proceedings of the IEEE, 104(1):148–175, 2016. [18] J. Snoek, H. Larochelle, and R. P. Adams. Practical bayesian optimization of machine learning algorithms. In Advances in Neural Information Processing Systems, pages 2960–2968, 2012. [19] N. Srinivas, A. Krause, S. Kakade, and M. W. Seeger. Gaussian process optimization in the bandit setting: No regret and experimental design. In Proceedings of the 27th International Conference on Machine Learning (ICML-10), June 21-24, 2010, Haifa, Israel, pages 1015–1022, 2010. [20] A. Sutti, T. Lin, and X. Wang. Shear-enhanced solution precipitation: a simple process to produce short polymeric nanofibers. Journal of nanoscience and nanotechnology, 11(10):8947–8952, 2011. [21] K. Swersky, J. Snoek, and R. P. Adams. Multi-task bayesian optimization. In Advances in Neural Information Processing Systems, pages 2004–2012, 2013. [22] C. Thornton, F. Hutter, H. H. Hoos, and K. Leyton-Brown. Auto-weka: combined selection and hyperparameter optimization of classification algorithms. In International Conference on Knowledge Discovery and Data Mining, pages 847–855, 2013. [23] R. Wagner, R. Kampmann, and P. W. Voorhees. Homogeneous Second-Phase Precipitation. Wiley Online Library, 1991. [24] Z. Wang, M. Zoghi, F. Hutter, D. Matheson, and N. de Freitas. Bayesian optimization in high dimensions via random embeddings. In International Joint Conference on Artificial Intelligence, pages 1778–1784, 2013. 10
2017
83
7,224
Uprooting and Rerooting Higher-Order Graphical Models Mark Rowland∗ University of Cambridge mr504@cam.ac.uk Adrian Weller∗ University of Cambridge and Alan Turing Institute aw665@cam.ac.uk Abstract The idea of uprooting and rerooting graphical models was introduced specifically for binary pairwise models by Weller [19] as a way to transform a model to any of a whole equivalence class of related models, such that inference on any one model yields inference results for all others. This is very helpful since inference, or relevant bounds, may be much easier to obtain or more accurate for some model in the class. Here we introduce methods to extend the approach to models with higher-order potentials and develop theoretical insights. In particular, we show that the triplet-consistent polytope TRI is unique in being ‘universally rooted’. We demonstrate empirically that rerooting can significantly improve accuracy of methods of inference for higher-order models at negligible computational cost. 1 Introduction Undirected graphical models with discrete variables are a central tool in machine learning. In this paper, we focus on three canonical tasks of inference: identifying a configuration with highest probability (termed maximum a posteriori or MAP inference), computing marginal probabilities of subsets of variables (marginal inference) and calculating the normalizing constant (partition function). All three tasks are typically computationally intractable, leading to much work to identify settings where exact polynomial-time methods apply, or to develop approximate algorithms that perform well. Weller [19] introduced an elegant method which first uproots and then reroots a given model M to any of a whole class of rerooted models {Mi}. The method relies on specific properties of binary pairwise models and makes use of an earlier construction which reduced MAP inference to the MAXCUT problem on the suspension graph ∇G (1; 2; 12; 19, see §3 for details). For many important inference tasks, the rerooted models are equivalent in the sense that results for any one model yield results for all others with negligible computational cost. This can be very helpful since various models in the class may present very different computational difficulties for inference. Here we show how the idea may be generalized to apply to models with higher-order potentials over any number of variables. Such models have many important applications, for example in computer vision [6] or modeling protein interactions [5]. As for pairwise models, we again obtain significant benefits for inference. We also develop a deeper theoretical understanding and derive important new results. We highlight the following contributions: • In §3-§4, we show how to achieve efficient uprooting and rerooting of binary graphical models with potentials of any order, while still allowing easy recovery of inference results. • In §5, to simplify the subsequent analysis, we introduce pure k-potentials for any order k, which may be of independent interest. We show that there is essentially only one pure k-potential which we call the even k-potential, and that even k-potentials form a basis for all model potentials. • In §6, we carefully analyze the effect of uprooting and rerooting on Sherali-Adams [11] relaxations Lr of the marginal polytope, for any order r. One surprising observation in §6.2 is that L3 (the ∗Authors contributed equally. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. triplet-consistent polytope or TRI) is unique in being universally rooted, in the sense that there is an affine score-preserving bijection between L3 for a model and L3 for each of its rerootings. • In §7, our empirical results demonstrate that rerooting can significantly improve accuracy of inference in higher-order models. We introduce effective heuristics to choose a helpful rerooting. Our observations have further implications for the many variational methods of marginal inference which optimize the sum of score and an entropy approximation over a Sherali-Adams polytope relaxation. These include the Bethe approximation (intimately related to belief propagation) and cluster extensions, tree-reweighted (TRW) approaches and logdet methods [12; 14; 16; 22; 24]. 1.1 Background and discussion of theoretical contributions Based on earlier connections in [2], [19] showed the remarkable result for pairwise models that the triplet-consistent polytope (L3 or TRI) is universally rooted (in the restricted sense defined in [19, Theorem 3]). This observation allowed straightforward strengthening of previously known results, for example: it was previously shown [23] that the LP relaxation on TRI (LP+TRI) is always tight for an ‘almost-balanced’ binary pairwise model, that is a model which can be rendered balanced by removing one variable [17]. Given [19, Theorem 3], this earlier result could immediately be significantly strengthened to [19, Theorem 4], which showed that LP+TRI is tight for a binary pairwise model provided only that some rerooting exists such that the rerooted model is almost balanced. Following [19], it was natural to suspect that the universal rootedness property might hold for all (or at least some) Lr, r ≥3. This would have impact on work such as [10] which examines which signed minors must be forbidden to guarantee tightness of LP+L4. If L4 were universally rooted, then it would be possible to simplify significantly the analysis in [10]. Considering this issue led to our analysis of the mappings to symmetrized uprooted polytopes given in our Theorem 17. We believe this is the natural generalization of the lower order relationships of L2 and L3 to RMET and MET described in [2], though this direction was not clear initially. With this formalism, together with the use of even potentials, we demonstrate our Theorems 20 and 21, showing that in fact TRI is unique in being universally rooted (and indeed in a stronger sense than given in [19]). We suggest that this result is surprising and may have further implications. As a consequence, it is not possible to generate some quick theoretical wins by generalizing previous results as [19] did to derive their Theorem 4, but on the other hand we observe that rerooting may be helpful in practice for any approach using a Sherali-Adams relaxation other than L3. We verify the potential for significant benefits experimentally in §7. 2 Graphical models A discrete graphical model M[G(V, E), (θE)E∈E] consists of: a hypergraph G = (V, E), which has n vertices V = {1, . . . , n} corresponding to the variables of the model, and hyperedges E ⊆P(V ), where P(V ) is the powerset of V ; together with potential functions (θE)E∈E over the hyperedges E ∈E. We consider binary random variables (Xv)v∈V with each Xv ∈Xv = {0, 1}. For a subset U ⊆V , xU ∈{0, 1}U is a configuration of those variables (Xv)v∈U. We write xU for the flipping of xU, defined by xi = 1 −xi ∀i ∈U. The joint probability mass function factors as follows, where the normalizing constant Z = P xV ∈{0,1}V exp(score(xV )) is the partition function: p(xV ) = 1 Z exp (score(xV )) , score(xV ) = X E∈E θE(xE). (1) 3 Uprooting and rerooting Our goal is to map a model M to any of a whole family of models {Mi} in such a way that inference on any Mi will allow us easily to recover inference results on the original model M. In this section we provide our mapping, then in §4 we explain how to recover inference results for M. The uprooting mechanism used by Weller [19] first reparametrizes edge potentials to the form θij(xi, xj) = −1 2Wij1[xi ̸= xj], where 1[·] is the indicator function (a reparameterization modifies 2 1 2 3 4 M = M0 1 2 3 4 0 M + 1 2 3 0 M4 = M +|X4=0 1 3 4 0 M2 = M +|X2=0 Figure 1: Left: The hypergraph G of a graphical model M over 4 variables, with potentials on the hyperedges {1, 2}, {1, 3, 4}, and {2, 4}. Center-left: The suspension hypergraph ∇G of the uprooted model M +. Centerright: The hypergraph ∇G\{4} of the rerooted model M4 = M +|X4=0, i.e. M + with X4 clamped to 0. Right: The hypergraph ∇G \ {2} of the rerooted model M2 = M +|X2=0, i.e. M + with X2 clamped to 0. potential functions such that the complete score of each configuration is unchanged, see 15 for details). Next, singleton potentials are converted to edge potentials with this same form by connecting to an added variable X0. This mechanism had been used previously to reduce MAP inference on M to MAXCUT on the converted model [1; 12], and applies specifically only to binary pairwise models. We introduce a generalized construction which applies to models with potentials of any order. We first uproot a model M to a highly symmetric uprooted model M + where an extra variable X0 is added, in such a way that the original model M is exactly M + with X0 clamped to the value 0. Since X0 is clamped to retrieve M, we may write M = M0 := M +|X0=0. Alternatively, we can choose instead to clamp a different variable Xi in M + which will lead to the rerooted model Mi := M +|Xi=0. Definition 1 (Clamping). For a graphical model M[G = (V, E), (θE)E∈E], and i ∈V , the model M|Xi=a obtained by clamping the variable Xi to the value a ∈Xi is given by: the hypergraph (V \ {i}, Ei), where Ei = {E \ {i}|E ∈E}; and potentials which are unchanged for hyperedges which do not contain i, while if i ∈E then θE\{i}(xE\{i}) = θE(xE\{i}, xi = a). Definition 2 (Uprooting, suspension hypergraph). Given a model M[G(V, E), (θE)E∈E], the uprooted model M + adds a variable X0, which is added to every hyperedge of the original model. M + has hypergraph ∇G, with vertex set V + = V ∪{0} and hyperedge set E+ = {E+ = E ∪{0}|E ∈E}. ∇G is the suspension hypergraph of G. M + has potential functions (θ+ E∪{0})E∈E given by θ+ E∪{0}(xE∪{0}) = θE(xE) if x0 = 0 θE(xE) if x0 = 1. With this definition, all uprooted potentials are symmetric in that θ+ E+(xE+) = θ+ E+(xE+) ∀E+ ∈E+. Definition 3 (Rerooting). From Definition 2, we see that given a model M, if we uproot to M + then clamp X0 = 0, we recover the original model M. If instead in M + we clamp Xi = 0 for any i = 1, . . . , n, then we obtain the rerooted model Mi := M +|Xi=0. See Figure 1 and Table 1 for examples of uprooting and rerooting. We explore the question of how to choose a good variable for rerooting (i.e. how to choose a good variable to clamp in M +) in §7. 4 Recovery of inference tasks Here we demonstrate that the partition function, MAP score and configuration, and marginal distributions for a model M, can all be recovered from its uprooted model M + or any rerooted model Mi i ∈V , with negligible computational cost. We write Vi = {0, 1, . . . , n} \ {i} for the variable set of rerooted model Mi; scorei(xVi) for the score of xVi in Mi; and pi for the probability distribution for Mi. We use superscript + to indicate the uprooted model. For example, the probability distribution for M + is given by p+(xV +) = 1 Z+ exp P E∈E+ θE(xE)  . From the definitions of §3, we obtain the following key lemma, which is critical to enable recovery of inference results. Lemma 4 (Score-preserving map). Each configuration xV of M maps to 2 configurations of the uprooted M + with the same score, i.e. from M, xV →in M +, both of (x0 = 0, xV ) and (x0 = 1, xV ) with score(xV ) = score+(x0 = 0, xV ) = score+(x0 = 1, xV ). For any i ∈V +, exactly one of the two uprooted configurations has xi = 0, and just this one will be selected in Mi. Hence, there is a score-preserving bijection between configurations of M and those of Mi: For any i ∈V + : in M, xV ↔ in Mi, (x0 = 0, xV \{i}) if xi = 0 (x0 = 1, xV \{i}) if xi = 1. (2) 3 M config M + configuration M4 config x1 x3 x4 x0 x1 x3 x4 x0 x1 x3 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 1 0 0 0 1 0 0 0 1 0 1 1 0 0 1 1 1 0 0 0 1 0 0 0 1 0 1 0 1 0 1 0 1 1 1 0 0 1 1 0 0 1 1 1 1 1 0 1 1 1 1 0 0 0 1 0 0 1 0 0 1 1 0 1 0 1 0 1 1 0 1 1 1 1 0 0 1 1 0 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 Table 1: An illustration of how scores of potential θ134 on hyperedge {1, 3, 4} in an original model M map to potential θ0134 in M + and then to θ013 in M4. See Figure 1 for the hypergraphs. Each color indicates a value of θ134(x1, x3, x4) for a different configuration (x1, x3, x4). Note that M + has 2 rows of each color, while after rerooting to M4, we again have exactly one row of each color. The 1-1 score preserving map between configurations of M and any Mi is critical to enable recovery of inference results; see Lemma 4. Table 1 illustrates this perhaps surprising result, from which the next two propositions follow. Proposition 5 (Recovering the partition function). Given a model M[G(V, E), (θE)E∈E] with partition function Z as in (1), the partition function Z+ of the uprooted model M + is twice Z, and the partition function of each rerooted model Mi is exactly Z, for any i ∈V . Proposition 6 (Recovering a MAP configuration). From M +: xV is an arg max for p iff (x0 = 0, xV ) is an arg max for p+ iff (x0 = 1, xV ) is an arg max for p+. From a rerooted model Mi: (xV \{i}, xi = 0) is an arg max for p iff (x0 = 0, xV \{i}) is an arg max for pi; (xV \{i}, xi = 1) is an arg max for p iff (x0 = 1, xV \{i}) is an arg max for pi. We can recover marginals as shown in the following proposition, proof in the Appendix §9.1. Proposition 7 (Recovering marginals). For a subset ∅̸= U ⊆V , we can recover from M +: p(xU) = p+(x0 = 0, xU) + p+(x0 = 1, xU) = 2p+(x0 = 0, xU) = 2p+(x0 = 1, xU). To recover from a rerooted Mi: (i) For any i ∈V \ U, p(xU) = pi(x0 = 0, xU) + pi(x0 = 1, xU). (ii) For any i ∈U, p(xU) = pi(x0 = 0, xU\{i}) xi = 0 pi(x0 = 1, xU\{i}) xi = 1. In §6, we provide a careful analysis of the impact of uprooting and rerooting on the Sherali-Adams hierarchy of relaxations of the marginal polytope [11]. We first introduce a way to parametrize potentials which will be particularly useful, and which may be of independent interest. 5 Pure k-potentials We introduce the notion of pure k-potentials. These allow the specification of interactions which act ‘purely’ over a set of variables of a given size k, without influencing the distribution of any subsets. We show that in fact, there is essentially only one pure k-potential. Further, we show that one can express any θE potential in terms of pure potentials over E and subsets of E, and that pure potentials have appealing properties when uprooted and rerooted which help our subsequent analysis. We say that a potential is a k-potential if k is the smallest number such that the score of the potential may be determined by considering the configuration of k variables. Usually a potential θE is a k-potential with k = |E|. For example, typically a singleton potential is a 1-potential, and an edge potential is a 2-potential. However, note that k < |E| is possible if one or more variables in E are not needed to establish the score (a simple example is θ12(x1, x2) = x1, which clearly is a 1-potential). 4 In general, a k-potential will affect the marginal distributions of all subsets of the k variables. For example, one popular form of 2-potential is θij(xi, xj) = Wijxixj, which tends to pull Xi and Xj toward the same value, but also tends to increase each of p(Xi = 1) and p(Xj = 1). For pairwise models, a different reparameterization of potentials instead writes the score as score(xV ) = X i∈V θixi + 1 2 X (i,j)∈E Wij1[xi = xj]. (3) Expression (3) has the desirable feature that the θij(xi, xj) = 1 2Wij1[xi = xj] edge potentials affect only the pairwise marginals, without disturbing singleton marginals. This motivates the following definition. Definition 8. Let k ≥2, and let U be a set of size k. We say that a k-potential θU : {0, 1}U →R is a pure k-potential if the distribution induced by the potential, p(xU) ∝exp(θU(xU)), has the property that for any ∅̸= W ⊊U, the marginal distribution p(xW ) is uniform. We shall see in Proposition 10 that a pure k-potential must essentially be an even k-potential. Definition 9. Let k ∈N, and |U| = k. An even k-potential is a k-potential θU : {0, 1}U →R of the form θU(xU) = a1[ |{i ∈U|xi = 1}| is even], for some a ∈R which is its coefficient. In words, θU(xU) takes value a if xU has an even number of 1s, else it takes value 0. As an example, the 2-potential θij(xi, xj) = 1 2Wij1[xi = xj] in (3) is an even 2-potential with U = {i, j} and coefficient Wij/2. The next two propositions are proved in the Appendix §9.2. Proposition 10 (All pure potentials are essentially even potentials). Let k ≥2, and |U| = k. If θU :{0, 1}U →R is a pure k-potential then θU must be an affine function of the even k-potential, i.e. ∃a, b ∈R s.t. θU(xU) = a1[ |{i ∈U|xi = 1}| is even] + b. Proposition 11 (Even k-potentials form a basis). For a finite set U, the set of even k-potentials 1[ |{i ∈W|Xi = 1}| is even]  W ⊆U, indexed by subsets W ⊆U, forms a basis for the vector space of all potential functions θ : {0, 1}U →R. Any constant in a potential will be absorbed into the partition function Z and does not affect the probability distribution, see (1). An even 2-potential with positive coefficient, e.g. as in (3) if Wij > 0, is supermodular. Models with only supermodular potentials (equivalently, submodular cost functions) typically admit easier inference [3; 7]; if such a model is binary pairwise then it is called attractive. However, for k > 2, even k-potentials θE are neither supermodular nor submodular. Yet if k is an even number, observe that θE(xE) = θE(xE). We discuss this further in Appendix §10.4. When a k-potential is uprooted, in general it may become a (k + 1)-potential (recall Definition 2). The following property of even k-potentials is helpful for our analysis in §6, and is easily checked. Lemma 12 (Uprooting an even k-potential). When an even k-potential θE with |E| = k is uprooted: if k is an even number, then the uprooted potential is exactly the same even k-potential; if k is odd, then we obtain the even (k + 1)-potential over E ∪{0} with the same coefficient as the original θE. 6 Marginal polytope and Sherali-Adams relaxations We saw in Lemma 4 that there is a score-preserving 1-2 mapping from configurations of M to those of M +, and a bijection between configurations of M and any Mi. Here we examine the extent to which these score-preserving mappings extend to (pseudo-)marginal probability distributions over variables by considering the Sherali-Adams relaxations [11] of the respective marginal polytopes. These relaxations feature prominently in many approaches for MAP and marginal inference. For U ⊆V , we write µU for a probability distribution in P({0, 1}U), the set of all probability distributions on {0, 1}U. Bold µ will represent a collection of measures over various subsets of variables. Given (1), to compute an expected score, we need (µE)E∈E. This motivates the following. Definition 13. The marginal polytope M(G(V, E)) = {(µE)E∈E ∃µV s.t. µV E = µE ∀E ∈E}, where for U1 ⊆U2 ⊆V , µU2↓U1 denotes the marginalization of µU2 ∈P({0, 1}U2) onto {0, 1}U1. M(G) consists of marginal distributions for every hyperedge E ∈E such that all the marginals are consistent with a global distribution over all variables V . Methods of variational inference typically 5 optimize either the score (for MAP inference) or the score plus an entropy term (for marginal inference) over a relaxation of the marginal polytope [15]. This is because M(G) is computationally intractable, with an exponential number of facets [2]. Relaxations from the Sherali-Adams hierarchy [11] are often used, requiring consistency only over smaller clusters of variables. Definition 14. Given an integer r ≥2, if a hypergraph G(V, E) satisfies maxE∈E |E| ≤r ≤|V |, then we say that G is r-admissible, and define the Sherali-Adams polytope of order r on G by Lr(G) =  (µE)E∈E ∃(µU) U⊆V |U|=r locally consistent, s.t. µU↓E = µE ∀E ⊆U ⊆V, |U| = r  , where a collection of measures (µA)A∈I (for some set I of subsets of V ) is locally consistent, or l.c., if for any A1, A2 ∈I, we have µA1↓A1∩A2 = µA2↓A1∩A2. Each element of Lr(G) is a set of locally consistent probability measures over the hyperedges. Note that M(G) ⊆Lr(G) ⊆Lr−1(G). The pairwise relaxation L2(G) is commonly used but higher-order relaxations achieve greater accuracy, have received significant attention [10; 13; 18; 22; 23], and are required for higher-order potentials. 6.1 The impact of uprooting and rerooting on Sherali-Adams polytopes We introduce two variants of the Sherali-Adams polytopes which will be helpful in analyzing uprooted models. For a measure µU ∈P({0, 1}U), we define the flipped measure µU as µU(xU) = µU(xU) ∀xU ∈{0, 1}U. A measure µU is flipping-invariant if µU = µU. Definition 15. The symmetrized Sherali-Adams polytopes for an uprooted hypergraph ∇G(V +, E+) (as given in Definition 2), is: eLr(∇G) =  (µE)E∈E+ ∈Lr(∇G) µE = µE ∀E ∈E+  . Definition 16. For any i ∈V +, and any integer r ≥2 such that maxE∈E+ |E| ≤r ≤|V +|, we define the symmetrized Sherali-Adams polytope of order r uprooted at i to be eLi r(∇G) =  (µE)E∈E+ ∃(µU)i∈U⊆V + |U|=r l.c., s.t. µU↓E = µE ∀E ⊆U ⊆V, |U| = r, i ∈U µU = µU ∀U ⊆V, |U| = r, i ∈U  . Thus, for each collection of measures over hyperedges in eLi r(∇G), there exist corresponding flippinginvariant, locally consistent measures on sets of size r which contain i (and their subsets). Note that for any hypergraph G(V, E) and any i ∈V +, we have eLr+1(∇G) ⊆eLi r+1(∇G) ⊆eLr(∇G). We next extend the correspondence of Lemma 4 to collections of locally-consistent probability distributions on the hyperedges of G, see the Appendix §9.3 for proof. Theorem 17. For a hypergraph G(V, E), and integer r such that maxE∈E |E| ≤r ≤|V |, there is an affine score-preserving bijection Lr(G) Uproot ⇄ RootAt0 eL0 r+1(∇G) . Theorem 17 establishes the following diagram of polytope inclusions and affine bijections: For M = M0 : Lr+1(G) ⊆ Unnamed ⊆ Lr(G) Uproot y xRootAt0 Uproot y xRootAt0 Uproot y xRootAt0 For M + : eL0 r+2(∇G) ⊆ eLr+1(∇G) ⊆ eL0 r+1(∇G) . (4) A question of theoretical interest and practical importance is which of the inclusions in (4) are strict. Our perspective here generalizes earlier work. Using different language, Deza and Laurent [2] identified L2(G) with eL0 3(∇G), which was termed RMET, the rooted semimetric polytope; and eL3(∇G) with MET, the semimetric polytope. Building on this, Weller [19] considered L3(G), the triplet-consistent polytope or TRI, though only in the context of pairwise potentials, and showed that L3(G) has the remarkable property that if it is used to optimize an LP for a model M on G, the exact same optimum is achieved for L3(Gi) for any rerooting Mi. It was natural to conjecture that Lr(G) might have this same property for all r > 3, yet this was left as an open question. 6 6.2 L3 is unique in being universally rooted We shall first strengthen [19] to show that L3 is universally rooted in the following stronger sense. Definition 18. We say that the rth-order Sherali-Adams relaxation is universally rooted (and write “Lr is universally rooted” for short) if for all admissible hypergraphs G, there is an affine scorepreserving bijection between Lr(G) and Lr(Gi), for each rerooted hypergraph (Gi)i∈V . If Lr is universally rooted, this applies for potentials over up to r variables (the maximum which makes sense in this context), and clearly it implies that optimizing score over any rerooting (as in MAP inference) will attain the same objective. The following result is proved in the Appendix §9.3. Lemma 19. If Lr is universally rooted for hypergraphs of maximum hyperedge degree p < r with p even, then Lr is also universally rooted for r-admissible hypergraphs with maximum degree p + 1. The proof relies on mapping to the symmetrized uprooted polytope eL0 r+1(∇G). Then by considering marginals using a basis equivalent to that described in Proposition 11 for even k-potentials, we observe that the symmetry of the polytope enforces only one possible marginal for (p + 1)-clusters. Combining Lemma 19 with arguments which extend those used by [19] demonstrates the following result, proved in the Appendix. Theorem 20. L3 is universally rooted. We next provide a striking and rather surprising result, see the Appendix for proof and details. Theorem 21. L3 is unique in being universally rooted. Specifically, for any integer r > 1 other than r = 3, we constructively demonstrate a hypergraph G(V, E) with |V | = r + 1 variables for which eL0 r+1(∇G) ̸= eLi r+1(∇G) for any i ∈V . Theorem 21 examines eL0 r+1(∇G) and eLi r+1(∇G), which by Theorem 17 are the uprooted equivalents of Lr(G) and Lr(Gi). It might appear more satisfying to try to demonstrate the result directly for the rooted polytopes, i.e. to show Lr(G) ̸= Lr(Gi). However, in general the rooted polytopes are not comparable: an r-potential in M can map to an (r + 1)-potential in M + and then to an (r + 1)-potential in Mi which cannot be evaluated for an Lr polytope. Theorem 21 shows that we may hope for benefits from rerooting for any inference method based on a Sherali-Adams relaxed polytope Lr, unless r = 3. 7 Experiments Here we show empirically the benefits of uprooting and rerooting for approximate inference methods in models with higher-order potentials. We introduce an efficient heuristic which can be used in practice to select a variable for rerooting, and demonstrate its effectiveness. We compared performance after different rerootings of marginal inference (to guarantee convergence we used the double loop method of Heskes et al. [4], which relates to generalized belief propagation, 24) and MAP inference (using loopy belief propagation, LBP [9]). For true values, we used the junction tree algorithm. All methods were implemented using libDAI [8]. We ran experiments on complete hypergraphs (with 8 variables) and toroidal grid models (5 × 5 variables). Potentials up to order 4 were selected randomly, by drawing even k-potentials from Unif([−Wmax, Wmax]) distributions for a variety of Wmax parameters, as shown in Figure 2, which highlights results for estimating log Z. For each regime of maximum potential values, we plot results averaged over 20 runs. For additional details and results, including marginals, other potential choices and larger models, see Appendix §10. We display average error of the inference method applied to: the original model M; the uprooted model M +; then rerootings at: the worst variable, the best variable, the K heuristic variable, and the G heuristic variable. Best and worst always refer to the variable at which rerooting gave with hindsight the best and worst error for the partition function (even in plots for other measures). 7 7.1 Heuristics to pick a good variable for rerooting From our Definition 3, a rerooted model Mi is obtained by clamping the uprooted model M + at variable Xi. Hence, selecting a good variable for rerooting is exactly the choice of a good variable to clamp in M +. Considering pairwise models, Weller [19] refined the maxW method [20; 21] to introduce the maxtW heuristic, and showed that it was very effective empirically. maxtW selects the variable Xi with max P j∈N (i) tanh | Wij 4 |, where N(i) is the set of neighbors of i in the model graph, and Wij is the strength of the pairwise interaction. The intuition for maxtW is as follows. Pairwise methods of approximate inference such as Bethe are exact for models with no cycles. If we could, we would like to ‘break’ tight cycles with strong edge weights, since these lead to error. When a variable is clamped, it is effectively removed from the model. Hence, we would like to reroot at a variable that sits on many cycles with strong edge weights. Identifying such cycles is NP-hard, but the maxtW heuristic attempts to do this by looking only locally around each variable. Further, the effect of a strong edge weight saturates [21]: a very strong edge weight Wij effectively ‘locks’ its end variables (either together or opposite depending on the sign of Wij), and this effect cannot be significantly increased even by an extremely strong edge. Hence the tanh function was introduced to the earlier maxW method, leading to the maxtW heuristic. As observed in §5, if we express our model potentials in terms of pure k-potentials, then the uprooted model will only have pure k-potentials for various values of k which are even numbers. Intuitively, the higher the coefficients on these potentials, the more tightly connected is the model leading to more challenging inference. Hence, a natural way to generalize the maxtW approach to handle higher-order potentials is to pick a variable Xi in M + which maximizes the following measure: clamp-heuristic-measure(i) = X i∈E:|E|=2 c2 tanh |t2aE| + X i∈E:|E|=4 c4 tanh |t4aE|, (5) where aE is the coefficient (weight) of the relevant pure k-potential, see Definition 9, and the {c2, t2}, {c4, t4} terms are constants for pure 2-potentials and for pure 4-potentials respectively. This approach extends to potentials of higher orders by adding similar further terms. Since our goal is to rank the measures for each i ∈V +, without loss of generality we take c2 = 1. We fit the t2, c4 and t4 constants to the data from our experimental runs, see the Appendix for details. Our K heuristic was fit only to runs for complete hypergraphs while the G heuristic was fit only to runs for models on grids. 7.2 Observations on results Considering all results across models and approximate methods for estimating log Z, marginals and MAP inference (see Figure 2 and Appendix §10.3), we make the following observations. Both K and G heuristics perform well (in and out of sample): they never hurt materially and often significantly improve accuracy, attaining results close to the best possible rerooting. Since our two heuristics achieve similar performance, sensitivity to the exact constants in (5) appears low. We verified this by comparing to maxtW for pairwise models as in [19]: both K and G heuristics performed just slightly better than maxtW. For all our runs, inference on rerooted models took similar time as on the original model (time required to reroot and later to map back inference results is negligible), see §10.3.1. Observe that stronger 1-potentials tend to make inference easier, pulling each variable toward a specific setting, and reducing the benefits from rerooting (left column of Figure 2). Stronger pure k-potentials for k > 1 intertwine variables more tightly: this typically makes inference harder and increases the gains in accuracy from rerooting. The pure k-potential perspective facilitates this analysis. When we examine larger models, or models with still higher order potentials, we observe qualitatively similar results, see Appendix §10.3.4 and 10.3.6. 8 Conclusion We introduced methods which broaden the application of the uprooting and rerooting approach to binary models with higher-order potentials of any order. We demonstrated several important theoretical insights, including Theorems 20 and 21 which show that L3 is unique in being universally rooted. We developed the helpful tool of even k-potentials in §5, which may be of independent 8 Average abs(error) in log Z for K8 complete hypergraphs (fully connected) on 8 variables. Average abs(error) in log Z for Grids on 5 × 5 variables (toroidal). Legends are consistent across all plots. vary Wmax for 1-pots vary Wmax for 2-pots vary Wmax for 3-pots vary Wmax for 4-pots Figure 2: Error in estimating log Z for random models with various pure k-potentials over 20 runs. If not shown, Wmax max coefficients for pure k-potentials are 0 for k = 1, 8 for k = 2, 0 for k = 3, 8 for k = 4. Where the red K heuristic curve is not visible, it coincides with the green G heuristic. Both K and G heuristics for selecting a rerooting work well: they never hurt and often yield large benefits. See §7 for details. interest. We empirically demonstrated significant benefits for rerooting in higher-order models – particularly for the hard case of strong cluster potentials and weak 1-potentials – and provided an efficient heuristic to select a variable for rerooting. This heuristic is also useful to indicate when rerooting is unlikely to be helpful for a given model (if (5) is maximized by taking i = 0). It is natural to compare the effect of rerooting M to Mi, against simply clamping Xi in the original model M. A key difference is that rerooting achieves the clamping at Xi for negligible computational cost. In contrast, if Xi is clamped in the original model then the inference method will have to be run twice: once clamping Xi = 0, and once clamping Xi = 1, then results must be combined. This is avoided with rerooting given the symmetry of M +. Rerooting effectively replaces what may be a poor initial implicit choice of clamping at X0 with a carefully selected choice of clamping variable almost for free. This is true even for large models where it may be advantageous to clamp a series of variables: by rerooting, one of the series is obtained for free, potentially gaining significant benefit with little work required. Note that each separate connected component may be handled independently, with its own added variable. This could be useful for (repeatedly) composing clamping and then rerooting each separated component to obtain an almost free clamping in each. Acknowledgements We thank Aldo Pacchiano for helpful discussions, and the anonymous reviewers for helpful comments. MR acknowledges support by the UK Engineering and Physical Sciences Research Council (EPSRC) grant EP/L016516/1 for the University of Cambridge Centre for Doctoral Training, the Cambridge Centre for Analysis. AW acknowledges support by the Alan Turing Institute under the EPSRC grant EP/N510129/1, and by the Leverhulme Trust via the CFI. References [1] F. Barahona, M. Grötschel, M. Jünger, and G. Reinelt. An application of combinatorial optimization to statistical physics and circuit layout design. Operations Research, 36(3):493–513, 1988. [2] M. Deza and M. Laurent. Geometry of Cuts and Metrics. Springer Publishing Company, Incorporated, 1st edition, 1997. ISBN 978-3-642-04294-2. [3] J. Djolonga and A. Krause. Scalable variational inference in log-supermodular models. In ICML, pages 1804–1813, 2015. [4] T. Heskes, K. Albers, and B. Kappen. Approximate inference and constrained optimization. In UAI, pages 313–320, 2003. 9 [5] A. Jaimovich, G. Elidan, H. Margalit, and N. Friedman. Towards an integrated protein–protein interaction network: A relational Markov network approach. Journal of Computational Biology, 13(2):145–164, 2006. [6] P. Kohli, L. Ladicky, and P. Torr. Robust higher order potentials for enforcing label consistency. International Journal of Computer Vision, 82(3):302–324, 2009. [7] V. Kolmogorov, J. Thapper, and S. Živný. The power of linear programming for general-valued CSPs. SIAM Journal on Computing, 44(1):1–36, 2015. [8] J. Mooij. libDAI: A free and open source C++ library for discrete approximate inference in graphical models. Journal of Machine Learning Research, 11:2169–2173, August 2010. URL http://www.jmlr. org/papers/volume11/mooij10a/mooij10a.pdf. [9] J. Pearl. Probabilistic Reasoning in Intelligent Systems: Networks of Plausible Inference. Morgan Kaufmann, 1988. [10] M. Rowland, A. Pacchiano, and A. Weller. Conditions beyond treewidth for tightness of higher-order LP relaxations. In Artifical Intelligence and Statistics (AISTATS), 2017. [11] H. Sherali and W. Adams. A hierarchy of relaxations between the continuous and convex hull representations for zero-one programming problems. SIAM Journal on Discrete Mathematics, 3(3):411–430, 1990. [12] D. Sontag. Cutting plane algorithms for variational inference in graphical models. Master’s thesis, MIT, EECS, 2007. [13] D. Sontag and T. Jaakkola. New outer bounds on the marginal polytope. In NIPS, 2007. [14] M. Wainwright and M. Jordan. Log-determinant relaxation for approximate inference in discrete Markov random fields. IEEE Transactions on Signal Processing, 2006. [15] M. Wainwright and M. Jordan. Graphical models, exponential families and variational inference. Foundations and Trends in Machine Learning, 1(1-2):1–305, 2008. [16] M. Wainwright, T. Jaakkola, and A. Willsky. A new class of upper bounds on the log partition function. IEEE Transactions on Information Theory, 51(7):2313–2335, 2005. [17] A. Weller. Revisiting the limits of MAP inference by MWSS on perfect graphs. In AISTATS, 2015. [18] A. Weller. Characterizing tightness of LP relaxations by forbidding signed minors. In UAI, 2016. [19] A. Weller. Uprooting and rerooting graphical models. In International Conference on Machine Learning (ICML), 2016. [20] A. Weller and J. Domke. Clamping improves TRW and mean field approximations. In Artificial Intelligence and Statistics (AISTATS), 2016. [21] A. Weller and T. Jebara. Clamping variables and approximate inference. In Neural Information Processing Systems (NIPS), 2014. [22] A. Weller, K. Tang, D. Sontag, and T. Jebara. Understanding the Bethe approximation: When and how can it go wrong? In Uncertainty in Artificial Intelligence (UAI), 2014. [23] A. Weller, M. Rowland, and D. Sontag. Tightness of LP relaxations for almost balanced models. In Artificial Intelligence and Statistics (AISTATS), 2016. [24] J. Yedidia, W. Freeman, and Y. Weiss. Constructing free-energy approximations and generalized belief propagation algorithms. IEEE Trans. Information Theory, pages 2282–2312, 2005. 10
2017
84
7,225
Learned in Translation: Contextualized Word Vectors Bryan McCann bmccann@salesforce.com James Bradbury james.bradbury@salesforce.com Caiming Xiong cxiong@salesforce.com Richard Socher rsocher@salesforce.com Abstract Computer vision has benefited from initializing multiple deep layers with weights pretrained on large supervised training sets like ImageNet. Natural language processing (NLP) typically sees initialization of only the lowest layer of deep models with pretrained word vectors. In this paper, we use a deep LSTM encoder from an attentional sequence-to-sequence model trained for machine translation (MT) to contextualize word vectors. We show that adding these context vectors (CoVe) improves performance over using only unsupervised word and character vectors on a wide variety of common NLP tasks: sentiment analysis (SST, IMDb), question classification (TREC), entailment (SNLI), and question answering (SQuAD). For fine-grained sentiment analysis and entailment, CoVe improves performance of our baseline models to the state of the art. 1 Introduction Significant gains have been made through transfer and multi-task learning between synergistic tasks. In many cases, these synergies can be exploited by architectures that rely on similar components. In computer vision, convolutional neural networks (CNNs) pretrained on ImageNet [Krizhevsky et al., 2012, Deng et al., 2009] have become the de facto initialization for more complex and deeper models. This initialization improves accuracy on other related tasks such as visual question answering [Xiong et al., 2016] or image captioning [Lu et al., 2016, Socher et al., 2014]. In NLP, distributed representations pretrained with models like Word2Vec [Mikolov et al., 2013] and GloVe [Pennington et al., 2014] have become common initializations for the word vectors of deep learning models. Transferring information from large amounts of unlabeled training data in the form of word vectors has shown to improve performance over random word vector initialization on a variety of downstream tasks, e.g. part-of-speech tagging [Collobert et al., 2011], named entity recognition [Pennington et al., 2014], and question answering [Xiong et al., 2017]; however, words rarely appear in isolation. The ability to share a common representation of words in the context of sentences that include them could further improve transfer learning in NLP. Inspired by the successful transfer of CNNs trained on ImageNet to other tasks in computer vision, we focus on training an encoder for a large NLP task and transferring that encoder to other tasks in NLP. Machine translation (MT) requires a model to encode words in context so as to decode them into another language, and attentional sequence-to-sequence models for MT often contain an LSTM-based encoder, which is a common component in other NLP models. We hypothesize that MT data in general holds potential comparable to that of ImageNet as a cornerstone for reusable models. This makes an MT-LSTM pairing in NLP a natural candidate for mirroring the ImageNet-CNN pairing of computer vision. As depicted in Figure 1, we begin by training LSTM encoders on several machine translation datasets, and we show that these encoders can be used to improve performance of models trained for other 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. E n c o d e r a ) b ) E n c o d e r E n c o d e r W o r d V e c t o r s W o r d V e c t o r s T a s k - s p e c i f i c M o d e l D e c o d e r T r a n s l a t i o n W o r d V e c t o r s Figure 1: We a) train a two-layer, bidirectional LSTM as the encoder of an attentional sequence-tosequence model for machine translation and b) use it to provide context for other NLP models. tasks in NLP. In order to test the transferability of these encoders, we develop a common architecture for a variety of classification tasks, and we modify the Dynamic Coattention Network for question answering [Xiong et al., 2017]. We append the outputs of the MT-LSTMs, which we call context vectors (CoVe), to the word vectors typically used as inputs to these models. This approach improved the performance of models for downstream tasks over that of baseline models using pretrained word vectors alone. For the Stanford Sentiment Treebank (SST) and the Stanford Natural Language Inference Corpus (SNLI), CoVe pushes performance of our baseline model to the state of the art. Experiments reveal that the quantity of training data used to train the MT-LSTM is positively correlated with performance on downstream tasks. This is yet another advantage of relying on MT, as data for MT is more abundant than for most other supervised NLP tasks, and it suggests that higher quality MT-LSTMs carry over more useful information. This reinforces the idea that machine translation is a good candidate task for further research into models that possess a stronger sense of natural language understanding. 2 Related Work Transfer Learning. Transfer learning, or domain adaptation, has been applied in a variety of areas where researchers identified synergistic relationships between independently collected datasets. Saenko et al. [2010] adapt object recognition models developed for one visual domain to new imaging conditions by learning a transformation that minimizes domain-induced changes in the feature distribution. Zhu et al. [2011] use matrix factorization to incorporate textual information into tagged images to enhance image classification. In natural language processing (NLP), Collobert et al. [2011] leverage representations learned from unsupervised learning to improve performance on supervised tasks like named entity recognition, part-of-speech tagging, and chunking. Recent work in NLP has continued in this direction by using pretrained word representations to improve models for entailment [Bowman et al., 2014], sentiment analysis [Socher et al., 2013], summarization [Nallapati et al., 2016], and question answering [Seo et al., 2017, Xiong et al., 2017]. Ramachandran et al. [2016] propose initializing sequence-to-sequence models with pretrained language models and fine-tuning for a specific task. Kiros et al. [2015] propose an unsupervised method for training an encoder that outputs sentence vectors that are predictive of surrounding sentences. We also propose a method of transferring higher-level representations than word vectors, but we use a supervised method to train our sentence encoder and show that it improves models for text classification and question answering without fine-tuning. Neural Machine Translation. Our source domain of transfer learning is machine translation, a task that has seen marked improvements in recent years with the advance of neural machine translation (NMT) models. Sutskever et al. [2014] investigate sequence-to-sequence models that consist of a neural network encoder and decoder for machine translation. Bahdanau et al. [2015] propose the augmenting sequence to sequence models with an attention mechanism that gives the decoder access to the encoder representations of the input sequence at each step of sequence generation. Luong et al. [2015] further study the effectiveness of various attention mechanisms with respect to machine translation. Attention mechanisms have also been successfully applied to NLP tasks like entailment [Conneau et al., 2017], summarization [Nallapati et al., 2016], question answering [Seo et al., 2017, Xiong et al., 2017, Min et al., 2017], and semantic parsing [Dong and Lapata, 2016]. We show that attentional encoders trained for NMT transfer well to other NLP tasks. 2 Transfer Learning and Machine Translation. Machine translation is a suitable source domain for transfer learning because the task, by nature, requires the model to faithfully reproduce a sentence in the target language without losing information in the source language sentence. Moreover, there is an abundance of machine translation data that can be used for transfer learning. Hill et al. [2016] study the effect of transferring from a variety of source domains to the semantic similarity tasks in Agirre et al. [2014]. Hill et al. [2017] further demonstrate that fixed-length representations obtained from NMT encoders outperform those obtained from monolingual (e.g. language modeling) encoders on semantic similarity tasks. Unlike previous work, we do not transfer from fixed length representations produced by NMT encoders. Instead, we transfer representations for each token in the input sequence. Our approach makes the transfer of the trained encoder more directly compatible with subsequent LSTMs, attention mechanisms, and, in general, layers that expect input sequences. This additionally facilitates the transfer of sequential dependencies between encoder states. Transfer Learning in Computer Vision. Since the success of CNNs on the ImageNet challenge, a number of approaches to computer vision tasks have relied on pretrained CNNs as off-the-shelf feature extractors. Girshick et al. [2014] show that using a pretrained CNN to extract features from region proposals improves object detection and semantic segmentation models. Qi et al. [2016] propose a CNN-based object tracking framework, which uses hierarchical features from a pretrained CNN (VGG-19 by Simonyan and Zisserman [2014]). For image captioning, Lu et al. [2016] train a visual sentinel with a pretrained CNN and fine-tune the model with a smaller learning rate. For VQA, Fukui et al. [2016] propose to combine text representations with visual representations extracted by a pretrained residual network [He et al., 2016]. Although model transfer has seen widespread success in computer vision, transfer learning beyond pretrained word vectors is far less pervasive in NLP. 3 Machine Translation Model We begin by training an attentional sequence-to-sequence model for English-to-German translation based on Klein et al. [2017] with the goal of transferring the encoder to other tasks. For training, we are given a sequence of words in the source language wx = [wx 1, . . . , wx n] and a sequence of words in the target language wz = [wz 1, . . . , wz m]. Let GloVe(wx) be a sequence of GloVe vectors corresponding to the words in wx, and let z be a sequence of randomly initialized word vectors corresponding to the words in wz. We feed GloVe(wx) to a standard, two-layer, bidirectional, long short-term memory network 1 [Graves and Schmidhuber, 2005] that we refer to as an MT-LSTM to indicate that it is this same two-layer BiLSTM that we later transfer as a pretrained encoder. The MT-LSTM is used to compute a sequence of hidden states h = MT-LSTM(GloVe(wx)). (1) For machine translation, the MT-LSTM supplies the context for an attentional decoder that produces a distribution over output words p( ˆwz t |H, wz 1, . . . , wz t−1) at each time-step. At time-step t, the decoder first uses a two-layer, unidirectional LSTM to produce a hidden state hdec t based on the previous target embedding zt−1 and a context-adjusted hidden state ˜ht−1: hdec t = LSTM  [zt−1; ˜ht−1], hdec t−1  . (2) The decoder then computes a vector of attention weights α representing the relevance of each encoding time-step to the current decoder state. αt = softmax H(W1hdec t + b1)  (3) where H refers to the elements of h stacked along the time dimension. 1 Since there are several biLSTM variants, we define ours as follows. Let h = [h1, . . . , hn] = biLSTM (x) represent the output sequence of our biLSTM operating on an input sequence x. Then a forward LSTM computes h→ t = LSTM (xt, h→ t−1) for each time step, and a backward LSTM computes h← t = LSTM (xt, h← t+1). The final outputs of the biLSTM for each time step are ht = [h→ t ; h← t ]. 3 The decoder then uses these weights as coefficients in an attentional sum that is concatenated with the decoder state and passed through a tanh layer to form the context-adjusted hidden state ˜h: ˜ht =  tanh W2H⊤αt + b2; hdec t  (4) The distribution over output words is generated by a final transformation of the context-adjusted hidden state: p( ˆwz t |X, wz 1, . . . , wz t−1) = softmax  Wout˜ht + bout  . 4 Context Vectors (CoVe) We transfer what is learned by the MT-LSTM to downstream tasks by treating the outputs of the MT-LSTM as context vectors. If w is a sequence of words and GloVe(w) the corresponding sequence of word vectors produced by the GloVe model, then CoVe(w) = MT-LSTM(GloVe(w)) (5) is the sequence of context vectors produced by the MT-LSTM. For classification and question answering, for an input sequence w, we concatenate each vector in GloVe(w) with its corresponding vector in CoVe(w) ˜w = [GloVe(w); CoVe(w)] (6) as depicted in Figure 1b. 5 Classification with CoVe We now describe a general biattentive classification network (BCN) we use to test how well CoVe transfer to other tasks. This model, shown in Figure 2, is designed to handle both single-sentence and two-sentence classification tasks. In the case of single-sentence tasks, the input sequence is duplicated to form two sequences, so we will assume two input sequences for the rest of this section. E n c o d e r E n c o d e r B i a t t e n t i o n M a x o u t N e t w o r k I n t e g r a t e P o o l I n t e g r a t e P o o l R e L U N e t w o r k R e L U N e t w o r k Figure 2: Our BCN uses a feedforward network with ReLU activation and biLSTM encoder to create task-specific representations of each input sequence. Biattention conditions each representation on the other, a biLSTM integrates the conditional information, and a maxout network uses pooled features to compute a distribution over possible classes. Input sequences wx and wy are converted to sequences of vectors, ˜wx and ˜wy, as described in Eq. 6 before being fed to the task-specific portion of the model (Figure 1b). A function f applies a feedforward network with ReLU activation [Nair and Hinton, 2010] to each element of ˜wx and ˜wy, and a bidirectional LSTM processes the resulting sequences to obtain task specific representations, x = biLSTM (f( ˜wx)) (7) y = biLSTM (f( ˜wy)) (8) These sequences are each stacked along the time axis to get matrices X and Y . In order to compute representations that are interdependent, we use a biattention mechanism [Seo et al., 2017, Xiong et al., 2017]. The biattention first computes an affinity matrix A = XY ⊤. It then extracts attention weights with column-wise normalization: Ax = softmax (A) Ay = softmax A⊤ (9) which amounts to a novel form of self-attention when x = y. Next, it uses context summaries Cx = A⊤ x X Cy = A⊤ y Y (10) to condition each sequence on the other. 4 We integrate the conditioning information into our representations for each sequence with two separate one-layer, bidirectional LSTMs that operate on the concatenation of the original representations (to ensure no information is lost in conditioning), their differences from the context summaries (to explicitly capture the difference from the original signals), and the element-wise products between originals and context summaries (to amplify or dampen the original signals). X|y = biLSTM ([X; X −Cy; X ⊙Cy]) (11) Y|x = biLSTM ([Y ; Y −Cx; Y ⊙Cx]) (12) The outputs of the bidirectional LSTMs are aggregated by pooling along the time dimension. Max and mean pooling have been used in other models to extract features, but we have found that adding both min pooling and self-attentive pooling can aid in some tasks. Each captures a different perspective on the conditioned sequences. The self-attentive pooling computes weights for each time step of the sequence βx = softmax X|yv1 + d1  βy = softmax Y|xv2 + d2  (13) and uses these weights to get weighted summations of each sequence: xself = X⊤ |yβx yself = Y ⊤ |x βy (14) The pooled representations are combined to get one joined representation for all inputs. xpool =  max(X|y); mean(X|y); min(X|y); xself  (15) ypool =  max(Y|x); mean(Y|x); min(Y|x); yself  (16) We feed this joined representation through a three-layer, batch-normalized [Ioffe and Szegedy, 2015] maxout network [Goodfellow et al., 2013] to produce a probability distribution over possible classes. 6 Question Answering with CoVe For question answering, we obtain sequences x and y just as we do in Eq. 7 and Eq. 8 for classification, except that the function f is replaced with a function g that uses a tanh activation instead of a ReLU activation. In this case, one of the sequences is the document and the other the question in the question-document pair. These sequences are then fed through the coattention and dynamic decoder implemented as in the original Dynamic Coattention Network (DCN) [Xiong et al., 2016]. 7 Datasets Machine Translation. We use three different English-German machine translation datasets to train three separate MT-LSTMs. Each is tokenized using the Moses Toolkit [Koehn et al., 2007]. Our smallest MT dataset comes from the WMT 2016 multi-modal translation shared task [Specia et al., 2016]. The training set consists of 30,000 sentence pairs that briefly describe Flickr captions and is often referred to as Multi30k. Due to the nature of image captions, this dataset contains sentences that are, on average, shorter and simpler than those from larger counterparts. Our medium-sized MT dataset is the 2016 version of the machine translation task prepared for the International Workshop on Spoken Language Translation [Cettolo et al., 2015]. The training set consists of 209,772 sentence pairs from transcribed TED presentations that cover a wide variety of topics with more conversational language than in the other two machine translation datasets. Our largest MT dataset comes from the news translation shared task from WMT 2017. The training set consists of roughly 7 million sentence pairs that comes from web crawl data, a news and commentary corpus, European Parliament proceedings, and European Union press releases. We refer to the three MT datasets as MT-Small, MT-Medium, and MT-Large, respectively, and we refer to context vectors from encoders trained on each in turn as CoVe-S, CoVe-M, and CoVe-L. 5 Dataset Task Details Examples SST-2 Sentiment Classification 2 classes, single sentences 56.4k SST-5 Sentiment Classification 5 classes, single sentences 94.2k IMDb Sentiment Classification 2 classes, multiple sentences 22.5k TREC-6 Question Classification 6 classes 5k TREC-50 Question Classification 50 classes 5k SNLI Entailment Classification 2 classes 550k SQuAD Question Answering open-ended (answer-spans) 87.6k Table 1: Datasets, tasks, details, and number of training examples. Sentiment Analysis. We train our model separately on two sentiment analysis datasets: the Stanford Sentiment Treebank (SST) [Socher et al., 2013] and the IMDb dataset [Maas et al., 2011]. Both of these datasets comprise movie reviews and their sentiment. We use the binary version of each dataset as well as the five-class version of SST. For training on SST, we use all sub-trees with length greater than 3. SST-2 contains roughly 56, 400 reviews after removing “neutral” examples. SST-5 contains roughly 94, 200 reviews and does include “neutral” examples. IMDb contains 25, 000 multi-sentence reviews, which we truncate to the first 200 words. 2, 500 reviews are held out for validation. Question Classification. For question classification, we use the small TREC dataset [Voorhees and Tice, 1999] dataset of open-domain, fact-based questions divided into broad semantic categories. We experiment with both the six-class and fifty-class versions of TREC, which which refer to as TREC-6 and TREC-50, respectively. We hold out 452 examples for validation and leave 5, 000 for training. Entailment. For entailment, we use the Stanford Natural Language Inference Corpus (SNLI) [Bowman et al., 2015], which has 550,152 training, 10,000 validation, and 10,000 testing examples. Each example consists of a premise, a hypothesis, and a label specifying whether the premise entails, contradicts, or is neutral with respect to the hypothesis. Question Answering. The Stanford Question Answering Dataset (SQuAD) [Rajpurkar et al., 2016] is a large-scale question answering dataset with 87,599 training examples, 10,570 development examples, and a test set that is not released to the public. Examples consist of question-answer pairs associated with a paragraph from the English Wikipedia. SQuAD examples assume that the question is answerable and that the answer is contained verbatim somewhere in the paragraph. 8 Experiments 8.1 Machine Translation The MT-LSTM trained on MT-Small obtains an uncased, tokenized BLEU score of 38.5 on the Multi30k test set from 2016. The model trained on MT-Medium obtains an uncased, tokenized BLEU score of 25.54 on the IWSLT test set from 2014. The MT-LSTM trained on MT-Large obtains an uncased, tokenized BLEU score of 28.96 on the WMT 2016 test set. These results represent strong baseline machine translation models for their respective datasets. Note that, while the smallest dataset has the highest BLEU score, it is also a much simpler dataset with a restricted domain. Training Details. When training an MT-LSTM, we used fixed 300-dimensional word vectors. We used the CommonCrawl-840B GloVe model for English word vectors, which were completely fixed during training, so that the MT-LSTM had to learn how to use the pretrained vectors for translation. The hidden size of the LSTMs in all MT-LSTMs is 300. Because all MT-LSTMs are bidirectional, they output 600-dimensional vectors. The model was trained with stochastic gradient descent with a learning rate that began at 1 and decayed by half each epoch after the validation perplexity increased for the first time. Dropout with ratio 0.2 was applied to the inputs and outputs of all layers of the encoder and decoder. 8.2 Classification and Question Answering For classification and question answering, we explore how varying the input representations affects final performance. Table 2 contains validation performances for experiments comparing the use of GloVe, character n-grams, CoVe, and combinations of the three. 6 SST-2 SST-5 IMDb TREC-6 TREC-50 SNLI SQuAD 2 4 6 8 10 12 14 16 % improvement over randomly initialized word vectors GloVe GloVe+CoVe (a) CoVe and GloVe SST-2 SST-5 IMDb TREC-6 TREC-50 SNLI SQuAD 2 4 6 8 10 12 14 16 % improvement over randomly initialized word vectors GloVe+Char GloVe+CoVe GloVe+CoVe+Char (b) CoVe and Characters Figure 3: The Benefits of CoVe GloVe+ Dataset Random GloVe Char CoVe-S CoVe-M CoVe-L Char+CoVe-L SST-2 84.2 88.4 90.1 89.0 90.9 91.1 91.2 SST-5 48.6 53.5 52.2 54.0 54.7 54.5 55.2 IMDb 88.4 91.1 91.3 90.6 91.6 91.7 92.1 TREC-6 88.9 94.9 94.7 94.7 95.1 95.8 95.8 TREC-50 81.9 89.2 89.8 89.6 89.6 90.5 91.2 SNLI 82.3 87.7 87.7 87.3 87.5 87.9 88.1 SQuAD 65.4 76.0 78.1 76.5 77.1 79.5 79.9 Table 2: CoVe improves validation performance. CoVe has an advantage over character n-gram embeddings, but using both improves performance further. Models benefit most by using an MT-LSTM trained with MT-Large (CoVe-L). Accuracy is reported for classification tasks, and F1 is reported for SQuAD. Training Details. Unsupervised vectors and MT-LSTMs remain fixed in this set of experiments. LSTMs have hidden size 300. Models were trained using Adam with α = 0.001. Dropout was applied before all feedforward layers with dropout ratio 0.1, 0.2, or 0.3. Maxout networks pool over 4 channels, reduce dimensionality by 2, 4, or 8, reduce again by 2, and project to the output dimension. The Benefits of CoVe. Figure 3a shows that models that use CoVe alongside GloVe achieve higher validation performance than models that use only GloVe. Figure 3b shows that using CoVe in Eq. 6 brings larger improvements than using character n-gram embeddings [Hashimoto et al., 2016]. It also shows that altering Eq. 6 by additionally appending character n-gram embeddings can boost performance even further for some tasks. This suggests that the information provided by CoVe is complementary to both the word-level information provided by GloVe as well as the character-level information provided by character n-gram embeddings. GloVe GloVe +CoVe-S GloVe +CoVe-M GloVe +CoVe-L 2 4 6 8 10 12 14 16 % improvement over randomly initialized word vectors SST-2 SST-5 IMDb TREC-6 TREC-50 SNLI SQuAD Figure 4: The Effects of MT Training Data The Effects of MT Training Data. We experimented with different training datasets for the MT-LSTMs to see how varying the MT training data affects the benefits of using CoVe in downstream tasks. Figure 4 shows an important trend we can extract from Table 2. There appears to be a positive correlation between the larger MT datasets, which contain more complex, varied language, and the improvement that using CoVe brings to downstream tasks. This is evidence for our hypothesis that MT data has potential as a large resource for transfer learning in NLP. 7 Model Test Model Test SST-2 P-LSTM [Wieting et al., 2016] 89.2 TREC-6 SVM [da Silva et al., 2011] 95.0 CT-LSTM [Looks et al., 2017] 89.4 SVM [Van-Tu and Anh-Cuong, 2016] 95.2 TE-LSTM [Huang et al., 2017] 89.6 DSCNN-P [Zhang et al., 2016] 95.6 NSE [Munkhdalai and Yu, 2016a] 89.7 BCN+Char+CoVe [Ours] 95.8 BCN+Char+CoVe [Ours] 90.3 TBCNN [Mou et al., 2015] 96.0 bmLSTM [Radford et al., 2017] 91.8 LSTM-CNN [Zhou et al., 2016] 96.1 SST-5 MVN [Guo et al., 2017] 51.5 TREC-50 SVM [Loni et al., 2011] 89.0 DMN [Kumar et al., 2016] 52.1 SNoW [Li and Roth, 2006] 89.3 LSTM-CNN [Zhou et al., 2016] 52.4 BCN+Char+CoVe [Ours] 90.2 TE-LSTM [Huang et al., 2017] 52.6 RulesUHC [da Silva et al., 2011] 90.8 NTI [Munkhdalai and Yu, 2016b] 53.1 SVM [Van-Tu and Anh-Cuong, 2016] 91.6 BCN+Char+CoVe [Ours] 53.7 Rules [Madabushi and Lee, 2016] 97.2 IMDb BCN+Char+CoVe [Ours] 91.8 SNLI DecAtt+Intra [Parikh et al., 2016] 86.8 SA-LSTM [Dai and Le, 2015] 92.8 NTI [Munkhdalai and Yu, 2016b] 87.3 bmLSTM [Radford et al., 2017] 92.9 re-read LSTM [Sha et al., 2016] 87.5 TRNN [Dieng et al., 2016] 93.8 btree-LSTM [Paria et al., 2016] 87.6 oh-LSTM [Johnson and Zhang, 2016] 94.1 600D ESIM [Chen et al., 2016] 88.0 Virtual [Miyato et al., 2017] 94.1 BCN+Char+CoVe [Ours] 88.1 Table 4: Single model test accuracies for classification tasks. Test Performance. Table 4 shows the final test accuracies of our best classification models, each of which achieved the highest validation accuracy on its task using GloVe, CoVe, and character n-gram embeddings. Final test performances on SST-5 and SNLI reached a new state of the art. Model EM F1 LR [Rajpurkar et al., 2016] 40.0 51.0 DCR [Yu et al., 2017] 62.5 72.1 hM-LSTM+AP [Wang and Jiang, 2017] 64.1 73.9 DCN+Char [Xiong et al., 2017] 65.4 75.6 BiDAF [Seo et al., 2017] 68.0 77.3 R-NET [Wang et al., 2017] 71.1 79.5 DCN+Char+CoVe [Ours] 71.3 79.9 Table 3: Exact match and F1 validation scores for singlemodel question answering. Table 3 shows how the validation exact match and F1 scores of our best SQuAD model compare to the scores of the most recent top models in the literature. We did not submit the SQuAD model for testing, but the addition of CoVe was enough to push the validation performance of the original DCN, which already used character n-gram embeddings, above the validation performance of the published version of the R-NET. Test performances are tracked by the SQuAD leaderboard 2. GloVe+Char+ Dataset Skip-Thought CoVe-L SST-2 88.7 91.2 SST-5 52.1 55.2 TREC-6 94.2 95.8 TREC-50 89.6 91.2 SNLI 86.0 88.1 Table 5: Classification validation accuracies with skip-thought and CoVe. Comparison to Skip-Thought Vectors. Kiros et al. [2015] show how to encode a sentence into a single skip-thought vector that transfers well to a variety of tasks. Both skip-thought and CoVe pretrain encoders to capture information at a higher level than words. However, skip-thought encoders are trained with an unsupervised method that relies on the final output of the encoder. MT-LSTMs are trained with a supervised method that instead relies on intermediate outputs associated with each input word. Additionally, the 4800 dimensional skip-thought vectors make training more unstable than using the 600 dimensional CoVe. Table 5 shows that these differences make CoVe more suitable for transfer learning in our classification experiments. 2https://rajpurkar.github.io/SQuAD-explorer/ 8 9 Conclusion We introduce an approach for transferring knowledge from an encoder pretrained on machine translation to a variety of downstream NLP tasks. In all cases, models that used CoVe from our best, pretrained MT-LSTM performed better than baselines that used random word vector initialization, baselines that used pretrained word vectors from a GloVe model, and baselines that used word vectors from a GloVe model together with character n-gram embeddings. We hope this is a step towards the goal of building unified NLP models that rely on increasingly more general reusable weights. The PyTorch code at https://github.com/salesforce/cove includes an example of how to generate CoVe from the MT-LSTM we used in all of our best models. We hope that making our best MT-LSTM available will encourage further research into shared representations for NLP models. References E. Agirre, C. Banea, C. Cardie, D. M. Cer, M. T. Diab, A. Gonzalez-Agirre, W. Guo, R. Mihalcea, G. Rigau, and J. Wiebe. SemEval-2014 Task 10: Multilingual semantic textual similarity. In SemEval@COLING, 2014. D. Bahdanau, K. Cho, and Y. Bengio. Neural machine translation by jointly learning to align and translate. In ICLR, 2015. S. R. Bowman, C. Potts, and C. D. Manning. Recursive neural networks for learning logical semantics. CoRR, abs/1406.1827, 2014. S. R. Bowman, G. Angeli, C. Potts, and C. D. Manning. A large annotated corpus for learning natural language inference. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing (EMNLP). Association for Computational Linguistics, 2015. M. Cettolo, J. Niehues, S. Stüker, L. Bentivogli, R. Cattoni, and M. Federico. The IWSLT 2015 evaluation campaign. In IWSLT, 2015. Q. Chen, X.-D. Zhu, Z.-H. Ling, S. Wei, and H. Jiang. Enhancing and combining sequential and tree LSTM for natural language inference. CoRR, abs/1609.06038, 2016. R. Collobert, J. Weston, L. Bottou, M. Karlen, K. Kavukcuoglu, and P. Kuksa. Natural language processing (almost) from scratch. JMLR, 12:2493–2537, 2011. A. Conneau, D. Kiela, H. Schwenk, L. Barrault, and A. Bordes. Supervised learning of universal sentence representations from natural language inference data. arXiv preprint arXiv:1705.02364, 2017. J. P. C. G. da Silva, L. Coheur, A. C. Mendes, and A. Wichert. From symbolic to sub-symbolic information in question classification. Artif. Intell. Rev., 35:137–154, 2011. A. M. Dai and Q. V. Le. Semi-supervised sequence learning. In NIPS, 2015. J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. ImageNet: A large-scale hierarchical image database. 2009 IEEE Conference on Computer Vision and Pattern Recognition, pages 248–255, 2009. A. B. Dieng, C. Wang, J. Gao, and J. W. Paisley. TopicRNN: A recurrent neural network with long-range semantic dependency. CoRR, abs/1611.01702, 2016. L. Dong and M. Lapata. Language to logical form with neural attention. CoRR, abs/1601.01280, 2016. A. Fukui, D. H. Park, D. Yang, A. Rohrbach, T. Darrell, and M. Rohrbach. Multimodal compact bilinear pooling for visual question answering and visual grounding. arXiv preprint arXiv:1606.01847, 2016. R. Girshick, J. Donahue, T. Darrell, and J. Malik. Rich feature hierarchies for accurate object detection and semantic segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 580–587, 2014. I. J. Goodfellow, D. Warde-Farley, M. Mirza, A. C. Courville, and Y. Bengio. Maxout networks. In ICML, 2013. A. Graves and J. Schmidhuber. Framewise phoneme classification with bidirectional LSTM and other neural network architectures. Neural Networks, 18(5):602–610, 2005. H. Guo, C. Cherry, and J. Su. End-to-end multi-view networks for text classification. CoRR, abs/1704.05907, 2017. 9 K. Hashimoto, C. Xiong, Y. Tsuruoka, and R. Socher. A joint many-task model: Growing a neural network for multiple NLP tasks. CoRR, abs/1611.01587, 2016. 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. F. Hill, K. Cho, and A. Korhonen. Learning distributed representations of sentences from unlabelled data. In HLT-NAACL, 2016. F. Hill, K. Cho, S. Jean, and Y. Bengio. The representational geometry of word meanings acquired by neural machine translation models. Machine Translation, pages 1–16, 2017. ISSN 1573-0573. doi: 10.1007/s10590-017-9194-2. URL http://dx.doi.org/10.1007/s10590-017-9194-2. M. Huang, Q. Qian, and X. Zhu. Encoding syntactic knowledge in neural networks for sentiment classification. ACM Trans. Inf. Syst., 35:26:1–26:27, 2017. S. Ioffe and C. Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, 2015. R. Johnson and T. Zhang. Supervised and semi-supervised text categorization using LSTM for region embeddings. In ICML, 2016. R. Kiros, Y. Zhu, R. Salakhutdinov, R. S. Zemel, R. Urtasun, A. Torralba, and S. Fidler. Skip-thought vectors. In NIPS, 2015. G. Klein, Y. Kim, Y. Deng, J. Senellart, and A. M. Rush. OpenNMT: Open-source toolkit for neural machine translation. ArXiv e-prints, 2017. P. Koehn, H. Hoang, A. Birch, C. Callison-Burch, M. Federico, N. Bertoldi, B. Cowan, W. Shen, C. Moran, R. Zens, C. Dyer, O. Bojar, A. Constantin, and E. Herbst. Moses: Open source toolkit for statistical machine translation. In ACL, 2007. 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. A. Kumar, O. Irsoy, P. Ondruska, M. Iyyer, J. Bradbury, I. Gulrajani, V. Zhong, R. Paulus, and R. Socher. Ask me anything: Dynamic memory networks for natural language processing. In ICML, 2016. X. Li and D. Roth. Learning question classifiers: The role of semantic information. Natural Language Engineering, 12:229–249, 2006. B. Loni, G. van Tulder, P. Wiggers, D. M. J. Tax, and M. Loog. Question classification by weighted combination of lexical, syntactic and semantic features. In TSD, 2011. M. Looks, M. Herreshoff, D. Hutchins, and P. Norvig. Deep learning with dynamic computation graphs. CoRR, abs/1702.02181, 2017. J. Lu, C. Xiong, D. Parikh, and R. Socher. Knowing when to look: Adaptive attention via a visual sentinel for image captioning. arXiv preprint arXiv:1612.01887, 2016. T. Luong, H. Pham, and C. D. Manning. Effective approaches to attention-based neural machine translation. In EMNLP, 2015. A. L. Maas, R. E. Daly, P. T. Pham, D. Huang, A. Y. Ng, and C. Potts. Learning word vectors for sentiment analysis. In Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies, pages 142–150, Portland, Oregon, USA, June 2011. Association for Computational Linguistics. URL http://www.aclweb.org/anthology/P11-1015. H. T. Madabushi and M. Lee. High accuracy rule-based question classification using question syntax and semantics. In COLING, 2016. T. Mikolov, K. Chen, G. Corrado, and J. Dean. Efficient estimation of word representations in vector space. In ICLR (workshop), 2013. S. Min, M. Seo, and H. Hajishirzi. Question answering through transfer learning from large fine-grained supervision data. 2017. T. Miyato, A. M. Dai, and I. Goodfellow. Adversarial training methods for semi-supervised text classification. 2017. 10 L. Mou, H. Peng, G. Li, Y. Xu, L. Zhang, and Z. Jin. Discriminative neural sentence modeling by tree-based convolution. In EMNLP, 2015. T. Munkhdalai and H. Yu. Neural semantic encoders. CoRR, abs/1607.04315, 2016a. T. Munkhdalai and H. Yu. Neural tree indexers for text understanding. CoRR, abs/1607.04492, 2016b. V. Nair and G. E. Hinton. Rectified linear units improve restricted Boltzmann machines. In ICML, 2010. R. Nallapati, B. Zhou, C. N. dos Santos, Çaglar Gülçehre, and B. Xiang. Abstractive text summarization using sequence-to-sequence RNNs and beyond. In CoNLL, 2016. B. Paria, K. M. Annervaz, A. Dukkipati, A. Chatterjee, and S. Podder. A neural architecture mimicking humans end-to-end for natural language inference. CoRR, abs/1611.04741, 2016. A. P. Parikh, O. Tackstrom, D. Das, and J. Uszkoreit. A decomposable attention model for natural language inference. In EMNLP, 2016. J. Pennington, R. Socher, and C. D. Manning. Glove: Global vectors for word representation. In EMNLP, 2014. Y. Qi, S. Zhang, L. Qin, H. Yao, Q. Huang, J. Lim, and M.-H. Yang. Hedged deep tracking. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4303–4311, 2016. A. Radford, R. Józefowicz, and I. Sutskever. Learning to generate reviews and discovering sentiment. CoRR, abs/1704.01444, 2017. P. Rajpurkar, J. Zhang, K. Lopyrev, and P. Liang. SQuAD: 100,000+ questions for machine comprehension of text. arXiv preprint arXiv:1606.05250, 2016. P. Ramachandran, P. J. Liu, and Q. V. Le. Unsupervised pretraining for sequence to sequence learning. CoRR, abs/1611.02683, 2016. K. Saenko, B. Kulis, M. Fritz, and T. Darrell. Adapting visual category models to new domains. In ECCV, 2010. M. Seo, A. Kembhavi, A. Farhadi, and H. Hajishirzi. Bidirectional attention flow for machine comprehension. ICLR, 2017. L. Sha, B. Chang, Z. Sui, and S. Li. Reading and thinking: Re-read LSTM unit for textual entailment recognition. In COLING, 2016. K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. R. Socher, A. Perelygin, J. Wu, J. Chuang, C. Manning, A. Ng, and C. Potts. Recursive deep models for semantic compositionality over a sentiment treebank. In EMNLP, 2013. R. Socher, A. Karpathy, Q. V. Le, C. D. Manning, and A. Y. Ng. Grounded compositional semantics for finding and describing images with sentences. In ACL, 2014. L. Specia, S. Frank, K. Sima’an, and D. Elliott. A shared task on multimodal machine translation and crosslingual image description. In WMT, 2016. I. Sutskever, O. Vinyals, and Q. V. Le. Sequence to sequence learning with neural networks. In NIPS, 2014. N. Van-Tu and L. Anh-Cuong. Improving question classification by feature extraction and selection. Indian Journal of Science and Technology, 9(17), 2016. E. M. Voorhees and D. M. Tice. The TREC-8 question answering track evaluation. In TREC, volume 1999, page 82, 1999. S. Wang and J. Jiang. Machine comprehension using Match-LSTM and answer pointer. 2017. W. Wang, N. Yang, F. Wei, B. Chang, and M. Zhou. Gated self-matching networks for reading comprehension and question answering. 2017. J. Wieting, M. Bansal, K. Gimpel, and K. Livescu. Towards universal paraphrastic sentence embeddings. In ICLR, 2016. C. Xiong, S. Merity, and R. Socher. Dynamic memory networks for visual and textual question answering. In Proceedings of The 33rd International Conference on Machine Learning, pages 2397–2406, 2016. 11 C. Xiong, V. Zhong, and R. Socher. Dynamic coattention networks for question answering. ICRL, 2017. Y. Yu, W. Zhang, K. Hasan, M. Yu, B. Xiang, and B. Zhou. End-to-end reading comprehension with dynamic answer chunk ranking. ICLR, 2017. R. Zhang, H. Lee, and D. R. Radev. Dependency sensitive convolutional neural networks for modeling sentences and documents. In HLT-NAACL, 2016. P. Zhou, Z. Qi, S. Zheng, J. Xu, H. Bao, and B. Xu. Text classification improved by integrating bidirectional LSTM with two-dimensional max pooling. In COLING, 2016. Y. Zhu, Y. Chen, Z. Lu, S. J. Pan, G.-R. Xue, Y. Yu, and Q. Yang. Heterogeneous transfer learning for image classification. In AAAI, 2011. 12
2017
85
7,226
Semisupervised Clustering, AND-Queries and Locally Encodable Source Coding Arya Mazumdar College of Information & Computer Sciences University of Massachusetts Amherst Amherst, MA 01003 arya@cs.umass.edu Soumyabrata Pal College of Information & Computer Sciences University of Massachusetts Amherst Amherst, MA 01003 soumyabratap@umass.edu Abstract Source coding is the canonical problem of data compression in information theory. In a locally encodable source coding, each compressed bit depends on only few bits of the input. In this paper, we show that a recently popular model of semisupervised clustering is equivalent to locally encodable source coding. In this model, the task is to perform multiclass labeling of unlabeled elements. At the beginning, we can ask in parallel a set of simple queries to an oracle who provides (possibly erroneous) binary answers to the queries. The queries cannot involve more than two (or a fixed constant number ∆of) elements. Now the labeling of all the elements (or clustering) must be performed based on the (noisy) query answers. The goal is to recover all the correct labelings while minimizing the number of such queries. The equivalence to locally encodable source codes leads us to find lower bounds on the number of queries required in variety of scenarios. We are also able to show fundamental limitations of pairwise ‘same cluster’ queries - and propose pairwise AND queries, that provably performs better in many situations. 1 Introduction Suppose we have n elements, and the ith element has a label Xi ∈{0, 1, . . . , k−1}, ∀i ∈{1, . . . , n}. We consider the task of learning the labels of the elements (or learning the label vector). This can also be easily thought of as a clustering problem of n elements into k clusters, where there is a ground-truth clustering1. There exist various approaches to this problem in general. In many cases some similarity values between pair of elements are known (a high similarity value indicate that they are in the same cluster). Given these similarity values (or a weighted complete graph), the task is equivalent to to graph clustering; when perfect similarity values are known this is equivalent to finding the connected components of a graph. A recent approach to clustering has been via crowdsourcing. Suppose there is an oracle (expert labelers, crowd workers) with whom we can make pairwise queries of the form “do elements u and v belong to the same cluster?”. We will call this the ‘same cluster’ query (as per [4]). Based on the answers from the oracle, we then try to reconstruct the labeling or clustering. This idea has seen a recent surge of interest especially in the entity resolution research (see, for e.g. [33, 30, 8, 20]). Since each query to crowd workers cost time and money, a natural objective will be to minimize the number of queries to the oracle and still recover the clusters exactly. Carefully designed adaptive and interactive querying algorithms for clustering has also recently been developed [33, 30, 8, 22, 21]. In 1The difference between clustering and learning labels is that in the case of clustering it is not necessary to know the value of the label for a cluster. Therefore any unsupervised labeling algorithm will be a clustering algorithm, however the reverse is not true. In this paper we are mostly concerned about the labeling problem, hence our algorithms (upper bounds) are valid for clustering as well. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. particular, the query complexity for clustering with a k-means objective had recently been studied in [4], and there are significant works in designing optimal crowdsourcing schemes in general (see, [12, 13, 28, 34, 15]). Note that, a crowd worker may potentially handle more than two elements at a time; however it is of interest to keep the number of elements involved in a query as small as possible. As an example, recent work in [31] considers triangle queries (involving three elements in a query). Also crowd workers can compute some simple functions on this small set of inputs - instead of answering a ‘same cluster’ query. But again it is desirable that the answer the workers provide to be simple, such as a binary answer. The queries to the oracle can be asked adaptively or non-adaptively. For the clustering problem, both the adaptive version and the nonadaptive versions have been studied. While both versions have obvious advantages and disadvantages, for crowdsourcing applications it is helpful to have a parallelizable querying scheme in most scenarios for faster response-rate and real time analysis. In this paper, we concentrate on the nonadaptive version of the problem, i.e., we perform the labeling algorithm after all the query answers are all obtained. Budgeted crowdsourcing problems can be quite straight-forwardly viewed as a canonical sourcecoding or source-channel coding problem of information theory (e.g., see the recent paper [14]). A main contribution of our paper is to view this as a locally encodable source coding problem: a data compression problem where each compressed bit depends only on a constant number of input bits. The notion of locally encodable source coding is not well-studied even within information theory community, and the only place where it is mentioned to the best of our knowledge is in [23], although the focus of that paper is a related notion of smooth encoding. Another related notion of local decoding seem to be much more well-studied [19, 18, 16, 26, 6, 25, 5, 32]. By posing the querying problem as such we can get a number of information theoretic lower bounds on the number of queries required to recover the correct labeling. We also provide nonadaptive schemes that are near optimal. Another of our main contributions is to show that even within queries with binary answers, ‘same cluster’ queries (or XOR queries) may not be the best possible choice. A smaller number of queries can be achieved for approximate recovery by using what we call an AND query. Among our settings, we also consider the case when the oracle gives incorrect answers with some probability. A simple scheme to reduce errors in this case could be to take a majority vote after asking the same question to multiple different crowd workers. However, often that is not sufficient. Experiments on several real datasets (see [21]) with answers collected from Amazon Mechanical Turk [9, 29] show that majority voting could even increase the errors. Interestingly, such an observation has been made by a recent paper as well [27, Figure 1]. The probability of error of a query answer may also be thought of as the aggregated answer after repeating the query several times. Once the answer has been aggregated, it cannot change – and thus it reduces to the model where repeating the same question multiple times is not allowed. On the other hand, it is usually assumed that the answers to different queries are independently erroneous (see [10]). Therefore we consider the case where repetition of a same query multiple times is not allowed2, however different queries can result in erroneous answers independently. In this case, the best known algorithms need O(n log n) queries to perform the clustering with two clusters [21]. We show that by employing our AND querying method (1 −δ)-proportion of all labels in the label vector will be recovered with only O(n log 1 δ ) queries. Along the way, we also provide new information theoretic results on fundamental limits of locally encodable source coding. While the the related notion of locally decodable source code [19, 16, 26, 6], as well as smooth compression [23, 26] have been studied, there was no nontrivial result known related to locally encodable codes in general. Although the focus of this paper is primarily theoretical, we also perform a real crowdsourcing experiment to validate our algorithm. 2 Problem Setup and Information Theoretic View For n elements, consider a label vector X ∈{0, . . . , k −1}n, where Xi, the ith entry of X, is the label of the ith element and can take one of k possible values. Suppose P(Xi = j) = pj∀j and Xi’s are independent. In other words, the prior distribution of the labels is given by the vector 2Independent repetition of queries is also theoretically not interesting, as by repeating any query just O(log n) times one can reduce the probability of error to near zero. 2 p ≡(p0, . . . , pk−1).For the special case of k = 2, we denote p0 ≡1 −p and p1 ≡p. While we emphasize on the case of k = 2 our results extends in the case of larger k, as will be mentioned. A query Q : {0, . . . , k −1}∆→{0, 1} is a deterministic function that takes as argument ∆labels, ∆≪n, and outputs a binary answer. While the query answer need not be binary, we restrict ourselves mostly to this case for being the most practical choice. Suppose a total of m queries are made and the query answers are given by Y ∈{0, 1}m. The objective is to reconstruct the label vector X from Y , such that the number of queries m is minimized. We assume our recovery algorithms to have the knowledge of p. This prior distribution, or the relative sizes of clusters, is usually easy to estimate by subsampling a small (O(log n)) subset of elements and performing a complete clustering within that set (by, say, all pairwise queries). In many prior works, especially in the recovery algorithms of popular statistical models such as stochastic block model, it is assumed that the relative sizes of the clusters are known (see [1]). We also consider the setting where query answers may be erroneous with some probability of error. For crowdsourcing applications, this is a valid assumption since many times even expert labelers can make errors, and such assumption can be made. To model this we assume each entry of Y is flipped independently with some probability q. Such independence assumption has been used many times previously to model errors in crowdsourcing systems (see, e.g., [10]). While this may not be the perfect model, we do not allow a single query to be repeated multiple times in our algorithms (see the Introduction for a justification). For the analysis of our algorithm we just need to assume that the answers to different queries are independent. While we analyze our algorithms under these assumptions for theoretical guarantees, it turns out that even in real crowdsourcing situations our algorithmic results mostly follow the theoretical results, giving further validation to the model. For the k = 2 case, and when q = 0 (perfect oracle), it is easy to see that n queries are sufficient for the task. One simply compares every element with the first element. This does not extend to the case when k > 2: for perfect recovery, and without any prior, one must make O(n2) queries in this case. When q > 0 (erroneous oracle), it has been shown that a total number of O(γnk log n) queries are sufficient [21], where γ is the ratio of the sizes of the largest and smallest clusters. Information theoretic view. The problem of learning a label vector x from queries is very similar to the canonical source coding (data compression) problem from information theory. In the source coding problem, a (possibly random) vector X is ‘encoded’ into a usually smaller length binary vector called the compressed vector3 Y ∈{0, 1}m. The decoding task is to again obtain X from the compressed vector Y . It is known that if X is distributed according to p, then m ≈nH(p) is both necessary and sufficient to recover x with high probability, where H(p) = −P i pi log pi is the entropy of p. We can cast our problem in this setting naturally, where entries of Y are just answers to queries made on X. The main difference is that in source coding each Yi may potentially depend on all the entries of X; while in the case of label learning, each Yi may depend on only ∆of the xis. We call this locally encodable source coding. This terminology is analogous to the recently developed literature on locally decodable source coding [19, 16]. It is called locally encodable, because each compressed bit depend only on ∆of the source (input) bits. For locally decodable source coding, each bit of the reconstructed sequence ˆX depends on at most a prescribed constant number ∆of bits from the compressed sequence. Another closely related notion is that of ‘smooth compression’, where each source bit contributes to at most ∆compressed bits [23]. Indeed, in [23], the notion of locally encodable source coding is also present where it was called robust compression. We provide new information theoretic lower bounds on the number of queries required to reconstruct X exactly and approximately for our problem. For the case when there are only two labels, the ‘same cluster’ query is equivalent to an Boolean XOR operation between the labels. There are some inherent limitations to these functions that prohibit the ‘same cluster’ queries to achieve the best possible number of queries for the ‘approximate’ recovery of labeling problem. We use an old result by Massey [17] to establish this limitation. We show that, instead using an operation like Boolean AND, much smaller number of queries are able to recover most of the labels correctly. 3The compressed vector is not necessarily binary, nor it is necessarily smaller length. 3 We also consider the case when the oracle gives faulty answer, or Y is corrupted by some noise (the binary symmetric channel). This setting is analogous to the problem of joint source-channel coding. However, just like before, each encoded bit must depend on at most ∆bits. We show that for the approximate recovery problem, AND queries are again performing substantially well. In a real crowdsourcing experiment, we have seen that if crowd-workers have been provided with the same set of pairs and being asked for ‘same cluster’ queries as well as AND queries, the error-rate of AND queries is lower. The reason is that for a correct ‘no’ answer in an AND query, a worker just need to know one of the labels in the pair. For a ‘same cluster’ query, both the labels must be known to the worker for any correct answer. There are multiple reasons why one would ask for a ‘combination’ or function of multiple labels from a worker instead of just asking for a label itself (a ‘label-query’). Note that, asking for labels will never let us recover the clusters in less than n queries, whereas, as we will see, the queries that combine labels will. Also in case of erroneous answer with AND queries or ‘same cluster’ queries, we have the option of not repeating a query, and still reduce errors. No such option is available with direct label-queries. Contributions. In summary our contributions can be listed as follows. 1. Noiseless queries and exact recovery (Sec. 3.1): For two clusters, we provide a querying scheme that asks αn, α < 1 number of nonadaptive pairwise ‘same cluster’ queries, and recovers the all labels with high probability, for a range of prior probabilities. We also provide a new lower bound that is strictly better than nH(p) for some p. 2. Noiseless queries and approximate recovery (Sec. 3.2): We provide a new lower bound on the number of queries required to recover (1 −δ) fraction of the labels δ > 0. We also show that ‘same cluster’ queries are insufficient, and propose a new querying strategy based on AND operation that performs substantially better. 3. Noisy queries and approximate recovery (Sec. 3.3). For this part we assumed the query answer to be k-ary (k ≥2) where k is the number of clusters. This section contains the main algorithmic result that uses the AND queries as main primitive. We show that, even in the presence of noise in the query answers, it is possible to recover (1 −δ) proportion of all labels correctly with only O(n log k δ ) nonadaptive queries. We validate this theoretical result in a real crowdsourcing experiment in Sec. 4. 3 Main results and Techniques 3.1 Noiseless queries and exact recovery In this scenario we assume the query answer from oracle to be perfect and we wish to get back the all of the original labels exactly without any error. Each query is allowed to take only ∆labels as input. When ∆= 2, we are allowed to ask only pairwise queries. Let us consider the case when there are only two labels, i.e., k = 2. That means the labels Xi ∈{0, 1}, 1 ≤i ≤n, are iid Bernoulli(p) random variable. Therefore the number of queries m that are necessary and sufficient to recover all the labels with high probability is approximately nh(p) ± o(n) where h(x) ≡−x log2 x −(1 −x) log2(1 −x) is the binary entropy function. However the sufficiency part here does not take into account that each query can involve only ∆labels. Querying scheme: We use the following type of queries. For each query, labels of ∆elements are given to the oracle, and the oracle returns a simple XOR operation of the labels. Note, for ∆= 2, our queries are just ‘same cluster’ queries. Theorem 1. There exists a querying scheme with m = n(h(p)+o(1)) log2 1 α queries of above type, where α = 1 2(1 + (1 −4p(1 −p))∆), such that it will be possible to recover all the labels with high probability by a Maximum Likelihood decoder. Proof. Let the number of queries asked is m. Let us define Q to be the random binary query matrix of dimension m × n where each row has exactly ∆ones, other entries being zero. Now for a label vector X we can represent the set of query outputs by Y = QX mod 2. Now if we use Maximum Likelihood Decoding then we will not make an error as long as the query output vector is different 4 for every X that belong to the typical set4 of X. Let us define a ‘bad event’ for two different label vectors X1 and X2 to be the event QX1 = QX2 or Q(X1 + X2) = 0 mod 2 because in that case we will not be able to differentiate between those two sequences. Now consider a random ensemble of matrices where in each row ∆positions are chosen uniformly randomly from the n positions to be 1. In this random ensemble, the probability of a ‘bad event’ for any two fixed typical label vectors X1 and X2 is going to be P i=0:∆ i even nr(p) i n−nr(p) ∆−i  n ∆  m ≤  1 2( n ∆  + n−2nr(p) ∆  ) n ∆  m ≤ 1 2(1 + (1 −2r(p))∆) m , where r(p) = 2p(1 −p). This is because , X1 + X2 mod 2 has r(p) = 2p(1 −p) ones with high probability since they are typical vectors. Now we have to use the ‘coding theoretic’ idea of expurgation to complete the analysis. From linearity of expectation, the expected number of ‘bad events’ is going to be T 2 1 2(1 + (1 −2r(p))∆) m , where T is the size of the typical set and T ≤2n(h(p)+o(1)). If this expected number of ‘bad events’ is smaller than ϵT then for every ‘bad event’, we can throw out 1 label vector and there will be no more bad events. This will imply perfect recovery, as long as T 2 1 2(1 + (1 −2r(p))∆) m < ϵT. Substituting the upper bound for T, we have that perfect recovery is possible as long as, m n > (h(p)+o(1)−log 2ϵ n )/(log 1 α). Now if we take ϵ to be of the form n−β for β > 0 then asymptotically we will have a vanishing fraction of typical label vectors which will be expurgated and log ϵ n →0. Therefore m = n(h(p)+o(1)) log 1 α queries will going to recover all the labels with high probability. Hence there must exist a querying scheme with m = n(h(p)+o(1)) log 1 α queries that will work. The number of sufficient queries guaranteed by the above theorem is strictly less than n for all 0.0694 ≤p < 0.5 even for ∆= 2. Note that, with ∆= 2, by querying the first element with all others nonadaptively (total n −1 queries), it is possible to deduce the two clusters. In contrast, if one makes just random ‘same cluster’ queries, then O(n log n) queries are required to recover the clusters with high probability (see, e.g., [2]). Now we provide a lower bound on the number of queries required. Theorem 2. The minimum number of queries necessary to recover all labels with high probability is at least by nh(p) · max{1, maxρ (1−ρ) h( (1−ρ)r(p)∆ ρ )} where r(p) ≡2p(1 −p). Proof. Every query involves at most ∆elements. Therefore the average number of queries an element is part of is ∆m n . Therefore 1 −ρ fraction of all the elements (say the set S ⊂{1, . . . , n}) are part of less than ∆m ρn queries. Now consider the set {1, . . . , n} \ S. Consider all typical label vectors C ∈{0, 1}n such that their projection on {1, . . . , n} \ S is a fixed typical sequence. We know that there are 2n(1−ρ)h(p) such sequences. Let X0 be one of these sequences. Now, almost all sequences of C must have a distance of n(1−ρ)r(p)+o(n) from X0. Let Y 0 be the corresponding query outputs when X0 is the input. Now any query output for input belonging to C must reside in a Hamming ball of radius (1 −ρ)r(p)∆m ρ from Y 0. Therefore we must have mh( (1−ρ)r(p)∆ ρ ) ⩾n(1 −ρ)h(p). This lower bound is better than the naive nh(p) for p < 0.03475 when ∆= 2. 4Here a typical set of labels is all such label vectors where the number of ones is between np −n2/3 and np + n2/3. 5 For ∆= 2, the plot of the corresponding upper and lower bounds have been shown in Figure 1. The main takeaway from this part is that, by exploiting the prior probabilities (or relative cluster sizes), it is possible to know the labels with strictly less than n queries (and close to the lower bound for p ≥0.3), even with pairwise ‘same cluster’ queries. 3.2 Noiseless queries and approximate recovery Figure 1: Number of pairwise queries for noiseless queries and exact recovery Again let us consider the case when k = 2, i.e., only two possible labels. Let X ∈{0, 1}n be the label vector. Suppose we have a querying algorithm that, by using m queries, recovers a label vector ˆX. Definition. We call a querying algorithm to be (1 −δ)good if for any label vector, at least (1 −δ)n labels are correctly recovered. This means for any label-recovered label pair X, ˆX, the Hamming distance is at most δn. For an almost equivalent definition, we can define a distortion function d(X, ˆX) = X + ˆX mod 2, for any two labels X, ˆX ∈{0, 1}. We can see that Ed(X, ˆX) = Pr(X ̸= ˆX), which we want to be bounded by δ. Using standard rate-distortion theory [7], it can be seen that, if the queries could involve an arbitrary number of elements then with m queries it is possible to have a (1 −˜δ(m/n))-good scheme where ˜δ(γ) ≡h−1(h(p) −γ). When each query is allowed to take only at most ∆inputs, we have the following lower bound for (1 −δ)-good querying algorithms. Theorem 3. In any (1 −δ)-good querying scheme with m queries where each query can take as input ∆elements, the following must be satisfied (below h′(x) = dh(x) dx ): δ ≥˜δ m n  + h(p) −h(˜δ( m n )) h′(˜δ( m n ))(1 + e∆h′(˜δ( m n ))) The proof of this theorem is quite involved, and we have included it in the appendix in the supplementary material. One of the main observation that we make is that the ‘same cluster’ queries are highly inefficient for approximate recovery. This follows from a classical result of Ancheta and Massey [17] on the limitation of linear codes as rate-distortion codes. Figure 2: Performance of (1 −δ)-good schemes with noiseless queries; p = 0.5 Recall that, the ‘same cluster’ queries are equivalent to XOR operation in the binary field, which is a linear operation on GF(2). We rephrase a conjecture by Massey in our terminology. Conjecture 1 (‘same cluster’ query lower bound). For any (1 −δ)-good scheme with m ‘same cluster’ queries (∆= 2), the following must be satisfied: δ ≥p(1− m nh(p)). This conjecture is known to be true at the point p = 0.5 (equal sized clusters). We have plotted these two lower bounds in Figure 2. Now let us provide a querying scheme with ∆= 2 that will provably be better than ‘same cluster’ schemes. Querying scheme: AND Queries: We define the AND query Q : {0, 1}2 →{0, 1} as Q(X, X′) = X V X′, where X, X′ ∈{0, 1}, so that Q(X, X′) = 1 only when both the elements have labels equal to 1. For each pairwise query the oracle will return this AND operation of the labels. Theorem 4. There exists a (1 −δ)-good querying scheme with m pairwise AND queries such that δ = pe−2m n + n X d=1 e−2m n ( 2m n )d d! d X k=1 n k f(k, d) nd (1 −p)kp 6 where f(k, d) = Pk i=0(−1)ik i  (k −i)d. Proof. Assume p < 0.5 without loss of generality. Consider a random bipartite graph where each ‘left’ node represent an element labeled according to the label vector X ∈{0, 1}n and each ‘right’ node represents a query. All the query answers are collected in Y ∈{0, 1}m. The graph has right-degree exactly equal to 2. For each query the two inputs are selected uniformly at random without replacement. Recovery algorithm: For each element we look at the queries that involves it and estimate its label as 1 if any of the query answers is 1 and predict 0 otherwise. If there are no queries that involves the element, we simply output 0 as the label. Since the average left-degree is 2m n and since all the edges from the right nodes are randomly and independently thrown, we can model the degree of each left-vertex by a Poisson distribution with the mean λ = 2m n . We define element j to be a two-hop-neighbor of i if there is at least one query which involved both the elements i and j . Under our decoding scheme we only have an error when the label of i, Xi = 1 and the labels of all its two-hop-neighbors are 0. Hence the probability of error for estimating Xi can be written as, Pr(Xi ̸= ˆXi) = P d Pr(degree(i) = d) Pr(Xi ̸= ˆXi | degree(i) = d). Now let us estimate Pr(Xi ̸= ˆXi | degree(i) = d). We further condition the error on the event that there are k distinct two-hop-neighbors (lets call the number of distinct neighbors of i as Dist(i)) and hence we have that Pr(Xi ̸= ˆXi | degree(i) = d) = Pd k=1 Pr(Dist(i) = k) Pr(Xi ̸= ˆXi|degree(i) = d, Dist(i) = k) = Pd k=1 n k  f(k,d) nd p(1 −p)k. Now using the Poisson assumption we get the statement of the theorem. The performance of this querying scheme is plotted against the number of queries for prior probabilities p = 0.5 in Figure 2. Comparison with ‘same cluster’ queries: We see in Figure 2 that the AND query scheme beats the ‘same cluster’ query lower bound for a range of query-performance trade-off in approximate recovery for p = 1 2. For smaller p, this range of values of δ increases further. If we randomly choose ‘same cluster’ queries and then resort to maximum likelihood decoding (note that, for AND queries, we present a simple decoding) then O(n log n) queries are still required even if we allow for δ proportion of incorrect labels (follows from [11]). The best performance for ‘same cluster’ query in approximate recovery that we know of for small δ is given by: m = n(1 −δ) (neglect nδ elements and just query the n(1 −δ) remaining elements with the first element). However, such a scheme can be achieved by AND queries as well in a similar manner. Therefore, there is no point in the query vs δ plot that we know of where ‘same cluster’ query achievability outperforms AND query achievability. 3.3 Noisy queries and approximate recovery This section contains our main algorithmic contribution. In contrast to the previous sections here we consider the general case of k ≥2 clusters. Recall that the label vector X ∈{0, 1, . . . , k −1}n, and the prior probability of each label is given by the probabilities p = (p0, . . . , pk−1). Instead of binary output queries, in this part we consider an oracle that can provide one of k different answers. We consider a model of noise in the query answer where the oracle provides correct answer with probability 1 −q, and any one of the remaining incorrect answers with probability q k−1. Note that we do not allow the same query to be asked to the oracle multiple time (see Sec. 2 for justification). We also define a (1 −δ)-good approximation scheme exactly as before. Querying Scheme: We only perform pairwise queries. For a pair of labels X and X′ we define a query Y = Q(X, X′) ∈{0, 1, . . . , k −1}. For our algorithm we define the Q as Q(X, X′) =  i if X = X′ = i 0 otherwise.  We can observe that for k = 2, this query is exactly same as the binary AND query that we defined in the previous section. In our querying scheme, we make a total of nd 2 queries, for an integer d > 1. We design a d-regular graph G(V, E) where V = {1, . . . , n} is the set of elements that we need to label. We query all the pairs of elements (u, v) ∈E. Under this querying scheme, we propose to use Algorithm 1 for reconstructions of labels. 7 Theorem 5. The querying scheme with m = O(n log k δ ) queries and Algorithm 1 is (1 −δ)-good for approximate recovery of labels from noisy queries. Algorithm 1 Noisy query approximate recovery with nd 2 queries Require: PRIOR p ≡(p0, . . . , pk−1) Require: Query Answers Yu,v : (u, v) ∈E for i ∈[1, 2, . . . , k −1] do Ci = dq k−1 + dpi 2 1 − qk k−1  end for for u ∈V do for i ∈[1, 2, . . . , k −1] do Nu,i = Pd v=1 1{Yu,v = i} if Nu,i ≥⌈Ci⌉then Xu ←i Assigned ←True break end if end for if ¬ Assigned then Xu ←0 end if end for We can come up with more exact relation between number of queries m = nd 2 , δ, p, q and k. This is deferred to the appendix in the supplementary material. Proof of Theorem 5. The total number of queries is m = nd 2 . Now for a particular element u ∈V , we look at the values of d noisy oracle answers {Yu,v}d v=1. We have, E(Nu,i) = dq k−1 + dpi 1 − qk k−1  when the true label of u is i ̸= 0. When the true label is something else, E(Nu,i) = dq k−1. There is an obvious gap between these expectations. Clearly when the true label is i, the probability of error in assignment of the label of u is given by, Pi ≤P j:j̸=i,j̸=0 Pr(Nu,j > Cj) + Pr(Nu,i < Ci) ≤ cke−2dϵ2 for some constants c and ϵ depending on the gap, from Chernoff bound. And when the true label is 0, the probability of error is P0 ≤P j:j̸=0 P(Nu,j > Cj) ≤c′ke−2dϵ′2, for some constants c′, ϵ′. Let δ = P i piPi, we can easily observe that d scales as O(log k δ ). Hence the total number of queries is nd 2 = O(n log k δ ). The only thing that remains to be proved is that the number of incorrect labels is δn with high probability. Let Zu be the event that element u has been incorrectly labeled. Then EZu = δ. The total number of incorrectly labeled elements is Z = P u Zu. We have EZ = nδ. Now define Zu ∼Zv if Zu and Zv are dependent. Now ∆∗≡P Zu∼Zv Pr(Zu|Zv) ≤d2 + d because the maximum number of nodes dependent with Zu are its 1-hop and 2-hop neighbors. Now using Corollary 4.3.5 in [3], it is evident that Z = EZ = nδ almost always. The theoretical performance guarantee of Algorithm 1 (a detailed version of Theorem 5 is in the supplementary material) for k = 2 is shown in Figures 3 and 4. We can observe from Figure 3 that for a particular q, incorrect labeling decreases as p becomes higher. We can also observe from Figure 4 that if q = 0.5 then the incorrect labeling is 50% because the complete information from the oracle is lost. For other values of q, we can see that the incorrect labeling decreases with increasing d. We point out that ‘same cluster’ queries are not a good choice here, because of the symmetric nature of XOR due to which there is no gap between the expected numbers (contrary to the proof of Theorem 5) which we had exploited in the algorithm to a large extent. Lastly, we show that Algorithm 1 can work without knowing the prior distribution and only with the knowledge of relative sizes of the clusters. The ground truth clusters can be adversarial as long as they maintain the relative sizes. Theorem 6. Suppose we have ni, the number of elements with label i, i = 0, 1, . . . , k −1, as input instead of the priors. By taking a random permutation over the nodes while constructing the d-regular graph, Algorithm 1 will be (1 −δ)-good approximation with m = O(n log k δ ) queries as n →∞ when we set pi = ni n . The proof of this theorem is deferred to the appendix in the supplementary material. 8 Figure 3: Recovery error for a fixed p, d = 100 and varying q Figure 4: Recovery error for a fixed p, q and varying d Figure 5: Algorithm 1 on real crowdsourced dataset 4 Experiments Though our main contribution is theoretical we have verified our work by using our algorithm on a real dataset created by local crowdsourcing. We first picked a list of 100 ‘action’ movies and 100 ‘romantic’ movies from IMDB (http://www.imdb.com/list/ls076503982/ and http://www.imdb.com/list/ls058479560/). We then created the queries as given in the querying scheme of Sec. 3.3 by creating a d-regular graph (where d is even). To create the graph we put all the movies on a circle and took a random permutation on them in a circle. Then for each node we connected d 2 edges on either side to its closest neighbors in the permuted circular list. This random permutation will allow us to use the relative sizes of the clusters as priors as explained in Sec. 3.3. Using d = 10 , we have nd 2 = 1000 queries with each query being the following question: Are both the movies ‘action’ movies?. Now we divided these 1000 queries into 10 surveys (using SurveyMonkey platform) with each survey carrying 100 queries for the user to answer. We used 10 volunteers to fill up the survey. We instructed them not to check any resources and answer the questions spontaneously and also gave them a time limit of a maximum of 10 minutes. The average finish time of the surveys were 6 minutes. The answers represented the noisy query model since some of the answers were wrong. In total, we have found 105 erroneous answers in those 1000 queries. For each movie we evaluate the d query answer it is part of, and use different thresholds T for prediction. That is, if there are more than T ‘yes’ answers among those d answers we classified the movie as ‘action’ movie and a ‘romantic’ movie otherwise.The theoretical threshold for predicting an ‘action’ movie is T = 2 for oracle error probability q = 0.105, p = 0.5 and d = 10 . But we compared other thresholds as well. Figure 6: Comparison of ‘same cluster’ query with AND queries when both achieve 80% accuracy We now used Algorithm 1 to predict the true label vector from a subset of queries by taking ˜d edges for each node where ˜d < d and ˜d is even i.e ˜d ∈{2, 4, 6, 8, 10}. Obviously, for ˜d = 2 , the thresholds T = 3, 4 is meaningless as we always estimate the movie as ‘romantic’ and hence the distortion starts from 0.5 in that case. We plotted the error for each case against the number of queries ( n ˜d 2 ) and also plotted the theoretical distortion obtained from our results for k = 2 labels and p = 0.5, q = 0.105. We compare these results along with the theoretical distortion that we should have for q = 0.105. All these results have been compiled in Figure 5 and we can observe that the distortion is decreasing with the number of queries and the gap between the theoretical result and the experimental results is small for T = 2. These results validate our theoretical results and our algorithm to a large extent. We have also asked ‘same cluster’ queries with the same set of 1000 pairs to the participants to find that the number of erroneous responses to be 234 (whereas with AND queries it was 105). This substantiates the claim that AND queries are easier to answer for workers. Since this number of errors is too high, we have compared the performance of ‘same cluster’ queries with AND queries and our algorithm in a synthetically generated dataset with two hundred elements (Figure 6). For recovery with ‘same cluster’ queries, we have used the popular spectral clustering algorithm with normalized cuts [24]. The detailed results obtained can be found in Figure 7 in the supplementary material. 9 Acknowledgements: This research is supported in parts by NSF Awards CCF-BSF 1618512, CCF 1642550 and an NSF CAREER Award CCF 1642658. The authors thank Barna Saha for many discussions on the topics of this paper. The authors also thank the volunteers who participated in the crowdsourcing experiments for this paper. References [1] E. Abbe, A. S. Bandeira, and G. Hall. Exact recovery in the stochastic block model. IEEE Trans. Information Theory, 62(1):471–487, 2016. [2] K. Ahn, K. Lee, and C. Suh. Community recovery in hypergraphs. In Communication, Control, and Computing (Allerton), 2016 54th Annual Allerton Conference on, pages 657–663. IEEE, 2016. [3] N. Alon and J. H. Spencer. The probabilistic method. John Wiley & Sons, 2004. [4] H. Ashtiani, S. Kushagra, and S. Ben-David. Clustering with same-cluster queries. In Advances In Neural Information Processing Systems, pages 3216–3224, 2016. [5] H. Buhrman, P. B. Miltersen, J. Radhakrishnan, and S. Venkatesh. Are bitvectors optimal? SIAM Journal on Computing, 31(6):1723–1744, 2002. [6] V. B. Chandar. Sparse graph codes for compression, sensing, and secrecy. PhD thesis, Massachusetts Institute of Technology, 2010. [7] T. M. Cover and J. A. Thomas. Elements of information theory, 2nd Ed. John Wiley & Sons, 2012. [8] D. Firmani, B. Saha, and D. Srivastava. Online entity resolution using an oracle. PVLDB, 9(5):384–395, 2016. [9] A. Gruenheid, B. Nushi, T. Kraska, W. Gatterbauer, and D. Kossmann. Fault-tolerant entity resolution with the crowd. CoRR, abs/1512.00537, 2015. [10] A. Gruenheid, B. Nushi, T. Kraska, W. Gatterbauer, and D. Kossmann. Fault-tolerant entity resolution with the crowd. arXiv preprint arXiv:1512.00537, 2015. [11] B. Hajek, Y. Wu, and J. Xu. Achieving exact cluster recovery threshold via semidefinite programming: Extensions. IEEE Transactions on Information Theory, 62(10):5918–5937, 2016. [12] D. R. Karger, S. Oh, and D. Shah. Iterative learning for reliable crowdsourcing systems. In Advances in neural information processing systems, pages 1953–1961, 2011. [13] D. R. Karger, S. Oh, and D. Shah. Budget-optimal task allocation for reliable crowdsourcing systems. Operations Research, 62(1):1–24, 2014. [14] F. Lahouti and B. Hassibi. Fundamental limits of budget-fidelity trade-off in label crowdsourcing. In Advances in Neural Information Processing Systems, pages 5059–5067, 2016. [15] Q. Liu, J. Peng, and A. T. Ihler. Variational inference for crowdsourcing. In Advances in neural information processing systems, pages 692–700, 2012. [16] A. Makhdoumi, S.-L. Huang, M. M´edard, and Y. Polyanskiy. On locally decodable source coding. In Communications (ICC), 2015 IEEE International Conference on, pages 4394–4399. IEEE, 2015. [17] J. L. Massey. Joint source and channel coding. Technical report, DTIC Document, 1977. [18] A. Mazumdar, V. Chandar, and G. W. Wornell. Update-efficiency and local repairability limits for capacity approaching codes. IEEE Journal on Selected Areas in Communications, 32(5):976–988, 2014. 10 [19] A. Mazumdar, V. Chandar, and G. W. Wornell. Local recovery in data compression for general sources. In Information Theory (ISIT), 2015 IEEE International Symposium on, pages 2984– 2988. IEEE, 2015. [20] A. Mazumdar and B. Saha. A theoretical analysis of first heuristics of crowdsourced entity resolution. The Thirty-First AAAI Conference on Artificial Intelligence (AAAI-17), 2017. [21] A. Mazumdar and B. Saha. Clustering with noisy queries. In Advances in Neural Information Processing Systems (NIPS) 31, 2017. [22] A. Mazumdar and B. Saha. Query complexity of clustering with side information. In Advances in Neural Information Processing Systems (NIPS) 31, 2017. [23] A. Montanari and E. Mossel. Smooth compression, gallager bound and nonlinear sparse-graph codes. In Information Theory, 2008. ISIT 2008. IEEE International Symposium on, pages 2474–2478. IEEE, 2008. [24] A. Y. Ng, M. I. Jordan, and Y. Weiss. On spectral clustering: Analysis and an algorithm. In Advances in neural information processing systems, pages 849–856, 2002. [25] A. Pananjady and T. A. Courtade. Compressing sparse sequences under local decodability constraints. In Information Theory (ISIT), 2015 IEEE International Symposium on, pages 2979–2983. IEEE, 2015. [26] M. Patrascu. Succincter. In Foundations of Computer Science, 2008. FOCS’08. IEEE 49th Annual IEEE Symposium on, pages 305–313. IEEE, 2008. [27] D. Prelec, H. S. Seung, and J. McCoy. A solution to the single-question crowd wisdom problem. Nature, 541(7638):532–535, 2017. [28] A. Vempaty, L. R. Varshney, and P. K. Varshney. Reliable crowdsourcing for multi-class labeling using coding theory. IEEE Journal of Selected Topics in Signal Processing, 8(4):667–679, 2014. [29] V. Verroios and H. Garcia-Molina. Entity resolution with crowd errors. In 31st IEEE International Conference on Data Engineering, ICDE 2015, Seoul, South Korea, April 13-17, 2015, pages 219–230, 2015. [30] N. Vesdapunt, K. Bellare, and N. Dalvi. Crowdsourcing algorithms for entity resolution. PVLDB, 7(12):1071–1082, 2014. [31] R. K. Vinayak and B. Hassibi. Crowdsourced clustering: Querying edges vs triangles. In Advances in Neural Information Processing Systems, pages 1316–1324, 2016. [32] E. Viola. Bit-probe lower bounds for succinct data structures. SIAM Journal on Computing, 41(6):1593–1604, 2012. [33] J. Wang, T. Kraska, M. J. Franklin, and J. Feng. Crowder: Crowdsourcing entity resolution. PVLDB, 5(11):1483–1494, 2012. [34] D. Zhou, S. Basu, Y. Mao, and J. C. Platt. Learning from the wisdom of crowds by minimax entropy. In Advances in Neural Information Processing Systems, pages 2195–2203, 2012. 11
2017
86
7,227
Regularizing Deep Neural Networks by Noise: Its Interpretation and Optimization Hyeonwoo Noh Tackgeun You Jonghwan Mun Bohyung Han Dept. of Computer Science and Engineering, POSTECH, Korea {shgusdngogo,tackgeun.you,choco1916,bhhan}@postech.ac.kr Abstract Overfitting is one of the most critical challenges in deep neural networks, and there are various types of regularization methods to improve generalization performance. Injecting noises to hidden units during training, e.g., dropout, is known as a successful regularizer, but it is still not clear enough why such training techniques work well in practice and how we can maximize their benefit in the presence of two conflicting objectives—optimizing to true data distribution and preventing overfitting by regularization. This paper addresses the above issues by 1) interpreting that the conventional training methods with regularization by noise injection optimize the lower bound of the true objective and 2) proposing a technique to achieve a tighter lower bound using multiple noise samples per training example in a stochastic gradient descent iteration. We demonstrate the effectiveness of our idea in several computer vision applications. 1 Introduction Deep neural networks have been showing impressive performance in a variety of applications in multiple domains [2, 12, 20, 23, 26, 27, 28, 31, 35, 38]. Its great success comes from various factors including emergence of large-scale datasets, high-performance hardware support, new activation functions, and better optimization methods. Proper regularization is another critical reason for better generalization performance because deep neural networks are often over-parametrized and likely to suffer from overfitting problem. A common type of regularization is to inject noises during training procedure: adding or multiplying noise to hidden units of the neural networks, e.g., dropout. This kind of technique is frequently adopted in many applications due to its simplicity, generality, and effectiveness. Noise injection for training incurs a tradeoff between data fitting and model regularization, even though both objectives are important to improve performance of a model. Using more noise makes it harder for a model to fit data distribution while reducing noise weakens regularization effect. Since the level of noise directly affects the two terms in objective function, model fitting and regularization terms, it would be desirable to maintain proper noise levels during training or develop an effective training algorithm given a noise level. Between these two potential directions, we are interested in the latter, more effective training. Within the standard stochastic gradient descent framework, we propose to facilitate optimization of deep neural networks with noise added for better regularization. Specifically, by regarding noise injected outputs of hidden units as stochastic activations, we interpret that the conventional training strategy optimizes the lower bound of the marginal likelihood over the hidden units whose values are sampled with a reparametrization trick [18]. Our algorithm is motivated by the importance weighted autoencoders [7], which are variational autoencoders trained for tighter variational lower bounds using more samples of stochastic variables 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. per training example in a stochastic gradient descent iteration. Our novel interpretation of noise injected hidden units as stochastic activations enables the lower bound analysis of [7] to be naturally applied to training deep neural networks with regularization by noise. It introduces the importance weighted stochastic gradient descent, a variant of the standard stochastic gradient descent, which employs multiple noise samples in an iteration for each training example. The proposed training strategy allows trained models to achieve good balance between model fitting and regularization. Although our method is general for various regularization techniques by noise, we mainly discuss its special form, dropout—one of the most famous methods for regularization by noise. The main contribution of our paper is three-fold: • We present that the conventional training with regularization by noise is equivalent to optimizing the lower bound of the marginal likelihood through a novel interpretation of noise injected hidden units as stochastic activations. • We derive the importance weighted stochastic gradient descent for regularization by noise through the lower bound analysis. • We demonstrate that the importance weighted stochastic gradient descent often improves performance of deep neural networks with dropout, a special form of regularization by noise. The rest of the paper is organized as follows. Section 2 discusses prior works related to our approach. We describe our main idea and instantiation to dropout in Section 3 and 4, respectively. Section 5 analyzes experimental results on various applications and Section 6 makes our conclusion. 2 Related Work Regularization by noise is a common technique to improve generalization performance of deep neural networks, and various implementations are available depending on network architectures and target applications. A well-known example is dropout [34], which randomly turns off a subset of hidden units of neural networks by multiplying noise sampled from a Bernoulli distribution. In addition to the standard form of dropout, there exist several variations of dropout designed to further improve generalization performance. For example, Ba et al. [3] proposed adaptive dropout, where dropout rate is determined by another neural network dynamically. Li et al. [22] employ dropout with a multinormial distribution, instead of a Bernoulli distribution, which generates noise by selecting a subset of hidden units out of multiple subsets. Bulo et al. [6] improve dropout by reducing gap between training and inference procedure, where the output of dropout layers in inference stage is given by learning expected average of multiple dropouts. There are several related concepts to dropout, which can be categorized as regularization by noise. In [17, 37], noise is added to weights of neural networks, not to hidden states. Learning with stochastic depth [15] and stochastic ensemble learning [10] can also be regarded as noise injection techniques to weights or architecture. Our work is differentiated with the prior study in the sense that we improve generalization performance using better training objective while dropout and its variations rely on the original objective function. Originally, dropout is proposed with interpretation as an extreme form of model ensemble [20, 34], and this intuition makes sense to explain good generalization performance of dropout. On the other hand, [36] views dropout as an adaptive regularizer for generalized linear models and [16] claims that dropout is effective to escape local optima for training deep neural networks. In addition, [9] uses dropout for estimating uncertainty based on Bayesian perspective. The proposed training algorithm is based on a novel interpretation of training with regularization by noise as training with latent variables. Such understanding is distinguishable from the existing views on dropout, and provides a probabilistic formulation to analyze dropout. A similar interpretation to our work is proposed in [24], but it focuses on reducing gap between training and inference steps of using dropout while our work proposes to use a novel training objective for better regularization. Our goal is to formulate a stochastic model for regularization by noise and propose an effective training algorithm given a predefined noise level within a stochastic gradient descent framework. A closely related work is importance weighted autoencoder [7], which employs multiple samples weighted by importance to compute gradients and improve performance. This work shows that the importance weighted stochastic gradient descent method achieves a tighter lower-bound of the ideal marginal likelihood over latent variables than the variational lower bound. It also presents that the 2 bound becomes tighter as the number of samples for the latent variables increases. The importance weighted objective has been applied to various applications such as generative modeling [5, 7], training binary stochastic feed-forward networks [30] and training recurrent attention models [4]. This idea is extended to discrete latent variables in [25]. 3 Proposed Method This section describes the proposed importance weighted stochastic gradient descent using multiple samples in deep neural networks for regularization by noise. 3.1 Main Idea The premise of our paper is that injecting noise into deterministic hidden units constructs stochastic hidden units. Noise injection during training obviously incurs stochastic behavior of the model and the optimizer. By defining deterministic hidden units with noise as stochastic hidden units, we can exploit well-defined probabilistic formulations to analyze the conventional training procedure and propose approaches for better optimization. Suppose that a set of activations over all hidden units across all layers, z, is given by z = g(hφ(x), ϵ) ∼pφ(z|x), (1) where hφ(x) is a deterministic activations of hidden units for input x and model parameters φ. A noise injection function g(·, ·) is given by addition or multiplication of activation and noise, where ϵ denotes noise sampled from a certain probability distribution such as Gaussian distribution. If this premise is applied to dropout, the noise ϵ means random selections of hidden units in a layer and the random variable z indicates the activation of the hidden layer given a specific sample of dropout. Training a neural network with stochastic hidden units requires optimizing the marginal likelihood over the stochastic hidden units z, which is given by Lmarginal = log Epφ(z|x) [pθ(y|z, x)] , (2) where pθ(y|z, x) is an output probability of ground-truth y given input x and hidden units z, and θ is the model parameter for the output prediction. Note that the expectation over training data Ep(x,y) outside the logarithm is omitted for notational simplicity. For marginalization of stochastic hidden units constructed by noise, we employ the reparameterization trick proposed in [18]. Specifically, random variable z is replaced by Eq. (1) and the marginalization is performed over noise, which is given by Lmarginal = log Ep(ϵ) [pθ(y|g(hφ(x), ϵ), x)] , (3) where p(ϵ) is the distribution of noise. Eq. (3) means that training a noise injected neural network requires optimizing the marginal likelihood over noise ϵ. 3.2 Importance Weighted Stochastic Gradient Descent We now describe how the marginal likelihood in Eq. (3) is optimized in a SGD (Stochastic Gradient Descent) framework and propose the IWSGD (Importance Weighted Stochastic Gradient Descent) method derived from the lower bound introduced by the SGD. 3.2.1 Objective In practice, SGD estimates the marginal likelihood in Eq. (3) by taking expectation over multiple sets of noisy samples, where we computes a marginal log-likelihood for a finite number of noise samples in each set. Therefore, the real objective for SGD is as follows: Lmarginal ≈LSGD(S) = Ep(E) " log 1 S X ϵ∈E pθ(y|g(hφ(x), ϵ), x) # , (4) where S is the number of noise samples for each training example and E = {ϵ1, ϵ2, ..., ϵS} is a set of noises. 3 The main observation from Burda et al. [7] is that the SGD objective in Eq. (4) is the lower-bound of the marginal likelihood in Eq. (3), which is held by Jensen’s inequality as LSGD(S) = Ep(E) " log 1 S X ϵ∈E pθ(y|g(hφ(x), ϵ), x) # ≤log Ep(E) " 1 S X ϵ∈E pθ(y|g(hφ(x), ϵ), x) # = log Ep(ϵ) [pθ(y|g(hφ(x), ϵ), x)] = Lmarginal, (5) where Ep(ϵ) [f(ϵ)] = Ep(E)  1 S P ϵ∈E f(ϵ)  for an arbitrary function f(·) over ϵ if the cardinality of E is equal to S. This characteristic makes the number of noise samples S directly related to the tightness of the lower-bound as Lmarginal ≥LSGD(S + 1) ≥LSGD(S). (6) Refer to [7] for the proof of Eq. (6). Based on this observation, we propose to use LSGD (S > 1) as an objective of IWSGD. Note that the conventional training procedure for regularization by noise such as dropout [34] relies on the objective with S = 1 (Section 4). Thus, we show that using more samples achieves tighter lower-bound and that the optimization by IWSGD has great potential to improve accuracy by proper regularization. 3.2.2 Training Training with IWSGD is achieved by computing the weighted average of gradients obtained from multiple noise samples ϵ. This training strategy is based on the derivative of IWSGD objective with respect to the model parameters θ and φ, which is given by ∇θ,φLSGD(S) = ∇θ,φEp(E) " log 1 S X ϵ∈E pθ(y|g(hφ(x), ϵ), x) # = Ep(E) " ∇θ,φlog 1 S X ϵ∈E pθ(y|g(hφ(x), ϵ), x) # = Ep(E) ∇θ,φ P ϵ∈E pθ(y|g(hφ(x), ϵ), x) P ϵ′∈E pθ(y|g(hφ(x), ϵ′), x)  = Ep(E) "X ϵ∈E wϵ∇θ,φlog pθ (y|g(hφ(x), ϵ), x) # , (7) where wϵ denotes an importance weight with respect to sample noise ϵ and is given by wϵ = pθ (y|g(hφ(x), ϵ), x) P ϵ′∈E pθ (y|g(hφ(x), ϵ′), x). (8) Note that the weight of each sample is equal to the normalized likelihood of the sample. For training, we first draw a set of noise samples E and perform forward and backward propagation for each noise sample ϵ ∈E to compute likelihoods and corresponding gradients. Then, importance weights are computed by Eq. (8), and employed to compute the weighted average of gradients. Finally, we optimize the model by SGD with the importance weighted gradients. 3.2.3 Inference Inference in the IWSGD is same as the standard dropout; input activations to each dropout layer are scaled based on dropout probability, rather than taking a subset of activations stochastically. Therefore, compared to the standard dropout, neither additional sampling nor computation is required during inference. 4 Figure 1: Implementation detail of IWSGD for dropout optimization. We compute a weighted average of the gradients from multiple dropout masks. For each training example the gradients for multiple dropout masks are independently computed and are averaged with importance weights in Eq. (8). 3.3 Discussion One may argue that the use of multiple samples is equivalent to running multiple iterations either theoretically or empirically. It is difficult to derive the aggregated lower bounds of the marginal likelihood over multiple iterations since the model parameters are updated in every iteration. However, we observed that performance with a single sample is saturated easily and it is unlikely to achieve better accuracy with additional iterations than our algorithm based on IWSGD, as presented in Section 5.1. 4 Importance Weighted Stochastic Gradient Descent for Dropout This section describes how the proposed idea is realized in the context of dropout, which is one of the most popular techniques for regularization by noise. 4.1 Analysis of Conventional Dropout For training with dropout, binary dropout masks are sampled from a Bernoulli distribution. The hidden activations below dropout layers, denoted by h(x), are either kept or discarded by elementwise multiplication with a randomly sampled dropout mask ϵ; activations after the dropout layers are denoted by g(hφ(x), ϵ). The objective of SGD optimization is obtained by averaging log-likelihoods, which is formally given by Ldropout = Ep(ϵ) [log pθ(y|g(hφ(x), ϵ), x)] , (9) where the outermost expectation over training data Ep(x,y) is omitted for simplicity as mentioned earlier. Note that the objective in Eq. (9) is a special case of the objective of IWSGD with S = 1. This implies that the conventional dropout training optimizes the lower-bound of the ideal marginal likelihood, which is improved by increasing the number of dropout masks for each training example in an iteration. 4.2 Training Dropout with Tighter Lower-bound Figure 1 illustrates how IWSGD is employed to train with dropout layers for regularization. Following the same training procedure described in Section 3.2.2, we sample multiple dropout masks as a realization of the multiple noise sampling. 5 (a) Test error in CIFAR 10 (depth=28) (b) Test error in CIFAR-100 (depth=28) Figure 2: Impact of multi-sample training in CIFAR datasets with variable dropout rates. These results are with wide residual net (widening factor=10, depth=28). Each data point and error bar are computed from 3 trials with different seeds. The results show that using IWSGD with multiple samples consistently improves the performance and the results are not sensitive to dropout rates. Table 1: Comparison with various models in CIFAR datasets. We achieve the near state-of-the-art performance by applying the multi-sample objective to wide residual network [40]. Note that ×4 iterations means a model trained with 4 times more iterations. The test errors of our implementations (including reproduction of [40]) are obtained from the results with 3 different seeds. The numbers within parentheses denote the standard deviations of test errors. CIFAR-10 CIFAR-100 ResNet [12] 6.43 ResNet with Stochastic Depth [15] 4.91 24.58 FractalNet with Dropout [21] 4.60 23.73 ResNet (pre-activation) [13] 4.62 22.71 PyramidNet [11] 3.77 18.29 Wide ResNet (depth=40) [40] 3.80 18.30 DenseNet [14] 3.46 17.18 Wide ResNet (depth=28, dropout=0.3) [40] 3.89 18.85 Wide ResNet (depth=28, dropout=0.5) (×4 iterations) 4.48 (0.15) 20.70 (0.19) Wide ResNet (depth=28, dropout=0.5) (reproduced) 3.88 (0.15) 19.12 (0.24) Wide ResNet (depth=28, dropout=0.5) with IWSGD (S = 4) 3.58 (0.05) 18.01 (0.16) Wide ResNet (depth=28, dropout=0.5) with IWSGD (S = 8) 3.55 (0.11) 17.63 (0.13) The use of IWSGD for optimization requires only minor modifications in implementation. This is because the gradient computation part in the standard dropout is reusable. The gradient for the standard dropout is given by ∇θ,φLdropout = Ep(ϵ) [∇θ,φlogpθ (y|g(hφ(x), ϵ), x)] . (10) Note that this is actually unweighted version of the final line in Eq. (7). Therefore, the only additional component for IWSGD is about weighting gradients with importance weights. This property makes it easy to incorporate IWSGD into many applications with dropout. 5 Experiments We evaluate the proposed training algorithm in various architectures for real world tasks including object recognition [40], visual question answering [39], image captioning [35] and action recognition [8]. These models are chosen for our experiments since they use dropouts actively for regularization. To isolate the effect of the proposed training method, we employ simple models without integrating heuristics for performance improvement (e.g., model ensembles, multi-scaling, etc.) and make hyper-parameters (e.g., type of optimizer, learning rate, batch size, etc.) fixed. 6 Table 2: Accuracy on VQA test-dev dataset. Our re-implementation of SAN [39] is used as baseline. Increasing the number of samples S with IWSGD consistently improves performance. Open-Ended Multiple-Choice All Y/N Num Others All Y/N Num Others SAN [39] 58.68 79.28 36.56 46.09 SAN with 2-layer LSTM (reproduced) 60.19 79.69 36.74 48.84 64.77 79.72 39.03 57.82 with IWSGD (S = 5) 60.31 80.74 34.70 48.66 65.01 80.73 36.36 58.05 with IWSGD (S = 8) 60.41 80.86 35.56 48.56 65.21 80.77 37.56 58.18 5.1 Object Recognition The proposed algorithm is integrated into wide residual network [40], which uses dropout in every residual block, and evaluated on CIFAR datasets [19]. This network shows the accuracy close to the state-of-the-art performance in both CIFAR 10 and CIFAR 100 datasets with data augmentation. We use the publicly available implementation1 by the authors of [40] and follow all the implementation details in the original paper. Figure 2 presents the impact of IWSGD with multiple samples. We perform experiments using the wide residual network with widening factor 10 and depth 28. Each experiment is performed 3 times with different seeds in CIFAR datasets and test errors with corresponding standard deviations are reported. The baseline performance is from [40], and we also report the reproduced results by our implementation, which is denoted by Wide ResNet (reproduced). The result by the proposed algorithm is denoted by IWSGD together with the number of samples S. Training with IWSGD with multiple samples clearly improves performance as illustrated in Figure 2. It also presents that, as the number of samples increases, the test errors decrease even more both on CIFAR-10 and CIFAR-100, regardless of the dropout rate. Another observation is that the results from the proposed multi-sample training strategy are not sensitive to dropout rates. Using IWSGD with multiple samples to train the wide residual network enables us to achieve the near state-of-the-art performance on CIFAR datasets. As illustrated in Table 1, the accuracy of the model with S = 8 samples is very close to the state-of-the-art performance for CIFAR datasets, which is based on another architecture [14]. To illustrate the benefit of our algorithm compared to the strategy to simply increase the number of iterations, we evaluate the performance of the model trained with 4 times more iterations, which is denoted by ×4 iterations. Note that the model with more iterations does not improve the performance as discussed in Section 3.3. We believe that the simple increase of the number of iterations is likely to overfit the trained model. 5.2 Visual Question Answering Visual Question Answering (VQA) [2] is a task to answer a question about a given image. Input of this task is a pair of an image and a question, and output is an answer to the question. This task is typically formulated as a classification problem with multi-modal inputs [1, 29, 39]. To train models and run experiments, we use VQA dataset [2], which is commonly used for the evaluation of VQA algorithms. There are two different kinds of tasks: open-ended and multiplechoice task. The model predicts an answer for an open-ended task without knowing predefined set of candidate answers while selecting one of candidate answers in multiple-choice task. We evaluate the proposed training method using a baseline model, which is similar to [39] but has a single stack of attention layer. For question features, we employ a two-layer LSTM based on word embedding2, while using activations from pool5 layer of VGG-16 [32] for image features. Table 2 presents the results of our experiment for VQA. SAN with 2-layer LSTM denotes our baseline with the standard dropout. This method already outperforms the comparable model with spatial attention [39] possibly due to the use of a stronger question encoder, two-layer LSTM. When we evaluate performance of IWSGD with 5 and 8 samples, we observe consistent performance improvement of our algorithm with increase of the number of samples. 1https://github.com/szagoruyko/wide-residual-networks 2https://github.com/VT-vision-lab/VQA_LSTM_CNN 7 Table 3: Results on MSCOCO test dataset for image captioning. For BLEU metric, we use BLEU-4, which is computed based on 4-gram words, since the baseline method [35] reported BLEU-4 only. BLEU METEOR CIDEr Google-NIC [35] 27.7 23.7 85.5 Google-NIC (reproduced) 26.8 22.6 82.2 with IWSGD (S = 5) 27.5 22.9 83.6 Table 4: Average classification accuracy of compared algorithms over three splits on UCF-101 dataset. TwoStreamFusion (reproduced) denotes our reproduction based on the public source code. Method UCF-101 TwoStreamFusion [8] 92.50 % TwoStreamFusion (reproduced) 92.49 % with IWSGD (S = 5) 92.73 % with IWSGD (S = 10) 92.69 % with IWSGD (S = 15) 92.72 % 5.3 Image Captioning Image captioning is a problem generating a natural language description given an image. This task is typically handled by an encoder-decoder network, where a CNN encoder transforms an input image into a feature vector and an LSTM decoder generates a caption from the feature by predicting words one by one. A dropout layer is located on top of the hidden state in LSTM decoder. To evaluate the proposed training method, we exploit a publicly available implementation3 whose model is identical to the standard encoder-decoder model of [35], but uses VGG-16 [32] instead of GoogLeNet as a CNN encoder. We fix the parameters of VGG-16 network to follow the implementation of [35]. We use MSCOCO dataset for experiment, and evaluate models with several metrics (BLEU, METEOR and CIDEr) using the public MSCOCO caption evaluation tool. These metrics measure precision or recall of n-gram words between the generated captions and the ground-truths. Table 3 summarizes the results on image captioning. Google-NIC is the reported scores in the original paper [35] while Google-NIC (reproduced) denotes the results of our reproduction. Our reproduction has slightly lower accuracy due to use of a different CNN encoder. IWSGD with 5 samples consistently improves performance in terms of all three metrics, which indicates our training method is also effective to learn LSTMs. 5.4 Action Recognition Action recognition is a task recognizing a human action in videos. We employ a well-known benchmark of action classification, UCF-101 [33], for evaluation, which has 13,320 trimmed videos annotated with 101 action categories. The dataset has three splits for cross validation, and the final performance is calculated by the average accuracy of the three splits. We employ a variation of two-stream CNN proposed by [8], which shows competitive performance on UCF-101. The network consists of three subnetworks: a spatial stream network for image, a temporal stream network for optical flow and a fusion network for combining the two-stream networks. We apply our IWSGD only to fine-tuning the fusion unit for training efficiency. Our implementation is based on the public source code4. Hyper-parameters such as dropout rate and learning rate scheduling is the same as the baseline model [8]. Table 4 illustrates performance improvement by integrating IWSGD but the overall tendency with increase of the number of samples is not consistent. We suspect that this is because the performance of the model is already saturated and there is no much room for improvement through fine-tuning only the fusion unit. 3https://github.com/karpathy/neuraltalk2 4http://www.robots.ox.ac.uk/~vgg/software/two_stream_action/ 8 6 Conclusion We proposed an optimization method for regularization by noise, especially for dropout, in deep neural networks. This method is based on a novel interpretation of noise injected deterministic hidden units as stochastic hidden ones. Using this interpretation, we proposed to use IWSGD (Importance Weighted Stochastic Gradient Descent), which achieves tighter lower bounds as the number of samples increases. We applied the proposed optimization method to dropout, a special case of the regularization by noise, and evaluated on various visual recognition tasks: image classification, visual question answering, image captioning and action classification. We observed the consistent improvement of our algorithm over all tasks, and achieved near state-of-the-art performance on CIFAR datasets through better optimization. We believe that the proposed method may improve many other deep neural network models with dropout layers. Acknowledgement This work was supported by the IITP grant funded by the Korea government (MSIT) [2017-0-01778, Development of Explainable Human-level Deep Machine Learning Inference Framework; 2017-0-01780, The Technology Development for Event Recognition/Relational Reasoning and Learning Knowledge based System for Video Understanding]. References [1] J. Andreas, M. Rohrbach, T. Darrell, and D. Klein. Neural module networks. In CVPR, 2016. [2] S. Antol, A. Agrawal, J. Lu, M. Mitchell, D. Batra, C. Lawrence Zitnick, and D. Parikh. VQA: visual question answering. In ICCV, 2015. [3] J. Ba and B. Frey. Adaptive dropout for training deep neural networks. In NIPS, 2013. [4] J. Ba, R. R. Salakhutdinov, R. B. Grosse, and B. J. Frey. Learning wake-sleep recurrent attention models. In NIPS, 2015. [5] J. Bornschein and Y. Bengio. Reweighted wake-sleep. In ICLR, 2015. [6] S. R. Bulo, L. Porzi, and P. Kontschieder. Dropout distillation. In ICML, 2016. [7] Y. Burda, R. Grosse, and R. Salakhutdinov. Importance weighted autoencoders. In ICLR, 2016. [8] C. Feichtenhofer, A. Pinz, and A. Zisserman. Convolutional two-stream network fusion for video action recognition. In CVPR, 2016. [9] Y. Gal and Z. Ghahramani. Dropout as a bayesian approximation: Representing model uncertainty in deep learning. In ICML, 2016. [10] B. Han, J. Sim, and H. Adam. Branchout: Regularization for online ensemble tracking with convolutional neural networks. In CVPR, 2017. [11] D. Han, J. Kim, and J. Kim. Deep pyramidal residual networks. CVPR, 2017. [12] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In CVPR, 2016. [13] K. He, X. Zhang, S. Ren, and J. Sun. Identity mappings in deep residual networks. In ECCV, 2016. [14] G. Huang, Z. Liu, K. Q. Weinberger, and L. van der Maaten. Densely connected convolutional networks. CVPR, 2017. [15] G. Huang, Y. Sun, Z. Liu, D. Sedra, and K. Q. Weinberger. Deep networks with stochastic depth. In ECCV, 2016. [16] P. Jain, V. Kulkarni, A. Thakurta, and O. Williams. To drop or not to drop: Robustness, consistency and differential privacy properties of dropout. arXiv preprint arXiv:1503.02031, 2015. [17] D. P. Kingma, T. Salimans, and M. Welling. Variational dropout and the local reparameterization trick. In NIPS, 2015. [18] D. P. Kingma and M. Welling. Auto-encoding variational bayes. In ICLR, 2014. [19] A. Krizhevsky. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009. [20] A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. In NIPS, 2012. [21] G. Larsson, M. Maire, and G. Shakhnarovich. Fractalnet: Ultra-deep neural networks without residuals. ICLR, 2017. [22] Z. Li, B. Gong, and T. Yang. Improved dropout for shallow and deep learning. In NIPS, 2016. 9 [23] J. Long, E. Shelhamer, and T. Darrell. Fully convolutional networks for semantic segmentation. In CVPR, 2015. [24] X. Ma, Y. Gao, Z. Hu, Y. Yu, Y. Deng, and E. Hovy. Dropout with expectation-linear regularization. In ICLR, 2016. [25] A. Mnih and D. Rezende. Variational inference for monte carlo objectives. In ICML, 2016. [26] 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. [27] H. Nam and B. Han. Learning multi-domain convolutional neural networks for visual tracking. In CVPR, 2016. [28] H. Noh, S. Hong, and B. Han. Learning deconvolution network for semantic segmentation. In ICCV, 2015. [29] H. Noh, S. Hong, and B. Han. Image question answering using convolutional neural network with dynamic parameter prediction. In CVPR, 2016. [30] T. Raiko, M. Berglund, G. Alain, and L. Dinh. Techniques for learning binary stochastic feedforward neural networks. In ICLR, 2015. [31] S. Ren, K. He, R. Girshick, and J. Sun. Faster R-CNN: Towards real-time object detection with region proposal networks. In NIPS, 2015. [32] K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. In ICLR, 2015. [33] 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. [34] N. Srivastava, G. E. Hinton, A. Krizhevsky, I. Sutskever, and R. Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. JMLR, 15(1):1929–1958, 2014. [35] O. Vinyals, A. Toshev, S. Bengio, and D. Erhan. Show and tell: A neural image caption generator. In CVPR, 2015. [36] S. Wager, S. Wang, and P. S. Liang. Dropout training as adaptive regularization. In NIPS, 2013. [37] L. Wan, M. Zeiler, S. Zhang, Y. LeCun, and R. Fergus. Regularization of neural networks using dropconnect. In ICML, 2013. [38] Y. Wu, M. Schuster, Z. Chen, Q. V. Le, M. Norouzi, W. Macherey, M. Krikun, Y. Cao, Q. Gao, K. Macherey, et al. Google’s neural machine translation system: Bridging the gap between human and machine translation. arXiv preprint arXiv:1609.08144, 2016. [39] Z. Yang, X. He, J. Gao, L. Deng, and A. Smola. Stacked attention networks for image question answering. In CVPR, 2016. [40] S. Zagoruyko and N. Komodakis. Wide residual networks. In BMVC, 2016. 10
2017
87
7,228
Few-Shot Adversarial Domain Adaptation Saeid Motiian, Quinn Jones, Seyed Mehdi Iranmanesh, Gianfranco Doretto Lane Department of Computer Science and Electrical Engineering West Virginia University {samotiian, qjones1, seiranmanesh, gidoretto}@mix.wvu.edu Abstract This work provides a framework for addressing the problem of supervised domain adaptation with deep models. The main idea is to exploit adversarial learning to learn an embedded subspace that simultaneously maximizes the confusion between two domains while semantically aligning their embedding. The supervised setting becomes attractive especially when there are only a few target data samples that need to be labeled. In this few-shot learning scenario, alignment and separation of semantic probability distributions is difficult because of the lack of data. We found that by carefully designing a training scheme whereby the typical binary adversarial discriminator is augmented to distinguish between four different classes, it is possible to effectively address the supervised adaptation problem. In addition, the approach has a high “speed” of adaptation, i.e. it requires an extremely low number of labeled target training samples, even one per category can be effective. We then extensively compare this approach to the state of the art in domain adaptation in two experiments: one using datasets for handwritten digit recognition, and one using datasets for visual object recognition. 1 Introduction As deep learning approaches have gained prominence in computer vision we have seen tasks that have large amounts of available labeled data flourish with improved results. There are still many problems worth solving where labeled data on an equally large scale is too expensive to collect, annotate, or both, and by extension a straightforward deep learning approach would not be feasible. Typically, in such a scenario, practitioners will train or reuse a model from a closely related dataset with a large amount of samples, here called the source domain, and then train with the much smaller dataset of interest, referred to as the target domain. This process is well-known under the name finetuning. Finetuning, while simple to implement, has been found to be sub-optimal when compared to later techniques such as domain adaptation [5]. Domain Adaptation can be supervised [58, 27], unsupervised [15, 34], or semi-supervised [16, 21, 63], depending on what data is available in a labeled format and how much can be collected. Unsupervised domain adaptation (UDA) algorithms do not need any target data labels, but they require large amounts of target training samples, which may not always be available. Conversely, supervised domain adaptation (SDA) algorithms do require labeled target data, and because labeling information is available, for the same quantity of target data, SDA outperforms UDA [38]. Therefore, if the available target data is scarce, SDA becomes attractive, even if the labeling process is expensive, because only few samples need to be processed. Most domain adaptation approaches try to find a feature space such that the confusion between source and target distributions in that space is maximum (domain confusion). Because of that, it is hard to say whether a sample in the feature space has come from the source distribution or the target distribution. Recently, generative adversarial networks [18] have been introduced for image generation which can also be used for domain adaptation. In [18], the goal is to learn a discriminator 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. G2 1 G3 1 G4 1 G1 1 Figure 1: Examples from MNIST [32] and SVHN [40] of grouped sample pairs. G1 is composed of samples of the same class from the source dataset in this case MNIST. G2 is composed of samples of the same class, but one is from the source dataset and the other is from the target dataset. In G3 the samples in each pair are from the source dataset but with differing class labels. Finally, pairs in G4 are composed of samples from the target and source datasets with differing class labels. to distinguish between real samples and generated (fake) samples and then to learn a generator which best confuses the discriminator. Domain adaptation can also be seen as a generative adversarial network with one difference, in domain adaptation there is no need to generate samples, instead, the generator network is replaced with an inference network. Since the discriminator cannot determine if a sample is from the source or the target distribution the inference becomes optimal in terms of creating a joint latent space. In this manner, generative adversarial learning has been successfully modified for UDA [33, 59, 49] and provided very promising results. Here instead, we are interested in adapting adversarial learning for SDA which we are calling few-shot adversarial domain adaptation (FADA) for cases when there are very few labeled target samples available in training. In this few-shot learning regime, our SDA method has proven capable of increasing a model’s performance at a very high rate with respect to the inclusion of additional samples. Indeed, even one additional sample can significantly increase performance. Our first contribution is to handle this scarce data while providing effective training. Our second contribution is to extend adversarial learning [18] to exploit the label information of target samples. We propose a novel way of creating pairs of samples using source and target samples to address the first challenge. We assign a group label to a pair according to the following procedure: 0 if samples of a pair come from the source distribution and the same class label, 1 if they come from the source and target distributions but the same class label, 2 if they come from the source distribution but different class labels, and 3 if they come from the source and target distributions and have different class labels. The second challenge is addressed by using adversarial learning [18] to train a deep inference function, which confuses a well-trained domain-class discriminator (DCD) while maintaining a high classification accuracy for the source samples. The DCD is a multi-class classifier that takes pairs of samples as input and classifies them into the above four groups. Confusing the DCD will encourage domain confusion, as well as the semantic alignment of classes. Our third contribution is an extensive validation of FADA against the state-of-the-art. Although our method is general, and can be used for all domain adaptation applications, we focus on visual recognition. 2 Related work Naively training a classifier on one dataset for testing on another is known to produce sub-optimal results, because an effect known as dataset bias [42, 57, 56] or covariate shift [51] occurs due to a difference in the distributions of the images between the datasets. Prior work in domain adaptation has minimized this shift largely in three ways. Some try to find a function which can map from the source domain to the target domain [47, 28, 19, 16, 11, 55, 52]. Others find a shared latent space that both domains can be mapped to before classification [35, 2, 39, 13, 14, 41, 37, 38]. Finally, some use regularization to improve the fit on the target domain [4, 1, 62, 10, 3, 8]. UDA can leverage the first two approaches while SDA uses the second, third, or a combination of the two approaches. In addition to these methods, [6, 36, 50] have addressed UDA when an auxiliary data view [31, 37], is available during training, but that is beyond the scope of this work. For this approach we are focused on finding a shared subspace for both the source and target distributions. Siamese networks [7] work well for subspace learning and have worked very well with deep convolutional neural networks [9, 53, 30, 61]. Siamese networks have also been useful in 2 Source g 1 h 1 φ 1 h 1 Loss (1) (a) (b) (c) Loss (3) Loss (1) Loss (4) DCD G2 1 G2 1 Loss (1) Figure 2: Few-shot adversarial domain adaptation. For simplicity we show our networks in the case of weight sharing (gs = gt = g). (a) In the first step, we initialized g and h using the source samples Ds. (b) We freeze g and train a DCD. The picture shows a pair from the second group G2 when the samples come from two different distributions but the same class label. (c) We freeze the DCD and update g and h. domain adaptation recently. In [58], which is a deep SDA approach, unlabeled and sparsely labeled target domain data are used to optimize for domain invariance to facilitate domain transfer while using a soft label distribution matching loss. In [54], which is a deep UDA approach, unlabeled target data is used to learn a nonlinear transformation that aligns correlations of layer activations in deep neural networks. Some approaches went beyond Siamese weight-sharing and used couple networks for DA. [27] uses two CNN streams, for source and target, fused at the classifier level. [45], which is a deep UDA approach and can be seen as an SDA after fine-tuning, also uses a two-streams architecture, for source and target, with related but not shared weights. [38], which is an SDA approach, creates positive and negative pairs using source and target data and then finds a shared feature space between source and target by bringing together the positive pairs and pushing apart the negative pairs. Recently, adversarial learning [18] has shown promising results in domain adaptation and can be seen as examples of the second category. [33] introduced a coupled generative adversarial network (CoGAN) for learning a joint distribution of multi-domain images for different applications including UDA. [59] has used the adversarial loss for discriminative UDA. [49] introduces an approach that leverages unlabeled data to bring the source and target distributions closer by inducing a symbiotic relationship between the learned embedding and a generative adversarial framework. Here we use adversarial learning to train inference networks such that samples from different distributions are not distinguishable. We consider the task where very few labeled target data are available in training. With this assumption, it is not possible to use the standard adversarial loss used in [33, 59, 49], because the training target data would be insufficient. We address that problem by modifying the usual pairing technique used in many applications such as learning similarity metrics [7, 23, 22]. Our pairing technique encodes domain labels as well as class labels of the training data (source and target samples), producing four groups of pairs. We then introduce a multi-class discriminator with four outputs and design an adversarial learning strategy to find a shared feature space. Our method also encourages the semantic alignment of classes, while other adversarial UDA approaches do not. 3 Few-shot adversarial domain adaptation In this section we describe the model we propose to address supervised domain adaptation (SDA). We are given a training dataset made of pairs Ds = {(xs i, ys i )}N i=1. The feature xs i ∈X is a realization from a random variable Xs, and the label ys i ∈Y is a realization from a random variable Y s. In addition, we are also given the training data Dt = {(xt i, yt i)}M i=1, where xt i ∈X is a realization from a random variable Xt, and the labels yt i ∈Y. We assume that there is a covariate shift [51] between Xs and Xt, i.e., there is a difference between the probability distributions p(Xs) and p(Xt). We say that Xs represents the source domain and that Xt represents the target domain. Under this settings the goal is to learn a prediction function f : X →Y that during testing is going to perform well on data from the target domain. The problem formulated thus far is typically referred to as supervised domain adaptation. In this work we are especially concerned with the version of this problem where only very few target labeled 3 Algorithm 1 FADA algorithm 1: Train g and h on Ds using (1). 2: Uniformly sample G1,G3 from DsxDs. 3: Uniformly sample G2,G4 from DsxDt. 4: Train DCD w.r.t. gt = gs = g using (3). 5: while not convergent do 6: Update g and h by minimizing (5). 7: Update DCD by minimizing (3). 8: end while samples per class are available. We aim at handling cases where there is only one target labeled sample, and there can even be some classes with no target samples at all. In absence of covariate shift a visual classifier f is trained by minimizing a classification loss LC(f) = E[ℓ(f(Xs), Y )] , (1) where E[·] denotes statistical expectation and ℓcould be any appropriate loss function. When the distributions of Xs and Xt are different, a deep model fs trained with Ds will have reduced performance on the target domain. Increasing it would be trivial by simply training a new model ft with data Dt. However, Dt is small and deep models require large amounts of labeled data. In general, f could be modeled by the composition of two functions, i.e., f = h ◦g. Here g : X →Z would be an inference from the input space X to a feature or inference space Z, and h : Z →Y would be a function for predicting from the feature space. With this notation we would have fs = hs ◦gs and ft = ht ◦gt, and the SDA problem would be about finding the best approximation for gt and ht, given the constraints on the available data. If gs and gt are able to embed source and target samples, respectively, to a domain invariant space, it is safe to assume from the feature to the label space that ht = hs = h. Therefore, domain adaptation paradigms are looking for such inference functions so that they can use the prediction function hs for target samples. Traditional unsupervised DA (UDA) paradigms try to align the distributions of the features in the feature space, mapped from the source and the target domains using a metric between distributions, Maximum Mean Discrepancy [20] being a popular one and other metrics like Kullback Leibler divergence [29] and Jensen–Shannon [18] divergence becoming popular when using adversarial learning. Once they are aligned, a classifier function would no longer be able to tell whether a sample is coming from the source or the target domain. Recent UDA paradigms try to find inference functions to satisfy this important goal using adversarial learning. Adversarial training looks for a domain discriminator D that is able to distinguish between samples of source and target distributions. In this case D is a binary classifier trained with the standard cross-entropy loss Ladv−D(Xs, Xt, gs, gt) = −E[log(D(gs(Xs)))] −E[log(1 −D(gt(Xt)))] . (2) Once the discriminator is learned, adversarial learning tries to update the target inference function gt in order to confuse the discriminator. In other words, the adversarial training is looking for an inference function gt that is able to map a target sample to a feature space such that the discriminator D will no longer distinguish it from a source sample. From the above discussion it is clear that in order to perform well, UDA needs to align the distributions effectively in order to be successful. This can happen only if distributions are represented by a sufficiently large dataset. Therefore, UDA approaches are in a position of weakness when we assume Dt to be small. Moreover, UDA approaches have also another intrinsic limitation; even with perfect confusion alignment, there is no guarantee that samples from different domains but with the same class label will map nearby in the feature space. This lack of semantic alignment is a major source of performance reduction. 3.1 Handling Scarce Target Data We are interested in the case where very few labeled target samples (as low as 1 sample per class) are available. We are facing two challenges in this setting. First, since the size of Dt is small, we need to find a way to augment it. Second, we need to somehow use the label information of Dt. Therefore, we create pairs of samples. In this way, we are able to alleviate the lack of training target samples by 4 pairing them with each training source sample. In [38], we have shown that creating positive and negative pairs using source and target data is very effective for SDA. Since the method proposed in [38] does not encode the domain information of the samples, it cannot be used in adversarial learning. Here we extend [38] by creating 4 groups of pairs (Gi, i = 1, 2, 3, 4) as follows: we break down the positive pairs into two groups (Groups 1 and 2), where pairs of the first group consist of samples from the source distribution with the same class labels, while pairs of the second group also have the same class label but come from different distributions (one from the source and one from the target distribution). This is important because we can encode both label and domain information of training samples. Similarly, we break down the negative pairs into two groups (Groups 3 and 4), where pairs of the third group consist of samples from the source distribution with different class labels, while pairs of the forth group come from different class labels and different distributions (one from the source and one from the target distributions). See Figure 1. In order to give each group the same amount of members we use all possible pairs from G2, as it is the smallest, and then uniformly sample from the pairs in G1, G3, and G4 to match the size of G2. Any reasonable amount of portions between the numbers of the pairs can also be used. In classical adversarial learning we would at this point learn a domain discriminator, but since we have semantic information to consider as well, we are interested in learning a multi-class discriminator (we call it domain-class discriminator (DCD)) in order to introduce semantic alignment of the source and target domains. By expanding the binary classifier to its multiclass equivalent, we can train a classifier that will evaluate which of the 4 groups a given sample pair belongs to. We model the DCD with 2 fully connected layers with a softmax activation in the last layer which we can train with the standard categorical cross-entropy loss LF ADA−D = −E[ 4 X i=1 yGi log(D(φ(Gi)))] , (3) where yGi is the label of Gi and D is the DCD function. φ is a symbolic function that takes a pair as input and outputs the concatenation of the results of the appropriate inference functions. The output of φ is passed to the DCD (Figure 2). In the second step, we are interested in updating gt in order to confuse the DCD in such a way that the DCD can no longer distinguish between groups 1 and 2, and also between groups 3 and 4 using the loss LF ADA−g = −E[yG1 log(D(φ(G2))) + yG3 log(D(φ(G4)))] . (4) (4) is inspired by the non-saturating game [17] and will force the inference function gt to embed target samples in a space that DCD will no longer be able to distinguish between them. Connection with multi-class discriminators: Consider an image generation task where training samples come from k classes. Learning the image generator can be done by any standard kclass classifier and adding generated samples as a new class (generated class) and correspondingly increasing the dimension of the classifier output from k to k + 1. During the adversarial learning, only the generated class is confused. This has proven effective for image generation [48] and other tasks. However, this is different than the proposed DCD, where group 1 is confused with 2, and group 3 is confused with 4. Inspired by [48], we are able to create a k + 4 classifier to also guarantee a high classification accuracy. Therefore, we suggest that (4) needs to be minimized together with the main classifier loss LF ADA−g = −γE[yG1 log(D(g(G2)))+yG3 log(D(g(G4)))]+E[ℓ(f(Xs), Y )]+E[ℓ(f(Xt), Y )] , (5) where γ strikes the balance between classification and confusion. Misclassifying pairs from group 2 as group 1 and likewise for groups 4 and 3, means that the DCD is no longer able to distinguish positive or negative pairs of different distributions from positive or negative pairs of the source distribution, while the classifier is still able to discriminate positive pairs from negative pairs. This simultaneously satisfies the two main goals of SDA, domain confusion and class separability in the 5 Table 1: MNIST-USPS-SVHN datasets. Classification accuracy for domain adaptation over the MNIST, USPS, and SVHN datasets. M, U, and S stand for MNIST, USPS, and SVHN domain. LB is our base model without adaptation. FT and FADA stand for fine-tuning and our method, respectively. Traditional UDA Adversarial UDA LB [60] [45] [15] [33] [59] [49] SDA 1 2 3 4 5 6 7 M →U 65.4 47.8 60.7 91.8 91.2 89.4 92.5 FT 82.3 84.9 85.7 86.5 87.2 88.4 88.6 [38] 85.0 89.0 90.1 91.4 92.4 93.0 92.9 FADA 89.1 91.3 91.9 93.3 93.4 94.0 94.4 U →M 58.6 63.1 67.3 73.7 89.1 90.1 90.8 FT 72.6 78.2 81.9 83.1 83.4 83.6 84.0 [38] 78.4 82.2 85.8 86.1 88.8 89.6 89.4 FADA 81.1 84.2 87.5 89.9 91.1 91.2 91.5 S →M 60.1 82.0 76.0 84.7 FT 65.5 68.6 70.7 73.3 74.5 74.6 75.4 FADA 72.8 81.8 82.6 85.1 86.1 86.8 87.2 M →S 20.3 40.1 36.4 FT 29.7 31.2 36.1 36.7 38.1 38.3 39.1 FADA 37.7 40.5 42.9 46.3 46.1 46.8 47.0 S →U 66.0 FT 69.4 71.8 74.3 76.2 78.1 77.9 78.9 FADA 78.3 83.2 85.2 85.7 86.2 87.1 87.5 U →S 15.3 FT 19.9 22.2 22.8 24.6 25.4 25.4 25.6 FADA 27.5 29.8 34.5 36.0 37.9 41.3 42.9 feature space. UDA only looks for domain confusion and does not address class separability, because of the lack of labeled target samples. Connection with conditional GANs: Concatenation of outputs of different inferences has been done before in conditional GANs. For example, [43, 44, 64] concatenate the input text to the penultimate layers of the discriminators. [25] concatenates positive and negative pairs before passing them to the discriminator. However, all of them use the vanilla binary discriminator. Relationship between gs and gt: There is no restriction for gs and gt and they can be constrained or unconstrained. An obvious choice of constraint is equality (weight-sharing) which makes the inference functions symmetric. This can be seen as a regularizer and will reduce overfitting [38]. Another approach would be learning an asymmetric inference function [45]. Since we have access to very few target samples, we use weight-sharing (gs = gt = g). Choice of gs, gt, and h: Since we are interested in visual recognition, the inference functions gs and gt are modeled by a convolutional neural network (CNN) with some initial convolutional layers, followed by some fully connected layers which are described specifically in the experiments section. In addition, the prediction function h is modeled by fully connected layers with a softmax activation function for the last layer. Training Process: Here we discuss the training process for the weight-sharing regularizer (gs = gt = g). Once the inference functions g and the prediction function h are chosen, FADA takes the following steps: First, g and h are initialized using the source dataset Ds. Then, the mentioned four groups of pairs should be created using Ds and Dt. The next step is training DCD using the four groups of pairs. This should be done by freezing g. In the next step, the inference function g and prediction function h should be updated in order to confuse DCD and maintain high classification accuracy. This should be done by freezing DCD. See Algorithm 1 and Figure 2. The training process for the non weight-sharing case can be derived similarly. 4 Experiments We present results using the Office dataset [47], the MNIST dataset [32], the USPS dataset [24], and the SVHN dataset [40]. 4.1 MNIST-USPS-SVHN Datasets The MNIST (M), USPS (U), and SVHN (S) datasets have recently been used for domain adaptation [12, 45, 59]. They contain images of digits from 0 to 9 in various different environments including in the wild in the case of SVHN [40]. We considered six cross-domain tasks. The first two tasks include M →U, U →M, and followed the experimental setting in [12, 45, 33, 59, 49], which involves randomly selecting 2000 images from MNIST and 1800 images from USPS. For the rest of 6 Table 2: Office dataset. Classification accuracy for domain adaptation over the 31 categories of the Office dataset. A, W, and D stand for Amazon, Webcam, and DSLR domain. LB is our base model without adaptation. Unsupervised Methods Supervised Methods LB [60] [34] [15] [58] [27] [38] FADA A →W 61.2 ± 0.9 61.8 ± 0.4 68.5 ± 0.4 68.7 ± 0.3 82.7 ± 0.8 84.5 ± 1.7 88.2 ± 1.0 88.1 ± 1.2 A →D 62.3 ± 0.8 64.4 ± 0.3 67.0 ± 0.4 67.1 ± 0.3 86.1 ± 1.2 86.3 ± 0.8 89.0 ± 1.2 88.2 ± 1.0 W →A 51.6 ± 0.9 52.2 ± 0.4 53.1 ± 0.3 54.09 ± 0.5 65.0 ± 0.5 65.7 ± 1.7 72.1 ± 1.0 71.1 ± 0.9 W →D 95.6 ± 0.7 98.5 ± 0.4 99.0 ± 0.2 99.0 ± 0.2 97.6 ± 0.2 97.5 ± 0.7 97.6 ± 0.4 97.5 ± 0.6 D →A 58.5 ± 0.8 52.1 ± 0.8 54.0 ± 0.4 56.0 ± 0.5 66.2 ± 0.3 66.5 ± 1.0 71.8 ± 0.5 68.1 ± 06 D →W 80.1 ± 0.6 95.0 ± 0.5 96.0 ± 0.3 96.4 ± 0.3 95.7 ± 0.5 95.5 ± 0.6 96.4 ± 0.8 96.4 ± 0.8 Average 68.2 70.6 72.9 73.6 82.2 82.6 85.8 84.9 the cross-domain tasks, M →S, S →M, U →S, and S →U, we used all training samples of the source domain for training and all testing samples of the target domain for testing. Since [12, 45, 33, 59, 49] introduced unsupervised methods, they used all samples of a target domain as unlabeled data in training. Here instead, we randomly selected n labeled samples per class from target domain data and used them in training. We evaluated our approach for n ranging from 1 to 4 and repeated each experiment 10 times (we only show the mean of the accuracies for this experiment because standard deviation is very small). Since the images of the USPS dataset have 16 × 16 pixels, we resized the images of the MNIST and SVHN datasets to 16 × 16 pixels. We assume gs and gt share weights (g = gs = gt) for this experiment. Similar to [32], we used 2 convolutional layers with 6 and 16 filters of 5 × 5 kernels followed by max-pooling layers and 2 fully connected layers with size 120 and 84 as the inference function g, and one fully connected layer with softmax activation as the prediction function h. Also, we used 2 fully connected layers with size 64 and 4 as DCD (4 groups classifier). Training for each stage was done using the Adam Optimizer [26]. We compare our method with 1 SDA method, under the same condition, and 6 recent UDA methods. UDA methods use all target samples in their training stage, while we only use very few labeled target samples per category in training. Table 1 shows the classification accuracies across a range for the number of target samples available in training (n = 1, . . . , 7). FADA works well even when only one target sample per category (n = 1) is available in training. We can get comparable accuracies with the state-of-the-art using only 10 labeled target samples (one sample per class n = 1) instead of using more than thousands of unlabeled target samples. We also report the lower bound (LB) of our model which corresponds to training the base model using only source samples. Moreover, we report the accuracies obtained by fine-tuning (FT) the base model on available target data and also the recent work presented in [38]. Although Table 1 shows that FT increases the accuracies over LB, it has reduced performance compared to SDA methods. Figure 3 shows how much improvement can be obtained with respect to the base model. The base model is the lower bound LB. This is simply obtained by training g and h with only the classification loss and source training data; so, no adaptation is performed. Weight-Sharing. As we discussed earlier, weight-sharing can be seen as a regularizer that prevents the target network gt from overfitting. This is important because gt can be easily overfitted since target data is scarce. We repeated the experiment for the U →M with n = 5 without sharing weights. This provides an average accuracy of 84.1 over 10 repetitions, which is less than the weight-sharing case. 4.2 Office Dataset The office dataset is a standard benchmark dataset for visual domain adaptation. It contains 31 object classes for three domains: Amazon, Webcam, and DSLR, indicated as A, W, and D, for a total of 4,652 images. The first domain A, consists of images downloaded from online merchants, the second W, consists of low resolution images acquired by webcams, the third D, consists of high resolution images collected with digital SLRs. We consider four domain shifts using the three domains (A →W, A →D, W →A, and D →A). Since there is not a considerable domain shift between W and D, we exclude W →D and D →W. 7 n=1 n=2 n=3 n=4 n=5 n=6 n=7 60 70 80 90 100 Accuracy % (a) M →U LB FT FADA n=1 n=2 n=3 n=4 n=5 n=6 n=7 10 20 30 40 50 Accuracy % (c) U →S LB FT FADA n=1 n=2 n=3 n=4 n=5 n=6 n=7 60 70 80 90 100 Accuracy % (e) S →U LB FT FADA n=1 n=2 n=3 n=4 n=5 n=6 n=7 20 30 40 50 Accuracy % (b) M →S LB FT FADA n=1 n=2 n=3 n=4 n=5 n=6 n=7 50 60 70 80 90 100 Accuracy % (d) U →M LB FT FADA n=1 n=2 n=3 n=4 n=5 n=6 n=7 50 60 70 80 90 100 Accuracy % (f) S →M LB FT FADA Figure 3: MNIST-USPS-SVHN summary. The lower bar of each column represents the LB as reported in Table 1 for the corresponding domain pair. The middle bar is the improvement of finetuning FT the base model using the available target data reported in Table 1. The top bar is the improvement of FADA over FT, also reported in Table 1. We followed the setting described in [58]. All classes of the office dataset and 5 train-test splits are considered. For the source domain, 20 examples per category for the Amazon domain, and 8 examples per category for the DSLR and Webcam domains are randomly selected for training for each split. Also, 3 labeled examples are randomly selected for each category in the target domain for training for each split. The rest of the target samples are used for testing. Note that we used the same splits generated by [58]. In addition to the SDA algorithms, we report the results of some recent UDA algorithms. They follow a different experimental protocol compared to the SDA algorithms, and use all samples of the target domain in training as unlabeled data together with all samples of the source domain. So, we cannot make an exact comparison between results. However, since UDA algorithms use all samples of the target domain in training and we use only very few of them (3 per class), we think it is still worth looking at how they differ. Here we are interested in the case where gs and gt share weights (gs = gt = g). For the inference function g, we used the convolutional layers of the VGG-16 architecture [53] followed by 2 fully connected layers with output size of 1024 and 128, respectively. For the prediction function h, we used a fully connected layer with softmax activation. Similar to [58], we used the weights pre-trained on the ImageNet dataset [46] for the convolutional layers, and initialized the fully connected layers using all the source domain data. We model the DCD with 2 fully connected layers with a softmax activation in the last layer. Table 2 reports the classification accuracy over 31 classes for the Office dataset and shows that FADA has performance comparable to the state-of-the-art. 5 Conclusions We have introduced a deep model combining a classification and an adversarial loss to address SDA in few-shot learning regime. We have shown that adversarial learning can be augmented to address SDA. The approach is general in the sense that the architecture sub-components can be changed. We found that addressing the semantic distribution alignments with point-wise surrogates of distribution distances and similarities for SDA works very effectively, even when labeled target samples are very few. In addition, we found the SDA accuracy to converge very quickly as more labeled target samples per category are available. The approach shows clear promise as it sets new state-of-the-art performance in the experiments. 8 References [1] Y. Aytar and A. Zisserman. Tabula rasa: Model transfer for object category detection. In Computer Vision (ICCV), 2011 IEEE International Conference on, pages 2252–2259. IEEE, 2011. [2] M. Baktashmotlagh, M. T. Harandi, B. C. Lovell, and M. Salzmann. Unsupervised domain adaptation by domain invariant projection. In IEEE ICCV, pages 769–776, 2013. [3] C. J. Becker, C. M. Christoudias, and P. Fua. Non-linear domain adaptation with boosting. In Advances in Neural Information Processing Systems, pages 485–493, 2013. [4] A. Bergamo and L. Torresani. Exploiting weakly-labeled web images to improve object classification: a domain adaptation approach. In Advances in Neural Information Processing Systems, pages 181–189, 2010. [5] J. Blitzer, R. McDonald, and F. Pereira. Domain adaptation with structural correspondence learning. In Proceedings of the 2006 conference on empirical methods in natural language processing, pages 120–128. Association for Computational Linguistics, 2006. [6] L. Chen, W. Li, and D. Xu. Recognizing RGB images by learning from RGB-D data. In CVPR, pages 1418–1425, June 2014. [7] S. Chopra, R. Hadsell, and Y. LeCun. Learning a similarity metric discriminatively, with application to face verification. In Computer Vision and Pattern Recognition, 2005. CVPR 2005. IEEE Computer Society Conference on, volume 1, pages 539–546. IEEE, 2005. [8] H. Daume III and D. Marcu. Domain adaptation for statistical classifiers. Journal of Artificial Intelligence Research, 26:101–126, 2006. [9] J. Donahue, Y. Jia, O. Vinyals, J. Hoffman, N. Zhang, E. Tzeng, and T. Darrell. DeCAF: a deep convolutional activation feature for generic visual recognition. In arXiv:1310.1531, 2013. [10] L. Duan, I. W. Tsang, D. Xu, and S. J. Maybank. Domain transfer svm for video concept detection. In Computer Vision and Pattern Recognition, 2009. CVPR 2009. IEEE Conference on, pages 1375–1381. IEEE, 2009. [11] B. Fernando, A. Habrard, M. Sebban, and T. Tuytelaars. Unsupervised visual domain adaptation using subspace alignment. In IEEE ICCV, pages 2960–2967, 2013. [12] B. Fernando, T. Tommasi, and T. Tuytelaarsc. Joint cross-domain classification and subspace learning for unsupervised adaptation. Pattern Recogition Letters, 2015. [13] Y. Ganin and V. Lempitsky. Unsupervised domain adaptation by backpropagation. arXiv preprint arXiv:1409.7495, 2014. [14] 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. [15] M. Ghifary, W. B. Kleijn, M. Zhang, D. Balduzzi, and W. Li. Deep reconstruction-classification networks for unsupervised domain adaptation. In European Conference on Computer Vision, pages 597–613. Springer, 2016. [16] B. Gong, Y. Shi, F. Sha, and K. Grauman. Geodesic flow kernel for unsupervised domain adaptation. In Computer Vision and Pattern Recognition (CVPR), 2012 IEEE Conference on, pages 2066–2073. IEEE, 2012. [17] I. Goodfellow. Nips 2016 tutorial: Generative adversarial networks. arXiv preprint arXiv:1701.00160, 2016. [18] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio. Generative adversarial nets. In Z. Ghahramani, M. Welling, C. Cortes, N. D. Lawrence, and K. Q. Weinberger, editors, Advances in Neural Information Processing Systems 27, pages 2672–2680. Curran Associates, Inc., 2014. [19] R. Gopalan, R. Li, and R. Chellappa. Domain adaptation for object recognition: An unsupervised approach. In IEEE ICCV, pages 999–1006, 2011. [20] A. Gretton, K. M. Borgwardt, M. Rasch, B. Schölkopf, and A. J. Smola. A kernel method for the two-sample-problem. In NIPS, 2006. [21] Y. Guo and M. Xiao. Cross language text classification via subspace co-regularized multi-view learning. In Proceedings of the 29th International Conference on Machine Learning, ICML 2012, Edinburgh, Scotland, UK, June 26 - July 1, 2012, 2012. [22] E. Hoffer and N. Ailon. Deep metric learning using triplet network. In International Workshop on Similarity-Based Pattern Recognition, pages 84–92. Springer, 2015. [23] J. Hu, J. Lu, and Y.-P. Tan. Discriminative deep metric learning for face verification in the wild. In Computer Vision and Pattern Recognition (CVPR), 2014 IEEE Conference on, pages 1875–1882, June 2014. [24] J. J. Hull. A database for handwritten text recognition research. IEEE Transactions on pattern analysis and machine intelligence, 16(5):550–554, 1994. [25] P. Isola, J.-Y. Zhu, T. Zhou, and A. A. Efros. Image-to-image translation with conditional adversarial networks. arXiv preprint arXiv:1611.07004, 2016. 9 [26] D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2014. [27] P. Koniusz, Y. Tas, and F. Porikli. Domain adaptation by mixture of alignments of second-or higher-order scatter tensors. arXiv preprint arXiv:1611.08195, 2016. [28] B. Kulis, K. Saenko, and T. Darrell. What you saw is not what you get: Domain adaptation using asymmetric kernel transforms. In Computer Vision and Pattern Recognition (CVPR), 2011 IEEE Conference on, pages 1785–1792. IEEE, 2011. [29] S. Kullback and R. A. Leibler. On information and sufficiency. The annals of mathematical statistics, 22(1):79–86, 1951. [30] B. Kumar, G. Carneiro, I. Reid, et al. Learning local image descriptors with deep siamese and triplet convolutional networks by minimising global loss functions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5385–5394, 2016. [31] M. Lapin, M. Hein, and B. Schiele. Learning using privileged information: SVM+ and weighted SVM. Neural Networks, 53:95–108, 2014. [32] 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. [33] M.-Y. Liu and O. Tuzel. Coupled generative adversarial networks. In Advances in Neural Information Processing Systems, pages 469–477, 2016. [34] M. Long, Y. Cao, J. Wang, and M. I. Jordan. Learning transferable features with deep adaptation networks. In ICML, pages 97–105, 2015. [35] M. Long, G. Ding, J. Wang, J. Sun, Y. Guo, and P. S. Yu. Transfer sparse coding for robust image representation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 407–414, 2013. [36] S. Motiian and G. Doretto. Information bottleneck domain adaptation with privileged information for visual recognition. In European Conference on Computer Vision, pages 630–647. Springer, 2016. [37] S. Motiian, M. Piccirilli, D. A. Adjeroh, and G. Doretto. Information bottleneck learning using privileged information for visual recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1496–1505, 2016. [38] S. Motiian, M. Piccirilli, D. A. Adjeroh, and G. Doretto. Unified deep supervised domain adaptation and generalization. In The IEEE International Conference on Computer Vision (ICCV), Oct 2017. [39] K. Muandet, D. Balduzzi, and B. Schölkopf. Domain generalization via invariant feature representation. In ICML (1), pages 10–18, 2013. [40] 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. [41] S. J. Pan, I. W. Tsang, J. T. Kwok, and Q. Yang. Domain adaptation via transfer component analysis. IEEE TNN, 22(2):199–210, 2011. [42] J. Ponce, T. L. Berg, M. Everingham, D. A. Forsyth, M. Hebert, S. Lazebnik, M. Marszalek, C. Schmid, B. C. Russell, A. Torralba, et al. Dataset issues in object recognition. In Toward category-level object recognition, pages 29–48. Springer, 2006. [43] S. Reed, Z. Akata, X. Yan, L. Logeswaran, B. Schiele, and H. Lee. Generative adversarial text to image synthesis. In Proceedings of the 33rd International Conference on International Conference on Machine Learning-Volume 48, pages 1060–1069. JMLR. org, 2016. [44] S. E. Reed, Z. Akata, S. Mohan, S. Tenka, B. Schiele, and H. Lee. Learning what and where to draw. In Advances in Neural Information Processing Systems, pages 217–225, 2016. [45] A. Rozantsev, M. Salzmann, and P. Fua. Beyond sharing weights for deep domain adaptation. arXiv preprint arXiv:1603.06432, 2016. [46] O. Russakovsky, J. Deng, H. Su, J. Krause, S. Satheesh, S. Ma, Z. Huang, A. Karpathy, A. Khosla, M. Bernstein, A. C. Berg, and L. Fei-Fei. ImageNet Large Scale Visual Recognition Challenge. IJCV, 2015. [47] K. Saenko, B. Kulis, M. Fritz, and T. Darrell. Adapting visual category models to new domains. In ECCV, pages 213–226, 2010. [48] 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 2234–2242, 2016. [49] S. Sankaranarayanan, Y. Balaji, C. D. Castillo, and R. Chellappa. Generate to adapt: Aligning domains using generative adversarial networks. arXiv preprint arXiv:1704.01705, 2017. [50] N. Sarafianos, M. Vrigkas, and I. A. Kakadiaris. Adaptive svm+: Learning with privileged information for domain adaptation. arXiv preprint arXiv:1708.09083, 2017. [51] H. Shimodaira. Improving predictive inference under covariate shift by weighting the log-likelihood function. Journal of Statistical Planning and Inference, 90(2):227–244, 2000. [52] A. Shrivastava, T. Pfister, O. Tuzel, J. Susskind, W. Wang, and R. Webb. Learning from simulated and unsupervised images through adversarial training. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), July 2017. 10 [53] K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. CoRR, abs/1409.1556, 2014. [54] B. Sun and K. Saenko. Deep coral: Correlation alignment for deep domain adaptation. In Computer Vision–ECCV 2016 Workshops, pages 443–450. Springer, 2016. [55] T. Tommasi, M. Lanzi, P. Russo, and B. Caputo. Learning the roots of visual domain shift. In Computer Vision–ECCV 2016 Workshops, pages 475–482. Springer, 2016. [56] T. Tommasi, N. Patricia, B. Caputo, and T. Tuytelaars. A deeper look at dataset bias. In German Conference on Pattern Recognition, pages 504–516. Springer, 2015. [57] A. Torralba and A. A. Efros. Unbiased look at dataset bias. In Computer Vision and Pattern Recognition (CVPR), 2011 IEEE Conference on, pages 1521–1528, 2011. [58] E. Tzeng, J. Hoffman, T. Darrell, and K. Saenko. Simultaneous deep transfer across domains and tasks. In ICCV, 2015. [59] E. Tzeng, J. Hoffman, K. Saenko, and T. Darrell. Adversarial discriminative domain adaptation. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), July 2017. [60] E. Tzeng, J. Hoffman, N. Zhang, K. Saenko, and T. Darrell. Deep domain confusion: Maximizing for domain invariance. arXiv preprint arXiv:1412.3474, 2014. [61] R. R. Varior, B. Shuai, J. Lu, D. Xu, and G. Wang. A siamese long short-term memory architecture for human re-identification. In European Conference on Computer Vision, pages 135–153. Springer, 2016. [62] J. Yang, R. Yan, and A. G. Hauptmann. Adapting svm classifiers to data with shifted distributions. In Data Mining Workshops, 2007. ICDM Workshops 2007. Seventh IEEE International Conference on, pages 69–76. IEEE, 2007. [63] T. Yao, Y. Pan, C.-W. Ngo, H. Li, and T. Mei. Semi-supervised domain adaptation with subspace learning for visual recognition. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2015. [64] H. Zhang, T. Xu, H. Li, S. Zhang, X. Huang, X. Wang, and D. Metaxas. Stackgan: Text to photo-realistic image synthesis with stacked generative adversarial networks. arXiv preprint arXiv:1612.03242, 2016. 11
2017
88
7,229
Robust and Efficient Transfer Learning with Hidden Parameter Markov Decision Processes Taylor Killian∗ taylorkillian@g.harvard.edu Harvard University Samuel Daulton∗ sdaulton@g.harvard.edu Harvard University, Facebook† George Konidaris gdk@cs.brown.edu Brown University Finale Doshi-Velez finale@seas.harvard.edu Harvard University Abstract We introduce a new formulation of the Hidden Parameter Markov Decision Process (HiP-MDP), a framework for modeling families of related tasks using lowdimensional latent embeddings. Our new framework correctly models the joint uncertainty in the latent parameters and the state space. We also replace the original Gaussian Process-based model with a Bayesian Neural Network, enabling more scalable inference. Thus, we expand the scope of the HiP-MDP to applications with higher dimensions and more complex dynamics. 1 Introduction The world is filled with families of tasks with similar, but not identical, dynamics. For example, consider the task of training a robot to swing a bat with unknown length l and mass m. The task is a member of a family of bat-swinging tasks. If a robot has already learned to swing several bats with various lengths and masses {(li, mi)}N i=1, then the robot should learn to swing a new bat with length l′ and mass m′ more efficiently than learning from scratch. That is, it is grossly inefficient to develop a control policy from scratch each time a unique task is encountered. The Hidden Parameter Markov Decision Process (HiP-MDP) [14] was developed to address this type of transfer learning, where optimal policies are adapted to subtle variations within tasks in an efficient and robust manner. Specifically, the HiP-MDP paradigm introduced a low-dimensional latent task parameterization wb that, combined with a state and action, completely describes the system’s dynamics T(s′|s, a, wb). However, the original formulation did not account for nonlinear interactions between the latent parameterization and the state space when approximating these dynamics, which required all states to be visited during training. In addition, the original framework scaled poorly because it used Gaussian Processes (GPs) as basis functions for approximating the task’s dynamics. We present a new HiP-MDP formulation that models interactions between the latent parameters wb and the state s when transitioning to state s′ after taking action a. We do so by including the latent parameters wb, the state s, and the action a as input to a Bayesian Neural Network (BNN). The BNN both learns the common transition dynamics for a family of tasks and models how the unique variations of a particular instance impact the instance’s overall dynamics. Embedding the latent parameters in this way allows for more accurate uncertainty estimation and more robust transfer when learning a control policy for a new and possibly unique task instance. Our formulation also inherits several desirable properties of BNNs: it can model multimodal and heteroskedastic transition ∗Both contributed equally as primary authors †Current affiliation, joined afterward 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. functions, inference scales to data large in both dimension and number of samples, and all output dimensions are jointly modeled, which reduces computation and increases predictive accuracy [11]. Herein, a BNN can capture complex dynamical systems with highly non-linear interactions between state dimensions. Furthermore, model uncertainty is easily quantified through the BNN’s output variance. Thus, we can scale to larger domains than previously possible. We use the improved HiP-MDP formulation to develop control policies for acting in a simple twodimensional navigation domain, playing acrobot [42], and designing treatment plans for simulated patients with HIV [15]. The HiP-MDP rapidly determines the dynamics of new instances, enabling us to quickly find near-optimal instance-specific control policies. 2 Background Model-based reinforcement learning We consider reinforcement learning (RL) problems in which an agent acts in a continuous state space S ⊆RD and a discrete action space A. We assume that the environment has some true transition dynamics T(s′|s, a), unknown to the agent, and we are given a reward function R(s, a) : S × A →R that provides the utility of taking action a from state s. In the model-based reinforcement learning setting, our goal is to learn an approximate transition function ˆT(s′|s, a) based on observed transitions (s, a, s′) and then use ˆT(s′|s, a) to learn a policy a = π(s) that maximizes long-term expected rewards E[P t γtrt], where γ ∈(0, 1] governs the relative importance of immediate and future rewards. HiP-MDPs A HiP-MDP [14] describes a family of Markov Decision Processes (MDPs) and is defined by the tuple {S, A, W, T, R, γ, PW }, where S is the set of states s, A is the set of actions a, and R is the reward function. The transition dynamics T (s′|s, a, wb) for each task instance b depend on the value of the hidden parameters wb ∈W; for each instance, the parameters wb are drawn from prior PW. The HiP-MDP framework assumes that a finite-dimensional array of hidden parameters wb can fully specify variations among the true task dynamics. It also assumes the system dynamics are invariant during a task and the agent is signaled when one task ends and another begins. Bayesian Neural Networks A Bayesian Neural Network (BNN) is a neural network, f(·, ·; W), in which the parameters W are random variables with some prior P(W) [27]. We place independent Gaussian priors on each parameter P(W) = Q w∈W N(w; µ, σ2). Exact Bayesian inference for the posterior over parameters P(W|{(s′, s, a)}) is intractable, but several recent techniques have been developed to scale inference in BNNs [4, 17, 22, 33]. As probabilistic models, BNNs reduce the tendency of neural networks to overfit in the presence of low amounts of data—just as GPs do. In general, training a BNN is more computationally efficient than a GP [22], while still providing coherent uncertainty measurements. Specifically, predictive distributions can be calculated by taking averages over samples of W from an approximated posterior distribution over the parameters. As such, BNNs are being adopted in the estimation of stochastic dynamical systems [11, 18]. 3 A HiP-MDP with Joint-Uncertainty The original HiP-MDP transition function models variation across task instances as:3 s′ d ≈ K X k=1 wbk ˆT (GP) kad (s) + ϵ wbk ∼N(µwk, σ2 w) ϵ ∼N(0, σ2 ad), (1) where sd is the dth dimension of s. Each basis transition function ˆTkad (indexed by the kth latent parameter, the action a, and the dimension d) is a GP using only s as input, linearly combined with instance-specific weights wbk. Inference involves learning the parameters for the GP basis functions and the weights for each instance. GPs can robustly approximate stochastic state transitions in 3We present a simplified version that omits their filtering variables zkad ∈{0, 1} to make the parallels between our formulation and the original more explicit; our simplification does not change any key properties. 2 continuous dynamical systems in model-based reinforcement learning [9, 35, 36]. GPs have also been widely used in transfer learning outside of RL (e.g. [5]). While this formulation is expressive, it has limitations. The primary limitation is that the uncertainty in the latent parameters wkb is modeled independently of the agent’s state uncertainty. Hence, the model does not account for interactions between the latent parameterization wb and the state s. As a result, Doshi-Velez and Konidaris [14] required that each task instance b performed the same set of state-action combinations (s, a) during training. While such training may sometimes be possible—e.g. robots that can be driven to identical positions—it is onerous at best and impossible for other systems such as human patients. The secondary limitation is that each output dimension sd is modeled separately as a collection of GP basis functions { ˆTkad}K k=1. The basis functions for output dimension sd are independent of the basis functions for output dimension sd′, for d ̸= d′. Hence, the model does not account for correlation between output dimensions. Modeling such correlations typically requires knowledge of how dimensions interact in the approximated dynamical system [2, 19]. We choose not to constrain the HiP-MDP with such a priori knowledge since the aim is to provide basis functions that can ascertain these relationships through observed transitions. To overcome these limitations, we include the instance-specific weights wb as input to the transition function and model all dimensions of the output jointly: s′ ≈ˆT (BNN)(s, a, wb) + ϵ wb ∼N (µw, Σb) ϵ ∼N 0, σ2 n  . (2) This critical modeling change eliminates all of the above limitations: we can learn directly from data as observed—which is abundant in many industrial and health domains—and no longer require highly constrained training procedure. We can also capture the correlations in the outputs of these domains, which occur in many natural processes. Finally, the computational demands of using GPs as the transition function limited the application of the original HiP-MDP formulation to relatively small domains. In the following, we use a BNN rather than a GP to model this transition function. The computational requirements needed to learn a GP-based transition function makes a direct comparison to our new BNN-based formulation infeasible within our experiments (Section 5). We demonstrate, in Appendix A, that the BNN-based transition model far exceeds the GP-based transition model in both computational and predictive performance. In addition, BNNs naturally produce multi-dimensional outputs s′ without requiring prior knowledge of the relationships between dimensions. This allows us to directly model output correlations between the D state dimensions, leading to a more unified and coherent transition model. Inference in a larger input space s, a, wb with a large number of samples is tractable using efficient approaches that let us—given a distribution P(W) and input-output tuples (s, a, s′)—estimate a distribution over the latent embedding P(wb). This enables more robust, scalable transfer. Demonstration We present a toy domain (Figure 1) where an agent is tasked with navigating to a goal region. The state space is continuous (s ∈(−2, 2)2), and action space is discrete (a ∈ {N, E, S, W}). Task instances vary the following the domain aspects: the location of a wall that blocks access to the goal region (either to the left of or below the goal region), the orientation of the cardinal directions (i.e. whether taking action North moves the agent up or down), and the direction of a nonlinear wind effect that increases as the agent moves away from the start region. Ignoring the wall and grid boundaries, the transition dynamics are: ∆x = (−1)θbc ax −(1 −θb)β p (x + 1.5)2 + (y + 1.5)2 ∆y = (−1)θbc ay −θbβ p (x + 1.5)2 + (y + 1.5)2 ax = 1 a ∈{E, W} 0 otherwise ay = 1 a ∈{N, S} 0 otherwise, where c is the step-size (without wind), θb ∈{0, 1} indicates which of the two classes the instance belongs to and β ∈(0, 1) controls the influence of the wind and is fixed for all instances. The agent 3 Figure 1: A demonstration of the HiPMDP modeling the joint uncertainty between the latent parameters wb and the state space. On the left, blue and red dots show the exploration during the red (θb = 0) and blue (θb = 1) instances. The latent parameters learned from the red instance are used predict transitions for taking action E from an area of the state space either unexplored (top right) or explored (bottom right) during the red instance. The prediction variance provides an estimate of the joint uncertainty between the latent parameters wb and the state. is penalized for trying to cross a wall, and each step incurs a small cost until the agent reaches the goal region, encouraging the agent to discover the goal region with the shortest route possible. An episode terminates once the agent enters the goal region or after 100 time steps. A linear function of the state s and latent parameters wb would struggle to model both classes of instances (θb = 0 and θb = 1) in this domain because the state transition resulting from taking an action a is a nonlinear function with interactions between the state and hidden parameter θb. By contrast, our new HiP-MDP model allows nonlinear interactions between state and the latent parameters wb, as well as jointly models their uncertainty. In Figure 1, this produces measurable differences in transition uncertainty in regions where there are few related observed transitions, even if there are many observations from unrelated instances. Here, the HiP-MDP is trained on two instances from distinct classes (shown in blue (θb = 1) and red (θb = 0) on the left). We display the uncertainty of the transition function, ˆT, using the latent parameters wred inferred for a red instance in two regions of the domain: 1) an area explored during red instances and 2) an area not explored under red instances, but explored with blue instances. The transition uncertainty ˆT is three times larger in the region where red instances have not been—even if many blue instances have been there—than in regions where red instances have commonly explored, demonstrating that the latent parameters can have different effects on the transition uncertainty in different states. 4 Inference Algorithm 1 summarizes the inference procedure for learning a policy for a new task instance b, facilitated by a pre-trained BNN for that task, and is similar in structure to prior work [9, 18]. The procedure involves several parts. Specifically, at the start of a new instance b, we have a global replay buffer D of all observed transitions (s, a, r, s′) and a posterior over the weights W for our BNN transition function ˆT learned with data from D. The first objective is to quickly determine the latent embedding, wb, of the current instance’s specific dynamical variation as transitions (s, a, s′) are observed from the current instance. Transitions from instance b are stored in both the global replay buffer D and an instance-specific replay buffer Db. The second objective is to develop an optimal control policy using the transition model ˆT and learned latent parameters wb. The transition model ˆT and latent embedding wb are separately updated via mini-batch stochastic gradient descent (SGD) using Adam [26]. Using ˆT for planning increases our sample efficiency as we reduce interactions with the environment. We describe each of these parts in more detail below. 4.1 Updating embedding wb and BNN parameters W For each new instance, a new latent weighting wb is sampled from the prior PW (Alg. 1, step 2), in preparation of estimating unobserved dynamics introduced by θb. Next, we observe transitions (s, a, r, s′) from the task instance for an initial exploratory episode (Alg. 1, steps 7-10). Given that 4 Algorithm 1 Learning a control policy w/ the HiP-MDP Input: Global replay buffer D, BNN transition function ˆT, initial state s0 b 1: procedure LEARNPOLICY( D, ˆT, s0 b) 2: Draw new wb ∼PW 3: Randomly init. policy ˆπb θ, θ− 4: Init. instance replay buffer Db 5: Init. fictional replay buffer Df b 6: for i = 0 to Ne episodes do 7: repeat 8: Take action a ←ˆπb(s) 9: Store D, Db ←(s, a, r, s′, wb) 10: until episode is complete 11: if i = 0 OR ˆT is innaccurate then 12: Db, W, wb ←TUNEMODEL(Db, W, wb) 13: for j = 0 to Nf −1 episodes do 14: Df b , ˆπb ←SIMEP(Df b , ˆT, wb, ˆπb, s0 b) 15: Df b , ˆπb ←SIMEP(Df b , ˆT, wb, ˆπb, s0 b) 1: function SIMEP(Df b , ˆT, wb, ˆπb, s0 b) 2: for t = 0 to Nt time steps do 3: Take action a ←ˆπb(s) 4: Approx. ˆs′ ←ˆT(s, a, wb) 5: Calc. reward ˆr ←R(s, a, ˆs′) 6: Store Df b ←(s, a, ˆr, ˆs′) 7: if mod (t, Nπ) = 0 then 8: Update ˆπb via θ from Df b 9: θ−←τθ + (1 −τ)θ− 10: return Df b , ˆπb 1: function TUNEMODEL(Db, W, wb) 2: for k = 0 to Nu updates do 3: Update wb from Db 4: Update W from Db 5: return Db, W, wb data, we optimize the latent parameters wb to minimize the α-divergence of the posterior predictions of ˆT(s, a, wb|W) and the true state transitions s′ (step 3 in TuneModel) [22]. Here, the minimization occurs by adjusting the latent embedding wb while holding the BNN parameters W fixed. After an initial update of the wb for a newly encountered instance, the parameters W of the BNN transition function ˆT are optimized (step 4 in TuneModel). As the BNN is trained on multiple instances of a task, we found that the only additional data needed to refine the BNN and latent wb for some new instance can be provided by an initial exploratory episode. Otherwise, additional data from subsequent episodes can be used to further improve the BNN and latent estimates (Alg. 1, steps 11-14). The mini-batches used for optimizing the latent wb and BNN network parameters W are sampled from Db with squared error prioritization [31]. We found that switching between small updates to the latent parameters and small updates to the BNN parameters led to the best transfer performance. If either the BNN network or latent parameters are updated too aggressively (having a large learning rate or excessive number of training epochs), the BNN disregards the latent parameters or state inputs respectively. After completing an instance, the BNN parameters and the latent parameters are updated using samples from global replay buffer D. Specific modeling details such as number of epochs, learning rates, etc. are described in Appendix C. 4.2 Updating policy ˆπb We construct an ε-greedy policy to select actions based on an approximate action-value function ˆQ(s, a). We model the action value function ˆQ(s, a) with a Double Deep Q Network (DDQN) [21, 29]. The DDQN involves training two networks (parametrized by θ and θ−respectively), a primary Qnetwork, which informs the policy, and a target Q-network, which is a slowly annealed copy of the primary network (step 9 of SimEp) providing greater stability when updating the policy ˆπb . With the updated transition function, ˆT, we approximate the environment when developing a control policy (SimEp). We simulate batches of entire episodes of length Nt using the approximate dynamical model ˆT, storing each transition in a fictional experience replay buffer Df b (steps 2-6 in SimEp). The primary network parameters θ are updated via SGD every Nπ time steps (step 8 in SimEp) to minimize the temporal-difference error between the primary network’s and the target network’s Q-values. The mini-batches used in the update are sampled from the fictional experience replay buffer Df b , using TD-error-based prioritization [38]. 5 5 Experiments and Results Now, we demonstrate the performance of the HiP-MDP with embedded latent parameters in transferring learning across various instances of the same task. We revisit the 2D demonstration problem from Section 3, as well as describe results on both the acrobot [42] and a more complex healthcare domain: prescribing effective HIV treatments [15] to patients with varying physiologies.4 For each of these domains, we compare our formulation of the HiP-MDP with embedded latent parameters (equation 2) with four baselines (one model-free and three model-based) to demonstrate the efficiency of learning a policy for a new instance b using the HiP-MDP. These comparisons are made across the first handful of episodes encountered in a new task instance to highlight the advantage provided by transferring information through the HiP-MDP. The ‘linear’ baseline uses a BNN to learn a set of basis functions that are linearly combined with the parameters wb (used to approximate the approach of Doshi-Velez and Konidaris [14], equation 1), which does not allow interactions between states and weights. The ‘model-based from scratch’ baseline considers each task instance b as unique; requiring the BNN transition function to be trained only on observations made from the current task instance. The ‘average’ model baseline is constructed under the assumption that a single transition function can be used for every instance of the task; ˆT is trained from observations of all task instances together. For all model-based approaches, we replicated the HiP-MDP procedure as closely as possible. The BNN was trained on observations from a single episode before being used to generate a large batch of approximate transition data, from which a policy is learned. Finally, the model-free baseline learns a DDQN-policy directly from observations of the current instance. For more information on the experimental specifications and long-run policy learning see Appendix C and D, respectively. 5.1 Revisiting the 2D demonstration (a) (b) Figure 2: (a) a demonstration of a model-free control policy, (b) a comparison of learning a policy at the outset of a new task instance b using the HiP-MDP versus four benchmarks. The HiP-MDP with embedded wb outperforms all four benchmarks. The HiP-MDP and the average model were supplied a transition model ˆT trained on two previous instances, one from each class, before being updated according to the procedure outlined in Sec. 4 for a newly encountered instance. After the first exploratory episode, the HiP-MDP has sufficiently determined the latent embedding, evidenced in Figure 2b where the developed policy clearly outperforms all four benchmarks. This implies that the transition model ˆT adequately provides the accuracy needed to develop an optimal policy, aided by the learned latent parametrization. The HiP-MDP with linear wb also quickly adapts to the new instance and learns a good policy. However, the HiP-MDP with linear wb is unable to model the nonlinear interaction between the latent parameters and the state. Therefore the model is less accurate and learns a less consistent policy than the HiP-MDP with embedded wb. (See Figure 2a in Appendix A.2) 4Example code for training and evaluating a HiP-MDP, including the simulators used in this section, can be found at http://github.com/dtak/hip-mdp-public. 6 (a) (b) Figure 3: (a) the acrobot domain, (b) a comparison of learning a policy for a new task instance b using the HiP-MDP versus four benchmarks. With single episode of data, the model trained from scratch on the current instance is not accurate enough to learn a good policy. Training a BNN from scratch requires more observations of the true dynamics than are necessary for the HiP-MDP to learn the latent parameterization and achieve a high level of accuracy. The model-free approach eventually learns an optimal policy, but requires significantly more observations to do so, as represented in Figure 2a. The model-free approach has no improvement in the first 10 episodes. The poor performance of the average model approach indicates that a single model cannot adequately represent the dynamics of the different task instances. Hence, learning a latent representation of the dynamics specific to each instance is crucial. 5.2 Acrobot First introduced by Sutton and Barto [42], acrobot is a canonical RL and control problem. The most common objective of this domain is for the agent to swing up a two-link pendulum by applying a positive, neutral, or negative torque on the joint between the two links (see Figure 3a). These actions must be performed in sequence such that the tip of the bottom link reaches a predetermined height above the top of the pendulum. The state space consists of the angles θ1, θ2 and angular velocities ˙θ1, ˙θ2, with hidden parameters corresponding to the masses (m1, m2) and lengths (l1, l2), of the two links.5 See Appendix B.2 for details on how these hidden parameters were varied to create different task instances. A policy learned on one setting of the acrobot will generally perform poorly on other settings of the system, as noted in [3]. Thus, subtle changes in the physical parameters require separate policies to adequately control the varied dynamical behavior introduced. This provides a perfect opportunity to apply the HiP-MDP to transfer between separate acrobot instances when learning a control policy ˆπb for the current instance. Figure 3b shows that the HiP-MDP learns an optimal policy after a single episode, whereas all other model-based benchmarks required an additional episode of training. As in the toy example, the model-free approach eventually learns an optimal policy, but requires more time. 5.3 HIV treatment Determining effective treatment protocols for patients with HIV was introduced as an RL problem by mathematically representing a patient’s physiological response to separate classes of treatments [1, 15]. In this model, the state of a patient’s health is recorded via 6 separate markers measured with a blood test.6 Patients are given one of four treatments on a regular schedule. Either they are given treatment from one of two classes of drugs, a mixture of the two treatments, or provided no treatment (effectively a rest period). There are 22 hidden parameters in this system that control a patient’s specific physiology and dictate rates of virulence, cell birth, infection, and death. (See Appendix B.3 5The centers of mass and moments of inertia can also be varied. For our purposes we left them unperturbed. 6These markers are: the viral load (V ), the number of healthy and infected CD4+ T-lymphocytes (T1, T ∗ 1 , respectively), the number of healthy and infected macrophages (T2, T ∗ 2 , respectively), and the number of HIV-specific cytotoxic T-cells (E). 7 (a) (b) Figure 4: (a) a visual representation of a patient with HIV transitioning from an unhealthy steady state to a healthy steady state using a proper treatment schedule, (b) a comparison of learning a policy for a new task instance b using the HiP-MDP versus four benchmarks. for more details.) The objective is to develop a treatment sequence that transitions the patient from an unhealthy steady state to a healthy steady state (Figure 4a, see Adams et al. [1] for a more thorough explanation). Small changes made to these parameters can greatly effect the behavior of the system and therefore introduce separate steady state regions that require unique policies to transition between them. Figure 4b shows that the HiP-MDP develops an optimal control policy after a single episode, learning an unmatched optimal policy in the shortest time. The HIV simulator is the most complex of our three domains, and the separation between each benchmark is more pronounced. Modeling a HIV dynamical system from scratch from a single episode of observations proved to be infeasible. The average model, which has been trained off a large batch of observations from related dynamical systems, learns a better policy. The HiP-MDP with linear wb is able to transfer knowledge from previous task instances and quickly learn the latent parameterization for this new instance, leading to an even better policy. However, the dynamical system contains nonlinear interactions between the latent parameters and the state space. Unlike the HiP-MDP with embedded wb, the HiP-MDP with linear wb is unable to model those interactions. This demonstrates the superiority of the HiPMDP with embedded wb for efficiently transferring knowledge between instances in highly complex domains. 6 Related Work There has been a large body of work on solving single POMDP models efficiently [6, 16, 24, 37, 45]. In contrast, transfer learning approaches leverage training done on one task to perform related tasks. Strategies for transfer learning include: latent variable models, reusing pre-trained model parameters, and learning a mapping between separate tasks (see review in [43]). Our work falls into the latent variable model category. Using latent representation to relate tasks has been particularly popular in robotics where similar physical movements can be exploited across a variety of tasks and platforms [10, 20]. In Chen et al. [8], these latent representations are encoded as separate MDPs with an accompanying index that an agent learns while adapting to observed variations in the environment. Bai et al. [3] take a closely related approach to our updated formulation of the HiP-MDP by incorporating estimates of unknown or partially observed parameters of a known environmental model and refining those estimates using model-based Bayesian RL. The core difference between this and our work is that we learn the transition model and the observed variations directly from the data while Bai et al. [3] assume it is given and the specific variations of the parameters are learned. Also related are multi-task approaches that train a single model for multiple tasks simultaneously [5, 7]. Finally, there have been many applications of reinforcement learning (e.g. [32, 40, 44]) and transfer learning in the healthcare domain by identifying subgroups with similar response (e.g. [23, 28, 39]). 8 More broadly, BNNs are powerful probabilistic inference models that allow for the estimation of stochastic dynamical systems [11, 18]. Core to this functionality is their ability to represent both model uncertainty and transition stochasticity [25]. Recent work decomposes these two forms of uncertainty to isolate the separate streams of information to improve learning. Our use of fixed latent variables as input to a BNN helps account for model uncertainty when transferring the pretrained BNN to a new instance of a task. Other approaches use stochastic latent variable inputs to introduce transition stochasticity [12, 30]. We view the HiP-MDP with latent embedding as a methodology that can facilitate personalization and do so robustly as it transfers knowledge of prior observations to the current instance. This approach can be especially useful in extending personalized care to groups of patients with similar diagnoses, but can also be extended to any control system where variations may be present. 7 Discussion and Conclusion We present a new formulation for transfer learning among related tasks with similar, but not identical dynamics, within the HiP-MDP framework. Our approach leverages a latent embedding—learned and optimized in an online fashion—to approximate the true dynamics of a task. Our adjustment to the HiP-MDP provides robust and efficient learning when faced with varied dynamical systems, unique from those previously learned. It is able, by virtue of transfer learning, to rapidly determine optimal control policies when faced with a unique instance. The results in this work assume the presence of a large batch of already-collected data. This setting is common in many industrial and health domains, where there may be months, sometimes years, worth of operations data on plant function, product performance, or patient health. Even with large batches, each new instance still requires collapsing the uncertainty around the instance-specific parameters in order to quickly perform well on the task. In Section 5, we used a batch of transition data from multiple instances of a task—without any artificial exploration procedure—to train the BNN and learn the latent parameterizations. Seeded with data from diverse task instances, the BNN and latent parameters accounted for the variation between instances. While we were primarily interested in settings where batches of observational data exist, one might also be interested in more traditional settings in which the first instance is completely new, the second instance only has information from the first, etc. In our initial explorations, we found that one can indeed learn the BNN in an online manner for simpler domains. However, even with simple domains, the model-selection problem becomes more challenging: an overly expressive BNN can overfit to the first few instances, and have a hard time adapting when it sees data from an instance with very different dynamics. Model-selection approaches to allow the BNN to learn online, starting from scratch, is an interesting future research direction. Another interesting extension is rapidly identifying the latent wb. Exploration to identify wb would supply the dynamical model with the data from the regions of domain with the largest uncertainty. This could lead to a more accurate latent representation of the observed dynamics while also improving the overall accuracy of the transition model. Also, we found training a DQN requires careful exploration strategies. When exploration is constrained too early, the DQN quickly converges to a suboptimal, deterministic policy––often choosing the same action at each step. Training a DQN along the BNN’s trajectories of least certainty could lead to improved coverage of the domain and result in more robust policies. The development of effective policies would be greatly accelerated if exploration were more robust and stable. One could also use the hidden parameters wb to learn a policy directly. Recognizing structure, through latent embeddings, between task variations enables a form of transfer learning that is both robust and efficient. Our extension of the HiP-MDP demonstrates how embedding a low-dimensional latent representation with the input of an approximate dynamical model facilitates transfer and results in a more accurate model of a complex dynamical system, as interactions between the input state and the latent representation are modeled naturally. We also model correlations in the output dimensions by replacing the GP basis functions of the original HiP-MDP formulation with a BNN. The BNN transition function scales significantly better to larger and more complex problems. Our improvements to the HiP-MDP provide a foundation for robust and efficient transfer learning. Future improvements to this work will contribute to a general transfer learning framework capable of addressing the most nuanced and complex control problems. 9 Acknowledgements We thank Mike Hughes, Andrew Miller, Jessica Forde, and Andrew Ross for their helpful conversations. TWK was supported by the MIT Lincoln Laboratory Lincoln Scholars Program. GDK is supported in part by the NIH R01MH109177. The content of this work is solely the responsibility of the authors and does not necessarily represent the official views of the NIH. References [1] BM Adams, HT Banks, H Kwon, and HT Tran. Dynamic multidrug therapies for HIV: optimal and STI control approaches. Mathematical Biosciences and Engineering, pages 223–241, 2004. [2] MA Alvarez, L Rosasco, ND Lawrence, et al. Kernels for vector-valued functions: A review. Foundations and Trends R⃝in Machine Learning, 4(3):195–266, 2012. [3] H Bai, D Hsu, and W S Lee. Planning how to learn. In International Conference on Robotics and Automation, pages 2853–2859. IEEE, 2013. [4] C Blundell, J Cornebise, K Kavukcuoglu, and D Wierstra. Weight uncertainty in neural networks. In Proceedings of The 32nd International Conference on Machine Learning, pages 1613–1622, 2015. [5] EV Bonilla, KM Chai, and CK Williams. Multi-task Gaussian process prediction. In Advances in Neural Information Processing Systems, volume 20, pages 153–160, 2008. [6] E Brunskill and L Li. Sample complexity of multi-task reinforcement learning. In Conference on Uncertainty in Artificial Intelligence, 2013. [7] R Caruana. Multitask learning. In Learning to learn, pages 95–133. Springer, 1998. [8] M Chen, E Frazzoli, D Hsu, and WS Lee. POMDP-lite for robust robot planning under uncertainty. In International Conference on Robotics and Automation, pages 5427–5433. IEEE, 2016. [9] MP Deisenroth and CE Rasmussen. PILCO: a model-based and data-efficient approach to policy search. In Proceedings of the International Conference on Machine Learning, 2011. [10] B Delhaisse, D Esteban, L Rozo, and D Caldwell. Transfer learning of shared latent spaces between robots with similar kinematic structure. In International Joint Conference on Neural Networks. IEEE, 2017. [11] S Depeweg, JM Hernández-Lobato, F Doshi-Velez, and S Udluft. Learning and policy search in stochastic dynamical systems with Bayesian neural networks. In International Conference on Learning Representations, 2017. [12] S Depeweg, JM Hernández-Lobato, F Doshi-Velez, and S Udluft. Uncertainty decomposition in bayesian neural networks with latent variables. arXiv preprint arXiv:1706.08495, 2017. [13] CR Dietrich and GN Newsam. Fast and exact simulation of stationary gaussian processes through circulant embedding of the covariance matrix. SIAM Journal on Scientific Computing, 18(4):1088–1107, 1997. [14] F Doshi-Velez and G Konidaris. Hidden parameter Markov Decision Processes: a semiparametric regression approach for discovering latent task parametrizations. In Proceedings of the Twenty-Fifth International Joint Conference on Artificial Intelligence, volume 25, pages 1432–1440, 2016. [15] D Ernst, G Stan, J Goncalves, and L Wehenkel. Clinical data based optimal STI strategies for HIV: a reinforcement learning approach. In Proceedings of the 45th IEEE Conference on Decision and Control, 2006. [16] A Fern and P Tadepalli. A computational decision theory for interactive assistants. In Advances in Neural Information Processing Systems, pages 577–585, 2010. [17] Y Gal and Z Ghahramani. Dropout as a Bayesian approximation: representing model uncertainty in deep learning. In Proceedings of the 33rd International Conference on Machine Learning, 2016. [18] Y Gal, R McAllister, and CE Rasmussen. Improving PILCO with Bayesian neural network dynamics models. In Data-Efficient Machine Learning workshop, ICML, 2016. [19] MG Genton, W Kleiber, et al. Cross-covariance functions for multivariate geostatistics. Statistical Science, 30(2):147–163, 2015. [20] A Gupta, C Devin, Y Liu, P Abbeel, and S Levine. Learning invariant feature spaces to transfer skills with reinforcement learning. In International Conference on Learning Representations, 2017. 10 [21] H van Hasselt, A Guez, and D Silver. Deep reinforcement learning with double Q-learning. In Proceedings of the Thirtieth AAAI Conference on Artificial Intelligence, pages 2094–2100. AAAI Press, 2016. [22] JM Hernández-Lobato, Y Li, M Rowland, D Hernández-Lobato, T Bui, and RE Turner. Black-box α-divergence minimization. In Proceedings of the 33rd International Conference on Machine Learning, 2016. [23] N Jaques, S Taylor, A Sano, and R Picard. Multi-task, multi-kernel learning for estimating individual wellbeing. In Proceedings of NIPS Workshop on Multimodal Machine Learning, 2015. [24] LP Kaelbling, ML Littman, and AR Cassandra. Planning and acting in partially observable stochastic domains. Artificial intelligence, 101(1):99–134, 1998. [25] A Kendall and Y Gal. What uncertainties do we need in bayesian deep learning for computer vision? arXiv preprint arXiv:1703.04977, 2017. [26] D Kingma and J Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations, 2015. [27] D JC MacKay. A practical Bayesian framework for backpropagation networks. Neural computation, 4(3): 448–472, 1992. [28] VN Marivate, J Chemali, E Brunskill, and M Littman. Quantifying uncertainty in batch personalized sequential decision making. In Workshops at the Twenty-Eighth AAAI Conference on Artificial Intelligence, 2014. [29] 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. [30] TM Moerland, J Broekens, and CM Jonker. Learning multimodal transition dynamics for model-based reinforcement learning. arXiv preprint arXiv:1705.00470, 2017. [31] AW Moore and CG Atkeson. Prioritized sweeping: reinforcement learning with less data and less time. Machine learning, 13(1):103–130, 1993. [32] BL Moore, LD Pyeatt, V Kulkarni, P Panousis, K Padrez, and AG Doufas. Reinforcement learning for closed-loop propofol anesthesia: a study in human volunteers. Journal of Machine Learning Research, 15 (1):655–696, 2014. [33] RM Neal. Bayesian training of backpropagation networks by the hybrid Monte carlo method. Technical report, Citeseer, 1992. [34] J Quiñonero-Candela and CE Rasmussen. A unifying view of sparse approximate gaussian process regression. Journal of Machine Learning Research, 6(Dec):1939–1959, 2005. [35] CE Rasmussen and M Kuss. Gaussian processes in reinforcement learning. In Advances in Neural Information Processing Systems, volume 15, 2003. [36] CE Rasmussen and CKI Williams. Gaussian processes for machine learning. MIT Press, Cambridge, 2006. [37] B Rosman, M Hawasly, and S Ramamoorthy. Bayesian policy reuse. Machine Learning, 104(1):99–127, 2016. [38] T Schaul, J Quan, I Antonoglou, and D Silver. Prioritized experience replay. In International Conference on Learning Representations, 2016. [39] P Schulam and S Saria. Integrative analysis using coupled latent variable models for individualizing prognoses. Journal of Machine Learning Research, 17:1–35, 2016. [40] SM Shortreed, E Laber, DJ Lizotte, TS Stroup, J Pineau, and SA Murphy. Informing sequential clinical decision-making through reinforcement learning: an empirical study. Machine learning, 84(1-2):109–136, 2011. [41] E Snelson and Z Ghahramani. Sparse gaussian processes using pseudo-inputs. In Advances in Neural Information Processing Systems, pages 1257–1264, 2006. [42] R Sutton and A Barto. Reinforcement learning: an introduction, volume 1. MIT Press, Cambridge, 1998. 11 [43] ME Taylor and P Stone. Transfer learning for reinforcement learning domains: a survey. Journal of Machine Learning Research, 10(Jul):1633–1685, 2009. [44] M Tenenbaum, A Fern, L Getoor, M Littman, V Manasinghka, S Natarajan, D Page, J Shrager, Y Singer, and P Tadepalli. Personalizing cancer therapy via machine learning. Workshops of NIPS, 2010. [45] JD Williams and S Young. Scaling POMDPs for dialog management with composite summary point-based value iteration (CSPBVI). In AAAI Workshop on Statistical and Empirical Approaches for Spoken Dialogue Systems, pages 37–42, 2006. 12
2017
89
7,230
Few-Shot Learning Through an Information Retrieval Lens Eleni Triantafillou University of Toronto Vector Institute Richard Zemel University of Toronto Vector Institute Raquel Urtasun University of Toronto Vector Institute Uber ATG Abstract Few-shot learning refers to understanding new concepts from only a few examples. We propose an information retrieval-inspired approach for this problem that is motivated by the increased importance of maximally leveraging all the available information in this low-data regime. We define a training objective that aims to extract as much information as possible from each training batch by effectively optimizing over all relative orderings of the batch points simultaneously. In particular, we view each batch point as a ‘query’ that ranks the remaining ones based on its predicted relevance to them and we define a model within the framework of structured prediction to optimize mean Average Precision over these rankings. Our method achieves impressive results on the standard few-shot classification benchmarks while is also capable of few-shot retrieval. 1 Introduction Recently, the problem of learning new concepts from only a few labelled examples, referred to as few-shot learning, has received considerable attention [1, 2]. More concretely, K-shot N-way classification is the task of classifying a data point into one of N classes, when only K examples of each class are available to inform this decision. This is a challenging setting that necessitates different approaches from the ones commonly employed when the labelled data of each new concept is abundant. Indeed, many recent success stories of machine learning methods rely on large datasets and suffer from overfitting in the face of insufficient data. It is however not realistic nor preferred to always expect many examples for learning a new class or concept, rendering few-shot learning an important problem to address. We propose a model for this problem that aims to extract as much information as possible from each training batch, a capability that is of increased importance when the available data for learning each class is scarce. Towards this goal, we formulate few-shot learning in information retrieval terms: each point acts as a ‘query’ that ranks the remaining ones based on its predicted relevance to them. We are then faced with the choice of a ranking loss function and a computational framework for optimization. We choose to work within the framework of structured prediction and we optimize mean Average Precision (mAP) using a standard Structural SVM (SSVM) [3], as well as a Direct Loss Minimization (DLM) [4] approach. We argue that the objective of mAP is especially suited for the low-data regime of interest since it allows us to fully exploit each batch by simultaneously optimizing over all relative orderings of the batch points. Figure 1 provides an illustration of this training objective. Our contribution is therefore to adopt an information retrieval perspective on the problem of few-shot learning; we posit that a model is prepared for the sparse-labels setting by being trained in a manner 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. Figure 1: Best viewed in color. Illustration of our training objective. Assume a batch of 6 points: G1, G2 and G3 of class "green", Y1 and Y2 of "yellow", and another point. We show in columns 1-5 the predicted rankings for queries G1, G2, G3, Y1 and Y2, respectively. Our learning objective is to move the 6 points in positions that simultaneously maximize the Average Precision (AP) of the 5 rankings. For example, the AP of G1’s ranking would be optimal if G2 and G3 had received the two highest ranks, and so on. that fully exploits the information in each batch. We also introduce a new form of a few-shot learning task, ‘few-shot retrieval’, where given a ‘query’ image and a pool of candidates all coming from previously-unseen classes, the task is to ‘retrieve’ all relevant (identically labelled) candidates for the query. We achieve competitive with the state-of-the-art results on the standard few-shot classification benchmarks and show superiority over a strong baseline in the proposed few-shot retrieval problem. 2 Related Work Our approach to few-shot learning heavily relies on learning an informative similarity metric, a goal that has been extensively studied in the area of metric learning. This can be thought of as learning a mapping of objects into a space where their relative positions are indicative of their similarity relationships. We refer the reader to a survey of metric learning [5] and merely touch upon a few representative methods here. Neighborhood Component Analysis (NCA) [6] learns a metric aiming at high performance in nearest neirhbour classification. Large Margin Nearest Neighbor (LMNN) [7] refers to another approach for nearest neighbor classification which constructs triplets and employs a contrastive loss to move the ‘anchor’ of each triplet closer to the similarly-labelled point and farther from the dissimilar one by at least a predefined margin. More recently, various methods have emerged that harness the power of neural networks for metric learning. These methods vary in terms of loss functions but have in common a mechanism for the parallel and identically-parameterized embedding of the points that will inform the loss function. Siamese and triplet networks are commonly-used variants of this family that operate on pairs and triplets, respectively. Example applications include signature verification [8] and face verification [9, 10]. NCA and LMNN have also been extended to their deep variants [11] and [12], respectively. These methods often employ hard-negative mining strategies for selecting informative constraints for training [10, 13]. A drawback of siamese and triplet networks is that they are local, in the sense that their loss function concerns pairs or triplets of training examples, guiding the learning process to optimize the desired relative positions of only two or three examples at a time. The myopia of these local methods introduces drawbacks that are reflected in their embedding spaces. [14] propose a method to address this by using higher-order information. We also learn a similarity metric in this work, but our approach is specifically tailored for few-shot learning. Other metric learning approaches for few-shot learning include [15, 1, 16, 17]. [15] employs a deep convolutional neural network that is trained to correctly predict pairwise similarities. Attentive Recurrent Comparators [16] also perform pairwise comparisons but form the representation of the pair through a sequence of glimpses at the two points that comprise it via a recurrent neural network. We note that these pairwise approaches do not offer a natural mechanism to solve K-shot N-way tasks for K > 1 and focus on one-shot learning, whereas our method tackles the more general few-shot learning problem. Matching Networks [1] aim to ‘match’ the training setup to the evaluation trials of K-shot N-way classification: they divide each sampled training ‘episode’ into disjoint support and query sets and backpropagate the classification error of each query point conditioned on the support set. Prototypical Networks [17] also perform episodic training, and use the simple yet effective mechanism of representing each class by the mean of its examples in the support set, constructing a 2 ‘prototype’ in this way that each query example will be compared with. Our approach can be thought of as constructing all such query/support sets within each batch in order to fully exploit it. Another family of methods for few-shot learning is based on meta-learning. Some representative work in this category includes [2, 18]. These approaches present models that learn how to use the support set in order to update the parameters of a learner model in such a way that it can generalize to the query set. Meta-Learner LSTM [2] learns an initialization for learners that can solve new tasks, whereas Model-Agnostic Meta-Learner (MAML) [18] learns an update step that a learner can take to be successfully adapted to a new task. Finally, [19] presents a method that uses an external memory module that can be integrated into models for remembering rarely occurring events in a life-long learning setting. They also demonstrate competitive results on few-shot classification. 3 Background 3.1 Mean Average Precision (mAP) Consider a batch B of points: X = {x1, x2, . . . , xN} and denote by cj the class label of the point xj. Let Relx1 = {xj ∈B : c1 == cj} be the set of points that are relevant to x1, determined in a binary fashion according to class membership. Let Ox1 denote the ranking based on the predicted similarity between x1 and the remaining points in B so that Ox1[j] stores x1’s jth most similar point. Precision at j in the ranking Ox1, denoted by Prec@jx1 is the proportion of points that are relevant to x1 within the j highest-ranked ones. The Average Precision (AP) of this ranking is then computed by averaging the precisions at j over all positions j in Ox1 that store relevant points. AP x1 = X j∈{1,...,|B−1|: Ox1[j]∈Relx1} Prec@jx1 |Relx1| where Prec@jx1 = |{k ≤j : Ox1[k] ∈Relx1}| j Finally, mean Average Precision (mAP) calculates the mean AP across batch points. mAP = 1 |B| X i∈{1,...B} AP xi 3.2 Structural Support Vector Machine (SSVM) Structured prediction refers to a family of tasks with inter-dependent structured output variables such as trees, graphs, and sequences, to name just a few [3]. Our proposed learning objective that involves producing a ranking over a set of candidates also falls into this category so we adopt structured prediction as our computational framework. SSVM [3] is an efficient method for these tasks with the advantage of being tunable to custom task loss functions. More concretely, let X and Y denote the spaces of inputs and structured outputs, respectively. Assume a scoring function F(x, y; w) depending on some weights w, and a task loss L(yGT, ˆy) incurred when predicting ˆy when the groundtruth is yGT. The margin-rescaled SSVM optimizes an upper bound of the task loss formulated as: min w E[max ˆy∈Y {L(yGT, ˆy) −F(x, yGT; w) + F(x, ˆy; w)}] The loss gradient can then be computed as: ∇wL(y) = ∇wF(X, yhinge, w) −∇wF(X, yGT, w) with yhinge = arg max ˆy∈Y {F(X, ˆy, w) + L(yGT, ˆy)} (1) 3.3 Direct Loss Minimization (DLM) [4] proposed a method that directly optimizes the task loss of interest instead of an upper bound of it. In particular, they provide a perceptron-like weight update rule that they prove corresponds to the gradient of the task loss. [20] present a theorem that equips us with the corresponding weight update rule for the task loss in the case of nonlinear models, where the scoring function is parameterized by a neural network. Since we make use of their theorem, we include it below for completeness. Let D = {(x, y)} be a dataset composed of input x ∈X and output y ∈Y pairs. Let F(X, y, w) be a scoring function which depends on the input, the output and some parameters w ∈RA. 3 Theorem 1 (General Loss Gradient Theorem from [20]). When given a finite set Y, a scoring function F(X, y, w), a data distribution, as well as a task-loss L(y, ˆy), then, under some mild regularity conditions, the direct loss gradient has the following form: ∇wL(y, yw) = ± lim ϵ→0 1 ϵ (∇wF(X, ydirect, w) −∇wF(X, yw, w)) (2) with: yw = arg max ˆy∈Y F(X, ˆy, w) and ydirect = arg max ˆy∈Y {F(X, ˆy, w) ± ϵL(y, ˆy)} This theorem presents us with two options for the gradient update, henceforth the positive and negative update, obtained by choosing the + or −of the ± respectively. [4] and [20] provide an intuitive view for each one. In the case of the positive update, ydirect can be thought of as the ‘worst’ solution since it corresponds to the output value that achieves high score while producing high task loss. In this case, the positive update encourages the model to move away from the bad solution ydirect. On the other hand, when performing the negative update, ydirect represents the ‘best’ solution: one that does well both in terms of the scoring function and the task loss. The model is hence encouraged in this case to adjust its weights towards the direction of the gradient of this best solution’s score. In a nutshell, this theorem provides us with the weight update rule for the optimization of a custom task loss, provided that we define a scoring function and procedures for performing standard and loss-augmented inference. 3.4 Relationship between DLM and SSVM As also noted in [4], the positive update of direct loss minimization strongly resembles that of the margin-rescaled structural SVM [3] which also yields a loss-informed weight update rule. This gradient computation differs from that of the direct loss minimization approach only in that, while SSVM considers the score of the ground-truth F(X, yGT, w), direct loss minimization considers the score of the current prediction F(X, yw, w). The computation of yhinge strongly resembles that of ydirect in the positive update. Indeed SSVM’s training procedure also encourages the model to move away from weights that produce the ‘worst’ solution yhinge. 3.5 Optimizing for Average Precision (AP) In the following section we adapt and extend a method for optimizing AP [20]. Given a query point, the task is to rank N points x = (x1, . . . , xN) with respect to their relevance to the query, where a point is relevant if it belongs to the same class as the query and irrelevant otherwise. Let P and N be the sets of ‘positive’ (i.e. relevant) and ‘negative’ (i.e. irrelevant) points respectively. The output ranking is represented as yij pairs where ∀i, j, yij = 1 if i is ranked higher than j and yij = −1 otherwise, and ∀i, yii = 0. Define y = (. . . , yij, . . . ) to be the collection of all such pairwise rankings. The scoring function that [20] used is borrowed from [21] and [22]: F(x, y, w) = 1 |P||N| X i∈P,j∈N yij(ϕ(xi, w) −ϕ(xj, w)) where ϕ(xi, w) can be interpreted as the learned similarity between xi and the query. [20] devise a dynamic programming algorithm to perform loss-augmented inference in this setting which we make use of but we omit for brevity. 4 Few-Shot Learning by Optimizing mAP In this section, we present our approach for few-shot learning that optimizes mAP. We extend the work of [20] that optimizes for AP in order to account for all possible choices of query among the batch points. This is not a straightforward extension as it requires ensuring that optimizing the AP of one query’s ranking does not harm the AP of another query’s ranking. In what follows we define a mathematical framework for this problem and we show that we can treat each query independently without sacrificing correctness, therefore allowing to efficiently in parallel 4 learn to optimize all relative orderings within each batch. We then demonstrate how we can use the frameworks of SSVM and DLM for optimization of mAP, producing two variants of our method henceforth referred to as mAP-SSVM and mAP-DLM, respectively. Setup: Let B be a batch of points: B = {x1, x2, . . . , xN} belonging to C different classes. Each class c ∈{1, 2, . . . , C} defines the positive set Pc containing the points that belong to c and the negative set N c containing the rest of the points. We denote by ci the class label of the ith point. We represent the output rankings as a collection of yi kj variables where yi kj = 1 if k is ranked higher than j in i’s ranking, yi kk = 0 and yi kj = −1 if j is ranked higher than k in i’s ranking. For convenience we combine these comparisons for each query i in yi = (. . . , yi kj, . . . ). Let f(x, w) be the embedding function, parameterized by a neural network and ϕ(x1, x2, w) the cosine similarity of points x1 and x2 in the embedding space given by w: ϕ(x1, x2, w) = f(x1, w) · f(x2, w) |f(x1, w)||f(x2, w)| ϕ(xi, xj, w) is typically referred in the literature as the score of a siamese network. We consider for each query i, the function F i(X, yi, w): F i(X, yi, w) = 1 |Pci||N ci| X k∈Pci\i X j∈N ci yi kj(ϕ(xi, xk, w) −ϕ(xi, xj, w)) We then compose the scoring function by summing over all queries: F(X, y, w) = X i∈B F i(X, yi, w) Further, for each query i ∈B, we let pi = rank(yi) ∈{0, 1}|Pci|+|N ci| be a vector obtained by sorting the yi kj’s ∀k ∈Pci \ i, j ∈N ci, such that for a point g ̸= i, pi g = 1 if g is relevant for query i and pi g = −1 otherwise. Then the AP loss for the ranking induced by some query i is defined as: Li AP (pi, ˆpi) = 1 − 1 |Pci| X j:ˆpi j=1 Prec@j where Prec@j is the percentage of relevant points among the top-ranked j and pi and ˆpi denote the ground-truth and predicted binary relevance vectors for query i, respectively. We define the mAP loss to be the average AP loss over all query points. Inference: We proof-sketch in the supplementary material that inference can be performed efficiently in parallel as we can decompose the problem of optimizing the orderings induced by the different queries to optimizing each ordering separately. Specifically, for a query i of class c the computation of the yi kj’s, ∀k ∈Pc \ i, j ∈N c can happen independently of the computation of the yi′ k′j′’s for some other query i′ ̸= i. We are thus able to optimize the ordering induced by each query point independently of those induced by the other queries. For query i, positive point k and negative point j, the solution of standard inference is yi wkj = arg maxyi F i(X, yi, w) and can be computed as follows yi wkj = 1, if ϕ(xi, xk, w) −ϕ(xi, xj, w) > 0 −1, otherwise (3) Loss-augmented inference for query i is defined as yi direct = arg max ˆyi  F i(X, ˆyi, w) ± ϵLi(yi, ˆyi) (4) and can be performed via a run of the dynamic programming algorithm of [20]. We can then combine the results of all the independent inferences to compute the overall scoring function F(X, yw, w) = X i∈B F i(X, yi w, w) and F(X, ydirect, w) = X i∈B F i(X, yi direct, w) (5) Finally, we define the ground-truth output value yGT . For any query i and distinct points m, n ̸= i we set yi GTmn = 1 if m ∈Pci and n ∈N ci, yi GTmn = −1 if n ∈Pci and m ∈N ci and yi GTmn = 0 otherwise. 5 Algorithm 1 Few-Shot Learning by Optimizing mAP Input: A batch of points X = {x1, . . . , xN} of C different classes and ∀c ∈{1, . . . , C} the sets Pc and N c. Initialize w if using mAP-SSVM then Set yi GT = ONES(|Pci|, |N ci|), ∀i = 1, . . . , N end if repeat if using mAP-DLM then Standard inference: Compute yi w, ∀i = 1, . . . , N as in Equation 3 end if Loss-augmented inference: Compute yi direct, ∀i = 1, . . . , N via the DP algorithm of [20] as in Equation 4. In the case of mAP-SSVM, always use the positive update option and set ϵ = 1 Compute F(X, ydirect, w) as in Equation 5 if using mAP-DLM then Compute F(X, yw, w) as in Equation 5 Compute the gradient ∇wL(y, yw) as in Equation 2 else if using mAP-SSVM then Compute F(X, yGT , w) as in Equation 6 Compute the gradient ∇wL(y, yw) as in Equation 1 (using ydirect in the place of yhinge) end if Perform the weight update rule with stepsize η: w ←w −η∇wL(y, yw) until stopping criteria We note that by construction of our scoring function defined above, we will only have to compute yi kj’s where k and i belong to the same class ci and j is a point from another class. Because of this, we set the yi GT for each query i to be an appropriately-sized matrix of ones: yi GT = ones(|Pci|, |N ci|). The overall score of the ground truth is then F(X, yGT , w) = X i∈B F i(X, yi GT , w) (6) Optimizing mAP via SSVM and DLM We have now defined all the necessary components to compute the gradient update as specified by the General Loss Gradient Theorem of [20] in equation 2 or as defined by the Structural SVM in equation 1. For clarity, Algorithm 1 describes this process, outlining the two variants of our approach for few-shot learning, namely mAP-DLM and mAP-SSVM. 5 Evaluation In what follows, we describe our training setup, the few-shot learning tasks of interest, the datasets we use, and our experimental results. Through our experiments, we aim to evaluate the few-shot retrieval ability of our method and additionally to compare our model to competing approaches for few-shot classification. For this, we have updated our tables to include very recent work that is published concurrently with ours in order to provide the reader with a complete view of the state-of-the-art on few-shot learning. Finally, we also aim to investigate experimentally our model’s aptness for learning from little data via its training objective that is designed to fully exploit each training batch. Controlling the influence of loss-augmented inference on the loss gradient We found empirically that for the positive update of mAP-DLM and for mAP-SSVM, it is beneficial to introduce a hyperparamter α that controls the contribution of the loss-augmented F(X, ydirect, w) relative to that of F(X, yw, w) in the case of mAP-DLM, or F(X, yGT , w) in the case of mAP-SSVM. The updated rules that we use in practice for training mAP-DLM and mAP-SSVM, respectively, are shown below, where α is a hyperparamter. ∇wL(y, yw) = ± lim ϵ→0 1 ϵ (α∇wF(X, ydirect, w) −∇wF(X, yw, w)) and ∇wL(y) = α∇wF(X, ydirect, w) −∇wF(X, yyGT , w) We refer the reader to the supplementary material for more details concerning this hyperparameter. 6 Classification Retrieval 1-shot 5-shot 1-shot 5-way 20-way 5-way 20-way 5-way 20-way Siamese 98.8 95.5 98.6 95.7 Matching Networks [1] 98.1 93.8 98.9 98.5 Prototypical Networks [17] 98.8 96.0 99.7 98.9 MAML [18] 98.7 95.8 99.9 98.9 ConvNet w/ Memory [19] 98.4 95.0 99.6 98.6 mAP-SSVM (ours) 98.6 95.2 99.6 98.6 98.6 95.7 mAP-DLM (ours) 98.8 95.4 99.6 98.6 98.7 95.8 Table 1: Few-shot learning results on Omniglot (averaged over 1000 test episodes). We report accuracy for the classification and mAP for the retrieval tasks. Few-shot Classification and Retrieval Tasks Each K-shot N-way classification ‘episode’ is constructed as follows: N evaluation classes and 20 images from each one are selected uniformly at random from the test set. For each class, K out of the 20 images are randomly chosen to act as the ‘representatives’ of that class. The remaining 20 −K images of each class are then to be classified among the N classes. This poses a total of (20 −K)N classification problems. Following the standard procedure, we repeat this process 1000 times when testing on Omniglot and 600 times for mini-ImageNet in order to compute the results reported in tables 1 and 2. We also designed a similar one-shot N-way retrieval task, where to form each episode we select N classes at random and 10 images per class, yielding a pool of 10N images. Each of these 10N images acts as a query and ranks all remaining (10N - 1) images. The goal is to retrieve all 9 relevant images before any of the (10N - 10) irrelevant ones. We measure the performance on this task using mAP. Note that since this is a new task, there are no publicly available results for the competing few-shot learning methods. Our Algorithm for K-shot N-way classification Our model classifies image x into class c = arg maxi AP i(x), where AP i(x) denotes the average precision of the ordering that image x assigns to the pool of all KN representatives assuming that the ground truth class for image x is i. This means that when computing AP i(x), the K representatives of class i will have a binary relevance of 1 while the K(N −1) representatives of the other classes will have a binary relevance of 0. Note that in the one-shot learning case where K = 1 this amounts to classifying x into the class whose (single) representative is most similar to x according to the model’s learned similarity metric. We note that the siamese model does not naturally offer a procedure for exploiting all K representatives of each class when making the classification decision for some reference. Therefore we omit few-shot learning results for siamese when K > 1 and examine this model only in the one-shot case. Training details We use the same embedding architecture for all of our models for both Omniglot and mini-ImageNet. This architecture mimics that of [1] and consists of 4 identical blocks stacked upon each other. Each of these blocks consists of a 3x3 convolution with 64 filters, batch normalization [23], a ReLU activation, and 2x2 max-pooling. We resize the Omniglot images to 28x28, and the mini-ImageNet images to 3x84x84, therefore producing a 64-dimensional feature vector for each Omniglot image and a 1600-dimensional one for each mini-ImageNet image. We use ADAM [24] for training all models. We refer the reader to the supplementary for more details. Omniglot The Omniglot dataset [25] is designed for testing few-shot learning methods. This dataset consists of 1623 characters from 50 different alphabets, with each character drawn by 20 different drawers. Following [1], we use 1200 characters as training classes and the remaining 423 for evaluation while we also augment the dataset with random rotations by multiples of 90 degrees. The results for this dataset are shown in Table 1. Both mAP-SSVM and mAP-DLM are trained with α = 10, and for mAP-DLM the positive update was used. We used |B| = 128 and N = 16 for our models and the siamese. Overall, we observe that many methods perform very similarly on few-shot classification on this dataset, ours being among the top-performing ones. Further, we perform equally well or better than the siamese network in few-shot retrieval. We’d like to emphasize that the siamese network is a tough baseline to beat, as can be seen from its performance in the classification tasks where it outperforms recent few-shot learning methods. mini-ImageNet mini-ImageNet refers to a subset of the ILSVRC-12 dataset [26] that was used as a benchmark for testing few-shot learning approaches in [1]. This dataset contains 60,000 84x84 color images and constitutes a significantly more challenging benchmark than Omniglot. In order to 7 Classification Retrieval 5-way 5-way 20-way 1-shot 5-shot 1-shot 1-shot Baseline Nearset Neighbors* 41.08 ± 0.70 % 51.04 ± 0.65 % Matching Networks* [1] 43.40 ± 0.78 % 51.09 ± 0.71 % Matching Networks FCE* [1] 43.56 ± 0.84 % 55.31 ± 0.73 % Meta-Learner LSTM* [2] 43.44 ± 0.77 % 60.60 ± 0.71 % Prototypical Networks [17] 49.42 ± 0.78% 68.20 ± 0.66 % MAML [18] 48.70 ± 1.84 % 63.11 ± 0.92 % Siamese 48.42 ± 0.79 % 51.24 ± 0.57 % 22.66 ± 0.13 % mAP-SSVM (ours) 50.32 ± 0.80 % 63.94 ± 0.72 % 52.85 ± 0.56 % 23.87 ± 0.14 % mAP-DLM (ours) 50.28 ± 0.80 % 63.70 ± 0.70 % 52.96 ± 0.55 % 23.68 ± 0.13 % Table 2: Few-shot learning results on miniImageNet (averaged over 600 test episodes and reported with 95% confidence intervals). We report accuracy for the classification and mAP for the retrieval tasks. *Results reported by [2]. compare our method with the state-of-the-art on this benchmark, we adapt the splits introduced in [2] which contain a total of 100 classes out of which 64 are used for training, 16 for validation and 20 for testing. We train our models on the training set and use the validation set for monitoring performance. Table 2 reports the performance of our method and recent competing approaches on this benchmark. As for Omniglot, the results of both versions of our method are obtained with α = 10, and with the positive update in the case of mAP-DLM. We used |B| = 128 and N = 8 for our models and the siamese. We also borrow the baseline reported in [2] for this task which corresponds to performing nearest-neighbors on top of the learned embeddings. Our method yields impressive results here, outperforming recent approaches tailored for few-shot learning either via deep-metric learning such as Matching Networks [1] or via meta-learning such as Meta-Learner LSTM [2] and MAML [18] in few-shot classification. We set the new state-of-the-art for 1-shot 5-way classification. Further, our models are superior than the strong baseline of the siamese network in the few-shot retrieval tasks. CUB We also experimented on the Caltech-UCSD Birds (CUB) 200-2011 dataset [27], where we outperform the siamese network as well. More details can be found in the supplementary. Learning Efficiency We examine our method’s learning efficiency via comparison with a siamese network. For fair comparison of these models, we create the training batches in a way that enforces that they have the same amount of information available for each update: each training batch B is formed by sampling N classes uniformly at random and |B| examples from these classes. The siamese network is then trained on all possible pairs from these sampled points. Figure 2 displays the performance of our model and the siamese on different metrics on Omniglot and mini-ImageNet. The first two rows show the performance of our two variants and the siamese in the few-shot classification (left) and few-shot retrieval (right) tasks, for various levels of difficulty as regulated by the different values of N. The first row corresponds to Omniglot and the second to mini-ImageNet. We observe that even when both methods converge to comparable accuracy or mAP values, our method learns faster, especially when the ‘way’ of the evaluation task is larger, making the problem harder. In the third row in Figure 2, we examine the few-shot learning performance of our model and the all-pairs siamese that were trained with N = 8 but with different |B|. We note that for a given N, larger batch size implies larger ‘shot’. For example, for N = 8, |B| = 64 results to on average 8 examples of each class in each batch (8-shot) whereas |B| = 16 results to on average 2-shot. We observe that especially when the ‘shot’ is smaller, there is a clear advantage in using our method over the all-pairs siamese. Therefore it indeed appears to be the case that the fewer examples we are given per class, the more we can benefit from our structured objective that simultaneously optimizes all relative orderings. Further, mAP-DLM can reach higher performance overall with smaller batch sizes (thus smaller ‘shot’) than the siamese, indicating that our method’s training objective is indeed efficiently exploiting the batch examples and showing promise in learning from less data. Discussion It is interesting to compare experimentally methods that have pursued different paths in addressing the challenge of few-shot learning. In particular, the methods we compare against each other in our tables include deep metric learning approaches such as ours, the siamese network, Prototypical Networks and Matching Networks, as well as meta-learning methods such as MetaLearner LSTM [2] and MAML [18]. Further, [19] has a metric-learning flavor but employs external memory as a vehicle for remembering representations of rarely-observed classes. The experimental 8 Figure 2: Few-shot learning performance (on unseen validation classes). Each point represents the average performance across 100 sampled episodes. Top row: Omniglot. Second and third rows: mini-ImageNet. results suggest that there is no clear winner category and all these directions are worth exploring further. Overall, our model performs on par with the state-of-the-art results on the classification benchmarks, while also offering the capability of few-shot retrieval where it exhibits superiority over a strong baseline. Regarding the comparison between mAP-DLM and mAP-SSVM, we remark that they mostly perform similarly to each other on the benchmarks considered. We have not observed in this case a significant win for directly optimizing the loss of interest, offered by mAP-DLM, as opposed to minimizing an upper bound of it. 6 Conclusion We have presented an approach for few-shot learning that strives to fully exploit the available information of the training batches, a skill that is utterly important in the low-data regime of few-shot learning. We have proposed to achieve this via defining an information-retrieval based training objective that simultaneously optimizes all relative orderings of the points in each training batch. We experimentally support our claims for learning efficiency and present promising results on two standard few-shot learning datasets. An interesting future direction is to not only reason about how to best exploit the information within each batch, but additionally about how to create training batches in order to best leverage the information in the training set. Furthermore, we leave it as future work to explore alternative information retrieval metrics, instead of mAP, as training objectives for few-shot learning (e.g. ROC curve, discounted cumulative gain etc). 9 References [1] Oriol Vinyals, Charles Blundell, Tim Lillicrap, Daan Wierstra, et al. Matching networks for one shot learning. In Advances in Neural Information Processing Systems, pages 3630–3638, 2016. [2] Sachin Ravi and Hugo Larochelle. Optimization as a model for few-shot learning. In International Conference on Learning Representations, volume 1, page 6, 2017. [3] Ioannis Tsochantaridis, Thorsten Joachims, Thomas Hofmann, and Yasemin Altun. Large margin methods for structured and interdependent output variables. Journal of machine learning research, 6(Sep):1453– 1484, 2005. [4] Tamir Hazan, Joseph Keshet, and David A McAllester. Direct loss minimization for structured prediction. In Advances in Neural Information Processing Systems, pages 1594–1602, 2010. [5] Aurélien Bellet, Amaury Habrard, and Marc Sebban. A survey on metric learning for feature vectors and structured data. arXiv preprint arXiv:1306.6709, 2013. [6] Jacob Goldberger, Sam Roweis, Geoff Hinton, and Ruslan Salakhutdinov. Neighbourhood components analysis. In Advances in Neural Information Processing Systems, page 513–520, 2005. [7] Kilian Q Weinberger, John Blitzer, and Lawrence K Saul. Distance metric learning for large margin nearest neighbor classification. In Advances in neural information processing systems, pages 1473–1480, 2005. [8] Jane Bromley, James W Bentz, Léon Bottou, Isabelle Guyon, Yann LeCun, Cliff Moore, Eduard Säckinger, and Roopak Shah. Signature verification using a “siamese” time delay neural network. International Journal of Pattern Recognition and Artificial Intelligence, 7(04):669–688, 1993. [9] Sumit Chopra, Raia Hadsell, and Yann LeCun. Learning a similarity metric discriminatively, with application to face verification. In 2005 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR’05), volume 1, pages 539–546. IEEE, 2005. [10] Florian Schroff, Dmitry Kalenichenko, and James Philbin. Facenet: A unified embedding for face recognition and clustering. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 815–823, 2015. [11] Ruslan Salakhutdinov and Geoffrey E Hinton. Learning a nonlinear embedding by preserving class neighbourhood structure. In AISTATS, volume 11, 2007. [12] Renqiang Min, David A Stanley, Zineng Yuan, Anthony Bonner, and Zhaolei Zhang. A deep non-linear feature mapping for large-margin knn classification. In Data Mining, 2009. ICDM’09. Ninth IEEE International Conference on, pages 357–366. IEEE, 2009. [13] Hyun Oh Song, Yu Xiang, Stefanie Jegelka, and Silvio Savarese. Deep metric learning via lifted structured feature embedding. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4004–4012, 2016. [14] Hyun Oh Song, Stefanie Jegelka, Vivek Rathod, and Kevin Murphy. Learnable structured clustering framework for deep metric learning. arXiv preprint arXiv:1612.01213, 2016. [15] Gregory Koch. Siamese neural networks for one-shot image recognition. PhD thesis, University of Toronto, 2015. [16] Pranav Shyam, Shubham Gupta, and Ambedkar Dukkipati. Attentive recurrent comparators. arXiv preprint arXiv:1703.00767, 2017. [17] Jake Snell, Kevin Swersky, and Richard S Zemel. Prototypical networks for few-shot learning. arXiv preprint arXiv:1703.05175, 2017. [18] Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. arXiv preprint arXiv:1703.03400, 2017. [19] Łukasz Kaiser, Ofir Nachum, Aurko Roy, and Samy Bengio. Learning to remember rare events. arXiv preprint arXiv:1703.03129, 2017. [20] Yang Song, Alexander G Schwing, Richard S Zemel, and Raquel Urtasun. Training deep neural networks via direct loss minimization. In Proceedings of The 33rd International Conference on Machine Learning, pages 2169–2177, 2016. 10 [21] Yisong Yue, Thomas Finley, Filip Radlinski, and Thorsten Joachims. A support vector method for optimizing average precision. In Proceedings of the 30th annual international ACM SIGIR conference on Research and development in information retrieval, pages 271–278. ACM, 2007. [22] Pritish Mohapatra, CV Jawahar, and M Pawan Kumar. Efficient optimization for average precision svm. In Advances in Neural Information Processing Systems, pages 2312–2320, 2014. [23] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015. [24] Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. [25] Brenden M Lake, Ruslan Salakhutdinov, Jason Gross, and Joshua B Tenenbaum. One shot learning of simple visual concepts. In CogSci, volume 172, page 2, 2011. [26] 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. [27] Catherine Wah, Steve Branson, Peter Welinder, Pietro Perona, and Serge Belongie. The caltech-ucsd birds-200-2011 dataset. 2011. 11
2017
9
7,231
Multi-View Decision Processes: The Helper-AI Problem Christos Dimitrakakis David C. Parkes Chalmers University of Technology & University of Lille Harvard University           Goran Radanovic Paul Tylkin Harvard University Harvard University            Abstract We consider a two-player sequential game in which agents have the same reward function but may disagree on the transition probabilities of an underlying Markovian model of the world. By committing to play a specific policy, the agent with the correct model can steer the behavior of the other agent, and seek to improve utility. We model this setting as a multi-view decision process, which we use to formally analyze the positive effect of steering policies. Furthermore, we develop an algorithm for computing the agents’ achievable joint policy, and we experimentally show that it can lead to a large utility increase when the agents’ models diverge. 1 Introduction. In the past decade, we have been witnessing the fulfillment of Licklider’s profound vision on AI [Licklider, 1960]: Man-computer symbiosis is an expected development in cooperative interaction between men and electronic computers. Needless to say, such a collaboration, between humans and AIs, is natural in many real-world AI problems. As a motivating example, consider the case of autonomous vehicles, where a human driver can override the AI driver if needed. With advances in AI, the human will benefit most if she allows the AI agent to assume control and drive optimally. However, this might not be achievable—due to human behavioral biases, such as over-weighting the importance of rare events, the human might incorrectly override the AI. In the way, the misaligned models of the two drivers can lead to a decrease in utility. In general, this problem may occur whenever two agents disagree on their view of reality, even if they cooperate to achieve a common goal. Formalizing this setting leads to a class of sequential multi-agent decision problems that extend stochastic games. While in a stochastic game there is an underlying transition kernel to which all agents (players) agree, the same is not necessarily true in the described scenario. Each agent may have a different transition model. We focus on a leader-follower setting in which the leader commits to a policy that the follower then best responds to, according to the follower’s model. Mapped to our motivating example, this would mean that the AI driver is aware of human behavioral biases and takes them into account when deciding how to drive. To incorporate both sequential and stochastic aspects, we model this as a multi-view decision process. Our multi-view decision process is based on an MDP model, with two, possibly different, transition kernels. One of the agents, hereafter denoted as P1, is assumed to have the correct transition kernel and is chosen to be the leader of the Stackelberg game—it commits to a policy that the second agent 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. (P2) best-responds to according to its own model. The agents have the same reward function, and are in this sense cooperative. In an application setting, while the human (P2) may not be a planner, we motivate our set-up as modeling the endpoint of an adaptive process that leads P2 to adopt a best-response to the policy of P1. Using the multi-view decision process, we analyze the effect of P2’s imperfect model on the achieved utility. We place an upper bound on the utility loss due to this, and also provide a lower bound on how much P1 gains by knowing P2’s model. One of our main analysis tools is the amount of influence an agent has, i.e. how much its actions affect the transition probabilities, both according to its own model, and according to the model of the other agent. We also develop an algorithm, extending backwards induction for simultaneous-move sequential games [c.f. Bošansk`y et al., 2016], to compute a pair of policies that constitute a subgame perfect equilibrium. In our experiments, we introduce intervention games as a way to construct example scenarios. In an intervention game, an AI and a human share control of a process, and the human can intervene to override the AI’s actions but suffers some cost in doing so. This allows us to derive a multi-view process from any single-agent MDP. We consider two domains: first, the intervention game variant of the shelter-food game introduced by Guo et al. [2013], as well as an autonomous driving problem that we introduce here. Our results show that the proposed approach provides a large increase in utility in each domain, thus overcoming the deficiencies of P2’s model, when the latter model is known to the AI. 1.1 Related work Environment design [Zhang et al., 2009, Zhang and Parkes, 2008] is a related problem, where a first agent seeks to modulate the behavior of a second agent. However, the interaction between agents occurs through finding a good modification of the second agent’s reward function: the AI observes a human performing a task, and uses inverse reinforcement learning [Ng et al., 2000] to estimate the human’s reward function. Then it can assign extrinsic reward to different states in order to improve the human’s policy. A similar problem in single-agent reinforcement learning is how to use internal rewards to improve the performance of a computationally-bounded, reinforcement learning agent [Sorg et al., 2010]. For example, even a myopic agent can maximize expected utility over a long time horizon if augmented with appropriately designed internal rewards. Our model differs from these prior works, in that the interaction between a ‘helper agent’ and a second agent is through taking actions in the same environment as the second agent. In cooperative inverse reinforcement learning [Hadfield-Menell et al., 2016], an AI wants to cooperate with a human but does not initially understand the task. While their framework allows for simultaneous moves of the AI and the human, they only apply it to two-stage games, where the human demonstrates a policy in the first stage and the AI imitates in the second stage. They show that the human should take into account the AI’s best response when providing demonstrations, and develop an algorithm for computing an appropriate demonstration policy. Our focus is on joint actions in a multi-period, uncertain environment, rather than teaching. The model of Amir et al. [2016] is also different, in that it considers the problem of how a teacher can optimally give advice to a sub-optimal learner, and is thus focused on communication and adaptation rather than interaction through actions. Finally, Elmalech et al. [2015] consider an advice-giving AI in single-shot games, where the human has an incorrect model. They experimentally find that when the AI heuristically models human expectations when giving advice, their performance is improved. We find that this also holds in our more general setting. We cannot use standard methods for computing optimal strategies in stochastic games [Bošanský et al., 2015, Zinkevich et al., 2005], as the two agents have different models of the transitions between states. On the other extreme, a very general formalism to represent agent beliefs, such as that of Gal and Pfeffer [2008] is not well suited, because we have a Stackelberg setting and the problem of the follower is standard. Our approach is to extend backwards induction [c.f. Bošansk`y et al., 2016, Sec. 4] to the case of misaligned models in order to obtain a subgame perfect policy for the AI. Paper organization. Section 2 formalises the setting and its basic properties, and provides a lower bound on the improvement P1 obtains when P2’s model is known. Section 3 introduces a backwards induction algorithm, while Section 4 discusses the experimental results. We conclude with Section 5. Finally, Appendix A collects all the proofs, additional technical material and experimental details. 2 2 The Setting and Basic Properties We consider two-agent sequential stochastic game, with two agents P1, P2, who disagree on the underlying model of the world, with the i-th agent’s model being µi, but share the same reward function. More formally, Definition 1 (Multi-view decision process (MVDP)). A multi-view decision process G = S, A, σ1, σ2, µ1, µ2, ρ, γ is a game between two agents, P1, P2, who share the same reward function. The game has a state space S, with S  |S|, action space A =  i Ai, with A  |A|, starting state distribution σ, transition kernel µ, reward function1 ρ : S →[0, 1], and discount factor γ ∈[0, 1]. At time t, the agents observe the state st, take a joint action at = (at,1, at,2) and receive reward rt = ρ(st). However, the two agents may have a different view of the game, with agent i modelling the transition probabilities of the process as µi(st+1 | st, at) for the probability of the next state st+1 given the current state st and joint action at. Each agent’s actions are drawn from a policy πi, which may be an arbitrary behavioral policy, fixed at the start of the game. For a given policy pair π = (π1, π2), with πi ∈Πi and Π   i Πi, the respective payoff from the point of view of the i-th agent ui : Π →R is defined to be: ui(π) = Eπ µi[U | s1 ∼σ], U  T  t=t γt−1ρ(st). (2.1) For simplicity of presentation, we define reward rt = ρ(st) at time t, as a function of the state only, although an extension to state-action reward functions is trivial. The reward, as well, as well as the utility U (the discounted sum of rewards over time) are the same for both agents for a given sequence of states. However, the payoff for agent i is their expected utility under the model i, and can be different for each agent. Any two-player stochastic game can be cast into an MVDP: Lemma 1. Any two-player general-sum stochastic game (SG) can be reduced to a two-player MVDP in polynomial time and space. The proof of Lemma 1 is in Appendix A. 2.1 Stackelberg setting We consider optimal policies from the point of view of P1, who is trying to assist a misguided P2. For simplicity, we restrict our attention to the Stackelberg setting, i.e. where P1 commits to a specific policy π1 at the start of the game. This simplifies the problem for P2, who can play the optimal response according to the agent’s model of the world. We begin by defining the (potentially unachievable) optimal joint policy, where both policies are chosen to maximise the same utility function: Definition 2 (Optimal joint policy). A joint policy ¯π is optimal under σ and µ1 iff u1(¯π) ≥u1(π), ∀π ∈Π. We furthermore use ¯u1  u1(¯π) to refer to the value of the jointly optimal policy. This value may not be achievable, even though the two agents share a reward function, as the second agent’s model does not agree with the first agent’s, and so their expected utilities are different. To model this, we define the Stackelberg utility of policy π1 for the first agent as: uSt 1 (π1)  u1(π1, πB 2 (π1)), πB 2 (π1) = arg max π2∈Π2 u2(π1, π2), (2.2) i.e. the value of the policy when the second agent best responds to agent one’s policy under the second agent’s model.2 The following defines the highest utility that P1 can achieve. 1For simplicity we consider state-dependent rewards bounded in [0, 1]. Our results are easily generalizable to ρ : S × A →[0, 1], through scaling by a factor of B and shifting by a factor of bm for any reward function in [b, b + B]. 2If there is no unique best response, we define the utility in terms of the worst-case, best response. 3 Definition 3 (Optimal policy). The optimal policy for P1, denoted by π∗ 1, is the one maximizing the Stackelberg utility, i.e. uSt 1 (π∗ 1) ≥uSt 1 (π1), π1 ∈Π1, and we use u∗ 1  uSt(π∗ 1) to refer to the value of this optimal policy. In the remainder of the technical discussion, we will characterize P1 policies in terms of how much worse they are than the jointly optimal policy, as well as how much better they can be than the policy that blithely assumes that P2 shares the same model. We start with some observations about the nature of the game when one agent fixes its policy, and we argue how the difference between the models of the two agents affects the utility functions. We then combine this with a definition of influence to obtain bounds on the loss due to the difference in the models. When agent i fixes a Markov policy πi, the game is an MDP for agent j. However, if agent i’s policy is not Markovian the resulting game is not an MDP on the original state space. We show that if P1 acts as if P2 has the correct transition kernel, then the resulting joint policy has value bounded by the L1 norm between the true kernel and agent 2’s actual kernel. We begin by establishing a simple inequality to show that knowledge of the model µ2 is beneficial for P1. Lemma 2. For any MVDP, the utility of the jointly optimal policy is greater than that of the (achievable) optimal policy, which is in turn greater than that of the policy that assumes that µ2 = µ1. u1(¯π) ≥uSt 1 (π∗ 1) ≥uSt 1 (¯π1) (2.3) Proof. The first inequality follows from the definition of the jointly optimal policy and uSt 1 . For the second inequality, note that the middle term is a maximizer for the right-hand side. Consequently, P1 must be able to do (weakly) better if it knows µ2 compared to if it just assumes that µ2 = µ1. However, this does not tell us how much (if any) improvement we can obtain. Our idea is to see what policy π1 we would need to play in order to make P2 play ¯π2, and measure the distance of this policy from ¯π1. To obtain a useful bound, we need to have a measure on how much P1 must deviate from ¯π1 in order for P2 to play ¯π2. For this, we define the notion of influence. This will capture the amount by which a agent i can affect the game in the eyes of agent j. In particular, it is the maximal amount by which an agent i can affect the transition distribution of agent j by changing i’s action at each state s: Definition 4 (Influence). The influence of agent i on the transition distribution of model µj is defined as the vector: Ii,j(s)  max at,−i max at,ia t,i µj(· | st = s, at,i, at,−i) −µj(· | st = s, a t,i, at,−i)1, (2.4) where the norm is over the difference in next-state distributions st+1 for the two models. Thus, I1,1 describes the actual influence of P1 on the transition probabilities, while I1,2 describes the perceived influence of P1 by P2. We will use influence to define an µ-dependent distance between policies, capturing the effect of an altered policy on the model: Definition 5 (Policy distance). The distance between policies πi, π i under model µj is: πi −π iµj  max s∈S πi(· | s) −π i(· | s)1Ii,j(s). (2.5) These two definitions result in the following Lipschitz condition on the utility function, whose proof can be found in Appendix A. Lemma 3. For any fixed π2, and any π1, π 1: ui(π1, π2) ≤ui(π 1, π2) + π1 −π 1µi γ (1−γ)2 , with a symmetric result holding for any fixed policy π1, and any pair π2, π 2. Lemma 3 bounds the change in utility due to a change in policy by P1 with respect to i’s payoff. As shall be seen in the next section, it allows us to analyze how close the utility we can achieve comes to that of the jointly optimal policy, and how much can be gained by not naively assuming that the model of P2 is the same. 4 2.2 Optimality In this section, we illuminate the relationship between different types of policies. First, we show that if P1 simply assumes µ2 = µ1, it only suffers a bounded loss relative to the jointly optimal policy. Subsequently, we prove that knowing µ2 allows P1 to find an improved policy. Lemma 4. Consider the optimal policy ¯π1 for the modified game G = S, A, σ1, σ1, µ1, µ1, ρ, γ where P2’s model is correct. Then ¯π1 is Markov and achieves utility ¯u in G, while its utility in G is: uSt 1 (¯π1) ≥¯u −2µ1 −µ21 (1 −γ)2 , µ1 −µ21  max st,at µ1(st+1 | st, at) −µ2(st+1 | st, at)1. As this bound depends on the maximum between all state action pairs, we refine it in terms of the influence of each agent’s actions. This also allows us to measure the loss in terms of the difference in P2’s actual and desired response, rather than the difference between the two models, which can be much larger. Corollary 1. If P2’s best response to ¯π1 is πB 2(¯π1) = ¯π2, then our loss relative to the jointly optimal policy is bounded by u1(¯π1, ¯π2) −u1(¯π1, πB 2(¯π1)) ≤ πB 2(¯π1) −¯π2  µ1 γ (1−γ)2 . Proof. This follows from Lemma 3 by fixing ¯π1 for the policy pairs πB 2 (¯π1), ¯π2 under µ1. While the previous corollary gave us an upper bound on the loss we incur if we ignore the beliefs of P2, we can bound the loss of the optimal Stackelberg policy in the same way: Corollary 2. The difference between the optimal utility u1(¯π1, ¯π2) and the optimal Stackleberg utility uSt 1 (π∗ 1) is bounded by u1(¯π1, ¯π2) −uSt 1 (π∗ 1) ≤ πB 2(¯π1) −¯π2  µ1 γ (1−γ)2 . Proof. The result follows directly from Corollary 1 and Lemma 2. This bound is not very informative by itself, as it does not suggest an advantage for the optimal Stackelberg policy. Instead, we can use Lemma 3 to lower bound the increase in utility obtained relative to just playing the optimistic policy ¯π1. We start by observing that when P2 responds with some ˆπ2 to ¯π1, P1 could improve upon this by playing ˆπ1 = πB 1 (ˆπ2), the best response of to ˆπ2, if P1 could somehow force P2 to stick to ˆπ2. We can define Δ  u1(ˆπ1, ˆπ2) −u1(¯π1, ˆπ2), (2.6) to be the potential advantage from switching to ˆπ1. Theorem 1 characterizes how close to this advantage P1 can get by playing a stochastic policy πα 1 (a | s)  α¯π1(a | s) + (1 −α)ˆπ1(a | s), while ensuring that P2 sticks to ˆπ2. Theorem 1 (A sufficient condition for an advantage over the naive policy). Let ˆπ2 = πB 2(¯π1) be the response of P2 to the optimistic policy ¯π1 and assume Δ > 0. Then we can obtain an advantage of at least: Δ − γ ¯π1 −ˆπ1µ1 (1 −γ)2 + δ 2 ¯π1 −ˆπ1µ1 ¯π1 −ˆπ1µ2 (2.7) where δ  u2(¯π1, ˆπ2) −maxπ2=ˆπ2 u2(¯π1, π2) is the gap between ˆπ2 and all other deterministic policies of P2 when P1 plays ¯π1. We have shown that knowledge of µ2 allows P1 to obtain improved policies compared to simply assuming µ2 = µ1, and that this improvement depends on both the real and perceived effects of a change in P1’s policy. In the next section we develop an efficient dynamic programming algorithm for finding a good policy for P1. 5 3 Algorithms for the Stackelberg Setting In the Stackelberg setting, we assume that P1 commits to a policy π1, and this policy is observed by P2. Because of this, it is sufficient for P2 to use a Markov policy, and this can be calculated in polynomial time in the number of states and actions. However, there is a polynomial reduction from stochastic games to MVDPs (Lemma 1), and since Letchford et al. [2012] show that computing optimal commitment strategies is NP-hard, then the planning problem for MVDPs is also NP-hard. Another difficulty that occurs is that dominating policies in the MDP sense may not exist in MVDPs. Definition 6 (Dominating policies). A dominating policy π satisfies V π(s) ≥V π(s), ∀s ∈S, where V π(s) = Eπ(u | s0 = s). Dominating policies have the nice property that they are also optimal for any starting distribution σ. However, dominating, stationary Markov polices need not exist in our setting. Theorem 2. A dominating, stationary Markov policy may not exist in a given MVDP. The proof of this theorem is given by a counterexample in Appendix A, where the optimal policy depends on the history of previously visited states. In the trivial case when µ1 = µ2, the problem can be reduced to a Markov decision process, which can be solved in O(S2A) [Mansour and Singh, 1999, Littman et al., 1995]. Generally, however, the commitment by P1 creates new dependencies that render the problem inherently non-Markovian with respect to the state st and thus harder to solve. In particular, even though the dynamics of the environment are Markovian with respect to the state st, the MVDP only becomes Markov in the Stackelberg setting with respect to the hyper-state ηt = (st, πt:T,1) where πt:T,1 is the commitment by P1 for steps t, . . . , T. To see that the game is non-Markovian, we only need to consider a single transition from st to st+1. P2’s action depends not only on the action at,1 of P1, but also on the expected utility the agent will obtain in the future, which in turn depends on πt:T,1. Consequently, state st is not a sufficient statistic for the Stackelberg game. 3.1 Backwards Induction These difficulties aside, we now describe a backwards induction algorithm for approximately solving MVDPs. The algorithm can be seen as a generalization of the backwards induction algorithm for simultaneous-move stochastic games [c.f. Bošansk`y et al., 2016] to the case of disagreement on the transition distribution. In our setting, at stage t of the interaction, P2 has observed the current state st and also knows the commitment of P1 for all future periods. P2 now chooses the action a∗ t,2(π1) ∈arg max at,2 ρ(st) + γ  at,1 π1(at,1 | st)  st+1 µ2(st+1|st, at,1, at,2) · V2,t+1(st+1). (3.1) Thus, for every state, there is a well-defined continuation for P2. Now, P1 needs to choose an action. This can be done easily, since we know P2’s continuation, and so we can define a value for each state-action-action triplet for either agent: Qi,t(st, at,1, at,2) = ρ(s) + γ  st+1 µi(st+1|st, at,1, at,2) · Vi,t+1(st+1). As the agents act simultaneously, the policy of P1 needs to be stochastic. The local optimization problem can be formed as a set of linear programs (LPs), one for each action a2 ∈A2: max π1  a1 π1(a1|s) · Qt,1(s, a1, a2) s.t. ∀ˆa2 :  a1 π1(a1|s) · Qt,2(s, a1, a2) ≥  a1 π(a1) · Qt,2(s, a1, ˆa2), ∀ˆa1 : 0 ≤π1(ˆa1|s) ≤1, and  a1 π1(a1|s) = 1. 6 Each LP results in the best possible policy at time t, such that we force P2 to play a2. From these, we select the best one. At the end, the algorithm, given the transitions (µ1, µ2), and the time horizon T, returns an approximately optimal joint policy, (π∗ 1, π∗ 2) for the MVDP. The complete pseudocode is given in Appendix C, algorithm 1. As this solves a finite horizon problem, the policy is inherently non-stationary. In addition, because there is no guarantee that there is a dominating policy, we may never obtain a stationary policy (see below). However, we can extract a stationary policy from the policies played at individual time steps t, and select the one with the highest expected utility. We can also obtain a version of the algorithm that attains a deterministic policy, by replacing the linear program with a maximization over P1’s actions. Optimality. The policies obtained using this algorithm are subgame perfect, up to the time horizon adopted for backward induction; i.e. the continuation policies are optimal (considering the possibly incorrect transition kernel of P2) off the equilibrium path. As a dominating Markov policy may not exist, the algorithm may not converge to a stationary policy in the infinite horizon discounted setting, similarly to the cyclic equilibria examined by Zinkevich et al. [2005]. This is because the commitment of P1 affects the current action of P2, and so the effective transition matrix for P1. More precisely, the transition actually depends on the future joint policy πn+1:T , because this determines the value Q2,t and so the policy of P2. Thus, the Bellman optimality condition does not hold, as the optimal continuation may depend on previous decisions. 4 Experiments We focus on a natural subclass of multi-view decision processes, which we call intervention games. Therein, a human and an AI have joint control of a system, and the human can override the AI’s actions at a cost. As an example, consider semi-autonomous driving, where the human always has an option to override the AI’s decisions. The cost represents the additional effort of human intervention; if there was no cost, the human may always prefer to assume manual control and ignore the AI. Definition 7 (c-intervention game). A MVDP is a c-intervention game if all of P2’s actions override those of P1, apart from the null action a0 ∈A2, which has no effect. µ1(st+1 | st, at,1, at,2) = µ1(st+1 | st, a t,1, at,2) ∀at,1, a t,1 ∈A, at,2 = a0. (4.1) In addition, the agents subtract a cost c(s) > 0 from the reward rt = ρ(st) whenever P2 takes an action other than a0. Any MDP with action space A and reward function ρ : S →[0, 1] can be converted into a cintervention game, and modeled as an MVDP, with action space A = A1 × A2, where A1 = A, A2 = A1 ∪  a0  , a1 ∈A1, a2 ∈A2, a = (a1, a2) ∈A, rMIN = min s∈S, a 2∈A2 ρ(s) −c(s), (4.2) rMAX = max s∈S, a 2∈A2 ρ(s) (4.3) and reward function3 ρ: S × A →[0, 1], with ρ(s, a) = ρ(s) −c(s) I  a2 = a0 −rMIN rMAX −rMIN . (4.4) The reward function in the MVDP is defined so that it also has the range [0, 1]. Algorithms and scenarios. We consider the main scenario, as well as three variant scenarios, with different assumptions about the AI’s model. For the main scenario, the human has an incorrect model of the world, which the AI knows. For this, we consider three types of AI policies: PURE: The AI only uses deterministic Markov policies. 3Note that although our original definition used a state-only reward function, we are using a state-action reward function. 7 (a) Multilane Highway 0 10 20 30 40 50 human error (factor) -15 -10 -5 0 5 10 15 20 utility opt pure mixed naive human stat (b) Highway: Error 0.0 0.05 0.1 0.15 0.2 cost (safety+intervention) -15 -10 -5 0 5 10 15 20 25 utility opt pure mixed naive human stat (c) Highway: Cost (d) Food and Shelter 0.0 0.1 0.2 0.3 0.4 0.5 human error (skewness) -2 -1 0 1 2 3 4 utility opt pure mixed naive human stat (e) Food and Shelter: Error 0.0 0.1 0.2 0.3 0.4 0.5 cost (intervention) 0.5 1.0 1.5 2.0 2.5 3.0 3.5 utility opt pure mixed naive human stat (f) Food and Shelter: Cost Figure 1: Illustrations and experimental results for the ‘multilane highway’ and ‘food and shelter’ domains. Plots (b,e) show the effect of varying the error in the human’s transition kernel with fixed intervention cost. Plots (c,f) show the effect of varying the intervention cost for a fixed error in the human’s transition kernel. MIXED: The AI may use stochastic Markov policies. STAT: As above, but use the best instantaneous deterministic policy of the first 25 time-steps found in PURE as a stationary Markov policy (running for the same time horizon as PURE). We also have three variant scenarios of AI and human behaviour. OPT: Both the AI and human have the correct model of the world. NAIVE: The AI assumes that the human’s model is correct. HUMAN: Both agents use the incorrect human model to take actions. It is equivalent to the human having full control without any intervention cost. In all of these, the AI uses a MIXED policy. We consider two simulated problem domains in which to evaluate our methods. The first is a multilane highway scenario, where the human and AI have shared control of a car, and the second is a food and shelter domain where they must collect food and maintain a shelter. In all cases, we use a finite time horizon of 100 steps and a discount factor of γ = 0.95. Multilane Highway. In this domain, a car is under joint control of an AI agent and a human, with the human able to override the AI’s actions at any time. There are multiple lanes in a highway, with varying levels of risk and speed (faster lanes are more risky). Within each lane, there is some probability of having an accident. However, the human overestimates this probability, and so wants to travel in a slower lane than is optimal. We denote a starting state by A, a destination state by B, and, for lane i, intermediate states Ci1, ..., CiJ, where J is the number of intermediate states in a lane, and an accident state D. See Figure 1(a) for an illustration of the domain, and for the simulation results. In the plots, the error parameter represents a factor by which the human is wrong in assessing the accident probability (assumed to be small), while the cost parameter determines both the cost of safety (slow driving) of different lanes as well as the cost of human intervening on these lanes. The latter is because our experimental model couples the cost of intervention with the safety cost. The rewards range from −10 to 10. More details are provided in the Appendix (Section B). 8 Food and Shelter Domain. The food and shelter domain [Guo et al., 2013] involves an agent simultaneously trying to find randomly placed food (in one of the top five locations) while maintaining a shelter. With positive probability at each time step, the shelter can collapse if it is not maintained. There is a negative reward for the shelter collapsing and positive reward for finding food (food reappears whenever it is found). In order to exercise the abilities of our modeling, we make the original setting more complex by increasing the size of the grid to 5 × 5 and allowing diagonal moves. For our MVDP setting, we give the AI the correct model but assume the human overestimates the probabilities. Furthermore, the human believes that diagonal movements are more prone to error. See Figure 1(d) for an illustration of the domain, and for the simulation results. In the plots, the error parameter determines how skewed the human’s belief about the error is towards the uniform distribution, while the cost parameter determines the cost of intervention. The rewards range from −1 to 1. More details are provided in the Appendix (Section B). Results. In the simulations, when we change the error parameter, we keep the cost parameter constant (0.15 for the multilane highway domain and 0.1 for the food and shelter domain), and vice versa, when we change the cost, we keep the error constant (25 for the multilane highway domain and 0.25 for the food and shelter domain). Overall, the results show that PURE, MIXED and STAT perform considerably better than NAIVE and HUMAN. Furthermore, for low costs, HUMAN is better than NAIVE. The reason is that in NAIVE the human agent overrides the AI, which is more costly than having the AI perform the same policy (as it happens to be for HUMAN). Therefore, simply assuming that the human has the correct model does not only lead to a larger error than knowing the human’s model, but it can also be worse than simply adopting the human’s erroneous model when making decisions. As the cost of intervention increases, the utilities become closer to the jointly optimal one (OPT scenario), with the exception of the utility for scenario HUMAN. This is not surprising since the intervention cost has an important tempering effect—the human is less likely to take over the control if interventions are costly. When the human error is small, the utility approaches that of the jointly optimal policy. Clearly, the increasing error leads to larger deviations from the the optimal utility. Out of the three algorithms (PURE, MIXED and STAT), MIXED obtains a slightly better performance and shows the additional benefit from allowing for stochastic polices. PURE and STAT have quite similar performance, which indicates that in most of the cases the backwards induction algorithm converges to a stationary policy. 5 Conclusion We have introduced the framework of multi-view decision processes to model value-alignment problems in human-AI collaboration. In this problem, an AI and a human act in the same environment, and share the same reward function, but the human may have an incorrect world model. We analyze the effect of knowledge of the human’s world model on the policy selected by the AI. More precisely, we developed a dynamic programming algorithm, and gave simulation results to demonstrate that an AI with this algorithm can adopt a useful policy in simple environments and even when the human adopts an incorrect model. This is important for modern applications involving the close cooperation between humans and AI such as home robots or automated vehicles, where the human can choose to intervene but may do so erroneously. Although backwards induction is efficient for discrete state and action spaces, it cannot usefully be applied to the continuous case. We would like to develop stochastic gradient algorithms for this case. More generally, we see a number of immediate extensions to MVDP: estimating the human’s world model, studying a setting in which human is learning to respond to the actions of the AI, and moving away from Stackelberg to the case of no commitment. Acknowledgements. The research has received funding from: the People Programme (Marie Curie Actions) of the European Union’s Seventh Framework Programme (FP7/2007-2013) under REA grant agreement 608743, the Swedish national science foundation (VR), the Future of Life Institute, the SEAS TomKat fund, and a SNSF Early Postdoc Mobility fellowship. 9 References Ofra Amir, Ece Kamar, Andrey Kolobov, and Barbara Grosz. Interactive teaching strategies for agent training. In IJCAI 2016, 2016. Branislav Bošanský, Simina Brânzei, Kristoffer Arnsfelt Hansen, Peter Bro Miltersen, and Troels Bjerre Sørensen. Computation of Stackelberg Equilibria of Finite Sequential Games. 2015. Branislav Bošansk`y, Viliam Lis`y, Marc Lanctot, Jiˇrí ˇCermák, and Mark HM Winands. Algorithms for computing strategies in two-player simultaneous move games. Artificial Intelligence, 237:1–40, 2016. Avshalom Elmalech, David Sarne, Avi Rosenfeld, and Eden Shalom Erez. When suboptimal rules. In AAAI, pages 1313–1319, 2015. Eyal Even-Dar and Yishai Mansour. Approximate equivalence of markov decision processes. In Learning Theory and Kernel Machines. COLT/Kernel 2003, Lecture notes in Computer science, pages 581–594, Washington, DC, USA, 2003. Springer. Ya’akov Gal and Avi Pfeffer. Networks of influence diagrams: A formalism for representing agents’ beliefs and decision-making processes. Journal of Artificial Intelligence Research, 33(1):109–147, 2008. Xiaoxiao Guo, Satinder Singh, and Richard L Lewis. Reward mapping for transfer in long-lived agents. In C. J. C. Burges, L. Bottou, M. Welling, Z. Ghahramani, and K. Q. Weinberger, editors, Advances in Neural Information Processing Systems 26, pages 2130–2138. 2013. Dylan Hadfield-Menell, Anca Dragan, Pieter Abbeel, and Stuart Russell. Cooperative inverse reinforcement learning, 2016. Joshua Letchford, Liam MacDermed, Vincent Conitzer, Ronald Parr, and Charles L. Isbell. Computing optimal strategies to commit to in stochastic games. In Proceedings of the Twenty-Sixth AAAI Conference on Artificial Intelligence, AAAI’12, 2012. J. C. R. Licklider. Man-computer symbiosis. RE Transactions on Human Factors in Electronics, 1: 4–11, 1960. Michael L Littman, Thomas L Dean, and Leslie Pack Kaelbling. On the complexity of solving markov decision problems. In Proceedings of the Eleventh conference on Uncertainty in artificial intelligence, pages 394–402. Morgan Kaufmann Publishers Inc., 1995. Yishay Mansour and Satinder Singh. On the complexity of policy iteration. In Proceedings of the Fifteenth conference on Uncertainty in artificial intelligence, pages 401–408. Morgan Kaufmann Publishers Inc., 1999. Andrew Y Ng, Stuart J Russell, et al. Algorithms for inverse reinforcement learning. In ICML, pages 663–670, 2000. Jonathan Sorg, Satinder P Singh, and Richard L Lewis. Internal rewards mitigate agent boundedness. In Proceedings of the 27th international conference on machine learning (ICML-10), pages 1007–1014, 2010. Haoqi Zhang and David C. Parkes. Value-based policy teaching with active indirect elicitation. In Proc. 23rd AAAI Conference on Artificial Intelligence (AAAI’08), page 208–214, Chicago, IL, July 2008. Haoqi Zhang, David C. Parkes, and Yiling Chen. Policy teaching through reward function learning. In 10th ACM Electronic Commerce Conference (EC’09), page 295–304, 2009. Martin Zinkevich, Amy Greenwald, and Michael Littman. Cyclic equilibria in markov games. In Advances in Neural Information Processing Systems, 2005. 10
2017
90
7,232
Maximum Margin Interval Trees Alexandre Drouin Département d’informatique et de génie logiciel Université Laval, Québec, Canada alexandre.drouin.8@ulaval.ca Toby Dylan Hocking McGill Genome Center McGill University, Montréal, Canada toby.hocking@r-project.org François Laviolette Département d’informatique et de génie logiciel Université Laval, Québec, Canada francois.laviolette@ift.ulaval.ca Abstract Learning a regression function using censored or interval-valued output data is an important problem in fields such as genomics and medicine. The goal is to learn a real-valued prediction function, and the training output labels indicate an interval of possible values. Whereas most existing algorithms for this task are linear models, in this paper we investigate learning nonlinear tree models. We propose to learn a tree by minimizing a margin-based discriminative objective function, and we provide a dynamic programming algorithm for computing the optimal solution in log-linear time. We show empirically that this algorithm achieves state-of-the-art speed and prediction accuracy in a benchmark of several data sets. 1 Introduction In the typical supervised regression setting, we are given set of learning examples, each associated with a real-valued output. The goal is to learn a predictor that accurately estimates the outputs, given new examples. This fundamental problem has been extensively studied and has given rise to algorithms such as Support Vector Regression (Basak et al., 2007). A similar, but far less studied, problem is that of interval regression, where each learning example is associated with an interval (yi, yi), indicating a range of acceptable output values, and the expected predictions are real numbers. Interval-valued outputs arise naturally in fields such as computational biology and survival analysis. In the latter setting, one is interested in predicting the time until some adverse event, such as death, occurs. The available information is often limited, giving rise to outputs that are said to be either un-censored (−∞< yi = yi < ∞), left-censored (−∞= yi < yi < ∞), right-censored (−∞< yi < yi = ∞), or interval-censored (−∞< yi < yi < ∞) (Klein and Moeschberger, 2005). For instance, right censored data occurs when all that is known is that an individual is still alive after a period of time. Another recent example is from the field of genomics, where interval regression was used to learn a penalty function for changepoint detection in DNA copy number and ChIP-seq data (Rigaill et al., 2013). Despite the ubiquity of this type of problem, there are surprisingly few existing algorithms that have been designed to learn from such outputs, and most are linear models. Decision tree algorithms have been proposed in the 1980s with the pioneering work of Breiman et al. (1984) and Quinlan (1986). Such algorithms rely on a simple framework, where trees are grown by recursive partitioning of leaves, each time maximizing some task-specific criterion. Advantages of these algorithms include the ability to learn non-linear models from both numerical and categorical data of various scales, and having a relatively low training time complexity. In this work, we extend the work of Breiman et al. (1984) to learning non-linear interval regression tree models. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. 1.1 Contributions and organization Our first contribution is Section 3, in which we propose a new decision tree algorithm for interval regression. We propose to partition leaves using a margin-based hinge loss, which yields a sequence of convex optimization problems. Our second contribution is Section 4, in which we propose a dynamic programming algorithm that computes the optimal solution to all of these problems in log-linear time. In Section 5 we show that our algorithm achieves state-of-the-art prediction accuracy in several real and simulated data sets. In Section 6 we discuss the significance of our contributions and propose possible future research directions. An implementation is available at https://git.io/mmit. 2 Related work The bulk of related work comes from the field of survival analysis. Linear models for censored outputs have been extensively studied under the name accelerated failure time (AFT) models (Wei, 1992). Recently, L1-regularized variants have been proposed to learn from high-dimensional data (Cai et al., 2009; Huang et al., 2005). Nonlinear models for censored data have also been studied, including decision trees (Segal, 1988; Molinaro et al., 2004), Random Forests (Hothorn et al., 2006) and Support Vector Machines (Pölsterl et al., 2016). However, most of these algorithms are limited to the case of right-censored and un-censored data. In contrast, in the interval regression setting, the data are either left, right or interval-censored. To the best of our knowledge, the only existing nonlinear model for this setting is the recently proposed Transformation Tree of Hothorn and Zeileis (2017). Another related method, which shares great similarity with ours, is the L1-regularized linear models of Rigaill et al. (2013). Like our proposed algorithm, their method optimizes a convex loss function with a margin hyperparameter. Nevertheless, one key limitation of their algorithm is that it is limited to modeling linear patterns, whereas our regression tree algorithm is not. 3 Problem 3.1 Learning from interval outputs Let S def= {(x1, y1), ..., (xn, yn)} ∼Dn be a data set of n learning examples, where xi ∈Rp is a feature vector, yi def= (yi, yi), with yi, yi ∈R and yi < yi, are the lower and upper limits of a target interval, and D is an unknown data generating distribution. In the interval regression setting, a predicted value is only considered erroneous if it is outside of the target interval. Formally, let ℓ: R →R be a function and define φℓ(x) def= ℓ[(x)+] as its corresponding hinge loss, where (x)+ is the positive part function, i.e. (x)+ = x if x > 0 and (x)+ = 0 otherwise. In this work, we will consider two possible hinge loss functions: the linear one, where ℓ(x) = x, and the squared one where ℓ(x) = x2. Our goal is to find a function h : Rp →R that minimizes the expected error on data drawn from D: minimize h E (xi,yi)∼Dφℓ(−h(xi) + yi) + φℓ(h(xi) −yi), Notice that, if ℓ(x) = x2, this is a generalization of the mean squared error to interval outputs. Moreover, this can be seen as a surrogate to a zero-one loss that measures if a predicted value lies within the target interval (Rigaill et al., 2013). 3.2 Maximum margin interval trees We will seek an interval regression tree model T : Rp →R that minimizes the total hinge loss on data set S: C(T) def= X (xi,yi)∈S  φℓ −T(xi) + yi + ϵ  + φℓ(T(xi) −yi + ϵ)  , (1) where ϵ ∈R+ 0 is a hyperparameter introduced to improve regularity (see supplementary material for details). 2 Feature value (xij) Interval limits µ0 ϵ ϵ Leaf τ0 Feature value (xij) Interval limits µ1 ϵ ϵ µ2 ϵ ϵ Leaf τ1: xij ≤δ Leaf τ2: xij > δ Upper limit (yi) Lower limit (yi) Threshold (δ) Predicted values (µ0, µ1, µ2) Margin (ϵ) Cost Figure 1: An example partition of leaf τ0 into leaves τ1 and τ2. A decision tree is an arrangement of nodes and leaves. The leaves are responsible for making predictions, whereas the nodes guide the examples to the leaves based on the outcome of some boolean-valued rules (Breiman et al., 1984). Let eT denote the set of leaves in a decision tree T. Each leaf τ ∈eT is associated with a set of examples Sτ ⊆S, for which it is responsible for making predictions. The sets Sτ obey the following properties: S = S τ∈e T Sτ and Sτ ∩Sτ ′ ̸= ∅⇔τ = τ ′. Hence, the contribution of a leaf τ to the total loss of the tree C(T), given that it predicts µ ∈R, is Cτ(µ) def= X (xi,yi)∈Sτ  φℓ(−µ + yi + ϵ) + φℓ(µ −yi + ϵ)  (2) and the optimal predicted value for the leaf is obtained by minimizing this function over all µ ∈R. As in the CART algorithm (Breiman et al., 1984), our tree growing algorithm relies on recursive partitioning of the leaves. That is, at any step of the tree growing algorithm, we obtain a new tree T ′ from T by selecting a leaf τ0 ∈eT and dividing it into two leaves τ1, τ2 ∈f T ′, s.t. Sτ0 = Sτ1 ∪Sτ2 and τ0 ̸∈f T ′. This partitioning results from applying a boolean-valued rule r : Rp →B to each example (xi, yi) ∈Sτ0 and sending it to τ1 if r(xi) = True and to τ2 otherwise. The rules that we consider are threshold functions on the value of a single feature, i.e., r(xi) def= “ xij ≤δ ”. This is illustrated in Figure 1. According to Equation (2), for any such rule, we have that the total hinge loss for the examples that are sent to τ1 and τ2 are Cτ1(µ) = ←− Cτ0(µ|j, δ) def= X (xi,yi)∈Sτ0:xij≤δ  φℓ(−µ + yi + ϵ) + φℓ(µ −yi + ϵ)  (3) Cτ2(µ) = −→ Cτ0(µ|j, δ) def= X (xi,yi)∈Sτ0:xij>δ  φℓ(−µ + yi + ϵ) + φℓ(µ −yi + ϵ)  . (4) The best rule is the one that leads to the smallest total cost C(T ′). This rule, as well as the optimal predicted values for τ1 and τ2, are obtained by solving the following optimization problem: argmin j,δ,µ1,µ2  ←− Cτ0(µ1|j, δ) + −→ Cτ0(µ2|j, δ)  . (5) In the next section we propose a dynamic programming algorithm for this task. 4 Algorithm First note that, for a given j, δ, the optimization separates into two convex minimization sub-problems, which each amount to minimizing a sum of convex loss functions: min j,δ,µ1,µ2 ←− Cτ (µ1|j, δ) + −→ Cτ (µ2|j, δ)  = min j,δ  min µ1 ←− Cτ (µ1|j, δ) + min µ2 −→ Cτ (µ2|j, δ)  . (6) 3 We will show that if there exists an efficient dynamic program Ωwhich, given any set of hinge loss functions defined over µ, computes their sum and returns the minimum value, along with a minimizing value of µ, the minimization problem of Equation (6) can be solved efficiently. Observe that, although there is a continuum of possible values for δ, we can limit the search to the values of feature j that are observed in the data (i.e., δ ∈{xij ; i = 1, ... , n}), since all other values do not lead to different configurations of Sτ1 and Sτ2. Thus, there are at most nj ≤n unique thresholds to consider for each feature. Let these thresholds be δj,1 < ... < δj,nj. Now, consider Φj,k as the set that contains all the losses φℓ(−µ + yi + ϵ) and φℓ(µ −yi + ϵ) for which we have (xi, yi) ∈Sτ0 and xij = δj,k. Since we now only consider a finite number of δ-values, it follows from Equation (3), that one can obtain ←− Cτ (µ1|j, δj,k) from ←− Cτ (µ1|j, δj,k−1) by adding all the losses in Φj,k. Similarly, one can also obtain −→ Cτ (µ1|j, δj,k) from −→ Cτ (µ1|j, δj,k−1) by removing all the losses in Φj,k (see Equation (4)). This, in turn, implies that minµ ←− Cτ (µ|j, δj,k) = Ω(Φj,1∪...∪Φj,k) and minµ −→ Cτ (µ|j, δj,k) = Ω(Φj,k+1 ∪... ∪Φj,nj) . Hence, the cost associated with a split on each threshold δj,k is given by: δj,1 : Ω(Φj,1) + Ω(Φj,2 ∪· · · ∪Φj,nj) . . . . . . . . . δj,i : Ω(Φj,1 ∪· · · ∪Φj,i) + Ω(Φj,i+1 ∪· · · ∪Φj,nj) . . . . . . . . . δj,nj−1 : Ω(Φj,1 ∪· · · ∪Φj,nj−1) + Ω(Φj,nj) (7) and the best threshold is the one with the smallest cost. Note that, in contrast with the other thresholds, δj,nj needs not be considered, since it leads to an empty leaf. Note also that, since Ωis a dynamic program, one can efficiently compute Equation (7) by using Ωtwice, from the top down for the first column and from the bottom up for the second. Below, we propose such an algorithm. 4.1 Definitions A general expression for the hinge losses φℓ(−µ + yi + ϵ) and φℓ(µ −yi + ϵ) is φℓ(si(µ −yi) + ϵ), where si = −1 or 1 respectively. Now, choose any convex function ℓ: R →R and let Pt(µ) def= t X i=1 φℓ(si(µ −yi) + ϵ) (8) be a sum of t hinge loss functions. In this notation, Ω(Φj,1 ∪... ∪Φj,i) = minµ Pt(µ), where t = |Φj,1 ∪... ∪Φj,i|. Observation 1. Each of the t hinge loss functions has a breakpoint at yi −siϵ, where it transitions from a zero function to a non-zero one if si = 1 and the converse if si = −1. For the sake of simplicity, we will now consider the case where these breakpoints are all different; the generalization is straightforward, but would needlessly complexify the presentation (see the supplementary material for details). Now, note that Pt(µ) is a convex piecewise function that can be uniquely represented as: Pt(µ) =              pt,1(µ) if µ ∈(−∞, bt,1] . . . pt,i(µ) if µ ∈(bt,i−1, bt,i] . . . pt,t+1(µ) if µ ∈(bt,t, ∞) (9) where we will call pt,i the ith piece of Pt and bt,i the ith breakpoint of Pt (see Figure 2 for an example). Observe that each piece pt,i is the sum of all the functions that are non-zero on the interval (bt,i−1, bt,i]. It therefore follows from Observation 1 that pt,i(µ) = t X j=1 ℓ[sj(µ −yj) + ϵ] I[(sj = −1 ∧bt,i−1 < yj + ϵ) ∨(sj = 1 ∧yj −ϵ < bt,i)] (10) where I[·] is the (Boolean) indicator function, i.e., I[True] = 1 and 0 otherwise. 4 t = 1 before optimization t = 1 after optimization t = 2 b1,1 = 3 f1,1(µ) = µ −3 P1(µ) p1,1(µ) p1,2(µ) = µ −3 j1 = 2 M1(µ) = p1,1(µ) = 0 J1 = 1 b2,1 = 2 f2,1(µ) = µ −2 b2,2 = 3 f2,2(µ) = µ −3 P2(µ) p2,1(µ) p2,2(µ) M2(µ) = p2,3(µ) j2 = J2 = 2 -1 0 1 1 2 3 4 1 2 3 4 1 2 3 4 Predicted value (µ) Cost Figure 2: First two steps of the dynamic programming algorithm for the data y1 = 4, s1 = 1, y2 = 1, s2 = −1 and margin ϵ = 1, using the linear hinge loss (ℓ(x) = x). Left: The algorithm begins by creating a first breakpoint at b1,1 = y1 −ϵ = 3, with corresponding function f1,1(µ) = µ −3. At this time, we have j1 = 2 and thus b1,j1 = ∞. Note that the cost p1,1 before the first breakpoint is not yet stored by the algorithm. Middle: The optimization step is to move the pointer to the minimum (J1 = j1 −1) and update the cost function, M1(µ) = p1,2(µ) −f1,1(µ). Right: The algorithm adds the second breakpoint at b2,1 = y2 + ϵ = 2 with f2,1(µ) = µ −2. The cost at the pointer is not affected by the new data point, so the pointer does not move. Lemma 1. For any i ∈{1, ..., t}, we have that pt,i+1(µ) = pt,i(µ) + ft,i(µ), where ft,i(µ) = skℓ[sk(µ −yk) + ϵ] for some k ∈{1, ..., t} such that yk −skϵ = bt,i. Proof. The proof relies on Equation (10) and is detailed in the supplementary material. 4.2 Minimizing a sum of hinge losses by dynamic programming Our algorithm works by recursively adding a hinge loss to the total function Pt(µ), each time, keeping track of the minima. To achieve this, we use a pointer Jt, which points to rightmost piece of Pt(µ) that contains a minimum. Since Pt(µ) is a convex function of µ, we know that this minimum is global. In the algorithm, we refer to the segment pt,Jt as Mt and the essence of the dynamic programming update is moving Jt to its correct position after a new hinge loss is added to the sum. At any time step t, let Bt = {(bt,1, ft,1), ..., (bt,t, ft,t) | bt,1 < ... < bt,t} be the current set of breakpoints (bt,i) together with their corresponding difference functions (ft,i). Moreover, assume the convention bt,0 = −∞and bt,t+1 = ∞, which are defined, but not stored in Bt. The initialization (t = 0) is B0 = {}, J0 = 1, M0(µ) = 0 . (11) Now, at any time step t > 0, start by inserting the new breakpoint and difference function. Hence, Bt = Bt−1 ∪{(yt −stϵ, st ℓ[st(µ −yt) + ϵ])} . (12) Recall that, by definition, the set Bt remains sorted after the insertion. Let jt ∈{1, . . . , t + 1}, be the updated value for the previous minimum pointer (Jt−1) after adding the tth hinge loss (i.e., the index of bt−1,Jt−1 in the sorted set of breakpoints at time t). It is obtained by adding 1 if the new breakpoint is before Jt−1 and 0 otherwise. In other words, jt = Jt−1 + I[yt −stϵ < bt−1,Jt−1] . (13) If there is no minimum of Pt(µ) in piece pt,jt, we must move the pointer from jt to its final position Jt ∈{1, ..., t + 1}, where Jt is the index of the rightmost function piece that contains a minimum: Jt = max i∈{1,...,t+1} i, s.t. (bt,i−1, bt,i] ∩{x ∈R | Pt(x) = min µ Pt(µ)} ̸= ∅. (14) See Figure 2 for an example. The minimum after optimization is in piece Mt, which is obtained by adding or subtracting a series of difference functions ft,i. Hence, applying Lemma 1 multiple times, 5 linear square square linear max average 0 1 2 3 4 5 6 7 8 9 10 0 1 100 1000 10000 100 1000 10000 n = number of outputs (finite interval limits) m = pointer moves Pointer moves on changepoint/UCI data sets square linear 0.01 0.10 1.00 10.00 1e+04 1e+05 1e+06 1e+07 number of outputs (finite interval limits) seconds Timings on simulated data sets Figure 3: Empirical evaluation of the expected O(n(m + log n)) time complexity for n data points and m pointer moves per data point. Left: max and average number of pointer moves m over all real and simulated data sets we considered (median line and shaded quartiles over all features, margin parameters, and data sets of a given size). We also observed m = O(1) pointer moves on average for both the linear and squared hinge loss. Right: timings in seconds are consistent with the expected O(n log n) time complexity. we obtain: Mt(µ) def= pt,Jt(µ) = pt,jt(µ) +      0 if jt = Jt PJt−1 i=jt ft,i(µ) if jt < Jt −Pjt−1 i=Jt ft,i(µ) if Jt < jt (15) Then, the optimization problem can be solved using minµ Pt(µ) = minµ∈(bt,Jt−1,bt,Jt] Mt(µ). The proof of this statement is available in the supplementary material, along with a detailed pseudocode and implementation details. 4.3 Complexity analysis The ℓfunctions that we consider are ℓ(x) = x and ℓ(x) = x2. Notice that any such function can be encoded by three coefficients a, b, c ∈R. Therefore, summing two functions amounts to summing their respective coefficients and takes time O(1). The set of breakpoints Bt can be stored using any data structure that allows sorted insertions in logarithmic time (e.g., a binary search tree). Assume that we have n hinge losses. Inserting a new breakpoint at Equation (12) takes O(log n) time. Updating the jt pointer at Equation (13) takes O(1). In contrast, the complexity of finding the new pointer position Jt and updating Mt at Equations (14) and (15) varies depending on the nature of ℓ. For the case where ℓ(x) = x, we are guaranteed that Jt is at distance at most one of jt. This is demonstrated in Theorem 2 of the supplementary material. Since we can sum two functions in O(1) time, we have that the worst case time complexity of the linear hinge loss algorithm is O(n log n). However, for the case where ℓ(x) = x2, the worst case could involve going through the n breakpoints. Hence, the worst case time complexity of the squared hinge loss algorithm is O(n2). Nevertheless, in Section 5.1, we show that, when tested on a variety real-world data sets, the algorithm achieved a time complexity of O(n log n) in this case also. Finally, the space complexity of this algorithm is O(n), since a list of n breakpoints (bt,i) and difference functions (ft,i) must be stored, along with the coefficients (a, b, c ∈R) of Mt. Moreover, it follows from Lemma 1 that the function pieces pt,i need not be stored, since they can be recovered using the bt,i and ft,i. 5 Results 5.1 Empirical evaluation of time complexity We performed two experiments to evaluate the expected O(n(m + log n)) time complexity for n interval limits and m pointer moves per limit. First, we ran our algorithm (MMIT) with both squared 6 Signal feature (x) f(x) = |x| Signal feature (x) f(x) = sin(x) Signal feature (x) f(x) = x/5 MMIT L1-Linear Function f(x) Lower limit Upper limit Figure 4: Predictions of MMIT (linear hinge loss) and the L1-regularized linear model of Rigaill et al. (2013) (L1-Linear) for simulated data sets. and linear hinge loss solvers on a variety of real-world data sets of varying sizes (Rigaill et al., 2013; Lichman, 2013), and recorded the number of pointer moves. We plot the average and max pointer moves over a wide range of margin parameters, and all possible feature orderings (Figure 3, left). In agreement with our theoretical result (supplementary material, Theorem 2), we observed a maximum of one move per interval limit for the linear hinge loss. On average we observed that the number of moves does not increase with data set size, even for the squared hinge loss. These results suggest that the number of pointer moves per limit is generally constant m = O(1), so we expect an overall time complexity of O(n log n) in practice, even for the squared hinge loss. Second, we used the limits of the target intervals in the neuroblastoma changepoint data set (see Section 5.3) to simulate data sets from n = 103 to n = 107 limits. We recorded the time required to run the solvers (Figure 3, right), and observed timings which are consistent with the expected O(n log n) complexity. 5.2 MMIT recovers a good approximation in simulations with nonlinear patterns We demonstrate one key limitation of the margin-based interval regression algorithm of Rigaill et al. (2013) (L1-Linear): it is limited to modeling linear patterns. To achieve this, we created three simulated data sets, each containing 200 examples and 20 features. Each data set was generated in such a way that the target intervals followed a specific pattern f : R →R according to a single feature, which we call the signal feature. The width of the intervals and a small random shift around the true value of f were determined randomly. The details of the data generation protocol are available in the supplementary material. MMIT (linear hinge loss) and L1-Linear were trained on each data set, using cross-validation to choose the hyperparameter values. The resulting data sets and the predictions of each algorithm are illustrated in Figure 4. As expected, L1-Linear fails to fit the non-linear patterns, but achieves a near perfect fit for the linear pattern. In contrast, MMIT learns stepwise approximations of the true functions, which results from each leaf predicting a constant value. Notice the fluctuations in the models of both algorithms, which result from using irrelevant features. 5.3 Empirical evaluation of prediction accuracy In this section, we compare the accuracy of predictions made by MMIT and other learning algorithms on real and simulated data sets. Evaluation protocol To evaluate the accuracy of the algorithms, we performed 5-fold crossvalidation and computed the mean squared error (MSE) with respect to the intervals in each of the five testing sets (Figure 5). For a data set S = {(xi, yi)}n i=1 with xi ∈Rp and yi ∈R 2, and for a model h : Rp →R, the MSE is given by MSE(h, S) = 1 n n X i=1 [h(xi) −yi] I[h(xi) < yi] + [h(xi) −yi] I[h(xi) > yi] 2 . (16) 7 changepoint neuroblastoma n=3418 p=117 0%finite 16%up changepoint histone n=935 p=26 47%finite 32%up UCI triazines n=186 p=60 93%finite 50%up UCI servo n=167 p=19 92%finite 50%up simulated linear n=200 p=20 80%finite 49%up simulated sin n=200 p=20 85%finite 49%up simulated abs n=200 p=20 77%finite 49%up G G G GG G G G G G G G G G G GGGGG G G G G G G GG GG G G GG G GGG G G G G G G G GG G G G G G GG G GGG G G G G G G G GG G G G G G G G G GG GG G G G G G G GG G G G G G GGG G G GGG G G GG G GG GG G G G G G G G G GG G G G GG G G G G G G G G GG G G GGG G G GG G G GGGG G GG GGG GG GGG G G G G G GG GGG G GG G G G G G G G G G GGG G G GGG GG G G G G G GGG G G GG G G G G G G Constant L1−Linear TransfoTree Interval−CART MMIT−L MMIT−S −2.5 −2.0 −1.5 −0.6−0.4−0.2 0.0 −3.0 −2.5 −2.0 −4 −3 −2 −4 −3 −2 −1 −3 −2 −1 −2 −1 0 log10(mean squared test error) in 5−fold CV, one point per fold Figure 5: MMIT testing set mean squared error is comparable to, or better than, other interval regression algorithms in seven real and simulated data sets. Five-fold cross-validation was used to compute 5 test error values (points) for each model in each of the data sets (panel titles indicate data set source, name, number of observations=n, number of features=p, proportion of intervals with finite limits and proportion of all interval limits that are upper limits). At each step of the cross-validation, another cross-validation (nested within the former) was used to select the hyperparameters of each algorithm based on the training data. The hyperparameters selected for MMIT are available in the supplementary material. Algorithms The linear and squared hinge loss variants of Maximum Margin Interval Trees (MMITL and MMIT-S) were compared to two state-of-the-art interval regression algorithms: the marginbased L1-regularized linear model of Rigaill et al. (2013) (L1-Linear) and the Transformation Trees of Hothorn and Zeileis (2017) (TransfoTree). Moreover, two baseline methods were included in the comparison. To provide an upper bound for prediction error, we computed the trivial model that ignores all features and just learns a constant function h(x) = µ that minimizes the MSE on the training data (Constant). To demonstrate the importance of using a loss function designed for interval regression, we also considered the CART algorithm (Breiman et al., 1984). Specifically, CART was used to fit a regular regression tree on a transformed training set, where each interval regression example (x, [y, y]) was replaced by two real-valued regression examples with features x and labels y + ϵ and y −ϵ. This algorithm, which we call Interval-CART, uses a margin hyperparameter and minimizes a squared loss with respect to the interval limits. However, in contrast with MMIT, it does not take the structure of the interval regression problem into account, i.e., it ignores the fact that no cost should be incurred for values predicted inside the target intervals. Results in changepoint data sets The problem in the first two data sets is to learn a penalty function for changepoint detection in DNA copy number and ChIP-seq data (Hocking et al., 2013; Rigaill et al., 2013), two significant interval regression problems from the field of genomics. For the neuroblastoma data set, all methods, except the constant model, perform comparably. Interval-CART achieves the lowest error for one fold, but L1-Linear is the overall best performing method. For the histone data set, the margin-based models clearly outperform the non-margin-based models: Constant and TransfoTree. MMIT-S achieves the lowest error on one of the folds. Moreover, MMIT-S tends to outperform MMIT-L, suggesting that a squared loss is better suited for this task. Interestingly, MMIT-S outperforms Interval-CART, which also uses a squared loss, supporting the importance of using a loss function adapted to the interval regression problem. Results in UCI data sets The next two data sets are regression problems taken from the UCI repository (Lichman, 2013). For the sake of our comparison, the real-valued outputs in these data sets were transformed into censored intervals, using a protocol that we detail in the supplementary material. For the difficult triazines data set, all methods struggle to surpass the Constant model. Neverthess, some achieve lower errors for one fold. For the servo data set, the margin-based tree models: MMIT-S, MMIT-L, and Interval-CART perform comparably and outperform the other models. This highlights the importance of developping non-linear models for interval regression and suggests a positive effect of the margin hyperparameter on accuracy. 8 Results in simulated data sets The last three data sets are the simulated data sets discussed in the previous section. As expected, the L1-linear model tends outperforms the others on the linear data set. However, surprisingly, on a few folds, the MMIT-L and Interval-CART models were able to achieve low test errors. For the non-linear data sets (sin and abs), MMIT-S, MMIT-L and Interval-Cart clearly outperform the TransfoTree, L1-linear and Constant models. Observe that the TransfoTree algorithm achieves results comparable to those of L1-linear which, in Section 5.2, has been shown to learn a roughly constant model in these situations. Hence, although these data sets are simulated, they highlight situations where this non-linear interval regression algorithm fails to yield accurate models, but where MMITs do not. Results for more data sets are available in the supplementary material. 6 Discussion and conclusions We proposed a new margin-based decision tree algorithm for the interval regression problem. We showed that it could be trained by solving a sequence of convex sub-problems, for which we proposed a new dynamic programming algorithm. We showed empirically that the latter’s time complexity is log-linear in the number of intervals in the data set. Hence, like classical regression trees (Breiman et al., 1984), our tree growing algorithm’s time complexity is linear in the number of features and log-linear in the number of examples. Moreover, we studied the prediction accuracy in several real and simulated data sets, showing that our algorithm is competitive with other linear and nonlinear models for interval regression. This initial work on Maximum Margin Interval Trees opens a variety of research directions, which we will explore in future work. We will investigate learning ensembles of MMITs, such as random forests. We also plan to extend the method to learning trees with non-constant leaves. This will increase the smoothness of the models, which, as observed in Figure 4, tend to have a stepwise nature. Moreover, we plan to study the average time complexity of the dynamic programming algorithm. Assuming a certain regularity in the data generating distribution, we should be able to bound the number of pointer moves and justify the time complexity that we observed empirically. In addition, we will study the conditions in which the proposed MMIT algorithm is expected to surpass methods that do not exploit the structure of the target intervals, such as the proposed Interval-CART method. Intuitively, one weakness of Interval-CART is that it does not properly model left and right-censored intervals, for which it favors predictions that are near the finite limits. Finally, we plan to extend the dynamic programming algorithm to data with un-censored outputs. This will make Maximum Margin Interval Trees applicable to survival analysis problems, where they should rank among the state of the art. Reproducibility • Implementation: https://git.io/mmit • Experimental code: https://git.io/mmit-paper • Data: https://git.io/mmit-data The versions of the software used in this work are also provided in the supplementary material. Acknowledgements We are grateful to Ulysse Côté-Allard, Mathieu Blanchette, Pascal Germain, Sébastien Giguère, Gaël Letarte, Mario Marchand, and Pier-Luc Plante for their insightful comments and suggestions. This work was supported by the National Sciences and Engineering Research Council of Canada, through an Alexander Graham Bell Canada Graduate Scholarship Doctoral Award awarded to AD and a Discovery Grant awarded to FL (#262067). 9 References Basak, D., Pal, S., and Patranabis, D. C. (2007). Support vector regression. Neural Information Processing-Letters and Reviews, 11(10), 203–224. Breiman, L., Friedman, J., Stone, C. J., and Olshen, R. A. (1984). Classification and regression trees. CRC press. Cai, T., Huang, J., and Tian, L. (2009). Regularized estimation for the accelerated failure time model. Biometrics, 65, 394–404. Hocking, T. D., Schleiermacher, G., Janoueix-Lerosey, I., Boeva, V., Cappo, J., Delattre, O., Bach, F., and Vert, J.-P. (2013). Learning smoothing models of copy number profiles using breakpoint annotations. BMC Bioinformatics, 14(1), 164. Hothorn, T. and Zeileis, A. (2017). Transformation Forests. arXiv:1701.02110. Hothorn, T., Bühlmann, P., Dudoit, S., Molinaro, A., and Van Der Laan, M. J. (2006). Survival ensembles. Biostatistics, 7(3), 355–373. Huang, J., Ma, S., and Xie, H. (2005). Regularized estimation in the accelerated failure time model with high dimensional covariates. Technical Report 349, University of Iowa Department of Statistics and Actuarial Science. Klein, J. P. and Moeschberger, M. L. (2005). Survival analysis: techniques for censored and truncated data. Springer Science & Business Media. Lichman, M. (2013). UCI machine learning repository. Molinaro, A. M., Dudoit, S., and van der Laan, M. J. (2004). Tree-based multivariate regression and density estimation with right-censored data. Journal of Multivariate Analysis, 90, 154–177. Pölsterl, S., Navab, N., and Katouzian, A. (2016). An Efficient Training Algorithm for Kernel Survival Support Vector Machines. arXiv:1611.07054. Quinlan, J. R. (1986). Induction of decision trees. Machine learning, 1(1), 81–106. Rigaill, G., Hocking, T., Vert, J.-P., and Bach, F. (2013). Learning sparse penalties for change-point detection using max margin interval regression. In Proc. 30th ICML, pages 172–180. Segal, M. R. (1988). Regression trees for censored data. Biometrics, pages 35–47. Wei, L. (1992). The accelerated failure time model: a useful alternative to the cox regression model in survival analysis. Stat Med, 11(14–15), 1871–9. 10
2017
91
7,233
Online Learning with a Hint Ofer Dekel Microsoft Research oferd@microsoft.com Arthur Flajolet Operations Research Center Massachusetts Institute of Technology flajolet@mit.edu Nika Haghtalab Computer Science Department Carnegie Mellon University nika@cmu.edu Patrick Jaillet EECS, LIDS, ORC Massachusetts Institute of Technology jaillet@mit.edu Abstract We study a variant of online linear optimization where the player receives a hint about the loss function at the beginning of each round. The hint is given in the form of a vector that is weakly correlated with the loss vector on that round. We show that the player can benefit from such a hint if the set of feasible actions is sufficiently round. Specifically, if the set is strongly convex, the hint can be used to guarantee a regret of O(log(T)), and if the set is q-uniformly convex for q ∈(2, 3), the hint can be used to guarantee a regret of o( √ T). In contrast, we establish Ω( √ T) lower bounds on regret when the set of feasible actions is a polyhedron. 1 Introduction Online linear optimization is a canonical problem in online learning. In this setting, a player attempts to minimize an online adversarial sequence of loss functions while incurring a small regret, compared to the best offline solution. Many online algorithms exist that are designed to have a regret of O( √ T) in the worst case and it has been known that one cannot avoid a regret of Ω( √ T) in the worst case. While this worst-case perspective on online linear optimization has lead to elegant algorithms and deep connections to other fields, such as boosting [9, 10] and game theory [4, 2], it can be overly pessimistic. In particular, it does not account for the fact that the player may have side-information that allows him to anticipate the upcoming loss functions and evade the Ω( √ T) regret. In this work, we go beyond this worst case analysis and consider online linear optimization when additional information in the form of a function that is correlated with the loss is presented to the player. More formally, online convex optimization [24, 11] is a T-round repeated game between a player and an adversary. On each round, the player chooses an action xt from a convex set of feasible actions K ⊆Rd and the adversary chooses a convex bounded loss function ft. Both choices are revealed and the player incurs a loss of ft(xt). The player then uses its knowledge of ft to adjust its strategy for the subsequent rounds. The player’s goal is to accumulate a small loss compared to the best fixed action in hindsight. This value is called regret and is a measure of success of the player’s algorithm. When the adversary is restricted to Lipschitz loss functions, several algorithms are known to guarantee O( √ T) regret [24, 16, 11]. If we further restrict the adversary to strongly convex loss functions, the regret bound improves to O(log(T)) [14]. However, when the loss functions are linear, no online algorithm can have a regret of o( √ T) [5]. In this sense, linear loss functions are the most difficult convex loss functions to handle [24]. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. In this paper, we focus on the case where the adversary is restricted to linear Lipschitz loss functions. More specifically, we assume that the loss function ft(x) takes the form cT tx, where ct is a bounded loss vector in C ⊆Rd. We further assume that the player receives a hint before choosing the action on each round. The hint in our setting is a vector that is guaranteed to be weakly correlated with the loss vector. Namely, at the beginning of round t, the player observes a unit-length vector vt ∈Rd such that vT tct ≥α∥ct∥2, and where α is a small positive constant. So long as this requirement is met, the hint could be chosen maliciously, possibly by an adversary who knows how the player’s algorithm uses the hint. Our goal is to develop a player strategy that takes these hints into account, and to understand when hints of this type make the problem provably easier and lead to smaller regret. We show that the player’s ability to benefit from the hints depends on the geometry of the player’s action set K. Specifically, we characterize the roundness of the set K using the notion of (C, q)uniform convexity for convex sets. In Section 3, we show that if K is a (C, 2)-uniformly convex set (or in other words, if K is a C-strongly convex set), then we can use the hint to design a player strategy that improves the regret guarantee to O (Cα)−1 log(T)  , where our O(·) notation hides a polynomial dependence on the dimension d and other constants. Furthermore, as we show in Section 4, if K is a (C, q)-uniformly convex set for q ∈(2, 3), we can use the hint to improve the regret to O  (Cα) 1 1−q T 2−q 1−q  , when the hint belongs to a small set of possible hints at every step. In Section 5, we prove lower bounds on the regret of any online algorithm in this model. We first show that when K is a polyhedron, such as a L1 ball, even a stronger form of hint cannot guarantee a regret of o( √ T). Next, we prove a lower bound of Ω(log(T)) regret when K is strongly convex. 1.1 Comparison with Other Notions of Hints The notion of hint that we introduce in this work generalizes some of the notions of predictability on online learning. Hazan and Megiddo [13] considered as an example a setting where the player knows the first coordinate of the loss vector at all rounds, and showed that when |ct1| ≥α and when the set of feasible actions is the Euclidean ball, one can achieve a regret of O(1/α · log(T)). Our work directly improves over this result, as in our setting a hint vt = ±e1 also achieves O(1/α · log(T)) regret, but we can deal with hints in different directions at different rounds and we allow for general uniformly convex action sets. Rakhlin and Sridharan [20] considered online learning with predictable sequences, with a notion of predictability that is concerned with the gradient of the convex loss functions. They show that if the player receives a hint Mt at round t, then the regret of the algorithm is at most O( qPT t=1 ∥∇ft(xt) −Mt∥2∗). x y x v c ˆc(x) −v −c w ˆy ˆx z=x+y 2 ˆc(z) ˆc(x)+ˆc(y) 2 c c0 ↵ v Figure 1: Comparison between notions of hint. In the case of linear loss functions, this implies that having an estimate vector c′ t of the loss vector within distance σ of the true loss vector ct results in an improved regret bound of O(σ √ T). In contrast, we consider a notion of hint that pertains to the direction of the loss vector rather than its location. Our work shows that merely knowing whether the loss vector positively or negatively correlates with another vector is sufficient to achieve improved regret bound, when the set is uniformly convex. That is, rather than having access to an approximate value of ct, we only need to have access to a halfspace that classifies ct correctly with a margin. This notion of hint is weaker that the notion of hint in the work of Rakhlin and Sridharan [20] when the approximation error satisfies ∥ct −c′ t∥2 ≤σ · ∥ct∥2 for σ ∈[0, 1). In this case one can use c′ t/ ∥c′ t∥2 as the direction of the hint in our setting and achieve a regret of O( 1 1−σ log T) when the set is strongly convex. This shows that when the set of feasible actions is strongly convex, a directional hint can improve the regret bound beyond what has been known to be achievable by an approximation hint. However, we note that our results require the hints to be always valid, whereas the algorithm of Rakhlin and Sridharan [19] can adapt to the quality of the hints. We discuss these works and other related works, such as [15], in more details in Appendix A. 2 Preliminaries We begin with a more formal definition of online linear optimization (without hints). Let A denote the player’s algorithm for choosing its actions. On round t the player uses A and all of the information 2 it has observed so far to choose an action xt in a convex compact set K ⊆Rd. Subsequently, the adversary chooses a loss vector ct in a compact set C ⊆Rd. The player and the adversary reveal their actions and the player incurs the loss cT txt. The player’s regret is defined as R(A, c1:T ) = T X t=1 c T txt −min x∈K T X t=1 c T tx. In online linear optimization with hints, the player observes vt ∈Rd with ∥vt∥2 = 1, before choosing xt, with the guarantee that vT tct ≥α∥ct∥2, for some α > 0. We use uniform convexity to characterize the degree of convexity of the player’s action set K. Informally, uniform convexity requires that the convex combination of any two points x and y on the boundary of K be sufficiently far from the boundary. A formal definition is given below. Definition 2.1 (Pisier [18]). Let K be a convex set that is symmetric around the origin. K and the Banach space defined by K are said to be uniformly convex if for any 0 < ϵ < 2 there exists a δ > 0 such that for any pair of points x, y ∈K with ∥x∥K ≤1, ∥y∥K ≤1, ∥x −y∥K ≥ϵ, we have x+y 2 K ≤1 −δ. The modulus of uniform-convexity δK(ϵ) is the best possible δ for that ϵ, i.e., δK(ϵ) = inf  1 − x + y 2 K : ∥x∥K ≤1, ∥y∥K ≤1, ∥x −y∥K ≥ϵ  . For brevity, we say that K is (C, q)-uniformly convex when δK(ϵ) = Cϵq and we omit C when it is clear from the context. Examples of uniformly convex sets include Lp balls for any 1 < p < ∞with modulus of convexity δLp(ϵ) = Cpϵp for p ≥2 and a constant Cp and δLp(ϵ) = (p −1)ϵ2 for 1 < p ≤2. On the other hand, L1 and L∞units balls are not uniformly convex. When δK(ϵ) ∈Θ(ϵ2), we say that K is strongly convex. Another notion of convexity we use in this work is called exp-concavity. A function f : K →R is exp-concave with parameter β > 0, if exp(−βf(x)) is a concave function of x ∈K. This is a weaker requirement than strong convexity when the gradient of f is uniformly bounded [14]. The next proposition shows that we can obtain regret bounds of order Θ(log(T)) in online convex optimization when the loss functions are exp-concave with parameter β. Proposition 2.2 ([14]). Consider online convex optimization on a sequence of loss functions f1, . . . , fT over a feasible set K ⊆Rd, such that all t, ft : K →R is exp-concave with parameter β > 0. There is an algorithm, with runtime polynomial in d, which we call AEXP, with a regret that is at most d β (1 + log(T + 1)). Throughout this work, we draw intuition from basic orthogonal geometry. Given any vector x and a hint v, we define x v = (xTv)v and x T v = x−(xTv)v, as the parallel and the orthogonal components of x with respect to v. When the hint v is clear from the context we simply use x and x T to denote these vectors. Naturally, our regret bounds involve a number of geometric parameters. Since the set of actions of the adversary C is compact, we can find G ≥0 such that ∥c∥2 ≤G for all c ∈C. When K is uniformly convex, we denote K = {w ∈Rd | ∥w∥K ≤1}. In this case, since all norms are equivalent in finite dimension, there exist R > 0 and r > 0 such that Br ⊆K ⊆BR, where Br (resp. BR) denote the L2 unit ball centered at 0 with radius r (resp. R). This implies that 1 R ∥·∥2 ≤∥·∥K ≤1 r ∥·∥2. 3 Improved Regret Bounds for Strongly Convex K At first sight, it is not immediately clear how one should use the hint. Since vt is guaranteed to satisfy cT tvt ≥α∥ct∥2, moving the action x in the direction −vt always decreases the loss. One could hope to get the most benefit out of the hint by choosing xt to be the extremal point in K in the direction −vt. However, this naïve strategy could lead to a linear regret in the worst case. For example, say that ct = (1, 1 2) and vt = (0, 1) for all t and let K be the Euclidean unit ball. Choosing xt = −vt would incur a loss of −T 2 , while the best fixed action in hindsight, the point ( −2 √ 5, −1 √ 5), would incur a loss of − √ 5 2 T. The player’s regret would therefore be √ 5−1 2 T. 3 Intuitively, the flaw of this naïve strategy is that the hint does not give the player any information about the (d −1)-dimensional subspace orthogonal to vt. Our solution is to use standard online learning machinery to learn how to act in this orthogonal subspace. Specifically, on round t, we use vt to define the following virtual loss function: ˆct(x) = min w∈K c T tw s.t. w T vt = x T vt . x y z x v c ˆc(x) −v −c (ˆz) )) z0 Figure 2: Virtual function ˆc(·). In words, we consider the 1-dimensional subspace spanned by vt and its (d −1)-dimensional orthogonal subspace separately. For any action x ∈K, we find another point, w ∈K, that equals x in the (d −1)-dimensional orthogonal subspace, but otherwise incurs the optimal loss. The value of the virtual loss ˆct(x) is defined to be the value of the original loss function ct at w. The virtual loss simulates the process of moving x as far as possible in the direction −vt without changing its value in any other direction (see Figure 2). This can be more formally seen by the following equation. arg min w∈K:w T =ˆx T c T tw = arg min w∈K:w T =ˆx T (c T t ) Tˆx T + (ct ) Tw  = arg min w∈K:w T =ˆx T v T tw, (1) where the last transition holds by the fact that ct = ct 2 vt since the hint is valid. x y x v c −v −c w ˆy ˆx z=x+y 2 ˆc(z) ˆc(x)+ˆc(y) 2 Figure 3: Uniform-convexity of the feasible set affects the convexity the virtual loss function. This provides an intuitive understanding of a measure of convexity of our virtual loss functions. When K is uniformly convex then the function ˆct(·) demonstrates convexity in the subspace orthogonal to vt. To see that, note that for any x and y that lie in the space orthogonal to vt, their mid point x+y 2 transforms to a point that is farther away in the direction of −vt than the midpoint of the transformations of x and y. As shown in Figure 3, the modulus of uniform convexity of K affects the degree of convexity of ˆct(·). We note, however, that ˆct(·) is not strongly convex in all directions. In fact, ˆct(·) is constant in the direction of vt. Nevertheless, the properties shown here allude to the fact that ˆct(·) demonstrates some notion of convexity. As we show in the next lemma, this notion is indeed exp-concavity: Lemma 3.1. If K is (C, 2)-uniformly convex, then ˆct(·) is 8 α·C·r G·R2 -exp-concave. Proof. Let γ = 8 α·C·r G·R2 . Without loss of generality, we assume that ct ̸= 0, otherwise ˆct(·) = 0 is a constant function and the proof follows immediately. Based on the above discussion, it is not hard to see that ˆct(·) is continuous (we prove this in more detail in the Appendix D.1. So, to prove that ˆct(·) is exp-concave, it is sufficient to show that exp  −γ · ˆct x + y 2  ≥1 2 exp (−γ · ˆct(x)) + 1 2 exp (−γ · ˆct(y)) ∀(x, y) ∈K. Consider (x, y) ∈K and choose corresponding (ˆx, ˆy) ∈K such that ˆct(x) = cT t ˆx and ˆct(y) = cT t ˆy. Without loss of generality, we have ∥ˆx∥K = ∥ˆy∥K = 1, as we can always choose corresponding ˆx, ˆy that are extreme points of K. Since exp(−γˆct(·)) is decreasing in ˆct(·), we have exp  −γ · ˆct x + y 2  = max ∥w∥K≤1 w T vt=( x+y 2 ) T vt exp(−γ · c T tw). (2) Note that w = ˆx+ˆy 2 −δK(∥ˆx −ˆy∥K) vt ∥vt∥K satisfies ∥w∥K ≤1, since ∥w∥K ≤ ˆx+ˆy 2 K + δK(∥ˆx −ˆy∥K) ≤1 (see also Figure 3). Moreover, w T vt = ( x+y 2 ) T vt. So, by using this w in Equation (2), we have exp  −γ · ˆct x + y 2  ≥exp  −γ 2 · (c T t ˆx + c T t ˆy) + γ · cT tvt ∥vt∥K · δK(∥ˆx −ˆy∥K)  . (3) 4 On the other hand, since ∥vt∥K ≤1 r∥vt∥2 = 1 r and ∥ˆx −ˆy∥K ≥1 R∥ˆx −ˆy∥2, we have exp  γ · cT tvt ∥vt∥K · δK(∥ˆx −ˆy∥K)  ≥exp  γ · r · α · ∥ct∥2 · C · 1 R2 · ∥ˆx −ˆy∥2 2  ≥exp γ · α · C · r R2 · ∥ct∥2 ·  cT t ˆx ∥ct∥2 −cT t ˆy ∥ct∥2 2! ≥exp (γ/2)2 · (cT t ˆx −cT t ˆy)2 2  ≥1 2 · exp γ 2 · (c T t ˆx −c T t ˆy)  + 1 2 · exp γ 2 · (c T t ˆy −c T t ˆx)  , where the penultimate inequality follows by the definition of γ and the last inequality is a consequence of the inequality exp(z2/2) ≥1 2 exp(z) + 1 2 exp(−z), ∀z ∈R. Plugging the last inequality into (3) yields exp  −γˆct(x+y 2 )  ≥1 2 exp  −γ 2 (c T t ˆx + c T t ˆy)  · n exp γ 2 (c T t ˆx −c T t ˆy)  + exp γ 2 (c T t ˆy −c T t ˆx) o = 1 2 exp (−γ · c T t ˆy) + 1 2 exp (−γ · c T t ˆx) = 1 2 exp (−γ · ˆct(y)) + 1 2 exp (−γ · ˆct(x)) , which concludes the proof. Now, we use the sequence of virtual loss functions to reduce our problem to a standard online convex optimization problem (without hints). Namely, the player applies AEXP (from Proposition 2.2), which is an online convex optimization algorithm known to have O(log(T)) regret with respect to exp-concave functions, to the sequence of virtual loss functions. Then our algorithm takes the action ˆxt ∈K that is prescribed by AEXP and moves it as far as possible in the direction of −vt. This process is formalized in Algorithm 1. Algorithm 1 Ahint FOR STRONGLY CONVEX K For t = 1, . . . , T, 1. Use Algorithm AEXP with the history ˆcτ(·) for τ < t, and let ˆxt be the chosen action. 2. Let xt = arg minw∈K(vT tw) s.t. w T vt = ˆx T vt t . Play xt and receive ct as feedback. Next, we show that the regret of algorithm AEXP on the sequence of virtual loss functions is an upper bound on the regret of Algorithm 1. Lemma 3.2. For any sequence of loss functions c1, . . . , cT , let R(Ahint, c1:T ) be the regret of algorithm Ahint on the sequence c1, . . . , cT , and R(AEXP, ˆc1:T ) be the regret of algorithm AEXP on the sequence of virtual loss functions ˆc1, . . . , ˆcT . Then, R(Ahint, c1:T ) ≤R(AEXP, ˆc1:T ). Proof. Equation (1) provides an equivalent definition xt = arg minw∈K(cT tw) s.t. w T vt = ˆx T vt t . Using this, we show that the loss of algorithm Ahint on the sequence c1:T is the same as the loss of algorithm AEXP on the sequence ˆc1:T . T X t=1 ˆct(ˆxt) = T X t=1 min w∈K:w T =ˆx T t c T tw = T X t=1 c T t( arg min w∈K:w T =ˆx T t c T tw) = T X t=1 c T txt. Next, we show that the offline optimal on the sequence ˆc1:T is more competitive that the offline optimal on the sequence c1:T . First note that for any x and t, ˆct(x) = minw∈K:w T =x T cT tw ≤cT tx. Therefore, minx∈K PT t=1 ˆct(x) ≤minx∈K PT t=1 cT tx. The proof concludes by R(Ahint, c1:T ) = T X t=1 c T txt −min x∈K T X t=1 c T tx ≤ T X t=1 ˆct(ˆxt) −min x∈K T X t=1 ˆct(x) = R(AEXP, ˆc1:T ). 5 Our main result follows from the application of Lemmas 3.1 and 3.2. Theorem 3.3. Suppose that K ⊆Rd is a (C, 2)-uniformly convex set that is symmetric around the origin, and Br ⊆K ⊆BR for some r and R. Consider online linear optimization with hints where the cost function at round t is ∥ct∥2 ≤G and the hint vt is such that cT tvt ≥α∥ct∥2, while ∥vt∥2 = 1. Algorithm 1 in combination with AEXP has a worst-case regret of R(Ahint, c1:T ) ≤d · G · R2 8α · C · r · (1 + log(T + 1)). Since AEXP requires the coefficient of exp-concavity to be given as an input, α needs to be known a priori to be able to use Algorithm 1. However, we can use a standard doubling trick to relax this requirement and derive the same asymptotic regret bound. We defer the presentation of this argument to Appendix B. 4 Improved Regret Bounds for (C, q)-Uniformly Convex K In this section, we consider any feasible set K that is (C, q)-uniformly convex for q ≥2. Our results differ from the previous section in two aspects. First, our algorithm can be used with (C, q)-uniformly convex feasible sets for any q ≥2 compared to the results of the previous section that only hold for strongly convex sets (q = 2). On the other hand, the approach in this section requires the hints to be restricted to a finite set of vectors V. We show that when K is (C, q)-uniformly convex for q > 2, our regret is O(T 2−q 1−q ). If q ∈(2, 3), this is an improvement over the worst case regret of O( √ T) guaranteed in the absence of hints. We first consider the scenario where the hint is always pointing in the same direction, i.e. vt = v for some v and all t ∈[T]. In this case, we show how one can use a simple algorithm that picks the best performing action so far (a.k.a the Follow-The-Leader algorithm) to obtain improved regret bounds. We then consider the case where the hint belongs to a finite set V. In this case, we instantiate one copy of the Follow-The-Leader algorithm for each v ∈V and combine their outcomes in order to obtain improved regret bounds that depend on the cardinality of V, which we denote by |V|. Lemma 4.1. Suppose that vt = v for all t = 1, · · · , T and that K is (C, q)-uniformly convex that is symmetric around the origin, and Br ⊆K ⊆BR for some r and R. Consider the algorithm, called Follow-The-Leader (FTL), that at every round t, plays xt ∈arg minx∈K P τ<t cT τx. If Pt τ=1 cT τv ≥0 for all t = 1, · · · , T, then the regret is bounded as follows, R(AFTL, c1:T ) ≤ ∥v∥K · Rq 2C 1/(q−1) · T X t=1 ∥ct∥q 2 Pt τ=1 cTτv !1/(q−1) . Furthermore, when v is a valid hint with margin α, i.e., cT tv ≥α · ∥ct∥2 for all t = 1, · · · , T, the right-hand side can be further simplified to obtain the regret bound: R(AFTL, c1:T ) ≤1 2γ · G · (ln(T) + 1) if q = 2 and R(AFTL, c1:T ) ≤ 1 (2γ)1/(q−1) · G · q −1 q −2 · T q−2 q−1 if q > 2, where γ = C·α ∥v∥K·Rq . Proof. We use a well-known inequality, known as FT(R)L Lemma (see e.g., [12, 17]), on the regret incurred by the FTL algorithm: R(AFTL, c1:T ) ≤ T X t=1 c T t(xt −xt+1). Without loss of generality, we can assume that ∥xt∥K = ∥xt+1∥K = 1 since the maximum of a linear function is attained at a boundary point. Since K is (C, q)-uniformly convex, we have xt + xt+1 2 K ≤1 −δK(∥xt −xt+1∥K). 6 This implies that xt + xt+1 2 −δK(∥xt −xt+1∥K) v ∥v∥K K ≤1. Moreover, xt+1 ∈arg minx∈K xT Pt τ=1 cτ. So, we have t X τ=1 cτ !T xt + xt+1 2 −δK(∥xt −xt+1∥K) v ∥v∥K  ≥inf x∈K x T t X τ=1 cτ = x T t+1 t X τ=1 cτ. Rearranging this last inequality and using the fact that Pt τ=1 vTcτ ≥0, we obtain: t X τ=1 cτ !T xt −xt+1 2  ≥δK(∥xt −xt+1∥K) · Pt τ=1 vTcτ ∥v∥K ≥C · ∥xt −xt+1∥q 2 ∥v∥K · Rq · t X τ=1 v Tcτ ! . By definition of FTL, we have xt ∈arg minx∈K xT Pt−1 τ=1 cτ, which implies: t−1 X τ=1 cτ !T xt+1 −xt 2 ≥0. Summing up the last two inequalities and setting γ = C·α ∥v∥K·Rq , we derive: c T t xt −xt+1 2  ≥γ α · t X τ=1 v Tcτ ! · ∥xt −xt+1∥q 2 ≥γ α · t X τ=1 v Tcτ ! · (cT t(xt −xt+1))q ∥ct∥q 2 . Rearranging this last inequality and using the fact that Pt τ=1 vTcτ ≥0, we obtain: |c T t(xt −xt+1)| ≤ 1 (2γ/α)1/(q−1) · ∥ct∥q 2 Pt τ=1 vTcτ !1/(q−1) . (4) Summing (4) over all t completes the proof of the first claim. The regret bounds for when vTct ≥ α · ∥ct∥2 for all t = 1, · · · , T follow from the first regret bound. We defer this part of the proof to Appendix D.2. Note that the regret bounds become O(T) when q →∞. This is expected because Lq balls are q-uniformly convex for q ≥2 and converge to L∞balls as q →∞and it is well-known that Follow-The-Leader yields Θ(T) regret in online linear optimization when K is a L∞ball. Using the above lemma, we introduce an algorithm for online linear optimization with hints that belong to a set V. In this algorithm, we instantiate one copy of the FTL algorithm for each possible direction of the hint. On round t, we invoke the copy of the algorithm that corresponds to the direction of the hint vt, using the history of the game for rounds with hints in that direction. We show that the overall regret of this algorithm is no larger than the sum of the regrets of the individual copies. Algorithm 2 Aset: SET-OF-HINTS For all v ∈V, let Tv = ∅. For t = 1, . . . , T, 1. Play xt ∈arg minx∈K P τ∈Tvt cT τx and receive ct as feedback. 2. Update Tvt ←Tvt ∪{t}. Theorem 4.2. Suppose that K ⊆Rd is a (C, q)-uniformly convex set that is symmetric around the origin, and Br ⊆K ⊆BR for some r and R. Consider online linear optimization with hints where the cost function at round t is ∥ct∥2 ≤G and the hint vt comes from a finite set V and is such that cT tvt ≥α∥ct∥2, while ∥vt∥2 = 1. Algorithm 2 has a worst-case regret of R(Aset, c1:T ) ≤|V| · R2 2C · α · r · G · (ln(T) + 1), if q = 2, and R(Aset, c1:T ) ≤|V| ·  Rq 2C · α · r 1/(q−1) · G · q −1 q −2 · T q−2 q−1 if q > 2. 7 Proof. We decompose the regret as follows: R(Aset, c1:T ) = T X t=1 c T txt −inf x∈K T X t=1 c T tx ≤ X v∈V (X t∈Tv c T txt −inf x∈K X t∈Tv c T tx ) ≤|V| · max v∈V R(AFTL, cTv). The proof follows by applying Lemma 4.1 and by using ∥vt∥K ≤(1/r) · ∥vt∥2 = 1/r. Note that Aset does not require α or V to be known a priori, as it can compile the set of hint directions as it sees new ones. Moreover, if the hints are not limited to finite set V a priori, then the algorithm can first discretize the L2 unit ball with an α/2-net and approximate any given hint with one of the hints in the discretized set. Using this discretization technique, Theorem 4.2 can be extended to the setting where the hints are not constrained to a finite set while having a regret that is linear in the size of the α/2-net (exponential in the dimension d.) Extensions of Theorem 4.2 are discussed in more details in the Appendix C. 5 Lower Bounds The regret bounds derived in Sections 3 and 4 suggest that the curvature of K can make up for the lack of curvature of the loss function to get rates faster than O( √ T) in online convex optimization, provided we receive additional information about the next move of the adversary in the form of a hint. In this section, we show that the curvature of the player’s decision set K is necessary to get rates better than O( √ T), even in the presence of a hint. As an example, consider the unit cube, i.e. K = {x | ∥x∥∞≤1}. Note that this set is not uniformly convex. Since, the ith coordinate of points in such a set, namely xi, has no effect on the range of acceptable values for the other coordinates, revealing one coordinate does not give us any information about the other coordinates xj for j ̸= i. For example, suppose that ct has each of its first two coordinates set to +1 or −1 with equal probability and all other coordinates set to 1. In this case, even after observing the last d −2 coordinates of the loss vector, the problem is reduced to a standard online linear optimization problem in the 2-dimensional unit cube. This choice of ct is known to incur a regret of Ω( √ T) [1]. Therefore, online linear optimization with the set K = {x | ∥x∥∞≤1}, even in the presence of hints, has a worst-case regret of Ω( √ T). As it turns out, this result holds for any polyhedral set of actions. We prove this by means of a reduction to the lower bounds established in [8] that apply to the online convex optimization framework (without hint). We defer the proof to the Appendix D.4. Theorem 5.1. If the set of feasible actions is a polyhedron then, depending on the set C, either there exists a trivial algorithm that achieves zero regret or every online algorithm has worst-case regret Ω( √ T). This is true even if the adversary is restricted to pick a fixed hint vt = v for all t = 1, · · · , T. At first sight, this result may come as a surprise. After all, since any Lp ball with 1 < p ≤2 is strongly convex, one can hope to use a L1+ν unit ball K′ to approximate K when K is a L1 ball (which is a polyhedron) and apply the results of Section 3 to achieve better regret bounds. The problem with this approach is that the constant in the modulus of convexity of K′ deteriorates when p →1 since δLp(ϵ) = (p −1) · ϵ2, see [3]. As a result, the regret bound established in Theorem 3.3 becomes O( 1 p−1 · log T). Since the best approximation of a L1 unit ball using a Lp ball is of the form {x ∈Rd | d1−1 p ∥x∥p ≤1}, the distance between the offline benchmark in the definition of regret when using K′ instead of K can be as large as (1 −d 1 p −1) · T, which translates into an additive term of order (1 −d 1 p −1) · T in the regret bound when using K′ as a proxy for K. Due to the inverse dependence of the regret bound obtained in Theorem 3.3 on p −1, the optimal choice of p = 1 + ˜O( 1 √ T ) leads to a regret of order ˜O( √ T). Finally, we conclude with a result that suggests that O(log(T)) is, in fact, the optimal achievable regret when K is strongly convex in online linear optimization with a hint. We defer the proof to the Appendix D.4. 8 Theorem 5.2. If K is a L2 ball then, depending on the set C, either there exists a trivial algorithm that achieves zero regret or every online algorithm has worst-case regret Ω(log(T)). This is true even if the adversary is restricted to pick a fixed hint vt = v for all t = 1, · · · , T. 6 Directions for Future Research We conjecture that the dependence of our regret bounds with respect to T is suboptimal when K is (C, q)-uniformly convex for q > 2. We expect the optimal rate to converge to √ T when q →∞as Lq balls converge to L∞balls and it is well known that the minimax regret scales as √ T in online linear optimization without hints when the decision set is a L∞ball. However, this calls for the development of an algorithm that is not based on a reduction to the Follow-The-Leader algorithm, as discussed after Lemma 4.1. We also conjecture that it is possible to relax the assumption that there are finitely many hints when K is (C, q)-uniformly convex with q > 2 without incurring an exponential dependence of the regret bounds (and the runtime) on the dimension d, see Appendix C. Again, this calls for the development of an algorithm that is not based on a reduction to the Follow-The-Leader algorithm. A solution that would alleviate the two aforementioned shortcomings would likely be derived through a reduction to online convex optimization with convex functions that are (C, q)-uniformly convex, for q ≥2, in all but one direction and constant in the other, in a similar fashion as done in Section 3 when q = 2. There has been progress in this direction in the literature, but, to the best of our knowledge, no conclusive result yet. For instance, Vovk [23] studies a related problem but restricts the study to the squared loss function. It is not clear if the setting studied in this paper can be reduced to the setting of square loss function. Another example is given by [21], where the authors consider online convex optimization with general (C, q)-uniformly convex functions in Banach spaces (with no hint) achieving a regret of order O(T (q−2)/(q−1)). Note that this rate matches the one derived in Theorem 4.2. However, as noted above, our setting cannot be reduced to theirs because our virtual loss functions are not uniformly convex in every direction. Acknowledgments Haghtalab was partially funded by an IBM Ph.D. fellowship and a Microsoft Ph.D. fellowship. Jaillet acknowledges the research support of the Office of Naval Research (ONR) grant N00014-15-1-2083. This work was partially done when Haghtalab was an intern at Microsoft Research, Redmond WA. References [1] Jacob Abernethy, Peter L Bartlett, Alexander Rakhlin, and Ambuj Tewari. Optimal strategies and minimax lower bounds for online convex games. In Proceedings of the 21st Conference on Learning Theory (COLT), pages 415–424, 2008. [2] Sanjeev Arora, Elad Hazan, and Satyen Kale. The multiplicative weights update method: a meta-algorithm and applications. Theory of Computing, 8(1):121–164, 2012. [3] Keith Ball, Eric A Carlen, and Elliott H Lieb. Sharp uniform convexity and smoothness inequalities for trace norms. Inventiones mathematicae, 115(1):463–482, 1994. [4] Avrim Blum and Yishay Monsour. Learning, regret minimization, and equilibria. In Algorithmic Game Theory, pages 79–102. 2007. [5] Nicolo Cesa-Bianchi and Gábor Lugosi. Prediction, learning, and games. Cambridge university press, 2006. [6] Chao-Kai Chiang and Chi-Jen Lu. Online learning with queries. In Proceedings of the 21st Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 616–629, 2010. [7] Chao-Kai Chiang, Tianbao Yang, Chia-Jung Lee, Mehrdad Mahdavi, Chi-Jen Lu, Rong Jin, and Shenghuo Zhu. Online optimization with gradual variations. In Proceedings of the 25th Conference on Learning Theory (COLT), pages 6–1, 2012. [8] Arthur Flajolet and Patrick Jaillet. No-regret learnability for piecewise linear losses. arXiv preprint arXiv:1411.5649, 2014. 9 [9] Yoav Freund. Boosting a weak learning algorithm by majority. Information and computation, 121(2): 256–285, 1995. [10] Yoav Freund and Robert E Schapire. A decision-theoretic generalization of on-line learning and an application to boosting. Journal of computer and system sciences, 55(1):119–139, 1997. [11] Elad Hazan. The convex optimization approach to regret minimization. Optimization for machine learning, pages 287–303, 2012. [12] Elad Hazan and Satyen Kale. Extracting certainty from uncertainty: Regret bounded by variation in costs. In Proceedings of the 23th Conference on Learning Theory (COLT), 2008. [13] Elad Hazan and Nimrod Megiddo. Online learning with prior knowledge. In Proceedings of the 20th Conference on Learning Theory (COLT), pages 499–513, 2007. [14] Elad Hazan, Amit Agarwal, and Satyen Kale. Logarithmic regret algorithms for online convex optimization. Machine Learning, 69(2-3):169–192, 2007. [15] Ruitong Huang, Tor Lattimore, András György, and Csaba Szepesvári. Following the leader and fast rates in linear prediction: Curved constraint sets and other regularities. In Proceedings of the 30th Annual Conference on Neural Information Processing Systems (NIPS), pages 4970–4978, 2016. [16] Adam Kalai and Santosh Vempala. Efficient algorithms for online decision problems. Journal of Computer and System Sciences, 71(3):291–307, 2005. [17] H Brendan McMahan. A survey of algorithms and analysis for adaptive online learning. Journal of Machine Learning Research, 18:1–50, 2017. [18] Gilles Pisier. Martingales in banach spaces (in connection with type and cotype). Manuscript., Course IHP, Feb, pages 2–8, 2011. [19] Alexander Rakhlin and Karthik Sridharan. Online learning with predictable sequences. In Proceedings of the 25th Conference on Learning Theory (COLT), pages 993–1019, 2013. [20] Alexander Rakhlin and Karthik Sridharan. Optimization, learning, and games with predictable sequences. In Proceedings of the 27th Annual Conference on Neural Information Processing Systems (NIPS), pages 3066–3074, 2013. [21] Karthik Sridharan and Ambuj Tewari. Convex games in banach spaces. In Proceedings of the 23rd Conference on Learning Theory (COLT), pages 1–13, 2010. [22] Roman Vershynin. Introduction to the non-asymptotic analysis of random matrices. In Compressed Sensing: Theory and Applications, pages 210–268. Cambridge University Press, 2012. [23] Vladimir Vovk. Competing with wild prediction rules. Machine Learning, 69(2-3):193–212, 2007. [24] Martin Zinkevich. Online convex programming and generalized infinitesimal gradient ascent. In Proceedings of the 20th International Conference on Machine Learning (ICML), pages 928–936, 2003. 10
2017
92
7,234
DPSCREEN: Dynamic Personalized Screening Kartik Ahuja Electrical and Computer Engineering Department University of California, Los Angeles ahujak@ucla.edu William R. Zame Economics Department University of California, Los Angeles zame@econ.ucla.edu Mihaela van der Schaar Engineering Science Department, University of Oxford Electrical and Computer Engineering Department, University of California, Los Angeles mihaela.vanderschaar@oxford-man.ox.ac.uk Abstract Screening is important for the diagnosis and treatment of a wide variety of diseases. A good screening policy should be personalized to the features of the patient and to the dynamic history of the patient (including the history of screening). The growth of electronic health records data has led to the development of many models to predict the onset and progression of different diseases. However, there has been limited work to address the personalized screening for these different diseases. In this work, we develop the first framework to construct screening policies for a large class of disease models. The disease is modeled as a finite state stochastic process with an absorbing disease state. The patient observes an external information process (for instance, self-examinations, discovering comorbidities, etc.) which can trigger the patient to arrive at the clinician earlier than scheduled screenings. The clinician carries out the tests; based on the test results and the external information it schedules the next arrival. Computing the exactly optimal screening policy that balances the delay in the detection against the frequency of screenings is computationally intractable; this paper provides a computationally tractable construction of an approximately optimal policy. As an illustration, we make use of a large breast cancer data set. The constructed policy screens patients more or less often according to their initial risk – it is personalized to the features of the patient – and according to the results of previous screens – it is personalized to the history of the patient. In comparison with existing clinical policies, the constructed policy leads to large reductions (28-68%) in the number of screens performed while achieving the same expected delays in disease detection. 1 Introduction Screening plays an important role in the diagnosis and treatment of a wide variety of diseases, including cancer, cardiovascular disease, HIV, diabetes and many others by leading to early detection of disease [1]-[3]. For some diseases (e.g., breast cancer, pancreatic cancer), the benefit of early detection is enormous [4] [5]. Because screening – especially screening that requires invasive procedures such as mammograms, CT scans, biopsies, angiograms, etc. – imposes financial and health costs on the patient and resource costs on society, good screening policies should trade off benefit and cost [6]. The best screening policies should take into account that the trade-off between benefit and cost should be different for different diseases – but also for different patients – patients whose features suggest that they are at high risk should be screened more often; patients whose features suggest that they are at low risk should be screened less often – and even different for the same individual at different points in time, as the perceived risk for that patient changes. Thus the 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. best screening policies should account for the disease type and be personalized to the features of the patient and to the history of the patient (including the history of screening) [32]. This paper develops the first such personalized screening policies in a very general setting. A screening policy prescribes what tests should/should not be done and when. Developing personalized screening policies that optimally balance the frequency of testing against the delay in the detection of the disease is extremely difficult for a number of reasons. (1) The onset and progression of different diseases varies significantly across the diseases. For instance, in [7] the development of breast cancer is modeled as a stationary Markov process, in [36] the development of HIV is modeled using a non-stationary survival process and, in [46] the development of colon cancer is modeled as a Semi-Markov process. The test outcomes observed over time may follow a non-stationary stochastic process that depends on the disease process upto that time and the features of the patient [35][36]. Existing works on screening [7] [9] are restricted to Markov disease processes and stationary Markov test outcome models, while this is not the case for many diseases and their test outcomes [10][35]-[37]. (2) The cost of not screening is the delay in detection of disease, which is not known. Hence the decision maker must act on the basis of beliefs about future disease states in addition to beliefs about the current disease state. (3) Patients can arrive at the scheduled time but may also arrive earlier on the basis of external information so the decision maker’s beliefs must take this external information into account. For instance, external information can be the development of lumps on breasts [25][26], or the development of a comorbidity [33][41]. (4) Given models of the progression of the disease and of the external information, solving for that policy is computationally intractable in general. This paper addresses all of these problems. We provide a computationally effective procedure that solves for an approximately optimal policy and we provide bounds for the approximation error (loss in performance) that arises from using the approximately optimal policy rather than the exactly optimal policy. Our procedure is applicable to many disease models such as dynamic survival models [11]-[13][36]-[37], first hitting time models [7][9][14]-[17]. Evaluating a proposed personalized screening policy using observational data is challenging. Observational data does not contain the counterfactuals: we cannot know what would have happened if a patient had been screened more often or an additional test had been performed. Instead, we follow an alternative route that has become standard in the literature [7]-[10]: we learn the disease progression model from the observational data and then evaluate the screening policy on the basis of the learned model. We also account for the fact that the disease model may be incorrectly estimated. We show that if the estimation error and the approximation error are small, then the policy we construct is very close to the policy for the correctly estimated model. In this work, use of a large breast cancer data set to illustrate the proposed personalized screening policy. We show that high risk patients are screened more often than low risk patients (personalization to the features of the patient) and that patients with bad test results are screened more often than patients with good test results (personalization to the dynamic history of the patient). The effect of these personalizations is that, in comparison with existing clinical policies, the policy we construct leads to large reductions (28-68%) in screening while achieving the same expected delays in disease detection. To illustrate the impact of the disease on the policy, we carry out a synthetic exercise across diseases, one for which the delay cost is linear and one for which the delay cost is quadratic. We show that the regime of operation (frequency of tests vs expected delay in detection) for the policies for the two costs are significantly different, thus highlighting the importance of choice of costs. 2 Model and Problem Formulation Time Time is discrete and the time horizon is finite; we write T = {1, ..., T} for the set of time slots. Patient Features Patients are distinguished by a (fixed) feature x. We assume that the features of a patient (age, sex, family history, etc.) are observable and that the set X of all patient features is finite. Disease Model We model the disease in terms of the (true physiological) state, where the state space is S. The disease follows a finite state stochastic process; ST is the space of state trajectories. The probability distribution over trajectories depends on the patient’s features; for ⃗s ∈ST , x ∈X we write Pr(⃗s|x) for the probability that the state trajectory is ⃗s given that the patient’s features are x. We distinguish one state D ∈S as the disease state; the disease state D is absorbing.1 Hence 1The restriction to a single absorbing disease state is only for expositional convenience. 2 Pr(s(t) = D, s(t′) ̸= D) = 0 for every time t and every time t′ > t. The true state is hidden/not observed.2 Our stochastic process model of disease encompasses many of the disease models in the literature, including discrete time survival models. The (discrete time) Cox Proportional Odds model [11], for instance, is the particular case of our model in which there are two states (Healthy H and Disease D) and the probability distribution over state trajectories is determined from the hazard rates. To be precise: if ⃗s is the state trajectory for which the disease state first occurs at time t0, so that s(t) = H for t < t0 and s(t) = D for t ≥t0, λ(t|x) is the hazard at time t conditional on x, then Pr(⃗s|x) = [1−λ(1|x)] · · · [1−λ(t0 −1|x)][λ(t0|x)] and Pr(⃗s|x) = 0 for all trajectories not having this form. Similar constructions show that other dynamic survival models [14]-[17] [10][37] also fit in the rubric of the general model presented here.3 External Information The clinician performs tests that are informative about the patient’s true state; in addition, external information may also arrive (for instance, patient self-examines breasts for lumps, patient discovers comorbidities, etc.). The patient observes an external information process modeled by a finite state stochastic process with state space Y; the information at time t is Y (t) ∈Y (for instance, Y = {Lump, No Lump}). If the patient visits clinician at time t, then this external information Y (t) arrives to the clinician. Y (t) may be correlated with the patient’s state trajectory through time t and the patient’s features; we write Pr(Y (t) = y|⃗s(t), x) for the probability that the external information at time t is y ∈Y, conditional on the state trajectory through time t and features x. We assume that at each time t the external information Y (t) is independent of the past observations conditional on the state trajectory through time t, ⃗s(t), and features x. Arrival The patient visits the clinician at time t if either (a) the information process Y (t) exceeds some threshold ˜y or (b) t is the time for the next recommended screening (determined in the Screening Policies described below). The first visit of the patient to the hospital depends on the screening policy and the patient’s features (See the description below). If the patient visits the clinician at time t, the clinician performs a sequence of tests and observes the results. For simplicity of exposition, we assume that the clinician performs only a single test, with a finite set Z of outcomes. We write Pr(Z(t) = z|⃗s(t), x) as the probability that test performed at time t yields the result z, conditional on the (unobserved) state trajectory and the patient’s features. We assume that the current test result is independent of past test results, conditional on the state trajectory and patient features. We also assume that current test result is independent of the external information conditional on the state trajectory through time t and the patient features. These assumptions are standard [7] [36]. We adopt the convention that z(t) = ∅if the patient does not visit the clinician at time t so that no test is performed. If the test outcome z ∈Z+ ⊂Z, then the patient is diagnosed to have the disease. We assume that there are no false positives. If a patient is diagnosed to be in the disease state, then screening ends and treatment begins. Screening Policies The history of a patient through time t consists of the trajectories of external information, test results and screening recommendations through time t. Write H(t) for the set of histories through time t and H = ST t=0 H(t) for the set of all histories. By convention H(0) consists only of the empty history. A screening policy is a map π : X ×H →{1, . . . , T}∪{D} that specifies, for each feature x and history h either the next screening time t+ or the decision that the patient is in the disease state D and so treatment should begin. A screening policy π begins at time 0, when the history is empty, so π(x, ∅) specifies the first screening time for a patient with features x. (For riskier patients, screening should begin earlier.) Write Π for the space of all screening policies. Screening Cost We normalize so that the cost of each screening is 1. (We can easily generalize to the more general setting in which the clinician decides from multiple tests [50], and different tests have different costs.) The cost of screening is a proxy for some combination of the monetary cost, the resource cost and the health cost to the patient. We discount screening costs over time so if Ts is the set of times at which the patient is screened then the screening cost is P t∈Ts δt, where δ ∈(0, 1). 2For many diseases, it seems natural to identify states intermediate between Healthy and Disease. For instance, because breast lumps [26] or colon polyps [9] that are found to be benign may become malignant, it seems natural to distinguish at least one Risky state, intermediate between the Healthy and Disease states. 3We can encompass the possibility of competing risks (e.g., different kinds of heart failure) [13] simply by allowing for multiple absorbing states. 3 Delay Cost If disease first occurs at time tD (the incidence time) but is detected only at time td > tD (the detection time) then the patient incurs a delay cost C(td −tD; tD). If the disease is never detected the delay cost is C(T −tD; tD). We assume that the delay cost function C : {1, . . . , T} × {1, . . . , T −1} →(0, ∞) is increasing in the first argument (the lag in detection) and decreasing in the second argument (the incidence time). The cost of delay is 0 if disease never occurs or occurs only at time t = T. Note that as soon as the disease is detected screening ends and treatment begins; in particular, there is a single unique time of incidence and a single unique time of detection. We allow for general delay costs because the impact of early/late detection on the probability of survival/successful treatment is different for different diseases. Expected Costs If the patient features are x ∈X then every screening policy π ∈Π induces a probability distribution Pr(·|x, π) on the space H(T) of all histories through time T and in particular induces probability distributions σ = Pr(·|x, π) on the families Ts ⊂2{1,...,T −1} of screening times and β = Pr((·, ·)|x, π) on the pairs (tD, td) of incidence time and detection time. The expected screening cost is Eσ P t∈Ts δt and the expected delay cost is Eβ  C(td −tD, tD)  . We provide a graphical model for the entire setup in the Appendix B of the Supplementary Materials. Optimal Screening Policy The objective of the screening policy is to minimize a weighted sum of the screening cost and the delay cost; i.e. the optimal screening policy is defined by arg min π∈Π n (1 −w) Eσ hX t∈Ts δti + wEβ[C(td −tD, tD)] o (1) The weight w reflects social/medical policy; for instance, w might be chosen to minimize cost subject to some accepted tolerance in delay (Further discussion on this is in Section 4). Comment The standard decision theory methods [18]-[21] used in screening [7][9] cannot be used to solve the above problem. In standard POMDPs, the interval between two decision epochs (in this case, screening times) is fixed exogenously; in standard POSMDPs, the time between two decision epochs is the sojourn time for the underlying core-state process. In our setting, the time between two decision epochs depends on the action (follow-up date), the external information process, and the state trajectory. In standard POMDPs (POSMDPs) the cost incurred in a decision epoch depend on the current state, while in the above problem the delay cost depends on the state trajectory. Moreover, in our setting the disease state trajectory is not restricted to a Markovian or Semi-Markovian process. 3 Proposed Approach Beliefs By a belief b we mean a probability distribution over the pairs consisting of state trajectories and a label l for the diagnosis: l = 1 if the patient has been diagnosed with the disease, l = 0 otherwise. By definition, a belief is a function b : ST × {0, 1} →[0, 1] such that P ⃗s,l b(⃗s, l) = 1 but it is often convenient to view a belief as a vector. Beliefs are updated using Bayesian updating every time there is a new observation (test outcomes, patient arrival, external information). Knowledge of beliefs will be sufficient to solve the optimization problem (1); see the Appendix C in the Supplementary Materials. We write B for the space of all beliefs. Bellman Equations To solve (1) we will formulate and solve the Bellman equations. To this end, we begin by defining the various components of the Bellman equations. Fix a time t. The cost ˜C incurred at time t depends on what happens at that time: i) if the patient (with diagnosis status l = 0 before the test) is tested and found to have acquired the disease, the cost is the sum of the cost of testing and the cost of delay, ii) if the patient has the disease and is not detected, then the cost of delay is incurred in the time slot T, and iii) if the patient does not have the disease, then the cost incurred in time slot t depends on whether a test was done in time slot t or not. We write these cases below. ˜C(⃗s, t, z, l) =    wC(t −tD; tD) + (1 −w)δtI(z ̸= ∅) t ≤T, l = 0, z ∈Z+ wC(T −tD; tD) t = T, l = 0 (1 −w)δtI(z ̸= ∅) otherwise (2) A recommendation plan τ : Z →T maps the observation z at the end of time slot t to the next scheduled follow-up time. Note that the recommendation plan is defined for a time t and is different than the policy. Denote the probability distribution over the observations (test outcome z, duration to the next arrival ˜τ, and the external information at the next arrival time y) conditional on the current belief b and the current recommendation plan τ by Pr(z, y, ˜τ b, τ, x). The belief b is updated to 4 ˆb in the next arrival time ˜τ based on the observations, current recommended plan and the current beliefs using Bayesian updating as ˆb(⃗s, l) = Pr(⃗s, l|b, τ, y, z, ˜τ, x). The optimal values for the objective in (2) starting from different initial beliefs can be expressed in terms of a value function V : B × {1, ..., T + 1} →R. The value function at time t when the patient is screened solves the Bellman equation: V (b, t) = max τ h X ⃗s,l,z −b(⃗s, l)Pr(z|⃗s, x)  ˜C(⃗s, t, z, l)  + X z,˜τ,y Pr(z, y, ˜τ b, τ, x)V ˆb, t + ˜τ i (3) We define V (b, T + 1) = 0 for all beliefs. Note that the computation of the first term in the RHS of (3) has a worst case computation time of |S|T . Therefore, solving for exact V (b, T) that satisfies (3) is computationally intractable when T is large. Next, we derive a useful property of the value function. (The proof of this and all other results are in the Appendix D-F of the Supplementary Material.). Lemma 1 For every t, the value function V (b, t) is the maximum of a finite family of functions that are linear in the beliefs b. In particular, the value function is convex and piecewise linear. The above property was shown for POMDPs in [39], we use the same ideas to extend it to our setup. 3.1 Constructing the Exactly Optimal Policy Every linear function of beliefs is of the form α∗b for some vector α. (We view α, b as column vectors and write α∗for the transpose.) Hence Lemma 1 tells us that there is a finite set of vectors Γ(t) such that V (b, t) = maxα∈Γ(t) α∗b. We refer to Γ(t) as the set of alpha vectors. In view of Lemma 1, to determine the value functions we need only determine the sets of alpha vectors. If we substitute the expression V (b, t) = maxα∈Γ(t) α∗b into (3), then we obtain a recursive expression for Γ(t) in terms of Γ(t + 1). By definition, the value function at time T + 1 is identically 0 so Γ(T +1) = {0}, where 0 is the |ST ×{0, 1}| dimensional zero vector, so we have an explicit starting point for this recursive procedure. There is an optimal action associated with each alpha vector. The action corresponding to the optimal alpha vector at a certain belief is the output of the optimal action given that belief, and so constructing the sets of alpha vectors yields the optimal policy; the details of the algorithm are in the Algorithm 3 in the Appendix A of the Supplementary Materials. Unfortunately, the algorithm to compute the sets of alpha vectors is computationally intractable (as expected). We therefore propose an algorithm that is tractable to compute an approximately optimal policy. 3.2 Constructing the Approximately Optimal Policy Point-Based Value Iteration (PBVI) approximation algorithms are known to work well for standard POMDPs [18]. These algorithms rely on choosing a finite set of belief vectors and constructing alpha vectors for these belief vectors and their success depends very much on the efficient construction of the set of belief vectors. The standard approaches [18] for belief construction are not designed to cope with settings like ours when beliefs lie in a very high dimensional space; in our setup belief has |ST × {0, 1}| dimensions. In Algorithm 1 (pseudo-code in the Appendix A of the Supplementary Materials), we first construct a lower dimensional belief space by sampling trajectories that are more likely to occur for the disease and then sampling the set of beliefs in the lower dimensional space that are likely to occur over the course of various screening policies. The key steps for Algorithm 1 are 1. Sample typical physiological state trajectories Sample a set ˜S ⊂ST of K physiological trajectories from the distribution Pr(⃗s|x). 2. Construct the set of reachable belief vectors Say that a belief vector b2 is reachable from the belief vector b1 if it can be derived by Bayesian updating on the basis of some underlying screening policy. We construct the sets of belief vectors that can be reached under different screening policies. For the first time slot, we start with a belief vector that lies in the space ˜S × {0, 1} given as Pr(⃗s|x)/Pr( ˜S|x), ∀⃗s ∈˜S, l = 0. For subsequent times, we select the beliefs that are encountered under random exploration of the actions (recommendation of future test dates). In addition to using random exploration, we can choose actions determined from a set of policies such as the clinical policies used in practice [27] [28] [47] to construct the set of reachable belief vectors. 5 Denote the set of belief vectors constructed at time t by ¯B[t] and the set of all such beliefs as ¯B = { ¯B[t], ∀t}. We carry out point-based value backups on these beliefs ¯B (see Algorithm 2 in the Appendix A of the Supplementary Materials), to construct the alpha vectors and thus the approximately optimal policy. Henceforth, we refer to our approach (Algorithm 1 and 2) as DPSCREEN. Computational Complexity The worst case computation of the policy requires O T(B)2T 2K|Y||Z|  steps, where B = maxt | ¯B[t]| is the maximum over the number of points sampled by the Algorithm 1 for any time slot t. The complexity can be reduced by restricting the space of actions; e.g. by bounding the amount of time allowed between successive screenings. Moreover, the proposed algorithms can be easily parallelized (many operations carried inside the iterations in Algorithm 2 can be done parallel), thus significantly reducing computation time. Approximation Error Because we only sample a finite number of trajectories, the policy we construct is not optimal but we can bound the loss of performance in comparison to the exactly optimal policy and hence justify the term “approximately optimal policy.” Define the approximation error to be the difference between the value achieved by the exact optimal policy (solution to (1)) and the value achieved by the approximately optimal policy (output from Algorithm 2). As a measure of the density of sampling of the belief simplex we set Ω( ¯B) = ζ maxt∈T maxB minb∈¯ B[t] ||b −b ′||1, where ζ is a constant that measures the maximum expected loss that can occur in one time slot. We make a few assumptions for the proposition to follow. The cost for delay is C(td −tD; tD) = c(td −tD)δtD, where c(d) is a convex function of d. The test outcome is accurate, i.e. no false positives and no false negatives. The maximum screening interval is bounded by W < T. The time horizon T is sufficiently large. We show that the loss of performance is bounded by the sampling density. Proposition 1 The approximation error is bounded above by Ω( ¯B). 3.3 Robustness Estimation Error To this point, it has been assumed that the model parameters are known. In practice, the model parameters need to be estimated using the observational data. In the next section, we will give a concrete example of how we estimate these parameters using observational data for breast cancer. Here we discuss the effect of error in estimation. Suppose that the model being estimated (true model) is m ′ ∈M, where M is the space of all the possible models (model parametrizations) under consideration. (We assume that the probability distribution of the physiological state transition, the patient’s self-observation outcomes, and the clinician’s observation outcomes are continuous on M.) Write L = M × B for the joint space of models and beliefs. Let the estimate of the model be ˆm. Let us assume that for every model in M the solution to (1) is unique. Therefore, we can define a mapping τ ∗: L × Z × T →T |Z|, where τ ∗(l, z, t) is the optimal recommended screening time at l, at time t following z. For a fixed model m, τ ∗((m, b), z, t) is the maximizer in (3). Theorem 1. There is a closed lower dimensional set E ⊂L such that the function τ ∗is locally constant on the complement of E. Theorem 1 implies that, with probability 1, if the model estimate ˆm and the true model m′ are sufficiently close, then the actions recommended by the exactly optimal policies for both models are identical. Therefore, the impact of estimation error on the exactly optimal policy is minimal. However, we construct approximately optimal policies. We can combine these conditions with Proposition 1 to say that if the approximation error Ω( ¯B) goes to zero, then the approximately optimal policy (for ˆ m) will also converge to the exactly optimal policy for true model m ′. Personalization: Figure 1 provides a graphical representation of the way in which DPSCREEN is personalized to the patients. We consider three Patients. The disease model for each patient is given by the ex ante survival curve (the probability of not becoming diseased by a given time). As shown in the graphs, the survival curves for Patients 1, 2 are the same; the survival curve for Patient 3 begins below the survival curve for Patients 1, 2 but is flatter and so eventually crosses the survival curve for Patients 1, 2. All three patients are screened at date 1; for all three the test outcome is z = Low. Hence the belief (risk assessment) for all three patients decreases. As a result, Patients 1, 2 are scheduled for next screening at date 4 but Patient 3, who has a lower ex ante survival probability, is scheduled for next screening at date 3. Thus, the policy is personalized to the ex ante risk. However, at date 2, all three patients experience an external information shock which causes them to be screened early. The test outcome for Patient 1 is z = Medium so Patient 1 is assessed to be at higher risk and is scheduled for next screening at date 3; the test outcome for Patient 2 is 6 𝑧= 𝐿𝑜𝑤 Time Belief Disease Patient 1 1 2 3 4 5 𝑧= 𝐿𝑜𝑤 Time Belief Disease 𝑧= 𝐿𝑜𝑤 𝑡' = 5 1 2 3 4 5 𝑧= 𝐿𝑜𝑤 Time Belief Disease 𝑧= 𝐿𝑜𝑤 1 2 3 4 5 𝑡': prescribed next arrival time 6 6 6 𝑡' = 4 𝑡' = 4 𝑡' = 3 𝑡' = 3 𝑡' = 6 Patient 1 and 2: Personalization through histories Same features, different histories → different screening Patient 2 and 3: Personalization through features Same history, different hazard rates → different screening 𝐿 𝑀 𝐻 𝐿 𝑀 𝐻 𝐿 𝑀 𝐻 𝑧: test outcomes 𝑧= 𝑀𝑒𝑑𝑖𝑢𝑚 Survival probability Survival probability Survival probability Patient 2 Patient 3 Figure 1: Illustration of dynamic personalization z = Low so Patient 2 is assessed to be at lower risk and is scheduled for next screening at date 5. Thus the policy is personalized to the dynamic history. The test outcome for Patient 3 is z = Low and Patient 3’s ex ante survival probability is higher so Patient 3’s risk is assessed to be very low, and Patient 3 is scheduled for next screening at date 6. Thus the policy adjusts to time-varying model parameters. 4 Illustrative Experiments Here we demonstrate the effectiveness of our policy in a real setting: screening for breast cancer. Description of the dataset: We use a de-identified dataset (from Athena Health Network [22]) of 45, 000 patients aged 60-65 who underwent screening for breast cancer. For most individuals we have the following associated features: age, the number of family members with breast cancer, weight, etc. Each patient had at least one mammogram; some had several. (In total, there are 84,000 mammograms in the dataset.) If the patients had a positive mammogram, a biopsy is carried out. Further description of mammogram output is in the Appendix G of the Supplementary Materials. Model description We model the disease progression using a two-state Markov model: S = {H, D} (H = Healthy, D = Disease/Cancer). Given patient features x, the initial probability of cancer is pin(x) and the probability of transition from the H to D is ptr(x). The external information Y is the size (perhaps 0) of a breast lump, based on the patient’s own self-examination. In view of the universal growth law for tumor described in [23], we model Y (t) = g(t) + ϵ(t), where g(t) = (1 −e−ι(t−ts))I(t > ts) is the size of the tumor and ts is the time at which patient actually develops cancer (the lump exists), ϵ(t) is a zero mean white noise process with variance σ2 and I() is the indicator function. If the lump size Y exceeds the threshold ˜y, then the patient visits the clinician, where tests are carried out. The set of test outcomes is Z = {∅, 1, 2, 3}, where z = ∅when no test is done, z = 1 when the mammogram is negative and no biopsy is done, z = 2 when the mammogram is positive and the biopsy is negative, z = 3 when both mammogram and biopsy is positive. Model Estimation We use the specificity and sensitivity for the mammogram from [7]. Each patient has a different (initial) risk for developing cancer; we compute the risk scores using the Gail model [24], which we use as the feature x. We assumed pin(x) and ptran(x) are logistic functions of x. We use standard Markov Chain Monte Carlo methods to estimate these functions pin(x) and ptran(x) (further details in the Appendix G of the Supplementary Materials). We assume that each woman has one self-examination per month [25] [26]. We use the value ι = 0.9 as stated in [23]. We estimate the parameters for the self-examinations σ = 0.43 and ˜y = 1 on the basis of the values of sensitivity and specificity for the self-examination from the literature [43]. In the comparisons to follow, we 7 will also analyze the setting when there are no self-examinations. We divide the population into two risk groups; the Low risk group consists of patients whose prior estimated risk of developing cancer within five years is less than 5%; the High risk group consists of patients whose prior estimated risk exceeds 5%. Performance Metrics, Objective and Benchmarks: Our objective is to minimize the number of screenings subject to a constraint on expected delay cost. We assume the delay cost is linear: C(td −tD, tD) = td −tD. To derive the solution to this constrained problem from construction, which minimizes the weighted sum of screening cost and delay cost, we solve the weighted problem for some weight w, and then tune w to select the policy that minimizes the number of screenings subject to a constraint on expected delay cost. For comparison purposes, we take the constraint on expected delay cost to be the expected delay that arises from current clinical practice (annual screening in the US [27][28], biennial screening in some other countries [29]). (Because our objective is to minimize the number of screenings, we take the cost of each screening to be 1, whether or not a biopsy is performed.) Comment At this point, we remind that existing frameworks [7][9][10] cannot be used to solve for the optimal screening policy in the above setup because: i) the costs incurred (delay) depends on the state trajectory and not just the current state, and ii) the lump growth model and the patient’s self-examination of the lump is not easy to incorporate in these works. Comparisons with clinical screening policies: We compare our constructed policies (for the two groups), with and without self-examination, in terms of three metrics: i) E[N|R]: the expected number of tests per year, conditional on the risk group; ii) E[∆|R]: the expected delay, conditional on the risk group; iii) E[∆|R, D]: the expected delay, conditional on the risk group and the patient actually developing cancer. Because E[∆|R] is the expected unconditional delay, it accounts for patients who do not develop cancer as well as for patients who do have cancer; because most patients do not develop cancer, E[∆|R] is small. We show the comparisons with the annual policies in Table 1; we show the comparisons with biennial screening in the Appendix G of the Supplementary Materials. In Table 1 we compare the performance of DPSCREEN (with and without self-examination) for Low and High risk groups against the current clinical policy of annual screening. For both risk groups, the proposed policy achieves approximately the same expected delay as the benchmark policy while doing many fewer tests (in expectation). With self-examinations, the expected reduction in number of screens is 57-68% (depending on risk group); even without self-examinations, the expected reduction in number of screens is 28-45% percent (depending on risk group). In Table 2 we contrast the difference in DPSCREEN across the two risk groups. To keep the comparison fair, we fix the tolerance in the delay to a fixed value. The proposed policy is personalized as it recommends significantly fewer tests to the low risk patients in contrast to the high risk patients. E["jR; Cost] months 0 0.2 0.4 0.6 0.8 1 E[NjR; Cost] 0 0.5 1 1.5 2 2.5 3 High risk, Linear cost High risk, Quadratic cost Low risk, Linear cost Low risk, Quadratic cost w=0.5 w=0.3 w=0.3 w=0.9 w=0.5 w=0.9 w=0.3 w=0.5 w=0.9 w=0.3 w=0.9 w=0.5 Figure 2: Impact of the type of disease Impact of the type of disease: We have so far considered breast cancer as an example and assumed linear delay costs. For some diseases (such as Pancreatic cancer [30][5]) the survival probability decreases very quickly with the delay in detection and therefore it might be reasonable to assume a cost of delay that is strictly convex (such as quadratic costs) in delay time for some disease. In Figure 2, we show that for a fixed risk group and for the same weights the policy constructed using quadratic costs is much more aggressive in testing. Moreover, the regime of operation of the policy (the points achieved by the policy in the 2-D plane E[N|R, Cost] vs E[∆|R, Cost]) can vary a lot depending on the choice of cost function even though the same weights are used. Therefore, the cost should be chosen based on the disease. 5 Related Works In Section 2, following the equation (1), we compared our methods with frameworks to some general frameworks in decision theory [18]-[21]. Next, we compare with other relevant works. 8 Table 1: Comparison of the proposed policy with annual screening for both high and low risk group. Risk Group Metrics DPSCREEN with self-examination DPSCREEN w/o self-examination Annual Low E[N|R], E[∆|R], E[∆|R, D] 0.32, 0.23, 9.2 0.55, 0.23, 9.2 1, 0.24, 9.6 High E[N|R], E[∆|R], E[∆|R, D] 0.43, 0.50, 6.7 0.72, 0.52,7.07 1, 0.52, 7.07 Table 2: Comparison of the proposed policies across different risk groups Risk Group DPSCREEN with self-examination DPSCREEN w/o self-examination E[N|R], E[∆|R], E[∆|R, D] E[N|R], E[∆|R], E[∆|R, D] Low 0.12, 0.33, 13.7 0.32, 0.33, 13.7 High 0.80, 0.35, 4.73 1.09, 0.35, 4.73 Screening frameworks for different diseases in operations research: Many works have focused on optimizing population-based screening schedules, which are not personalized (See [42] and references therein). In [7] [9] the authors develop personalized POMDP based screening models. The underlying disease evolution (breast and colon cancer) is assumed to follow a Markov process. External information process such as self-exams and the test outcomes over time are assumed to follow a stationary i.i.d process given the disease process. In [10] authors develop personalized screening models based on principles of Bayesian design for maximizing information gain (based on [40]). The underlying disease model (cardiac disease) is a dynamic (two-state) survival model and the cost of misdetection is a constant and does not depend on the delay. The test outcomes are modeled using generalized linear mixed effects models, and there is no external information process. To summarize, all of the above methods rely on very specific models for their disease, test outcomes, and external information, while our method imposes much less restrictions on the same. Screening frameworks for different diseases in medical literature: The Medical research literature on screening (e.g., Cancer Intervention and Surveillance Modelling Network, US preventive services task force, etc.) relies on stochastic simulation based methods: fix a disease model and a set of screening policies to be compared; for each policy in the set, simulate outcome paths from the model; compare across the set of policies [44]-[48]. The clinical guidelines for screening issued by the US preventive services task force [47][49] for colon cancer cancers are created based on the MISCAN-COLON [46] model for colon cancer. Simulations were carried out to compare different screening policies suggested by experts for that specific disease model- MISCAN-COLON. This approach allows more realistically complex models but it only compares a fixed set of policies, all of which may be far from optimal. Controlled Sensing: In controlled sensing [21][34][38] the problem of sensor scheduling requires deciding which sensor to use and when; this problem is similar the personalized screening problem studied here. In these works [21][34][38], the main focus is to exploit (or derive) structural properties of the process being sensed and the cost functions such that the exactly optimal sensing schedule is easy to characterize and compute. The structural assumptions such as the process that is sampled is stationary and Markov make these works less suited for personalized screening. 6 Conclusion In this work, we develop a novel methodology for constructing personalized screening policies that balance the cost of screening against the cost of delay in detection of disease. The disease is modeled as an arbitrary finite state stochastic process with an absorbing disease state. Our method incorporates the possibility of external information, such as self-examination or discovery of co-morbidities, that may trigger arrival of the patient to the clinician in advance of a scheduled screening appointment. We use breast cancer data to develop the disease model. In comparison with current clinical policies, our personalized screening policies reduce the number of screenings performed while maintaining the same delay in detection of disease. 9 7 Acknowledgements This work was supported by the Office of Naval Research (ONR) and the National Science Foundation (NSF) (Grant number: 1533983 and Grant number: 1407712). References [1] Siu, A. L. (2016). Screening for breast cancer: US Preventive Services Task Force recommendation statement. Annals of internal medicine, 164(4), pp.279-296. [2] Canto, M. et.al. (2013). International Cancer of the Pancreas Screening (CAPS) Consortium summit on the management of patients with increased risk for familial pancreatic cancer, Gut, 62(3), pp.339-347. [3] Wilson, J. et.al. (1968). Principles and practice of screening for disease. [4] Jemal, A. et.al. (2010). Cancer statistics, CA: a cancer journal for clinicians, 60(5), pp.277-300. [5] Rulyak, S. J. et.al. (2003). Cost-effectiveness of pancreatic cancer screening in familial pancreatic cancer kindreds, Gastrointestinal endoscopy, 57(1), pp.23-29. [6] Pace, L. E., & Keating, N. L. (2014). A systematic assessment of benefits and risks to guide breast cancer screening decisions. Jama, 311(13), 1327-1335. [7] Ayer, T. et.al. (2012). OR forum—a POMDP approach to personalize mammography screening decisions. Operations Research, 60(5), pp.1019-1034. [8] Maillart, L. M. et.al. (2008). Assessing dynamic breast cancer screening policies. Operations Research, 56(6), pp.1411-1427. [9] Erenay, F. S. et.al. (2014). Optimizing colonoscopy screening for colorectal cancer prevention and surveillance, Manufacturing & Service Operations Management, 16(3), pp.381-400. [10] Rizopoulos, D. et.al. (2015). Personalized screening intervals for biomarkers using joint models for longitudinal and survival data. Biostatistics, 17(1), pp.149-164. [11] Cox, D. R. (1992). Regression models and life-tables. In Breakthroughs in statistics. Springer New York. [12] Miller Jr, R. G. (2011). Survival analysis,John Wiley & Sons. [13] Crowder, M. J. (2001). Classical competing risks. CRC Press. [14] Lee, M. L. T. et.al. (2003). First hitting time models for lifetime data, Handbook of statistics, 23, pp.537-543. [15] Cox, D. R. (1992). Regression models and life-tables. In Breakthroughs in statistics. Springer New York, pp. 527-541. [16] Si, X. S. et.al. (2011). Remaining useful life estimation–A review on the statistical data driven approaches. European journal of operational research, 213(1), pp.1-14. [17] Lee, M. L. T. et.al. (2006). Threshold regression for survival analysis: modeling event times by a stochastic process reaching a boundary. Statistical Science, pp.501-513. [18] Pineau, J. et.al. (2003). Point-based value iteration: An anytime algorithm for POMDPs, n Joint Conference on Artificial Intelligence, 3, pp. 1025-1032. [19] Kim, D. et.al. (2011). Point-based value iteration for constrained POMDPs, in Joint Conference on Artificial Intelligence, pp. 1968-1974. [20] Yu, H. (2006). Approximate solution methods for partially observable Markov and semi-Markov decision processes, Doctoral dissertation, Massachusetts Institute of Technology. [21] Krishnamurthy, V. (2016). Partially Observed Markov Decision Processes. Cambridge University Press. 10 [22] Elson, S. L. et.al. (2013). The Athena Breast Health Network: developing a rapid learning system in breast cancer prevention, screening, treatment, and care. Breast cancer research and treatment, , 140(2), pp.417-425. [23] Guiot, C. et.al. (2003). Does tumor growth follow a “universal law”?, Journal of theoretical biology, 225(2), pp.147-151. [24] Gail, M. H. et.al. (1989). Projecting individualized probabilities of developing breast cancer for white females who are being examined annually. Journal of the National Cancer Institute, 81(24), 1879-1886. [25] Baxter, N. (2002). Breast self-examination, Canadian Medical Association Journal, Chicago, 166(2), pp.166-168. [26] Thomas, D. B. et.al.(2002). Randomized trial of breast self-examination in Shanghai: final results. Journal of the National Cancer Institute, 94(19), 1445-1457. [27] Oeffinger, K. C. et.al. (2015). Breast cancer screening for women at average risk: 2015 guideline update from the American Cancer Society. Jama, 314(15), 1599-1614. [28] Nelson, H. D. et.al. (2009). Screening for breast cancer: an update for the US Preventive Services Task Force. Annals of internal medicine, 151(10), 727-737. [29] Klabunde, C. N. et.al. (2007). Evaluating population-based screening mammography programs internationally. In Seminars in breast disease, International Breast Cancer Screening Network, 10 (2), pp. 102-107. [30] Sener, S. F. et.al. (1999). Pancreatic cancer: a report of treatment and survival trends for 100,313 patients diagnosed from 1985–1995, using the National Cancer Database. Journal of the American College of Surgeons, 189(1), pp.1-7. [31] Armstrong, K. et.al. (2007). Screening mammography in women 40 to 49 years of age: a systematic review for the American College of Physicians. Annals of internal medicine, 146(7), 516-526. [32] Liebman, M. N. (2007). Personalized medicine: a perspective on the patient, disease and causal diagnostics, 171-174. [33] Mandelblatt, J. S. et.al. (1992). Breast cancer screening for elderly women with and without comorbid conditions. Ann Intern Med, 116, 722-730. [34] Alaa, A. M. et.al. (2016). Balancing suspense and surprise: Timely decision making with endogenous information acquisition, in Advances in Neural Information Processing Systems (NIPS), pp. 2910-2918. [35] Schulam, P. et.al. (2016). Disease Trajectory Maps, in Advances In Neural Information Processing Systems (NIPS), pp. 4709-4717. [36] Rizopoulos, D. (2011). Dynamic Predictions and Prospective Accuracy in Joint Models for Longitudinal and Time to Event Data. Biometrics, 67(3), 819-829. [37] Meira-Machado, L. et.al. (2006). Nonparametric estimation of transition probabilities in a non-Markov illness–death model. Lifetime Data Analysis, 12(3), 325-344. [38] Krishnamurthy, V. (2017). POMDP Structural Results for Controlled Sensing. arXiv preprint arXiv:1701.00179. [39] Smallwood, R. D., & Sondik, E. J. (1973). The optimal control of partially observable Markov processes over a finite horizon. Operations research, 21(5), 1071-1088. [40] Verdinelli, I. et.al. (1992). Bayesian designs for maximizing information and outcome, Journal of the American Statistical Association, 87(418), 510-515. [41] Daskivich, T. J.et.al. (2011). Overtreatment of men with low-risk prostate cancer and significant comorbidity, Cancer, 117(10), 2058-2066. [42]Alagoz, O et.al. (2011). Operations research models for cancer screening, Wiley Encyclopedia of Operations Research and Management Science. 11 [43] Elmore, J. G. et.al. (2005). Efficacy of breast cancer screening in the community according to risk level. Journal of the National Cancer Institute, 97(14), 1035-1043. [44] Vilaprinyo et.al (2014). Cost-effectiveness and harm-benefit analyses of risk-based screening strategies for breast cancer, PloS one. 9(2), p.e86858. [45] Trentham-Dietz et.al. (2016) Tailoring Breast Cancer Screening Intervals by Breast Density and Risk for Women Aged 50 Years or Older: Collaborative Modeling of Screening Outcomes Risk-Based Breast Cancer Screening Intervals, Annals of Internal Medicine, 165(10), pp.700-712. [46] Loeve, F. et.al (1999). The MISCAN-COLON simulation model for the evaluation of colorectal cancer screening. Computers in Biomedical Research, 32(1), pp.13-33. [47] Zauber, A. G. et.al. (2009) Evaluating Test Strategies for Colorectal Cancer Screening: A Decision Analysis for the US Preventive Services Task Force. Annals of Internal Medicine, 149(9), pp.659-669. [48] Frazier, A. L et.al. (2000) Cost-effectiveness of screening for colorectal cancer in the general population, JAMA, 284(15), pp.1954-1961. [49] Whitlock et.al. (2008) Screening for Colorectal Cancer: A Targeted, Updated Systematic Review for the US Preventive Services Task Force Screening for Colorectal Cancer. Annals of Internal Medicine, 149(9), pp.638-658. [50] Alaa, A.M. et.al. (2016). ConfidentCare: A Clinical Decision Support System for Personalized Breast Cancer Screening, accepted and to appear in IEEE Transactions on Multimedia-Special Issue on Multimedia-based Healthcare, 18(10), pp.1942-1955. 12
2017
93
7,235
Online Learning of Optimal Bidding Strategy in Repeated Multi-Commodity Auctions Sevi Baltaoglu Cornell University Ithaca, NY 14850 msb372@cornell.edu Lang Tong Cornell University Ithaca, NY 14850 lt35@cornell.edu Qing Zhao Cornell University Ithaca, NY 14850 qz16@cornell.edu Abstract We study the online learning problem of a bidder who participates in repeated auctions. With the goal of maximizing his T-period payoff, the bidder determines the optimal allocation of his budget among his bids for K goods at each period. As a bidding strategy, we propose a polynomial-time algorithm, inspired by the dynamic programming approach to the knapsack problem. The proposed algorithm, referred to as dynamic programming on discrete set (DPDS), achieves a regret order of O(√T log T). By showing that the regret is lower bounded by Ω( √ T) for any strategy, we conclude that DPDS is order optimal up to a √log T term. We evaluate the performance of DPDS empirically in the context of virtual trading in wholesale electricity markets by using historical data from the New York market. Empirical results show that DPDS consistently outperforms benchmark heuristic methods that are derived from machine learning and online learning approaches. 1 Introduction We consider the problem of optimal bidding in a multi-commodity uniform-price auction (UPA) [1], which promotes the law of one price for identical goods. UPA is widely used in practice. Examples include spectrum auction, the auction of treasury notes, the auction of emission permits (UK), and virtual trading in the wholesale electricity market, which we discuss in detail in Sec. 1.1. A mathematical abstraction of multi-commodity UPA is as follows. A bidder has K goods to bid on at an auction. With the objective to maximize his T-period expected profit, at each period, the bidder determines how much to bid for each good subject to a budget constraint. In the bidding period t, if a bid xt,k for good k is greater than or equal to its auction clearing price λt,k, then the bid is cleared, and the bidder pays λt,k. His revenue resulting from the cleared bid will be the good’s spot price (utility) πt,k. In particular, the payoff obtained from good k at period t is (πt,k −λt,k)1{xt,k ≥λt,k} where 1{xt,k ≥λt,k} indicates whether the bid is cleared. Let λt = [λt,1, ..., λt,K]⊺and πt = [πt,1, ..., πt,K]⊺be the vector of auction clearing and spot market prices at period t, respectively. Similarly, let xt = [xt,1, ..., xt,K]⊺be the vector of bids for period t. We assume that (πt, λt) are drawn from an unknown joint distribution and, in our analysis, independent and identically distributed (i.i.d.) over time.1 At the end of each period, the bidder observes the auction clearing and spot prices of all goods. Therefore, before choosing the bid of period t, all the information the bidder has is a vector It−1 containing his observation and decision history {xi, λi, πi}t−1 i=1. Consequently, a bidding policy µ of a bidder is defined as a sequence of decision rules, i.e., µ = (µ0, µ1..., µT −1), such that, at time t −1, 1This implies that the auction clearing price is independent of bid xt, which is a reasonable assumption for any market where an individual’s bid has negligible impact on the market price. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. µt−1 maps the information history It−1 to the bid xt of period t. The performance of any bidding policy µ is measured by its regret, which is defined by the difference between the total expected payoff of policy µ and that of the optimal bidding strategy under known distribution of (πt, λt). 1.1 Motivating applications The mathematical abstraction introduced above applies to virtual trading in the U.S. wholesale electricity markets that are operated under a two-settlement framework. In the day-ahead (DA) market, the independent system operator (ISO) receives offers to sell and bids to buy from generators and retailers for each hour of the next day. To determine the optimal DA dispatch of the next day and DA electricity prices at each location, ISO solves an economic dispatch problem with the objective of maximizing social surplus while taking transmission and operational constraints into account. Due to system congestion and losses, wholesale electricity prices vary from location to location.2 In the real-time (RT) market, ISO adjusts the DA dispatch according to the RT operating conditions, and the RT wholesale price compensates deviations in the actual consumption from the DA schedule. The differences between DA and RT prices occur frequently both as a result of generators and retailers exercising locational market power [2] and as a result of price spikes in the RT due to unplanned outages and unpredictable weather conditions [3]. To promote price convergence between DA and RT markets, in the early 2000s, virtual trading was introduced [4]. Virtual trading is a financial mechanism that allows market participants and external financial entities to arbitrage on the differences between DA and RT prices. Empirical and analytical studies have shown that increased competition in the market due to virtual trading results in price convergence and increased market efficiency [2, 3, 5]. Virtual transactions make up a significant portion of the wholesale electricity markets. For example, the total volume of cleared virtual transactions in five big ISO markets was 13% of the total load in 2013 [4]. In the same year, total payoff resulting from all virtual transactions was around 250 million dollars in the PJM market [2] and 45 million dollars in NYISO market [6]. A bid in virtual trading is a bid to buy (sell) energy in the DA market at a specific location with an obligation to sell (buy) back exactly the same amount in the RT market at the same location if the bid is cleared (accepted). Specifically, a bid to buy in the DA market is cleared if the offered bid price is higher than the DA market price. Similarly, a bid to sell in the DA market is cleared if it is below the DA market price. In this context, different locations and/or different hours of the day are the set of goods to bid on. The DA prices are the auction clearing prices, and the RT prices are the spot prices. The problem studied here may also find applications in other types of repeated auctions where the auction may be of the double, uniform-price, or second-price types. For example, in the case of online advertising auctions [7], different goods can correspond to different types of advertising space an advertiser may consider to bid on. 1.2 Main results and related work We propose an online learning approach to the algorithmic bidding under budget constraints in repeated multi-commodity auctions. The proposed approach falls in the category of empirical risk minimization (ERM) also referred to as the follow the leader approach. The main challenge here is that optimizing the payoff (risk) amounts to solving a multiple choice knapsack problem (MCKP) that is known to be NP hard [8]. The proposed approach, referred to as dynamic programming on discrete set (DPDS), is inspired by a pseudo-polynomial dynamic programming approach to 0-1 Knapsack problems. DPDS allocates the limited budget of the bidder among K goods in polynomial time both in terms of the number of goods K and in terms of the time horizon T. We show that the expected payoff of DPDS converges to that of the optimal strategy under known distribution by a rate no slower than p log t/t which results in a regret upper bound of O(√T log T). By showing that, for any bidding strategy, the regret is lower bounded by Ω( √ T), we prove that DPDS is order optimal up to a √log T term. We also evaluate the performance of DPDS empirically in the context of virtual trading by using historical data from the New York energy market. Our empirical results show that 2For example, transmission congestion may prevent scheduling the least expensive resources at some locations. 2 DPDS consistently outperforms benchmark heuristic methods that are derived from standard machine learning methods. The problem formulated here can be viewed in multiple machine learning perspectives. We highlight below several relevant existing approaches. Since the bidder can calculate the reward that could have been obtained by selecting any given bid value regardless of its own decision, our problem falls into the category of full-feedback version of multi-armed bandit (MAB) problem, referred to as experts problem, where the reward of all arms (actions) are observable at the end of each period regardless of the chosen arm. For the case of finite number of arms, Kleinberg et al. [9] showed that, for stochastic setting, constant regret is achievable by choosing the arm with the highest average reward at each period. A special case of the adversarial setting was studied by Cesa-Bianchi et al. [10] who provided matching upper and lower bounds in the order of Θ( √ T). Later, Freund and Schapire [11] and Auer et al. [12] showed that the Hedge algorithm, a variation of weighted majority algorithm [13], achieves the matching bound for the general setting. These results, however, do not apply to experts problems with continuous action spaces. The stochastic experts problem where the set of arms is an uncountable compact metric space (X, d) rather than finite was studied by Kleinberg and Slivkins [14] (see [15] for an extended version). Since there are uncountable number of arms, it is assumed that, in each period, a payoff function drawn from an i.i.d. distribution is observed rather than the individual payoff of each arm. Under the assumption of Lipschitz expected payoff function, they showed that the instance-specific regret of any algorithm is lower bounded by Ω( √ T). They also showed that their algorithm—NaiveExperts—achieves a regret upper bound of O(T γ) for any γ > (b + 1)/(b + 2) where b is the isometry invariant of the metric space. However, NaiveExperts is computationally intractable in practice because the computational complexity of its direct implementation grows exponentially with the dimension (number of goods in our case). Furthermore, the lower bound in [14] does not imply a lower bound for our problem with a specific payoff. Krichene et al. [16] studied the adversarial setting and proposed an extension of the Hedge algorithm, which achieves O(√T log T) regret under the assumption of Lipschitz payoff functions. For our problem, it is reasonable to assume that the expected payoff function is Lipschitz; yet it is clear that, at each period, the payoff realization is a step function which is not Lipschitz. Hence, Lipschitz assumption of [16] doesn’t hold in our setting. Stochastic gradient descent methods, which have low computational complexity, have been extensively studied in the literature of continuum-armed bandit [17, 18, 19]. However, either the concavity or the unimodality of the expected payoff function is required for regret guarantees of these methods to hold. This may not be the case in our problem depending on the underlying distribution of prices. A relevant work that takes an online learning perspective for the problem of a bidder engaging in repeated auctions is Weed et al. [7]. They are motivated by online advertising auctions and studied the partial information setting of the same problem as ours but without a budget constraint. Under the margin condition, i.e., the probability of auction price occurring in close proximity of mean utility is bounded, they showed that their algorithm, inspired by the UCB1 algorithm [20], achieves regret that ranges from O(log T) to O(√T log T) depending on how tight the margin condition is. They also provided matching lower bounds up to a logarithmic factor. However, their lower bound does not imply a bound for the full information setting we study here. Also, the learning algorithm in [7] does not apply here because the goods are coupled through the budget constraint in our case. Furthermore, we do not have margin condition, and we allow the utility of the good to depend on the auction price. Some other examples of literature on online learning in repeated auctions studied the problem of an advertiser who wants to maximize the number of clicks with a budget constraint [21, 22], or that of a seller who tries to learn the valuation of its buyer in a posted price auction [23, 24]. The settings considered in those problems are considerably different from that studied here in the implementation of budget constraints [21, 22], and in the strategic behavior of the bidder [23, 24]. 2 Problem formulation The total expected payoff at period t given bid xt can be expressed as r(xt) = E ((πt −λt)⊺1{xt ≥λt}|xt) , where the expectation is taken using the joint distribution of (πt, λt), and 1{xt ≥λt} is the vector of indicator functions with the k-th entry corresponding to 1{xt,k ≥λt,k}. We assume that the payoff 3 (πt −λt)⊺1{xt ≥λt} obtained at each period is a bounded random variable with support in [l, u],3 and the auction prices are drawn from a distribution with positive support. Hence, a zero bid for any good is equivalent to not bidding because it will not get cleared. The objective is to determine a bidding policy µ that maximizes the expected T-period payoff subject to a budget constraint for each individual period: maximize µ E T X t=1 r(xµ t ) ! subject to ∥xµ t ∥1 ≤B, for all t = 1, ..., T, xµ t ≥0, for all t = 1, ..., T, (1) where B is the auction budget of the bidder, xµ t denotes the bid determined by policy µ, and xµ t ≥0 is equivalent to xµ t,k ≥0 for all k ∈{1, 2, ..., K}. 2.1 Optimal solution under known distribution If the joint distribution f(., .) of πt and λt is known, the optimization problem (1) decouples to solving for each time instant separately. Since (πt, λt) is i.i.d. over t, an optimal solution under known model does not depend on t and is given by x∗= arg max xt∈F r(xt) (2) where F = {x ∈ℜK : x ≥0, ∥x∥1 ≤B} is the feasible set of bids. Optimal solution x∗may not be unique or it may not have a closed form. The following example illustrates a case where there isn’t a closed form solution and shows that, even in the case of known distribution, the problem is a combinatorial stochastic optimization, and it is not easy to calculate an optimal solution. Example. Let λt and πt be independent, λt,k be exponentially distributed with mean ¯λk > 0, and the mean of πt,k be ¯πk > 0 for all k ∈{1, .., K}. Since not bidding for good k is optimal if ¯πk ≤0, we exclude the case ¯πk ≤0 without loss of generality. For this example, we can use the concavity of r(x) in the interval [0, ¯π], where ¯π = [¯π1, ..., ¯πK]⊺, to obtain the unique optimal solution x∗, which is characterized by x∗ k =      ¯πk if PK k=1 ¯πk ≤B, 0 if PK k=1 ¯πk > B and ¯πk/¯λk < γ∗, xk satisfying (¯πk −xk)e−xk/¯λk/¯λk = γ∗ if PK k=1 ¯πk > B and ¯πk/¯λk ≥γ∗, where the Lagrange multiplier γ∗> 0 is chosen such that ∥x∗∥1 = B is satisfied. This solution takes the form of a "water-filling" strategy. More specifically, if the budget constraint is not binding, then the optimal solution is to bid ¯πk for every good k. However, in the case of a binding budget constraint, the optimal solution is determined by the bid value at which the marginal expected payoff associated with each good k is equal to min(γ∗, ¯πk/¯λk), and this bid value cannot be expressed in closed form. We measure the performance of a bidding policy µ by its regret4, the difference between the expected T-period payoff of µ and that of x∗, i.e., Rµ T (f) = T X t=1 E(r(x∗) −r(xµ t )), (3) where the expectation is taken with respect to the randomness induced by µ. The regret of any policy is monotonically increasing. Hence, we are interested in policies with sub-linear regret growth. 3This is reasonable in the case of virtual trading because DA and RT prices are bounded due to offer/bid caps. 4The regret definition used here is the same as in [14]. This definition is also known as pseudo-regret in the literature [25]. 4 3 Online learning approach to optimal bidding The idea behind our approach is to maximize the sample mean of the expected payoff function, which is an ERM approach [26]. However, we show that a direct implementation of ERM is NP-hard. Hence, we propose a polynomial-time algorithm that is based on dynamic programming on a discretized feasible set. We show that our approach achieves the order optimal regret. 3.1 Approximate expected payoff function and its optimization Regardless of the bidding policy, one can observe the auction and spot prices of past periods. Therefore, the average payoff that could have been obtained by bidding x up to the current period can be calculated for any fixed value of x ∈F. Specifically, the average payoff ˆrt,k(xk) for a good k as a function of the bid value xk can be calculated at period t + 1 by using observations up to t, i.e., ˆrt,k(xk) = (1/t) t X i=1 (πi,k −λi,k)1{xk ≥λi,k}. For example, at the end of first period, ˆrt,k(xk) = (π1,k −λ1,k)1{xk ≥λ1,k} as illustrated in Fig. 1a. For, t ≥2, this can be expressed recursively; ˆrt,k(xk) =  t−1 t ˆrt−1,k(xk) if xk < λt,k, t−1 t ˆrt−1,k(xk) + 1 t (πt,k −λt,k) if xk ≥λt,k. (4) Since each observation introduces a new breakpoint, and the value of average payoff function is constant between two consecutive breakpoints, we observe that ˆrt,k(xk) is a piece-wise constant function with at most t breakpoints. Let the vector of order statistics of the observed auction clearing prices {λi,k}t i=1 and zero be λ(k) =  0, λ(1),k, ..., λ(t),k ⊺, and let the vector of associated average payoffs be r(k), i.e., r(k) i = ˆrt,k  λ(k) i  . Then, ˆrt,k(xk) can be expressed by the pair λ(k), r(k) , e.g., see Fig. 1b. λ1,k xk ˆr1,k(xk) π1,k −λ1,k 0 (a) t = 1 λ(k) 2 xk ˆr4,k(xk) r(k) 2 λ(k) 3 λ(k) 4 λ(k) 5 r(k) 3 r(k) 4 r(k) 5 0 (b) t = 4 Figure 1: Piece-wise constant average payoff function of good k For a vector y, let ym:n = (ym, ym+1, ..., yn) denote the sequence of entries from m to n. Initialize λ(k), r(k) = (0, 0) at the beginning of first period. Then, at each period t ≥1, the pair λ(k), r(k) can be updated recursively as follows:  λ(k), r(k) = h λ(k) 1:ik, λt,k, λ(k) ik+1:t i⊺ , t −1 t r(k) 1:ik, t −1 t r(k) ik:t + 1 t (πt,k −λt,k) ⊺ , (5) where ik = maxi:λ(k) i <λt,k i at period t. Consequently, overall average payoff function ˆrt(x) can be expressed as a sum of average payoff functions of individual goods. Instead of the unknown expected payoff r(x), let’s consider the maximization of the average payoff function, which corresponds to the ERM approach, i.e., max x∈F ˆrt(x) = max x∈F K X k=1 ˆrt,k(xk). (6) Due to the piece-wise constant structure, choosing xk = λ(k) i for some i ∈{1, ..., t + 1} contributes the same amount to the overall payoff as choosing any xk ∈ h λ(k) i , λ(k) i+1  if i < t + 1 and any 5 xk ≥λ(k) i if i = t + 1. However, choosing xk = λ(k) i utilizes a smaller portion of the budget. Hence, an optimal solution to (6) can be obtained by solving the following integer linear program: maximize {zk}K k=1 K X k=1  r(k)⊺ zk subject to K X k=1  λ(k)⊺ zk ≤B, 1⊺zk ≤1, ∀k = 1, ..., K, zk,i ∈{0, 1}, ∀i = 1, ..., t + 1; ∀k = 1, ..., K. (7) where the bid value xk = λ(k)⊺zk for good k. Observe that (7) is a multiple choice knapsack problem (MCKP) [8], a generalization of 0-1 knapsack. Unfortunately, (7) is NP-hard [8]. If we had a polynomial-time algorithm that finds an optimal solution x ∈F to (6), then we could have obtained the solution of (7) in polynomial-time too by setting zk,i = 1 where i = maxi:λ(k) i ≤xk i for each k. Therefore, (6) is also NP-hard, and, to the best of our knowledge, there isn’t any method in the ERM literature [27], which mostly focuses on classification problems, suitable to implement for the specific problem at hand. 3.2 Dynamic programming on discrete set (DPDS) policy Next, we present an approach that discretizes the feasible set using intervals of equal length and optimizes the average payoff on this new discrete set via a dynamic program. Although this approach doesn’t solve (6), the solution can be arbitrarily close to the optimal depending on the choice of the interval length under the assumption of the Lipschitz continuous expected payoff function. To exploit the smoothness of Lipschitz continuity, discretization approach of the continuous feasible set has been used in the continuous MAB literature previously [17, 14]. However, different than MAB literature, in this paper, discretization approach is utilized to reduce the computational complexity of an NP-hard problem as well. Let αt be an integer sequence increasing with t and Dt = {0, B/αt, 2B/αt, ..., B} as illustrated in Fig. 2. Then, the new discrete set is given as Ft = {x ∈F : xk ∈Dt, ∀k ∈{1, ..., K}}. Our goal is to optimize ˆrt(.) on the new set Ft rather than F, i.e., max xt+1∈Ft ˆrt(xt+1). (8) λ(k) 2 xk ˆr4,k(xk) r(k) 2 λ(k) 3 λ(k) 4 λ(k) 5 r(k) 3 r(k) 4 r(k) 5 B α4 2B α4 3B α4 4B α4 0 Figure 2: Example of the discretization of the decision space for good k when t = 4 Now, we use dynamic programming approach that has been used to solve 0-1 Knapsack problems including MCKP given in (7) [28]. However, direct implementation of this approach results in pseudopolynomial computational complexity in the case of 0-1 Knapsack problems. The discretization of the feasible set with equal interval length reduces the computational complexity to polynomial time. We define the maximum payoff one can collect with budget b among goods {1, ..., n} when the bid value xk is restricted to the set Dt for each good k as Vn(b) = max {xk}n k=1:Pn k=1 xk≤b,xk∈Dt∀k n X k=1 ˆrt,k(xk). 6 Then, the following recursion can be used to solve for VK(B) which gives the optimal solution to (8): Vn(jB/αt) = ( 0 if n = 0, j ∈{0, 1, ..., αt}, max 0≤i≤j (ˆrt,n(iB/αt) + Vn−1((j −i)B/αt)) if 1 ≤n ≤K, j ∈{0, 1, ..., αt}. (9) This is the Bellman equation where Vn(b) is the maximum total payoff one can collect using remaining budget b and remaining n goods. Its optimality can be shown via a simple induction argument. Recall that ˆrt,n(0) = 0 for all (t, n) pairs due to the assumption of positive day-ahead prices. Recursion (9) can be solved starting from n = 1 and proceeding to n = K, where, for each n, Vn(b) is calculated for all b ∈Dt. Since the computation of Vn(b) requires at most αt + 1 comparison for any fixed value of n ∈{1, ..., K} and b ∈Dt, it has a computational complexity on the order of Kα2 t once the average payoff values ˆrt,n(xn) for all xn ∈Dt and n ∈{1, ..., K} are given. For each n ∈{1, ..., K}, computation of ˆrt,n(xn) for all xn ∈Dt introduces an additional computational complexity of at most on the order of t, which can be observed from the update step of λ(k), π(k) , given in (5). Hence, total computational complexity of DPDS is O(K max(t, α2 t )) at each period t. 3.3 Convergence and regret of DPDS policy Under the assumption of Lipschitz continuity, Theorem 1 shows that the value of DPDS converges to the value of the optimal policy under known model with a rate faster than or equal to p log t/t if the DPDS algorithm parameter αt = ⌈tγ⌉with γ ≥1/2. Consequently, the regret growth rate of DPDS is upper bounded by O(√T log T). If γ = 1/2, then the computational complexity of the algorithm is bounded by O(Kt) at each period t, and total complexity over the entire horizon is O(KT 2). Theorem 1 Let xDPDS t+1 denote the bid of DPDS policy for period t + 1. If r(.) is Lipschitz continuous on F with p-norm and Lipschitz constant L, then, for any γ > 0 and for DPDS parameter choice αt ≥2, E(r(x∗)−r(xDPDS t+1 )) ≤LK1/pB αt + p 2(γ + 1)K + 1(u−l) r log t t + 4 min(u −l, LK1/pB)αK t t(γ+1)K+1/2 , (10) and for αt = max(⌈tγ⌉, 2) with γ ≥1/2, RDPDS T (f) ≤2(LK1/pB+4 min(u−l, LK1/pB)) √ T +2 p 2(γ + 1)K + 1(u−l) p T log T. (11) Actually, we can relax the uniform Lipschitz continuity condition. Under the weaker condition of |r(x∗) −r(x)| ≤L∥x∗−x∥q p for all x ∈F and for some constant L > 0, the incremental regret bound that is given in (10) becomes E(r(x∗)−r(xDPDS t+1 )) ≤LKq/p(B/αt)q+(u−l)( p 2(γ + 1)K + 1 p log t/t+4αK t t−(γ+1)K−1/2). The proof of Theorem 1 is derived by showing that the value of x∗ t+1 = arg maxx∈Ft r(x) converges to the value of x∗due to Lipschitz continuity, and the value of xDPDS t+1 converges to the value of x∗ t+1 via the use of concentration inequality inspired by [20, 17]. Even though the upper bound of regret in Theorem 1 depends on the budget B linearly, this dependence can be avoided in the expense of increase in computational complexity. For example, in the literature, the reward is generally assumed to be in the unit interval, i.e., l = 0 and u = 1, and the expected reward is assumed to be Lipschitz continuous with Euclidean norm and constant L = 1. In this case, by following the proof of Theorem 1, we observe that assigning γ = 1/2 and αt = max(⌈αtγ⌉, 2) for some α > 0 gives a regret upper bound of 2B √ KT/α+12√KT log T +α for T > α + 1. Consequently, if B = O(K), then O(K3/4√ T + √KT log T) regret is achievable by setting α = K3/4. 3.4 Lower bound of regret for any bidding policy We now show that DPDS in fact achieves the slowest possible regret growth. Specifically, Theorem 2 states that, for any bidding policy µ and horizon T, there exists a distribution f for which the regret growth is slower than or equal to the square root of the horizon T. 7 Theorem 2 Consider the case where K = 1, B = 1, and λt and πt are independent random variables with distributions fλ(λt) = ϵ−11{(1 −ϵ)/2 ≤λt ≤(1 + ϵ)/2} and fπ(πt) = Bernoulli(¯π), respectively. Let f(λt, πt) = fλ(λt)fπ(πt) and ϵ = T −1/2/2 √ 5. Then, for any bidding policy µ, Rµ T (f) ≥(1/16 √ 5) √ T, either for ¯π = 1/2 + ϵ or for ¯π = 1/2 −ϵ. As seen in Theorem 2, we choose a specific distribution for the auction clearing and spot prices. Observe that, for this distribution, the payoff function is Lipschitz continuous with Lipschitz constant L = 3/2 because the magnitude of the derivative of the payoff function |r′(x)| ≤|¯π −x|/ϵ ≤3/2 for (1 −ϵ)/2 ≤x ≤(1 + ϵ)/2 and r′(x) = 0 otherwise. So, it satisfies the condition given in Theorem 1. The proof of Theorem 2 is obtained by showing that, every time the bid is cleared, an incremental regret greater than ϵ/2 is incurred under the distribution with ¯π = (1/2−ϵ); otherwise, an incremental regret greater than ϵ/2 is incurred under the distribution with ¯π = (1/2 + ϵ). However, to distinguish between these two distributions, one needs Ω(T) samples, which results in a regret lower bound of Ω( √ T). The bound is obtained by adapting a similar argument used by [29] in the context of non-stochastic MAB problem. 4 Empirical study New York ISO (NYISO), which consists of 11 zones, allows virtual transactions at zonal nodes only. So, we use historical DA and RT prices of these zones from 2011 to 2016 [30]. Since the price for each hour is different at each zone, there are 11×24 different locations, i.e., zone-hour pairs, to bid on every day. The prices are per unit (MWh) prices. We also consider buy and sell bids simultaneously for all location. As explained in Sec. 1.1, a sell bid is a bid to sell in the DA market with an obligation to buy back in the RT market. Hence, the profit of a sell bid at period t is (λt −πt)⊺1{xt ≤λt}. Generally, an upper bound ¯p for the DA prices is known, e.g. ¯p = $1000 for NYISO. We convert a sell bid to a buy bid by using xsell t = ¯p −xt, λsell t = ¯p −λt, and πsell t = ¯p −πt instead of xt, λt, and πt. NYISO DA market for day t closes at 5:00 am on day t −1. Hence, the RT prices of all hours of day t −1 cannot be observed before the bid submission for day t. Therefore, the most recent information used before the submission for day t was the observations from day t −2. (a) y = 2012 (b) y = 2013 (c) y = 2014 (d) y = 2015 (e) y = 2016 Figure 3: Cumulative profit trajectory of year y for B = 100000 We compare DPDS with three algorithms. One of them is UCBID-GR, inspired by UCBID [7]. At each day, UCBID-GR sorts all locations according to their profitabilities, i.e., their price spread (the difference between DA and RT price) sample means. Then, starting from the most profitable location, 8 UCBID-GR sets the bid of a location equal to its RT price sample mean until there isn’t any sufficient budget left. The second algorithm, referred to as SA, is a variant of Kiefer-Wolfowitz stochastic approximation method. SA approximates the gradient of the payoff function by using the current observation and updates the bid of each k as follows; xt,k = xt−1,k + at ((πt−2,k −λt−2,k)(1{xt−1,k + ct ≥λt−2,k} −1{xt−1,k ≥λt−2,k})) /ct. Then, xt is projected to the feasible set F. The last algorithm is SVM-GR, which is inspired by the use of support vector machines (SVM) by Tang et al. [31] to determine if a buy or a sell bid is profitable at a location, i.e., if the price spread is positive or negative. Due to possible correlation of the price spread at a location on day t with the price spreads observed recently at that and also at other locations, the input of SVM for each location is set as the price spreads of all locations from day t −7 to day t −2. To test SVM-GR algorithm at a particular year, for each location, the data from the previous year is used to train SVM and to determine the average profit, i.e., average price spread, and the bid level that will be accepted with 95% confidence in the event that a buy or a sell bid is profitable. For the test year, at each period, SVM-GR first determines if a buy or a sell bid is profitable for each location. Then, SVM-GR sorts all locations according to their average profits, and, starting from the most profitable location, it sets the bid of a location equal to the bid level with 95% confidence of acceptance until there isn’t any sufficient budget left. To evaluate the performance of a year, DPDS, UCBID-GR, and SA algorithms have also been trained starting from the beginning of the previous year. The algorithm parameter of DPDS was set as αt = t; and the step size at and ct of SA were set as 20000/t and 2000/t1/4, respectively. For B=$100,000, the cumulative profit trajectory of five consecutive years are given in Fig. 3. We observe that DPDS obtains a significant profit in all cases, and it outperforms other algorithms consistently except 2015 where SVM-GR makes approximately 25% more profit. However, in three out of five years, SVM-GR suffers a considerable amount of loss. In general, UCBID-GR performs quite well except 2016, and SA algorithm incurs a loss almost every year. 5 Conclusion By applying general techniques such as ERM, discretization approach, and dynamic programming, we derive a practical and efficient algorithm to the algorithmic bidding problem under budget constraint in repeated multi-commodity auctions. We show that the expected payoff of the proposed algorithm, DPDS, converges to that of the optimal strategy by a rate no slower than p log t/t, which results in a O(√T log T) regret. By showing that the regret is lower bounded by Ω( √ T) for any bidding strategy, we prove that DPDS is order optimal up to a √log T term. For the motivating application of virtual bidding in electricity markets (see Sec. 1.1), the stochastic setting, studied in this paper, is natural due to the electricity markets being competitive, which implies that the existence of an adversary is very unlikely. However, it is also of interest to study the adversarial setting to extend the results to other applications. For example, the adversarial setting of our problem is a special case of no-regret learning problem of Simultaneous Second Price Auctions (SiSPA), studied by Daskalakis and Syrgkanis [32] and Dudik et al. [33]. In particular, to deal with the adversarial setting, it is possible to use our dynamic programming approach as the offline oracle for the Oracle-Based Generalized FTPL algorithm proposed by Dudik et al. [33] if we fix the discretized action set over the whole time horizon. More specifically, let the interval length of discretization be B/m, i.e., αt = m. Then, it is possible to show that a 1-admissible translation matrix with K⌈log m⌉columns is implementable with complexity m. Consequently, no-regret result of Dudik et al. [33] holds with a regret bound of O(K √ T log m) if we measure the performance of the algorithm against the best action in hindsight in the discretized finite action set rather than in the original continuous action set considered here. Unfortunately, as shown by Weed et al. [7], it is not possible to achieve sublinear regret with a fixed discretization for the specific problem considered in this paper. Hence, it requires further work to see if this method can be extended to obtain no-regret learning for the adversarial setting under the original continuous action set. 9 Acknowledgments We would like to thank Professor Robert Kleinberg for the insightful discussion. This work was supported in part by the National Science Foundation under Award 1549989 and by the Army Research Laboratory Network Science CTA under Cooperative Agreement W911NF-09-20053. References [1] Paul Milgrom. Putting auction theory to work. Cambridge University Press, 2004. [2] PJM. Virtual transactions in the pjm energy markets. Technical report, Oct 2015. http:// www.pjm.com/~/media/committees-groups/committees/mc/20151019-webinar/ 20151019-item-02-virtual-transactions-in-the-pjm-energy-marketswhitepaper.ashx. [3] Ruoyang Li, Alva J. Svoboda, and Shmuel S. Oren. Efficiency impact of convergence bidding in the california electricity market. Journal of Regulatory Economics, 48(3):245–284, 2015. [4] John E. Parsons, Cathleen Colbert, Jeremy Larrieu, Taylor Martin, and Erin Mastrangelo. Financial arbitrage and efficient dispatch in wholesale electricity markets, February 2015. https://ssrn.com/ abstract=2574397. [5] Wenyuan Tang, Ram Rajagopal, Kameshwar Poolla, and Pravin Varaiya. Model and data analysis of two-settlement electricity market with virtual bidding. In 2016 IEEE 55th Conference on Decision and Control (CDC), pages 6645–6650, 2016. [6] David B. Patton, Pallas LeeVanSchaick, and Jie Chen. 2014 state of the market report for the new york iso markets. Technical report, May 2015. http://www.nyiso.com/public/webdocs/ markets_operations/documents/Studies_and_Reports/Reports/ Market_Monitoring_Unit_Reports/2014/NYISO2014SOMReport__5-132015_Final.pdf. [7] Jonathan Weed, Vianney Perchet, and Philippe Rigollet. Online learning in repeated auctions. In 29th Annual Conference on Learning Theory, page 1562–1583, 2016. [8] Hans Kellerer, Ulrich Pferschy, and David Pisinger. The Multiple-Choice Knapsack Problem, pages 317–347. Springer Berlin Heidelberg, 2004. [9] Robert Kleinberg, Alexandru Niculescu-Mizil, and Yogeshwer Sharma. Regret bounds for sleeping experts and bandits. In 21st Conference on Learning Theory, pages 425–436, 2008. [10] Nicolò Cesa-Bianchi, Yoav Freund, David P. Helmbold, David Haussler, Robert E. Schapire, and Manfred K. Warmuth. How to use expert advice. In Proceedings of the Twenty-fifth Annual ACM Symposium on Theory of Computing, pages 382–391. ACM, 1993. [11] Yoav Freund and Robert E. Schapire. A decision-theoretic generalization of on-line learning and an application to boosting. In Proceedings of the Second European Conference on Computational Learning Theory, pages 23–37. Springer-Verlag, 1995. [12] Peter Auer, Nicolò Cesa-Bianchi, Yoav Freund, and Robert E. Schapire. Gambling in a rigged casino: The adversarial multi-armed bandit problem. In Proceedings of IEEE 36th Annual Foundations of Computer Science, pages 322–331, 1995. [13] Nick Littlestone and Manfred K. Warmuth. The weighted majority algorithm. Information and Computation, 108(2):212 – 261, 1994. [14] Robert Kleinberg and Aleksandrs Slivkins. Sharp dichotomies for regret minimization in metric spaces. In Proceedings of the Twenty-first Annual ACM-SIAM Symposium on Discrete Algorithms, pages 827–846. Society for Industrial and Applied Mathematics, 2010. [15] Robert Kleinberg, Aleksandrs Slivkins, and Eli Upfal. Bandits and experts in metric spaces. arXiv preprint arXiv:1312.1277v2, 2015. [16] Walid Krichene, Maximilian Balandat, Claire Tomlin, and Alexandre Bayen. The hedge algorithm on a continuum. In Proceedings of the 32Nd International Conference on International Conference on Machine Learning - Volume 37, pages 824–832. JMLR.org, 2015. 10 [17] Robert D. Kleinberg. Nearly tight bounds for the continuum-armed bandit problem. In L. K. Saul, Y. Weiss, and L. Bottou, editors, Advances in Neural Information Processing Systems 17, pages 697–704. MIT Press, 2005. [18] Abraham D. Flaxman, Adam Tauman Kalai, and H. Brendan McMahan. Online convex optimization in the bandit setting: Gradient descent without a gradient. In Proceedings of the Sixteenth Annual ACM-SIAM Symposium on Discrete Algorithms, pages 385–394. Society for Industrial and Applied Mathematics, 2005. [19] Eric W. Cope. Regret and convergence bounds for a class of continuum-armed bandit problems. IEEE Transactions on Automatic Control, 54(6):1243–1253, 2009. [20] Peter Auer, Nicolò Cesa-Bianchi, and Paul Fischer. Finite-time analysis of the multiarmed bandit problem. Machine Learning, 47(2-3):235–256, 2002. [21] Kareem Amin, Michael Kearns, Peter Key, and Anton Schwaighofer. Budget optimization for sponsored search: Censored learning in mdps. In Proceedings of the Twenty-Eighth Conference on Uncertainty in Artificial Intelligence, pages 54–63. AUAI Press, 2012. [22] Long Tran-Thanh, Lampros Stavrogiannis, Victor Naroditskiy, Valentin Robu, Nicholas R Jennings, and Peter Key. Efficient regret bounds for online bid optimisation in budget-limited sponsored search auctions. In Proceedings of the Thirtieth Conference on Uncertainty in Artificial Intelligence, pages 809–818. AUAI Press, 2014. [23] Kareem Amin, Afshin Rostamizadeh, and Umar Syed. Learning prices for repeated auctions with strategic buyers. In C. J. C. Burges, L. Bottou, M. Welling, Z. Ghahramani, and K. Q. Weinberger, editors, Advances in Neural Information Processing Systems 26, pages 1169–1177. Curran Associates, Inc., 2013. [24] Mehryar Mohri and Andres Munoz. Optimal regret minimization in posted-price auctions with strategic buyers. In Z. Ghahramani, M. Welling, C. Cortes, N. D. Lawrence, and K. Q. Weinberger, editors, Advances in Neural Information Processing Systems 27, pages 1871–1879. Curran Associates, Inc., 2014. [25] Sébastien Bubeck and Nicolò Cesa-Bianchi. Regret analysis of stochastic and nonstochastic multi-armed bandit problems. Foundations and Trends in Machine Learning, 5(1):1–122, 2012. [26] Vladimir Vapnik. Principles of risk minimization for learning theory. In J. E. Moody, S. J. Hanson, and R. P. Lippmann, editors, Advances in Neural Information Processing Systems 4, pages 831–838. Morgan-Kaufmann, 1992. [27] Shai Shalev-Shwartz and Shai Ben-David. Understanding Machine Learning: From Theory to Algorithms. Cambridge University Press, 2014. [28] Krzysztof Dudzi´nski and Stanisław Walukiewicz. Exact methods for the knapsack problem and its generalizations. European Journal of Operational Research, 28(1):3 – 21, 1987. [29] Peter Auer, Nicolò Cesa-Bianchi, Yoav Freund, and Robert E. Schapire. The nonstochastic multiarmed bandit problem. SIAM Journal on Computing, 32(1):48–77, 2002. [30] NYISO Website, 2017. http://www.nyiso.com/public/markets_operations/ market_data/pricing_data/index.jsp. [31] Wenyuan Tang, Ram Rajagopal, Kameshwar Poolla, and Pravin Varaiya. Private communications, 2017. [32] Constantinos Daskalakis and Vasilis Syrgkanis. Learning in auctions: Regret is hard, envy is easy. In 2016 IEEE 57th Annual Symposium on Foundations of Computer Science (FOCS), pages 219–228, 2016. [33] Miroslav Dudik, Nika Haghtalab, Haipeng Luo, Robert E. Shapire, Vasilis Syrgkanis, and Jennifer Wortman Vaughan. Oracle-efficient online learning and auction design. In 2017 IEEE 58th Annual Symposium on Foundations of Computer Science (FOCS), pages 528–539, 2017. 11
2017
94
7,236
A-NICE-MC: Adversarial Training for MCMC Jiaming Song Stanford University tsong@cs.stanford.edu Shengjia Zhao Stanford University zhaosj12@cs.stanford.edu Stefano Ermon Stanford University ermon@cs.stanford.edu Abstract Existing Markov Chain Monte Carlo (MCMC) methods are either based on generalpurpose and domain-agnostic schemes, which can lead to slow convergence, or problem-specific proposals hand-crafted by an expert. In this paper, we propose ANICE-MC, a novel method to automatically design efficient Markov chain kernels tailored for a specific domain. First, we propose an efficient likelihood-free adversarial training method to train a Markov chain and mimic a given data distribution. Then, we leverage flexible volume preserving flows to obtain parametric kernels for MCMC. Using a bootstrap approach, we show how to train efficient Markov chains to sample from a prescribed posterior distribution by iteratively improving the quality of both the model and the samples. Empirical results demonstrate that A-NICE-MC combines the strong guarantees of MCMC with the expressiveness of deep neural networks, and is able to significantly outperform competing methods such as Hamiltonian Monte Carlo. 1 Introduction Variational inference (VI) and Monte Carlo (MC) methods are two key approaches to deal with complex probability distributions in machine learning. The former approximates an intractable distribution by solving a variational optimization problem to minimize a divergence measure with respect to some tractable family. The latter approximates a complex distribution using a small number of typical states, obtained by sampling ancestrally from a proposal distribution or iteratively using a suitable Markov chain (Markov Chain Monte Carlo, or MCMC). Recent progress in deep learning has vastly advanced the field of variational inference. Notable examples include black-box variational inference and variational autoencoders [1–3], which enabled variational methods to benefit from the expressive power of deep neural networks, and adversarial training [4, 5], which allowed the training of new families of implicit generative models with efficient ancestral sampling. MCMC methods, on the other hand, have not benefited as much from these recent advancements. Unlike variational approaches, MCMC methods are iterative in nature and do not naturally lend themselves to the use of expressive function approximators [6, 7]. Even evaluating an existing MCMC technique is often challenging, and natural performance metrics are intractable to compute [8–11]. Defining an objective to improve the performance of MCMC that can be easily optimized in practice over a large parameter space is itself a difficult problem [12, 13]. To address these limitations, we introduce A-NICE-MC, a new method for training flexible MCMC kernels, e.g., parameterized using (deep) neural networks. Given a kernel, we view the resulting Markov Chain as an implicit generative model, i.e., one where sampling is efficient but evaluating the (marginal) likelihood is intractable. We then propose adversarial training as an effective, likelihoodfree method for training a Markov chain to match a target distribution. First, we show it can be used in a learning setting to directly approximate an (empirical) data distribution. We then use the approach to train a Markov Chain to sample efficiently from a model prescribed by an analytic expression (e.g., a Bayesian posterior distribution), the classic use case for MCMC techniques. We leverage flexible volume preserving flow models [14] and a “bootstrap” technique to automatically design powerful 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. domain-specific proposals that combine the guarantees of MCMC and the expressiveness of neural networks. Finally, we propose a method that decreases autocorrelation and increases the effective sample size of the chain as training proceeds. We demonstrate that these trained operators are able to significantly outperform traditional ones, such as Hamiltonian Monte Carlo, in various domains. 2 Notations and Problem Setup A sequence of continuous random variables {xt}1 t=0, xt 2 Rn, is drawn through the following Markov chain: x0 ⇠⇡0 xt+1 ⇠T✓(xt+1|xt) where T✓(·|x) is a time-homogeneous stochastic transition kernel parametrized by ✓2 ⇥and ⇡0 is some initial distribution for x0. In particular, we assume that T✓is defined through an implicit generative model f✓(·|x, v), where v ⇠p(v) is an auxiliary random variable, and f✓is a deterministic transformation (e.g., a neural network). Let ⇡t ✓denote the distribution for xt. If the Markov chain is both irreducible and positive recurrent, then it has an unique stationary distribution ⇡✓= lim t!1 ⇡t ✓. We assume that this is the case for all the parameters ✓2 ⇥. Let pd(x) be a target distribution over x 2 Rn, e.g, a data distribution or an (intractable) posterior distribution in a Bayesian inference setting. Our objective is to find a T✓such that: 1. Low bias: The stationary distribution is close to the target distribution (minimize |⇡✓−pd|). 2. Efficiency: {⇡t ✓}1 t=0 converges quickly (minimize t such that |⇡t ✓−pd| < δ). 3. Low variance: Samples from one chain {xt}1 t=0 should be as uncorrelated as possible (minimize autocorrelation of {xt}1 t=0). We think of ⇡✓as a stochastic generative model, which can be used to efficiently produce samples with certain characteristics (specified by pd), allowing for efficient Monte Carlo estimates. We consider two settings for specifying the target distribution. The first is a learning setting where we do not have an analytic expression for pd(x) but we have access to typical samples {si}m i=1 ⇠pd; in the second case we have an analytic expression for pd(x), possibly up to a normalization constant, but no access to samples. The two cases are discussed in Sections 3 and 4 respectively. 3 Adversarial Training for Markov Chains Consider the setting where we have direct access to samples from pd(x). Assume that the transition kernel T✓(xt+1|xt) is the following implicit generative model: v ⇠p(v) xt+1 = f✓(xt, v) (1) Assuming a stationary distribution ⇡✓(x) exists, the value of ⇡✓(x) is typically intractable to compute. The marginal distribution ⇡t ✓(x) at time t is also intractable, since it involves integration over all the possible paths (of length t) to x. However, we can directly obtain samples from ⇡t ✓, which will be close to ⇡✓if t is large enough (assuming ergodicity). This aligns well with the idea of generative adversarial networks (GANs), a likelihood free method which only requires samples from the model. Generative Adversarial Network (GAN) [4] is a framework for training deep generative models using a two player minimax game. A generator network G generates samples by transforming a noise variable z ⇠p(z) into G(z). A discriminator network D(x) is trained to distinguish between “fake” samples from the generator and “real” samples from a given data distribution pd. Formally, this defines the following objective (Wasserstein GAN, from [15]) min G max D V (D, G) = min G max D Ex⇠pd[D(x)] −Ez⇠p(z)[D(G(z))] (2) In our setting, we could assume pd(x) is the empirical distribution from the samples, and choose z ⇠⇡0 and let G✓(z) be the state of the Markov Chain after t steps, which is a good approximation of ⇡✓if t is large enough. However, optimization is difficult because we do not know a reasonable t in advance, and the gradient updates are expensive due to backpropagation through the entire chain. 2 Figure 1: Visualizing samples of ⇡1 to ⇡50 (each row) from a model trained on the MNIST dataset. Consecutive samples can be related in label (red box), inclination (green box) or width (blue box). Figure 2: T✓(yt+1|yt). Figure 3: Samples of ⇡1 to ⇡30 from models (top: without shortcut connections; bottom: with shortcut connections) trained on the CelebA dataset. Therefore, we propose a more efficient approximation, called Markov GAN (MGAN): min ✓ max D Ex⇠pd[D(x)] −λE¯x⇠⇡b ✓[D(¯x)] −(1 −λ)Exd⇠pd,¯x⇠T m ✓(¯x|xd)[D(¯x)] (3) where λ 2 (0, 1), b 2 N+, m 2 N+ are hyperparameters, ¯x denotes “fake” samples from the generator and T m ✓(x|xd) denotes the distribution of x when the transition kernel is applied m times, starting from some “real” sample xd. We use two types of samples from the generator for training, optimizing ✓such that the samples will fool the discriminator: 1. Samples obtained after b transitions ¯x ⇠⇡b ✓, starting from x0 ⇠⇡0. 2. Samples obtained after m transitions, starting from a data sample xd ⇠pd. Intuitively, the first condition encourages the Markov Chain to converge towards pd over relatively short runs (of length b). The second condition enforces that pd is a fixed point for the transition operator. 1 Instead of simulating the chain until convergence, which will be especially time-consuming if the initial Markov chain takes many steps to mix, the generator would run only (b + m)/2 steps on average. Empirically, we observe better training times by uniformly sampling b from [1, B] and m from [1, M] respectively in each iteration, so we use B and M as the hyperparameters for our experiments. 3.1 Example: Generative Model for Images We experiment with a distribution pd over images, such as digits (MNIST) and faces (CelebA). In the experiments, we parametrize f✓to have an autoencoding structure, where the auxiliary variable v ⇠N(0, I) is directly added to the latent code of the network serving as a source of randomness: z = encoder✓(xt) z0 = ReLU(z + βv) xt+1 = decoder✓(z0) (4) where β is a hyperparameter we set to 0.1. While sampling is inexpensive, evaluating probabilities according to T✓(·|xt) is generally intractable as it would require integration over v. The starting distribution ⇡0 is a factored Gaussian distribution with mean and standard deviation being the mean and standard deviation of the training set. We include all the details, which ares based on the DCGAN [16] architecture, in Appendix E.1. All the models are trained with the gradient penalty objective for Wasserstein GANs [17, 15], where λ = 1/3, B = 4 and M = 3. We visualize the samples generated from our trained Markov chain in Figures 1 and 3, where each row shows consecutive samples from the same chain (we include more images in Appendix F) From 1We provide a more rigorous justification in Appendix B. 3 Figure 1 it is clear that xt+1 is related to xt in terms of high-level properties such as digit identity (label). Our model learns to find and “move between the modes” of the dataset, instead of generating a single sample ancestrally. This is drastically different from other iterative generative models trained with maximum likelihood, such as Generative Stochastic Networks (GSN, [18]) and Infusion Training (IF, [19]), because when we train T✓(xt+1|xt) we are not specifying a particular target for xt+1. In fact, to maximize the discriminator score the model (generator) may choose to generate some xt+1 near a different mode. To further investigate the frequency of various modes in the stationary distribution, we consider the class-to-class transition probabilities for MNIST. We run one step of the transition operator starting from real samples where we have class labels y 2 {0, . . . , 9}, and classify the generated samples with a CNN. We are thus able to quantify the transition matrix for labels in Figure 2. Results show that class probabilities are fairly uniform and range between 0.09 and 0.11. Although it seems that the MGAN objective encourages rapid transitions between different modes, it is not always the case. In particular, as shown in Figure 3, adding residual connections [20] and highway connections [21] to an existing model can significantly increase the time needed to transition between modes. This suggests that the time needed to transition between modes can be affected by the architecture we choose for f✓(xt, v). If the architecture introduces an information bottleneck which forces the model to “forget” xt, then xt+1 will have higher chance to occur in another mode; on the other hand, if the model has shortcut connections, it tends to generate xt+1 that are close to xt. The increase in autocorrelation will hinder performance if samples are used for Monte Carlo estimates. 4 Adversarial Training for Markov Chain Monte Carlo We now consider the setting where the target distribution pd is specified by an analytic expression: pd(x) / exp(−U(x)) (5) where U(x) is a known “energy function” and the normalization constant in Equation (5) might be intractable to compute. This form is very common in Bayesian statistics [22], computational physics [23] and graphics [24]. Compared to the setting in Section 3, there are two additional challenges: 1. We want to train a Markov chain such that the stationary distribution ⇡✓is exactly pd; 2. We do not have direct access to samples from pd during training. 4.1 Exact Sampling Through MCMC We use ideas from the Markov Chain Monte Carlo (MCMC) literature to satisfy the first condition and guarantee that {⇡t ✓}1 t=0 will asymptotically converge to pd. Specifically, we require the transition operator T✓(·|x) to satisfy the detailed balance condition: pd(x)T✓(x0|x) = pd(x0)T✓(x|x0) (6) for all x and x0. This condition can be satisfied using Metropolis-Hastings (MH), where a sample x0 is first obtained from a proposal distribution g✓(x0|x) and accepted with the following probability: A✓(x0|x) = min ✓ 1, pd(x0) pd(x) g✓(x|x0) g✓(x0|x) ◆ = min ✓ 1, exp(U(x) −U(x0))g✓(x|x0) g✓(x0|x) ◆ (7) Therefore, the resulting MH transition kernel can be expressed as T✓(x0|x) = g✓(x0|x)A✓(x0|x) (if x 6= x0), and it can be shown that pd is stationary for T✓(·|x) [25]. The idea is then to optimize for a good proposal g✓(x0|x). We can set g✓directly as in Equation (1) (if f✓takes a form where the probability g✓can be computed efficiently), and attempt to optimize the MGAN objective in Eq. (3) (assuming we have access to samples from pd, a challenge we will address later). Unfortunately, Eq. (7) is not differentiable - the setting is similar to policy gradient optimization in reinforcement learning. In principle, score function gradient estimators (such as REINFORCE [26]) could be used in this case; in our experiments, however, this approach leads to extremely low acceptance rates. This is because during initialization, the ratio g✓(x|x0)/g✓(x0|x) can be extremely low, which leads to low acceptance rates and trajectories that are not informative for training. While it might be possible to optimize directly using more sophisticated techniques from the RL literature, we introduce an alternative approach based on volume preserving dynamics. 4 4.2 Hamiltonian Monte Carlo and Volume Preserving Flow To gain some intuition to our method, we introduce Hamiltonian Monte Carlo (HMC) and volume preserving flow models [27]. HMC is a widely applicable MCMC method that introduces an auxiliary “velocity” variable v to g✓(x0|x). The proposal first draws v from p(v) (typically a factored Gaussian distribution) and then obtains (x0, v0) by simulating the dynamics (and inverting v at the end of the simulation) corresponding to the Hamiltonian H(x, v) = v>v/2 + U(x) (8) where x and v are iteratively updated using the leapfrog integrator (see [27]). The transition from (x, v) to (x0, v0) is deterministic, invertible and volume preserving, which means that g✓(x0, v0|x, v) = g✓(x, v|x0, v0) (9) MH acceptance (7) is computed using the distribution p(x, v) = pd(x)p(v), where the acceptance probability is p(x0, v0)/p(x, v) since g✓(x0, v0|x, v)/g✓(x, v|x0, v0) = 1. We can safely discard v0 after the transition since x and v are independent. Let us return to the case where the proposal is parametrized by a neural network; if we could satisfy Equation 9 then we could significantly improve the acceptance rate compared to the “REINFORCE” setting. Fortunately, we can design such an proposal by using a volume preserving flow model [14]. A flow model [14, 28–30] defines a generative model for x 2 Rn through a bijection f : h ! x, where h 2 Rn have the same number of dimensions as x with a fixed prior pH(h) (typically a factored Gaussian). In this form, pX(x) is tractable because pX(x) = pH(f −1(x)) ####det@f −1(x) @x #### −1 (10) and can be optimized by maximum likelihood. In the case of a volume preserving flow model f, the determinant of the Jacobian @f(h) @h is one. Such models can be constructed using additive coupling layers, which first partition the input into two parts, y and z, and then define a mapping from (y, z) to (y0, z0) as: y0 = y z0 = z + m(y) (11) where m(·) can be a complex function. By stacking multiple coupling layers the model becomes highly expressive. Moreover, once we have the forward transformation f, the backward transformation f −1 can be easily derived. This family of models are called Non-linear Independent Components Estimation (NICE)[14]. 4.3 A NICE Proposal HMC has two crucial components. One is the introduction of the auxiliary variable v, which prevents random walk behavior; the other is the symmetric proposal in Equation (9), which allows the MH step to only consider p(x, v). In particular, if we simulate the Hamiltonian dynamics (the deterministic part of the proposal) twice starting from any (x, v) (without MH or resampling v), we will always return to (x, v). Auxiliary variables can be easily integrated into neural network proposals. However, it is hard to obtain symmetric behavior. If our proposal is deterministic, then f✓(f✓(x, v)) = (x, v) should hold for all (x, v), a condition which is difficult to achieve 2. Therefore, we introduce a proposal which satisfies Equation (9) for any ✓, while preventing random walk in practice by resampling v after every MH step. Our proposal considers a NICE model f✓(x, v) with its inverse f −1 ✓ , where v ⇠p(v) is the auxiliary variable. We draw a sample x0 from the proposal g✓(x0, v0|x, v) using the following procedure: 1. Randomly sample v ⇠p(v) and u ⇠Uniform[0, 1]; 2. If u > 0.5, then (x0, v0) = f✓(x, v); 2The cycle consistency loss (as in CycleGAN [31]) introduces a regularization term for this condition; we added this to the REINFORCE objective but were not able to achieve satisfactory results. 5 f f −1 High “high” acceptance “low” acceptance U(x, v) Low U(x, v) p(x, v) Figure 4: Sampling process of A-NICE-MC. Each step, the proposal executes f✓or f −1 ✓. Outside the high probability regions f✓will guide x towards pd(x), while MH will tend to reject f −1 ✓ . Inside high probability regions both operations will have a reasonable probability of being accepted. 3. If u 0.5, then (x0, v0) = f −1 ✓ (x, v). We call this proposal a NICE proposal and introduce the following theorem. Theorem 1. For any (x, v) and (x0, v0) in their domain, a NICE proposal g✓satisfies g✓(x0, v0|x, v) = g✓(x, v|x0, v0) Proof. In Appendix C. 4.4 Training A NICE Proposal Given any NICE proposal with f✓, the MH acceptance step guarantees that pd is a stationary distribution, yet the ratio p(x0, v0)/p(x, v) can still lead to low acceptance rates unless ✓is carefully chosen. Intuitively, we would like to train our proposal g✓to produce samples that are likely under p(x, v). Although the proposal itself is non-differentiable w.r.t. x and v, we do not require score function gradient estimators to train it. In fact, if f✓is a bijection between samples in high probability regions, then f −1 ✓ is automatically also such a bijection. Therefore, we ignore f −1 ✓ during training and only train f✓(x, v) to reach the target distribution p(x, v) = pd(x)p(v). For pd(x), we use the MGAN objective in Equation (3); for p(v), we minimize the distance between the distribution for the generated v0 (tractable through Equation (10)) and the prior distribution p(v) (which is a factored Gaussian): min ✓ max D L(x; ✓, D) + γLd(p(v), p✓(v0)) (12) where L is the MGAN objective, Ld is an objective that measures the divergence between two distributions and γ is a parameter to balance between the two factors; in our experiments, we use KL divergence for Ld and γ = 1 3. Our transition operator includes a trained NICE proposal followed by a Metropolis-Hastings step, and we call the resulting Markov chain Adversarial NICE Monte Carlo (A-NICE-MC). The sampling process is illustrated in Figure 4. Intuitively, if (x, v) lies in a high probability region, then both f✓ and f −1 ✓ should propose a state in another high probability region. If (x, v) is in a low-probability probability region, then f✓would move it closer to the target, while f −1 ✓ does the opposite. However, the MH step will bias the process towards high probability regions, thereby suppressing the randomwalk behavior. 4.5 Bootstrap The main remaining challenge is that we do not have direct access to samples from pd in order to train f✓according to the adversarial objective in Equation (12), whereas in the case of Section 3, we have a dataset to get samples from the data distribution. In order to retrieve samples from pd and train our model, we use a bootstrap process [33] where the quality of samples used for adversarial training should increase over time. We obtain initial samples by running a (possibly) slow mixing operator T✓0 with stationary distribution pd starting from an arbitrary initial distribution ⇡0. We use these samples to train our model f✓i, and then use it to obtain new samples from our trained transition operator T✓i; by repeating the process we can obtain samples of better quality which should in turn lead to a better model. 3The results are not very sensitive to changes in γ; we also tried Maximum Mean Discrepancy (MMD, see [32] for details) and achieved similar results. 6 Figure 5: Left: Samples from a model with shortcut connections trained with ordinary discriminator. Right: Samples from the same model trained with a pairwise discriminator. Figure 6: Densities of ring, mog2, mog6 and ring5 (from left to right). 4.6 Reducing Autocorrelation by Pairwise Discriminator An important metric for evaluating MCMC algorithms is the effective sample size (ESS), which measures the number of “effective samples” we obtain from running the chain. As samples from MCMC methods are not i.i.d., to have higher ESS we would like the samples to be as independent as possible (low autocorrelation). In the case of training a NICE proposal, the objective in Equation (3) may lead to high autocorrelation even though the acceptance rate is reasonably high. This is because the coupling layer contains residual connections from the input to the output; as shown in Section 3.1, such models tend to learn an identity mapping and empirically they have high autocorrelation. We propose to use a pairwise discriminator to reduce autocorrelation and improve ESS. Instead of scoring one sample at a time, the discriminator scores two samples (x1, x2) at a time. For “real data” we draw two independent samples from our bootstrapped samples; for “fake data” we draw x2 ⇠T m ✓(·|x1) such that x1 is either drawn from the data distribution or from samples after running the chain for b steps, and x2 is the sample after running the chain for m steps, which is similar to the samples drawn in the original MGAN objective. The optimal solution would be match both distributions of x1 and x2 to the target distribution. Moreover, if x1 and x2 are correlated, then the discriminator should be able distinguish the “real” and “fake” pairs, so the model is forced to generate samples with little autocorrelation. More details are included in Appendix D. The pairwise discriminator is conceptually similar to the minibatch discrimination layer [34]; the difference is that we provide correlated samples as “fake” data, while [34] provides independent samples that might be similar. To demonstrate the effectiveness of the pairwise discriminator, we show an example for the image domain in Figure 5, where the same model with shortcut connections is trained with and without pairwise discrimination (details in Appendix E.1); it is clear from the variety in the samples that the pairwise discriminator significantly reduces autocorrelation. 5 Experiments Code for reproducing the experiments is available at https://github.com/ermongroup/a-nice-mc. To demonstrate the effectiveness of A-NICE-MC, we first compare its performance with HMC on several synthetic 2D energy functions: ring (a ring-shaped density), mog2 (a mixture of 2 Gaussians) mog6 (a mixture of 6 Gaussians), ring5 (a mixture of 5 distinct rings). The densities are illustrated in Figure 6 (Appendix E.2 has the analytic expressions). ring has a single connected component of high-probability regions and HMC performs well; mog2, mog6 and ring5 are selected to demonstrate cases where HMC fails to move across modes using gradient information. A-NICE-MC performs well in all the cases. We use the same hyperparameters for all the experiments (see Appendix E.4 for details). In particular, we consider f✓(x, v) with three coupling layers, which update v, x and v respectively. This is to ensure that both x and v could affect the updates to x0 and v0. How does A-NICE-MC perform? We evaluate and compare ESS and ESS per second (ESS/s) for both methods in Table 1. For ring, mog2, mog6, we report the smallest ESS of all the dimensions 7 Table 1: Performance of MCMC samplers as measured by Effective Sample Size (ESS). Higher is better (1000 maximum). Averaged over 5 runs under different initializations. See Appendix A for the ESS formulation, and Appendix E.3 for how we benchmark the running time of both methods. ESS A-NICE-MC HMC ring 1000.00 1000.00 mog2 355.39 1.00 mog6 320.03 1.00 ring5 155.57 0.43 ESS/s A-NICE-MC HMC ring 128205 121212 mog2 50409 78 mog6 40768 39 ring5 19325 29 (a) E[ p x2 1 + x2 2] (b) Std[ p x2 1 + x2 2] (c) HMC (d) A-NICE-MC Figure 7: (a-b) Mean absolute error for estimating the statistics in ring5 w.r.t. simulation length. Averaged over 100 chains. (c-d) Density plots for both methods. When the initial distribution is a Gaussian centered at the origin, HMC overestimates the densities of the rings towards the center. (as in [35]); for ring5, we report the ESS of the distance between the sample and the origin, which indicates mixing across different rings. In the four scenarios, HMC performed well only in ring; in cases where modes are distant from each other, there is little gradient information for HMC to move between modes. On the other hand, A-NICE-MC is able to freely move between the modes since the NICE proposal is parametrized by a flexible neural network. We use ring5 as an example to demonstrate the results. We assume ⇡0(x) = N(0, σ2I) as the initial distribution, and optimize σ through maximum likelihood. Then we run both methods, and use the resulting particles to estimate pd. As shown in Figures 7a and 7b, HMC fails and there is a large gap between true and estimated statistics. This also explains why the ESS is lower than 1 for HMC for ring5 in Table 1. Another reasonable measurement to consider is Gelman’s R hat diagnostic [36], which evaluates performance across multiple sampled chains. We evaluate this over the rings5 domain (where the statistics is the distance to the origin), using 32 chains with 5000 samples and 1000 burn-in steps for each sample. HMC gives a R hat value of 1.26, whereas A-NICE-MC gives a R hat value of 1.002 4. This suggest that even with 32 chains, HMC does not succeed at estimating the distribution reasonably well. Does training increase ESS? We show in Figure 8 that in all cases ESS increases with more training iterations and bootstrap rounds, which also indicates that using the pairwise discriminator is effective at reducing autocorrelation. Admittedly, training introduces an additional computational cost which HMC could utilize to obtain more samples initially (not taking parameter tuning into account), yet the initial cost can be amortized thanks to the improved ESS. For example, in the ring5 domain, we can reach an ESS of 121.54 in approximately 550 seconds (2500 iterations on 1 thread CPU, bootstrap included). If we then sample from the trained A-NICE-MC, it will catch up with HMC in less than 2 seconds. Next, we demonstrate the effectiveness of A-NICE-MC on Bayesian logistic regression, where the posterior has a single mode in a higher dimensional space, making HMC a strong candidate for the task. However, in order to achieve high ESS, HMC samplers typically use many leap frog steps and require gradients at every step, which is inefficient when rxU(x) is computationally expensive. A-NICE-MC only requires running f✓or f −1 ✓ once to obtain a proposal, which is much cheaper computationally. We consider three datasets - german (25 covariates, 1000 data points), heart (14 covariates, 532 data points) and australian (15 covariates, 690 data points) - and evaluate the lowest ESS across all covariates (following the settings in [35]), where we obtain 5000 samples after 1000 4For R hat values, the perfect value is 1, and 1.1-1.2 would be regarded as too high. 8 Figure 8: ESS with respect to the number of training iterations. Table 2: ESS and ESS per second for Bayesian logistic regression tasks. ESS A-NICE-MC HMC german 926.49 2178.00 heart 1251.16 5000.00 australian 1015.75 1345.82 ESS/s A-NICE-MC HMC german 1289.03 216.17 heart 3204.00 1005.03 australian 1857.37 289.11 burn-in samples. For HMC we use 40 leap frog steps and tune the step size for the best ESS possible. For A-NICE-MC we use the same hyperparameters for all experiments (details in Appendix E.5). Although HMC outperforms A-NICE-MC in terms of ESS, the NICE proposal is less expensive to compute than the HMC proposal by almost an order of magnitude, which leads to higher ESS per second (see Table 2). 6 Discussion To the best of our knowledge, this paper presents the first likelihood-free method to train a parametric MCMC operator with good mixing properties. The resulting Markov Chains can be used to target both empirical and analytic distributions. We showed that using our novel training objective we can leverage flexible neural networks and volume preserving flow models to obtain domain-specific transition kernels. These kernels significantly outperform traditional ones which are based on elegant yet very simple and general-purpose analytic formulas. Our hope is that these ideas will allow us to bridge the gap between MCMC and neural network function approximators, similarly to what “black-box techniques” did in the context of variational inference [1]. Combining the guarantees of MCMC and the expressiveness of neural networks unlocks the potential to perform fast and accurate inference in high-dimensional domains, such as Bayesian neural networks. This would likely require us to gather the initial samples through other methods, such as variational inference, since the chances for untrained proposals to “stumble upon” low energy regions is diminished by the curse of dimensionality. Therefore, it would be interesting to see whether we could bypass the bootstrap process and directly train on U(x) by leveraging the properties of flow models. Another promising future direction is to investigate proposals that can rapidly adapt to changes in the data. One use case is to infer the latent variable of a particular data point, as in variational autoencoders. We believe it should be possible to utilize meta-learning algorithms with data-dependent parametrized proposals. Acknowledgements This research was funded by Intel Corporation, TRI, FLI and NSF grants 1651565, 1522054, 1733686. The authors would like to thank Daniel Lévy for discussions on the NICE proposal proof, Yingzhen Li for suggestions on the training procedure and Aditya Grover for suggestions on the implementation. References [1] R. Ranganath, S. Gerrish, and D. Blei, “Black box variational inference,” in Artificial Intelligence and Statistics, pp. 814–822, 2014. [2] D. P. Kingma and M. Welling, “Auto-encoding variational bayes,” arXiv preprint arXiv:1312.6114, 2013. [3] D. J. Rezende, S. Mohamed, and D. Wierstra, “Stochastic backpropagation and approximate inference in deep generative models,” arXiv preprint arXiv:1401.4082, 2014. 9 [4] 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, pp. 2672–2680, 2014. [5] S. Mohamed and B. Lakshminarayanan, “Learning in implicit generative models,” arXiv preprint arXiv:1610.03483, 2016. [6] T. Salimans, D. P. Kingma, M. Welling, et al., “Markov chain monte carlo and variational inference: Bridging the gap.,” in ICML, vol. 37, pp. 1218–1226, 2015. [7] N. De Freitas, P. Højen-Sørensen, M. I. Jordan, and S. Russell, “Variational mcmc,” in Proceedings of the Seventeenth conference on Uncertainty in artificial intelligence, pp. 120–127, Morgan Kaufmann Publishers Inc., 2001. [8] J. Gorham and L. Mackey, “Measuring sample quality with stein’s method,” in Advances in Neural Information Processing Systems, pp. 226–234, 2015. [9] J. Gorham, A. B. Duncan, S. J. Vollmer, and L. Mackey, “Measuring sample quality with diffusions,” arXiv preprint arXiv:1611.06972, 2016. [10] J. Gorham and L. Mackey, “Measuring sample quality with kernels,” arXiv preprint arXiv:1703.01717, 2017. [11] S. Ermon, C. P. Gomes, A. Sabharwal, and B. Selman, “Designing fast absorbing markov chains.,” in AAAI, pp. 849–855, 2014. [12] N. Mahendran, Z. Wang, F. Hamze, and N. De Freitas, “Adaptive mcmc with bayesian optimization.,” in AISTATS, vol. 22, pp. 751–760, 2012. [13] S. Boyd, P. Diaconis, and L. Xiao, “Fastest mixing markov chain on a graph,” SIAM review, vol. 46, no. 4, pp. 667–689, 2004. [14] L. Dinh, D. Krueger, and Y. Bengio, “Nice: Non-linear independent components estimation,” arXiv preprint arXiv:1410.8516, 2014. [15] M. Arjovsky, S. Chintala, and L. Bottou, “Wasserstein gan,” arXiv preprint arXiv:1701.07875, 2017. [16] A. Radford, L. Metz, and S. Chintala, “Unsupervised representation learning with deep convolutional generative adversarial networks,” arXiv preprint arXiv:1511.06434, 2015. [17] I. Gulrajani, F. Ahmed, M. Arjovsky, V. Dumoulin, and A. Courville, “Improved training of wasserstein gans,” arXiv preprint arXiv:1704.00028, 2017. [18] Y. Bengio, E. Thibodeau-Laufer, G. Alain, and J. Yosinski, “Deep generative stochastic networks trainable by backprop,” 2014. [19] F. Bordes, S. Honari, and P. Vincent, “Learning to generate samples from noise through infusion training,” ICLR, 2017. [20] 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, pp. 770–778, 2016. [21] R. K. Srivastava, K. Greff, and J. Schmidhuber, “Highway networks,” arXiv preprint arXiv:1505.00387, 2015. [22] P. J. Green, “Reversible jump markov chain monte carlo computation and bayesian model determination,” Biometrika, pp. 711–732, 1995. [23] W. Jakob and S. Marschner, “Manifold exploration: a markov chain monte carlo technique for rendering scenes with difficult specular transport,” ACM Transactions on Graphics (TOG), vol. 31, no. 4, p. 58, 2012. 10 [24] D. P. Landau and K. Binder, A guide to Monte Carlo simulations in statistical physics. Cambridge university press, 2014. [25] W. K. Hastings, “Monte carlo sampling methods using markov chains and their applications,” Biometrika, vol. 57, no. 1, pp. 97–109, 1970. [26] R. J. Williams, “Simple statistical gradient-following algorithms for connectionist reinforcement learning,” Machine learning, vol. 8, no. 3-4, pp. 229–256, 1992. [27] R. M. Neal et al., “Mcmc using hamiltonian dynamics,” Handbook of Markov Chain Monte Carlo, vol. 2, pp. 113–162, 2011. [28] D. J. Rezende and S. Mohamed, “Variational inference with normalizing flows,” arXiv preprint arXiv:1505.05770, 2015. [29] D. P. Kingma, T. Salimans, and M. Welling, “Improving variational inference with inverse autoregressive flow,” arXiv preprint arXiv:1606.04934, 2016. [30] A. Grover, M. Dhar, and S. Ermon, “Flow-gan: Bridging implicit and prescribed learning in generative models,” arXiv preprint arXiv:1705.08868, 2017. [31] 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. [32] Y. Li, K. Swersky, and R. Zemel, “Generative moment matching networks,” in International Conference on Machine Learning, pp. 1718–1727, 2015. [33] B. Efron and R. J. Tibshirani, An introduction to the bootstrap. CRC press, 1994. [34] 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, pp. 2226– 2234, 2016. [35] M. Girolami and B. Calderhead, “Riemann manifold langevin and hamiltonian monte carlo methods,” Journal of the Royal Statistical Society: Series B (Statistical Methodology), vol. 73, no. 2, pp. 123–214, 2011. [36] S. P. Brooks and A. Gelman, “General methods for monitoring convergence of iterative simulations,” Journal of computational and graphical statistics, vol. 7, no. 4, pp. 434–455, 1998. [37] M. D. Hoffman and A. Gelman, “The no-u-turn sampler: adaptively setting path lengths in hamiltonian monte carlo.,” Journal of Machine Learning Research, vol. 15, no. 1, pp. 1593–1623, 2014. [38] 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. [39] D. Kingma and J. Ba, “Adam: A method for stochastic optimization,” arXiv preprint arXiv:1412.6980, 2014. 11
2017
95
7,237
Question Asking as Program Generation Anselm Rothe1 anselm@nyu.edu Brenden M. Lake1,2 brenden@nyu.edu Todd M. Gureckis1 todd.gureckis@nyu.edu 1Department of Psychology 2Center for Data Science New York University Abstract A hallmark of human intelligence is the ability to ask rich, creative, and revealing questions. Here we introduce a cognitive model capable of constructing humanlike questions. Our approach treats questions as formal programs that, when executed on the state of the world, output an answer. The model specifies a probability distribution over a complex, compositional space of programs, favoring concise programs that help the agent learn in the current context. We evaluate our approach by modeling the types of open-ended questions generated by humans who were attempting to learn about an ambiguous situation in a game. We find that our model predicts what questions people will ask, and can creatively produce novel questions that were not present in the training set. In addition, we compare a number of model variants, finding that both question informativeness and complexity are important for producing human-like questions. 1 Introduction In active machine learning, a learner is able to query an oracle in order to obtain information that is expected to improve performance. Theoretical and empirical results show that active learning can speed acquisition for a variety of learning tasks [see 21, for a review]. Although impressive, most work on active machine learning has focused on relatively simple types of information requests (most often a request for a supervised label). In contrast, humans often learn by asking far richer questions which more directly target the critical parameters in a learning task. A human child might ask “Do all dogs have long tails?” or “What is the difference between cats and dogs?” [2]. A long term goal of artificial intelligence (AI) is to develop algorithms with a similar capacity to learn by asking rich questions. Our premise is that we can make progress toward this goal by better understanding human question asking abilities in computational terms [cf. 8]. To that end, in this paper, we propose a new computational framework that explains how people construct rich and interesting queries within in a particular domain. A key insight is to model questions as programs that, when executed on the state of a possible world, output an answer. For example, a program corresponding to “Does John prefer coffee to tea?” would return True for all possible world states where this is the correct answer and False for all others. Other questions may return different types of answers. For example “How many sugars does John take in his coffee?” would return a number 0, 1, 2, etc. depending on the world state. Thinking of questions as syntactically well-formed programs recasts the problem of question asking as one of program synthesis. We show that this powerful formalism offers a new approach to modeling question asking in humans and may eventually enable more human-like question asking in machines. We evaluate our model using a data set containing natural language questions asked by human participants in an information-search game [19]. Given an ambiguous situation or context, our model can predict what questions human learners will ask by capturing constraints in how humans construct semantically meaningful questions. The method successfully predicts the frequencies of 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. human questions given a game context, and can also synthesize novel human-like questions that were not present in the training set. 2 Related work Contemporary active learning algorithms can query for labels or causal interventions [21], but they lack the representational capacity to consider a richer range of queries, including those expressed in natural language. AI dialog systems are designed to ask questions, yet these systems are still far from achieving human-like question asking. Goal-directed dialog systems [25, 1], applied to tasks such as booking a table at a restaurant, typically choose between a relatively small set of canned questions (e.g., “How can I help you?”, “What type of food are you looking for?”), with little genuine flexibility or creativity. Deep learning systems have also been developed for visual “20 questions” style tasks [22]; although these models can produce new questions, the questions typically take a stereotyped form (“Is it a person?”, “Is it a glove?” etc.). More open-ended question asking can be achieved by non-goal-driven systems trained on large amounts of natural language dialog, such as the recent progress demonstrated in [20]. However, these approaches cannot capture intentional, goal-directed forms of human question asking. Recent work has probed other aspects of question asking. The Visual Question Generation (VQG) data set [16] contains images paired with interesting, human-generated questions. For instance, an image of a car wreck might be paired with the question, “What caused the accident?” Deep neural networks, similar to those used for image captioning, are capable of producing these types of questions after extensive training [16, 23, 11]. However, they require large datasets of images paired with questions, whereas people can ask intelligent questions in a novel scenario with no (or very limited) practice, as shown in our task below. Moreover, human question asking is robust to changes in task and goals, while state-of-the-art neural networks do not generalize flexibly in these ways. 3 The question data set Our goal was to develop a model of context-sensitive, goal-directed question asking in humans, which falls outside the capabilities of the systems described above. We focused our analysis on a data set we collected in [19], which consists of 605 natural language questions asked by 40 human players to resolve an ambiguous game situation (similar to “Battleship”).1 Players were individually presented with a game board consisting of a 6×6 grid of tiles. The tiles were initially turned over but each could be flipped to reveal an underlying color. The player’s goal was to identify as quickly as possible the size, orientation, and position of “ships” (i.e., objects composed of multiple adjacent tiles of the same color) [7]. Every board had exactly three ships which were placed in nonoverlapping but otherwise random locations. The ships were identified by their color S = {Blue, Red, Purple}. All ships had a width of 1, a length of N = {2, 3, 4} and orientation O = {Horizontal, Vertical}. Any tile that did not overlap with a ship displayed a null “water” color (light gray) when flipped. After extensive instructions about the rules and purpose of the game and a number of practice rounds [see 19], on each of 18 target contexts players were presented with a partly revealed game board (similar to Figure 1B and 1C) that provided ambiguous information about the actual shape and location of the ships. They were then given the chance to ask a natural-language question about the configuration. The player’s goal was to use this question asking opportunity to gain as much information as possible about the hidden game board configuration. The only rules given to players about questions was that they must be answerable using one word (e.g., true/false, a number, a color, a coordinate like A1 or a row or column number) and no combination of questions was allowed. The questions were recorded via an HTML text box in which people typed what they wanted to ask. A good question for the context in Figure 1B is “Do the purple and the red ship touch?”, while “What is the color of tile A1?” is not helpful because it can be inferred from the revealed game board and the rules of the game (ship sizes, etc.) that the answer is “Water” (see Figure 3 for additional example questions). Each player completed 18 contexts where each presented a different underlying game board and partially revealed pattern. Since the usefulness of asking a question depends on the context, the data 1https://github.com/anselmrothe/question_dataset 2 A B C D E F 1 2 3 4 5 6 A B C D E F 1 2 3 4 5 6 !"#$%&! A B C D E F 1 2 3 4 5 6 Hidden gameboard a) b) c) Partially revealed gameboard Figure 1: The Battleship game used to obtain the question data set by Rothe et al. [19]. (A) The hidden positions of three ships S = {Blue, Red, Purple} on a game board that players sought to identify. (B) After observing the partly revealed board, players were allowed to ask a natural language question. (C) The partly revealed board in context 4. set consists of 605 question-context pairs ⟨q, c⟩, with 26 to 39 questions per context.2 The basic challenge for our active learning method is to predict which question q a human will ask from the given context c and the overall rules of the game. This is a particularly challenging data set to model because of the the subtle differences between contexts that determine if a question is potentially useful along with the open-ended nature of human question asking. 4 A probabilistic model of question generation Here we describe the components of our probabilistic model of question generation. Section 4.1 describes two key elements of our approach, compositionality and computability, as reflected in the choice to model questions as programs. Section 4.2 describes a grammar that defines the space of allowable questions/programs. Section 4.3 specifies a probabilistic generative model for sampling context-sensitive, relevant programs from this space. The remaining sections cover optimization, the program features, and alternative models (Sections 4.4-4.6). 4.1 Compositionality and computability The analysis of the data set [19] revealed that many of the questions in the data set share similar concepts organized in different ways. For example, the concept of ship size appeared in various ways across questions: • “How long is the blue ship?” • “Does the blue ship have 3 tiles?” • “Are there any ships with 4 tiles?” • “Is the blue ship less then 4 blocks?” • “Are all 3 ships the same size?” • “Does the red ship have more blocks than the blue ship?” As a result, the first key element of modeling question generation was to recognize the compositionality of these questions. In other words, there are conceptual building blocks (predicates like size(x) and plus(x,y)) that can be put together to create the meaning of other questions (plus(size(Red), size(Purple))). Combining meaningful parts to give meaning to larger expressions is a prominent approach in linguistics [10], and compositionality more generally has been an influential idea in cognitive science [4, 15, 14]. The second key element is the computability of questions. We propose that human questions are like programs that when executed on the state of a world output an answer. For example, a program that when executed looks up the number of blue tiles on a hypothesized or imagined Battleship game board and returns said number corresponds to the question “How long is the blue ship?”. In this way, programs can be used to evaluate the potential for useful information from a question by executing the program over a set of possible or likely worlds and preferring questions that are informative for identifying the true world state. This approach to modeling questions is closely 2Although each of the 40 players asked a question for each context, a small number of questions were excluded from the data set for being ambiguous or extremely difficult to address computationally [see 19]. 3 related to formalizing question meaning as a partition over possible worlds [6], a notion used in previous studies in linguistics [18] and psychology [9]. Machine systems for question answering have also fruitfully modeled questions as programs [24, 12], and computational work in cognitive science has modeled various kinds of concepts as programs [17, 5, 13]. An important contribution of our work here is that it tackles question asking and provides a method for generating meaningful questions/programs from scratch. 4.2 A grammar for producing questions To capture both compositionality and computability, we represent questions in a simple programming language, based on lambda calculus and LISP. Every unit of computation in that language is surrounded by parentheses, with the first element being a function and all following elements being arguments to that function (i.e., using prefix notation). For instance, the question “How long is the blue ship?” would be represented by the small program (size Blue). More examples will be discussed below. With this step we abstracted the question representation from the exact choice of words while maintaining its meaning. As such the questions can be thought of as being represented in a “language of thought” [3]. Programs in this language can be combined as in the example (> (size Red) (size Blue)), asking whether the red ship is larger than the blue ship. To compute an answer, first the inner parentheses are evaluated, each returning a number corresponding to the number of red or blue tiles on the game board, respectively. Then these numbers are used as arguments to the > function, which returns either True or False. A final property of interest is the generativity of questions, that is, the ability to construct novel expressions that are useful in a given context. To have a system that can generate expressions in this language we designed a grammar that is context-free with a few exceptions, inspired by [17]. The grammar consists of a set of rewrite rules, which are recursively applied to grow expressions. An expression that cannot be further grown (because no rewrite rules are applicable) is guaranteed to be an interpretable program in our language. To create a question, our grammar begins with an expression that contains the start symbol A and then rewrites the symbols in the expression by applying appropriate grammatical rules until no symbol can be rewritten. For example, by applying the rules A →N, N →(size S), and S →Red, we arrive at the expression (size Red). Table SI-1 (supplementary materials) shows the core rewrite rules of the grammar. This set of rules is sufficient to represent all 605 questions in the human data set. To enrich the expressiveness and conciseness of our language we added lambda expressions, mapping, and set operators (Table SI-2, supplementary material). Their use can be seen in the question “Are all ships the same size?”, which can be conveniently represented by (= (map (λ x (size x)) (set Blue Red Purple))). During evaluation, map sequentially assigns each element from the set to x in the λ-part and ultimately returns a vector of the three ship sizes. The three ship sizes are then compared by the = function. Of course, the same question could also be represented as (= (= (size Blue) (size Red)) (size Purple)). 4.3 Probabilistic generative model An artificial agent using our grammar is able to express a wide range of questions. To decide which question to ask, the agent needs a measure of question usefulness. This is because not all syntactically well-formed programs are informative or useful. For instance, the program (> (size Blue) (size Blue)) representing the question “Is the blue ship larger than itself?” is syntactically coherent. However, it is not a useful question to ask (and is unlikely to be asked by a human) because the answer will always be False (“no”), no matter the true size of the blue ship. We propose a probabilistic generative model that aims to predict which questions people will ask and which not. Parameters of the model can be fit to predict the frequency that humans ask particular questions in particular context in the data set by [19]. Formally, fitting the generative model is a problem of density estimation in the space of question-like programs, where the space is defined by the grammar. We define the probability of question x (i.e., the probability that question x is asked) 4 with a log-linear model. First, the energy of question x is the weighted sum of question features E(x) = θ1f1(x) + θ2f2(x) + ... + θKfK(x), (1) where θk is the weight of feature fk of question x. We will describe all features below. Model variants will differ in the features they use. Second, the energy is related to the probability by p(x; θ) = exp(−E(x)) P x∈X exp(−E(x)) = exp(−E(x)) Z , (2) where θ is the vector of feature weights, highlighting the fact that the probability is dependent on a parameterization of these weights, Z is the normalizing constant, and X is the set of all possible questions that can be generated by the grammar in Tables SI-1 and SI-2 (up to a limit on question length).3 The normalizing constant needs to be approximated since X is too large to enumerate. 4.4 Optimization The objective is to find feature weights that maximize the likelihood of asking the human-produced questions. Thus, we want to optimize arg max θ N X i=1 log p(d(i); θ), (3) where D = {d(1), ..., d(N)} are the questions (translated into programs) in the human data set. To optimize via gradient ascent, we need the gradient of the log-likelihood with respect to each θk, which is given by ∂log p(D; θ) ∂θk = N Ex∼D[fk(x)] −N Ex∼Pθ[fk(x)]. (4) The term Ex∼D[fk(x)] = 1 N PN i=1 fk(d(i)) is the expected (average) feature values given the empirical set of human questions. The term Ex∼Pθ[fk(x)] = P x∈X fk(x)p(x; θ) is the expected feature values given the model. Thus, when the gradient is zero, the model has perfectly matched the data in terms of the average values of the features. Computing the exact expected feature values from the model is intractable, since there is a very large number of possible questions (as with the normalizing constant in Equation 2). We use importance sampling to approximate this expectation. To create a proposal distribution, denoted as q(x), we use the question grammar as a probabilistic context free grammar with uniform distributions for choosing the re-write rules. The details of optimization are as follows. First, a large set of 150,000 questions is sampled in order to approximate the gradient at each step via importance sampling.4 Second, to run the procedure for a given model and training set, we ran 100,000 iterations of gradient ascent at a learning rate of 0.1. Last, for the purpose of evaluating the model (computing log-likelihood), the importance sampler is also used to approximate the normalizing constant in Eq. 2 via the estimator Z ≈Ex∼q[ p(x;θ) q(x) ]. 4.5 Question features We now turn to describe the question features we considered (cf. Equation 1), namely two features for informativeness, one for length, and four for the answer type. Informativeness. Perhaps the most important feature is a question’s informativeness, which we model through a combination of Bayesian belief updating and Expected Information Gain (EIG). To compute informativeness, our agent needs to represent several components: A belief about the current world state, a way to update its belief once it receives an answer, and a sense of all possible 3We define X to be the set of questions with 100 or fewer functions. 4We had to remove the rule L →(draw C) from the grammar and the corresponding 14 questions from the data set that asked for a demonstration of a colored tile. Although it is straightforward to represent those questions with this rule, the probabilistic nature of draw led to exponentially complex computations of the set of possible-world answers. 5 G G G GG G G G G G G G G GG G G G G GG G G G G G G GG G GG ρ = 0.51 G G G G G G G G G G G G G G GG G G G G G G G G ρ = 0.56 G GGGG G G G G G G G G GG G G GG G GG GG G G G G G G G G ρ = 0.58 G G G G G G G G G G G G GG G G G G G GG G G G G G G G G G ρ = 0.37 G G G G G G G G G G G G G G G G G G G G G G G G G GG G G G G ρ = 0.85 G G G G GG G GG G G G G G G G G G G G G G G G G G ρ = 0.47 G G G G G G G G GG G G G G G G GG G G G G G G G G GG G ρ = 0.85 G G G G G G G G G G G G G G G GG GG G G G G G G G G G G G G ρ = 0.69 G G G G G GG G G G G G G GG G GG G G G G G G G G G G GG G G G G G G GG ρ = 0.62 G G G G G G G G G G G G G G G G G GG G GG G G G G G G ρ = 0.8 G G G GG G G G G G G G G G G G G G G G G G G G G G G G G G G GG ρ = 0.75 G G G GG G G G G G G G G G G G G GG GG G G G G G GG G G G G G ρ = 0.82 G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G ρ = 0.47 G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G ρ = 0.8 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.6 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.45 context: 11 context: 12 context: 13 context: 14 context: 15 context: 16 context: 17 context: 18 context: 3 context: 4 context: 5 context: 6 context: 7 context: 8 context: 9 context: 10 −40 −20 −40 −20 −40 −20 −40 −20 −40 −20 −40 −20 −40 −20 −40 −20 0 5 10 15 0 5 10 15 Negative energy Empirical question frequency Figure 2: Out-of-sample model predictions regarding the frequency of asking a particular question. The y-axis shows the empirical question frequency, and x-axis shows the model’s energy for the question (Eq. 1, based on the full model). The rank correlation ρ is shown for each context. answers to the question.5 In the Battleship game, an agent must identify a single hypothesis h (i.e., a hidden game board configuration) in the space of possible configurations H (i.e., possible board games). The agent can ask a question x and receive the answer d, updating its hypothesis space by applying Bayes’ rule, p(h|d; x) ∝p(d|h; x)p(h). The prior p(h) is specified first by a uniform choice over the ship sizes, and second by a uniform choice over all possible configurations given those sizes. The likelihood p(d|h; x) ∝1 if d is a valid output of the question program x when executed on h, and zero otherwise. The Expected Information Gain (EIG) value of a question x is the expected reduction in uncertainty about the true hypothesis h, averaged across all possible answers Ax of the question EIG(x) = X d∈Ax p(d; x) h I[p(h)] −I[p(h|d; x)] i , (5) where I[·] is the Shannon entropy. Complete details about the Bayesian ideal observer follow the approach we used in [19]. Figure 3 shows the EIG scores for the top two human questions for selected contexts. In addition to feature fEIG(x) = EIG(x), we added a second feature fEIG=0(x), which is 1 if EIG is zero and 0 otherwise, to provide an offset to the linear EIG feature. Note that the EIG value of a question always depends on the game context. The remaining features described below are independent of the context. Complexity. Purely maximizing EIG often favors long and complicated programs (e.g., polynomial questions such as size(Red)+10*size(Blue)+100*size(Purple)+...). Although a machine would not have a problem with answering such questions, it poses a problem for a human answerer. Generally speaking, people prefer concise questions and the rather short questions in the data set reflect this. The probabilistic context free grammar provides a measure of complexity that favors shorter programs, and we use the log probability under the grammar fcomp(x) = −log q(x) as the complexity feature. Answer type. We added four features for the answer types Boolean, Number, Color, and Location. Each question program belongs to exactly one of these answer types (see Table SI-1). The type Orientation was subsumed in Boolean, with Horizontal as True and Vertical as False. This allows the model to capture differences in the base rates of question types (e.g., if people prefer true/false questions over other types). Relevance. Finally, we added one auxiliary feature to deal with the fact that the grammar can produce syntactically coherent programs that have no reference to the game board at all (thus are not really questions about the game; e.g., (+ 1 1)). The “filter” feature f∅(x) marks questions 5We assume here that the agent’s goal is to accurately identify the current world state. In a more general setting, the agent would require a cost function that defines the helpfulness of an answer as a reduced distance to the goal. 6 that refer to the Battleship game board with a value of 1 (see the b marker in Table SI-1) and 0 otherwise.6 4.6 Alternative models To evaluate which features are important for human-like question generation, we tested the full model that uses all features, as well as variants in which we respectively lesioned one key property. The information-agnostic model did not use fEIG(x) and fEIG=0(x) and thus ignored the informativeness of questions. The complexity-agnostic model ignored the complexity feature. The type-agnostic model ignored the answer type features. 5 Results and Discussion Table 1: Log likelihoods of model variants averaged across held out contexts. Model LL Full -1400.06 Information-agnostic -1464.65 Complexity-agnostic -22993.38 Type-agnostic -1419.26 The probabilistic model of question generation was evaluated in two main ways. First, it was tasked with predicting the distribution of questions people asked in novel scenarios, which we evaluate quantitatively. Second, it was tasked with generating genuinely novel questions that were not present in the data set, which we evaluate qualitatively. To make predictions, the different candidate models were fit to 15 contexts and asked to predict the remaining one (i.e., leave one out cross-validation).7 This results in 64 different model fits (i.e., 4 models × 16 fits). First, we verify that compositionality is an essential ingredient in an account of human question asking. For any given context, about 15% of the human questions did not appear in any of the other contexts. Any model that attempts to simply reuse/reweight past questions will be unable to account for this productivity (effectively achieving a log-likelihood of −∞), at least not without a much larger training set of questions. The grammar over programs provides one account of the productivity of the human behavior. Second, we compared different models on their ability to quantitatively predict the distribution of human questions. Table 1 summarizes the model predictions based on the log-likelihood of the questions asked in the held-out contexts. The full model – with learned features for informativeness, complexity, answer type, and relevance – provides the best account of the data. In each case, lesioning its key components resulted in lower quality predictions. The complexity-agnostic model performed far worse than the others, highlighting the important role of complexity (as opposed to pure informativeness) in understanding which questions people choose to ask. The full model also outperformed the information-agnostic and type-agnostic models, suggesting that people also optimize for information gain and prefer certain question types (e.g., true/false questions are very common). Because the log-likelihood values are approximate, we bootstrapped the estimate of the normalizing constant Z and compared the full model and each alternative. The full model’s loglikelihood advantage over the complexity-agnostic model held in 100% of the bootstrap samples, over the information-agnostic model in 81% of samples, and over type-agnostic model in 88%. Third, we considered the overall match between the best-fit model and the human question frequencies. Figure 2 shows the correlations between the energy values according to the held-out predictions of the full model (Eq. 1) and the frequencies of human questions (e.g., how often participants asked “What is the size of the red ship?” in a particular context). The results show very strong agreement for some contexts along with more modest alignment for others, with an average Spearman’s rank correlation coefficient of 0.64. In comparison, the information-agnostic model achieved 0.65, the complexity-agnostic model achieved -0.36, and the type-agnostic model achieved 0.55. One limitation is that the human data is sparse (many questions were only asked once), and thus correlations 6The features f∅(x) and fEIG=0(x) are not identical. Questions like (size Blue) do refer to the board but will have zero EIG if the size of the blue ship is already known. 7For computational reasons we had to drop contexts 1 and 2, which had especially large hypothesis spaces. However, we made sure that the grammar was designed based on the full set of contexts (i.e., it could express all questions in the human question data set). 7 are limited as a measure of fit. However, there is, surprisingly, no correlation at all between question generation frequency and EIG alone [19], again suggesting a key role of question complexity and the other features. Last, the model was tasked with generating novel, “human-like” questions that were not part of the human data set. Figure 3 shows five novel questions that were sampled from the model, across four different game contexts. Questions were produced by taking five weighted samples from the set of programs produced in Section 4.4 for approximate inference, with weights determined by their energy (Eq. 2). To ensure novelty, samples were rejected if they were equivalent to any human question in the training data set or to an already sampled question. Equivalence between any two questions was determined by the mutual information of their answer distributions (i.e., their partitions over possible hypotheses), and or if the programs differed only through their arguments (e.g. (size Blue) is equivalent to (size Red)). The generated questions in Figure 3 demonstrate that the model is capable of asking novel (and clever) human-like questions that are useful in their respective contexts. Interesting new questions that were not observed in the human data include “Are all the ships horizontal?” (Context 7), “What is the top left of all the ship tiles?” (Context 9), “Are blue and purple ships touching and red and purple not touching (or vice versa)?” (Context 9), and “What is the column of the top left of the tiles that have the color of the bottom right corner of the board?” (Context 15). The four contexts were selected to illustrate the creative range of the model, and the complete set of contexts is shown in the supplementary materials. 6 Conclusions People use question asking as a cognitive tool to gain information about the world. Although people ask rich and interesting questions, most active learning algorithms make only focused requests for supervised labels. Here were formalize computational aspects of the rich and productive way that people inquire about the world. Our central hypothesis is that active machine learning concepts can be generalized to operate over a complex, compositional space of programs that are evaluated over possible worlds. To that end, this project represents a step toward more capable active learning machines. There are also a number of limitations of our current approach. First, our system operates on semantic representations rather than on natural language text directly, although it is possible that such a system can interface with recent tools in computational linguistics to bridge this gap [e.g., 24]. Second, some aspects of our grammar are specific to the Battleship domain. It is often said that some knowledge is needed to ask a good question, but critics of our approach will point out that the model begins with substantial domain knowledge and special purpose structures. On the other hand, many aspects of our grammar are domain general rather than domain specific, including very general functions and programming constructs such as logical connectives, set operations, arithmetic, and mapping. To extend this approach to new domains, it is unclear exactly how much new knowledge engineering will be needed, and how much can be preserved from the current architecture. Future work will bring additional clarity as we extend our approach to different domains. From the perspective of computational cognitive science, our results show how people balance informativeness and complexity when producing semantically coherent questions. By formulating question asking as program generation, we provide the first predictive model to date of open-ended human question asking. Acknowledgments We thank Chris Barker, Sam Bowman, Noah Goodman, and Doug Markant for feedback and advice. This research was supported by NSF grant BCS-1255538, the John Templeton Foundation Varieties of Understanding project, a John S. McDonnell Foundation Scholar Award to TMG, and the MooreSloan Data Science Environment at NYU. 8 Figure 3: Novel questions generated by the probabilistic model. Across four contexts, five model questions are displayed, next to the two most informative human questions for comparison. Model questions were sampled such that they are not equivalent to any in the training set. The natural language translations of the question programs are provided for interpretation. Questions with lower energy are more likely according to the model. 9 References [1] A. Bordes and J. Weston. Learning End-to-End Goal-Oriented Dialog. arXiv preprint, 2016. [2] M. M. Chouinard. Children’s Questions: A Mechanism for Cognitive Development. Monographs of the Society of Research in Cognitive Development, 72(1):1–129, 2007. [3] J. A. Fodor. The Language of Thought. Harvard University Press, 1975. [4] J. A. Fodor and Z. W. Pylyshyn. Connectionism and cognitive architecture: A critical analysis. Cognition, 28:3–71, 1988. [5] N. D. Goodman, J. B. Tenenbaum, and T. Gerstenberg. Concepts in a probabilistic language of thought. In E. Margolis and S. Laurence, editors, Concepts: New Directions. MIT Press, Cambridge, MA, 2015. [6] J. Groenendijk and M. Stokhof. On the Semantics of Questions and the Pragmantics of Answers. PhD thesis, University of Amsterdam, 1984. [7] T. M. Gureckis and D. B. Markant. Active Learning Strategies in a Spatial Concept Learning Game. In Proceedings of the 31st Annual Conference of the Cognitive Science Society, 2009. [8] T. M. Gureckis and D. B. Markant. Self-Directed Learning: A Cognitive and Computational Perspective. Perspectives on Psychological Science, 7(5):464–481, 2012. [9] R. X. D. Hawkins, A. Stuhlmuller, J. Degen, and N. D. Goodman. Why do you ask? Good questions provoke informative answer. In Proceedings of the 37th Annual Conference of the Cognitive Science Society, 2015. [10] P. Jacobson. Compositional Semantics. Oxford University Press, 2014. [11] U. Jain, Z. Zhang, and A. Schwing. Creativity: Generating Diverse Questions using Variational Autoencoders. arXiv preprint, 2017. [12] J. Johnson, B. Hariharan, L. van der Maaten, J. Hoffman, L. Fei-fei, C. L. Zitnick, and R. Girshick. Inferring and Executing Programs for Visual Reasoning. In International Conference on Computer Vision, 2017. [13] B. M. Lake, R. Salakhutdinov, and J. B. Tenenbaum. Human-level concept learning through probabilistic program induction. Science, 350(6266):1332–1338, 2015. [14] B. M. Lake, T. D. Ullman, J. B. Tenenbaum, and S. J. Gershman. Building machines that learn and think like people. Behavioral and Brain Sciences, 2017. [15] G. F. Marcus. The Algebraic Mind: Integrating Connectionism and Cognitive Science. MIT Press, Cambridge, MA, 2003. [16] N. Mostafazadeh, I. Misra, J. Devlin, M. Mitchell, X. He, and L. Vanderwende. Generating Natural Questions About an Image. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, pages 1802–1813, 2016. [17] S. T. Piantadosi, J. B. Tenenbaum, and N. D. Goodman. Bootstrapping in a language of thought: A formal model of numerical concept learning. Cognition, 123(2):199–217, 2012. [18] C. Roberts. Information structure in discourse: Towards an integrated formal theory of pragmatics. Working Papers in Linguistics-Ohio State University Department of Linguistics, pages 91–136, 1996. [19] A. Rothe, B. M. Lake, and T. M. Gureckis. Asking and evaluating natural language questions. In A. Papafragou, D. Grodner, D. Mirman, and J. Trueswell, editors, Proceedings of the 38th Annual Conference of the Cognitive Science Society, Austin, TX, 2016. [20] 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 Proceedings of the Thirtieth AAAI Conference on Artificial Intelligence, 2016. [21] B. Settles. Active Learning. Morgan & Claypool Publishers, 2012. [22] F. Strub, d. V. Harm, J. Mary, B. Piot, A. Courville, and O. Pietquin. End-to-end optimization of goal-driven and visually grounded dialogue systems. In International Joint Conference on Artificial Intelligence (IJCAI), 2017. [23] A. K. Vijayakumar, M. Cogswell, R. R. Selvaraju, Q. Sun, S. Lee, D. Crandall, and D. Batra. Diverse Beam Search: Decoding Diverse Solutions from Neural Sequence Models. arXiv preprint, 2016. [24] Y. Wang, J. Berant, and P. Liang. Building a Semantic Parser Overnight. Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 1332–1342, 2015. [25] S. Young, M. Gaˇsi´c, B. Thomson, and J. D. Williams. POMDP-based statistical spoken dialog systems: A review. Proceedings of the IEEE, 101(5):1160–1179, 2013. 10
2017
96
7,238
Gradient Methods for Submodular Maximization Hamed Hassani ESE Department University of Pennsylvania Philadelphia, PA hassani@seas.upenn.edu Mahdi Soltanolkotabi EE Department University of Southern California Los Angeles, CA soltanol@usc.edu Amin Karbasi ECE Department Yale University New Haven, CT amin.karbasi@yale.edu Abstract In this paper, we study the problem of maximizing continuous submodular functions that naturally arise in many learning applications such as those involving utility functions in active learning and sensing, matrix approximations and network inference. Despite the apparent lack of convexity in such functions, we prove that stochastic projected gradient methods can provide strong approximation guarantees for maximizing continuous submodular functions with convex constraints. More specifically, we prove that for monotone continuous DR-submodular functions, all fixed points of projected gradient ascent provide a factor 1/2 approximation to the global maxima. We also study stochastic gradient methods and show that after O(1/ϵ2) iterations these methods reach solutions which achieve in expectation objective values exceeding ( OPT 2 −ϵ). An immediate application of our results is to maximize submodular functions that are defined stochastically, i.e. the submodular function is defined as an expectation over a family of submodular functions with an unknown distribution. We will show how stochastic gradient methods are naturally well-suited for this setting, leading to a factor 1/2 approximation when the function is monotone. In particular, it allows us to approximately maximize discrete, monotone submodular optimization problems via projected gradient ascent on a continuous relaxation, directly connecting the discrete and continuous domains. Finally, experiments on real data demonstrate that our projected gradient methods consistently achieve the best utility compared to other continuous baselines while remaining competitive in terms of computational effort. 1 Introduction Submodular set functions exhibit a natural diminishing returns property, resembling concave functions in continuous domains. At the same time, they can be minimized exactly in polynomial time (while can only be maximized approximately), which makes them similar to convex functions. They have found numerous applications in machine learning, including viral marketing [1], dictionary learning [2] network monitoring [3, 4], sensor placement [5], product recommendation [6, 7], document and corpus summarization [8] data summarization [9], crowd teaching [10, 11], and probabilistic models [12, 13]. However, submodularity is in general a property that goes beyond set functions and can be defined for continuous functions. In this paper, we consider the following stochastic continuous submodular optimization problem max x∈K F(x) ≐Eθ∼D[Fθ(x)], (1.1) where K is a bounded convex body, D is generally an unknown distribution, and Fθ’s are continuous submodular functions for every θ ∈D. We also use OPT ≜maxx∈K F(x) to denote the optimum value. We note that the function F(x) is itself also continuous submodular, as a non-negative combination of submodular functions are still submodular [14]. The formulation covers popular 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. instances of submodular optimization. For instance, when D puts all the probability mass on a single function, (1.1) reduces to deterministic continuous submodular optimization. Another common objective is the finite-sum continuous submodular optimization where D is uniformly distributed over m instances, i.e., F(x) ≐1 m ∑m θ=1 Fθ(x). A natural approach to solving problems of the form (1.1) is to use projected stochastic methods. As we shall see in Section 5, these local search heuristics are surprisingly effective. However, the reasons for this empirical success is completely unclear. The main challenge is that maximizing F corresponds to a nonconvex optimization problem (as the function F is not concave), and a priori it is not clear why gradient methods should yield a reliable solution. This leads us to the main challenge of this paper Do projected gradient methods lead to provably good solutions for continuous submodular maximization with general convex constraints? We answer the above question in the affirmative, proving that projected gradient methods produce a competitive solution with respect to the optimum. More specifically, given a general bounded convex body K and a continuous function F that is monotone, smooth, and (weakly) DR-submodular we show that • All stationary points of a DR-submodular function F over K provide a 1/2 approximation to the global maximum. Thus, projected gradient methods with sufficiently small step sizes (a.k.a. gradient flows) always lead to a solutions with 1/2 approximation guarantees. • Projected gradient ascent after O ( L2 ϵ ) iterations produces a solution with objective value larger than (OPT/2 −ϵ). When calculating the gradient is difficult but an unbiased estimate can be easily obtained, the stochastic projected gradient ascent in O ( L2 ϵ + σ2 ϵ2 ) iterations finds a solution with objective value exceeding (OPT/2 −ϵ). Here, L2 is the smoothness of the continuous submodular function measured in the ℓ2-norm, σ2 is the variance of the stochastic gradient with respect to the true gradient and OPT is the function value at the global optimum. • More generally, for weakly continuous DR-submodular functions with parameter γ (define in (2.6)) we prove the above results with γ2/(1 + γ2) approximation guarantee. Our result have some important implications. First, they show that projected gradient methods are an efficient way of maximizing the multilinear extension of (weakly) submodular set functions for any submodularity ratio γ (note that γ = 1 corresponds to submodular functions) [2]. Second, in contrast to conditional gradient methods for submodular maximization that require the initial point to be the origin [15, 16], projected gradient methods can start from any initial point in the constraint set K and still produce a competitive solution. Third, such conditional gradient methods, when applied to the stochastic setting (with a fixed batch size), perform poorly and can produce arbitrarily bad solutions when applied to continuous submodular functions (see [17, Appendix B] in the long version of this paper for an example and further discussion on why conditional gradient methods do not easily admit stochastic variants). In contrast, stochastic projected gradient methods are stable by design and provide a solution with an approximation ratio of at least 1/2 in expectation. Finally, our work provides a unifying approach for solving the stochastic submodular maximization problem [18] f(S) ≐Eθ∼D[fθ(S)], (1.2) where the functions fθ ∶2V →R+ are submodular set functions defined over the ground set V . Such objective functions naturally arise in many data summarization applications [19] and have been recently introduced and studied in [18]. Since D is unknown, problem (1.2) cannot be directly solved. Instead, [18] showed that in the case of coverage functions, it is possible to efficiently maximize f by lifting the problem to the continuous domain and using stochastic gradient methods on a continuous relaxation to reach a solution that is within a factor (1 −1/e) of the optimum. In contrast, our work provides a general recipe with 1/2 approximation guarantee for problem (1.2) in which fθ’s can be any monotone submodular function. 2 2 Continuous Submodular Maximization A set function f ∶2V →R+, defined on the ground set V , is called submodular if for all subsets A,B ⊆V , we have f(A) + f(B) ≥f(A ∩B) + f(A ∪B). Even though submodularity is mostly considered on discrete domains, the notion can be naturally extended to arbitrary lattices [20]. To this aim, let us consider a subset of Rn + of the form X = ∏n i=1 Xi where each Xi is a compact subset of R+. A function F ∶X →R+ is submodular [21] if for all (x,y) ∈X × X, we have F(x) + F(y) ≥F(x ∨y) + F(x ∧y), (2.1) where x∨y ≐max(x,y) (component-wise) and x∧y ≐min(x,y) (component-wise). A submodular function is monotone if for any x,y ∈X obeying x ≤y, we have F(x) ≤F(y) (here, by x ≤y we mean that every element of x is less than that of y). Like set functions, we can define submodularity in an equivalent way, reminiscent of diminishing returns, as follows [14]: the function F is submodular if for any x ∈X, any two distinct basis vectors ei,ej ∈Rn, and any two non-negative real numbers zi,zj ∈R+ obeying xi + zi ∈Xi and xj + zj ∈Xj we have F(x + ziei) + F(x + zjej) ≥F(x) + F(x + ziei + zjej). (2.2) Clearly, the above definition includes submodularity over a set (by restricting Xi’s to {0,1}) or over an integer lattice (by restricting Xi’s to Z+) as special cases. However, in the remainder of this paper we consider continuous submodular functions defined on product of sub-intervals of R+. We note that when twice differentiable, F is submodular if and only if all cross-second-derivatives are non-positive [14], i.e., ∀i ≠j,∀x ∈X, ∂2F(x) ∂xi∂xj ≤0. (2.3) The above expression makes it clear that continuous submodular functions are not convex nor concave in general as concavity (convexity) implies that ∇2F ⪯0 (resp.▽2F ⪰0). Indeed, we can have functions that are both submodular and convex/concave. For instance, for a concave function g and non-negative weights λi ≥0, the function F(x) = g(∑n i=1 λixi) is submodular and concave. Trivially, affine functions are submodular, concave, and convex. A proper subclass of submodular functions are called DR-submodular [16, 22] if for any x,y ∈X obeying x ≤y, any standard basis vector ei ∈Rn, and any non-negative number z ∈R+ obeying zei + x ∈X and zei + y ∈X, we have F(zei + x) −F(x) ≥F(zei + y) −F(y). (2.4) One can easily verify that for a differentiable DR-submodular functions the gradient is an antitone mapping, i.e., for all x,y ∈X such that x ≤y we have ∇F(x) ≥∇F(y) [16]. When twice differentiable, DR-submodularity is equivalent to ∀i & j,∀x ∈X, ∂2F(x) ∂xi∂xj ≤0. (2.5) The above twice differentiable functions are sometimes called smooth submodular functions in the literature [23]. However, in this paper, we say a differentiable submodular function F is L-smooth w.r.t a norm ∥⋅∥(and its dual norm ∥⋅∥∗) if for all x,y ∈X we have ∥∇F(x) −∇F(x)∥∗≤L∥x −y∥. Here, ∥⋅∥∗is the dual norm of ∥⋅∥defined as ∥g∥∗= supx∈Rn∶∥x∥≤1 gT x. When the function is smooth w.r.t the ℓ2-norm we use L2 (note that the ℓ2 norm is self-dual). We say that a function is weakly DR-submodular with parameter γ if γ = inf x,y∈X x≤y inf i∈[n] [∇F(x)]i [∇F(y)]i . (2.6) See [24] for related definitions. Clearly, for a differentiable DR-submodular function we have γ = 1. An important example of a DR-submodular function is the multilinear extension [15] F ∶[0,1]n →R of a discrete submodular function f, namely, F(x) = ∑ S⊆V ∏ i∈S xi ∏ j/∈S (1 −xj)f(S). 3 We note that for set functions, DR-submodularity (i.e., Eq. 2.4) and submodularity (i.e., Eq. 2.1) are equivalent. However, this is not true for the general submodular functions defined on integer lattices or product of sub-intervals [16, 22]. The focus of this paper is on continuous submodular maximization defined in Problem (1.1). More specifically, we assume that K ⊂X is a a general bounded convex set (not necessarily down-closed as considered in [16]) with diameter R. Moreover, we consider Fθ’s to be monotone (weakly) DR-submodular functions with parameter γ. 3 Background and Related Work Submodular set functions [25, 20] originated in combinatorial optimization and operations research, but they have recently attracted significant interest in machine learning. Even though they are usually considered over discrete domains, their optimization is inherently related to continuous optimization methods. In particular, Lovasz [26] showed that the Lovasz extension is convex if and only if the corresponding set function is submodular. Moreover, minimizing a submodular set-function is equivalent to minimizing the Lovasz extension.1 This idea has been recently extended to minimization of strict continuous submodular functions (i.e., cross-order derivatives in (2.3) are strictly negative) [14]. Similarly, approximate submodular maximization is linked to a different continuous extension known as multilinear extension [28]. Multilinear extension (which is an example of DR-submodular functions studied in this paper) is not concave nor convex in general. However, a variant of conditional gradient method, called continuous greedy, can be used to approximately maximize them. Recently, Chekuri et al [23] proposed an interesting multiplicative weight update algorithm that achieves (1 −1/e −ϵ) approximation guarantee after ˜O(n2/ϵ2) steps for twice differentiable monotone DRsubmodular functions (they are also called smooth submodular functions) subject to a polytope constraint. Similarly, Bian et al [16] proved that a conditional gradient method, similar to the continuous greedy algorithm, achieves (1−1/e−ϵ) approximation guarantee after O(L2/ϵ) iterations for maximizing a monotone DR-submodular functions subject to special convex constraints called down-closed convex bodies. A few remarks are in order. First, the proposed conditional gradient methods cannot handle the general stochastic setting we consider in Problem (1.1) (in fact, projection is the key). Second, there is no near-optimality guarantee if conditional gradient methods do not start from the origin. More precisely, for the continuous greedy algorithm it is necessary to start from the 0 vector (to be able to remain in the convex constraint set at each iteration). Furthermore, the 0 vector must be a feasible point of the constraint set. Otherwise, the iterates of the algorithm may fall out of the convex constraint set leading to an infeasible final solution. Third, due to the starting point requirement, they can only handle special convex constraints, called down-closed. And finally, the dependency on L2 is very subomptimal as it can be as large as the dimension n (e.g., for the multilinear extensions of some submodular set functions, see [17, Appendix B] in the long version of this paper). Our work resolves all of these issues by showing that projected gradient methods can also approximately maximize monotone DR-submodular functions subject to general convex constraints, albeit, with a lower 1/2 approximation guarantee. Generalization of submodular set functions has lately received a lot of attention. For instance, a line of recent work considered DR-submodular function maximization over an integer lattice [29, 30, 22]. Interestingly, Ene and Nguyen [31] provided an efficient reduction from an integer-lattice DRsubmodular to a submodular set function, thus suggesting a simple way to solve integer-lattice DR-submodular maximization. Note that such reductions cannot be applied to the optimization problem (1.1) as expressing general convex body constraints may require solving a continuous optimization problem. 4 Algorithms and Main Results In this section we discuss our algorithms together with the corresponding theoretical guarantees. In what follows, we assume that F is a weakly DR-submodular function with parameter γ. 1The idea of using stochastic methods for submodular minimization has recently been used in [27]. 4 4.1 Characterizing the quality of stationary points We begin with the definition of a stationary point. Definition 4.1 A vector x ∈K is called a stationary point of a function F ∶X →R+ over the set K ⊂X if maxy∈K⟨∇F(x),y −x⟩≤0. Stationary points are of interest because they characterize the fixed points of the Gradient Ascent (GA) method. Furthermore, (projected) gradient ascent with a sufficiently small step size is known to converge to a stationary point for smooth functions [32]. To gain some intuition regarding this connection, let us consider the GA procedure. Roughly speaking, at any iteration t of the GA procedure, the value of F increases (to the first order) by ⟨∇F(xt),xt+1 −xt⟩. Hence, the progress at time t is at most maxy∈K⟨∇F(xt),y−xt⟩. If at any time t we have maxy∈K⟨∇F(xt),y−xt⟩≤0, then the GA procedure will not make any progress and it will be stuck once it falls into a stationary point. The next natural question is how small can the value of F be at a stationary point compared to the global maximum? The following lemma relates the value of F at a stationary point to OPT. Theorem 4.2 Let F ∶X →R+ be monotone and weakly DR-submodular with parameter γ and assume K ⊆X is a convex set. Then, (i) If x is a stationary point of F in K, then F(x) ≥ γ2 1+γ2 OPT. (ii) Furthermore, if F is L-smooth, gradient ascent with a step size smaller than 1/L will converge to a stationary point. The theorem above guarantees that all fixed points of the GA method yield a solution whose function value is at least γ2 1+γ2 OPT. Thus, all fixed point of GA provide a factor γ2 1+γ2 approximation ratio. The particular case of γ = 1, i.e., when F is DR-submodular, asserts that at any stationary point F is at least OPT/2. This lower bound is in fact tight. In the long version of this paper (in particular [17, Appendix A]) we provide a simple instance of a differentiable DR-Submodular function that attains OPT/2 at a stationary point that is also a local maximum. We would like to note that our result on the quality of stationary points (i.e., first part of Theorem 4.2 above) can be viewed as a simple extension of the results in [33]. In particular, the special case of γ = 1 follows directly from [28, Lemma 3.2]. See the long version of this paper [17, Section 7] for how this lemma is used in our proofs. However, we note that the main focus of this paper is whether such a stationary point can be found efficiently using stochastic schemes that do not require exact evaluations of gradients. This is the subject of the next section. 4.2 (Stochastic) gradient methods We now discuss our first algorithmic approach. For simplicity we focus our exposition on the DR submodular case, i.e., γ = 1, and discuss how this extends to the more general case in the long version of this paper ([17, Section 7]). A simple approach to maximizing DR submodular functions is to use the (projected) Gradient Ascent (GA) method. Starting from an initial estimate x1 ∈K obeying the constraints, GA iteratively applies the following update xt+1 = PK (xt + µt∇F(xt)). (4.1) Here, µt is the learning rate and PK(v) denotes the Euclidean projection of v onto the set K. However, in many problems of practical interest we do not have direct access to the gradient of F. In these cases it is natural to use a stochastic estimate of the gradient in lieu of the actual gradient. This leads to the Stochastic Gradient Method (SGM). Starting from an initial estimate x0 ∈K obeying the constraints, SGM iteratively applies the following updates xt+1 = PK (xt + µtgt). (4.2) Specifically, at every iteration t, the current iterate xt is updated by adding µtgt, where gt is an unbiased estimate of the gradient ∇F(xt) and µt is the learning rate. The result is then projected onto the set K. We note that when gt = ∇F(xt), i.e., when there is no randomness in the updates, then 5 Algorithm 1 (Stochastic) Gradient Method for Maximizing F(x) over a convex set K Parameters: Integer T > 0 and scalars ηt > 0, t ∈[T] Initialize: x1 ∈K for t = 1 to T do yt+1 ←xt + ηtgt, where gt is a random vector s.t. E[gt∣xt] = ∇F(xt) xt+1 = arg minx∈K ∣∣x −yt+1∣∣2 end for Pick τ uniformly at random from {1,2,...,T}. Output xτ the SGM updates (4.2) reduce to the GA updates (4.1). We detail the SGM method in Algorithm 1. As we shall see in our experiments detained in Section 5, the SGM method is surprisingly effective for maximizing monotone DR-submodular functions. However, the reasons for this empirical success was previously unclear. The main challenge is that maximizing F corresponds to a nonconvex optimization problem (as the function F is not concave), and a priori it is not clear why gradient methods should yield a competitive ratio. Thus, studying gradient methods for such nonconvex problems poses new challenges: Do (stochastic) gradient methods converge to a stationary point? The next theorem addresses some of these challenges. To be able to state this theorem let us recall the standard definition of smoothness. We say that a continuously differentiable function F is L-smooth (in Euclidean norm) if the gradient ∇F is L-Lipschitz, that is ∥∇F(x) −∇F(y)∥ℓ2 ≤L∥x −y∥ℓ2 . We also defined the diameter (in Euclidean norm) as R2 = supx,y∈K 1 2 ∥x −y∥2 ℓ2. We now have all the elements in place to state our first theorem. Theorem 4.3 (Stochastic Gradient Method) Let us assume that F is L-smooth w.r.t. the Euclidean norm ∥⋅∥ℓ2, monotone and DR-submodular. Furthermore, assume that we have access to a stochastic oracle gt obeying E[gt] = ∇F(xt) and E[∥gt −∇F(xt)∥2 ℓ2 ] ≤σ2. We run stochastic gradient updates of the form (4.2) with µt = 1 L+ σ R √ t. Let τ be a random variable taking values in {1,2,...,T} with equal probability. Then, E[F(xτ)] ≥OPT 2 −(R2L + OPT 2T + Rσ √ T ). (4.3) Remark 4.4 We would like to note that if we pick τ to be a random variable taking values in {2,...,T −1} with probability 1 (T −1) and 1 and T each with probability 1 2(T −1) then E[F(xτ)] ≥OPT 2 −(R2L 2T + Rσ √ T ). The above results roughly state that T = O ( R2L ϵ + R2σ2 ϵ2 ) iterations of the stochastic gradient method from any initial point, yields a solution whose objective value is at least OPT 2 −ϵ. Stated differently, T = O ( R2L ϵ + R2σ2 ϵ2 ) iterations of the stochastic gradient method provides in expectation a value that exceeds OPT 2 −ϵ approximation ratio for DR-submodular maximization. As explained in Section 4.1, it is not possible to go beyond the factor 1/2 approximation ratio using gradient ascent from an arbitrary initialization. An important aspect of the above result is that it only requires an unbiased estimate of the gradient. This flexibility is crucial for many DR-submodular maximization problems (see, (1.1)) as in many cases calculating the function F and its derivative is not feasible. However, it is possible to provide a good un-biased estimator for these quantities. 6 We would like to point out that our results are similar in nature to known results about stochastic methods for convex optimization. Indeed, this result interpolates between the 1 √ T for stochastic smooth optimization, and the 1/T for deterministic smooth optimization. The special case of σ = 0 which corresponds to Gradient Ascent deserves particular attention. In this case, and under the assumptions of Theorem 4.3, it is possible to show that F(xT ) ≥OPT 2 −R2L T , without the need for a randomized choice of τ ∈[T]. Finally, we would like to note that while the first term in (4.3) decreases as 1/T, the pre-factor L could be rather large in many applications. For instance, this quantity may depend on the dimension of the input n (see [17, Appendix C] in the extended version of this paper). Thus, the number of iterations for reaching a desirable accuracy may be very large. Such a large computational load causes (stochastic) gradient methods infeasible in some application domains. It is possible to overcome this deficiency by using stochastic mirror methods (see [17, Section 4.3] in the extended version of this paper). 5 Experiments In our experiments, we consider a movie recommendation application [19] consisting of N users and n movies. Each user i has a user-specific utility function fi for evaluating sets of movies. The goal is to find a set of k movies such that in expectation over users’ preferences it provides the highest utility, i.e., max∣S∣≤k f(S), where f(S) ≐Ei∼D[fi(S)]. This is an instance of the stochastic submodular maximization problem defined in (1.2). We consider a setting that consists of N users and consider the empirical objective function 1 N ∑N j=1 fi. In other words, the distribution D is assumed to be uniform on the integers between 1 and N. We can then run the (discrete) greedy algorithm on the empirical objective function to find a good set of size k. However, as N is a large number, the greedy algorithm will require a high computational complexity. Another way of solving this problem is to evaluate the multilinear extension Fi of any sampled function fi and solve the problem in the continuous domain as follows. Let F(x) = Ei∼D[Fi(x)] for x ∈[0,1]n and define the constraint set Pk = {x ∈[0,1]m ∶∑n i=1 xi ≤k}. The discrete and continuous optimization formulations lead to the same optimal value [15]: max S∶∣S∣≤k f(S) = max x∈Pk F(x). Therefore, by running the stochastic versions of projected gradient methods, we can find a solution in the continuous domain that is at least 1/2 approximation to the optimal value. By rounding that fractional solution (for instance via randomized Pipage rounding [15]) we obtain a set whose utility is at least 1/2 of the optimum solution set of size k. We note that randomized Pipage rounding does not need access to the value of f. We also remark that projection onto Pk can be done very efficiently in O(n) time (see [18, 34, 35]). Therefore, such an approach easily scales to big data scenarios where the size of the data set (e.g. number of users) or the number of items n (e.g. number of movies) are very large. In our experiments, we consider the following baselines: (i) Stochastic Gradient Ascent (SG): We use the step size µt = c/ √ t and mini-batch size B. The details for computing an unbiased estimator for the gradient of F are given in [17, Appendix D] of the extended version of this paper. (ii) Frank-Wolfe (FW) variant of [16]: We use T to denote the total number of iterations and B to denote mini-batch sizes (we further let α = 1,δ = 0, see Algorithm 1 in [16] for more details). (iii) Batch-mode Greedy (Greedy): We run the vanilla greedy algorithm (in the discrete domain) in the following way. At each round of the algorithm (for selecting a new element), B random users are picked and the function f is estimated by the average over the B selected users. To run the experiments we use the MovieLens data set. It consists of 1 million ratings (from 1 to 5) by N = 6041 users for n = 4000 movies. Let ri,j denote the rating of user i for movie j (if such a rating does not exist we assign ri,j to 0). In our experiments, we consider two well motivated objective functions. The first one is called “facility location" where the valuation function by user i is defined 7 10 20 30 40 50 k 4 6 8 SG(B = 20) Greedy(B = 100) Greedy(B = 1000) FW(B = 20) FW(B = 100) objective value (a) Concave Over Modular 0 200 400 600 800 1000 T (number of iterations) 4.8 5.0 5.2 5.4 5.6 SG(B = 20, c = 1) Greedy SG(B = 20, c = 10) objective value (b) Concave Over Modular 10 20 30 40 50 k 3.75 4.00 4.25 4.50 4.75 5.00 SG(B = 20) Greedy(B = 100) Greedy(B = 1000) FW(B = 20) FW(B = 100) objective value (c) Facility Location 0.0 0.2 0.4 0.6 0.8 number of function computations ⇥108 4.65 4.70 4.75 4.80 SG(B = 20, c = 1) SG(B = 20, c = 2) Greedy objective value (d) Facility Location Figure 1: (a) shows the performance of the algorithms w.r.t. the cardinality constraint k for the concave over modular objective. Each of the continuous algorithms (i.e., SG and FW) run for T = 2000 iterations. (b) shows the performance of the SG algorithm versus the number of iterations for fixed k = 20 for the concave over modular objective. The green dashed line indicates the value obtained by Greedy (with B = 1000). Recall that the step size of SG is c/ √ t. (c) shows the performance of the algorithms w.r.t. the cardinality constraint k for the facility location objective function. Each of the continuous algorithms (SG and FW) run for T = 2000 iterations. (d) shows the performance of different algorithms versus the number of simple function computations (i.e. the number of fi’s evaluated during the algorithm) for the facility location objective function. For the greedy algorithm, larger number of function computations corresponds to a larger batch size. For SG larger time corresponds to larger iterations. as f(S,i) = maxj∈S ri,j. In words, the way user i evaluates a set S is by picking the highest rated movie in S. Thus, the objective function is equal to ffac(S) = 1 N N ∑ i=1 max j∈S ri,j. In our second experiment, we consider a different user-specific valuation function which is a concave function composed with a modular function, i.e., f(S,i) = (∑j∈S ri,j)1/2. Again, by considering the uniform distribution over the set of users, we obtain fcon(S) = 1 N N ∑ i=1 ( ∑ j∈S ri,j) 1/2 . Note that the multilinear extensions of f1 and f2 are neither concave nor convex. Figure 1 depicts the performance of different algorithms for the two proposed objective functions. As Figures 1a and 1c show, the FW algorithm needs a much higher mini-batch size to be comparable 8 in performance to our stochastic gradient methods. Note that a smaller batch size leads to less computational effort (using the same value for B and T, the computational complexity of FW and SGA is almost the same). Figure 1b shows that after a few hundred iterations SG with B = 20 obtains almost the same utility as the Greedy method with a large batch size (B = 1000). Finally, Figure 1d shows the performance of the algorithms with respect to the number of times the single functions (fi’s) are evaluated. This further shows that gradient based methods have comparable complexity w.r.t. the Greedy algorithm in the discrete domain. 6 Conclusion In this paper we studied gradient methods for submodular maximization. Despite the lack of convexity of the objective function we demonstrated that local search heuristics are effective at finding approximately optimal solutions. In particular, we showed that all fixed point of projected gradient ascent provide a factor 1/2 approximation to the global maxima. We also demonstrated that stochastic gradient and mirror methods achieve an objective value of OPT/2 −ϵ, in O( 1 ϵ2 ) iterations. We further demonstrated the effectiveness of our methods with experiments on real data. While in this paper we have focused on convex constraints, our framework may allow non-convex constraints as well. For instance it may be possible to combine our framework with recent results in [36, 37, 38] to deal with general nonconvex constraints. Furthermore, in some cases projection onto the constraint set may be computationally intensive or even intractable but calculating an approximate projection may be possible with significantly less effort. One of the advantages of gradient descentbased proofs is that they continue to work even when some perturbations are introduced in the updates. Therefore, we believe that our framework can deal with approximate projections and we hope to pursue this in future work. Acknowledgments This work was done while the authors were visiting the Simon’s Institute for the Theory of Computing. A. K. is supported by DARPA YFA D16AP00046. The authors would like to thank Jeff Bilmes, Volkan Cevher, Chandra Chekuri, Maryam Fazel, Stefanie Jegelka, Mohammad-Reza Karimi, Andreas Krause, Mario Lucic, and Andrea Montanari for helpful discussions. 9 References [1] D. Kempe, J. Kleinberg, and E. Tardos. Maximizing the spread of influence through a social network. In KDD, 2003. [2] A. Das and D. Kempe. Submodular meets spectral: Greedy algorithms for subset selection, sparse approximation and dictionary selection. ICML, 2011. [3] J. Leskovec, A. Krause, C. Guestrin, C. Faloutsos, J. Van Briesen, and N. Glance. Cost-effective outbreak detection in networks. In KDD, 2007. [4] R. M. Gomez, J. Leskovec, and A. Krause. Inferring networks of diffusion and influence. In Proceedings of KDD, 2010. [5] C. Guestrin, A. Krause, and A. P. Singh. Near-optimal sensor placements in gaussian processes. In ICML, 2005. [6] K. El-Arini, G. Veda, D. Shahaf, and C. Guestrin. Turning down the noise in the blogosphere. In KDD, 2009. [7] B. Mirzasoleiman, A. Badanidiyuru, and A. Karbasi. Fast constrained submodular maximization: Personalized data summarization. In ICML, 2016. [8] H. Lin and J. Bilmes. A class of submodular functions for document summarization. In Proceedings of Annual Meeting of the Association for Computational Linguistics: Human Language Technologies, 2011. [9] B. Mirzasoleiman, A. Karbasi, R. Sarkar, and A. Krause. Distributed submodular maximization: Identifying representative elements in massive data. In NIPS, 2013. [10] A. Singla, I. Bogunovic, G. Bartok, A. Karbasi, and A. Krause. Near-optimally teaching the crowd to classify. In ICML, 2014. [11] B. Kim, O. Koyejo, and R. Khanna. Examples are not enough, learn to criticize! criticism for interpretability. In NIPS, 2016. [12] J. Djolonga and A. Krause. From map to marginals: Variational inference in bayesian submodular models. In NIPS, 2014. [13] R. Iyer and J. Bilmes. Submodular point processes with applications to machine learning. In Artificial Intelligence and Statistics, 2015. [14] F. Bach. Submodular functions: from discrete to continous domains. arXiv preprint arXiv:1511.00394, 2015. [15] G. Calinescu, C. Chekuri, M. Pal, and J. Vondrak. Maximizing a submodular set function subject to a matroid constraint. SIAM Journal on Computing, 2011. [16] A. Bian, B. Mirzasoleiman, J. M. Buhmann, and A. Krause. Guaranteed non-convex optimization: Submodular maximization over continuous domains. arXiv preprint arXiv:1606.05615, 2016. [17] H. Hassani, M. Soltanolkotabi, and A. Karbasi. Gradient methods for submodular maximization. arXiv preprint arXiv:1708.03949, 2017. [18] M. Karimi, M. Lucic, H. Hassani, and A. Krasue. stochastic submodular maximization: The case for coverage functions. 2017. [19] S. A. Stan, M. Zadimoghaddam, A. Krasue, and A. Karbasi. Probabilistic submodular maximization in sub-linear time. ICML, 2017. [20] S. Fujishige. Submodular functions and optimization, volume 58. Annals of Discrete Mathematics, North Holland, Amsterdam, 2nd edition, 2005. [21] L. A. Wolsey. An analysis of the greedy algorithm for the submodular set covering problem. Combinatorica, 2(4):385–393, 1982. [22] T. Soma and Y. Yoshida. A generalization of submodular cover via the diminishing return property on the integer lattice. In NIPS, 2015. 10 [23] C. Chekuri, T. S. Jayram, and J. Vondrak. On multiplicative weight updates for concave and submodular function maximization. In Proceedings of the 2015 Conference on Innovations in Theoretical Computer Science, pages 201–210. ACM, 2015. [24] R. Eghbali and M. Fazel. Designing smoothing functions for improved worst-case competitive ratio in online optimization. In Advances in Neural Information Processing Systems, pages 3287–3295, 2016. [25] J. Edmonds. Matroids and the greedy algorithm. Mathematical programming, 1(1):127–136, 1971. [26] László Lovász. Submodular functions and convexity. In Mathematical Programming The State of the Art, pages 235–257. Springer, 1983. [27] D. Chakrabarty, Y. T. Lee, Sidford A., and S. C. W. Wong. Subquadratic submodular function minimization. In STOC, 2017. [28] C. Chekuri, J. Vondrák, and R.s Zenklusen. Submodular function maximization via the multilinear relaxation and contention resolution schemes. In Proceedings of the 43rd ACM Symposium on Theory of Computing (STOC), 2011. [29] T. Soma, N. Kakimura, K. Inaba, and K. Kawarabayashi. Optimal budget allocation: Theoretical guarantee and efficient algorithm. In ICML, 2014. [30] C. Gottschalk and B. Peis. Submodular function maximization on the bounded integer lattice. In International Workshop on Approximation and Online Algorithms, 2015. [31] A. Ene and H. L. Nguyen. A reduction for optimizing lattice submodular functions with diminishing returns. arXiv preprint arXiv:1606.08362, 2016. [32] Yurii Nesterov. Introductory lectures on convex optimization: A basic course, volume 87. Springer Science & Business Media, 2013. [33] J. Vondrak, C. Chekuri, and R. Zenklusen. Submodular function maximization via the multilinear relaxation and contention resolution schemes. In Proceedings of the forty-third annual ACM symposium on Theory of computing, pages 783–792. ACM, 2011. [34] P. Brucker. An O(n) algorithm for quadratic knapsack problems. Operations Research Letters, 3(3):163– 166, 1984. [35] P. M. Pardalos and N. Kovoor. An algorithm for a singly constrained class of quadratic programs subject to upper and lower bounds. Mathematical Programming, 46(1):321–328, 1990. [36] S. Oymak, B. Recht, and M. Soltanolkotabi. Sharp time–data tradeoffs for linear inverse problems. arXiv preprint arXiv:1507.04793, 2015. [37] M. Soltanolkotabi. Structured signal recovery from quadratic measurements: Breaking sample complexity barriers via nonconvex optimization. arXiv preprint arXiv:1702.06175, 2017. [38] M. Soltanolkotabi. Learning ReLUs via gradient descent. arXiv preprint arXiv:1705.04591, 2017. 11
2017
97
7,239
Recycling Privileged Learning and Distribution Matching for Fairness Novi Quadrianto∗ Predictive Analytics Lab (PAL) University of Sussex Brighton, United Kingdom n.quadrianto@sussex.ac.uk Viktoriia Sharmanska Department of Computing Imperial College London London, United Kingdom sharmanska.v@gmail.com Abstract Equipping machine learning models with ethical and legal constraints is a serious issue; without this, the future of machine learning is at risk. This paper takes a step forward in this direction and focuses on ensuring machine learning models deliver fair decisions. In legal scholarships, the notion of fairness itself is evolving and multi-faceted. We set an overarching goal to develop a unified machine learning framework that is able to handle any definitions of fairness, their combinations, and also new definitions that might be stipulated in the future. To achieve our goal, we recycle two well-established machine learning techniques, privileged learning and distribution matching, and harmonize them for satisfying multi-faceted fairness definitions. We consider protected characteristics such as race and gender as privileged information that is available at training but not at test time; this accelerates model training and delivers fairness through unawareness. Further, we cast demographic parity, equalized odds, and equality of opportunity as a classical two-sample problem of conditional distributions, which can be solved in a general form by using distance measures in Hilbert Space. We show several existing models are special cases of ours. Finally, we advocate returning the Pareto frontier of multi-objective minimization of error and unfairness in predictions. This will facilitate decision makers to select an operating point and to be accountable for it. 1 Introduction Machine learning technologies have permeated everyday life and it is common nowadays that an automated system makes decisions for/about us, such as who is going to get bank credit. As more decisions in employment, housing, and credit become automated, there is a pressing need for addressing ethical and legal aspects, including fairness, accountability, transparency, privacy, and confidentiality, posed by those machine learning technologies [1, 2]. This paper focuses on enforcing fairness in the decisions made by machine learning models. A decision is fair if [3, 4, 5]: i) it is not based on a protected characteristic [6] such as gender, marital status, or age (fair treatment), ii) it does not disproportionately benefit or hurt individuals sharing a certain value of their protected characteristic (fair impact), and iii) given the target outcomes, it enforces equal discrepancies between decisions and target outcomes across groups of individuals based on their protected characteristic (fair supervised performance). The above three fairness definitions have been studied before, and several machine learning frameworks for addressing each one or a combination of them are available. We first note that one could ensure fair treatment by simply ignoring protected characteristic features, i.e. fairness through unawareness. However this poses a risk of unfairness by proxy as there are ways of predicting ∗Also with National Research University Higher School of Economics, Moscow, Russia. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. protected characteristic features from other features [7, 8]. Existing models guard against unfairness by proxy by enforcing fair impact or fair supervised performance constraints in addition to the fair treatment constraint. An example of the fair impact constraint is the 80% rule (see e.g. [3, 9, 10]) in which positive decisions must be in favour of group B individuals at least 80% as often as in favour of group A individuals for the case of a binary protected characteristic and a binary decision. Another example of the fair impact constraint is a demographic parity in which positive decisions of group B individuals must be at the same rate as positive decisions of group A individuals (see e.g. [11] and earlier works [12, 13, 14]). In contrast to the fair impact that only concerns about decisions of an automated system, the fair supervised performance takes into account, when enforcing fairness, the discrepancy between decisions (predictions) and target outcomes, which is compatible to the standard supervised learning setting. Kleinberg et al. [15] show that fair impact and fair supervised performance are indeed mutually exclusive measures of fairness. Examples of the fair supervised performance constraint are equality of opportunity [4] in which the true positive rates (false negative rates) across groups must match, and equalized odds [4] in which both the true positive rates and false positive rates must match. Hardt et al. [4] enforce equality of opportunity or equalized odds by post-processing the soft-outputs of an unfair classifier. The post-processing step consists of learning a different threshold for a different group of individuals. The utilization of an unfair classifier as a building block of the model is deliberate as the main goal of supervised machine learning models is to perform prediction tasks for future data as accurately as possible. Suppose the target outcome is correlated with the protected characteristic, Hardt et al.’s model will be able to learn the ideal predictor, which is not unfair as it represents the target outcome [4]. However, Hardt et al.’s model needs to access the value of the protected characteristic for future data. Situations where the protected characteristic is unavailable due to confidentiality or is prohibited to be accessed due to the fair treatment law requirement will make the model futile [5]. Recent work of Zafar et al. [5] propose de-correlation constraints between supervised performance, e.g. true positive rate, and protected characteristics as a way to achieve fair supervised performance. Zafar et al.’s model, however, will not be able to learn the ideal predictor when the target outcome is indeed correlated with a protected characteristic. This paper combines the benefits of Hardt et al.’s model [4] in its ability to learn the ideal predictor and of Zafar et al.’s model [5] in not requiring the availability of protected characteristic for future data at prediction time. To achieve this, we will be building upon recent advances in the use of privileged information for training machine learning models [16, 17, 18, 19]. Privileged information refers to features that can be used at training time but will not be available for future data at prediction time. We propose to consider protected characteristics such as race, gender, or marital status as privileged information. The privileged learning framework is remarkably suitable for incorporating fairness, as it learns the ideal predictor and does not require protected characteristics for future data. Therefore, this paper recycles the overlooked privileged learning framework, which is designed for accelerating learning and improving prediction performance, for building a fair classification model. Enforcing fairness using the privileged learning framework alone, however, might increase the risk of unfairness by proxy. Our proposed model guards against this by explicitly adding fair impact and/or fair supervised performance constraints into the privileged learning model. We recycle a distribution matching measure for fairness. This measure can be instantiated for both fair impact (e.g. demographic parity) and fair supervised performance (e.g. equalized odds and equality of opportunity) constraints. Matching a distribution between function outputs (decisions) across different groups will deliver fair impact, and matching a distribution between errors (discrepancies between decisions and target outcomes) across different groups will deliver fair supervised performance. We further show several existing methods are special cases of ours. 2 Related Work There is much work on the topic of fairness in the machine learning context in addition to those that have been embedded in the introduction. One line of research can be described in terms of learning fair models by modifying feature representations of the data (e.g. [20, 10, 21]), class label annotations ([22]), or even the data itself ([23]). Another line of research is to develop classifier regularizers that penalize unfairness (e.g. [13, 14, 24, 11, 5]). Our method falls into this second line of research. It has also been emphasized that fair models could enforce group fairness definitions (covered in the introduction) as well as individual fairness definitions. Dwork et al. and Joseph et al. [25, 26] define 2 an individual fairness as a non-preferential treatment towards an individual A if this individual is not as qualified as another individual B; this is a continuous analog of fairness through unawareness [23]. On privileged learning Vapnik et al. [16] introduce privileged learning in the context of Support Vector Machines (SVM) and use the privileged features to predict values of the slack variables. It was shown that this procedure can provably reduce the amount of data needed for learning an optimal hyperplane [16, 27, 19]. Additional features for training a classifier that will not necessarily be available at prediction time, privileged information, are widespread. As an example, features from 3D cameras and laser scanners are slow to acquire and expensive to store but have the potential to boost the predictive capability of a trained 2D system. Many variants of privileged learning methods and settings have been proposed such as, structured prediction [28], margin transfer [17], and Bayesian privileged learning [18, 29]. Privileged learning has also been shown [30] to be intimately related to Hinton et al.’s knowledge distillation [31] and Bucila et al.’s [32] model compression in which a complex model is learnt and is then replicated by a simpler model. On distribution matching Distribution matching has been explored in the context of domain adaptation (e.g. [33, 34]), transduction learning (e.g. [35]), and recently in privileged learning [36], among others. The empirical Maximum Mean Discrepancy (MMD) [37] is commonly used as the nonparametric metric that captures discrepancy between two distributions. In the domain adaptation setting, Pan et al. [38] use the MMD metric to project data from target and related source domain into a common subspace such that the difference between the distributions of source and target domain data is reduced. A similar idea has been explored in the context of deep neural networks by Zhang et al. [34], where they use the MMD metric to match both the distribution of the features and the distribution of the labels given features in the source and target domains. In the transduction setting, Quadrianto et al. [35] propose to minimize the mismatch between the distribution of function outputs on the training data and on the target test data. Recently, Sharmanska et al. [36] devise a cross-dataset transfer learning method by matching the distribution of classifier errors across datasets. 3 The Fairness Model In this section, we will formalize the setup of a supervised binary classification task subject to fairness constraints. Assume that we are given a set of N training examples, represented by feature vectors X = {x1, . . . , xN} ⊂X = Rd, their label annotation, Y = {y1, . . . , yN} ∈Y = {+1, −1}, and protected characteristic information also in the form of feature vectors, Z = {z1, . . . , zN} ⊂Z, where zn encodes the protected characteristics of sample xn. The task of interest is to infer a predictor f for the label ynew of an un-seen instance xnew, given Y , X and Z. However, f cannot use the protected characteristic Z at decision (prediction) time, as it will constitute an unfair treatment. The availability of protected characteristic at training time can be used to enforce fair impact and/or fair supervised performance constraints. We first describe how to deliver fair treatment via privileged learning. We then detail distribution matching viewpoint of fair impact and fair supervised performance. Frameworks of privileged learning and distribution matching are suitable for protected characteristics with binary/multi-class/continuous values. In this paper, however, we focus on a single protected characteristic admitting binary values as in existing work (e.g. [20, 4, 5]). 3.1 Fairness through Unawareness: Privileged Learning In the privileged learning setting [16], we are given training triplets (x1, x⋆ 1, y1), . . . , (xN, x⋆ N, yN) where (xn, yn) ⊂X × Y is the standard training input-output pair and x⋆ n ∈X ⋆is additional information about a training instance xn. This additional (privileged) information is only available during training. In our earlier illustrative example in the related work, xn is for example a colour feature from a 2D image while x⋆ n is a feature from 3D cameras and laser scanners. There is no direct limitation on the form of privileged information, i.e. it could be yet another feature representation like shape features from the 2D image, or a completely different modality like 3D cameras in addition to the 2D image, that is specific for each training instance. The goal of privileged learning is to use x⋆ n to accelerate the learning process of inferring an optimal (ideal) predictor in the data space X, i.e. f : X →Y. The difference between accelerated and non-accelerated methods is in the rate of convergence to the optimal predictor, e.g. 1/N cf.1/ √ N for margin-based classifiers [16, 19]. From the description above, it is apparent that both privileged learning model and fairness model aim to use data, privileged feature x⋆ n and protected characteristic zn respectively, that are available at 3 training time only. We propose to recycle privileged learning model for achieving fairness through unawareness by taking protected characteristics as privileged information. For a single binary protected characteristic zn, x⋆ n is formed by concatenating xn and zn. This is because privileged information has to be instance specific and richer than xn alone, and this is not the case when only a single binary protected characteristic is used. By using privileged learning framework, the predictor f is unaware of protected characteristic zn as this information is not used as an input to the predictor. Instead, zn, together with xn, is used to distinguish between easy-to-classify and difficult-to-classify data instances and subsequently to use this knowledge to accelerate the learning process of a predictor f [16, 17]. Easiness and hardness can be defined, for example, based on the distance of data instance to the decision boundary (margin) [16, 17, 19] or based on the steepness of the logistic likelihood function [18]. Our specific choice of easiness and hardness definition is detailed in Section 3.3. A direct advantage of approaching fairness from the privileged lens is the learning acceleration can be used to limit the performance degradation of the fair model as it now has to trade-off two goals: good prediction performance and respecting fairness constraints. An obvious disadvantage is an increased risk of unfairness by proxy as knowledge of easy-to-classify and difficult-to-classify data instances is based on protected characteristics. The next section describes a way to alleviate this based on a distribution matching principle. 3.2 Demographic Parity, Equalized Odds, Equality of opportunity, and Beyond: Matching Conditional Distributions We have the following definitions for several fairness criteria [25, 4, 5]: Definition A Demographic parity (fair impact): A binary decision model is fair if its decision {+1, −1} are independent of the protected characteristic z ∈{0, 1}. A decision ˆf satisfies this definition if P(sign( ˆf(x)) = +1|z = 0) = P(sign( ˆf(x)) = +1|z = 1). Definition B Equalized odds (fair supervised performance): A binary decision model is fair if its decisions {+1, −1} are conditionally independent of the protected characteristic z ∈{0, 1} given the target outcome y. A decision ˆf satisfies this definition if P(sign( ˆf(x)) = +1|z = 0, y) = P(sign( ˆf(x)) = +1|z = 1, y), for y ∈{+1, −1}. For the target outcome y = +1, the definition above requires that ˆf has equal true positive rates across two different values of protected characteristic. It requires ˆf to have equal false positive rates for the target outcome y = −1. Definition C Equality of opportunity (fair supervised performance): A binary decision model is fair if its decisions {+1, −1} are conditionally independent of the protected characteristic z ∈{0, 1} given the positive target outcome y. A decision ˆf satisfies this definition if P(sign( ˆf(x)) = +1|z = 0, y = +1) = P(sign( ˆf(x)) = +1|z = 1, y = +1). Equality of opportunity only constrains equal true positive rates across the two demographics. All three fairness criteria rely on the definition that data across the two demographics should exhibit similar behaviour, i.e. matching positive predictions, matching true positive rates, and matching false positive rates. A natural pathway to inject these into any learning model is to use a distribution matching framework. This matching assumption is well founded if we assume that both data Xz=0 = {xz=0 1 , . . . , xz=0 Nz=0} ⊂X and another data Xz=1 = {xz=1 1 , . . . , xz=1 Nz=1} ⊂X are drawn independently and identically distributed from the same distribution p(x) on a domain X. It therefore follows that for any function (or set of functions) f the distribution of f(x) where x ∼p(x) should also behave in the same way across the two demographics. We know that this is not automatically true if we get to choose f after seeing Xz=0 and Xz=1. In order to allow us to draw on a rich body of literature for comparing distributions, we cast the goal of enforcing distributional similarity across two demographics as a two-sample problem. 3.2.1 Distribution matching First, we denote the applications of our predictor ˆf : X →R to data having protected characteristic value zero by ˆf(XZ=0) := { ˆf(xz=0 1 ), . . . , ˆf(xz=0 Nz=0)}, likewise by ˆf(XZ=1) := 4 { ˆf(xz=1 1 ), . . . , ˆf(xz=1 Nz=1)} for value one. For enforcing the demographic parity criterion, we can enforce the closeness between the distributions of ˆf(x). We can achieve this by minimizing: D( ˆf(XZ=0), ˆf(XZ=1)), the distance between the two distributions ˆf(XZ=0) and ˆf(XZ=1). (1) For enforcing the equalized odds criterion, we need to minimize both D(I[Y = +1] ˆf(XZ=0), I[Y = +1] ˆf(XZ=1)) and D(I[Y = −1] ˆf(XZ=0), I[Y = −1] ˆf(XZ=1)). (2) We make use of Iverson’s bracket notation: I[P] = 1 when condition P is true and 0 otherwise. The first will match true positive rates (and also false negative rates) across the two demographics and the latter will match false positive rates (and also true negative rates). For enforcing equality of opportunity, we just need to minimize D(I[Y = +1] ˆf(XZ=0), I[Y = +1] ˆf(XZ=1)). (3) To go beyond true positive rates and false positive rates, Zafar et al. [5] raise the potential of removing unfairness by enforcing equal misclassification rates, false discovery rates, and false omission rates across two demographics. False discovery and false omission rates, however, with their fairness model are difficult to encode. In the distribution matching sense, those can be easily enforced by minimizing D(1 −Y ˆf(XZ=0), 1 −Y ˆf(XZ=1)), (4) D(I[Y = +1] max(0, −ˆf(XZ=0)), I[Y = +1] max(0, −ˆf(XZ=1))), and (5) D(I[Y = −1] max(0, ˆf(XZ=0)), I[Y = −1] max(0, ˆf(XZ=1))) (6) for misclassification, false omission, and false discovery rates, respectively. Maximum mean discrepancy To avoid a parametric assumption on the distance estimate between distributions, we use the Maximum Mean Discrepancy (MMD) criterion [37], a non-parametric distance estimate. Denote by H a Reproducing Kernel Hilbert Space with kernel k defined on X. In this case one can show [37] that whenever k is characteristic (or universal), the map µ :p →µ[p] := Ex∼p(x)[k( ˆf(x), ·)] with associated distance MMD2(p, p′) := ∥µ[p] −µ[p′]∥2 characterizes a distribution uniquely. Examples of characteristic kernels [39] are Gaussian RBF, Laplacian and B2n+1-splines. With a this choice of kernel functions, the MMD criterion matches infinitely many moments in the Reproducing Kernel Hilbert Space (RKHS). We use an unbiased linear-time estimate of MMD as follows [37, Lemma 14]: \ MMD2 = 1 N PN i k( ˆf(x2i−1 z=0 ), ˆf(x2i z=0)) −k( ˆf(x2i−1 z=0 ), ˆf(x2i z=1)) −k( ˆf(x2i z=0), ˆf(x2i−1 z=1 )) + k( ˆf(x2i−1 z=1 ), ˆf(x2i z=1)), with N := ⌊min(Nz=1, Nz=0)⌋. 3.2.2 Special cases Before discussing a specific composition of privileged learning and distribution matching to achieve fairness, we consider a number of special cases of matching constraint to show that many of existing methods use this basic idea. Mean matching for demographic parity Zemel et al. [20] balance the mapping from data to one of C latent prototypes across the two demographics by imposing the following constraint: 1 Nz=0 PNz=0 n=1 ˆf(xz=0 n ; c) = 1 Nz=1 PNz=1 n=1 ˆf(xz=1 n ; c); ∀c = 1, . . . , C, where ˆf(xz=0 n ) is a softmax function with C prototypes. Assuming a linear kernel k on this constraint is equivalent to requiring that for each c µ[ ˆf(xz=0 n ; c)] = 1 Nz=0 Nz=0 X n=1 D ˆf(xz=0 n ; c), · E = 1 Nz=1 Nz=1 X n=1 D ˆf(xz=1 n ; c), · E = µ[ ˆf(xz=1 n ; c)]. Mean matching for equalized odds and equality of opportunity To ensure equal false positive rates across the two demographics, Zafar et al. [5] add the following constraint to the training objective 5 of a linear classifier ˆf(x) = ⟨w, x⟩: PNz=0 n=1 min(0, I[yn = −1] ˆf(xz=0 n )) = PNz=1 n=1 min(0, I[yn = −1] ˆf(xz=1 n )). Again, assuming a linear kernel k on this constraint is equivalent to requiring that µ[min(0, I[yn = −1] ˆf(xz=0 n ))] = 1 Nz=0 Nz=0 X n=1 D min(0, I[yn = −1] ˆf(xz=0 n )), · E = 1 Nz=1 Nz=1 X n=1 D min(0, I[yn = −1] ˆf(xz=1 n )), · E = µ[min(0, I[yn = −1] ˆf(xz=1 n ))]. The min(·) function ensures that we only match false positive rates as without it both false positive and true negative rates will be matched. Relying on means for matching both false positive and true negative is not sufficient as the underlying distributions are multi-modal; it motivates the need for distribution matching. 3.3 Privileged learning with fairness constraints Here we describe the proposed model that recycles two established frameworks, privileged learning and distribution matching, and subsequently harmonizes them for addressing fair treatment, fair impact, fair supervised performance and beyond in a unified fashion. We use SVM∆+ [19], an SVM-based classification method for privileged learning, as a building block. SVM∆+ modifies the required distance of data instance to the decision boundary based on easiness/hardness of that data instance in the privileged space X ⋆, a space that contains protected characteristic Z. Easiness/hardness is reflected in the negative of the confidence, −yn(⟨w⋆, x⋆ n⟩+ b⋆) where w⋆and b⋆are some parameters; the higher this value, the harder this data instance to be classified correctly even in the rich privileged space. Injecting the distribution matching constraint, the final Distribution Matching+ (DM+) optimization problem is now: minimize w∈Rd,b∈R w⋆∈Rd⋆,b⋆∈R 1/2 ∥w∥2 ℓ2 | {z } regularisation on model without protected characteristic +1/2γ ∥w⋆∥2 ℓ2 | {z } regularisation on model with protected characteristic +C∆ N X n=1 max (0, −yn[⟨w⋆, x⋆ n⟩+ b⋆]) | {z } hinge loss on model with protected characteristic + + C N X n=1 max (0, 1 −yn[⟨w⋆, x⋆ n⟩+ b⋆] −yn[⟨w, xn⟩+ b]) | {z } hinge loss on model without protected characteristic but with margin dependent on protected characteristic (7a) subject to \ MMD2(pz=0, pz=1) ≤ϵ, | {z } constraint for removing unfairness by proxy (7b) where C, ∆, γ and an upper-bound ϵ are hyper-parameters. Terms pz=0 and pz=1 are distributions over appropriately defined fairness variables across the two demographics, e.g. ˆf(XZ=0) and ˆf(XZ=1) with ˆf(·) = ⟨w, ·⟩+ b for demographic parity and I[Y = +1] ˆf(XZ=0) and I[Y = +1] ˆf(XZ=1) for equality of opportunity. We have the following observations of the knowledge transfer from the privileged space to the space X without protected characteristic (refer to the last term in (7a)): • Very large positive value of the negative of the confidence in the space that includes protected characteristic, −yn[⟨w⋆, x⋆ n⟩+ b⋆] >> 0 means xn, without protected characteristic, is expected to be a hard-to-classify instance therefore its margin distance to the decision boundary is increased. • Very large negative value of the negative of the confidence in the space that includes protected characteristic, −yn[⟨w⋆, x⋆ n⟩+ b⋆] << 0 means xn, without protected characteristic, is expected to be an easy-to-classify instance therefore its margin distance to the decision boundary is reduced. The formulation in (7) is a multi-objective optimization with three competing goals: minimizing empirical error (hinge loss), minimizing model complexity (ℓ2 regularisation), and minimizing prediction discrepancy across the two demographics (MMD). Each goal corresponds to a different optimal solution and we have to accept a compromise in the goals. While solving a single-objective optimization implies to search for a single best solution, a collection of solutions at which no goal can be improved without damaging one of the others (Pareto frontier) [40] is sought when solving a multi-objective optimization. 6 Multi-objective optimization We first note that the MMD fairness criteria will introduce nonconvexity to our optimization problem. For a non-convex multi-objective optimization, the Pareto frontier may have non-convex portions. However, any Pareto optimal solution of a multi-objective optimization can be obtained by solving the constraint problem for an upper bound ϵ (as in (7b)) regardless of the non-convexity of the Pareto frontier [40]. Alternatively, the Convex Concave Procedure (CCP) [41], can be used to find an approximate solution of the problem in (7) by solving a succession of convex programs. CCP has been used in several other algorithms enforcing fair impact and fair supervised performance to deal with non-convexity of the objective function (e.g. [24, 5]). However, it was noted in [35] that for an objective function that has an additive structure as in our DM+ model, it is better to use the non-convex objective directly. 4 Experiments We experiment with two datasets: The ProPublica COMPAS dataset and the Adult income dataset. ProPublica COMPAS (Correctional Offender Management Profiling for Alternative Sanctions) has a total of 5,278 data instances, each with 5 features (e.g., count of prior offences, charge for which the person was arrested, race). The binary target outcome is whether or not the defendant recidivated within two years. For this dataset, we follow the setting in [5] and consider race, which is binarized as either black or white, as a protected characteristic. We use 4, 222 instances for training and 1, 056 instances for test. The Adult dataset has a total of 45, 222 data instances, each with 14 features (e.g., gender, educational level, number of work hours per week). The binary target outcome is whether or not income is larger than 50K dollars. For this dataset, we follow [20] and consider gender as a binary protected characteristic. We use 36, 178 instances for training and 9, 044 instances for test. Methods We have two variants of our distribution matching framework: DM that uses SVM as the base classifier coupled with the constraint in (7b), and DM+ ((7a) and (7b)). We compare our methods with several baselines: support vector machine (SVM), logistic regression (LR), mean matching with logistic regression as the base classifier (Zafar et al.) [5], and a threshold classifier method with protected characteristic-specific thresholds on the output of a logistic regression model (Hardt et al.) [4]. All methods but Hardt et al. do not use protected characteristics at prediction time. Optimization procedure For our DM and DM+ methods, we identify at least three options on how to optimize the multi-objective optimization problem in (7): using Convex Concave Procedure (CCP), using Broyden-Fletcher-Goldfarb-Shanno gradient descent method with limited-memory variation (L-BFGS), and using evolutionary multi-objective optimization (EMO). We discuss those options in turn. First, we can express each additive term in the \ MMD2(pz=0, pz=1) fairness constraint (7b) as a difference of two convex functions, find the convex upper bound of each term, and place the convexified fairness constraint as part of the objective function. In our initial experiments, solving (7) with CCP tends to ignore the fairness constraint, therefore we do not explore this approach further. As mentioned earlier, the convex upper bounds on each of the additive terms in the MMD constraint become increasingly loose as we move away from the current point of approximation. This leads to the second optimization approach. We turn the constrained optimization problem into an unconstrained one by introducing a non-negative weight CMMD to scale the \ MMD2(pz=0, pz=1) term. We then solve this unconstrained problem using L-BFGS. The main challenge with this procedure is the need to trade-off multiple competing goals by tuning several hyper-parameters, which will be discussed in the next section. The CCP and L-BFGS procedures will only return one optimal solution from the Pareto frontier. Third, to approximate the Pareto-optimal set, we can instead use EMO procedures (e.g. Non-dominated Sorting Genetic Algorithm (NSGA) – II and Strength Pareto Evolutionary Algorithm (SPEA) - II). For the EMO, we also solve the unconstrained problem as in the second approach, but we do not need to introduce a trade-off parameter for each term in the objective function. We use the DEAP toolbox [42] for experimenting with EMO. Model selection For the baseline Zafar et al., as in [5], we set the hyper-parameters τ and µ corresponding to the Penalty Convex Concave procedure to 5.0 and 1.2, respectively. Gaussian RBF kernel with a kernel width σ2 is used for the MMD term. When solving DM (and DM+) optimization problems with L-BFGS, the hyper-parameters C, CMMD, σ2, (and γ) are set to 1000., 5000., 10., (and 1.) for both datasets. For DM+, we select ∆over the range {1., 2., . . . , 10.} 7 Table 1: Results on multi-objective optimization which balances two main objectives: performance accuracies and fairness criteria. Equal true positive rates are required for ProPublica COMPAS dataset, and equal accuracies between two demographics z = 0 and z = 1 are required for Adult dataset. The solver of Zafar et al. fails on the Adult dataset while enforcing equal accuracies across the two demographics. Hardt et al.’s method does not enforce equal accuracies. SVM and LR only optimize performance accuracies. The terms |Acc.z=0 - Acc.z=1|, |TPRz=0 - TPRz=1|, and |FPRz=0 - FPRz=1| denote accuracy, true positive rate, and false positive rate discrepancies in an absolute term between the two demographics (the smaller the fairer). For ProPublica COMPAS dataset, we boldface |TPRz=0 - TPRz=1| since we enforce the equality of opportunity criterion on this dataset. For Adult dataset, we boldface |Acc.z=0 - Acc.z=1| since this is the fairness criterion. ProPublica COMPAS dataset (Fairness Constraint on equal TPRs) |Acc.z=0 - Acc.z=1 | |TPRz=0 - TPRz=1| |FPRz=0 - FPRz=1| Acc. LR 0.0151±0.0116 0.2504±0.0417 0.1618±0.0471 0.6652±0.0139 SVM 0.0172±0.0102 0.2573±0.0158 0.1603±0.0490 0.6367±0.0212 Zafar et al. 0.0174±0.0142 0.1144±0.0482 0.1914±0.0314 0.6118±0.0198 Hardt et al.∗ 0.0219±0.0191 0.0463±0.0185 0.0518±0.0413 0.6547±0.0128 DM (L-BFGS) 0.0457±0.0289 0.1169±0.0690 0.0791±0.0395 0.5931±0.0599 DM+ (L-BFGS) 0.0608±0.0259 0.1065±0.0413 0.0973±0.0272 0.6089±0.0398 DM (EMO Usr1) 0.0537±0.0121 0.1346±0.0360 0.1028±0.0481 0.6261±0.0133 DM (EMO Usr2) 0.0535±0.0213 0.1248±0.0509 0.0906±0.0507 0.6148±0.0137 ∗use protected characteristics at prediction time. Adult dataset (Fairness Constraint on equal accuracies) |Acc.z=0 - Acc.z=1| |TPRz=0 - TPRz=1| |FPRz=0 - FPRz=1| Acc. SVM 0.1136±0.0064 0.0964±0.0289 0.0694±0.0109 0.8457±0.0034 DM (L-BFGS) 0.0640±0.0280 0.0804±0.0659 0.0346±0.0343 0.8152±0.0068 DM+ (L-BFGS) 0.0459±0.0372 0.0759±0.0738 0.0368±0.0349 0.8127±0.0134 DM (EMO Usr1) 0.0388±0.0179 0.0398±0.0284 0.0398±0.0284 0.8057±0.0108 DM (EMO Usr2) 0.0482±0.0143 0.0302±0.0212 0.0135±0.0056 0.8111±0.0122 using 5-fold cross validation. The selection process goes as follow: we first sort ∆values according to how well they satisfy the fairness criterion, we then select a ∆value at a point before it yields a lower incremental classification accuracy. As stated earlier, we do not need C, CMMD, σ2, γ, ∆ hyper-parameters for balancing multiple terms in the objective function when using EMO for DM and DM+. There are however several free parameters related to the evolutionary algorithm itself. We use the NSGA – II selection strategy with a polynomial mutation operator as in the the original implementation [43], and the mutation probability is set to 0.5. We do not use any mating operator. We use 500 individuals in a loop of 50 iterations (generations). Results Experimental results over 5 repeats are presented in Table 1. In the ProPublica COMPAS dataset, we enforce equality of opportunity |TPRz=0 - TPRz=1|, i.e. equal true positive rates (Equation (3)), as the fairness criterion (refer to the ProPublica COMPAS dataset in Table 1). Additionally, our distribution matching methods, DM+ and DM also deliver a reduction in discrepancies between false positive rates. We experiment with both L-BFGS and EMO optimization procedures. For EMO, we simulate two decision makers choosing an operating point based on the visualization of Pareto frontier in Figure 1 – Right (shown as DM (EMO Usr1) and DM (EMO Usr2) in Table 1). For this dataset, Usr1 has an inclination to be more lenient in being fair for a gain in accuracy in comparison to the Usr2. This is actually reflected in the selection of the operating point (see supplementary material). The EMO is run on the 60% of the training data, the selection is done on the remaining 40%, and the reported results are on the separate test set based on the model trained on the 60% of the training data. The method Zafar et al. achieves similar reduction rate in the fairness criterion to our distribution matching methods. As a reference, we also include results of Hardt et al.’s method; it achieves the best equality of opportunity measure with only a slight drop in accuracy performance w.r.t. the unfair LR. It is important to note that Hardt et al.’s method requires protected characteristics at test time. If we allow the usage of protected characteristics at test time, we should expect similar reduction rate in fairness and accuracy measures for other methods [5]. 8 Hinge Loss 0.75 1.00 1.25 1.50 1.75 2.00 2.25 2.50 Regularization 0 5 1015 20 25 30 35 40 MMD −0.08 −0.06 −0.04 −0.02 0.00 0.02 0.04 0.06 0.35 0.40 0.45 0.50 0.55 0.60 Classification Error 0.00 0.05 0.10 0.15 0.20 0.25 |TPRZ=0 −TPRZ=1| SVM Figure 1: Visualization of a Pareto frontier of our DM method for the ProPublica COMPAS dataset. Left: In a 3D criterion space corresponding to the three objective functions: hinge loss, i.e. max (0, 1 −yn[⟨w, xn⟩+ b]), regularization, i.e. ∥w∥2 ℓ2, and MMD, i.e. \ MMD2(pz=0, pz=1). Fairer models (smaller MMD values) are gained at the expense of model complexity (higher regularization and/or hinge loss values). Note that the unbiased estimate of MMD may be negative [37]. Right: The same Pareto frontier but in a 2D space of error and unfairness in predictions. Only the first repeat is visualized; please refer to the supplementary material for the other four repeats, for the Adult dataset, and of the DM+ method. In the Adult dataset, we enforce equal accuracies |Acc.z=0 - Acc.z=1| (Equation (4)) as the fairness criterion (refer to the Adult dataset in Table 1). The method whereby a decision maker uses a Pareto frontier visualization for choosing the operating point (DM (EMO Usr1)) reaches the smallest discrepancy between the two demographics. In addition to equal accuracies (Equation (4)), our distribution matching methods, DM+ and DM, also deliver a reduction in discrepancies between true positive and false positive rates w.r.t. SVM (second and third column). In this dataset, Zafar et al. falls into numerical problems when enforcing equal accuracies (vide our earlier discussion on different optimization procedures, especially related to CCP). As observed in prior work [5, 20], the methods that do not enforce fairness (equal accuracies or equal true positive rates), SVM and LR, achieve higher classification accuracy compared to the methods that do enforce fairness: Zafar et al., DM+, and DM. This can be seen in the last column of Table 1. 5 Discussion and Conclusion We have proposed a unified machine learning framework that is able to handle any definitions of fairness, e.g. fairness through unawareness, demographic parity, equalized odds, and equality of opportunity. Our framework is based on learning using privileged information and matching conditional distributions using a two-sample problem. By using distance measures in Hilbert Space to solve the two-sample problem, our framework is general and will be applicable for protected characteristics with binary/multi-class/continuous values. The current work focuses on a single binary protected characteristic. This corresponds to conditional distribution matching with a binary conditioning variable. To generalize this to any type and multiple dependence of protected characteristics, we can use the Hilbert Space embedding of conditional distributions framework of [44, 45]. We note that there are important factors external to machine learning models that are relevant to fairness. However, this paper adopts the established approach of existing work on fair machine learning. In particular, it is taken as given that one typically does not have any control over the data collection process because there is no practical way of enforcing truth/un-biasedness in datasets that are generated by others, such as banks, police forces, and companies. Acknowledgments NQ is supported by the UK EPSRC project EP/P03442X/1 ‘EthicalML: Injecting Ethical and Legal Constraints into Machine Learning Models’ and the Russian Academic Excellence Project ‘5-100’. VS is supported by the IC Research Fellowship. We thank NVIDIA for GPU donation and Amazon for AWS Cloud Credits. We thank Kristian Kersting and Oliver Thomas for discussions, Muhammad Bilal Zafar for his implementations of [4] and [5], and Sienna Quadrianto for supporting the work. 9 References [1] Executive Office of the President. Big data: A report on algorithmic systems, opportunity, and civil rights. Technical report, 2016. [2] The Royal Society Working Group. Machine learning: the power and promise of computers that learn by example. Technical report, 2017. [3] Solon Barocas and Andrew D. Selbst. Big data’s disparate impact. California Law Review, 104:671–732, 2016. [4] Moritz Hardt, Eric Price, and Nati Srebro. Equality of opportunity in supervised learning. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett, editors, Advances in Neural Information Processing Systems (NIPS) 29, pages 3315–3323, 2016. [5] Muhammad Bilal Zafar, Isabel Valera, Manuel Gomez-Rodriguez, and Krishna P. Gummadi. Fairness beyond disparate treatment & disparate impact: Learning classification without disparate mistreatment. In International Conference on World Wide Web (WWW), pages 1171–1180, 2017. [6] Equality Act. London: HMSO, 2010. [7] Salvatore Ruggieri, Dino Pedreschi, and Franco Turini. Data mining for discrimination discovery. ACM Transactions on Knowledge Discovery from Data (TKDD), 4:9:1–9:40, 2010. [8] Philip Adler, Casey Falk, Sorelle A Friedler, Gabriel Rybeck, Carlos Scheidegger, Brandon Smith, and Suresh Venkatasubramanian. Auditing black-box models for indirect influence. In ICDM, 2016. [9] Andrea Romei and Salvatore Ruggieri. A multidisciplinary survey on discrimination analysis. The Knowledge Engineering Review, pages 582–638, 2014. [10] Michael Feldman, Sorelle A Friedler, John Moeller, Carlos Scheidegger, and Suresh Venkatasubramanian. Certifying and removing disparate impact. In International Conference on Knowledge Discovery and Data Mining (KDD), pages 259–268, 2015. [11] Muhammad Bilal Zafar, Isabel Valera, Manuel Gomez Rodriguez, and Krishna P. Gummadi. Fairness Constraints: Mechanisms for Fair Classification. In Aarti Singh and Jerry Zhu, editors, International Conference on Artificial Intelligence and Statistics (AISTATS), volume 54 of Proceedings of Machine Learning Research, pages 962–970. PMLR, 2017. [12] Toon Calders, Faisal Kamiran, and Mykola Pechenizkiy. Building classifiers with independency constraints. In International Conference on Data Mining Workshops (ICDMW), pages 13–18, 2009. [13] Toshihiro Kamishima, Shotaro Akaho, and Jun Sakuma. Fairness-aware learning through regularization approach. In International Conference on Data Mining Workshops (ICDMW), pages 643–650, 2011. [14] Toshihiro Kamishima, Shotaro Akaho, Hideki Asoh, and Jun Sakuma. Fairness-aware classifier with prejudice remover regularizer. In European conference on Machine Learning and Knowledge Discovery in Databases (ECML PKDD), pages 35–50, 2012. [15] Jon M. Kleinberg, Sendhil Mullainathan, and Manish Raghavan. Inherent trade-offs in the fair determination of risk scores. CoRR, abs/1609.05807, 2016. [16] Vladimir Vapnik and Akshay Vashist. A new learning paradigm: Learning using privileged information. Neural Networks, pages 544–557, 2009. [17] Viktoriia Sharmanska, Novi Quadrianto, and Christoph H. Lampert. Learning to rank using privileged information. In International Conference on Computer Vision (ICCV), pages 825–832, 2013. 10 [18] Daniel Hernández-Lobato, Viktoriia Sharmanska, Kristian Kersting, Christoph H Lampert, and Novi Quadrianto. Mind the nuisance: Gaussian process classification using privileged noise. In Z. Ghahramani, M. Welling, C. Cortes, N. D. Lawrence, and K. Q. Weinberger, editors, Advances in Neural Information Processing Systems (NIPS) 27, pages 837–845, 2014. [19] Vladimir Vapnik and Rauf Izmailov. Learning using privileged information: similarity control and knowledge transfer. Journal of Machine Learning Research (JMLR), 16:2023–2049, 2015. [20] Richard Zemel, Yu Wu, Kevin Swersky, Toniann Pitassi, and Cynthia Dwork. Learning fair representations. In S. Dasgupta and D. McAllester, editors, International Conference on Machine Learning (ICML), Proceedings of Machine Learning Research, pages 325–333. PMLR, 2013. [21] Christos Louizos, Kevin Swersky, Yujia Li, Max Welling, and Richard Zemel. The variational fair autoencoder. CoRR, abs/1511.00830, 2015. [22] Binh Thanh Luong, Salvatore Ruggieri, and Franco Turini. k-NN as an implementation of situation testing for discrimination discovery and prevention. In International Conference on Knowledge Discovery and Data Mining (KDD), pages 502–510, 2011. [23] Matt J. Kusner, Joshua R. Loftus, Chris Russell, and Ricardo Silva. Counterfactual fairness. In U. V. Luxburg, I. Guyon, S. Bengio, H. Wallach, R. Fergus, S.V.N. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems (NIPS) 30, 2017. [24] Gabriel Goh, Andrew Cotter, Maya Gupta, and Michael P Friedlander. Satisfying real-world goals with dataset constraints. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett, editors, Advances in Neural Information Processing Systems (NIPS) 29, pages 2415–2423, 2016. [25] Cynthia Dwork, Moritz Hardt, Toniann Pitassi, Omer Reingold, and Richard Zemel. Fairness through awareness. In Innovations in Theoretical Computer Science (ITCS), pages 214–226. ACM, 2012. [26] Matthew Joseph, Michael Kearns, Jamie H Morgenstern, and Aaron Roth. Fairness in learning: Classic and contextual bandits. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett, editors, Advances in Neural Information Processing Systems (NIPS) 29, pages 325–333, 2016. [27] Dmitry Pechyony and Vladimir Vapnik. On the theory of learnining with privileged information. In John D. Lafferty, Christopher K. I. Williams, John Shawe-Taylor, Richard S. Zemel, and Aron Culotta, editors, Advances in Neural Information Processing Systems (NIPS) 23, pages 1894–1902, 2010. [28] Jan Feyereisl, Suha Kwak, Jeany Son, and Bohyung Han. Object localization based on structural svm using privileged information. In Zoubin Ghahramani, Max Welling, Corinna Cortes, Neil D. Lawrence, and Kilian Q. Weinberger, editors, Advances in Neural Information Processing Systems (NIPS) 27, pages 208–216, 2014. [29] Viktoriia Sharmanska, Daniel Hernández-Lobato, José Miguel Hernández-Lobato, and Novi Quadrianto. Ambiguity helps: Classification with disagreements in crowdsourced annotations. In Computer Vision and Pattern Recognition (CVPR), pages 2194–2202. IEEE Computer Society, 2016. [30] D. Lopez-Paz, B. Schölkopf, L. Bottou, and V. Vapnik. Unifying distillation and privileged information. In International Conference on Learning Representations (ICLR), 2016. [31] Geoffrey E. Hinton, Oriol Vinyals, and Jeffrey Dean. Distilling the knowledge in a neural network. CoRR, abs/1503.02531, 2015. [32] Cristian Bucila, Rich Caruana, and Alexandru Niculescu-Mizil. Model compression. In International Conference on Knowledge Discovery and Data Mining (KDD), pages 535–541, 2006. 11 [33] Wen Li, Lixin Duan, Dong Xu, and Ivor W Tsang. Learning with augmented features for supervised and semi-supervised heterogeneous domain adaptation. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI), pages 1134–1148, 2014. [34] Xu Zhang, Felix Xinnan Yu, Shih-Fu Chang, and Shengjin Wang. Deep transfer network: Unsupervised domain adaptation. CoRR, abs/1503.00591, 2015. [35] Novi Quadrianto, James Petterson, and Alex J. Smola. Distribution matching for transduction. In Y. Bengio, D. Schuurmans, J. D. Lafferty, C. K. I. Williams, and A. Culotta, editors, Advances in Neural Information Processing Systems (NIPS) 22, pages 1500–1508. 2009. [36] Viktoriia Sharmanska and Novi Quadrianto. Learning from the mistakes of others: Matching errors in cross-dataset learning. In Computer Vision and Pattern Recognition (CVPR), pages 3967–3975. IEEE Computer Society, 2016. [37] Arthur Gretton, Karsten M. Borgwardt, Malte J. Rasch, Bernhard Schölkopf, and Alexander Smola. A kernel two-sample test. Journal of Machine Learning Research (JMLR), 13:723–773, 2012. [38] Sinno Jialin Pan, Ivor W. Tsang, James T. Kwok, and Qiang Yang. Domain adaptation via transfer component analysis. In Craig Boutilier, editor, International Joint Conference on Artifical Intelligence (IJCAI), pages 1187–1192, 2009. [39] Bharath K. Sriperumbudur, Kenji Fukumizu, and Gert R. G. Lanckriet. Universality, characteristic kernels and RKHS embedding of measures. Journal of Machine Learning Research (JMLR), 12:2389–2410, 2011. [40] Yann Collette and Patrick Siarry. Multiobjective Optimization: Principles and Case Studies. Springer, 2003. [41] Thomas Lipp and Stephen Boyd. Variations and extension of the convex–concave procedure. Optimization and Engineering, 17(2):263–287, 2016. [42] Félix-Antoine Fortin, François-Michel De Rainville, Marc-André Gardner Gardner, Marc Parizeau, and Christian Gagné. DEAP: Evolutionary algorithms made easy. Journal of Machine Learning Research (JMLR), 13(1):2171–2175, 2012. [43] Kalyanmoy Deb, Samir Agrawal, Amrit Pratap, and T. Meyarivan. A fast elitist non-dominated sorting genetic algorithm for multi-objective optimisation: NSGA-II. In International Conference on Parallel Problem Solving from Nature (PPSN), pages 849–858, 2000. [44] Le Song, Jonathan Huang, Alex Smola, and Kenji Fukumizu. Hilbert space embeddings of conditional distributions with applications to dynamical systems. In International Conference on Machine Learning (ICML), pages 961–968, 2009. [45] L. Song, K. Fukumizu, and A. Gretton. Kernel embeddings of conditional distributions: A unified kernel framework for nonparametric inference in graphical models. IEEE Signal Processing Magazine, 30(4):98–111, 2013. 12
2017
98
7,240
Collecting Telemetry Data Privately Bolin Ding, Janardhan Kulkarni, Sergey Yekhanin Microsoft Research {bolind, jakul, yekhanin}@microsoft.com Abstract The collection and analysis of telemetry data from user’s devices is routinely performed by many software companies. Telemetry collection leads to improved user experience but poses significant risks to users’ privacy. Locally differentially private (LDP) algorithms have recently emerged as the main tool that allows data collectors to estimate various population statistics, while preserving privacy. The guarantees provided by such algorithms are typically very strong for a single round of telemetry collection, but degrade rapidly when telemetry is collected regularly. In particular, existing LDP algorithms are not suitable for repeated collection of counter data such as daily app usage statistics. In this paper, we develop new LDP mechanisms geared towards repeated collection of counter data, with formal privacy guarantees even after being executed for an arbitrarily long period of time. For two basic analytical tasks, mean estimation and histogram estimation, our LDP mechanisms for repeated data collection provide estimates with comparable or even the same accuracy as existing single-round LDP collection mechanisms. We conduct empirical evaluation on real-world counter datasets to verify our theoretical results. Our mechanisms have been deployed by Microsoft to collect telemetry across millions of devices. 1 Introduction Collecting telemetry data to make more informed decisions is a commonplace. In order to meet users’ privacy expectations and in view of tightening privacy regulations (e.g., European GDPR law) the ability to collect telemetry data privately is paramount. Counter data, e.g., daily app or system usage statistics reported in seconds, is a common form of telemetry. In this paper we are interested in algorithms that preserve users’ privacy in the face of continuous collection of counter data, are accurate, and scale to populations of millions of users. Recently, differential privacy [10] (DP) has emerged as defacto standard for the privacy guarantees. In the context of telemetry collection one typically considers algorithms that exhibit differential privacy in the local model [12, 14, 7, 5, 3, 18], also called randomized response model [19], γ-amplification [13], or FRAPP [1]. These are randomized algorithms that are invoked on each user’s device to turn user’s private value into a response that is communicated to a data collector and have the property that the likelihood of any specific algorithm’s output varies little with the input, thus providing users with plausible deniability. Guarantees offered by locally differentially private algorithms, although very strong in a single round of telemetry collection, quickly degrade when data is collected over time. This is a very challenging problem that limits the applicability of DP in many contexts. In telemetry applications, privacy guarantees need to hold in the face of continuous data collection. An influential paper [12] proposed a framework based on memoization to tackle this issue. Their techniques allow one to extend single round DP algorithms to continual data collection and protect users whose values stay constant or change very rarely. The key limitation of the work of [12] is that their approach cannot protect users’ private numeric values with very small but frequent changes, making it inappropriate for collecting telemetry counters. In this paper, we address this limitation. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. We design mechanisms with formal privacy guarantees in the face of continuous collection of counter data. These guarantees are particularly strong when user’s behavior remains approximately the same, varies slowly, or varies around a small number of values over the course of data collection. Our results. Our contributions are threefold. 1) We give simple 1-bit response mechanisms in the local model of DP for single-round collection of counter data for mean and histogram estimation. Our mechanisms are inspired by those in [19, 8, 7, 4], but allow for considerably simpler descriptions and implementations. Our experiments also demonstrate their performance in concrete settings. 2) Our main technical contribution is a rounding technique called α-point rounding that borrows ideas from approximation algorithms literature [15, 2], and allows memoization to be applied in the context of private collection of counters. Our memoization schema avoids substantial losses in accuracy or privacy and unaffordable storage overhead. We give a rigorous definition of privacy guarantees provided by our algorithms when the data is collected continuously for an arbitrarily long period of time. We also present empirical findings related to our privacy guarantees. 3) Finally, our mechanisms have been deployed by Microsoft across millions of devices starting with Windows Insiders in Windows 10 Fall Creators Update to protect users’ privacy while collecting application usage statistics. 1.1 Preliminaries and problem formulation In our setup, there are n users, and each user at time t has a private (integer or real-valued) counter with value xi(t) ∈[0, m]. A data collector wants to collect these counter values {xi(t)}i∈[n] at each time stamp t to do statistical analysis. For example, for the telemetry analysis, understanding the mean and the distribution of counter values (e.g., app usage) is very important to IT companies. Local model of differential privacy (LDP). Users do not need to trust the data collector and require formal privacy guarantees before they are willing to communicate their values to the data collector. Hence, a more well-studied DP model [10, 11], which first collects all users’ data and then injects noise in the analysis step, is not applicable in our setup. In this work, we adopt the local model of differential privacy, where each user randomizes private data using a randomized algorithm (mechanism) A locally before sending it to data collector. Definition 1 ([13, 8, 4]). A randomized algorithm A : V →Z is ϵ-locally differentially private (ϵ-LDP) if for any pair of values v, v′ ∈V and any subset of output S ⊆Z, we have that Pr[A(v) ∈S] ≤eϵ · Pr[A(v′) ∈S] . LDP formalizes a type of plausible deniability: no matter what output is released, it is approximately equally as likely to have come from one point v ∈V as any other. For alternate interpretations of differential privacy within the framework of hypothesis testing we refer the reader to [20, 7]. Statistical estimation problems. We focus on two estimation problems in this paper. Mean estimation: For each time stamp t, the data collector wants to obtain an estimation ˆσ(t) for the mean of ⃗xt = ⟨xi(t)⟩i∈[n], i.e., σ(⃗xt) = 1 n · P i∈[n] xi(t). We do worst case analysis and aim to bound the absolute error |ˆσ(t) −σ(⃗xt)| for any input ⃗xt ∈[0, m]n. In the rest of the paper, we abuse notation and denote σ(t) to mean σ(⃗xt) for a fixed input ⃗xt. Histogram estimation: Suppose the domain of counter values is partitioned into k buckets (e.g., with equal widths), and a counter value xi(t) ∈[0, m] can be mapped to a bucket number vi(t) ∈[k]. For each time stamp t, the data collector wants to estimate frequency of v ∈[k] : ht(v) = 1 n · |{i : vi(t) = v}| as ˆht(v). The error of a histogram estimation is measured by maxv∈[k] |ˆht(v) −ht(v)|. Again, we do worst case analysis of our algorithm over all possible inputs ⃗vt = ⟨vi(t)⟩i∈[n] ∈[k]n. 1.2 Repeated collection and overview of privacy framework Privacy leakage in repeated data collection. Although LDP is a very strict notion of privacy, its effectiveness decreases if the data is collected repeatedly. If we collect counter values of a user i for T time stamps by executing an ε-LDP mechanism A independently on each time stamp, 2 xi(1)xi(2) . . . xi(T) can be only guaranteed indistinguishable to another sequence of counter values, x′ i(1)x′ i(2) . . . x′ i(T), by a factor of up to eT ·ε, which is too large to be reasonable as T increases. Hence, in applications such as telemetry, where data is collected continuously, privacy guarantees provided by an LDP mechanism for a single round of data collection are not sufficient. We formalize our privacy guarantee to enhance LDP for repeated data collection later in Section 3. However, intuitively we ensure that every user blends with a large set of other users who have very different behaviors. Our Privacy Framework and Guarantees. Our framework for repeated private collection of counter data follows similar outline as the framework used in [12]. Our framework for mean and histogram estimation has four main components: 1) An important building block for our overall solution are 1-bit mechanisms that provide local ϵ-LDP guarantees and good accuracy for a single round of data collection (Section 2). 2) An α-point rounding scheme to randomly discretize users private values prior to applying memoization (to conceal small changes) while keeping the expectation of discretized values intact (Section 3). 3) Memoization of discretized values using the 1-bit mechanisms to avoid privacy leakage from repeated data collection (Section 3). In particular, if the counter value of a user remains approximately consistent, then the user is guaranteed ϵ-differential privacy even after many rounds of data collection. 4) Finally, output perturbation (instantaneous noise in [12]) to protect exposing the transition points due to large changes in user’s behavior and attacks based on auxiliary information (Section 4). In Sections 2, 3 and 4, we formalize these guarantees focusing predominantly on the mean estimation problem. All the omitted proofs and additional experimental results are in the full version on the arXiv [6]. 2 Single-round LDP mechanisms for mean and histogram estimation We first describe our 1-bit LDP mechanisms for mean and histogram estimation. Our mechanisms are inspired by the works of Duchi et al. [8, 7, 9] and Bassily and Smith [4]. However, our mechanisms are tuned for more efficient communication (by sending 1 bit for each counter each time) and stronger protection in repeated data collection (introduced later in Section 3). To the best our knowledge, the exact form of mechanisms presented in this Section was not known. Our algorithms yield accuracy gains in concrete settings (see Section 5) and are easy to understand and implement. 2.1 1-Bit mechanism for mean estimation Collection mechanism 1BitMean: When the collection of counter xi(t) at time t is requested by the data collector, each user i sends one bit bi(t), which is independently drawn from the distribution: bi(t) =  1, with probability 1 eϵ+1 + xi(t) m · eϵ−1 eϵ+1; 0, otherwise. (1) Mean estimation. Data collector obtains the bits {bi(t)}i∈[n] from n users and estimates σ(t) as ˆσ(t) = m n n X i=1 bi(t) · (eε + 1) −1 eε −1 . (2) The basic randomizer of [4] is equivalent to our 1-bit mechanism for the case when each user takes values either 0 or m. The above mechanism can also be seen as a simplification of the multidimensional mean-estimation mechanism given in [7]. For the 1-dimensional mean estimation, Duchi et al. [7] show that Laplace mechanism is asymptotically optimal for the mini-max error. However, the communication cost per user in Laplace mechanism is Ω(log m) bits, and our experiments show it also leads to larger error compared to our 1-bit mechanism. We prove following results for the above 1-bit mechanism. Theorem 1. For single-round data collection, the mechanism 1BitMean in (1) preserves ϵ-LDP for each user. Upon receiving the n bits {bi(t)}i∈[n], the data collector can then estimate the mean of 3 counters from n users as ˆσ(t) in (2). With probability at least 1 −δ, we have |ˆσ(t) −σ(t)| ≤ m √ 2n · eε + 1 eε −1 · r log 2 δ . 2.2 d-Bit mechanism for histogram estimation Now we consider the problem of estimating histograms of counter values in a discretized domain with k buckets with LDP to be guaranteed. This problem has extensive literature both in computer science and statistics, and dates back to the seminal work Warner [19]; we refer the readers to following excellent papers [16, 8, 4, 17] for more information. Recently, Bassily and Smith [4] gave asymptotically tight results for the problem in the worst-case model building on the works of [16]. On the other hand, Duchi et al. [8] introduce a mechanism by adapting Warner’s classical randomized response mechanism in [19], which is shown to be optimal for the statistical mini-max regret if one does not care about the cost of communication. Unfortunately, some ideas in Bassily and Smith [4] such as Johnson-Lindenstrauss lemma do not scale to population sizes of millions of users. Therefore, in order to have a smooth trade-off between accuracy and communication cost (as well as the ability to protect privacy in repeated data collection, which will be introduced in Section 3) we introduce a modified version of Duchi et al.’s mechanism [8] based on subsampling by buckets. Collection mechanism dBitFlip: Each user i randomly draws d bucket numbers without replacement from [k], denoted by j1, j2, . . . , jd. When the collection of discretized bucket number vi(t) ∈[k] at time t is requested by the data collector, each user i sends a vector: bi(t) = [(j1, bi,j1(t)), (j2, bi,j2(t)), . . . , (jd, bi,jd(t))] , where bi,jp(t) is a random 0-1 bit, with Pr  bi,jp(t) = 1  = eε/2/(eε/2 + 1) if vi(t) = jp 1/(eε/2 + 1) if vi(t) ̸= jp , for p = 1, 2, . . . , d. Under the same public coin model as in [4], each user i only needs to send to the data collector d bits bi,j1(t), bi,j2(t), . . ., bi,jd(t) in bi(t), as j1, j2, . . . , jd can be generated using public coins. Histogram estimation. Data collector estimates histogram ht as: for v ∈[k], ˆht(v) = k nd X bi,v(t) is received bi,v(t) · (eε/2 + 1) −1 eε/2 −1 . (3) When d = k, dBitFlip is exactly the same as the one in Duchi et al.[8]. The privacy guarantee is straightforward. In terms of the accuracy, the intuition is that for each bucket v ∈[k], there are roughly nd/k users responding with a 0-1 bit bi,v(t). We can prove the following result. Theorem 2. For single-round data collection, the mechanism dBitFlip preserves ϵ-LDP for each user. Upon receiving the d bits {bi,jp(t)}p∈[d] from each user i, the data collector can then estimate then histogram ht as ˆht in (3). With probability at least 1 −δ, we have, max v∈[k] |ht(v) −ˆht(v)| ≤ r 5k nd · eε/2 + 1 eε/2 −1 · r log 6k δ ≤O r k log(k/δ) ε2nd ! . 3 Memoization for continual collection of counter data One important concern regarding the use of ϵ-LDP algorithms (e.g., in Section 2.1) to collect counter data pertains to privacy leakage that may occur if we collect user’s data repeatedly (say, daily) and user’s private value xi does not change or changes little. Depending on the value of ϵ, after a number of rounds, data collector will have enough noisy reads to estimate xi with high accuracy. Memoization [12] is a simple rule that says that: At the account setup phase each user pre-computes and stores his responses to data collector for all possible values of the private counter. At data collection users do not use fresh randomness, but respond with pre-computed responses corresponding to their current counter values. Memoization (to a certain degree) takes care of situations when the private value xi stays constant. Note that the use of memoization violates differential privacy in continual collection. If memoization is employed, data collector can easily distinguish a user whose 4 value keeps changing, from a user whose value is constant; no matter how small the ϵ is. However, privacy leakage is limited. When data collector observes that user’s response had changed, this only indicates that user’s value had changed, but not what it was and not what it is. As observed in [12, Section 1.3] using memoization technique in the context of collecting counter data is problematic for the following reason. Often, from day to day, private values xi do not stay constant, but rather experience small changes (e.g., one can think of app usage statistics reported in seconds). Note that, naively using memoization adds no additional protection to the user whose private value varies but stays approximately the same, as data collector would observe many independent responses corresponding to it. One naive way to fix the issue above is to use discretization: pick a large integer (segment size) s that divides m; consider the partition of all integers into segments [ℓs, (ℓ+ 1)s]; and have each user report his value after rounding the true value xi to the mid-point of the segment that xi belongs to. This approach takes care of the issue of leakage caused by small changes to xi as users values would now tend to stay within a single segment, and thus trigger the same memoized response; however accuracy loss may be extremely large. For instance, in a population where all xi are ℓs + 1 for some ℓ, after rounding every user would be responding based on the value ℓs + s/2. In the following subsection we present a better (randomized) rounding technique (termed α-point rounding) that has been previously used in approximation algorithms literature [15, 2] and rigorously addresses the issues discussed above. We first consider the mean estimation problem. 3.1 α-point rounding for mean estimation The key idea of rounding is to discretize the domain where users’ counters take their values. Discretization reduces domain size, and users that behave consistently take less different values, which allows us to apply memoization to get a strong privacy guarantee. As we demonstrated above discretization may be particularly detrimental to accuracy when users’ private values are correlated. We propose addressing this issue by: making the discretization rule independent across different users. This ensures that when (say) all users have the same value, some users round it up and some round it down, facilitating a smaller accuracy loss. We are now ready to specify the algorithm that extends the basic algorithm 1BitMean and employs both α-point rounding and memoization. We assume that counter values range in [0, m]. 1. At the algorithm design phase, we specify an integer s (our discretization granularity). We assume that s divides m. We suggest setting s rather large compared to m, say s = m/20 or even s = m depending on the particular application domain. 2. At the the setup phase, each user i ∈[n] independently at random picks a value αi ∈ {0, . . . , s −1}, that is used to specify the rounding rule. 3. User i invokes the basic algorithm 1BitMean with range m to compute and memoize 1-bit responses to data collector for all m s + 1 values xi in the arithmetic progression A = {ℓs}0≤ℓ≤m s . (4) 4. Consider a user i with private value xi who receives a data collection request. Let xi ∈[L, R), where L, R are the two neighboring elements of the arithmetic progression {ℓs}0≤ℓ≤m s +1. The user xi rounds value to L if xi + αi < R; otherwise, the user rounds the value to R. Let yi denote the value of the user after rounding. In each round, user responds with the memoized bit for value yi. Note that rounding is always uniquely defined. Perhaps a bit surprisingly, using α-point rounding does not lead to additional accuracy losses independent of the choice of discretization granularity s. Theorem 3. Independent of the value of discretization granularity s, at any round of data collection, each output bit bi is still sampled according to the distribution given by formula (1). Therefore, the algorithm above provides the same accuracy guarantees as given in Theorem 1. 5 3.2 Privacy definition using permanent memoization In what follows we detail privacy guarantees provided by an algorithm that employs α-point rounding and memoization in conjunction with the ϵ-DP 1-bit mechanism of Section 2.1 against a data collector that receives a very long stream of user’s responses to data collection events. Let U be a user and x(1), . . . , x(T) be the sequence of U’s private counter values. Given user’s private value αi, each of {x(j)}j∈[T ] gets rounded to the corresponding value {y(j)}j∈[T ] in the set A (defined by (4)) according to the rule given in Section 3.1. Definition 2. Let B be the space of all sequences {z(j)}j∈[T ] ∈AT , considered up to an arbitrary permutation of the elements of A. We define the behavior pattern b(U) of the user U to be the element of B corresponding to {y(j)}j∈[T ]. We refer to the number of distinct elements y(j) in the sequence {y(j)}j∈[T ] as the width of b(U). We now discuss our notion of behavior pattern, using counters that carry daily app usage statistics as an example. Intuitively, users map to the same behavior pattern if they have the same number of different modes (approximate counter values) of using the app, and switch between these modes on the same days. For instance, one user that uses an app for 30 minutes on weekdays, 2 hours on weekends, and 6 hours on holidays, and the other user who uses the app for 4 hours on weekdays, 10 minutes on weekends, and does not use it on holidays will likely map to the same behavior pattern. Observe however that the mapping from actual private counter values {x(j)} to behavior patterns is randomized, thus there is a likelihood that some users with identical private usage profiles may map to different behavior patterns. This is a positive feature of the Definition 2 that increases entropy among users with the same behavior pattern. The next theorem shows that the algorithm of Section 3.1 makes users with the same behavior pattern blend with each other from the viewpoint of data collector (in the sense of differential privacy). Theorem 4. Consider users U and V with sequences of private counter values {xU(1), . . . , xU(T)} and {xV (1), . . . , xV (T)}. Assume that both U and V respond at T data-collection time stamps using the algorithm presented in Section 3.1, and b(U) = b(V ) with the width of b(U) equal to w. Let sU, sV ∈{0, 1}T be the random sequences of responses generated by users U and V ; then for any binary string s ∈{0, 1}T in the response domain, we have: Pr[sU = s] ≤ewϵ · Pr[sV = s] . (5) 3.2.1 Setting parameters The ϵ-LDP guarantee provided by Theorem 4 ensures that each user is indistinguishable from other users with the same behavior pattern (in the sense of LDP). The exact shape of behavior patterns is governed by the choice of the parameter s. Setting s very large, say s = m or s = m/2 reduces the number of possible behavior patterns and thus increases the number of users that blend by mapping to a particular behavior pattern. It also yields stronger guarantee for blending within a pattern since for all users U we necessarily have b(U) ≤m/s + 1 and thus by Theorem 4 the likelihood of distinguishing users within a pattern is trivially at most e(m/s+1)·ϵ. At the same time there are cases where one can justify using smaller values of s. In fact, consistent users, i.e., users whose private counter always land in the vicinity of one of a small number of fixed values enjoy a strong LDP guarantee within their patterns irrespective of s (provided it is not too small), and smaller s may be advantageous to avoid certain attacks based on auxiliary information as the set of all possible values of a private counter xi that lead to a specific output bit b is potentially more complex. Finally, it is important to stress that the ϵ-LDP guarantee established in Theorem 4 is not a panacea, and in particular it is a weaker guarantee provided in a much more challenging setting than just the ϵ-LDP guarantee across all users that we provide for a single round of data collection (an easier setting). In particular, while LDP across all population of users is resilient to any attack based on auxiliary information, LDP across a sub population may be vulnerable to such attacks and additional levels of protection may need to be applied. In particular, if data collector observes that user’s response has changed; data collector knows with certainty that user’s true counter value had changed. In the case of app usage telemetry this implies that app has been used on one of the days. This attack is partly mitigated by the output perturbation technique that is discussed in Section 4. 6 1 20 400 8000 160000 3200000 Percentage of users in the patterns App A (s=m) 1 20 400 8000 160000 3200000 Percentage of users in the patterns App A (s=m/2) 1 20 400 8000 160000 3200000 Percentage of users in the patterns App A (s=m/3) Figure 1: Distribution of pattern supports for App A 3.2.2 Experimental study We use a real-world dataset of 3 million users with their daily usage of an app (App A) collected (in seconds) over a continuous period of 31 days to demonstrate the mapping of users to behavior patterns in Figure 1. See full version of the paper for usage patterns for more apps. For each behavior pattern (Definition 2), we calculate its support as the number of users with their sequences in this pattern. All the patterns’ supports sup are plotted (y-axis) in the decreasing order, and we can also calculate the percentage of users (x-axis) in patterns with supports at least sup. We vary the parameter s in permanent memoization from m (maximizing blending) to m/3 and report the corresponding distributions of pattern supports in Figure 1. It is not hard to see that theoretically for every behavior pattern there is a very large set of sequences of private counter values {x(t)}t that may map to it (depending on αi). Real data (Figure 1) provides evidence that users tend to be approximately consistent and therefore simpler patterns, i.e., patterns that mostly stick to a single rounded value y(t) = y correspond to larger sets of sequences {xi(t)}t, obtained from a real population. In particular, for each app there is always one pattern (corresponding to having one fixed y(t) = y across all 31 days) which blends the majority of users (> 2 million). More complex behavior patterns have less users mapping to them. In particular, there always are some lonely users (1%-5% depending on s) who land in patterns that have support size of one or two. From the viewpoint of a data collector such users can only be identified as those having a complex and irregular behavior, however the actual nature of that behavior by Theorem 4 remains uncertain. 3.3 Example One specific example of a counter collection problem that has been identified in [12, Section 1.3] as being non-suitable for techniques presented in [12] but can be easily solved using our methods is to repeatedly collect age in days from a population of users. When we set s = m and apply the algorithm of Section 3.1 we can collect such data for T rounds with high accuracy. Each user necessarily responds with a sequence of bits that has form zt ◦¯zT −t, where 0 ≤t ≤T. Thus data collector only gets to learn the transition point, i.e., the day when user’s age in days passes the value m −αi, which is safe from privacy perspective as αi is picked uniformly at random by the user. 3.4 Continual collection for histogram estimation using permanent memoization Naive memoization. α-point rounding is not suitable for histogram estimation as counter values have been mapped to k buckets. The single-round LDP mechanism in Duchi et al. [8] sends a 0-1 random response for each bucket: send 1 with probability eε/2/(eε/2 +1) if the value is in this bucket, and with probability 1/(eε/2 + 1) if not. This mechanism is ϵ-LDP. Each user can then memoize a mapping fk : [k] →{0, 1}k by running this mechanism once for each v ∈[k], and always respond fk(v) if the user’s value is in bucket v. However, this memoization schema leads to serious privacy leakage: with some auxiliary information, one can infer with high confidence a user’s value from the response produced by the mechanism; more concretely, if the data collector knows that the app usage value is in a bucket v and observes the output fk(v) = z in some day, whenever the user sends z again in future, the data collector can infer that the bucket number is v with almost 100% probability. d-bit memoization. To avoid such privacy leakages, we memoize based on our d-bit mechanism dBitFlip (Section 2.2). Each user runs dBitFlip for each v ∈[k], with responses created on d buckets j1, j2, . . . , jd (randomly drawn and then fixed per user), and memoizes the response in a mapping fd : [k] →{0, 1}d. A user will always send fd(v) if the bucket number is v. This mechanism is denoted by dBitFlipPM, and the same estimator (3) can be used to estimate the histogram upon 7 1 8 64 512 4096 32768 0.1 0.2 0.5 1 2 5 10 Epsilon Laplace 1BitRRPM 1BitRRPM+OP(1/10) 1BitRRPM+OP(1/3) (a) Mean (n = 0.3 × 106) 1 8 64 512 4096 32768 0.1 0.2 0.5 1 2 5 10 Epsilon Laplace 1BitRRPM 1BitRRPM+OP(1/10) 1BitRRPM+OP(1/3) (b) Mean (n = 3 × 106) 0 0.05 0.1 0.15 0.2 0.1 0.2 0.5 1 2 5 10 Epsilon BinFlip BinFlip+ KFlip 4BitFlipPM 2BitFlipPM 1BitFlipPM (c) Histogram (n = 0.3 × 106) Figure 2: Comparison of mechanisms for mean and histogram estimations on real-world datasets receiving the d-bit response from every user. This scheme avoids privacy leakages that arise due to the naive memoization, because multiple (Ω k/2d w.h.p.) buckets are mapped to the same response. This protection is the strongest when d = 1. Definition 2 about behavior patterns and Theorem 4 can be generalized here to provide similar privacy guarantee in continual data collection. 4 Output perturbation One of the limitations of our memoization approach based on α-point rounding is that it does not protect the points of time where user’s behavior changes significantly. Consider a user who never uses an app for a long time, and then starts using it. When this happens, suppose the output produced by our algorithm changes from 0 to 1. Then the data collector can learn with certainty that the user’s behavior changed, (but not what this behavior was or what it became). Output perturbation is one possible mechanism of protecting the exact location of the points of time where user’s behavior has changed. As mentioned earlier, output perturbation was introduced in [12] as a way to mitigate privacy leakage that arises due to memoization. The main idea behind output perturbation is to flip the output of memoized responses with a small probability 0 ≤γ ≤0.5. This ensures that data collector will not be able to learn with certainty that the behavior of a user changes at certain time stamps. In the full version of the paper we formalize this notion, and prove accuracy and privacy guarantees with output perturbation. Here we contain ourselves to mentioning that using output perturbation with a positive γ, in combination with the ϵ-LDP 1BitMean algorithm in Section 2 is equivalent to invoking the 1BitMean algorithm with ϵ′ = ln  (1−2γ)( eϵ eϵ+1 )+γ (1−2γ)( 1 eϵ+1 )+γ  . 5 Empirical evaluation We compare our mechanisms (with permanent memoization) for mean and histogram estimation with previous mechanisms for one-time data collection. We would like to emphasize that the goal of these experiments is to show that our mechanisms, with such additional protection, are no worse than or comparable to the state-of-the-art LDP mechanisms in terms of estimation accuracy. We first use the real-world dataset which is described in Section 3.2.2. Mean estimation. We implement our 1-bit mechanism (Section 2.1) with α-point Randomized Rounding and Permanent Memoization for repeated collection (Section 3), denoted by 1BitRRPM, and output perturbation to enhance the protection for usage change (Section 4), denoted by 1BitRRPM+OP(γ). We compare it with the Laplace mechanism for LDP mean estimation in [8, 9], denoted by Laplace. We vary the value of ε (ε = 0.1-10) and the number of users (n = 0.3, 3 × 106 by randomly picking subsets of all users), and run all the mechanisms 3000 times on 31-day usage data with three counters. The domain size is m = 24 hours. The average of absolute errors (in seconds) with one standard deviation (STD) are reported in Figures 2(a)-2(b). 1BitRRPM is consistently better than Laplace with smaller errors and narrower STDs. Even with a perturbation probability γ = 1/10, they are comparable in accuracy. When γ = 1/3, output perturbation is equivalent to adding an additional uniform noise from [0, 24 hours] independently on each day–even in this case, 1BitRRPM+OP(1/3) gives us tolerable accuracy when the number of users is large. Histogram estimation. We create k = 32 buckets on [0, 24 hours] with even widths to evaluate mechanisms for histogram estimation. We implement our d-bit mechanism (Section 2.2) with 8 1 8 64 512 4096 32768 0.1 0.2 0.5 1 2 5 10 Epsilon Laplace 1BitRRPM 1BitRRPM+OP(1/10) 1BitRRPM+OP(1/3) (a) Mean (constant distribution) 1 8 64 512 4096 32768 0.1 0.2 0.5 1 2 5 10 Epsilon Laplace 1BitRRPM 1BitRRPM+OP(1/10) 1BitRRPM+OP(1/3) (b) Mean (uniform distribution) 0 0.05 0.1 0.15 0.2 0.1 0.2 0.5 1 2 5 10 Epsilon BinFlip BinFlip+ KFlip 4BitFlipPM 2BitFlipPM 1BitFlipPM (c) Histogram (normal distribution) Figure 3: Mechanisms for mean and histogram estimations on different distributions (n = 0.3 × 106) permanent memoization for repeated collection (Section 3.4), denoted by dBitFlipPM. In order to provide protection on usage change in repeated collection, we use d = 1, 2, 4 (strongest when d = 1). We compare it with state-of-the-art one-time mechanisms for histogram estimation: BinFlip [8, 9], KFlip (k-RR in [17]), and BinFlip+ (applying the generic protocol with 1-bit reports in [4] on BinFlip). When d = k, dBitFlipPM has the same accuracy as BinFlip. KFlip is sub-optimal for small ε [17] but has better performance when ε is Ω(ln k). In contrast, BinFlip+ has good performance when ε ≤2. We repeat the experiment 3000 times and report the average histogram error (i.e., maximum error across all bars in a histogram) with one standard deviation for different algorithms in Figure 2(c) with ε = 0.1-10 and n = 0.3 × 106 to confirm the above theoretical results. BinFlip (equivalently, 32BitFlipPM) has the best accuracy overall. With enhanced privacy protection in repeated data collection, 4bitFlipPM is comparable to the one-time collection mechanism KFlip when ε is small (0.1-0.5) and 4bitFlipPM-1bitFlipPM are better than BinFlip+ when ε is large (5-10). On different data distributions. We have shown that errors in mean and histogram estimations can be bounded (Theorems 1-2) in terms of ε and the number of users n, together with the number of buckets k and the number of bits d (applicable only to histograms). We now conduct additional experiments on synthetic datasets to verify that the empirical errors should not change much on different data distributions. Three types of distributions are considered: i) constant distribution, i.e., each user i has a counter xi(t) = 12 (hours) all the time; ii) uniform distribution, i.e., xi(t) ∼ U(0, 24); and iii) normal distribution, i.e., xi(t) ∼N(12, 22) (with mean equal to 12 and standard deviation equal to 2), truncated on [0, 24]. Three synthetic datasets are created by drawing samples of sizes n = 0.3 × 106 from these three distributions. Some results are plotted on Figure 3: the empirical errors on different distributions are almost the same as those in Figures 2(a) and 2(c). One can refer to the full version of the paper [6] for the complete set of charts. 6 Deployment In earlier sections, we presented new LDP mechanisms geared towards repeated collection of counter data, with formal privacy guarantees even after being executed for a long period of time. Our mean estimation algorithm has been deployed by Microsoft starting with Windows Insiders in Windows 10 Fall Creators Update. The algorithm is used to collect the number of seconds that a user has spend using a particular app. Data collection is performed every 6 hours, with ϵ = 1. Memoization is applied across days and output perturbation uses γ = 0.2. According to Section 4, this makes a single round of data collection satisfy ϵ′-DP with ϵ′ = 0.686. One important feature of our deployment is that collecting usage data for multiple apps from a single user only leads to a minor additional privacy loss that is independent of the actual number of apps. Intuitively, this happens since we are collecting active usage data, and the total number of seconds that a user can spend across multiple apps in 6 hours is bounded by an absolute constant that is independent of the number of apps. Theorem 5. Using the 1BitMean mechanism with a parameter ϵ′ to simultaneously collect t counters x1, . . . , xt, where each xi satisfies 0 ≤xi ≤m and P i xi ≤m preserves ϵ′′-DP, where ϵ′′ = ϵ′ + eϵ′ −1. We defer the proof to the full version of the paper [6]. By Theorem 5, in deployment, a single round of data collection across an arbitrary large number of apps satisfies ϵ′′-DP, where ϵ′′ = 1.672. 9 References [1] S. Agrawal and J. R. Haritsa. A framework for high-accuracy privacy-preserving mining. In ICDE, pages 193–204, 2005. [2] N. Bansal, D. Coppersmith, and M. Sviridenko. Improved approximation algorithms for broadcast scheduling. SIAM Journal on Computing, 38(3):1157–1174, 2008. [3] R. Bassily, K. Nissim, U. Stemmer, and A. Thakurta. Practical locally private heavy hitters. In NIPS, 2017. [4] R. Bassily and A. D. Smith. Local, private, efficient protocols for succinct histograms. In STOC, pages 127–135, 2015. [5] R. Bassily, A. D. Smith, and A. Thakurta. Private empirical risk minimization: Efficient algorithms and tight error bounds. In FOCS, pages 464–473, 2014. [6] B. Ding, J. Kulkarni, and S. Yekhanin. Collecting telemetry data privately. arXiv, 2017. [7] J. C. Duchi, M. I. Jordan, and M. J. Wainwright. Local privacy and statistical minimax rates. In FOCS, pages 429–438, 2013. [8] J. C. Duchi, M. J. Wainwright, and M. I. Jordan. Local privacy and minimax bounds: Sharp rates for probability estimation. In NIPS, pages 1529–1537, 2013. [9] J. C. Duchi, M. J. Wainwright, and M. I. Jordan. Minimax optimal procedures for locally private estimation. CoRR, abs/1604.02390, 2016. [10] C. Dwork, F. McSherry, K. Nissim, and A. Smith. Calibrating noise to sensitivity in private data analysis. In TCC, pages 265–284, 2006. [11] C. Dwork, A. Roth, et al. The algorithmic foundations of differential privacy. Foundations and Trends R⃝in Theoretical Computer Science, 9(3–4):211–407, 2014. [12] Ú. Erlingsson, V. Pihur, and A. Korolova. RAPPOR: randomized aggregatable privacypreserving ordinal response. In CCS, pages 1054–1067, 2014. [13] A. Evfimievski, J. Gehrke, and R. Srikant. Limiting privacy breaches in privacy preserving data mining. In PODS, pages 211–222, 2003. [14] G. C. Fanti, V. Pihur, and Ú. Erlingsson. Building a RAPPOR with the unknown: Privacypreserving learning of associations and data dictionaries. PoPETs, 2016(3):41–61, 2016. [15] M. X. Goemans, M. Queyranne, A. S. Schulz, M. Skutella, and Y. Wang. Single machine scheduling with release dates. SIAM Journal on Discrete Mathematics, 15(2):165–192, 2002. [16] J. Hsu, S. Khanna, and A. Roth. Distributed private heavy hitters. In ICALP, pages 461–472, 2012. [17] P. Kairouz, K. Bonawitz, and D. Ramage. Discrete distribution estimation under local privacy. ICML, 2016. [18] J. Tang, A. Korolova, X. Bai, X. Wang, and X. Wang. Privacy loss in Apple’s implementation of differential privacy on MacOS 10.125. arXiv 1709.02753, 2017. [19] S. L. Warner. Randomized response: A survey technique for eliminating evasive answer bias. Journal of the American Statistical Association, 60(309):63–69, 1965. [20] L. Wasserman and S. Zhou. A statistical framework for differential privacy. Journal of the American Statistical Association, 105(489):375–389, 2010. 10
2017
99
7,241
Synthesized Policies for Transfer and Adaptation across Tasks and Environments Hexiang Hu ∗ University of Southern California Los Angeles, CA 90089 hexiangh@usc.edu Liyu Chen ∗ University of Southern California Los Angeles, CA 90089 liyuc@usc.edu Boqing Gong Tencent AI Lab Bellevue, WA 98004 boqinggo@outlook.com Fei Sha † Netflix Los Angeles, CA 90028 fsha@netflix.com Abstract The ability to transfer in reinforcement learning is key towards building an agent of general artificial intelligence. In this paper, we consider the problem of learning to simultaneously transfer across both environments (ε) and tasks (τ), probably more importantly, by learning from only sparse (ε, τ) pairs out of all the possible combinations. We propose a novel compositional neural network architecture which depicts a meta rule for composing policies from environment and task embeddings. Notably, one of the main challenges is to learn the embeddings jointly with the meta rule. We further propose new training methods to disentangle the embeddings, making them both distinctive signatures of the environments and tasks and effective building blocks for composing the policies. Experiments on GRIDWORLD and THOR, of which the agent takes as input an egocentric view, show that our approach gives rise to high success rates on all the (ε, τ) pairs after learning from only 40% of them. 1 Introduction Remarkable progress has been made in reinforcement learning in the last few years [16, 21, 26]. Among these, an agent learns to discover its best policy of actions to accomplish a task, by interacting with the environment. However, the skills the agent learns are often tied for a specific pair of the environment (ε) and the task (τ). Consequently, when the environment changes even slightly, the agent’s performance deteriorates drastically [11,28]. Thus, being able to swiftly adapt to new environments and transfer skills to new tasks is crucial for the agents to act in real-world settings. How can we achieve swift adaptation and transfer? In this paper, we consider several progressively difficult settings. In the first setting, the agent needs to adapt and transfer to a new pair of environment and task, when the agent has been exposed to the environment and the task before (but not simultaneously). Our goal is to use as few as possible seen pairs (i.e., a subset out of all possible (ε, τ) combinations, as sparse as possible) to train the agent. In the second setting, the agent needs to adapt and transfer across either environments or tasks, to those previously unseen by the agent. For instance, a home service robot needs to adapt from one home to another one but essentially accomplish the same sets of tasks, or the robot learns new tasks in the same home. In the third setting, the agent has encountered neither the environment nor the task ∗Equal Contribution. †On leave from University of Southern California (feisha@usc.edu). 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. Unseen Seen M envs N tasks (c) Transfer Setting 3 N tasks M envs (b) Transfer Setting 2 M envs (a) Transfer Setting 1 N tasks Figure 1: We consider a transfer learning scenario in reinforcement learning that considers transfer in both task and environment. Three different settings are presented here (see text for details). The red dots denote SEEN combinations, gray dots denote UNSEEN combinations, and arrows →denote transfer directions. before. Intuitively, the second and the third settings are much more challenging than the first one and appear to be intractable. Thus, the agent is allowed to have a very limited amount of learning data in the target environment and/or task, for instance, from one demonstration, in order to transfer knowledge from its prior learning. Figure 1 schematically illustrates the three settings. Several existing approaches have been proposed to address some of those settings [1–3,14,17,24,25]; for a detailed discussion, see related works in Section 2. A common strategy behind these works is to jointly learn through multi-task (reinforcement) learning [9,18,25]. Despite many progresses, however, adaptation and transfer remain a challenging problem in reinforcement learning where a powerful learning agent easily overfits to the environment or the task it has encountered, leading to poor generalization to new ones [11,28]. In this paper, we propose a new approach to tackle this challenge. Our main idea is to learn a meta rule to synthesize policies whenever the agent encounters new environments or tasks. Concretely, the meta rule uses the embeddings of the environment and the task to compose a policy, which is parameterized as the linear combination of the policy basis. On the training data from seen pairs of environments and tasks, our algorithm learns the embeddings as well as the policy basis. For new environments or tasks, the agent learns the corresponding embeddings only while it holds the policy basis fixed. Since the embeddings are low-dimensional, a limited amount of training data in the new environment or task is often adequate to learn well so as to compose the desired policy. While deep reinforcement learning algorithms are capable of memorizing and thus entangling representations of tasks and environments [28], we propose a disentanglement objective such that the embeddings for the tasks and the environments can be extracted to maximize the efficacy of the synthesized policy. Empirical studies demonstrate the importance of disentangling the representations. We evaluated our approach on GRIDWORLD which we have created and the photo-realistic robotic environment THOR [13]. We compare to several leading methods for transfer learning in a significant number of settings. The proposed approach outperforms most of them noticeably in improving the effectiveness of transfer and adaptation. 2 Related Work Multi-task [27] and transfer learning [24] for reinforcement learning (RL) have been long and extensively studied. Teh et al. [25] presented a distillation based method that transfers the knowledge from task specific agents to a multi-task learning agent. Andreas et al. [1] combined the option framework [23] and modular network [2], and presented an efficient multi-task learning approach which shares sub-policies across policy sketches of different tasks. Schaul et al. [19] encoded the goal state into value functions and showed its generalization to new goals. More recently, Oh et al. [17] proposed to learn a meta controller along with a set of parameterized policies to compose a policy that generalizes to unseen instructions. In contrast, we jointly consider the tasks and environments which can be both atomic, as we learn their embeddings without resorting to any external knowledge (e.g., text, attributes, etc.). Several recent works [3,6,14,29] factorize Q value functions with an environment-agnostic stateaction feature encoding function and task-specific embeddings. Our model is related to this line of 2 work in spirit. However, as opposed to learning the value functions, we directly learn a factorized policy network with strengthened disentanglement between environments and tasks. This allows us to easily generalize better to new environments or tasks, as shown in the empirical studies. 3 Approach We begin by introducing notations and stating the research problem formally. We then describe the main idea behind our approach, followed by the details of each component of the approach. 3.1 Problem Statement and Main Idea Problem statement. We follow the standard framework for reinforcement learning [22]. An agent interacts with an environment by sequentially choosing actions over time and aims to maximize its cumulative rewards. This learning process is abstractly described by a Markov decision process with the following components: a space of the agent’s state s ∈S, a space of possible actions a ∈A, an initial distribution of states p0(s), a stationary distribution characterizing how the state at time t transitions to the next state at (t + 1): p(st+1|st, at), and a reward function r := r(s, a). The agent’s actions follow a policy π(a|s) : S × A →[0, 1], defined as a conditional distribution p(a|s). The goal of the learning is to identify the optimal policy that maximizes the discounted cumulative reward: R = E[P∞ t=0 γtr(st, at)], where γ ∈(0, 1] is a discount factor and the expectation is taken with respect to the randomness in state transitions and taking actions. We denote by p(s|s′, t, π) the probability at state s after transitioning t time steps, starting from state s′ and following the policy π. With it, we define the discounted state distribution as ρπ(s) = P s′ P∞ t=1 γt−1p0(s′)p(s|s′, t, π). In this paper, we study how an agent learns to accomplish a variety of tasks in different environments. Let E and T denote the sets of the environments and the tasks, respectively. We assume the cases of finite sets but it is possible to extend our approach to infinite ones. While the most basic approach is to learn an optimal policy under each pair (ε, τ) of environment and task, we are interested in generalizing to all combinations in (E, T ), with interactive learning from a limited subset of (ε, τ) pairs. Clearly, the smaller the subset is, the more desirable the agent’s generalization capability is. Main idea. In the rest of the paper, we refers to the limited subset of pairs as seen pairs or training pairs and the rest ones as unseen pairs or testing pairs. We assume that the agent does not have access to the unseen pairs to obtain any interaction data to learn the optimal policies directly. In computer vision, such problems have been intensively studied in the frameworks of unsupervised domain adaptation and zero-shot learning, for example, [4,5,8,15]. There are totally |E| × |T | pairs – our goal is to learn from O(|E| + |T |) training pairs and generalize to all. Our main idea is to synthesize policies for the unseen pairs of environments and tasks. In particular, our agent learns two sets of embeddings: one for the environments and the other for the tasks. Moreover, the agent also learns how to compose policies using such embeddings. Note that learning both the embeddings and how to compose happens on the training pairs. For the unseen pairs, the policies are constructed and used right away — if there is interaction data, the policies can be further fine-tuned. However, even without such interaction data, the synthesized policies still perform well. To this end, we desire our approach to jointly supply two aspects: a compositional structure of Synthesized Policies (SYNPO) from environment and task embeddings and a disentanglement learning objective to learn the embeddings. We refer this entire framework as SYNPO and describe its details in what follows. 3.2 Policy Factorization and Composition Given a pair z = (ε, τ) of an environment ε and a task τ, we denote by eε and eτ their embeddings, respectively. The policy is synthesized with a bilinear mapping πz(a|s) ∝exp(ψT sU(eε, eτ)φa + bπ) (1) where bπ is a scalar bias, and ψs and φa are featurized states and actions (for instances, image pixels or the feature representations of an image). The bilinear mapping given by the matrix U is 3 Task Descriptor Task Embedding Environment Descriptor Environment Embedding State Feature Extraction Action Embedding Reward Prediction Policy Prediction L2 Normalize L2 Normalize e" <latexit sha1_base64="o0ScyitlsecfAWzDmpxR2anCJoc=">AB9HicbVDLSgNBEOz1GeMr6tHLYBA8hV0R9Bjw4jGKeUCyhNlJbzJkdmadmQ2EkO/w4kERr36MN/GSbIHTSxoKq6e6KUsG N9f1vb219Y3Nru7BT3N3bPzgsHR03jMo0wzpTQulWRA0KLrFuRXYSjXSJBLYjIa3M785Qm24ko92nGKY0L7kMWfUOinEbmdENaGCyW7pbJf8ecgqyTISRly1Lqlr05PsSxBaZmgxrQDP7XhGrLmcBpsZMZTCkb0j62HZU0QRNO5kdPyblTeiRW2pW0ZK7+npjQxJhxErnOhNqBWfZm4n9eO7PxTjhMs0sSrZYFGeCWEVmCZAe18isGDtCmebuVsIGVFNmXU5F0Kw/PIqaVxWAr8S3F+Vqw95HAU4hTO4g ACuoQp3UIM6MHiCZ3iFN2/kvXjv3seidc3LZ07gD7zPHzqQkm8=</latexit> <latexit sha1_base64="o0ScyitlsecfAWzDmpxR2anCJoc=">AB9HicbVDLSgNBEOz1GeMr6tHLYBA8hV0R9Bjw4jGKeUCyhNlJbzJkdmadmQ2EkO/w4kERr36MN/GSbIHTSxoKq6e6KUsG N9f1vb219Y3Nru7BT3N3bPzgsHR03jMo0wzpTQulWRA0KLrFuRXYSjXSJBLYjIa3M785Qm24ko92nGKY0L7kMWfUOinEbmdENaGCyW7pbJf8ecgqyTISRly1Lqlr05PsSxBaZmgxrQDP7XhGrLmcBpsZMZTCkb0j62HZU0QRNO5kdPyblTeiRW2pW0ZK7+npjQxJhxErnOhNqBWfZm4n9eO7PxTjhMs0sSrZYFGeCWEVmCZAe18isGDtCmebuVsIGVFNmXU5F0Kw/PIqaVxWAr8S3F+Vqw95HAU4hTO4g ACuoQp3UIM6MHiCZ3iFN2/kvXjv3seidc3LZ07gD7zPHzqQkm8=</latexit> <latexit sha1_base64="o0ScyitlsecfAWzDmpxR2anCJoc=">AB9HicbVDLSgNBEOz1GeMr6tHLYBA8hV0R9Bjw4jGKeUCyhNlJbzJkdmadmQ2EkO/w4kERr36MN/GSbIHTSxoKq6e6KUsG N9f1vb219Y3Nru7BT3N3bPzgsHR03jMo0wzpTQulWRA0KLrFuRXYSjXSJBLYjIa3M785Qm24ko92nGKY0L7kMWfUOinEbmdENaGCyW7pbJf8ecgqyTISRly1Lqlr05PsSxBaZmgxrQDP7XhGrLmcBpsZMZTCkb0j62HZU0QRNO5kdPyblTeiRW2pW0ZK7+npjQxJhxErnOhNqBWfZm4n9eO7PxTjhMs0sSrZYFGeCWEVmCZAe18isGDtCmebuVsIGVFNmXU5F0Kw/PIqaVxWAr8S3F+Vqw95HAU4hTO4g ACuoQp3UIM6MHiCZ3iFN2/kvXjv3seidc3LZ07gD7zPHzqQkm8=</latexit> <latexit sha1_base64="o0ScyitlsecfAWzDmpxR2anCJoc=">AB9HicbVDLSgNBEOz1GeMr6tHLYBA8hV0R9Bjw4jGKeUCyhNlJbzJkdmadmQ2EkO/w4kERr36MN/GSbIHTSxoKq6e6KUsG N9f1vb219Y3Nru7BT3N3bPzgsHR03jMo0wzpTQulWRA0KLrFuRXYSjXSJBLYjIa3M785Qm24ko92nGKY0L7kMWfUOinEbmdENaGCyW7pbJf8ecgqyTISRly1Lqlr05PsSxBaZmgxrQDP7XhGrLmcBpsZMZTCkb0j62HZU0QRNO5kdPyblTeiRW2pW0ZK7+npjQxJhxErnOhNqBWfZm4n9eO7PxTjhMs0sSrZYFGeCWEVmCZAe18isGDtCmebuVsIGVFNmXU5F0Kw/PIqaVxWAr8S3F+Vqw95HAU4hTO4g ACuoQp3UIM6MHiCZ3iFN2/kvXjv3seidc3LZ07gD7zPHzqQkm8=</latexit> e⌧ <latexit sha1_base64="b17TtuIqpVuQMgCnxZngNLs8a8=">AB7XicbVDLSgNBEOyNrxhfUY9eBoPgKeyKoMeAF49RzAOSJcxOZpMxszPLTK8Qv7BiwdFvPo/3vwbJ8keNLGgoajqprsrSqWw6Pv fXmFtfWNzq7hd2tnd2z8oHx41rc4M4w2mpTbtiFouheINFCh5OzWcJpHkrWh0M/NbT9xYodUDjlMeJnSgRCwYRSc1ea+LNOuVK37Vn4OskiAnFchR75W/un3NsoQrZJa2wn8FMJNSiY5NSN7M8pWxEB7zjqKIJt+Fkfu2UnDmlT2JtXCkc/X3xIQm1o6TyHUmFId2ZuJ/3mdDOPrcCJUmiFXbLEoziRBTWavk74wnKEcO0KZEe5WwobUIYuoJILIVh+eZU0L6qBXw3uLiu1+zyOIpzAKZxDAFdQg1uoQwMYPMI zvMKbp70X7937WLQWvHzmGP7A+/wBnGePMA=</latexit> <latexit sha1_base64="b17TtuIqpVuQMgCnxZngNLs8a8=">AB7XicbVDLSgNBEOyNrxhfUY9eBoPgKeyKoMeAF49RzAOSJcxOZpMxszPLTK8Qv7BiwdFvPo/3vwbJ8keNLGgoajqprsrSqWw6Pv fXmFtfWNzq7hd2tnd2z8oHx41rc4M4w2mpTbtiFouheINFCh5OzWcJpHkrWh0M/NbT9xYodUDjlMeJnSgRCwYRSc1ea+LNOuVK37Vn4OskiAnFchR75W/un3NsoQrZJa2wn8FMJNSiY5NSN7M8pWxEB7zjqKIJt+Fkfu2UnDmlT2JtXCkc/X3xIQm1o6TyHUmFId2ZuJ/3mdDOPrcCJUmiFXbLEoziRBTWavk74wnKEcO0KZEe5WwobUIYuoJILIVh+eZU0L6qBXw3uLiu1+zyOIpzAKZxDAFdQg1uoQwMYPMI zvMKbp70X7937WLQWvHzmGP7A+/wBnGePMA=</latexit> <latexit sha1_base64="b17TtuIqpVuQMgCnxZngNLs8a8=">AB7XicbVDLSgNBEOyNrxhfUY9eBoPgKeyKoMeAF49RzAOSJcxOZpMxszPLTK8Qv7BiwdFvPo/3vwbJ8keNLGgoajqprsrSqWw6Pv fXmFtfWNzq7hd2tnd2z8oHx41rc4M4w2mpTbtiFouheINFCh5OzWcJpHkrWh0M/NbT9xYodUDjlMeJnSgRCwYRSc1ea+LNOuVK37Vn4OskiAnFchR75W/un3NsoQrZJa2wn8FMJNSiY5NSN7M8pWxEB7zjqKIJt+Fkfu2UnDmlT2JtXCkc/X3xIQm1o6TyHUmFId2ZuJ/3mdDOPrcCJUmiFXbLEoziRBTWavk74wnKEcO0KZEe5WwobUIYuoJILIVh+eZU0L6qBXw3uLiu1+zyOIpzAKZxDAFdQg1uoQwMYPMI zvMKbp70X7937WLQWvHzmGP7A+/wBnGePMA=</latexit> <latexit sha1_base64="b17TtuIqpVuQMgCnxZngNLs8a8=">AB7XicbVDLSgNBEOyNrxhfUY9eBoPgKeyKoMeAF49RzAOSJcxOZpMxszPLTK8Qv7BiwdFvPo/3vwbJ8keNLGgoajqprsrSqWw6Pv fXmFtfWNzq7hd2tnd2z8oHx41rc4M4w2mpTbtiFouheINFCh5OzWcJpHkrWh0M/NbT9xYodUDjlMeJnSgRCwYRSc1ea+LNOuVK37Vn4OskiAnFchR75W/un3NsoQrZJa2wn8FMJNSiY5NSN7M8pWxEB7zjqKIJt+Fkfu2UnDmlT2JtXCkc/X3xIQm1o6TyHUmFId2ZuJ/3mdDOPrcCJUmiFXbLEoziRBTWavk74wnKEcO0KZEe5WwobUIYuoJILIVh+eZU0L6qBXw3uLiu1+zyOIpzAKZxDAFdQg1uoQwMYPMI zvMKbp70X7937WLQWvHzmGP7A+/wBnGePMA=</latexit> ↵(e", e⌧) <latexit sha1_base64="9UyHAbOkW8X/xPXTLrLzPRCcQKE=">ACBnicbVDLSgNBEJyNrxhfUY8iDAYhgoRdEfQY8OIxinlAdgm9k04yZHZ2mZkNhJCTF3/FiwdFvPoN3vwbJ4+DJhY01FR1M90VJoJr47rfTmZldW19I7uZ29re2d3L7x/UdJwqhlUWi1g1QtAouMSq4UZgI 1EIUSiwHvZvJn59gErzWD6YJBF3JO5yBsVIrf+yDSHpQxJY/AIWJ5iKW59Q+DaRnrXzBLblT0GXizUmBzFp5b/8dszSCKVhArRuem5ighEow5nAc5PNSbA+tDFpqUSItTBaHrGmJ5apU07sbIlDZ2qvydGEGk9jELbGYHp6UVvIv7nNVPTuQ5GXCapQclmH3VSQU1MJ5nQNlfIjBhaAkxuytlPVDAjE0uZ0PwFk9eJrWLkueWvLvLQvl+HkeWHJETUiQeuSJlcksqpEoYeSTP5JW8OU/Oi/PufMxaM8585pD8gfP5A7OBmKk=</latexit> <latexit sha1_base64="9UyHAbOkW8X/xPXTLrLzPRCcQKE=">ACBnicbVDLSgNBEJyNrxhfUY8iDAYhgoRdEfQY8OIxinlAdgm9k04yZHZ2mZkNhJCTF3/FiwdFvPoN3vwbJ4+DJhY01FR1M90VJoJr47rfTmZldW19I7uZ29re2d3L7x/UdJwqhlUWi1g1QtAouMSq4UZgI 1EIUSiwHvZvJn59gErzWD6YJBF3JO5yBsVIrf+yDSHpQxJY/AIWJ5iKW59Q+DaRnrXzBLblT0GXizUmBzFp5b/8dszSCKVhArRuem5ighEow5nAc5PNSbA+tDFpqUSItTBaHrGmJ5apU07sbIlDZ2qvydGEGk9jELbGYHp6UVvIv7nNVPTuQ5GXCapQclmH3VSQU1MJ5nQNlfIjBhaAkxuytlPVDAjE0uZ0PwFk9eJrWLkueWvLvLQvl+HkeWHJETUiQeuSJlcksqpEoYeSTP5JW8OU/Oi/PufMxaM8585pD8gfP5A7OBmKk=</latexit> <latexit sha1_base64="9UyHAbOkW8X/xPXTLrLzPRCcQKE=">ACBnicbVDLSgNBEJyNrxhfUY8iDAYhgoRdEfQY8OIxinlAdgm9k04yZHZ2mZkNhJCTF3/FiwdFvPoN3vwbJ4+DJhY01FR1M90VJoJr47rfTmZldW19I7uZ29re2d3L7x/UdJwqhlUWi1g1QtAouMSq4UZgI 1EIUSiwHvZvJn59gErzWD6YJBF3JO5yBsVIrf+yDSHpQxJY/AIWJ5iKW59Q+DaRnrXzBLblT0GXizUmBzFp5b/8dszSCKVhArRuem5ighEow5nAc5PNSbA+tDFpqUSItTBaHrGmJ5apU07sbIlDZ2qvydGEGk9jELbGYHp6UVvIv7nNVPTuQ5GXCapQclmH3VSQU1MJ5nQNlfIjBhaAkxuytlPVDAjE0uZ0PwFk9eJrWLkueWvLvLQvl+HkeWHJETUiQeuSJlcksqpEoYeSTP5JW8OU/Oi/PufMxaM8585pD8gfP5A7OBmKk=</latexit> <latexit sha1_base64="9UyHAbOkW8X/xPXTLrLzPRCcQKE=">ACBnicbVDLSgNBEJyNrxhfUY8iDAYhgoRdEfQY8OIxinlAdgm9k04yZHZ2mZkNhJCTF3/FiwdFvPoN3vwbJ4+DJhY01FR1M90VJoJr47rfTmZldW19I7uZ29re2d3L7x/UdJwqhlUWi1g1QtAouMSq4UZgI 1EIUSiwHvZvJn59gErzWD6YJBF3JO5yBsVIrf+yDSHpQxJY/AIWJ5iKW59Q+DaRnrXzBLblT0GXizUmBzFp5b/8dszSCKVhArRuem5ighEow5nAc5PNSbA+tDFpqUSItTBaHrGmJ5apU07sbIlDZ2qvydGEGk9jELbGYHp6UVvIv7nNVPTuQ5GXCapQclmH3VSQU1MJ5nQNlfIjBhaAkxuytlPVDAjE0uZ0PwFk9eJrWLkueWvLvLQvl+HkeWHJETUiQeuSJlcksqpEoYeSTP5JW8OU/Oi/PufMxaM8585pD8gfP5A7OBmKk=</latexit> β(e", e⌧) <latexit sha1_base64="R8vh5kuP0bCsmePTJOyeZXopkg=">ACBnicbVDLSgNBEJyN7/iKehRhMAgRJOyKoEfBi0cV84AkhN5JxkyO7vM9AZCyMmLv+LFgyJe/QZv/o2TmIMmFjTUVHUz3RUmSlry/S8vs7C4tLyupZd39jc2s7t7JZtnBqBJRGr2FRDsKikxhJUlhND EIUKqyEvauxX+mjsTLW9zRIsBFBR8u2FEBOauYO6iES8AI2630wmFipYn3C3ZMgPW7m8n7Rn4DPk2BK8myKm2bus96KRqhJqHA2lrgJ9QYgiEpFI6y9dRiAqIHaw5qiFC2xhOzhjxI6e0eDs2rjTxifp7YgiRtYModJ0RUNfOemPxP6+WUvuiMZQ6SQm1+PmonSpOMR9nwlvSoCA1cASEkW5XLrpgQJBLutCGZPnifl02LgF4Pbs/zl3TSOVbPDlmBeycXbJrdsNKTLAH9sRe2Kv36D17b97T2vGm87sT/wPr4BPKOYXw=</latexit> <latexit sha1_base64="R8vh5kuP0bCsmePTJOyeZXopkg=">ACBnicbVDLSgNBEJyN7/iKehRhMAgRJOyKoEfBi0cV84AkhN5JxkyO7vM9AZCyMmLv+LFgyJe/QZv/o2TmIMmFjTUVHUz3RUmSlry/S8vs7C4tLyupZd39jc2s7t7JZtnBqBJRGr2FRDsKikxhJUlhND EIUKqyEvauxX+mjsTLW9zRIsBFBR8u2FEBOauYO6iES8AI2630wmFipYn3C3ZMgPW7m8n7Rn4DPk2BK8myKm2bus96KRqhJqHA2lrgJ9QYgiEpFI6y9dRiAqIHaw5qiFC2xhOzhjxI6e0eDs2rjTxifp7YgiRtYModJ0RUNfOemPxP6+WUvuiMZQ6SQm1+PmonSpOMR9nwlvSoCA1cASEkW5XLrpgQJBLutCGZPnifl02LgF4Pbs/zl3TSOVbPDlmBeycXbJrdsNKTLAH9sRe2Kv36D17b97T2vGm87sT/wPr4BPKOYXw=</latexit> <latexit sha1_base64="R8vh5kuP0bCsmePTJOyeZXopkg=">ACBnicbVDLSgNBEJyN7/iKehRhMAgRJOyKoEfBi0cV84AkhN5JxkyO7vM9AZCyMmLv+LFgyJe/QZv/o2TmIMmFjTUVHUz3RUmSlry/S8vs7C4tLyupZd39jc2s7t7JZtnBqBJRGr2FRDsKikxhJUlhND EIUKqyEvauxX+mjsTLW9zRIsBFBR8u2FEBOauYO6iES8AI2630wmFipYn3C3ZMgPW7m8n7Rn4DPk2BK8myKm2bus96KRqhJqHA2lrgJ9QYgiEpFI6y9dRiAqIHaw5qiFC2xhOzhjxI6e0eDs2rjTxifp7YgiRtYModJ0RUNfOemPxP6+WUvuiMZQ6SQm1+PmonSpOMR9nwlvSoCA1cASEkW5XLrpgQJBLutCGZPnifl02LgF4Pbs/zl3TSOVbPDlmBeycXbJrdsNKTLAH9sRe2Kv36D17b97T2vGm87sT/wPr4BPKOYXw=</latexit> <latexit sha1_base64="R8vh5kuP0bCsmePTJOyeZXopkg=">ACBnicbVDLSgNBEJyN7/iKehRhMAgRJOyKoEfBi0cV84AkhN5JxkyO7vM9AZCyMmLv+LFgyJe/QZv/o2TmIMmFjTUVHUz3RUmSlry/S8vs7C4tLyupZd39jc2s7t7JZtnBqBJRGr2FRDsKikxhJUlhND EIUKqyEvauxX+mjsTLW9zRIsBFBR8u2FEBOauYO6iES8AI2630wmFipYn3C3ZMgPW7m8n7Rn4DPk2BK8myKm2bus96KRqhJqHA2lrgJ9QYgiEpFI6y9dRiAqIHaw5qiFC2xhOzhjxI6e0eDs2rjTxifp7YgiRtYModJ0RUNfOemPxP6+WUvuiMZQ6SQm1+PmonSpOMR9nwlvSoCA1cASEkW5XLrpgQJBLutCGZPnifl02LgF4Pbs/zl3TSOVbPDlmBeycXbJrdsNKTLAH9sRe2Kv36D17b97T2vGm87sT/wPr4BPKOYXw=</latexit> φa <latexit sha1_base64="el6Py6GIBQlOm5FdMp3Rgvsg2g=">AB7XicbVDLSgNBEOyNrxhfUY9eBoPgKeyKoMeAF49 RzAOSJfROJsmY2ZlZlYIS/7BiwdFvPo/3vwbJ8keNLGgoajqprsrSgQ31ve/vcLa+sbmVnG7tLO7t39QPjxqGpVqyhpUCaXbERomuGQNy61g7UQzjCPBWtH4Zua3npg2XMkHO0lYGONQ8gGnaJ3U7CYj3sNeueJX/TnIKglyUoEc9V75q9tXNI2ZtFS gMZ3AT2yYobacCjYtdVPDEqRjHLKOoxJjZsJsfu2UnDmlTwZKu5KWzNXfExnGxkziyHXGaEdm2ZuJ/3md1A6uw4zLJLVM0sWiQSqIVWT2OulzagVE0eQau5uJXSEGql1AZVcCMHy6ukeVEN/Gpwd1mp3edxFOETuEcAriCGtxCHRpA4RGe4RXePOW 9eO/ex6K14OUzx/AH3ucPiNaPIw=</latexit> <latexit sha1_base64="el6Py6GIBQlOm5FdMp3Rgvsg2g=">AB7XicbVDLSgNBEOyNrxhfUY9eBoPgKeyKoMeAF49 RzAOSJfROJsmY2ZlZlYIS/7BiwdFvPo/3vwbJ8keNLGgoajqprsrSgQ31ve/vcLa+sbmVnG7tLO7t39QPjxqGpVqyhpUCaXbERomuGQNy61g7UQzjCPBWtH4Zua3npg2XMkHO0lYGONQ8gGnaJ3U7CYj3sNeueJX/TnIKglyUoEc9V75q9tXNI2ZtFS gMZ3AT2yYobacCjYtdVPDEqRjHLKOoxJjZsJsfu2UnDmlTwZKu5KWzNXfExnGxkziyHXGaEdm2ZuJ/3md1A6uw4zLJLVM0sWiQSqIVWT2OulzagVE0eQau5uJXSEGql1AZVcCMHy6ukeVEN/Gpwd1mp3edxFOETuEcAriCGtxCHRpA4RGe4RXePOW 9eO/ex6K14OUzx/AH3ucPiNaPIw=</latexit> <latexit sha1_base64="el6Py6GIBQlOm5FdMp3Rgvsg2g=">AB7XicbVDLSgNBEOyNrxhfUY9eBoPgKeyKoMeAF49 RzAOSJfROJsmY2ZlZlYIS/7BiwdFvPo/3vwbJ8keNLGgoajqprsrSgQ31ve/vcLa+sbmVnG7tLO7t39QPjxqGpVqyhpUCaXbERomuGQNy61g7UQzjCPBWtH4Zua3npg2XMkHO0lYGONQ8gGnaJ3U7CYj3sNeueJX/TnIKglyUoEc9V75q9tXNI2ZtFS gMZ3AT2yYobacCjYtdVPDEqRjHLKOoxJjZsJsfu2UnDmlTwZKu5KWzNXfExnGxkziyHXGaEdm2ZuJ/3md1A6uw4zLJLVM0sWiQSqIVWT2OulzagVE0eQau5uJXSEGql1AZVcCMHy6ukeVEN/Gpwd1mp3edxFOETuEcAriCGtxCHRpA4RGe4RXePOW 9eO/ex6K14OUzx/AH3ucPiNaPIw=</latexit> <latexit sha1_base64="el6Py6GIBQlOm5FdMp3Rgvsg2g=">AB7XicbVDLSgNBEOyNrxhfUY9eBoPgKeyKoMeAF49 RzAOSJfROJsmY2ZlZlYIS/7BiwdFvPo/3vwbJ8keNLGgoajqprsrSgQ31ve/vcLa+sbmVnG7tLO7t39QPjxqGpVqyhpUCaXbERomuGQNy61g7UQzjCPBWtH4Zua3npg2XMkHO0lYGONQ8gGnaJ3U7CYj3sNeueJX/TnIKglyUoEc9V75q9tXNI2ZtFS gMZ3AT2yYobacCjYtdVPDEqRjHLKOoxJjZsJsfu2UnDmlTwZKu5KWzNXfExnGxkziyHXGaEdm2ZuJ/3md1A6uw4zLJLVM0sWiQSqIVWT2OulzagVE0eQau5uJXSEGql1AZVcCMHy6ukeVEN/Gpwd1mp3edxFOETuEcAriCGtxCHRpA4RGe4RXePOW 9eO/ex6K14OUzx/AH3ucPiNaPIw=</latexit> s <latexit sha1_base64="vesXAMwpxL8jPVUL4wO79X4Crs=">AB7XicbVDLSgNBEOyNrxhfUY9eBoPgKeyKoMeAF49 RzAOSJcxOepMxszPLzKwQv7BiwdFvPo/3vwbJ8keNLGgoajqprsrSgU31ve/vcLa+sbmVnG7tLO7t39QPjxqGpVphg2mhNLtiBoUXGLDciuwnWqkSwFY1uZn7rCbXhSj7YcYphQgeSx5xR6RmNzW8Z3rlil/15yCrJMhJBXLUe+Wvbl+xLEFpmaD GdAI/teGEasuZwGmpmxlMKRvRAXYclTRBE07m107JmVP6JFbalbRkrv6emNDEmHESuc6E2qFZ9mbif14ns/F1OEyzSxKtlgUZ4JYRWavkz7XyKwYO0KZ5u5WwoZU2ZdQCUXQrD8ipXlQDvxrcXVZq93kcRTiBUziHAK6gBrdQhwYweIRneIU3T3k v3rv3sWgtePnMfyB9/kDtOuPQA=</latexit> <latexit sha1_base64="vesXAMwpxL8jPVUL4wO79X4Crs=">AB7XicbVDLSgNBEOyNrxhfUY9eBoPgKeyKoMeAF49 RzAOSJcxOepMxszPLzKwQv7BiwdFvPo/3vwbJ8keNLGgoajqprsrSgU31ve/vcLa+sbmVnG7tLO7t39QPjxqGpVphg2mhNLtiBoUXGLDciuwnWqkSwFY1uZn7rCbXhSj7YcYphQgeSx5xR6RmNzW8Z3rlil/15yCrJMhJBXLUe+Wvbl+xLEFpmaD GdAI/teGEasuZwGmpmxlMKRvRAXYclTRBE07m107JmVP6JFbalbRkrv6emNDEmHESuc6E2qFZ9mbif14ns/F1OEyzSxKtlgUZ4JYRWavkz7XyKwYO0KZ5u5WwoZU2ZdQCUXQrD8ipXlQDvxrcXVZq93kcRTiBUziHAK6gBrdQhwYweIRneIU3T3k v3rv3sWgtePnMfyB9/kDtOuPQA=</latexit> <latexit sha1_base64="vesXAMwpxL8jPVUL4wO79X4Crs=">AB7XicbVDLSgNBEOyNrxhfUY9eBoPgKeyKoMeAF49 RzAOSJcxOepMxszPLzKwQv7BiwdFvPo/3vwbJ8keNLGgoajqprsrSgU31ve/vcLa+sbmVnG7tLO7t39QPjxqGpVphg2mhNLtiBoUXGLDciuwnWqkSwFY1uZn7rCbXhSj7YcYphQgeSx5xR6RmNzW8Z3rlil/15yCrJMhJBXLUe+Wvbl+xLEFpmaD GdAI/teGEasuZwGmpmxlMKRvRAXYclTRBE07m107JmVP6JFbalbRkrv6emNDEmHESuc6E2qFZ9mbif14ns/F1OEyzSxKtlgUZ4JYRWavkz7XyKwYO0KZ5u5WwoZU2ZdQCUXQrD8ipXlQDvxrcXVZq93kcRTiBUziHAK6gBrdQhwYweIRneIU3T3k v3rv3sWgtePnMfyB9/kDtOuPQA=</latexit> <latexit sha1_base64="vesXAMwpxL8jPVUL4wO79X4Crs=">AB7XicbVDLSgNBEOyNrxhfUY9eBoPgKeyKoMeAF49 RzAOSJcxOepMxszPLzKwQv7BiwdFvPo/3vwbJ8keNLGgoajqprsrSgU31ve/vcLa+sbmVnG7tLO7t39QPjxqGpVphg2mhNLtiBoUXGLDciuwnWqkSwFY1uZn7rCbXhSj7YcYphQgeSx5xR6RmNzW8Z3rlil/15yCrJMhJBXLUe+Wvbl+xLEFpmaD GdAI/teGEasuZwGmpmxlMKRvRAXYclTRBE07m107JmVP6JFbalbRkrv6emNDEmHESuc6E2qFZ9mbif14ns/F1OEyzSxKtlgUZ4JYRWavkz7XyKwYO0KZ5u5WwoZU2ZdQCUXQrD8ipXlQDvxrcXVZq93kcRTiBUziHAK6gBrdQhwYweIRneIU3T3k v3rv3sWgtePnMfyB9/kDtOuPQA=</latexit> ˜rz(s, a) <latexit sha1_base64="uMhnOPvpQd+Wwjt/9j7ViT7Q+GA=">AB+nicbVBNS8NAEN3Ur1q/Uj16WSxCBSmJCHosePFYxX5AG8JmM2XbjZhd6PU2J/ixYMiXv0l3vw3btsctPXBwO9GWbmBQlnSjvOt1VYWV1b3yhulra2d3b37PJ+S8WpNCkMY9lJyAKOBPQ1Exz6CQS BRwaAejq6nfvgepWCzu9DgBLyIDwfqMEm0k3y73NOMhZHLiP1bVKSYnvl1xas4MeJm4OamgHA3f/uqFMU0jEJpyolTXdRLtZURqRjlMSr1UQULoiAyga6gESgvm50+wcdGCXE/lqaExjP190RGIqXGUWA6I6KHatGbiv953VT3L72MiSTVIOh8UT/lWMd4mgMOmQSq+dgQiUzt2I6JQbdIqmRDcxZeXSeus5jo19+a8Ur/N4yiQ3SEqshF6iOrlEDNRFD+gZvaI368l6sd6tj3lrwcpnDtAfWJ8/fzuThw=</latexit> <latexit sha1_base64="uMhnOPvpQd+Wwjt/9j7ViT7Q+GA=">AB+nicbVBNS8NAEN3Ur1q/Uj16WSxCBSmJCHosePFYxX5AG8JmM2XbjZhd6PU2J/ixYMiXv0l3vw3btsctPXBwO9GWbmBQlnSjvOt1VYWV1b3yhulra2d3b37PJ+S8WpNCkMY9lJyAKOBPQ1Exz6CQS BRwaAejq6nfvgepWCzu9DgBLyIDwfqMEm0k3y73NOMhZHLiP1bVKSYnvl1xas4MeJm4OamgHA3f/uqFMU0jEJpyolTXdRLtZURqRjlMSr1UQULoiAyga6gESgvm50+wcdGCXE/lqaExjP190RGIqXGUWA6I6KHatGbiv953VT3L72MiSTVIOh8UT/lWMd4mgMOmQSq+dgQiUzt2I6JQbdIqmRDcxZeXSeus5jo19+a8Ur/N4yiQ3SEqshF6iOrlEDNRFD+gZvaI368l6sd6tj3lrwcpnDtAfWJ8/fzuThw=</latexit> <latexit sha1_base64="uMhnOPvpQd+Wwjt/9j7ViT7Q+GA=">AB+nicbVBNS8NAEN3Ur1q/Uj16WSxCBSmJCHosePFYxX5AG8JmM2XbjZhd6PU2J/ixYMiXv0l3vw3btsctPXBwO9GWbmBQlnSjvOt1VYWV1b3yhulra2d3b37PJ+S8WpNCkMY9lJyAKOBPQ1Exz6CQS BRwaAejq6nfvgepWCzu9DgBLyIDwfqMEm0k3y73NOMhZHLiP1bVKSYnvl1xas4MeJm4OamgHA3f/uqFMU0jEJpyolTXdRLtZURqRjlMSr1UQULoiAyga6gESgvm50+wcdGCXE/lqaExjP190RGIqXGUWA6I6KHatGbiv953VT3L72MiSTVIOh8UT/lWMd4mgMOmQSq+dgQiUzt2I6JQbdIqmRDcxZeXSeus5jo19+a8Ur/N4yiQ3SEqshF6iOrlEDNRFD+gZvaI368l6sd6tj3lrwcpnDtAfWJ8/fzuThw=</latexit> <latexit sha1_base64="uMhnOPvpQd+Wwjt/9j7ViT7Q+GA=">AB+nicbVBNS8NAEN3Ur1q/Uj16WSxCBSmJCHosePFYxX5AG8JmM2XbjZhd6PU2J/ixYMiXv0l3vw3btsctPXBwO9GWbmBQlnSjvOt1VYWV1b3yhulra2d3b37PJ+S8WpNCkMY9lJyAKOBPQ1Exz6CQS BRwaAejq6nfvgepWCzu9DgBLyIDwfqMEm0k3y73NOMhZHLiP1bVKSYnvl1xas4MeJm4OamgHA3f/uqFMU0jEJpyolTXdRLtZURqRjlMSr1UQULoiAyga6gESgvm50+wcdGCXE/lqaExjP190RGIqXGUWA6I6KHatGbiv953VT3L72MiSTVIOh8UT/lWMd4mgMOmQSq+dgQiUzt2I6JQbdIqmRDcxZeXSeus5jo19+a8Ur/N4yiQ3SEqshF6iOrlEDNRFD+gZvaI368l6sd6tj3lrwcpnDtAfWJ8/fzuThw=</latexit> ⇡z(a|s) <latexit sha1_base64="yCwp2OQiK/gaMRFA9L6BRPFQW2Q=">AB8nicbVBNS8NAEJ34WetX1aOXxSLUS0lE0GPBi8cq9gPSUDbTbt0swm7E6HW/gwvHhTx6q/x5r9x2+agrQ8GHu/NMDMvTKUw6Lrfzsrq2vrGZmGruL2zu7dfOjhsmiTjDdYIhPdDqnhUijeQIGSt1PNa RxK3gqH1O/9cC1EYm6x1HKg5j2lYgEo2glv5OK7iOp0Cdz1i2V3ao7A1kmXk7KkKPeLX1egnLYq6QSWqM7kpBmOqUTDJ8VOZnhK2ZD2uW+pojE3wXh28oScWqVHokTbUkhm6u+JMY2NGcWh7YwpDsyiNxX/8/wMo6tgLFSaIVdsvijKJMGETP8nPaE5QzmyhDIt7K2EDaimDG1KRuCt/jyMmeVz236t1elGt3eRwFOIYTqIAHl1CDG6hDAxgk8Ayv8Oag8+K8Ox/z1hUnzmCP3A+fwCAo5DH</latexit> <latexit sha1_base64="yCwp2OQiK/gaMRFA9L6BRPFQW2Q=">AB8nicbVBNS8NAEJ34WetX1aOXxSLUS0lE0GPBi8cq9gPSUDbTbt0swm7E6HW/gwvHhTx6q/x5r9x2+agrQ8GHu/NMDMvTKUw6Lrfzsrq2vrGZmGruL2zu7dfOjhsmiTjDdYIhPdDqnhUijeQIGSt1PNa RxK3gqH1O/9cC1EYm6x1HKg5j2lYgEo2glv5OK7iOp0Cdz1i2V3ao7A1kmXk7KkKPeLX1egnLYq6QSWqM7kpBmOqUTDJ8VOZnhK2ZD2uW+pojE3wXh28oScWqVHokTbUkhm6u+JMY2NGcWh7YwpDsyiNxX/8/wMo6tgLFSaIVdsvijKJMGETP8nPaE5QzmyhDIt7K2EDaimDG1KRuCt/jyMmeVz236t1elGt3eRwFOIYTqIAHl1CDG6hDAxgk8Ayv8Oag8+K8Ox/z1hUnzmCP3A+fwCAo5DH</latexit> <latexit sha1_base64="yCwp2OQiK/gaMRFA9L6BRPFQW2Q=">AB8nicbVBNS8NAEJ34WetX1aOXxSLUS0lE0GPBi8cq9gPSUDbTbt0swm7E6HW/gwvHhTx6q/x5r9x2+agrQ8GHu/NMDMvTKUw6Lrfzsrq2vrGZmGruL2zu7dfOjhsmiTjDdYIhPdDqnhUijeQIGSt1PNa RxK3gqH1O/9cC1EYm6x1HKg5j2lYgEo2glv5OK7iOp0Cdz1i2V3ao7A1kmXk7KkKPeLX1egnLYq6QSWqM7kpBmOqUTDJ8VOZnhK2ZD2uW+pojE3wXh28oScWqVHokTbUkhm6u+JMY2NGcWh7YwpDsyiNxX/8/wMo6tgLFSaIVdsvijKJMGETP8nPaE5QzmyhDIt7K2EDaimDG1KRuCt/jyMmeVz236t1elGt3eRwFOIYTqIAHl1CDG6hDAxgk8Ayv8Oag8+K8Ox/z1hUnzmCP3A+fwCAo5DH</latexit> <latexit sha1_base64="yCwp2OQiK/gaMRFA9L6BRPFQW2Q=">AB8nicbVBNS8NAEJ34WetX1aOXxSLUS0lE0GPBi8cq9gPSUDbTbt0swm7E6HW/gwvHhTx6q/x5r9x2+agrQ8GHu/NMDMvTKUw6Lrfzsrq2vrGZmGruL2zu7dfOjhsmiTjDdYIhPdDqnhUijeQIGSt1PNa RxK3gqH1O/9cC1EYm6x1HKg5j2lYgEo2glv5OK7iOp0Cdz1i2V3ao7A1kmXk7KkKPeLX1egnLYq6QSWqM7kpBmOqUTDJ8VOZnhK2ZD2uW+pojE3wXh28oScWqVHokTbUkhm6u+JMY2NGcWh7YwpDsyiNxX/8/wMo6tgLFSaIVdsvijKJMGETP8nPaE5QzmyhDIt7K2EDaimDG1KRuCt/jyMmeVz236t1elGt3eRwFOIYTqIAHl1CDG6hDAxgk8Ayv8Oag8+K8Ox/z1hUnzmCP3A+fwCAo5DH</latexit> Figure 2: Overview of our proposed model. Given a task and an environment, the corresponding embeddings eε and eτ are retrieved to compose the policy coefficients and reward coefficients. Such coefficients then linearly combine the shared basis and synthesize a policy (and a reward prediction) for the agent. parameterized as the linear combination of K basis matrices Θk, U(eε, eτ) = K X k=1 αk(eε, eτ)Θk. (2) Note that the combination coefficients depend on the specific pair of environment and task while the basis is shared across all pairs. They enable knowledge transfer from the seen pairs to unseen ones. Analogously, during learning (to be explained in detail in the later section), we predict the rewards by modeling them with the same set of basis but different combination coefficients: ˜rz(s, a) = ψT sV (eε, eτ)φa + br = ψT s X k βk(eε, eτ)Θk ! φa + br (3) where br is a scalar bias. Note that similar strategies for learning to predict rewards along with learning the policies have also been studied in recent works [3,12,29]. We find this strategy helpful too (cf. details in our empirical studies in Section 4). Figure 2 illustrates the model architecture described above. In this paper, we consider agents that take egocentric views of the environment, so a convolutional neural network is used to extract the state features ψs (cf. the bottom left panel of Figure 2). The action features φa are learned as a look-up table. Other model parameters include the basis Θ, the embeddings eε and eτ in the look-up tables respectively for the environments and the tasks, and the coefficient functions αk(·, ·) and βk(·, ·) for respectively synthesizing the policy and reward predictor. The coefficient functions αk(·, ·) and βk(·, ·) are parameterized with one-hidden-layer MLPs with the inputs being the concatenation of eε and eτ, respectfully. 3.3 Disentanglement of the Embeddings for Environments and Tasks In SYNPO, both the embeddings and the bilinear mapping are to be learnt. In an alternative but equivalent form, the policies are formulated as πz(a|s) ∝exp X k αk(eε, eτ)ψT sΘkφa + bπ ! . (4) As the defining coefficients αk are parameterized by a neural network whose inputs and parameters are both optimized, we need to impose additional structures such that the learned embeddings facilitate the transfer across environments or tasks. Otherwise, the learning could overfit to the seen pairs and consider each pair in unity, thus leading to poor generalization to unseen pairs. To this end, we introduce discriminative losses to distinguish different environments or tasks through the agent’s trajectories. Let x = {ψT sΘkφa} ∈RK be the state-action representation. For the agent interacting with an environment-task pair z = (ε, τ), we denote its trajectory as {x1, x2, · · · , xt, . . .}. We argue that a good embedding (either eε or eτ) ought to be able to tell from which environment or 4 task the trajectory is from. In particular, we formulate this as a multi-way classification where we desire xt (on average) is telltale of its environment ε or task τ: ℓε := − X t log P(ε|xt) with P(ε|xt) ∝exp g(xt)Teε  (5) ℓτ := − X t log P(τ|xt) with P(τ|xt) ∝exp h(xt)Teτ  (6) where we use two nonlinear mapping functions (g(·) and h(·), parameterized by one-hidden-layer MLPs) to transform the state-action representation xt, such that it retrieves eε and eτ. These two functions are also learnt using the interaction data from the seen pairs. 3.4 Learning Our approach (SYNPO) relies on the modeling assumption that the policies (and the reward predicting functions) are factorized in the axes of the environment and the task. This is a generic assumption and can be integrated with many reinforcement learning algorithms. In this paper, we study its effectiveness on imitation learning (mostly) and also reinforcement learning. In imitation learning, we denote by πe z the expert policy of combination z and apply the simple strategy of “behavior cloning” with random perturbations to learn our model from the expert demonstration [10]. We employ a cross-entropy loss for the policy as follows: ℓπz := −Es∼ρπez ,a∼πez[log πz(a|s)] A ℓ2 loss is used for learning the reward prediction function, ℓrz := Es∼ρπez ,a∼πez∥˜rz(s, a) − rz(s, a)∥2. Together with the disentanglement losses, they form the overall loss function L := Ez[ℓπz + λ1ℓrz + λ2ℓε + λ3ℓτ] which is then optimized through experience replay, as shown in Algorithm 1 in the supplementary materials (Suppl. Materials). We choose the value of those hyper-parameters λi so that the contributions of the objectives are balanced. More details are presented in the Suppl. Materials. 3.5 Transfer to Unseen Environments and Tasks Eq. 1 is used to synthesize a policy for any (ε, τ) pair, as long as the environment and the task — not necessarily the pair of them — have appeared at least once in the training pairs. If, however, a new environment and/or a new task appears (corresponding to the transfer setting 2 or 3 in Section 1), fine-tuning is required to extract their embeddings. To do so, we keep all the components of our model fixed except the look-up tables (i.e., embeddings) for the environment and/or the task. This effectively re-uses the policy composition rule and enables fast learning of the environment and/or the task embeddings, after seeing a few number of demonstrations. In the experiments, we find it works well even with only one shot of the demonstration. 4 Experiments We validate our approach (SYNPO) with extensive experimental studies, comparing with several baselines and state-of-the-art transfer learning methods. 4.1 Setup We experiment with two simulated environments3: GRIDWORLD and THOR [13], in both of which the agent takes as input an egocentric view (cf. Figure 3). Please refer to the Suppl. Materials for more details about the state feature function ψs used in these simulators. GRIDWORLD and tasks. We design twenty 16 × 16 grid-aligned mazes, some of which are visualized in Figure 3 (a). The mazes are similar in appearance but differ from each other in topology. There are five colored blocks as “treasures” and the agent’s goal is to collect the treasures in prespecified orders, e.g., “Pick up Red and then pick up Blue”. At a time step, the “egocentric” view 3The implementation of the two simulated environments are available on https://www.github.com/sha-lab/gridworld and https://www.github.com/sha-lab/thor, respectfully. 5 Figure 3: From left to right: (a) Some sample mazes of our GRIDWORLD dataset. They are similar in appearance but different in topology. Demonstrations of an agent’s egocentric views of (b) GRIDWORLD and (c) THOR. observed by the agent consists of the agent’s surrounding within a 3 × 3 window and the treasures’ locations. At each run, the locations of the agent and treasures are randomized. We consider twenty tasks in each environment, resulting |E| × |T | = 400 pairs of (ε, τ) in total. In the transfer setting 1 (cf. Figure 1(a)), we randomly choose 144 pairs as the training set under the constraint that each of the environments appears at least once, so does any task. The remaining 256 pairs are used for testing. For the transfer settings 2 and 3 (cf. Figure 1(b) and (c)), we postpone the detailed setups to Section 4.2.2. THOR [13] and tasks. We also test our method on THOR, a challenging 3D simulator where the agent is placed in indoor photo-realistic scenes. The tasks are to search and act on objects, e.g., “Put the cabbage to the fridge”. Different from GRIDWORLD, the objects’ locations are unknown so the agent has to search for the objects of interest by its understanding of the visual scene (cf. Figure 3(c)). There are 7 actions in total (look up, look down, turn left, turn right, move forward, open/close, pick up/put down). We run experiments with 19 scenes × 21 tasks in this simulator. Evaluations. We evaluate the agent’s performance by the averaged success rate (AvgSR.) for accomplishing the tasks, limiting the maximum trajectory length to 300 steps. For the results reported in numbers (e.g., Tables 1), we run 100 rounds of experiments for each (ε, τ) pair by randomizing the agent’s starting point and the treasures’ locations. To plot the convergence curves (e.g., Figure 4), we sample 100 (ε, τ) combinations and run one round of experiment for each to save computation time. We train our algorithms under 3 random seeds and report the mean and standard deviation (std). Competing methods. We compare our approach (SYNPO) with the following baselines and competing methods. Note that our problem setup is new, so we have to adapt the competing methods, which were proposed for other scenarios, to fit ours. • MLP. The policy network is a multilayer perceptron whose input concatenates state features and the environment and task embeddings. We train this baseline using the proposed losses for our approach, including the disentanglement losses ℓϵ, ℓτ; it performs worse without ℓϵ, ℓτ. • Successor Feature (SF). We learn the successor feature model [3] by Q-imitation learning for fair comparison. We strictly follow [14] to set up the learning objectives. The key difference of SF from our approach is its lack of capability in capturing the environmental priors. • Module Network (ModuleNet). We also implement a module network following [7]. Here we train an environment specific module for each environment and a task specific module for each task. The policy for a certain (ε, τ) pair is assembled by combining the corresponding environment module and task module. • Multi-Task Reinforcement Learning (MTL). This is a degenerated version of our method, where we ignore the distinctions of environments. We simply replace the environment embeddings by zeros for the coefficient functions. The disentanglement loss on task embeddings is still used since it leads to better performances than otherwise. Please refer to the Suppl. Materials for more experimental details, including all the twenty GRIDWORLD mazes, how we configure the rewards, optimization techniques, feature extraction for the states, and our implementation of the baseline methods. 4.2 Experimental Results on GRIDWORLD We first report results on the adaptation and transfer learning setting 1, as described in Section 1 and Figure 1(a). There, the agent acts upon a new pair of environment and task, both of which it has 6 0 25000 50000 75000 100000 125000 150000 175000 200000 iteration 0.0 0.2 0.4 0.6 0.8 average success rate MLP MTL ModuleNet SF SynPo 0 25000 50000 75000 100000 125000 150000 175000 200000 iteration 0.0 0.2 0.4 0.6 0.8 average success rate MLP MTL ModuleNet SF SynPo (a) AvgSR. over Time on SEEN (b) AvgSR. over Time on UNSEEN Figure 4: On GRIDWORLD. Averaged success rate (AvgSR) on SEEN pairs and UNSEEN pairs, respectively. Results are reported with |E| = 20 and |T | = 20. We report mean and std based on 3 training random seeds. 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 # of seen / # of total 0.2 0.4 0.6 0.8 1.0 average success rate Seen Unseen 0.00 0.25 0.50 0.75 1.00 1.25 1.50 1.75 2.00 steps 1e7 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 success rate on test set MLP MTL SynPo (a) Transfer learning performance curve (b) AvgSR. over Time on UNSEEN Figure 5: (a) Transfer learning performance (in AvgSR.) with respect to the ratio: # SEEN pairs / # TOTAL pairs, with |E| = 10 and |T | = 10. (b) Reinforcement learning performance on unseen pairs of different approaches (with PPO [20]). MLP overfits, MTL improves slightly, and SYNPO achieves 96.16% AvgSR. encountered during training but not in the same (ε, τ) pair. The goal is to use as sparse (ε, τ) pairs among all the combinations as possible to learn and yet still able to transfer successfully. 4.2.1 Transfer to Previously Encountered Environments and Tasks Main results. Table 1 and Figure 4 show the success rates and convergence curves, respectively, of our approach and the competing methods averaged over the seen and unseen (ε, τ) pairs. SYNPO consistently outperforms the others in terms of both the convergence and final performance, by a significant margin. On the seen split, MTL and MLP have similar performances, while MTL performs worse comparing to MLP on the unseen split (i.e. in terms of the generalization performance), possibly because it treats all the environments the same. We design an extreme scenario to further challenge the environment-agnostic methods (e.g., MTL). We reduce the window size of the agent’s view to one, so the agent sees the cell it resides and the treasures’ locations and nothing else. As a result, MTL suffers severely, MLP performs moderately well, and SYNPO outperforms both significantly (unseen AvgSR: MTL=6.1%, MLP=66.1%, SYNPO = 76.8%). We conjecture that the environment information embodied in the states is crucial for the agent to beware of and generalize across distinct environments. More discussions are deferred to the Suppl. Materials. How many seen (ε, τ) pairs do we need to transfer well? Figure 5(a) shows that, not surprisingly, the transfer learning performance increases as the number of seen pairs increases. The acceleration slows down after the seen/total ratio reaches 0.4. In other words, when there is a limited budget, our approach enables the agent to learn from 40% of all possible (ε, τ) pairs and yet generalize well across the tasks and environments. Does reinforcement learning help transfer? Beyond imitation learning, we further study our SYNPO for reinforcement learning (RL) under the same transfer learning setting. Specifically, we use PPO [20] to fine-tune the three top performing algorithms on GRIDWORLD. The results averaged over 3 random seeds are shown in Figure 5(b). We find that RL fine-tuning improves the transfer 7 Table 1: Performance (AvgSR.) of each method on GRIDWORLD (SEEN/UNSEEN = 144/256). Method SF ModuleNet MLP MTL SYNPO AvgSR. (SEEN) 0.0 ± 0.0% 50.9 ± 33.8% 69.0 ± 2.0% 64.1 ± 1.2% 83.3 ± 0.5 % AvgSR. (UNSEEN) 0.0 ± 0.0% 30.4 ± 20.1% 66.1 ± 2.6% 41.5 ± 1.4% 82.1 ± 1.5% Table 2: Performance of transfer learning in the settings 2 and 3 on GRIDWORLD Setting Method Cross Pair (Q’s ε, P’s τ) Cross Pair (P’s ε, Q’s τ) Q Pairs Setting 2 MLP 13.8% 20.7% 6.3% SYNPO 50.5% 21.5% 13.5% Setting 3 MLP 14.6% 18.3% 7.2% SYNPO 42.7% 19.4% 12.9% performance for all the three algorithms. In general, MLP suffers from over-fitting, MTL is improved moderately yet with a significant gap to the best result, and SYNPO achieves the best AvgSR, 96.16%. Ablation studies. We refer readers to the Suppl. Materials for ablation studies of the learning objectives. 4.2.2 Transfer to Previously Unseen Environments or Tasks Now we investigate how effectively one can schedule transfer from seen environments and tasks to unseen ones, i.e., the settings 2 and 3 described in Section 1 and Figure 1(b) and (c). The seen pairs (denoted by P) are constructed from ten environments and ten tasks; the remaining ten environments and ten tasks are unseen (denoted by Q). Then we have two settings of transfer learning. One is to transfer to pairs which cross the seen set P and unseen set Q – this corresponds to the setting 2 as the embeddings for either the unseen tasks or the unseen environments need to be learnt, but not both. Once these embeddings are learnt, we use them to synthesize policies for the test (ε, τ) pairs. This mimics the style “incremental learning of small pieces and integrating knowledge later”. The other is the transfer setting 3. The agent learns policies via learning embeddings for the tasks and environments of the unseen set Q and then composing, as described in section 3.5. Using the embeddings from P and Q, we can synthesize policies for any (ε, τ) pair. This mimics the style of “learning in giant jumps and connecting dots”. Main results. Table 2 contrasts the results of the two transfer learning settings. Clearly, setting 2 attains stronger performance as it “incrementally learns” the embeddings of either the tasks or the environments but not both, while setting 3 requires learning both simultaneously. It is interesting to see this result aligns with how effective human learns. Figure 6 visualizes the results whose rows are indexed by tasks and columns by environments. The seen pairs in P are in the upper-left quadrant and the unseen set Q is on the bottom-right. We refer readers to the Suppl. Materials for more details and discussions of the results. 4.3 Experimental Results on THOR Main results. The results on the THOR simulator are shown in Table 3, where we report our approach as well as the top performing ones on GRIDWORLD. Our SYNPO significantly outperforms three competing ones for both seen pairs and unseen pairs. Moreover, our approach also has the best performance of success rate on seen to unseen, indicating that it is less prone to overfiting than the other methods. More details are included in the Suppl. Materials. 5 Conclusion In this paper, we consider the problem of learning to simultaneously transfer across both environments (ε) and tasks (τ) under the reinforcement learning framework and, more importantly, by learning from only sparse (ε, τ) pairs out of all the possible combinations. Specifically, we present a novel approach that learns to synthesize policies from the disentangled embeddings of environments and tasks. We evaluate our approach for the challenging transfer scenarios in two simulators, GRID8 Env_0 Env_1 Env_2 Env_3 Env_4 Env_5 Env_6 Env_7 Env_8 Env_9 Env_10 Env_11 Env_12 Env_13 Env_14 Env_15 Env_16 Env_17 Env_18 Env_19 ('R', 'B') ('B', 'G') ('G', 'O') ('O', 'P') ('P', 'R') ('R', 'G') ('B', 'O') ('G', 'P') ('O', 'R') ('P', 'B') ('R', 'O') ('B', 'P') ('G', 'R') ('O', 'B') ('P', 'G') ('R', 'P') ('B', 'R') ('G', 'B') ('O', 'G') ('P', 'O') 0.90 1.00 0.90 0.90 1.00 0.90 1.00 0.90 1.00 1.00 0.50 0.30 0.40 0.60 0.50 0.30 0.50 0.30 0.60 0.70 1.00 0.90 1.00 0.90 0.90 1.00 0.90 1.00 0.90 0.90 0.30 0.50 0.80 0.50 0.50 0.30 0.50 0.30 0.70 0.60 1.00 1.00 1.00 1.00 1.00 1.00 1.00 0.90 1.00 0.90 0.50 0.40 0.80 0.50 0.40 0.50 0.20 0.30 0.50 0.70 0.90 1.00 0.80 0.90 1.00 1.00 0.90 0.90 0.80 0.90 0.50 0.10 0.80 0.60 0.50 0.70 0.20 0.40 0.40 0.70 0.90 1.00 1.00 0.90 1.00 0.80 0.90 0.80 0.90 1.00 0.40 0.50 0.60 0.50 0.60 0.50 0.30 0.10 0.50 0.40 1.00 0.90 1.00 0.80 0.90 1.00 1.00 1.00 0.90 1.00 0.40 0.20 0.50 0.30 0.60 0.80 0.50 0.50 0.70 0.80 1.00 1.00 1.00 0.80 1.00 1.00 0.90 0.80 1.00 1.00 0.70 0.30 0.80 0.90 0.40 0.30 0.40 0.20 0.40 0.40 0.80 0.80 0.90 0.90 1.00 1.00 1.00 0.90 1.00 0.90 0.30 0.50 0.70 0.60 0.50 0.50 0.60 0.20 0.80 0.40 1.00 1.00 1.00 0.80 1.00 1.00 0.90 0.80 1.00 1.00 0.60 0.60 0.60 0.50 0.60 0.50 0.50 0.20 0.60 0.60 0.90 1.00 0.90 1.00 0.70 1.00 0.80 0.80 1.00 1.00 0.60 0.70 0.80 0.60 0.80 0.60 0.70 0.40 0.40 0.60 0.30 0.00 0.20 0.40 0.10 0.40 0.20 0.10 0.50 0.30 0.20 0.10 0.20 0.20 0.10 0.10 0.00 0.00 0.10 0.00 0.20 0.30 0.40 0.30 0.10 0.40 0.20 0.30 0.10 0.20 0.10 0.00 0.20 0.10 0.20 0.20 0.10 0.00 0.20 0.10 0.10 0.50 0.30 0.10 0.10 0.10 0.30 0.40 0.10 0.40 0.20 0.20 0.10 0.20 0.40 0.20 0.20 0.10 0.20 0.30 0.50 0.20 0.30 0.20 0.10 0.20 0.20 0.50 0.20 0.20 0.20 0.10 0.10 0.10 0.70 0.10 0.20 0.00 0.20 0.10 0.00 0.10 0.20 0.20 0.20 0.10 0.40 0.10 0.20 0.50 0.10 0.00 0.20 0.10 0.10 0.10 0.00 0.10 0.30 0.10 0.40 0.30 0.50 0.40 0.30 0.50 0.40 0.50 0.50 0.30 0.20 0.10 0.20 0.20 0.10 0.10 0.20 0.00 0.30 0.30 0.20 0.40 0.20 0.10 0.40 0.30 0.50 0.00 0.40 0.20 0.20 0.20 0.50 0.40 0.00 0.30 0.30 0.10 0.40 0.30 0.10 0.20 0.20 0.00 0.00 0.00 0.10 0.20 0.20 0.20 0.00 0.00 0.20 0.00 0.10 0.00 0.00 0.00 0.20 0.00 0.50 0.00 0.10 0.00 0.10 0.00 0.00 0.00 0.10 0.30 0.00 0.10 0.00 0.10 0.10 0.10 0.00 0.10 0.10 0.10 0.00 0.00 0.00 0.10 0.00 0.00 0.10 0.00 0.20 0.00 0.10 0.10 0.00 0.10 0.10 0.00 0.20 0.10 0.00 0.00 Env_0 Env_1 Env_2 Env_3 Env_4 Env_5 Env_6 Env_7 Env_8 Env_9 Env_10 Env_11 Env_12 Env_13 Env_14 Env_15 Env_16 Env_17 Env_18 Env_19 ('R', 'B') ('B', 'G') ('G', 'O') ('O', 'P') ('P', 'R') ('R', 'G') ('B', 'O') ('G', 'P') ('O', 'R') ('P', 'B') ('R', 'O') ('B', 'P') ('G', 'R') ('O', 'B') ('P', 'G') ('R', 'P') ('B', 'R') ('G', 'B') ('O', 'G') ('P', 'O') 1.00 1.00 1.00 1.00 0.90 0.90 0.90 0.90 0.90 1.00 0.40 0.50 0.80 0.20 0.50 0.40 0.50 0.30 0.80 0.00 1.00 1.00 0.90 0.90 0.90 1.00 0.90 1.00 0.90 1.00 0.40 0.30 0.20 0.40 0.60 0.20 0.30 0.10 0.90 0.10 1.00 0.80 0.90 1.00 0.70 0.90 0.90 1.00 1.00 1.00 0.30 0.30 0.70 0.50 0.50 0.40 0.50 0.30 0.70 0.30 1.00 0.80 0.90 1.00 0.80 0.90 0.80 0.90 1.00 0.90 0.50 0.30 0.50 0.40 0.40 0.40 0.40 0.30 0.80 0.30 0.90 0.90 0.80 1.00 1.00 0.80 0.90 1.00 0.90 1.00 0.40 0.80 0.60 0.20 0.20 0.20 0.20 0.40 0.60 0.50 1.00 1.00 0.90 0.70 0.90 0.90 0.80 0.80 0.90 1.00 0.50 0.30 0.60 0.60 0.90 0.20 0.40 0.50 0.60 0.40 1.00 1.00 1.00 0.70 0.90 0.80 0.90 0.90 0.90 0.90 0.40 0.50 0.50 0.30 0.80 0.40 0.30 0.10 0.40 0.40 0.90 0.80 0.90 0.70 0.80 0.80 0.80 0.90 1.00 0.90 0.30 0.40 0.70 0.40 0.20 0.40 0.30 0.30 0.70 0.10 0.80 0.80 0.80 1.00 1.00 1.00 0.80 0.80 1.00 1.00 0.00 0.40 0.70 0.40 0.80 0.40 0.50 0.30 0.70 0.40 0.80 1.00 1.00 0.90 0.90 0.80 0.90 1.00 0.90 1.00 0.30 0.30 0.70 0.40 0.70 0.40 0.30 0.20 0.90 0.20 0.40 0.20 0.30 0.20 0.20 0.50 0.50 0.30 0.20 0.10 0.20 0.10 0.00 0.20 0.20 0.20 0.10 0.10 0.00 0.10 0.20 0.30 0.20 0.30 0.10 0.20 0.10 0.10 0.40 0.20 0.30 0.00 0.10 0.10 0.00 0.10 0.00 0.10 0.40 0.00 0.30 0.20 0.10 0.40 0.10 0.20 0.30 0.10 0.30 0.30 0.10 0.20 0.20 0.00 0.10 0.20 0.10 0.00 0.10 0.10 0.20 0.30 0.20 0.30 0.20 0.00 0.20 0.10 0.10 0.30 0.10 0.20 0.00 0.20 0.10 0.10 0.00 0.00 0.40 0.20 0.10 0.10 0.20 0.20 0.00 0.10 0.10 0.00 0.20 0.20 0.00 0.20 0.00 0.10 0.10 0.10 0.30 0.00 0.00 0.10 0.40 0.20 0.30 0.40 0.50 0.10 0.30 0.10 0.30 0.50 0.40 0.40 0.20 0.10 0.10 0.20 0.10 0.10 0.70 0.40 0.10 0.50 0.20 0.20 0.10 0.20 0.20 0.30 0.30 0.20 0.30 0.30 0.40 0.00 0.30 0.20 0.10 0.00 0.30 0.00 0.40 0.00 0.20 0.00 0.00 0.30 0.10 0.10 0.20 0.00 0.20 0.00 0.20 0.00 0.10 0.20 0.00 0.00 0.00 0.00 0.10 0.00 0.10 0.00 0.10 0.30 0.10 0.00 0.10 0.30 0.20 0.00 0.00 0.10 0.10 0.10 0.00 0.10 0.00 0.10 0.00 0.10 0.00 0.20 0.00 0.20 0.10 0.10 0.30 0.20 0.10 0.00 0.00 0.00 0.40 0.20 0.10 0.00 0.10 0.40 (a) Transfer Setting 2 (b) Transfer Setting 3 Figure 6: Transfer results of settings 2 and 3. AvgSRs are marked in the grid (see Suppl. Materials for more visually discernible plots). The tasks and environments in the purple cells are from the unseen Q set and the red cells correspond to the rest. Darker color means better performance. It shows that cross-task transfer is easier than cross-environment. Table 3: Performance of each method on THOR (SEEN/UNSEEN=144/199) Method ModuleNet MLP MTL SYNPO AvgSR. (SEEN) 51.5 % 47.5% 52.2% 55.6% AvgSR. (UNSEEN) 14.4 % 25.8% 33.3% 35.4% WORLD and THOR. Empirical results verify that our method generalizes better across environments and tasks than several competing baselines. Acknowledgments We appreciate the feedback from the reviewers. This work is partially supported by DARPA# FA8750-18-2-0117, NSF IIS-1065243, 1451412, 1513966/ 1632803/1833137, 1208500, CCF-1139148, a Google Research Award, an Alfred P. Sloan Research Fellowship, gifts from Facebook and Netflix, and ARO# W911NF-12-1-0241 and W911NF-15-1-0484. References [1] J. Andreas, D. Klein, and S. Levine. Modular multitask reinforcement learning with policy sketches. In ICML, 2017. [2] J. Andreas, M. Rohrbach, T. Darrell, and D. Klein. Neural module networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 39–48, 2016. [3] A. Barreto, W. Dabney, R. Munos, J. J. Hunt, T. Schaul, D. Silver, and H. P. van Hasselt. Successor features for transfer in reinforcement learning. In NIPS, 2017. [4] S. Changpinyo, W.-L. Chao, B. Gong, and F. Sha. Synthesized classifiers for zero-shot learning. 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 5327–5336, 2016. [5] W.-L. Chao, S. Changpinyo, B. Gong, and F. Sha. An empirical study and analysis of generalized zero-shot learning for object recognition in the wild. In ECCV, 2016. [6] P. Dayan. Improving generalization for temporal difference learning: The successor representation. Neural Computation, 5:613–624, 1993. [7] C. Devin, A. Gupta, T. Darrell, P. Abbeel, and S. Levine. Learning modular neural network policies for multi-task and multi-robot transfer. In Robotics and Automation (ICRA), 2017 IEEE International Conference on, pages 2169–2176. IEEE, 2017. [8] B. Gong, Y. Shi, F. Sha, and K. Grauman. Geodesic flow kernel for unsupervised domain adaptation. 2012 IEEE Conference on Computer Vision and Pattern Recognition, pages 2066–2073, 2012. [9] G. Hinton, O. Vinyals, and J. Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015. [10] J. Ho and S. Ermon. Generative adversarial imitation learning. In Advances in Neural Information Processing Systems, pages 4565–4573, 2016. 9 [11] S. Huang, N. Papernot, I. Goodfellow, Y. Duan, and P. Abbeel. Adversarial attacks on neural network policies. arXiv preprint arXiv:1702.02284, 2017. [12] M. Jaderberg, V. Mnih, W. Czarnecki, T. Schaul, J. Z. Leibo, D. Silver, and K. Kavukcuoglu. Reinforcement learning with unsupervised auxiliary tasks. CoRR, abs/1611.05397, 2016. [13] E. Kolve, R. Mottaghi, D. Gordon, Y. Zhu, A. Gupta, and A. Farhadi. Ai2-thor: An interactive 3d environment for visual ai. CoRR, abs/1712.05474, 2017. [14] T. D. Kulkarni, A. Saeedi, S. Gautam, and S. Gershman. Deep successor reinforcement learning. CoRR, abs/1606.02396, 2016. [15] I. Misra, A. Gupta, and M. Hebert. From red wine to red tomato: Composition with context. CVPR 2017, pages 1160–1169, 2017. [16] V. Mnih, K. Kavukcuoglu, D. Silver, A. A. Rusu, J. Veness, M. G. Bellemare, A. Graves, M. A. Riedmiller, A. Fidjeland, G. Ostrovski, S. Petersen, C. Beattie, A. Sadik, I. Antonoglou, H. King, D. Kumaran, D. Wierstra, S. Legg, and D. Hassabis. Human-level control through deep reinforcement learning. Nature, 518:529–533, 2015. [17] J. Oh, S. Singh, H. Lee, and P. Kohli. Zero-shot task generalization with multi-task deep reinforcement learning. arXiv preprint arXiv:1706.05064, 2017. [18] E. Parisotto, J. L. Ba, and R. Salakhutdinov. Actor-mimic: Deep multitask and transfer reinforcement learning. arXiv preprint arXiv:1511.06342, 2015. [19] T. Schaul, D. Horgan, K. Gregor, and D. Silver. Universal value function approximators. In ICML, 2015. [20] J. Schulman, F. Wolski, P. Dhariwal, A. Radford, and O. Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017. [21] D. Silver, T. Hubert, J. Schrittwieser, I. Antonoglou, M. Lai, A. Guez, M. Lanctot, L. Sifre, D. Kumaran, T. Graepel, T. P. Lillicrap, K. Simonyan, and D. Hassabis. Mastering chess and shogi by self-play with a general reinforcement learning algorithm. CoRR, abs/1712.01815, 2017. [22] R. S. Sutton and A. G. Barto. Reinforcement learning: An introduction. IEEE Transactions on Neural Networks, 16:285–286, 1998. [23] R. S. Sutton, D. Precup, and S. Singh. Between mdps and semi-mdps: A framework for temporal abstraction in reinforcement learning. Artificial intelligence, 112(1-2):181–211, 1999. [24] M. E. Taylor and P. Stone. Transfer learning for reinforcement learning domains: A survey. Journal of Machine Learning Research, 10:1633–1685, 2009. [25] Y. Teh, V. Bapst, W. M. Czarnecki, J. Quan, J. Kirkpatrick, R. Hadsell, N. Heess, and R. Pascanu. Distral: Robust multitask reinforcement learning. In Advances in Neural Information Processing Systems, pages 4499–4509, 2017. [26] O. Vinyals, T. Ewalds, S. Bartunov, P. Georgiev, A. S. Vezhnevets, M. Yeo, A. Makhzani, H. Küttler, J. Agapiou, J. Schrittwieser, et al. Starcraft ii: a new challenge for reinforcement learning. arXiv preprint arXiv:1708.04782, 2017. [27] A. Wilson, A. Fern, S. Ray, and P. Tadepalli. Multi-task reinforcement learning: a hierarchical bayesian approach. In Proceedings of the 24th international conference on Machine learning, pages 1015–1022. ACM, 2007. [28] C. Zhang, O. Vinyals, R. Munos, and S. Bengio. A study on overfitting in deep reinforcement learning. arXiv preprint arXiv:1804.06893, 2018. [29] Y. Zhu, D. Gordon, E. Kolve, D. Fox, L. Fei-Fei, A. Gupta, R. Mottaghi, and A. Farhadi. Visual semantic planning using deep successor representations. In Proceedings of the IEEE International Conference on Computer Vision, volume 2, page 7, 2017. 10
2018
1
7,242
Analytic solution and stationary phase approximation for the Bayesian lasso and elastic net Tom Michoel The Roslin Institute, The University of Edinburgh, UK Computational Biology Unit, Department of Informatics, University of Bergen, Norway tom.michoel@uib.no Abstract The lasso and elastic net linear regression models impose a double-exponential prior distribution on the model parameters to achieve regression shrinkage and variable selection, allowing the inference of robust models from large data sets. However, there has been limited success in deriving estimates for the full posterior distribution of regression coefficients in these models, due to a need to evaluate analytically intractable partition function integrals. Here, the Fourier transform is used to express these integrals as complex-valued oscillatory integrals over “regression frequencies”. This results in an analytic expansion and stationary phase approximation for the partition functions of the Bayesian lasso and elastic net, where the non-differentiability of the double-exponential prior has so far eluded such an approach. Use of this approximation leads to highly accurate numerical estimates for the expectation values and marginal posterior distributions of the regression coefficients, and allows for Bayesian inference of much higher dimensional models than previously possible. 1 Introduction Statistical modelling of high-dimensional data sets where the number of variables exceeds the number of experimental samples may result in over-fitted models that do not generalize well to unseen data. Prediction accuracy in these situations can often be improved by shrinking regression coefficients towards zero [1]. Bayesian methods achieve this by imposing a prior distribution on the regression coefficients whose mass is concentrated around zero. For linear regression, the most popular methods are ridge regression [2], which has a normally distributed prior; lasso regression [3], which has a double-exponential or Laplace distribution prior; and elastic net regression [4], whose prior interpolates between the lasso and ridge priors. The lasso and elastic net are of particular interest, because in their maximum-likelihood solutions, a subset of regression coefficients are exactly zero. However, maximum-likelihood solutions only provide a point estimate for the regression coefficients. A fully Bayesian treatment that takes into account uncertainty due to data noise and limited sample size, and provides posterior distributions and confidence intervals, is therefore of great interest. Unsurprisingly, Bayesian inference for the lasso and elastic net involves analytically intractable partition function integrals and requires the use of numerical Gibbs sampling techniques [5–8]. However, Gibbs sampling is computationally expensive and, particularly in high-dimensional settings, convergence may be slow and difficult to assess or remedy [9–12]. An alternative to Gibbs sampling for Bayesian inference is to use asymptotic approximations to the intractable integrals based on Laplace’s method [13, 14]. However, the Laplace approximation requires twice differentiable loglikelihood functions, and cannot be applied to the lasso and elastic net models as they contain a non-differentiable term proportional to the sum of absolute values (i.e. ℓ1-norm) of the regression coefficients. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. Alternatives to the Laplace approximation have been considered for statistical models where the Fisher information matrix is singular, and no asymptotic approximation using normal distributions is feasible [15, 16]. However, in ℓ1-penalized models, the singularity originates from the prior distributions on the model parameters, and the Fisher information matrix remains positive definite. Here we show that in such models, approximate Bayesian inference is in fact possible using a Laplace-like approximation, more precisely the stationary phase or saddle point approximation for complex-valued oscillatory integrals [17]. This is achieved by rewriting the partition function integrals in terms of “frequencies” instead of regression coefficients, through the use of the Fourier transform. The appearance of the Fourier transform in this context should not come as a big surprise. The stationary phase approximation can be used to obtain or invert characteristic functions, which are of course Fourier transforms [18]. More to the point of this paper, there is an intimate connection between the Fourier transform of the exponential of a convex function and the Legendre-Fenchel transform of that convex function, which plays a fundamental role in physics by linking microscopic statistical mechanics to macroscopic thermodynamics and quantum to classical mechanics [19]. In particular, convex duality [20, 21], which maps the solution of a convex optimization problem to that of its dual, is essentially equivalent to writing the partition function of a Gibbs probability distribution in coordinate or frequency space (Appendix A). Convex duality principles have been essential to characterize analytical properties of the maximumlikelihood solutions of the lasso and elastic net regression models [22–27]. This paper shows that equally powerful duality principles exist to study Bayesian inference problems. 2 Analytic results We consider the usual setup for linear regression where there are n observations of p predictor variables and one response variable, and the effects of the predictors on the response are to be determined by minimizing the least squares cost function ∥y −Ax∥2 subject to additional constraints, where y ∈Rn are the response data, A ∈Rn×p are the predictor data, x ∈Rp are the regression coefficients which need to be estimated and ∥v∥= (Pn i=1 |vi|2)1/2 is the ℓ2-norm. Without loss of generality, it is assumed that the response and predictors are centred and standardized, n X i=1 yi = n X i=1 Aij = 0 and n X i=1 y2 i = n X i=1 A2 ij = n for j ∈{1, 2, . . . , p}. (1) In a Bayesian setting, a hierarchical model is assumed where each sample yi is drawn independently from a normal distribution with mean Ai•x and variance σ2, where Ai• denotes the ith row of A, or more succintly, p(y | A, x) = N(Ax, σ21), (2) where N denotes a multivariate normal distribution, and the regression coefficients x are assumed to have a prior distribution p(x) ∝exp h −n σ2 λ∥x∥2 + 2µ∥x∥1 i , (3) where ∥x∥1 = Pp j=1 |xj| is the ℓ1-norm, and the prior distribution is defined upto a normalization constant. The apparent dependence of the prior distribution on the data via the dimension paramater n only serves to simplify notation, allowing the posterior distribution of the regression coefficients to be written, using Bayes’ theorem, as p(x | y, A) ∝p(y | x, A)p(x) ∝e−n σ2 L(x|y,A), (4) where L(x | y, A) = 1 2n∥y −Ax∥2 + λ∥x∥2 + 2µ∥x∥1 (5) = xT AT A 2n + λ1  x −2 AT y 2n T x + 2µ∥x∥1 + 1 2n∥y∥2 (6) is minus the posterior log-likelihood function. The maximum-likelihood solutions of the lasso (λ = 0) and elastic net (λ > 0) models are obtained by minimizing L, where the relative scaling of the penalty 2 parameters to the sample size n corresponds to the notational conventions of [28]1. In the current setup, it is assumed that the parameters λ ≥0, µ > 0 and σ2 > 0 are given a priori. To facilitate notation, a slightly more general class of cost functions is defined as H(x | C, w, µ) = xT Cx −2wT x + 2µ∥x∥1, (7) where C ∈Rp×p is a positive-definite matrix, w ∈Rp is an arbitrary vector and µ > 0. After discarding a constant term, L(x | y, A) is of this form, as is the so-called “non-naive” elastic net, where C = ( 1 2nAT A + λ1)/(λ + 1) [4]. More importantly perhaps, eq. (7) also covers linear mixed models, where samples need not be independent [29]. In this case, eq. (2) is replaced by p(y | A, x) = N(Ax, σ2K), for some covariance matrix K ∈Rn×n, resulting in a posterior minus log-likelihood function with C = 1 2nAT K−1A + λ1 and w = 1 2nAT K−1y. The requirement that C is positive definite, and hence invertible, implies that H is strictly convex and hence has a unique minimizer. For the lasso (λ = 0) this only holds without further assumptions if n ≥p [26]; for the elastic net (λ > 0) there is no such constraint. The Gibbs distribution on Rp for the cost function H(x | C, w, µ) with inverse temperature τ is defined as p(x | C, w, µ) = e−τH(x|C,w,µ) Z(C, w, µ) . For ease of notation we will henceforth drop explicit reference to C, w and µ. The normalization constant Z = R Rp e−τH(x)dx is called the partition function. There is no known analytic solution for the partition function integral. However, in the posterior distribution (4), the inverse temperature τ = n σ2 is large, firstly because we are interested in high-dimensional problems where n is large (even if it may be small compared to p), and secondly because we assume a priori that (some of) the predictors are informative for the response variable and that therefore σ2, the amount of variance of y unexplained by the predictors, must be small. It therefore makes sense to seek an analytic approximation to the partition function for large values of τ. However, the usual approach to approximate e−τH(x) by a Gaussian in the vicinity of the minimizer of H and apply a Laplace approximation [17] is not feasible, because H is not twice differentiable. Instead we observe that e−τH(x) = e−2τf(x)e−2τg(x) where f(x) = 1 2xT Cx −wT x (8) g(x) = µ p X j=1 |xj|. (9) Using Parseval’s identity for Fourier transforms (Appendix A.1), it follows that (Appendix A.3) Z = Z Rp e−2τf(x)e−2τg(x)dx = 1 (πτ) p 2 p det(C) Z Rp e−τ(k−iw)T C−1(k−iw) p Y j=1 µ k2 j + µ2 dk. (10) After a change of variables z = −ik, Z can be written as a p-dimensional complex contour integral Z = (−iµ)p (πτ) p 2 p det(C) Z i∞ −i∞ · · · Z i∞ −i∞ eτ(z−w)T C−1(z−w) p Y j=1 1 µ2 −z2 j dz1 . . . dzp. (11) Cauchy’s theorem [30, 31] states that this integral remains invariant if the integration contours are deformed, as long as we remain in a domain where the integrand does not diverge (Appendix A.4). The analogue of Laplace’s approximation for complex contour integrals, known as the stationary phase, steepest descent or saddle point approximation, then states that an integral of the form (11) can be approximated by a Gaussian integral along a steepest descent contour passing through the saddle point of the argument of the exponential function [17]. Here, the function (z −w)T C−1(z −w) has a saddle point at z = w. If |wj| < µ for all j, the standard stationary phase approximation can be applied directly, but this only covers the uninteresting situation where the maximum-likelihood solution ˆx = argminx H(x) = 0 (Appendix A.5). As soon as |wj| > µ for at least one j, the standard 1To be precise, in [28] the penalty term is written as ˜λ( 1−α 2 ∥x∥2 2 + α∥x∥1), wich is obtained from (5) by setting ˜λ = 2(λ + µ) and α = µ λ+µ. 3 argument breaks down, since to deform the integration contours from the imaginary axes to parallel contours passing through the saddle point z0 = w, we would have to pass through a pole (divergence) of the function Q j(µ2 −z2 j )−1 (Figure S1). Motivated by similar, albeit one-dimensional, analyses in non-equilibrium physics [32, 33], we instead consider a temperature-dependent function H∗ τ (z) = (z −w)T C−1(z −w) −1 τ p X j=1 ln(µ2 −z2 j ), (12) which is well-defined on the domain D = {z ∈Cp : |ℜzj| < µ, j = 1, . . . , p}, where ℜdenotes the real part of a complex number. This function has a unique saddle point in D, regardless whether |wj| < µ or not (Figure S1). Our main result is a steepest descent approximation of the partition function around this saddle point. Theorem 1 Let C ∈Rp×p be a positive definite matrix, w ∈Rp and µ > 0. Then the complex function H∗ τ defined in eq. (12) has a unique saddle point ˆuτ that is real, ˆuτ ∈D ∩Rp, and is a solution of the set of third order equations (µ2 −u2 j)[C−1(w −u)]j −uj τ = 0 , u ∈Rp, j ∈{1, . . . , p}. (13) For Q(z) a complex analytic function of z ∈Cp, the generalized partition function Z[Q] = 1 (πτ) p 2 p det(C) Z Rp e−τ(k−iw)T C−1(k−iw)Q(−ik) p Y j=1 µ k2 j + µ2 dk. can be analytically expressed as Z[Q] =  µ √τ p eτ(w−ˆuτ )T C−1(w−ˆuτ ) p Y j=1 1 q µ2 + ˆu2 τ,j 1 p det(C + Dτ) exp n 1 4τ 2 ∆τ o eRτ (ik)Q(ˆuτ + ik) k=0 , (14) where Dτ is a diagonal matrix with diagonal elements (Dτ)jj = τ(µ2 −ˆu2 τ,j)2 µ2 + ˆu2 τ,j , (15) ∆τ is the differential operator ∆τ = p X i,j=1  τDτ(C + Dτ)−1C  ij ∂2 ∂ki∂kj (16) and Rτ(z) = p X j=1 X m≥3 1 m h 1 (µ −ˆuτ,j)m + (−1)m (µ + ˆuτ,j)m i zm j . (17) This results in an analytic approximation Z[Q] ∼  µ √τ p eτ(w−ˆuτ )T C−1(w−ˆuτ ) p Y j=1 1 q µ2 + ˆu2 τ,j Q(ˆuτ) p det(C + Dτ) . (18) The analytic expression in eq. (14) follows by changing the integration contours to pass through the saddle point ˆuτ, and using a Taylor expansion of H∗ τ (z) around the saddle point along the steepest descent contour. However, because ∆τ and Rτ depend on τ, it is not a priori evident that (18) holds. A detailed proof is given in Appendix B. The analytic approximation in eq. (18) can be simplified further by expanding ˆuτ around its leading term, resulting in an expression that recognizably converges to the sparse maximum-likelihood solution (Appendix C). While eq. (18) is computationally more expensive to calculate than the corresponding expression in terms of the maximum-likelihood solution, it was found to be numerically more accurate (Section 3). 4 Various quantities derived from the posterior distribution can be expressed in terms of generalized partition functions. The most important of these are the expectation values of the regression coefficients, which, using elementary properties of the Fourier transform (Appendix A.6), can be expressed as E(x) = 1 Z Z Rp x e−τH(x) = Z  C−1(w −z)  Z ∼C−1(w −ˆuτ). The leading term, ˆxτ ≡C−1(w −ˆuτ), (19) can be interpreted as an estimator for the regression coefficients in its own right, which interpolates smoothly (as a function of τ) between the ridge regression estimator ˆxridge = C−1w at τ = 0 and the maximum-likelihood elastic net estimator ˆx = C−1(w −ˆu) at τ = ∞, where ˆu = limτ→∞ˆuτ satisfies a box-constrained optimization problem (Appendix C). The marginal posterior distribution for a subset I ⊂{1, . . . , p} of regression coefficients is defined as p(xI) = 1 Z(C, w, µ) Z R|Ic| e−τH(x|C,w,µ)dxIc where Ic = {1, . . . , p} \ I is the complement of I, |I| denotes the size of a set I, and we have reintroduced temporarily the dependency on C, w and µ as in eq. (7). A simple calculation shows that the remaining integral is again a partition function of the same form, more precisely: p(xI) = e−τ(xT I CIxI−2wT I xI+2µ∥xI∥1) Z(CIc, wIc −xT I CI,Ic, µ) Z(C, w, µ) , (20) where the subscripts I and Ic indicate sub-vectors and sub-matrices on their respective coordinate sets. Hence the analytic approximation in eq. (14) can be used to approximate numerically each term in the partition function ratio and obtain an approximation to the marginal posterior distributions. The posterior predictive distribution [1] for a new sample a ∈Rp of predictor data can also be written as a ratio of partition functions: p(y) = Z Rp p(y | a, x)p(x | C, w, µ) dx =  τ 2πn  1 2 e−τ 2n y2 Z C + 1 2naaT , w + y 2na, µ  Z(C, w, µ) , where C ∈Rp×p and w ∈Rp are obtained from the training data as before, n is the number of training samples, and y ∈R is the unknown response to a with distribution p(y). Note that E(y) = Z R yp(y)dy = Z Rp hZ R p(y | a, x)dy i p(x | C, w, µ) dx = Z Rp aT xp(x | C, w, µ) dx = aT E(x) ∼aT ˆxτ. (21) 3 Numerical experiments To test the accuracy of the stationary phase approximation, we implemented algorithms to solve the saddle point equations and compute the partition function and marginal posterior distribution, as well as an existing Gibbs sampler algorithm [8] in Matlab (see Appendix E for algorithm details, source code available from https://github.com/tmichoel/bayonet/). Results were first evaluated for independent predictors (or equivalently, one predictor) and two commonly used data sets: the “diabetes data” (n = 442, p = 10) [34] and the “leukemia data” (n = 72, p = 3571) [4] (see Appendix F for further experimental details and data sources). First we tested the rate of convergence in the asymptotic relation (see Appendix C) lim τ→∞−1 τ log Z = Hmin = min x∈Rp H(x). For independent predictors (p = 1), the partition function can be calculated analytically using the error function (Appendix D), and rapid convergence to Hmin is observed (Figure 1a). After scaling by the number of predictors p, a similar rate of convergence is observed for the stationary 5 a 0.1 102 0.05 0.2 104 0.15 0.3 106 0.5 1.5 108 5 b 0 0.02 102 0.04 0.06 104 0.08 10-2 0.1 106 10-1 108 c 0 102 0.05 104 10-2 0.1 106 10-1 108 d 0 102 0.05 0.05 104 0.1 0.15 106 0.5 1.5 108 5 e 0.02 102 0.04 0.06 0.08 104 0.1 10-2 0.12 106 10-1 108 f 0.02 102 0.04 0.06 0.08 104 10-2 0.1 0.12 106 10-1 108 Figure 1: Convergence to the minimum-energy solution. Top row: (−1 τ log Z −Hmin)/p vs. τ and µ for the exact partition function for independent predictors (p = 1) (a), and for the stationary phase approximation for the diabetes (b) and leukemia (c) data. Bottom row: ∥ˆxτ −ˆx∥∞for the exact expectation value for independent predictors (d), and using the stationary phase approximation for the diabetes (e) and leukemia (f) data. Parameter values were C = 1.0, w = 0.5, and µ ranging from 0.05 to 5 in geometric steps (a), and λ = 0.1 and µ ranging from 0.01µmax upto, but not including, µmax = maxj |wj| in geometric steps (b,c). a -0.1 -0.05 0 0.05 0.1 x 0 5 10 15 20 25 30 p(x) b -0.2 -0.1 0 0.1 0.2 x 0 5 10 15 p(x) c 0.1 0.2 0.3 0.4 x 0 2 4 6 8 10 p(x) d -3 -2 -1 0 1 x 10-3 0 500 1000 1500 p(x) e -0.05 0 0.05 x 0 20 40 60 p(x) f -0.05 0 0.05 0.1 0.15 x 0 5 10 15 20 25 p(x) Figure 2: Marginal posterior distributions for the diabetes data (λ = 0.1, µ = 0.0397, τ = 682.3) (a– c) and leukemia data (λ = 0.1, µ = 0.1835, τ = 9943.9) (d–f;). In blue, Gibbs sampling histogram (104 samples). In red, stationary phase approximation for the marginal posterior distribution of selected predictors. In yellow, maximum-likelihood-based approximation for the same distributions. The distributions for a zero, transition and non-zero maximum-likelihood predictor are shown (from left to right). The ∗on the x-axes indicate the location of the maximum-likelihood and posterior expectation value. 6 phase approximation to the partition function for both the diabetes and leukemia data (Figure 1b,c). However, convergence of the posterior expectation values ˆxτ to the maximum-likelihood coefficients ˆx, as measured by the ℓ∞-norm difference ∥ˆxτ −ˆx∥∞= maxj |ˆxτ,j −ˆxj| is noticeably slower, particularly in the p ≫n setting of the leukemia data (Figure 1d–f). Next, the accuracy of the stationary phase approximation at finite τ was determined by comparing the marginal distributions for single predictors [i.e. where I is a singleton in eq. (20)] to results obtained from Gibbs sampling. For simplicity, representative results are shown for specific hyperparameter values (Appendix F.2). Application of the stationary phase approximation resulted in marginal posterior distributions which were indistinguishable from those obtained by Gibbs sampling (Figure 2). In view of the convergence of the log-partition function to the minimum-energy value (Figure 1), an approximation to eq. (20) of the form p(xI) ≈e−τ(xT I CIxI−2wT I xI+2µ∥xI∥1)e−τ[Hmin(CIc,wIc−xT I CI,Ic,µ)−Hmin(C,w,µ)] (22) was also tested. However, while eq. (22) is indistinguishable from eq. (20) for predictors with zero effect size in the maximum-likelihood solution, it resulted in distributions that were squeezed towards zero for transition predictors, and often wildly inaccurate for non-zero predictors (Figure 2). This is because eq. (22) is maximized at xI = ˆxI, the maximum-likelihood value, whereas for non-zero coordinates, eq. (20) is (approximately) symmetric around its expectation value E(xI) = ˆxτ,I. Hence, accurate estimations of the marginal posterior distributions requires using the full stationary phase approximations [eq. (18)] to the partition functions in eq. (20). The stationary phase approximation can be particularly advantageous in prediction problems, where the response value ˆy ∈R for a newly measured predictor sample a ∈Rp is obtained using regression coefficients learned from training data (yt, At). In Bayesian inference, ˆy is set to the expectation value of the posterior predictive distribution, ˆy = E(y) = aT ˆxτ [eq. (21)]. Computation of the posterior expectation values ˆxτ [eq. (19)] using the stationary phase approximation requires solving only one set of saddle point equations, and hence can be performed efficiently across a range of hyper-parameter values, in contrast to Gibbs sampling, where the full posterior needs to be sampled even if only expectation values are needed. To illustrate how this benefits large-scale applications of the Bayesian elastic net, its prediction performance was compared to state-of-the-art Gibbs sampling implementations of Bayesian horseshoe and Bayesian lasso regression [35], as well as to maximum-likelihood elastic net and ridge regression, using gene expression and drug sensitivity data for 17 anticancer drugs in 474 human cancer cell lines from the Cancer Cell Line Encyclopedia [36]. Ten-fold cross-validation was used, using p = 1000 preselected genes and 427 samples for training regression coefficients and 47 for validating predictions in each fold. To obtain unbiased predictions at a single choice for the hyper-parameters, µ and τ were optimized over a 10 × 13 grid using an additional internal 10-fold cross-validation on the training data only (385 samples for training, 42 for testing); BayReg’s lasso and horseshoe methods sample hyper-parameter values from their posteriors and do not require an additional cross-validation loop (see Appendix F.3 for complete experimental details and data sources). Despite evaluating a much greater number of models (in each cross-validation fold, 10× cross-validation over 130 hyper-parameter combinations vs. 1 model per fold), the overall computation time was still much lower than BayReg’s Gibbs sampling approach (on average 30 sec. per fold, i.e. 0.023 sec. per model, vs. 44 sec. per fold for BayReg). In terms of predictive performance, Bayesian methods tended to perform better than maximum-likelihood methods, in particular for the most ‘predictable’ responses, with little variation between the three Bayesian methods (Figure 3a). While the difference in optimal performance between Bayesian and maximum-likelihood elastic net was not always large, Bayesian elastic net tended to be optimized at larger values of µ (i.e. at sparser maximum-likelihood solutions), and at these values the performance improvement over maximumlikelihood elastic net was more pronounced (Figure 3b). As expected, τ acts as a tuning parameter that allows to smoothly vary from the maximum-likelihood solution at large τ (here, τ ∼106) to the solution with best cross-validation performance (here, τ ∼103 −104) (Figure 3c). The improved performance at sparsity-inducing values of µ suggests that the Bayesian elastic net is uniquely able to identify the dominant predictors for a given response (the non-zero maximum-likelihood coefficients), while still accounting for the cumulative contribution of predictors with small effects. Comparison with the unpenalized (µ = 0) ridge regression coefficients shows that the Bayesian expectation values are strongly shrunk towards zero, except for the non-zero maximum-likelihood coefficients, which remain relatively unchanged (Figure 3d), resulting in a double-exponential distribution for 7 a PD-0325901 Topotecan AZD6244 Paclitaxel Panobinostat Lapatinib Sorafenib TKI258 17-AAG AEW541 TAE684 Erlotinib PF2341066 ZD-6474 AZD0530 Nutlin-3 LBW242 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 corr(ytrue,ypred) BAY Elastic Net (analytic approx) BAYREG Lasso BAYREG Horseshoe ML Elastic Net ML Ridge b 0.17 0.11 0.069 0.044 0.027 0.017 0.011 0.0069 0.0044 0.0027 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 corr(ytrue,ypred) BAY Elastic Net ML Elastic Net ML Ridge c 0 103 0.2 0.4 corr(ytrue,ypred) 104 0.0044 0.6 0.011 105 0.027 0.069 106 0.17 d -0.08 -0.06 -0.04 -0.02 0 0.02 0.04 0.06 xRidge -0.02 -0.01 0 0.01 0.02 0.03 0.04 0.05 xBayELN Figure 3: Predictive accuracy on the Cancer Cell Line Encyclopedia. a. Median correlation coefficient between predicted and true drug sensitivities over 10-fold cross-validation, using Bayesian posterior expectation values from the analytic approximation for elastic net (red) and from BayReg’s lasso (blue) and horseshoe (yellow) implementations, and maximum-likelihood elastic net (purple) and ridge regression (green) values for the regression coefficients. See main text for details on hyperparameter optimization. b. Median 10-fold cross-validation value for the correlation coefficient between predicted and true sensitivities for the compound PD-0325901 vs. µ, for the Bayesian elastic net at optimal τ (red), maximum-likelihood elastic net (blue) and ridge regression (dashed). c. Median 10-fold cross-validation value for the correlation coefficient between predicted and true sensitivities for PD-0325901 for the Bayesian elastic net vs. τ and µ; the black dots show the overall maximum and the ML maximum. d. Scatter plot of expected regression coefficients in the Bayesian elastic net for PD-0325901 at µ = 0.055 and optimal τ = 3.16 · 103 vs. ridge regression coefficient estimates; coefficients with non-zero maximum-likelihood elastic net value at the same µ are indicated in red. See Supp. Figures S2 and S3 for the other 16 compounds. the regression coefficients. This contrasts with ridge regression, where regression coefficients are normally distributed leading to over-estimation of small effects, and maximum-likelihood elastic net, where small effects become identically zero and don’t contribute to the predicted value at all. 4 Conclusions The application of Bayesian methods to infer expected effect sizes and marginal posterior distributions in ℓ1-penalized models has so far required the use of computationally expensive Gibbs sampling methods. Here it was shown that highly accurate inference in these models is also possible using an analytic stationary phase approximation to the partition function integrals. This approximation exploits the fact that the Fourier transform of the non-differentiable double-exponential prior distribution is a well-behaved exponential of a log-barrier function, which is intimately related to the Legendre-Fenchel transform of the ℓ1-penalty term. Thus, the Fourier transform plays the same role for Bayesian inference problems as convex duality plays for maximum-likelihood approaches. For simplicity, we have focused on the linear regression model, where the invariance of multivariate normal distributions under the Fourier transform greatly facilitates the analytic derivations. Preliminary work shows that the results can probably be extended to generalized linear models (or any 8 model with convex energy function) with L1 penalty, using the argument sketched in Appendix A.2. In such models, the predictor correlation matrix C will need to be replaced by the Hessian matrix of the energy function evaluated at the saddle point. Numerically, this will require updates of the Hessian during the coordinate descent algorithm for solving the saddle point equations. How to balance the accuracy of the approximation and the frequency of the Hessian updates will require further in-depth investigation. In principle, the same analysis can also be performed using other nontwice-differentiable sparse penalty functions, but if their Fourier transform is not known analytically, or not twice differentiable either, the analysis and implementation will become more complicated still. A limitation of the current approach may be that values of the hyper-parameters need to be specified in advance, whereas in complete hierarchical models, these are subject to their own prior distributions. Incorporation of such priors will require careful attention to the interchange between taking the limit of and integrating over the inverse temperature parameter. However, in many practical situations ℓ1 and ℓ2-penalty parameters are pre-determined by cross-validation. Setting the residual variance parameter to its maximum a-posteriori value then allows to evaluate the maximum-likelihood solution in the context of the posterior distribution of which it is the mode [8]. Alternatively, if the posterior expectation values of the regression coefficients are used instead of their maximum-likelihood values to predict unmeasured responses, the optimal inverse-temperature parameter can be determined by standard cross-validation on the training data, as in the drug response prediction experiments. No attempt was made to optimize the efficiency of the coordinate descent algorithm to solve the saddle point equations. However, comparison to the Gibbs sampling algorithm shows that one cycle through all coordinates in the coordinate descent algorithm is approximately equivalent to one cycle in the Gibbs sampler, i.e. to adding one more sample. The coordinate descent algorithm typically converges in 5-10 cycles starting from the maximum-likelihood solution, and 1-2 cycles when starting from a neighbouring solution in the estimation of marginal distributions. In contrast, Gibbs sampling typically requires 103-105 coordinate cycles to obtain stable distributions. Hence, if only the posterior expectation values or the posterior distributions for a limited number of coordinates are sought, the computational advantage of the stationary phase approximation is vast. On the other hand, each evaluation of the marginal distribution functions requires the solution of a separate set of saddle point equations. Hence, computing these distributions for all predictors at a very large number of points with the current algorithm could become equally expensive as Gibbs sampling. In summary, expressing intractable partition function integrals as complex-valued oscillatory integrals through the Fourier transform is a powerful approach for performing Bayesian inference in the lasso and elastic net regression models, and ℓ1-penalized models more generally. Use of the stationary phase approximation to these integrals results in highly accurate estimates for the posterior expectation values and marginal distributions at a much reduced computational cost compared to Gibbs sampling. Acknowledgments This research was supported by the BBSRC (grant numbers BB/J004235/1 and BB/M020053/1). References [1] Jerome Friedman, Trevor Hastie, and Robert Tibshirani. The elements of statistical learning. Springer series in statistics Springer, Berlin, 2001. [2] Arthur E Hoerl and Robert W Kennard. Ridge regression: Biased estimation for nonorthogonal problems. Technometrics, 12(1):55–67, 1970. [3] R. Tibshirani. Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society. Series B (Methodological), pages 267–288, 1996. [4] H. Zou and T. Hastie. Regularization and variable selection via the elastic net. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 67(2):301–320, 2005. [5] Trevor Park and George Casella. The Bayesian lasso. Journal of the American Statistical Association, 103(482):681–686, 2008. [6] Chris Hans. Bayesian lasso regression. Biometrika, pages 835–845, 2009. 9 [7] Qing Li, Nan Lin, et al. The Bayesian elastic net. Bayesian Analysis, 5(1):151–170, 2010. [8] Chris Hans. Elastic net regression modeling with the orthant normal prior. Journal of the American Statistical Association, 106(496):1383–1393, 2011. [9] Jun S Liu. Monte Carlo strategies in scientific computing. Springer, 2004. [10] Himel Mallick and Nengjun Yi. Bayesian methods for high dimensional linear models. Journal of Biometrics & Biostatistics, 1:005, 2013. [11] Bala Rajaratnam and Doug Sparks. Fast Bayesian lasso for high-dimensional regression. arXiv preprint arXiv:1509.03697, 2015. [12] Bala Rajaratnam and Doug Sparks. MCMC-based inference in the era of big data: A fundamental analysis of the convergence complexity of high-dimensional chains. arXiv preprint arXiv:1508.00947, 2015. [13] Robert E Kass and Duane Steffey. Approximate Bayesian inference in conditionally independent hierarchical models (parametric empirical Bayes models). Journal of the American Statistical Association, 84(407):717–726, 1989. [14] Håvard Rue, Sara Martino, and Nicolas Chopin. Approximate Bayesian inference for latent Gaussian models by using integrated nested Laplace approximations. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 71(2):319–392, 2009. [15] Sumio Watanabe. A widely applicable Bayesian information criterion. Journal of Machine Learning Research, 14(Mar):867–897, 2013. [16] Mathias Drton and Martyn Plummer. A Bayesian information criterion for singular models. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 79(2):323–380, 2017. [17] Roderick Wong. Asymptotic approximation of integrals, volume 34. SIAM, 2001. [18] Henry E Daniels. Saddlepoint approximations in statistics. The Annals of Mathematical Statistics, pages 631–650, 1954. [19] Grigory Lazarevich Litvinov. The Maslov dequantization, idempotent and tropical mathematics: a brief introduction. arXiv preprint math/0507014, 2005. [20] S.P. Boyd and L. Vandenberghe. Convex optimization. Cambridge university press, 2004. [21] R Tyrrell Rockafellar. Convex Analysis. Princeton University Press, 1970. [22] M.R. Osborne, B. Presnell, and B.A. Turlach. On the lasso and its dual. Journal of Computational and Graphical Statistics, 9(2):319–337, 2000. [23] Michael R Osborne, Brett Presnell, and Berwin A Turlach. A new approach to variable selection in least squares problems. IMA Journal of Numerical Analysis, 20(3):389–403, 2000. [24] L. El Ghaoui, V. Viallon, and T. Rabbani. Safe feature elimination for the lasso and sparse supervised learning problems. Pacific Journal of Optimization, 8:667–698, 2012. [25] R. Tibshirani, J. Bien, J. Friedman, T. Hastie, N. Simon, J. Taylor, and R.J. Tibshirani. Strong rules for discarding predictors in lasso-type problems. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 74(2):245–266, 2012. [26] R.J. Tibshirani. The lasso problem and uniqueness. Electronic Journal of Statistics, 7:1456– 1490, 2013. [27] Tom Michoel. Natural coordinate descent algorithm for L1-penalised regression in generalised linear models. Computational Statistics & Data Analysis, 97:60–70, 2016. [28] J. Friedman, T. Hastie, and R. Tibshirani. Regularization paths for generalized linear models via coordinate descent. Journal of Statistical Software, 33(1):1, 2010. 10 [29] Barbara Rakitsch, Christoph Lippert, Oliver Stegle, and Karsten Borgwardt. A lasso multimarker mixed model for association mapping with population structure correction. Bioinformatics, 29(2):206–214, 2012. [30] Serge Lang. Complex Analysis, volume 103 of Graduate Texts in Mathematics. Springrer, 2002. [31] Volker Schneidemann. Introduction to Complex Analysis in Several Variables. Birkhäuser Verlag, 2005. [32] R Van Zon and EGD Cohen. Extended heat-fluctuation theorems for a system with deterministic and stochastic forces. Physical Review E, 69(5):056121, 2004. [33] Jae Sung Lee, Chulan Kwon, and Hyunggyu Park. Modified saddle-point integral near a singularity for the large deviation function. Journal of Statistical Mechanics: Theory and Experiment, 2013(11):P11002, 2013. [34] B. Efron, T. Hastie, I.M. Johnstone, and R. Tibshirani. Least angle regression. The Annals of Statistics, 32(2):407–499, 2004. [35] Enes Makalic and Daniel F Schmidt. High-dimensional Bayesian regularised regression with the BayesReg package. arXiv:1611.06649, 2016. [36] J. Barretina, G. Caponigro, N. Stransky, K. Venkatesan, A.A. Margolin, S. Kim, C.J. Wilson, J. Lehár, G.V. Kryukov, D. Sonkin, et al. The Cancer Cell Line Encyclopedia enables predictive modelling of anticancer drug sensitivity. Nature, 483(7391):603–607, 2012. 11
2018
10
7,243
Decentralize and Randomize: Faster Algorithm for Wasserstein Barycenters Pavel Dvurechensky, Darina Dvinskikh Weierstrass Institute for Applied Analysis and Stochastics, Institute for Information Transmission Problems RAS {pavel.dvurechensky,darina.dvinskikh}@wias-berlin.de Alexander Gasnikov Moscow Institute of Physics and Technology, Institute for Information Transmission Problems RAS gasnikov@yandex.ru César A. Uribe Massachusetts Institute of Technology cauribe@mit.edu Angelia Nedi´c Arizona State University, Moscow Institute of Physics and Technology angelia.nedich@asu.edu Abstract We study the decentralized distributed computation of discrete approximations for the regularized Wasserstein barycenter of a finite set of continuous probability measures distributedly stored over a network. We assume there is a network of agents/machines/computers, and each agent holds a private continuous probability measure and seeks to compute the barycenter of all the measures in the network by getting samples from its local measure and exchanging information with its neighbors. Motivated by this problem, we develop, and analyze, a novel accelerated primal-dual stochastic gradient method for general stochastic convex optimization problems with linear equality constraints. Then, we apply this method to the decentralized distributed optimization setting to obtain a new algorithm for the distributed semi-discrete regularized Wasserstein barycenter problem. Moreover, we show explicit non-asymptotic complexity for the proposed algorithm. Finally, we show the effectiveness of our method on the distributed computation of the regularized Wasserstein barycenter of univariate Gaussian and von Mises distributions, as well as some applications to image aggregation.1 1 Introduction Optimal transport (OT) [30, 25] has become increasingly popular in the machine learning and optimization community. Given a basis space (e.g., pixel grid) and a transportation cost function (e.g., squared Euclidean distance), the OT approach defines a distance between two objects (e.g., images), modeled as two probability measures on the basis space, as the minimal cost of transportation of the first measure to the second. Besides images, these probability measures or histograms can model other real-world objects like videos, texts, etc. The optimal transport distance leads to outstanding results in unsupervised learning [4, 7], semi-supervised learning [42], clustering [24], text classification [27], as well as in image retrieval, clustering and classification [38, 11, 39], statistics [20, 36], economics 1The full version of this paper can be found in the supplementary material and is also available as [15]. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. and finance [5], condensed matter physics [8], and other applications [26]. From the computational point of view, the optimal transport distance (or Wasserstein distance) between two histograms of size n requires solving a linear program, which typically requires O(n3 log n) arithmetic operations. An alternative approach is based on entropic regularization of this linear program and application of either Sinkhorn’s algorithm [11] or stochastic gradient descent [22], both requiring O(n2) arithmetic operations, which can be too costly in the large-scale context. Given a set of objects, the optimal transport distance naturally defines their mean representative. For example, the 2-Wasserstein barycenter [2] is an object minimizing the sum of squared 2-Wasserstein distances to all objects in a set. Wasserstein barycenters capture the geometric structure of objects, such as images, better than the barycenter with respect to the Euclidean or other distances [12]. If the objects in the set are randomly sampled from some distribution, theoretical results such as central limit theorem [14] or confidence set construction [20] have been proposed, providing the basis for the practical use of Wasserstein barycenter. However, calculating the Wasserstein barycenter of m measures includes repeated computation of m Wasserstein distances. The entropic regularization approach was extended for this case in [6], with the proposed algorithm having a O(mn2) complexity, which can be very large if m and n are large. Moreover, in the large-scale setup, storage and processing of transportation plans, required to calculate Wasserstein distances, can be intractable for local computation. On the other hand, recent studies [34, 40, 37, 46, 31] on accelerated distributed convex optimization algorithms demonstrated their efficiency for convex optimization problems over arbitrary networks with inherently distributed data, i.e., the data is produced by a distributed network of sensors [35, 33, 32] or the transmission of information is limited by communication or privacy constraints, i.e., only limited amount of information can be shared across the network. Motivated by the limited communication issue and the computational complexity of the Wasserstein barycenter problem for large amounts of data stored in a network of computers, we use the entropy regularization of the Wasserstein distance and propose a decentralized algorithm to calculate an approximation to the Wasserstein barycenter of a set of probability measures. We solve the problem in a distributed manner on a connected and undirected network of agents oblivious to the network topology. Each agent locally holds a possibly continuous probability distribution, can sample from it, and seeks to cooperatively compute the barycenter of all probability measures exchanging the information with its neighbors. We consider the semi-discrete case, which means that we fix the discrete support for the barycenter and calculate a discrete approximation for the barycenter. Related work. Unlike [44], we propose a decentralized distributed algorithm for the computation of the regularized Wasserstein barycenter of a set of continuous measures. Working with continuous distributions requires the application of stochastic procedures like stochastic gradient method as in [22], where it is applied for regularized Wasserstein distance, but not for Wasserstein barycenter. This idea was extended to the case of non-regularized barycenter in [43, 10], where parallel algorithms were developed. The critical difference between the parallel and the decentralized setting is that, in the former, the topology of the computational network is fixed to be a star topology and it is known in advance by all the machines, forming a master/slave architecture. We seek to further scale up the barycenter computation to a huge number of input measures using arbitrary network topologies. Moreover, unlike [43], we use entropic regularization to take advantage of the problem smoothness and obtain faster rates of convergence for the optimization procedure. Unlike [10], we fix the support of the barycenter, which leads to a convex optimization problem and allows us to prove complexity bounds for our algorithm. Table 1: Summary of literature. PAPER DECENTR. CONT. BARYC. [11, 6, 13] × × √ [22] × √ × [43, 10] × √ √ OUR ALG. 2 √ √ √ The well-developed approach based on Sinkhorn’s algorithm [11, 6, 13] naturally leads to parallel algorithms. Nevertheless, its application to continuous distributions requires discretization of these distributions, leading to computational intractability when one desires good accuracy and, hence, has to use fine discretization with large n, which leads to the necessity of solving an optimization problem of large dimension. Thus, this approach is not directly applicable in our setting of continuous distributions, and it is not clear whether it is applicable in the decentralized distributed setting with arbitrary networks. 2 Recently, an alternative accelerated-gradient-based approach was shown to give better results than the Sinkhorn’s algorithm for Wasserstein distance [18, 19]. Moreover, accelerated gradient methods have natural extensions for the decentralized distributed setting [40, 45, 28]. Nevertheless, existing distributed optimization algorithms can not be applied to the barycenter problem in our setting of continuous distributions as these algorithms are either designed for deterministic problems or for stochastic primal problem, whereas in our case the dual problem is a stochastic problem. Table 1 summarizes the existing literature on Wasserstein barycenter calculation and shows our contribution. Contributions. We propose a novel algorithm for general stochastic optimization problems with linear constraints, namely the Accelerated Primal-Dual Stochastic Gradient Method (APDSGD). Based on this algorithm, we introduce a distributed algorithm for the computation of a discrete approximation for regularized Wasserstein barycenter of a set of continuous distributions stored distributedly over a network (connected and undirected) with unknown arbitrary topology. For our algorithm, we provide iteration and arithmetic operations complexity in terms of the problem parameters. Finally, we demonstrate the effectiveness of our algorithm on the distributed computation of the regularized Wasserstein barycenter of a set of von Mises distributions for various network topologies and network sizes. Moreover, we show some initial results on the problem of image aggregation for two datasets, namely, a subset of the MNIST digit dataset [29] and subset of the IXI Magnetic Resonance dataset [1]. Paper organization. In Section 2 we present the regularized Wasserstein barycenter problem for the semi-discrete case and its distributed computation over networks. In Section 3 we introduce a new algorithm for general stochastic optimization problems with linear constraints and analyze its convergence rate. Section 4 extends this algorithm and introduces our method for the distributed computation of regularized Wasserstein barycenter. Section 5 shows the experimental results for the proposed algorithm. The supplementary material contains the full version of the paper, including an appendix with the proofs, as well as additional results of numerical experiments. Notation. We define M1 +(X) the set of positive Radon probability measures on a metric space X, and S1(n) = {a ∈Rn + | Pn l=1 al = 1} the probability simplex. We denote by δ(x) the Dirac measure at point x, and ⊗the Kronecker product. We refer to λmax(W) as the maximum eigenvalue of a symmetric matrix W. We use bold symbols for stacked vectors p = [pT 1 , · · · , pT m]T ∈Rmn, where p1, ..., pm ∈Rn. In this case [p]i = pi – the i-th block of p. For a vector λ ∈Rn, we denote by [λ]l its l-th component. We refer to the Euclidean norm of a vector ∥p∥2 := Pn l=1([p]l)2 as 2-norm. 2 The Distributed Wasserstein Barycenter Problem In this section, we present the problem of decentralized distributed computation of regularized Wasserstein barycenters for a family of possibly continuous probability measures distributed over a network. First, we provide the necessary background for regularized Wasserstein distance and barycenter. Then, we give the details of the distributed formulation of the optimization problem defining Wasserstein barycenter, which is a minimization problem with linear equality constraint. To deal with this constraint, we make a transition to the dual problem, which, as we show, due to the presence of continuous distributions, is a smooth stochastic optimization problem. Regularized semi-discrete formulation of optimal transport problem. We consider entropic regularization for the optimal transport problem and the corresponding regularized Wasserstein distance and barycenter [11]. Let µ ∈M1 +(Y) with density q(y), and a discrete probability measure ν = Pn i=1[p]iδ(zi) with weights given by vector p ∈S1(n) and finite support given by points z1, . . . , zn ∈Z from a metric space Z. The regularized Wasserstein distance in semi-discrete setting between continuous measure µ and discrete measure ν is defined as2 Wγ(µ, ν) = min π∈Π(µ,ν) ( n X i=1 Z Y ci(y)πi(y)dy + γ n X i=1 Z Y πi(y) log πi(y) ξ  dy ) , (1) 2Formally, the ρ-Wasserstein distance for ρ ≥1 is (W0(µ, ν)) 1 ρ if Y = Z and ci(y) = dρ(zi, y), d being a distance on Y. For simplicity, we refer to (1) as regularized Wasserstein distance in a general situation since our algorithm does not rely on any specific choice of cost ci(y). 3 where ci(y) = c(zi, y) is a cost function for transportation of a unit of mass from point zi ∈Z to point y ∈Y, ξ is the uniform distribution on Y × Z, and the set of admissible coupling measures π is defined as Π(µ, ν) = ( π ∈M1 +(Y) × S1(n) : n X i=1 πi(y) = q(y), y ∈Y, Z Y πi(y)dy = pi, ∀i = 1, . . . , n ) . For a set of measures µi ∈M1 +(Z), i = 1, . . . , m, we fix the support z1, . . . , zn ∈Z of their regularized Wasserstein barycenter ν and wish to find it in the form ν = Pn i=1[p]iδ(zi), where p ∈Sn(1). Then the regularized Wasserstein barycenter in the semi-discrete setting is defined as the solution to the following convex optimization problem3 min p∈S1(n) m X i=1 Wγ,µi(p) = min p1=···=pm p1,...,pm∈S1(n) m X i=1 Wγ,µi(pi), (2) where we used notation Wγ,µ(p) := Wγ(µ, ν) for fixed probability measure µ. Network constraints in the distributed barycenter problem. We now describe the distributed optimization setting for solving the second problem in (2). We assume that each measure µi is held by an agent i on a network and this agent can sample from this measure. We model such a network as a fixed connected undirected graph G = (V, E), where V is the set of m nodes, and E is the set of edges. We assume that the graph G does not have self-loops. The network structure imposes information constraints; specifically, each node i has access to µi only and can exchange information only with its immediate neighbors, i.e., nodes j s.t. (i, j) ∈E. We represent the communication constraints imposed by the network by introducing a single equality constraint instead of p1 = · · · = pm in (2). To do so, we define the Laplacian matrix ¯W∈Rm×m of the graph G such that a) [ ¯W]ij = −1 if (i, j) ∈E, b) [ ¯W]ij = deg(i) if i = j, c) [ ¯W]ij = 0 otherwise. Here deg(i) is the degree of the node i, i.e., the number of neighbors of the node. Finally, define the communication matrix (also referred to as an interaction matrix) by W := ¯W ⊗In. Assuming that G is undirected and connected, the Laplacian matrix ¯W is symmetric and positive semidefinite. Furthermore, the vector 1 is the unique (up to a scaling factor) eigenvector associated with the zero eigenvalue. W inherits the properties of ¯W, i.e., it is symmetric and positive semidefinite. Moreover, √ Wp = 0 if and only if p1 = · · · = pm, where we defined stacked column vector p = [pT 1 , · · · , pT m]T ∈Rmn. Using this fact, we equivalently rewrite problem (2) as the maximization problem with linear equality constraint max p1,...,pm∈S1(n), √ W p=0 − m X i=1 Wγ,µi(pi). (3) Dual formulation of the barycenter problem. Given that problem (3) is an optimization problem with linear constraints, we introduce a stacked vector of dual variables λ = [λT 1 , · · · , λT m]T ∈Rmn for the constraints √ Wp = 0 in (3). Then, the Lagrangian dual problem for (3) is min λ∈Rmn max p1,...,pm∈S1(n) ( m X i=1 ⟨λi, [ √ Wp]i⟩−Wγ,µi(pi) ) = min λ∈Rmn m X i=1 W∗ γ,µi([ √ Wλ]i), (4) where [ √ Wp]i and [ √ Wλ]i denote the i-th n-dimensional block of vectors √ Wp and √ Wλ respectively, the equality m P i=1 ⟨λi, [ √ Wp]i⟩= m P i=1 ⟨[ √ Wλ]i, pi⟩was used, and W∗ γ,µi(·) is the FenchelLegendre transform of Wγ,µi(pi). The following Lemma states that each W∗ γ,µi(·) is a smooth function with Lipschitz-continuous gradient and can be expressed as an expectation of a function of additional random argument. Lemma 1. Given µ ∈M1 +(Y) with density q(·), the Fenchel-Legendre conjugate for Wγ,µ(p) is W∗ γ,µ(¯λ) = EY ∼µγ log 1 q(Y ) n X l=1 exp [¯λ]l −cl(Y ) γ ! , and its gradient is 1/γ-Lipschitz-continuous w.r.t. 2-norm. 3For simplicity, we assume equal weights for each Wγ,µi(p) and do not normalize the sum dividing by m. Our results can be directly generalized to the case of non-negative weights summing up to 1. 4 Denote ¯λ = √ Wλ = [[ √ Wλ]T 1 , . . . , [ √ Wλ]T m]T = [¯λT 1 , . . . , ¯λT m]T and W∗ γ(λ) – the dual objective in the r.h.s. of (4). Then, by the chain rule, the l-th n-dimensional block of ∇W∗ γ(λ) is  ∇W∗ γ(λ)  l = " ∇ m X i=1 W∗ γ,µi([ √ Wλ]i) # l = m X j=1 √ W lj∇W∗ γ,µj(¯λj), l = 1, ..., m. (5) It follows from (5) and Lemma 1 that the dual problem (4) is a smooth stochastic convex optimization problem. This is in contrast to [28], where the primal problem is a stochastic optimization problem. Moreover, as opposed to the existing literature on stochastic convex optimization, we not only need to solve the dual problem but also need to reconstruct an approximate solution for the primal problem (3), which is the barycenter. In the next section, we develop a novel accelerated primal-dual stochastic gradient method for a general smooth stochastic optimization problem, which is dual to some optimization problem with linear equality constraints. Furthermore, in Section 4, we apply our general algorithm to the particular case of primal-dual pair of problems (3) and (4). 3 General Primal-Dual Framework for Stochastic Optimization In this section, we consider a general smooth stochastic convex optimization problem which is dual to some optimization problem with linear equality constraints. Extending our works [16, 21, 9, 17, 19, 3, 18], we develop a novel algorithm for its solution and reconstruction of the primal variable together with convergence rate analysis. Unlike prior works, we consider the stochastic primal-dual pair of problems and one of our contributions consists in providing a primal-dual extension of the accelerated stochastic gradient method. We believe that our algorithm can be used for problems other than regularized Wasserstein barycenter problem and, thus, we, first, provide a general algorithm and, then, apply it to the barycenter problem. We introduce new notation since this section is independent of the others and is focused on a general optimization problem. General setup. For any finite-dimensional real vector space E, we denote by E∗its dual, by ∥· ∥ a norm on E and by ∥· ∥∗the norm on E∗which is dual to ∥· ∥, i.e. ∥λ∥∗= max∥x∥≤1⟨λ, x⟩. For a linear operator A : E1 →E2, the adjoint operator AT : E∗ 2 →E∗ 1 in defined by ⟨u, Ax⟩= ⟨AT u, x⟩, ∀u ∈E∗ 2, x ∈E1. We say that a function f : E →R has a L-Lipschitz-continuous gradient w.r.t. norm ∥· ∥∗if it is continuously differentiable and its gradient satisfies Lipschitz condition ∥∇f(x) −∇f(y)∥∗≤L∥x −y∥, ∀x, y ∈E. Our main goal in this section, is to provide an algorithm for a primal-dual (up to a sign) pair of problems (P) min x∈Q⊆E {f(x) : Ax = b} , (D) min λ∈Λ  ⟨λ, b⟩+ max x∈Q −f(x) −⟨AT λ, x⟩  . where Q is a simple closed convex set, A : E →H is given linear operator, b ∈H is given, Λ = H∗. We define ϕ(λ) := ⟨λ, b⟩+ maxx∈Q −f(x) −⟨AT λ, x⟩  = ⟨λ, b⟩+ f ∗(−AT λ) and assume it to be smooth with L-Lipschitz-continuous gradient. Here f ∗is the Fenchel-Legendre dual for f. We also assume that f ∗(−AT λ) = EξF ∗(−AT λ, ξ), where ξ is random vector and F ∗is the Fenchel-Legendre conjugate function to some function F(x, ξ), i.e. it satisfies F ∗(−AT λ, ξ) = max x∈Q{⟨−AT λ, x⟩−F(x, ξ)}. F ∗(¯λ, ξ) is assumed to be smooth and, hence ∇¯λF ∗(¯λ, ξ) = x(¯λ, ξ), where x(¯λ, ξ) is the solution of the maximization problem x(¯λ, ξ) = arg max x∈Q{⟨¯λ, x⟩−F(x, ξ)}. Under these assumptions, the dual problem (D) can be accessed by a stochastic oracle (Φ(λ, ξ), ∇Φ(λ, ξ)) satisfying EξΦ(λ, ξ) = ϕ(λ), Eξ∇Φ(λ, ξ) = ∇ϕ(λ), which we use in our algorithm. Accelerated primal-dual stochastic gradient method. Next, we provide an accelerated algorithm for the primal-dual pair of problems (P) −(D). The idea is to apply accelerated stochastic gradient method to the dual problem (D), endow it with a step in the primal space and show that the new algorithm allows also approximating the solution to the primal problem. We additionally assume that the variance of the stochastic approximation ∇Φ(λ, ξ) for the gradient of ϕ can be controlled and made as small as we desire. This can be done, for example by mini-batching the stochastic approximation. Finally, since ∇Φ(λ, ξ) = b −A∇F ∗(−AT λ, ξ) = b −Ax(−AT λ, ξ), on each iteration, to find ∇Φ(λ,ξ) we find the vector x(−AT λ, ξ) and use it for the primal iterates. 5 Theorem 1. Let ϕ have L-Lipschitz-continuous gradient w.r.t. 2-norm and ∥λ∗∥2 ≤R, where λ∗is a solution of dual problem (D). Given desired accuracy ε, assume that, at each iteration of Algorithm 1, the stochastic gradient ∇Φ(λk, ξk) is chosen in such a way that Eξ∥∇Φ(λk, ξk) −∇ϕ(λk)∥2 2 ≤ εLαk Ck . Then, for any ε > 0 and N ≥0, and expectation E w.r.t. all the randomness ξ1, . . . , ξN, the output ˆxN generated by the Algorithm 1 satisfies f(EˆxN) −f ∗≤16LR2 N 2 + ε 2 and ∥AEˆxN −b∥2 ≤16LR N 2 + ε 2R. (6) In step 7 of Algorithm 1 we can use a batch of size M and 1 M PM r=1 x(λk+1, ξr k+1) to update ˆxk+1. Then, under reasonable assumptions, ˆxN concentrates around EˆxN [23] and, if f is Lipschitzcontinuous, we obtain that (6) holds with large probability with ˆxN instead of EˆxN. 4 Solving the Barycenter Problem Algorithm 1 Accelerated Primal-Dual Stochastic Gradient Method (APDSGD) Input: Number of iterations N. 1: C0 = α0 = 0, η0 = ζ0 = λ0 = ˆx0 = 0. 2: for k = 0, . . . , N −1 do 3: Find αk+1 > 0 from Ck+1 := Ck+αk+1 = 2Lα2 k+1. τk+1 = αk+1/Ck+1. 4: λk+1 = τk+1ζk + (1 −τk+1)ηk 5: ζk+1 = ζk −αk+1∇Φ(λk+1, ξk+1). 6: ηk+1 = τk+1ζk+1 + (1 −τk+1)ηk. 7: ˆxk+1 = τk+1x(λk+1, ξk+1) + (1 −τk+1)ˆxk. 8: end for Output: The points ˆxN, ηN. In this section, we apply the general algorithm APDSGD to solve the primaldual pair of problems (3)-(4) and approximate the regularized Wasserstein barycenter which is a solution to (3). First, in Lemma 2, we make several technical steps to take care of the assumption of Theorem (1). Then, we introduce a change of dual variable so that the step 5 of Algorithm 1 becomes feasible for decentralized distributed setting. After that, we provide our algorithm for regularized Wasserstein barycenter problem with its complexity analysis. Lemma 2. The gradient of the objective function W∗ γ(λ) in the dual problem (4) is λmax(W)/γLipschitz-continuous w.r.t. 2-norm. If its stochastic approximation is defined as [e∇W∗ γ(λ)]i = m X j=1 √ W ij e∇W∗ γ,µj(¯λj), i = 1, ..., m, with e∇W∗ γ,µj(¯λj) = 1 M M X r=1 pj(¯λj, Y j r ), and [pj(¯λj, Y j r )]l = exp(([¯λj]l −cl(Y j r ))/γ) Pn ℓ=1 exp(([¯λj]ℓ−cℓ(Y j r ))/γ) . (7) where M is the batch size, ¯λj := [ √ Wλ]j, j = 1, ..., m, Y j 1 , ..., Y j r is a sample from the measure µj, j = 1, ..., m. Then EY j r ∼µj,j=1,...,m,r=1,...,M e∇W∗ γ(λ) = ∇W∗ γ(λ) and EY j r ∼µj,j=1,...,m,r=1,...,M∥e∇W∗ γ(λ) −∇W∗ γ(λ)∥2 2 ≤λmax(W)m/M, λ ∈Rmn. (8) Based on this lemma, we see that if, on each iteration of Algorithm 1, the mini-batch size Mk satisfies Mk ≥mγCk αkε , the assumptions of Theorem 1 hold. For the particular problem (4) the step 5 of Algorithm 1 can be written block-wise [ζk+1]i = [ζk]i −αk+1 Pm j=1 √ W ij e∇W∗ γ,µj([ √ Wλk+1]j), i = 1, ..., m. Unfortunately, this update can not be made in the decentralized setting since the sparsity pattern of √ W ij can be different from Wij and this will require some agents to get information not only from their neighbors. To overcome this obstacle, we change the variables and denote ¯λ = √ Wλ, ¯η = √ Wη, ¯ζ = √ Wζ. Then the step 5 of Algorithm 1 becomes [¯ζk+1]i = [¯ζk]i −αk+1 Pm j=1 Wij e∇W∗ γ,µj([¯λk+1]j), i = 1, ..., m. Theorem 2. Under the assumptions of Section 2, Algorithm 2 after N = p 16λmax(W)R2/(εγ) iterations returns an approximation ˆpN for the barycenter, which satisfies m X i=1 Wγ,µi(E[ˆpN]i) − m X i=1 Wγ,µi([p∗]i) ≤ε, ∥ √ WEˆpN∥2 ≤ε/R. (9) 6 The total complexity is O  mn max q λmax(W )R2 εγ , λmax(W )mR2 ε2  arithmetic operations. Algorithm 2 Distributed computation of Wasserstein barycenter Input: Each agent i ∈V is assigned its measure µi. 1: All agents set [¯η0]i = [¯ζ0]i = [¯λ0]i = [ˆp0]i = 0 ∈Rn, C0 = α0 = 0 and N 2: For each agent i ∈V : 3: for k = 0, . . . , N −1 do 4: Find αk+1 > 0 from Ck+1 := Ck+αk+1 = 2Lα2 k+1. τk+1 = αk+1/Ck+1. 5: Set Mk+1 = max {1, ⌈mγCk+1/(αk+1ε)⌉} 6: [¯λk+1]i = τk+1[¯ζk]i + (1 −τk+1)[¯ηk]i 7: Generate Mk+1 samples {Y i r }Mk+1 r=1 from the measure µi and set e∇W∗ γ,µi([¯λk+1]i) as in (7). 8: Share e∇W∗ γ,µi([¯λk+1]i) with {j | (i, j) ∈E} 9: [¯ζk+1]i = [¯ζk]i −αk+1 Pm j=1 Wij e∇W∗ γ,µj([¯λk+1]j) 10: [¯ηk+1]i = τk+1[¯ζk+1]i + (1 −τk+1)[¯ηk+1]i 11: [ˆpk+1]i = τk+1pi([¯λk+1]i, Y i 1 ) + (1 −τk+1)[ˆpk+1]i, where pi(·, ·) is defined in (7).4 12: end for Output: ˆpN. We underline that even if the measures µi, i = 1, ..., m are discrete with large support size, it can be more efficient to apply our stochastic algorithm than a deterministic algorithm. We now explain it in more details. If a measure µ is discrete, then W∗ γ,µ(¯λ) in Lemma 1 is represented as a finite expectation, i.e., a sum of functions instead of an integral, and can be found explicitly. In the same way, its gradient and, hence, ∇W∗ γ(λ) in (5) can be found explicitly in a deterministic way. Then a deterministic accelerated decentralized algorithm can be applied to approximate the regularized barycenter. Let us assume for simplicity that the support of measure µ is of the size n. Then the calculation of the exact gradient of W∗ γ,µ(¯λ) requires O(n2) arithmetic operations and the overall complexity of the deterministic algorithm is O  mn2p λmax(W)R2/γε  . For comparison, the complexity of our randomized approach in Theorem 2 is proportional to n, but not to n2. So, our randomized approach is superior in the regime of large n. 5 Experimental Results In this section, we present experimental results for Algorithm 2. Initially, we consider a set of agents over a network, where each agent i can samples from a privately held random variable Yi ∼N(θi, v2 i ), where N(θ, v2) is a univariate Gaussian distribution with mean θ and variance v2. Moreover, we set θi ∈[−4, 4] and vi ∈[0.1, 0.6]. The objective is to compute a discrete distribution p ∈S1(n) that solves (2). We assume n = 100 and the support of p is a set of 100 equally spaced points on the segment [−5, 5]. Figure 1 shows the performance of Algorithm 2 for four classes of networks: complete, cycle, star, and Erd˝os-Rényi. Moreover, we show the behavior for different network sizes, namely: m = 10, 100, 200, 500. Particularly we use two metrics: the function value of the dual problem and the distance to consensus, i.e., W∗ γ(λ) and C(ˆp) := ∥ √ W ˆp∥2. As expected, when the network is a complete graph, the convergence to the final value and the distance to consensus decreases rapidly. Nevertheless, the performance in graphs with degree regularity, such as the cycle graph and the Erd˝os-Rényi random graph, is similar to a complete graph with much less communication overhead. For the star graph, which has the worst case between the maximum and minimum number of neighbors among all nodes, the algorithm performs poorly. Figure 2 shows the convergence of the local barycenter of a set of von Mises distributions. Each agent over an Erd˝os-Rényi random graph can access private realizations from a von Mises random variable. Particularly, for the cases of von Mises distributions, we have used the angle between two points distance function. Figure 3 shows the computed local barycenter of 9 agents in a network of 500 nodes at different iteration numbers. Each agent holds a local copy of a sample of the digit 2 (56 × 56 image) from the MNIST dataset [29]. All agents converge to the same image that structurally represents the aggregation of the original 500 images held over the network. Finally, Figure 4 shows a simple example of an application of Wasserstein barycenter on medical image aggregation where we have 4 agents connected over a cycle graph and each agent holds a magnetic resonance image (256 × 256) from the IXI dataset [1]. 4In the experiments, we use 1 Mk+1 PMk+1 r=1 pi([¯λk+1]i, Y i r ) instead of pi([¯λk+1]i, Y i 1 ), which does not change the statement of Theorem 2, but reduces the variance of ˆpN in practice. Moreover, under mild assumptions, we can obtain high-probability analogue to inequalities (9). 7 Cycle Erd˝os-Rényi Star Complete 200 400 600 8001,000 −2 −1 0 1 Iterations m = 200 F(˜λk) 200 400 600 8001,000 −2 −1 0 1 Iterations m = 100 200 400 600 8001,000 −2 −1 0 1 Iterations m = 10 200 400 600 8001,000 −2 −1 0 1 Iterations m = 500 200 400 600 8001,000 0 0.2 0.4 0.6 0.8 1 Iterations m = 200 C(ˆpk) 200 400 600 8001,000 0 0.2 0.4 0.6 0.8 1 Iterations m = 100 200 400 600 8001,000 0 0.2 0.4 0.6 0.8 1 Iterations m = 10 200 400 600 8001,000 0 0.2 0.4 0.6 0.8 1 Iterations m = 500 Figure 1: Dual function value and distance to consensus for 200, 100, 10, 500 agents, Mk = 100 and γ = 0.1. N = 1 0 π/2 π 3π/2 N = 100 0 π/2 π 3π/2 N = 200 0 π/2 π 3π/2 N = 500 0 π/2 π 3π/2 Figure 2: Wasserstein barycenter of von Mises distributions for 10 agents at different iteration numbers. N = 1 N = 1000 N = 2000 N = 3000 N = 4000 Figure 3: Wasserstein barycenter of digit 2 from the MNIST dataset [29]. Each block shows a subset of 9 randomly selected local barycenters at different time instances. N = 1 N = 100 N = 1000 N = 6000 N = 10000 Figure 4: Wasserstein barycenter for a subset of images from the IXI dataset [1]. Each block shows the local barycenters of 4 agents at different time instances. 6 Conclusions We propose a novel distributed algorithm for regularized Wasserstein barycenter problem for a set of continuous measures stored distributedly over a network of agents. Our algorithm is based on a new general algorithm for the solution of stochastic convex optimization problems with linear constraints. In contrast to the recent literature, our algorithm can be executed over arbitrary connected and static networks where nodes are oblivious to the network topology, which makes it suitable for large-scale network optimization setting. Additionally, our analysis indicates that the randomization strategy provides faster convergence rates than the deterministic procedure when the support size of the barycenter is large. The implementation of our algorithm on real networks, requires further work, as well as its extension to the decentralized distributed setting of Sinkhorn-type algorithms [6] for regularized Wasserstein barycenter and other related algorithms, e.g., Wasserstein propagation [41]. 8 Acknowledgments The work of A. Nedi´c and C.A. Uribe in Sect. 5 is supported by the National Science Foundation under grant no. CPS 15-44953. The research by P. Dvurechensky, D. Dvinskikh, and A. Gasnikov in Sect. 3 and Sect. 4 was funded by the Russian Science Foundation (project 18-71-10108). References [1] IXI Dataset. http://brain-development.org/ixi-dataset/. Accessed: 2018-05-17. [2] M. Agueh and G. Carlier. Barycenters in the wasserstein space. SIAM Journal on Mathematical Analysis, 43(2):904–924, 2011. [3] A. S. Anikin, A. V. Gasnikov, P. E. Dvurechensky, A. I. Tyurin, and A. V. Chernov. Dual approaches to the minimization of strongly convex functionals with a simple structure under affine constraints. Computational Mathematics and Mathematical Physics, 57(8):1262–1276, Aug 2017. [4] M. Arjovsky, S. Chintala, and L. Bottou. Wasserstein GAN. arXiv:1701.07875, 2017. [5] M. Beiglböck, P. Henry-Labordere, and F. Penkner. Model-independent bounds for option prices: a mass transport approach. Finance and Stochastics, 17(3):477–501, 2013. [6] J.-D. Benamou, G. Carlier, M. Cuturi, L. Nenna, and G. Peyré. Iterative bregman projections for regularized transportation problems. SIAM Journal on Scientific Computing, 37(2):A1111–A1138, 2015. [7] J. Bigot, R. Gouet, T. Klein, and A. López. Geodesic PCA in the wasserstein space by convex pca. Ann. Inst. H. Poincaré Probab. Statist., 53(1):1–26, 02 2017. [8] G. Buttazzo, L. De Pascale, and P. Gori-Giorgi. Optimal-transport formulation of electronic densityfunctional theory. Physical Review A, 85(6):062502, 2012. [9] A. Chernov, P. Dvurechensky, and A. Gasnikov. Fast primal-dual gradient method for strongly convex minimization problems with linear constraints. In Y. Kochetov, M. Khachay, V. Beresnev, E. Nurminski, and P. Pardalos, editors, Discrete Optimization and Operations Research: 9th International Conference, DOOR 2016, Vladivostok, Russia, September 19-23, 2016, Proceedings, pages 391–403. Springer International Publishing, 2016. [10] S. Claici, E. Chien, and J. Solomon. Stochastic Wasserstein barycenters. In J. Dy and A. Krause, editors, Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pages 999–1008. PMLR, 2018. [11] M. Cuturi. Sinkhorn distances: Lightspeed computation of optimal transport. In C. J. C. Burges, L. Bottou, M. Welling, Z. Ghahramani, and K. Q. Weinberger, editors, Advances in Neural Information Processing Systems 26, pages 2292–2300. Curran Associates, Inc., 2013. [12] M. Cuturi and A. Doucet. Fast computation of wasserstein barycenters. In International Conference on Machine Learning, pages 685–693, 2014. [13] M. Cuturi and G. Peyré. A smoothed dual approach for variational wasserstein problems. SIAM Journal on Imaging Sciences, 9(1):320–343, 2016. [14] E. del Barrio, E. Gine, and C. Matran. Central limit theorems for the wasserstein distance between the empirical and the true distributions. The Annals of Probability, 27(2):1009–1071, 1999. [15] P. Dvurechensky, D. Dvinskikh, A. Gasnikov, C. A. Uribe, and A. Nedi´c. Decentralize and randomize: Faster algorithm for Wasserstein barycenters. arXiv:1806.03915, 2018. [16] P. Dvurechensky and A. Gasnikov. Stochastic intermediate gradient method for convex problems with stochastic inexact oracle. Journal of Optimization Theory and Applications, 171(1):121–145, 2016. [17] P. Dvurechensky, A. Gasnikov, E. Gasnikova, S. Matsievsky, A. Rodomanov, and I. Usik. Primaldual method for searching equilibrium in hierarchical congestion population games. In Supplementary Proceedings of the 9th International Conference on Discrete Optimization and Operations Research and Scientific School (DOOR 2016) Vladivostok, Russia, September 19 - 23, 2016, pages 584–595, 2016. arXiv:1606.08988. 9 [18] P. Dvurechensky, A. Gasnikov, and A. Kroshnin. Computational optimal transport: Complexity by accelerated gradient descent is better than by Sinkhorn’s algorithm. In J. Dy and A. Krause, editors, Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pages 1367–1376, 2018. arXiv:1802.04367. [19] P. Dvurechensky, A. Gasnikov, S. Omelchenko, and A. Tiurin. Adaptive similar triangles method: a stable alternative to Sinkhorn’s algorithm for regularized optimal transport. arXiv:1706.07622, 2017. [20] J. Ebert, V. Spokoiny, and A. Suvorikova. Construction of non-asymptotic confidence sets in 2-Wasserstein space. arXiv:1703.03658, 2017. [21] A. V. Gasnikov, E. V. Gasnikova, Y. E. Nesterov, and A. V. Chernov. Efficient numerical methods for entropy-linear programming problems. Computational Mathematics and Mathematical Physics, 56(4):514– 524, 2016. [22] A. Genevay, M. Cuturi, G. Peyré, and F. Bach. Stochastic optimization for large-scale optimal transport. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett, editors, Advances in Neural Information Processing Systems 29, pages 3440–3448. Curran Associates, Inc., 2016. [23] V. Guigues, A. Juditsky, and A. Nemirovski. Non-asymptotic confidence bounds for the optimal value of a stochastic program. Optimization Methods and Software, 32(5):1033–1058, 2017. [24] N. Ho, X. Nguyen, M. Yurochkin, H. H. Bui, V. Huynh, and D. Phung. Multilevel clustering via Wasserstein means. In D. Precup and Y. W. Teh, editors, Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pages 1501–1509, International Convention Centre, Sydney, Australia, 06–11 Aug 2017. PMLR. [25] L. Kantorovich. On the translocation of masses. (Doklady) Acad. Sci. URSS (N.S.), 37:199–201, 1942. [26] S. Kolouri, S. R. Park, M. Thorpe, D. Slepcev, and G. K. Rohde. Optimal mass transport: Signal processing and machine-learning applications. IEEE Signal Processing Magazine, 34(4):43–59, July 2017. [27] M. J. Kusner, Y. Sun, N. I. Kolkin, and K. Q. Weinberger. From word embeddings to document distances. In Proceedings of the 32nd International Conference on International Conference on Machine Learning Volume 37, ICML’15, pages 957–966. JMLR.org, 2015. [28] G. Lan, S. Lee, and Y. Zhou. Communication-efficient algorithms for decentralized and stochastic optimization. Mathematical Programming, pages 1–48, 2018. [29] Y. LeCun. The mnist database of handwritten digits. http://yann. lecun. com/exdb/mnist/, 1998. [30] G. Monge. Mémoire sur la théorie des déblais et des remblais. Histoire de l’Académie Royale des Sciences de Paris, 1781. [31] A. Nedi´c, A. Olshevsky, W. Shi, and C. A. Uribe. Geometrically convergent distributed optimization with uncoordinated step-sizes. In American Control Conference (ACC), 2017, pages 3950–3955. IEEE, 2017. [32] A. Nedi´c, A. Olshevsky, and C. A. Uribe. Distributed learning for cooperative inference. arXiv preprint arXiv:1704.02718, 2017. [33] A. Nedi´c, A. Olshevsky, and C. A. Uribe. Fast convergence rates for distributed non-bayesian learning. IEEE Transactions on Automatic Control, 62(11):5538–5553, 2017. [34] A. Nedi´c, A. Olshevsky, and W. Shi. Achieving geometric convergence for distributed optimization over time-varying graphs. SIAM Journal on Optimization, 27(4):2597–2633, 2017. [35] R. Olfati-Saber, E. Franco, E. Frazzoli, and J. S. Shamma. Belief Consensus and Distributed Hypothesis Testing in Sensor Networks, pages 169–182. Springer Berlin Heidelberg, Berlin, Heidelberg, 2006. [36] V. M. Panaretos and Y. Zemel. Amplitude and phase variation of point processes. Ann. Statist., 44(2):771– 812, 04 2016. [37] A. Rogozin, C. A. Uribe, A. Gasnikov, N. Malkovsky, and A. Nedi´c. Optimal distributed optimization on slowly time-varying graphs. arXiv preprint arXiv:1805.06045, 2018. [38] Y. Rubner, C. Tomasi, and L. J. Guibas. The earth mover’s distance as a metric for image retrieval. International journal of computer vision, 40(2):99–121, 2000. 10 [39] R. Sandler and M. Lindenbaum. Nonnegative matrix factorization with earth mover’s distance metric for image analysis. IEEE Transactions on Pattern Analysis and Machine Intelligence, 33(8):1590–1602, Aug 2011. [40] K. Scaman, F. R. Bach, S. Bubeck, Y. T. Lee, and L. Massoulié. Optimal algorithms for smooth and strongly convex distributed optimization in networks. In Proceedings of the 34th International Conference on Machine Learning, ICML 2017, Sydney, NSW, Australia, 6-11 August 2017, pages 3027–3036, 2017. [41] J. Solomon, F. De Goes, G. Peyré, M. Cuturi, A. Butscher, A. Nguyen, T. Du, and L. Guibas. Convolutional wasserstein distances: Efficient optimal transportation on geometric domains. ACM Transactions on Graphics (TOG), 34(4):66, 2015. [42] J. Solomon, R. M. Rustamov, L. Guibas, and A. Butscher. Wasserstein propagation for semi-supervised learning. In Proceedings of the 31st International Conference on International Conference on Machine Learning - Volume 32, ICML’14, pages I–306–I–314. JMLR.org, 2014. [43] M. Staib, S. Claici, J. M. Solomon, and S. Jegelka. Parallel streaming wasserstein barycenters. In Advances in Neural Information Processing Systems, pages 2644–2655, 2017. [44] C. A. Uribe, D. Dvinskikh, P. Dvurechensky, A. Gasnikov, and A. Nedi´c. Distributed computation of Wasserstein barycenters over networks. In 2018 IEEE 57th Annual Conference on Decision and Control (CDC), pages 6544–6549, Dec 2018. [45] C. A. Uribe, S. Lee, A. Gasnikov, and A. Nedi´c. Optimal algorithms for distributed optimization. 2017. arXiv:1712.00232. [46] C. A. Uribe, S. Lee, A. Gasnikov, and A. Nedi´c. A dual approach for optimal algorithms in distributed optimization over networks. arXiv preprint arXiv:1809.00710, 2018. 11
2018
100
7,244
Thermostat-assisted continuously-tempered Hamiltonian Monte Carlo for Bayesian learning Rui Luo1, Jianhong Wang∗1, Yaodong Yang∗1, Zhanxing Zhu2, and Jun Wang†1 1University College London, 2Peking University Abstract We propose a new sampling method, the thermostat-assisted continuously-tempered Hamiltonian Monte Carlo, for Bayesian learning on large datasets and multimodal distributions. It simulates the Nosé-Hoover dynamics of a continuously-tempered Hamiltonian system built on the distribution of interest. A significant advantage of this method is that it is not only able to efficiently draw representative i.i.d. samples when the distribution contains multiple isolated modes, but capable of adaptively neutralising the noise arising from mini-batches and maintaining accurate sampling. While the properties of this method have been studied using synthetic distributions, experiments on three real datasets also demonstrated the gain of performance over several strong baselines with various types of neural networks plunged in. 1 Introduction Bayesian learning via Markov chain Monte Carlo (MCMC) methods is appealing for its inborn nature of characterising the uncertainty within the learnable parameters. However, when the distributions of interest contain multiple modes, rapid exploration on the corresponding multimodal landscapes w.r.t. the parameters becomes difficult using classic methods [7, 16]. In particular, given a large number of modes, some “distant” ones might be beyond the reach from others; this would potentially lead to the so-called pseudo-convergence [1], where the guarantee of ergodicity for MCMC methods breaks. To make things worse, Bayesian learning on large datasets is typically conducted in an online setting: at each of the iterations, only a subset, i.e. a mini-batch, of the dataset is utilised to update the model parameters [24]. Although the computational complexity is substantially reduced, those mini-batches inevitably introduce noise into the system and therefore increase the uncertainty within the parameters, making it harder to properly sample multimodal distributions. In this paper, we propose a new sampling method, referred to as the thermostat-assisted continuouslytempered Hamiltonian Monte Carlo, to address the aforementioned problems and to facilitate Bayesian learning on large datasets and multimodal posterior distributions. We extend the classic Hamiltonian Monte Carlo (HMC) with the scheme of continuous tempering stemming from the recent advances in physics [8] and chemistry [15]. The extended dynamics governs the variation on effective temperature for the distribution of interest in a continuous and systematic fashion such that the sampling trajectory can readily overcome high energy barriers and rapidly explore the entire parameter space. In addition to tempering, we also introduce a set of Nosé-Hoover thermostats [18, 11] to handle the noise arising from the use of mini-batches. The thermostats are integrated into the tempered dynamics so that the mini-batch noise can be effectively recognised and automatically neutralised. In short, the proposed method leverages continuous tempering to enhance the sampling efficiency, especially for multimodal distributions; it makes use of Nosé-Hoover thermostats to adaptively dissipate the instabilities caused by mini-batches so that the desired distributions can be recovered. Various experiments are conducted to demonstrate the effectiveness of the new method: it consistently outperforms several samplers and optimisers on the accuracy of image classification with different types of neural network. ∗Equal †Correspondence to: j.wang@cs.ucl.ac.uk 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. 2 Preliminaries We review HMC [6] and continuous tempering [8, 15], the two bases of our model, where the former serves as a de facto standard for Bayesian sampling and the latter is a state-of-the-art solution to the acceleration of molecular dynamics simulations on complex physical systems. 2.1 Hamiltonian Monte Carlo for posterior sampling Bayesian posterior sampling aims at efficiently generating i.i.d. samples from the posterior ρ(θ|D) of the variable of interest θ given some dataset D. Provided the prior ρ(θ) and the likelihood L(θ; D) along with the dataset D = {xi} with |D| independent data points xi, the target posterior to generate samples from can be formulated as ρ(θ|D) ∝ρ(θ)L(θ; D) = ρ(θ) |D| Ö i ℓ(θ; xi), with the likelihood per data point ℓ(θ; xi). (1) In a typical HMC setting [16], a physical system is constructed and connected with the target posterior in Eq. (1) via the system’s potential, which is defined as U(θ) = −log ρ(θ|D) = −log ρ(θ) − |D| Õ i=1 log ℓ(θ; xi) −const . (2) In this system, the variable of interest θ ∈RD, referred to as the system configuration, is interpreted as the joint position of all physical objects within that system. An auxiliary variable pθ ∈RD is then introduced as the conjugate momentum w.r.t. θ to describe its rate of change. The tuple Γ = (θ,pθ) represents the state of the physical system that uniquely determines the characteristics of that system. A predefined constant matrix Mθ = diag[mθi] specifies the masses of the objects associated with θ and can be leveraged for preconditioning. The energy function H(Γ) of the physical system, referred to as the Hamiltonian, is essentially the sum of the potential in Eq. (2) and the conventional quadratic kinetic energy: H(Γ) = U(θ) + p⊤ θ M−1 θ pθ/2. The Hamiltonian dynamics, i.e. the Hamilton’s equations of motion, can be derived by applying the Hamiltonian formalism [Ûθ = ∂pθ H, Ûpθ = −∂θH] to H(Γ), where Ûθ and Ûpθ denote the time derivatives. The Hamiltonian dynamics, on one hand, describes the time evolution of system from a microscopic perspective. The principle of statistical physics, on the other hand, states in a macroscopic sense that given a physical system in thermal equilibrium with a heat bath at a fixed temperature T, the states Γ of that system are distributed as a particular distribution related to the system’s Hamiltonian H(Γ): π(Γ) = 1 ZΓ(T)e−H(Γ)/T, with the normalising constant ZΓ(T) = Õ Γ e−H(Γ)/T . (3) Such distribution is referred to as the canonical distribution. Note that by setting T = 1 and U(θ) as in Eq. (2), the canonical distribution in Eq. (3) can be marginalised as the posterior in Eq. (1). 2.2 Continuous tempering In physical chemistry, continuous tempering [8, 15] is currently a state-of-the-art method to accelerate molecular dynamics simulations by means of continuously and systematically varying the temperature of a physical system. It extends the original system by coupling with additional degrees of freedom, namely the tempering variable ξ ∈R with mass mξ as well as its conjugate momentum pξ ∈R, which control the effective temperature of the original system in a continuous fashion via the Hamiltonian dynamics of the extended system. With a suitable choice of coupling function λ(ξ) and a compatible confining potential W(ξ), the Hamiltonian of the extended system can be designed as H(Γ) = λ(ξ)U(θ) + W(ξ) + p⊤ θ M−1 θ pθ/2 + p2 ξ/2mξ, (4) where Γ = (θ,ξ,pθ, pξ) represents the state of the extended system with the position of the tempering variable ξ and its momentum pξ appended to the state of the original system (θ,pθ). λ(ξ) ∈R+ maps the tempering variable to a multiplier of temperature so that the effective temperature of the original system T/λ(ξ) can vary; its domain domλ(ξ) ⊂R is a finite interval regulated by W(ξ). 2 3 Thermostat-assisted continuously-tempered Hamiltonian Monte Carlo We propose a sampling method, called the thermostat-assisted continuously-tempered Hamiltonian Monte Carlo (TACT-HMC), for multimodal posterior sampling in the presence of unknown noise. TACT-HMC leverages the extended Hamiltonian in Eq. (4) to raise and vary the effective temperature continuously; it efficiently lowers the energy barriers between modes and hence accelerates sampling. Our method also incorporates the Nosé-Hoover thermostats to effectively recognise and automatically neutralise the noise arising from the use of mini-batches. 3.1 System dynamics with the Nosé-Hoover augmentation In solving for the system dynamics, we apply the Hamiltonian formalism to the extended Hamiltonian in Eq. (4), which requires the potential U(θ) and gradient ∇θU(θ). We define hereafter the negative gradient of the potential U(θ) as the induced force f(θ) = −∇θU(θ). Because the calculation of either U(θ) or f(θ) involves the full dataset D = {xi}, it is computationally expensive or even unaffordable to calculate the actual values for large |D|. Instead, we consider the mini-batch approximations: ˜U(θ) = −log ρ(θ) −|D| |S| |S| Õ k=1 log ℓ(θ; xik ) and ˜f(θ) = ∇θ log ρ(θ) + |D| |S| |S| Õ k=1 ∇θ log ℓ(θ; xik ), where xik denotes the data point sampled from mini-batches S = {xik } ⊂D with the size |S| ≪|D|. It is clear that ˜U(θ) and ˜f(θ) are unbiased estimators of U(θ) and f(θ). As we assume xik to be mutually independent, ˜U(θ) and ˜f(θ) are sums of |S| i.i.d. random variables, where the Central Limit Theorem (CLT) applies; the mini-batch approximations converge to Gaussian variables, i.e. ˜U(θ) →N(U(θ),vU(θ)) and ˜f(θ) →N(f(θ),V f (θ)) with variances vU(θ) and V f (θ). As random variables, ˜U(θ) and ˜f(θ) inevitably inject noise into the system dynamics. We incorporate a set of independent Nosé-Hoover thermostats [18, 11] – apparatuses originally devised for temperature stabilisation in molecular dynamics simulations – to adaptively cancel the effect of noise. The system dynamics with the augmentation of thermostats – we call Nosé-Hoover dynamics – is formulated as dθ dt = M−1 θ pθ, dpθ dt = λ(ξ)˜f(θ) −λ2(ξ)Sθpθ, ds⟨i,j⟩ θ dt = λ2(ξ) κ ⟨i,j⟩ θ  pθi pθj mθi −Tδij  , dξ dt = pξ mξ , dpξ dt = −λ′(ξ) ˜U(θ) −W ′(ξ) −  λ′(ξ) 2sξ pξ, dsξ dt =  λ′(ξ) 2 κξ  p2 ξ mξ −T  , (5) where Sθ and sξ denote the Nosé-Hoover thermostats coupled with θ and ξ. Specifically, Sθ =  s⟨i,j⟩ θ  is a D × D matrix with the (i, j)-th elements s⟨i,j⟩ θ dependent upon the multiplicative term pθi pθj /mθi. κ ⟨i,j⟩ θ and κξ are constants that denote the “thermal inertia” corresponding to s⟨i,j⟩ θ and sξ, respectively. Intuitively, the thermostats Sθ and sξ act as negative feedback controllers on the momenta pθ and pξ. Consider the dynamics of sξ in Eq. (5), when p2 ξ/mξ exceeds the reference T, the thermostat sξ will increase, leading to a greater friction −sξ pξ in updating pξ; the friction in turn reduces the magnitude of pξ, resulting in a decrease in the value of p2 ξ/mξ. The negative feedback loop is thus established. With the help of thermostats, the noise injected into the system can be adaptively neutralised. We define the diffusion coefficients bU(θ) B vU(θ) dt/2 and Bf (θ) =  b⟨i,j⟩ f (θ)  B V f (θ) dt/2 such that the variances vU(θ) and V f (θ) of the mini-batch approximations evaluated at each of the discrete iterations can be embedded in the Fokker-Planck equation (FPE) [20] established in continuous time. FPE translates the microscopic motion of particles, formulated by SDEs, into the macroscopic time evolution of the state distribution in the form of PDEs. With FPE leveraged, we establish the theorem as follows to characterise the invariant distribution: Theorem 1. The system governed by the dynamics in Eq. (5) has the invariant distribution: π(Γ,Sθ, sξ) ∝e −  H(Γ) +  sξ −bU (θ) mξ T 2 κξ /2 + Í i, j s⟨i, j⟩ θ − b⟨i, j⟩ f (θ) mθj T !2 κ⟨i, j⟩ θ  2 . T , (6) where Γ = (θ,ξ,pθ, pξ) denotes the extended state as presented in Eq. (4). 3 Proof. Recall FPE in its vector form [20]: ∂ ∂t π(x,t) = −∂ ∂x · h µx(x,t)π(x,t) i +  ∂ ∂x ∂⊤ ∂x  · h Bx(x,t)π(x,t) i , (7) where x = vec(Γ,Sθ, sξ) denotes the vectorisation of the collection of all variables defined in Eq. (6), µx and Bx represent the drift and diffusion terms associated with the dynamics in Eq. (5), respectively, and the dot operator · defines the composition of summation after element-wise multiplication. We substitute the corresponding elements within Eq. (5) into the drift and diffusion of FPE in Eq. (7). As we presume that the introduced thermostats are mutually independent with each other, the invariant distribution can hence be factorised into marginals as π(x) = πΓπsξ Î i,j πs⟨i, j⟩ θ . It is straightforward to verify that those deterministic parts with the dependency only on Γ cancel exactly with each other. The remnants are the stochastic parts as well as the deterministic ones that depend on the thermostats Sθ and sξ, which can be formulated as ∂ ∂t π(x,t) = ∂ ∂pξ h λ′(ξ) 2sξ pξ π i − Õ i,j ∂ ds⟨i,j⟩ θ " λ2(ξ) κ ⟨i,j⟩ θ  pθi pθj mθi −Tδij  π # + ∂2 ∂pξ h λ′(ξ) 2bU(θ)π i + ∂ ∂pθ · h λ2(ξ)Sθpθπ i − ∂ ∂sξ "  λ′(ξ) 2 κξ  p2 ξ mξ −T  π # +  ∂ ∂pθ ∂⊤ ∂pθ  · h λ2(ξ)Bf (θ)π i . (8) We solve for the invariant distribution π(x) by equating Eq. (8) to zero. The resulted formulae for the marginals πsξ and πs⟨i, j⟩ θ are obtained under the assumption of factorisation in the form of 1 πsξ ∂πsξ ∂sξ = −κξ T  sξ −bU(θ) mξT  and 1 πs⟨i, j⟩ θ ∂πs⟨i, j⟩ θ ∂s⟨i,j⟩ θ = − κ ⟨i,j⟩ θ T  s⟨i,j⟩ θ − b⟨i,j⟩ f (θ) mθjT  . (9) The solutions to Eq. (9) are clear: both πsξ and πs⟨i, j⟩ θ are Gaussian distributions determined uniquely by the coefficients. The marginals πsξ and πs⟨i, j⟩ θ , along with the canonical distribution πΓ w.r.t. H(Γ), constitute the invariant distribution defined in Eq. (6). □ Theorem 1 states that, when the system reaches equilibrium, the system state is distributed as Eq. (6), and the mini-batch noise is absorbed into the thermostats from the system dynamics in Eq. (5). Thus, we can marginalise out both Sθ and sξ to drop the noise, and then obtain the canonical distribution in Eq. (3). As we are seeking for the recovery of the target posterior from the canonical distribution, we can assign specific values to the tempering variable ξ = ξ∗such that the effective temperature of the original system is held fixed at unity T/λ(ξ∗) = 1. Hence, the posterior ρ(θ|D) equals to the marginal distribution w.r.t. θ given ξ∗satisfying λ(ξ∗) = T, which is obtained by the marginalisation of pθ and pξ over the canonical distribution as follows: π(θ|ξ∗) = Õ pθ ,pξ π(Γ|ξ∗) = Í pθ ,pξ e−H(Γ|ξ∗)/T Í Γ\ξ e−H(Γ|ξ∗)/T = e−U(θ) Í θ e−U(θ) = 1 Zθ(T)e−U(θ) = ρ(θ|D), where H(Γ|ξ∗) = λ(ξ∗)U(θ) + W(ξ∗) + p⊤ θ M−1 θ pθ/2 + p2 ξ/2mξ represents the extended Hamiltonian conditioning on the tempering variable ξ = ξ∗, when λ(ξ∗) = T holds. 3.2 Tempering enhancement via adaptive biasing force A necessary condition for the tempering scheme to be well-functioning is that the tempering variable ξ can properly explore the majority of the domain of the coupling function domλ(ξ); this ensures the expected variation on the effective temperature during sampling. For complex systems, however, it is often the case that the tempering variable is subject to a strong instantaneous force that prevents ξ from proper exploration of domλ(ξ) and therefore hinders the efficiency of tempering. The adaptive biasing force (ABF) algorithm [3] has emerged as a promising solution to such problem ever since its inception [4], where it was introduced to address the problem on fast calculation of the free energy of complex chemical or biochemical systems. Intuitively, ABF maintains and updates an estimate of the average force, i.e. the average of the instantaneous force exerted on the target variable. It then applies the estimate to the target variable in the opposite direction to counteract the instantaneous force and reduce it into small zero-mean fluctuations so that the variable undergoes random walks. 4 Algorithm 1 Thermostat-assisted continuously-tempering Hamiltonian Monte Carlo Input: stepsize ηθ,ηξ; level of injected noise cθ,cξ; thermal inertia γθ,γξ; # of steps for unit interval K 1: rθ ∼N(0,ηθI) and rξ ∼N(0,ηξ); (zθ, zξ) ←(cθ,cξ) 2: INITIALISE( θ,ξ,abf,samples ) 3: for k = 1,2,3,. . . do 4: λ ←LAMBDA( ξ ); δλ ←LAMBDADERIVATIVE( ξ ) 5: zξ ←zξ + δλ2 r2 ξ −ηξ γξ 6: zθ ←zθ + λ2 r⊤ θ rθj /dim(rθ) −ηθ γθ 7: S ←NEXTBATCH( D, k ); δA ←abf[ ABFINDEXING( ξ ) ] 8: ˜U ←MODELFORWARD( θ,S); ˜f ←MODELBACKWARD( θ,S) 9: rξ ←rξ −δλ  ηξ ˜U + N(0,2cξηξ)  −δλ2zξrξ + ηξδA 10: rθ ←rθ + λ  ηθ ˜f + N(0,2cθηθI)  −λ2zθrθ 11: ABFUPDATE( abf,ξ,δλ, ˜U, k ) 12: ξ ←ξ + rξ 13: if ISINSIDEWELL( ξ ) = false then ▷ξ is restricted by the well of infinite height. 14: rξ ←−rξ; ξ ←ξ + rξ ▷ξ bounces back when hitting the wall. 15: θ ←θ + rθ 16: if k = 0 mod K and λ = 0 then 17: APPEND( samples,θ ) ▷θ is collected as a new sample in samples. 18: rθ ∼N(0,ηθI) and rξ ∼N(0,ηξ) ▷rθ,rξ is optionally resampled. 19: function ABFUPDATE( abf,ξ,δλ, ˜U, k ) 20: j ←ABFINDEXING( ξ ) ▷ξ is mapped to the index j of the associated bin. 21: abf[ j ] ←[1 −1/k]abf[ j ] + [1/k]δλ · ˜U Formally, the function of free energy w.r.t. ξ is defined by convention in the form of A(ξ) = −T log π(ξ) + const, where π(ξ) = Õ Γ\ξ π(Γ) with the extended state Γ = (θ,ξ,pθ, pξ). The equation of pξ in Eq. (5) is then augmented with the derivative of A(ξ) such that dpξ  dt = −λ′(ξ) ˜U(θ) −W ′(ξ) + A′(ξ) −  λ′(ξ) 2sξ pξ, (10) where A′(ξ) is referred to as the adaptive biasing force induced by the free energy as A′(ξ) = −T π(ξ) dπ dξ = Í Γ\ξ  ∂H ∂ξ  e−H(Γ)/T Í Γ\ξ e−H(Γ)/T B  ∂H ∂ξ ξ  . (11) The brackets ⟨·|ξ⟩denote the conditional average, i.e. the average on the canonical distribution π(Γ) with ξ held fixed. A′(ξ) is the average of the reversed instantaneous force on ξ. It is proved [14] that ABF converges to the equilibrium at which ξ’s free energy landscape is flattened, even though the augmentation in Eq. (10) alters the equations of motion originally defined in Eq. (5). 3.3 Implementation As proved in Theorem 1, the dynamics in Eq. (5) is capable of preserving the correct distribution in the presence of noise. In principle, it requires the thermostat Sθ to be of size D2 for the D-dimensional parameter θ; however, the storage is unaffordable for complex models in high dimensions. A plausible option to mitigate this issue is to assume homogeneous θ and isotropic Gaussian noise such that the mass Mθ = mθI and the variance V f (θ) = vf (θ)I; this simplifies the high-dimensional Sθ to scalar sθ. The confining potential W(ξ) that determines the range of the tempering variable ξ is implemented as a well of infinite height. When colliding with the boundary of W(ξ), ξ bounces back elastically with the velocity reversed. The Euler’s method is then applied such that dt →∆t. In Eq. (11), the calculation of A′(ξ) involves the ensemble average ⟨∂H/∂ξ|ξ⟩, hence being intractable. Here we instead calculate the time average Í k ∂H/∂ξ|ξk , which is equivalent to the ensemble average in the long-time limit under the assumption of ergodicity; it can be readily calculated in a recurrent form during sampling. To maintain the runtime estimates of A′(ξ), the range of ξ is divided uniformly into J bins of equal length with memory initialised in each of those bins. At each time step k, ABF determines the index j of the bin in which the tempering variable ξ = ξk is currently located, and then updates the time average using the record in memory and the current force ∂H/∂ξ|ξk evaluated at ξk. With all components assembled, we establish the TACT-HMC algorithm as Algorithm. 1 with rθ = pθ ∆t mθ , rξ = pξ ∆t mξ , zθ = sθ ∆t, zξ = sξ ∆t, ηθ = ∆t2 mθ , ηξ = ∆t2 mξ , γθ = κθ mθD, γξ = κξ mξ applied as the change of variables for the convenience of implementation. Furthermore, we introduce additional Gaussian noises N(0,2cξηξ) and N(0,2cθηθI) in momenta updates to improve ergodicity. 5 -20 -15 -10 -5 0 5 10 15 20 0.00 0.05 0.10 0.15 0.20 Pr( ) I. Samples via the proposed method -20 -15 -10 -5 0 5 10 15 20 0.00 0.05 0.10 0.15 0.20 Pr( ) II. Samples via well-tempered HMC w/o thermostats -20 -15 -10 -5 0 5 10 15 20 0.00 0.05 0.10 0.15 0.20 Pr( ) III. Samples via thermostat-assisted HMC w/o tempering (a) Histograms of samples generated by TACT-HMC and the ablated alternatives, with the target shown in blue. 0.00 0 -200 -400 -600 20 Iteration 15 10 5 0 -5 -10 -800 -1000 0.05 -1200 -15 -1400 -20 0.10 Pr( ) I. Sampling trajectory 0.15 0.20 0 1 2 3 4 5 6 7 8 9 10 Iteration 104 0.7 0.8 0.9 1.0 1.1 1.2 1.3 CUMAVG(s ) II. Cumulative averages of thermostats 0 1 2 3 4 5 6 7 8 9 10 Iteration 104 0.7 0.8 0.9 1.0 1.1 1.2 1.3 CUMAVG(s ) -3 -2 -1 0 1 2 3 4 5 s 0.0 0.1 0.2 0.3 0.4 0.5 Pr(s ) III. Histograms of sampled thermostats -3 -2 -1 0 1 2 3 4 5 s 0.0 0.1 0.2 0.3 0.4 0.5 Pr(s ) 0 5 10 15 20 25 30 Lag k 0.00 0.25 0.50 0.75 1.00 (k) IV. Autocorrelation plot 0 50 100 150 200 250 300 Time 0 5 10 15 kBT( ) V. Variation of temperature (b) I: Sampling trajectory of TACT-HMC, demonstrating robust mixing property; II: Cumulative averages of thermostats, indicating fast convergence to the theoretical reference values drawn by red lines; III: Histograms of sampled thermostats, showing a good fit to the theoretical distributions by blue curves; IV: Autocorrelation plot of samples, the decreasing of autocorrelation is comparably fast; V: (A snapshot of) variation on the effective system temperature during simulation, with the standard reference of unity temperature marked by red line. Figure 1: Experiment on sampling a 1d synthetic distribution. 4 Related work Since the inception of the stochastic gradient Langevin dynamics (SGLD) [24], algorithms originated from stochastic approximation [21] have received increasing attention on tasks of Bayesian learning. By adding the right amount of noise to the updates of the stochastic gradient descent (SGD), SGLD manages to properly sample the posterior in a random-walk fashion akin to the full-batch Metropolisadjusted Langevin algorithm (MALA) [22]. To enable the Hamiltonian dynamics for efficient state space exploration, Chen et al. [2] extended the mechanism designed for SGLD to HMC, and proposed the stochastic gradient Hamiltonian Monte Carlo (SGHMC). As is shown that the stochastic gradient drives the Hamiltonian dynamics to deviate, SGHMC estimates the unknown noise from the stochastic gradient with the Fisher information matrix, and then compensates the estimated noise by augmenting the Hamiltonian dynamics with an additive friction derived from the estimated Fisher matrix. It turns out that the friction can be linked to the momentum term within a class of accelerated gradient-based methods [19, 17, 23] in optimisation. Shortly after SGHMC, Ding et al. [5] came up with the idea of incorporating the Nosé-Hoover thermostat [18, 11] into the Hamiltonian dynamics in replacement of the constant friction in SGHMC, and hence developed the stochastic gradient Nosé-Hoover thermostat (SGNHT). The thermostat in SGNHT serves as an adaptive friction which adaptively neutralises the mini-batch noise from the stochastic gradient into the system [12]. Parallel to those aforementioned studies, recent advances in the development of continuous tempering [8, 15] as well as its applications in machine learning [25, 9] are of particular interest. Ye et al. [25] proposed the continuously tempered Langevin dynamics (CTLD), which leverages the mechanism of continuous tempering and embeds the tempering variable in an extended stochastic gradient secondorder Langevin dynamics. CTLD facilitates exploration on rugged landscapes of objective functions, locating the “good” wide valleys on the landscape and preventing early trapping in the “bad” narrow local minima. Nevertheless, CTLD is designed to be an initialiser for training deep neural networks; it serves as an enhancement of the subsequent gradient-based optimisers instead of a Bayesian solution. From the Bayesian perspective, Graham et al. [9] developed the continuously-tempered Hamiltonian Monte Carlo (CTHMC) operating in a full-batch setting. CTHMC augments the Hamiltonian system with an extra continuously-varying control variate borrowed from the scheme of continuous tempering, which enables the extended Hamiltonian dynamics to bridge between sampling a complex multimodal target posterior and a simpler unimodal base distribution. Albeit beneficial for mixing, its dynamics lacks the ability to handle the mini-batch noise, and thus fails to function properly with mini-batches. 5 Experiment Two sets of experiments are carried out. We first conduct an ablation study with synthetic distributions, where we visualise the system dynamics and validate the efficacy of TACT-HMC. We then evaluate the performance of our method against several strong baselines on three real datasets. 6 Figure 2: Experiments on sampling two 2d synthetic distributions. Left: The distributions to sample; Mid-left: Histograms sampled by TACT-HMC; Mid-right: Histograms by the well-tempered sampler without thermostatting; Right: Histograms by the thermostat-assisted sampler without tempering. 5.1 Multimodal sampling of synthetic distributions We run TACT-HMC on three 1d/2d synthetic distributions. In the meantime, two ablated alternatives are initiated in parallel with the same setting: one is equipped with thermostats but without tempering for sampling acceleration, the other is well-tempered but without thermostatting against noise. The distributions are synthesised to contain multiple distant modes; the calculation of gradient is perturbed by Gaussian noise that is unknown to all samplers. Figure 1 summarises the result of sampling a mixture of three 1d Gaussians. As the figure indicates, only TACT-HMC is capable of correctly sampling from the target. The sampler without thermostatting is heavily influenced by the noise in gradient, resulting in a spread histogram; while the one without tempering gets trapped by those energy barriers and hence fails to explore the entire space of system configurations. The sampling trajectory and properties of TACT-HMC are illustrated in details in Fig. 1b, which justifies the correctness of TACT-HMC. The autocorrelation of samples ρ(k) is calculated and shown in Fig. 1b(IV), which decreases monotonically from ρ(0) = 1 down to ρ(∞) →0+. The effective sample size (ESS) can thus be readily evaluated through the formula ESS = n 1 + 2 Í∞ k=1 ρ(k), with ρ(k) as the autocorrelation at lag k. The ESS for TACT-HMC in this 1d Gaussian mixture case is 2.1096 × 104 out of n = 105 samples, which is roughly 60.2% of the value for SGHMC and 50.9% of that for SGNHT. We believe that the non-linear interaction between the parameter of interest θ and the tempering variable ξ via the multiplicative term λ(ξ)U(θ) results in a longer autocorrelation time and hence a lower ESS value. We also investigate the variation of the effective system temperature during sampling. A snapshot of the trajectory regarding the effective system temperature is demonstrated in Fig. 1b(V): it constantly oscillates between higher and lower temperatures, and returns to the unity temperature occasionally. We further conduct two 2d sampling experiments as shown in Fig. 2. Comparing between columns, we find that TACT-HMC recovers those multiple modes for both distributions while neutralising the influence of the noise in gradient; however, the samplings by the ablated alternatives are impaired either by the noise in gradient or by the energy barriers as discovered in the 1d scenario. 5.2 Bayesian learning on real datasets Stepping out of the study on the synthetic cases, we then move on to the tasks of image classification on three real datasets: EMNIST3, Fashion-MNIST4 and CIFAR-10. The performance is evaluated and compared in terms of the accuracy of classification on three types of neural networks: multilayer perceptrons (MLPs), recurrent neural networks (RNNs), and convolutional neural networks (CNNs). Two recent samplers are chosen as part of the baselines, namely SGNHT [5] and SGHMC [2]; besides, two widely-used gradient-based optimisers, Adam [13] and momentum SGD [23], are compared. Each method will keep running for 1000 epochs in either sampling or training before the evaluation and comparison. We further apply random permutation to a certain percentage (0%, 20%, and 30%) of the training labels at the beginning of each epoch for demonstrating the robustness of our method. 3https://www.nist.gov/itl/iad/image-group/emnist-dataset 4https://github.com/zalandoresearch/fashion-mnist 7 Table 1: Result of Bayesian learning experiments on real datasets MLP on EMNIST RNN on Fashion-MNIST CNN on CIFAR-10 % permuted labels 0% 20% 30% 0% 20% 30% 0% 20% 30% Adam [13] 83.39% 80.27% 80.63% 88.84% 88.35% 88.25% 69.53% 72.39% 71.05% momentum SGD [23] 83.95% 82.64% 81.70% 88.66% 88.91% 88.34% 64.25% 65.09% 67.70% SGHMC [2] 84.53% 82.62% 81.56% 90.25% 88.98% 88.49% 76.44% 73.87% 71.79% SGNHT [5] 84.48% 82.63% 81.60% 90.18% 89.10% 88.58% 76.60% 73.86% 71.37% TACT-HMC (Alg. 1) 84.85% 82.95% 81.77% 90.84% 89.61% 89.01% 78.93% 74.88% 73.22% All four baselines are tuned to their best on each task; the setting of TACT-HMC will be specified for each task in the corresponding subsection. For the baseline samplers, the accuracy of classification is calculated from Monte Carlo integration on all sampled models; for the baseline optimisers, the performance is evaluated directly on test sets after training. The result is summarised in Table. 1. EMNIST classification with MLP. The MLP herein defines a three-layered fully-connected neural network with the hidden layer consisting of 100 neurons. EMNIST Balanced is selected as the dataset, where 47 categories of images are split into a training set of size 112,800 and a complementary test set of size 18,800. The batch size is fixed at 128 for all methods in both sampling and training tests. For readability, we introduce a 7-tuple [ηθ,ηξ,cθ,cξ,γθ,γξ,K] as the specification to set up TACT-HMC (see Alg. 1). In this specification, [ηθ,cθ,γθ] denote the step size, the level of the injected Gaussian noise and the thermal inertia, all w.r.t. the parameter of interest θ; similarly, [ηξ,cξ,γξ] represent the quantities corresponding to the tempering variable ξ; K defines the number of steps in simulating a unit interval. In this experiment, TACT-HMC is configured as [0.0015,0.0015,0.05,0.05,1.0,1.0,50]. Fashion-MNIST classification with RNN. The RNN contains a LSTM layer [10] as the first layer, with the input/output dimensions being 28/128. It takes as the input via scanning a 28 × 28 image vertically each line of a time. After 28 steps of scanning, the LSTM outputs a representative vector of length 128 into ReLU activation, which is followed by a dense layer of size 64 with ReLU activation. The prediction regarding 10 categories is generated through softmax activation in the output layer. The batch size is fixed at 64 for all methods in comparison. The specification of TACT-HMC in this experiment is determined as [0.0012,0.0012,0.15,0.15,1.0,1.0,50]. CIFAR-10 classification with CNN. The CNN comprises of four learnable layers: from the bottom to the top, a 2d convolutional layer using the kernel of size 3×3×3×16, and another 2d convolutional layer with the kernel of size 3×3×16×16, then two dense layers of size 100 and 10. ReLU activations are inserted between each of those learnable layers. For each convolutional layer, the stride is set to 1 × 1, and a pooling layer with 2 × 2 stride is appended after the ReLU activation. Softmax function is applied for generating the final prediction over 10 categories. The batch size is fixed at 64 for all methods. Here, TACT-HMC’s specification is set as [0.0010,0.0010,0.10,0.10,1.0,1.0,50]. Discussion. As summarised in Table. 1, TACT-HMC outperforms all four baselines on the accuracy of classification. Specifically, TACT-HMC demonstrates advantages on complicated tasks, e.g. the CIFAR-10 classification with CNN where the model has relatively higher complexity and the dataset contains multiple channels. For the RNN task, our method outperforms others with roughly 0.5% on accuracy. The performance gain on the MLP task is rather limited; we believe the reason for this is that the complexities of both model and dataset are essentially moderate. When the random permutation is applied to a larger portion of training labels, TACT-HMC still maintains robust performance on the accuracy of classification, even though the landscape of the objective function becomes rougher and the system dynamics gathers more noise. 6 Conclusion We developed a new sampling method, which is called the thermostat-assisted continuously-tempered Hamiltonian Monte Carlo, to facilitate Bayesian learning with large datasets and multimodal posterior distributions. The method builds a well-tempered Hamiltonian system by incorporating the scheme of continuous tempering in the system for classic HMC, and then simulates the dynamics augmented by Nosé-Hoover thermostats. This sampler is designed for two substantial demands: first, to efficiently generate representative i.i.d. samples from complex multimodal distributions; second, to adaptively neutralise the noise arising from mini-batches. Extensive experiments have been carried out on both synthetic distributions and real-world applications. The result validated the efficacy of tempering and thermostatting, demonstrating great potentials of our sampler in accelerating deep Bayesian learning. 8 References [1] Steve Brooks, Andrew Gelman, Galin Jones, and Xiao-Li Meng. Handbook of markov chain monte carlo. CRC press, 2011. [2] Tianqi Chen, Emily B Fox, and Carlos Guestrin. Stochastic gradient hamiltonian monte carlo. In ICML, pages 1683–1691, 2014. [3] Jeffrey Comer, James C Gumbart, Jérôme Hénin, Tony Lelièvre, Andrew Pohorille, and Christophe Chipot. The adaptive biasing force method: Everything you always wanted to know but were afraid to ask. The Journal of Physical Chemistry B, 119(3):1129–1151, 2014. [4] Eric Darve and Andrew Pohorille. Calculating free energies using average force. The Journal of Chemical Physics, 115(20):9169–9183, 2001. [5] Nan Ding, Youhan Fang, Ryan Babbush, Changyou Chen, Robert D Skeel, and Hartmut Neven. Bayesian sampling using stochastic gradient thermostats. In Advances in neural information processing systems, pages 3203–3211, 2014. [6] Simon Duane, Anthony D Kennedy, Brian J Pendleton, and Duncan Roweth. Hybrid monte carlo. Physics letters B, 195(2):216–222, 1987. [7] Farhan Feroz and MP Hobson. Multimodal nested sampling: an efficient and robust alternative to markov chain monte carlo methods for astronomical data analyses. Monthly Notices of the Royal Astronomical Society, 384(2):449–463, 2008. [8] Gianpaolo Gobbo and Benedict J Leimkuhler. Extended hamiltonian approach to continuous tempering. Physical Review E, 91(6):061301, 2015. [9] Matthew M. Graham and Amos J. Storkey. Continuously tempered hamiltonian monte carlo. In Gal Elidan, Kristian Kersting, and Alexander T. Ihler, editors, Proceedings of the Thirty-Third Conference on Uncertainty in Artificial Intelligence, UAI 2017, Sydney, Australia, August 11-15, 2017. AUAI Press, 2017. [10] Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8):1735–1780, 1997. [11] William G Hoover. Canonical dynamics: equilibrium phase-space distributions. Physical review A, 31(3):1695, 1985. [12] Andrew Jones and Ben Leimkuhler. Adaptive stochastic methods for sampling driven molecular systems. The Journal of chemical physics, 135(8):084125, 2011. [13] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2014. [14] Tony Lelièvre, Mathias Rousset, and Gabriel Stoltz. Long-time convergence of an adaptive biasing force method. Nonlinearity, 21(6):1155, 2008. [15] Nicolas Lenner and Gerald Mathias. Continuous tempering molecular dynamics: A deterministic approach to simulated tempering. Journal of chemical theory and computation, 12(2):486–498, 2016. [16] Radford M Neal et al. Mcmc using hamiltonian dynamics. Handbook of Markov Chain Monte Carlo, 2:113–162, 2011. [17] Yurii Nesterov. A method of solving a convex programming problem with convergence rate o(1/k2). Soviet Mathematics Doklady, 27(2):372–376, 1983. [18] Shuichi Nosé. A unified formulation of the constant temperature molecular dynamics methods. The Journal of chemical physics, 81(1):511–519, 1984. [19] Boris T Polyak. Some methods of speeding up the convergence of iteration methods. USSR Computational Mathematics and Mathematical Physics, 4(5):1–17, 1964. [20] H. Risken and H. Haken. The Fokker-Planck Equation: Methods of Solution and Applications Second Edition. Springer, 1989. [21] Herbert Robbins and Sutton Monro. A stochastic approximation method. The annals of mathematical statistics, pages 400–407, 1951. [22] Gareth O Roberts, Richard L Tweedie, et al. Exponential convergence of langevin distributions and their discrete approximations. Bernoulli, 2(4):341–363, 1996. 9 [23] Ilya Sutskever, James Martens, George Dahl, and Geoffrey Hinton. On the importance of initialization and momentum in deep learning. In International conference on machine learning, pages 1139–1147, 2013. [24] Max Welling and Yee W Teh. Bayesian learning via stochastic gradient langevin dynamics. In Proceedings of the 28th International Conference on Machine Learning (ICML-11), pages 681–688, 2011. [25] Nanyang Ye, Zhanxing Zhu, and Rafal Mantiuk. Langevin dynamics with continuous tempering for training deep neural networks. In Advances in Neural Information Processing Systems, pages 618–626, 2017. 10
2018
1000
7,245
Flexible Neural Representation for Physics Prediction Damian Mrowca1,⇤, Chengxu Zhuang2,⇤, Elias Wang3,⇤, Nick Haber2,4,5 , Li Fei-Fei1 , Joshua B. Tenenbaum7,8 , and Daniel L. K. Yamins1,2,6 Department of Computer Science1, Psychology2, Electrical Engineering3, Pediatrics4 and Biomedical Data Science5, and Wu Tsai Neurosciences Institute6, Stanford, CA 94305 Department of Brain and Cognitive Sciences7, and Computer Science and Artificial Intelligence Laboratory8, MIT, Cambridge, MA 02139 {mrowca, chengxuz, eliwang}@stanford.edu Abstract Humans have a remarkable capacity to understand the physical dynamics of objects in their environment, flexibly capturing complex structures and interactions at multiple levels of detail. Inspired by this ability, we propose a hierarchical particlebased object representation that covers a wide variety of types of three-dimensional objects, including both arbitrary rigid geometrical shapes and deformable materials. We then describe the Hierarchical Relation Network (HRN), an end-to-end differentiable neural network based on hierarchical graph convolution, that learns to predict physical dynamics in this representation. Compared to other neural network baselines, the HRN accurately handles complex collisions and nonrigid deformations, generating plausible dynamics predictions at long time scales in novel settings, and scaling to large scene configurations. These results demonstrate an architecture with the potential to form the basis of next-generation physics predictors for use in computer vision, robotics, and quantitative cognitive science. 1 Introduction Humans efficiently decompose their environment into objects, and reason effectively about the dynamic interactions between these objects [43, 45]. Although human intuitive physics may be quantitatively inaccurate under some circumstances [32], humans make qualitatively plausible guesses about dynamic trajectories of their environments over long time horizons [41]. Moreover, they either are born knowing, or quickly learn about, concepts such as object permanence, occlusion, and deformability, which guide their perception and reasoning [42]. An artificial system that could mimic such abilities would be of great use for applications in computer vision, robotics, reinforcement learning, and many other areas. While traditional physics engines constructed for computer graphics have made great strides, such routines are often hard-wired and thus challenging to integrate as components of larger learnable systems. Creating end-to-end differentiable neural networks for physics prediction is thus an appealing idea. Recently, Chang et al. [11] and Battaglia et al. [4] have illustrated the use of neural networks to predict physical object interactions in (mostly) 2D scenarios by proposing object-centric and relation-centric representations. Common to these works is the treatment of scenes as graphs, with nodes representing object point masses and edges describing the pairwise relations between objects (e.g. gravitational, spring-like, or repulsing relationships). Object relations and physical states are used to compute the pairwise effects between objects. After combining effects on an object, the future physical state of the environment is predicted on a per-object basis. This approach is very promising in its ability to explicitly handle ⇤Equal contribution 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. object interactions. However, a number of challenges have remained in generalizing this approach to real-world physical dynamics, including representing arbitrary geometric shapes with sufficient resolution to capture complex collisions, working with objects at different scales simultaneously, and handling non-rigid objects of nontrivial complexity. t t+1 t+2 t+3 t+4 t+5 t+6 t+7 t+8 t+9 Ground Truth Prediction Figure 1: Predicting physical dynamics. Given past observations the task is to predict the future physical state of a system. In this example, a cube deforms as it collides with the ground. The top row shows the ground truth and the bottom row the prediction of our physics prediction network. Several of these challenges are illustrated in the fast-moving deformable cube sequence depicted in Figure 1. Humans can flexibly vary the level of detail at which they perceive such objects in motion: The cube may naturally be conceived as an undifferentiated point mass as it moves along its initial kinematic trajectory. But as it collides with and bounces up from the floor, the cube’s complex rectilinear substructure and nonrigid material properties become important for understanding what happens and predicting future interactions. The ease with which the human mind handles such complex scenarios is an important explicandum of cognitive science, and also a key challenge for artificial intelligence. Motivated by both of these goals, our aim here is to develop a new class of neural network architectures with this human-like ability to reason flexibly about the physical world. To this end, it would be natural to extend the interaction network framework by representing each object as a (potentially large) set of connected particles. In such a representation, individual constituent particles could move independently, allowing the object to deform while being constrained by pairwise relations preventing the object from falling apart. However, this type of particle-based representation introduces a number of challenges of its own. Conceptually, it is not immediately clear how to efficiently propagate effects across such an object. Moreover, representing every object with hundreds or thousands of particles would result in an exploding number of pairwise relations, which is both computationally infeasible and cognitively unnatural. As a solution to these issues, we propose a novel cognitively-inspired hierarchical graph-based object representation that captures a wide variety of complex rigid and deformable bodies (Section 3), and an efficient hierarchical graph-convolutional neural network that learns physics prediction within this representation (Section 4). Evaluating on complex 3D scenarios, we show substantial improvements relative to strong baselines both in quantitative prediction accuracy and qualitative measures of prediction plausibility, and evidence for generalization to complex unseen scenarios (Section 5). 2 Related Work An efficient and flexible predictor of physical dynamics has been an outstanding question in neural network design. In computer vision, modeling moving objects in images or videos for action recognition, future prediction, and object tracking is of great interest. Similarly in robotics, actionconditioned future prediction from images is crucial for navigation or object interactions. However, future predictors operating directly on 2D image representations often fail to generate sharp object boundaries and struggle with occlusions and remembering objects when they are no longer visually observable [1, 17, 16, 28, 29, 33, 34, 19]. Representations using 3D convolution or point clouds are better at maintaining object shape [46, 47, 10, 36, 37], but do not entirely capture object permanence, and can be computationally inefficient. More similar to our approach are inverse graphics methods that extract a lower dimensional physical representation from images that is used to predict physics [25, 26, 51, 50, 52, 53, 7, 49]. Our work draws inspiration from and extends that of Chang et al. [11] and Battaglia et al. [4], which in turn use ideas from graph-based neural networks [39, 44, 9, 30, 22, 14, 13, 24, 8, 40]. Most of the existing work, however, does not naturally handle complex scene scenarios with objects of widely varying scales or deformable objects with complex materials. Physics simulation has also long been studied in computer graphics, most commonly for rigid-body collisions [2, 12]. Particles or point masses have also been used to represent more complex physical 2 objects, with the neural network-based NeuroAnimator being one of the earliest examples to use a hierarchical particle representation for objects to advance the movement of physical objects [18]. Our particle-based object representation also draws inspiration from recent work on (non-neural-network) physics simulation, in particular the NVIDIA FleX engine [31, 6]. However, unlike this work, our solution is an end-to-end differentiable neural network that can learn from data. Recent research in computational cognitive science has posited that humans run physics simulations in their mind [5, 3, 20, 48, 21]. It seems plausible that such simulations happen at just the right level of detail which can be flexibly adapted as needed, similar to our proposed representation. Both the ability to imagine object motion as well as to flexibly decompose an environment into objects and parts form an important prior that humans rely on for further learning about new tasks, when generalizing their skills to new environments or flexibly adapting to changes in inputs and goals [27]. 3 Hierarchical Particle Graph Representation A key factor for predicting the future physical state of a system is the underlying representation used. A simplifying, but restrictive, often made assumption is that all objects are rigid. A rigid body can be represented with a single point mass and unambiguously situated in space by specifying its position and orientation, together with a separate data structure describing the object’s shape and extent. Examples are 3D polygon meshes or various forms of 2D or 3D masks extracted from perceptual data [10, 16]. The rigid body assumption describes only a fraction of the real world, excluding, for example, soft bodies, cloths, fluids, and gases, and precludes objects breaking and combining. However, objects are divisible and made up of a potentially large numbers of smaller sub-parts. Given a scene with a set of objects O, the core idea is to represent each object o 2 O with a set of particles Po ⌘{pi|i 2 o}. Each particle’s state at time t is described by a vector in R7 consisting of its position x 2 R3, velocity δ 2 R3, and mass m 2 R+. We refer to pi and this vector interchangeably. Particles are spaced out across an object to fully describe its volume. In theory, particles can be arbitrarily placed within an object. Thus, less complex parts can be described with fewer particles (e.g. 8 particles fully define a cube). More complicated parts (e.g. a long rod) can be represented with more particles. We define P as the set {pi|1 i NP } of all NP particles in the observed scene. ... Figure 2: Hierarchical graph-based object representation. An object is decomposed into particles. Particles (of the same color) are grouped into a hierarchy representing multiple object scales. Pairwise relations constrain particles in the same group and to ancestors and descendants. To fully physically describe a scene containing multiple objects with particles, we also need to define how the particles relate to each other. Similar to Battaglia et al. [4], we represent relations between particles pi and pj with K-dimensional pairwise relationships R = {rij 2 RK}. Each relationship rij within an object encodes material properties. For example, for a soft body rij 2 R represents the local material stiffness, which need not be uniform within an object. Arbitrarily-shaped objects with potentially nonuniform materials can be represented in this way. Note that the physical interpretation of rij is learned from data rather than hard-coded through equations. Overall, we represent the scene by a node-labeled graph G = hP, Ri where the particles form the nodes P and the relations define the (directed) edges R. Except for the case of collisions, different objects are disconnected components within G. The graph G is used to propagate effects through the scene. It is infeasible to use a fully connected graph for propagation as pairwise-relationship computations grow with O(N 2 P ). To achieve O(NP log(NP )) complexity, we construct a hierarchical scene (di)graph GH from G in which the nodes of each connected component are organized into a tree structure: First, we initialize the leaf nodes L of GH as the original particle set P. Then, we extend GH by a root node for each connected component (object) in G. The root node states are defined as the aggregates of their leaf node states. The root nodes are connected to their leaves with directed edges and vice versa. 3 At this point, GH consists of the leaf particles L representing the finest scene resolution and one root node for each connected component describing the scene at the object level. To obtain intermediate levels of detail, we then cluster the leaves L in each connected component into smaller subcomponents using a modified k-means algorithm. We add one node for each new subcomponent and connect its leaves to the newly added node and vice versa. This newly added node is then labeled as the direct ancestors for its leaves and its leaves are siblings to each other. We then connect the added intermediate nodes with each other if and only if their respective subcomponent leaves are connected. Lastly, we add directed edges from the root node of each connected component to the new intermediate nodes in that component, and remove edges between leaves not in the same cluster. The process then recurses within each new subcomponent. See Algorithm 1 in the supplementary for details. We denote the sibling(s) of a particle p by sib(p), its ancestor(s) by anc(p), its parent by par(p), and its descendant(s) by des(p). We define leaves(pa) = {pl 2 L | pa 2 anc(pl)}. Note that in GH, directed edges connect pi and sib(pi), leaves pl and anc(pl), and pi and des(pi); see Figure 3b. 4 Physics Prediction Model In this section we introduce our physics prediction model. It is based on hierarchical graph convolution, an operation which propagates relevant physical effects through the graph hierarchy. 4.1 Hierarchical Graph Convolutions For Effect Propagation In order to predict the future physical state, we need to resolve the constraints that particles connected in the hierarchical graph impose on each other. We use graph convolutions to compute and propagate these effects. Following Battaglia et al. [4], we implement a pairwise graph convolution using two basic building blocks: (1) A pairwise processing unit φ that takes the sender particle state ps, the receiver particle state pr and their relation rsr as input and outputs the effect esr 2 RE of ps on pr, and (2) a commutative aggregation operation ⌃which collects and computes the overall effect er 2 RE. In our case, this is a simple summation over all effects on pr. Together these two building blocks form a convolution on graphs as shown in Figure 3a. ps1 ps2 ps3 pr ps1 es r 2 Σ er rs r ps ϕ pr pr pr 1 1 ps2 rs r 2 ps3 rs r 3 es r 1 es r 3 L 2 A A 2 D WS WS L2A A2D A2D Σ Σ Σ ϕL2A ϕWS ϕA2D ps2 ps3 pr η a) b) Figure 3: Effect propagation through graph convolutions. a) Pairwise graph convolution φ. A receiver particle pr is constrained in its movement through graph relations rsr with sender particle(s) ps. Given ps, pr and rsr, the effect esr of ps on pr is computed using a fully connected neural network. The overall effect er is the sum of all effects on pr. b) Hierarchical graph convolution ⌘. Effects in the hierarchy are propagated in three consecutive steps. (1) φL2A. Leaf particles L propagate effects to all of their ancestors A. (2) φW S. Effects are exchanged between siblings S. (3) φA2D. Effects are propagated from the ancestors A to all of their descendants D. Pairwise processing limits graph convolutions to only propagate effects between directly connected nodes. For a generic flat graph, we would have to repeatedly apply this operation until the information from all particles has propagated across the whole graph. This is infeasible in a scenario with many particles. Instead, we leverage direct connections between particles and their ancestors in our hierarchy to propagate all effects across the entire graph in one model step. We introduce a hierarchical graph convolution, a three stage mechanism for effect propagation as seen in Figure 3b: The first L2A (Leaves to Ancestors) stage φL2A(pl, pa, rla, e0 l ) predicts the effect eL2A la 2 RE of a leaf particle pl on an ancestor particle pa 2 anc(pl) given pl, pa, the material property information of rla, and input effect e0 l on pl. The second WS (Within Siblings) stage φW S(pi, pj, rij, eL2A i ) predicts the effect eW S ij 2 RE of sibling particle pi on pj 2 sib(pi). The third A2D (Ancestors to Descendants) stage φA2D(pa, pd, rad, eL2A a + eW S a ) predicts the effect eA2D ij 2 RE of an ancestor particle pa on a descendant particle pd 2 des(pa). The total propagated effect ei on particle pi is 4 ϕC ϕF Σ ϕH ψ η Pt+1 G(t-T,t] H Figure 4: Hierarchical Relation Network. The model takes the past particle graphs G(t−T,t] H = hP (t−T,t], R(t−T,t]i as input and outputs the next states P t+1. The inputs to each graph convolutional effect module φ are the particle states and relations, the outputs the respective effects. φH processes past states, φC collisions, and φF external forces. The hierarchical graph convolutional module ⌘ takes the sum of all effects, the pairwise particle states, and relations and propagates the effects through the graph. Finally, uses the propagated effects to compute the next particle states P t+1. computed by summing the various effects on that particle, ei = eL2A i + eW S i + eA2D i where eL2A a = X pl2leaves(pa) φL2A(pl, pa, rla, e0 l ) eW S j = X pi2sib(pj) φW S(pi, pj, rij, eL2A i ) eA2D d = X pa2anc(pd) φA2D(pa, pd, rad, eL2A a + eW S a ). In practice, φL2A, φW S, and φA2D are realized as fully-connected networks with shared weights that receive an additional ternary input (0 for L2A, 1 for WS, and 2 for A2D) in form of a one-hot vector. Since all particles within one object are connected to the root node, information can flow across the entire hierarchical graph in at most two propagation steps. We make use of this property in our model. 4.2 The Hierarchical Relation Network Architecture This section introduces the Hierarchical Relation Network (HRN), a neural network for predicting future physical states shown in Figure 4. At each time step t, HRN takes a history of T previous particle states P (t−T,t] and relations R(t−T,t] in the form of hierarchical scene graphs G(t−T,t] H as input. G(t−T,t] H dynamically changes over time as directed, unlabeled virtual collision relations are added for sufficiently close pairs of particles. HRN also takes external effects on the system (for example gravity g or external forces F) as input. The model consists of three pairwise graph convolution modules, one for external forces (φF ), one for collisions (φC) and one for past states (φH), followed by a hierarchical graph convolution module ⌘that propagates effects through the particle hierarchy. A fully-connected module then outputs the next states P t+1. In the following, we briefly describe each module. For ease of reading we drop the notation (t −T, t] and assume that all variables are subject to this time range unless otherwise noted. External Force Module The external force module φF converts forces F ⌘{fi} on leaf particles pi 2 P L into effects φF (pi, fi) = eF i 2 RE. Collision Module Collisions between objects are handled by dynamically defining pairwise collision relations rC ij between leaf particles pi 2 P L from one object and pj 2 P L from another object that are close to each other [11]. The collision module φC uses pi, pj and rC ij to compute the effects φC(pj, pi, rC ij) = eC ji 2 RE of pj on pi and vice versa. With dt(i, j) = kxt i −xt jk, the overall collision effects equal eC i = P j{eji|dt(i, j) < DC}. The hyperparameter DC represents the maximum distance for a collision relation. History Module The history module φH predicts the effects φ(p(t−T,t−1] i , pt i) 2 eH i from past p(t−T,t−1] i 2 P L on current leaf particle states pt i 2 P L. Hierarchical Effect Propagation Module The hierarchical effect propagation module ⌘propagates the overall effect e0 i = eF i + eC i + eH i from external forces, collisions and history on pi through the particle hierarchy. ⌘corresponds to the three-stage hierarchical graph convolution introduced in 5 Figure 3 b) which given the pairwise particle states pi and pj, their relation rij, and input effects e0 i , outputs the total propagated effect ei on each particle pi. State Prediction Module We use a simple fully-connected network to predict the next particle states P t+1. In order to get more accurate predictions, we leverage the hierarchical particle representation by predicting the dynamics of any given particle within the local coordinate system originated at its parent. The only exceptions are object root particles for which we predict the global dynamics. Specifically, the state prediction module (g, pi, ei) predicts the local future delta position δt+1 i,` = δt+1 i −δt+1 par(i) using the particle state pi, the total effect ei on pi, and the gravity g as input. As we only predict global dynamics for object root particles, the gravity is only applied to these root particles. The final future delta position in world coordinates is computed from local information as δt+1 i = δt+1 i,` + P j δt+1 j,` , j 2 anc(i). 4.3 Learning Physical Constraints through Loss Functions and Data Traditionally, physical systems are modeled with equations providing fixed approximations of the real world. Instead, we choose to learn physical constraints, including the meaning of the material property vector, from data. The error signal we found to work best is a combination of three objectives. (1) We predict the position change δt+1 i,` between time step t and t + 1 independently for all particles in the hierarchy. In practice, we find that δt+1 i,` will differ in magnitude for particles in different levels. Therefore, we normalize the local dynamics using the statistics from all particles in the same level (local loss). (2) We also require that the global future delta position δt+1 i is accurate (global loss). (3) We aim to preserve the intra-object particle structure by imposing that the pairwise distance between two connected particles pi and pj in the next time step dt+1(i, j) matches the ground truth. In the case of a rigid body this term works to preserve the distance between particles. For soft bodies, this objective ensures that pairwise local deformations are learned correctly (preservation loss). The total objective function linearly combines (1), (2), and (3) weighted by hyperparameters ↵and β: Loss = ↵ # X pi kˆδt+1 i,` −δt+1 i,` k2+β X pi kˆδt+1 i −δt+1 i k2$ + # 1−↵ $ X pi2sib(pj) k ˆdt+1(i, j) −dt+1(i, j)k2 5 Experiments In this section, we examine the HRN’s ability to accurately predict the physical state across time in scenarios with rigid bodies, deformable bodies (soft bodies, cloths, and fluids), collisions, and external actions. We also evaluate the generalization performance across various object and environment properties. Finally, we present some more complex scenarios including (e.g.) falling block towers and dominoes. Prediction roll-outs are generated by recursively feeding back the HRN’s one-step prediction as input. We strongly encourage readers to have a look at result examples shown in main text figures, supplementary materials, and at https://youtu.be/kD2U6lghyUE. All training data for the below experiments was generated via a custom interactive particle-based environment based on the FleX physics engine [31] in Unity3D. This environment provides (1) an automated way to extract a particle representation given a 3D object mesh, (2) a convenient way to generate randomized physics scenes for generating static training data, and (3) a standardized way to interact with objects in the environment through forces.†. Further details about the experimental setups and training procedure can be found in the supplement. 5.1 Qualitative evaluation of physical phenomena Rigid body kinematic motion and external forces. In a first experiment, rigid objects are pushed up, via an externally applied force, from a ground plane then fall back down and collide with the plane. The model is trained on 10 different simple shapes (cube, sphere, pyramid, cylinder, cuboid, torus, prism, octahedron, ellipsoid, flat pyramid) with 50-300 particles each. The static plane is represented using 5,000 particles with a practically infinite mass. External forces spatially dispersed with a Gaussian kernel are applied at randomly chosen points on the object. Testing is performed on †HRN code and Unity FleX environment can be found at https://neuroailab.github.io/physics/ 6 a) c) Ground Truth Prediction b) d) Ground Truth Prediction f) Ground Truth Prediction Ground Truth Prediction Ground Truth Prediction Ground Truth Prediction e) t+1 t+3 t+5 t+7 t+9 t+1 t+3 t+5 t+7 t+9 h) Ground Truth Prediction Ground Truth Prediction g) Figure 5: Prediction examples and ground truth. a) A cone bouncing off a plane. b) Parabolic motion of a bunny. A force is applied at the first frame. c) A cube falling on a slope. d) A cone colliding with a pentagonal prism. Both shapes were held-out. e) Three objects colliding on a plane. f) Falling block tower not trained on. g) A cloth drops and folds after hitting the floor. h) A fluid drop bursts on the ground. We strongly recommend watching the videos in the supplement. instances of the same rigid shapes, but with new force vectors and application points, resulting in new trajectories. Results can be seen in supplementary Figure F.9c-d, illustrating that the HRN correctly predicts the parabolic kinematic trajectories of tangentially accelerated objects, rotation due to torque, responses to initial external impulses, and the eventual elastic collisions of the object with the floor. Complex shapes and surfaces. In more complex scenarios, we train on the simple shapes colliding with a plane then generalize to complex non-convex shapes (e.g. bunny, duck, teddy). Figure 5b shows an example prediction for the bunny; more examples are shown in supplementary Figure F.9g-h. We also examine spheres and cubes falling on 5 complex surfaces: slope, stairs, half-pipe, bowl, and a “random” bumpy surface. See Figure 5c and supplementary Figure F.10c-e for results. We train on spheres and cubes falling on the 5 surfaces, and test on new trajectories. Dynamic collisions. Collisions between two moving objects are more complicated to predict than static collisions (e.g. between an object and the ground). We first evaluate this setup in a zero-gravity environment to obtain purely dynamic collisions. Training was performed on collisions between 9 pairs of shapes sampled from the 10 shapes in the first experiment. Figure 5d shows predictions for collisions involving shapes not seen during training, the cone and pentagonal prism, demonstrating HRN’s ability to generalize across shapes. Additional examples can be found in supplementary Figure F.9e-f, showing results on trained shapes. Many-object interactions. Complex scenarios include simultaneous interactions between multiple moving objects supported by static surfaces. For example, when three objects collide on a planar surface, the model has to resolve direct object collisions, indirect collisions through intermediate objects, and forces exerted by the surface to support the objects. To illustrate the HRN’s ability to handle such scenarios, we train on combinations of two and three objects (cube, stick, sphere, ellipsoid, triangular prism, cuboid, torus, pyramid) colliding simultaneously on a plane. See Figure 5e and supplementary Figure F.10f for results. We also show that HRN trained on the two and three object collision data generalizes to complex new scenarios. Generalization tests were performed on a falling block tower, a falling domino chain, and a bowl containing multiple spheres. All setups consist of 5 objects. See Figure 5f and supplementary Figures F.9b and F.10b,g for results. Although predictions sometimes differ from ground truth in their details, results still appear plausible to human observers. 7 Soft bodies. We repeat the same experiments but with soft bodies of varying stiffness, showing that HRN properly handles kinematics, external forces, and collisions with complex shapes and surfaces involving soft bodies. One illustrative result is depicted in Figure 1, showing a non-rigid cube as it deformably bounces off the floor. Additional examples are shown in supplementary Figure F.9g-h. Cloth. We also experiment with various cloth setups. In the first experiment, a cloth drops on the floor from a certain height and folds or deforms. In another experiment a cloth is fixated at two points and swings back and forth. Cloth predictions are very challenging as cloths do not spring back to their original shape and self-collisions have to be resolved in addition to collisions with the ground. To address this challenge, we add self-collisions, collision relationships between particles within the same object, in the collision module. Results can be seen in Figure 5g and supplementary Figure F.11 and show that the cloth motion and deformations are accurately predicted. Fluids. In order to test our models ability to predict fluids, we perform a simple experiment in which a fluid drop drops on the floor from a certain height. As effects within a fluid are mostly local, flat hierarchies with small groupings are better on fluid prediction. Results can be seen in Figure 5h and show that the fall of a liquid drop is successfully predicted when trained in this scenario. Response to parameter variation. To evaluate how the HRN responds to changes in mass, gravity and stiffness, we train on datasets in which these properties vary. During testing time we vary those parameters for the same initial starting state and evaluate how trajectories change. In supplementary Figures F.14, F.13 and F.12 we show results for each variation, illustrating e.g. how objects accelerate more rapidly in a stronger gravitational field. Heterogeneous materials. We leverage the hierarchical particle graph representation to construct objects that contain both rigid and soft parts. After training a model with objects of varying shapes and stiffnesses falling on a plane, we manually adjust individual stiffness relations to create a half-rigid half-soft object and generate HRN predictions. Supplementary Figure F.10h shows a half-rigid half-soft pyramid. Note that there is no ground truth for this example as we surpass the capabilities of the used physics simulator which is incapable of simulating objects with heterogeneous materials. 5.2 Quantitative evaluation and ablation We compare HRN to several baselines and model ablations. The first baseline is a simple MultiLayer-Perceptron (MLP) which takes the full particle representation and directly outputs the next particle states. The second baseline is the Interaction Network as defined by Battaglia et al. [4] denoted as fully connected graph as it corresponds to removing our hierarchy and computing on a fully connected graph. In addition, to show the importance of the φC, φF , and φH modules, we remove and replace them with simple alternatives. No φF replaces the force module by concatenating the forces to the particle states and directly feeding them into ⌘. Similarly for no φC, φC is removed by adding the collision relations to the object relations and feeding them directly through ⌘. In case of no φH, φH is simply removed and not replaced with anything. Next, we show that two input time steps (t, t −1) improve results by comparing it with a 1 time step model. Lastly, we evaluate the importance of the preservation loss and the global loss component added to the local loss. All models are trained on scenarios where two cubes collide fall on a plane and repeatedly collide after being pushed towards each other. The models are tested on held-out trajectories of the same scenario. An additional evaluation of different grouping methods can be found in Section B of the supplement. Position MSE Time Delta Position MSE Time Preserve Distance MSE Time Global + local loss Local loss No preservation loss No ϕH No ϕC No ϕF 1 time step Fully connected graph 0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 t t+1 t+2 t+3 t+4 t+5 t+6 t+7 t+8 t+9 0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 t t+1 t+2 t+3 t+4 t+5 t+6 t+7 t+8 t+9 MLP 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 t t+1 t+2 t+3 t+4 t+5 t+6 t+7 t+8 t+9 Figure 6: Quantitative evaluation. We compare the full HRN (global + local loss) to several baselines, namely local loss only, no preservation loss, no φH, no φC, no φF , 1 time step, fully connected graph and a MLP baseline. The line graphs from left to right show the mean squared error (MSE) between positions, delta positions and distance preservation accumulated over time. Our model has the lowest position and delta position error and a only slightly higher preservation error. 8 Comparison metrics are the cumulative mean squared error of the absolute global position, local position delta, and preserve distance error up to time step t + 9. Results are reported in Figure 6. The HRN outperforms all controls most of the time. The hierarchy is especially important, with the fully connected graph and MLP baselines performing substantially worse. Besides, the HRN without the hierarchical graph convolution mechanism performed significantly worse as seen in supplementary Figure C.4, which shows the necessity of the three consecutive graph convolution stages. In qualitative evaluations, we found that using more than one input time step improves results especially during collisions as the acceleration is better estimated which the metrics in Figure 6 confirm. We also found that splitting collisions, forces, history and effect propagation into separate modules with separate weights allows each module to specialize, improving predictions. Lastly, the proposed loss structure is crucial to model training. Without distance preservation or the global delta position prediction our model performs much worse. See supplementary Section C for further discussion on the losses and graph structures. 5.3 Discussion Our results show that the vast majority of complex multi-object interactions are predicted well, including multi-point collisions between non-convex geometries and complex scenarios like the bowl containing multiple rolling balls. Although not shown, in theory, one could also simulate shattering objects by removing enough relations between particles within an object. These manipulations are of substantial interest because they go beyond what is possible to generate in our simulation environment. Additionally, predictions of especially challenging situations such as multi-block towers were also mostly effective, with objects (mostly) retaining their shapes and rolling over each other convincingly as towers collapsed (see the supplement and the video). The loss of shape preservation over time can be partially attributed to the compounding errors generated by the recursive roll-outs. Nevertheless, our model predicts the tower to collapse faster than ground truth. Predictions also jitter when objects should stand absolutely still. These failures are mainly due to the fact that the training set contained only interactions between fast-moving pairs or triplets of objects, with no scenarios with objects at rest. That it generalized to towers as well as it did is a powerful illustration of our approach. Adding a fraction of training observations with objects at rest causes towers to behave more realistically and removes the jitter overall. The training data plays a crucial role in reaching the final model performance and its generalization ability. Ideally, the training set would cover the entirety of physical phenomena in the world. However, designing such a dataset by hand is intractable and almost impossible. Thus, methods in which a self-driven agent sets up its own physical experiments will be crucial to maximize learning and understanding[19]. 6 Conclusion We have described a hierarchical graph-based scene representation that allows the scalable specification of arbitrary geometrical shapes and a wide variety of material properties. Using this representation, we introduced a learnable neural network based on hierarchical graph convolution that generates plausible trajectories for complex physical interactions over extended time horizons, generalizing well across shapes, masses, external and internal forces as well as material properties. Because of the particle-based nature of our representation, it naturally captures object permanence identified in cognitive science as a key feature of human object perception [43]. A wide variety of applications of this work are possible. Several of interest include developing predictive models for grasping of rigid and soft objects in robotics, and modeling the physics of 3D point cloud scans for video games or other simulations. To enable a pixel-based end-to-end trainable version of the HRN for use in key computer vision applications, it will be critical to combine our work with adaptations of existing methods (e.g. [54, 23, 15]) for inferring initial (non-hierarchical) scene graphs from LIDAR/RGBD/RGB image or video data. In the future, we also plan to remedy some of HRN’s limitations, expanding the classes of materials it can handle to including inflatables or gases, and to dynamic scenarios in which objects can shatter or merge. This should involve a more sophisticated representation of material properties as well as a more nuanced hierarchical construction. Finally, it will be of great interest to evaluate to what extent HRN-type models describe patterns of human intuitive physical knowledge observed by cognitive scientists [32, 35, 38]. 9 Acknowledgments We thank Viktor Reutskyy, Miles Macklin, Mike Skolones and Rev Lebaredian for helpful discussions and their support with integrating NVIDIA FleX into our simulation environment. This work was supported by grants from the James S. McDonnell Foundation, Simons Foundation, and Sloan Foundation (DLKY), a Berry Foundation postdoctoral fellowship (NH), the NVIDIA Corporation, ONR - MURI (Stanford Lead) N00014-16-1-2127 and ONR - MURI (UCLA Lead) 1015 G TA275. References [1] P. Agrawal, A. V. Nair, P. Abbeel, J. Malik, and S. Levine. Learning to poke by poking: Experiential learning of intuitive physics. In Advances in Neural Information Processing Systems, pages 5074–5082, 2016. [2] D. Baraff. Physically based modeling: Rigid body simulation. SIGGRAPH Course Notes, ACM SIGGRAPH, 2(1):2–1, 2001. [3] C. Bates, P. Battaglia, I. Yildirim, and J. B. Tenenbaum. Humans predict liquid dynamics using probabilistic simulation. In CogSci, 2015. [4] P. Battaglia, R. Pascanu, M. Lai, D. Jimenez Rezende, and k. kavukcuoglu. Interaction networks for learning about objects, relations and physics. In Advances in Neural Information Processing Systems 29, pages 4502–4510. 2016. [5] P. W. Battaglia, J. B. Hamrick, and J. B. Tenenbaum. Simulation as an engine of physical scene understanding. Proceedings of the National Academy of Sciences, 110(45):18327–18332, 2013. [6] J. Bender, M. Müller, and M. Macklin. Position-based simulation methods in computer graphics. In Eurographics (Tutorials), 2015. [7] M. Brand. Physics-based visual understanding. Computer Vision and Image Understanding, 65 (2):192–205, 1997. [8] M. M. Bronstein, J. Bruna, Y. LeCun, A. Szlam, and P. Vandergheynst. Geometric deep learning: going beyond euclidean data. IEEE Signal Processing Magazine, 34(4):18–42, 2017. [9] J. Bruna, W. Zaremba, A. Szlam, and Y. LeCun. Spectral networks and locally connected networks on graphs. arXiv preprint arXiv:1312.6203, 2013. [10] A. Byravan and D. Fox. Se3-nets: Learning rigid body motion using deep neural networks. In Robotics and Automation (ICRA), 2017 IEEE International Conference on, pages 173–180. IEEE, 2017. [11] M. B. Chang, T. Ullman, A. Torralba, and J. B. Tenenbaum. A compositional object-based approach to learning physical dynamics. arXiv preprint arXiv:1612.00341, 2016. [12] E. Coumans. Bullet physics engine. Open Source Software: http://bulletphysics. org, 1:3, 2010. [13] M. Defferrard, X. Bresson, and P. Vandergheynst. Convolutional neural networks on graphs with fast localized spectral filtering. In Advances in Neural Information Processing Systems, pages 3844–3852, 2016. [14] D. K. Duvenaud, D. Maclaurin, J. Iparraguirre, R. Bombarell, T. Hirzel, A. Aspuru-Guzik, and R. P. Adams. Convolutional networks on graphs for learning molecular fingerprints. In Advances in neural information processing systems, pages 2224–2232, 2015. [15] H. Fan, H. Su, and L. J. Guibas. A point set generation network for 3d object reconstruction from a single image. In CVPR, volume 2, page 6, 2017. [16] C. Finn, I. Goodfellow, and S. Levine. Unsupervised learning for physical interaction through video prediction. In Advances in neural information processing systems, pages 64–72, 2016. [17] K. Fragkiadaki, P. Agrawal, S. Levine, and J. Malik. Learning visual predictive models of physics for playing billiards. arXiv preprint arXiv:1511.07404, 2015. 10 [18] R. Grzeszczuk, D. Terzopoulos, and G. Hinton. Neuroanimator: Fast neural network emulation and control of physics-based models. In Proceedings of the 25th annual conference on Computer graphics and interactive techniques, pages 9–20. ACM, 1998. [19] N. Haber, D. Mrowca, L. Fei-Fei, and D. L. Yamins. Learning to play with intrinsicallymotivated self-aware agents. arXiv preprint arXiv:1802.07442, 2018. [20] J. Hamrick, P. Battaglia, and J. B. Tenenbaum. Internal physics models guide probabilistic judgments about object dynamics. In Proceedings of the 33rd annual conference of the cognitive science society, pages 1545–1550. Cognitive Science Society Austin, TX, 2011. [21] M. Hegarty. Mechanical reasoning by mental simulation. Trends in cognitive sciences, 8(6): 280–285, 2004. [22] M. Henaff, J. Bruna, and Y. LeCun. Deep convolutional networks on graph-structured data. arXiv preprint arXiv:1506.05163, 2015. [23] T. Kipf, E. Fetaya, K.-C. Wang, M. Welling, and R. Zemel. Neural relational inference for interacting systems. arXiv preprint arXiv:1802.04687, 2018. [24] T. N. Kipf and M. Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016. [25] T. D. Kulkarni, V. K. Mansinghka, P. Kohli, and J. B. Tenenbaum. Inverse graphics with probabilistic cad models. arXiv preprint arXiv:1407.1339, 2014. [26] T. D. Kulkarni, W. F. Whitney, P. Kohli, and J. Tenenbaum. Deep convolutional inverse graphics network. In Advances in Neural Information Processing Systems, pages 2539–2547, 2015. [27] B. M. Lake, T. D. Ullman, J. B. Tenenbaum, and S. J. Gershman. Building machines that learn and think like people. Behavioral and Brain Sciences, 40, 2017. [28] A. Lerer, S. Gross, and R. Fergus. Learning physical intuition of block towers by example. arXiv preprint arXiv:1603.01312, 2016. [29] W. Li, S. Azimi, A. Leonardis, and M. Fritz. To fall or not to fall: A visual approach to physical stability prediction. arXiv preprint arXiv:1604.00066, 2016. [30] Y. Li, D. Tarlow, M. Brockschmidt, and R. Zemel. Gated graph sequence neural networks. arXiv preprint arXiv:1511.05493, 2015. [31] M. Macklin, M. Müller, N. Chentanez, and T.-Y. Kim. Unified particle physics for real-time applications. ACM Transactions on Graphics (TOG), 33(4):153, 2014. [32] M. McCloskey, A. Caramazza, and B. Green. Curvilinear motion in the absence of external forces: Naive beliefs about the motion of objects. Science, 210(4474):1139–1141, 1980. [33] R. Mottaghi, H. Bagherinezhad, M. Rastegari, and A. Farhadi. Newtonian scene understanding: Unfolding the dynamics of objects in static images. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3521–3529, 2016. [34] R. Mottaghi, M. Rastegari, A. Gupta, and A. Farhadi. “what happens if...” learning to predict the effect of forces in images. In European Conference on Computer Vision, pages 269–285. Springer, 2016. [35] L. Piloto, A. Weinstein, A. Ahuja, M. Mirza, G. Wayne, D. Amos, C.-c. Hung, and M. Botvinick. Probing physics knowledge using tools from developmental psychology. arXiv preprint arXiv:1804.01128, 2018. [36] C. R. Qi, H. Su, K. Mo, and L. J. Guibas. Pointnet: Deep learning on point sets for 3d classification and segmentation. Proc. Computer Vision and Pattern Recognition (CVPR), IEEE, 1(2):4, 2017. 11 [37] C. R. Qi, L. Yi, H. Su, and L. J. Guibas. Pointnet++: Deep hierarchical feature learning on point sets in a metric space. In Advances in Neural Information Processing Systems, pages 5105–5114, 2017. [38] R. Riochet, M. Y. Castro, M. Bernard, A. Lerer, R. Fergus, V. Izard, and E. Dupoux. Intphys: A framework and benchmark for visual intuitive physics reasoning. arXiv preprint arXiv:1803.07616, 2018. [39] F. Scarselli, M. Gori, A. C. Tsoi, M. Hagenbuchner, and G. Monfardini. The graph neural network model. IEEE Transactions on Neural Networks, 20(1):61–80, 2009. [40] M. Schlichtkrull, T. N. Kipf, P. Bloem, R. v. d. Berg, I. Titov, and M. Welling. Modeling relational data with graph convolutional networks. arXiv preprint arXiv:1703.06103, 2017. [41] K. A. Smith and E. Vul. Sources of uncertainty in intuitive physics. Topics in cognitive science, 5(1):185–199, 2013. [42] E. S. Spelke. Principles of object perception. Cognitive science, 14(1):29–56, 1990. [43] E. S. Spelke, K. Breinlinger, J. Macomber, and K. Jacobson. Origins of knowledge. Psychological review, 99(4):605, 1992. [44] I. Sutskever and G. E. Hinton. Using matrices to model symbolic relationship. In Advances in Neural Information Processing Systems, pages 1593–1600, 2009. [45] J. B. Tenenbaum, C. Kemp, T. L. Griffiths, and N. D. Goodman. How to grow a mind: Statistics, structure, and abstraction. science, 331(6022):1279–1285, 2011. [46] D. Tran, L. Bourdev, R. Fergus, L. Torresani, and M. Paluri. Learning spatiotemporal features with 3d convolutional networks. In Computer Vision (ICCV), 2015 IEEE International Conference on, pages 4489–4497. IEEE, 2015. [47] D. Tran, L. Bourdev, R. Fergus, L. Torresani, and M. Paluri. Deep end2end voxel2voxel prediction. In Computer Vision and Pattern Recognition Workshops (CVPRW), 2016 IEEE Conference on, pages 402–409. IEEE, 2016. [48] T. Ullman, A. Stuhlmüller, N. Goodman, and J. B. Tenenbaum. Learning physics from dynamical scenes. In Proceedings of the 36th Annual Conference of the Cognitive Science society, pages 1640–1645, 2014. [49] Z. Wang, S. Rosa, B. Yang, S. Wang, N. Trigoni, and A. Markham. 3d-physnet: Learning the intuitive physics of non-rigid object deformations. arXiv preprint arXiv:1805.00328, 2018. [50] N. Watters, A. Tacchetti, T. Weber, R. Pascanu, P. Battaglia, and D. Zoran. Visual interaction networks. arXiv preprint arXiv:1706.01433, 2017. [51] W. F. Whitney, M. Chang, T. Kulkarni, and J. B. Tenenbaum. Understanding visual concepts with continuation learning. arXiv preprint arXiv:1602.06822, 2016. [52] J. Wu, I. Yildirim, J. J. Lim, B. Freeman, and J. Tenenbaum. Galileo: Perceiving physical object properties by integrating a physics engine with deep learning. In Advances in neural information processing systems, pages 127–135, 2015. [53] J. Wu, J. J. Lim, H. Zhang, J. B. Tenenbaum, and W. T. Freeman. Physics 101: Learning physical object properties from unlabeled videos. In BMVC, volume 2, page 7, 2016. [54] J. Wu, T. Xue, J. J. Lim, Y. Tian, J. B. Tenenbaum, A. Torralba, and W. T. Freeman. Single image 3d interpreter network. In European Conference on Computer Vision, pages 365–382. Springer, 2016. 12
2018
1001
7,246
A Stein variational Newton method Gianluca Detommaso University of Bath & The Alan Turing Institute gd391@bath.ac.uk Tiangang Cui Monash University Tiangang.Cui@monash.edu Alessio Spantini Massachusetts Institute of Technology spantini@mit.edu Youssef Marzouk Massachusetts Institute of Technology ymarz@mit.edu Robert Scheichl Heidelberg University r.scheichl@uni-heidelberg.de Abstract Stein variational gradient descent (SVGD) was recently proposed as a general purpose nonparametric variational inference algorithm [Liu & Wang, NIPS 2016]: it minimizes the Kullback–Leibler divergence between the target distribution and its approximation by implementing a form of functional gradient descent on a reproducing kernel Hilbert space. In this paper, we accelerate and generalize the SVGD algorithm by including second-order information, thereby approximating a Newton-like iteration in function space. We also show how second-order information can lead to more effective choices of kernel. We observe significant computational gains over the original SVGD algorithm in multiple test cases. 1 Introduction Approximating an intractable probability distribution via a collection of samples—in order to evaluate arbitrary expectations over the distribution, or to otherwise characterize uncertainty that the distribution encodes—is a core computational challenge in statistics and machine learning. Common features of the target distribution can make sampling a daunting task. For instance, in a typical Bayesian inference problem, the posterior distribution might be strongly non-Gaussian (perhaps multimodal) and high dimensional, and evaluations of its density might be computationally intensive. There exist a wide range of algorithms for such problems, ranging from parametric variational inference [4] to Markov chain Monte Carlo (MCMC) techniques [10]. Each algorithm offers a different computational trade-off. At one end of the spectrum, we find the parametric mean-field approximation—a cheap but potentially inaccurate variational approximation of the target density. At the other end, we find MCMC—a nonparametric sampling technique yielding estimators that are consistent, but potentially slow to converge. In this paper, we focus on Stein variational gradient descent (SVGD) [17], which lies somewhere in the middle of the spectrum and can be described as a particular nonparametric variational inference method [4], with close links to the density estimation approach in [2]. The SVGD algorithm seeks a deterministic coupling between a tractable reference distribution of choice (e.g., a standard normal) and the intractable target. This coupling is induced by a transport map T that can transform a collection of reference samples into samples from the desired target distribution. For a given pair of distributions, there may exist infinitely many such maps [28]; several existing algorithms (e.g., [27, 24, 21]) aim to approximate feasible transport maps of various forms. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. The distinguishing feature of the SVGD algorithm lies in its definition of a suitable map T. Its central idea is to approximate T as a growing composition of simple maps, computed sequentially: T = T1 ◦· · · ◦Tk ◦· · · , (1) where each map Tk is a perturbation of the identity map along the steepest descent direction of a functional J that describes the Kullback–Leibler (KL) divergence between the pushforward of the reference distribution through the composition T1 ◦· · · ◦Tk and the target distribution. The steepest descent direction is further projected onto a reproducing kernel Hilbert space (RKHS) in order to give Tk a nonparametric closed form [3]. Even though the resulting map Tk is available explicitly without any need for numerical optimization, the SVGD algorithm implicitly approximates a steepest descent iteration on a space of maps of given regularity. A primary goal of this paper is to explore the use of second-order information (e.g., Hessians) within the SVGD algorithm. Our idea is to develop the analogue of a Newton iteration—rather than gradient descent—for the purpose of sampling distributions more efficiently. Specifically, we design an algorithm where each map Tk is now computed as the perturbation of the identity function along the direction that minimizes a certain local quadratic approximation of J. Accounting for second-order information can dramatically accelerate convergence to the target distribution, at the price of additional work per iteration. The tradeoff between speed of convergence and cost per iteration is resolved in favor of the Newton-like algorithm—which we call a Stein variational Newton method (SVN)—in several numerical examples. The efficiency of the SVGD and SVN algorithms depends further on the choice of reproducing kernel. A second contribution of this paper is to design geometry-aware Gaussian kernels that also exploit second-order information, yielding substantially faster convergence towards the target distribution than SVGD or SVN with an isotropic kernel. In the context of parametric variational inference, second-order information has been used to accelerate the convergence of certain variational approximations, e.g., [14, 13, 21]. In this paper, however, we focus on nonparametric variational approximations, where the corresponding optimisation problem is defined over an infinite-dimensional RKHS of transport maps. More closely related to our work is the Riemannian SVGD algorithm [18], which generalizes a gradient flow interpretation of SVGD [15] to Riemannian manifolds, and thus also exploits geometric information within the inference task. The rest of the paper is organized as follows. Section 2 briefly reviews the SVGD algorithm, and Section 3 introduces the new SVN method. In Section 4 we introduce geometry-aware kernels for the SVN method. Numerical experiments are described in Section 5. Proofs of our main results and further numerical examples addressing scaling to high dimensions are given in the supplementary material. Code and all numerical examples are collected in our GitHub repository [1]. 2 Background Suppose we wish to approximate an intractable target distribution with density π on Rd via an empirical measure, i.e., a collection of samples. Given samples {xi} from a tractable reference density p on Rd, one can seek a transport map T : Rd →Rd such that the pushforward density of p under T, denoted by T∗p, is a close approximation to the target π.1 There exist infinitely many such maps [28]. The image of the reference samples under the map, {T(xi)}, can then serve as an empirical measure approximation of π (e.g., in the weak sense [17]). Variational approximation. Using the KL divergence to measure the discrepancy between the target π and the pushforward T∗p, one can look for a transport map T that minimises the functional T 7→DKL(T∗p || π) (2) over a broad class of functions. The Stein variational method breaks the minimization of (2) into several simple steps: it builds a sequence of transport maps {T1, T2, . . . , Tl, . . .} to iteratively push an initial reference density p0 towards π. Given a scalar-valued RKHS H with a positive definite kernel k(x, x′), each transport map Tl : Rd →Rd is chosen to be a perturbation of the identity map I(x) = x along the vector-valued RKHS Hd ≃H × · · · × H, i.e., Tl(x) := I(x) + Q(x) for Q ∈Hd. (3) 1 If T is invertible, then T∗p(x) = p(T −1(x)) | det(∇xT −1(x))|. 2 The transport maps are computed iteratively. At each iteration l, our best approximation of π is given by the pushforward density pl = (Tl ◦· · · ◦T1)∗p0. The SVGD algorithm then seeks a transport map Tl+1 = I + Q that further decreases the KL divergence between (Tl+1)∗pl and π, Q 7→Jpl[Q] := DKL((I + Q)∗pl || π), (4) for an appropriate choice of Q ∈Hd. In other words, the SVGD algorithm seeks a map Q ∈Hd such that Jpl[Q] < Jpl[0], (5) where 0(x) = 0 denotes the zero map. By construction, the sequence of pushforward densities {p0, p1, p2, . . . , pl, . . .} becomes increasingly closer (in KL divergence) to the target π. Recent results on the convergence of the SVGD algorithm are presented in [15]. Functional gradient descent. The first variation of Jpl at S ∈Hd along V ∈Hd can be defined as DJpl[S](V ) := lim τ→0 1 τ Jpl[S + τV ] −Jpl[S]  . (6) Assuming that the objective function Jpl : Hd →R is Fréchet differentiable, the functional gradient of Jpl at S ∈Hd is the element ∇Jpl[S] of Hd such that DJpl[S](V ) = ⟨∇Jpl[S], V ⟩Hd ∀V ∈Hd, (7) where ⟨·, ·⟩Hd denotes an inner product on Hd. In order to satisfy (5), the SVGD algorithm defines Tl+1 as a perturbation of the identity map along the steepest descent direction of the functional Jpl evaluated at the zero map, i.e., Tl+1 = I −ε∇Jpl[0], (8) for a small enough ε > 0. It was shown in [17] that the functional gradient at 0 has a closed form expression given by −∇Jpl[0](z) = Ex∼pl[k(x, z)∇x log π(x) + ∇xk(x, z)]. (9) Empirical approximation. There are several ways to approximate the expectation in (9). For instance, a set of particles {x0 i }n i=1 can be generated from the initial reference density p0 and pushed forward by the transport maps {T1, T2, . . .}. The pushforward density pl can then be approximated by the empirical measure given by the particles {xl i}n i=1, where xl i = Tl(xl−1 i ) for i = 1, . . . , n, so that −∇Jpl[0](z) ≈G(z) := 1 n Pn j=1  k(xl j, z)∇xl j log π(xl j) + ∇xl jk(xl j, z)  . (10) The first term in (10) corresponds to a weighted average steepest descent direction of the log-target density π with respect to pl. This term is responsible for transporting particles towards highprobability regions of π. In contrast, the second term can be viewed as a “repulsion force” that spreads the particles along the support of π, preventing them from collapsing around the mode of π. The SVGD algorithm is summarised in Algorithm 1. Algorithm 1: One iteration of the Stein variational gradient algorithm Input :Particles {xl i}n i=1 at previous iteration l; step size εl+1 Output :Particles {xl+1 i }n i=1 at new iteration l + 1 1: for i = 1, 2, . . . , n do 2: Set xl+1 i ←xl i + εl+1 G(xl i), where G is defined in (10). 3: end for 3 Stein variational Newton method Here we propose a new method that incorporates second-order information to accelerate the convergence of the SVGD algorithm. We replace the steepest descent direction in (8) with an approximation of the Newton direction. 3 Functional Newton direction. Given a differentiable objective function Jpl, we can define the second variation of Jpl at 0 along the pair of directions V, W ∈Hd as D2Jpl[0](V, W) := lim τ→0 1 τ DJpl[τW](V ) −DJpl[0](V )  . At each iteration, the Newton method seeks to minimize a local quadratic approximation of Jpl. The minimizer W ∈Hd of this quadratic form defines the Newton direction and is characterized by the first order stationarity conditions D2Jpl[0](V, W) = −DJpl[0](V ), ∀V ∈Hd. (11) We can then look for a transport map Tl+1 that is a local perturbation of the identity map along the Newton direction, i.e., Tl+1 = I + εW, (12) for some ε > 0 that satisfies (5). The function W is guaranteed to be a descent direction if the bilinear form D2Jpl[0] in (11) is positive definite. The following theorem gives an explicit form for D2Jpl[0] and is proven in Appendix. Theorem 1. The variational characterization of the Newton direction W = (w1, . . . , wd)⊤∈Hd in (11) is equivalent to d X i=1 * d X j=1 ⟨hij(y, z), wj(z)⟩H + ∂iJpl[0](y), vi(y) + H = 0, (13) for all V = (v1, . . . , vd)⊤∈Hd, where hij(y, z) = Ex∼pl  −∂2 ij log π(x)k(x, y)k(x, z) + ∂ik(x, y)∂jk(x, z)  . (14) We propose a Galerkin approximation of (13). Let (xk)n k=1 be an ensemble of particles distributed according to pl( · ), and define the finite dimensional linear space Hd n = span{k(x1, ·), . . . , k(xn, ·)}. We look for an approximate solution W = (w1, . . . , wd)⊤in Hd n—i.e., wj(z) = n X k=1 αk j k(xk, z) (15) for some unknown coefficients (αk j )—such that the residual of (13) is orthogonal to Hd n. The following corollary gives an explicit characterization of the Galerkin solution and is proven in the Appendix. Corollary 1. The coefficients (αk j ) are given by the solution of the linear system n X k=1 Hs,k αk = ∇Js, for all s = 1, . . . , n, (16) where αk := αk 1, . . . , αk d ⊤is a vector of unknown coefficients, (Hs,k)ij := hij(xs, xk) is the evaluation of the symmetric form (14) at pairs of particles, and where ∇Js := −∇Jpl[0](xs) represents the evaluation of the first variation at the s-th particle. In practice, we can only evaluate a Monte Carlo approximation of Hs,k and ∇Js in (16) using the ensemble (xk)n k=1. Inexact Newton. The solution of (16) by means of direct solvers might be impractical for problems with a large number of particles n or high parameter dimension d, since it is a linear system with nd unknowns. Moreover, the solution of (16) might not lead to a descent direction (e.g., when π is not log-concave). We address these issues by deploying two well-established techniques in nonlinear optimisation [31]. In the first approach, we solve (16) using the inexact Newton–conjugate gradient (NCG) method [31, Chapters 5 and 7], wherein a descent direction can be guaranteed by appropriately the matrix-vector product with each Hs,k and does not construct the matrix explicitly, and thus can be scaled to high dimensions. In the second approach, we simplify the problem further by taking a 4 block-diagonal approximation of the second variation, breaking (16) into n decoupled d × d linear systems Hs,sαs = ∇Js, s = 1, . . . n . (17) Here, we can either employ a Gauss-Newton approximation of the Hessian ∇2 log π in Hs,s or again use inexact Newton–CG, to guarantee that the approximation of the Newton direction is a descent direction. Both the block-diagonal approximation and inexact NCG are more efficient than solving for the full Newton direction (16). In addition, the block-diagonal form (17) can be solved in parallel for each of the blocks, and hence it may best suit high-dimensional applications and/or large numbers of particles. In the supplementary material, we provide a comparison of these approaches on various examples. Both approaches provide similar progress per SVN iteration compared to the full Newton direction. Leveraging second-order information provides a natural scaling for the step size, i.e., ε = O(1). Here, the choice ε = 1 performs reasonably well in our numerical experiments (Section 5 and the Appendix). In future work, we will refine our strategy by considering either a line search or a trust region step. The resulting Stein variational Newton method is summarised in Algorithm 2. Algorithm 2: One iteration of the Stein variational Newton algorithm Input :Particles {xl i}n i=1 at stage l; step size ε Output :Particles {xl+1 i }n i=1 at stage l + 1 1: for i = 1, 2, . . . , n do 2: Solve the linear system (16) for α1, . . . , αn 3: Set xl+1 i ←xl i + εW(xl i) given α1, . . . , αn 4: end for 4 Scaled Hessian kernel In the Stein variational method, the kernel weighs the contribution of each particle to a locally averaged steepest descent direction of the target distribution, and it also spreads the particles along the support of the target distribution. Thus it is essential to choose a kernel that can capture the underlying geometry of the target distribution, so the particles can traverse the support of the target distribution efficiently. To this end, we can use the curvature information characterised by the Hessian of the logarithm of the target density to design anisotropic kernels. Consider a positive definite matrix A(x) that approximates the local Hessian of the negative logarithm of the target density, i.e., A(x) ≈−∇2 x log π(x). We introduce the metric Mπ := Ex∼π[A(x)] , (18) to characterise the average curvature of the target density, stretching and compressing the parameter space in different directions. There are a number of computationally efficient ways to evaluate such an A(x)—for example, the generalised eigenvalue approach in [20] and the Fisher information-based approach in [11]. The expectation in (18) is taken against the target density π, and thus cannot be directly computed. Utilising the ensemble {xl i}n i=1 in each iteration, we introduce an alternative metric Mpl := 1 n Pn i=1 A(xl i), (19) to approximate Mπ. Similar approximations have also been introduced in the context of dimension reduction for statistical inverse problems; see [7]. Note that the computation of the metric (19) does not incur extra computational cost, as we already calculated (approximations to) ∇2 x log π(x) at each particle in the Newton update. Given a kernel of the generic form k(x, x′) = f(∥x −x′∥2), we can then use the metric Mpl to define an anisotropic kernel kl(x, x′) = f  1 g(d)∥x −x′∥2 Mpl  , where the norm ∥· ∥Mpl is defined as ∥x∥2 Mpl = x⊤Mplx and g(d) is a positive and real-valued function of the dimension d. For example, with g(d) = d, the Gaussian kernel used in the SVGD of 5 [17] can be modified as kl(x, x′) := exp  −1 2d∥x −x′∥2 Mpl  . (20) The metric Mpl induces a deformed geometry in the parameter space: distance is greater along directions where the (average) curvature is large. This geometry directly affects how particles in SVGD or SVN flow—by shaping the locally-averaged gradients and the “repulsion force” among the particles—and tends to spread them more effectively over the high-probability regions of π. The dimension-dependent scaling factor g(d) plays an important role in high dimensional problems. Consider a sequence of target densities that converges to a limit as the dimension of the parameter space increases. For example, in the context of Bayesian inference on function spaces, e.g., [26], the posterior density is often defined on a discretisation of a function space, whose dimensionality increases as the discretisation is refined. In this case, the g(d)-weighed norm ∥· ∥2/d is the square of the discretised L2 norm under certain technical conditions (e.g., the examples in Section 5.2 and the Appendix) and converges to the functional L2 norm as d →∞. With an appropriate scaling g(d), the kernel may thus exhibit robust behaviour with respect to discretisation if the target distribution has appropriate infinite-dimensional limits. For high-dimensional target distributions that do not have a well-defined limit with increasing dimension, an appropriately chosen scaling function g(d) can still improve the ability of the kernel to discriminate inter-particle distances. Further numerical investigation of this effect is presented in the Appendix. 5 Test cases We evaluate our new SVN method with the scaled Hessian kernel on a set of test cases drawn from various Bayesian inference tasks. For these test cases, the target density π is the (unnormalised) posterior density. We assume the prior distributions are Gaussian, that is, π0(x) = N(mpr, Cpr), where mpr ∈Rd and Cpr ∈Rd×d are the prior mean and prior covariance, respectively. Also, we assume there exists a forward operator F : Rd →Rm mapping from the parameter space to the data space. The relationship between the observed data and unknown parameters can be expressed as y = F(x) + ξ, where ξ ∼N(0, σ2 I) is the measurement error and I is the identity matrix. This relationship defines the likelihood function L(y|x) = N(F(x), σ2 I) and the (unnormalised) posterior density π(x) ∝π0(x)L(y|x). We will compare the performance of SVN and SVGD, both with the scaled Hessian kernel (20) and the heuristically-scaled isotropic kernel used in [17]. We refer to these algorithms as SVN-H, SVN-I, SVGD-H, and SVGD-I, where ‘H’ or ‘I’ designate the Hessian or isotropic kernel, respectively. Recall that the heuristic used in the ‘-I’ algorithms involves a scaling factor based on the number of particles n and the median pairwise distance between particles [17]. Here we present two test cases, one multi-modal and the other high-dimensional. In the supplementary material, we report on additional tests. First, we evaluate the performance of SVN-H with different Hessian approximations: the exact Hessian (full Newton), the block diagonal Hessian, and a Newton–CG version of the algorithm with exact Hessian. Second, we provide a performance comparison between SVGD and SVN on a high-dimensional Bayesian neural network. Finally, we provide further numerical investigations of the dimension-scalability of our scaled kernel. 5.1 Two-dimensional double banana The first test case is a two-dimensional bimodal and “banana” shaped posterior density. The prior is a standard multivariate Gaussian, i.e., mpr = 0 and Cpr = I, and the observational error has standard deviation σ = 0.3. The forward operator is taken to be a scalar logarithmic Rosenbrock function, i.e., F(x) = log (1 −x1)2 + 100(x2 −x2 1)2 , where x = (x1, x2). We take a single observation y = F(xtrue) + ξ, with xtrue being a random variable drawn from the prior and ξ ∼N(0, σ2 I). Figure 1 summarises the outputs of four algorithms at selected iteration numbers, each with n = 1000 particles initially sampled from the prior π0. The rows of Figure 1 correspond to the choice of algorithms and the columns of Figure 1 correspond to the outputs at different iteration numbers. We run 10, 50, and 100 iterations of SVN-H. To make a fair comparison, we rescale the number 6 Figure 1: Particle configurations superimposed on contour plots of the double-banana density. of iterations for each of the other algorithms so that the total cost (CPU time) is approximately the same. It is interesting to note that the Hessian kernel takes considerably less computational time than the Isotropic kernel. This is because, whereas the Hessian kernel is automatically scaled, the Isotropic kernel calculates the distance between the particles at each iterations to heuristically rescale the kernel. The first row of Figure 1 displays the performance of SVN-H, where second-order information is exploited both in the optimisation and in the kernel. After only 10 iterations, the algorithm has already converged, and the configuration of particles does not visibly change afterwards. Here, all the particles quickly reach the high probability regions of the posterior distribution, due to the Newton acceleration in the optimisation. Additionally, the scaled Hessian kernel seems to spread the particles into a structured and precise configuration. The second row shows the performance of SVN-I, where the second-order information is used exclusively in the optimisation. We can see the particles quickly moving towards the high-probability regions, but the configuration is much less structured. After 47 iterations, the algorithm has essentially converged, but the configuration of the particles is noticeably rougher than that of SVN-H. SVGD-H in the third row exploits second-order information exclusively in the kernel. Compared to SVN-I, the particles spread more quickly over the support of the posterior, but not all the particles reach the high probability regions, due to slower convergence of the optimisation. The fourth row shows the original algorithm, SVGD-I. The algorithm lacks both of the benefits of second-order information: with slower convergence and a more haphazard particle distribution, it appears less efficient for reconstructing the posterior distribution. 5.2 100-dimensional conditioned diffusion The second test case is a high-dimensional model arising from a Langevin SDE, with state u : [0, T] →R and dynamics given by dut = βu (1 −u2) (1 + u2) dt + dxt, u0 = 0 . (21) 7 Here x = (xt)t≥0 is a Brownian motion, so that x ∼π0 = N(0, C), where C(t, t′) = min(t, t′). This system represents the motion of a particle with negligible mass trapped in an energy potential, with thermal fluctuations represented by the Brownian forcing; it is often used as a test case for MCMC algorithms in high dimensions [6]. Here we use β = 10 and T = 1. Our goal is to infer the driving process x and hence its pushforward to the state u. SVN-H -- 10 iterations 0 0.5 1 -1.5 -1 -0.5 0 0.5 SVN-H -- 50 iterations 0 0.5 1 -1.5 -1 -0.5 0 0.5 SVN-H -- 100 iterations 0 0.5 1 -1.5 -1 -0.5 0 0.5 SVN-I -- 11 iterations 0 0.5 1 -2 -1 0 1 2 SVN-I -- 54 iterations 0 0.5 1 -2 -1 0 1 SVN-I -- 108 iterations 0 0.5 1 -2 -1 0 1 SVGD-H -- 40 iterations 0 0.5 1 -2 -1 0 1 2 SVGD-H -- 198 iterations 0 0.5 1 -2 -1 0 1 2 SVGD-H -- 395 iterations 0 0.5 1 -2 -1 0 1 2 SVGD-I -- 134 iterations 0 0.5 1 -1.5 -1 -0.5 0 0.5 SVGD-I -- 668 iterations 0 0.5 1 -1.5 -1 -0.5 0 0.5 SVGD-I -- 1336 iterations 0 0.5 1 -1.5 -1 -0.5 0 0.5 Figure 2: In each plot, the magenta path is the true solution of the discretised Langevin SDE; the blue line is the reconstructed posterior mean; the shaded area is the 90% marginal posterior credible interval at each time step. The forward operator is defined by F(x) = [ut1, ut2, . . . , ut20]⊤∈R20, where ti are equispaced observation times in the interval (0, 1], i.e., ti = 0.05 i. By taking σ = 0.1, we define an observation y = F(xtrue) + ξ ∈R20, where xtrue is a Brownian motion path and ξ ∼N(0, σ2 I). For discretization, we use an Euler-Maruyama scheme with step size ∆t = 10−2; therefore the dimensionality of the problem is d = 100. The prior is given by the Brownian motion x = (xt)t≥0, described above. Figure 2 summarises the outputs of four algorithms, each with n = 1000 particles initially sampled from π0. Figure 2 is presented in the same way as Figure 1 from the first test case. The iteration numbers are scaled, so that we can compare outputs generated by various algorithms using approximately the same amount of CPU time. In Figure 2, the path in magenta corresponds to the solution of the Langevin SDE in (21) driven by the true Brownian path xtrue. The red points correspond to the 20 noisy observations. The blue path is the reconstruction of the magenta path, i.e., it corresponds to the solution of the Langevin SDE driven by the posterior mean of (xt)t≥0. Finally, the shaded area represents the marginal 90% credible interval of each dimension (i.e., at each time step) of the posterior distribution of u. We observe excellent performance of SVN-H. After 50 iterations, the algorithm has already converged, accurately reconstructing the posterior mean (which in turn captures the trends of the true path) and the posterior credible intervals. (See Figure 3 and below for a validation of these results against a reference MCMC simulation.) SVN-I manages to provide a reasonable reconstruction of the 8 target distribution: the posterior mean shows fair agreement with the true solution, but the credible intervals are slightly overestimated, compared to SVN-H and the reference MCMC. The overestimated credible interval may be due to the poor dimension scaling of the isotropic kernel used by SVN-I. With the same amount of computational effort, SVGD-H and SVGD-I cannot reconstruct the posterior distribution: both the posterior mean and the posterior credible intervals depart significantly from their true values. In Figure 3, we compare the posterior distribution approximated with SVN-H (using n = 1000 particles and 100 iterations) to that obtained with a reference MCMC run (using the DILI algorithm of [6] with an effective sample size of 105), showing an overall good agreement. The thick blue and green paths correspond to the posterior means estimated by SVN-H and MCMC, respectively. The blue and green shaded areas represent the marginal 90% credible intervals (at each time step) produced by SVN-H and MCMC. In this example, the posterior mean of SVN-H matches that of MCMC quite closely, and both are comparable to the data-generating path (thick magenta line). (The posterior means are much smoother than the true path, which is to be expected.) The estimated credible intervals of SVN-H and MCMC also match fairly well along the entire path of the SDE. 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 -1.6 -1.4 -1.2 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 true SVN-H MCMC obs Figure 3: Comparison of reconstructed distributions from SVN-H and MCMC 6 Discussion In general, the use of Gaussian reproducing kernels may be problematic in high dimensions, due to the locality of the kernel [8]. While we observe in Section 4 that using a properly rescaled Gaussian kernel can improve the performance of the SVN method in high dimensions, we also believe that a truly general purpose nonparametric algorithm using local kernels will inevitably face further challenges in high-dimensional settings. A sensible approach to coping with high dimensionality is also to design algorithms that can detect and exploit essential structure in the target distribution, whether it be decaying correlation, conditional independence, low rank, multiple scales, and so on. See [25, 29] for recent efforts in this direction. 7 Acknowledgements G. Detommaso is supported by the EPSRC Centre for Doctoral Training in Statistical Applied Mathematics at Bath (EP/L015684/1) and by a scholarship from the Alan Turing Institute. T. Cui, G. Detommaso, A. Spantini, and Y. Marzouk acknowledge support from the MATRIX Program on “Computational Inverse Problems” held at the MATRIX Institute, Australia, where this joint collaboration was initiated. A. Spantini and Y. Marzouk also acknowledge support from the AFOSR Computational Mathematics Program. 9 References [1] http://github.com/gianlucadetommaso/Stein-variational-samplers [2] E. Anderes, M. Coram. A general spline representation for nonparametric and semiparametric density estimates using diffeomorphisms. arXiv preprint arXiv:1205.5314, 2012. [3] N. Aronszajn. Theory of reproducing kernels. Transactions of the American mathematical society, p. 337–404, 1950. [4] D. Blei, A. Kucukelbir, and J. D. McAuliffe. Variational inference: A review for statisticians. Journal of the American Statistical Association, p. 859–877, 2017. [5] W. Y. Chen, L. Mackey, J. Gorham, F. X. Briol, C. J. Oates. Stein points. In International Conference on Machine Learning. arXiv:1803.10161, 2018. [6] T. Cui, K. J. H. Law, Y. M. Marzouk. Dimension-independent likelihood-informed MCMC. Journal of Computational Physics, 304: 109–137, 2016. [7] T. Cui, J. Martin, Y. M. Marzouk, A. Solonen, and A. Spantini. Likelihood-informed dimension reduction for nonlinear inverse problems. Inverse Problems, 30(11):114015, 2014. [8] D. Francois, V. Wertz, and M. Verleysen. About the locality of kernels in high-dimensional spaces. International Symposium on Applied Stochastic Models and Data Analysis, p. 238–245, 2005. [9] S. Gershman, M. Hoffman, D. Blei. Nonparametric variational inference. arXiv preprint arXiv:1206.4665, 2012. [10] W. R. Gilks, S. Richardson, and D. Spiegelhalter. Markov chain Monte Carlo in practice. CRC press, 1995. [11] M. Girolami and B. Calderhead. Riemann manifold Langevin and Hamiltonian Monte Carlo methods. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 73(2):123– 214, 2011. [12] J. Han and Q. Liu. Stein variational adaptive importance sampling. arXiv preprint arXiv:1704.05201, 2017. [13] M. E. Khan, Z. Liu, V. Tangkaratt, Y. Gal. Vprop: Variational inference using RMSprop. arXiv preprint arXiv:1712.01038, 2017. [14] M. E. Khan, W. Lin, V. Tangkaratt, Z. Liu, D. Nielsen. Adaptive-Newton method for explorative learning. arXiv preprint arXiv:1711.05560, 2017. [15] Q. Liu. Stein variational gradient descent as gradient flow. In Advances in Neural Information Processing systems (I. Guyon et al., Eds.), Vol. 30, p. 3118–3126, 2017. [16] Y. Liu, P. Ramachandran, Q. Liu, and J. Peng. Stein variational policy gradient. arXiv preprint arXiv:1704.02399, 2017. [17] Q. Liu and D. Wang. Stein variational gradient descent: A general purpose Bayesian inference algorithm. In Advances In Neural Information Processing Systems (D. D. Lee et al., Eds.), Vol. 29, p. 2378–2386, 2016. [18] C. Liu and J. Zhu. Riemannian Stein variational gradient descent for Bayesian inference. arXiv preprint arXiv:1711.11216, 2017. [19] D. G. Luenberger. Optimization by vector space methods. John Wiley & Sons, 1997. [20] J. Martin, L. C. Wilcox, C. Burstedde, and O. Ghattas. A stochastic Newton MCMC method for large-scale statistical inverse problems with application to seismic inversion. SIAM Journal on Scientific Computing, 34(3), A1460–A1487, Chapman & Hall/CRC, 2012 [21] Y. M. Marzouk, T. Moselhy, M. Parno, and A. Spantini. Sampling via measure transport: An introduction. Handbook of Uncertainty Quantification, Springer, p. 1–41, 2016. [22] R. M. Neal. MCMC using Hamiltonian dynamics. In Handbook of Markov Chain Monte Carlo (S. Brooks et al., Eds.), Chapman & Hall/CRC, 2011. [23] Y. Pu, Z. Gan, R. Henao, C. Li, S. Han, and L. Carin. Stein variational autoencoder. arXiv preprint arXiv:1704.05155, 2017. [24] D. Rezende and S. Mohamed. Variational inference with normalizing flows. arXiv:1505.05770, 2015. 10 [25] A. Spantini, D. Bigoni, and Y. Marzouk. Inference via low-dimensional couplings. Journal of Machine Learning Research, to appear. arXiv:1703.06131, 2018. [26] A. M. Stuart. Inverse problems: a Bayesian perspective. Acta Numerica, 19, p. 451–559, 2010. [27] E. G. Tabak and T. V. Turner. A family of nonparametric density estimation algorithms. Communications on Pure and Applied Mathematics, p. 145–164, 2013. [28] C. Villani. Optimal Transport: Old and New. Springer-Verlag Berlin Heidelberg, 2009. [29] D. Wang, Z. Zeng, and Q. Liu. Structured Stein variational inference for continuous graphical models. arXiv:1711.07168, 2017. [30] J. Zhuo, C. Liu, N. Chen, and B. Zhang. Analyzing and improving Stein variational gradient descent for high-dimensional marginal inference. arXiv preprint arXiv:1711.04425, 2017. [31] S. Wright, J. Nocedal. Numerical Optimization. Springer Science, 1999. 11
2018
1002
7,247
Dual Swap Disentangling Zunlei Feng Zhejiang University zunleifeng@zju.edu.cn Xinchao Wang Stevens Institute of Technology xinchao.wang@stevens.edu Chenglong Ke Zhejiang University chenglongke@zju.edu.cn Anxiang Zeng Alibaba Group renzhong@taobao.com Dacheng Tao University of Sydney dctao@sydney.edu.au Mingli Song∗ Zhejiang University brooksong@zju.edu.cn Abstract Learning interpretable disentangled representations is a crucial yet challenging task. In this paper, we propose a weakly semi-supervised method, termed as Dual Swap Disentangling (DSD), for disentangling using both labeled and unlabeled data. Unlike conventional weakly supervised methods that rely on full annotations on the group of samples, we require only limited annotations on paired samples that indicate their shared attribute like the color. Our model takes the form of a dual autoencoder structure. To achieve disentangling using the labeled pairs, we follow a “encoding-swap-decoding” process, where we first swap the parts of their encodings corresponding to the shared attribute, and then decode the obtained hybrid codes to reconstruct the original input pairs. For unlabeled pairs, we follow the “encoding-swap-decoding” process twice on designated encoding parts and enforce the final outputs to approximate the input pairs. By isolating parts of the encoding and swapping them back and forth, we impose the dimension-wise modularity and portability of the encodings of the unlabeled samples, which implicitly encourages disentangling under the guidance of labeled pairs. This dual swap mechanism, tailored for semi-supervised setting, turns out to be very effective. Experiments on image datasets from a wide domain show that our model yields state-of-the-art disentangling performances. 1 Introduction Disentangling aims at learning dimension-wise interpretable representations from data. For example, given an image dataset of human faces, disentangling should produce representations or encodings for which part corresponds to interpretable attributes like facial expression, hairstyle, and color of the eye. It is therefore a vital step for many machine learning tasks including transfer learning (Lake et al. [2017]), reinforcement learning (Higgins et al. [2017a]) and visual concepts learning (Higgins et al. [2017b]). Existing disentangling methods can be broadly classified into two categories, supervised approaches and unsupervised ones. Methods in the former category focus on utilizing annotated data to explicitly supervise the input-to-attribute mapping. Such supervision may take the form of partitioning the data into subsets which vary only along some particular dimension (Kulkarni et al. [2015], Bouchacourt et al. [2017]), or labeling explicitly specific sources of variation of the data (Kingma et al. [2014], Siddharth et al. [2017], Perarnau et al. [2016], Wang et al. [2017]). Despite their promising results, supervised methods, especially for deep-learning ones, usually require a large number of training samples which are often expensive to obtain. ∗Corresponding author. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. Unsupervised methods, on the other hand, do not require annotations but yield disentangled representations that are usually uninterpretable and dimension-wise uncontrollable. In other words, the user has no control over the semantic encoded in each dimension of the obtained codes. Taking a mugshot for example, the unsupervised approach fails to make sure that one of the disentangled codes will contain the feature of eye color. In addition, existing methods produce for each attribute with a single-dimension code, which sometimes has difficulty in expressing intricate semantics. In this paper, we propose a weakly semi-supervised learning approach, dubbed as Dual Swap Disentangling (DSD), for disentangling that combines the best of the two worlds. The proposed DSD takes advantage of limited annotated sample pairs together with many unannotated ones to derive dimension-wise and semantic-controllable disentangling. We implement the DSD model using an autoencoder, training on both labeled and unlabeled input data pairs and by swapping designated parts of the encodings. Specifically, DSD differs from the prior disentangling models in the following aspects. • Limited Weakly-labeled Input Pairs. Unlike existing supervised and semi-supervised models that either require strong labels on each attribute of each training sample (Kingma et al. [2014], Perarnau et al. [2016], Siddharth et al. [2017], Wang et al. [2017], Banijamali et al. [2017]), or require fully weak labels on a group of samples sharing the same attribute (Bouchacourt et al. [2017]), our model only requires limited pairs of samples, which are much cheaper to obtain. • Dual-stage Architecture. To our best knowledge, we propose the first dual-stage network architecture to utilize unlabeled sample pairs for semi-supervised disentangling, to facilitate and improve over the supervised learning using a small number of labeled pairs. • Multi-dimension Attribute Encoding. We allow multi-dimensional encoding for each attribute to improve the expressiveness capability. Moreover, unlike prior methods (Kulkarni et al. [2015], Chen et al. [2016], Higgins et al. [2016], Burgess et al. [2017], Bouchacourt et al. [2017], Chen et al. [2018], Gao et al. [2018], Kim and Mnih [2018]), we do not impose any over-constrained assumption, such as each dimension being independent, into our encodings. We show the architecture of DSD in Fig. 1. It comprises two stages, primary-stage and dual-stage, both are utilizing the same autoencoder. During training, the annotated pairs go through the primarystage only, while the unannotated ones go through both. For annotated pairs, again, we only require weak labels to indicate which attribute the two input samples are sharing. We feed such annotated pairs to the encoder and obtained a pair of codes. We then designate which dimensions correspond to the specific shared attribute, and swap these parts of the two codes to obtain a pair of hybrid codes. Next we feed the hybrid codes to the decoder to reconstruct the final output of the labeled pairs. We enforce the reconstruction to approximate the input since we swap only the shared attribute, in which way we encourage the disentangling of the specific attribute in the designated dimensions and thus make our encodings dimension-wise controllable. The unlabeled pairs during training go through both the primary-stage and the dual-stage. In the primary-stage, unlabeled pairs undergo the exact same procedure as the labeled ones, i.e., the encoding-swap-decoding steps. In the dual-stage, the decoded unlabeled pairs are again fed into the same autoencoder and parsed through the encoding-swap-decoding process for the second time. In other words, the code parts that are swapped during the primary-stage are swapped back in the second stage. With the guidance and constraint of labeled pairs, the dual swap strategy can generate informative feedback signals to train the DSD for the dimension-wise and semantic-controllable disentangling. The dual swap strategy, tailored for unlabeled pairs, turns out to be very effective in facilitating supervised learning with a limited number of samples. Our contribution is therefore the first dual-stage strategy for semi-supervised disentangling. Also, require limited weaker annotations as compared to previous methods, and extend the single-dimension attribute encoding to multi-dimension ones. We evaluate the proposed DSD on a wide domain of image datasets, in term of both qualitative visualization and quantitative measures. Our method achieves results superior to the current state-of-the-art. 2 primary-stage dual-stage ܽଵ ܾଵ ܾ௞ ܾଶ ܽ௞ ܽ௡ ܾ௡ ܽଶ… … … … ܽଵ ܾଵ ܽ௞ ܾଶ ܾ௞ ܽ௡ ܾ௡ ܽଶ… … … … … … … … ݂థ ݂థ ݂ఝ ݂ఝ ܽଵ ᇱ ܾଵ ᇱܾଶ ᇱ ܾ௡ᇱ ܽଶ ᇱ ܽ௡ᇱ ܽ௞ ᇱ ܾ௞ ᇱ … … … … ܽଵ ᇱ ܾଵ ᇱܾଶ ᇱ ܾ௡ᇱ ܽଶ ᇱ ܽ௡ᇱ ܾ௞ ᇱ ܽ௞ ᇱ : original pairs (labeled or unlabeled) : hybrid outputs : dual-stage outputs : data flow for labeled pairs : data flow for unlabeled pairs : primary-stage outputs ( , ) : swapping ݂థ ݂ఝ : encoder : decoder ( , ) ( , ) ( , ) Figure 1: Architecture of the proposed DSD. It comprises two stages: primary-stage and dual-stage. The former one is employed for both labeled and unlabeled pairs while the latter is for unlabeled only. 2 Related Work Recent works in learning disentangled representations have broadly followed two approaches, (semi-)supervised and unsupervised. Most of existing unsupervised methods (Burgess et al. [2017], Chen et al. [2018], Gao et al. [2018], Kim and Mnih [2018], Dupont [2018]) are based on the most two prominent methods InfoGAN (Chen et al. [2016]) and β-VAE (Higgins et al. [2016]). They however impose the independent assumption of the different dimensions of the latent code to achieve disentangling. Some semi-supervised methods (Bouchacourt et al. [2017], Siddharth et al. [2017]) import annotation information into β-VAE to achieve controllable disentangling. Supervised or semi-supervised methods like (Kingma et al. [2014], Perarnau et al. [2016], Wang et al. [2017], Banijamali et al. [2017], Feng et al. [2018]), they focus on utilizing annotated data to explicitly supervise the input-to-attribute mapping. Different with above methods, our method does not impose any over-constrained assumption and only require limited weak annotations. We also give a brief review here about swapping scheme, group labels, and dual mechanism, which relate to our dual-stage model and weakly-labeled input. For swapping, Xiao et al. [2017] propose a supervised algorithm called DNA-GAN which can learn disentangled representations from multiple semantic images with swapping policy. The significant difference between our DSD and DNA-GAN is that the swapped codes correspond to different semantics in DNA-GAN. DNA-GAN requires lots of annotated multi-labeled images and the annihilating operation adopted by DNA-GAN is destructive. Besides, DNA-GAN is based on GAN, which also suffers from the unstable training of GAN. For group information, Bouchacourt et al. [2017] propose the Multi-Level VAE (ML-VAE) model for learning a meaningful disentanglement from a set of grouped observations. The group used in the ML-VAE requires that observations in the same group have the same semantics. However, it also has the limitation on increased reconstruction error. For dual mechanism, Zhu et al. [2017] use cycle-consistent adversarial networks to realize unpaired image-to-image translation. Xia et al. [2016] adopt the dual-learning framework for machine translation. However, they all require two domain entities, such as image domains (sketch and photo) and language domains (English and French). Different with above two works, our dual framework only needs one domain entity. 3 Method In this section, we give more details of our proposed DSD model. We start by introducing the architecture and basic elements of our model, then show our training strategy for labeled and unlabeled pairs, and finally summarize the complete algorithm. 3 3.1 Dual-stage Autoencoder The goal of our proposed DSD model is to take both weakly labeled and unlabeled sample pairs as input, and train an autoencoder that accomplishes dimension-wise controllable disentangling. We show a visual illustration of our model in Fig. 1, where the dual-stage architecture is tailored for the self-supervision on the unlabeled samples. In what follows, we describe DSD’s basic elements: input, autoencoder, swap strategy and the dual-stage design in detail. Input DSD takes a pair of samples as input denoted as (IA, IB), where the pair can be either weakly labeled or unlabeled. Unlike conventional weakly supervised methods like Bouchacourt et al. [2017] that rely on full annotations on the group of samples, our model only requires limited and weak annotations as we only require the labels to indicate which attribute, if any, is shared by a pair of samples. Autoencoder DSD conducts disentangling using an autoencoder trained in both stages. Given a pair of input (IA, IB), weakly labeled or not, the encoder fϕ first encodes them to two vector representations RA = fϕ(IA) = [a1, a2, ..., an] and RB = fϕ(IB) = [b1, b2, ..., bn], and then the decoder fφ decodes the obtained codes or encodings to reconstruct the original input pairs, i.e., IA = fφ(RA) and IB = fφ(RB). We would expect the obtained codes RA and RB to possess the following two properties: i) they include as much as possible information of the original input IA and IB, and ii) they are disentangled and element-wise interpretable. The first property, as any autoencoder, is achieved through minimizing the following original autoencoder loss: Lo(IA, IB; ϕ, φ) = ||IA −IA||2 2 + ||IB −IB||2 2. (1) The second property is further achieved via the swapping strategy and dual-stage design, described in what follows. Swap Strategy If given the knowledge that the pair of input IA and IB are sharing an attribute, such as the color, we can designate a specific part of their encodings, like ak of RA and bk of RB, to associate the attribute semantic with the designated part. Assume that RA and RB are disentangled, swapping their code parts corresponding to the shared attribute, ak and bk, should not change their encoding or their hybrid reconstruction ¨ IA and ¨ IB. Conversely, enforcing the reconstruction after swapping to approximate the original input should facilitate and encourage disentangling for the specific shared attribute. Notably, here we allow each part of the encodings to be multi-dimensions, i.e., ak, bk ∈Rm, m ≥1, so as to improve the expressiveness of the encodings. Dual-stage For labeled pairs, we know what their shared attribute is and can thus swap the corresponding parts of the code. For unlabeled ones, however, we do not have such knowledge. To take advantage of the large volume of unlabeled pairs, we implement a dual-stage architecture that allows the unlabeled pairs to swap random designated parts of their codes to produce the reconstruction during the primary-stage and then swap back during the second stage. Through this process, we explicitly impose the element-wise modularity and portability of the encodings of the unlabeled samples, and implicitly encourage disentangling under the guidance of labeled pairs. 3.2 Labeled Pairs For a pair of labeled input (IA, IB) in group Gk, meaning that they share the attribute corresponding to the k-th part of their encodings RA and RB, we swap their k-th part and get a pair of hybrid codes ¨ RA = [a1, a2, ..., bk, ..., an] and ¨ RB = [b1, b2, ..., ak, ..., bn]. We then feed the hybrid code pair ¨ RA and ¨ RB to the decoder fφ to obtain the final representation ¨ IA and ¨ IB. We enforce the reconstructions ¨ IA and ¨ IB to approximate (IA, IB), and encourage disentangling of the k-th attribute. This is achieved by minimizing the swap loss Ls(IA, IB; ϕ, φ) = ||IA −¨ IA||2 2 + ||IB −¨ IB||2 2, (2) so that the k-th part of RA and RB will only contain the shared semantic. We take the total loss Lp for the labeled pairs to be the sum of the original autoencoder loss Lo and swap loss Ls(IA, IB; ϕ, φ): Lp(IA, IB; ϕ, φ) = Lo(IA, IB; ϕ, φ) + αLs(IA, IB; ϕ, φ), (3) 4 where α is a balance parameter, which decides the degree of disentanglement. Algorithm 1 The Dual Swap Disentangling (DSD) algorithm Input: Paired observation groups {Gk, k = 1, 2, .., n}, unannotated observation set G. 1: Initialize ϕ1 and φ1. 2: for t =1, 3, ..., T epochs do 3: Random sample k ∈{1, 2, ..., n}. 4: Sample paired observation (IA, IB) from group Gk. 5: Encode IA and IB into RA and RB with encoder fϕt. 6: Swap the k-th part of RA and RB and get two hybrid representations ¨ RA and ¨ RB. 7: Construct RA and RB into ¯ IA = fφt(RA) and ¯ IB = fφt(RB). 8: Construct ¨ RA and ¨ RB into ¨ IA = fφt( ¨ RA) and ¨ IB = fφt( ¨ RB). 9: Update ϕt+1, φt+1 ←ϕt, φt by ascending the gradient estimate of Lp(IA, IB; ϕt, φt). 10: Sample unpaired observation (IA, IB) from unannotated observation set G. 11: Encode IA and IB into RA and RB with encoder fϕt+1. 12: swap the k-th part of RA and RB and get two hybrid representations ¨ RA and ¨ RB. 13: Construct RA and RB into ¯ IA = fφt+1(RA) and ¯ IB = fφt+1(RB). 14: Construct ¨ RA and ¨ RB into ¨ IA = fφt+1( ¨ RA) and ¨ IB = fφt+1( ¨ RB). 15: Encode ( ¨ IA, ¨ IB) into ¨ R′ A and ¨ R′ B with encoder fϕt+1. 16: Swap the k-th parts of ¨ R′ A and ¨ R′ B backward and get R′ A and R′ B. 17: Construct R′ A and R′ B into ¯¯ IA = fφt+1(R′ A) and ¯¯ IB = fφt+1(R′ B). 18: Update ϕt+2, φt+2 ← ϕt+1, φt+1 by ascending the gradient estimate of Lu(IA, IB; ϕt+1, φt+1). 19: end for Output: ϕT , φT 3.3 Unlabeled Pairs Unlike the labeled pairs that go through only the primary-stage, unlabeled pairs go through both the primary-stage and the dual-stage, in other words, the “encoding-swap-decoding” process is conducted twice for disentangling. Like the labeled pairs, in the primary-stage the unlabeled pairs (IA, IB) also produce a pair of hybrid outputs ¨ IA and ¨ IB through swapping a random k-th part of RA and RB. In the dual-stage, the two hybrids ¨ IA and ¨ IB are again fed to the same encoder fϕ and encoded as new representations ¨ R′ A = [a′ 1, a′ 2, ..., b′ k, ..., a′ n] and ¨ R′ B = [b′ 1, b′ 2, ..., a′ k, ..., b′ n]. We then swap back the k-th part of ¨ R′ A and ¨ R′ B and denote the new codes as R′ A = [a′ 1, a′ 2, ..., a′ k, ..., a′ n] and R′ B = [b′ 1, b′ 2, ..., b′ k, ..., b′ n]. These codes are fed to the decoder fφ to produce the final output ¯¯ IA = fφ(R′ A) and ¯¯ IB = fφ(R′ B). We minimize the reconstruction error of dual swap output with respect to the original input, and write the dual swap loss Ld as follows: Ld(IA, IB; ϕ, φ) = ||IA −¯¯ IA||2 2 + ||IB −¯¯ IB||2 2. (4) The dual swap reconstruction minimization here provides a unique form of self-supervision. That is, by swapping random parts back and forth, we encourage the element-wise separability and modularity of the obtained encodings, which further helps the encoder to learn disentangled representations under the guidance of limited weak labels. The total loss for the unlabeled pairs consists of the original autoencoder loss Lo(IA, IB; ϕ, φ) and dual autoencoder loss Ld(IA, IB; ϕ, φ): Lu(IA, IB; ϕ, φ) = Lo(IA, IB; ϕ, φ) + βLd(IA, IB; ϕ, φ), (5) where β is the balance parameter. As we will show in our experiment, adopting the dual swap on unlabeled samples and solving the objective function of Eq. 5, yield a significantly better result as compared to only using unlabeled samples during the primary-stage without swapping, which corresponds to optimizing over the autoencoder loss alone. 5 3.4 Complete Algorithm Within each epoch during training, we alternatively optimize the autoencoder using randomlysampled labeled and unlabeled pairs. The complete algorithm is summarized in Algorithm 1. Once trained, the encoder is able to infer disentangled encodings that can be applied in many applications. 4 Experiments To validate the effectiveness of our methods, we conduct experiments on six image datasets of different domains: a synthesized Square dataset, Teapot (Moreno et al. [2016], Eastwood and Williams [2018]), MNIST (Haykin and Kosko [2009]), dSprites (Higgins et al. [2016]), Mugshot (Shen et al. [2016]), and CAS-PEAL-R1 (Gao et al. [2008]). We firstly qualitatively assess the visualization of DSD’s generative capacity by performing swapping operation on the parts of latent codes, which verifies the disentanglement and completeness of our method. To evaluate the informativeness of the disentangled codes, we compute the classification accuracies based on DSD encodings. We are not able to use the framework of Eastwood and Williams [2018] as it is only applicable to methods that encode each semantic into a single dimension code. In the DSD framework, the latent code’s length and semantic number for the six datasets are set as follows: Square (15, 3), Teapot (50, 5), MNIST (15, 3), dSprites (25, 5), CAS-PEAL-R1 (40, 4) and Mugshot (100, 2). The latent code’s length is empirically set, but usually set larger for sophisticated attributes. In our experiment, the visual results are generated with the 64 × 64 network architecture and other quantitative results are generated with the 32 × 32 network architecture. For the 32 × 32 network architecture, the encoder / discriminatior (D) / auxilary network (Q) and the decoder / generator (G) are shown in Table 1. The 64 × 64 network architecture is same as architecture of Eastwood and Williams [2018]. Adam optimizer (Kingma and Ba [2014]) is adopted with learning rates of 1e−4 (64 × 64 network) and 0.5e−4 (32 × 32 network). The batch size is 64. For the stable training of InfoGAN, we fix the latent codes’ standard deviations to 1 and use the objective of the improved Wasserstein GAN (Gulrajani et al. [2017]), simply appending InfoGAN’s approximate mutual information penalty. We use layer normalization instead of batch normalization. For the above two network architecture, α and β are all set as 5 and 0.2, respectively. Encoder / D/Q Decoder /G 3 × 3 32 conv. FC 4 · 4 · 8 · 32 BN, ReLU, 3 × 3 32 conv BN, ReLU, 3 × 3 256 conv, ↑ BN, ReLU, 3 × 3 64 conv, ↓ BN, ReLU, 3 × 3 128 conv BN, ReLU, 3 × 3 64 conv BN, ReLU, 3 × 3 128 conv, ↑ BN, ReLU, 3 × 3 128 conv, ↓ BN, ReLU, 3 × 3 64 conv BN, ReLU, 3 × 3 128 conv BN, ReLU, 3 × 3 64 conv, ↑ BN, ReLU, 3 × 3 256 conv, ↓ BN, ReLU, 3 × 3 32 conv FC Output BN, ReLU, 3 × 3 3 conv, tanh Table 1: Network architecture for image size 32 × 32. Each network has 3 residual blocks (all but the first and last rows). The input to each residual block is added to its output (with appropriate downsampling/upsampling to ensure that the dimensions match). Downsampling ↓is performed with mean pooling and ↑indicates nearest-neighbour upsampling. 4.1 Qualitative Evaluation We show in Fig. 2 some visualization results on the six datasets. For each dataset, we show input pairs, the swapped attribute, and results after swapping. Square We create a synthetic image dataset of 60, 000 image samples ( 30, 000 pair images), where each image features a randomly-colored square at a random position with a randomly-colored background. The training, validation and testing dataset are set as {(20, 000), (9, 000) and (1, 000)}, respectively. Visual results of DSD on Square dataset are shown in Fig. 2(a), where DSD leads to visually plausible results. 6 input s #1 s #2 s #3 position background square color input s #1 s #2 s #3 digital identity angle thickness (a) (c) azimuth elevation red blue green input s #1 s #2 s #3 (b) s #4 s #5 (d) input background orientation position x scale position y shape input s #1 input s #1 (e) (f) hat light hat & glasses input s #1 s #2 s #2,3 input input d-pair s #1 s #2 s #3 s #4 s #5 background Figure 2: Visual results on six datasets: (a) Square, (b) Teapot, (c) MNIST, (d) dSprites, (e) Mugshot, and (f) CAS-PEAL-R1. “d-pair” indicates disturbed pair. Teapot The Teapot dataset used in Eastwood and Williams [2018] contains 200, 000 64 × 64 color images of a teapot with varying poses and colors. Each generative factor is independently sampled from its respective uniform distribution: azimuth (z0) ∼U⌈0, 2π⌉, elevation (z1) ∼U⌈0, 2π⌉, red (z2) ∼U⌈0; 1⌉, green (z4) ∼U⌈0; 1⌉. In the experiment, we used 50, 000 training, 10, 000 validation and 10, 000 testing samples. Fig. 2(b) shows the visual results on Teapot, where we can see that the five factors are evidently disentangled. MNIST In the visual experiment, we adopt InfoGAN to generate 5, 000 paired samples, for which we vary the following factors: digital identity (0−9), angle and stroke thickness. The whole training dataset contains 50, 000 samples: 5, 000 generated paired samples and 45, 000 real unpaired samples collected from the original dataset. Semantics swapping for MNIST are shown in Fig. 2(c), where the digits swap one attribute but preserve the other two. For example, when swapping the angle, the digital identity and thickness are kept unchanged. The generated images again look very realistic. dSprites The dSprites is a dataset of 2D shapes procedurally generated from 6 ground truth independent latent factors. These factors are color (white), shape (heart, oval and square), scale (6 values), rotation (40 values), position X (32 values) and position Y (32 values) of a sprite. All possible combinations of these factors are present exactly once, generating N = 737280 total images. We sample 100, 000 pairs from original dSprites, which are divided into {(80, 000), (10, 000), (10, 000)} for training, validation and testing. Fig. 2(d) shows the visual results with swapped above latent factors, where we can see that the five factors are again obviously disentangled. Mugshot We also use the Mugshot dataset which contains selfie images of different subjects with different backgrounds. This dataset is generated by artificially combining human face images in Shen et al. [2016] with 1, 000 scene photos collected from internet. For Mugshot dataset, we divided it into {(20, 000), (9, 000), (1, 000)} for training, validation and testing. Fig. 2(e) shows the results of the same mugshot through swapping different backgrounds, which are visually impressive. Note that, in this case we only consider two semantics, the foreground being the human selfie and the background being the collected scene. The good visual results can be partially explained by the fact that the background with different subjects has been observed by DSD during training. CAS-PEAL-R1 CAS-PEAL-R1 contains 30, 900 images of 1, 040 subjects, of which 438 subjects wear 6 different types of accessories (3 types of glasses, and 3 types of hat). There are images of 233 subjects that involve at least 10 lighting changes and at most 31 lighting changes. We sample 50, 000 pair samples from original CAS-PEAL-R1. They are divided into {(40, 000), (9, 000), (1, 000)} for training, validation and testing. Fig. 2(f) shows the visual results with swapped light, hat and glasses. 7 Notably, the covered hair by the hats can also be reconstructed when the hats are swapped, despite the qualities of hybrid images are exceptional. This can be in part explained by the existence of disturbed paired samples, as depicted in the last column. This pair of images is in fact labeled as sharing the same hat, although the appearances of the hats such as the wearing angles are significantly different, making the supervision very noisy. 4.2 Quantitative Evaluation To quantitatively evaluate the informativeness of disentangled codes, we compare our methods with 4 methods: InfoGAN (Chen et al. [2016]), β-VAE (Higgins et al. [2016]), Semi-VAE (Siddharth et al. [2017]) and basic Autoencoder. We first use InfoGAN to generate 5, 0000 pair digital samples, and then train all methods on this generated dataset. For InfoGAN and β-VAE , the lengths of their codes are set as 5. To fairly compare with the above two methods, the codes’ length of Semi-VAE, Autoencoder and our DSD are taken to be 5 × 3, which means the code contains 3 parts and each part’s length is 5. In this condition, we can compare part of codes (length = 5) that correspond to digit identity with whole codes (length = 5) of InfoGAN and β-VAE and variable (length = 1) that correspond to digit identity. For the basic Autoencoder, the highest accuracy part is treated as the identity part. After training all the models, real MNIST data are encoded as codes. Then, 55, 000 training samples are used to train a simple knn classifier and remaining 10, 000 are used as test samples. Table 2 gives the classification accuracy of different methods, where the InfoGAN achieves the worst accuracy score. The DSD(0.5) achieves best accuracy score, which further validates the informativeness of our DSD. Table 2: The accuracy score comparison among different models. DSD(n) denotes the DSD with n supervision rate paired samples. Accuracy (ACC) values are shown as “q/p”, where q is the accuracy obtained using the digital identity part of the codes for classification, and p is the accuracy obtained using the whole codes. Model β-VAE(β=1) β-VAE(β=6) InfoGAN Semi-VAE Autoencoder DSD(0.5) DSD(1) ACC 0.22/0.72 0.25/0.71 0.19/0.51 0.22/0.57 0.66/0.93 0.76/0.91 0.742/0.90 In addition, to compare the annotated dataset’s requirement of different (semi-)supervised methods, we summarize it in Table 3. Name abbreviation with corresponding methods is given as following: DC-IGN (Kulkarni et al. [2015]), DNA-GAN (Xiao et al. [2017]), TD-GAN (Wang et al. [2017]), Semi-DGM (Kingma et al. [2014]), Semi-VAE (Siddharth et al. [2017]), MLVAE (Bouchacourt et al. [2017]), JADE (Banijamali et al. [2017]). DSD is the only one that requires limited and weak labels, meaning that it requires the least amount of human annotations. Table 3: Comparison of the required annotated data. Label indicates whether the method require strong label or weak label. Rate indicates the proportion of annotated data required for training. DC-IGN DNA-GAN TD-GAN Semi-DGM Semi-VAE JADE ML-VAE DSD Label strong strong strong strong strong strong weak weak Rate 100 % 100 % 100 % limited limited limited 100 % limited 4.3 Supervision Rate We also conduct experiments to demonstrate the impact of the supervision rate for DSD’s disentangling capabilities, where we set the rates to be 0.0, 0.1, 0.2, ..., 1.0. From Fig. 3(a), we can see that different supervision rates do not affect the convergence of DSD. Lower supervision rate will however lead to the overfitting if the epoch number greater than the optimal one. Fig. 3(d) shows the classification accuracy of DSD with different supervision rates. With only 20% paired samples, DSD achieves comparable accuracy as the one obtained using 100% paired data, which shows that the dual-learning mechanism is able to take good advantage of unpaired samples. Fig. 3(c) shows some hybrid images that are swapped the digital identity code parts. Note that, images obtained by DSD with supervision rates equal to 0.2, 0.3, 0.4, 0.5 and 0.7 keep the angles of the digits correct while others not. These image pairs are highlighted in yellow. 8 Inputs digital identity Loss Supervision Rate Epoch 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 dual primary Epoch Loss (a) (b) (c) (d) Supervision Rate X 1.0e4 X 1.0e4 overfitting validation loss curves of primary-framework training loss curves of DSD training loss curves of primary-framework validation loss curves of DSD Figure 3: Results of different supervision rate. (a) The training loss curves and validation loss curves of different supervision rates, where “t-rate” indicates training loss of supervision rate and “v-rate” indicates validation loss of supervision rate. (b) The training and validation loss curves of the DSD (dual framework) and primary-framework with different supervision rates. (c) Visual results of different supervision rates through swapping parts of codes that correspond to the digital identities. (d) Classification accuracy of codes that are encoded by DSD with different supervision rate. 4.4 Primary vs Dual To verify the effectiveness of dual-learning mechanism, we compare our DSD (dual framework) with a basic primary-framework that only contains primary-stage. The primary-framework also requires paired and unpaired samples. The major difference between the primary-framework and DSD is that there is no swapping operation for unpaired samples in the primary-framework. Fig. 3(b) gives the training and validation loss curves of the DSD and primary-framework with different supervision rates, where we can find that different supervision rates have no visible impacts on the convergence of DSD and primary-framework. From Fig. 3(d), we can see that accuracy scores of the DSD are always higher than accuracies of the primary-framework in different supervision rate, which proves that codes disentangled by the DSD are more informative than those disentangled by the primaryframework. Fig. 3(c) gives the visual comparison between the hybrid images in different supervision rate. It is obvious that hybrid images of the primary-framework are almost the same with original images, which indicates that the swapped codes contain redundant angle information. In other words, the disentanglement of the primary-framework is defective. On the contrary, most of the hybrid images of DSD keep the angle effectively, indicating that swapped coded only contains the digital identity information. These results show that the DSD is indeed superior to the primary-framework. 5 Discussion and Conclusion In this paper, we propose the Dual Swap Disentangling (DSD) model that learns disentangled representations using limited and weakly-labeled training samples. Our model requires the shared attribute as the only annotation of a pair of input samples, and is able to take advantage of the vast amount of unlabeled samples to facilitate the model training. This is achieved by the dual-stage architecture, where the labeled samples go through the “encoding-swap-decoding” process once while the unlabeled ones go through the process twice. Such self-supervision mechanism for unlabeled samples turns out to be very effective: DSD yields results superior to the state-of-the-art on several datasets of different domains. In the future work, we will take semantic hierarchy into consideration and potentially learn disentangled representations with even fewer labeled pairs. 9 Acknowledgments This work is supported by Natonal Basic Research Program of China under Grant No. 2015CB352400, National Natural Science Foundation of China (61572428,U1509206), Fundamental Research Funds for the Central Universities (2017FZA5014), Key Research and Development Program of Zhejiang Province (2018C01004), and Australian Research Council Projects (FL170100117, DP-140102164). References Ershad Banijamali, Amir Hossein Karimi, Alexander Wong, and Ali Ghodsi. Jade: Joint autoencoders for dis-entanglement. 2017. Diane Bouchacourt, Ryota Tomioka, and Sebastian Nowozin. Multi-level variational autoencoder: Learning disentangled representations from grouped observations. 2017. Christopher Burgess, Irina Higgins, Arka Pal, Loic Matthey, Nick Watters, Guillaume Desjardins, and Alexander Lerchner. Understanding disentangling in beta-vae. In NIPS 2017 Disentanglement Workshop, 2017. Tian Qi Chen, Xuechen Li, Roger Grosse, and David Duvenaud. Isolating sources of disentanglement in variational autoencoders. arXiv preprint arXiv:1802.04942, 2018. Xi Chen, Yan Duan, Rein Houthooft, John Schulman, Ilya Sutskever, and Pieter Abbeel. Infogan: Interpretable representation learning by information maximizing generative adversarial nets. 2016. Emilien Dupont. Joint-vae: Learning disentangled joint continuous and discrete representations. arXiv preprint arXiv:1804.00104, 2018. Cian Eastwood and Christopher K. I. Williams. A framework for the quantitative evaluation of disentangled representations. In International Conference on Learning Representations, 2018. Zunlei Feng, Zhenyun Yu, Yezhou Yang, Yongcheng Jing, Junxiao Jiang, and Mingli Song. Interpretable partitioned embedding for customized fashion outfit composition. 2018. Shuyang Gao, Rob Brekelmans, Greg Ver Steeg, and Aram Galstyan. Auto-encoding total correlation explanation. arXiv preprint arXiv:1802.05822, 2018. Wen Gao, Bo Cao, Shiguang Shan, Xilin Chen, Delong Zhou, Xiaohua Zhang, and Debin Zhao. The caspeal large-scale chinese face database and baseline evaluations. IEEE Transactions on Systems, Man, and Cybernetics - Part A: Systems and Humans, 38(1):149–161, 2008. Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron Courville. Improved training of wasserstein gans. 2017. S. Haykin and B. Kosko. Gradientbased learning applied to document recognition. In IEEE, pages 306–351, 2009. Irina Higgins, Loic Matthey, Arka Pal, Christopher Burgess, Xavier Glorot, Matthew Botvinick, Shakir Mohamed, and Alexander Lerchner. beta-vae: Learning basic visual concepts with a constrained variational framework. 2016. Irina Higgins, Arka Pal, Andrei A Rusu, Loic Matthey, Christopher P Burgess, Alexander Pritzel, Matthew Botvinick, Charles Blundell, and Alexander Lerchner. Darla: Improving zero-shot transfer in reinforcement learning. arXiv preprint arXiv:1707.08475, 2017a. Irina Higgins, Nicolas Sonnerat, Loic Matthey, Arka Pal, Christopher P Burgess, Matthew Botvinick, Demis Hassabis, and Alexander Lerchner. Scan: Learning abstract hierarchical compositional visual concepts. 2017b. Hyunjik Kim and Andriy Mnih. Disentangling by factorising. arXiv preprint arXiv:1802.05983, 2018. Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. Computer Science, 2014. Diederik P Kingma, Danilo J Rezende, Shakir Mohamed, and Max Welling. Semi-supervised learning with deep generative models. Advances in Neural Information Processing Systems, 4:3581–3589, 2014. Tejas D. Kulkarni, William F. Whitney, Pushmeet Kohli, and Joshua B. Tenenbaum. Deep convolutional inverse graphics network. 71(2):2539–2547, 2015. 10 Brenden M Lake, Tomer D Ullman, Joshua B Tenenbaum, and Samuel J Gershman. Building machines that learn and think like people. Behavioral and Brain Sciences, 40, 2017. Pol Moreno, Christopher K. I. Williams, Charlie Nash, and Pushmeet Kohli. Overcoming occlusion with inverse graphics. In European Conference on Computer Vision, pages 170–185, 2016. Guim Perarnau, Van De Weijer Joost, Bogdan Raducanu, and Jose M Alvarez. Invertible conditional gans for image editing. 2016. Xiaoyong Shen, Aaron Hertzmann, Jiaya Jia, Sylvain Paris, Brian Price, Eli Shechtman, and Ian Sachs. Automatic portrait segmentation for image stylization. Computer Graphics Forum, 35(2):93–102, 2016. N Siddharth, Brooks Paige, Alban Desmaison, Jan-Willem van de Meent, Frank Wood, Noah Goodman, D, Pushmeet Kohli, and H S Torr, Philip. Learning disentangled representations in deep generative models. 2017. Chaoyue Wang, Chaohui Wang, Chang Xu, and Dacheng Tao. Tag disentangled generative adversarial network for object image re-rendering. In Twenty-Sixth International Joint Conference on Artificial Intelligence, pages 2901–2907, 2017. Yingce Xia, Di He, Tao Qin, Liwei Wang, Nenghai Yu, Tie Yan Liu, and Wei Ying Ma. Dual learning for machine translation. 2016. Taihong Xiao, Jiapeng Hong, and Jinwen Ma. Dna-gan: Learning disentangled representations from multiattribute images. 2017. Jun Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. pages 2242–2251, 2017. 11
2018
1003
7,248
Algorithmic Regularization in Learning Deep Homogeneous Models: Layers are Automatically Balanced˚ Simon S. Du: Wei Hu; Jason D. Lee§ Abstract We study the implicit regularization imposed by gradient descent for learning multi-layer homogeneous functions including feed-forward fully connected and convolutional deep neural networks with linear, ReLU or Leaky ReLU activation. We rigorously prove that gradient flow (i.e. gradient descent with infinitesimal step size) effectively enforces the differences between squared norms across different layers to remain invariant without any explicit regularization. This result implies that if the weights are initially small, gradient flow automatically balances the magnitudes of all layers. Using a discretization argument, we analyze gradient descent with positive step size for the non-convex low-rank asymmetric matrix factorization problem without any regularization. Inspired by our findings for gradient flow, we prove that gradient descent with step sizes ⌘t “ O ´ t´p 1 2 `δq¯ (0 † δ § 1 2) automatically balances two low-rank factors and converges to a bounded global optimum. Furthermore, for rank-1 asymmetric matrix factorization we give a finer analysis showing gradient descent with constant step size converges to the global minimum at a globally linear rate. We believe that the idea of examining the invariance imposed by first order algorithms in learning homogeneous models could serve as a fundamental building block for studying optimization for learning deep models. 1 Introduction Modern machine learning models often consist of multiple layers. For example, consider a feedforward deep neural network that defines a prediction function x fiÑ fpx; W p1q, . . . , W pNqq “ W pNqφpW pN´1q ¨ ¨ ¨ W p2qφpW p1qxq ¨ ¨ ¨ q, where W p1q, . . . , W pNq are weight matrices in N layers, and φ p¨q is a point-wise homogeneous activation function such as Rectified Linear Unit (ReLU) φpxq “ maxtx, 0u. A simple observation is that this model is homogeneous: if we multiply a layer by a positive scalar c and divide another layer by c, the prediction function remains the same, e.g. fpx; cW p1q, . . . , 1 cW pNqq “ fpx; W p1q, . . . , W pNqq. A direct consequence of homogeneity is that a solution can produce small function value while being unbounded, because one can always multiply one layer by a huge number and divide another ˚The full version of this paper is available at https://arxiv.org/abs/1806.00900. :Machine Learning Department, School of Computer Science, Carnegie Mellon University. Email: ssdu@cs.cmu.edu ;Computer Science Department, Princeton University. Email: huwei@cs.princeton.edu §Department of Data Sciences and Operations, Marshall School of Business, University of Southern California. Email: jasonlee@marshall.usc.edu 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montr´eal, Canada. layer by that number. Theoretically, this possible unbalancedness poses significant difficulty in analyzing first order optimization methods like gradient descent/stochastic gradient descent (GD/SGD), because when parameters are not a priori constrained to a compact set via either coerciveness5 of the loss or an explicit constraint, GD and SGD are not even guaranteed to converge [Lee et al., 2016, Proposition 4.11]. In the context of deep learning, Shamir [2018] determined that the primary barrier to providing algorithmic results is in that the sequence of parameter iterates is possibly unbounded. Now we take a closer look at asymmetric matrix factorization, which is a simple two-layer homogeneous model. Consider the following formulation for factorizing a low-rank matrix: min UPRd1ˆr,V PRd2ˆr f pU, V q “ 1 2 ››UV J ´ M ˚››2 F , (1) where M ˚ P Rd1ˆd2 is a matrix we want to factorize. We observe that due to the homogeneity of f, it is not smooth6 even in the neighborhood of a globally optimum point. To see this, we compute the gradient of f: Bf pU, V q BU “ ` UV J ´ M ˚˘ V , Bf pU, V q BV “ ` UV J ´ M ˚˘J U. (2) Notice that the gradient of f is not homogeneous anymore. Further, consider a globally optimal solution pU, V q such that }U}F is of order ✏and }V }F is of order 1{✏(✏being very small). A small perturbation on U can lead to dramatic change to the gradient of U. This phenomenon can happen for all homogeneous functions when the layers are unbalanced. The lack of nice geometric properties of homogeneous functions due to unbalancedness makes first-order optimization methods difficult to analyze. A common theoretical workaround is to artificially modify the natural objective function as in (1) in order to prove convergence. In [Tu et al., 2015, Ge et al., 2017a], a regularization term for balancing the two layers is added to (1): min UPRd1ˆr,V PRd2ˆr 1 2 ››UV J ´ M ››2 F ` 1 8 ››U JU ´ V JV ››2 F . (3) For problem (3), the regularizer removes the homogeneity issue and the optimal solution becomes unique (up to rotation). Ge et al. [2017a] showed that the modified objective (3) satisfies (i) every local minimum is a global minimum, (ii) all saddle points are strict7, and (iii) the objective is smooth. These imply that (noisy) GD finds a global minimum [Ge et al., 2015, Lee et al., 2016, Panageas and Piliouras, 2016]. On the other hand, empirically, removing the homogeneity is not necessary. We use GD with random initialization to solve the optimization problem (1). Figure 1a shows that even without regularization term like in the modified objective (3) GD with random initialization converges to a global minimum and the convergence rate is also competitive. A more interesting phenomenon is shown in Figure 1b in which we track the Frobenius norms of U and V in all iterations. The plot shows that the ratio between norms remains a constant in all iterations. Thus the unbalancedness does not occur at all! In many practical applications, many models also admit the homogeneous property (like deep neural networks) and first order methods often converge to a balanced solution. A natural question arises: Why does GD balance multiple layers and converge in learning homogeneous functions? In this paper, we take an important step towards answering this question. Our key finding is that the gradient descent algorithm provides an implicit regularization on the target homogeneous function. First, we show that on the gradient flow (gradient descent with infinitesimal step size) trajectory induced by any differentiable loss function, for a large class of homogeneous models, including fully connected and convolutional neural networks with linear, ReLU and Leaky ReLU activations, the differences between squared norms across layers remain invariant. Thus, as long as at the beginning the differences are small, they remain small at all time. Note that small differences arise in commonly used initialization schemes such as 1 ? d Gaussian initialization or 5A function f is coercive if }x} Ñ 8 implies fpxq Ñ 8. 6A function is said to be smooth if its gradient is β-Lipschitz continuous for some finite β ° 0. 7A saddle point of a function f is strict if the Hessian at that point has a negative eigenvalue. 2 0 2000 4000 6000 8000 10000 Epochs -18 -16 -14 -12 -10 -8 -6 -4 -2 0 2 Logarithm of Obj Without Regularization With Regularization (a) Comparison of convergence rates of GD for objective functions (1) and (3). 0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 Epochs 0.4 0.5 0.6 0.7 0.8 0.9 1 Ratio between F-Norms of Two Layers Without Regularization With Regularization (b) Comparison of quantity }U}2 F { }V }2 F when running GD for objective functions (1) and (3). Figure 1: Experiments on the matrix factorization problem with objective functions (1) and (3). Red lines correspond to running GD on the objective function (1), and blue lines correspond to running GD on the objective function (3). Xavier/Kaiming initialization schemes [Glorot and Bengio, 2010, He et al., 2016]. Our result thus explains why using ReLU activation is a better choice than sigmoid from the optimization point view. For linear activation, we prove an even stronger invariance for gradient flow: we show that W phqpW phqqJ ´ pW ph`1qqJW ph`1q stays invariant over time, where W phq and W ph`1q are weight matrices in consecutive layers with linear activation in between. Next, we go beyond gradient flow and consider gradient descent with positive step size. We focus on the asymmetric matrix factorization problem (1). Our invariance result for linear activation indicates that U JU ´ V JV stays unchanged for gradient flow. For gradient descent, U JU ´ V JV can change over iterations. Nevertheless we show that if the step size decreases like ⌘t “ O ´ t´p 1 2 `δq¯ (0 † δ § 1 2), U JU ´ V JV will remain small in all iterations. In the set where U JU ´ V JV is small, the loss is coercive, and gradient descent thus ensures that all the iterates are bounded. Using these properties, we then show that gradient descent converges to a globally optimal solution. Furthermore, for rank-1 asymmetric matrix factorization, we give a finer analysis and show that randomly initialized gradient descent with constant step size converges to the global minimum at a globally linear rate. Related work. The homogeneity issue has been previously discussed by Neyshabur et al. [2015a,b]. The authors proposed a variant of stochastic gradient descent that regularizes paths in a neural network, which is related to the max-norm. The algorithm outperforms gradient descent and AdaGrad on several classification tasks. A line of research focused on analyzing gradient descent dynamics for (convolutional) neural networks with one or two unknown layers [Tian, 2017, Brutzkus and Globerson, 2017, Du et al., 2017a,b, Zhong et al., 2017, Li and Yuan, 2017, Ma et al., 2017, Brutzkus et al., 2017]. For one unknown layer, there is no homogeneity issue. While for two unknown layers, existing work either requires learning two layers separately [Zhong et al., 2017, Ge et al., 2017b] or uses re-parametrization like weight normalization to remove the homogeneity issue [Du et al., 2017b]. To our knowledge, there is no rigorous analysis for optimizing multi-layer homogeneous functions. For a general (non-convex) optimization problem, it is known that if the objective function satisfies (i) gradient changes smoothly if the parameters are perturbed, (ii) all saddle points and local maxima are strict (i.e., there exists a direction with negative curvature), and (iii) all local minima are global (no spurious local minimum), then gradient descent [Lee et al., 2016, Panageas and Piliouras, 2016] converges to a global minimum. There have been many studies on the optimization landscapes of neural networks [Kawaguchi, 2016, Choromanska et al., 2015, Du and Lee, 2018, Hardt and Ma, 2016, Bartlett et al., 2018, Haeffele and Vidal, 2015, Freeman and Bruna, 2016, Vidal et al., 2017, Safran and Shamir, 2016, Zhou and Feng, 2017, Nguyen and Hein, 2017a,b, Zhou and Feng, 2017, Safran and Shamir, 2017], showing that the objective functions have properties (ii) and (iii). 3 Nevertheless, the objective function is in general not smooth as we discussed before. Our paper complements these results by showing that the magnitudes of all layers are balanced and in many cases, this implies smoothness. Paper organization. The rest of the paper is organized as follows. In Section 2, we present our main theoretical result on the implicit regularization property of gradient flow for optimizing neural networks. In Section 3, we analyze the dynamics of randomly initialized gradient descent for asymmetric matrix factorization problem with unregularized objective function (1). In Section 4, we empirically verify the theoretical result in Section 2. We conclude and list future directions in Section 5. Some technical proofs are deferred to the appendix. Notation. We use bold-faced letters for vectors and matrices. For a vector x, denote by xris its i-th coordinate. For a matrix A, we use Ari, js to denote its pi, jq-th entry, and use Ari, :s and Ar:, js to denote its i-th row and j-th column, respectively (both as column vectors). We use }¨}2 or }¨} to denote the Euclidean norm of a vector, and use }¨}F to denote the Frobenius norm of a matrix. We use x¨, ¨y to denote the standard Euclidean inner product between two vectors or two matrices. Let rns “ t1, 2, . . . , nu. 2 The Auto-Balancing Properties in Deep Neural Networks In this section we study the implicit regularization imposed by gradient descent with infinitesimal step size (gradient flow) in training deep neural networks. In Section 2.1 we consider fully connected neural networks, and our main result (Theorem 2.1) shows that gradient flow automatically balances the incoming and outgoing weights at every neuron. This directly implies that the weights between different layers are balanced (Corollary 2.1). For linear activation, we derive a stronger auto-balancing property (Theorem 2.2). In Section 2.2 we generalize our result from fully connected neural networks to convolutional neural networks. In Section 2.3 we present the proof of Theorem 2.1. The proofs of other theorems in this section follow similar ideas and are deferred to Appendix A. 2.1 Fully Connected Neural Networks We first formally define a fully connected feed-forward neural network with N (N • 2) layers. Let W phq P Rnhˆnh´1 be the weight matrix in the h-th layer, and define w “ pW phqqN h“1 as a shorthand of the collection of all the weights. Then the function fw : Rd Ñ Rp (d “ n0, p “ nN) computed by this network can be defined recursively: f p1q w pxq “ W p1qx, f phq w pxq “ W phqφh´1pf ph´1q w pxqq (h “ 2, . . . , N), and fwpxq “ f pNq w pxq, where each φh is an activation function that acts coordinatewise on vectors.8 We assume that each φh (h P rN ´1s) is homogeneous, namely, φhpxq “ φ1 hpxq¨x for all x and all elements of the sub-differential φ1 hp¨q when φh is non-differentiable at x. This property is satisfied by functions like ReLU φpxq “ maxtx, 0u, Leaky ReLU φpxq “ maxtx, ↵xu (0 † ↵† 1), and linear function φpxq “ x. Let ` : Rp ˆ Rp Ñ R•0 be a differentiable loss function. Given a training dataset tpxi, yiqum i“1 Ä Rd ˆ Rp, the training loss as a function of the network parameters w is defined as Lpwq “ 1 m m ÿ i“1 ` pfwpxiq, yiq . (4) We consider gradient descent with infinitesimal step size (also known as gradient flow) applied on Lpwq, which is captured by the differential inclusion: dW phq dt P ´ BLpwq BW phq , h “ 1, . . . , N, (5) where t is a continuous time index, and BLpwq BW phq is the Clarke sub-differential [Clarke et al., 2008]. If curves W phq “ W phqptq (h P rNs) evolve with time according to (5) they are said to be a solution of the gradient flow differential inclusion. 8We omit the trainable bias weights in the network for simplicity, but our results can be directly generalized to allow bias weights. 4 Our main result in this section is the following invariance imposed by gradient flow. Theorem 2.1 (Balanced incoming and outgoing weights at every neuron). For any h P rN ´ 1s and i P rnhs, we have d dt ´ }W phqri, :s}2 ´ }W ph`1qr:, is}2¯ “ 0. (6) Note that W phqri, :s is a vector consisting of network weights coming into the i-th neuron in the h-th hidden layer, and W ph`1qr:, is is the vector of weights going out from the same neuron. Therefore, Theorem 2.1 shows that gradient flow exactly preserves the difference between the squared `2-norms of incoming weights and outgoing weights at any neuron. Taking sum of (6) over i P rnhs, we obtain the following corollary which says gradient flow preserves the difference between the squares of Frobenius norms of weight matrices. Corollary 2.1 (Balanced weights across layers). For any h P rN ´ 1s, we have d dt ´ }W phq}2 F ´ }W ph`1q}2 F ¯ “ 0. Corollary 2.1 explains why in practice, trained multi-layer models usually have similar magnitudes on all the layers: if we use a small initialization, }W phq}2 F ´ }W ph`1q}2 F is very small at the beginning, and Corollary 2.1 implies this difference remains small at all time. This finding also partially explains why gradient descent converges. Although the objective function like (4) may not be smooth over the entire parameter space, given that }W phq}2 F ´ }W ph`1q}2 F is small for all h, the objective function may have smoothness. Under this condition, standard theory shows that gradient descent converges. We believe this finding serves as a key building block for understanding first order methods for training deep neural networks. For linear activation, we have the following stronger invariance than Theorem 2.1: Theorem 2.2 (Stronger balancedness property for linear activation). If for some h P rN ´ 1s we have φhpxq “ x, then d dt ´ W phqpW phqqJ ´ pW ph`1qqJW ph`1q¯ “ 0. This result was known for linear networks [Arora et al., 2018], but the proof there relies on the entire network being linear while Theorem 2.2 only needs two consecutive layers to have no nonlinear activations in between. While Theorem 2.1 shows the invariance in a node-wise manner, Theorem 2.2 shows for linear activation, we can derive a layer-wise invariance. Inspired by this strong invariance, in Section 3 we prove gradient descent with positive step sizes preserves this invariance approximately for matrix factorization. 2.2 Convolutional Neural Networks Now we show that the conservation property in Corollary 2.1 can be generalized to convolutional neural networks. In fact, we can allow arbitrary sparsity pattern and weight sharing structure within a layer; convolutional layers are a special case. Neural networks with sparse connections and shared weights. We use the same notation as in Section 2.1, with the difference that some weights in a layer can be missing or shared. Formally, the weight matrix W phq P Rnhˆnh´1 in layer h (h P rNs) can be described by a vector vphq P Rdh and a function gh : rnhs ˆ rnh´1s Ñ rdhs Y t0u. Here vphq consists of the actual free parameters in this layer and dh is the number of free parameters (e.g. if there are k convolutional filters in layer h each with size r, we have dh “ r ¨ k). The map gh represents the sparsity and weight sharing pattern: W phqri, js “ "0, ghpi, jq “ 0, vphqrks, ghpi, jq “ k ° 0. 5 Denote by v “ ` vphq˘N h“1 the collection of all the parameters in this network, and we consider gradient flow to learn the parameters: dvphq dt P ´BLpvq Bvphq , h “ 1, . . . , N. The following theorem generalizes Corollary 2.1 to neural networks with sparse connections and shared weights: Theorem 2.3. For any h P rN ´ 1s, we have d dt ´ }vphq}2 ´ }vph`1q}2¯ “ 0. Therefore, for a neural network with arbitrary sparsity pattern and weight sharing structure, gradient flow still balances the magnitudes of all layers. 2.3 Proof of Theorem 2.1 The proofs of all theorems in this section are similar. They are based on the use of the chain rule (i.e. back-propagation) and the property of homogeneous activations. Below we provide the proof of Theorem 2.1 and defer the proofs of other theorems to Appendix A. Proof of Theorem 2.1. First we note that we can without loss of generality assume L is the loss associated with one data sample px, yq P Rd ˆ Rp, i.e., Lpwq “ `pfwpxq, yq. In fact, for Lpwq “ 1 m ∞m k“1 Lkpwq where Lkpwq “ ` pfwpxkq, ykq, for any single weight W phqri, js in the network we can compute d dtpW phqri, jsq2 “ 2W phqri, js¨ dW phqri,js dt “ ´2W phqri, js¨ BLpwq BW phqri,js “ ´2W phqri, js ¨ 1 m ∞m k“1 BLkpwq BW phqri,js, using the sharp chain rule of differential inclusions for tame functions [Drusvyatskiy et al., 2015, Davis et al., 2018]. Thus, if we can prove the theorem for every individual loss Lk, we can prove the theorem for L by taking average over k P rms. Therefore in the rest of proof we assume Lpwq “ `pfwpxq, yq. For convenience, we denote xphq “ f phq w pxq (h P rNs), which is the input to the h-th hidden layer of neurons for h P rN ´ 1s and is the output of the network for h “ N. We also denote xp0q “ x and φ0pxq “ x (@x). Now we prove (6). Since W ph`1qrk, is (k P rnh`1s) can only affect Lpwq through xph`1qrks , we have for k P rnh`1s, BLpwq BW ph`1qrk, is “ BLpwq Bxph`1qrks ¨ Bxph`1qrks BW ph`1qrk, is “ BLpwq Bxph`1qrks ¨ φhpxphqrisq, which can be rewritten as BLpwq BW ph`1qr:, is “ φhpxphqrisq ¨ BLpwq Bxph`1q . It follows that d dt}W ph`1qr:, is}2 “ 2 B W ph`1qr:, is, d dtW ph`1qr:, is F “ ´2 B W ph`1qr:, is, BLpwq BW ph`1qr:, is F “ ´2φhpxphqrisq ¨ B W ph`1qr:, is, BLpwq Bxph`1q F . (7) On the other hand, W phqri, :s only affects Lpwq through xphqris. Using the chain rule, we get BLpwq BW phqri, :s “ BLpwq Bxphqris ¨ φh´1pxph´1qq “ B BLpwq Bxph`1q , W ph`1qr:, is F ¨ φ1 hpxphqrisq ¨ φh´1pxph´1qq, where φ1 is interpreted as a set-valued mapping whenever it is applied at a non-differentiable point.9 9More precisely, the equalities should be an inclusion whenever there is a sub-differential, but as we see in the next display the ambiguity in the choice of sub-differential does not affect later calculations. 6 It follows that10 d dt}W phqri, :s}2 “ 2 B W phqri, :s, d dtW phqri, :s F “ ´2 B W phqri, :s, BLpwq BW phqri, :s F “ ´ 2 B BLpwq Bxph`1q , W ph`1qr:, is F ¨ φ1 hpxphqrisq ¨ A W phqri, :s, φh´1pxph´1qq E “ ´ 2 B BLpwq Bxph`1q , W ph`1qr:, is F ¨ φ1 hpxphqrisq ¨ xphqris “ ´2 B BLpwq Bxph`1q , W ph`1qr:, is F ¨ φhpxphqrisq. Comparing the above expression to (7), we finish the proof. 3 Gradient Descent Converges to Global Minimum for Asymmetric Matrix Factorization In this section we constrain ourselves to the asymmetric matrix factorization problem and analyze the gradient descent algorithm with random initialization. Our analysis is inspired by the auto-balancing properties presented in Section 2. We extend these properties from gradient flow to gradient descent with positive step size. Formally, we study the following non-convex optimization problem: min UPRd1ˆr,V PRd2ˆr fpU, V q “ 1 2 ››UV J ´ M ˚››2 F , (8) where M ˚ P Rd1ˆd2 has rank r. Note that we do not have any explicit regularization in (8). The gradient descent dynamics for (8) have the following form: Ut`1 “ Ut ´ ⌘tpUtV J t ´ M ˚qVt, Vt`1 “ Vt ´ ⌘tpUtV J t ´ M ˚qJUt. (9) 3.1 The General Rank-r Case First we consider the general case of r • 1. Our main theorem below says that if we use a random small initialization pU0, V0q, and set step sizes ⌘t to be appropriately small, then gradient descent (9) will converge to a solution close to the global minimum of (8). To our knowledge, this is the first result showing that gradient descent with random initialization directly solves the un-regularized asymmetric matrix factorization problem (8). Theorem 3.1. Let 0 † ✏† }M ˚}F . Suppose we initialize the entries in U0 and V0 i.i.d. from Np0, ✏ polypdqq (d “ maxtd1, d2u), and run (9) with step sizes ⌘t “ ? ✏{r 100pt`1q}M ˚}3{2 F (t “ 0, 1, . . .).11 Then with high probability over the initialization, limtÑ8pUt, Vtq “ p ¯U, ¯V q exists and satisfies ›› ¯U ¯V J ´ M ˚›› F § ✏. Proof sketch of Theorem 3.1. First let’s imagine that we are using infinitesimal step size in GD. Then according to Theorem 2.2 (viewing problem (8) as learning a two-layer linear network where the inputs are all the standard unit vectors in Rd2), we know that U JU ´ V JV will stay invariant throughout the algorithm. Hence when U and V are initialized to be small, U JU ´V JV will stay small forever. Combined with the fact that the objective fpU, V q is decreasing over time (which means UV J cannot be too far from M ˚), we can show that U and V will always stay bounded. Now we are using positive step sizes ⌘t, so we no longer have the invariance of U JU ´ V JV . Nevertheless, by a careful analysis of the updates, we can still prove that U J t Ut ´ V J t Vt is small, the objective fpUt, Vtq decreases, and Ut and Vt stay bounded. Formally, we have the following lemma: Lemma 3.1. With high probability over the initialization pU0, V0q, for all t we have: 10This holds for any choice of element of the sub-differential, since φ1pxqx “ φpxq holds at x “ 0 for any choice of sub-differential. 11The dependency of ⌘t on t can be ⌘t “ ⇥ ´ t´p1{2`δq¯ for any constant δ P p0, 1{2s. 7 (i) Balancedness: ››U J t Ut ´ V J t Vt ›› F § ✏; (ii) Decreasing objective: fpUt, Vtq § fpUt´1, Vt´1q § ¨ ¨ ¨ § fpU0, V0q § 2 }M ˚}2 F ; (iii) Boundedness: }Ut}2 F § 5?r }M ˚}F , }Vt}2 F § 5?r }M ˚}F . Now that we know the GD algorithm automatically constrains pUt, Vtq in a bounded region, we can use the smoothness of f in this region and a standard analysis of GD to show that pUt, Vtq converges to a stationary point p ¯U, ¯V q of f (Lemma B.2). Furthermore, using the results of [Lee et al., 2016, Panageas and Piliouras, 2016] we know that p ¯U, ¯V q is almost surely not a strict saddle point. Then the following lemma implies that p ¯U, ¯V q has to be close to a global optimum since we know ›› ¯U J ¯U ´ ¯V J ¯V ›› F § ✏from Lemma 3.1 (i). This would complete the proof of Theorem 3.1. Lemma 3.2. Suppose pU, V q is a stationary point of f such that ››U JU ´ V JV ›› F § ✏. Then either ››UV J ´ M ˚›› F § ✏, or pU, V q is a strict saddle point of f. The full proof of Theorem 3.1 and the proofs of Lemmas 3.1 and 3.2 are given in Appendix B. 3.2 The Rank-1 Case We have shown in Theorem 3.1 that GD with small and diminishing step sizes converges to a global minimum for matrix factorization. Empirically, it is observed that a constant step size ⌘t ” ⌘is enough for GD to converge quickly to global minimum. Therefore, some natural questions are how to prove convergence of GD with a constant step size, how fast it converges, and how the discretization affects the invariance we derived in Section 2. While these questions remain challenging for the general rank-r matrix factorization, we resolve them for the case of r “ 1. Our main finding is that with constant step size, the norms of two layers are always within a constant factor of each other (although we may no longer have the stronger balancedness property as in Lemma 3.1), and we utilize this property to prove the linear convergence of GD to a global minimum. When r “ 1, the asymmetric matrix factorization problem and its GD dynamics become min uPRd1,vPRd2 1 2 ››uvJ ´ M ˚››2 F and ut`1 “ ut ´ ⌘putvJ t ´ M ˚qvt, vt`1 “ vt ´ ⌘ ` vtuJ t ´ M ˚J˘ ut. Here we assume M ˚ has rank 1, i.e., it can be factorized as M ˚ “ σ1u˚v˚J where u˚ and v˚ are unit vectors and σ1 ° 0. Our main theoretical result is the following. Theorem 3.2 (Approximate balancedness and linear convergence of GD for rank-1 matrix factorization). Suppose u0 „ Np0, δIq, v0 „ Np0, δIq with δ “ cinit a σ1 d (d “ maxtd1, d2u) for some sufficiently small constant cinit ° 0, and ⌘“ cstep σ1 for some sufficiently small constant cstep ° 0. Then with constant probability over the initialization, for all t we have c0 § |uJ t u˚| |vJ t v˚| § C0 for some universal constants c0, C0 ° 0. Furthermore, for any 0 † ✏† 1, after t “ O ` log d ✏ ˘ iterations, we have ››utvJ t ´ M ˚›› F § ✏σ1. Theorem 3.2 shows for ut and vt, their strengths in the signal space, ˇˇuJ t u˚ˇˇ and ˇˇvJ t v˚ˇˇ, are of the same order. This approximate balancedness helps us prove the linear convergence of GD. We refer readers to Appendix C for the proof of Theorem 3.2. 4 Empirical Verification We perform experiments to verify the auto-balancing properties of gradient descent in neural networks with ReLU activation. Our results below show that for GD with small step size and small 8 0 2000 4000 6000 8000 10000 Epochs 0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 Difference of the Squared Frobenius Norm Between 1st and 2nd Layer Between 2nd and 3rd Layer (a) Balanced initialization, squared norm differences. 0 2000 4000 6000 8000 10000 Epochs 0.992 0.994 0.996 0.998 1 1.002 1.004 1.006 Squared Frobenius Norm Ratios Between 1st and 2nd Layer Between 2nd and 3rd Layer (b) Balanced initialization, squared norm ratios. 0 2000 4000 6000 8000 10000 Epochs 0 2 4 6 8 10 Difference of the Squared Frobenius Norm Between 1st and 2nd Layer Between 2nd and 3rd Layer (c) Unbalanced Initialization, squared norm differences. 0 2000 4000 6000 8000 10000 Epochs 0 2 4 6 8 10 12 Squared Frobenius Norm Ratios Between 1st and 2nd Layer Between 2nd and 3rd Layer (d) Unbalanced initialization, squared norm ratios. Figure 2: Balancedness of a 3-layer neural network. initialization: (1) the difference between the squared Frobenius norms of any two layers remains small in all iterations, and (2) the ratio between the squared Frobenius norms of any two layers becomes close to 1. Notice that our theorems in Section 2 hold for gradient flow (step size Ñ 0) but in practice we can only choose a (small) positive step size, so we cannot hope the difference between the squared Frobenius norms to remain exactly the same but can only hope to observe that the differences remain small. We consider a 3-layer fully connected network of the form fpxq “ W3φpW2φpW1xqq where x P R1,000 is the input, W1 P R100ˆ1,000, W2 P R100ˆ100, W3 P R10ˆ100, and φp¨q is ReLU activation. We use 1,000 data points and the quadratic loss function, and run GD. We first test a balanced initialization: W1ri, js „ Np0, 10´4 100 q, W2ri, js „ Np0, 10´4 10 q and W3ri, js „ Np0, 10´4q, which ensures }W1}2 F « }W2}2 F « }W3}2 F . After 10,000 iterations we have }W1}2 F “ 42.90, }W2}2 F “ 43.76 and }W3}2 F “ 43.68. Figure 2a shows that in all iterations ˇˇ}W1}2 F ´ }W2}2 F ˇˇ and ˇˇ}W2}2 F ´ }W3}2 F ˇˇ are bounded by 0.14 which is much smaller than the magnitude of each }Wh}2 F . Figures 2b shows that the ratios between norms approach 1. We then test an unbalanced initialization: W1ri, js „ Np0, 10´4q, W2ri, js „ Np0, 10´4q and W3ri, js „ Np0, 10´4q. After 10,000 iterations we have }W1}2 F “ 55.50, }W2}2 F “ 45.65 and }W3}2 F “ 45.46. Figure 2c shows that ˇˇ}W1}2 F ´ }W2}2 F ˇˇ and ˇˇ}W2}2 F ´ }W3}2 F ˇˇ are bounded by 9 (and indeed change very little throughout the process), and Figures 2d shows that the ratios become close to 1 after about 1,000 iterations. 5 Conclusion and Future Work In this paper we take a step towards characterizing the invariance imposed by first order algorithms. We show that gradient flow automatically balances the magnitudes of all layers in a deep neural network with homogeneous activations. For the concrete model of asymmetric matrix factorization, we further use the balancedness property to show that gradient descent converges to global minimum. We believe our findings on the invariance in deep models could serve as a fundamental building block for understanding optimization in deep learning. Below we list some future directions. Other first-order methods. In this paper we focus on the invariance induced by gradient descent. In practice, different acceleration and adaptive methods are also used. A natural future direction is how to characterize the invariance properties of these algorithms. From gradient flow to gradient descent: a generic analysis? As discussed in Section 3, while strong invariance properties hold for gradient flow, in practice one uses gradient descent with positive step sizes and the invariance may only hold approximately because positive step sizes discretize the dynamics. We use specialized techniques for analyzing asymmetric matrix factorization. It would be very interesting to develop a generic approach to analyze the discretization. Recent findings on the connection between optimization and ordinary differential equations [Su et al., 2014, Zhang et al., 2018] might be useful for this purpose. 9 Acknowledgements We thank Phil Long for his helpful comments on an earlier draft of this paper. JDL acknowledges support from ARO W911NF-11-1-0303. References Pierre-Antoine Absil, Robert Mahony, and Benjamin Andrews. Convergence of the iterates of descent methods for analytic cost functions. SIAM Journal on Optimization, 16(2):531–547, 2005. Sanjeev Arora, Nadav Cohen, and Elad Hazan. On the optimization of deep networks: Implicit acceleration by overparameterization. arXiv preprint arXiv:1802.06509, 2018. Peter L Bartlett, David P Helmbold, and Philip M Long. Gradient descent with identity initialization efficiently learns positive definite linear transformations by deep residual networks. arXiv preprint arXiv:1802.06093, 2018. Alon Brutzkus and Amir Globerson. Globally optimal gradient descent for a convnet with gaussian inputs. arXiv preprint arXiv:1702.07966, 2017. Alon Brutzkus, Amir Globerson, Eran Malach, and Shai Shalev-Shwartz. Sgd learns overparameterized networks that provably generalize on linearly separable data. arXiv preprint arXiv:1710.10174, 2017. Anna Choromanska, Mikael Henaff, Michael Mathieu, G´erard Ben Arous, and Yann LeCun. The loss surfaces of multilayer networks. In Artificial Intelligence and Statistics, pages 192–204, 2015. Francis H Clarke, Yuri S Ledyaev, Ronald J Stern, and Peter R Wolenski. Nonsmooth analysis and control theory, volume 178. Springer Science & Business Media, 2008. Damek Davis, Dmitriy Drusvyatskiy, Sham Kakade, and Jason D Lee. Stochastic subgradient method converges on tame functions. arXiv preprint arXiv:1804.07795, 2018. Dmitriy Drusvyatskiy, Alexander D Ioffe, and Adrian S Lewis. Curves of descent. SIAM Journal on Control and Optimization, 53(1):114–138, 2015. Simon S Du and Jason D Lee. On the power of over-parametrization in neural networks with quadratic activation. arXiv preprint arXiv:1803.01206, 2018. Simon S Du, Jason D Lee, and Yuandong Tian. When is a convolutional filter easy to learn? arXiv preprint arXiv:1709.06129, 2017a. Simon S Du, Jason D Lee, Yuandong Tian, Barnabas Poczos, and Aarti Singh. Gradient descent learns one-hidden-layer cnn: Don’t be afraid of spurious local minima. arXiv preprint arXiv:1712.00779, 2017b. C Daniel Freeman and Joan Bruna. Topology and geometry of half-rectified network optimization. arXiv preprint arXiv:1611.01540, 2016. 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, 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, 2017a. Rong Ge, Jason D Lee, and Tengyu Ma. Learning one-hidden-layer neural networks with landscape design. arXiv preprint arXiv:1711.00501, 2017b. Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In Proceedings of the thirteenth international conference on artificial intelligence and statistics, pages 249–256, 2010. 10 Benjamin D Haeffele and Ren´e Vidal. Global optimality in tensor factorization, deep learning, and beyond. arXiv preprint arXiv:1506.07540, 2015. Moritz Hardt and Tengyu Ma. Identity matters in deep learning. arXiv preprint arXiv:1611.04231, 2016. 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. Kenji Kawaguchi. Deep learning without poor local minima. In Advances In Neural Information Processing Systems, pages 586–594, 2016. 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. Yuanzhi Li and Yang Yuan. Convergence analysis of two-layer neural networks with ReLU activation. arXiv preprint arXiv:1705.09886, 2017. Siyuan Ma, Raef Bassily, and Mikhail Belkin. The power of interpolation: Understanding the effectiveness of sgd in modern over-parametrized learning. arXiv preprint arXiv:1712.06559, 2017. Behnam Neyshabur, Ruslan R Salakhutdinov, and Nati Srebro. Path-SGD: Path-normalized optimization in deep neural networks. In Advances in Neural Information Processing Systems, pages 2422–2430, 2015a. Behnam Neyshabur, Ryota Tomioka, Ruslan Salakhutdinov, and Nathan Srebro. Data-dependent path normalization in neural networks. arXiv preprint arXiv:1511.06747, 2015b. Quynh Nguyen and Matthias Hein. The loss surface of deep and wide neural networks. arXiv preprint arXiv:1704.08045, 2017a. Quynh Nguyen and Matthias Hein. The loss surface and expressivity of deep convolutional neural networks. arXiv preprint arXiv:1710.10928, 2017b. Ioannis Panageas and Georgios Piliouras. Gradient descent only converges to minimizers: Nonisolated critical points and invariant regions. arXiv preprint arXiv:1605.00405, 2016. Itay Safran and Ohad Shamir. On the quality of the initial basin in overspecified neural networks. In International Conference on Machine Learning, pages 774–782, 2016. Itay Safran and Ohad Shamir. Spurious local minima are common in two-layer relu neural networks. arXiv preprint arXiv:1712.08968, 2017. O. Shamir. Are resnets provably better than linear predictors? arXiv preprint arXiv:1804.06739, 2018. Weijie Su, Stephen Boyd, and Emmanuel Candes. A differential equation for modeling nesterovs accelerated gradient method: Theory and insights. In Advances in Neural Information Processing Systems, pages 2510–2518, 2014. Yuandong Tian. An analytical formula of population gradient for two-layered ReLU network and its applications in convergence and critical point analysis. arXiv preprint arXiv:1703.00560, 2017. Stephen Tu, Ross Boczar, Max Simchowitz, Mahdi Soltanolkotabi, and Benjamin Recht. Low-rank solutions of linear matrix equations via procrustes flow. arXiv preprint arXiv:1507.03566, 2015. Rene Vidal, Joan Bruna, Raja Giryes, and Stefano Soatto. Mathematics of deep learning. arXiv preprint arXiv:1712.04741, 2017. Jingzhao Zhang, Aryan Mokhtari, Suvrit Sra, and Ali Jadbabaie. Direct runge-kutta discretization achieves acceleration. arXiv preprint arXiv:1805.00521, 2018. 11 Kai Zhong, Zhao Song, Prateek Jain, Peter L Bartlett, and Inderjit S Dhillon. Recovery guarantees for one-hidden-layer neural networks. arXiv preprint arXiv:1706.03175, 2017. Pan Zhou and Jiashi Feng. The landscape of deep learning algorithms. arXiv preprint arXiv:1705.07038, 2017. 12
2018
1004
7,249
Third-order Smoothness Helps: Faster Stochastic Optimization Algorithms for Finding Local Minima Yaodong Yu⇤ Department of Computer Science University of Virginia Charlottesville, VA 22904 yy8ms@virginia.edu Pan Xu⇤ Department of Computer Science University of California, Los Angeles Los Angeles, CA 90095 panxu@cs.ucla.edu Quanquan Gu Department of Computer Science University of California, Los Angeles Los Angeles, CA 90095 qgu@cs.ucla.edu Abstract We propose stochastic optimization algorithms that can find local minima faster than existing algorithms for nonconvex optimization problems, by exploiting the third-order smoothness to escape non-degenerate saddle points more efficiently. More specifically, the proposed algorithm only needs eO(✏−10/3) stochastic gradient evaluations to converge to an approximate local minimum x, which satisfies krf(x)k2 ✏and λmin(r2f(x)) ≥−p✏in unconstrained stochastic optimization, where eO(·) hides logarithm polynomial terms and constants. This improves upon the eO(✏−7/2) gradient complexity achieved by the state-of-the-art stochastic local minima finding algorithms by a factor of eO(✏−1/6). Experiments on two nonconvex optimization problems demonstrate the effectiveness of our algorithm and corroborate our theory. 1 Introduction We study the following unconstrained stochastic optimization problem min x2Rd f(x) = E⇠⇠D[F(x; ⇠)], (1.1) where F(x; ⇠) : Rd ! R is a stochastic function and ⇠is a random variable sampled from a fixed distribution D. In particular, we are interested in nonconvex optimization where the expected function f(x) is not convex. This kind of nonconvex optimization is ubiquitous in machine learning, especially deep learning [24]. Finding a global minimum of nonconvex problem (1.1) is generally NP hard [18]. Nevertheless, for many nonconvex optimization problems in machine learning, a local minimum is adequate and can be as good as a global minimum in terms of generalization performance, such as in deep learning [10, 13]. In this paper, we aim to design efficient stochastic optimization algorithms that can find an approximate local minimum of (1.1), i.e., an (✏, ✏H)-second-order stationary point x defined as follows krf(x)k2 ✏, and λmin " r2f(x) # ≥−✏H, (1.2) ⇤Equal contribution. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. where ✏, ✏H 2 (0, 1). Notably, when ✏H = pL2✏for Hessian Lipschitz f with parameter L2, (1.2) is equivalent to the definition of ✏-second-order stationary point [28]. Algorithms based on cubic regularized Newton’s method [28] and its variants [1, 7, 12, 23, 33, 31] have been proposed to find such approximate local minima. However, all of them need to solve the cubic problems exactly [28] or approximately [1, 7] in each iteration, which poses a rather heavy computational overhead. Another line of research employs the negative curvature direction to find the local minimum by combining accelerated gradient descent and negative curvature descent [8, 2], which yet becomes impractical in large scale and high dimensional machine learning problems due to the frequent computation of negative curvature in each iteration. To alleviate the computational burden of local minimum finding algorithms, there has emerged a fresh line of research [34, 5, 21] that tries to achieve the iteration complexity as the state-ofthe-art second-order methods, while only utilizing first-order oracles. The key observation is that first-order methods with noise injection [15, 20] are essentially an equivalent way to extract the negative curvature direction around saddle points [34, 5]. Together with the Stochastically Controlled Stochastic Gradient (SCSG) method [25], the aforementioned methods [34, 5] converge to an (✏, p✏)second-order stationary point (an approximate local minimum) within eO(✏−7/2) stochastic gradient evaluations, where eO(·) hides logarithm polynomial factors and constants. In this work, motivated by [9] which employed the third-order smoothness of f in deterministic nonconvex optimization to find a first-order stationary point, we explore the benefits of third-order smoothness in finding an approximate local minimum in the stochastic nonconvex optimization. In particular, we propose a stochastic optimization algorithm, named as FLASH, which only utilizes first-order oracles and finds the (✏, ✏H)-second-order stationary point within eO(✏−10/3) stochastic gradient evaluations. Note that our gradient complexity matches that of the state-of-the-art stochastic optimization algorithm SCSG [25] for finding first-order stationary points. At the core of our algorithm is an exploitation of the third-order smoothness of the objective function f which enables us to choose a larger step size in the negative curvature descent stage, and therefore leads to a faster convergence rate. The main contributions of our work are as follows • We show that the third-order smoothness of the nonconvex function can lead to a faster escape from saddle points in the stochastic optimization. We characterize, for the first time, the improvement brought by third-order smoothness in finding the approximate local minimum. • We propose an efficient stochastic algorithm for general stochastic objective functions and prove faster convergence rates for finding local minima. More specifically, for stochastic optimization, our algorithm converges to an approximate local minimum with only eO(✏−10/3) stochastic gradient evaluations. • In each outer iteration, our proposed algorithm only performs either one step of negative curvature descent, or an epoch of SCSG, which saves a lot of gradient and negative curvature computations compared with existing algorithms. Notation For a vector x = (x1, ..., xd)> 2 Rd, we denote the `q norm as kxkq = (Pd i=1 |xi|q)1/q for 0 < q < +1. For a matrix A = [Aij] 2 Rd⇥d, we use kAk2 and kAkF to denote the spectral and Frobenius norm. For a three-way tensor T 2 Rd⇥d⇥d and vector x 2 Rd, we denote their inner product as hT , x⌦3i. For a symmetric matrix A, let λmax(A) and λmin(A) be the maximum, minimum eigenvalues of matrix A. We use A ⌫0 to denote A is positive semidefinite. For two sequences {an} and {bn}, we denote an = O(bn) if an C bn for some constant C independent of n. The notation eO(·) hides logarithmic factors. Additionally, we denote an . bn (an & bn) if an is less than (larger than) bn up to a constant. 2 Related Work In this section, we discuss related work for finding approximate second-order stationary points in nonconvex optimization. In general, existing literature can be divided into the following three categories. Hessian-based: The pioneer work of [28] proposed the cubic regularized Newton’s method to find an (✏, ✏H)-second-order stationary point in O " max{✏−3/2, ✏−3 H } # iterations. Curtis et al. [12] showed that the trust-region Newton method can achieve the same iteration complexity as the cubic 2 regularization method. Recently, Kohler and Lucchi [23], Xu et al. [33] showed that by using subsampled Hessian matrix instead of the entire Hessian matrix in cubic regularization method and trust-region method, the iteration complexity can still match the original exact methods under certain conditions. Zhou et al. [36] improved the second-order oracle complexity (including gradient and Hessian evaluations) by proposing a variance-reduced Cubic regularization method. However, these methods need to compute the Hessian matrix and solve a very expensive subproblem either exactly or approximately in each iteration, which can be computationally intractable for high-dimensional problems. Hessian-vector product-based: Through different approaches, Carmon et al. [8] and Agarwal et al. [1] independently proposed algorithms that are able to find (✏, p✏)-second-order stationary points within eO(✏−7/4) full gradient and Hessian-vector product evaluations. By making an additional assumption of the third-order smoothness on the objective function and combining the negative curvature descent with the “convex until proven guilty” algorithm, Carmon et al. [9] proposed an algorithm that is able to find an (✏, p✏)-second-order stationary point within eO(✏−5/3) full gradient and Hessian-vector product evaluations.2 For nonconvex finite-sum optimization problems, Agarwal et al. [1] proposed an algorithm which is able to find approximate local minima within eO(n✏−3/2 +n3/4✏−7/4) stochastic gradient and stochastic Hessian-vector product evaluations, where n is the number of component functions. Reddi et al. [30] proposed an algorithm, which combines first-order and second-order methods to find approximate (✏, ✏H)-second-order stationary points, and requires eO " n2/3✏−2 + n✏−3 H + n3/4✏−7/2 H # stochastic gradient and stochastic Hessian-vector product evaluations. In the general stochastic optimization setting, Allen-Zhu [2] proposed an algorithm named Natasha2, which is based on variance reduction and negative curvature descent, and is able to find (✏, p✏)-second-order stationary points with at most eO(✏−7/2) stochastic gradient and stochastic Hessian-vector product evaluations. Tripuraneni et al. [31] proposed a stochastic cubic regularization algorithm to find (✏, p✏)-second-order stationary points and achieved the same runtime complexity as [2]. Gradient-based: For general nonconvex problems, Ghadimi and Lan [16] proposed a randomized stochastic gradient method and established the complexity of this method for finding a first-order stationary point. Levy [26], Jin et al. [20, 21] showed that it is possible to escape from saddle points and find local minima only using gradient evaluations plus random perturbation. The best-known runtime complexity of these methods is eO " ✏−7/4# when ✏H = p✏[21]. For nonconvex finite-sum problems, Allen-Zhu and Li [5] proposed a first-order negative curvature finding method called Neon2 and combined it with the stochastic variance reduced gradient (SVRG) method [22, 29, 3, 25], leading to an algorithm that finds (✏, ✏H)-second-order stationary points within eO " n2/3✏−2 + n✏−3 H + n3/4✏−7/2 H + n5/12✏−2✏−1/2 H # stochastic gradient evaluations. For nonconvex stochastic optimization problems, a variant of stochastic gradient descent (SGD) [15] is proved to find the (✏, p✏)-secondorder stationary point within O(✏−4poly(d)) stochastic gradient evaluations. More recently, Xu and Yang [34], Allen-Zhu and Li [5] turned the first-order stationary point finding method SCSG [25] into approximate local minima finding algorithms, which only involves stochastic gradient computation. The runtime complexity of these algorithms is eO(✏−10/3 + ✏−2✏−3 H ). In order to further save gradient and negative curvature computations, [35] considered the number of saddle points encountered in the algorithm and proposed the gradient descent with one-step escaping algorithm (GOSE) that saves negative curvature computation. However, none of the above algorithms explore the third-order smoothness of the nonconvex objective function. 3 Preliminaries In this section, we present definitions that will be used in our algorithm design and later theoretical analysis. Definition 3.1 (Smoothness). A differentiable function f is L1-smooth, if for any x, y 2 Rd: krf(x) −rf(y)k2 L1kx −yk2. 2As shown in [9], the second-order accuracy parameter ✏H can be set as ✏2/3 and the total runtime complexity remains the same, i.e., eO(✏−5/3). 3 Definition 3.2 (Hessian Lipschitz). A twice-differentiable function f is L2-Hessian Lipschitz, if for any x, y 2 Rd: kr2f(x) −r2f(y)k2 L2kx −yk2. Note that Hessian-Lipschitz is also referred to as the second-order smoothness. The above two smoothness conditions are widely used in nonconvex optimization problems [28]. In this paper, we will further explore the effectiveness of third-order derivative Lipschitz condition in nonconvex optimization. We use a three-way tensor r3f(x) 2 Rd⇥d⇥d to denote the third-order derivative of a function, which is formally defined below. Definition 3.3 (Third-order Derivative). The third-order derivative of function f: Rd ! R is a three-way tensor r3f(x) 2 Rd⇥d⇥d which is defined as [r3f(x)]ijk = @ @xi@xj@xk f(x), for i, j, k = 1, . . . , d and x 2 Rd. Next we introduce the definition of third-order smoothness for function f, which implies that the third-order derivative will not change rapidly. Definition 3.4 (Third-order Derivative Lipschitz). A thrice-differentiable function f has L3-Lipschitz third-order derivative, if for any x, y 2 Rd: kr3f(x) −r3f(y)kF L3kx −yk2. The above definition has been introduced in [6], and the third-order derivative Lipschitz is also referred to as third-order smoothness in [9]. One can also use another equivalent notion of third-order derivative Lipschitz condition used in [9]. Note that the third-order Lipschitz condition is critical in our algorithms and theoretical analysis in later sections. In the sequel, we will use third-order derivative Lipschitz and third-order smoothness interchangeably. Definition 3.5 (Optimal Gap). For a function f, we define the optimal gap ∆f at point x0 as f(x0) −inf x2Rd f(x) ∆f. Without loss of generality, we assume ∆f < +1. Definition 3.6 (Geometric Distribution). For a random integer X, define X has a geometric distribution with parameter p, denoted as Geom(p), if it satisfies that P(X = k) = pk(1 −p), 8k = 0, 1, . . . . Definition 3.7 (Sub-Gaussian Stochastic Gradient). For any x 2 Rd and random variable ⇠2 D, the stochastic gradient rF(x; ⇠) is sub-Gaussian with parameter σ if it satisfies E  exp ✓krF(x; ⇠) −rf(x)k2 2 σ2 ◆( exp(1). In addition, we introduce Tg to denote the time complexity of stochastic function value and gradient evaluation, i.e., (F(x; ⇠i), rF(x; ⇠i)) for ⇠i 2 D, and Th to denote the time complexity of stochastic Hessian-vector product evaluation, i.e., r2F(x; ⇠i)v for a given vector v and ⇠i 2 D. 4 Exploiting Third-order Smoothness In this section we will show how to employ the third-order smoothness of the objective function to make better use of the negative curvature direction for escaping saddle points. We first give an enlightening explanation on why third-order smoothness helps in general nonconvex optimization problems. Then we present our main algorithm which is able to utilize the third-order smoothness to take a larger step size for general stochastic optimization. In order to find local minima in nonconvex problems, different kinds of approaches have been explored to escape from saddle points. One of these approaches is to use negative curvature direction [27] to escape from saddle points, which has been explored in many existing studies [8, 11, 2]. 4 According to recent work by [34, 5], one can extract the negative curvature direction by only using stochastic gradient evaluations, which makes the negative curvature descent approach more appealing. We first consider a simple case to illustrate how to utilize the third-order smoothness when taking a negative curvature descent step. For nonconvex optimization problems, an ✏-first-order stationary point bx can be found by using first-order methods such as gradient descent. If bx is not an (✏, ✏H)second-order stationary point defined in (1.2), then there must exist a unit vector bv such that bv>r2f(bx) bv −✏H 2 . As studied in [8, 34, 5], one can take a negative curvature descent step along the direction of bv to escape from the saddle point bx, i.e., ey = argmin y2{u,w} f(y), u = bx −e↵bv, w = bx + e↵bv, (4.1) where e↵is the step size. Suppose the function f is L1-smooth and L2-Hessian Lipschitz, then the step size can be set as e↵= O(✏H/L2) and the negative curvature descent step (4.1) is guaranteed to attain the following function value decrease, f(ey) −f(bx) = −O ✓✏3 H L2 2 ◆ . (4.2) Inspired by the previous work [9], we aim to achieve more function value decrease than (4.2) by incorporating an additional assumption that the objective function has L3-Lipschitz third-order derivatives (third-order smoothness). More specifically, we adjust the negative curvature descent step in (4.1) as follows, by = argmin y2{u,w} f(y), u = bx −↵bv, w = bx + ↵bv, (4.3) where ↵= O( p ✏H/L3 ) is the adjusted step size which can be much larger than the step size e↵in (4.1) when ✏H is sufficiently small. The adjusted negative curvature descent step (4.3) is guaranteed to decrease the function value by a larger decrement, i.e., f(by) −f(bx) = −O ✓✏2 H L3 ◆ . (4.4) Compared with (4.2), the decrement in (4.4) can be substantially larger. In other words, if we make the additional assumption of the third-order smoothness, the negative curvature descent with larger step size will make more progress toward decreasing the function value. Note that [9] focuses on deterministic optimization, while our work is focused on the stochastic optimization. Here we need to carefully design our algorithm to improve the computational complexity in the stochastic setting. In the following, we will present an algorithm for stochastic nonconvex optimization which exploits the benefits of third-order smoothness to escape from saddle points . Recall the general stochastic optimization problem in (1.1). In this setting, one cannot have access to the full gradient or Hessian information. Instead, only stochastic gradient and stochastic Hessian-vector product evaluations are accessible. As a result, we have to employ stochastic optimization methods to calculate the negative curvature direction. There exist two kinds of methods to calculate the negative curvature direction bv for the general stochastic problem. The first kind is an online PCA method, i.e., Oja’s algorithm [4], which uses Hessian-vector product evaluations and can be seen as a stochastic variant of FastPCA [14]. Another method is the online version of the Neon algorithm, denote as Neon2online [5], which only requires stochastic gradient evaluations. By using either Oja’s algorithm or Neon2online, there exists an algorithm, denoted by ApproxNCStochastic, which uses stochastic gradient evaluations or stochastic Hessian-vector product evaluations to find the negative curvature direction for general stochastic nonconvex optimization problem (1.1). Specifically, ApproxNC-Stochastic returns a unit vector bv that satisfies bv>r2f(x) bv −✏H/2 provided λmin(r2f(x)) < −✏H, otherwise it will return bv = ?. Based on ApproxNC-Stochastic, we present our negative curvature descent algorithm in Algorithm 1. Note that the Rademacher random variable ⇣is an important feature in Algorithm 1. As we cannot access the full objective function value in stochastic setting, we use a Rademacher variable (⇣= −1 or ⇣= 1 with probability 1/2) in our algorithm to decide the direction of negative curvature descent step. 5 Algorithm 1 NCD3-Stochastic (f, x, {Li}3 i=1, δ, ✏H) 1: Set ↵= p 3✏H/L3 2: bv ApproxNC-Stochastic(f, x, L1, L2, δ, ✏H) 3: if bv 6= ? 4: generate a Rademacher random variable ⇣ 5: by x + ⇣↵bv 6: return by 7: else 8: return ? Therefore, with the step size ↵= O( p ✏H/L3) for the negative curvature descent step, Algorithm 1 can make greater progress in expectation when λmin(r2f(x)) < −✏H, and we summarize this property as follows. Lemma 4.1. Let f(x) = E⇠⇠D[F(x; ⇠)] and each stochastic function F(x; ⇠) is L1-smooth, L2Hessian Lipschitz continuous, and the third derivative of f(x) is L3-Lipschitz. Set ✏H 2 (0, 1) and step size as ↵= p 3✏H/L3. If the input x of Algorithm 1 satisfies λmin(r2f(x)) < −✏H, then with probability 1 −δ, Algorithm 1 will return by such that E⇣[f(x) −f(by)] ≥3✏2 H/8L3, where δ 2 (0, 1) and E⇣denotes the expectation over the Rademacher random variable ⇣. Furthermore, if we choose δ ✏H/(3✏H + 8L2), it holds that E[f(by) −f(x)] −✏2 H 8L3 , where E is over all randomness of the algorithm, and the total runtime is eO "" L2 1/✏2 H # Th # if ApproxNC-Stochastic adopts online Oja’s algorithm, and eO "" L2 1/✏2 H # Tg # if ApproxNC-Stochastic adopts Neon2online. 5 Fast Local Minima Finding Algorithm In this section, we present our main algorithm to find approximate local minima for nonconvex stochastic optimization problems, based on the negative curvature descent algorithms proposed in previous section. To find the local minimum, we use SCSG [25], which is the state-of-the-art stochastic optimization algorithm, to find a first-order stationary point and then apply Algorithm 1 to escape the saddle point using negative curvature direction. The proposed method is presented in Algorithm 2, We use a subsampled stochastic gradient rfS(x) in the outer loop (Line 4) of Algorithm 2, which is defined as rfS(x) = 1/|S| P i2S rF(x; ⇠i). As shown in Algorithm 2, we use subsampled gradient to check whether xk−1 is a first-order stationary point. Suppose the stochastic gradient rF(x; ⇠) satisfies the gradient sub-Gaussian condition (3.7) and the batch size |Sk| is large enough, then krf(xk−1)k2 > ✏/4 holds with high probability if krfSk(xk−1)k2 > ✏/2. Similarly, krf(xk−1)k2 ✏holds with high probability if krfSk(xk−1)k2 ✏/2. Note that each iteration of the outer loop in Algorithm 2 consists of two cases: (1) if the norm of subsampled gradient rfSk(xk−1) is small, then we run one subroutine NCD3-Stochastic, i.e., Algorithm 1; and (2) if the norm of rfSk(xk−1) is large, then we run one epoch of SCSG algorithm. This design can reduce the number of negative curvature calculations. There are two major differences between Algorithm 2 and existing algorithms in [34, 5]: (1) the step size of negative curvature descent step in Algorithm 2 is larger; and (2) the minibatch size in each epoch of SCSG in Algorithm 2 can be set to 1 instead of being related to the accuracy parameters ✏and ✏H, while the minibatch size in each epoch of SCSG in the existing algorithms [34, 5] has to depend on ✏and ✏H. Now we present the following theorem which spells out the runtime complexity of Algorithm 2. Theorem 5.1. Let f(x) = E⇠⇠D[F(x; ⇠)]. Suppose the third derivative of f(x) is L3-Lipschitz, and each stochastic function F(x; ⇠) is L1-smooth and L2-Hessian Lipschitz continuous. Suppose that the stochastic gradient rF(x; ⇠) satisfies the gradient sub-Gaussian condition with parameter 6 Algorithm 2 Fast Local minimA finding with third-order SmootHness (FLASH-Stochastic) 1: Input: f, x0, L1, L2, L3, δ, ✏, ✏H, b, K 2: Set B eO(σ2/✏2), ⌘= b2/3/(3L1B2/3) 3: for k = 1, 2, ..., K 4: uniformly sample a batch Sk ⇠D with |Sk| = B 5: gk rfSk(xk−1) 6: if kgkk2 > ✏/2 7: generate Tk ⇠Geom(B/(B + b)) 8: y(k) 0 xk−1 9: for t = 1, ..., Tk 10: randomly pick It ⇢D with |It| = b 11: ⌫(k) t−1 rfIt(y(k) t−1) −rfIt(y(k) 0 ) + gk 12: y(k) t y(k) t−1 −⌘⌫(k) t−1 13: end for 14: xk y(k) Tk 15: else 16: xk NCD3-Stochastic(f, xk−1, {Li}3 i=1, δ, ✏H) 17: if xk = ? 18: return xk−1 19: end for σ. Set batch size B = eO(σ2/✏2) and ✏H & ✏2/3. If Algorithm 2 adopts online Oja’s algorithm to compute the negative curvature, then Algorithm 2 finds an (✏, ✏H)-second-order stationary point with probability at least 1/3 in runtime eO ✓✓L1σ4/3∆f ✏10/3 + L3σ2∆f ✏2✏2 H ◆ Tg + ✓L2 1L3∆f ✏4 H ◆ Th ◆ . If Algorithm 2 adopts Neon2online, then it finds an (✏, ✏H)-second-order stationary point with probability at least 1/3 in runtime eO ✓✓L1σ4/3∆f ✏10/3 + L3σ2∆f ✏2✏2 H + L2 1L3∆f ✏4 H ◆ Tg ◆ . Remark 5.2. Although the runtime complexity in Theorem 5.1 holds with a constant probability, one can repeatedly run Algorithm 2 for at most log(1/δ) times to achieve a high probability result with probability at least 1 −δ. Remark 5.3. Theorem 5.1 suggests that the runtime complexity of Algorithm 2 is eO(✏−10/3 + ✏−2✏−2 H +✏−4 H ) to find an (✏, ✏H)-second-order stationary point. Compared with eO(✏−10/3 +✏−2✏−3 H + ✏−5 H ) runtime complexity achieved by the state-of-the-art [5], the runtime complexity of Algorithm 2 is improved upon the state-of-the-art in the second and third terms. If we set ✏H = p✏, the runtime of Algorithm 2 is eO(✏−10/3) and that of the state-of-the-art stochastic local minima finding algorithms [2, 31, 34, 5] becomes eO(✏−7/2), thus Algorithm 2 outperforms the state-of-the-art algorithms by a factor of eO(✏−1/6). Remark 5.4. Note that we can set ✏H to a smaller value, i.e., ✏H = ✏2/3, and the total runtime complexity of Algorithm 2 remains eO(✏−10/3). It is also worth noting that the runtime complexity of Algorithm 2 matches that of the state-of-the-art stochastic optimization algorithm (SCSG) [25] which only finds first-order stationary points but does not impose the third-order smoothness assumption. 6 Experiments In this section, we conduct numerical experiment on two nonconvex optimization problems, i.e., matrix sensing and deep autoencoder. All the experiments are carried on Amazon AWS p2.xlarge nodes with NVIDIA GK210 GPUs, and we use Pytorch 0.3.0 to implement all the algorithms. 7 Oracle Calls #104 0 2 4 6 8 10 12 Objective Function Value 0.2 0.4 0.6 0.8 1 1.2 SGD NSGD SGD-m SCSG Neon Neon2 FLASH (a) Matrix Sensing (d = 50) Oracle Calls #104 0 2 4 6 8 10 12 Objective Function Value 0.2 0.4 0.6 0.8 1 1.2 SGD NSGD SGD-m SCSG Neon Neon2 FLASH (b) Matrix Sensing (d = 100) Oracle Calls #104 0 2 4 Objective Function Value 0.2 0.4 0.6 0.8 1 1.2 2 = , 2 = 0.1, 2 = 0.01, 2 = 0.001, (c) Varying NC Step Size (d = 50) Oracle Calls #104 0 2 4 6 Objective Function Value 0.2 0.4 0.6 0.8 1 1.2 2 = , 2 = 0.1, 2 = 0.01, 2 = 0.001, (d) Varying NC Step Size, (d = 100) Oracle Calls #106 0 2 4 6 8 10 Training Loss 0 0.02 0.04 0.06 0.08 0.1 SGD NSGD SGD-m SCSG Neon Neon2 FLASH (e) AE-1, Training Oracle Calls #106 0 2 4 6 8 10 Test Loss 0 0.02 0.04 0.06 0.08 0.1 SGD NSGD SGD-m SCSG Neon Neon2 FLASH (f) AE-1, Test Oracle Calls #106 0 2 4 6 8 10 Training Loss 0 0.02 0.04 0.06 0.08 0.1 SGD NSGD SGD-m SCSG Neon Neon2 FLASH (g) AE-2, Training Oracle Calls #106 0 2 4 6 8 10 Test Loss 0 0.02 0.04 0.06 0.08 0.1 SGD NSGD SGD-m SCSG Neon Neon2 FLASH (h) AE-2, Test Figure 1: Numerical results for matrix sensing and deep autoencoder. (a)-(b) Convergence of different algorithms for matrix sensing: objective function value versus the number of oracle calls. (c)-(d) Different negative curvature step size comparison of FLASH for matrix sensing. (e)-(h) Convergence of different algorithms for two deep autoencoders: Training loss versus the number of oracle calls and test loss versus the number of oracle calls. Matrix Sensing We consider the symmetric matrix sensing problem, which is defined as: min U2Rd⇥r f(U) = 1 2m m X i=1 " hAi, UU>i −bi #2, (6.1) where the matrices {Ai}i=1,...,m are known sensing matrices, bi = hAi, M⇤i is the i-th observation, and M⇤= U⇤(U⇤)> is an unknown low-rank matrix, which needs to be recovered. For the data generation, we consider two matrix sensing problems: (1) d = 50, r = 3, and (2) d = 100, r = 3, then generate m = 20d sensing matrices A1, . . . , Am, where each element of the sensing matrix Ai follows i.i.d. standard normal distribution, and the unknown low-rank matrix M⇤as M⇤= U⇤(U⇤)>, where U⇤2 Rd⇥r is randomly generated, and thus bi = hAi, M⇤i. Next we randomly initialize a vector u0 2 Rd satisfying ku0k2 < λmax(M⇤) and set the initial input U0 as U0 = [u0, 0, . . . , 0]. Deep Autoencoder We also perform experiments of training a deep autoencoder on MNIST dataset [19]. The MNIST dataset contains images of handwritten digits, including 60, 000 training examples and 10, 000 test examples. Each image has 28 ⇥28 pixels. We consider two autoencoders: (1) a fully connected encoder with layers of size (28 ⇥28)-1024-512-256-32 and a symmetric decoder (AE-1) and (2) a fully connected encoder with layers of size (28 ⇥28)-1024-512-256-128-56-32 and a symmetric decoder (AE-2);. The code layer with 32 units are linear and we use softplus function as the activation function for other layers. We use mean squared error (MSE) as the loss function. We evaluate our algorithm FLASH-Stochastic (FLASH for short) together with the following stateof-the-art stochastic optimization algorithms for nonconvex problems: (1) stochastic gradient descent (SGD); (2) SGD with momentum (SGD-m); (3) noisy stochastic gradient descent (NSGD) [15]; (4) Stochastically Controlled Stochastic Gradient (SCSG) [25]; (5) NEgative-curvature-Originated-fromNoise (Neon) [34]; (6) NEgative-curvature-Originated-from-Noise 2 (Neon2) [5]. A fixed gradient mini-batch size of 100 is used for all the algorithms. We apply Oja’s algorithm with a Hessian mini-batch size of 100 to calculate the negative curvature in FLASH. We perform a grid search over step sizes for each method. For the negative curvature step size ↵, we choose ↵= O(✏H/L2 for Neon, Neon2 and ↵= O( p ✏H/L3) for our algorithm FLASH according to the corresponding theories, where ✏H = 0.001, and tune the constant parameter in the negative curvature step size by grid search. We report the objective function value versus oracle calls on matrix sensing and training loss versus oracle calls on matrix sensing and deep autoencoder. 8 The experimental results of the above two nonconvex problems are shown in Figure 1. For the matrix sensing problem, in Figure 1(a)-1(b), we observe that without adding noise or using second-order information, SGD, SGD-m and SCSG are not able to escape from saddle points. Our algorithm and NSGD, Neon, Neon2 can escape from saddle points, and our algorithm converges to the unknown matrix faster than NSGD, Neon, Neon2. As we can see from Figure 1(e)-1(h), for deep autoencoder, compared with SGD, SGD-m, NSGD, SCSG, Neon and Neon2, our algorithm escapes from saddle points faster and converges faster. Our algorithm outperforms Neon and Neon2 on both problems and validates our theoretical analysis that negative curvature step with a larger step size is helpful in stochastic nonconvex optimization problems. We also compare the convergence behavior of our algorithm with different step sizes for negative curvature descent. We first set initial step size ↵= 0.2 (for negative curvature descent) and then decrease the step size by a factor of 0.1 each time, while the other parameters remain the same. We can see from Figure 1(c) and 1(d) that our algorithm FLASH converges faster with larger step sizes for negative curvature descent, which validates our theories on third-order smoothness can be helpful in the nonconvex stochastic optimization. 7 Conclusions In this paper, we investigated the benefit of third-order smoothness of nonconvex objective functions in stochastic optimization. We illustrated that third-order smoothness can help faster escape saddle points, by proposing a new negative curvature descent algorithms with improved theoretical guarantee. Based on the proposed negative curvature descent algorithm, we further proposed a practical stochastic optimization algorithm with improved run time complexity that finds local minima for stochastic nonconvex optimization problems. Acknowledgements We would like to thank the anonymous reviewers for their helpful comments, and Yu Chen, Xuwang Yin for their helpful discussions on the experiments. This research was sponsored in part by the National Science Foundation IIS-1652539 and BIGDATA IIS-1855099. We also thank AWS for providing cloud computing credits associated with the NSF BIGDATA award. The views and conclusions contained in this paper are those of the authors and should not be interpreted as representing any funding agencies. References [1] Naman Agarwal, Zeyuan Allen-Zhu, Brian Bullins, Elad Hazan, and Tengyu Ma. Finding approximate local minima for nonconvex optimization in linear time. arXiv preprint arXiv:1611.01146, 2016. [2] Zeyuan Allen-Zhu. Natasha 2: Faster non-convex optimization than sgd. arXiv preprint arXiv:1708.08694, 2017. [3] Zeyuan Allen-Zhu and Elad Hazan. Variance reduction for faster non-convex optimization. In International Conference on Machine Learning, pages 699–707, 2016. [4] Zeyuan Allen-Zhu and Yuanzhi Li. Follow the compressed leader: Faster algorithms for matrix multiplicative weight updates. arXiv preprint arXiv:1701.01722, 2017. [5] Zeyuan Allen-Zhu and Yuanzhi Li. Neon2: Finding local minima via first-order oracles. arXiv preprint arXiv:1711.06673, 2017. [6] Animashree Anandkumar and Rong Ge. Efficient approaches for escaping higher order saddle points in non-convex optimization. In Conference on Learning Theory, pages 81–102, 2016. [7] Yair Carmon and John C Duchi. Gradient descent efficiently finds the cubic-regularized non-convex newton step. arXiv preprint arXiv:1612.00547, 2016. [8] Yair Carmon, John C Duchi, Oliver Hinder, and Aaron Sidford. Accelerated methods for non-convex optimization. arXiv preprint arXiv:1611.00756, 2016. 9 [9] Yair Carmon, Oliver Hinder, John C Duchi, and Aaron Sidford. " convex until proven guilty": Dimension-free acceleration of gradient descent on non-convex functions. arXiv preprint arXiv:1705.02766, 2017. [10] Anna Choromanska, Mikael Henaff, Michael Mathieu, Gérard Ben Arous, and Yann LeCun. The loss surfaces of multilayer networks. In Artificial Intelligence and Statistics, pages 192–204, 2015. [11] Frank E Curtis and Daniel P Robinson. Exploiting negative curvature in deterministic and stochastic optimization. arXiv preprint arXiv:1703.00412, 2017. [12] Frank E Curtis, Daniel P Robinson, and Mohammadreza Samadi. A trust region algorithm with a worst-case iteration complexity of\mathcal {O}(\epsilonˆ{-3/2}) for nonconvex optimization. Mathematical Programming, 162(1-2):1–32, 2017. [13] Yann N Dauphin, Razvan Pascanu, Caglar Gulcehre, Kyunghyun Cho, Surya Ganguli, and Yoshua Bengio. Identifying and attacking the saddle point problem in high-dimensional nonconvex optimization. In Advances in neural information processing systems, pages 2933–2941, 2014. [14] Dan Garber, Elad Hazan, Chi Jin, Cameron Musco, Praneeth Netrapalli, Aaron Sidford, et al. Faster eigenvector computation via shift-and-invert preconditioning. In International Conference on Machine Learning, pages 2626–2634, 2016. [15] Rong Ge, Furong Huang, Chi Jin, and Yang Yuan. Escaping from saddle points—online stochastic gradient for tensor decomposition. In Conference on Learning Theory, pages 797– 842, 2015. [16] Saeed Ghadimi and Guanghui Lan. Stochastic first-and zeroth-order methods for nonconvex stochastic programming. SIAM Journal on Optimization, 23(4):2341–2368, 2013. [17] Saeed Ghadimi, Guanghui Lan, and Hongchao Zhang. Mini-batch stochastic approximation methods for nonconvex stochastic composite optimization. Mathematical Programming, 155 (1-2):267–305, 2016. [18] Christopher J Hillar and Lek-Heng Lim. Most tensor problems are np-hard. Journal of the ACM (JACM), 60(6):45, 2013. [19] Geoffrey E Hinton and Ruslan R Salakhutdinov. Reducing the dimensionality of data with neural networks. science, 313(5786):504–507, 2006. [20] Chi Jin, Rong Ge, Praneeth Netrapalli, Sham M Kakade, and Michael I Jordan. How to escape saddle points efficiently. arXiv preprint arXiv:1703.00887, 2017. [21] Chi Jin, Praneeth Netrapalli, and Michael I Jordan. Accelerated gradient descent escapes saddle points faster than gradient descent. arXiv preprint arXiv:1711.10456, 2017. [22] Rie Johnson and Tong Zhang. Accelerating stochastic gradient descent using predictive variance reduction. In Advances in neural information processing systems, pages 315–323, 2013. [23] Jonas Moritz Kohler and Aurelien Lucchi. Sub-sampled cubic regularization for non-convex optimization. arXiv preprint arXiv:1705.05933, 2017. [24] Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, 521(7553):436–444, 2015. [25] Lihua Lei, Cheng Ju, Jianbo Chen, and Michael I Jordan. Nonconvex finite-sum optimization via scsg methods. arXiv preprint arXiv:1706.09156, 2017. [26] Kfir Y Levy. The power of normalization: Faster evasion of saddle points. arXiv preprint arXiv:1611.04831, 2016. [27] Jorge J Moré and Danny C Sorensen. On the use of directions of negative curvature in a modified newton method. Mathematical Programming, 16(1):1–20, 1979. 10 [28] Yurii Nesterov and Boris T Polyak. Cubic regularization of newton method and its global performance. Mathematical Programming, 108(1):177–205, 2006. [29] Sashank J Reddi, Ahmed Hefny, Suvrit Sra, Barnabas Poczos, and Alex Smola. Stochastic variance reduction for nonconvex optimization. In International conference on machine learning, pages 314–323, 2016. [30] Sashank J Reddi, Manzil Zaheer, Suvrit Sra, Barnabas Poczos, Francis Bach, Ruslan Salakhutdinov, and Alexander J Smola. A generic approach for escaping saddle points. arXiv preprint arXiv:1709.01434, 2017. [31] Nilesh Tripuraneni, Mitchell Stern, Chi Jin, Jeffrey Regier, and Michael I Jordan. Stochastic cubic regularization for fast nonconvex optimization. arXiv preprint arXiv:1711.02838, 2017. [32] Roman Vershynin. Introduction to the non-asymptotic analysis of random matrices. arXiv preprint arXiv:1011.3027, 2010. [33] Peng Xu, Farbod Roosta-Khorasani, and Michael W Mahoney. Newton-type methods for non-convex optimization under inexact hessian information. arXiv preprint arXiv:1708.07164, 2017. [34] Yi Xu and Tianbao Yang. First-order stochastic algorithms for escaping from saddle points in almost linear time. arXiv preprint arXiv:1711.01944, 2017. [35] Yaodong Yu, Difan Zou, and Quanquan Gu. Saving gradient and negative curvature computations: Finding local minima more efficiently. arXiv preprint arXiv:1712.03950, 2017. [36] Dongruo Zhou, Pan Xu, and Quanquan Gu. Stochastic variance-reduced cubic regularized Newton methods. In Proceedings of the 35th International Conference on Machine Learning, volume 80, pages 5990–5999, 10–15 Jul 2018. 11
2018
1005
7,250
Robot Learning in Homes: Improving Generalization and Reducing Dataset Bias Abhinav Gupta∗ Adithyavairavan Murali∗ Dhiraj Gandhi∗ Lerrel Pinto∗ The Robotics Institute Carnegie Mellon University Abstract Data-driven approaches to solving robotic tasks have gained a lot of traction in recent years. However, most existing policies are trained on large-scale datasets collected in curated lab settings. If we aim to deploy these models in unstructured visual environments like people’s homes, they will be unable to cope with the mismatch in data distribution. In such light, we present the first systematic effort in collecting a large dataset for robotic grasping in homes. First, to scale and parallelize data collection, we built a low cost mobile manipulator assembled for under 3K USD. Second, data collected using low cost robots suffer from noisy labels due to imperfect execution and calibration errors. To handle this, we develop a framework which factors out the noise as a latent variable. Our model is trained on 28K grasps collected in several houses under an array of different environmental conditions. We evaluate our models by physically executing grasps on a collection of novel objects in multiple unseen homes. The models trained with our home dataset showed a marked improvement of 43.7% over a baseline model trained with data collected in lab. Our architecture which explicitly models the latent noise in the dataset also performed 10% better than one that did not factor out the noise. We hope this effort inspires the robotics community to look outside the lab and embrace learning based approaches to handle inaccurate cheap robots. 1 Introduction Powered by the availability of cheaper robots, robust simulators and greater processing speeds, the last decade has witnessed the rise of data-driven approaches in robotics. Instead of using hand-designed models, these approaches focus on the collection of large-scale datasets to learn policies that map from high-dimensional observations to actions. Current data-driven approaches mostly focus on using simulators since it is considerably less expensive to collect simulated data than on an actual robot in real-time. The hope is that these approaches will either be robust enough to domain shifts or that the models can be adapted using a small amount of real world data via transfer learning. However, beyond simple robotic picking tasks [1, 2, 3], there exist little support to this level of optimism. One major reason for this is the wide “reality gap” between simulators and the real world. Therefore, there has concurrently been a push in the robotics community to collect real-world physical interaction data [4, 5, 6, 7, 8, 9, 10, 11] in multiple robotics labs. A major driving force behind this effort is the declining costs of hardware which allows scaling up data collection efforts for a variety of robotic tasks. This approach has indeed been quite successful at tasks such as grasping, pushing, poking and imitation learning. However, these learned models have often been shown to overfit (even after increasing the number of datapoints) and the performance of these robot learning methods tends ∗Equal contribution. Direct correspondence to: {abhinavg,amurali,dgandhi,lerrelp}@cs.cmu.edu 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. Grasp Policy View from Robot Camera (with detected objects) Execute Planar Grasp Figure 1: We built multiple low-cost robots and collected a large grasp dataset in several homes. to plateau fast. This leads us to an important question: why does robotic action data not lead to similar gains as we see in other prominent areas such as computer vision [12] and natural language processing [13]? The key to answering this question lies in the word: “real”. Many approaches claim that the data collected in the lab is real-world data. But is this really true? How often do we see white table-clothes or green backgrounds in real-world scenarios? In this paper, we argue that current robotic datasets lack the diversity of environments required for data-driven approaches to learn invariances. Therefore, the key lies in moving data collection efforts from a lab setting to real-world homes of people. We argue that learning based approaches in robotics need to move out of simulators and labs and enter the homes of people where the “real” data lives. There are however several challenges in moving the data collection efforts inside the home. First, even the cheapest industrial robots like the Sawyer or the Baxter are too expensive (>20K USD). In order to collect data in homes, we need a cheap and compact robot. But the challenge with low-cost robots is that the lack of accurate control makes the data unreliable. Furthermore, data collection in homes cannot receive 24/7 supervision by humans, which coupled with external factors will lead to more noise in the data collection. Finally, there is a chicken-egg problem for home-robotics: current robots are not good enough to collect data in homes; but to improve robots we need data in homes. In this paper, we propose to break this chicken-egg problem and present the first systematic effort in collecting a dataset inside the homes. Towards this goal: (a) we assemble a robot which costs less than 3K USD; (b) we use this robot to collect data inside 6 different homes for training and 3 homes for testing; (c) we present an approach that models and factors the noise in labeled data; (d) we demonstrate how data collected from these diverse home environment leads to superior performance and requires little-to-no domain adaptation. We hope this effort drives the robotics community to move out of the lab and use learning based approaches to handle inaccurate cheap robots. 2 Overview The goal of our paper is to highlight the importance of diversifying the data and environments for robot learning. We want to show that data collected from homes will be less biased and in turn allow for greater generalization. For the purposes of this paper, we focus on the task of grasping. Even for simple manipulation primitive tasks like grasping, current datasets suffer from strong biases such as simple backgrounds and the same environment dynamics (friction of tabletop etc.). We argue that current learning approaches exploit these biases and are not able to learn truly generalizable models. Of-course one important question is what kind of hardware should we use for collecting the largescale data inside the homes. We envision that since we would need to collect data from hundreds and thousands of homes; one of the prime-requirement for scaling is significantly reducing the cost of the robot. Towards this goal, we assembled a customized mobile manipulator as described below. 2 Hardware Setup: Our robot consists of a Dobot Magician robotic arm [14] mounted on a Kobuki mobile base [15]. The robotic arm came with four degrees of freedom (DOF) and we customized the last link with a two axis wrist. We also modified the original pneumatic gripper with a two-fingered electric gripper [16]. The resulting robotic arm has five DOFs - x, y, z, roll & pitch - with a payload capacity of 0.3kg. The arm is rigidly attached on top of the moving base. The Kobuki base is about 0.2m high with 4.5kg of payload capacity. An Intel R200 RGBD [17] camera was also mounted with a pan-tilt attachment at a height of 1m above the ground. All the processing for the robot is performed an on-board laptop [18] attached on the back. The laptop has intel core i5-8250U processor with 8GB of RAM and runs for around three hours on a single charge. The battery in the base is used to power both the base and the arm. With a single charge, the system can run for 1.5 hours. One unavoidable consequence of significant cost reduction is the inaccurate control due to cheap motors. Unlike expensive setups such as Sawyer or Baxter, our setup has higher calibration errors and lower accuracy due to in-accuracte kinematics and hardware execution errors. Therefore, unlike existing self-supervised datasets; our dataset is diverse and huge but the labels are noisy. For example, the robot might be trying to grasp at location x, y but to due to noise the execution is at (x + δx, y + δy). Therefore, the success/failure label corresponds to a different location. In order to tackle this challenge, we present an approach to learn from noisy data. Specifically, we model noise as a latent variable and use two networks: one which predicts the likely noise and other that predicts the action to execute. 3 Learning on Low Cost Robot Data We now present our method for learning a robotic grasping model given low-cost data. We first introduce the patch grasping framework presented in Pinto and Gupta [4]. Unlike the data collected in industrial/collaborative robots like the Sawyer and Baxter, there is a higher tendency for noisy labels in the datasets collected with cheap robots. This error in position control can be attributed to a myraid of factors: hardware execution error, inaccurate kinematics, camera calibration, proprioception, wear and tear, etc. We present an architecture to disentangle the noise of the low-cost robot’s actual and commanded executions. 3.1 Grasping Formulation Similar to [4], we are interested in the problem of planar grasping. This means that every object in the dataset is grasped at the same height (fixed cartesian z) and perpendicular to the ground (fixed end-effector pitch). The goal is find a grasp configuration (x, y, θ) given an observation I of the object. Here x and y are the translational degrees of freedom, while θ represents the rotational degrees of freedom (roll of the end-effector). Since our main baseline comparison is with the lab data collected in Pinto and Gupta [4], we follow a model architecture similar to theirs. Instead of directly predicting (x, y, θ) on the entire image I, several smaller patches IP centered at different locations (x, y) are sampled and the angle of grasp θ is predicted from this patch. The angle is discretized as θD into N bins to allow for multimodal predictions. For training, each datapoint consists of an image I, the executed grasp (x, y, θ) and the grasp success label g. This is converted to the image patch IP and the discrete angle θD. A binary cross entropy loss is then used to minimize the classification error between the predicted and ground truth label g. We use a Imagenet pre-trained convolutional neural network as initialization. 3.2 Modeling Noise as Latent Variable Unlike [4] where a relatively accurate industrial arm is used along with well calibrated cameras, our low-cost setup suffered from inaccurate position control and calibration. Though the executions are noisy, there is some structure in the noise which is dependent on both the design and individual robots. This means that the structure of noise can be modelled as a latent variable and decoupled during training [19]. Our approach is summarized in Fig 2. The conventional approach [4] models the grasp success probability for image patch IP at angle θD as P(g|IP , θD; R). Here R represents variables of the environment which can introduce noise in the system. In the case of standard commercial robots with high accuracy, R does not play a significant role. However, in the low cost setting with multiple robots collecting data in parallel, it becomes 3 ResNet18 Feature Robot Feature Robot information Scene image Fully Connected [512] Noise modelling network (NMN) ReLU Fully Connected [512] ReLU Fully Connected [9] SoftMax Patch Predictions [9] Image Patches [9X224X224X3] Pretrained ResNet18 [9X512] Fully Connected [9X512] ReLU Fully Connected [9X18] Fully Connected [512] ReLU Sigmoid Angle Predictions [9X18] Grasp prediction network (GPN) Marginalize [18] Grasp angle probabilities conv1 96@ (55X55) Image patch (227X227) conv2 256@ (27X27) conv3 384@ (13X13) conv4 384@ (13X13) conv5 256@ (13X13) fc6 (4096) AlexNet Pretrained Parameters Learnt Parameters ang1 (2) ang5 (2) ang12 (2) ang18 (2) fc7 (1024) Figure 2: Our architecture consists of three components - a) the Grasp Prediction Network (GPN) which infers grasp angles based on the image patch of the object b) the Noise Modelling Network (NMN) which estimates the latent noise given the image of the scene and robot information and the c) marginalization layer computing the final grasp angles. an important consideration for learning. For instance, given an observed execution of patch IP , the actual execution could have been at a neighbouring patch. Here, z models the latent variable of the actual patch executed, and c IP belongs to a set of possible hypothesis neighbouring patches P. We considered a total of nine patches centered around IP , as explained in Fig 2. The conditional probability of grasping at a noisy image patch IP can hence be computed by marginalizing over z: P(g|IP , θD, R) = X c IP ∈P P(g|z = c IP , θD, R) · P(z = c IP |θD, IP , R) (1) Here P(z = c IP |θD, IP , R) represents the noise which is dependent on the environment variables R, while P(g|z = c IP , θD, R) represents the grasp prediction probability given the true patch. The first part of the equation is implemented as a standard grasp network, which we refer to as the Grasp Prediction Network (GPN). Specifically, we feed in nine possible patches and obtain their respective success probability distribution. The second probability distribution over noise is modeled via a separate network, which we call Noise Modelling Network (NMN). The overall grasp model Robust-Grasp is defined by GPN ⊗NMN, where ⊗is the marginalization operator. 3.3 Learning the latent noise model Thus far, we have presented our Robust-Grasp architecture which models the true grasping distribution and latent noise. What should be the inputs to the NMN network and how should it be trained? We assume that z is conditionally independent of the local patch-specific variables (θD, IP ) given the global information R, i.e P(z = c IP |θD, IP , R) ≡P(z = c IP |R). Apart from the patch IP and grasp information (x, y, θ), other auxiliary information such as the image of the entire scene, ID of the specific robot that collected a datapoint and the raw pixels location of the grasp are stored. The image of the whole scene might contain essential cues about the system, such as the relative location of camera to the ground which may change over the lifetime of the robot. The identification number of the robot might give cues about errors specific to a particular hardware. Finally, the raw pixels of execution contain calibration specific information, since calibration error is coupled with pixel location, since we do least squares fit to compute calibration parameters. It is important to emphasize that we do not have explicit labels to train NMN. Since we have to estimate the latent variable z, one could use Expectation Maximization (EM) [20]. But inspired from Misra et al. [19], we use direct optimization to jointly learn both NMN and GPN with the noisy labels from our dataset. The entire image of the scene along with the environment information is passed into NMN. This outputs a probability distribution over the patches where the grasps might have 4 Test Homes Train Homes Figure 3: Homes used for collecting training data and environments where models were tested been executed. Finally, we apply the binary cross entropy loss on the overall marginalized output GPN⊗NMN and the true grasp label g. 3.4 Training details We used PyTorch [21] to implement our models. Instead of learning the visual representations from scratch, we finetune on a pretrained ResNet-18 [22] model. For the noise modelling network (NMN), we concatenate the 512 dimensional ResNet feature with a one-hot vector of the robot’s ID and the raw pixel location of the grasp. This passes through a series of three fully connected layers and a SoftMax layer to convert the correct patch predictions to a probability distribution. For the grasp prediction network (GPN), we extract nine candidate correct patches to input. One of these inputs is the original noisy patch, while the others are equidistant from the original patch. The angle predictions for all the patches are passed through a sigmoid activation at the end to obtain grasp success probability for a specific patch at a specific angle. We train our network in two stages. First, we only train GPN using the noisy patch which allows it to learn a good initialization for grasp prediction and in turn provide better gradients to NMN. This training is done over five epochs of the data. In the second stage, we add the NMN and marginalization operator to simultaneously train NMN and GPN in an end-to-end fashion. This is done over 25 epochs of the data. We note that this two-stage approach is crucial for effective training of our networks, without which NMN trivially selects the same patch irrespective of the input. The optimizer used for training is Adam [23]. 4 Results In our experimental evaluation, we demonstrate that collecting data in diverse households is crucial for our learned models to generalize to unseen home environments. Furthermore, we also show that modelling the error of low cost robots in our Robust-Grasp architecture significantly improves grasping performance. We here onwards refer to our robot as the Low Cost Arm (LCA). Data Collection: First, we describe our methodology for collecting grasp data. We collected a diverse set (see Fig 3) of planar grasping in six homes. Each home has several environments and the data was collected in parallel using multiple robots. Since we are collecting data in homes which have very unstructured visual input, we used an object detector (specifically tiny-YOLO, due to compute and memory constraints on LCA) [24]. This results in bounding box predictions for the objects amidst clutter and diverse backgrounds, of which we only use the 2D location and discard the object class information. Once we have the location of the object in image space, we first sample a grasp and then compute the 3D grasp location from the noisy PointCloud. The motion planning pipeline is carefully designed since our under-constrained robot only has 5 DOFs. When collecting training data, we scattered a diverse set of objects and let the mobile base randomly move and grasp objects. The 5 base was constrained to a 2m wide area to prevent the robot from colliding with obstacles beyond its zone of operation. We collected a dataset of about 28K grasps. Quantitative Evaluation: For quantitative evaluation, we use three different test settings: • Binary Classification (Held-out Data): For our first test, we collect a held-out test set by performing random grasps on objects. We measure the performance of binary classification where given a location and grasp angle; the model has to predict whether the grasp would be successful or not. This methodology allows us evaluate a large number models without needing to run them on a real robot. For our experiments, we use three different environments/set-ups for held-out data. We collected two held-out datasets using LCA in lab and LCA in home environments. Our third dataset is publicly available Baxter robot data [4]. • Real Low Cost Arm (Real-LCA): We evaluated the physical grasping performance of our learned models on the low cost arm in this setting. For testing, we used 20 novel objects in four canonical orientations in three homes not seen in training. Since both the homes and the objects are not seen in training, this metric tests the generalization of our learned model. • Real Sawyer (Real-Sawyer): In the third metric, we measure the physical grasping performance of our learned models on an industrial robotic arm (Sawyer). Similar to the Real-LCA metric, we grasp 20 novel objects in four canonical orientations in our lab environment. The goal of this experiment is to show that training models with data collected in homes also improves task performance in curated environments like the lab. Since the Sawyer is a more accurate and better calibrated, we evaluate our Robust-Grasp model against the model which does not disentangle the noise in the data. Baselines: Next we describe the baselines used in our experiments. Since we want to evaluate the performance of both the home robot dataset (Home-LCA) and the Robust-Grasp architecture, we used baselines for both the data and model. We used two datasets for the baseline: grasp data collected by [4] (Lab-Baxter) as well as data collected with our low cost arms in a single environment (Lab-LCA). To benchmark our Robust-Grasp model, we compared to the noise independent patch grasping model [4], which we call Patch-Grasp. We also compared our data and model with DexNet-3.0 from Mahler et al. [25] (DexNet) for a strong real-world grasping baseline. 4.1 Experiment 1: Performance on held-out data To demonstrate the importance of learning from home data, we train a Robust-Grasp model on both the Lab-Baxter and Lab-LCA dataset and compare it to the model trained with the Home-LCA dataset. As shown in Table 1, models trained on only lab data overfit to their respective environments and do not generalize to the more challenging Home-LCA environment, corresponding to a lower binary classification accuracy score. On the other hand, the model trained on Home-LCA perform well on both home and curated lab environments. Table 1: Results of binary classification on different test sets Model Train Dataset Test Accuracy (%) Lab-Baxter Lab-LCA Home-LCA Patch-Grasp [4] Lab-Baxter [4] 76.9 55.1 54.3 Patch-Grasp Lab-LCA 58.0 69.1 56.5 Patch-Grasp Home-LCA 71.5 71.3 69.9 Robust-Grasp Lab-LCA 55.0 71.2 56.1 Fine-tuned Lab-LCA, Home-LCA 74.6 52.1 59.7 Robot-ID Conditioned Home-LCA 73.5 71.1 70.6 Robust-Grasp (Ours) Home-LCA (Ours) 75.2 71.1 73.0 To illustrate the importance of collecting a large Home-LCA dataset, we compare to a common domain adaptation baseline: fine-tuning the model learned on Lab-LCA with 5K home grasps (‘Fine-tuned’ in Table 1). We notice that this is significantly worse than the model trained with just home data from scratch. Our hypothesis is that the feature representation learned from Lab data is insufficient to capture the richer variety present in Home Data. 6 Further, to demonstrate the importance of the NMN for noise modelling, we compare to a baseline model without NMN and feed the robot_id to the grasp prediction network directly (‘Robot-ID Conditioned’ in Table 1), similar to Hardware Conditioned Policies [26]. This baseline gives competitive results while testing on Lab-LCA and Lab-Baxter datasets, however it did not fare as well as Robust-Grasp. This demonstrates the importance of NMN and sharing data across different LCAs. 4.2 Experiment 2: Performance on Real LCA Robot In Real-LCA, our most challenging evaluation, we compare our model against a pre-trained DexNet baseline model and the model trained on the Lab-Baxter dataset. The models were benchmarked based on the physical grasping performance on novel objects in unseen environments. We observe a significant improvement of 43.7% (see Table 2) when training on the Home-LCA dataset over the Lab-Baxter dataset. Moreover, our model is also 33% better than DexNet, though the latter has achieved state-of-the-art results in the bin-picking task [25]. The relatively low performance of DexNet in these environments can be attributed to the high quality depth sensing it requires. Since our robots are tested in homes which typically have a lot of natural light, the depth images are quite noisy. This effect is further coupled with the cheap commodity RGBD cameras that we use on our robot. We used the Robust-Grasp model to train on the Home-LCA dataset. Table 2: Results of grasp performance in novel homes (Real-LCA) Environment Model Home-LCA (Ours) Lab-Baxter [4] DexNet [25] 1 58.75 31.25 38.75 2 57.5 11.25 26.25 3 70.0 12.50 21.25 Overall 62.08 18.33 28.75 4.3 Does factoring out the noise in data improve performance? To evaluate the performance of our Robust-Grasp model vis-à-vis the Patch-Grasp model, we would ideally need a noise-free dataset for fair comparisons. Since it is difficult to collect noise-free data on our home robots, we use Lab-Baxter for benchmarking. The Baxter robot is more accurate and better calibrated than the LCA robot and thus has less noisy labels. Testing is done on the Sawyer robot to ensure the testing robot is different from both training robots. Results for the Real-Sawyer are reported in Table 3. On this metric, our Robust-Grasp model trained on Home-LCA achieves 77.5% grasping accuracy. This is a significant improvement over the 56.25% grasping accuracy of the Patch-Grasp baseline trained on the same dataset. We also note that our grasp accuracy is similar to the performance reported (around 80%) in several recent learning to grasp papers [7]. However unlike these methods, we train in a completely different environment (homes) and test in the lab. The improvements of the Robust-Grasp model is also demonstrated with the binary classification metric in Table 1, where it outperforms the Patch-Grasp by about 4% on the Lab-Baxter and Home-LCA datasets. Moreover, our visualizations of predicted noise corrections in Fig 4, show that the corrections depend on both the pixel locations of the noisy grasp and the specific robot. Table 3: Results of grasp performance in lab on the Sawyer robot (Real-Sawyer) Robust-Grasp (Home-LCA) Patch-Grasp (Home-LCA) Patch-Grasp (Lab-Baxter) 77.50 (Ours) 56.25 1.25 5 Related Work 5.1 Large scale robot learning Over the last few year there has been a growing interest in scaling up robot learning with large scale robot datasets. The Cornell Grasp Dataset [27] was among the first works that released a hand annotated grasping dataset. Following this, Pinto and Gupta [4] created a self-supervized grasping dataset in which a Baxter robot collected and self-annotated the data. Levine et al. [7] took the next 7 Robot #1 Robot #2 Robot #3 Robot #4 Figure 4: We visualize the predicted corrections made by the Noise Modelling Network (NMN). The arrows indicate the NMN learned direction of correction for noisy patches uniformly sampled in the image for multiple robots. This demonstrates that the NMN outputs are both, dependent on the raw pixel location of the noisy grasp and, dependent on the robot ID. step in robotic data collection by employing an Arm-Farm of several industrial manipulators to learn grasping using reinforcement learning. All of these works, use data in a restrictive lab environment using high-cost data labelling mechanisms. In our work, we show how low-cost data in a variety of homes can be used to train grasping models. Apart from grasping, there has also been a significant effort is collecting data for other robotic tasks. Agarwal et al. [8], Finn et al. [9], and Pinto and Gupta [28] collected data of a manipulator pushing objects on a table. Similarly, Nair et al. [10] collects data for manipulating a rope on a table while Yahya et al. [29] used several robots in parallel to train a policy to open a door. Erickson et al. [30], Murali et al. [31], and Calandra et al. [32] collected a dataset of robotic tactile interactions for material recognition and grasp stability estimation. Again, all of this data is collected in a lab environment. We also note several pioneering work in lifelong robotics like Veloso et al. [33], Hawes et al. [34]. In contrast to our work, they focus on navigation and long-term autonomy. 5.2 Grasping Grasping is one of the fundamental problems in robotic manipulation and we refer readers to recent surveys Bicchi and Kumar [35], Bohg et al. [36] for a comprehensive review. Classical approaches focused on physics-based analysis of stability [37] and usually require explicit 3D models of the objects. Recent papers have focused on data-driven approaches that directly learn a mapping from visual observations to grasp control [27, 4, 7]. For large-scale data collection both simulation [25, 38, 39, 40] and real-world robots [4, 7] have been used. Mahler et al. [25] propose a versatile grasping model, that achieves 90% grasping performance in the lab for the bin-picking task. However since this method uses depth as input, we demonstrate that it is challenging to use it for home robots which may not have accurate depth sensing in these environments. 5.3 Learning with low cost robots Given that most labs run experiments with standard collaborative or industrial robots, there is very limited research on learning on low cost robots and manipulators. Deisenroth et al. [41] used model-based RL to teach a cheap inaccurate 6 DOF robot to stack multiple blocks. Though mobile robots like iRobot’s Roomba have been in the home consumer electronics market for a decade, it is not clear whether they use learning approaches alongside mapping and planning. 5.4 Modelling noise in data Learning from noisy inputs is a challenging problem that has received significant attention in computer vision. Nettleton et al. [42] show that training models from noisy data detrimentally impacts performance. However, as the work in Frénay and Verleysen [43] points out, the noise can be either independent of the environment or statistically dependent on the environment. This means that creating models that can account for and correct noise [19, 44] are valuable. Inspired from Misra et al. [19], we present a model that disentangles the noise in the training grasping data to learn a better grasping model. 8 6 Conclusion In summary, we present the first effort in collecting large scale robot data inside diverse environments like people’s homes. We first assemble a mobile manipulator which costs under 3K USD and collect a dataset of about 28K grasps in six homes under varying environmental conditions. Collecting data with cheap inaccurate robots introduces the challenge of noisy labels and we present an architectural framework which factors out the noise in the data. We demonstrate that it is crucial to train models with data collected in households if the goal is to eventually test them in homes. To evaluate our models, we physically tested them by grasping a set of 20 novel objects in lab and in three unseen home environments from Airbnb. The model trained with our home dataset showed a 43.7% improvement over a model trained with data collected in the lab. Furthermore, our framework performed 33% better than a baseline DexNet model, which struggled with the typically poor depth sensing in common household environments with a lot of natural light. We also demonstrate that our model improves grasp performance in curated environments like the lab. Our model was also able to successfully disentangle the structured noise in the data and improved performance by about 10%. ACKNOWLEDGEMENTS This work was supported by ONR MURI N000141612007. Abhinav was supported in part by Sloan Research Fellowship and Adithya was partly supported by a Uber Fellowship. References [1] Josh Tobin, Rachel Fong, Alex Ray, Jonas Schneider, Wojciech Zaremba, and Pieter Abbeel. Domain randomization for transferring deep neural networks from simulation to the real world. 2017. URL https://arxiv.org/abs/1703.06907. [2] Xue Bin Peng, Marcin Andrychowicz, Wojciech Zaremba, and Pieter Abbeel. Sim-to-real transfer of robotic control with dynamics randomization. arXiv preprint arXiv:1710.06537, 2017. [3] Lerrel Pinto, Marcin Andrychowicz, Peter Welinder, Wojciech Zaremba, and Pieter Abbeel. Asymmetric actor critic for image-based robot learning. Robotics Science and Systems, 2018. [4] Lerrel Pinto and Abhinav Gupta. Supersizing self-supervision: Learning to grasp from 50k tries and 700 robot hours. CoRR, abs/1509.06825, 2015. URL http://arxiv.org/abs/1509. 06825. [5] Adithyavairavan Murali, Lerrel Pinto, Dhiraj Gandhi, and Abhinav Gupta. CASSL: Curriculum accelerated self-supervised learning. International Conference on Robotics and Automation, 2018. [6] Sergey Levine, Chelsea Finn, Trevor Darrell, and Pieter Abbeel. End-to-end training of deep visuomotor policies. The Journal of Machine Learning Research, 17(1):1334–1373, 2016. [7] Sergey Levine, Peter Pastor, Alex Krizhevsky, and Deirdre Quillen. Learning hand-eye coordination for robotic grasping with deep learning and large-scale data collection. CoRR, abs/1603.02199, 2016. URL http://arxiv.org/abs/1603.02199. [8] Pulkit Agarwal, Ashwin Nair, Pieter Abbeel, Jitendra Malik, and Sergey Levine. Learning to poke by poking: Experiential learning of intuitive physics. 2016. URL http://arxiv.org/ abs/1606.07419. [9] Chelsea Finn, Ian Goodfellow, and Sergey Levine. Unsupervised learning for physical interaction through video prediction. In Advances in neural information processing systems, 2016. [10] Ashvin Nair, Dian Chen, Pulkit Agrawal, Phillip Isola, Pieter Abbeel, Jitendra Malik, and Sergey Levine. Combining self-supervised learning and imitation for vision-based rope manipulation. International Conference on Robotics and Automation, 2017. [11] Pratyusha Sharma, Lekha Mohan, Lerrel Pinto, and Abhinav Gupta. Multiple interactions made easy (mime): Large scale demonstrations data for imitation. arXiv preprint arXiv:1810.07121, 2018. 9 [12] Chen Sun, Abhinav Shrivastava, Saurabh Singh, and Abhinav Gupta. Revisiting unreasonable effectiveness of data in deep learning era. ICCV, 2017. [13] George Dahl, Dong Yu, Li Deng, and Alex Acero. Context dependent pre-trained deep neural networks for large vocabulary speech recognition. IEEE Transactions on Audio, Speech, and Language Processing, 2010. [14] Dobot Magician. https://www.dobot.cc/dobot-magician/specification.html. [15] Kobuki Base. http://kobuki.yujinrobot.com/about2/. [16] Makerblock Gripper. http://store.makeblock.com/robot-gripper. [17] Leonid Keselman, John Iselin Woodfill, Anders Grunnet-Jepsen, and Achintya Bhowmik. Intel realsense stereoscopic depth cameras. arXiv preprint arXiv:1705.05548, 2017. [18] On Board Computer. https://www.acer.com/ac/en/US/content/model/NX.GTSAA. 005. [19] Ishan Misra, Lawrence Zitnick, Margaret Mitchell, and Ross Girshick. Seeing through the human reporting bias:visual classifiers from noisy human-centric labels. CVPR, 2016. [20] 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. Series B (methodological), pages 1–38, 1977. [21] Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in pytorch. 2017. [22] 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. [23] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. [24] Joseph Redmon and Ali Farhadi. Yolo9000: Better, faster, stronger. arXiv preprint arXiv:1612.08242, 2016. [25] Jeffrey Mahler, Jacky Liang, Sherdil Niyaz, Michael Laskey, Richard Doan, Xinyu Liu, Juan Aparicio Ojea, and Ken Goldberg. Dex-net 2.0: Deep learning to plan robust grasps with synthetic point clouds and analytic grasp metrics. RSS, 2017. [26] Tao Chen, Adithyavairavan Murali, and Abhinav Gupta. Hardware conditioned policies for multi-robot transfer learning. Nueral Information Processing Systems, 2018. URL https: //arxiv.org/abs/1811.09864. [27] Ian Lenz, Honglak Lee, and Ashutosh Saxena. Deep learning for detecting robotic grasps. IJRR, 2015. [28] Lerrel Pinto and Abhinav Gupta. Learning to push by grasping: Using multiple tasks for effective learning. International Conference on Robotics and Automation, 2017. [29] Ali Yahya, Adrian Li, Mrinal Kalakrishnan, Yevgen Chebotar, and Sergey Levine. Collective robot reinforcement learning with distributed asynchronous guided policy search. IROS, 2017. [30] Zackory Erickson, Sonia Chernova, and Charles C Kemp. Semi-supervised haptic material recognition for robots using generative adversarial networks. Conference on Robot Learning, 2017. [31] Adithyavairavan Murali, Yin Li, Dhiraj Gandhi, and Abhinav Gupta. Learning to grasp without seeing. International Symposium on Experimental Robotics, 2018. 10 [32] Roberto Calandra, Andrew Owens, Manu Upadhyaya, Wenzhen Yuan, Justin Lin, Edward Adelson, and Sergey Levine. The feeling of success: Does touch sensing help predict grasp outcomes? Conference on Robot Learning, 2017. [33] Manuela Veloso, Joydeep Biswas, Brian Coltin, Stephanie Rosenthal, Tom Kollar, Cetin Mericli, Mehdi Samadi, Susana Brandao, and Rodrigo Ventura. Cobots: Collaborative robots servicing multi-floor buildings. In Intelligent Robots and Systems (IROS), 2012 IEEE/RSJ International Conference on, pages 5446–5447. IEEE, 2012. [34] Nick Hawes, Christopher Burbridge, Ferdian Jovan, Lars Kunze, Bruno Lacerda, Lenka Mudrova, Jay Young, Jeremy Wyatt, Denise Hebesberger, Tobias Kortner, et al. The strands project: Long-term autonomy in everyday environments. IEEE Robotics & Automation Magazine, 24 (3):146–156, 2017. [35] Antonio Bicchi and Vijay Kumar. Robotic grasping and contact: a review. In International Conference on Robotics and Automation, 2000. [36] Jeannette Bohg, Antonio Morales, Tamim Asfour, and Danica Kragic. Data-driven grasp synthesis—a survey. IEEE Transactions on Robotics, 2014. [37] Van-Duc Nguyen. Constructing force-closure grasps. The International Journal of Robotics Research, 7(3):3–16, 1988. [38] Jeffrey Mahler, Florian T Pokorny, Brian Hou, Melrose Roderick, Michael Laskey, Mathieu Aubry, Kai Kohlhoff, Torsten Kröger, James Kuffner, and Ken Goldberg. Dex-net 1.0: A cloudbased network of 3d objects for robust grasp planning using a multi-armed bandit model with correlated rewards. In Robotics and Automation (ICRA), 2016 IEEE International Conference on, pages 1957–1964. IEEE, 2016. [39] Konstantinos Bousmalis, Alex Irpan, Paul Wohlhart, Yunfei Bai, Matthew Kelcey, Mrinal Kalakrishnan, Laura Downs, Julian Ibarz, Peter Pastor, Kurt Konolige, et al. Using simulation and domain adaptation to improve efficiency of deep robotic grasping. In 2018 IEEE International Conference on Robotics and Automation (ICRA), pages 4243–4250. IEEE, 2018. [40] Kuan Fang, Yunfei Bai, Stefan Hinterstoisser, Silvio Savarese, and Mrinal Kalakrishnan. Multitask domain adaptation for deep learning of instance grasping from simulation. In 2018 IEEE International Conference on Robotics and Automation (ICRA), pages 3516–3523. IEEE, 2018. [41] Marc Peter Deisenroth, Carl Edward Rasmussen, and Dieter Fox. Learning to control a low-cost manipulator using data-efficient reinforcement learning. RSS, 2011. [42] David F Nettleton, Albert Orriols-Puig, and Albert Fornells. A study of the effect of different types of noise on the precision of supervised learning techniques. Artificial intelligence review, 33(4):275–306, 2010. [43] Benoît Frénay and Michel Verleysen. Classification in the presence of label noise: a survey. IEEE transactions on neural networks and learning systems, 25(5):845–869, 2014. [44] Tong Xiao, Tian Xia, Yi Yang, Chang Huang, and Xiaogang Wang. Learning from massive noisy labeled data for image classification. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2691–2699, 2015. 11
2018
1006
7,251
LAG: Lazily Aggregated Gradient for Communication-Efficient Distributed Learning Tianyi Chen⋆ Georgios B. Giannakis⋆ Tao Sun†,∗ Wotao Yin∗ ⋆University of Minnesota - Twin Cities, Minneapolis, MN 55455, USA †National University of Defense Technology, Changsha, Hunan 410073, China ∗University of California - Los Angeles, Los Angeles, CA 90095, USA {chen3827,georgios@umn.edu} nudtsuntao@163.com wotaoyin@math.ucla.edu Abstract This paper presents a new class of gradient methods for distributed machine learning that adaptively skip the gradient calculations to learn with reduced communication and computation. Simple rules are designed to detect slowly-varying gradients and, therefore, trigger the reuse of outdated gradients. The resultant gradient-based algorithms are termed Lazily Aggregated Gradient — justifying our acronym LAG used henceforth. Theoretically, the merits of this contribution are: i) the convergence rate is the same as batch gradient descent in stronglyconvex, convex, and nonconvex cases; and, ii) if the distributed datasets are heterogeneous (quantified by certain measurable constants), the communication rounds needed to achieve a targeted accuracy are reduced thanks to the adaptive reuse of lagged gradients. Numerical experiments on both synthetic and real data corroborate a significant communication reduction compared to alternatives. 1 Introduction In this paper, we develop communication-efficient algorithms to solve the following problem min θ∈Rd L(θ) with L(θ) := ∑ m∈M Lm(θ) (1) where θ ∈Rd is the unknown vector, L and {Lm, m∈M} are smooth (but not necessarily convex) functions with M := {1, . . . , M}. Problem (1) naturally arises in a number of areas, such as multi-agent optimization [1], distributed signal processing [2], and distributed machine learning [3]. Considering the distributed machine learning paradigm, each Lm is also a sum of functions, e.g., Lm(θ):=∑ n∈Nmℓn(θ), where ℓn is the loss function (e.g., square or the logistic loss) with respect to the vector θ (describing the model) evaluated at the training sample xn; that is, ℓn(θ) := ℓ(θ; xn). While machine learning tasks are traditionally carried out at a single server, for datasets with massive samples {xn}, running gradient-based iterative algorithms at a single server can be prohibitively slow; e.g., the server needs to sequentially compute gradient components given limited processors. A simple yet popular solution in recent years is to parallelize the training across multiple computing units (a.k.a. workers) [3]. Specifically, assuming batch samples distributedly stored in a total of M workers with the worker m ∈M associated with samples {xn, n ∈Nm}, a globally shared model θ will be updated at the central server by aggregating gradients computed by workers. Due to bandwidth and privacy concerns, each worker m will not upload its data {xn, n ∈Nm} to the server, thus the learning task needs to be performed by iteratively communicating with the server. We are particularly interested in the scenarios where communication between the central server and the local workers is costly, as is the case with the Federated Learning setting [4, 5], the cloud-edge 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. AI systems [6], and more in the emerging Internet-of-Things paradigm [7]. In those cases, communication latency is the bottleneck of overall performance. More precisely, the communication latency is a result of initiating communication links, queueing and propagating the message. For sending small messages, e.g., the d-dimensional model θ or aggregated gradient, this latency dominates the message size-dependent transmission latency. Therefore, it is important to reduce the number of communication rounds, even more so than the bits per round. In short, our goal is to find the model parameter θ that minimizes (1) using as low communication overhead as possible. 1.1 Prior art To put our work in context, we review prior contributions that we group in two categories. Large-scale machine learning. Solving (1) at a single server has been extensively studied for largescale learning tasks, where the “workhorse approach” is the simple yet efficient stochastic gradient descent (SGD) [8, 9]. Albeit its low per-iteration complexity, the inherited variance prevents SGD to achieve fast convergence. Recent advances include leveraging the so-termed variance reduction techniques to achieve both low complexity and fast convergence [10–12]. For learning beyond a single server, distributed parallel machine learning is an attractive solution to tackle large-scale learning tasks, where the parameter server architecture is the most commonly used one [3, 13]. Different from the single server case, parallel implementation of the batch gradient descent (GD) is a popular choice, since SGD that has low complexity per iteration requires a large number of iterations thus communication rounds [14]. For traditional parallel learning algorithms however, latency, bandwidth limits, and unexpected drain on resources, that delay the update of even a single worker will slow down the entire system operation. Recent research efforts in this line have been centered on understanding asynchronous-parallel algorithms to speed up machine learning by eliminating costly synchronization; e.g., [15–20]. All these approaches either reduce the computational complexity, or, reduce the run time, but they do not save communication. Communication-efficient learning. Going beyond single-server learning, the high communication overhead becomes the bottleneck of the overall system performance [14]. Communication-efficient learning algorithms have gained popularity [21, 22]. Distributed learning approaches have been developed based on quantized (gradient) information, e.g., [23–26], but they only reduce the required bandwidth per communication, not the rounds. For machine learning tasks where the loss function is convex and its conjugate dual is expressible, the dual coordinate ascent-based approaches have been demonstrated to yield impressive empirical performance [5, 27, 28]. But these algorithms run in a double-loop manner, and the communication reduction has not been formally quantified. To reduce communication by accelerating convergence, approaches leveraging (inexact) second-order information have been studied in [29, 30]. Roughly speaking, algorithms in [5, 27–30] reduce communication by increasing local computation (relative to GD), while our method does not increase local computation. In settings different from the one considered in this paper, communication-efficient approaches have been recently studied with triggered communication protocols [31, 32]. Except for convergence guarantees however, no theoretical justification for communication reduction has been established in [31]. While a sublinear convergence rate can be achieved by algorithms in [32], the proposed gradient selection rule is nonadaptive and requires double-loop iterations. 1.2 Our contributions Before introducing our approach, we revisit the popular GD method for (1) in the setting of one parameter server and M workers: At iteration k, the server broadcasts the current model θk to all the workers; every worker m ∈M computes ∇Lm ( θk) and uploads it to the server; and once receiving gradients from all workers, the server updates the model parameters via GD iteration θk+1 = θk −α∇k GD with ∇k GD := ∑ m∈M ∇Lm ( θk) (2) where α is a stepsize, and ∇k GD is an aggregated gradient that summarizes the model change. To implement (2), the server has to communicate with all workers to obtain fresh {∇Lm ( θk) }. In this context, the present paper puts forward a new batch gradient method (as simple as GD) that can skip communication at certain rounds, which justifies the term Lazily Aggregated Gradient 2 Metric Communication Computation Memory Algorithm PS→WK m WK m →PS PS WK m PS WK m GD θk ∇Lm (2) ∇Lm θk / LAG-PS θk, if m∈Mk δ∇k m, if m∈Mk (4), (12b) ∇Lm, if m∈Mk θk, ∇k, {ˆθ k m} ∇Lm(ˆθ k m) LAG-WK θk δ∇k m, if m∈Mk (4) ∇Lm, (12a) θk, ∇k ∇Lm(ˆθ k m) Table 1: A comparison of communication, computation and memory requirements. PS denotes the parameter server, WK denotes the worker, PS→WK m is the communication link from the server to the worker m, and WK m →PS is the communication link from the worker m to the server. (LAG). With its derivations deferred to Section 2, LAG resembles (2), given by LAG iteration θk+1 = θk −α∇k with ∇k := ∑ m∈M ∇Lm (ˆθ k m ) (3) where each ∇Lm(ˆθ k m) is either ∇Lm(θk), when ˆθ k m = θk, or an outdated gradient that has been computed using an old copy ˆθ k m ̸= θk. Instead of requesting fresh gradient from every worker in (2), the twist is to obtain ∇k by refining the previous aggregated gradient ∇k−1; that is, using only the new gradients from the selected workers in Mk, while reusing the outdated gradients from the rest of workers. Therefore, with ˆθ k m :=θk, ∀m∈Mk, ˆθ k m := ˆθ k−1 m , ∀m /∈Mk, LAG in (3) is equivalent to LAG iteration θk+1 = θk −α∇k with ∇k =∇k−1+ ∑ m∈Mk δ∇k m (4) where δ∇k m := ∇Lm(θk)−∇Lm(ˆθ k−1 m ) is the difference between two evaluations of ∇Lm at the current iterate θk and the old copy ˆθ k−1 m . If ∇k−1 is stored in the server, this simple modification scales down the per-iteration communication rounds from GD’s M to LAG’s |Mk|. We develop two different rules to select Mk. The first rule is adopted by the parameter server (PS), and the second one by every worker (WK). At iteration k, LAG-PS: the server determines Mk and sends θk to the workers in Mk; each worker m ∈Mk computes ∇Lm(θk) and uploads δ∇k m; each workerm/∈Mkdoes nothing; the server updates via (4); LAG-WK: the server broadcasts θk to all workers; every worker computes ∇Lm(θk), and checks if it belongs to Mk; only the workers in Mk upload δ∇k m; the server updates via (4). See a comparison of two LAG variants with GD in Table 1. Parameter Server (PS) Workers Figure 1: LAG in a parameter server setup. Naively reusing outdated gradients, while saving communication per iteration, can increase the total number of iterations. To keep this number in control, we judiciously design our simple trigger rules so that LAG can: i) achieve the same order of convergence rates (thus iteration complexities) as batch GD under strongly-convex, convex, and nonconvex smooth cases; and, ii) require reduced communication to achieve a targeted learning accuracy, when the distributed datasets are heterogeneous (measured by certain quantity specified later). In certain learning settings, LAG requires only O(1/M) communication of GD. Empirically, we found that LAG can reduce the communication required by GD and other distributed learning methods by an order of magnitude. Notation. Bold lowercase letters denote column vectors, which are transposed by (·)⊤. And ∥x∥ denotes the ℓ2-norm of x. Inequalities for vectors x > 0 is defined entrywise. 2 LAG: Lazily Aggregated Gradient Approach In this section, we formally develop our LAG method, and present the intuition and basic principles behind its design. The original idea of LAG comes from a simple rewriting of the GD iteration (2) as θk+1 = θk −α ∑ m∈M ∇Lm(θk−1) −α ∑ m∈M ( ∇Lm ( θk) −∇Lm ( θk−1)) . (5) 3 Let us view ∇Lm(θk)−∇Lm(θk−1) as a refinement to ∇Lm(θk−1), and recall that obtaining this refinement requires a round of communication between the server and the worker m. Therefore, to save communication, we can skip the server’s communication with the worker m if this refinement is small compared to the old gradient; that is, ∥∇Lm(θk)−∇Lm(θk−1)∥≪∥∑ m∈M ∇Lm(θk−1)∥. Generalizing on this intuition, given the generic outdated gradient components {∇Lm(ˆθ k−1 m )} with ˆθ k−1 m =θk−1−τ k−1 m m for a certain τ k−1 m ≥0, if communicating with some workers will bring only small gradient refinements, we skip those communications (contained in set Mk c) and end up with θk+1 = θk −α ∑ m∈M ∇Lm (ˆθ k−1 m ) −α ∑ m∈Mk ( ∇Lm ( θk) −∇Lm (ˆθ k−1 m )) (6a) = θk −α∇L(θk) −α ∑ m∈Mkc ( ∇Lm (ˆθ k−1 m ) −∇Lm ( θk)) (6b) where Mk and Mk c are the sets of workers that do and do not communicate with the server, respectively. It is easy to verify that (6) is identical to (3) and (4). Comparing (2) with (6b), when Mk c includes more workers, more communication is saved, but θk is updated by a coarser gradient. Key to addressing this communication versus accuracy tradeoff is a principled criterion to select a subset of workers Mk c that do not communicate with the server at each round. To achieve this “sweet spot,” we will rely on the fundamental descent lemma. For GD, it is given as follows [33]. Lemma 1 (GD descent in objective) Suppose L(θ) is L-smooth, and ¯θ k+1 is generated by running one-step GD iteration (2) given θk and stepsize α. Then the objective values satisfy L(¯θ k+1) −L(θk) ≤− ( α −α2L 2 ) ∥∇L(θk)∥2 := ∆k GD(θk). (7) Likewise, for our wanted iteration (6), the following holds; its proof is given in the Supplement. Lemma 2 (LAG descent in objective) Suppose L(θ) is L-smooth, and θk+1 is generated by running one-step LAG iteration (4) given θk. Then the objective values satisfy (cf. δ∇k m in (4)) L(θk+1)−L(θk) ≤−α 2 ∇L(θk) 2 + α 2 ∑ m∈Mkc δ∇k m 2 + (L 2 −1 2α ) θk+1−θk 2 :=∆k LAG(θk). (8) Lemmas 1 and 2 estimate the objective value descent by performing one-iteration of the GD and LAG methods, respectively, conditioned on a common iterate θk. GD finds ∆k GD(θk) by performing M rounds of communication with all the workers, while LAG yields ∆k LAG(θk) by performing only |Mk| rounds of communication with a selected subset of workers. Our pursuit is to select Mk to ensure that LAG enjoys larger per-communication descent than GD; that is ∆k LAG(θk)/|Mk| ≤∆k GD(θk)/M. (9) Choosing the standard α = 1/L, we can show that in order to guarantee (9), it is sufficient to have (see the supplemental material for the deduction) ∇Lm (ˆθ k−1 m ) −∇Lm ( θk) 2 ≤ ∇L(θk) 2 /M 2, ∀m ∈Mk c. (10) However, directly checking (10) at each worker is expensive since obtaining ∥∇L(θk)∥2 requires information from all the workers. Instead, we approximate ∥∇L(θk)∥2 in (10) by ∇L(θk) 2 ≈1 α2 D ∑ d=1 ξd θk+1−d −θk−d 2 (11) where {ξd}D d=1 are constant weights, and the constant D determines the number of recent iterate changes that LAG incorporates to approximate the current gradient. The rationale here is that, as L is smooth, ∇L(θk) cannot be very different from the recent gradients or the recent iterate lags. Building upon (10) and (11), we will include worker m in Mk c of (6) if it satisfies LAG-WK condition ∇Lm(ˆθ k−1 m )−∇Lm(θk) 2 ≤ 1 α2M 2 D ∑ d=1 ξd θk+1−d−θk−d 2 . (12a) 4 Algorithm 1 LAG-WK 1: Input: Stepsize α > 0, and threshold {ξd}. 2: Initialize: θ1, {∇Lm(ˆθ 0 m), ∀m}. 3: for k = 1, 2, . . . , K do 4: Server broadcasts θk to all workers. 5: for worker m = 1, . . . , M do 6: Worker m computes ∇Lm(θk). 7: Worker m checks condition (12a). 8: if worker m violates (12a) then 9: Worker m uploads δ∇k m. 10: ▷Save ∇Lm(ˆθ k m) = ∇Lm(θk) 11: else 12: Worker m uploads nothing. 13: end if 14: end for 15: Server updates via (4). 16: end for Algorithm 2 LAG-PS 1: Input: Stepsize α > 0, {ξd}, and Lm, ∀m. 2: Initialize: θ1,{ˆθ 0 m,∇Lm(ˆθ 0 m), ∀m}. 3: for k = 1, 2, . . . , K do 4: for worker m = 1, . . . , M do 5: Server checks condition (12b). 6: if worker m violates (12b) then 7: Server sends θk to worker m. 8: ▷Save ˆθ k m = θk at server 9: Worker m computes ∇Lm(θk). 10: Worker m uploads δ∇k m. 11: else 12: No actions at server and worker m. 13: end if 14: end for 15: Server updates via (4). 16: end for Table 2: A comparison of LAG-WK and LAG-PS. Condition (12a) is checked at the worker side after each worker receives θk from the server and computes its ∇Lm(θk). If broadcasting is also costly, we can resort to the following server side rule: LAG-PS condition L2 m ˆθ k−1 m −θk 2 ≤ 1 α2M 2 D ∑ d=1 ξd θk+1−d −θk−d 2 . (12b) The values of {ξd} and D admit simple choices, e.g., ξd = 1/D, ∀d with D = 10 used in simulations. LAG-WK vs LAG-PS. To perform (12a), the server needs to broadcast the current model θk, and all the workers need to compute the gradient; while performing (12b), the server needs the estimated smoothness constant Lm for all the local functions. On the other hand, as it will be shown in Section 3, (12a) and (12b) lead to the same worst-case convergence guarantees. In practice, however, the server-side condition is more conservative than the worker-side one at communication reduction, because the smoothness of Lm readily implies that satisfying (12b) will necessarily satisfy (12a), but not vice versa. Empirically, (12a) will lead to a larger Mk c than that of (12b), and thus extra communication overhead will be saved. Hence, (12a) and (12b) can be chosen according to users’ preferences. LAG-WK and LAG-PS are summarized as Algorithms 1 and 2. Regarding our proposed LAG method, three remarks are in order. R1) With recursive update of the lagged gradients in (4) and the lagged iterates in (12), implementing LAG is as simple as GD; see Table 1. Both empirically and theoretically, we will further demonstrate that using lagged gradients even reduces the overall delay by cutting down costly communication. R2) Although both LAG and asynchronous-parallel algorithms in [15–20] leverage stale gradients, they are very different. LAG actively creates staleness, and by design, it reduces total communication despite the staleness. Asynchronous algorithms passively receives staleness, and increases total communication due to the staleness, but it saves run time. R3) Compared with existing efforts for communication-efficient learning such as quantized gradient, Nesterov’s acceleration, dual coordinate ascent and second-order methods, LAG is not orthogonal to all of them. Instead, LAG can be combined with these methods to develop even more powerful learning schemes. Extension to the proximal LAG is also possible to cover nonsmooth regularizers. 3 Iteration and communication complexity In this section, we establish the convergence of LAG, under the following standard conditions. Assumption 1: Loss function Lm(θ) is Lm-smooth, and L(θ) is L-smooth. Assumption 2: L(θ) is convex and coercive. Assumption 3: L(θ) is µ-strongly convex. 5 The subsequent convergence analysis critically builds on the following Lyapunov function: Vk := L(θk) −L(θ∗) + D ∑ d=1 βd θk+1−d −θk−d 2 (13) where θ∗is the minimizer of (1), and {βd} is a sequence of constants that will be determined later. We will start with the sufficient descent of our Vk in (13). Lemma 3 (descent lemma) Under Assumption 1, if α and {ξd} are chosen properly, there exist constants c0, · · · , cD ≥0 such that the Lyapunov function in (13) satisfies Vk+1 −Vk ≤−c0 ∇L(θk) 2 − D ∑ d=1 cd θk+1−d−θk−d 2 (14) which implies the descent in our Lyapunov function, that is, Vk+1 ≤Vk. Lemma 3 is a generalization of GD’s descent lemma. As specified in the supplementary material, under properly chosen {ξd}, the stepsize α ∈(0, 2/L) including α = 1/L guarantees (14), matching the stepsize region of GD. With Mk = M and βd = 0, ∀d in (13), Lemma 3 reduces to Lemma 1. 3.1 Convergence in strongly convex case We first present the convergence under the smooth and strongly convex condition. Theorem 1 (strongly convex case) Under Assumptions 1-3, the iterates {θk} of LAG satisfy L ( θK) −L ( θ∗) ≤ ( 1 −c(α; {ξd}) )K V0 (15) where θ∗is the minimizer of L(θ) in (1), and c(α; {ξd}) ∈(0, 1) is a constant depending on α, {ξd} and {βd} and the condition number κ := L/µ, which are specified in the supplementary material. Iteration complexity. The iteration complexity in its generic form is complicated since c(α; {ξd}) depends on the choice of several parameters. Specifically, if we choose the parameters as follows ξ1 = · · · = ξD := ξ < 1 D and α := 1 −√Dξ L and β1 = · · · = βD := D −d + 1 2α √ D/ξ (16) then, following Theorem 1, the iteration complexity of LAG in this case is ILAG(ϵ) = κ 1 −√Dξ log ( ϵ−1) . (17) The iteration complexity in (17) is on the same order of GD’s iteration complexity κ log(ϵ−1), but has a worse constant. This is the consequence of using a smaller stepsize in (16) (relative to α = 1/L in GD) to simplify the choice of other parameters. Empirically, LAG with α = 1/L can achieve almost the same empirical iteration complexity as GD; see Section 4. Building on the iteration complexity, we study next the communication complexity of LAG. In the setting of our interest, we define the communication complexity as the total number of uploads over all the workers needed to achieve accuracy ϵ. While the accuracy refers to the objective optimality error in the strongly convex case, it is considered as the gradient norm in general (non)convex cases. The power of LAG is best illustrated by numerical examples; see an example of LAG-WK in Figure 2. Clearly, workers with a small smoothness constant communicate with the server less frequently. This intuition will be formally treated in the next lemma. Lemma 4 (lazy communication) Define the importance factor of every worker m as H(m) := Lm/L. If the stepsize α and the constants {ξd} in the conditions (12) satisfy ξD ≤· · · ≤ξd ≤ · · · ≤ξ1 and worker m satisfies H2(m) ≤ξd / (dα2L2M 2) := γd (18) then, until the k-th iteration, worker m communicates with the server at most k/(d + 1) rounds. Lemma 4 asserts that if the worker m has a small Lm (a close-to-linear loss function) such that H2(m) ≤γd, then under LAG, it only communicates with the server at most k/(d + 1) rounds. This is in contrast to the total of k communication rounds involved per worker under GD. Ideally, we want as many workers satisfying (18) as possible, especially when d is large. 6 0 1 WK 1 0 1 WK 3 0 1 WK 5 0 1 WK 7 0 100 200 300 400 500 600 700 800 900 1000 Iteration index k 0 1 WK 9 Figure 2: Communication events of workers 1, 3, 5, 7, 9 over 1, 000 iterations. Each stick is an upload. A setup with L1 < . . . < L9. To quantify the overall communication reduction, we define the heterogeneity score function as h(γ) := 1 M ∑ m∈M 1(H2(m) ≤γ) (19) where the indicator 1 equals 1 when H2(m) ≤γ holds, and 0 otherwise. Clearly, h(γ) is a nondecreasing function of γ, that depends on the distribution of smoothness constants L1, L2, . . . , LM. It is also instructive to view it as the cumulative distribution function of the deterministic quantity H2(m), implying h(γ) ∈[0, 1]. Putting it in our context, the critical quantity h(γd) lower bounds the fraction of workers that communicate with the server at most k/(d + 1) rounds until the k-th iteration. We are now ready to present the communication complexity. Proposition 5 (communication complexity) With γd defined in (18) and the function h(γ) in (19), the communication complexity of LAG denoted as CLAG(ϵ) is bounded by CLAG(ϵ) ≤ ( 1 − D ∑ d=1 (1 d − 1 d + 1 ) h (γd) ) M ILAG(ϵ) := ( 1 −∆¯C(h; {γd}) ) M ILAG(ϵ) (20) where the constant is defined as ∆¯C(h; {γd}) := ∑D d=1 ( 1 d − 1 d+1 ) h (γd). The communication complexity in (20) crucially depends on the iteration complexity ILAG(ϵ) as well as what we call the fraction of reduced communication per iteration ∆¯C(h; {γd}). Simply choosing the parameters as (16), it follows from (17) and (20) that (cf. γd =ξ(1 −√Dξ)−2M −2d−1) CLAG(ϵ) ≤ ( 1 −∆¯C(h; ξ) ) CGD(ϵ) /( 1 − √ Dξ ) . (21) where the GD’s complexity is CGD(ϵ) = Mκ log(ϵ−1). In (21), due to the nondecreasing property of h(γ), increasing the constant ξ yields a smaller fraction of workers 1 −∆¯C(h; ξ) that are communicating per iteration, yet with a larger number of iterations (cf. (17)). The key enabler of LAG’s communication reduction is a heterogeneous environment associated with a favorable h(γ) ensuring that the benefit of increasing ξ is more significant than its effect on increasing iteration complexity. More precisely, for a given ξ, if h(γ) guarantees ∆¯C(h; ξ) > √Dξ, then we have CLAG(ϵ)<CGD(ϵ). Intuitively speaking, if there is a large fraction of workers with small Lm, LAG has lower communication complexity than GD. An example follows to illustrate this reduction. Example. Consider Lm = 1, m ̸= M, and LM = L ≥M 2 ≫1, where we have H(m) = 1/L, m ̸= M, H(M) = 1, implying that h(γ) ≥1 − 1 M , if γ ≥1/L2. Choosing D ≥M and ξ = M 2D/L2 < 1/D in (16) such that γD ≥1/L2 in (18), we have (cf. (21)) CLAG(ϵ) / CGD(ϵ) ≤ [ 1 − ( 1 − 1 D + 1 )( 1 −1 M )] /( 1 −MD/L ) ≈ M + D M(D + 1) ≈2 M . (22) Due to technical issues in the convergence analysis, the current condition on h(γ) to ensure LAG’s communication reduction is relatively restrictive. Establishing communication reduction on a broader learning setting that matches the LAG’s intriguing empirical performance is in our agenda. 3.2 Convergence in (non)convex case LAG’s convergence and communication reduction guarantees go beyond the strongly-convex case. We next establish the convergence of LAG for general convex functions. Theorem 2 (convex case) Under Assumptions 1 and 2, if α and {ξd} are chosen properly, then L(θK) −L(θ∗) = O (1/K) . (23) For nonconvex objective functions, LAG can guarantee the following convergence result. Theorem 3 (nonconvex case) Under Assumption 1, if α and {ξd} are chosen properly, then min 1≤k≤K θk+1 −θk 2 = o (1/K) and min 1≤k≤K ∇L(θk) 2 = o (1/K) . (24) 7 200 400 600 800 1000 Number of iteration 10-5 100 Objective error Cyc-IAG Num-IAG LAG-PS LAG-WK Batch-GD 101 102 103 Number of communications (uploads) 10-5 100 Objective error Cyc-IAG Num-IAG LAG-PS LAG-WK Batch-GD 0 0.5 1 1.5 2 2.5 Number of iteration ×104 10-5 100 Objective error Cyc-IAG Num-IAG LAG-PS LAG-WK Batch-GD 101 102 103 104 Number of communications (uploads) 10-5 100 Objective error Cyc-IAG Num-IAG LAG-PS LAG-WK Batch-GD Increasing Lm Increasing Lm Uniform Lm Uniform Lm Figure 3: Iteration and communication complexity in synthetic datasets. 0 1000 2000 3000 4000 5000 Number of iteration 10-5 100 105 Objective error Cyc-IAG Num-IAG LAG-PS LAG-WK Batch-GD 101 102 103 104 Number of communications (uploads) 10-5 100 105 Objective error Cyc-IAG Num-IAG LAG-PS LAG-WK Batch-GD 0 0.5 1 1.5 2 2.5 3 3.5 Number of iteration ×104 10-8 10-6 10-4 10-2 100 102 Objective error Cyc-IAG Num-IAG LAG-PS LAG-WK Batch-GD 101 102 103 104 Number of communications (uploads) 10-5 100 Objective error Cyc-IAG Num-IAG LAG-PS LAG-WK Batch-GD Linear regression Linear regression Logistic regression Logistic regression Figure 4: Iteration and communication complexity in real datasets. Theorems 2 and 3 assert that with the judiciously designed lazy gradient aggregation rules, LAG can achieve order of convergence rate identical to GD for general (non)convex objective functions. Similar to Proposition 5, in the supplementary material, we have also shown that in the (non)convex case, LAG still requires less communication than GD, under certain conditions on the function h(γ). 4 Numerical tests and conclusions To validate the theoretical results, this section evaluates the empirical performance of LAG in linear and logistic regression tasks. All experiments were performed using MATLAB on an Intel CPU @ 3.4 GHz (32 GB RAM) desktop. By default, we consider one server, and nine workers. Throughout the test, we use L(θk) −L(θ∗) as figure of merit of our solution. For logistic regression, the regularization parameter is set to λ = 10−3. To benchmark LAG, we consider the following approaches. ▷Cyc-IAG is the cyclic version of the incremental aggregated gradient (IAG) method [9, 10] that resembles the recursion (4), but communicates with one worker per iteration in a cyclic fashion. ▷Num-IAG also resembles the recursion (4), and is the non-uniform-sampling enhancement of SAG [12], but it randomly selects one worker to obtain a fresh gradient per-iteration with the probability of choosing worker m equal to Lm/ ∑ m∈M Lm. ▷Batch-GD is the GD iteration (2) that communicates with all the workers per iteration. For LAG-WK, we choose ξd = ξ = 1/D with D = 10, and for LAG-PS, we choose more aggressive ξd = ξ = 10/D with D = 10. Stepsizes for LAG-WK, LAG-PS, and GD are chosen as α = 1/L; to optimize performance and guarantee stability, α = 1/(ML) is used in Cyc-IAG and Num-IAG. We consider two synthetic data tests: a) linear regression with increasing smoothness constants, e.g., Lm = (1.3m−1 +1)2, ∀m; and, b) logistic regression with uniform smoothness constants, e.g., L1 = . . . = L9 = 4; see Figure 3. For the case of increasing Lm, it is not surprising that both LAG variants need fewer communication rounds. Interesting enough, for uniform Lm, LAG-WK still has marked improvements on communication, thanks to its ability of exploiting the hidden smoothness of the loss functions; that is, the local curvature of Lm may not be as steep as Lm. Performance is also tested on the real datasets [2]: a) linear regression using Housing, Body fat, Abalone datasets; and, b) logistic regression using Ionosphere, Adult, Derm datasets; see Figure 4. Each dataset is evenly split into three workers with the number of features used in the test equal to the minimal number of features among all datasets; see the details of parameters and data allocation in the supplement material. In all tests, LAG-WK outperforms the alternatives in terms of both metrics, especially reducing the needed communication rounds by several orders of magnitude. Its needed communication rounds can be even smaller than the number of iterations, if none of workers violate 8 Linear regression Logistic regression Algorithm M = 9 M = 18 M = 27 M = 9 M = 18 M = 27 Cyclic-IAG 5271 10522 15773 33300 65287 97773 Num-IAG 3466 5283 5815 22113 30540 37262 LAG-PS 1756 3610 5944 14423 29968 44598 LAG-WK 412 657 1058 584 1098 1723 Batch GD 5283 10548 15822 33309 65322 97821 Table 3: Communication complexity (ϵ = 10−8) in real dataset under different number of workers. 0 1 2 3 4 5 Number of iteration ×105 10-1 100 101 102 103 Objective error Cyc-IAG Num-IAG LAG-PS LAG-WK Batch-GD 101 102 103 104 105 Number of communications (uploads) 10-1 100 101 102 103 Objective error Cyc-IAG Num-IAG LAG-PS LAG-WK Batch-GD Figure 5: Iteration and communication complexity in Gisette dataset. the trigger condition (12) at certain iterations. Additional tests under different number of workers are listed in Table 3, which corroborate the effectiveness of LAG when it comes to communication reduction. Similar performance gain has also been observed in the additional logistic regression test on a larger dataset Gisette. The dataset was taken from [7] which was constructed from the MNIST data [8]. After random selecting subset of samples and eliminating all-zero features, it contains 2000 samples xn ∈R4837. We randomly split this dataset into nine workers. The performance of all the algorithms is reported in Figure 5 in terms of the iteration and communication complexity. Clearly, LAG-WK and LAG-PS achieve the same iteration complexity as GD, and outperform Cyc- and NumIAG. Regarding communication complexity, two LAG variants reduce the needed communication rounds by several orders of magnitude compared with the alternatives. Confirmed by the impressive empirical performance on both synthetic and real datasets, this paper developed a promising communication-cognizant method for distributed machine learning that we term Lazily Aggregated gradient (LAG) approach. LAG can achieve the same convergence rates as batch gradient descent (GD) in smooth strongly-convex, convex, and nonconvex cases, and requires fewer communication rounds than GD given that the datasets at different workers are heterogeneous. To overcome the limitations of LAG, future work consists of incorporating smoothing techniques to handle nonsmooth loss functions, and robustifying our aggregation rules to deal with cyber attacks. Acknowledgments The work by T. Chen and G. Giannakis is supported in part by NSF 1500713 and 1711471, and NIH 1R01GM104975-01. The work by T. Chen is also supported by the Doctoral Dissertation Fellowship from the University of Minnesota. The work by T. Sun is supported in part by China Scholarship Council. The work by W. Yin is supported in part by NSF DMS-1720237 and ONR N0001417121. 9 References [1] A. Nedic and A. Ozdaglar, “Distributed subgradient methods for multi-agent optimization,” IEEE Trans. Automat. Control, vol. 54, no. 1, pp. 48–61, Jan. 2009. [2] G. B. Giannakis, Q. Ling, G. Mateos, I. D. Schizas, and H. Zhu, “Decentralized Learning for Wireless Communications and Networking,” in Splitting Methods in Communication and Imaging, Science and Engineering. New York: Springer, 2016. [3] 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 Proc. Advances in Neural Info. Process. Syst., Lake Tahoe, NV, 2012, pp. 1223–1231. [4] B. McMahan, E. Moore, D. Ramage, S. Hampson, and B. A. y Arcas, “Communication-efficient learning of deep networks from decentralized data,” in Proc. Intl. Conf. Artificial Intell. and Stat., Fort Lauderdale, FL, Apr. 2017, pp. 1273–1282. [5] V. Smith, C.-K. Chiang, M. Sanjabi, and A. S. Talwalkar, “Federated multi-task learning,” in Proc. Advances in Neural Info. Process. Syst., Long Beach, CA, Dec. 2017, pp. 4427–4437. [6] I. Stoica, D. Song, R. A. Popa, D. Patterson, M. W. Mahoney, R. Katz, A. D. Joseph, M. Jordan, J. M. Hellerstein, J. E. Gonzalez et al., “A Berkeley view of systems challenges for AI,” arXiv preprint:1712.05855, Dec. 2017. [7] T. Chen, S. Barbarossa, X. Wang, G. B. Giannakis, and Z.-L. Zhang, “Learning and management for Internet-of-Things: Accounting for adaptivity and scalability,” Proc. of the IEEE, Nov. 2018. [8] L. Bottou, “Large-Scale Machine Learning with Stochastic Gradient Descent,” in Proc. of COMPSTAT’2010, Y. Lechevallier and G. Saporta, Eds. Heidelberg: Physica-Verlag HD, 2010, pp. 177–186. [9] L. Bottou, F. E. Curtis, and J. Nocedal, “Optimization methods for large-scale machine learning,” arXiv preprint:1606.04838, Jun. 2016. [10] R. Johnson and T. Zhang, “Accelerating stochastic gradient descent using predictive variance reduction,” in Proc. Advances in Neural Info. Process. Syst., Lake Tahoe, NV, Dec. 2013, pp. 315–323. [11] A. Defazio, F. Bach, and S. Lacoste-Julien, “Saga: A fast incremental gradient method with support for non-strongly convex composite objectives,” in Proc. Advances in Neural Info. Process. Syst., Montreal, Canada, Dec. 2014, pp. 1646–1654. [12] M. Schmidt, N. Le Roux, and F. Bach, “Minimizing finite sums with the stochastic average gradient,” Mathematical Programming, vol. 162, no. 1-2, pp. 83–112, Mar. 2017. [13] M. Li, D. G. Andersen, A. J. Smola, and K. Yu, “Communication efficient distributed machine learning with the parameter server,” in Proc. Advances in Neural Info. Process. Syst., Montreal, Canada, Dec. 2014, pp. 19–27. [14] B. McMahan and D. Ramage, “Federated learning: Collaborative machine learning without centralized training data,” Google Research Blog, Apr. 2017. [Online]. Available: https://research.googleblog.com/ 2017/04/federated-learning-collaborative.html [15] L. Cannelli, F. Facchinei, V. Kungurtsev, and G. Scutari, “Asynchronous parallel algorithms for nonconvex big-data optimization: Model and convergence,” arXiv preprint:1607.04818, Jul. 2016. [16] T. Sun, R. Hannah, and W. Yin, “Asynchronous coordinate descent under more realistic assumptions,” in Proc. Advances in Neural Info. Process. Syst., Long Beach, CA, Dec. 2017, pp. 6183–6191. [17] Z. Peng, Y. Xu, M. Yan, and W. Yin, “Arock: an algorithmic framework for asynchronous parallel coordinate updates,” SIAM J. Sci. Comp., vol. 38, no. 5, pp. 2851–2879, Sep. 2016. [18] B. Recht, C. Re, S. Wright, and F. Niu, “Hogwild: A lock-free approach to parallelizing stochastic gradient descent,” in Proc. Advances in Neural Info. Process. Syst., Granada, Spain, Dec. 2011, pp. 693–701. [19] J. Liu, S. Wright, C. Ré, V. Bittorf, and S. Sridhar, “An asynchronous parallel stochastic coordinate descent algorithm,” J. Machine Learning Res., vol. 16, no. 1, pp. 285–322, 2015. [20] X. Lian, Y. Huang, Y. Li, and J. Liu, “Asynchronous parallel stochastic gradient for nonconvex optimization,” in Proc. Advances in Neural Info. Process. Syst., Montreal, Canada, Dec. 2015, pp. 2737–2745. 10 [21] M. I. Jordan, J. D. Lee, and Y. Yang, “Communication-efficient distributed statistical inference,” J. American Statistical Association, vol. to appear, 2018. [22] Y. Zhang, J. C. Duchi, and M. J. Wainwright, “Communication-efficient algorithms for statistical optimization.” J. Machine Learning Res., vol. 14, no. 11, 2013. [23] A. T. Suresh, X. Y. Felix, S. Kumar, and H. B. McMahan, “Distributed mean estimation with limited communication,” in Proc. Intl. Conf. Machine Learn., Sydney, Australia, Aug. 2017, pp. 3329–3337. [24] D. Alistarh, D. Grubic, J. Li, R. Tomioka, and M. Vojnovic, “QSGD: Communication-efficient SGD via gradient quantization and encoding,” In Proc. Advances in Neural Info. Process. Syst., pages 1709–1720, Long Beach, CA, Dec. 2017. [25] W. Wen, C. Xu, F. Yan, C. Wu, Y. Wang, Y. Chen, and H. Li, “TernGrad: Ternary gradients to reduce communication in distributed deep learning,” In Proc. Advances in Neural Info. Process. Syst., pages 1509–1519, Long Beach, CA, Dec. 2017. [26] A. F. Aji and K. Heafield, “Sparse communication for distributed gradient descent,” In Proc. of Empirical Methods in Natural Language Process., pages 440–445, Copenhagen, Denmark, Sep. 2017. [27] M. Jaggi, V. Smith, M. Takác, J. Terhorst, S. Krishnan, T. Hofmann, and M. I. Jordan, “Communicationefficient distributed dual coordinate ascent,” in Proc. Advances in Neural Info. Process. Syst., Montreal, Canada, Dec. 2014, pp. 3068–3076. [28] C. Ma, J. Koneˇcn`y, M. Jaggi, V. Smith, M. I. Jordan, P. Richtárik, and M. Takáˇc, “Distributed optimization with arbitrary local solvers,” Optimization Methods and Software, vol. 32, no. 4, pp. 813–848, Jul. 2017. [29] O. Shamir, N. Srebro, and T. Zhang, “Communication-efficient distributed optimization using an approximate newton-type method,” in Proc. Intl. Conf. Machine Learn., Beijing, China, Jun. 2014, pp. 1000– 1008. [30] Y. Zhang and X. Lin, “DiSCO: Distributed optimization for self-concordant empirical loss,” in Proc. Intl. Conf. Machine Learn., Lille, France, Jun. 2015, pp. 362–370. [31] Y. Liu, C. Nowzari, Z. Tian, and Q. Ling, “Asynchronous periodic event-triggered coordination of multiagent systems,” in Proc. IEEE Conf. Decision Control, Melbourne, Australia, Dec. 2017, pp. 6696–6701. [32] G. Lan, S. Lee, and Y. Zhou, “Communication-efficient algorithms for decentralized and stochastic optimization,” arXiv preprint:1701.03961, Jan. 2017. [33] Y. Nesterov, Introductory Lectures on Convex Optimization: A basic course. Berlin, Germany: Springer, 2013, vol. 87. [34] D. Blatt, A. O. Hero, and H. Gauchman, “A convergent incremental gradient method with a constant step size,” SIAM J. Optimization, vol. 18, no. 1, pp. 29–51, Feb. 2007. [35] M. Gurbuzbalaban, A. Ozdaglar, and P. A. Parrilo, “On the convergence rate of incremental aggregated gradient algorithms,” SIAM J. Optimization, vol. 27, no. 2, pp. 1035–1048, Jun. 2017. [36] M. Lichman, “UCI machine learning repository,” 2013. [Online]. Available: http://archive.ics.uci.edu/ml [37] L. Song, A. Smola, A. Gretton, K. M. Borgwardt, and J. Bedo, “Supervised feature selection via dependence estimation,” in Proc. Intl. Conf. Machine Learn., Corvallis, OR, Jun. 2007, pp. 823–830. [38] Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner, “Gradient-based learning applied to document recognition,” Proc. of the IEEE, vol. 86, no. 11, pp. 2278–2324, Nov. 1998. 11
2018
1007
7,252
Equality of Opportunity in Classification: A Causal Approach Junzhe Zhang Purdue University, USA zhang745@purdue.edu Elias Bareinboim Purdue University, USA eb@purdue.edu Abstract The Equalized Odds (for short, EO) is one of the most popular measures of discrimination used in the supervised learning setting. It ascertains fairness through the balance of the misclassification rates (false positive and negative) across the protected groups – e.g., in the context of law enforcement, an African-American defendant who would not commit a future crime will have an equal opportunity of being released, compared to a non-recidivating Caucasian defendant. Despite this noble goal, it has been acknowledged in the literature that statistical tests based on the EO are oblivious to the underlying causal mechanisms that generated the disparity in the first place (Hardt et al. 2016). This leads to a critical disconnect between statistical measures readable from the data and the meaning of discrimination in the legal system, where compelling evidence that the observed disparity is tied to a specific causal process deemed unfair by society is required to characterize discrimination. The goal of this paper is to develop a principled approach to connect the statistical disparities characterized by the EO and the underlying, elusive, and frequently unobserved, causal mechanisms that generated such inequality. We start by introducing a new family of counterfactual measures that allows one to explain the misclassification disparities in terms of the underlying mechanisms in an arbitrary, non-parametric structural causal model. This will, in turn, allow legal and data analysts to interpret currently deployed classifiers through causal lens, linking the statistical disparities found in the data to the corresponding causal processes. Leveraging the new family of counterfactual measures, we develop a learning procedure to construct a classifier that is statistically efficient, interpretable, and compatible with the basic human intuition of fairness. We demonstrate our results through experiments in both real (COMPAS) and synthetic datasets. 1 Introduction The goal of supervised learning is to provide a statistical basis upon which individuals with different group memberships can be reliably classified. For instance, a bank may want to learn a function from a set of background factors so as to determine whether a customer will repay her loan; a university may train a classifier to predict the future GPA of an applicant to decide whether to accept her into the program. The growing adoption of automated systems based on standard classification algorithms throughout society (including in law enforcement, education, and finance [13, 4, 8, 21, 1]) has raised concerns about potential issues due to unfairness and discrimination. Z X W Y Figure 1: COMPAS A recent high-profile example is a risk assessment tool called COMPAS, which has been widely used across the US to inform decisions in the criminal justice system. Fig. 1 graphically describes this setting – X represents the race (0 for Caucasian, 1 for African-American) of a defendant and Y stands for the recidivism outcome (0 for no, 1 otherwise), which are mediated by the prior convictions W, and confounded by other demographic information Z (e.g., age, gender) of the defendant. The COMPAS 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. Z X W Y ˆY (a) f(x, z, w) Z X W Y ˆY (b) f1(x) = x Z X W Y ˆY (c) f2(w) = w Z X W Y ˆY (d) f3(z) = z Figure 2: (a-d) Causal diagrams of classifiers f, f1, f2, f3 in COMPAS. Nodes represent variables, directed arrows for functional relationships, and bi-directed arrows for unknown associations. tool is a classifier f(x, z, w) (shown in Fig. 2(a)) providing a prediction ˆY on whether the defendant is expected to commit a future crime. An analysis performed by the news organization ProPublica revealed that the odds of receiving a positive prediction ( ˆY = 1) for defendants who did not recidivate were on average higher among African-Americans than their Caucasians counterparts [1]. In words, the error rates of COMPAS disproportionately misclassified African-American defendants. Many attempts have been made to model discrimination in the classification setting [26, 14, 11, 9, 15]. A recent, noteworthy framework comes under the rubric of Equalized Odds [7] (also referred to as Error Rate Balance [5]), which constrains the classification algorithm such that its disparate error rate ERx0,x1(ˆy|y) = P(ˆy|x1, y) −P(ˆy|x0, y) is equalized (and equal to 0) across different demographics x0, x1, i.e., the odds of misclassification does not disproportionately affect any population sub-group. In the COMPAS example, the condition ERx0,x1( ˆY = 1|Y = 0) = 0 implies that an AfricanAmerican defendant who does not commit a future crime will have an equal opportunity of getting released, compared to non-recidivating Caucasian defendants. This notion of fairness is natural in many learning settings and, indeed, has been implemented in a number of algorithms [7, 6, 25, 23]. Unfortunately, the framework of equalized odds is not without its problems. To witness, consider a binary instance of Fig. 1 where the values of X and Z are determined such that x = z and W is decided by the function w ←x. We are concerned with the ER disparity induced by different classifiers f1, f2, f3 (Fig. 2(b-d)), where, for instance, ˆy ←f1(x) = x (i.e., f1 takes only X as input, and ignores the other features). Remarkably, a simple analysis shows that ERx0,x1( ˆY = 1|Y = 0) is the same (and equal to 1) in all three classifiers, despite their fundamentally different mechanisms associating X and ˆY . Note that f1, f2, f3 corresponds to the direct path X →ˆY , the indirect path X →W →ˆY , and the remaining spurious (non-causal) paths (e.g., X ↔Z →ˆY ), respectively. This observation is not entirely new, and is part of a pattern noted by [7] – statistical tests based on the disparate ER are oblivious to the underlying causal mechanisms that generated the data. This realization has dramatic implications to the applicability of supervised learning in the real world since it seems to suggest that commonsense notions of discrimination, for example, the unequalized false positive rate caused by direct discrimination (X →ˆY ), cannot be formally articulated, measured from data, and, therefore, controlled. More importantly, the legal frameworks of anti-discrimination laws in the US (e.g., Title VII) require that to establish a prima facie case of discrimination, the plaintiff must demonstrate “a strong causal connection” between the alleged discriminatory practice and the observed statistical disparity, otherwise the case will be dismissed (Texas Dept. of Housing and Community Affairs v. Inclusive Communities Project, Inc., 576 U.S. __ (2015)). Without a robust causal basis, an evidence of disparate ER on its own is not sufficient to lead to any legal liability. More recently, the use of causal reasoning to help open the black-box of decision-making systems has attracted considerable interest in the community, leading to fine-grained explanations of observed statistical biases [11, 10, 25, 9]. One of the main tasks of causal inference is to explain “how nature works,” or more technically, to decompose a composite statistical measure (e.g, the total variation TVx0,x1(ˆy) = P(ˆy|x1) −P(ˆy|x0)), into its most elementary and interpretable components [24, 17, 29]. In particular, [28] introduced the causal explanation formula, which allows fairness analysts to decompose TV into detailed counterfactual measures describing the effects along direct, indirect, and spurious paths from X to ˆY . While [28] explains how the statistical inequality in the observed outcome is brought about, it is unclear how to apply such insight to correct the problematic behaviors of an alleged, discriminatory policy. Furthermore, the explanation formula allows the decomposition of marginal measures such as TV, but it’s unable to explain disparities represented by conditional ones, such as the ER (e.g., non-recidivating African-American defendants). This paper aims to overcome these challenges. We develop a causal framework to link the disparities realized through the ER and the (unobserved) causal mechanisms by which the protected attribute X 2 affects change in the prediction ˆY . Specifically, (1) we introduce a family of counterfactual measures capable of describing the ER in terms of the direct, indirect, and spurious paths from X to ˆY on an arbitrary structural causal model (Defs. 1-3) and we prove different qualitative and quantitative properties of these measures (Thms. 1-2); (2) we derive adjustment-like formulas to estimate the counterfactual ERs from observational data (Thms. 3-4), which are accompanied with an efficient algorithm (Alg. 1, Thm. 5) to find the corresponding admissible sets; (3) we operationalize the proposed counterfactual estimands through a novel procedure to learn a fair classifier subject to constraints over the effect along the underlying causal mechanisms (Algs. 2-3, Thm. 6). 2 Preliminaries and Notations We use capital letters to denote variables (X), and small letters for their values (x). We use the abbreviation P(x) to represent the probabilities P(X = x). For arbitrary sets A and B, let A\B denote the set difference {x : x ∈A and x ̸∈B}, and let |A| be the dimension of set A. The basic semantical framework of our analysis rests on structural causal models (SCM) [16, Ch. 7]. A SCM is a tuple ⟨M, P(u)⟩, where M consists of a set of endogenous (observed) variables V and exogenous (unobserved) variables U. The values of each Vi ∈V are determined by a structural function fVi taking as arguments a combination of other endogenous and exogenous variables (i.e., Vi ←fVi(PAi, Ui), PAi ⊆V , Ui ⊆U)). Values of U are drawn from the distribution P(u). Each SCM is associated with a directed acyclic graph (DAG) G = ⟨V , E⟩, termed a causal diagram, where nodes V represent endogenous variables and directed edges E stand for functional relations (e.g., see Fig. 1). By convention, U are not explicitly shown; a bi-directed arrow between Vi and Vj indicates the presence of an unobserved confounder (UC) Uk affecting both Vi, Vj, i.e., Vi ←Uk →Vj. A path is a sequence of edges where each pair of adjacent edges in the sequence share a node. We use d-separation and blocking interchangeably, following the convention in [16]. A path from a node X to a node ˆY consists exclusively of direct arrows pointing away from X is called causal; all the other non-causal paths are called spurious. The causal paths could be further categorized into the direct path X →ˆY and the indirect paths, e.g., X →W →ˆY of Fig. 2(a). Let (X →ˆY )G, (X i−→ˆY )G and (X s ←→ˆY )G denote, respectively, the direct, indirect and spurious paths between X and ˆY in a DAG G. A descendant of X is any node which X has a causal path to (including X itself). The descendant set of a set X is all descendants of any node in X, which we denote by De(X)G. An intervention on a set of variables X ⊆V , denoted by do(x), is an operation where values of X are set to constants x, regardless of how they were ordinarily determined (through the functions fX). We denote by ⟨Mx, P(u)⟩a sub-model of a SCM ⟨M, P(u)⟩induced by do(x). The potential response of ˆY to intervention do(x), denoted by ˆYx(u), is the solution of ˆY with U = u in the sub-model Mx; it can be read as the counterfactual sentence “the value that ˆY would have obtained in situation U = u, had X been x.” Statistically, averaging U’s distribution (P(u)) leads to the counterfactual variable ˆYx. For a more detailed discussion on SCMs, please refer to [16, 2]. 3 Counterfactual Analysis of Unequalized Classification Errors In this section, we investigate the unequalized odds of misclassification observed in COMPAS by devising three simple thought experiments. These experiments could be generalized into a set of novel counterfactual measures, providing a fine-grained explanation of how the ER disparity of a classifier f( ˆ pa) is brought about. Throughout our analysis, we will let X be the protected attribute, ˆY be the prediction and Y be the true outcome; ˆ PA is a set of (possible) input features of the predictor ˆY . We will denote by value x1 the disadvantaged group and x0 the advantaged group. Given the space constraints, all proofs are included in the full technical report [27, Appendix A]. We consider first the impact of the direct discrimination (i.e., the direct path X →ˆY ) on the ER disparity observed in the COMPAS. We will devise a thought experiment concerning with a Caucasian defendant who does not recidivate (i.e., x0, y). Imagine a hypothetical situation where this defendant were a non-recidivating African-American (x1, y), while keeping the prior convictions W and other demographic information Z fixed at the level that the defendant x0, y currently has. We then measure the prediction ˆY in this imagined world (counterfactually), compared to what the defendant currently receives from COMPAS (factually). If the prediction were different in these two situations, e.g., ˆY 3 changes from 0 to 1, we could then say the path X →ˆY is active, i.e., the direct discrimination against African-American defendants exists. (a) P(ˆyx1,y,Wx0,y,Z|x0, y) W x0 x1 ˆY Z − (b) P(ˆy|x0, y) W x0 ˆY Z Figure 3: Graphical representation of the counterfactual direct ER in COMPAS. Figs. 3(a-b) represent this thought experiment graphically. Fig. 3(b) shows the conditional SCM ⟨M, P(u|x0, y)⟩of the non-recidivating Caucasian defendant (x0, y): variables X, Z, W are correlated by conditioning on the collider Y [16, pp. 339]; we omit the true outcome Y for simplicity. Using this model as the baseline (i.e., what factually happened in reality), we change in Fig. 3(a) the input of X to the direct path X →ˆY to x1 (edges in G represent functional relations), while keeping the value of X to other variables (W, Z) fixed at the baseline level x0, y. In this reality, variable Zx0,y = Z since Z is a non-descendant node of X and Y [16, pp. 232]; the intervention on Y is omitted since Y does not directly affect the prediction ˆY . Since the direct path X →ˆY is the only difference between models of Figs. 3(a-b), the change in ˆY thus measure the influence of X →ˆY . Indeed, this hypothetical procedure could be generalized, applicable to any classifier in an arbitrary SCM, which we summarize as follows. Definition 1 (Counterfactual Direct Error Rate). Given a SCM ⟨M, P(u)⟩and a classifier f( ˆ pa), the counterfactual direct error rate for a sub-population x, y (with prediction ˆy ̸= y) is defined as: ERd x0,x1(ˆy|x, y) = P(ˆyx1,y,( ˆ PA\X)x0,y|x, y) −P(ˆyx0,y|x, y) (1) In Eq. 1, ˆYx1,y,( ˆ PA\X)x0,y could be further simplified as ˆYx1,( ˆ PA\X)x0,y since Y is not an input of f( ˆ pa). The subscript ( ˆ PA\X)x0,y is the solution of the input features (besides X) ( ˆ PA\X)(u) in the sub-model Mx0,y; values of U are drawn from the distribution P(u) such that X(u) = x, Y (u) = y. The query of Eq. 1 could be read as: “For an individual with the protected attribute X = x and the true outcome Y = y, how would the prediction ˆY change had X been x1, while keeping all the other features ˆ PA\X at the level that they would attain had X = x0 and Y = y, compared to the prediction ˆY she/he would receive had X been x0 and Y been y?” (a) P(ˆyx0,y,Wx1,y,Z|x0, y) W x0 x1 ˆY Z − (b) P(ˆy|x0, y) W x0 ˆY Z Figure 4: Graphical representations of the counterfactual indirect ER in COMPAS. Similarly, we could devise a thought experiment to measure the effect of the indirect discrimination, mediated by the prior convictions W, i.e., the indirect path X →W →ˆY . Consider again the non-recidivating Caucasian defendant x0, y. We conceive a scenario where the prior convictions W of the defendant x0, y changes to the level that it would have achieved had the defendant been a non-recidivating African-American x1, y, while keeping the other features X, Z fixed at the level that they currently are. Fig. 4(a) describes this hypothetical scenario: we change only input value of edge X →W to x1, while keeping all the other paths untouched (at the baseline). We then measure the prediction ˆY in both the counterfactual (Fig. 4(a)) and factual (Fig. 4(b)) world and compare their differences. The change in the prediction of these models thus represent the influence of indirect path X →W →ˆY . We generalize this thought experiment and provide an estimand of the indirect paths for any SCM and classifier f, namely: Definition 2 (Counterfactual Indirect Error Rate). Given a SCM ⟨M, P(u)⟩and a classifier f( ˆ pa), the counterfactual indirect error rate for a sub-population x, y (with prediction ˆy ̸= y) is defined as: ERi x0,x1(ˆy|x, y) = P(ˆyx0,y,( ˆ PA\X)x1,y|x, y) −P(ˆyx0,y|x, y). (2) (a) P(ˆyx0,y|x1, y) W x1 x0 ˆY Z − (b) P(ˆyx0,y|x0, y) W x0 ˆY Z Figure 5: Graphical representations of the counterfactual spurious ER in COMPAS. Finally, we introduce a hypothetical procedure measuring the influence of the spurious relations between the protected attribute X and prediction ˆY through the population attributes that are non-descendants of both X and ˆY , e.g., the path X ↔Z →ˆY in Fig. 2(a). We consider a Caucasian x0, y and an African-American x1, y defendants who both would not recidivate. We measure the prediction ˆY these defendants would receive had they both been 4 non-recidivating Caucasians (x0, y). Figs. 5 (a-b) describes this experimental setup. Since the causal influence of X (on ˆY ) are fixed at x0 in both models, the difference in ˆY must be due to the population characteristics that are not affected by X i.e., the spurious X −ˆY relationships. Definition 3 (Counterfactual Spurious Error Rate). Given a SCM ⟨M, P(u)⟩and a classifier f( ˆ pa), the counterfactual spurious error rate for a sub-population x, y (with prediction ˆy ̸= y) is defined as: ERs x0,x1(ˆy|y) = P(ˆyx0,y|x1, y) −P(ˆyx0,y|x0, y) (3) Def. 3 generalizes the thought experiment described above to an arbitrary SCM. In the above equation, the distribution P(ˆyx0,y|x0, y) coincides with P(ˆy|x0, y) since variable ˆYx0,y = ˆY given that X = x0, Y = y (the composition axiom [16, Ch. 7.3]). Eq. 3 can be read as the counterfactual sentence: “For two demographics x0, x1 with the same true outcome Y = y, how would the prediction ˆY differ had they both been x0, y?” 3.1 Properties of Counterfactual Error Rates Theorem 1. Given a SCM ⟨M, P(u)⟩and a classifier f( ˆ pa), for any x0, x1, x, ˆy, y, the counterfactual ERs of Defs. 1-3 obey the following properties : (1) (X ̸→Y )G|Y ⇒ERd x0,x1(ˆy|x, y) = 0; (2) |(X i−→Y )G|Y | = 0 ⇒ERi x0,x1(ˆy|x, y) = 0; (3) |(X s ←→Y )G|Y | = 0 ⇒ERs x0,x1(ˆy|x, y) = 0, where G|Y is the causal diagram of a conditional SCM ⟨My, P(u|y)⟩. The conditional causal diagram G|Y is obtained from the original model G by (1) removing the node Y and (2) adding bi-directed arrows between nodes whose associated exogenous variables are correlated in P(u|y)1 (e.g., Fig. 3(b)). Thm. 1 says that Defs. 1-3 provide prima facie evidence for discrimination detection. For instance, ERd x0,x1(ˆy|x, y) ̸= 0 implies that the path X →ˆY is active, i.e., the direct discrimination exists. It is expected that the proposed counterfactual measures capture the relative strength of different active pathways connecting node X and ˆY in the underlying SCM. We now derive how the counterfactual ERs are quantitatively related with the unequalized odds of misclassification induced by an arbitrary classifier. Theorem 2 (Causal Explanation Formula of Equalized Odds). For any x0, x1, ˆy, y, ERx0,x1(ˆy|x, y), ERd x0,x1(ˆy|x, y), ERi x0,x1(ˆy|x, y) and ERs x0,x1(ˆy|y) obey the following non-parametric relationship: ERx0,x1(ˆy|y) = ERd x0,x1(ˆy|x0, y) −ERi x1,x0(ˆy|x0, y) −ERs x1,x0(ˆy|y). (4) Thm. 2 guarantees that the disparate ER with the transition from x0 to x1 is equal to the sum of the counterfactual direct ER with this transition, minus the indirect and spurious ER with reverse transition, from x1 to x0, on the sub-population x0, y. Together with Thm. 1, each decomposing term in Eq. 4 thus estimates the adverse impact of its corresponding discriminatory mechanism on the total ER disparity. For instance, in COMPAS, ERd x0,x1(ˆy1|x0, y) explains how much the direct racial discrimination accounts for the unequalized false positive rate ERx0,x1(ˆy1|y0) between non-recidivating African American (x1, y) and Caucasian (x0, y) defendants. Perhaps surprisingly, this result holds non-parametrically, which means that the counterfactual ERs decompose following Thm. 2 for any functional form of the classifier and the underlying causal models where the dataset was generated. Owed to their generality and ubiquity, we refer to this equation as the “Causal Explanation Formula” for the disparate ER in classification tasks. Connections with Other Counterfactual Measures Defs. 1-3 can be seen as a generalization of the marginal counterfactual measures, including the counterfactual effects introduced in [28] and the natural effects in [17, 11, 15]. Unable to consider the additional evidence (in classification, the true outcome Y = y), the fairness analysis framework based on these marginal measures fails to provide a fine-grained quantitative explanation of the ER disparity (as in, Thm. 2). The counterfactual fairness [10] is another counterfactual measure. As noted in [28], however, it considers only the effects along the causal paths from the protected attribute X and the outcome ˆY , thus unable to provide a full account of the X −ˆY associations, including the spurious relations. We provide in Appendix B [27] a more detailed discussion about the relationships between our measures and the existing ones. 1G|Y explicitly represents the change of information flow due to conditioning on the true outcome Y : the information via arrows pointing away from Y is intercepted; measuring the collider Y makes its (marginally independent) common causes dependent, also known as the “explaining away” effect [16, pp. 339]. 5 4 Estimating Counterfactual Error Rates The Explanation Formula provides the precise relation between the counterfactual ERs, but it does not specify how they should be estimated from data. When the underlying SCM is provided, the counterfactual direct, indirect and spurious ERs (Defs. 1-3) are all well-defined and computable via the three-step algorithm of “predictions, interventions and counterfactuals” described in [16, Ch. 7.1]. However, the SCMs are not fully known in many applications, and one must estimate the proposed counterfactual measures from the passively-collected (observational) data. Let a classifier f( ˆ pa) be denoted by f( ˆw, ˆz), where ˆZ ⊆ ˆ PA are non-descendants of both X and Y and the subset of features ˆ W = ˆ PA\ ˆZ. We first characterize a set of classifiers where such estimation is still feasible. Definition 4 (Explanation Criterion). Given a DAG G and a classifier ˆy ←f( ˆw, ˆz), a set of covariates C satisfies the explanation criterion relative to f (called the explaining set) if and only if (1) ˆZ ⊆C; (2) C ∩Forb({X, Y }, ˆ W \X) = ∅where Forb({X, Y }, ˆ W \X) is a set of descendants Wi ∈De(W)G for some W ̸∈{X, Y } on a proper causal path2 from {X, Y } to ˆ W \X in G; and (3) all spurious paths from {X, Y } to ˆ W \X in G are blocked by C. A classifier f is counterfactually explainable (ctf-explainable) if and only if it has an explaining set C satisfying Conditions 1-3. Consider again the COMPAS model of Fig. 1. The classifier f(x, w, z) has input features ˆ W = {X, W} and ˆZ = {Z}. The set C = {Z} does not satisfy the explanation criterion relative to f since it does not block the spurious path Y ←W. Indeed, one could show that there exists no set C satisfying Def. 4 relative to f, i.e., f(x, w, z) is not ctf-explainable. However, if we remove the prior convictions W from the feature set, the new classifier f(x, z) is ctf-explainable with C = {Z}: ˆ Z = C = {Z} satisfies Condition 1; Conditions 2-3 follow immediately since ˆ W \X = ∅. Defs. 4 constitutes a sufficient condition upon which the counterfactual ERs could, at least in principle, be estimated from the observational data. This yields identification formulas as shown next: Theorem 3. Given a causal diagram G and a classifier f( ˆw, ˆz), if f is ctf-explainable (Def. 4) with an explaining set C, ERd x0,x1(ˆy|x, y), ERi x0,x1(ˆy|x, y) and ERs x0,x1(ˆy|y) can be estimated as follows: ERd x0,x1(ˆy|x, y) = X ˆ w,c (P(ˆyx1, ˆ w\x,ˆz) −P(ˆyx0, ˆ w\x,ˆz))P( ˆw\x|x0, c, y)P(c|x, y), (5) ERi x0,x1(ˆy|x, y) = X ˆ w,c P(ˆyx1, ˆ w\x,ˆz)(P( ˆw\x|x1, c, y) −P( ˆw\x|x0, c, y))P(c|x, y), (6) ERs x0,x1(ˆy|y) = X ˆ w,c P(ˆyx1, ˆ w\x,ˆz)P( ˆw\x|x1, c, y)(P(c|x1, y) −P(c|x0, y)). (7) where P(ˆy ˆ w,ˆz) is well-defined, computable from the classifier f( ˆw, ˆz)3. In Eqs. 5-7, the conditional distributions P(c|x, y) and P( ˆw\x|x0, c, y) do not involve any counterfactual variable, which means that they are readily estimable by any method from the observational data (e.g., through deep nets). Continuing from the COMPAS example, we could thus estimate the counterfactual ERs of f(x, z) from the distribution P(x, y, z, w) using Thm. 3 with C = {Z}. Inverse Propensity Weighting Estimators Eqs. 5-7 involve summing over all possible values of ˆ W , C, which may present computational and sample complexity challenges as the cardinalities of ˆ W , C grow very rapidly. There exist robust statistical estimation techniques, known as the inverse propensity weighting (IPW) [12, 18], to circumvent such issues. Given the observed data D = {Yi, ˆ Wi, Ci}n i=1, we propose the IPW estimator for ERd x0,x1(ˆy|x, y) as follows: ˆ ER d x0,x1(ˆy|x, y) = 1 n n X i=1 (P(ˆyx1, ˆ Wi\Xi, ˆ Zi) −P(ˆyx0, ˆ Wi\Xi, ˆ Zi)) ˆP(x|Ci, y)I{Xi=x0,Yi=y} ˆP(x0|Ci, y) ˆP(x, y) , (8) where I{·} is an indicator function and ˆP(x, y) is the sample mean estimator of P(x, y) (X, Y are finite). ˆP(x|c, y) is a reliable estimator of the conditional distributions P(x|c, y) and, in practice, could be estimated by assuming some parametric models such as logistic regression. 2A causal path from {X, Y } to ˆ W \X is proper if it does not intersect {X, Y } except at the end point [20]. 3For a deterministic f( ˆ w, ˆz), the probabilities P(ˆy ˆ w, ˆz) = I{ˆy=f( ˆ w, ˆz)} where I{·} is an indicator function. 6 Algorithm 1: FindExpSet Input: Feature set { ˆ W , ˆ Z}, DAG G = ⟨V , E⟩ Output: Explaining set C (Def. 4) relative to f( ˆ w, ˆz) in G, or ⊥if f is not ctf-explainable. 1: Apply FindSep [22] to find a set C with ˆ Z ⊆C ⊆V \Forb({X, Y }, ˆ W \X) such that it d-separates {X, Y } and ˆ W \X in Gpbd {X,Y }, ˆ W \X. 2: return C Algorithm 3: Ctf-FairLearning Input: Samples D, DAG G, ϵd, ϵi, ϵs > 0 Output: A fair classifier f 1: Let F = C-SFFS(D, G). 2: Obtain a fair classifier f from F by solving Eq. 9 subject to |ERd| ≤ϵd, |ERi| ≤ϵi, |ERs| ≤ϵs. Algorithm 2: Causal-SFFS Input: Samples D = {Yi, Vi}n i=1, a causal diagram G Output: A family of ctf-explainable classifiers F Initialization: ˆ PA0 = ∅, k = 0. 1: while k < |V | do 2: Let subset ˆVk be defined as {vi ∈V \ ˆ PAk : FindExpSet( ˆ PAk ∪vi, G) ̸=⊥}. 3: Let vk+1 = arg maxvi∈ˆ Vk J( ˆ PAk ∪{vi}). 4: Let ˆ PAk+1 = ˆ PAk ∪vk+1; k = k + 1. 5: Continue with the conditional exclusion of [19, Step 2-3] and update the counter k. 6: end while 7: return F = {∀f : ˆ PAk →ˆY }. Theorem 4. For a ctf-explainable classifier f( ˆw, ˆz), ˆ ER d x0,x1(ˆy|x, y) (Eq. 8) is a consistent estimator for ERd x0,x1(ˆy|x, y) (Eq. 5) if the model for P(x|c, y) is correctly specified. We provide IPW estimators for counterfactual indirect and spurious ERs in Appendix A [27]. 4.1 Finding Adjustment Set for Explainable Classifiers A few natural questions arise here is (1) how to systematically test whether a classifier f is ctfexplainable, and (2) if so, to find a set C satisfying the explanation criterion so that the counterfactual ERs could be identified. In this section, we will develop an efficient method to answer these questions. Given a DAG G, by Gpbd {X,Y }, ˆ W \X we denote the proper backdoor graph obtained from G by removing the first edge of every proper causal path from {X, Y } to ˆ W \X [22]. We formulate next in graphical terms a set of identification conditions equivalent to the explanation criterion defined in Def. 4. Definition 5 (Constructive Explanation Criterion). Given a DAG G and a classifier f( ˆw, ˆz), covariates C satisfy the constructive explanation criterion relative to f if and only if (1) ˆZ ⊆C ⊆ V \Forb({X, Y }, ˆ W \X), where Forb({X, Y }, ˆ W \X) is a set of nodes forbidden by Def. 4; (2) C d-separates {X, Y } and ˆ W \X in the proper backdoor graph Gpbd {X,Y }, ˆ W \X. Theorem 5. Given a causal diagram G and a classifier f, covariates C satisfies the explanation criterion (Def. 4) to f if and only if it satisfies the constructive explanation criterion (Def. 5) to f. Thm. 5 allows us to use the algorithmic framework developed by [22] for constructing d-separating sets in DAGs. We summarize this procedure as FindExpSet, in Alg. 1. Specifically, the sub-routine FindSep find a covariates set C with ˆZ ⊆C ⊆V \Forb({X, Y }, ˆ W \X), such that C d-separates all paths between {X, Y } and ˆ W \X in Gpbd {X,Y }, ˆ W \X, i.e., the explaining set relative to classifier f( ˆw, ˆz) (Def. 4). This algorithm can be solved in O(n + m) runtime where n is the number of nodes and m is the number of edges in the proper backdoor graph Gpbd {X,Y }, ˆ W \X. 5 Achieving Equalized Counterfactual Error Rates So far we have focused on analyzing the unequalized counterfactual ERs of an existing predictor in the environment. A more interesting problem is how to obtain an optimal classifier such that its induced counterfactual ERs along with a specific discriminatory mechanism are equalized. Given finite samples D = {Yi, Vi}n i=1 drawn from P(y, v) (where the protected attribute X ∈V ), the associated causal diagram G, and a set of candidate ctf-explainable classifiers F, the goal of the supervised learning is to obtain an optimal classifier f ∗( ˆ pa) from F such that a loss function L(D, f) measuring the distance between the prediction ˆY and the true outcome Y is minimized. We will elaborate later about how to construct the ctf-explainable set F. Among the quantities evolved by Thm. 3, the counterfactual distribution P(ˆyx, ˆ w\x,ˆz) is defined from the classifier f and the other conditional distributions (e.g., P(c|x, y)) are estimable from the data D. We could thus represent a counterfactual ER (e.g., direct) of a classifier f ∈F as a function g(D, f) (e.g., Eq. 8). A fair 7 classifier is obtained by minimizing L(D, f) subject to a box constraint over g(D, f), namely, min f∈F L(D, f) s.t. |g(D, f)| ≤ϵ, (9) where ϵ ∈R+ and the smaller ϵ is, the fairer the learned classifier would be. In general, the constraints |g(D, f)| ≤ϵ are non-convex and solving the problem of Eq. 9 seems to be difficult. However, this optimization problem could be significantly simpler in certain cases, solvable using standard convex optimization methods [3]. We provide two canonical settings that fit this requirement. First, we assume that the features V are discrete, and let θˆy,x, ˆ w\x,ˆz denote the probabilities P(ˆyx, ˆ w\x,ˆz). The counterfactual constraints |g(D, f)| ≤ϵ are thus reducible to a set of linear inequalities on the parameter space {θ}. Second, consider a classifier making decision based on a decision boundary ˜Y = θ⊺φ(x, ˆw\x, ˆz) (e.g., logistic regression), where φ(·) is the basis function. The boundary ˜Y acts as a proxy to the prediction ˆY . For instance, the condition ERd x0,x1(˜y|x, y) = 0 implies ERd x0,x1(ˆy|x, y) = 0. The same reasoning applies to the counterfactual indirect and spurious ERs. We will employ the techniques in [25] and approximate the constraints |g(D, f)| ≤ϵ using the counterfactual ERs of X on the boundary ˜Y . Assume that we are interested in the mean effect and replace the quantities P(ˆyx, ˆ w\x,ˆz) in Thm. 3 with θ⊺φ(x, ˆw\x, ˆz). Given the convexity of L(D, f), Eq. 9 is a convex optimization problem and can thus be efficiently solved using standard methods. 5.1 Constructing Counterfactually Explainable Classifiers The counterfactual explainability (Def. 4) of a classifier f relies on its input feature ˆ PA: the smaller the set ˆ PA is, the easier it would be to find a explaining set C relative to f( ˆ pa). In practice, some features contain critical information about the prediction task, which means that their exclusion could lead to poorer performance. This observation suggests a novel feature selection problem in the fairness-aware classification task: we would like to find a subset ˆ PA from the available features V such that each classifier in the candidate set F = {∀f : ˆ PA →ˆY } is ctf-explainable, without significant loss of prediction accuracy. Our solution builds on the procedure FindExpSet (Alg. 1) and the classic method of Sequential Floating Forward Selection (SFFS) [19]. Let ˆ PAk be the set of k features. The score function J( ˆ pak) evaluates the candidate subset ˆ PAk and returns a measure of its “goodness”. In practice, this score could be obtained by computing the statistical measures of dependence, or by evaluating the best in-class predictive accuracy for classifiers in {∀f : ˆ PAk →ˆY } on the validation data. We denote our method by Causal SFFS (C-SFFS) and summarize it in Alg. 2. Starting with a subset ˆ PAk, C-SFFS (Step 2-3) adds one feature which gives the highest score J. FindExpSet ensures that the resulting subset ˆ PAk+1 induces a ctf-explainable classifier f( ˆ pak+1). Step 5 repeatedly removes the least significant feature vd from the newly-formed ˆ PAk until no feature could be excluded to improve the score J. During the exclusion phase, we do not apply FindExpSet, since removing features from a ctf-explainable classifier does not violate the explanation criterion (Def. 4). It follows immediately from the soundness of FindExpSet that C-SFFS always returns a ctf-explainable set F. Theorem 6. For F = C-SFFS(D, G), each classifier f ∈F is ctf-explainable. We summarize in Alg. 3 the procedure of training an optimal classifier satisfying the fairness constraints over the counterfactual ERs. ERd, ERi, and ERs stand for the counterfactual quantities ERd x0,x1(ˆy|x0, y), ERi x1,x0(ˆy|x0, y), and ERs x1,x0(ˆy|y), respectively. We use C-SFFS (Alg. 2) to obtain a candidate set F such that each f ∈F is ctf-explainable. The fair classifier is computed by solving the optimization problem in Eq. 9 subject to the box constraints over ERd, ERi, and ERs. 6 Simulations and Experiments In this section, we will illustrate our approach on both synthetic and real datasets. We focus on the false positive rate ERx0,x1(ˆy1|y0) across demographics x0 = 0, x1 = 1, where ˆy1 = 1, y0 = 0, and the corresponding components ERd x0,x1(ˆy1|x0, y0), ERi x1,x0(ˆy1|x0, y0) and ERs x1,x0(ˆy1|y0) (following Thm. 2). We shorten the notation and write ERx0,x1(ˆy1|y0) = ER, and similarly to ERd, ERi and ERs. Details of the experiments are provided in Appendix C [27]. 8 (a) Standard Prediction Model (b) COMPAS Figure 7: Results of Experiments 1-2. Measures that are not estimable via the explanation criterion are shaded and highlighted. ER stands for the false positive rate ERx0,x1(ˆy1|y0); ERd, ERi and ERs represent the corresponding counterfactual direct, indirect, and spurious ERs (Thm. 2). Classifier fopt, fer, and fctf in Exp. 1 correspond to, respectively, color blue, orange, and yellow in Fig. (a); fopt, fer, fopt-, fer-, and fctf- in Exp. 2 correspond to blue, orange, yellow, purple, and green in Fig. (b). Z X W Y D Figure 6: Standard fairness prediction model Experiment 1: Standard Prediction Model We consider a generalized COMPAS model containing the common descendant D, shown in Fig. 6, which we call here the standard fairness prediction model (for short, standard prediction model). We train two classifiers with the same feature set {X, W, Z, D} where the first is obtained via the standard, unconstrained optimization, which we call fopt, and the second one constrains the disparate ER to half of that of fopt, which we call fer. We further compute the counterfactual ERs (Defs. 1-3). The results are shown in Fig. 7(a). We first confirm that the procedure fer is sound in the sense that feo (90.4%) achieves a comparable predictive accuracy to fopt (90.4%) while reducing the disparate ER in half (ERer = −0.238, ERopt = −0.476). Second, ERd is larger in fer (ERd eo = 0.620) than in the unconstrained fopt (ERd opt = 0.381). This materializes the concern acknowledged in [7], namely, that optimizing based on ER may not be enforcing any type of real-life fairness notion related to the underlying causal mechanism. To circumvent this issue, we train a classifier with the same feature set such that its counterfactual ERs are reduced to half of that of the unconstrained fopt, called fctf. The results (Fig. 7(a)) support the counterfactual approach: fctf (90.1%) reports ER comparable to fer (ERctf = −0.238), but a smaller significant direct, indirect and spurious ER disparities (ERd ctf = 0.191, ERd ctf = −0.194, ERd ctf = −0.236). Experiment 2: COMPAS In the COMPAS model of Fig. 1, we are interested in predicting whether a defendant would recidivate, while avoiding the direct discrimination (the threshold ϵ = 0.01). We compute a classifier fer with a feature set {X, Z, W} subject to |ERer| ≤ϵ. We also include an unconstrained classifier fopt as the baseline. The results (Fig. 7(b)) reveal that fer (73.7%) and fopt (74.6%) are comparable in prediction accuracy while fer has much smaller disparate ER (ERer = −0.005, ERopt = −0.077). Given that the underlying causal model is not fully known, we could only estimate the counterfactual direct ER from passively-collected samples. Since classifiers with feature set {X, W, Z} are not ctf-explainable in the COMPAS model (Def.4), ERd of fer and fopt cannot be identified via Thm. 3. Previous analysis (Experiment 1) implies that ERd could be significant even when ER is small, which suggests one should be wary of the direct discrimination of fer and fopt. To overcome this issue, we remove W from the feature set and obtain fopt- and fer- following a similar procedure. We estimate their ERd via Thm. 3 with covariates C = {Z}. The results show that the direct discrimination are significant in both fer- and fopt- (ERd eo−= 0.015, ERd opt−= −0.066). To remove the direct discrimination, we train a classifier fctf- following Alg. 3 with the features {X, Z} and ϵd = ϵ. The results support the efficacy of Alg. 3: fctf- performs slightly worse in prediction accuracy (72.1%) but ascertains no direct discrimination (ERd ctf−= −0.001). 7 Conclusions We introduced a new family of counterfactual measures capable of explaining disparities in the misclassification rates (false positive and false negative) across different demographics in terms of the causal mechanisms underlying the specific prediction process. We then developed machinery based on these measures to allow data scientists (1) to diagnose whether a classifier is operating in a discriminatory fashion against specific groups, and (2) to learn a new classifier subject to fairness constraints in terms of fine-grained misclassification rates. In practice, this approach constitutes a formal solution to the notorious lack of interpretability of the equalized odds. We hope the causal machinery put forwarded here will help data scientists to analyze already deployed systems as well as to construct new classifiers that are fair even when the training data comes from an unfair world. 9 Acknowledgments This research is supported in parts by grants from IBM Research, Adobe Research, NSF IIS-1704352, and IIS-1750807 (CAREER). References [1] J. Angwin, J. Larson, S. Mattu, and L. Kirchner. Machine bias: There’s software used across the country to predict future criminals. and it’s biased against blacks. ProPublica, 23, 2016. [2] E. Bareinboim and J. Pearl. Causal inference and the data-fusion problem. Proceedings of the National Academy of Sciences, 113:7345–7352, 2016. [3] S. Boyd and L. Vandenberghe. Convex optimization. Cambridge university press, 2004. [4] T. Brennan, W. Dieterich, and B. Ehret. Evaluating the predictive validity of the compas risk and needs assessment system. Criminal Justice and Behavior, 36(1):21–40, 2009. [5] A. Chouldechova. Fair prediction with disparate impact: A study of bias in recidivism prediction instruments. Big data, 5(2):153–163, 2017. [6] G. Goh, A. Cotter, M. Gupta, and M. P. Friedlander. Satisfying real-world goals with dataset constraints. In Advances in Neural Information Processing Systems, pages 2415–2423, 2016. [7] 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. [8] A. E. Khandani, A. J. Kim, and A. W. Lo. Consumer credit-risk models via machine-learning algorithms. Journal of Banking & Finance, 34(11):2767–2787, 2010. [9] N. Kilbertus, M. R. Carulla, G. Parascandolo, M. Hardt, D. Janzing, and B. Schölkopf. Avoiding discrimination through causal reasoning. In Advances in Neural Information Processing Systems, pages 656–666, 2017. [10] M. J. Kusner, J. Loftus, C. Russell, and R. Silva. Counterfactual fairness. In Advances in Neural Information Processing Systems, pages 4069–4079, 2017. [11] X. W. Lu Zhang, Yongkai Wu. A causal framework for discovering and removing direct and indirect discrimination. In Proceedings of the Twenty-Sixth International Joint Conference on Artificial Intelligence, IJCAI-17, pages 3929–3935, 2017. [12] J. K. Lunceford and M. Davidian. Stratification and weighting via the propensity score in estimation of causal treatment effects: a comparative study. Statistics in medicine, 23(19):2937– 2960, 2004. [13] J. F. Mahoney and J. M. Mohen. Method and system for loan origination and underwriting, Oct. 23 2007. US Patent 7,287,008. [14] K. Mancuhan and C. Clifton. Combating discrimination using bayesian networks. Artificial Intelligence and Law, 22(2):211–238, Jun 2014. [15] R. Nabi and I. Shpitser. Fair inference on outcomes. In Proceedings of the 32nd AAAI Conference on Artificial Intelligence, 2018. [16] J. Pearl. Causality: Models, Reasoning, and Inference. Cambridge University Press, New York, 2000. 2nd edition, 2009. [17] J. Pearl. Direct and indirect effects. In Proc. of the Seventeenth Conference on Uncertainty in Artificial Intelligence, pages 411–420. Morgan Kaufmann, CA, 2001. [18] J. Pearl, M. Glymour, and N. P. Jewell. Causal inference in statistics: a primer. John Wiley & Sons, 2016. [19] P. Pudil, J. Novoviˇcová, and J. Kittler. Floating search methods in feature selection. Pattern recognition letters, 15(11):1119–1125, 1994. 10 [20] I. Shpitser, T. VanderWeele, and J. Robins. On the validity of covariate adjustment for estimating causal effects. In Proceedings of the Twenty-Sixth Conference on Uncertainty in Artificial Intelligence, pages 527–536. AUAI, Corvallis, OR, 2010. [21] L. Sweeney. Discrimination in online ad delivery. Queue, 11(3):10, 2013. [22] B. van der Zander, M. Li´skiewicz, and J. Textor. Constructing separators and adjustment sets in ancestral graphs. In Proceedings of the 30th Conference on Uncertainty in Artificial Intelligence. AUAI, 2014. [23] B. Woodworth, S. Gunasekar, M. I. Ohannessian, and N. Srebro. Learning non-discriminatory predictors. In Conference on Learning Theory, pages 1920–1953, 2017. [24] S. Wright. The method of path coefficients. The annals of mathematical statistics, 5(3):161–215, 1934. [25] M. B. Zafar, I. Valera, M. Gomez Rodriguez, and K. P. Gummadi. Fairness beyond disparate treatment & disparate impact: Learning classification without disparate mistreatment. In Proceedings of the 26th International Conference on World Wide Web, pages 1171–1180. International World Wide Web Conferences Steering Committee, 2017. [26] M. B. Zafar, I. Valera, M. G. Rogriguez, and K. P. Gummadi. Fairness constraints: Mechanisms for fair classification. In Artificial Intelligence and Statistics, pages 962–970, 2017. [27] J. Zhang and E. Bareinboim. Equality of opportunity in classification: A causal approach. Technical Report R-37, AI Lab, Purdue University., 2018. [28] J. Zhang and E. Bareinboim. Fairness in decision-making — the causal explanation formula. In Proceedings of AAAI Conference on Artificial Intelligence, pages 2037–2045, 2018. [29] J. Zhang and E. Bareinboim. Non-parametric path analysis in structural causal models. In Proceedings of the 34th Conference on Uncertainty in Artificial Intelligence, 2018. 11
2018
1008
7,253
Modern Neural Networks Generalize on Small Data Sets Matthew Olson Department of Statistics Wharton School University of Pennsylvania Philadelphia, PA 19104 maolson@wharton.upenn.edu Abraham J. Wyner Department of Statistics Wharton School University of Pennsylvania Philadelphia, PA 19104 ajw@wharton.upenn.edu Richard Berk Department of Statistics Wharton School University of Pennsylvania Philadelphia, PA 19104 berkr@wharton.upenn.edu Abstract In this paper, we use a linear program to empirically decompose fitted neural networks into ensembles of low-bias sub-networks. We show that these sub-networks are relatively uncorrelated which leads to an internal regularization process, very much like a random forest, which can explain why a neural network is surprisingly resistant to overfitting. We then demonstrate this in practice by applying large neural networks, with hundreds of parameters per training observation, to a collection of 116 real-world data sets from the UCI Machine Learning Repository. This collection of data sets contains a much smaller number of training examples than the types of image classification tasks generally studied in the deep learning literature, as well as non-trivial label noise. We show that even in this setting deep neural nets are capable of achieving superior classification accuracy without overfitting. 1 Introduction A recent focus in the deep learning community has been resolving the “paradox" that extremely large, high capacity neural networks are able to simultaneously memorize training data and achieve good generalization error. In a number of experiments, Zhang et al. [24] demonstrated that large neural networks were capable of both achieving state of the art performance on image classification tasks, as well as perfectly fitting training data with permuted labels. The apparent consequence of these observations was to question traditional measures of complexity considered in statistical learning theory. A great deal of recent research has aimed to explain the generalization ability of very high capacity neural networks [14]. A number of different streams have emerged in this literature [18, 16, 17]. The authors in Zhang et al. [24] suggest that stochastic gradient descent (SGD) may provide implicit regularization by encouraging low complexity solutions to the neural network optimization problem. As an analogy, they point out that SGD applied to under-determined least squares problems produces solutions with minimal ℓ2 norm. Other streams of research have aimed at exploring the effect of margins on generalization error [1, 16]. This line of thought is similar to the margin-based views of AdaBoost in the boosting literature that bound test performance in terms of the classifier’s confidence 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. in its predictions. Other research has investigated the sharpness of local minima found by training a neural network with SGD [9, 18]. The literature is extensive, and this review is far from complete. The empirical investigations found in this literature tend to be concentrated on a small set of image classification data sets. For instance, every research article mentioned in the last section with an empirical component considers at least on of the following four data sets: MNIST, CIFAR-10, CIFAR-100, or ImageNet. In fact, in both NIPS 2017 and ICML 2017, over half of all accepted papers that mentioned “neural networks" in the abstract or title used one of these data sets. All of these data sets share characteristics that may narrow their generality: similar problem domain, very low noise rates, balanced classes, and relatively large training sizes (60k training points at minimum). In this work, we consider a much richer class of small data sets from the UCI Machine Learning Repository in order to study the “generalization paradox." These data sets contain features not found in the image classification data, such as small sample sizes and nontrivial, heteroscedastic label noise. Although not without its faults [20], the UCI repository provides a much needed alternative to the standard image data sets. As part of our investigation we will establish that large neural networks with tens of thousands of parameters are capable of achieving superior test accuracy on data sets with only hundreds of observations. This is surprising, as it is commonly thought that deep neural networks require large data sets to train properly [19, 7]. We believe that this gap in knowledge has led to the common misbelief that unregularized, deep neural networks will necessarily overfit the types of data considered by small-data professions. In fact, we establish that with minimal tuning, deep neural networks are able to achieve performance on par with a random forest classifier, which is considered to have state-of-the-art performance on data sets from the UCI Repository [10]. The mechanism by which a random forest is able to generalize well on small data sets is straightforward: a random forest is an ensemble of low-bias, decorrelated trees. Randomization combined with averaging reduces the ensemble’s variance, smoothing out the predictions from fully grown trees. It is clear that a neural network should excel at bias reduction, but the way in which it achieves variance reduction is much more mysterious. The same paradox has been examined at length in the literature on AdaBoost, and in particular, it has been conjectured that the later stages of AdaBoost serve as a bagging phase which reduces variance [4, 5, 6, 23]. One of the central aims of this paper is to identify the variance stabilization that occurs when training a deep neural network. To this end, the later half of this paper focuses on empirically decomposing a neural network into an ensemble of sub-networks, each of which achieves low training error and less than perfect pairwise correlation. In this way, we view neural networks in a similar spirit to random forests. One can use this perspective as a window to viewing the success of recent residual network architectures that are fit with hundreds or thousands of hidden layers [13, 22]. These deeper layers might serve more as a bagging mechanism, rather than additional levels of feature hierarchy, as is commonly cited for the success of deep networks [3]. The key takeaways from this paper are summarized as follows: • Large neural networks with hundreds of parameters per training observation are able to generalize well on small, noisy data sets. • Despite a bewildering set of tuning parameters [2], neural networks can be trained on small data sets with minimal tuning. • Neural networks have a natural interpretation as an ensemble of low-bias classifiers whose pairwise correlations are less than one. This ensemble view offers a novel perspective on the generalization paradox found in the literature. 2 Ensemble View of Deep Neural Networks In this section, we establish that a neural network has a natural interpretation as an ensemble classifier. This perspective allows us to borrow insights from random forests and model stacking to gain better insight as to how a neural network with many parameters per observation is still able to generalize well on small data sets. We also outline a procedure for decomposing fitted neural networks into ensemble components of low bias, decorrelated sub-networks. This procedure will be illustrated for a number of neural networks fit to real data in Section 3.3. 2 2.1 Network Decomposition We will begin by recalling some familiar notation for a feed-forward neural network in a binary classification setting. In the case of a network with L hidden layers, each layer with M hidden nodes, we may write the network’s prediction at a point x ∈Rp as zℓ+1 = W ℓ+1g(zℓ) ℓ= 0, . . . , L f(x) = σ(zL+1) (1) where σ is the sigmoid function, g is an activation function, W L+1 ∈R1×M, W 1 ∈RM×p, and W ℓ∈RM×M for ℓ= 2, . . . , L (and z0 ≡x). Assume that any bias terms have been absorbed. For the models considered in this paper, L = 10, M = 100, and g is taken to be the elu activation function [8]. It is also helpful to abuse notation a bit, and to write zℓ(x) as the output at hidden layer ℓwhen x is fed through the network. There are many ways to decompose a neural network into an ensemble of sub-networks: one way to do this is at the final hidden layer. Let us fix an integer K ≤M and consider a matrix α ∈RM×K such that PK k=1 αm,k = W L+1 1,m for m = 1, . . . , M. We can then write the final logit output as a combination of units from the final hidden layer: zL+1(x) = W L+1g(zL(x)) = M X m=1 W L+1 1,m g(zL m(x)) = M X m=1 K X k=1 αm,kg(zL m(x)) = K X k=1 M X m=1 αm,kg(zL m(x)) = K X k=1 fk(x) (2) where fk(x) = PM m=1 αm,kg(zL m(x)). In words, we have simply decomposed the final layer of the network (at the logit level) into a sum of component networks. The weights that define the kth sub-network are stored in the kth column of α. We will find in Section 3 that networks trained on a number of binary classification problems have decompositions such that each fk fits the training data perfectly, and such that out-of-sample correlation between each fi and fj is relatively small. This situation is reminiscent of how a random forest works: by averaging the outputs of low-bias, low-correlation trees. We argue that it is through this implicit regularization mechanism that overparametrized neural networks are able to simultaneously achieve zero training error and good generalization performance. 2.2 Ensemble Hunting The decomposition in Equation 2 is of course entirely open-ended without further restrictions on α, the weights defining each sub-network. Broadly speaking, we want to search for a set of ensemble components that are both diverse and low bias. As a proxy for the latter, we impose the constraint that each sub-network achieves very high training accuracy. We will restrict our analysis to networks that obtain 100% training accuracy, and we will demand that each sub-network fk do so as well. As a proxy for diversity, we desire that each sub-network in the ensemble should be built from a different part of the full network, as much to the extent that is possible. One strategy for accomplishing this is to require that the columns of α are sparse and have non-overlapping components. In practice, we found that the integer programs required to find these matrices were computationally intractable when coupled with the other constraints we consider. Our approach was simply to force a random selection of half the entries of each column to be zero through linear constraints. We will now outline our ensemble search more precisely. For each of the K columns of α, we sampled integers (m1,k, . . . , mM/2,k) uniformly without replacement from the integers 1 to M, and 3 we included the linear constraints αmj,k,k = 0. Thus, we constrained each sub-network fk to be a weighted sum of no more than M/2 units from the final hidden layer. Under this scheme, two sub-networks share 0.25M hidden units on average, and any given hidden unit appears in about half of the sub-networks. We then used linear programming to find a matrix α ∈RM×K that satisfied the required constraints: K X k=1 αm,k = W L+1 1,m , 1 ≤m ≤M αmj,k,k = 0, 1 ≤j ≤M/2, 1 ≤k ≤K M X m=1 αm,kg(zL m(xi)) ! yi ≥0, 1 ≤i ≤n, 1 ≤k ≤K In summary, the first set of constraints ensures that the sub-networks fk decompose the full network, that is, so that zL+1(x) = PK k=1 fk(x) for all x ∈Rp. The second set of constraints zeros out half entries for each column of α, encouraging diversity among the sub-networks. The final set of constraints ensures that each sub-network achieves 100% accuracy on the training data (non-negative margin). Notice that we are simply looking for any feasible α for this system, and these constraints are rough heuristics that our sub-networks are diverse and low-bias. We could have additionally incorporated a loss function which further penalized similarity among the columns of α, such as maximizing pairwise distances between elements. However, most reasonable distance measures - such as norms or Kullback-Leibler divergence - are convex, and maximizing a convex function is difficult. Finally, we emphasize that these constraints are very demanding, and rule out trivial decompositions. For instance, in a number of experiments, we were not able to find any feasible α for networks with a small number of hidden layers. 2.3 Model Example As a first application of ensemble hunting, we will consider a simulated model in two dimensions. The response y takes values −1 and 1 according to the following probability model, where x ∈[−1, 1]2: p(y = 1|x) = 1 if ∥x∥2 ≤0.3 0.15 otherwise . The Bayes rule for this model is to assign a label y = 1 if x is inside a circle centered at the origin with radius 0.3, and to assign y = −1 otherwise. This rule implies a minimal possible classification error rate of approximately 10%. Our training set consists of 400 (x, y) pairs, where the predictors x form an evenly spaced grid of values on [−1, 1]2. We train two classifiers: a neural network with L = 10 hidden layers and M = 100 hidden nodes, and a random forest. In each case, both classifiers are trained until they achieve 100% training accuracy. The decision surfaces implied by these classifiers, as well as the Bayes rule, are plotted in Figure 1. Evaluated on a hold-out set of size n = 10, 000, the neural network and random forest achieve test accuracies of 85% and 84%, respectively. Inspecting Figure 1, we see that although each classifier fits the training data perfectly, the fits around the noise points outside the circle are confined to small neighborhoods. Our goal is to explain how these types of fits occur in practice. The bottom two figures in Figure 1 show the decision surfaces produced by the random forest and a single random forest tree. Comparing these surfaces illustrates the power of ensembling: the single tree has smaller accuracy than the large forest, as evidenced by the black patches outside of the circle. However, these patches are relatively small, and when all the trees are averaged together, much of these get smoothed out to the Bayes rule. Averaging works because the random forest trees are diverse by construction. We would like to extend this line of reasoning to explain the fit produced by the neural network. Unlike a random forest, for which it is relatively easy to find sub-ensembles with low training error and low correlation, the corresponding search in the case of neural networks requires more work. 4 (a) Bayes Rule (b) Neural Network (c) Random Forest (d) Single Tree Figure 1: In each figure, the black region indicates points for which the classifier returns a label of y = 1. Training points with class label y = 1 are shown in red, and points with class label y = −1 are shown in blue. Using the ensemble-hunting procedure outlined in the previous section, we decompose the network into K = 8 sub-networks f1, . . . , f8, and we plot their associated response surfaces in Figure 2. The test accuracies of these sub-networks range from 79% to 82%, and every classifier fits the training data perfectly by construction. When examining these surfaces, it is curious that they all look somewhat different, especially near the edges of the domain. Using the test set, we compute that the average error correlation across sub-networks is 60%. We would like to emphasize that in this example, the performance of both classifiers is actually quite good, especially compared to a more simple procedure such as CART. One surprising conclusion from this exercise was that the final layer of our fitted neural network was highly redundant: the final layer could be decomposed as 8 distinct classifiers, each of which achieved 100% training accuracy. Common intuition for the success of neural networks suggests that deep layers provide a rich hierarchy of features useful for classification [3]. For instance, when training a network to distinguish cats and dogs, earlier layers might be able to detect edges, while later layers learn to detect ears or other complicated shapes. There are no complicated features to learn in this example: the Bayes decision boundary is a circle, which can be easily constructed from a network with one hidden layer and a handful of hidden nodes. Our analysis here suggests that these later layers might serve mostly in a variance reducing capacity. The full network’s test accuracy is higher than any of its components, which is possible only since their mistakes have relatively low correlation. 3 Empirical Results In this section we will discuss the results from a large scale classification study comparing the performance of a deep neural network and a random forest on a collection of 116 data sets from the UCI Machine Learning Repository. We also discuss empirical ensemble decompositions for a number of trained neural networks from binary classification tasks. 5 (a) f1 (b) f2 (c) f3 (d) f4 (e) f5 (f) f6 (g) f7 (h) f8 Figure 2: Decision surfaces implied from a decomposition of the neural network from Section 2.3. 3.1 Data Summary The collection of data sets we consider were first analyzed in a large-scale study comparing the accuracy of 147 different classifiers [10]. This collection is salient for several reasons. First, Fernández-Delgado et al. [10] found that random forests had the best accuracy of all the classifiers in the study (neural networks with many layers were not included). Thus, random forests can be considered a gold standard to which compare competing classifiers. Second, this collection of data sets presents a very different test bed from the usual image and speech data sets found in the neural network literature. In particular, these data sets span a wide variety of domains, including agriculture, credit scoring, health outcomes, ecology, and engineering applications, to name a few. Importantly, these data sets also reflect a number of realities found in data analysis in areas apart from computer science, such as highly imbalanced classes, non-trivial Bayes error rates, and discrete (categorical) features. These data sets tend to have a small number of observations: the median number of training cases is 601, and the smallest data set has only 10 observations. It is interesting to note that these small sizes lead to highly overparameterized models: on average, each network as 155 parameters per training observation. The number of features ranges from 3 to 262, and half of data sets include categorical features. Finally, the number of classes ranges from 2 to 100. See Table 1 for a more detailed summary of the data sets. CATEGORICAL CLASSES FEATURES N MIN 0 2 3 10 25% 0 2 8 208 50% 4 3 15 601 75% 8 6 33 2201 MAX 256 100 262 67557 Table 1: Dataset Summary 3.2 Experimental Setting For each data set in our collection, we fit three classifiers: a random forest, and neural networks with and without dropout. Importantly, the training process was completely non-adaptive. One of 6 our goals was to illustrate the extent to which deep neural networks can be used as “off-the-shelf" classifiers. (a) (b) Figure 3: Plots of cross-validated accuracy. Each point corresponds to a data set. 3.2.1 Implementation Details Both networks shared the following architecture and training specifications: • 10 hidden layers • 100 nodes per layer • 200 epochs of gradient descent using Adam optimizer with a learning rate of 0.001 [15]. • He-initialization for each hidden layer [12] • Elu activation function [8]. Our choice of architecture was chosen simply to ensure that each network had the capacity to achieve perfect training accuracy in most cases. In practice, we found that networks without dropout achieved 100% training accuracy after a couple dozen epochs of training. The only difference between the networks involved the presence of explicit regularization. More specifically, one network was fit using dropout with a keep-rate of 0.85, while the other network was fit without explicit regularization. Dropout can be thought of as a ridge-type penalty is often used to mitigate over-fitting [21]. There are other types of regularization not considered in this paper, including weight decay, early stopping, and max-norm constraints. Each random forest was fit with 500 trees, using defaults known to work well in practice [6]. In particular, in each training instance, the number of randomly chosen splits to consider at each tree node was √p, where p is the number of input variables. Although we did not tune this parameter, the performance we observe is very similar to that found in [10]. We turn first to Figure 3, which plots the cross-validated accuracy of the neural network classifiers and the random forest for each data set. In the first figure, we see that a random forest outperforms an unregularized neural network on 72 out of 116 data sets, although by a small margin. The mean difference in accuracy is 2.4%, which is statistically significant at the 0.01 level by a Wilcoxon signed rank test. We notice that the gap between the two classifiers tends to be the smallest on data sets with low Bayes error rate - those points in the upper right hand portion of the plot. We also notice that there exists data sets for which either a random forest or a neural network significantly outperforms the other. For example, a neural network achieves an accuracy of 90.3% on the monks-2 data set, compared to 62.9% for a random forest. Incidentally, the base-rate for the majority class is 65.0% percent in this data set, indicating that the random forest has completely overfit the data. Turning to the second plot in Figure 3, we see that dropout improves the performance of the neural network relative to the random forest. The mean difference between classifiers is now decreased to 1.5%, which is still significant at the 0.01 level. The largest improvement in accuracy occurs in data 7 sets for which the random forest achieved an accuracy of between 75% and 85%. It is also worth noting that the performance difference between the neural networks with and without dropout is less than one percent, and this difference is not statistically significant. While it might not be surprising that explicit regularization helps when fitting noisy data sets, it is surprising that its absence does not lead to a complete collapse in performance. Neural networks with many layers are dramatically more expressive than shallow networks [3], which suggests deeper networks should also be more susceptible to fitting noise when the Bayes error rate is non-zero. We find this is not the case. (a) (b) Figure 4: The left figure displays the ratio of test error of the best sub-network to the full network, while the right figure displays the average error correlation among sub-networks. 3.3 Ensemble Formation We will now carry over the ensemble decomposition analysis from Section 2 to the binary classifiers fit in Section 3 using K = 10 sub-networks. We restrict our analysis to data sets with at least 500 observations, and for which the fitted neural network achieved 100% training accuracy. All results are reported over 25 randomly chosen 80-20 training-testing splits, and all metrics we report were obtained from the testing split. In the first figure of Figure 4, we report the test accuracy of the best sub-network as a fraction of the full network. For example, in the statlog-australian-credit data set, the average value of this fraction was 1.06 (over all 25 training-testing splits), meaning that the best sub-network outperformed the full network by 6% on average. Conversely, in other data sets, such as tic-tac-toe data set, the best sub-network had worse performance than the full network across all training-testing splits. In the second figure of Figure 4, we report the error correlation averaged over the 10 sub-networks. Ensembles of classifiers work best when the mistakes made by each component have low correlation - this is the precise motivation for the random forest algorithm. Strikingly, we observe that the errors made by the sub-networks tend to have low correlation in every data set. Empirically, this illustrates that a neural network can be decomposed as a collection of diverse sub-networks. In particular, the error correlation in the tic-tac-toe data set is around 0.25, which reconciles our observation that the full network performed better than the best sub-network. 4 Discussion We established that deep neural networks can generalize well on small, noisy data sets despite memorizing the training data. In order to explain this behavior, we offered a novel perspective on neural networks which views them through the lens of ensemble classifiers. Some commonly used wisdom when training neural networks is to choose an architecture which allows one sufficient capacity to fit the training data, and then scale back with regularization [2]. Contrast this with the mantra of a random forest: fit the training data perfectly with very deep decision trees, and then rely 8 on randomization and averaging for variance reduction 1. We have shown that the same mantra can be applied to a deep neural network. Rather than each layer presenting an ever increasing hierarchy of features, it is plausible that the final layers offer an ensemble mechanism. Finally, we remark that the small size of data sets we consider and relatively small network sizes have obvious computational advantages, which allow for rapid experimentation. Some of the recent norms proposed for explaining neural network generalization are intractable on networks with millions of parameters: Schatten norms, for example, require computing a full SVD [11]. In the settings we consider here, such calculations are trivial. Future research should aim to discern a mechanism for the decorrelation we observe, and to explore the link between decorrelation and generalization. References [1] Bartlett, P. L., Foster, D. J., and Telgarsky, M. J. (2017). Spectrally-normalized margin bounds for neural networks. In Advances in Neural Information Processing Systems, pages 6240–6249. [2] Bengio, Y. (2012). Practical recommendations for gradient-based training of deep architectures. In Neural networks: Tricks of the trade, pages 437–478. Springer. [3] Bengio, Y. et al. (2009). Learning deep architectures for ai. Foundations and trends R⃝in Machine Learning, 2(1):1–127. [4] Breiman, L. (2000a). Some infinity theory for predictor ensembles. Technical report, Technical Report 579, Statistics Dept. UCB. [5] Breiman, L. (2000b). Special invited paper. additive logistic regression: A statistical view of boosting: Discussion. The annals of statistics, 28(2):374–377. [6] Breiman, L. (2001). Random forests. Machine Learning, 45:5–32. [7] Chollet, F. (2017). Deep learning with python. Manning Publications Co. [8] Clevert, D.-A., Unterthiner, T., and Hochreiter, S. (2015). Fast and accurate deep network learning by exponential linear units (elus). arXiv preprint arXiv:1511.07289. [9] Dinh, L., Pascanu, R., Bengio, S., and Bengio, Y. (2017). Sharp minima can generalize for deep nets. In International Conference on Machine Learning, pages 1019–1028. [10] Fernández-Delgado, M., Cernadas, E., Barro, S., and Amorim, D. (2014). Do we need hundreds of classifiers to solve real world classification problems. J. Mach. Learn. Res, 15(1):3133–3181. [11] Golowich, N., Rakhlin, A., and Shamir, O. (2018). Size-independent sample complexity of neural networks. In Conference On Learning Theory, pages 297–299. [12] He, K., Zhang, X., Ren, S., and Sun, J. (2015). Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In Proceedings of the IEEE international conference on computer vision, pages 1026–1034. [13] He, K., Zhang, X., Ren, S., and Sun, J. (2016). Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770–778. [14] Kawaguchi, K., Kaelbling, L. P., and Bengio, Y. (2017). Generalization in deep learning. arXiv preprint arXiv:1710.05468. [15] Kingma, D. P. and Ba, J. L. (2015). Adam: Amethod for stochastic optimization. In Proceedings of the 3rd International Conference on Learning Representations (ICLR). [16] Liang, T., Poggio, T., Rakhlin, A., and Stokes, J. (2017). Fisher-rao metric, geometry, and complexity of neural networks. arXiv preprint arXiv:1711.01530. 1We do not intend to argue that one should always use a very deep network - the optimal architecture will of course vary from data set to data set. However, as in the case of a random forest, high capacity networks work surprisingly well in a number of settings. 9 [17] Lin, H. W., Tegmark, M., and Rolnick, D. (2017). Why does deep and cheap learning work so well? Journal of Statistical Physics, 168(6):1223–1247. [18] Neyshabur, B., Bhojanapalli, S., McAllester, D., and Srebro, N. (2017). Exploring generalization in deep learning. In Advances in Neural Information Processing Systems, pages 5947–5956. [19] Rolnick, D., Veit, A., Belongie, S., and Shavit, N. (2017). Deep learning is robust to massive label noise. arXiv preprint arXiv:1705.10694. [20] Segal, M. R. (2004). Machine learning benchmarks and random forest regression. [21] Srivastava, N., Hinton, G. E., Krizhevsky, A., Sutskever, I., and Salakhutdinov, R. (2014). Dropout: a simple way to prevent neural networks from overfitting. Journal of machine learning research, 15(1):1929–1958. [22] Veit, A., Wilber, M. J., and Belongie, S. (2016). Residual networks behave like ensembles of relatively shallow networks. In Advances in Neural Information Processing Systems, pages 550–558. [23] Wyner, A. J., Olson, M., Bleich, J., and Mease, D. (2017). Explaining the success of adaboost and random forests as interpolating classifiers. Journal of Machine Learning Research, 18(48):1– 33. [24] Zhang, C., Bengio, S., Hardt, M., Recht, B., and Vinyals, O. (2017). Understanding deep learning requires rethinking generalization. International Conference on Learning Representations. 10
2018
1009
7,254
Heterogeneous Multi-output Gaussian Process Prediction Pablo Moreno-Muñoz1 Antonio Artés-Rodríguez1 Mauricio A. Álvarez2 1Dept. of Signal Theory and Communications, Universidad Carlos III de Madrid, Spain 2Dept. of Computer Science, University of Sheffield, UK {pmoreno,antonio}@tsc.uc3m.es, mauricio.alvarez@sheffield.ac.uk Abstract We present a novel extension of multi-output Gaussian processes for handling heterogeneous outputs. We assume that each output has its own likelihood function and use a vector-valued Gaussian process prior to jointly model the parameters in all likelihoods as latent functions. Our multi-output Gaussian process uses a covariance function with a linear model of coregionalisation form. Assuming conditional independence across the underlying latent functions together with an inducing variable framework, we are able to obtain tractable variational bounds amenable to stochastic variational inference. We illustrate the performance of the model on synthetic data and two real datasets: a human behavioral study and a demographic high-dimensional dataset. 1 Introduction Multi-output Gaussian processes (MOGP) generalise the powerful Gaussian process (GP) predictive model to the vector-valued random field setup (Alvarez et al., 2012). It has been experimentally shown that by simultaneously exploiting correlations between multiple outputs and across the input space, it is possible to provide better predictions, particularly in scenarios with missing or noisy data (Bonilla et al., 2008; Dai et al., 2017). The main focus in the literature for MOGP has been on the definition of a suitable cross-covariance function between the multiple outputs that allows for the treatment of outputs as a single GP with a properly defined covariance function (Alvarez et al., 2012). The two classical alternatives to define such cross-covariance functions are the linear model of coregionalisation (LMC) (Journel and Huijbregts, 1978) and process convolutions (Higdon, 2002). In the former case, each output corresponds to a weighted sum of shared latent random functions. In the latter, each output is modelled as the convolution integral between a smoothing kernel and a latent random function common to all outputs. In both cases, the unknown latent functions follow Gaussian process priors leading to straight-forward expressions to compute the cross-covariance functions among different outputs. More recent alternatives to build valid covariance functions for MOGP include the work by Ulrich et al. (2015) and Parra and Tobar (2017), that build the cross-covariances in the spectral domain. Regarding the type of outputs that can be modelled, most alternatives focus on multiple-output regression for continuous variables. Traditionally, each output is assumed to follow a Gaussian likelihood where the mean function is given by one of the outputs of the MOGP and the variance in that distribution is treated as an unknown parameter. Bayesian inference is tractable for these models. In this paper, we are interested in the heterogeneous case for which the outputs are a mix of continuous, categorical, binary or discrete variables with different likelihood functions. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. There have been few attempts to extend the MOGP to other types of likelihoods. For example, Skolidis and Sanguinetti (2011) use the outputs of a MOGP for jointly modelling several binary classification problems, each of which uses a probit likelihood. They use an intrinsic coregionalisation model (ICM), a particular case of LMC. Posterior inference is perfomed using expectation-propagation (EP) and variational mean field. Both Chai (2012) and Dezfouli and Bonilla (2015) have also used ICM for modeling a single categorical variable with a multinomial logistic likelihood. The outputs of the ICM model are used as replacements for the linear predictors in the softmax function. Chai (2012) derives a particular variational bound for the marginal likelihood and computes Gaussian posterior distributions; and Dezfouli and Bonilla (2015) introduce an scalable inference procedure that uses a mixture of Gaussians to approximate the posterior distribution using automated variational inference (AVI) (Nguyen and Bonilla, 2014a) that requires sampling from univariate Gaussians. For the single-output GP case, the usual practice for handling non-Gaussian likelihoods has been replacing the parameters or linear predictors of the non-Gaussian likelihood by one or more independent GP priors. Since computing posterior distributions becomes intractable, different alternatives have been offered for approximate inference. An example is the Gaussian heteroscedastic regression model with variational inference (Lázaro-Gredilla and Titsias, 2011), Laplace approximation (Vanhatalo et al., 2013); and stochastic variational inference (SVI) (Saul et al., 2016). This last reference uses the same idea for modulating the parameters of a Student-t likelihood, a log-logistic distribution, a beta distribution and a Poisson distribution. The generalised Wishart process (Wilson and Ghahramani, 2011) is another example where the entries of the scale matrix of a Wishart distribution are modulated by independent GPs. Our main contribution in this paper is to provide an extension of multiple-output Gaussian processes for prediction in heterogeneous datasets. The key principle in our model is to use the outputs of a MOGP as the latent functions that modulate the parameters of several likelihood functions, one likelihood function per output. We tackle the model’s intractability using variational inference. Furthermore, we use the inducing variable formalism for MOGP introduced by Alvarez and Lawrence (2009) and compute a variational bound suitable for stochastic optimisation as in Hensman et al. (2013). We experimentally provide evidence of the benefits of simultaneously modeling heterogeneous outputs in different applied problems. Our model can be seen as a generalisation of Saul et al. (2016) for multiple correlated output functions of an heterogeneous nature. Our Python implementation follows the spirit of Hadfield et al. (2010), where the user only needs to specify a list of likelihood functions likelihood_list = [Bernoulli(), Poisson(), HetGaussian()], where HetGaussian refers to the heteroscedastic Gaussian distribution, and the number of latent parameter functions per likelihood is assigned automatically. 2 Heterogeneous Multi-output Gaussian process Consider a set of output functions Y = {yd(x)}D d=1, with x ∈Rp, that we want to jointly model using Gaussian processes. Traditionally, the literature has considered the case for which each yd(x) is continuous and Gaussian distributed. In this paper, we are interested in the heterogeneous case for which the outputs in Y are a mix of continuous, categorical, binary or discrete variables with several different distributions. In particular, we will assume that the distribution over yd(x) is completely specified by a set of parameters θd(x) ∈X Jd, where we have a generic X domain for the parameters and Jd is the number of parameters thet define the distribution. Each parameter θd,j(x) ∈θd(x) is a non-linear transformation of a Gaussian process prior fd,j(x), this is, θd,j(x) = gd,j(fd,j(x)), where gd,j(·) is a deterministic function that maps the GP output to the appropriate domain for the parameter θd,j. To make the notation concrete, let us assume an heterogeneous multiple-output problem for which D = 3. Assume that output y1(x) is binary and that it will be modelled using a Bernoulli distribution. The Bernoulli distribution uses a single parameter (the probability of success), J1 = 1, restricted to values in the range [0, 1]. This means that θ1(x) = θ1,1(x) = g1,1(f1,1(x)), where g1,1(·) could be modelled using the logistic sigmoid function σ(z) = 1/(1 + exp(−z)) that maps σ : R →[0, 1]. Assume now that the second output y2(x) corresponds to a count variable that can take values y2(x) ∈N ∪{0}. The count variable can be modelled using a Poisson distribution with a single parameter (the rate), J2 = 1, restricted to the positive reals. This means that θ2(x) = θ2,1(x) = g2,1(f2,1(x)) where g2,1(·) could be modelled as an exponential function g2,1(·) = exp(·) to ensure strictly positive values for the parameter. Finally, y3(x) is a continuous variable with heteroscedastic 2 noise. It can be modelled using a Gaussian distribution where both the mean and the variance are functions of x. This means that θ3(x) = [θ3,1(x) θ3,2(x)]⊤= [g3,1(f3,1(x)) g3,2(f3,2(x))]⊤, where the first function is used to model the mean of the Gaussian, and the second function is used to model the variance. Therefore, we can assume the g3,1(·) is the identity function and g3,2(·) is a function that ensures that the variance takes strictly positive values, e.g. the exponential function. Let us define a vector-valued function y(x) = [y1(x), y2(x), · · · , yD(x)]⊤. We assume that the outputs are conditionally independent given the vector of parameters θ(x) = [θ1(x), θ2(x), · · · , θD(x)]⊤, defined by specifying the vector of latent functions f(x) = [f1,1(x), f1,2(x), · · · f1,J1(x), f2,1(x), f2,2(x), · · · , fD,JD(x)]⊤∈RJ×1, where J = PD d=1 Jd, p(y(x)|θ(x)) = p(y(x)|f(x)) = D Y d=1 p(yd(x)|θd(x)) = D Y d=1 p(yd(x)|efd(x)), (1) where we have defined efd(x) = [fd,1(x), · · · , fd,Jd(x)]⊤∈RJd×1, the set of latent functions that specify the parameters in θd(x). Notice that J ≥D. This is, there is not always a one-to-one map from f(x) to y(x). Most previous work has assumed that D = 1, and that the corresponding elements in θd(x), this is, the latent functions in ef1(x) = [f1,1(x), · · · , f1,J1(x)]⊤are drawn from independent Gaussian processes. Important exceptions are Chai (2012) and Dezfouli and Bonilla (2015), that assumed a categorical variable y1(x), where the elements in ef1(x) were drawn from an intrinsic coregionalisation model. In what follows, we generalise these models for D > 1 and potentially heterogeneuos outputs yd(x). We will use the word “output” to refer to the elements yd(x) and “latent parameter function” (LPF) or “parameter function” (PF) to refer to fd,j(x). 2.1 A multi-parameter GP prior Our main departure from previous work is in modeling of f(x) using a multi-parameter Gaussian process that allows correlations for the parameter functions fd,j(x). We will use a linear model of corregionalisation type of covariance function for expressing correlations between functions fd,j(x), and fd′,j′(x′). The particular construction is as follows. Consider an additional set of independent latent functions U = {uq(x)}Q q=1 that will be linearly combined to produce J LPFs {fd,j(x)}Jd,D j=1,d=1. Each latent function uq(x) is assummed to be drawn from an independent GP prior such that uq(·) ∼GP(0, kq(·, ·)), where kq can be any valid covariance function, and the zero mean is assumed for simplicity. Each latent parameter fd,j(x) is then given as fd,j(x) = Q X q=1 Rq X i=1 ai d,j,qui q(x), (2) where ui q(x) are IID samples from uq(·) ∼GP(0, kq(·, ·)) and ai d,j,q ∈R. The mean function for fd,j(x) is zero and the cross-covariance function kfd,jfd′,j′ (x, x′) = cov[fd,j(x), fd′,j′(x′)] is equal to PQ q=1 bq (d,j),(d′,j′)kq(x, x′), where bq (d,j),(d′,j′) = PRq i=1 ai d,j,qai d′,j′,q. Let us define X = {xn}N n=1 ∈RN×p as a set of common input vectors for all outputs yd(x). Although, the presentation could be extended for the case of a different set of inputs per output. Let us also define fd,j = [fd,j(x1), · · · , fd,j(xN)]⊤∈RN×1; efd = [f ⊤ d,1 · · · f ⊤ d,Jd]⊤∈RJdN×1, and f = [ef ⊤ 1 · · ·ef ⊤ D]⊤∈RJN×1. The generative model for the heterogeneous MOGP is as follows. We sample f ∼N(0, K), where K is a block-wise matrix with blocks given by {Kfd,jfd′,j′ }D,D,Jd,Jd′ d=1,d′=1,j=1,j′=1. In turn, the elements in Kfd,jfd′,j′ are given by kfd,jfd′,j′ (xn, xm), with xn, xm ∈X. For the particular case of equal inputs X for all LPF, K can also be expressed as the sum of Kronecker products K = PQ q=1 AqA⊤ q ⊗Kq = PQ q=1 Bq ⊗Kq, where Aq ∈RJ×Rq has entries {ai d,j,q}D,Jd,Rq d=1,j=1,i=1 and Bq has entries {bq (d,j),(d′,j′)}D,D,Jd,Jd′ d=1,d′=1,j=1,j′=1. The matrix Kq ∈RN×N has entries given by kq(xn, xm) for xn, xm ∈X. Matrices Bq ∈RJ×J are known as the coregionalisation matrices. Once we obtain the sample for f, we evaluate the vector of parameters θ = [θ⊤ 1 · · · θ⊤ D]⊤, where θd = efd. Having specified θ, we can generate samples for the output vector y = [y⊤ 1 · · · y⊤ D]⊤∈ X DN×1, where the elements in yd are obtained by sampling from the conditional distributions 3 p(yd(x)|θd(x)). To keep the notation uncluttered, we will assume from now that Rq = 1, meaning that Aq = aq ∈RJ×1, and the corregionalisation matrices are rank-one. In the literature such model is known as the semiparametric latent factor model (Teh et al., 2005). 2.2 Scalable variational inference Given an heterogeneous dataset D = {X, y}, we would like to compute the posterior distribution for p(f|D), which is intractable in our model. In what follows, we use similar ideas to Alvarez and Lawrence (2009); Álvarez et al. (2010) that introduce the inducing variable formalism for computational efficiency in MOGP. However, instead of marginalising the latent functions U to obtain a variational lower bound, we keep their presence in a way that allows us to apply stochastic variational inference as in Hensman et al. (2013); Saul et al. (2016). 2.2.1 Inducing variables for MOGP A key idea to reduce computational complexity in Gaussian process models is to introduce auxiliary variables or inducing variables. These variables have been used already in the context of MOGP (Alvarez and Lawrence, 2009; Álvarez et al., 2010) . A subtle difference from the single output case is that the inducing variables are not taken from the same latent process, say f1(x), but from the latent processes U used also to build the model for multiple outputs. We will follow the same formalism here. We start by defining the set of M inducing variables per latent function uq(x) as uq = [uq(z1), · · · , uq(zM)]⊤, evaluated at a set of inducing inputs Z = {zm}M m=1 ∈RM×p. We also define u = [u⊤ 1 , · · · , u⊤ Q]⊤∈RQM×1. For simplicity in the exposition, we have assumed that all the inducing variables, for all q, have been evaluated at the same set of inputs Z. Instead of marginalising {uq(x)}Q q from the model in (2), we explicitly use the joint Gaussian prior p(f, u) = p(f|u)p(u). Due to the assumed independence in the latent functions uq(x), the distribution p(u) factorises as p(u) = QQ q=1 p(uq), with uq ∼N(0, Kq), where Kq ∈RM×M has entries kq(zi, zj) with zi, zj ∈Z. Notice that the dimensions of Kq are different to the dimensions of Kq in section 2.1. The LPFs fd,j are conditionally independent given u, so we can write the conditional distribution p(f|u) as p(f|u) = D Y d=1 Jd Y j=1 p(fd,j|u) = D Y d=1 Jd Y j=1 N  fd,j|Kfd,juK−1 uuu, Kfd,jfd,j −Kfd,juK−1 uuK⊤ fd,ju  , where Kuu ∈RQM×QM is a block-diagonal matrix with blocks given by Kq and Kfd,ju ∈RN×QM is the cross-covariance matrix computed from the cross-covariances between fd,j(x) and uq(z). The expression for this cross-covariance function can be obtained from (2) leading to kfd,juq(x, z) = ad,j,qkq(x, z). This form for the cross-covariance between the LPF fd,j(x) and uq(z) is a key difference between the inducing variable methods for the single-output GP case and the MOGP case. 2.2.2 Variational Bounds Exact posterior inference is intractable in our model due to the presence of an arbitrary number of non-Gaussian likelihoods. We use variational inference to compute a lower bound L for the marginal log-likelihood log p(y), and for approximating the posterior distribution p(f, u|D). Following Álvarez et al. (2010), the posterior of the LPFs f and the latent functions u can be approximated as p(f, u|y, X) ≈q(f, u) = p(f|u)q(u) = D Y d=1 Jd Y j=1 p(fd,j|u) Q Y q=1 q(uq), where q(uq) = N(uq|µuq, Suq) are Gaussian variational distributions whose parameters {µuq, Suq}Q q=1 must be optimised. Building on previous work by Saul et al. (2016); Hensman et al. (2015), we derive a lower bound that accepts any log-likelihood function that can be modulated by the LPFs f. The lower bound L for log p(y) is obtained as follows log p(y) = log Z p(y|f)p(f|u)p(u)dfdu ≥ Z q(f, u) log p(y|f)p(f|u)p(u) q(f, u) dfdu = L. 4 We can further simplify L to obtain L = Z Z p(f|u)q(u) log p(y|f)dfdu − Q X q=1 KL q(uq)||p(uq)  = Z Z D Y d=1 Jd Y j=1 p(fd,j|u)q(u) log p(y|f)dudf − Q X q=1 KL q(uq)||p(uq)  , where KL is the Kullback-Leibler divergence. Moreover, the approximate marginal posterior for fd,j is q(fd,j) = R p(fd,j|u)q(u)du, leading to q(fd,j) = N  fd,j|Kfd,juK−1 uuµu, Kfd,jfd,j + Kfd,juK−1 uu(Su −Kuu)K−1 uuK⊤ fd,ju  , where µu = [µ⊤ u1, · · · , µ⊤ uQ]⊤and Su is a block-diagonal matrix with blocks given by Suq. The expression for log p(y|f) factorises, according to (1): log p(y|f) = PD d=1 log p(yd|efd) = PD d=1 log p(yd|fd,1, · · · , fd,Jd). Using this expression for log p(y|f) leads to the following expression for the bound D X d=1 Eq(fd,1)···q(fd,Jd)  log p(yd|fd,1, · · · , fd,Jd)  − Q X q=1 KL q(uq)||p(uq)  . When D = 1 in the expression above, we recover the bound obtained in Saul et al. (2016). To maximize this lower bound, we need to find the optimal variational parameters {µuq}Q q=1 and {Suq}Q q=1. We represent each matrix Suq as Suq = LuqL⊤ uq and, to ensure positive definiteness for Suq, we estimate Luq instead of Suq. Computation of the posterior distributions over fd,j can be done analytically. There is still an intractability issue in the variational expectations on the log-likelihood functions. Since we construct these bounds in order to accept any possible data type, we need a general way to solve these integrals. One obvious solution is to apply Monte Carlo methods, however it would be slow both maximising the lower bound and updating variational parameters by sampling thousands of times (for approximating expectations) at each iteration. Instead, we address this problem by using Gaussian-Hermite quadratures as in Hensman et al. (2015); Saul et al. (2016). Stochastic Variational Inference. The conditional expectations in the bound above are also valid across data observations so that we can express the bound as D X d=1 N X n=1 Eq(fd,1(xn))···q(fd,Jd(xn))  log p(yd(xn)|fd,1(xn), · · · , fd,Jd(xn))  − Q X q=1 KL q(uq)||p(uq)  . This functional form allows the use of mini-batches of smaller sets of training samples, performing the optimization process using noisy estimates of the global objective gradient in a similar fashion to Hoffman et al. (2013); Hensman et al. (2013, 2015); Saul et al. (2016) . This scalable bound makes our multi-ouput model applicable to large heterogenous datasets. Notice that computational complexity is dominated by the inversion of Kuu with a cost of O(QM 3) and products like Kfu with a cost of O(JNQM 2). Hyperparameter learning. Hyperparameters in our model include Z, {Bq}Q q=1, and {γq}Q q=1, the hyperparameters associated to the covariance functions {kq(·, ·)}Q q=1. Since the variational distribution q(u) is sensitive to changes of the hyperparameters, we maximize the variational parameters for q(u), and the hyperparameters using a Variational EM algorithm (Beal, 2003) when employing the full dataset, or the stochastic version when using mini-batches (Hoffman et al., 2013). 2.3 Predictive distribution Consider a set of test inputs X∗. Assuming that p(u|y) ≈q(u), the predictive distribution p(y∗) can be approximated as p(y∗|y) ≈ R p(y∗|f∗)q(f∗)df∗, where q(f∗) = R p(f∗|u)q(u)du. Computing the expression q(f∗) = QD d=1 QJd j=1 q(fd,j,∗) involves evaluating Kfd,j,∗u at X∗. As in the case of 5 the lower bound, the integral above is intractable for the non-Gaussian likelihoods p(y∗|f∗). We can once again make use of Monte Carlo integration or quadratures to approximate the integral. Simpler integration problems are obtained if we are only interested in the predictive mean, E[y∗], and the predictive variance, var[y∗]. 3 Related Work The most closely related works to ours are Skolidis and Sanguinetti (2011), Chai (2012), Dezfouli and Bonilla (2015) and Saul et al. (2016). We are different from Skolidis and Sanguinetti (2011) because we allow more general heterogeneous outputs beyond the specific case of several binary classification problems. Our inference method also scales to large datasets. The works by Chai (2012) and Dezfouli and Bonilla (2015) do use a MOGP, but they only handle a single categorical variable. Our inference approach scales when compared to the one in Chai (2012) and it is fundamentally different to the one in Dezfouli and Bonilla (2015) since we do not use AVI. Our model is also different to Saul et al. (2016) since we allow for several dependent outputs, D > 1, and our scalable approach is more akin to applying SVI to the inducing variable approach of Álvarez et al. (2010). More recenty, Vanhatalo et al. (2018) used additive multi-output GP models to account for interdependencies between counting and binary observations. They use the Laplace approximation for approximating the posterior distribution. Similarly, Pourmohamad and Lee (2016) perform combined regression and binary classification with a multi-output GP learned via sequential Monte Carlo. Nguyen and Bonilla (2014b) also uses the same idea from Álvarez et al. (2010) to provide scalability for multiple-output GP models conditioning the latent parameter functions fd,j(x) on the inducing variables u, but only considers the multivariate regression case. It is also important to mention that multi-output Gaussian processes have been considered as alternative models for multi-task learning (Alvarez et al., 2012). Multi-task learning also addresses multiple prediction problems together within a single inference framework. Most previous work in this area has focused on problems where all tasks are exclusively regression or classification problems. When tasks are heterogeneous, the common practice is to introduce a regularizer per data type in a global cost function (Zhang et al., 2012; Han et al., 2017). Usually, these cost functions are compounded by additive terms, each one referring to every single task, while the correlation assumption among heterogeneous likelihoods is addressed by mixing regularizers in a global penalty term (Li et al., 2014) or by forcing different tasks to share a common mean (Ngufor et al., 2015). Another natural way of treating both continuous and discrete tasks is to assume that all of them share a common input set that varies its influence on each output. Then, by sharing a jointly sparsity pattern, it is possible to optimize a global cost function with a single regularization parameter on the level of sparsity (Yang et al., 2009). There have also been efforts for modeling heterogeneous data outside the label of multi-task learning including mixed graphical models (Yang et al., 2014), where varied types of data are assumed to be combinations of exponential families, and latent feature models (Valera et al., 2017) with heterogeneous observations being mappings of a set of Gaussian distributed variables. 4 Experiments In this section, we evaluate our model on different heterogeneous scenarios 1. To demonstrate its performance in terms of multi-output learning, prediction and scalability, we have explored several applications with both synthetic and real data. For all the experiments, we consider an RBF kernel for each covariance function kq(·, ·) and we set Q = 3. For standard optimization we used the LBFGS-B algorithm. When SVI was needed, we considered ADADELTA included in the climin library, and a mini-batch size of 500 samples in every output. All performance metrics are given in terms of the negative log-predictive density (NLPD) calculated from a test subset and applicable to any type of likelihood. Further details about experiments are included in the appendix. Missing Gap Prediction: In our first experiment, we evaluate if our model is able to predict observations in one output using training information from another one. We setup a toy problem which consists of D = 2 heterogeneous outputs, where the first function y1(x) is real and y2(x) binary. Assumming that heterogeneous outputs do not share a common input set, we observe 1The code is publicly available in the repository github.com/pmorenoz/HetMOGP/ 6 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 −6 −4 −2 0 2 4 6 Real Input Real Output Output 1: Gaussian Regression (a) 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.2 0.4 0.6 0.8 1 Real Input Binary Output Output 2: Binary Classification (b) 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.2 0.4 0.6 0.8 1 Real Input Binary Output Single Output: Binary Classification (c) Figure 1: Comparison between multi-output and single-output performance for two heterogeneous sets of observations. a) Fitted function and uncertainty for the first output. It represents the mean function parameter µ(x) for a Gaussian distribution with σ2 = 1. b) Predictive output function for binary inputs. Blue curve is the fitting function for training data and the red one corresponds to predicting from test inputs (true test binary outputs in red too). c) Same output as Figure 1(b) but training an independent Chained GP only in the single binary output (GP binary classification). N1 = 600 and N2 = 500 samples respectively. All inputs are uniformly distributed in the input range [0, 1], and we generate a gap only in the set of binary observations by removing Ntest = 150 samples in the interval [0.7, 0.9]. Using the remaining points from both outputs for training, we fitted our MOGP model. In Figures 1(a,b) we can see how uncertainty in binary test predictions is reduced by learning from the first output. In contrast, Figure 1(c) shows wider variance in the predicted parameter when it is trained independently. For the multi-output case we obtained a NLPD value for test data of 32.5 ± 0.2 × 10−2 while in the single-output case the NLPD was 40.51 ± 0.08 × 10−2. Human Behavior Data: In this experiment, we are interested in modeling human behavior in psychiatric patients. Previous work by Soleimani et al. (2018) already explores the application of scalable MOGP models to healthcare for reliable predictions from multivariate time-series. Our data comes from a medical study that asked patients to download a monitoring app (EB2)2 on their smartphones. The system captures information about mobility, communication metadata and interactions in social media. The work has a particular interest in mental health since shifts or misalignments in the circadian feature of human behavior (24h cycles) can be interpreted as early signs of crisis. Table 1: Behavior Dataset Test-NLPD (×10−2) Bernoulli Heteroscedastic Bernoulli Global HetMOGP 2.24 ± 0.21 6.09 ± 0.21 5.41 ± 0.05 13.74 ± 0.41 ChainedGP 2.43 ± 0.30 7.29 ± 0.12 5.19 ± 0.81 14.91 ± 1.05 Monday Tuesday Wednesday Thursday Friday Saturday Sunday 0 0.2 0.4 0.6 0.8 1 Output 1: Binary Presence/Absence at Home Monday Tuesday Wednesday Thursday Friday Saturday Sunday −4 −2 0 2 4 Output 2: Log-distance Distance from Home (Km) Monday Tuesday Wednesday Thursday Friday Saturday Sunday 0 0.2 0.4 0.6 0.8 1 Output 3: Binary Use/non-use of Whatsapp Figure 2: Results for multi-output modeling of human behavior. After training, all output predictions share a common (daily) periodic pattern. In particular, we obtained a binary indicator variable of presence/absence at home by monitoring latitude-longitude and measuring its distance from the patient’s home location within a 50m radius range. Then, using the already measured distances, we generated a mobility sequence with all log-distance values. Our last output consists of binary samples representing use/non-use of the 2This smartphone application can be found at https://www.eb2.tech/. 7 Whatsapp application in the smartphone. At each monitoring time instant, we used its differential data consumption to determine use or non-use of the application. We considered an entire week in seconds as the input domain, normalized to the range [0, 1]. In Figure (2), after training on N = 750 samples, we find that the circadian feature is mainly contained in the first output. During the learning process, this periodicity is transferred to the other outputs through the latent functions improving the performance of the entire model. Experimentally, we tested that this circadian pattern was not captured in mobility and social data when training outputs independently. In Table 1 we can see prediction metrics for multi-output and independent prediction. London House Price Data: Based on the large scale experiments in Hensman et al. (2013), we obtained the complete register of properties sold in the Greater London County during 2017 (https://www.gov.uk/government/collections/price-paid-data). We preprocessed it to translate all property addresses to latitude-longitude points. For each spatial input, we considered two observations, one binary and one real. The first one indicates if the property is or is not a flat (zero would mean detached, semi-detached, terraced, etc.. ), and the second one the sale price of houses. Our goal is to predict features of houses given a certain location in the London area. We used a training set of N = 20, 000 samples, 1, 000 for test predictions and M = 100 inducing points. Table 2: London Dataset Test-NLPD (×10−2) Bernoulli Heteroscedastic Global HetMOGP 6.38 ± 0.46 10.05 ± 0.64 16.44 ± 0.01 ChainedGP 6.75 ± 0.25 10.56 ± 1.03 17.31 ± 1.06 -0.51 -0.34 -0.17 -0.0 0.16 0.33 51.29 51.37 51.45 51.53 51.61 51.69 Longitude Latitude Property Type Flat Other -0.51 -0.34 -0.17 -0.0 0.16 0.33 51.29 51.37 51.45 51.53 51.61 51.69 Longitude Latitude Sale Price 79K£ 167K£ 351K£ 738K£ 1.5M£ -0.51 -0.34 -0.17 -0.0 0.16 0.33 51.29 51.37 51.45 51.53 51.61 51.69 Longitude Latitude Log-price Variance 0.3 0.6 0.9 1.2 1.5 1.8 2.1 2.4 Figure 3: Results for spatial modeling of heterogeneous data. (Top row) 10% of training samples for the Greater London County. Binary outputs are the type of property sold in 2017 and real ones are prices included in sale contracts. (Bottom row) Test prediction curves for Ntest = 2, 500 inputs. Results in Figure (3) show a portion of the entire heterogeneous dataset and its test prediction curves. We obtained a global NLPD score of 16.44 ± 0.01 using the MOGP and 17.31 ± 1.06 in the independent outputs setting (both ×10−2). There is an improvement in performance when training our multi-output model even in large scale datasets. See Table (2) for scores per each output. High Dimensional Input Data: In our last experiment, we tested our MOGP model for the arrhythmia dataset in the UCI repository (http://archive.ics.uci.edu/ml/). We use a dataset of dimensionality p = 255 and 452 samples that we divide in training, validation and test sets 8 (more details are in the appendix). We use our model for predicting a binary output (gender) and a continuous output (logarithmic age) and we compared against independent Chained GPs per output. The binary output is modelled as a Bernoulli distribution and the continuous one as a Gaussian. We obtained an average NLPD value of 0.0191 for both multi-output and independent output models with a slight difference in the standard deviation. 5 Conclusions In this paper we have introduced a novel extension of multi-output Gaussian Processes for handling heterogeneous observations. Our model is able to work on large scale datasets by using sparse approximations within stochastic variational inference. Experimental results show relevant improvements with respect to independent learning of heterogeneous data in different scenarios. In future work it would be interesting to employ convolutional processes (CPs) as an alternative to build the multi-output GP prior. Also, instead of typing hand-made definitions of heterogeneous likelihoods, we may consider to automatically discover them (Valera and Ghahramani, 2017) as an input block in a pipeline setup of our tool. Acknowledgments The authors want to thank Wil Ward for his constructive comments and Juan José Giraldo for his useful advice about SVI experiments and simulations. We also thank Alan Saul and David Ramírez for their recommendations about scalable inference and feedback on the equations. We are grateful to Eero Siivola and Marcelo Hartmann for sharing their Python module for heterogeneous likelihoods and to Francisco J. R. Ruiz for his illuminating help about the stochastic version of the VEM algorithm. Also, we would like to thank Juan José Campaña for his assistance on the London House Price dataset. Pablo Moreno-Muñoz acknowledges the support of his doctoral FPI grant BES2016-077626 and was also supported by Ministerio de Economía of Spain under the project Macro-ADOBE (TEC2015-67719-P), Antonio Artés-Rodríguez acknowledges the support of projects ADVENTURE (TEC2015-69868-C2-1-R), AID (TEC2014-62194-EXP) and CASI-CAM-CM (S2013/ICE-2845). Mauricio A. Álvarez has been partially financed by the Engineering and Physical Research Council (EPSRC) Research Projects EP/N014162/1 and EP/R034303/1. References M. Alvarez and N. D. Lawrence. Sparse convolved Gaussian processes for multi-output regression. In NIPS 21, pages 57–64, 2009. M. Álvarez, D. Luengo, M. Titsias, and N. Lawrence. Efficient multioutput Gaussian processes through variational inducing kernels. In AISTATS, pages 25–32, 2010. M. A. Alvarez, L. Rosasco, N. D. Lawrence, et al. Kernels for vector-valued functions: A review. Foundations and Trends in Machine Learning, 4(3):195–266, 2012. M. J. Beal. Variational algorithms for approximate Bayesian inference. Ph. D. Thesis, University College London, 2003. E. V. Bonilla, K. M. Chai, and C. Williams. Multi-task Gaussian process prediction. In NIPS 20, pages 153–160, 2008. K. M. A. Chai. Variational multinomial logit Gaussian process. Journal of Machine Learning Research, 13: 1745–1808, 2012. Z. Dai, M. A. Álvarez, and N. Lawrence. Efficient modeling of latent information in supervised learning using Gaussian processes. In NIPS 30, pages 5131–5139, 2017. A. Dezfouli and E. V. Bonilla. Scalable inference for Gaussian process models with black-box likelihoods. In NIPS 28, pages 1414–1422. 2015. J. D. Hadfield et al. MCMC methods for multi-response generalized linear mixed models: the MCMCglmm R package. Journal of Statistical Software, 33(2):1–22, 2010. H. Han, A. K. Jain, S. Shan, and X. Chen. Heterogeneous face attribute estimation: A deep multi-task learning approach. IEEE transactions on pattern analysis and machine intelligence, 2017. 9 J. Hensman, N. Fusi, and N. D. Lawrence. Gaussian processes for big data. In Uncertainty in Artificial Intelligence, pages 282–290, 2013. J. Hensman, A. G. d. G. Matthews, and Z. Ghahramani. Scalable variational Gaussian process classification. In AISTATS, pages 351–360, 2015. D. M. Higdon. Space and space-time modelling using process convolutions. In Quantitative methods for current environmental issues, pages 37–56, 2002. M. D. Hoffman, D. M. Blei, C. Wang, and J. Paisley. Stochastic variational inference. Journal of Machine Learning Research, 14(1):1303–1347, 2013. A. G. Journel and C. J. Huijbregts. Mining Geostatistics. Academic Press, London, 1978. M. Lázaro-Gredilla and M. Titsias. Variational heteroscedastic Gaussian process regression. In ICML, pages 841–848, 2011. S. Li, Z.-Q. Liu, and A. B. Chan. Heterogeneous multi-task learning for human pose estimation with deep convolutional neural network. In CVPR, pages 482–489, 2014. C. Ngufor, S. Upadhyaya, D. Murphree, N. Madde, D. Kor, and J. Pathak. A heterogeneous multi-task learning for predicting RBC transfusion and perioperative outcomes. In AIME, pages 287–297. Springer, 2015. T. V. Nguyen and E. V. Bonilla. Automated variational inference for Gaussian process models. In NIPS 27, pages 1404–1412. 2014a. T. V. Nguyen and E. V. Bonilla. Collaborative multi-output Gaussian processes. In UAI, 2014b. G. Parra and F. Tobar. Spectral mixture kernels for multi-output Gaussian processes. In NIPS 30, 2017. T. Pourmohamad and H. K. H. Lee. Multivariate stochastic process models for correlated responses of mixed type. Bayesian Analysis, 11(3):797–820, 2016. A. D. Saul, J. Hensman, A. Vehtari, and N. D. Lawrence. Chained Gaussian processes. In AISTATS, pages 1431–1440, 2016. G. Skolidis and G. Sanguinetti. Bayesian multitask classification with Gaussian process priors. IEEE Transactions on Neural Networks, 22(12), 2011. H. Soleimani, J. Hensman, and S. Saria. Scalable joint models for reliable uncertainty-aware event prediction. IEEE Transactions on Pattern Analysis and Machine Intelligence, 40(8):1948–1963, 2018. Y. Teh, M. Seeger, and M. Jordan. Semiparametric latent factor models. In AISTATS, pages 333–340, 2005. K. R. Ulrich, D. E. Carlson, K. Dzirasa, and L. Carin. GP kernels for cross-spectrum analysis. In NIPS 28, 2015. I. Valera and Z. Ghahramani. Automatic discovery of the statistical types of variables in a dataset. In ICML, pages 3521–3529, 2017. I. Valera, M. F. Pradier, M. Lomeli, and Z. Ghahramani. General latent feature models for heterogeneous datasets. arXiv preprint arXiv:1706.03779, 2017. J. Vanhatalo, J. Riihimäki, J. Hartikainen, P. Jylänki, V. Tolvanen, and A. Vehtari. GPstuff: Bayesian modeling with Gaussian processes. Journal of Machine Learning Research, 14(1):1175–1179, 2013. J. Vanhatalo, M. Hartmann, and L. Veneranta. Joint species distribution modeling with additive multivariate Gaussian process priors and heteregenous data. arXiv preprint arXiv:1809.02432, 2018. A. G. Wilson and Z. Ghahramani. Generalised Wishart processes. In UAI, pages 736–744, 2011. E. Yang, P. Ravikumar, G. I. Allen, Y. Baker, Y.-W. Wan, and Z. Liu. A general framework for mixed graphical models. arXiv preprint arXiv:1411.0288, 2014. X. Yang, S. Kim, and E. P. Xing. Heterogeneous multitask learning with joint sparsity constraints. In NIPS 22, pages 2151–2159, 2009. D. Zhang, D. Shen, A. D. N. Initiative, et al. Multi-modal multi-task learning for joint prediction of multiple regression and classification variables in Alzheimer’s disease. NeuroImage, 59(2):895–907, 2012. 10
2018
101
7,255
SNIPER: Efficient Multi-Scale Training Bharat Singh ∗ Mahyar Najibi ∗ Larry S. Davis University of Maryland, College Park {bharat,najibi,lsd}@cs.umd.edu Abstract We present SNIPER, an algorithm for performing efficient multi-scale training in instance level visual recognition tasks. Instead of processing every pixel in an image pyramid, SNIPER processes context regions around ground-truth instances (referred to as chips) at the appropriate scale. For background sampling, these context-regions are generated using proposals extracted from a region proposal network trained with a short learning schedule. Hence, the number of chips generated per image during training adaptively changes based on the scene complexity. SNIPER only processes 30% more pixels compared to the commonly used single scale training at 800x1333 pixels on the COCO dataset. But, it also observes samples from extreme resolutions of the image pyramid, like 1400x2000 pixels. As SNIPER operates on resampled low resolution chips (512x512 pixels), it can have a batch size as large as 20 on a single GPU even with a ResNet-101 backbone. Therefore it can benefit from batch-normalization during training without the need for synchronizing batch-normalization statistics across GPUs. SNIPER brings training of instance level recognition tasks like object detection closer to the protocol for image classification and suggests that the commonly accepted guideline that it is important to train on high resolution images for instance level visual recognition tasks might not be correct. Our implementation based on Faster-RCNN with a ResNet-101 backbone obtains an mAP of 47.6% on the COCO dataset for bounding box detection and can process 5 images per second during inference with a single GPU. Code is available at https://github.com/mahyarnajibi/SNIPER/. 1 Introduction Humans have a foveal visual system which attends to objects at a fixed distance and size. For example, when we focus on nearby objects, far away objects get blurred [7]. Naturally, it is difficult for us to focus on objects of different scales simultaneously [30]. We only process a small field of view at any given point of time and adaptively ignore the remaining visual content in the image. However, computer algorithms which are designed for instance level visual recognition tasks like object detection depart from this natural way of processing visual information. For obtaining a representation robust to scale, popular detection algorithms like Faster-RCNN/Mask-RCNN [29, 12] are trained on a multi-scale image pyramid [22, 33]. Since every pixel is processed at each scale, this approach to processing visual information increases the training time significantly. For example, constructing a 3 scale image pyramid (e.g. scales=1x,2x,3x) requires processing 14 times the number of pixels present in the original image. For this reason, it is impractical to use multi-scale training in many scenarios. Recently, it is shown that ignoring gradients of objects which are of extreme resolutions is beneficial while using multiple scales during training [33]. For example, when constructing an image pyramid of 3 scales, the gradients of large and small objects should be ignored at large and small resolutions ∗Equal Contribution 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. respectively. If this is the case, an intuitive question which arises is, do we need to process the entire image at a 3x resolution? Wouldn’t it suffice to sample a much smaller RoI (chip) around small objects at this resolution? On the other hand, if the image is already high resolution, and objects in it are also large in size, is there any benefit in upsampling that image? While ignoring significant portions of the image would save computation, a smaller chip would also lack context required for recognition. A significant portion of background would also be ignored at a higher resolution. So, there is a trade-off between computation, context and negative mining while accelerating multi-scale training. To this end, we present a novel training algorithm called Scale Normalization for Image Pyramids with Efficient Resampling (SNIPER), which adaptively samples chips from multiple scales of an image pyramid, conditioned on the image content. We sample positive chips conditioned on the ground-truth instances and negative chips based on proposals generated by a region proposal network. Under the same conditions (fixed batch normalization), we show that SNIPER performs as well as the multi-scale strategy proposed in SNIP [33] while reducing the number of pixels processed by a factor of 3 during training on the COCO dataset. Since SNIPER is trained on 512x512 size chips, it can reap the benefits of a large batch size and training with batch-normalization on a single GPU node. In particular, we can use a batch size of 20 per GPU (leading to a total batch size of 160), even with a ResNet-101 based Faster-RCNN detector. While being efficient, SNIPER obtains competitive performance on the COCO detection dataset even with simple detection architectures like Faster-RCNN. 2 Background Deep learning based object detection algorithms have primarily evolved from the R-CNN detector [11], which started with object proposals generated with an unsupervised algorithm [34], resized these proposals to a canonical 224x224 size image and classified them using a convolutional neural network [19]. This model is scale invariant, but the computational cost for training and inference for R-CNN scales linearly with the number of proposals. To alleviate this computational bottleneck, Fast-RCNN [10] proposed to project region proposals to a high level convolutional feature map and use the pooled features as a semantic representation for region proposals. In this process, the computation is shared for the convolutional layers and only lightweight fully connected layers are applied on each proposal. However, convolution for objects of different sizes is performed at a single scale, which destroys the scale invariance properties of R-CNN. Hence, inference at multiple scales is performed and detections from multiple scales are combined by selecting features from a pair of adjacent scales closer to the resolution of the pre-trained network [13, 10]. The Fast-RCNN model has since become the de-facto approach for classifying region proposals as it is fast and also captures more context in its features, which is lacking in RCNN. It is worth noting that in multi-scale training, Fast-RCNN upsamples and downsamples every proposal (whether small or big) in the image. This is unlike R-CNN, where each proposal is resized to a canonical size of 224x224 pixels. Large objects are not upsampled and small objects are not downsampled in R-CNN. In this regard, R-CNN more appropriately does not up/downsample every pixel in the image but only in those regions which are likely to contain objects to an appropriate resolution. However, R-CNN does not share the convolutional features for nearby proposals like Fast-RCNN, which makes it slow. To this end, we propose SNIPER, which retains the benefits of both these approaches by generating scale specific context-regions (chips) that cover maximum proposals at a particular scale. SNIPER classifies all the proposals inside a chip like Fast-RCNN which enables us to perform efficient classification of multiple proposals within a chip. As SNIPER does not upsample the image where there are large objects and also does not process easy background regions, it is significantly faster compared to a Fast-RCNN detector trained on an image pyramid. SNIP [33] is also trained on almost all the pixels of the image pyramid (like Fast-RCNN), although gradients arising from objects of extreme resolutions are ignored. In particular, 2 resolutions of the image pyramid (480 and 800 pixels) always engage in training and multiple 1000 pixel crops are sampled out of the 1400 pixel resolution of the image in the finest scale. SNIPER takes this cropping procedure to an extreme level by sampling 512 pixels crops from 3 scales of an image pyramid. At extreme scales (like 3x), SNIPER observes less than one tenth of the original content present in the image! Unfortunately, as SNIPER chips generated only using ground-truth instances are very small compared to the resolution of the original image, a significant portion of the background does not participate in training. This causes the false positive rate to increase. Therefore, it is important to 2 Coarsest Scale Intermediate Scale Finest Scale Finest Scale Figure 1: SNIPER Positive chip selection . SNIPER adaptively samples context regions (aka chips) based on the presence of objects inside the image. Left side: The image, ground-truth boxes (represented by green lines), and the chips in the original image scale (represented by the blue, yellow, pink, and purple rectangles). Right side: Down/up-sampling is performed considering the size of the objects. Covered objects are shown in green and invalid objects in the corresponding scale are shown as red rectangles. generate chips for background regions as well. In SNIPER, this is achieved by randomly sampling a fixed number of chips (maximum of 2 in this paper) from regions which are likely to cover false positives. To find such regions, we train a lightweight RPN network with a short schedule. The proposals of this network are used to generate chips for regions which are likely to contain false positives (this could potentially be replaced with unsupervised proposals like EdgeBoxes [42] as well). After adding negative chip sampling, the performance of SNIPER matches SNIP, but it is 3 times faster! Since we are able to obtain similar performance by observing less than one tenth of the image, it implies that very large context during training is not important for training high-performance detectors but sampling regions containing hard negatives is. 3 SNIPER We describe the major components of SNIPER in this section. One is positive/negative chip mining and the other is label assignment after chips are generated. Finally, we will discuss the benefits of training with SNIPER. 3.1 Chip Generation SNIPER generates chips Ci at multiple scales {s1, s2, .., si, ..sn} in the image. For each scale, the image is first re-sized to width (Wi) and height (Hi). On this canvas, K × K pixel chips are placed at equal intervals of d pixels (we set d to 32 in this paper). This leads to a two-dimensional array of chips at each scale. 3.2 Positive Chip Selection For each scale, there is a desired area range Ri = [ri min, ri max], i ∈[1, n] which determines which ground-truth boxes/proposals participate in training for each scale i. The valid list of ground-truth bounding boxes which lie in Ri are referred to as Gi. Then, chips are greedily selected so that maximum number of valid ground-truth boxes (Gi) are covered. A ground-truth box is said to be covered if it is completely enclosed inside a chip. All the positive chips from a scale are combined per image and are referred to as Ci pos. For each ground-truth bounding box, there always exists a chip which covers it. Since consecutive Ri contain overlapping intervals, a ground-truth bounding box may be assigned to multiple chips at different scales. It is also possible that the same ground-truth bounding box may be in multiple chips from the same scale. Ground-truth instances which have a partial overlap (IoU > 0) with a chip are cropped. All the cropped ground-truth boxes (valid or invalid) are retained in the chip and are used in label assignment. 3 Figure 2: SNIPER negative chip selection. First row: the image and the ground-truth boxes. Bottom row: negative proposals not covered in positive chips (represented by red circles located at the center of each proposal for the clarity) and the generated negative chips based on the proposals (represented by orange rectangles). In this way, every ground-truth box is covered at the appropriate scale. Since the crop-size is much smaller than the resolution of the image (i.e. more than 10x smaller for high-resolution images), SNIPER does not process most of the background at high-resolutions. This leads to significant savings in computation and memory requirement while processing high-resolution images. We illustrate this with an example shown in Figure 1. The left side of the figure shows the image with the ground-truth boxes represented by green bounding boxes. Other colored rectangles on the left side of the figure show the chips generated by SNIPER in the original image resolution which cover all objects. These chips are illustrated on the right side of the figure with the same border color. Green and red bounding boxes represent the valid and invalid ground-truth objects corresponding to the scale of the chip. As can be seen, in this example, SNIPER efficiently processes all ground-truth objects in an appropriate scale by forming 4 low-resolution chips. 3.3 Negative Chip Selection Although positive chips cover all the positive instances, a significant portion of the background is not covered by them. Incorrectly classifying background increases the false positive rate. In current object detection algorithms, when multi-scale training is performed, every pixel in the image is processed at all scales. Although training on all scales reduces the false positive rate, it also increases computation. We posit that a significant amount of the background is easy to classify and hence, we can avoid performing any computation in those regions. So, how do we eliminate regions which are easy to classify? A simple approach is to employ object proposals to identify regions where objects are likely to be present. After all, our classifier operates on region proposals and if there are no region proposals in a part of the image, it implies that it is very easy to classify as background. Hence, we can ignore those parts of the image during training. To this end, for negative chip mining, we first train RPN for a couple of epochs. No negative chips are used for training this network. The task of this network is to roughly guide us in selecting regions which are likely to contain false positives, so it is not necessary for it to be very accurate. This RPN is used to generate proposals over the entire training set. We assume that if no proposals are generated in a major portion of the image by RPN, then it is unlikely to contain an object instance. For negative chip selection, for each scale i, we first remove all the proposals which have been covered in Ci pos. Then, for each scale i, we greedily select all the chips which cover at least M proposals in Ri. This generates a set of negative chips for each scale per image, Ci neg. During training, we randomly sample a fixed number of negative chips per epoch (per image) from this pool of negative chips which are generated from all scales, i.e. Sn i=1 Ci neg. Figure 2 shows examples of the generated negative chips by SNIPER. The first row shows the image and the ground-truth boxes. In the bottom row, we show the proposals not covered by Ci pos and the corresponding negative chips generated (the orange boxes). However, for clarity, we represent each proposal by a red circle in its center. As illustrated, SNIPER only processes regions which likely contain false positives, leading to faster processing time. 4 3.4 Label Assignment Our network is trained end to end on these chips like Faster-RCNN, i.e. it learns to generate proposals as well as classify them with a single network. While training, proposals generated by RPN are assigned labels and bounding box targets (for regression) based on all the ground-truth boxes which are present inside the chip. We do not filter ground-truth boxes based on Ri. Instead, proposals which do not fall in Ri are ignored during training. So, a large ground-truth box which is cropped, could generate a valid proposal which is small. Like Fast-RCNN, we mark any proposal which has an overlap greater than 0.5 with a ground-truth box as positive and assign bounding-box targets for the proposal. Our network is trained end to end and we generate 300 proposals per chip. We do not apply any constraint that a fraction of these proposals should be re-sampled as positives [29], as in Fast-RCNN. We did not use OHEM [32] for classification and use a simple softmax cross-entropy loss for classification. For assigning RPN labels, we use valid ground-truth boxes to assign labels and invalid ground-truth boxes to invalidate anchors, as done in SNIP [33]. 3.5 Benefits For training, we randomly sample chips from the whole dataset for generating a batch. On average, we generate ∼5 chips of size 512x512 per image on the COCO dataset (including negative chips) when training on three scales (512/ms 2, 1.667, 3). This is only 30% more than the number of pixels processed per image when single scale training is performed with an image resolution of 800x1333. Since all our images are of the same size, data is much better packed leading to better GPU utilization which easily overcomes the extra 30% overhead. But more importantly, we reap the benefits of multi-scale training on 3 scales, large batch size and training with batch-normalization without any slowdown in performance on a single 8 GPU node!. It is commonly believed that high resolution images (e.g. 800x1333) are necessary for instance level recognition tasks. Therefore, for instance level recognition tasks, it was not possible to train with batch-normalization statistics computed on a single GPU. Methods like synchronized batchnormalization [22, 41] or training on 128 GPUs [28] have been proposed to alleviate this problem. Synchronized batch-normalization slows down training significantly and training on 128 GPUs is also impractical for most people. Therefore, group normalization [35] has been recently proposed so that instance level recognition tasks can benefit from another form of normalization in a low batch setting during training. With SNIPER, we show that the image resolution bottleneck can be alleviated for instance level recognition tasks. As long as we can cover negatives and use appropriate scale normalization methods, we can train with a large batch size of resampled low resolution chips, even on challenging datasets like COCO. Our results suggest that context beyond a certain field of view may not be beneficial during training. It is also possible that the effective receptive field of deep neural networks is not large enough to leverage far away pixels in the image, as suggested in [24]. In very large datasets like OpenImagesV4 [18] containing 1.7 million images, most objects are large and images provided are high resolution (1024x768), so it is less important to upsample images by 3×. In this case, with SNIPER, we generate 3.5 million chips of size 512x512 using scales of (512/ms, 1). Note that SNIPER also performs adaptive downsampling. Since the scales are smaller, chips would cover more background, due to which the impact of negative sampling is diminished. In this case (of positive chip selection), SNIPER processes only half the number of pixels compared to naïve multi-scale training on the above mentioned scales in OpenImagesV4. Due to this, we were able to train Faster-RCNN with a ResNet-101 backbone on 1.7 million images in just 3 days on a single 8 GPU node! 4 Experimental Details We evaluate SNIPER on the COCO dataset for object detection. COCO contains 123,000 images in the training and validation set and 20,288 images in the test-dev set. We train on the combined training and validation set and report results on the test-dev set. Since recall for proposals is not provided by the evaluation server, we train on 118,000 images and report recall on the remaining 5,000 images (commonly referred to as the minival set). 2max(widthim,heightim) 5 Method AR AR50 AR75 0-25 25-50 50-100 100-200 200-300 ResNet-101 With Neg 65.4 93.2 76.9 41.3 65.8 74.5 76.9 78.7 ResNet-101 W/o Neg 65.4 93.2 77.6 40.8 65.7 74.7 77.4 79.3 Table 1: We plot the recall for SNIPER with and without negatives. Surprisingly, recall is not effected by negative chip sampling On COCO, we train SNIPER with a batch-size of 128 and with a learning rate of 0.015. We use a chip size of 512×512 pixels. Training scales are set to (512/ms, 1.667, 3) where ms is the maximum value width and height of the image3. The desired area ranges (i.e. Ri) are set to (0,802), (322, 1502), and (1202, inf) for each of the scales respectively. Training is performed for a total of 6 epochs with step-down at the end of epoch 5. Image flipping is used as a data-augmentation technique. Every epoch requires 11,000 iterations. For training RPN without negatives, each epoch requires 7000 iterations. We use RPN for generating negative chips and train it for 2 epochs with a fixed learning rate of 0.015 without any step-down. Therefore, training RPN for 2 epochs requires less than 20% of the total training time. RPN proposals are extracted from all scales. Note that inference takes 1/3 the time for a full forward-backward pass and we do not perform any flipping for extracting proposals. Hence, this process is also efficient. We use mixed precision training as described in [27]. To this end, we re-scale weight-decay by 100, drop the learning rate by 100 and rescale gradients by 100. This ensures that we can train with activations of half precision (and hence ∼2x larger batch size) without any loss in accuracy. We use fp32 weights for the first convolution layer, last convolution layer in RPN (classification and regression) and the fully connected layers in Faster-RCNN. We evaluate SNIPER using a popular detector, Faster-RCNN with ResNets [14, 15] and MobileNetV2 [31]. Proposals are generated using RPN on top of conv4 features and classification is performed after concatenating conv4 and conv5 features. In the conv5 branch, we use deformable convolutions and a stride of 1. We use a 512 dimensional feature map in RPN. For the classification branch, we first project the concatenated feature map to 256 dimensions and then add 2 fully connected layers with 1024 hidden units. For lightweight networks like MobileNetv2 [31], to preserve the computational processing power of the network, we did not make any architectural changes to the network like changing the stride of the network or added deformable convolutions. We reduced the RPN dimension to 256 and size of fc layers to 512 from 1024. RPN and classification branch are both applied on the layer with stride 32 for MobileNetv2. SNIPER generates 1.2 million chips for the COCO dataset after the images are flipped. This results in around 5 chips per image. In some images which contain many object instances, SNIPER can generate as many as 10 chips and others where there is a single large salient object, it would only generate a single chip. In a sense, it reduces the imbalance in gradients propagated to an instance level which is present in detectors which are trained on full resolution images. At least in theory, training on full resolution images is biased towards large object instances. 4.1 Recall Analysis We observe that recall (averaged over multiple overlap thresholds 0.5:0.05:0.95) for RPN does not decrease if we do not perform negative sampling. This is because recall does not account for false positives. As shown in Section 4.2, this is in contrast to mAP for detection in which negative sampling plays an important role. Moreover, in positive chip sampling, we do cover every ground truth sample. Therefore, for generating proposals, it is sufficient to train on just positive samples. This result further bolsters SNIPER’s strategy of finding negatives based on an RPN in which the training is performed just on positive samples. 4.2 Negative Chip Mining and Scale SNIPER uses negative chip mining to reduce the false positive rate while speeding up the training by skipping the easy regions inside the image. As proposed in Section 3.3, we use a region proposal network trained with a short learning schedule to find such regions. To evaluate the effectiveness of our negative mining approach, we compare SNIPER’s mean average precision with a slight variant 3For the first scale, zero-padding is used if the smaller side of the image becomes less than 512 pixels. 6 Method Backbone AP AP50 AP75 APS APM APL SNIPER ResNet-101 46.1 67.0 51.6 29.6 48.9 58.1 SNIPER 2 scale ResNet-101 43.3 63.7 48.6 27.1 44.7 56.1 SNIPER w/o negatives ResNet-101 43.4 62.8 48.8 27.4 45.2 56.2 Table 2: The effect training on 2 scales (1.667 and max size of 512). We also show the impact in performance when no negative mining is performed. which only uses positive chips during training (denoted as SNIPER w/o neg). All other parameters remain the same. Table 2 compares the performance of these models. The proposed negative chip mining approach noticeably improves AP for all localization thresholds and object sizes. Noticeably, negative chip mining improves the average precision from 43.4 to 46.1. This is in contrast to the last section where we were evaluating proposals. This is because mAP is affected by false positives. If we do not include regions in the image containing negatives which are similar in appearance to positive instances, it would increase our false positive rate and adversely affect detection performance. SNIPER is an efficient multi-scale training algorithm. In all experiments in this paper we use the aforementioned three scales (See Section 4 for the details). To show that SNIPER effectively benefits from multi-scale training, we reduce the number of scales from 3 to 2 by dropping the high resolution scale. Table 2 shows the mean average precision for SNIPER under these two settings. As can be seen, by reducing the number of scales, the performance consistently drops by a large margin on all evaluation metrics. 4.3 Timing It takes 14 hours to train SNIPER end to end on a 8 GPU V100 node with a Faster-RCNN detector which has a ResNet-101 backbone. It is worth noting that we train on 3 scales of an image pyramid (max size of 512, 1.667 and 3). Training RPN is much more efficient and it only takes 2 hours for pre-training. Not only is SNIPER efficient in training, it can also process around 5 images per second on a single V100 GPU. For better utilization of resources, we run multiple processes in parallel during inference and compute the average time it takes to process a batch of 100 images. 4.4 Inference We perform inference on an image pyramid and scale the original image to the following resolutions (480, 512), (800, 1280) and (1400, 2000). The first element is the minimum size with the condition that the maximum size does not exceed the second element. The valid ranges for training and inference are similar to SNIP [33]. For combining the detections, we use Soft-NMS [4]. We do not perform flipping [39], iterative bounding box regression [9] or mask tightening [22]. 4.5 Comparison with State-of-the-art It is difficult to fairly compare different detectors as they differ in backbone architectures (like ResNet [14], ResNext [36], Xception [6]), pre-training data (e.g. ImageNet-5k, JFT [16], OpenImages [18]), different structures in the underlying network (e.g multi-scale features [20, 26], deformable convolutions [8], heavier heads [28], anchor sizes, path aggregation [22]), test time augmentations like flipping, mask tightening, iterative bounding box regression etc. Therefore, we compare our results with SNIP [33], which is a recent method for training object detectors on an image pyramid. The results are presented in Table 3. Without using batch normalization [17], SNIPER achieves comparable results. While SNIP [33] processes almost all the image pyramid, SNIPER on the other hand, reduces the computational cost by skipping easy regions. Moreover, since SNIPER operates on a lower resolution input, it reduces the memory footprint. This allows us to increase the batch size and unlike SNIP [33], we can benefit from batch normalization during training. With batch normalization, SNIPER significantly outperforms SNIP in all metrics. It should be noted that not only the proposed method is more accurate, it is also 3× faster during training. To the best of our knowledge, for a Faster-RCNN architecture with a ResNet-101 backbone (with deformable convolutions), our reported result of 46.1% is state-of-the-art. This result improves to 7 Method Backbone AP AP50 AP75 APS APM APL SSD MobileNet-v2 22.1 SNIP ResNet-50 (fixed BN) 43.6 65.2 48.8 26.4 46.5 55.8 ResNet-101 (fixed BN) 44.4 66.2 49.9 27.3 47.4 56.9 MobileNet-V2 34.1 54.4 37.7 18.2 36.9 46.2 ResNet-50 (fixed BN) 43.5 65.0 48.6 26.1 46.3 56.0 SNIPER ResNet-101 46.1 67.0 51.6 29.6 48.9 58.1 ResNet-101 + OpenImages 46.8 67.4 52.5 30.5 49.4 59.6 ResNet-101 + OpenImages + Seg Binary 47.1 67.8 52.8 30.2 49.9 60.2 ResNet-101 + OpenImages + Seg Softmax 47.6 68.5 53.4 30.9 50.6 60.7 SNIPER ResNet-101 + OpenImages + Seg Softmax 38.9 62.9 41.8 19.6 41.2 55.0 SNIPER ResNet-101 + OpenImages + Seg Binary 41.3 65.4 44.9 21.4 43.5 58.7 Table 3: Ablation analysis and comparison with full resolution training. Last two rows show instance segmentation results when the mask head is trained with N+1 way softmax loss and binary softmax loss for N classes. 46.8% if we pre-train the detector on the OpenImagesV4 dataset. Adding an instance segmentation head and training the detection network along with it improves the performance to 47.6%. With our efficient batch inference pipeline, we can process 5 images per second on a single V100 GPU and still obtain an mAP of 47.6%. This implies that on modern GPUs, it is practical to perform inference on an image pyramid which includes high resolutions like 1400x2000. We also show results for Faster-RCNN trained with MobileNetV2. It obtains an mAP of 34.1% compared to the SSDLite [31] version which obtained 22.1%. This again highlights the importance of image pyramids (and SNIPER training) as we can improve the performance of the detector by 12%. We also show results for instance segmentation. The network architecture is same as Mask-RCNN [12], just that we do not use FPN [20] and use the same detection architecture which was described for object detection. For multi-tasking, we tried two variants of loss functions for training the mask branch. One was a foreground-background softmax function for N classes and another was a N+1 way softmax function. For instance segmentation, the network which is trained with 2-way Softmax loss for each class clearly performs better. But, for object detection, the N+1 way Softmax loss leads to slightly better results. We only use 3 scales during inference and do not perform flipping, mask tightening, iterative bounding-box regression, padding masks before resizing etc. Our instance segmentation results are preliminary and we have only trained 2 models so far. 5 Related Work SNIPER benefits from multiple techniques which were developed over the last year. Notably, it was shown that it is important to train with batch normalization statistics [28, 22, 41] for tasks like object detection and semantic segmentation. This is one important reason for SNIPER’s better performance. SNIPER also benefits from a large batch size which was shown to be effective for object detection [28]. Like SNIP [33], SNIPER ignores gradients of objects at extreme scales in the image pyramid to improve multi-scale training. In the past, many different methods have been proposed to understand the role of context [38, 1, 25], scale [5, 37, 20, 26] and sampling [21, 32, 2, 3]. Considerable importance has been given to leveraging features of different layers of the network and designing architectures for explicitly encoding context/multi-scale information [26, 23, 39, 40] for classification. Our results highlight that context may not be very important for training high performance object detectors. 6 Conclusion and Future Work We presented an algorithm for efficient multi-scale training which sampled low resolution chips from a multi-scale image pyramid to accelerate multi-scale training by a factor of 3 times. In doing so, SNIPER did not compromise on the performance of the detector due to effective sampling techniques for positive and negative chips. As SNIPER operates on re-sampled low resolution chips, it can be trained with a large batch size on a single GPU which brings it closer to the protocol for training image 8 classification. This is in contrast with the common practice of training on high resolution images for instance-level recognition tasks. In future, we would like to accelerate multi-scale inference, because a significant portion of the background can be eliminated without performing expensive computation. It would also be interesting to evaluate at what chip resolution does context start to hurt the performance of object detectors. 7 Acknowledgement The authors would like to thank an Amazon Machine Learning gift for the AWS credits used for this research. The research is based upon work supported by the Office of the Director of National Intelligence (ODNI), Intelligence Advanced Research Projects Activity (IARPA), via DOI/IBC Contract Numbers D17PC00287 and D17PC00345. The U.S. Government is authorized to reproduce and distribute reprints for Governmental purposes not withstanding any copyright annotation thereon. Disclaimer: The views and conclusions contained herein are those of the authors and should not be interpreted as necessarily representing the official policies or endorsements, either expressed or implied of IARPA, DOI/IBC or the U.S. Government. References [1] S. Bell, C. Lawrence Zitnick, K. Bala, and R. Girshick. Inside-outside net: Detecting objects in context with skip pooling and recurrent neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2874–2883, 2016. [2] V. P. Boda and P. Narayan. Sampling rate distortion. IEEE Transactions on Information Theory, 63(1):563– 574, 2017. [3] V. P. Boda and P. Narayan. Universal sampling rate distortion. IEEE Transactions on Information Theory, 2018. [4] N. Bodla, B. Singh, R. Chellappa, and L. S. Davis. Soft-nms—improving object detection with one line of code. In 2017 IEEE International Conference on Computer Vision (ICCV), pages 5562–5570. IEEE, 2017. [5] Z. Cai, Q. Fan, R. S. Feris, and N. Vasconcelos. A unified multi-scale deep convolutional neural network for fast object detection. In European Conference on Computer Vision, pages 354–370. Springer, 2016. [6] F. Chollet. Xception: Deep learning with depthwise separable convolutions. CVPR, 2017. [7] M. Corbetta and G. L. Shulman. Control of goal-directed and stimulus-driven attention in the brain. Nature reviews neuroscience, 3(3):201, 2002. [8] J. Dai, H. Qi, Y. Xiong, Y. Li, G. Zhang, H. Hu, and Y. Wei. Deformable convolutional networks. ICCV, 2017. [9] S. Gidaris and N. Komodakis. Locnet: Improving localization accuracy for object detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 789–798, 2016. [10] R. Girshick. Fast r-cnn. In Computer Vision (ICCV), 2015 IEEE International Conference on, pages 1440–1448. IEEE, 2015. [11] R. Girshick, J. Donahue, T. Darrell, and J. Malik. Rich feature hierarchies for accurate object detection and semantic segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 580–587, 2014. [12] K. He, G. Gkioxari, P. Dollár, and R. Girshick. Mask r-cnn. In Computer Vision (ICCV), 2017 IEEE International Conference on, pages 2980–2988. IEEE, 2017. [13] 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. [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] K. He, X. Zhang, S. Ren, and J. Sun. Identity mappings in deep residual networks. In European Conference on Computer Vision, pages 630–645. Springer, 2016. 9 [16] G. Hinton, O. Vinyals, and J. Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015. [17] S. Ioffe and C. Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. ICML, 2015. [18] I. Krasin, T. Duerig, N. Alldrin, V. Ferrari, S. Abu-El-Haija, A. Kuznetsova, H. Rom, J. Uijlings, S. Popov, S. Kamali, M. Malloci, J. Pont-Tuset, A. Veit, S. Belongie, V. Gomes, A. Gupta, C. Sun, G. Chechik, D. Cai, Z. Feng, D. Narayanan, and K. Murphy. Openimages: A public dataset for large-scale multi-label and multi-class image classification. Dataset available from https://storage.googleapis.com/openimages/web/index.html, 2017. [19] 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. [20] T.-Y. Lin, P. Dollár, R. Girshick, K. He, B. Hariharan, and S. Belongie. Feature pyramid networks for object detection. In CVPR, pages 936–944, 2017. [21] T.-Y. Lin, P. Goyal, R. Girshick, K. He, and P. Dollár. Focal loss for dense object detection. IEEE transactions on pattern analysis and machine intelligence, 2018. [22] S. Liu, L. Qi, H. Qin, J. Shi, and J. Jia. Path aggregation network for instance segmentation. CVPR, 2018. [23] W. Liu, D. Anguelov, D. Erhan, C. Szegedy, S. Reed, C.-Y. Fu, and A. C. Berg. Ssd: Single shot multibox detector. In European conference on computer vision, pages 21–37. Springer, 2016. [24] W. Luo, Y. Li, R. Urtasun, and R. Zemel. Understanding the effective receptive field in deep convolutional neural networks. In Advances in Neural Information Processing Systems, pages 4898–4906, 2016. [25] R. Mottaghi, X. Chen, X. Liu, N.-G. Cho, S.-W. Lee, S. Fidler, R. Urtasun, and A. Yuille. The role of context for object detection and semantic segmentation in the wild. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 891–898, 2014. [26] M. Najibi, P. Samangouei, R. Chellappa, and L. Davis. SSH: Single stage headless face detector. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4875–4884, 2017. [27] S. Narang, G. Diamos, E. Elsen, P. Micikevicius, J. Alben, D. Garcia, B. Ginsburg, M. Houston, O. Kuchaiev, G. Venkatesh, et al. Mixed precision training. ICLR, 2018. [28] C. Peng, T. Xiao, Z. Li, Y. Jiang, X. Zhang, K. Jia, G. Yu, and J. Sun. Megdet: A large mini-batch object detector. CVPR, 2018. [29] 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. [30] R. A. Rensink. The dynamic representation of scenes. Visual cognition, 7(1-3):17–42, 2000. [31] M. Sandler, A. Howard, M. Zhu, A. Zhmoginov, and L.-C. Chen. Mobilenetv2: Inverted residuals and linear bottlenecks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4510–4520, 2018. [32] A. Shrivastava, A. Gupta, and R. Girshick. Training region-based object detectors with online hard example mining. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 761–769, 2016. [33] B. Singh and L. S. Davis. An analysis of scale invariance in object detection-snip. CVPR, 2018. [34] J. R. Uijlings, K. E. Van De Sande, T. Gevers, and A. W. Smeulders. Selective search for object recognition. International journal of computer vision, 104(2):154–171, 2013. [35] Y. Wu and K. He. Group normalization. arXiv:1803.08494, 2018. [36] S. Xie, R. Girshick, P. Dollár, Z. Tu, and K. He. Aggregated residual transformations for deep neural networks. In Computer Vision and Pattern Recognition (CVPR), 2017 IEEE Conference on, pages 5987–5995. IEEE, 2017. [37] F. Yang, W. Choi, and Y. Lin. Exploit all the layers: Fast and accurate cnn object detector with scale dependent pooling and cascaded rejection classifiers. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2129–2137, 2016. 10 [38] F. Yu and V. Koltun. Multi-scale context aggregation by dilated convolutions. arXiv preprint arXiv:1511.07122, 2015. [39] S. Zagoruyko, A. Lerer, T.-Y. Lin, P. O. Pinheiro, S. Gross, S. Chintala, and P. Dollár. A multipath network for object detection. BMVC, 2016. [40] X. Zeng, W. Ouyang, J. Yan, H. Li, T. Xiao, K. Wang, Y. Liu, Y. Zhou, B. Yang, Z. Wang, et al. Crafting gbd-net for object detection. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017. [41] H. Zhao, J. Shi, X. Qi, X. Wang, and J. Jia. Pyramid scene parsing network. In IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), pages 2881–2890, 2017. [42] C. L. Zitnick and P. Dollár. Edge boxes: Locating object proposals from edges. In European Conference on Computer Vision, pages 391–405. Springer, 2014. 11
2018
102
7,256
Soft-Gated Warping-GAN for Pose-Guided Person Image Synthesis Haoye Dong1,2 , Xiaodan Liang3,∗, Ke Gong1 , Hanjiang Lai1,2 , Jia Zhu4 , Jian Yin1,2 1School of Data and Computer Science, Sun Yat-sen University 2Guangdong Key Laboratory of Big Data Analysis and Processing, Guangzhou 510006, P.R.China 3School of Intelligent Systems Engineering, Sun Yat-sen University 4School of Computer Science, South China Normal University {donghy7@mail2, laihanj3@mail, issjyin@mail}.sysu.edu.cn {xdliang328, kegong936}@gmail.com, jzhu@m.scun.edu.cn Abstract Despite remarkable advances in image synthesis research, existing works often fail in manipulating images under the context of large geometric transformations. Synthesizing person images conditioned on arbitrary poses is one of the most representative examples where the generation quality largely relies on the capability of identifying and modeling arbitrary transformations on different body parts. Current generative models are often built on local convolutions and overlook the key challenges (e.g. heavy occlusions, different views or dramatic appearance changes) when distinct geometric changes happen for each part, caused by arbitrary pose manipulations. This paper aims to resolve these challenges induced by geometric variability and spatial displacements via a new Soft-Gated Warping Generative Adversarial Network (Warping-GAN), which is composed of two stages: 1) it first synthesizes a target part segmentation map given a target pose, which depicts the region-level spatial layouts for guiding image synthesis with higher-level structure constraints; 2) the Warping-GAN equipped with a soft-gated warping-block learns feature-level mapping to render textures from the original image into the generated segmentation map. Warping-GAN is capable of controlling different transformation degrees given distinct target poses. Moreover, the proposed warping-block is lightweight and flexible enough to be injected into any networks. Human perceptual studies and quantitative evaluations demonstrate the superiority of our WarpingGAN that significantly outperforms all existing methods on two large datasets. 1 Introduction Person image synthesis, posed as one of most challenging tasks in image analysis, has huge potential applications for movie making, human-computer interaction, motion prediction, etc. Despite recent advances in image synthesis for low-level texture transformations [13, 35, 14] (e.g. style or colors), the person image synthesis is particularly under-explored and encounters with more challenges that cannot be resolved due to the technical limitations of existing models. The main difficulties that affect the generation quality lie in substantial appearance diversity and spatial layout transformations on clothes and body parts, induced by large geometric changes for arbitrary pose manipulations. Existing models [20, 21, 28, 8, 19] built on the encoder-decoder structure lack in considering the crucial shape and appearance misalignments, often leading to unsatisfying generated person images. Among recent attempts of person image synthesis, the best-performing methods (PG2 [20], BodyROI7 [21], and DSCF [28]) all directly used the conventional convolution-based generative models ∗Corresponding author is Xiaodan Liang 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. CVPR2017 NIPS2017 CVPR2018 CVPR2018 Real Image pix2pix [13] PG2 [20] BodyROI7 [21] DSCF [28] Ours Figure 1: Comparison against the state-of-the-art methods on DeepFashion [36], based on the same condition images and the target poses. Our results are shown in the last column. Zoom in for details. by taking either the image and target pose pairs or more body parts as inputs. DSCF [28] employed deformable skip connections to construct the generator and can only transform the images in a coarse rectangle scale using simple affinity property. However, they ignore the most critical issue (i.e. large spatial misalignment) in person image synthesis, which limits their capabilities in dealing with large pose changes. Besides, they fail to capture structure coherence between condition images with target poses due to the lack of modeling higher-level part-level structure layouts. Hence, their results suffer from various artifacts, blurry boundaries, missing clothing appearance when large geometric transformations are requested by the desirable poses, which are far from satisfaction. As the Figure 1 shows, the performance of existing state-of-the-art person image synthesis methods is disappointing due to the severe misalignment problem for reaching target poses. In this paper, we propose a novel Soft-Gated Warping-GAN to address the large spatial misalignment issues induced by geometric transformations of desired poses, which includes two stages: 1) a poseguided parser is employed to synthesize a part segmentation map given a target pose, which depicts part-level spatial layouts to better guide the image generation with high-level structure constraints; 2) a Warping-GAN renders detailed appearances into each segmentation part by learning geometric mappings from the original image to the target pose, conditioned on the predicted segmentation map. The Warping-GAN first trains a light-weight geometric matcher and then estimates its transformation parameters between the condition and synthesized segmentation maps. Based on the learned transformation parameters, the Warping-GAN incorporates a soft-gated warping-block which warps deep feature maps of the condition image to render the target segmentation map. Our Warping-GAN has several technical merits. First, the warping-block can control the transformation degree via a soft gating function according to different pose manipulation requests. For example, a large transformation will be activated for significant pose changes while a small degree of transformation will be performed for the case that the original pose and target pose are similar. Second, warping informative feature maps rather than raw pixel values could help synthesize more realistic images, benefiting from the powerful feature extraction. Third, the warping-block can adaptively select effective feature maps by attention layers to perform warping. Extensive experiments demonstrate that the proposed Soft-Gated Warping-GAN significantly outperforms the existing state-of-the-art methods on pose-based person image synthesis both qualitatively 2 and quantitatively, especially for large pose variation. Additionally, human perceptual study further indicates the superiority of our model that achieves remarkably higher scores compared to other methods with more realistic generated results. 2 Relation Works Image Synthesis. Driven by remarkable results of GANs [10], lots of researchers leveraged GANs to generate images [12, 6, 18]. DCGANs [24] introduced an unsupervised learning method to effectively generate realistic images, which combined convolutional neural networks (CNNs) with GANs. Pix2pix [13] exploited a conditional adversarial networks (CGANs) [22] to tackle the image-to-image translation tasks, which learned the mapping from condition images to target images. CycleGAN [35], DiscoGAN [15], and DualGAN [33] each proposed an unsupervised method to generate the image from two domains with unlabeled images. Furthermore, StarGAN [5] proposed a unified model for image-to-image transformations task towards multiple domains, which is effective on young-to-old, angry-to-happy, and female-to-male. Pix2pixHD [30] used two different scales residual networks to generate the high-resolution images by two steps. These approaches are capable of learning to generate realistic images, but have limited scalability in handling posed-based person synthesis, because of the unseen target poses and the complex conditional appearances. Unlike those methods, we proposed a novel Soft-Gated Warping-GAN that pays attention to pose alignment in deep feature space and deals with textures rendering on the region-level for synthesizing person images. Person Image Synthesis. Recently, lots of studies have been proposed to leverage adversarial learning for person image synthesis. PG2 [20] proposed a two-stage GANs architecture to synthesize the person images based on pose keypoints. BodyROI7 [21] applied disentangle and restructure methods to generate person images from different sampling features. DSCF [28] introduced a special U-Net [26] structure with deformable skip connections as a generator to synthesize person images from decomposed and deformable images. AUNET [8] presented a variational U-Net for generating images conditioned on a stickman (more artificial pose information), manipulating the appearance and shape by a variational Autoencoder. Skeleton-Aided [32] proposed a skeleton-aided method for video generation with a standard pix2pix [13] architecture, generating human images base on poses. [1] proposed a modular GANs, separating the image into different parts and reconstructing them by target pose. [23] essentially used CycleGAN [35] to generate person images, which applied conditioned bidirectional generators to reconstruct the original image by the pose. VITON [11] used a coarse-to-fine strategy to transfer a clothing image into a fixed pose person image. CP-VTON [29] learns a thin-plate spline transformation for transforming the in-shop clothes into fitting the body shape of the target person via a Geometric Matching Module (GMM). However, all methods above share a common problem, ignoring the deep feature maps misalignment between the condition and target images. In this paper, we exploit a Soft-Gated Warping-GAN, including a pose-guided parser to generate the target parsing, which guides to render textures on the specific part segmentation regions, and a novel warping-block to align the image features, which produces more realistic-look textures for synthesizing high-quality person images conditioned on different poses. 3 Soft-Gated Warping-GAN Our goal is to change the pose of a given person image to another while keeping the texture details, leveraging the transformation mapping between the condition and target segmentation maps. We decompose this task into two stages: pose-guided parsing and Warping-GAN rendering. We first describe the overview of our Soft-Gated Warping-GAN architecture. Then, we discuss the pose-guided parsing and Warping-GAN rendering in details, respectively. Next, we present the warping-block design and the pipeline for estimating transformation parameters and warping images, which benefits to generate realistic-looking person images. Finally, we give a detailed description of the synthesis loss functions applied in our network. 3.1 Network Architectures Our pipeline is a two-stage architecture for pose-guided parsing and Warping-GAN rendering respectively, which includes a human parsing parser, a pose estimator, and the affine [7]/TPS [2, 25] (Thin-Plate Spline) transformation estimator. Notably, we make the first attempt to estimate the 3 Parser … Geometric Matcher … Stage I: Pose-Guided Parsing Stage II: Warping-GAN Rendering WarpingBlock Condition Image Condition Image Target pose Target Pose Condition Parsing Synthesized Parsing Synthesized Parsing Target Parsing Synthesized Image Target Image Condition Parsing Residual Blocks Residual Blocks Encoder Encoder Decoder Decoder Encoder Figure 2: The overview of our Soft-Gated Warping-GAN. Given a condition image and a target pose, our model first generates the target parsing using a pose-guided parser. We then estimate the transformations between the condition and target parsing by a geometric matcher following a soft-gated warping-block to warp the image features. Subsequently, we concatenate the warped feature maps, embedded pose, and synthesized parsing to generate the realistic-looking image. transformation of person part segmentation maps for generating person images. In stage I, we first predict the human parsing based on the target pose and the parsing result from the condition image. The synthesized parsing result is severed as the spatial constraint to enhance the person coherence. In stage II, we use the synthesized parsing result from the stage I, the condition image, and the target pose jointly to trained a deep warping-block based generator and a discriminator, which is able to render the texture details on the specific regions. In both stages, we only take the condition image and the target pose as input. In contrast to AUNET [8](using ’stickman’ to represent pose, involving more artificial and constraint for training), we are following PG2 [20] to encode the pose with 18 heatmaps. Each heatmap has one point that is filled with 1 in 4-pixel radius circle and 0 elsewhere. 3.1.1 Stage I: Pose-Guided Parsing To learn the mapping from condition image to the target pose on a part-level, a pose-guide parser is introduced to generate the human parsing of target image conditioned on the pose. The synthesized human parsing contains pixel-wise class labels that can guide the image generation on the class-level, as it can help to refine the detailed appearance of parts, such as face, clothes, and hands. Since the DeepFashion and Market-1501 dataset do not have human parsing labels, we use the LIP [9] dataset to train a human parsing network. The LIP [9] dataset consists of 50,462 images and each person has 20 semantic labels. To capture the refined appearance of the person, we transfer the synthesized parsing labels into an one-hot tensor with 20 channels. Each channel is a binary mask vector and denotes the one class of person parts. These vectors are trained jointly with condition image and pose to capture the information from both the image features and the structure of the person, which benefits to synthesize more realistic-looking person images. Adapted from Pix2pix [13], the generator of the pose-guided parser contains 9 residual blocks. In addition, we utilize a pixel-wise softmax loss from LIP [9] to enhance the quality of results. As shown in Figure 2, the pose-guided parser consists of one ResNet-like generator, which takes condition image and target pose as input, and outputs the target parsing which obeys the target pose. 3.1.2 Stage II: Warping-GAN Rendering In this stage, we exploit a novel region-wise learning to render the texture details based on specific regions, guided by the synthesized parsing from the stage I. Formally, Let Ii = P(li) denote the function for the region-wise learning, where Ii and li denote the i-th pixel value and the class label of this pixel respectively. And i (0 ≤i < n) denotes the index of pixel in image. n is the total number 4 Matching Layer Pose-Guided Parser Parser Warping Condition Image Target Pose Warped Image Transformation Grid Condition parsing Synthesized Parsing Feature Extractor Feature Extractor Regression Network Figure 3: The architecture of Geometric Matcher. We first produce a condition parsing from the condition image by a parser. Then, we synthesize the target parsing with the target pose and the condition parsing. The condition and synthesized parsing are passed through two feature extractors, respectively, following a feature matching layer and a regression network. The condition image is warped using the transformation grid in the end. of pixels in one image. Note that in this work, the segmentation map also named parsing or human parsing, since our method towards the person images. However, the misalignments between the condition and target image lead to generate blurry values. To alleviate this problem, we further learn the mapping between condition image and target pose by introducing two novel approaches: the geometric matcher and the soft-gated warping-block transfer. Inspired by the geometric matching method, GEO [25], we propose a parsing-based geometric matching method to estimate the transformation between the condition and synthesized parsing. Besides, we design a novel block named warping-block for warping the condition image on a partlevel, using the synthesized parsing from stage I. Note that, those transformation mappings are estimated from the parsing, which we can use to warp the deep features of condition image. Geometric Matcher. We train a geometric matcher to estimate the transformation mapping between the condition and synthesized parsing, as illustrate in Figure 3. Different from GEO [25], we handle this issue as parsing context matching, which can also estimate the transformation effectively. Due to the lack of the target image in the test phrase, we use the condition and synthesized parsing to compute the transformation parameters. In our method, we combine affine and TPS to obtain the transformation mapping through a siamesed convolutional neural network following GEO [25]. To be specific, we first estimate the affine transformation between the condition and synthesized parsing. Based on the results from affine estimation, we then estimate TPS transformation parameters between warping results from the affine transformation and target parsing. The transformation mappings are adopted to transform the extracted features of the condition image, which helps to alleviate the misalignment problem. Feature Map Warped Feature Map Transformation Grid Figure 4: The architecture of soft-gated warping-block. Zoom in for details. Soft-gated Warping-Block. Inspired by [3], having obtained the transformation mapping from the geometric matcher, we subsequently use this mapping to warp deep feature maps, which is able to capture the significant high-level information and thus help to synthesize image in an approximated shape with more realistic-looking details. We combine the affine [7] and TPS [2] (Thin-Plate Spline transformation) as the transformation operation of the warpingblock. As shown in Figure 4, we denote those transformations as the transformation grid. Formally, let Φ(I) denotes the deep feature map, R(Φ(I)) denotes the residual feature map from Φ(I), W(I) represents the operation of the transformation grid. Thus, we regard T(I) as the transformation operation, we then formulate the transformation mapping of the warping-block as: T(Φ(I)) = Φ(I) + W(I) · R(Φ(I)), (1) where · denotes the matrix multiplication, we denote e as the element of W(I), e ∈[0, 1], which acts as the soft gate of residual feature maps to address the misalignment problem caused by different poses. Hence, the warping-block can control the transformation degree via a soft-gated function 5 according to different pose manipulation requests, which is light-weight and flexible to be injected into any generative networks. 3.1.3 Generator and Discriminator Feature map 0 Feature map 1 Feature map 2 Real or Fake? Fake Pair Real Pair Figure 5: The overview of discriminator in stage II. Zoom in for details. Generator. Adapted from pix2pix [13], we build two residual-like generators. One generator in stage I contains standard residual blocks in the middle, and another generator adds the warping-block following encoder in stage II. As shown in Figure 2, Both generators consist of an encoder, a decoder and 9 residual blocks. Discriminator. To achieve a stabilized training, inspired by [30], we adopt the pyramidal hierarchy layers to build the discriminator in both stages, as illustrated in Figure 5. We combine condition image, target keypoints, condition parsing, real/synthesized parsing, and real/synthesized image as input for the discriminator. We observe that feature maps from the pyramidal hierarchy discriminator benefits to enhance the quality of synthesized images. More details are shown in the following section. 3.2 Objective Functions We aim to build a generator that synthesizes person image in arbitrary poses. Due to the complex details of the image and the variety of poses, it’s challenging for training generator well. To address these issues, we apply four losses to alleviate them in different aspects, which are adversarial loss Ladv [10], pixel-wise loss Lpixel [32], perceptual loss Lperceptual [14, 11, 17] and pyramidal hierarchy loss LPH. As the Fig 5 shown, the pyramidal hierarchy contains useful and effective feature maps at different scales in different layers of the discriminator. To fully leverage these feature maps, we define a pyramidal hierarchy loss, as illustrated in Eq. 2. LPH = n X i=0 αi∥Fi(ˆI) −Fi(I)∥1, (2) where Fi(I) denotes the i-th (i = 0, 1, 2) layer feature map from the trained discriminator. We also use L1 norm to calculate the losses of feature maps of each layer and sum them with the weight αi. The generator objective is a weighted sum of different losses, written as follows. Ltotal = λ1Ladv + λ2Lpixel + λ3Lperceptual + λ4LPH, (3) where λi denotes the weight of i-loss, respectively. 4 Experiments We perform extensive experiments to evaluate the capability of our approach against recent methods on two famous datasets. Moreover, we further perform a human perceptual study on the Amazon Mechanical Turk (AMT) to evaluate the visualized results of our method. Finally, we demonstrate an ablation study to verify the influence of each important component in our framework. 4.1 Datasets and Implementation Details DeepFashion [36] consists of 52,712 person images in fashion clothes with image size 256×256. Following [20, 21, 28], we remove the failure case images with pose estimator [4] and human parser [9], then extract the image pairs that contain the same person in same clothes with two different poses. We select 81,414 pairs as our training set and randomly select 12,800 pairs for testing. Market-1501 [34] contains 322,668 images collected from 1,501 persons with image size 128×64. According to [34, 20, 21, 28], we extract the image pairs that reach about 600,000. Then we also randomly select 12,800 pairs as the test set and 296,938 pairs for training. 6 Table 1: Comparison on DeepFashion and Market-1501 datasets. DeepFashion [36] Market-1501 [34] Model SSIM IS SSIM IS pix2pix [13] (CVPR2017) 0.692 3.249 0.183 2.678 PG2 [20] (NIPS2017) 0.762 3.090 0.253 3.460 DSCF [28] (CVPR2018) 0.761 3.351 0.290 3.185 UPIS [23] (CVPR2018) 0.747 2.97 – – AUNET [8] (CVPR2018) 0.786 3.087 0.353 3.214 BodyROI7 [21] (CVPR2018) 0.614 3.228 0.099 3.483 w/o parsing 0.692 3.146 0.236 2.489 w/o soft-gated warping-block 0.777 3.262 0.337 3.394 w/o Ladv 0.780 3.430 0.346 3.332 w/o Lperceptual 0.772 3.446 0.319 3.407 w/o Lpixel 0.780 3.270 0.337 3.292 w/o LPH 0.776 3.323 0.337 3.448 Ours (full) 0.793 3.314 0.356 3.409 Table 2: Pairwise comparison with other approaches. Chance is at 50%. Each cell lists the percentage where our result is preferred over the other method. pix2pix [13] PG2 [20] BodyROI7 [21] DSCF [28] DeepFashion [36] 98.7% 87.3% 96.3% 79.6% Market-1501 [34] 83.4% 67.7% 68.4% 62.1% Evaluation Metrics: We use the Amazon Mechanical Turk (AMT) to evaluate the visual quality of synthesized results. We also apply Structural SIMilarity (SSIM) [31] and Inception Score (IS) [27] for quantitative analysis. Implementation Details. Our network architecture is adapted from pix2pixHD [30], which has presented remarkable results for synthesizing images. The architecture consists of an generator with encoder-decoder structure and a multi-layer discriminator. The generator contains three downsampling layers, three upsampling layers, night residual blocks, and one Warping-Block block. We apply three different scale convolutional layers for the discriminator, and extract features from those layers to compute the Pyramidal Hierarchy loss (PH loss), as the Figure 5 shows. We use the Adam [16] optimizer and set β1 = 0.5, β2 = 0.999. We use learning rate of 0.0002. We use batch size of 12 for Deepfashion, and 20 for Market-1501. 4.2 Quantitative Results To verify the effectiveness of our method, we conduct experiments on two benchmarks and compare against six recent related works. To obtain fair comparisons, we directly use the results provided by the authors. The comparison results and the advantages of our approach are also clearly shown in the numerical scores in Table 1. Our proposed method consistently outperforms all baselines for the SSIM metric on both datasets, thanks to the Soft-Gated Warping-GAN which can render high-level structure textures and control different transformation for the geometric variability. Our network also achieves comparable results for the IS metric on two datasets, which confirms the generalization ability of our Soft-Gated Warping-GAN. 4.3 Human Perceptual Study We further evaluate our algorithm via a human subjective study. We perform pairwise A/B tests deployed on the Amazon Mechanical Turk (MTurk) platform on the DeepFashion [36] and the Market-1501 [34]. The workers are given two generated person images at once. One is synthesized by our method and the other is produced by the compared approach. They are then given unlimited time to select which image looks more natural. Our method achieves significantly better human 7 Condition Image Target Pose Target Image CVPR2017 pix2pix NIPS2017 PG2 CVPR2018 BodyROI7 CVPR2018 DSCF Ours Figure 6: Comparison against the recent state-of-theart methods, based on the same condition image and the target pose. Our results on DeepFashion [36] are shown in the last column. Zoom in for details. Condition Image Target Pose Target Image Ours NIPS2017 PG2 CVPR2018 BodyROI7 CVPR2018 DSCF CVPR2017 pix2pix Figure 7: Comparison against the recent stateof-the-art methods, based on the same condition image and the target pose. Our results on Market-1501 [34] shown in the last column. evaluation scores, as summarized in Table 2. For example, compared to BodyROI7 [21], 96.3% workers determine that our method generated more realistic person images on DeepFashion [36] dataset. This superior performance confirms the effectiveness of our network comprised of a human parser and the soft-gated warping-block, which synthesizes more realistic and natural person images. 4.4 Qualitative Results We next present and discuss a series of qualitative results that will highlight the main characteristics of the proposed approach, including its ability to render textures with high-level semantic part segmentation details and to control the transformation degrees conditioned on various poses. The qualitative results on the DeepFashion [36] and the Market-1501 [34] are visualized in Figure 6 and Figure 7. Existed methods create blurry and coarse results without considering to render the details of target clothing items by human parsing. Some methods produce sharper edges, but also cause undesirable artifacts missing some parts. In contrast to these methods, our approach accurately and seamlessly generates more detailed and precise virtual person images conditioned on different target poses. However, there are some blurry results on Market-1501 [34], which might result from that the performance of the human parser in our model may be influenced by the low-resolution images. We will present and analyze more visualized results and failure cases in the supplementary materials. 4.5 Ablation study To verify the impact of each component of the proposed method, we conduct an ablation study on DeepFashion [36] and Market-1501 [34]. As shown in Table 1 and Figure 8, we report evaluation results of the different versions of the proposed method. We first compare the results using poseguided parsing to the results without using it. From the comparison, we can learn that incorporating the human parser into our generator significantly improves the performance of generation, which can depict the region-level spatial layouts for guiding image synthesis with higher-level structure constraints by part segmentation maps. We then examine the effectiveness of the proposed soft-gated warping-block. From Table 1 and Figure 8, we observe that the performance drops dramatically without the soft-gated warping-block. The results suggest the improved performance attained by the warping-block insertion is not merely due to the additional parameters, but the effective mechanism inherently brought by the warping operations which act as a soft gate to control different transformation degrees according to the pose manipulations. We also study the importance of each term in our objective function. As can be seen, adding each of the four losses can substantially enhance the results. 5 Conclusion In this work, we presented a novel Soft-Gated Warping-GAN for addressing pose-guided person image synthesis, which aims to resolve the challenges induced by geometric variability and spatial 8 w/o parsing w/o soft-gated warping-block w/o pixel-wise loss w/o perceptual loss w/o PH loss w/o adv loss Ours(Full) Condition Image Target Pose Target Image Figure 8: Ablation studies on DeepFashion [36]. Zoom in for details. displacements. Our approach incorporates a human parser to produce a target part segmentation map to instruct image synthesis with higher-level structure information, and a soft-gated warping-block to warp the feature maps for rendering the textures. Effectively controlling different transformation degrees conditioned on various target poses, our proposed Soft-Gated Warping-GAN can generate remarkably realistic and natural results with the best human perceptual score. Qualitative and quantitative experimental results demonstrate the superiority of our proposed method, which achieves state-of-the-art performance on two large datasets. Acknowledgements This work is supported by the National Natural Science Foundation of China (61472453, U1401256, U1501252, U1611264, U1711261, U1711262, 61602530), and National Natural Science Foundation of China (NSFC) under Grant No. 61836012. References [1] Guha Balakrishnan, Amy Zhao, Adrian V Dalca, Fredo Durand, and John Guttag. Synthesizing images of humans in unseen poses. In CVPR, 2018. [2] Fred L. Bookstein. Principal warps: Thin-plate splines and the decomposition of deformations. IEEE Transactions on pattern analysis and machine intelligence, 11(6):567–585, 1989. [3] Kaidi Cao, Yu Rong, Cheng Li, Xiaoou Tang, and Chen Change Loy. Pose-robust face recognition via deep residual equivariant mapping. In CVPR, pages 5187–5196, 2018. [4] Zhe Cao, Tomas Simon, Shih-En Wei, and Yaser Sheikh. Realtime multi-person 2d pose estimation using part affinity fields. In CVPR, 2017. [5] Yunjey Choi, Minje Choi, Munyoung Kim, Jung-Woo Ha, Sunghun Kim, and Jaegul Choo. Stargan: Unified generative adversarial networks for multi-domain image-to-image translation. In CVPR, 2018. [6] Zhijie Deng, Hao Zhang, Xiaodan Liang, Luona Yang, Shizhen Xu, Jun Zhu, and Eric P Xing. Structured generative adversarial networks. In Advances in Neural Information Processing Systems, pages 3899–3909, 2017. 9 [7] Ping Dong and Nikolas P Galatsanos. Affine transformation resistant watermarking based on image normalization. In ICIP (3), pages 489–492, 2002. [8] Patrick Esser, Ekaterina Sutter, and Björn Ommer. A variational u-net for conditional appearance and shape generation. In CVPR, 2018. [9] Ke Gong, Xiaodan Liang, Xiaohui Shen, and Liang Lin. Look into person: Self-supervised structure-sensitive learning and a new benchmark for human parsing. In CVPR, pages 6757– 6765, 2017. [10] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In NIPS, pages 2672–2680, 2014. [11] Xintong Han, Zuxuan Wu, Zhe Wu, Ruichi Yu, and Larry S Davis. Viton: An image-based virtual try-on network. arXiv preprint arXiv:1711.08447, 2017. [12] Zhiting Hu, Zichao Yang, Ruslan Salakhutdinov, Xiaodan Liang, Lianhui Qin, Haoye Dong, and Eric Xing. Deep generative models with learnable knowledge constraints. NIPS, 2018. [13] Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. In CVPR, 2017. [14] Justin Johnson, Alexandre Alahi, and Li Fei-Fei. Perceptual losses for real-time style transfer and super-resolution. In ECCV, pages 694–711, 2016. [15] Taeksoo Kim, Moonsu Cha, Hyunsoo Kim, Jungkwon Lee, and Jiwon Kim. Learning to discover cross-domain relations with generative adversarial networks. arXiv preprint arXiv:1703.05192, 2017. [16] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. [17] Christian Ledig, Lucas Theis, Ferenc Huszár, Jose Caballero, Andrew Cunningham, Alejandro Acosta, Andrew Aitken, Alykhan Tejani, Johannes Totz, Zehan Wang, et al. Photo-realistic single image super-resolution using a generative adversarial network. In CVPR, pages 105–114, 2017. [18] Xiaodan Liang, Lisa Lee, Wei Dai, and Eric P Xing. Dual motion gan for future-flow embedded video prediction. In IEEE International Conference on Computer Vision (ICCV), volume 1, 2017. [19] Xiaodan Liang, Hao Zhang, Liang Lin, and Eric Xing. Generative semantic manipulation with mask-contrasting gan. In Proceedings of the European Conference on Computer Vision (ECCV), pages 558–573, 2018. [20] Liqian Ma, Xu Jia, Qianru Sun, Bernt Schiele, Tinne Tuytelaars, and Luc Van Gool. Pose guided person image generation. In NIPS, 2017. [21] Liqian Ma, Qianru Sun, Stamatios Georgoulis, Luc Van Gool, Bernt Schiele, and Mario Fritz. Disentangled person image generation. In CVPR, 2018. [22] Mehdi Mirza and Simon Osindero. Conditional generative adversarial nets. arXiv preprint arXiv:1411.1784, 2014. [23] Albert Pumarola, Antonio Agudo, Alberto Sanfeliu, and Francesc Moreno-Noguer. Unsupervised person image synthesis in arbitrary poses. In CVPR, 2018. [24] Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. In ICLR, 2016. [25] I. Rocco, R. Arandjelovi´c, and J. Sivic. Convolutional neural network architecture for geometric matching. In CVPR, 2017. 10 [26] Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In MICCAI, pages 234–241, 2015. [27] Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, Xi Chen, and Xi Chen. Improved techniques for training gans. In NIPS, 2016. [28] Aliaksandr Siarohin, Enver Sangineto, Stephane Lathuiliere, and Nicu Sebe. Deformable gans for pose-based human image generation. In CVPR, 2018. [29] Bochao Wang, Huabin Zheng, Xiaodan Liang, Yimin Chen, Liang Lin, and Meng Yang. Toward characteristic-preserving image-based virtual try-on network. ECCV, 2018. [30] Ting-Chun Wang, Ming-Yu Liu, Jun-Yan Zhu, Andrew Tao, Jan Kautz, and Bryan Catanzaro. High-resolution image synthesis and semantic manipulation with conditional gans. arXiv preprint arXiv:1711.11585, 2017. [31] Zhou Wang, Alan C Bovik, Hamid R Sheikh, and Eero P Simoncelli. Image quality assessment: from error visibility to structural similarity. TIP, 13(4):600–612, 2004. [32] Yichao Yan, Jingwei Xu, Bingbing Ni, Wendong Zhang, and Xiaokang Yang. Skeleton-aided articulated motion generation. In ACM MM, 2017. [33] Zili Yi, Hao Zhang, Ping Tan, and Minglun Gong. Dualgan: Unsupervised dual learning for image-to-image translation. arXiv preprint, 2017. [34] Liang Zheng, Liyue Shen, Lu Tian, Shengjin Wang, Jingdong Wang, and Qi Tian. Scalable person re-identification: A benchmark. In ICCV, pages 1116–1124, 2015. [35] Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In ICCV, 2017. [36] Shi Qiu Xiaogang Wang Ziwei Liu, Ping Luo and Xiaoou Tang. Deepfashion: Powering robust clothes recognition and retrieval with rich annotations. In CVPR, pages 1096–1104, 2016. 11
2018
103
7,257
∆-encoder: an effective sample synthesis method for few-shot object recognition Eli Schwartz*1,2, Leonid Karlinsky*1, Joseph Shtok1, Sivan Harary1, Mattias Marder1, Abhishek Kumar1, Rogerio Feris1, Raja Giryes2 and Alex M. Bronstein3 1IBM Research AI 2School of Electrical Engineering, Tel-Aviv University, Tel-Aviv, Israel 3Department of Computer Science, Technion, Haifa, Israel Abstract Learning to classify new categories based on just one or a few examples is a long-standing challenge in modern computer vision. In this work, we propose a simple yet effective method for few-shot (and one-shot) object recognition. Our approach is based on a modified auto-encoder, denoted ∆-encoder, that learns to synthesize new samples for an unseen category just by seeing few examples from it. The synthesized samples are then used to train a classifier. The proposed approach learns to both extract transferable intra-class deformations, or "deltas", between same-class pairs of training examples, and to apply those deltas to the few provided examples of a novel class (unseen during training) in order to efficiently synthesize samples from that new class. The proposed method improves the state-of-the-art of one-shot object-recognition and performs comparably in the few-shot case. * The authors have contributed equally to this work Corresponding author: Leonid Karlinsky (leonidka@il.ibm.com) Figure 1: Visualization of two-way one-shot classification trained on synthesized examples. Correctly classified images are framed in magenta (Golden retriever) and yellow (African wild dog). The only two images seen at training time and used for sample synthesis are framed in blue. Note the non-trivial relative arrangement of examples belonging to different classes handled successfully by our approach. The figure is plotted using t-SNE applied to VGG features. Best viewed in color. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. 1 Introduction Following the great success of deep learning, the field of visual classification has made a significant leap forward, reaching – and in some cases, surpassing – human levels performance (usually when expertise is required) [24, 37]. Starting from AlexNet [23], followed by VGG [38], Google Inception [42], ResNet [18], DenseNet [20] and NASNet [54] the field made tremendous advances in classification performance on large-scale datasets, such as ImageNet [5], with thousands of examples per category. However, it is known that we humans are particularly good at learning new categories on the go, from seeing just a few or even a single example [24]. This is especially evident in early childhood, when a parent points and names an object and a child can immediately start finding more of its kind in the surroundings. While the exact workings of the human brain are very far from being fully understood, one can conjecture that humans are likely to learn from analogies. That is, we identify in new objects elements of some latent semantic structure, present in other, already familiar categories, and use this structure to construct our internal classifier for the new category. Similarly, in the domain of computer vision, we assume that we can use the plentiful set of examples (instances) of the known classes (represented in some latent semantic space), in order to learn to sample from the distributions of the new classes, the ones for which we are given just one or a few examples. Teaching a neural network to sample from distributions of new visual categories, based on just a few observed examples, is the essence of our proposed approach. First, the proposed approach learns to extract and later to sample (synthesize) transferable non-linear deformations between pairs of examples of seen (training) classes. We refer to these deformations as "deltas" in the feature space. Second, it learns to apply those deltas to the few provided examples of novel categories, unseen during training, in order to efficiently synthesize new samples from these categories. Thus, in the few-shot scenario, we are able to synthesize enough samples of each new category to train a classifier in the standard supervised fashion. Our proposed solution is a simple, yet effective method (in the light of the obtained empirical results) for learning to sample from the class distribution after being provided with one or a few examples of that class. It exhibits improved performance compared to the state-of-the-art methods for few-shot classification on a variety of standard few-shot classification benchmarks. 2 Related work Few-shot learning by metric learning: a number of approaches [47, 39, 36] use a large corpus of instances of known categories to learn an embedding into a metric space where some simple (usually L2) metric is then used to classify instances of new categories via proximity to the few labeled training examples embedded in the same space. In [13], a metric learning method based on graph neural networks, that goes beyond the L2 metric, have been proposed. The metric-learning-based approaches are either posed as a general discriminative distance metric learning (DML) scheme [36], or optimized to operate in the few shot scenario [39, 47, 13]. These approaches show great promise, and in some cases are able to learn embedding spaces with quite meaningful semantics embedded in the metric [36]. Yet, their performance is in many cases inferior to the meta-learning and generative (synthesis) approaches that will be discussed next. Few-shot meta-learning (learning-to-learn): these approaches are trained on few-shot tasks instead of specific object instances, resulting in models that once trained can "learn" on new such tasks with relatively few examples. In Matching Networks [43], a non-parametric k-NN classifier is meta-learned such that for each few-shot task the learned model generates an adaptive embedding space for which the task can be better solved. In [39] the embedding space is optimized to best support task-adaptive category population centers (assuming uni-modal category distributions). In approaches such as MAML [10], Meta-SGD [26], DEML+Meta-SGD [52], Meta-Learn LSTM [34] and Meta-Networks [31], the meta-learned classifiers are optimized to be easily fine-tuned on new few-shot tasks using small training data. Generative and augmentation-based few-shot approaches: In this line of methods, either generative models are trained to synthesize new data based on few examples, or additional examples are obtained by some other form of transfer learning from external data. These approaches can be categorized as follows: (1) semi-supervised approaches using additional unlabeled data [6, 11]; (2) 2 fine tuning from pre-trained models [25, 45, 46]; (3) applying domain transfer by borrowing examples from relevant categories [27] or using semantic vocabularies [2, 12]; (4) rendering synthetic examples [32, 7, 40]; (5) augmenting the training examples [23]; (6) example synthesis using Generative Adversarial Networks (GANs) [53, 21, 14, 35, 33, 29, 8, 20]; and (6) learning to use additional semantic information (e.g. attribute vector) per-instance for example synthesis [4, 51]. It is noteworthy that all the augmentation and synthesis approaches can be used in combination with the metric learning or meta-learning schemes, as we can always synthesize more data before using those approaches and thus (hopefully) improve their performance. Several insightful papers have recently emerged dealing with sample synthesis. In [17] it is conjectured that the relative linear offset in feature space between a pair of same-class examples conveys information on a valid deformation, and can be applied to instances of other classes. In their approach, similar (in terms of this offset) pairs of examples from different categories are mined during training and then used to train a generator optimized for applying the same offset to other examples. In our technique, we do not restrict our “deltas” to be linear offsets, and in principle can have the encoder and the generator to learn more complex deformations than offsets in the feature space. In [44], a generator sub-network is added to a classification network in order to synthesize additional examples on the fly in a way that helps training the classifier on small data. This generator receives the provided training examples accompanied by noise vectors (source of randomness). At the learning stage, the generator is optimized to perform random augmentation, jointly with the meta-learner parameters, via the classification loss. In contrast, in our strategy the generator is explicitly trained, via the reconstruction loss, to transfer deformations between examples and categories. A similar idea of learning to randomly augment class examples in a way that will improve classification performance is explored in [1] using GANs. In [35], a few-shot class density estimation is performed with an autoregressive model, augmented with an attention mechanism, where examples are synthesized by a sequential process. Finally, the idea of learning to apply deformations on class examples has also been successfully explored in other domains, such as text synthesis [16]. 3 The ∆-encoder We propose a method for few-shot classification by learning to synthesize samples of novel categories (unseen during training) when only a single or a few real examples are available. The generated samples are then used to train a classifier. Our proposed approach, dubbed as the ∆-encoder, learns to sample from the category distribution, while being seeded by only one or few examples from that distribution. Doing so, it belongs to the family of example synthesis methods. Yet, it does not assume the existence of additional unlabeled data, e.g., transferable pre-trained models (on an external dataset) or any directly related examples from other categories or domains, and it does not rely on additional semantic information per-instance. The proposed solution is to train a network comprised of an encoder and a decoder. The encoder learns to extract transferable deformations between pairs of examples of the same class, while the decoder learns how to apply these deformations to other examples in order to learn to sample from new categories. For the ease of notation, assume we are given a single example Y belonging to a certain category C, and our goal is to learn to sample additional examples X belonging to the same category. In other words, we would like to learn to sample from the class posterior: P(X|C, Y ). Notice that the conditioning on Y implies that we may not learn to sample from the whole class posterior, but rather from its certain subset of "modes" that can be obtained from Y using the deformations we learned to extract. Our method is inspired by the one used for zero-shot classification in [3], where the decoder is provided side information about the class, in the form of human-annotated attributes. Our generative model is a variant of an Auto-Encoder (AE). Standard AE learns to reconstruct a signal X by minimizing ∥X −ˆX∥1, where ˆX = D(E(X)) is the signal reconstructed by the AE, and E and D are the encoder and decoder sub-networks, respectively. A common assumption for an AE is that the intermediate bottleneck representation E(X), can be of much lower dimension than X. This is driven by assuming the ability to extract the "semantic essence" of X – a minimal set of identifying features of X necessary for the reconstruction. The simple key idea of this work is to change the meaning of E(X) from representing the "essence" of X, to representing the delta, or "additional information" needed to reconstruct X from Y (an observed example from the same category). To this end, we propose the training architecture depicted in Figure 2a. The encoder gets 3 𝑋𝑠 ෠𝑋𝑠 Encoder Decoder 𝑍 𝑌𝑠 𝑋𝑠 Encoder Decoder 𝑍 𝑌𝑠 (a) Training phase: (b) Sample synthesis phase: 𝑌𝑢 ෠𝑋𝑢 Figure 2: Proposed ∆-encoder architecture. (a) Training phase: Xs and Y s are a random pair of samples from the same seen class; the ∆-encoder learns to reconstruct Xs. (b) Sample synthesis phase: Xs and Y s are a random pair of samples from a random seen class, and Y u is a single example from a novel unseen class; the ∆-encoder generates a new sample ˆXu from the new class. as an input both the signal X and the "anchor" example Y and learns to compute the representation of the additional information Z = E(X, Y ) needed by the decoder D in order to reconstruct the X from both Y and Z. Keeping the dimension of Z small, we ensure that the decoder D cannot use just Z in order to reconstruct X. This way, we regularize the encoder to strongly rely on the anchor example Y for the reconstruction, thus, enabling synthesis as described next. Following training, at the sample synthesis phase, we use the trained network to sample from P(X|C, Y ). We use the non-parametric distribution of Z by sampling random pairs {Xs, Y s} from the classes seen during training (such that Xs and Y s belong to the same category) and generating from them Z = E(Xs, Y s) using the trained encoder. Thus, we end up with a set of samples {Zi}. In each of the one-shot experiments, for a novel unseen class U we are provided with an example Y u, from which we synthesize a set of samples for the class U using our trained generator model: {D(Zi, Y u)}. The process is illustrated in Figure 2b. Finally, we use the synthesized samples to train a linear classifier (one dense layer followed by softmax). As a straightforward extension, for k-shot learning we repeat the process k times, independently synthesizing samples based on each of the k examples provided. 3.1 Implementation details In all the experiments, images are represented by pre-computed feature vectors. In all our experiments we are using the VGG16 [38] or ResNet18 [18] models for feature extraction. For both models the head, i.e., the layers after the last convolution, is replaced by two fully-connected layers with 2048 units with ReLU activations. The features used are the 2048-dimensional outputs of the last fullyconnected layer. Following the ideas of [28], we augment the L1 reconstruction loss (∥X −ˆX∥1) to include adaptive weights: P i wi|Xi −ˆXi|, where wi = |Xi −ˆXi|2/∥X −ˆX∥2, encouraging larger gradients for feature dimensions with higher residual error. The encoder and decoder sub-networks are implemented as multi-layer perceptrons with a single hidden layer of 8192 units, where each layer is followed by a leaky ReLU activation (max(x, 0.2 · x)). The encoder output Z is 16-dimensional. All models are trained with Adam optimizer with the learning rate set to 10−5. Dropout with 50% rate is applied to all layers. In all experiments 1024 samples are synthesized for each unseen class. The ∆-encoder training takes about 10 epochs to reach convergence; each epoch takes about 20 seconds running on an Nvidia Tesla K40m GPU (48K training samples, batch size 128). The data generation phase takes around 0.1 seconds per 1024 samples. The code is available here. 4 4 Results We have evaluated the few-shot classification performance of the proposed method on multiple datasets, which are the benchmarks of choice for the majority of few-shot learning literature, namely: miniImageNet, CIFAR-100, Caltech-256, CUB, APY, SUN and AWA2. These datasets are common benchmarks for the zero- and few-shot object recognition, and span a large variety of properties including high- and low-resolution images, tens to hundreds of fine- and coarse-grained categories, etc. We followed the standard splits used for few-shot learning for the first four datasets; for the other datasets that are not commonly used for few-shot, we used the split suggested in [49] for zero-shot learning. Table 3 summarizes the properties of the tested datasets. In all of our experiments, the data samples X and Y are feature vectors computed by a pre-trained neural-network. The experimental protocol in terms of splitting of the dataset into disjoint sets of training and testing classes is the same as in all the other works evaluated on the same datasets. We use the VGG16 [38] backbone network for computing the features in all of our experiments except those on Caltech-256 and CUB. For these small-scale datasets we used ResNet18 [18], same as [4], to avoid over-fitting. We show that even in this simple setup of using pre-computed feature vectors, competitive results can be obtained by the proposed method compared to the few-shot state-of-the-art. Combining the proposed approach with an end-to-end training of the backbone network is an interesting future research direction beyond the scope of this work. As in compared approaches, we evaluate our approach by constructing "few-shot test episode" tasks. In each test episode for the N-way k-shot classification task, we draw N random unseen categories, and draw k random samples from each category. Then, in order to evaluate performance on the episode, we use our trained network to synthesize a total of 1024 samples per category based on those k examples. This is followed by training a simple linear N-class classifier over those 1024 · N samples, and finally, the calculation of the few-shot classification accuracy on a set of M real (query) samples from the tested N categories. In our experiments, instead of using a fixed (large) value for M, we simply test the classification accuracy on all of the remaining samples of the N categories that were not used for one- or few-shot training. Average performance on 10 such experiments is reported. 4.1 Standard benchmarks For miniImageNet, CIFAR100, CUB and Caltech-256 datasets, we evaluate our approach using a backbone network (for computing the feature vectors) trained from scratch on a subset of categories of each dataset. For few-shot testing, we use the remaining unseen categories. The proposed synthesis network is trained on the same set of categories as the backbone network. The experimental protocol used here is the same as in all compared methods. The performance achieved by our approach is summarized in Table 1; it competes favorably to the state-of-the-art of few-shot classification on these datasets. The performance of competing methods is taken from [4]. We remark in the table whenever a method uses some form of additional external data, be it training on an external large-scale dataset, using word embedding applied to the category name, or using human-annotated class attributes. 4.2 Additional experiments using a shared pre-trained feature extracting model For fair comparison, in the experiments described above in Section 4.1 we only trained our feature extractor backbone on the subset of training categories of the target dataset (same as in other works). However, it is nonetheless interesting to see how our proposed method performs in a realistic setting of having a single pre-trained feature extractor backbone trained on a large set of external data. To this end, we have conducted experiments on four public datasets (APY, AWA2, CUB and SUN), where we used features obtained from a VGG16 backbone pre-trained on ImageNet. The unseen test categories were verified to be disjoint from the ImageNet categories in [49] that dealt with dataset bias in zero-shot experiments. The results of our experiments as well as comparisons to some baselines are summarized in Table 2. The experiments in this section illustrate that the proposed method can strongly benefit from better features trained on more data. For CUB with "stronger" ImageNet features (last column in Table 2) we achieved more than 10% improvement over training only using a subset of CUB categories (last column in Table 1). 5 Table 1: 1-shot/5-shot 5-way accuracy results Method miniImageNet CIFAR100 Caltech-256 CUB Nearest neighbor (baseline) 44.1 / 55.1 56.1 / 68.3 51.3 / 67.5 52.4 / 66.0 MACO [19] 41.1 / 58.3 60.8 / 75.0 Meta-Learner LSTM [34] 43.4 / 60.6 40.4 / 49.7 Matching Nets [43] 46.6 / 60.0 50.5 / 60.3 48.1 / 57.5 49.3 / 59.3 MAML [10] 48.7 / 63.1 49.3 / 58.3 45.6 / 54.6 38.4 / 59.1 Prototypical Networks [39] 49.4 / 68.2 SRPN [30] 55.2 / 69.6 RELATION NET [41] 57.0 / 71.1 DEML+Meta-SGD♥[52] 58.5 / 71.3 ⋄ 61.6 / 77.9 ⋄ 62.2 / 79.5 ⋄ 66.9 / 77.1 ⋄ Dual TriNet♥[4] 58.1 / 76.9 † 63.4 / 78.4 † 63.8 / 80.5 † 69.6 / 84.1 ⋆ ∆-encoder♥ 59.9 / 69.7 66.7 / 79.8 73.2 / 83.6 69.8 / 82.6 ⋄Also trained on an a large external dataset † Using label embedding trained on large corpus ⋆Using human annotated class attributes ♥Using ResNet features Table 2: 1-shot/5-shot 5-way accuracy with ImageNet model features (trained on disjoint categories) Method AWA2 APY SUN CUB Nearest neighbor (baseline) 65.9 / 84.2 57.9 / 76.4 72.7 / 86.7 58.7 / 80.2 Prototypical Networks 80.8 / 95.3 69.8 / 90.1 74.7 / 94.8 71.9 / 92.4 ∆-encoder 90.5 / 96.4 82.5 / 93.4 82.0 / 93.0 82.2 / 92.6 4.3 Ablation study: evaluating different design choices In this section we review and evaluate different design choices used in the architecture and the approach proposed in this paper. For this ablation study we use the performance estimates for the AWA, APY, SUN and CUB datasets to compare the different choices. In [3] the authors suggested the usage of Denoising-Autoencoder (DAE) for zero-shot learning (Fig. 3a). The noise is implemented as 20% dropout on the input. In training time, the DAE learns to reconstruct Xs from it’s noisy version, where the decoder uses the class attributes to perform the reconstruction. At test time, the decoder is used to synthesize examples from a novel class using its attributes vector and a random noise vector Z. Average accuracy for the zero-shot task is 64.4% (first row in Table 4). As a first step towards one-shot learning, we have tested the same architecture but using another sample from the same class instead of the attributes vector (Figure 3b). The intuition behind this is that the decoder will learn to reconstruct the class instances by editing another instances from the same class instead of relying on the class attributes. This already yields a significant improvement to the average accuracy bringing it to 81.1%, hinting that even a single class instance conveys more information than the human chosen attributes for the class in these datasets. Next, we replaced the random sampling of Z with a non-parametric density estimate of it obtained from the training set. Instead of sampling entries of Z ∼N(0, 1), we randomly sample an instance Xs belonging to a randomly chosen training class and run it through the encoder to produce Z = E(Xs). This variant assumes that the distribution of Z is similar between the seen and unseen classes. We observed a slight improvement of 0.5% due to this change. We also tested a variant where no noise is injected to the input, i.e. replacing Denoising-Autoencoder with Autoencoder. Since we did not observe a change in performance we chose the Autoencoder for being the simpler of the two. Finally, to get to our final architecture as described in Section 3 we add Y as input to the encoder. This improved the performance by 2.4%. Linear offset delta To evaluate the effect of the learned non-linear ∆-encoder we also experimented with replacing it with a linear "delta" in the embedding space. In this experiment we set Z = E(Xs, Y s) = Xs −Y s and ˆX = D(Z, Y u) = Y u + Z. That means we sample linear shifts from same-class pairs in the training set and use them to augment the single example of a new class Y u that we have. For this experiment we got ∼10 points lower accuracy compared to ∆-encoder, showing the importance of the learned non-linear "delta" encoding. 6 Table 3: Summary of the datasets used in our experiments Fine Image Total # Seen Unseen Dataset grained size images classes classes miniImageNet [43]  Medium 60K 80 20 CIFAR-100 [22]  Small 60K 80 20 Caltech-256 Object Category [15]  Large 30K 156 50 Caltech-UCSD Birds 200 (CUB) [48]  Large 12K 150 50 Attribute Pascal & Yahoo (aPY) [9]  Large 14K 20 12 Scene UNderstanding (SUN) [50]  Large 14K 645 72 Animals with Attributes 2 (AWA2) [49]  Large 37K 40 10 Table 4: Evaluating different design choices. All the numbers are one-shot accuracy in %. Method AWA2 APY SUN CUB Avg. Zero-shot (Y is attribute vector) [3] (Fig. 3a) 66.4 62.0 82.5 42.8 63.4 Transferring linear offsets in the embedding space 81.3 72.1 73.5 73.9 75.2 Replacing attribute with sample from class (Fig. 3b) 85.4 78.1 81.1 81.1 81.4 Z is sampled from training set, not random (Fig. 3c) 86.6 84.2 80.1 77.0 81.9 Autoencoder instead of denoising-autoencoder (Fig. 3d) 88.2 80.9 79.5 79.1 81.9 Adding Y as input to encoder too (Fig. 2) 90.5 82.5 82 82.2 84.3 4.4 Are we synthesizing non-trivial samples? We have observed a significant few-shot performance boost when using the proposed method for sample synthesis when compared to the baseline of using just the few provided examples. But are we learning to generate any significant new information on the class manifold in the feature space? Or are we simply augmenting the provided examples slightly? We chose two ways to approach this question. First, evaluating the performance as more samples are synthesized. Second, visualizing the synthesized samples in the feature space. Figure 4 presents the accuracy as a function of number of generated samples in both 1-shot and 5-shot scenarios when evaluated on the miniImageNet dataset. As can be seen the performance improves with the number of samples synthesized, converging after 512 −1024 samples. For this reason we use 1024 synthesized samples in all of our experiments. It is interesting to note that at convergence, not only using the 5-shot synthesized samples is significantly better then the baseline of using just the five provided real examples, but also using the samples synthesized from just one real example is better then using five real examples (without synthesis). This may suggest that the proposed synthesis approach does learn something non-trivial surpassing the addition of four real examples. 23 24 25 26 27 28 29 210 Number of generated samples 45 50 55 60 65 70 75 Accuracy 1-shot accuracy 1-shot nearest-neighbor baseline 5-shot accuracy 5-shot nearest-neighbor baseline Figure 4: miniImageNet 5-way Accuracy vs. number of generated samples. As indicated by the accuracy trend we keep generating new meaningful samples till we reach convergence at ∼1K samples. To visualize the synthesized samples we plot them for the case of 12 classes unseen during training (Figure 5a). The samples were synthesized from a single real example for each class (1-shot mode) and plotted in 2d using t-SNE. As can be seen from the figure, the synthesized samples reveal a non trivial density structure around the seed examples. Moreover, the seed examples are not the centers of the synthesized populations (we verified that same is true before applying t-SNE) as would be expected for naive augmentation by random perturbation. Hence, the classifier learned from the synthesized examples significantly differs from the nearest neighbors baseline classifier that is using the seed examples alone (improving its performance by 20 −30 points in tables 1 & 2). In addition, Figure 5b shows visualizations for some of the 7 𝑎. Zero-shot (Y is attributes vector) 𝑋𝑠+ 𝑁 ෠𝑋 Encoder Decoder 𝑍 𝑋𝑠 Encoder Decoder 𝑍 Training phase: Sample synthesis phase: 𝑌𝑢 ෠𝑋 c. Z is sampled from training set (not random) 𝑌= 𝑎𝑡𝑡𝑟𝑖𝑏𝑢𝑡𝑒𝑠 𝑋𝑠+ 𝑁 ෠𝑋 Encoder Decoder 𝑍 Decoder 𝑍= 𝑁(0,1) Training phase: Sample synthesis phase: ෠𝑋 𝑌= 𝑎𝑡𝑡𝑟𝑖𝑏𝑢𝑡𝑒𝑠 b. Replacing attribute with sample from class 𝑋𝑠+ 𝑁 ෠𝑋 Encoder Decoder 𝑍 Decoder 𝑍= 𝑁(0,1) Training phase: Sample synthesis phase: ෠𝑋 𝑌𝑠 𝑌𝑢 𝑌𝑠 𝑋𝑠 ෠𝑋 Encoder Decoder 𝑍 𝑋𝑠 Encoder Decoder 𝑍 Training phase: Sample synthesis phase: 𝑌𝑢 ෠𝑋 d. Autoencoder instead of denoising-autoencoder 𝑌𝑠 Figure 3: Different design choices tried. Classification accuracy for each architecture is presented in Table 4. The final chosen architecture is depicted in Fig. 2. synthesized feature vectors obtained from a given seed example. The images displayed are the nearest neighbors of the synthesized ones in the feature space. 𝑎. 𝑏. Figure 5: a. Generated samples for 12-way one-shot. The red crosses mark the original 12 single-samples. The generated points are colored according to their class. b. Synthesized samples visualization. The single image seen at training is framed in blue. All other images represent the synthesized samples visualized using their nearest "real image" neighbors in the feature space. The two-dimensional embedding was produced by t-SNE. Best viewed in color. 5 Summary and Future work In this work, we proposed a novel auto-encoder like architecture, the ∆-encoder. This model learns to generate novel samples from a distribution of a class unseen during training using as little as one example from that class. The ∆-encoder was shown to achieve state-of-the-art results in the task of few-shot classification. We believe that this new tool can be utilized in a variety of more general settings challenged by the scarceness of labeled examples, e.g., in semi-supervised and active learning. In the latter case, new candidate examples for labeling can be selected by first generating new samples using the ∆-encoder, and then picking the data points that are farthest from the generated samples. Additional, more technical, research directions include iterative sampling from the generated distribution by feeding the generated samples as reference examples, and conditioning the sampling of the "deltas" on the anchor example for better controlling the set of transformations suitable for transfer. We leave these interesting directions for future research. 8 Acknowledgment: Part of this research was partially supported by the ERC-StG SPADE grant. Rogerio Feris is partly supported by IARPA via DOI/IBC contract number D17PC00341. Alex Bronstein is supported by ERC StG RAPID. The U.S. Government is authorized to reproduce and distribute reprints for Governmental purposes notwithstanding any copyright annotation thereon. Disclaimer: The views and conclusions contained herein are those of the authors and should not be interpreted as necessarily representing the official policies or endorsements, either expressed or implied, of IARPA, DOI/IBC, or the U.S. Government) References [1] A. Antoniou, A. Storkey, and H. Edwards. Data Augmentation Generative Adversarial Networks. arXiv:1711.04340, 2017. [2] J. L. Ba, K. Swersky, S. Fidler, and R. Salakhutdinov. Predicting deep zero-shot convolutional neural networks using textual descriptions. Proceedings of the IEEE International Conference on Computer Vision, 2015 Inter:4247–4255, 2015. [3] M. Bucher, S. Herbin, and F. Jurie. Generating Visual Representations for Zero-Shot Classification. arXiv:1708.06975, 8 2017. [4] Z. Chen, Y. Fu, Y. Zhang, Y.-G. Jiang, X. Xue, and L. Sigal. Semantic Feature Augmentation in Few-shot Learning. arXiv:1804.05298v2, 2018. [5] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and F.-F. Li. ImageNet: A large-scale hierarchical image database. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 248–255, 2009. [6] X. Dong, L. Zheng, F. Ma, Y. Yang, and D. Meng. Few-shot Object Detection. Arxiv:1706.08249, pages 1–11, 2017. [7] A. Dosovitskiy, J. T. Springenberg, M. Tatarchenko, and T. Brox. Learning to Generate Chairs, Tables and Cars with Convolutional Networks. IEEE Transactions on Pattern Analysis and Machine Intelligence, 39(4):692–705, 2017. [8] I. Durugkar, I. Gemp, and S. Mahadevan. Generative Multi-Adversarial Networks. International Conference on Learning Representations (ICLR), pages 1–14, 2017. [9] A. Farhadi, I. Endres, D. Hoiem, and D. Forsyth. Describing Objects by their Attributes. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 1778–1785, 2009. [10] C. Finn, P. Abbeel, and S. Levine. Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networks. arXiv:1703.03400, 2017. [11] Y. Fu, T. M. Hospedales, T. Xiang, and S. Gong. Transductive Multi-View Zero-Shot Learning. IEEE Transactions on Pattern Analysis and Machine Intelligence, 37(11):2332–2345, 2015. [12] Y. Fu and L. Sigal. Semi-supervised Vocabulary-informed Learning. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 5337–5346, 2016. [13] V. Garcia and J. Bruna. Few-Shot Learning with Graph Neural Networks. arXiv:1711.04043, pages 1–13, 2017. [14] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio. Generative Adversarial Nets. Advances in Neural Information Processing Systems 27, pages 2672–2680, 2014. [15] G. Griffin, a. Holub, and P. Perona. Caltech-256 object category dataset. Caltech mimeo, 11(1):20, 2007. [16] K. Guu, T. B. Hashimoto, Y. Oren, and P. Liang. Generating Sentences by Editing Prototypes. Arxiv:1709.08878, 2017. [17] B. Hariharan and R. Girshick. Low-shot Visual Recognition by Shrinking and Hallucinating Features. IEEE International Conference on Computer Vision (ICCV), 2017. 9 [18] K. He, X. Zhang, S. Ren, and J. Sun. Deep Residual Learning for Image Recognition. arXiv:1512.03385, 2015. [19] N. Hilliard, L. Phillips, S. Howland, A. Yankov, C. D. Corley, and N. O. Hodas. Few-Shot Learning with Metric-Agnostic Conditional Embeddings. 2 2018. [20] G. Huang, Z. Liu, L. v. d. Maaten, and K. Q. Weinberger. Densely Connected Convolutional Networks. 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 2261–2269, 2017. [21] E. S. Jun-Yan Zhu, Philipp Krahenbuhl and A. Efros. Generative Visual Manipulation on the Natural Image Manifold. European Conference on Computer Vision (ECCV)., pages 597–613, 2016. [22] A. Krizhevsky. Learning Multiple Layers of Features from Tiny Images. Technical report. Science Department, University of Toronto, Tech., pages 1–60, 2009. [23] A. Krizhevsky, I. Sutskever, and G. E. Hinton. ImageNet Classification with Deep Convolutional Neural Networks. Advances In Neural Information Processing Systems, pages 1–9, 2012. [24] B. M. Lake, R. Salakhutdinov, and J. B. Tenenbaum. Human-level concept learning through probabilistic program induction. Science, 350(6266):1332–1338, 2015. [25] Z. Li and D. Hoiem. Learning without Forgetting. IEEE Transactions on Pattern Analysis and Machine Intelligence, pages 1–13, 2016. [26] Z. Li, F. Zhou, F. Chen, and H. Li. Meta-SGD: Learning to Learn Quickly for Few-Shot Learning. arXiv:1707.09835, 2017. [27] J. J. Lim, R. Salakhutdinov, and A. Torralba. Transfer Learning by Borrowing Examples for Multiclass Object Detection. Advances in Neural Information Processing Systems 26 (NIPS), pages 1–9, 2012. [28] T.-Y. Lin, P. Goyal, R. Girshick, K. He, and P. Dollár. Focal Loss for Dense Object Detection. arXiv:1708.02002, 2017. [29] X. Mao, Q. Li, H. Xie, R. Y. K. Lau, Z. Wang, and S. P. Smolley. Least Squares Generative Adversarial Networks. IEEE International Conference on Computer Vision (ICCV), pages 1–16, 2016. [30] A. Mehrotra and A. Dukkipati. Generative Adversarial Residual Pairwise Networks for One Shot Learning. arXiv:1703.08033, 2017. [31] T. Munkhdalai and H. Yu. Meta Networks. arXiv:1703.00837, 2017. [32] D. Park and D. Ramanan. Articulated pose estimation with tiny synthetic videos. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2015-Octob:58–66, 2015. [33] A. Radford, L. Metz, and S. Chintala. Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks. arXiv:1511.06434, pages 1–16, 2015. [34] S. Ravi and H. Larochelle. Optimization As a Model for Few-Shot Learning. International Conference on Learning Representations (ICLR), pages 1–11, 2017. [35] S. Reed, Y. Chen, T. Paine, A. van den Oord, S. M. A. Eslami, D. Rezende, O. Vinyals, and N. de Freitas. Few-shot autoregressive density estimation: towards learning to learn distributions. arXiv:1710.10304, (2016):1–11, 2018. [36] O. Rippel, M. Paluri, P. Dollar, and L. Bourdev. Metric Learning with Adaptive Density Discrimination. arXiv:1511.05939, (Dml):1–15, 2015. [37] F. Schroff, D. Kalenichenko, and J. Philbin. FaceNet: A unified embedding for face recognition and clustering. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 815–823, 2015. 10 [38] K. Simonyan and A. Zisserman. Very Deep Convolutional Networks for Large-Scale Image Recognition. CoRR arXiv:1409.1556, abs/1409.1:1–14, 2014. [39] J. Snell, K. Swersky, and R. S. Zemel. Prototypical Networks for Few-shot Learning. Advances In Neural Information Processing Systems (NIPS), 2017. [40] H. Su, C. R. Qi, Y. Li, and L. J. Guibas. Render for CNN Viewpoint Estimation in Images Using CNNs Trained with Rendered 3D Model Views.pdf. IEEE International Conference on Computer Vision (ICCV), pages 2686–2694, 2015. [41] F. Sung, Y. Yang, L. Zhang, T. Xiang, P. H. S. Torr, and T. M. Hospedales. Learning to Compare: Relation Network for Few-Shot Learning. arXiv:1711.06025, 11 2017. [42] C. Szegedy, W. Liu, Y. Jia, P. Sermanet, S. Reed, D. Anguelov, D. Erhan, V. Vanhoucke, and A. Rabinovich. Going deeper with convolutions. In IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR), volume 07-12-June, pages 1–9. IEEE, 6 2015. [43] O. Vinyals, C. Blundell, T. Lillicrap, K. Kavukcuoglu, and D. Wierstra. Matching Networks for One Shot Learning. Advances In Neural Information Processing Systems (NIPS), 2016. [44] Y.-X. Wang, R. Girshick, M. Hebert, and B. Hariharan. Low-Shot Learning from Imaginary Data. arXiv:1801.05401, 2018. [45] Y.-X. Wang and M. Hebert. Learning from Small Sample Sets by Combining Unsupervised Meta-Training with CNNs. Advances In Neural Information Processing Systems (NIPS), (Nips):244–252, 2016. [46] Y.-X. Wang and M. Hebert. Learning to Learn: Model Regression Networks for Easy Small Sample Learning. European Conference on Computer Vision (ECCV), pages 616–634, 2016. [47] K. Q. Weinberger and L. K. Saul. Distance Metric Learning for Large Margin Nearest Neighbor Classification. The Journal of Machine Learning Research, 10:207–244, 2009. [48] P. Welinder, S. Branson, T. Mita, and C. Wah. Caltech-UCSD birds 200. pages 1–15, 2010. [49] Y. Xian, C. H. Lampert, B. Schiele, and Z. Akata. Zero-Shot Learning - A Comprehensive Evaluation of the Good, the Bad and the Ugly. arXiv:1707.00600, pages 1–14, 2018. [50] J. Xiao, J. Hays, K. A. Ehinger, A. Oliva, and A. Torralba. SUN database: Large-scale scene recognition from abbey to zoo. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 3485–3492. IEEE, 6 2010. [51] A. Yu and K. Grauman. Semantic Jitter: Dense Supervision for Visual Comparisons via Synthetic Images. Proceedings of the IEEE International Conference on Computer Vision, 2017-Octob:5571–5580, 2017. [52] F. Zhou, B. Wu, and Z. Li. Deep Meta-Learning: Learning to Learn in the Concept Space. arXiv:1802.03596, 2 2018. [53] J. Y. Zhu, T. Park, P. Isola, and A. A. Efros. Unpaired Image-to-Image Translation Using Cycle-Consistent Adversarial Networks. Proceedings of the IEEE International Conference on Computer Vision, 2017-Octob:2242–2251, 2017. [54] B. Zoph, V. Vasudevan, J. Shlens, and Q. V. Le. Learning Transferable Architectures for Scalable Image Recognition. arXiv:1707.07012, 2017. 11
2018
104
7,258
A Linear Speedup Analysis of Distributed Deep Learning with Sparse and Quantized Communication Peng Jiang The Ohio State University jiang.952@osu.edu Gagan Agrawal The Ohio State University agrawal@cse.ohio-state.edu Abstract The large communication overhead has imposed a bottleneck on the performance of distributed Stochastic Gradient Descent (SGD) for training deep neural networks. Previous works have demonstrated the potential of using gradient sparsification and quantization to reduce the communication cost. However, there is still a lack of understanding about how sparse and quantized communication affects the convergence rate of the training algorithm. In this paper, we study the convergence rate of distributed SGD for non-convex optimization with two communication reducing strategies: sparse parameter averaging and gradient quantization. We show that O(1/ p MK) convergence rate can be achieved if the sparsification and quantization hyperparameters are configured properly. We also propose a strategy called periodic quantized averaging (PQASGD) that further reduces the communication cost while preserving the O(1/ p MK) convergence rate. Our evaluation validates our theoretical results and shows that our PQASGD can converge as fast as full-communication SGD with only 3% −5% communication data size. 1 Introduction The explosion of data and an increase in model size has led to great interest in training deep neural networks on distributed systems. In particular, distributed stochastic gradient descent has been extensively studied in both deep learning and high-performance computing communities, with the goal of accelerating large-scale learning tasks [13, 10, 9, 47, 3, 14, 30, 31, 6, 44, 38]. In today’s mainstream deep learning frameworks such as Tensorflow, Torch, MXNet, Caffe, and CNTK [22, 1, 11, 8, 36], data-parallel distributed SGD is widely adopted to exploit the compute capacity of multiple machines. The idea of data-parallel distributed SGD is that each machine holds a copy of the entire model and computes stochastic gradients with local mini-batches, and the local model parameters or gradients are frequently synchronized to achieve a global consensus of the learned model. In this context, a well-known performance bottleneck is the high bandwidth cost for synchronizing the gradients or model parameters among multiple machines [3, 27, 20, 28, 9, 42, 29]. A popular approach to overcome such a bottleneck is to perform compression of the gradients [33, 4, 46, 5, 37]. For example, Aji et al. [4] propose to sparsify the gradients and transmit only the components with absolute values larger than a threshold. Their sparsification method reduces the gradient exchange and achieve 22% speedup gain on 4 GPUs for a neural machine translation task. Wen et al. [46] propose to aggressively quantize the gradients to three numerical levels {-1, 0, 1}. Their quantization method reduces the communication cost with none or little accuracy lost on image classification. Though numerous variants of gradient quantization and/or sparsification have been proposed and successfully applied to different deep learning tasks [42, 45, 37, 48, 18, 7, 16], their impact to the convergence rate of distributed SGD (especially for non-convex optimization) is still unclear. Most of the research efforts involve a simple empirical demonstration of convergence. Wen et al. [46] 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. show the convergence of their ternary gradient method with a strong assumption on the gradient bound, and yet no convergence rate is given. Alistarh et al. [5] analyze the convergence rate of SGD with quantized gradients – however, their result on non-convex optimization shows that the “variance blowup” caused by quantization is constant. Overall, there is not a good understanding of how gradient sparsification and quantization impact the convergence rate of distributed SGD, whether they are worth applying in general, and how they can be applied properly to achieve the optimal convergence rate and performance. To fill these gaps in theory, this paper studies the convergence rate of distributed SGD with sparse and quantized communication for the following non-convex stochastic optimization problem: min x2RN f(x) := E⇠⇠DF(x; ⇠), (1) where x 2 RN are the model variables, D is a predefined distribution and ⇠is a random variable referring to a data sample, both F(x; ⇠) and f(x) are smooth (but not necessarily convex) functions. This formulation summarizes many popular machine learning models including deep learning [25]. Contributions We first analyze the convergence rate of distributed SGD with two communication reducing techniques: sparse parameter averaging and gradient quantization. For sparse parameter averaging, we prove that distributed SGD can maintain its asymptotic O(1/ p MK) convergence rate as long as we can make sure all of the parameter components are exchanged in a limited number of consecutive iterations. Here, M is the total mini-batch size on n nodes, and K is the number of iterations. As a corollary, we prove that distributed SGD that averages the model parameters only once every p iterations can converge at rate O(1/ p MK). For gradient quantization, we prove that if using unbiased stochastic quantization function, distributed SGD will converge at rate O((1 + q)/ p MK) or O((1 + qm)/ p MK), depending on if the training data are shared or partitioned among nodes. Here, m is the mini-batch size on a single node, and q is a bound of the expected quantization error we define later. This result suggests that choosing a quantization function that ensures q = ⇥(1) and q = ⇥(1/m) can achieve O(1/ p MK) convergence rate for distributed SGD in the two scenarios. The O(1/ p MK) convergence rate is usually desired in distributed training as it implies linear speedup across multiple machines w.r.t computation complexity [14, 32]. Our analysis results indicate that distributed SGD with sparse and quantized communication can converge as fast as full-precision SGD if configured properly. Intuitively, the O(1/ p MK) convergence rate can be preserved because the additional deviation of the gradient introduced by sparsification or quantization can be relatively small compared with the deviation caused by the stochastic method itself. According to the analysis results, to ensure the optimal convergence rate, sparsification or quantization alone achieves limited compression ratio. To further reduce the communication cost without impairing the convergence rate, we propose to communicate quantized changes of model parameters once every p iterations. We prove that our algorithm converges at rate O((1 + q)/ p MK) if the training data are shared among all nodes, and converges at rate O((1 + mpq)/ p MK) if the training data are partitioned. By properly setting p and q, we achieve O(1/ p MK) convergence rate for our algorithm. 2 Related Work Many gradient sparsification and quantization techniques have been proposed to reduce the communication overhead in distributed training. Gradient Sparsification Strom [42] proposed to only send gradient components larger than a predefined threshold – however, the threshold is hard to determine in practice. Aji et al. [4] presented a heuristic approach to truncate the smallest gradient components and only communicate the remaining large ones. They saved 99% of gradient exchange with 0.3% loss of BLEU score on a machine translation task. Lin et al. [33] showed that techniques such as momentum correction and local gradient clipping can help the convergence of distributed SGD with sparse gradient exchange. They achieved a gradient compression ratio from 270x to 600x for a wide range CNNs and RNNs without losing accuracy. Despite the good performance in practice, the gradient sparsification methods in previous works are largely heuristic and no convergence guarantee has been established. 2 Gradient Quantization Seide et al. [37] proposed to use only 1-bit to represent the gradient. They achieve 10x speedup for a speech application. Alistarh et al. [5] proposed a quantization method named QSGD and gave its convergence rate for both convex and non-convex optimization; however, their convergence bound for the non-convex case has a constant term that does not converge over iterations. Wen et al. [46] proposed to aggressively quantize the gradients to three levels {-1,0,1}. They proved that their algorithm converges almost surely under a strong assumption on the gradient bound; however, no convergence rate is given. Moreover, none of the previous works have considered the impact of partitioned training data to the convergence rate of distributed SGD with gradient quantization. There are also efforts that quantize the entire model including the gradients. For example, Buckwild! [12] showed the convergence guarantee of low-precision SGD with assumptions on convexity and gradient sparsity. Li et al. [26] studied different training methods for quantized neural network. They prove that convergence is guaranteed for training quantized neural network with convexity assumption. They also explained the inherent difficulty in training quantized neural network for non-convex cases. In this work, we focus on full precision neural network with quantized gradients, and we show that convergence rate is guaranteed on non-convex optimization if a good quantization function is used. 3 Analysis of Sparse Parameter Averaging and Gradient Quantization In this section, we analyze the convergence rates of distributed SGD with two communication reducing techniques: sparse parameter averaging and gradient quantization. 3.1 Notation and Assumptions We focus on synchronous data-parallel distributed SGD. The original objective defined in (1) can be rewritten as: min x2RN f(x) := 1 n n X i=1 E⇠⇠DiFi(x; ⇠) | {z } =:fi(x) , (2) where Di is a predefined distribution on the ith node. If the training data are shared among all nodes, then Di0s are the same as D. If data are partitioned and placed on different nodes and each node defines a distribution for sampling local data, then Di0s are different. Notation • k·k2 denotes the `2 norm of a vector or the spectral norm of a matrix. • kvk1 := P i |vi| denotes the `1 norm of a vector. • kvk1 := maxi |vi| denotes the maximum norm of a vector. • k·kF denotes the Frobenius norm of a matrix. • rf(·) denotes the gradient of a function f. • 1n denotes the column vector in Rn with 1 for all elements. • ei denotes the column vector in Rn with 1 for the ith element and 0 for others. • f ⇤denotes the optimal solution of (2). Assumptions • All rfi(·)0s are Lipschitz continuous with respect to the `2 norm, that is, ''rfi(x) −rfi(y) '' 2 Lkx −yk2 8x, 8y, 8i. (3) • The stochastic gradient rFi(x; ⇠) is unbiased, that is, E⇠⇠DirFi(x; ⇠) = rfi(x) 8x. (4) • The variance of stochastic gradient is bounded, that is, E⇠⇠Di ''rFi(x; ⇠) −rfi(x) ''2 2 σ2 8x, 8i. (5) 3 Algorithm 1 The procedure on the ith node of distributed SGD with sparse gradients Require: initial point x0,i, number of iterations K, and learning rate γ 1: for j = 0, 1, 2, . . . , K −1 do 2: Randomly select m training samples indexed by ⇠j,i = [⇠j,i,0, ⇠j,i,1, . . . , ⇠j,i,m−1] 3: Compute a local stochastic gradient based on ⇠j,i: rFi(xj,i; ⇠j,i) 4: Update the model parameters locally: xj+ 1 2 ,i = xj,i −γrFi(xj,i; ⇠j,i) 5: Select a subset of parameter components indexed by vj and let Pj = vjvT j 6: Average the selected parameter components: xj+1,i = 1 n Pn k=1 Pjxj+ 1 2 ,k +(I −Pj)xj+ 1 2 ,i 7: end for • The variance of gradient among nodes is bounded, that is, Ei⇠U(1,n) ''rfi(x) −rf(x) ''2 2 &2 8x, (6) where U(1, n) is a discrete uniform distribution of integers from 1 to n. If all nodes share the same training data, & = 0. These assumptions are commonly used in previous works for analyzing convergence rate of distributed SGD [46, 31, 5, 17]. 3.2 Sparse Parameter Averaging Sparse parameter averaging aims to reduce the communication overhead by exchanging only a subset of gradient or model parameter components in each iteration. Algorithm 1 gives a procedure of distributed SGD with sparse parameter averaging. All nodes are initialized with an identical initial point x0. In each iteration, it first computes a stochastic gradient based on the current value of model parameters and a local mini-batch. Then, the model parameters are updated locally with the stochastic gradients. Next, a subset of parameter components are selected (Line 5). The selected components are denoted as a binary vector vj in the algorithm – the pth element in vj is 1 if the pth component is selected; otherwise it is 0. We require that all nodes share the same vj in the jth iteration, i.e., all nodes are communicating the same components. This is a reasonable requirement as averaging different components from different nodes leads to inconsistent model parameters. The selection is applied to the model parameters via a projection Pj = vjvT j which is a diagonal matrix with the pth element in the diagonal being 1 if the pth component is selected. In the synchronization step (Line 6), the selected components are updated with the average values from all nodes while the unselected components keep their local values. Note that Algorithm 1 is different from asynchronous SGD [35] as all nodes are synchronized before updating the selected local model parameters in this algorithm. Convergence Rate Throughout the paper, we discuss the convergence rate of training algorithms in terms of the average of the `2 norm of the gradients. Specifically, we say an algorithm gives an ✏-approximation solution if 1 K 0 @ K−1 X j=0 '''rf * xj +''' 2 2 1 A ✏. (7) This metric is conventionally used in the analysis for non-convex optimization [17, 32, 31]. Instead of considering any specific sparsification strategy, we require Algorithm 1 to exchange all parameter components in any p consecutive iterations. More formally, we require k Y t=j * I −Pj + = 0 8(k −j) ≥p. (8) If this condition holds, we have the following convergence rate for distributed SGD with any gradient sparsification method: Theorem 1. Under the assumptions in §3.1, if Lγ 1 and 1 > 6np2L2γ2, Algorithm 1 has the following convergence rate: 1 K 0 @ K−1 X j=0 '''''rf ✓Xj1n n ◆''''' 2 2 1 A 2 * f (x0) −f ⇤+ D1 γK +Lγσ2D1 M +pn2L2γ2σ2D2 M +3np2L2γ2&2D2, (9) 4 where D1 = 1 −3np2L2γ2 1 −6np2L2γ2 ! , D2 = ✓ 1 1 −6np2L2γ2 ◆ . (10) In Theorem 1, Xj = [xj,1, xj,2, . . . , xj,n] 2 RN⇥n are the model parameters on n nodes and Xj1n n = 1 n Pn i=1 xj,i is their average. Theorem 1 indicates that Algorithm 1 has guaranteed convergence if Lγ 1 and 1 > 6np2L2γ2. The result applies to any sparsification strategy as long as a limited p is ensured. Our analysis shows that the threshold used in different sparsification strategies for selecting gradient components actually does not affect the convergence rate of SGD directly; instead, it is the variance of model parameters among different computing nodes that really matters. (See Proof to Theorem 1 in supplemental for more details.) Intuitively, a larger threshold means fewer exchanges of gradient components, which leads to a larger variance of model parameters among nodes, and thus, a slower convergence of the training process. The analysis also provides a theoretical basis for tuning the threshold for selecting gradient components in sparse-communication SGD: we should adjust the threshold adaptively to keep a small variance of model parameters among nodes. With a proper learning rate, we can obtain the following result from Theorem 1: Corollary 1. Under the assumptions in §3.1, if setting γ = ✓ p M/K where ✓> 0 is a constant, we have the convergence rate for Algorithm 1 as: 1 K 0 @ K−1 X j=0 '''''rf ✓Xj1n n ◆''''' 2 2 1 A 4✓−1 * f (x0) −f ⇤+ + 2✓Lσ2 p MK + 2pn2✓2L2σ2 + 6nM✓2p2L2&2 K (11) if the total number of iterations is large enough: K ≥12nM✓2p2L2. (12) If K is large enough, the second term in (11) will be dominated by the first term, and the algorithm will converge at rate O(1/ p MK). In practice, K is usually set as a fixed number. Corollary 1 indicates that there is a trade-off between the communication overhead and the convergence rate. A larger p leads to a smaller communication overhead, but a larger second term in (11). Linear Speedup With O(1/ p MK) convergence rate, Algorithm 1 achieves ✏-approximation solution when mK / 1/(n✏2). That is, the amount of computation required on each node is inversely proportional to n. Thus, linear speedup can be achieved by Algorithm 1 asymptotically w.r.t computational complexity. Periodic Averaging As a particular sparsification strategy, we can average the model parameters once every p iterations. That is, Pj = I if p divides j, and Pj = 0 if p does not divide j. This strategy obviously satisfies the condition in (8). Therefore, we have the following result: Corollary 2. If we periodically average the model parameters once every p iterations, distributed SGD still converges at rate O(1/ p MK) when K is large enough. One advantage of this simple strategy is that it not only decreases the average communication data size but also reduces the average latency by a factor of p. This approach has been used in practice [34, 43]; however, its convergence has not been well studied. Our result illustrates the interaction of p with other training hyperparameters and shows its influence to the convergence rate of distributed SGD. 3.3 Gradient Quantization As an orthogonal approach to sparse parameter averaging, gradient quantization aims to reduce the communication cost by representing the gradients with fewer bits. The local stochastic gradient on each node is given to a quantization function before synchronizing with other nodes. The model parameters are then updated with the average of the quantized gradients. Convergence Rate Previous works have shown the convergence of distributed SGD with unbiased stochastic quantization functions [5, 46]. However, no convergence rate is given in [46], and the convergence analysis on non-convex optimization in [5] shows that the average `2 norm of the gradients has a constant variance blowup term. We now give a more general convergence result for 5 distributed SGD using unbiased stochastic quantization functions. Suppose the quantization function is Q, our result is based on the bound of expected error of a quantization function defined as follows: q = sup x2RN ''Q(x) −x ''2 2 kxk2 2 . (13) With this definition, we have the following convergence result for distributed SGD with gradient quantization: Theorem 2. Under the assumptions in §3.1, if using an unbiased quantization function with an error bound q as defined in (13) and (1 + q n)Lγ < 2, distributed SGD has the following convergence rate: 1 K 0 @ K−1 X j=0 '''rf * xj +''' 2 2 1 A (f(x0) −f ⇤)D γK + (1 + q)Lγσ2D 2M + qLγ&2D 2n , (14) where D = 2 2 −(1 + q n)Lγ (15) Setting a proper learning rate, we can obtain the following result: Corollary 3. Under the assumptions in §3.1, if using a quantization function with an error bound of q and setting γ = ✓ p M/K where ✓> 0 is a constant, we have the following convergence rate for distributed SGD: 1 K 0 @ K−1 X j=0 '''rf * xj +''' 2 2 1 A 2✓−1 * f(x0) −f ⇤+ + (1 + q)✓Lσ2 p MK + m p MK ✓qL&2 (16) if the total number of iterations is large enough: K ≥ML2✓2(1 + q n)2. (17) Corollary 3 suggests that if all nodes share the same training data (i.e. & = 0), q = ⇥(1) is a sufficient condition for distributed SGD to achieve O(1/ p MK) convergence rate. If each node can access only a partition of the training data (i.e. & 6= 0), distributed SGD can still achieve O(1/ p MK) convergence rate by using a quantization function that ensures q = ⇥(1/m). Comparison of QSGD and TernGrad Based on the above results, we now discuss the performance of the quantization functions proposed in the two previous works: QSGD [5] and TernGrad [46]. The quantization function in QSGD has a configurable level s. A gradient component vi is quantized to either l/s or (l + 1)/s based on a Bernoulli distribution defined as 8 < : P{bi = (l + 1)/s} = s|vi| kvk2 −l P{bi = l/s} = 1 −s|vi| kvk2 + l. (18) The quantized value of vi is defined as Qs(vi) = bi · sign(vi) · kvk2. Alistarh et al. have shown that Qs has q min{N/s2, p N/s}, while a more accurate bound is q = min{N/(4s2), p N/s} (see supplemental material B for more explanation). This indicates that s = p N/2 is enough to achieve q = 1 (thus O(1/ p MK) convergence rate) on shared training data. For training with partitioned data (i.e., & 6= 0), we can increase the quantization level of QSGD to p mN/2 to achieve q = 1/m. Note that s is not the actual quantization level of Qs, though Alistarh et al. called so in their paper [5]. The actual number of different values of l in Qs is (s · kvk1 /kvk2). That is, the number of bits used to encode a quantized component is dlog2 * s · kvk1 /kvk2 + e. To see this, we can consider QSGD with s levels in range [0, kvk2] as quantization with (s · kvk1 /kvk2) levels in range [0, kvk1] because both use classification interval of size kvk2/s. This also illustrates that the TernGrad proposed by Wen et al. [46] is equivalent to QSGD with s = kvk2/ kvk1 (see supplemental material B and C for more explanation). Therefore, when the gradient components are more evenly distributed (i.e., s = kvk2/ kvk1 ! p N), the fewer quantization levels Qs needs and the better convergence rate TernGrad can achieve. (Consider the extreme case when the gradient is a vector of same value; It is apparent that quantization level of 1 suffices to encode the gradient.) In general, TernGrad does not achieve O(1/ p MK) convergence rate. 6 4 Periodic Quantized Averaging SGD (PQASGD) Algorithm 2 The procedure on the ith node of PQASGD Require: initial point x0,i, number of iterations K, and learning rate γ 1: for j = 0, 1, 2, . . . , K −1 do 2: Randomly select m training samples indexed by ⇠j,i = [⇠j,i,0, ⇠j,i,1, ..., ⇠j,i,m−1] 3: Compute a local stochastic gradient based on ⇠j,i: rFi(xj,i; ⇠j,i) 4: Update the model parameters locally: xj+1,i = xj,i −γrFi(xj,i; ⇠j,i) 5: if ((j + 1) mod p) = 0 then 6: Compute the change of parameters since last synchronization: Gj,i = xj+1,i −xj+1−p,i 7: Quantize the change of parameters: ∆j,i = Q(Gj,i) 8: Average the quantized changes on all nodes: ∆j = 1 n Pn k=1 ∆j,k 9: Update the model parameters: xj+1,i = xj+1−p,i + ∆j 10: end if 11: end for In the previous section, we show that sparse parameter averaging and gradient quantization can achieve O(1/ p MK) convergence rate for distributed SGD. However, the compression ratio is limited by using either of the two strategies alone. With sparse parameter averaging, a large p may impair the convergence rate and even lead to divergence. With gradient quantization, even if the gradient components are evenly distributed and the optimal convergence rate can be achieved with 2-bit quantization (one bit for the sign and one bit for the level as in TernGrad), the compression ratio is at most 32/2 = 16 (if no other compression is applied). We now propose a simple strategy that combines sparsification and quantization to further reduce the communication overhead while preserving the O(1/ p MK) convergence rate. The idea is to communicate the quantized changes of model parameters once every p iterations. The procedure is shown in Algorithm 2. All nodes are initialized with the same initial point. In each iteration, each node computes a stochastic gradient based on a local mini-batch and updates its local model parameters. If the iterate number (j + 1) is not a multiple of p, the algorithm continues to the next iteration without any communication. If j + 1 is a multiple of p, each node computes the change of model parameters since last synchronization and quantize the change (Line 6-7). Then, the local quantized changes are averaged among nodes (Line 8) and the average value is updated to the local model parameters (Line 9). Convergence Rate We have the following convergence rate for Algorithm 2: Theorem 3. Under the assumptions in §3.1, suppose the quantization function is unbiased with an error bound q and the learning rate γ = ✓ p M/K where ✓is a constant, Algorithm 2 has the following convergence rate: 1 K K−1 X j=0 E '''''rf ✓ Xj 1n n ◆''''' 2 2 2✓−1 * f(x0) −f ⇤+ p MK + 2(1 + 2q)L✓σ2 p MK + 12qpmL✓&2 p MK (19) if the total number of iterations is large enough: K ≥max M✓2 4q2 ⇣p (n2pL)2 + 12np2q2(1 + L2) + n2pL ⌘2 , 144ML2✓2q2p2 n2 , ML2✓2 ! (20) Theorem 3 implies that PQASGD converges at rate O((1 + q)/ p MK) if all node share the same training data, and converges at rate O(1 + mpq)/ p MK if the training data are partitioned. Thus, O(1/ p MK) convergence rate can be achieved in both cases by using quantization functions that ensure q = 1 and pq = 1/m respectively. Compared with stand-alone gradient quantization, PQASGD reduces the communication data size by a factor of p on shared training data and a factor of p/ log(p) on partitioned training data. 7 0 50 100 150 200 Epochs 0.0 0.5 1.0 1.5 2.0 2.5 Training Loss FULLSGD PSGD (p = 2) PSGD (p = 4) PSGD (p = 8) RSGD (p = 2) RSGD (p = 4) RSGD (p = 8) 140 160 180 200 0.002 0.006 0.010 0.014 0.018 (a) Training loss: ResNet32 on 8 machines 0 25 50 75 100 125 150 175 200 Epochs 30 40 50 60 70 80 90 Test Accuracy (%) FULLSGD PSGD (p = 2) PSGD (p = 4) PSGD (p = 8) RSGD (p = 2) RSGD (p = 4) RSGD (p = 8) 150 175 200 90.5 91.0 91.5 (b) Test Accuracy: ResNet32 on 8 machines 0 20 40 60 80 100 120 140 160 Epochs 0.0 0.5 1.0 1.5 2.0 2.5 3.0 Training Loss FULLSGD QSGD-S (s = p N/2, ce = 0.231) QSGD-P (s = p N/2, ce = 0.242) QSGD-P (s = p mN/2, ce = 0.297) PQASGD-P (p = 8, s = pmpN/2, ce = 0.044) PQASGD-S (p = 8, s = p N/2, ce = 0.030) 120 130 140 150 160 0.000 0.002 0.004 0.006 (c) Training loss: VGG16 on 8 machines 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 7LPe (seF) 1e3 0 1 2 3 4 5 7UDLQLQg Loss 2.7x fDsteU 1.7x fDsteU )8LL6GD 46GD-3 (s ) 0 mN/2, ce ) (. 247) 34A6GD-3 (p ) 8, s ) 0 mpN/2, ce ) (. (35) 1.30 1.31 1.32 1e3 0.00 0.02 0.04 0.06 0.08 0.10 (d) Training loss: ResNet110 on 16 machines Figure 1: Training loss and test accuracy for different image classification models on CIFAR-10. 5 Experiments In this section, we validate our theory with experiments on two machine learning tasks: image classification and speech recognition. For image classification, we train ResNet [19] and VGG [39] with different number of layers on CIFAR-10 [24]. For speech recognition, we train a 5-layer LSTM of 800 hidden units per layer on AN4 dataset [2]. Our experiments are conducted on a local HPC cluster. Each machine in the cluster has an NVIDIA K80 GPU and is considered as a single node in the training. The machines are connected with 100Gbps InfiniBand and have GPUDirect peer-to-peer communication. We use OpenMPI 3.0.0 as the communication backend, and implement the algorithms in the paper within Pytorch 0.3.1. To make the benefits of communication reduction more noticeable, we direct OpenMPI to use TCP-based communication and use trickle to throttle the upload and download bandwidth of the training process on each node to 5Gbps in order to emulate a 10Gbps connection. In practice, network bandwidth can always become a bottleneck when training larger models. There are three aspects in our evaluation: 1) We evaluate two sparse parameter averaging strategies – periodic averaging (PSGD) and rotate averaging (RSGD), on partitioned training data. PSGD averages the model parameters once every p iterations as described in the paper. RSGD divides the parameters into p chunks and averages the ith chunk if j mod p = i where j is the iterate number. It is obvious that RSGD meets the condition in (8). We compare the convergence rate of PSGD and RSGD with full-communication SGD (FULLSGD) to see if they can converge at rate O(1/ p MK) as stated in Theorem 1. 2) We use QSGD [5] with level s = p N/2 on both shared and partitioned training data (QSGD-S and QSGD-P respectively) and compare its convergence rate with FULLSGD. Then, we set the level s to p mN/2 for QSGD-P to validate our conclusion in §3.3 that q = 1/m is enough to achieve O(1/ p MK) convergence rate for training on partitioned data. 3) We compare the convergence rate and performance of our PQASGD with FULLSGD, TernGrad and QSGD. For training on partitioned training data, we set the level s to pmpN/2 for PQASGD and p mN/2 for QSGD to achieve q = 1 for both algorithms. 5.1 Results on Image Classification For all experiments on image classification, we use mini-batch size m = 32 on each node. For training on 4 machines (total mini-batch size M = 128), we initialize the learning rate γ to 0.1 and 8 decrease it to 0.01 after 110 epochs. The momentum is set to 0.9. For training on more machines, the learning rate scales with the number of nodes. For example, the learning rate for training on 16 machines is initialized to 0.4 and decreased to 0.04 after 110 epochs. Figure 1a shows the training loss for ResNet32 over epochs on 8 machines with partitioned training data. We can see that PSGD and RSGD with p ranging from 2 to 8 converge almost as fast as FULLSGD. While there is a small gap between the training loss of FULLSGD and PSGD/RSGD with p = 8, we can see from the zoomed figure that the gap narrows as the training proceeds. This is observed in all of the models used in our experiments (we have more results in supplemental material D), which validate our claim in Theorem 1. Figure 1b shows the test accuracy over epochs corresponding to the training process in Figure 1a. We can see that PSGD/RSGD achieve test accuracy comparable to that of FULLSGD, indicating sparse communication does not cause accuracy loss. In fact, we observe that when p = 2 and 4, PSGD/RSGD consistently achieve slightly higher accuracy than FULLSGD. As generalization performance of deep neural networks has not been well explained and current theories are mostly based on strong hypotheses [21, 15, 23, 41, 40], we suspect that sparse-communication actually helps the training process escape sharp minimum and avoid overfitting. We will investigate this property of sparsecommunication SGD in future work. Figure 1c shows the training loss for VGG16 over epochs on 8 machines. The number ce in the figure is the compression efficiency, which represents the ratio of compressed data size to the original communication data size of FULLSGD. For QSGD, the compression efficiency = number_of_bits_used/32. We can see that QSGD-S with s = p N/2 matches the convergence rate of FULLSGD with 23.1% communication data size (i.e., with an average of 0.231 ⇥32 ⇡7.4 bits used for each gradient component). In contrast, there is an apparent gap between the training loss of FULLSGD and QSGD-P with s = p N/2, which indicates that data partitioning does affect the convergence rate of distributed SGD with quantized gradients. This effect is eliminated by setting s to p mN/2. TernGrad achieve 6.3% compression efficiency; however, its training loss after 160 epochs is around 0.02, which is 10 times larger than the other methods. We do not plot the training loss for TernGrad in Figure 1c because it is hard to show its line with other lines in the same scale. From the zoomed figure, we can see that our PQASGD with p = 8 matches FULLSGD after 130 epochs on both shared and partitioned training data, while it only incurs 3% and 4.4% communication overhead respectively. Compared with TernGrad, our PQASGD converges much faster while achieving even higher compression ratio. This indicates that instead of simply pursuing more aggressive quantization, combining with sparsification is a more effective approach to reduce the communication overhead for distributed SGD. Figure 1d shows the training loss for ResNet110 over time on 16 GPUs. We run FULLSGD, QSGD, TernGrad and PQASGD on partitioned training data for 200 epochs. QSGD uses s = p mN/2 and PQASGD uses p = 8 and s = pmpN/2. The mini-batch size and learning rate are the same as described above, except that we set the learning rate to 0.04 in the first 10 epochs for warmup. TernGrad diverges occasionally for training this model, so we do not include its result here. We can see that our PQASGD achieves 2.7x speedup against FULLSGD and 1.7x against QSGD as it requires only 3.5% communication data size compared with FULLSGD. The test error of PQASGD after 200 epochs is 0.0635, which is in consistent with the best accuracy reported in [19]. Thus, our PQASGD does not impair the generalization. 5.2 Results on Speech Recognition The results on speech recognition follow the same pattern as for image classification. Due to space limit, we leave the results in the supplemental material. 6 Conclusion In this work, we studied the convergence rate of distributed SGD with two communication reducing strategies: sparse parameter averaging and gradient quantization. We prove that both strategies can achieve O(1/ p MK) convergence rate if configured properly. We also propose a strategy called PQASGD that combines sparsification and quantization while preserving the O(1/ p MK) convergence rate. The experiments validate our theoretical results and show that our PQASGD matches the convergence rate of full-communication SGD with only 3%-5% communication data size. 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 distributed systems. CoRR, abs/1603.04467, 2016. [2] A. Acero. Acoustical and environmental robustness in automatic speech recognition. 1990. [3] A. Agarwal and J. C. Duchi. Distributed delayed stochastic 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 873–881. Curran Associates, Inc., 2011. [4] A. F. Aji and K. Heafield. Sparse communication for distributed gradient descent. CoRR, abs/1704.05021, 2017. [5] D. Alistarh, D. Grubic, J. Li, R. Tomioka, and M. Vojnovic. Qsgd: Communication-efficient sgd via gradient quantization and encoding. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems 30, pages 1709–1720. Curran Associates, Inc., 2017. [6] A. A. Awan, K. Hamidouche, J. M. Hashmi, and D. K. Panda. S-Caffe: Co-designing MPI Runtimes and Caffe for Scalable Deep Learning on Modern GPU Clusters. In Proceedings of the 22nd ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, PPoPP ’17, pages 193–205, New York, NY, USA, 2017. ACM. [7] C.-Y. Chen, J. Choi, D. Brand, A. Agrawal, W. Zhang, and K. Gopalakrishnan. Adacomp : Adaptive residual gradient compression for data-parallel distributed training. CoRR, abs/1712.02679, 2017. [8] T. Chen, M. Li, Y. Li, M. Lin, N. Wang, M. Wang, T. Xiao, B. Xu, C. Zhang, and Z. Zhang. Mxnet: A flexible and efficient machine learning library for heterogeneous distributed systems. CoRR, abs/1512.01274, 2015. [9] T. Chilimbi, Y. Suzue, J. Apacible, and K. Kalyanaraman. Project adam: Building an efficient and scalable deep learning training system. In Proceedings of the 11th USENIX Conference on Operating Systems Design and Implementation, OSDI’14, pages 571–582, Berkeley, CA, USA, 2014. USENIX Association. [10] A. Coates, B. Huval, T. Wang, D. J. Wu, A. Y. Ng, and B. Catanzaro. Deep learning with cots hpc systems. In Proceedings of the 30th International Conference on International Conference on Machine Learning Volume 28, ICML’13, pages III–1337–III–1345. JMLR.org, 2013. [11] R. Collobert, S. Bengio, and J. Marithoz. Torch: A modular machine learning software library, 2002. [12] C. M. De Sa, C. Zhang, K. Olukotun, C. Ré, and C. Ré. Taming the wild: A unified analysis of hogwildstyle algorithms. In C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett, editors, Advances in Neural Information Processing Systems 28, pages 2674–2682. Curran Associates, Inc., 2015. [13] J. Dean, G. S. Corrado, R. Monga, K. Chen, M. Devin, Q. V. Le, M. Z. Mao, M. Ranzato, A. Senior, P. Tucker, K. Yang, and A. Y. Ng. Large scale distributed deep networks. In Proceedings of the 25th International Conference on Neural Information Processing Systems - Volume 1, NIPS’12, pages 1223– 1231, USA, 2012. Curran Associates Inc. [14] O. Dekel, R. Gilad-Bachrach, O. Shamir, and L. Xiao. Optimal distributed online prediction using mini-batches. J. Mach. Learn. Res., 13(1):165–202, Jan. 2012. [15] L. Dinh, R. Pascanu, S. Bengio, and Y. Bengio. Sharp minima can generalize for deep nets. In D. Precup and Y. W. Teh, editors, Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pages 1019–1028, International Convention Centre, Sydney, Australia, 06–11 Aug 2017. PMLR. [16] R. Garg and R. Khandekar. Gradient descent with sparsification: An iterative algorithm for sparse recovery with restricted isometry property. In Proceedings of the 26th Annual International Conference on Machine Learning, ICML ’09, pages 337–344, New York, NY, USA, 2009. ACM. [17] S. Ghadimi and G. Lan. Stochastic first- and zeroth-order methods for nonconvex stochastic programming. SIAM Journal on Optimization, 23(4):2341–2368, 2013. [18] S. Gupta, A. Agrawal, K. Gopalakrishnan, and P. Narayanan. Deep learning with limited numerical precision. CoRR, abs/1502.02551, 2015. 10 [19] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. CoRR, abs/1512.03385, 2015. [20] Q. Ho, J. Cipar, H. Cui, J. K. Kim, S. Lee, P. B. Gibbons, G. A. Gibson, G. R. Ganger, and E. P. Xing. More effective distributed ml via a stale synchronous parallel parameter server. In Proceedings of the 26th International Conference on Neural Information Processing Systems - Volume 1, NIPS’13, pages 1223–1231, USA, 2013. Curran Associates Inc. [21] E. Hoffer, I. Hubara, and D. Soudry. Train longer, generalize better: closing the generalization gap in large batch training of neural networks. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems 30, pages 1731–1741. Curran Associates, Inc., 2017. [22] Y. Jia, E. Shelhamer, J. Donahue, S. Karayev, J. Long, R. Girshick, S. Guadarrama, and T. Darrell. Caffe: Convolutional architecture for fast feature embedding. In Proceedings of the 22Nd ACM International Conference on Multimedia, MM ’14, pages 675–678, New York, NY, USA, 2014. ACM. [23] N. S. Keskar, D. Mudigere, J. Nocedal, M. Smelyanskiy, and P. T. P. Tang. On large-batch training for deep learning: Generalization gap and sharp minima. CoRR, abs/1609.04836, 2016. [24] A. Krizhevsky. Learning multiple layers of features from tiny images. Technical report, 2009. [25] Y. LeCun, Y. Bengio, and G. Hinton. Deep learning. Nature, 521:436 EP –, 05 2015. [26] H. Li, S. De, Z. Xu, C. Studer, H. Samet, and T. Goldstein. Training quantized nets: A deeper understanding. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems 30, pages 5811–5821. Curran Associates, Inc., 2017. [27] 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 Proceedings of the 11th USENIX Conference on Operating Systems Design and Implementation, OSDI’14, pages 583–598, Berkeley, CA, USA, 2014. USENIX Association. [28] M. Li, D. G. Andersen, A. J. Smola, and K. Yu. Communication efficient distributed machine learning with the parameter server. In Z. Ghahramani, M. Welling, C. Cortes, N. D. Lawrence, and K. Q. Weinberger, editors, Advances in Neural Information Processing Systems 27, pages 19–27. Curran Associates, Inc., 2014. [29] M. Li, J. Dean, B. Póczos, R. Salakhutdinov, and A. J. Smola. Scaling distributed machine learning with system and algorithm co-design. 2016. [30] X. Lian, Y. Huang, Y. Li, and J. Liu. Asynchronous parallel stochastic gradient for nonconvex optimization. In Proceedings of the 28th International Conference on Neural Information Processing Systems, NIPS’15, pages 2737–2745, Cambridge, MA, USA, 2015. MIT Press. [31] X. Lian, C. Zhang, H. Zhang, C.-J. Hsieh, W. Zhang, and J. Liu. Can decentralized algorithms outperform centralized algorithms? a case study for decentralized parallel stochastic gradient descent. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems 30, pages 5330–5340. Curran Associates, Inc., 2017. [32] 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 29, pages 3054–3062. 2016. [33] Y. Lin, S. Han, H. Mao, Y. Wang, and B. Dally. Deep gradient compression: Reducing the communication bandwidth for distributed training. In International Conference on Learning Representations, 2018. [34] D. Povey, X. Zhang, and S. Khudanpur. Parallel training of deep neural networks with natural gradient and parameter averaging. CoRR, abs/1410.7455, 2014. [35] B. Recht, C. Re, S. Wright, and F. 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. [36] F. Seide and A. Agarwal. Cntk: Microsoft’s open-source deep-learning toolkit. In Proceedings of the 22Nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’16, pages 2135–2135, New York, NY, USA, 2016. ACM. 11 [37] F. Seide, H. Fu, J. Droppo, G. Li, and D. Yu. 1-bit stochastic gradient descent and application to data-parallel distributed training of speech dnns, September 2014. [38] R. Shi, Y. Gan, and Y. Wang. Evaluating scalability bottlenecks by workload extrapolation. In 2018 IEEE 26th International Symposium on Modelling, Analysis and Simulation of Computer and Telecommunication Systems (MASCOTS), Milwaukee, WI, USA, Sept 2018. [39] K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. CoRR, abs/1409.1556, 2014. [40] S. L. Smith, P.-J. Kindermans, and Q. V. Le. Don’t decay the learning rate, increase the batch size. In International Conference on Learning Representations, 2018. [41] S. L. Smith and Q. V. Le. A bayesian perspective on generalization and stochastic gradient descent. In International Conference on Learning Representations, 2018. [42] N. Strom. Scalable distributed dnn training using commodity gpu cloud computing. In INTERSPEECH, 2015. [43] H. Su and H. Chen. Experiments on parallel training of deep neural network using model averaging. CoRR, abs/1507.01239, 2015. [44] L. Wang, J. Ye, Y. Zhao, W. Wu, A. Li, S. L. Song, Z. Xu, and T. Kraska. Superneurons: Dynamic gpu memory management for training deep neural networks. In Proceedings of the 23rd ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, PPoPP ’18, pages 41–53, New York, NY, USA, 2018. ACM. [45] J. Wangni, J. Wang, J. Liu, and T. Zhang. Gradient sparsification for communication-efficient distributed optimization. CoRR, abs/1710.09854, 2017. [46] W. Wen, C. Xu, F. Yan, C. Wu, Y. Wang, Y. Chen, and H. Li. Terngrad: Ternary gradients to reduce communication in distributed deep learning. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems 30, pages 1509–1519. Curran Associates, Inc., 2017. [47] S. Zhang, A. Choromanska, and Y. LeCun. Deep learning with elastic averaging sgd. In Proceedings of the 28th International Conference on Neural Information Processing Systems - Volume 1, NIPS’15, pages 685–693, Cambridge, MA, USA, 2015. MIT Press. [48] S. Zhou, Z. Ni, X. Zhou, H. Wen, Y. Wu, and Y. Zou. Dorefa-net: Training low bitwidth convolutional neural networks with low bitwidth gradients. CoRR, abs/1606.06160, 2016. 12
2018
105
7,259
Almost Optimal Algorithms for Linear Stochastic Bandits with Heavy-Tailed Payoffs Han Shao∗ Xiaotian Yu∗ Irwin King Michael R. Lyu Department of Computer Science and Engineering The Chinese University of Hong Kong {hshao,xtyu,king,lyu}@cse.cuhk.edu.hk Abstract In linear stochastic bandits, it is commonly assumed that payoffs are with subGaussian noises. In this paper, under a weaker assumption on noises, we study the problem of linear stochastic bandits with heavy-tailed payoffs (LinBET), where the distributions have finite moments of order 1 + ϵ, for some ϵ ∈(0, 1]. We rigorously analyze the regret lower bound of LinBET as Ω(T 1 1+ϵ ), implying that finite moments of order 2 (i.e., finite variances) yield the bound of Ω( √ T), with T being the total number of rounds to play bandits. The provided lower bound also indicates that the state-of-the-art algorithms for LinBET are far from optimal. By adopting median of means with a well-designed allocation of decisions and truncation based on historical information, we develop two novel bandit algorithms, where the regret upper bounds match the lower bound up to polylogarithmic factors. To the best of our knowledge, we are the first to solve LinBET optimally in the sense of the polynomial order on T . Our proposed algorithms are evaluated based on synthetic datasets, and outperform the state-of-the-art results. 1 Introduction The decision-making model named Multi-Armed Bandits (MAB), where at each time step an algorithm chooses an arm among a given set of arms and then receives a stochastic payoff with respect to the chosen arm, elegantly characterizes the tradeoff between exploration and exploitation in sequential learning. The algorithm usually aims at maximizing cumulative payoffs over a sequence of rounds. A natural and important variant of MAB is linear stochastic bandits with the expected payoff of each arm satisfying a linear mapping from the arm information to a real number. The model of linear stochastic bandits enjoys some good theoretical properties, e.g., there exists a closed-form solution of the linear mapping at each time step in light of ridge regression. Many practical applications take advantage of MAB and its variants to control decision performance, e.g., online personalized recommendations (Li et al., 2010) and resource allocations (Lattimore et al., 2014). In most previous studies of MAB and linear stochastic bandits, a common assumption is that noises in observed payoffs are sub-Gaussian conditional on historical information (Abbasi-Yadkori et al., 2011; Bubeck et al., 2012), which encompasses cases of all bounded payoffs and many unbounded payoffs, e.g., payoffs of an arm following a Gaussian distribution. However, there do exist practical scenarios of non-sub-Gaussian noises in observed payoffs for sequential decisions, such as highprobability extreme returns in investments for financial markets (Cont and Bouchaud, 2000) and fluctuations of neural oscillations (Roberts et al., 2015), which are called heavy-tailed noises. Thus, it is significant to completely study theoretical behaviours of sequential decisions in the case of heavy-tailed noises. ∗The first two authors contributed equally. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. Many practical distributions, e.g., Pareto distributions and Weibull distributions, are heavy-tailed, which perform high tail probabilities compared with exponential family distributions. We consider a general characterization of heavy-tailed payoffs in bandits, where the distributions have finite moments of order 1 + ϵ, where ϵ ∈(0, 1]. When ϵ = 1, stochastic payoffs are generated from distributions with finite variances. When 0 < ϵ < 1, stochastic payoffs are generated from distributions with infinite variances (Shao and Nikias, 1993). Note that, different from sub-Gaussian noises in the traditional bandit setting, noises from heavy-tailed distributions do not enjoy exponentially decaying tails, and thus make it more difficult to learn a parameter of an arm. The regret of MAB with heavy-tailed payoffs has been well addressed by Bubeck et al. (2013), where stochastic payoffs have bounds on raw or central moments of order 1 + ϵ. For MAB with finite variances (i.e., ϵ = 1), the regret of truncation algorithms or median of means recovers the optimal regret for MAB under the sub-Gaussian assumption. Recently, Medina and Yang (2016) investigated theoretical guarantees for the problem of linear stochastic bandits with heavy-tailed payoffs (LinBET). It is surprising to find that, for ϵ = 1, the regret of bandit algorithms by Medina and Yang (2016) to solve LinBET is !O(T 3 4 ) 2, which is far away from the regret of the state-of-the-art algorithms (i.e., !O( √ T)) in linear stochastic bandits under the sub-Gaussian assumption (Dani et al., 2008a; Abbasi-Yadkori et al., 2011). Thus, the most interesting and non-trivial question is Is it possible to recover the regret of !O( √ T) when ϵ = 1 for LinBET? In this paper, we answer this question affirmatively. Specifically, we investigate the problem of LinBET characterized by finite (1 + ϵ)-th moments, where ϵ ∈(0, 1]. The problem of LinBET raises several interesting challenges. The first challenge is the lower bound of the problem, which remains unknown. The technical issues come from the construction of an elegant setting for LinBET, and the derivation of a lower bound with respect to ϵ. The second challenge is how to develop a robust estimator for the parameter in LinBET, because heavy-tailed noises greatly affect errors of the conventional least-squares estimator. It is worth mentioning that Medina and Yang (2016) has tried to tackle this challenge, but their estimators do not make full use of the contextual information of chosen arms to eliminate the effect from heavy-tailed noises, which eventually leads to large regrets. The third challenge is how to successfully adopt median of means and truncation to solve LinBET with regret upper bounds matching the lower bound as closely as possible. Our Results. First of all, we rigorously analyze the lower bound on the problem of LinBET, which enjoys a polynomial order on T as Ω(T 1 1+ϵ ). The lower bound provides two essential hints: one is that finite variances in LinBET yield a bound of Ω( √ T), and the other is that algorithms by Medina and Yang (2016) are sub-optimal. Then, we develop two novel bandit algorithms to solve LinBET based on the basic techniques of median of means and truncation. Both the algorithms adopt the optimism in the face of uncertainty principle, which is common in bandit problems (Abbasi-Yadkori et al., 2011; Munos et al., 2014). The regret upper bounds of the proposed two algorithms, which are !O(T 1 1+ϵ ), match the lower bound up to polylogarithmic factors. To the best of our knowledge, we are the first to solve LinBET almost optimally. We conduct experiments based on synthetic datasets, which are generated by Student’s t-distribution and Pareto distribution, to demonstrate the effectiveness of our algorithms. Experimental results show that our algorithms outperform the state-of-the-art results. The contributions of this paper are summarized as follows: • We provide the lower bound for the problem of LinBET characterized by finite (1 + ϵ)-th moments, where ϵ ∈(0, 1]. In the analysis, we construct an elegant setting of LinBET, which results in a regret bound of Ω(T 1 1+ϵ ) in expectation for any bandit algorithm. • We develop two novel bandit algorithms, which are named as MENU and TOFU (with details shown in Section 4). The MENU algorithm adopts median of means with a welldesigned allocation of decisions and the TOFU algorithm adopts truncation via historical information. Both algorithms achieve the regret !O(T 1 1+ϵ ) with high probability. • We conduct experiments based on synthetic datasets to demonstrate the effectiveness of our proposed algorithms. By comparing our algorithms with the state-of-the-art results, we show improvements on cumulative payoffs for MENU and TOFU, which are strictly consistent with theoretical guarantees in this paper. 2We omit polylogarithmic factors of T for !O(·). 2 2 Preliminaries and Related Work In this section, we first present preliminaries, i.e., notations and learning setting of LinBET. Then, we give a detailed discussion on the line of research for bandits with heavy-tailed payoffs. 2.1 Notations For a positive integer K, [K] ≜{1, 2, · · · , K}. Let the ℓ-norm of a vector x ∈Rd be ∥x∥ℓ≜ (xℓ 1 + · · · + xℓ d) 1 ℓ, where ℓ≥1 and xi is the i-th element of x with i ∈[d]. For r ∈R, its absolute value is |r|, its ceiling integer is ⌈r⌉, and its floor integer is ⌊r⌋. The inner product of two vectors x, y is denoted by x⊤y = ⟨x, y⟩. Given a positive definite matrix A ∈Rd×d, the weighted Euclidean norm of a vector x ∈Rd is ∥x∥A = √ x⊤Ax. B(x, r) denotes a Euclidean ball centered at x with radius r ∈R+, where R+ is the set of positive numbers. Let e be Euler’s number, and Id ∈Rd×d an identity matrix. Let 1{·} be an indicator function, and E[X] the expectation of X. 2.2 Learning Setting For a bandit algorithm A, we consider sequential decisions with the goal to maximize cumulative payoffs, where the total number of rounds for playing bandits is T . For each round t = 1, · · · , T , the bandit algorithm A is given a decision set Dt ⊆Rd such that ∥x∥2 ≤D for any x ∈Dt. A has to choose an arm xt ∈Dt and then observes a stochastic payoff yt(xt). For notation simplicity, we also write yt = yt(xt). The expectation of the observed payoff for the chosen arm satisfies a linear mapping from the arm to a real number as yt(xt) ≜⟨xt, θ∗⟩+ ηt, where θ∗is an underlying parameter with ∥θ∗∥2 ≤S and ηt is a random noise. Without loss of generality, we assume E [ηt|Ft−1] = 0, where Ft−1 ≜{x1, · · · , xt} ∪{η1, · · · , ηt−1} is a σ-filtration and F0 = ∅. Clearly, we have E[yt(xt)|Ft−1] = ⟨xt, θ∗⟩. For an algorithm A, to maximize cumulative payoffs is equivalent to minimizing the regret as R(A, T ) ≜ " T # t=1 ⟨x∗ t , θ∗⟩ $ − " T # t=1 ⟨xt, θ∗⟩ $ = T # t=1 ⟨x∗ t −xt, θ∗⟩, (1) where x∗ t denotes the optimal decision at time t for θ∗, i.e., x∗ t ∈arg maxx∈Dt⟨x, θ∗⟩. In this paper, we will provide high-probability upper bound of R(A, T ) with respect to A, and provide the lower bound for LinBET in expectation for any algorithm. The problem of LinBET is defined as below. Definition 1 (LinBET). Given a decision set Dt for time step t = 1, · · · , T , an algorithm A, of which the goal is to maximize cumulative payoffs over T rounds, chooses an arm xt ∈Dt. With Ft−1, the observed stochastic payoff yt(xt) is conditionally heavy-tailed, i.e., E % |yt|1+ϵ|Ft−1 & ≤b or E % |yt −⟨xt, θ∗⟩|1+ϵ|Ft−1 & ≤c, where ϵ ∈(0, 1], and b, c ∈(0, +∞). 2.3 Related Work The model of MAB dates back to 1952 with the original work by Robbins et al. (1952), and its inherent characteristic is the trade-off between exploration and exploitation. The asymptotic lower bound of MAB was developed by Lai and Robbins (1985), which is logarithmic with respect to the total number of rounds. An important technique called upper confidence bound was developed to achieve the lower bound (Lai and Robbins, 1985; Agrawal, 1995). Other related techniques to solve the problem of sequential decisions include Thompson sampling (Thompson, 1933; Chapelle and Li, 2011; Agrawal and Goyal, 2012) and Gittins index (Gittins et al., 2011). The problem of MAB with heavy-tailed payoffs characterized by finite (1 + ϵ)-th moments has been well investigated (Bubeck et al., 2013; Vakili et al., 2013; Yu et al., 2018). Bubeck et al. (2013) pointed out that finite variances in MAB are sufficient to achieve regret bounds of the same order as the optimal regret for MAB under the sub-Gaussian assumption, and the order of T in regret bounds increases when ϵ decreases. The lower bound of MAB with heavy-tailed payoffs has been analyzed (Bubeck et al., 2013), and robust algorithms by Bubeck et al. (2013) are optimal. Theoretical guarantees by Bubeck et al. (2013); Vakili et al. (2013) are for the setting of finite arms. In Vakili et al. (2013), primary theoretical results were presented for the case of ϵ > 1. We notice that the case of ϵ > 1 is not interesting, because it reduces to the case of finite variances in MAB. 3 For the problem of linear stochastic bandits, which is also named linear reinforcement learning by Auer (2002), the lower bound is Ω(d √ T) when contextual information of arms is from a ddimensional space (Dani et al., 2008b). Bandit algorithms matching the lower bound up to polylogarithmic factors have been well developed (Auer, 2002; Dani et al., 2008a; Abbasi-Yadkori et al., 2011; Chu et al., 2011). Notice that all these studies assume that stochastic payoffs contain subGaussian noises. More variants of MAB can be discussed by Bubeck et al. (2012). It is surprising to find that the lower bound of LinBET remains unknown. In Medina and Yang (2016), bandit algorithms based on truncation and median of means were presented. When ϵ is finite for LinBET, the algorithms by Medina and Yang (2016) cannot recover the bound of !O( √ T) which is the regret of the state-of-the-art algorithms in linear stochastic bandits under the sub-Gaussian assumption. Medina and Yang (2016) conjectured that it is possible to recover !O( √ T) with ϵ being a finite number for LinBET. Thus, it is urgent to conduct a thorough analysis of the conjecture in consideration of the importance of heavy-tailed noises in real scenarios. Solving the conjecture generalizes the practical applications of bandit models. Practical motivating examples for bandits with heavy-tailed payoffs include delays in end-to-end network routing (Liebeherr et al., 2012) and sequential investments in financial markets (Cont and Bouchaud, 2000). Recently, the assumption in stochastic payoffs of MAB was relaxed from sub-Gaussian noises to bounded kurtosis (Lattimore, 2017), which can be viewed as an extension of Bubeck et al. (2013). The interesting point of Lattimore (2017) is the scale free algorithm, which might be practical in applications. Besides, Carpentier and Valko (2014) investigated extreme bandits, where stochastic payoffs of MAB follow Fréchet distributions. The setting of extreme bandits fits for the real scenario of anomaly detection without contextual information. The order of regret in extreme bandits is characterized by distributional parameters, which is similar to the results by Bubeck et al. (2013). It is worth mentioning that, for linear regression with heavy-tailed noises, several interesting studies have been conducted. Hsu and Sabato (2016) proposed a generalized method in light of median of means for loss minimization with heavy-tailed noises. Heavy-tailed noises in Hsu and Sabato (2016) might come from contextual information, which is more complicated than the setting of stochastic payoffs in this paper. Therefore, linear regression with heavy-tailed noises usually requires a finite fourth moment. In Audibert et al. (2011), the basic technique of truncation was adopted to solve robust linear regression in the absence of exponential moment condition. The related studies in this line of research are not directly applicable for the problem of LinBET. 3 Lower Bound In this section, we provide the lower bound for LinBET. We consider heavy-tailed payoffs with finite (1 + ϵ)-th raw moments in the analysis. In particular, we construct the following setting. Assume d ≥2 is even (when d is odd, similar results can be easily derived by considering the first d −1 dimensions). For Dt ⊆Rd with t ∈[T ], we fix the decision set as D1 = · · · = DT = D(d). Then, the fixed decision set is constructed as D(d) ≜{(x1, · · · , xd) ∈Rd + : x1 +x2 = · · · = xd−1 +xd = 1}, which is a subset of intersection of the cube [0, 1]d and the hyperplane x1 + · · · + xd = d/2. We define a set Sd ≜{(θ1, · · · , θd) : ∀i ∈[d/2] , (θ2i−1, θ2i) ∈{(2∆, ∆), (∆, 2∆)}} with ∆∈ (0, 1/d]. The payoff functions take values in {0, (1/∆) 1 ϵ } such that, for every x ∈D(d), the expected payoff is θ⊤ ∗x. To be more specific, we have the payoff function of x as y(x) = '( 1 ∆ ) 1 ϵ with a probability of ∆ 1 ϵ θ⊤ ∗x, 0 with a probability of 1 −∆ 1 ϵ θ⊤ ∗x. (2) We have the theorem for the lower bound of LinBET as below. Theorem 1 (Lower Bound of LinBET). If θ∗is chosen uniformly at random from Sd, and the payoff for each x ∈D(d) is in {0, (1/∆) 1 ϵ } with mean θ⊤ ∗x, then for any algorithm A and every T ≥(d/12) ϵ 1+ϵ , we have E [R(A, T )] ≥ d 192T 1 1+ϵ . (3) 4 ˆθn,k∗ calculate k LSEs with payoffs on {xi}n i=1 take median of means of {ˆθn,j}k j=1 · · · ... ... ... ... ... ... ... x1 x1 x2 x2 x3 x3 · · · · · · xn xn · · · · · · xN xN k = ⌈24 log ( eT δ ) ⌉ N = ⌊T k ⌋ ˆθn,1 ˆθn,k (a) Framework of MENU · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ... ... ... ... ... ... x1 x1 x1 xn xn xn xN xN xN N = T 2ϵ 1+3ϵ k = T 1+ϵ 1+3ϵ calculate LSE with {˜li}n i=1 of payoffs on {xi}k, i ∈[n] take median of means ˆθn ˜l1 ˜ln (b) Framework of MoM Figure 1: Framework comparison between our MENU and MoM by Medina and Yang (2016). In the proof of Theorem 1, we first prove the lower bound when d = 2, and then generalize the argument to any d > 2. We notice that the parameter in the original d-dimensional space is rearranged to d/2 tuples, each of which is a 2-dimensional vector as (θ2i−1, θ2i) ∈{(2∆, ∆), (∆, 2∆)} with i ∈[d/2]. If the i-th tuple of the parameter is selected as (2∆, ∆), then the i-th tuple of the optimal arm is (x∗,2i−1, x∗,2i) = (1, 0). In this case, if we define the i-th tuple of the chosen arm as (xt,2i−1, xt,2i), the instantaneous regret is ∆(1 −xt,2i−1). Then, the regret can be represented as an integration of ∆(1 −xt,2i−1) over D(d). Finally, with common inequalities in information theory, we obtain the regret lower bound by setting ∆= T − ϵ 1+ϵ /12. We notice that martingale differences to prove the lower bound for linear stochastic bandits in (Dani et al., 2008a) are not directly feasible for the proof of lower bound in LinBET, because under our construction of heavy-tailed payoffs (i.e., Eq. (4)), the information of ϵ is excluded. Besides, our proof is partially inspired by Bubeck (2010). We show the detailed proof of Theorem 1 in Appendix A. Remark 1. The above lower bound provides two essential hints: one is that finite variances in LinBET yield a bound of Ω( √ T), and the other is that algorithms proposed by Medina and Yang (2016) are far from optimal. The result in Theorem 1 strongly indicates that it is possible to design bandit algorithms recovering !O( √ T) with finite variances. 4 Algorithms and Upper Bounds In this section, we develop two novel bandit algorithms to solve LinBET, which turns out to be almost optimal. We rigorously prove regret upper bounds for the proposed algorithms. In particular, our core idea is based on the optimism in the face of uncertainty principle (OFU). The first algorithm is median of means under OFU (MENU) shown in Algorithm 1, and the second algorithm is truncation under OFU (TOFU) shown in Algorithm 2. For comparisons, we directly name the bandit algorithm based on median of means in Medina and Yang (2016) as MoM, and name the bandit algorithm based on confidence region with truncation in Medina and Yang (2016) as CRT. Both algorithms in this paper adopt the tool of ridge regression. At time step t, let ˆθt be the ℓ2regularized least-squares estimate (LSE) of θ∗as ˆθt = V −1 t X⊤ t Yt, where Xt ∈Rt×d is a matrix of which rows are x⊤ 1 , · · · , x⊤ t , Vt ≜X⊤ t Xt + λId, Yt ≜(y1, · · · , yt) is a vector of the historical observed payoffs until time t and λ > 0 is a regularization parameter. 4.1 MENU and Regret Description of MENU. To conduct median of means in LinBET, it is common to allocate T pulls of bandits among N ≤T epochs, and for each epoch the same arm is played multiple times to obtain an estimate of θ∗. We find that there exist different ways to construct the epochs. We design the framework of MENU in Figure 1(a), and show the framework of MoM designed 5 Algorithm 1 Median of means under OFU (MENU) 1: input d, c, ϵ, δ, λ, S, T , {Dn}N n=1 2: initialization: k = ⌈24 log " eT δ # ⌉, N = ⌊T k ⌋, V0 = λId, C0 = B(0, S) 3: for n = 1, 2, · · · , N do 4: (xn, ˜θn) = arg max(x,θ)∈Dn×Cn−1⟨x, θ⟩ ◃to select an arm 5: Play xn with k times and observe payoffs yn,1, yn,2, · · · , yn,k 6: Vn = Vn−1 + xnx⊤ n 7: For j ∈[k], ˆθn,j = V −1 n $n i=1 yi,jxi ◃to calculate LSE for the j-th group 8: For j ∈[k], let rj be the median of {∥ˆθn,j −ˆθn,s∥Vn : s ∈[k]\j} 9: k∗= arg minj∈[k] rj ◃to take median of means of estimates 10: βn = 3 % (9dc) 1 1+ϵ n 1−ϵ 2(1+ϵ) + λ 1 2 S & 11: Cn = {θ : ∥θ −ˆθn,k∗∥Vn ≤βn} ◃to update the confidence region 12: end for by Medina and Yang (2016) in Figure 1(b). For MENU and MoM, we have the following three differences. First, for each epoch n = 1, · · · , N, MENU plays the same arm xn by O(log(T )) times, while MoM plays the same arm by O(T 1+ϵ 1+3ϵ ) times. Second, at epoch n with historical payoffs, MENU conducts LSEs by O(log(T )) times, each of which is based on {xi}n i=1, while MoM conducts LSE by one time based on intermediate payoffs calculated via median of means of observed payoffs. Third, MENU adopts median of means of LSEs, while MoM adopts median of means of the observed payoffs. Intuitively, the execution of multiple LSEs will lead to the improved regret of MENU. With a better trade-off between k and N in Figure 1(a), we derive an improved upper bound of regret in Theorem 2. In light of Figure 1(a), we develop algorithmic procedures in Algorithm 1 for MENU. We notice that, in order to guarantee the median of means of LSEs not far away from the true underlying parameter with high probability, we construct the confidence interval in Line 10 of Algorithm 1. Now we have the following theorem for the regret upper bound of MENU. Theorem 2 (Regret Analysis for the MENU Algorithm). Assume that for all t and xt ∈Dt with ∥xt∥2 ≤D, ∥θ∗∥2 ≤S, |x⊤ t θ∗| ≤L and E[|ηt|1+ϵ|Ft−1] ≤c. Then, with probability at least 1 −δ, for every T ≥256 + 24 log (e/δ), the regret of the MENU algorithm satisfies R(MENU, T ) ≤6 % (9dc) 1 1+ϵ + λ 1 2 S + L & T 1 1+ϵ ' 24 log 'eT δ ( + 1 ( ϵ 1+ϵ ) 2d log ' 1 + T D2 λd ( . The technical challenges in MENU (i.e., Algorithm 1) and its proofs are discussed as follows. Based on the common techniques in linear stochastic bandits (Abbasi-Yadkori et al., 2011), to guarantee the instantaneous regret in LinBET, we need to guarantee ∥θ∗−ˆθn,k∗∥Vn ≤βn with high probability. We attack this issue by guaranteeing ∥θ∗−ˆθn,j∥Vn ≤βn/3 with a probability of 3/4, which could reduce to a problem of bounding a weighted sum of historical noises. Interestingly, by conducting singular value decomposition on Xn (of which rows are x⊤ 1 , · · · , x⊤ n ), we find that 2-norm of the weights is no greater than 1. Then the weighted sum can be bounded by a term as O * n 1−ϵ 2(1+ϵ) + . With a standard analysis in linear stochastic bandits from the instantaneous regret to the regret, we achieve the above results for MENU. We show the detailed proof of Theorem 2 in Appendix B. Remark 2. For MENU, we adopt the assumption of heavy-tailed payoffs on central moments, which is required in the basic technique of median of means (Bubeck et al., 2013). Besides, there exists an implicit mild assumption in Algorithm 1 that, at each epoch n, the decision set must contain the selected arm xn at least k times, which is practical in applications, e.g., online personalized recommendations (Li et al., 2010). The condition of T ≥256 + 24 log (e/δ) is required for T ≥k. The regret upper bound of MENU is !O(T 1 1+ϵ ), which implies that finite variances in LinBET are sufficient to achieve !O( √ T). 4.2 TOFU and Regret Description of TOFU. We demonstrate the algorithmic procedures of TOFU in Algorithm 2. We point out two subtle differences between our TOFU and the algorithm of CRT as follows. In TOFU, 6 Algorithm 2 Truncation under OFU (TOFU) 1: input d, b, ϵ, δ, λ, T , {Dt}T t=1 2: initialization: V0 = λId, C0 = B(0, S) 3: for t = 1, 2, · · · , T do 4: bt = ' b log( 2T δ ) ( 1 ϵ t 1−ϵ 2(1+ϵ) 5: (xt, ˜θt) = arg max(x,θ)∈Dt×Ct−1⟨x, θ⟩ ◃to select an arm 6: Play xt and observe a payoff yt 7: Vt = Vt−1 + xtx⊤ t and X⊤ t = [x1, · · · , xt] 8: [u1, · · · , ud]⊤= V −1/2 t X⊤ t 9: for i = 1, · · · , d do 10: Y † i = (y11ui,1y1≤bt, · · · , yt1ui,tyt≤bt) ◃to truncate the payoffs 11: end for 12: θ† t = V −1/2 t (u⊤ 1 Y † 1 , · · · , u⊤ d Y † d ) 13: βt = 4 √ db 1 1+ϵ " log " 2dT δ ## ϵ 1+ϵ t 1−ϵ 2(1+ϵ) + λ 1 2 S 14: Update Ct = {θ : ∥θ −θ† t ∥Vt ≤βt} ◃to update the confidence region 15: end for Table 1: Statistics of synthetic datasets in experiments. For Student’s t-distribution, ν denotes the degree of freedom, lp denotes the location, sp denotes the scale. For Pareto distribution, α denotes the shape and sm denotes the scale. NA denotes not available. dataset Dt {#arms,#dimensions} distribution {parameters} {ϵ, b, c} mean of the optimal arm S1 {20,10} Student’s t-distribution {ν = 3, lp = 0, sp = 1} {1.00, NA, 3.00} 4.00 S2 {100,20} Student’s t-distribution {ν = 3, lp = 0, sp = 1} {1.00, NA, 3.00} 7.40 S3 {20,10} Pareto distribution {α = 2, sm = x⊤ t θ∗ 2 } {0.50, 7.72, NA} 3.10 S4 {100,20} Pareto distribution {α = 2, sm = x⊤ t θ∗ 2 } {0.50, 54.37, NA} 11.39 to obtain the accurate estimate of θ∗, we need to trim all historical payoffs for each dimension individually. Besides, the truncating operations depend on the historical information of arms. By contrast, in CRT, the historical payoffs are trimmed once, which is controlled only by the number of rounds for playing bandits. Compared to CRT, our TOFU achieves a tighter confidence interval, which can be found from the setting of βt. Now we have the following theorem for the regret upper bound of TOFU. Theorem 3 (Regret Analysis for the TOFU Algorithm). Assume that for all t and xt ∈Dt with ∥xt∥2 ≤D, ∥θ∗∥2 ≤S, |x⊤ t θ∗| ≤L and E[|yt|1+ϵ|Ft−1] ≤b. Then, with probability at least 1 −δ, for every T ≥1, the regret of the TOFU algorithm satisfies R(TOFU, T ) ≤2T 1 1+ϵ " 4 √ db 1 1+ϵ , log ,2dT δ -ϵ 1+ϵ + λ 1 2 S + L $ . 2d log , 1 + T D2 λd . Similarly to the proof in Theorem 2, we can achieve the above results for TOFU. Due to space limitation, we show the detailed proof of Theorem 3 in Appendix C. Remark 3. For TOFU, we adopt the assumption of heavy-tailed payoffs on raw moments. It is worth pointing out that, when ϵ = 1, we have regret upper bound for TOFU as !O(d √ T), which implies that we recover the same order of d as that under sub-Gaussian assumption (Abbasi-Yadkori et al., 2011). A weakness in TOFU is high time complexity, because for each round TOFU needs to truncate all historical payoffs. The time complexity might be reasonably reduced by dividing T into multiple epochs, each of which contains only one truncation. 7 5 Experiments In this section, we conduct experiments based on synthetic datasets to evaluate the performance of our proposed bandit algorithms: MENU and TOFU. For comparisons, we adopt two baselines: MoM and CRT proposed by Medina and Yang (2016). We run multiple independent repetitions for each dataset in a personal computer under Windows 7 with Intel CPU@3.70GHz and 16GB memory. 5.1 Datasets and Setting To show effectiveness of bandit algorithms, we will demonstrate cumulative payoffs with respect to number of rounds for playing bandits over a fixed finite-arm decision set. For verifications, we adopt four synthetic datasets (named as S1–S4) in the experiments, of which statistics are shown in Table 1. The experiments on heavy tails require ϵ, b or ϵ, c to be known, which corresponds to the assumptions of Theorem 2 or Theorem 3. According to the required information, we can apply MENU or TOFU into practical applications. We adopt Student’s t and Pareto distributions because they are common in practice. For Student’s t-distributions, we easily estimate c, while for Pareto distributions, we easily estimate b. Besides, we can choose different parameters (e.g., larger values) in the distributions, and recalculate the parameters of b and c. For S1 and S2, which contain different numbers of arms and different dimensions for the contextual information, we adopt standard Student’s t-distribution to generate heavy-tailed noises. For the chosen arm xt ∈Dt, the expected payoff is x⊤ t θ∗, and the observed payoff is added a noise generated from a standard Student’s t-distribution. We generate each dimension of contextual information for an arm, as well as the underlying parameter, from a uniform distribution over [0, 1]. The standard Student’s t-distribution implies that the bound for the second central moment of S1 and S2 is 3. For S3 and S4, we adopt Pareto distribution, where the shape parameter is set as α = 2. We know x⊤ t θ∗= αsm/(α −1) implying sm = x⊤ t θ∗/2. Then, we set ϵ = 0.5 leading to the bound of raw moment as E % |yt|1.5& = αs1.5 m /(α −1.5) = 4s1.5 m . We take the maximum of 4s1.5 m among all arms as the bound of the 1.5-th raw moment. We generate arms and the parameter similar to S1 and S2. In figures, we show the average of cumulative payoffs with time evolution over ten independent repetitions for each dataset, and show error bars of a standard variance for comparing the robustness of algorithms. For S1 and S2, we run MENU and MoM and set T = 2 × 104. For S3 and S4, we run TOFU and CRT and set T = 1 × 104. For all algorithms, we set λ = 1.0, and δ = 0.1. 5.2 Results and Discussions We show experimental results in Figure 2. From the figure, we clearly find that our proposed two algorithms outperform MoM and CRT, which is consistent with the theoretical results in Theorems 2 and 3. We also evaluate our algorithms with other synthetic datasets, as well as different λ and δ, and observe similar superiority of MENU and TOFU. Finally, for further comparison on regret, complexity and storage of four algorithms, we list the results shown in Table 2. Table 2: Comparison on regret, complexity and storage of four algorithms. algorithm MoM MENU CRT TOFU regret !O(T 1+2ϵ 1+3ϵ ) !O(T 1 1+ϵ ) !O(T 1 2 + 1 2(1+ϵ) ) !O(T 1 1+ϵ ) complexity O(T ) O(T log T ) O(T ) O(T 2) storage O(1) O(log T ) O(1) O(T ) 6 Conclusion We have studied the problem of LinBET, where stochastic payoffs are characterized by finite (1 + ϵ)-th moments with ϵ ∈(0, 1]. We broke the traditional assumption of sub-Gaussian noises in payoffs of bandits, and derived theoretical guarantees based on the prior information of bounds on finite moments. We rigorously analyzed the lower bound of LinBET, and developed two novel 8 (a) S1 (b) S2 (c) S3 (d) S4 Figure 2: Comparison of cumulative payoffs for synthetic datasets S1-S4 with four algorithms. bandit algorithms with regret upper bounds matching the lower bound up to polylogarithmic factors. Two novel algorithms were developed based on median of means and truncation. In the sense of polynomial dependence on T , we provided optimal algorithms for the problem of LinBET, and thus solved an open problem, which has been pointed out by Medina and Yang (2016). Finally, our proposed algorithms have been evaluated based on synthetic datasets, and outperformed the state-ofthe-art results. Since both algorithms in this paper require a priori knowledge of ϵ, future directions in this line of research include automatic learning of LinBET without information of distributional moments, and evaluation of our proposed algorithms in real-world scenarios. Acknowledgments The work described in this paper was partially supported by the Research Grants Council of the Hong Kong Special Administrative Region, China (No. CUHK 14208815 and No. CUHK 14210717 of the General Research Fund), and Microsoft Research Asia (2018 Microsoft Research Asia Collaborative Research Award). References Y. Abbasi-Yadkori, D. Pál, and C. Szepesvári. Improved algorithms for linear stochastic bandits. In Advances in Neural Information Processing Systems, pages 2312–2320, 2011. R. Agrawal. Sample mean based index policies by O(log n) regret for the multi-armed bandit problem. Advances in Applied Probability, 27(4):1054–1078, 1995. S. Agrawal and N. Goyal. Analysis of Thompson sampling for the multi-armed bandit problem. In Conference on Learning Theory, pages 39–1, 2012. J.-Y. Audibert, O. Catoni, et al. Robust linear least squares regression. The Annals of Statistics, 39 (5):2766–2794, 2011. P. Auer. Using confidence bounds for exploitation-explorationtrade-offs. Journal of Machine Learning Research, 3(Nov):397–422, 2002. 9 S. Bubeck. Bandits games and clustering foundations. PhD thesis, Université des Sciences et Technologie de Lille-Lille I, 2010. S. Bubeck, N. 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. S. Bubeck, N. Cesa-Bianchi, and G. Lugosi. Bandits with heavy tail. IEEE Transactions on Information Theory, 59(11):7711–7717, 2013. A. Carpentier and M. Valko. Extreme bandits. In Advances in Neural Information Processing Systems, pages 1089–1097, 2014. O. Chapelle and L. Li. An empirical evaluation of Thompson sampling. In Advances in Neural Information Processing Systems, pages 2249–2257, 2011. W. Chu, L. Li, L. Reyzin, and R. Schapire. Contextual bandits with linear payoff functions. In Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, pages 208–214, 2011. R. Cont and J.-P. Bouchaud. Herd behavior and aggregate fluctuations in financial markets. Macroeconomic Dynamics, 4(2):170–196, 2000. V. Dani, T. P. Hayes, and S. M. Kakade. Stochastic linear optimization under bandit feedback. In Conference on Learning Theory, pages 355–366, 2008a. V. Dani, S. M. Kakade, and T. P. Hayes. The price of bandit information for online optimization. In Advances in Neural Information Processing Systems, pages 345–352, 2008b. J. Gittins, K. Glazebrook, and R. Weber. Multi-armed bandit allocation indices. John Wiley & Sons, 2011. D. Hsu and S. Sabato. Heavy-tailed regression with a generalized median-of-means. In International Conference on Machine Learning, pages 37–45, 2014. D. Hsu and S. Sabato. Loss minimization and parameter estimation with heavy tails. The Journal of Machine Learning Research, 17(1):543–582, 2016. T. L. Lai and H. Robbins. Asymptotically efficient adaptive allocation rules. Advances in Applied Mathematics, 6(1):4–22, 1985. T. Lattimore. A scale free algorithm for stochastic bandits with bounded kurtosis. In Advances in Neural Information Processing Systems, pages 1583–1592, 2017. T. Lattimore, K. Crammer, and C. Szepesvári. Optimal resource allocation with semi-bandit feedback. In Proceedings of the Thirtieth Conference on Uncertainty in Artificial Intelligence, pages 477–486. AUAI Press, 2014. L. Li, W. Chu, J. Langford, and R. E. Schapire. A contextual-bandit approach to personalized news article recommendation. In Proceedings of the Nineteenth International Conference on World Wide Web, pages 661–670. ACM, 2010. J. Liebeherr, A. Burchard, and F. Ciucu. Delay bounds in communication networks with heavy-tailed and self-similar traffic. IEEE Transactions on Information Theory, 58(2):1010–1024, 2012. A. M. Medina and S. Yang. No-regret algorithms for heavy-tailed linear bandits. In International Conference on Machine Learning, pages 1642–1650, 2016. R. Munos et al. From bandits to monte-carlo tree search: The optimistic principle applied to optimization and planning. Foundations and Trends R⃝in Machine Learning, 7(1):1–129, 2014. H. Robbins et al. Some aspects of the sequential design of experiments. Bulletin of the American Mathematical Society, 58(5):527–535, 1952. J. A. Roberts, T. W. Boonstra, and M. Breakspear. The heavy tail of the human brain. Current Opinion in Neurobiology, 31:164–172, 2015. Y. Seldin, F. Laviolette, N. Cesa-Bianchi, J. Shawe-Taylor, and P. Auer. PAC-Bayesian inequalities for martingales. IEEE Transactions on Information Theory, 58(12):7086–7093, 2012. M. Shao and C. L. Nikias. Signal processing with fractional lower order moments: stable processes and their applications. Proceedings of the IEEE, 81(7):986–1010, 1993. W. R. Thompson. On the likelihood that one unknown probability exceeds another in view of the evidence of two samples. Biometrika, 25(3/4):285–294, 1933. S. Vakili, K. Liu, and Q. Zhao. Deterministic sequencing of exploration and exploitation for multiarmed bandit problems. IEEE Journal of Selected Topics in Signal Processing, 7(5):759–767, 2013. X. Yu, H. Shao, M. R. Lyu, and I. King. Pure exploration of multi-armed bandits with heavy-tailed payoffs. In Proceedings of the Thirty-Fourth Conference on Uncertainty in Artificial Intelligence, pages 937–946. AUAI Press, 2018. 10
2018
106
7,260
Learning towards Minimum Hyperspherical Energy Weiyang Liu1,*, Rongmei Lin2,*, Zhen Liu1,*, Lixin Liu3, Zhiding Yu4, Bo Dai1,5, Le Song1,6 1Georgia Institute of Technology 2Emory University 3South China University of Technology 4NVIDIA 5Google Brain 6Ant Financial Abstract Neural networks are a powerful class of nonlinear functions that can be trained end-to-end on various applications. While the over-parametrization nature in many neural networks renders the ability to fit complex functions and the strong representation power to handle challenging tasks, it also leads to highly correlated neurons that can hurt the generalization ability and incur unnecessary computation cost. As a result, how to regularize the network to avoid undesired representation redundancy becomes an important issue. To this end, we draw inspiration from a well-known problem in physics – Thomson problem, where one seeks to find a state that distributes N electrons on a unit sphere as evenly as possible with minimum potential energy. In light of this intuition, we reduce the redundancy regularization problem to generic energy minimization, and propose a minimum hyperspherical energy (MHE) objective as generic regularization for neural networks. We also propose a few novel variants of MHE, and provide some insights from a theoretical point of view. Finally, we apply neural networks with MHE regularization to several challenging tasks. Extensive experiments demonstrate the effectiveness of our intuition, by showing the superior performance with MHE regularization. 1 Introduction The recent success of deep neural networks has led to its wide applications in a variety of tasks. With the over-parametrization nature and deep layered architecture, current deep networks [14, 46, 42] are able to achieve impressive performance on large-scale problems. Despite such success, having redundant and highly correlated neurons (e.g., weights of kernels/filters in convolutional neural networks (CNNs)) caused by over-parametrization presents an issue [37, 41], which motivated a series of influential works in network compression [10, 1] and parameter-efficient network architectures [16, 19, 62]. These works either compress the network by pruning redundant neurons or directly modify the network architecture, aiming to achieve comparable performance while using fewer parameters. Yet, it remains an open problem to find a unified and principled theory that guides the network compression in the context of optimal generalization ability. Another stream of works seeks to further release the network generalization power by alleviating redundancy through diversification [57, 56, 5, 36] as rigorously analyzed by [59]. Most of these works address the redundancy problem by enforcing relatively large diversity between pairwise projection bases via regularization. Our work broadly falls into this category by sharing similar high-level target, but the spirit and motivation behind our proposed models are distinct. In particular, there is a recent trend of studies that feature the significance of angular learning at both loss and convolution levels [29, 28, 30, 27], based on the observation that the angles in deep embeddings learned by CNNs tend to encode semantic difference. The key intuition is that angles preserve the most abundant and discriminative information for visual recognition. As a result, hyperspherical geodesic distances between neurons naturally play a key role in this context, and thus, it is intuitively desired to impose discrimination by keeping their projections on the hypersphere as far away from * indicates equal contributions. Correspondence to: Weiyang Liu <wyliu@gatech.edu>. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. each other as possible. While the concept of imposing large angular diversities was also considered in [59, 57, 56, 36], they do not consider diversity in terms of global equidistribution of embeddings on the hypersphere, which fails to achieve the state-of-the-art performances. Given the above motivation, we draw inspiration from a well-known physics problem, called Thomson problem [48, 43]. The goal of Thomson problem is to determine the minimum electrostatic potential energy configuration of N mutually-repelling electrons on the surface of a unit sphere. We identify the intrinsic resemblance between the Thomson problem and our target, in the sense that diversifying neurons can be seen as searching for an optimal configuration of electron locations. Similarly, we characterize the diversity for a group of neurons by defining a generic hyperspherical potential energy using their pairwise relationship. Higher energy implies higher redundancy, while lower energy indicates that these neurons are more diverse and more uniformly spaced. To reduce the redundancy of neurons and improve the neural networks, we propose a novel minimum hyperspherical energy (MHE) regularization framework, where the diversity of neurons is promoted by minimizing the hyperspherical energy in each layer. As verified by comprehensive experiments on multiple tasks, MHE is able to consistently improve the generalization power of neural networks. Orthonormal MHE Half-space MHE Figure 1: Orthonormal, MHE and half-space MHE regularization. The red dots denote the neurons optimized by the gradient of the corresponding regularization. The rightmost pink dots denote the virtual negative neurons. We randomly initialize the weights of 10 neurons on a 3D Sphere and optimize them with SGD. MHE faces different situations when it is applied to hidden layers and output layers. For hidden layers, applying MHE straightforwardly may still encourage some degree of redundancy since it will produce co-linear bases pointing to opposite directions (see Fig. 1 middle). In order to avoid such redundancy, we propose the half-space MHE which constructs a group of virtual neurons and minimize the hyperspherical energy of both existing and virtual neurons. For output layers, MHE aims to distribute the classifier neurons1 as uniformly as possible to improve the inter-class feature separability. Different from MHE in hidden layers, classifier neurons should be distributed in the full space for the best classification performance [29, 28]. An intuitive comparison among the widely used orthonormal regularization, the proposed MHE and half-space MHE is provided in Fig. 1. One can observe that both MHE and half-space MHE are able to uniformly distribute the neurons over the hypersphere and half-space hypershpere, respectively. In contrast, conventional orthonormal regularization tends to group neurons closer, especially when the number of neurons is greater than the dimension. MHE is originally defined on Euclidean distance, as indicated in Thomson problem. However, we further consider minimizing hyperspherical energy defined with respect to angular distance, which we will refer to as angular-MHE (A-MHE) in the following paper. In addition, we give some theoretical insights of MHE regularization, by discussing the asymptotic behavior and generalization error. Last, we apply MHE regularization to multiple vision tasks, including generic object recognition, class-imbalance learning, and face recognition. In the experiments, we show that MHE is architectureagnostic and can considerably improve the generalization ability. 2 Related Works Diversity regularization is shown useful in sparse coding [32, 35], ensemble learning [26, 24], selfpaced learning [21], metric learning [58], etc. Early studies in sparse coding [32, 35] show that the generalization ability of codebook can be improved via diversity regularization, where the diversity is often modeled using the (empirical) covariance matrix. More recently, a series of studies have featured diversity regularization in neural networks [59, 57, 56, 5, 36, 55], where regularization is mostly achieved via promoting large angle/orthogonality, or reducing covariance between bases. Our work differs from these studies by formulating the diversity of neurons on the entire hypersphere, therefore promoting diversity from a more global, top-down perspective. Methods other than diversity-promoting regularization have been widely proposed to improve CNNs [44, 20, 33, 30] and generative adversarial nets (GANs) [4, 34]. MHE can be regarded as a complement that can be applied on top of these methods. 1Classifier neurons are the projection bases of the last layer (i.e., output layer) before input to softmax. 2 3 Learning Neurons towards Minimum Hyperspherical Energy 3.1 Formulation of Minimum Hyperspherical Energy Minimum hyperspherical energy defines an equilibrium state of the configuration of neuron’s directions. We argue that the power of neural representation of each layer can be characterized by the hyperspherical energy of its neurons, and therefore a minimal energy configuration of neurons can induce better generalization. Before delving into details, we first define the hyperspherical energy functional for N neurons (i.e., kernels) with (d+1)-dimension WN ={w1, · · · , wN ∈Rd+1} as Es,d( ˆwi|N i=1) = N X i=1 N X j=1,j̸=i fs ∥ˆwi −ˆwj∥  = ( P i̸=j ∥ˆwi −ˆwj∥−s , s > 0 P i̸=j log ∥ˆwi −ˆwj∥−1  , s = 0 , (1) where ∥·∥denotes Euclidean distance, fs(·) is a decreasing real-valued function, and ˆwi = wi ∥wi∥ is the i-th neuron weight projected onto the unit hypersphere Sd ={w∈Rd+1| ∥w∥=1}. We also denote ˆ WN ={ ˆw1, · · · , ˆwN ∈Sd}, and Es =Es,d( ˆwi|N i=1) for short. There are plenty of choices for fs(·), but in this paper we use fs(z) = z−s, s > 0, known as Riesz s-kernels. Particularly, as s →0, z−s →s log(z−1)+1, which is an affine transformation of log(z−1). It follows that optimizing the logarithmic hyperspherical energy E0 =P i̸=j log(∥ˆwi −ˆwj∥−1) is essentially the limiting case of optimizing the hyperspherical energy Es. We therefore define f0(z)=log(z−1) for convenience. The goal of the MHE criterion is to minimize the energy in Eq. (1) by varying the orientations of the neuron weights w1, · · · , wN. To be precise, we solve an optimization problem: minWN Es with s ≥0. In particular, when s=0, we solve the logarithmic energy minimization problem: arg min WN E0 = arg min WN exp(E0) = arg max WN Y i̸=j ∥ˆwi −ˆwj∥, (2) in which we essentially maximize the product of Euclidean distances. E0, E1 and E2 have interesting yet profound connections. Note that Thomson problem corresponds to minimizing E1, which is a NP-hard problem. Therefore in practice we can only compute its approximate solution by heuristics. In neural networks, such a differentiable objective can be directly optimized via gradient descent. 3.2 Logarithmic Hyperspherical Energy E0 as a Relaxation Optimizing the original energy in Eq. (1) is equivalent to optimizing its logarithmic form log Es. To efficiently solve this difficult optimization problem, we can instead optimize the lower bound of log Es as a surrogate energy, by applying Jensen’s inequality: arg min WN  Elog := N X i=1 N X j=1,j̸=i log  fs ∥ˆwi −ˆwj∥  (3) With fs(z)=z−s, s>0, we observe that Elog becomes sE0 =s P i̸=j log(∥ˆwi −ˆwj∥−1), which is identical to the logarithmic hyperspherical energy E0 up to a multiplicative factor s. Therefore, minimizing E0 can also be viewed as a relaxation of minimizing Es for s>0. 3.3 MHE as Regularization for Neural Networks Now that we have introduced the formulation of MHE, we propose MHE regularization for neural networks. In supervised neural network learning, the entire objective function is shown as follows: L = 1 m m X j=1 ℓ(⟨wout i , xj⟩c i=1, yj) | {z } training data fitting + λh · L−1 X j=1 1 Nj(Nj −1){Es}j | {z } Th: hyperspherical energy for hidden layers + λo · 1 NL(NL −1)Es( ˆwout i |c i=1) | {z } To: hyperspherical energy for output layer (4) where xi is the feature of the i-th training sample entering the output layer, wout i is the classifier neuron for the i-th class in the output fully-connected layer and ˆwout i denotes its normalized version. {Es}i denotes the hyperspherical energy for the neurons in the i-th layer. c is the number of classes, m is the batch size, L is the number of layers of the neural network, and Ni is the number of neurons in the i-th layer. Es( ˆwout i |c i=1) denotes the hyperspherical energy of neurons { ˆwout 1 , · · · , ˆwout c }. The ℓ2 weight decay is omitted here for simplicity, but we will use it in practice. An alternative interpretation of MHE regularization from a decoupled view is given in Section 3.7 and Appendix C. MHE has different effects and interpretations in regularizing hidden layers and output layers. MHE for hidden layers. To make neurons in the hidden layers more discriminative and less redundant, we propose to use MHE as a form of regularization. MHE encourages the normalized neurons to 3 be uniformly distributed on a unit hypersphere, which is partially inspired by the observation in [30] that angular difference in neurons preserves semantic (label-related) information. To some extent, MHE maximizes the average angular difference between neurons (specifically, the hyperspherical energy of neurons in every hidden layer). For instance, in CNNs we minimize the hyperpsherical energy of kernels in convolutional and fully-connected layers except the output layer. MHE for output layers. For the output layer, we propose to enhance the inter-class feature separability with MHE to learn discriminative and well-separated features. For classification tasks, MHE regularization is complementary to the softmax cross-entropy loss in CNNs. The softmax loss focuses more on the intra-class compactness, while MHE encourages the inter-class separability. Therefore, MHE on output layers can induce features with better generalization power. 3.4 MHE in Half Space Original MHE Half-space MHE w1 w2 w1 w2 -w1 -w2 ^ ^ ^ ^ ^ ^ Figure 2: Half-space MHE. Directly applying the MHE formulation may still encouter some redundancy. An example in Fig. 2, with two neurons in a 2dimensional space, illustrates this potential issue. Directly imposing the original MHE regularization leads to a solution that two neurons are colinear but with opposite directions. To avoid such redundancy, we propose the half-space MHE regularization which constructs some virtual neurons and minimizes the hyperspherical energy of both original and virtual neurons together. Specifically, half-space MHE constructs a colinear virtual neuron with opposite direction for every existing neuron. Therefore, we end up with minimizing the hyperspherical energy with 2Ni neurons in the i-th layer (i.e., minimizing Es({ ˆwk, −ˆwk}|2Ni k=1)). This half-space variant will encourage the neurons to be less correlated and less redundant, as illustrated in Fig. 2. Note that, half-space MHE can only be used in hidden layers, because the colinear neurons do not constitute redundancy in output layers, as shown in [29]. Nevertheless, colinearity is usually not likely to happen in high-dimensional spaces, especially when the neurons are optimized to fit training data. This may be the reason that the original MHE regularization still consistently improves the baselines. 3.5 MHE beyond Euclidean Distance The hyperspherical energy is originally defined based on the Euclidean distance on a hypersphere, which can be viewed as an angular measure. In addition to Euclidean distance, we further consider the geodesic distance on a unit hypersphere as a distance measure for neurons, which is exactly the same as the angle between neurons. Specifically, we consider to use arccos( ˆw⊤ i ˆwj) to replace ∥ˆwi −ˆwj∥in hyperspherical energies. Following this idea, we propose angular MHE (A-MHE) as a simple extension, where the hyperspherical energy is rewritten as: Ea s,d( ˆwi|N i=1) = N X i=1 N X j=1,j̸=i fs arccos( ˆw⊤ i ˆwj)  =  P i̸=j arccos( ˆw⊤ i ˆwj)−s, s > 0 P i̸=j log arccos( ˆw⊤ i ˆwj)−1 , s = 0 (5) which can be viewed as redefining MHE based on geodesic distance on hyperspheres (i.e., angle), and can be used as an alternative to the original hyperspherical energy Es in Eq. (4). Note that, A-MHE can also be learned in full-space or half-space, leading to similar variants as original MHE. The key difference between MHE and A-MHE lies in the optimization dynamics, because their gradients w.r.t the neuron weights are quite different. A-MHE is also more computationally expensive than MHE. 3.6 Mini-batch Approximation for MHE With a large number of neurons in one layer, calculating MHE can be computationally expensive as it requires computing the pair-wise distances between neurons. To address this issue, we propose the mini-batch version of MHE to approximate the MHE (either original or half-space) objective. Mini-batch approximation for MHE on hidden layers. For hidden layers, mini-batch approximation iteratively takes a random batch of neurons as input and minimizes their hyperspherical energy as an approximation to the MHE. Note that the gradient of the mini-batch objective is an unbiased estimation of the original gradient of MHE. Data-dependent mini-batch approximation for output layers. For the output layer, the datadependent mini-batch approximation iteratively takes the classifier neurons corresponding to the classes that exist in mini-batches. It minimizes 1 m(N−1) Pm i=1 PN j=1,j̸=yi fs(∥ˆwyi −ˆwj∥) in each iteration, where yi denotes the class label of the i-th sample in each mini-batch, m is the mini-batch size, and N is the number of neurons (in one particular layer). 4 3.7 Discussions Connections to scientific problems. The hyperspherical energy minimization has close relationships with scientific problems. When s=1, Eq. (1) reduces to Thomson problem [48, 43] (in physics) where one needs to determine the minimum electrostatic potential energy configuration of N mutuallyrepelling electrons on a unit sphere. When s=∞, Eq. (1) becomes Tammes problem [47] (in geometry) where the goal is to pack a given number of circles on the surface of a sphere such that the minimum distance between circles is maximized. When s=0, Eq. (1) becomes Whyte’s problem where the goal is to maximize product of Euclidean distances as shown in Eq. (2). Our work aims to make use of important insights from these scientific problems to improve neural networks. Understanding MHE from decoupled view. Inspired by decoupled networks [27], we can view the original convolution as the multiplication of the angular function g(θ)=cos(θ) and the magnitude function h(∥w∥, ∥x∥)=∥w∥·∥x∥: f(w, x)=h(∥w∥, ∥x∥)·g(θ) where θ is the angle between the kernel w and the input x. From the equation above, we can see that the norm of the kernel and the direction (i.e., angle) of the kernel affect the inner product similarity differently. Typically, weight decay is to regularize the kernel by minimizing its ℓ2 norm, while there is no regularization on the direction of the kernel. Therefore, MHE completes this missing piece by promoting angular diversity. By combining MHE to a standard neural networks, the entire regularization term becomes Lreg = λw · 1 PL j=1 Nj L X j=1 Nj X i=1 ∥wi∥ | {z } Weight decay: regularizing the magnitude of kernels + λh · L−1 X j=1 1 Nj(Nj −1){Es}j + λo · 1 NL(NL −1)Es( ˆwout i |c i=1) | {z } MHE: regularizing the direction of kernels where λw, λh and λo are weighting hyperparameters for these three regularization terms. From the decoupled view, MHE makes a lot of senses in regularizing the neural networks, since it serves as a complementary and orthogonal role to weight decay. More discussions are in Appendix C. Comparison to orthogonality/angle-promoting regularizations. Promoting orthogonality or large angles between bases has been a popular choice for encouraging diversity. Probably the most related and widely used one is the orthonormal regularization [30] which aims to minimize ∥W ⊤W −I∥F , where W denotes the weights of a group of neurons with each column being one neuron and I is an identity matrix. One similar regularization is the orthogonality regularization [36] which minimizes the sum of the cosine values between all the kernel weights. These methods encourage kernels to be orthogonal to each other, while MHE does not. Instead, MHE encourages the hyperspherical diversity among these kernels, and these kernels are not necessarily orthogonal to each other. [56] proposes the angular constraint which aims to constrain the angles between different kernels of the neural network, but quite different from MHE, they use a hard constraint to impose this angular regularization. Moreover, these methods model diversity regularization at a more local level, while MHE regularization seeks to model the problem in a more top-down manner. Normalized neurons in MHE. From Eq. 1, one can see that the normalized neurons are used to compute MHE, because we aim to encourage the diversity on a hypersphere. However, a natural question may arise: what if we use the original (i.e., unnormalized) neurons to compute MHE? First, combining the norm of kernels (i.e., neurons) into MHE may lead to a trivial gradient descent direction: simply increasing the norm of all kernels. Suppose all kernel directions stay unchanged, increasing the norm of all kernels by a factor can effectively decrease the objective value of MHE. Second, coupling the norm of kernels into MHE may contradict with weight decay which aims to decrease the norm of kernels. Moreover, normalized neurons imply that the importance of all neurons is the same, which matches the intuition in [28, 30, 27]. If we desire different importance for different neurons, we can also manually assign a fixed weight for each neuron. This may be useful when we have already known certain neurons are more important and we want them to be relatively fixed. The neuron with large weight tends to be updated less. We will discuss it more in Appendix D. 4 Theoretical Insights This section leverages a number of rigorous theoretical results from [38, 23, 12, 25, 11, 23, 8, 54] and provides theoretical yet intuitive understandings about MHE. 4.1 Asymptotic Behavior This subsection shows how the hyperspherical energy behaves asymptotically. Specifically, as N →∞, we can show that the solution ˆ WN tends to be uniformly distributed on hypersphere Sd when the hyperspherical energy defined in Eq. (1) achieves its minimum. 5 Definition 1 (minimal hyperspherical s-energy). We define the minimal s-energy for N points on the unit hypersphere Sd ={w∈Rd+1| ∥w∥=1} as εs,d(N) := inf ˆ WN ⊂Sd Es,d( ˆwi|N i=1) (6) where the infimum is taken over all possible ˆ WN on Sd. Any configuration of ˆ WN to attain the infimum is called an s-extremal configuration. Usually εs,d(N)=∞if N is greater than d and εs,d(N)=0 if N =0, 1. We discuss the asymptotic behavior (N →∞) in three cases: 0<s<d, s=d, and s>d. We first write the energy integral as Is(µ)= RR Sd×Sd ∥u−v∥−sdµ(u)dµ(v), which is taken over all probability measure µ supported on Sd. With 0<s<d, Is(µ) is minimal when µ is the spherical measure σd =Hd(·)|Sd/Hd(Sd) on Sd, where Hd(·) denotes the d-dimensional Hausdorff measure. When s≥d, Is(µ) becomes infinity, which therefore requires different analysis. In general, we can say all s-extremal configurations asymptotically converge to uniform distribution on a hypersphere, as stated in Theorem 1. This asymptotic behavior has been heavily studied in [38, 23, 12]. Theorem 1 (asymptotic uniform distribution on hypersphere). Any sequence of optimal s-energy configurations ( ˆ W ⋆ N)|∞ 2 ⊂Sd is asymptotically uniformly distributed on Sd in the sense of the weakstar topology of measures, namely 1 N X v∈ˆ W ⋆ N δv →σd, as N →∞ (7) where δv denotes the unit point mass at v, and σd is the spherical measure on Sd. Theorem 2 (asymptotics of the minimal hyperspherical s-energy). We have that limN→∞ εs,d(N) p(N) exists for the minimal s-energy. For 0<s<d, p(N)=N 2. For s=d, p(N)=N 2 log N. For s>d, p(N)=N 1+s/d. Particularly if 0<s<d, we have limN→∞ εs,d(N) N 2 =Is(σd). Theorem 2 tells us the growth power of the minimal hyperspherical s-energy when N goes to infinity. Therefore, different potential power s leads to different optimization dynamics. In the light of the behavior of the energy integral, MHE regularization will focus more on local influence from neighborhood neurons instead of global influences from all the neurons as the power s increases. 4.2 Generalization and Optimality As proved in [54], in one-hidden-layer neural network, the diversity of neurons can effectively eliminate the spurious local minima despite the non-convexity in learning dynamics of neural networks. Following such an argument, our MHE regularization, which encourages the diversity of neurons, naturally matches the theoretical intuition in [54], and effectively promotes the generalization of neural networks. While hyperspherical energy is minimized such that neurons become diverse on hyperspheres, the hyperspherical diversity is closely related to the generalization error. More specifically, in a one-hidden-layer neural network f(x)=Pn k=1 vkσ(W ⊤ k x) with least squares loss L(f)= 1 2m Pm i=1(yi −f(xi))2, we can compute its gradient w.r.t Wk as ∂L ∂Wk = 1 m Pm i=1(f(xi)−yi)vkσ′(W ⊤ k xi)xi. (σ(·) is the nonlinear activation function and σ′(·) is its subgradient. x∈is the training sample. Wk denotes the weights of hidden layer and vk is the weights of output layer.) Subsequently, we can rewrite this gradient as a matrix form: ∂L ∂W =D·r where D∈Rdn×m, D{di−d+1:di,j} =viσ′(W ⊤ i xj)xj ∈Rd and r∈Rm, ri = 1 mf(xi)−yi. Further, we can obtain the inequality ∥r∥≤ 1 λmin(D)∥∂L ∂W ∥. ∥r∥is actually the training error. To make the training error small, we need to lower bound λmin(D) away from zero. From [54, 3], one can know that the lower bound of λmin(D) is directly related to the hyperspherical diversity of neurons. After bounding the training error, it is easy to bound the generalization error using Rademachar complexity. 5 Applications and Experiments 5.1 Improving Network Generalization First, we perform ablation study and some exploratory experiments on MHE. Then we apply MHE to large-scale object recognition and class-imbalance learning. For all the experiments on CIFAR-10 and CIFAR-100 in the paper, we use moderate data augmentation, following [14, 27]. For ImageNet-2012, we follow the same data augmentation in [30]. We train all the networks using SGD with momentum 0.9, and the network initialization follows [13]. All the networks use BN [20] and ReLU if not otherwise specified. Experimental details are given in each subsection and Appendix A. 6 5.1.1 Ablation Study and Exploratory Experiments Method CIFAR-10 CIFAR-100 s=2 s=1 s=0 s=2 s=1 s=0 MHE 6.22 6.74 6.44 27.15 27.09 26.16 Half-space MHE 6.28 6.54 6.30 25.61 26.30 26.18 A-MHE 6.21 6.77 6.45 26.17 27.31 27.90 Half-space A-MHE 6.52 6.49 6.44 26.03 26.52 26.47 Baseline 7.75 28.13 Table 1: Testing error (%) of different MHE on CIFAR-10/100. Variants of MHE. We evaluate all different variants of MHE on CIFAR-10 and CIFAR-100, including original MHE (with the power s=0, 1, 2) and half-space MHE (with the power s=0, 1, 2) with both Euclidean and angular distance. In this experiment, all methods use CNN-9 (see Appendix A). The results in Table 1 show that all the variants of MHE perform consistently better than the baseline. Specifically, the half-space MHE has more significant performance gain compared to the other MHE variants, and MHE with Euclidean and angular distance perform similarly. In general, MHE with s=2 performs best among s=0, 1, 2. In the following experiments, we use s=2 and Euclidean distance for both MHE and half-space MHE by default if not otherwise specified. Method 16/32/64 32/64/128 64/128/256 128/256/512 256/512/1024 Baseline 47.72 38.64 28.13 24.95 25.45 MHE 36.84 30.05 26.75 24.05 23.14 Half-space MHE 35.16 29.33 25.96 23.38 21.83 Table 2: Testing error (%) of different width on CIFAR-100. Network width. We evaluate MHE with different network width. We use CNN-9 as our base network, and change its filter number in Conv1.x, Conv2.x and Conv3.x (see Appendix A) to 16/32/64, 32/64/128, 64/128/256, 128/256/512 and 256/512/1024. Results in Table 2 show that both MHE and half-space MHE consistently outperform the baseline, showing stronger generalization. Interestingly, both MHE and half-space MHE have more significant gain while the filter number is smaller in each layer, indicating that MHE can help the network to make better use of the neurons. In general, half-space MHE performs consistently better than MHE, showing the necessity of reducing colinearity redundancy among neurons. Both MHE and half-space MHE outperform the baseline with a huge margin while the network is either very wide or very narrow, showing the superiority in improving generalization. Method CNN-6 CNN-9 CNN-15 Baseline 32.08 28.13 N/C MHE 28.16 26.75 26.9 Half-space MHE 27.56 25.96 25.84 Table 3: Testing error (%) of different depth on CIFAR-100. N/C: not converged. Network depth. We perform experiments with different network depth to better evaluate the performance of MHE. We fix the filter number in Conv1.x, Conv2.x and Conv3.x to 64, 128 and 256, respectively. We compare 6-layer CNN, 9-layer CNN and 15-layer CNN. The results are given in Table 3. Both MHE and half-space MHE perform significantly better than the baseline. More interestingly, baseline CNN-15 can not converge, while CNN-15 is able to converge reasonably well if we use MHE to regularize the network. Moreover, we also see that half-space MHE can consistently show better generalization than MHE with different network depth. Method H O H O H O × √ √× √√ MHE 26.85 26.55 26.16 Half-space MHE N/A 26.28 25.61 A-MHE 27.8 26.56 26.17 Half-space A-MHE N/A 26.64 26.03 Baseline 28.13 Table 4: Ablation study on CIFAR-100. Ablation study. Since the current MHE regularizes the neurons in the hidden layers and the output layer simultaneously, we perform ablation study for MHE to further investigate where the gain comes from. This experiment uses the CNN-9. The results are given in Table 4. “H” means that we apply MHE to all the hidden layers, while “O” means that we apply MHE to the output layer. Because the half-space MHE can not be applied to the output layer, so there is “N/A” in the table. In general, we find that applying MHE to both the hidden layers and the output layer yields the best performance, and using MHE in the hidden layers usually produces better accuracy than using MHE in the output layer. 10-2 100 102 25 25.5 26 26.5 27 27.5 28 Baseline MHE (O) MHE (H) HS-MHE (H) 101 10-1 Value of Hyperparameter Testing Error on CIFAR-100 (%) Figure 3: Hyperparameter. Hyperparameter experiment. We evaluate how the selection of hyperparameter affects the performance. We experiment with different hyperparameters from 10−2 to 102 on CIFAR-100 with the CNN-9. HS-MHE denotes the half-space MHE. We evaluate MHE variants by separately applying MHE to the output layer (“O”), MHE to the hidden layers (“H”), and the half-space MHE to the hidden layers (“H”). The results in Fig. 3 show that our MHE is not very hyperparameter-sensitive and can consistently beat the baseline by a considerable margin. One can observe that MHE’s hyperparameter works well from 10−2 to 102 and therefore is easy to set. In contrast, the hyperparameter of weight decay could be more sensitive than MHE. Half-space MHE can consistently outperform the original MHE under all different hyperparameter settings. Interestingly, applying MHE only to hidden layers can achieve better accuracy than applying MHE only to output layers. 7 Method CIFAR-10 CIFAR-100 ResNet-110-original [14] 6.61 25.16 ResNet-1001 [15] 4.92 22.71 ResNet-1001 (64 batch) [15] 4.64 baseline 5.19 22.87 MHE 4.72 22.19 Half-space MHE 4.66 22.04 Table 5: Error (%) of ResNet-32. MHE for ResNets. Besides the standard CNN, we also evaluate MHE on ResNet-32 to show that our MHE is architecture-agnostic and can improve accuracy on multiple types of architectures. Besides ResNets, MHE can also be applied to GoogleNet [46], SphereNets [30] (the experimental results are given in Appendix E), DenseNet [17], etc. Detailed architecture settings are given in Appendix A. The results on CIFAR-10 and CIFAR-100 are given in Table 5. One can observe that applying MHE to ResNet also achieves considerable improvements, showing that MHE is generally useful for different architectures. Most importantly, adding MHE regularization will not affect the original architecture settings, and it can readily improve the network generalization at a neglectable computational cost. 5.1.2 Large-scale Object Recognition Method ResNet-18 ResNet-34 baseline 33.95 30.04 Orthogonal [36] 33.65 29.74 Orthnormal 33.61 29.75 MHE 33.50 29.60 Half-space MHE 33.45 29.50 Table 6: Top1 error (%) on ImageNet. We evaluate MHE on large-scale ImageNet-2012 datasets. Specifically, we perform experiment using ResNets, and then report the top-1 validation error (center crop) in Table 6. From the results, we still observe that both MHE and half-space MHE yield consistently better recognition accuracy than the baseline and the orthonormal regularization (after tuning its hyperparameter). To better evaluate the consistency of MHE’s performance gain, we use two ResNets with different depth: ResNet-18 and ResNet-34. On these two different networks, both MHE and half-space MHE outperform the baseline by a significant margin, showing consistently better generalization power. Moreover, half-space MHE performs slightly better than full-space MHE as expected. 5.1.3 Class-imbalance Learning (a) CNN without MHE (b) CNN with MHE Figure 4: Class-imbalance learning on MNIST. Because MHE aims to maximize the hyperspherical margin between different classifier neurons in the output layer, we can naturally apply MHE to class-imbalance learning where the number of training samples in different classes is imbalanced. We demonstrate the power of MHE in class-imbalance learning through a toy experiment. We first randomly throw away 98% training data for digit 0 in MNIST (only 100 samples are preserved for digit 0), and then train a 6-layer CNN on this imbalance MNIST. To visualize the learned features, we set the output feature dimension as 2. The features and classifier neurons on the full training set are visualized in Fig. 4 where each color denotes a digit and red arrows are the normalized classifier neurons. Although we train the network on the imbalanced training set, we visualize the features of the full training set for better demonstration. The visualization for the full testing set is also given in Appendix H. From Fig. 4, one can see that the CNN without MHE tends to ignore the imbalanced class (digit 0) and the learned classifier neuron is highly biased to another digit. In contrast, the CNN with MHE can learn reasonably separable distribution even if digit 0 only has 2% samples compared to the other classes. Using MHE in this toy setting can readily improve the accuracy on the full testing set from 88.5% to 98%. Most importantly, the classifier neuron for digit 0 is also properly learned, similar to the one learned on the balanced dataset. Note that, half-space MHE can not be applied to the classifier neurons, because the classifier neurons usually need to occupy the full feature space. Method Single Err. (S) Multiple Baseline 9.80 30.40 12.00 Orthonormal 8.34 26.80 10.80 MHE 7.98 25.80 10.25 Half-space MHE 7.90 26.40 9.59 A-MHE 7.96 26.00 9.88 Half-space A-MHE 7.59 25.90 9.89 Table 7: Error on imbalanced CIFAR-10. We experiment MHE in two data imbalance settings on CIFAR-10: 1) single class imbalance (S) - All classes have the same number of images but one single class has significantly less number, and 2) multiple class imbalance (M) The number of images decreases as the class index decreases from 9 to 0. We use CNN-9 for all the compared regularizations. Detailed setups are provided in Appendix A. In Table 7, we report the error rate on the whole testing set. In addition, we report the error rate (denoted by Err. (S)) on the imbalance class (single imbalance setting) in the full testing set. From the results, one can observe that CNN-9 with MHE is able to effectively perform recognition when classes are imbalanced. Even only given a small portion of training data in a few classes, CNN-9 with MHE can achieve very competitive accuracy on the full testing set, showing MHE’s superior generalization power. Moreover, we also provide experimental results on imbalanced CIFAR-100 in Appendix H. 8 5.2 SphereFace+: Improving Inter-class Feature Separability via MHE for Face Recognition We have shown that full-space MHE for output layers can encourage classifier neurons to distribute more evenly on hypersphere and therefore improve inter-class feature separability. Intuitively, the classifier neurons serve as the approximate center for features from each class, and can therefore guide the feature learning. We also observe that open-set face recognition (e.g., face verification) requires the feature centers to be as separable as possible [28]. This connection inspires us to apply MHE to face recognition. Specifically, we propose SphereFace+ by applying MHE to SphereFace [28]. The objective of SphereFace, angular softmax loss (ℓSF) that encourages intra-class feature compactness, is naturally complementary to that of MHE. The objective function of SphereFace+ is defined as LSF+ = 1 m m X j=1 ℓSF(⟨wout i , xj⟩c i=1, yj, mSF) | {z } Angular softmax loss: promoting intra-class compactness + λM · 1 m(N −1) m X i=1 N X j=1,j̸=yi fs( ˆwout yi −ˆwout j ) | {z } MHE: promoting inter-class separability (8) where c is the number of classes, m is the mini-batch size, N is the number of classifier neurons, xi the deep feature of the i-th face (yi is its groundtruth label), and wout i is the i-th classifier neuron. mSF is a hyperparameter for SphereFace, controlling the degree of intra-class feature compactness (i.e., the size of the angular margin). Because face datesets usually have thousands of identities, we will use the data-dependent mini-batch approximation MHE as shown in Eq. (8) in the output layer to reduce computational cost. MHE completes a missing piece for SphereFace by promoting the interclass separability. SphereFace+ consistently outperforms SphereFace, and achieves state-of-the-art performance on both LFW [18] and MegaFace [22] datasets. More results on MegaFace are put in Appendix I. MHE can also improve other face recognition methods, as shown in Appendix F. mSF LFW MegaFace SphereFace SphereFace+ SphereFace SphereFace+ 1 96.35 97.15 39.12 45.90 2 98.87 99.05 60.48 68.51 3 98.97 99.13 63.71 66.89 4 99.26 99.32 70.68 71.30 Table 8: Accuracy (%) on SphereFace-20 network. mSF LFW MegaFace SphereFace SphereFace+ SphereFace SphereFace+ 1 96.93 97.47 41.07 45.55 2 99.03 99.22 62.01 67.07 3 99.25 99.35 69.69 70.89 4 99.42 99.47 72.72 73.03 Table 9: Accuracy (%) on SphereFace-64 network. Performance under different mSF. We evaluate SphereFace+ with two different architectures (SphereFace-20 and SphereFace-64) proposed in [28]. Specifically, SphereFace-20 and SphereFace64 are 20-layer and 64-layer modified residual networks, respectively. We train our network with the publicly available CASIA-Webface dataset [60], and then test the learned model on LFW and MegaFace dataset. In MegaFace dataset, the reported accuracy indicates rank-1 identification accuracy with 1 million distractors. All the results in Table 8 and Table 9 are computed without model ensemble and PCA. One can observe that SphereFace+ consistently outperforms SphereFace by a considerable margin on both LFW and MegaFace datasets under all different settings of mSF. Moreover, the performance gain generalizes across network architectures with different depth. Method LFW MegaFace Softmax Loss 97.88 54.86 Softmax+Contrastive [45] 98.78 65.22 Triplet Loss [40] 98.70 64.80 L-Softmax Loss [29] 99.10 67.13 Softmax+Center Loss [53] 99.05 65.49 CosineFace [51, 49] 99.10 75.10 SphereFace 99.42 72.72 SphereFace+ (ours) 99.47 73.03 Table 10: Comparison to state-of-the-art. Comparison to state-of-the-art methods. We also compare our methods with some widely used loss functions. All these compared methods use SphereFace-64 network that are trained with CASIA dataset. All the results are given in Table 10 computed without model ensemble and PCA. Compared to the other state-of-the-art methods, SphereFace+ achieves the best accuracy on LFW dataset, while being comparable to the best accuracy on MegaFace dataset. Current state-of-the-art face recognition methods [49, 28, 51, 6, 31] usually only focus on compressing the intra-class features, which makes MHE a potentially useful tool in order to further improve these face recognition methods. 6 Concluding Remarks We borrow some useful ideas and insights from physics and propose a novel regularization method for neural networks, called minimum hyperspherical energy (MHE), to encourage the angular diversity of neuron weights. MHE can be easily applied to every layer of a neural network as a plug-in regularization, without modifying the original network architecture. Different from existing methods, such diversity can be viewed as uniform distribution over a hypersphere. In this paper, MHE has been specifically used to improve network generalization for generic image classification, class-imbalance learning and large-scale face recognition, showing consistent improvements in all tasks. Moreover, MHE can significantly improve the image generation quality of GANs (see Appendix G). In summary, our paper casts a novel view on regularizing the neurons by introducing hyperspherical diversity. 9 Acknowledgements This project was supported in part by NSF IIS-1218749, NIH BIGDATA 1R01GM108341, NSF CAREER IIS-1350983, NSF IIS-1639792 EAGER, NSF IIS-1841351 EAGER, NSF CCF-1836822, NSF CNS-1704701, ONR N00014-15-1-2340, Intel ISTC, NVIDIA, Amazon AWS and Siemens. We would like to thank NVIDIA corporation for donating Titan Xp GPUs to support our research. We also thank Tuo Zhao for the valuable discussions and suggestions. References [1] Alireza Aghasi, Afshin Abdi, Nam Nguyen, and Justin Romberg. Net-trim: A layer-wise convex pruning of deep neural networks. In NIPS, 2017. 1 [2] Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016. 20 [3] Dmitriy Bilyk and Michael T Lacey. One-bit sensing, discrepancy and stolarsky’s principle. Sbornik: Mathematics, 208(6):744, 2017. 6 [4] Andrew Brock, Theodore Lim, James M Ritchie, and Nick Weston. Neural photo editing with introspective adversarial networks. In ICLR, 2017. 2, 20 [5] Michael Cogswell, Faruk Ahmed, Ross Girshick, Larry Zitnick, and Dhruv Batra. Reducing overfitting in deep networks by decorrelating representations. In ICLR, 2016. 1, 2 [6] Jiankang Deng, Jia Guo, and Stefanos Zafeiriou. Arcface: Additive angular margin loss for deep face recognition. arXiv preprint arXiv:1801.07698, 2018. 9 [7] 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. 20 [8] Mario Götz and Edward B Saff. Note on d—extremal configurations for the sphere in r d+1. In Recent Progress in Multivariate Approximation, pages 159–162. Springer, 2001. 5, 15 [9] Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron C Courville. Improved training of wasserstein gans. In NIPS, 2017. 20 [10] Song Han, Huizi Mao, and William J Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. In ICLR, 2016. 1 [11] DP Hardin and EB Saff. Minimal riesz energy point configurations for rectifiable d-dimensional manifolds. arXiv preprint math-ph/0311024, 2003. 5, 15 [12] DP Hardin and EB Saff. Discretizing manifolds via minimum energy points. Notices of the AMS, 51(10):1186–1194, 2004. 5, 6 [13] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In ICCV, 2015. 6 [14] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016. 1, 6, 8, 13 [15] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In ECCV, 2016. 8 [16] Andrew G Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, and Hartwig Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861, 2017. 1 [17] Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In CVPR, 2017. 8 [18] Gary B Huang, Manu Ramesh, Tamara Berg, and Erik Learned-Miller. Labeled faces in the wild: A database for studying face recognition in unconstrained environments. Technical report, Technical Report, 2007. 9 10 [19] Forrest N Iandola, Song Han, Matthew W Moskewicz, Khalid Ashraf, William J Dally, and Kurt Keutzer. Squeezenet: Alexnet-level accuracy with 50x fewer parameters and< 0.5 mb model size. arXiv preprint arXiv:1602.07360, 2016. 1 [20] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, 2015. 2, 6, 20 [21] Lu Jiang, Deyu Meng, Shoou-I Yu, Zhenzhong Lan, Shiguang Shan, and Alexander Hauptmann. Self-paced learning with diversity. In NIPS, 2014. 2 [22] Ira Kemelmacher-Shlizerman, Steven M Seitz, Daniel Miller, and Evan Brossard. The megaface benchmark: 1 million faces for recognition at scale. In CVPR, 2016. 9 [23] Arno Kuijlaars and E Saff. Asymptotics for minimal discrete energy on the sphere. Transactions of the American Mathematical Society, 350(2):523–538, 1998. 5, 6, 15 [24] Ludmila I Kuncheva and Christopher J Whitaker. Measures of diversity in classifier ensembles and their relationship with the ensemble accuracy. Machine learning, 51(2):181–207, 2003. 2 [25] Naum Samouilovich Landkof. Foundations of modern potential theory, volume 180. Springer, 1972. 5, 15 [26] Nan Li, Yang Yu, and Zhi-Hua Zhou. Diversity regularized ensemble pruning. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, 2012. 2 [27] Weiyang Liu, Zhen Liu, Zhiding Yu, Bo Dai, Rongmei Lin, Yisen Wang, James M Rehg, and Le Song. Decoupled networks. CVPR, 2018. 1, 5, 6, 16 [28] Weiyang Liu, Yandong Wen, Zhiding Yu, Ming Li, Bhiksha Raj, and Le Song. Sphereface: Deep hypersphere embedding for face recognition. In CVPR, 2017. 1, 2, 5, 9, 14, 19 [29] Weiyang Liu, Yandong Wen, Zhiding Yu, and Meng Yang. Large-margin softmax loss for convolutional neural networks. In ICML, 2016. 1, 2, 4, 9, 22 [30] Weiyang Liu, Yan-Ming Zhang, Xingguo Li, Zhiding Yu, Bo Dai, Tuo Zhao, and Le Song. Deep hyperspherical learning. In NIPS, 2017. 1, 2, 4, 5, 6, 8, 16, 18 [31] Yu Liu, Hongyang Li, and Xiaogang Wang. Rethinking feature discrimination and polymerization for large-scale recognition. arXiv preprint arXiv:1710.00870, 2017. 9 [32] Julien Mairal, Francis Bach, Jean Ponce, and Guillermo Sapiro. Online dictionary learning for sparse coding. In ICML, 2009. 2 [33] Dmytro Mishkin and Jiri Matas. All you need is a good init. In ICLR, 2016. 2 [34] Takeru Miyato, Toshiki Kataoka, Masanori Koyama, and Yuichi Yoshida. Spectral normalization for generative adversarial networks. In ICLR, 2018. 2, 20 [35] Ignacio Ramirez, Pablo Sprechmann, and Guillermo Sapiro. Classification and clustering via dictionary learning with structured incoherence and shared features. In CVPR, 2010. 2 [36] Pau Rodríguez, Jordi Gonzalez, Guillem Cucurull, Josep M Gonfaus, and Xavier Roca. Regularizing cnns with locally constrained decorrelations. In ICLR, 2017. 1, 2, 5, 8 [37] Aruni RoyChowdhury, Prakhar Sharma, Erik Learned-Miller, and Aruni Roy. Reducing duplicate filters in deep neural networks. In NIPS workshop on Deep Learning: Bridging Theory and Practice, 2017. 1 [38] Edward B Saff and Amo BJ Kuijlaars. Distributing many points on a sphere. The mathematical intelligencer, 19(1):5–11, 1997. 5, 6 [39] Tim Salimans and Diederik P Kingma. Weight normalization: A simple reparameterization to accelerate training of deep neural networks. In NIPS, 2016. 20 [40] Florian Schroff, Dmitry Kalenichenko, and James Philbin. Facenet: A unified embedding for face recognition and clustering. In CVPR, 2015. 9 [41] Wenling Shang, Kihyuk Sohn, Diogo Almeida, and Honglak Lee. Understanding and improving convolutional neural networks via concatenated rectified linear units. In ICML, 2016. 1 [42] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv:1409.1556, 2014. 1 11 [43] Steve Smale. Mathematical problems for the next century. The mathematical intelligencer, 20(2):7–15, 1998. 2, 5 [44] Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. JMLR, 15(1):1929–1958, 2014. 2 [45] Yi Sun, Xiaogang Wang, and Xiaoou Tang. Deep learning face representation from predicting 10,000 classes. In CVPR, 2014. 9 [46] Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In CVPR, 2015. 1, 8 [47] Pieter Merkus Lambertus Tammes. On the origin of number and arrangement of the places of exit on the surface of pollen-grains. Recueil des travaux botaniques néerlandais, 27(1):1–84, 1930. 5 [48] Joseph John Thomson. Xxiv. on the structure of the atom: an investigation of the stability and periods of oscillation of a number of corpuscles arranged at equal intervals around the circumference of a circle; with application of the results to the theory of atomic structure. The London, Edinburgh, and Dublin Philosophical Magazine and Journal of Science, 7(39):237–265, 1904. 2, 5 [49] Feng Wang, Weiyang Liu, Haijun Liu, and Jian Cheng. Additive margin softmax for face verification. arXiv preprint arXiv:1801.05599, 2018. 9, 19 [50] Feng Wang, Xiang Xiang, Jian Cheng, and Alan L Yuille. Normface: L2 hypersphere embedding for face verification. arXiv preprint arXiv:1704.06369, 2017. 19 [51] Hao Wang, Yitong Wang, Zheng Zhou, Xing Ji, Zhifeng Li, Dihong Gong, Jingchao Zhou, and Wei Liu. Cosface: Large margin cosine loss for deep face recognition. arXiv preprint arXiv:1801.09414, 2018. 9, 14 [52] David Warde-Farley and Yoshua Bengio. Improving generative adversarial networks with denoising feature matching. In ICLR, 2017. 20 [53] Yandong Wen, Kaipeng Zhang, Zhifeng Li, and Yu Qiao. A discriminative feature learning approach for deep face recognition. In ECCV, 2016. 9 [54] Bo Xie, Yingyu Liang, and Le Song. Diverse neural network learns true target functions. arXiv preprint arXiv:1611.03131, 2016. 5, 6 [55] Di Xie, Jiang Xiong, and Shiliang Pu. All you need is beyond a good init: Exploring better solution for training extremely deep convolutional neural networks with orthonormality and modulation. arXiv:1703.01827, 2017. 2 [56] Pengtao Xie, Yuntian Deng, Yi Zhou, Abhimanu Kumar, Yaoliang Yu, James Zou, and Eric P Xing. Learning latent space models with angular constraints. In ICML, 2017. 1, 2, 5 [57] Pengtao Xie, Aarti Singh, and Eric P Xing. Uncorrelation and evenness: a new diversity-promoting regularizer. In ICML, 2017. 1, 2 [58] Pengtao Xie, Wei Wu, Yichen Zhu, and Eric P Xing. Orthogonality-promoting distance metric learning: convex relaxation and theoretical analysis. In ICML, 2018. 2 [59] Pengtao Xie, Jun Zhu, and Eric Xing. Diversity-promoting bayesian learning of latent variable models. In ICML, 2016. 1, 2 [60] Dong Yi, Zhen Lei, Shengcai Liao, and Stan Z Li. Learning face representation from scratch. arXiv:1411.7923, 2014. 9 [61] Kaipeng Zhang, Zhanpeng Zhang, Zhifeng Li, and Yu Qiao. Joint face detection and alignment using multitask cascaded convolutional networks. IEEE Signal Processing Letters, 23(10):1499–1503, 2016. 14 [62] Xiangyu Zhang, Xinyu Zhou, Mengxiao Lin, and Jian Sun. Shufflenet: An extremely efficient convolutional neural network for mobile devices. arXiv preprint arXiv:1707.01083, 2017. 1 12
2018
107
7,261
Learning a latent manifold of odor representations from neural responses in piriform cortex Anqi Wu1 Stan L. Pashkovski2 Sandeep Robert Datta2 Jonathan W. Pillow1 1 Princeton Neuroscience Institute, Princeton University, {anqiw, pillow}@princeton.edu 2 Department of Neurobiology, Harvard Medical School, {pashkovs, srdatta}@hms.harvard.edu Abstract A major difficulty in studying the neural mechanisms underlying olfactory perception is the lack of obvious structure in the relationship between odorants and the neural activity patterns they elicit. Here we use odor-evoked responses in piriform cortex to identify a latent manifold specifying latent distance relationships between olfactory stimuli. Our approach is based on the Gaussian process latent variable model, and seeks to map odorants to points in a low-dimensional embedding space, where distances between points in the embedding space relate to the similarity of population responses they elicit. The model is specified by an explicit continuous mapping from a latent embedding space to the space of high-dimensional neural population firing rates via nonlinear tuning curves, each parametrized by a Gaussian process. Population responses are then generated by the addition of correlated, odor-dependent Gaussian noise. We fit this model to large-scale calcium fluorescence imaging measurements of population activity in layers 2 and 3 of mouse piriform cortex following the presentation of a diverse set of odorants. The model identifies a low-dimensional embedding of each odor, and a smooth tuning curve over the latent embedding space that accurately captures each neuron’s response to different odorants. The model captures both signal and noise correlations across more than 500 neurons. We validate the model using a cross-validation analysis known as co-smoothing to show that the model can accurately predict the responses of a population of held-out neurons to test odorants. 1 Introduction Odorants are physically described by thousands of features in a high-dimensional chemical feature space. Previous studies have focused on reducing the dimensionality of this chemical feature space [1], or on identifying dimensions of olfactory perceptual space using psychophysical measurements in humans [2, 3]. However, the dimensions of olfactory space underlying neural representations in the brain remain largely unknown. Here we take a latent variable modeling approach to the problem of identifying a low-dimensional manifold of olfactory stimuli. Our approach is unsupervised in that it makes no use of chemical features, but seeks to identify a latent embedding of odorants from measurements of odor-evoked neural population activity in mouse piriform cortex. This approach aims to provide insight into odor encoding in the brain by identifying an olfactory space that relates smoothly to changes in large-scale neural firing patterns. Recent work in computational neuroscience has focused on the development of sophisticated modelbased methods for identifying low-dimensional latent manifolds underlying neural population activity [4–12]. Here we extend such methods to the problem of neural coding in the olfactory system. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. Specifically, we develop a Gaussian process based latent variable model (GPLVM) [13] for identifying latent structure underlying population activity in the olfactory cortex. The model is defined by a latent olfactory space, which serves as a low-dimensional embedding space. This latent space seeks to preserve the similarity relationships between odors on the basis of similarities in evoked neural activity patterns. The latent olfactory space is mapped to the space of high-dimensional neural activity patterns via a set of nonlinear tuning curves, one for each neuron, each governed by a Gaussian process prior. The output of these tuning curves specifies a vector of mean responses to an odorant, and we model the neural activity patterns as Gaussian with a low-rank plus diagonal covariance, modulated by an odor-dependent scaling factor. This results in a matrix normal model of the population response across odorants, defined by a diagonal odorant covariance and a low-rank plus diagonal neuron covariance matrix. The main novelty of this work from a modeling perspective consists of extending the GPLVM to incorporate structured noise for capturing correlated, odor-dependent variability in multi-trial population responses to repeated stimuli. Although we have applied it here to the piriform cortex, we feel that this model could be used to gain insights into the latent organization of neural population activity in a wide variety of other brain areas where coding is mixed or poorly understood, e.g., prefrontal cortex [14, 15], parietal cortex [16–18], or entorhinal cortex [19]. In the following, we formulate the multi-trial Gaussian process latent variable for correlated neural activity (Sec. 2) and describe an efficient variational expectation maximization (EM) inference method based on black-box variational inference (Sec. 3). We then describe a validation procedure based on co-smoothing, in which we predict the response of a subset of the neural population to a test odor using the tuning curves and the latent embeddings estimated from training data (Sec. 4). We validate our model and inference methodology using a simulated experiment, which reveals that repeated stimulus presentations are necessary to obtain accurate estimates of the structured noise covariance (Sec. 6). Finally (Sec. 7), we apply the model to multiple multi-neuron recordings of population activity from layer 2 (L2) and layer 3 (L3) mouse piriform cortex, each with more than 500 simultaneously recorded neurons. The model allows us to infer a low-dimensional embedding of 66 odorants, and smooth, low-dimensional neural tuning curves that account for the mean response of each neuron across odorants, and covariance matrices that account for both signal and noise correlations in neural activity patterns across neurons and odorants. 2 Multi-trial Gaussian process latent variable with structured noise We consider simultaneously measured calcium fluorescence imaging responses from N neurons in response to D distinct odorants, each presented T times. Let Y 2 RT ⇥D⇥N denote the tensor of neural responses, with neurons indexed by n 2 {1, ..., N}, odorants indexed by d 2 {1, ..., D} and repeats indexed by t 2 {1, ..., T}. Our goal is to build a generative model characterizing a low-dimensional latent structure underlying this data, and assume each odor is associated with a latent variable xd 2 RP ⇥1 in a P-dimensional latent space. Latent space: Let X = [x1, ..., xD]> 2 RD⇥P denote the matrix of latent locations for the D odorants in a P-dimensional latent embedding space. Let xp denote the p’th column of X, which carries the embedding location of all odorants along the p’th latent dimension. We place a standard normal prior to the embedding locations, xp ⇠N(0, ID) for all p, reflecting our lack of prior information from the chemical descriptors for each odorant. Nonlinear latent tuning curves: Let f : RP ⇥1 ! R denote a nonlinear function mapping from the latent space of odorant embeddings {xd} to a single neuron’s firing rate. These functions differ from traditional tuning curves in that their input is the latent (unobserved) vector xd of an odorant, as opposed to an observable stimulus feature (e.g., or orientation of a visual grating, or chemical features of an odorant). Let fn(x) denote the tuning curve for the n’th neuron, which we parametrize with a Gaussian Process (GP) prior: fn(x) ⇠GP(m(x), k(x, x0)), n = {1, ..., N} (1) where m(x) = bn>x is a linear mean function with weights bn, and k(x, x0) is a covariance function that governs smoothness of the tuning curve over its P-dimensional input latent space. We use the Gaussian or radial basis function (RBF) covariance function: k(x, x0) = ⇢exp(−||x −x0||2 2/2σ2), where x and x0 are arbitrary points in the latent space, ⇢is the marginal variance and σ is the length scale controlling smoothness of the latent tuning curve. 2 2D latent odor locations dim 1 dim 2 2D tuning curves firing rates odor noise covariance neural noise covariance , , neuron odor repeats neural recordings neurons dim 2 dim 1 odor neuron odor odor neuron neuron Figure 1: Schematic diagram of the multi-trial Gaussian process latent variable with structured noise. Let fn 2 RD⇥1 denote a vector of firing rates for neuron n in response the D odorants, with the d’th element equal to fn(xd). The GP prior over fn(·) implies that fn has a multivariate normal distribution given X: fn | X ⇠N(mn, K), n = {1, ..., N} (2) where mn is a D ⇥1 mean vector for neuron n, and K is a D ⇥D covariance matrix generated by evaluating the covariance function k(·, ·) at all pairs of rows in X. We assume the mean vector to be mn = Xbn with weights bn 2 RP ⇥1 giving a linearly mapping of the P-dimensional latent representation for the mean of the firing rate vector fn. If we assume a prior distribution over bn : p(bn) = N(0, β−1IP ) for n = {1, ..., N} with β as the precision, we can integrate over bn to get the distribution of fn conditioned on X only: fn|X ⇠N(0, K + β−1XX>), n = {1, ..., N} (3) where the covariance is a mixture of a linear kernel and a nonlinear RBF kernel. The precision value β plays a role as the trade-off parameter between two kernels. For simplicity, we will denote K + β−1XX> as K in the following sections, and we will differentiate the RBF kernel and the mixture kernel in the experimental section. Horizontally stacking fn for N neurons, we get a firing rate matrix F 2 RD⇥N with fn on the n’th column. Let ef = vec(F) be the vectorized F, we can write the prior for ef as, ef ⇠N(0, IN ⌦K) (4) Observation model: For each repeat in the olfaction dataset, we have the neural population response to all odors, denoted as Yt 2 RD⇥N. Instead of taking the average over {Yt}T t=1 and modeling the averaged neural response as noise corrupted F, we use all the repeats to estimate latent variable and noise covariance. First we collapse neuron dimension and odor dimension together to formulate a 2D matrix eY 2 RT ⇥(DN), with the row vectors {eyt 2 R(DN)⇥1}T t=1. Given the vectorized firing rate ef, {eyt}T t=1 are i.i.d samples from eyt|ef ⇠N(ef, ∆), t = {1, ..., T} (5) where ∆2 R(DN)⇥(DN) is the noise covariance matrix. When ∆is a diagonal matrix, the model implies the observed response yt,d,n = fd,n + ✏t,d,n with ✏t,d,n ⇠N(0, δ2 d,n) for the n’th neuron and d’th odor in repeat t. When we assume the noise correlation exists across multiple neuron and odor pairs, ∆is a non-diagonal matrix. In the olfaction dataset, there is a very small amount of repeats but a large neural population, which implies that eY locates in a small-sample and high-dimension regime. Such a dataset is insufficient to provide strong data support to estimate parameters for a full rank ∆ matrix. Moreover, inverting ∆requires O(D3N 3) computational complexity prohibiting an efficient inference when N is large. Therefore, our solution is to model the noise covariance matrix with a Kronecker structure, i.e., ∆= ⌃N ⌦⌃D, where ⌃N is the noise covariance across neurons and ⌃D is the noise covariance across odors. Fig. 1 provides a schematic of the model. When applying multi-trial GPLVM to the olfactory data, each repeat of presentations of all odorants is one trial to fit the model. Marginal distribution over F: Since we have normal distributions for both data likelihood (eq. 5) and prior for ef (eq. 4), we can marginalize out ef to derive the evidence for X. There are multiple ways of deriving the integration. Here, we provide one formulation consisting of multiple multivariate 3 normal distributions and treating the mean and the cross-trial information as random variables: p(ey1, ..., eyT |K) = N 0 @ 1 p T T X j=1 eyj|0, ∆+ TI ⌦K 1 A T −1 Y t=1 N 0 @ 1 p t(t + 1) t X j=1 eyj − r t t + 1 eyt+1|0, ∆ 1 A . (6) More derivation details can be found in the supplement (Appendix A). The evidence distribution consists of two parts: 1) normal distributions for the cross-trial random variables with the noise covariance as its covariance, and 2) a normal distribution for the average of all repeats with a covariance formed as a sum of the noise covariance and the GP prior covariance. For single-trial data, the evidence distribution is reduced to the first normal distribution only in eq. 6, which is insufficient to be used to estimate a full noise covariance with a Kronecker structure as well as a kernel matrix. Therefore, the cross-trial statistics should be considered for structured noise estimation. 3 Efficient variational inference Given the evidence in eq. 6 and the normal prior for X, we estimate the latent variable X in K and model parameters consisting of noise covariance ∆and hyperparameters in the kernel function. The joint distribution is written as, p(Y, X|∆, ✓) = p(Y|X, ∆, ✓)p(X) (7) where ✓= {⇢, σ} is the hyperparameter set, references to which will now be suppressed for simplification. This is a Gaussian process latent variable model (GPLVM) with multi-trial Gaussian observations and structured noise covariance. Due to the non-conjugacy of the data distribution and the prior over X, we employ a variational distribution to approximate the posterior of latent variable using the Black Box Variational Inference (BBVI) [20] and optimize both latent variable and model parameters using a variational Expectation-Maximization (EM) algorithm. More details can be found in the supplement (Appendix B). In E-step, we need to evaluate the log marginal likelihood for eq. 6 and calculate the inversion of (DN) ⇥(DN) covariance matrices, which is the computational bottleneck of the evaluation. However, we can efficiently evaluate it with the nice property of Kronecker product. For the noise-only normal distributions, their covariance ∆= ⌃N ⌦⌃D is a Kronecker product of two smaller matrices. The inversion of ∆is achieved by ∆−1 = ⌃−1 N ⌦⌃−1 D . The log determinant is log |∆| = N log |⌃D| + D log |⌃N|. For the normal distribution with both latent variable and noise, its covariance matrix is a sum of two Kronecker products. In general, efficient evaluation can be carried out for such a formulation. The key idea is to transform the summation of two full matrices into one full matrix plus a diagonal matrix and then invert the summation using eigenvalue decomposition. Let ⌃D = UD⇤DU> D and ⌃N = UN⇤NU> N be the eigen-decompositions of ⌃D and ⌃N. The covariance matrix C can be factorized as C = TIN ⌦K + ⌃N ⌦⌃D = ⇣ UN⇤ 1 2 N ⌦UD⇤ 1 2 D ⌘⇣ (T⇤−1 N ) ⌦(⇤ −1 2 D U> DKUD⇤ −1 2 D ) + IN ⌦ID ⌘⇣ ⇤ 1 2 NU> N ⌦⇤ 1 2 DU> D ⌘ . (8) The complexity of inverting the first and the third terms in eq. 8 is O(D3 + N 3). The bottleneck is now inverting the second term in eq. 8. We define new notations eK = ⇤ −1 2 D U> DKUD⇤ −1 2 D and eC = T⇤−1 N ⌦eK + IN ⌦ID. The problem is thus reduced to inverting the matrix eC. The second step is to exploit the compatibility of a Kronecker product plus a constant diagonal term with eigenvalue decomposition. Let T⇤−1 N = UT ⇤T U> T and eK = UK⇤KU> K be the eigen-decompositions of T⇤−1 N and eK. Thus, eC = T⇤−1 N ⌦eK + IN ⌦ID = (UT ⌦UK) (⇤T ⌦⇤K + IN ⌦ID) , U> T ⌦U> K , (9) Finally, combining eq. 8 and eq. 9 to get C = ⇣ UN⇤ 1 2 N ⌦UD⇤ 1 2 D ⌘ (UT ⌦UK) (⇤T ⌦⇤K + IN ⌦ID) , U> T ⌦U> K - ⇣ ⇤ 1 2 NU> N ⌦⇤ 1 2 DU> D ⌘ . (10) 4 Inverting C now has only O(D3 + N 3) computational complexity instead of O(D3N 3). More detailed derivations can be found in the supplement (Appendix C). With this efficient evaluation of the log conditional likelihood, we can run BBVI fast for E-step to learn the optimal approximate posterior q(X|λ†) ⇡p(X|Y, ∆, ✓) given a fixed set of ∆and ✓with λ† as the optimal approximation parameters. In M-step, model parameters are optimized using the ELBO given the optimal variational distribution learned from E-step: ∆†, ✓† = argmax∆,✓Eq(X|λ†) [log p(Y|X, ∆, ✓)] (11) where the expectation can also be approximated by Monte Carlo integration. After the optimization, we can derive the posterior distribution for firing rates F given the neural response Y and optimal X, ∆and ✓as p(F|Y, X, ∆, ✓) = N ef|(IN ⌦K)(∆+ TIN ⌦K)−1 T X t=1 eyt, (IN ⌦K)(∆+ TIN ⌦K)−1∆ ! . (12) Similar to the evaluation in E-step, the posterior mean of firing rates can be efficiently calculated using the same Kronecker trick in eq. 10. 4 Prediction with co-smoothing We propose a model to learn latent representations for odors and tuning curves for neurons as well as structured noise covariance with multi-trial neural responses. Next, we employ a co-smoothing idea to evaluate its performance. The question to ask is when presenting an unseen odor to neural populations, can we use partially observed neurons’ responses to learn the odor’s latent representation, then predict the neural responses of the unobserved neurons given their tuning curves and the latent representation? Firing rate prediction: We first use the training odors to estimate the firing rates and the latent representations of these training odors as shown in sec. 3. For a new odor, we collect some repeats of neural responses from partially observed neural ensembles Y⇤ o 2 RT ⇥1⇥No where T is the number of repeats, No is the number of observed neurons and ⇤indicates the test odor. We use Y⇤ o as well as the optimal firing rates F and latent variables X to estimate the latent representation x⇤for the test odor. We use the same variational EM algorithm to learn q(x⇤) ⇡p(x⇤|Y⇤ o, Y, X, ∆, ✓) by fixing the latent variables and noise covariance from the training data as well as the hyperparameters while changing the latent variable and noise variance related to the test odor. Finally, the predictive firing rate for the test odor from the partially unobserved neural ensembles, denoted as F⇤ u 2 RNu⇥1 with Nu as the number of unobserved neurons, is calculated as F⇤ u = (ΓNu,N ⌦K⇤)(∆+ TIN ⌦K)−1 T X t=1 eyt, (13) where K⇤2 R1⇥D is the kernel matrix evaluated between the test odor’s latent representation x⇤and the training odors’ latent representations X, and ΓNu,N 2 RNu⇥N is a zero-one matrix indicating the indices of the unobserved neurons in the entire neural ensemble. We can also calculate the firing rates for the observed neurons F⇤ o 2 RNo⇥1 using a similar expression as eq. 13. For experimental evaluation purpose, we can compare the predictive firing rate F⇤ u with the averaged true response PT t=1 Y⇤ u,t. We will show the firing rate prediction in the olfaction data experiment. Single-trial neural activity prediction: When the number of repeats is large enough to render a mean response resembling the underlying firing rate, single-trial and trial-average models can both provide good estimations for latent variables and firing rates for test odors by using the co-smoothing approach. The advantage of our multi-trial model will be suppressed when only evaluating the predictive performance for firing rates when there are many repeats. Thereby, we can take another step forward to predict single-trial neural activities given the estimated firing rates where the estimated noise covariance encodes trial-by-trial deviations from the noise-free firing rate. 5 A) B) single-trial prediction 0.4 0.5 0.6 0.7 R 2 true data 0 19 0 19 neural noise odor noise GP kernel odor signal neural signal 0 19 0 19 0 49 0 49 0 19 0 19 0 49 0 49 trial-average multi-trial estimation model N D Figure 2: A) R2 values for single-trial prediction for 8 different noise covariance structures comparing between trial-average and multi-trial models. The top two rows indicate the combinations of neuron noise covariance and odor noise covariance parametrization. The y-axis indicates the R2 values. B) Data covariance/correlation (top) and model-recovered covariance/correlation (bottom) for signal (columns 2-3) and noise (columns 4-5). The true kernel matrix in the GP prior is presented at the top in the 1st column and the estimated kernel matrix is presented at the bottom in the 1st column. Let ⌃D and ⌃N denote the noise covariance matrices for all odors and all neurons. We can partition them into the following forms: ⌃D = ⌃11 D ⌃12 D ⌃12 D > ⌃22 D 2 , ⌃N = ⌃11 N ⌃12 N ⌃12 N > ⌃22 N 2 . (14) ⌃D is partitioned according to the training odors and the test odor. ⌃11 D is the noise covariance for the training odors estimated during the training stage; ⌃12 D is the cross noise covariance between the training odors and the test odor estimated during the co-smoothing stage; and ⌃22 D is the test odor noise covariance estimated during the co-smoothing stage. ⌃N is partitioned according to the observed neurons and the unobserved neurons. ⌃11 N is the noise covariance for the observed odors; ⌃12 N is the cross noise covariance between the observed neurons and the unobserved neurons; and ⌃22 N is the unobserved neuron noise covariance. The entire ⌃N matrix is learned during the training procedure and is partially used to do co-smoothing. We also denote the single-trial neural response for training as Yt, the single-trial neural response added for co-smoothing as Y⇤ o,t and the single-trial neural response from the unobserved neurons for the test odor as Y⇤ u,t. Then we can write down the mean of the posterior distribution for Y⇤ u,t, i.e., p(Y⇤ u,t|Yt, Y⇤ o,t, F, F⇤ o, F⇤ u, ⌃D, ⌃N), as vec ˆY⇤ u,t = vecˆF⇤ u + 2 4⌃12 D⌦  ⌃12 N ⌃22 N 2 ⌃22 D ⌦⌃12 N 3 5 >2 4 ⌃11 D ⌦⌃N ⌃12 D ⌦ ⌃11 N ⌃12 N > 2 ⌃12 D >⌦[⌃11 N ⌃12 N ] ⌃22 D ⌦⌃11 N 3 5 −1vecYt −vecF vecY⇤ o,t −vecF⇤ o 2 (15) We will show the predictive performance comparing ˆY⇤ u,t and Y⇤ u,t using single repeats in the simulated experiment. 5 Simulated data First, we consider a simulated dataset to illustrate the effect of our multi-trial GPLVM model with structured noise covariance on single-trial predictive performance. We create a simulated example with T = 10 repeats, N = 50 neurons and D = 20 odors according to the generative model described in sec. 2. We generate 2-dimensional latent variables from a normal prior and construct a covariance matrix from the latent using an RBF kernel function, and then i.i.d sample tuning curves for 50 neurons from a Gaussian process prior with a zero mean and the covariance matrix. Then we generate two structured noise covariance matrices with rank = 2 for neurons and odors respectively. Finally, we generate 10 samples from eq. 5 using the sampled tuning curves and the structured noise covariances. We compare multiple combinations of structures for neuron noise covariance ⌃N and odor noise covariance ⌃D. Each one can take one of three forms: an identity matrix, a diagonal matrix with heterogeneous noise variances on the diagonal and a low-rank full matrix plus a heterogeneous diagonal (indicated in Fig. 2A)). Moreover, we compare between trial-averaged neural response and multi-trial neural response in order to show that it requires more statistics to learn structured noise variance. The trial-average results in Fig. 2A) are achieved by fitting the mean response only to 6 functional local 3 -2 -6 6 -2 4 -5 5 -2 2 -2 2 -5 5 -7 7 PCA A) C) 2D tuning curves for individual neurons 2D latents for odors empirical firing rates estimated firing rates mean response to each odor firing rates odor index B) multi-trial GPLVM Figure 3: A) 2D latent representations of 22 odors in functional and local odor sets analyzed by PCA and multi-trial GPLVM. Odors from different functional groups are color-coded. B) Inferred two-dimensional latent tuning curves for five example neurons. C) Mean response to each of the 22 individual odors for these same example neurons. Traces show observed mean spike count for each odor (blue) and inferred latent tuning curve value (red). multi-trial GPLVM to learn structured noise. Our quantitative comparison covers the noise models for GP from [21] and [22]. The R2 values of the single-trial prediction performance is shown in Fig. 2A). The red and blue error bars represent trial-average and multi-trial respectively. When fitting a full noise covariance matrix for odors, a trial-average model is poor. When fitting the 8th column with full matrices for both neurons and odors, it prefers the multi-trial model and achieves the best predictive performance with structured noise covariance matrices. We also show that the best model (the 8th column) effectively captures noise structures and signal structures for both neuron and odor from the data (Fig. 2B)). The kernel matrix for the prior is also well recovered in Fig. 2B). 6 Olfaction data Two-photon calcium imaging of piriform cortex was performed in awake mice previously infected with the GCaMP6s activity reporter. Imaging volumes through piriform layers 2 and 3 were acquired at 7 volumes/sec using a custom microscope equipped with a resonant galvo and high-speed piezo actuator. Detection of active neurons, segmentation, and extraction of fluorescence signal was performed using Suite2p software. Extracted fluorescence traces were corrected for neuropil contamination. For each cell, responses to odor presentations constituted a single delta F/F0 value where F is the average fluorescence signal over 2 seconds immediately following odor onset and F0 is fluorescence signal preceding odor onset. Monomolecular odors were diluted in di-propylene glycol (DPG) according to individual vapor pressures obtained from www.thegoodscentscompany.com, to give a nominal concentration of 500 ppm. This vapor-phase concentration was further diluted 1:5 by the carrier airflow to yield 100 ppm at the exit port. Odor presentations lasted for two seconds and were interleaved by 30 seconds of blank (DPG) delivery. The order of presentation of odors was pseudo-randomized for each experiment, such that on any given repeat, odors were presented once in no predictable order. Three different odor sets, each consisting of 22 odorants, were presented to multiple awake mice with 10 repeats for each odor. For each odor set, we have calcium imaging neural responses collected from about 200 neurons in both layer 2 (L2) and layer 3 (L3) in the piriform cortex of 3 mice leading to a dataset with about 500 L2 neurons and 500 L3 neurons for each odor set. Therefore, we deal with three datasets, each with T = 10 repeats, D = 22 odorants, N ⇡500 L2 neurons and N ⇡500 L3 neurons. We standardize each repeat response across neurons and apply principle component analysis (PCA) and our model with a 2-dimensional latent embedding to these datasets. For PCA, we find the first two principal components of the D ⇥(NT) response matrix. For our model, the kernel in eq. 3 is an RBF function without a linear component. We set the noise covariances for odors and neurons to be a heterogeneous diagonal matrix and a full matrix with a low-rank structure as described in Fig. 2A). We fit the model to three different odor sets {"functional", "local", "global"} using both L2 neurons and L3 neurons sharing the same 2D latent variables. Fig. 3A) shows the 2-dimensional latent variables for 22 odors in the functional and local odor sets. More latent representations discovered by t-SNE [23] and multidimensional scaling (MDS) [24] can be found in the supplementary (Appendix D). 7 1 12 0.3 0.325 2 4 8 0.48 0.52 1 12 2 4 8 single-trial prediction 0.2 0.4 R 2 trial-average RBF+linear multi-trial RBF multi-trial RBF+linear trial-average RBF 0.2 0.4 0.6 0.8 correlation metric rank r rank of true data neural noise odor noise odor signal neural signal estimation model A) B) N D Figure 4: A) R2 and correlation metric criteria for predictive performance for 5 different noise covariance structures comparing between trial-average and multi-trial models as well as an RBF kernel vs a mixture of kernels. The top two rows indicate the combinations of neuron noise structure and odor noise structure. The influence of the rank of noise covariance is also presented for two criteria. B) Data covariance/correlation (top) and model-recovered covariance/correlation (bottom) for signal (the first two columns) and noise (the last two columns). The functional odor set contains distinct odors sharing one of six chemical functional groups. Odors sharing the same functional group should be more closely related in chemical space than odors harboring different functional groups. The local odor set contains straight chain aliphatic odorants that harbor 1 of 4 carbonyl functional groups and range 3-8 carbons in length. PCA cannot discover the functional class nor identify the linearized embeddings effectively for both sets. Our model (multitrial GPLVM) can identify 2-dimensional clusters with clear linear boundaries for the functional set and linearized curves of groups of odors for the local set, without knowing any information regarding the chemical features (Fig. 3A)). Odors from the same functional group have the same color. We learn the 2D latent variables by imposing L2 and L3 sharing the same latent space, but the tuning curves are estimated separately with different length scales for the GP priors. We observe that L3 neurons have a bigger length scale value than L2 neurons. This implies wider tuning curves for L3 which leads to better performance for L3 at discriminating different functional groups and identifying the latent odor embeddings. Fig. 3B) shows some example 2D tuning curves from L3 in both odor sets. Fig. 3C) presents averaged firing rates for individual neurons. The blue curves are the mean responses across repeats which can be considered as empirical tuning curves (signal). The red curves are estimated tuning curves. This comparison suggests that our model can identify the signal and fit the data pretty well. Moreover, 1D empirical curves are plotted along the indices of the odors which are not that smooth nor interpretable. We can see that the model can effectively capture a set of smooth 2D neural turning curves for individual neurons which explicitly map the 2D latent representations of odors to high-dimensional neural activities. The 2D illustration indicates the strength of our proposed model in discovering nonlinear latent embedding for neural ensembles. We can find more interpretable 2D tuning curves than just taking the average across multiple repeats for single neurons. Thereby, such a 2D space can be interpreted as an underlying embedding of neural populations. Next, we will employ the co-smoothing idea described in sec. 4 to evaluate the predictive power of our model with different noise structures. The better the predictive performance is, the better the data is fit and explained by the noise structure. For evaluating purpose, we leave one odor out for each odor set, train on 21 odors using L3 neurons and compute the predicted neural activities, an Nu by 1 vector, for the test odor within the odor set. In total, we carry out a training and predicting procedure for 66 times (leaving one odor out at each time) and take the average. Given the predicted neural activity vector, we use two evaluating criteria: r-squared value (R2) and correlation metric. R2 reveals how close the true neural activities are to the predicted ones. It emphasizes single-neuron performance. However neurons in the piriform cortex are known for encoding correlation information of odors at the population level rather than individual neurons. The correlation/similarity between odors represented in neural space is more informative. We propose another correlation-based metric. We compare the correlation between the predicted neural activity of the test odor and the training odors to obtain a 21 by 1 vector and compare this vector with the true 21 by 1 vector constructed from the true neural activities using another r-squared comparison. This is saying whether the similarity between the test odor and the 8 training odors estimated by the model resembles the true correlation in neural space. The correlation metric should have higher r-squared values than R2 employed on the predictive neural activity vector since noisy neurons are smoothed out in the correlation metric. Fig. 4A) presents both R2 and correlation metric (y-axis) on 5 different noise models. For both metrics, the higher the y value is, the better the performance is. The structures of the models are indicated in the top two rows. When fitting the olfaction data, we don’t assume a low-rank matrix for odor noise covariance. Since the presentation of odors were randomized, odors across repeats don’t imply each other. The red and blue error bars represent trial-average and multi-trial respectively. It’s clear that trial-average has much poor performance, especially for non-identity ⌃N matrices. When ⌃N is an identity matrix (the 3th column), the trial-average values almost catch up with the multi-trial performance. The circle represents a single RBF kernel, and the square is a mixture of RBF and linear kernels with precision β estimated as an element in the hyperparameter set. Among all the models, the 5th model outperforms the others with a full-matrix ⌃N and a non-identity ⌃D. This essentially suggests that there exists correlated noise variability among neurons which cannot be ignored and contribute to information encoding in the piriform cortex. Odorants are more independent in neural space but require odor-specific noise variances. This result validates our prior knowledge about the olfactory neurons. Fig. 4B) shows that the best model (the 5th column) effectively captures noise structures and signal structures for both neuron and odor from the data. There are two dimensionality parameters we need to tune in the model. One is the dimensionality of the latent space, and the other is the rank of the low-rank component in the structured noise matrix. We automate the selection of the number of latent dimensions via an automatic relevance determination (ARD) kernel [25] version of RBF over the latent variables, i.e. K in eq. 2 achieved by k(x, x0) = ⇢exp(−PP i (xi−x0 i)2 2σ2 i ). Each latent dimension has its own length scale σ2 i , and they are independent of each other. By fitting the length scale σ2 i , the model automatically learns a sparse latent space with most σ2 i s approaching to infinity and a few small σ2 i s. As a result of ARD, irrelevant latent dimensions are effectively turned off by selecting large length scales for them. We initially set the dimensionality to be 100, and the model returns 10-15 effective dimensions for all the data. For the rank r of the low-rank structure, we run experiments with r = {1, 2, 4, 8, 12}. Fig. 4A) shows that r = 2 has the best predictive performance using both R2 and correlation metric suggesting the noise correlation is pretty strong with a low-dimensional subspace. 7 Conclusion We have proposed a multi-trial Gaussian process latent variable model with structured noise, and used it to infer a latent odor manifold underlying olfactory responses in the piriform cortex. The resulting model maps odorants to points in a low-dimensional embedding space, where the distance between points in this embedding space relates to the similarity of population responses they elicit. The model is specified by an explicit continuous mapping from a latent embedding space to the space of high-dimensional neural population activity patterns via a set of nonlinear neural tuning curves, each parametrized by a Gaussian process, followed by a low-rank model of correlated, odor-dependent Gaussian noise. We used multiple repeats for analysis instead of trial-average responses for the sake of structured noise covariance estimation. We applied this model to calcium fluorescence imaging measurements of population activity in layers 2 and 3 of mouse piriform cortex following presentation of a diverse set of odorants. We showed that we can learn a low-dimensional embedding of odorants and a smooth tuning curve over the latent embedding space that accurately captures neural responses to different odorants. The model captured both signal and noise correlations across more than 500 neurons. Finally, we performed a co-smoothing analysis to show that the model can accurately predict responses of a population of held-out neurons to test odorants. In the future, we will further investigate the biological interpretability of the 10-15 effective latent dimensions for olfactory perceptual space and the rank-2 structured neural noise covariance. Moreover, we will explore the relationship between chemical features of these odorants and their learned latent embeddings in order to understand which chemical features are most important for determining an odorant’s location within the neural manifold for olfactory representations. Acknowledgements This work was supported by grants from the Simons Foundation (SCGB AWD1004351 and AWD543027), the NIH (R01EY017366, R01NS104899) and a U19 NIH-NINDS BRAIN Initiative Award (NS104648-01). 9 References [1] RafiHaddad, Rehan Khan, Yuji K Takahashi, Kensaku Mori, David Harel, and Noam Sobel. A metric for odorant comparison. Nature methods, 5(5):425, 2008. [2] Alexei Koulakov, Brian E Kolterman, Armen Enikolopov, and Dmitry Rinberg. In search of the structure of human olfactory space. Frontiers in systems neuroscience, 5:65, 2011. [3] Amir Madany Mamlouk, Christine Chee-Ruiter, Ulrich G Hofmann, and James M Bower. Quantifying olfactory perception: mapping olfactory perception space by using multidimensional scaling and selforganizing maps. Neurocomputing, 52:591–597, 2003. [4] John P Cunningham and M Yu Byron. Dimensionality reduction for large-scale neural recordings. Nature neuroscience, 17(11):1500, 2014. [5] Evan Archer, Il Memming Park, Lars Buesing, John Cunningham, and Liam Paninski. Black box variational inference for state space models. arXiv preprint arXiv:1511.07367, 2015. [6] Yuanjun Gao, Evan W Archer, Liam Paninski, and John P Cunningham. Linear dynamical neural population models through nonlinear embeddings. In Advances in Neural Information Processing Systems, pages 163–171, 2016. [7] Matthew R Whiteway and Daniel A Butts. Revealing unobserved factors underlying cortical activity with a rectified latent variable model applied to neural population recordings. Journal of neurophysiology, 117(3):919–936, 2016. [8] Yuan Zhao and Il Memming Park. Variational latent gaussian process for recovering single-trial dynamics from population spike trains. Neural Computation, 2017. [9] David Sussillo, Rafal Jozefowicz, LF Abbott, and Chethan Pandarinath. Lfads-latent factor analysis via dynamical systems. arXiv preprint arXiv:1608.06315, 2016. [10] Yuan Zhao and Il Memming Park. Recursive variational bayesian dual estimation for nonlinear dynamics and non-gaussian observations. arXiv preprint arXiv:1707.09049, 2017. [11] Anqi Wu, Nicholas G Roy, Stephen Keeley, and Jonathan W Pillow. Gaussian process based nonlinear latent structure discovery in multivariate spike train data. In Advances in Neural Information Processing Systems, pages 3499–3508, 2017. [12] Zhe Chen. Latent variable modeling of neural population dynamics. In Dynamic Neuroscience, pages 53–82. Springer, 2018. [13] Neil D Lawrence. Gaussian process latent variable models for visualisation of high dimensional data. In Advances in neural information processing systems, pages 329–336, 2004. [14] Mattia Rigotti, Omri Barak, Melissa R Warden, Xiao-Jing Wang, Nathaniel D Daw, Earl K Miller, and Stefano Fusi. The importance of mixed selectivity in complex cognitive tasks. Nature, 497(7451):585–590, May 2013. [15] Valerio Mante, David Sussillo, Krishna V Shenoy, and William T Newsome. Context-dependent computation by recurrent dynamics in prefrontal cortex. Nature, 503(7474):78–84, 2013. [16] Miriam LR Meister, Jay A Hennig, and Alexander C Huk. Signal multiplexing and single-neuron computations in lateral intraparietal area during decision-making. Journal of Neuroscience, 33(6):2254– 2267, 2013. [17] David Raposo, Matthew T Kaufman, and Anne K Churchland. A category-free neural population supports evolving demands during decision-making. Nature neuroscience, 2014. [18] Il Memming Park, Miriam LR Meister, Alexander C Huk, and Jonathan W Pillow. Encoding and decoding in parietal cortex during sensorimotor decision-making. Nature neuroscience, 17(10):1395–1403, 10 2014. [19] Kiah Hardcastle, Niru Maheswaranathan, Surya Ganguli, and Lisa M Giocomo. A multiplexed, heterogeneous, and adaptive code for navigation in medial entorhinal cortex. Neuron, 94(2):375–387, 2017. [20] Rajesh Ranganath, Sean Gerrish, and David Blei. Black box variational inference. In Artificial Intelligence and Statistics, pages 814–822, 2014. 10 [21] Oliver Stegle, Christoph Lippert, Joris M Mooij, Neil D Lawrence, and Karsten M Borgwardt. Efficient inference in matrix-variate gaussian models with\iid observation noise. In Advances in neural information processing systems, pages 630–638, 2011. [22] Barbara Rakitsch, Christoph Lippert, Karsten Borgwardt, and Oliver Stegle. It is all in the noise: Efficient multi-task gaussian process inference with structured residuals. In Advances in neural information processing systems, pages 1466–1474, 2013. [23] Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(Nov):2579–2605, 2008. [24] Trevor F Cox and Michael AA Cox. Multidimensional scaling. Chapman and hall/CRC, 2000. [25] Carl Edward Rasmussen. Gaussian processes in machine learning. In Advanced lectures on machine learning, pages 63–71. Springer, 2004. 11
2018
108
7,262
Global Gated Mixture of Second-order Pooling for Improving Deep Convolutional Neural Networks Qilong Wang1,2,∗,†, Zilin Gao2,∗, Jiangtao Xie2, Wangmeng Zuo3, Peihua Li2,‡ 1Tianjin University, 2Dalian University of Technology, 3 Harbin Institute of Technology qlwang@tju.edu.cn, gzl@mail.dlut.edu.cn, jiangtaoxie@mail.dlut.edu.cn wmzuo@hit.edu.cn, peihuali@dlut.edu.cn Abstract In most of existing deep convolutional neural networks (CNNs) for classification, global average (first-order) pooling (GAP) has become a standard module to summarize activations of the last convolution layer as final representation for prediction. Recent researches show integration of higher-order pooling (HOP) methods clearly improves performance of deep CNNs. However, both GAP and existing HOP methods assume unimodal distributions, which cannot fully capture statistics of convolutional activations, limiting representation ability of deep CNNs, especially for samples with complex contents. To overcome the above limitation, this paper proposes a global Gated Mixture of Second-order Pooling (GM-SOP) method to further improve representation ability of deep CNNs. To this end, we introduce a sparsity-constrained gating mechanism and propose a novel parametric SOP as component of mixture model. Given a bank of SOP candidates, our method can adaptively choose Top-K(K > 1) candidates for each input sample through the sparsity-constrained gating module, and performs weighted sum of outputs of K selected candidates as representation of the sample. The proposed GM-SOP can flexibly accommodate a large number of personalized SOP candidates in an efficient way, leading to richer representations. The deep networks with our GM-SOP can be end-to-end trained, having potential to characterize complex, multi-modal distributions. The proposed method is evaluated on two large scale image benchmarks (i.e., downsampled ImageNet-1K and Places365), and experimental results show our GM-SOP is superior to its counterparts and achieves very competitive performance. The source code will be available at http://www.peihuali.org/GM-SOP. 1 Introduction Deep convolutional neural networks (CNNs) have achieved great success in a variety of computer vision tasks, especially image classification [25]. During the past years, deep CNN architectures have been widely studied and achieved remarkable progress [34, 36, 13, 17]. As one standard module in deep CNN architectures [36, 13, 17, 5, 16], global average pooling (GAP) summarizes activations of the last convolution layer for final prediction. However, GAP only collects first-order statistics while neglecting richer higher-order ones, suffering from limited representation ability [7]. Recently, some researchers propose to integrate trainable higher-order pooling (HOP) methods (e.g., second-order and third-order pooling) into deep CNNs [19, 29, 39, 27, 8], which distinctly improve representation ability of deep CNNs. However, both GAP and existing HOP methods adopt the unimodal distribution ∗The first two authors contribute equally to this work. †This work was mainly done when he was with Dalian University of Technology. ‡Peihua Li is the corresponding author. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. ( ) H x softmax . . . ∑ Classification Loss Final Representation . . . Sparsity-constrained Gating Module Gated Mixture of Second-order Pooling SR-SOP Balance Loss x Image Convolution Layers Prediction Layers 4th-CM ⊙ Top-K . . . Weights 1 1 × conv. Bank of Parametric Component Models (CMs) 3rd-CM SR-SOP 1 1 × conv. 2nd-CM SR-SOP 1 1 × conv. 1st-CM SR-SOP 1 1 × conv. :Dot Product :Sum ⊙ ∑ Figure 1: Overview of deep CNNs with the proposed global Gated Mixture of Second-order Pooling (GM-SOP). The sparsity-constrained gating module adaptively selects Top-K parametric SR-SOP (indicated by solid rectangles) from a bank of N candidate component models given a sample X, and the final representation is generated by weighted sum of outputs of K selected CMs. For brevity here we take N = 4, K = 2 as an example. assumption to collect statistics of convolutional activations. As illustrated in Figure 1, input images often contain multiple objects or parts, leading their distributions of convolutional activations usually are very complex (e.g., mixture of multiple unimodal models). As such, unimodal distributions cannot fully capture statistics of convolutional activations, which will limit performance of deep CNNs. One natural idea to overcome the above limitation is ensemble of multiple models for summarizing convolutional activations. However, direct ensemble of all component models (CMs) in mixture model will suffer from very high computational cost as number of CMs gets large, while a small number of CMs may be insufficient for characterizing complex distributions. Moreover, simple direct ensemble will make all CMs tend to learn similar characteristics, since they receive identical training samples. These factors heavily limit the representation ability of mixture model (refer to the results in Section 3.2). Inspired by recent work [33], we propose an idea of gated mixture model to solve the above issues. Our gated mixture model is composed of a sparsity-constrained gating module and a bank of candidate CMs. Given an input sample, the sparsity-constrained gating module adaptively selects Top-K CMs from N(N ≫K) candidates according to assigned weights, and then weighted sum of outputs of K selected CMs is used to generate final representation. In this way, our gated mixture model can accommodate efficiently a large number of CMs because only K ones are trained and used to generate representation given a sample. Furthermore, different CMs will receive different training samples so that they can capture personalized characteristics of convolutional activations during training. As suggested in [33], we employ an extra balance loss to eliminate self-reinforcing phenomenon, guaranteeing as many candidate CMs as possible be adequately trained. The CM plays a key role in gated mixture model. Compared with first-order GAP, HOP can capture more statistical information, achieving remarkable improvement in either shallow models [4, 23] or deep architectures [19, 29, 8, 27]. As shown in [26], the comparisons on both largescale image classification [9] and fine-grained visual recognition demonstrate matrix square-root normalized second-order pooling (SR-SOP) outperforms other HOP methods and achieves promising performance in deep architectures. In view of effectiveness of SR-SOP, it seems to be a good choice for CM. However, there exist two problems lying in usage of SR-SOP. Firstly, SR-SOP is a parameter-free model, which cannot be individually learned. Meanwhile, SR-SOP assumes data distribution obeys a Gaussian, which may not always hold true. To address these problems, this paper proposes a parametric SR-SOP method4, which enables candidate CMs to be individually trained with negligible additional cost. Besides, underlying the parametric SR-SOP is estimation of covariance in the generalized Gaussian setting which has better modeling capability than SR-SOP. Based on the parametric SR-SOP, we propose a global Gated Mixture of Second-order Pooling (GM-SOP), 4We reasonably introduce a group of trainable parameters into SR-SOP, and use the recently proposed fast iterative algorithm [26] to speed up matrix square-root normalization on GPU. 2 which is illustrated in Figure 1. Our GM-SOP can effectively exploit a large bank of personalized SOP models to generate more discriminative representations. We evaluate the proposed GM-SOP method on two large scale image benchmarks, i.e., downsampled ImageNet-1K [9] and Places365 [44] that are introduced by [6] and this paper, respectively. As described in [6], downsampled ImageNet is a promising alternative to CIFAR10/100 datasets, as it is large-scale and more challenging, which postpones the saturation risk on CIFAR (as observed in http://karpathy.github.io/2011/04/27/manually-classifying-cifar10/). Compared with standard-size ImageNet, downsampled ImageNet allows much faster experiments and lower computation requirement while maintaining similar characteristics with respect to analysis of networks[6]. The contributions of our paper are three-fold. (1) We, for the first time, introduce a global gated mixture of pooling model into prevalent deep CNN architectures. This goes beyond the existing global average/covariance (second-order) pooling, possessing the potential to capture complex, multi-modal distributions of convolutional activations. (2) We propose parametric second-order models as essential components of mixture model. These components can be trained individually for modeling richer feature characteristics than simple second-order pooling. (3) We perform extensive experiments on two large-scale benchmarks for evaluating and validating the proposed methods, which have proven to achieve much better results than the counterparts. 2 Gated Mixture of Second-order Pooling (GM-SOP) In this section, we introduce the proposed Gated Mixture of Second-order Pooling (GM-SOP) method. We first describe a general idea of gated mixture model, and then propose a parametric matrix squareroot normalized second-order pooling (SR-SOP) method as our component model. Finally, the GM-SOP is integrated into deep CNNs in an end-to-end learning manner. 2.1 Gated Mixture Model Mixture Model The mixture model (e.g., finite mixture distributions [12, 30] or mixture of experts [21, 22]) is widely used to characterize complex data distribution or improve discrimination ability of supervised system through ensemble of multiple component models (CMs). In general, mixture model can be formulated as the weighted sum of all CMs, i.e., y = N X i=1 ωi(X)Mi(X), s.t., N X i=1 ωi(X) = 1, (1) where N is the number of CMs. ωi(X) and Mi(X) indicate weight and output of i-th CM given input X, respectively. The mixture model in Eq. (1) consists of a weight (probability) function and a set of parametric CMs. Given specific forms of weight function and parametric CMs, mixture model in Eq. (1) can be learned by using gradient learning algorithm [21] or Expectation-Maximization (EM) algorithm [22, 30]. Sparsity-constrained Gating Module Given an input sample, contribution of each CM in mixture model is decided by the corresponding weight through either computation of posterior probability in mixture distributions [12, 30] or a gating network in mixture of experts [21, 22]. However, they both acquiesce to allow every input sample to participate in training of all CMs. It will suffer from high computational cost when number of CMs is large. Meanwhile, CMs with small weights may bring noise into final representation [41]. Inspired by [33], we exploit a sparsity-constrained gating module as the weight function to overcome the above issues, where weights are learned by explicitly imposing a sparse constraint. As illustrated in Figure 1, we first pass X throughout a group of prediction layers with parameters θg, i.e., f(θg; X). Then, weights are outputted by using a fully-connected layer with additional noise perturbations, i.e., Hi(f(θg; X)) = Wg i f(θg; X) + γ · log(1 + exp(Wn i f(θg; X))). (2) Here, Wg i and Wn i are i-th row of parameters of fully-connected layer and additional noise, respectively. γ is a random variable sampled from a normal distribution. To make the learned weights H(f(θg; X)) be sparse, only the K largest weights are kept and remaining ones are set to be negative infinity, denoted as Top-K(Hi(f(θg; X))). Finally, a softmax function is used to normalize the 3 weights. To sum up, the weight function can be written as ωi(X) = exp(Top-K(Hi(f(θg; X)))) PN i=1 exp(Top-K(Hi(f(θg; X)))) . (3) Balance Loss The sparsity-constrained gating module makes each sample participate in training of K CMs. However, as shown in [33] and the results of Section 3.2, such gating module has a self-reinforcing phenomenon (i.e., only the same few CMs receive almost all samples while remaining ones have rarely been trained), decreasing representation ability of mixture model. As suggested in [33], we introduce an extra balance loss which is a function of weights defined as follows: LB = α std(PS s=1 ω(Xs)) µ(PS s=1 ω(Xs)) 2 , (4) where Xs is s-th training sample in a mini-batch of S samples and ω(Xj) = [ω1(Xj), . . . , ωN(Xj)] is the weight function in Eq. (3); std(v) and µ(v) denote standard deviation and mean of vector v, respectively; α is a tunable parameter. The loss LB is to constrain that all CMs are adequately trained. 2.2 Component Model of GM-SOP Besides the weight function, component model (CM) plays an indispensable role in gated mixture model. Motivated by success of matrix square-root normalized second-order pooling (SR-SOP) in deep CNN architectures [39, 27], we propose a parametric SR-SOP as CM of our GM-SOP. Parametric SR-SOP Given an input X ∈RL×d containing L features of d-dimension, the SR-SOP of X is computed as Z = (XT ˆJX) 1 2 = Σ 1 2 = UΛ 1 2 UT , ˆJ = 1 L(I −1 L11T ), (5) where Σ = UΛUT is eigenvalue decomposition (EIG) of Σ. I and 1 are identity matrix and L-dimension vector with all elements being one, respectively. Σ is sample covariance (second-order statistics) of X estimated by the classical maximum likelihood estimation (MLE). Since X is a set of convolutional activations in deep CNNs, dimension of X is usually very high (128 in our case) while number of features is very small (∼100). It is well known that the classical MLE is not robust in the above scenario [10]. As explained in [40], performing matrix square root on covariance amounts to robust covariance estimation, very suitable for the scenario of high dimension and small sample. In addition, matrix square-root normalization can be regarded as a special case of Power-Euclidean metric [11] between covariance matrices, i.e., ∥Σβ i −Σβ j ∥2 with β = 0.5, which is an approximation of Log-Euclidean metric [2] (hence making use of Riemannian geometry lying in covariance matrices5) while overcoming some downsides of Log-Euclidean metric [11]. Although SR-SOP in Eq. (5) benefits from some merits and achieves promising performance, it is a parameter-free model, which can not be trained as personalized CMs. Meanwhile, covariance Σ in Eq. (5) is calculated based on assumption that X is sampled from a Gaussian distribution, which may not always hold true. To handle above two problems, we propose a parametric second-order pooling (SOP), i.e., Σ(Qj) = XT QjX = (PjX)T (PjX). (6) Different from the original sample covariance Σ with constant matrix ˆJ, Qj in Eq. (6) is a learnable parameter, and Qj is a symmetric positive semi-definite matrix with Qj = PT j Pj. Note that our parametric SOP in Eq. (6) shares similar philosophy with estimating covariance by assuming features follow a multivariate generalized Gaussian distribution with zero mean [32], i.e., p(xl; bΣ; δ; ε) = Γ(d/2) πd/2Γ(d/2δ)2d/2δ δ εd/2|bΣ|1/2 exp  −1 2εδ (xl bΣ −1xT l )δ  , (7) 5Covariance matrices are symmetric positive definite matrices, whose space forms a non-linear Riemannian manifold [2]. 4 where ε and δ are parameters of scale and shape, respectively; bΣ is covariance matrix, and Γ is a Gamma function. Compared with assumption of data distribution being a Gaussian in Eq. (5), generalized Gaussian distribution in Eq. (7) is more general and captures more complex characteristics. Given δ and ε, covariance matrix bΣ can be estimated using iterative reweighed methods [3, 43], and specifically, for the j-th iteration bΣj = 1 L L X l=1 Ld qj l + (qj l )1−δ P k̸=l(qj k)δ · xT l xl = 1 L L X l=1 fj(xl) · xT l xl = XT bGjX, (8) where qj l = xl bΣj−1xT l and bGj is a diagonal matrix with diagonal elements being {fj(x1)/L, . . . , fj(xL)/L}. It is worth mentioning at this point that our parametric SOP in Eq. (6) learns a more informative, full matrix, instead of only the diagonal one in traditional iterative reweighted methods [3, 43]. Obviously our parametric SOP in Eq. (6) can be regarded as single step of iterative estimation. To accomplish multi-step iterative estimation, we can learn a sequence of parameters Qj, j = 1, . . . , J. After that, we perform matrix square-root normalization to obtain better performance. In practice we adopt two-step estimation (i.e., J = 2) to balance efficiency and effectiveness. We mention that implementation of each one of the two step estimation (i.e., PjX) in Eq. (6) can be conveniently implemented using 1 × 1 convolution. As a result, our parametric SR-SOP can be transformed into learning multiple sequential 1 × 1 convolution operations following by computation of SR-SOP. Fast Iterative Algorithm The computation of matrix square root in our parametric SR-SOP depends on EIG, which is limited supported on GPU, slowing down training speed of the whole network. Therefore, we employ the recently proposed iterative method [26] to speed up computing matrix square root. This method is based on Newton-Schulz iteration [14], which computes approximate matrix square root through iterative matrix multiplications as Σ 1 2 ≈A ˜ J : {A˜j = 1 2A˜j−1(3I −B˜j−1A˜j−1); B˜j = 1 2(3I −B˜j−1A˜j−1)B˜j−1}˜j:=1,··· , ˜ J, (9) where A0 = Σ and B0 = I. Clearly, Eq. (9) involves only matrix multiplications, more suitable for GPU implementation, and its back-propagation algorithm can be derived based on matrix backpropagation method [20]. Readers can refer to [26] for more details. 2.3 Deep CNN with GM-SOP The overview of deep CNNs with our GM-SOP is illustrated in Figure 1. Notably, the proposed GMSOP, rather than global average pooling or second-order pooling, is inserted after the last convolution layer. In our GM-SOP, the outputs of the last convolution layer are simultaneously fed into sparsityconstrained gating module and the bank of parametric CMs. In terms of the Top-K results, the gating module allocates individual training samples to different CMs, and for each sample the final representation is a weighted sum of the outputs of K selected CMs. We add a batch normalization [18] layer and a dropout [35] layer with drop rate of 0.2 after final representation. Finally, we use a fully-connected layer and a softmax layer for classification. The sparsity-constrained gating module is composed of prediction layers, Top-K and softmax operations, where the prediction layers share the same architecture with CMs to keep pace with representation. The parametric SR-SOP contains a set of convolution operations and iterative matrix multiplications. Clearly back-propagation of all involved layers can be accomplished according to traditional chain rule and matrix back-propagation method [20], and thus the deep CNNs with GM-SOP can be trained in an end-to-end manner. 3 Experiments To evaluate the proposed method, we conduct experiments on two large-scale image benchmarks, i.e., downsampled ImageNet-1K [6] and Places365 [44]. We first describe implementation details of different competing methods, and then assess the effect of key parameters on our method using downsampled ImageNet-1K. Finally, we report the comparison results on two benchmarks. 5 Table 1: Modified ResNet-18 and ResNet-50 for downsampled ImageNet-1K and Places365. conv1 conv2_x conv3_x conv4_x conv5_x ResNet-18 3 × 3, 16 (stride=1)  3 × 3, 16 3 × 3, 16  × 2  3 × 3, 32 3 × 3, 32  × 2  3 × 3, 64 3 × 3, 64  × 2  3 × 3, 128 3 × 3, 128  × 2 GAP ResNet-50 3 × 3, 16 (stride=1)  3 × 3, 16 3 × 3, 16  × 6  3 × 3, 32 3 × 3, 32  × 6  3 × 3, 64 3 × 3, 64  × 6  3 × 3, 128 3 × 3, 128  × 6 GAP Output Size 64 × 64 64 × 64 32 × 32 16 × 16 8 × 8 ImageNet-1K 96 × 96 96 × 96 48 × 48 24 × 24 12 × 12 Places365 3.1 Implementation Details In this work, we implement several methods for comparison, and consider two basic CNN models including ResNet [13] of 18 and 50 layers. All competing methods are described as follows. (1) ResNet-18/ResNet-50 indicate original ResNets with first-order GAP. (2) ResNet-18-Xd/ResNet-50-Xd denote ResNets with a parametric GAP, which is achieved by inserting a 1 × 1 × X convolution layer before GAP. Such method can be regarded as a special case of gated mixture of first-order GAP with single CM. (3) Ave-GAP-K performs simple average of K parametric GAPs without gating module. (4) GM-GAP-N-K selects K parametric GAPs from N GAP candidates through sparsity-constrained gating module, and performs weighted sum of K selected parametric GAPs. (5) Parametric SR-SOP is achieved by adding two convolution layers of {1 × 1 × 128 × 256} and {1 × 1 × 256 × 128} before SR-SOP. (6) Ave-SOP-K performs simple average of K parametric SR-SOPs without gating module. (7) GM-SOP-N-K selects K parametric SR-SOP models from N candidates with sparsity-constrained gating module, and performs weighted sum of K selected candidates. In our experiments, image sizes of downsampled ImageNet-1K and Places365 respectively are 64 × 64 and 100 × 100, so we modify ResNet architectures in [13] to fit image sizes in our case. The architectures of modified ResNet-18 and ResNet-50 are given in Table 1. As suggested in [26], we compute approximate matrix square root in Eq. (9) within five iterations to balance the effectiveness and efficiency. For training the whole network, we employ mini-batch stochastic gradient descent with batchsize of 256 and momentum of 0.9. The parameter of weight decay is set to 5e-4. The program is implemented using MatConvNet toolkit [37], and runs on a PC equipped with an Intel i7-4790K@4.00GHz CPU, a single NVIDIA GeForce GTX1080 GPU and 64G RAM. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 No. of CM 0 5 Num. of Samples 105 =0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 No. of CM 0 5 10 Num. of Samples 104 =100 0 1 10 100 1000 42.5 43 43.5 44 44.5 Top-1 error (%) Figure 2: Left: Numbers of receiving samples in each CM by setting α = 0 and α = 100. α = 0 indicates balance loss is not employed. Right: Results of GM-GAP-16-4 with various α. 3.2 Ablation Studies on Downsampled ImageNet-1K Our gated mixture model has three key parameters, i.e., weight parameter α of balance loss in Eq. (4), number of CMs (N) and number of selected CMs (K). We evaluate them using gated mixture of first-order GAP with ResNet-18 on downsampled ImageNet-1K, and the decided optimal parameters are directly adopted to GM-SOP. Such strategy is not only faster but also avoids over-fitting on parameters of GM-SOP. We train the networks on downsampled ImageNet-1K dataset [6] within 6 (1,1) (2,4) (2,8) (4,8) (4,16) (8,16) (12,16)(16,16) (4,32) (8,32) (K,N) 40 42.5 45 47.5 50 Top-1 error (%) Top-1 error (%) 0 500 1000 1500 FPS (Hz) FPS (Hz) Figure 3: GM-GAP with various N and K. Methods Dim. of Reps. Top-1 error (%) ResNet-18 128 52.00 ResNet-18-512d 512 49.08 Ave-GAP-16 512 47.44 GM-GAP-16-8 (Ours) 512 42.37 ResNet-18-8256d 8256 47.29 SR-SOP 8256 40.32 Ave-SOP-16 8256 40.28 Parametric SR-SOP 8256 40.01 GM-SOP-16-8 (Ours) 8256 38.21 Table 2: Comparison with counterparts using ResNet-18 on downsampled ImageNet-1K. Table 3: Comparison with state-of-the-arts on downsampled ImageNet-1K. The methods marked by ⋆double number of training images using original images and their horizontal flipping ones, and perform 4 pixels padding and random crop in both training and prediction stages. Methods Number of Parameters Dimension of Representations Top-1 error/Top-5 error (%) WRN-36-1⋆[6] 1.6M 128 49.79/24.17 WRN-36-2⋆[6] 6.2M 256 39.55/16.57 WRN-36-5⋆[6] 37.6M 640 32.34/12.64 ResNet-18-512d [13] 1.3M 512 49.08/24.25 ResNet-18+One-layer-SG-MOE [33] 2.3M 512 46.80/22.63 ResNet-18+NetVLAD [1] 8.9M 8192 45.16/21.73 ResNet-50 [13] 2.4M 128 43.28/19.39 ResNet-50-512d [13] 2.8M 512 41.79/18.30 ResNet-50-8256d [13] 11.6M 8256 41.42/18.14 GM-GAP-16-8 + ResNet-18 (Ours) 2.3M 512 42.37/18.82 GM-GAP-16-8 + ResNet-18⋆(Ours) 2.3M 512 40.03/17.91 GM-GAP-16-8 + WRN-36-2 (Ours) 8.7M 512 35.97/14.41 GM-SOP-16-8 + ResNet-18 (Ours) 10.3M 8256 38.21/17.01 GM-SOP-16-8 + ResNet-50 (Ours) 11.9M 8256 35.73/14.96 GM-SOP-16-8 + WRN-36-2 (Ours) 15.7M 8256 32.33/12.35 {50, 15, 10} epochs, while the initial learning rate is set to 0.075 with decay rate of 0.1. Only random flipping is used for data augmentation, and prediction is performed on whole images. Following the common settings in [13, 6], we run experiments three trials and report Top-1 error of different methods on validation set for comparison. Effect of Parameter α The goal of balance loss is to make as many CMs as possible be adequately trained. Here we evaluate its effect using GM-GAP-16-4 with various α. Figure 2 (Left) compares numbers of receiving samples in each CM by setting α = 0 and α = 100 within the last training epoch, where α = 0 indicates balance loss is discarded. Clearly, only four CMs receive almost all training samples when balance loss is not employed (i.e., α = 0). Differently, the balance loss with α = 100 makes most of CMs receive similar amount of training samples. Figure 2 (Right) shows the results of GM-GAP-16-4 with various α, from it we can see that adequately training as many CMs as possible achieves lower classification error. The balance loss with α = 100, 1000 obtain similar results. Without loss of generality, we set parameter α to 100 in following experiments. Numbers of N and K Then we assess the effect of numbers of N and K by setting α = 100. Top-1 error and training speed (Frames Per Second, FPS) of GM-GAP with various N and K are illustrated in Figure 3. Fixing number of K, increase of N leads lower error while bringing more computational costs. When number of N is fixed, better results are obtained by appropriately enlarging K. Taking N = 16 as an example, K = 8 gets the best result, and results of K = 12 and K = 16 are slightly inferior to the one of K = 8. It maybe owe to the fact that sparsity constraint eliminates noisy CMs having small weights. In addition, we can see that GM-GAP with N = 16, K = 8 (42.37%, 800Hz) employing 16 CMs is only about 1.8 times slower than baseline (49.08%, 1470Hz) with one CM, but achieves about 6.71% gains. We also experiment with more CMs. GM-GAP with N=128 and K=32 obtains 42.52%, achieving no gain over the result of N=16 and K=8 (42.37%). We observe larger number (128) of CMs leads to a bit over-fitting in our case and more computation cost. To balance efficiency and effectiveness, we set N = 16 and K = 8 for both GM-GAP and GM-SOP throughout all remaining experiments. 7 Table 4: Comparison with counterparts on Places365 dataset with image size of 100 × 100. ResNet-18-512d GM-GAP-16-8 ResNet-18-8256d SR-SOP Parametric SR-SOP GM-SOP-16-8 Dim. 512 512 8256 8256 8256 8256 Top-1 error (%) 49.96 48.07 49.99 48.11 47.48 47.18 Top-5 error (%) 19.19 17.84 19.32 18.01 17.52 17.02 Comparison with Counterparts We compare our method with several counterparts, and results of different methods are listed in Table 2. We train SR-SOP (or parametric SR-SOP) and Ave-SOP-16 (or GM-SOP-16-8) within {20, 5, 5, 5} and {40, 10, 5, 5} epochs. The initial learning rates are set to 0.15 and 0.1 with decay rate of 0.1. When employing GAP as CM, our GM-GAP is superior to ResNet-18-512d (single CM) and Ave-GAP-16 (direct ensemble) by a large margin. Meanwhile, SR-SOP performs better than GM-GAP, and improves ResNet-18-8256d by 6.97% with the same dimensional representation, demonstrating superiority of SOP. Note that our parametric SR-SOP outperforms original SR-SOP with negligible additional costs (680Hz vs. 670Hz), and they are moderately slower than GM-GAP-16-8 (800Hz). The GM-SOP-16-8 outperforms Ave-SOP-16 by 2.07% with more than 2 times faster, and improves SR-SOP by about 2.11% with about 2 times slower. The above results verify the effectiveness of our GM-SOP and idea of gated mixture model. 3.3 Results on Downsampled ImageNet-1K Here we compare our method with state-of-the-art (SOTA) methods on downsampled ImageNet-1K [6]. Since this dataset is recently proposed and has few reported results, we implement several SOTA methods based on the modified ResNet-18 and ResNet-50 by ourselves and report their results with trying our best to tune their hyper-parameters. NetVLAD [1] is implemented using public available source code with setting dictionary size to 64. By using the same settings with GM-GAP, we replace GAP with One-layer-SG-MoE [33], where each expert is a 128 × 512 fully-connected layer. All ResNet-50 based methods are trained within {50, 15, 10} epochs, and initial learning rates with decay rate of 0.1 are set to 0.1 and 0.075 for our GM-SOP and remaining ones, respectively. We also compare with wide residual network (WRN) [42], whose results are duplicated from [6]. As shown in Table 3, our GM-SOP and GM-GAP significantly outperform NetVLAD, One-layer-SG-MoE and original network, when ResNet-18 is employed. Meanwhile, our GM-SOP with ResNet-50 improves original network and its variants by a large margin. These results verify our methods effectively improve existing deep CNNs. Our GM-SOP with ResNet-18 clearly outperforms WRN-36-1 and WRN-36-2, although the latter ones adopt more sophisticated data augmentation. By using the same augmentation strategy in [6], GM-GAP-16-8 achieves over 2% gains in Top-1 error, which uses much less parameters to get simliar results with WRN-36-2. To further evaluate our methods, we integrate the proposed methods with the stronger WRN-36-2, our GM-GAP and GM-GOP improve WRN-36-2 over 3.58% and 7.22% in Top-1 error, respectively. Note that GM-SOP with WRN-36-2 obtains the similar result with WRN-36-5 [6] using one half parameters. 3.4 Results on Places365 Finally, we evaluate our method on Places365 [44], which contains about 1.8 million training images and 36,500 validation images collected from 365 scene categories. In our experiments, we resize all images to 100 × 100, developing a downsampled Places365 dataset. It is much larger and more challenging than existing low-resolution image datasets [24, 6]. We implement several counterparts and compare with our method based on ResNet-18. For training these networks, we randomly crop a 96 × 96 image patch or its flip as input. ResNet-18-8256d and remaining ones are trained within {35, 10, 10, 5} and {25, 5, 5, 5} epochs, and the initial learning rates are set to 0.05 and 0.1 with decay rate of 0.1, respectively. The inference is performed on single center crop, and we report results on validation set for comparison. The results of different methods are given in Table 4, from it we can see that our GM-SOP-16-8 achieves the best result and significantly outperforms ResNet-18-512d and ResNet-18-8256d, further demonstrating the effectiveness of GM-SOP. Meanwhile, GM-GAP-16-8 and GM-SOP-16-8 are superior to ResNet-18-512d and SR-SOP by a large margin, respectively. It indicates the idea of gated mixture model is helpful for improving representation ability of deep CNNs. Note that parametric SR-SOP for non-trivial gains over original SR-SOP, showing a more general approach for image modeling is meaningful and useful for improving performance. 8 4 Related Work Our GM-SOP method shares similarity with sparsely-gated mixture-of-experts (SG-MoE) layer [33]. The SG-MoE motivates the gating module of our GM-SOP, but quite differently, our GM-SOP proposes a parametric SR-SOP as CM while SG-MoE employs a linear transformation (fullyconnected layer) as expert. Meanwhile, our methods significantly outperform one SG-MoE layer. Additionally, the SG-MoE is proposed as a general purpose component in a recurrent model [15], while our GM-SOP is proposed as a global modeling step to improve representation ability of deep CNNs. This work also is related to those methods integrating single HOP into deep CNNs [19, 29, 39, 27, 8]. Beyond them, our GM-SOP is a mixture model, which can capture richer information and achieve better performance. NetVLAD [1] and MFAFVNet [28] extend deep CNNs with popular feature encoding methods, which also can be seen as mixture models. However, different from their concatenation scheme for all CMs, our GM-SOP performs sum of selected CMs, leading more compact representations. Meanwhile, our GM-SOP is clearly superior to feature encoding based NetVLAD [1]. Recently, some researchers propose to learn deep mixture probability models for semi-supervised learning [31] and unsupervised clustering [38]. These methods formulate mixture probability models as multi-layer networks, and infer the corresponding networks with deriving variants of EM algorithm. In contrary to deep mixture probability models [31, 38], we aim at plugging a trainable gated mixture model into deep CNNs as representation for supervised classification. 5 Conclusion This paper proposes a novel GM-SOP method for improving deep CNNs, whose core is a trainable gated mixture of parametric second-order pooling model for summarizing the outputs of the last convolution layer as image representation. The GM-SOP can be flexibly integrated into deep CNNs in an end-to-end manner. Compared with popular GAP and existing HOP methods only considering unimodal distributions, our GM-SOP can make better use of statistical information inherent in convolutional activations, leading better representation ability and higher accuracy. The experimental results on two large-scale image benchmarks demonstrate the gated mixture model is helpful to improve classification performance of deep CNNs, and our GM-SOP method clearly outperforms its counterparts with affordable costs. Note that the proposed GM-SOP is an architecture-independent model, so we can flexibly adopt it to other advanced CNN architectures [17, 5, 16]. In future, we will experiment with standard-size ImageNet dataset, and extend GM-SOP to other tasks, such as video classification and semantic segmentation. Acknowledgments The work was supported by the National Natural Science Foundation of China (Grant No. 61471082, 61671182, 61806140) and the State Key Program of National Natural Science Foundation of China (Grant No. 61732011). Qilong Wang was supported by China Post-doctoral Programme Foundation for Innovative Talent. We thank NVIDIA corporation for donating GPU. References [1] R. Arandjelovic, P. Gronat, A. Torii, T. Pajdla, and J. Sivic. NetVLAD: CNN architecture for weakly supervised place recognition. In CVPR, 2016. [2] V. Arsigny, P. Fillard, X. Pennec, and N. Ayache. Fast and simple calculus on tensors in the Log-Euclidean framework. In MICCAI, 2005. [3] O. Arslan. Convergence behavior of an iterative reweighting algorithm to compute multivariate M-estimates for location and scatter. Journal of Statistical Planning and Inference, 118:115–128, 2004. [4] J. Carreira, R. Caseiro, J. Batista, and C. Sminchisescu. Free-form region description with second-order pooling. IEEE TPAMI, 37(6):1177–1189, 2015. [5] Y. Chen, J. Li, H. Xiao, X. Jin, S. Yan, and J. Feng. Dual path networks. In NIPS, 2017. [6] P. Chrabaszcz, I. Loshchilov, and F. Hutter. A downsampled variant of ImageNet as an alternative to the CIFAR datasets. arXiv, abs/1707.08819, 2017. [7] M. Cimpoi, S. Maji, and A. Vedaldi. Deep filter banks for texture recognition and segmentation. In CVPR, 2015. [8] Y. Cui, F. Zhou, J. Wang, X. Liu, Y. Lin, and S. Belongie. Kernel pooling for convolutional neural networks. In CVPR, 2017. 9 [9] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. ImageNet: A large-scale hierarchical image database. In CVPR, 2009. [10] D. L. Donoho, M. Gavish, and I. M. Johnstone. Optimal shrinkage of eigenvalues in the spiked covariance model. arXiv, 1311.0851, 2014. [11] L. Dryden, A. Koloydenko, and D. Zhou. Non-Euclidean statistics for covariance matrices, with applications to diffusion tensor imaging. The Annals of Applied Statistics, 2009. [12] B. S. Everitt and D. J. Hand. Finite mixture distributions. Springer Press, 1981. [13] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In CVPR, 2016. [14] N. J. Higham. Functions of Matrices: Theory and Computation. Society for Industrial and Applied Mathematics, Philadelphia, PA, USA, 2008. [15] S. Hochreiter and J. Schmidhuber. Long short-term memory. Neural Computation, 9(8):1735–1780, 1997. [16] J. Hu, L. Shen, and G. Sun. Squeeze-and-excitation networks. In CVPR, 2018. [17] G. Huang, Z. Liu, L. van der Maaten, and K. Q. Weinberger. Densely connected convolutional networks. In CVPR, 2017. [18] S. Ioffe and C. Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, 2015. [19] C. Ionescu, O. Vantzos, and C. Sminchisescu. Matrix backpropagation for deep networks with structured layers. In ICCV, 2015. [20] C. Ionescu, O. Vantzos, and C. Sminchisescu. Training deep networks with structured layers by matrix backpropagation. arXiv, abs/1509.07838, 2015. [21] R. A. Jacobs, M. I. Jordan, S. J. Nowlan, and G. E. Hinton. Adaptive mixtures of local experts. Neural Computation, 3(1):79–87, 1991. [22] M. I. Jordan and R. A. Jacobs. Hierarchical mixtures of experts and the EM algorithm. Neural Computation, 6(2):181–214, 1994. [23] P. Koniusz, F. Yan, P. Gosselin, and K. Mikolajczyk. Higher-order occurrence pooling for bags-of-words: Visual concept detection. IEEE TPAMI, 39(2):313–326, 2017. [24] A. Krizhevsky. Learning multiple layers of features from tiny images. Technical report, 2009. [25] A. Krizhevsky, I. Sutskever, and G. E. Hinton. ImageNet classification with deep convolutional neural networks. In NIPS, 2012. [26] P. Li, J. Xie, Q. Wang, and Z. Gao. Towards faster training of global covariance pooling networks by iterative matrix square root normalization. In CVPR, 2018. [27] P. Li, J. Xie, Q. Wang, and W. Zuo. Is second-order information helpful for large-scale visual recognition? In ICCV, 2017. [28] Y. Li, M. Dixit, and N. Vasconcelos. Deep scene image classification with the MFAFVNet. In ICCV, 2017. [29] T.-Y. Lin, A. RoyChowdhury, and S. Maji. Bilinear CNN models for fine-grained visual recognition. In ICCV, 2015. [30] G. McLachlan and D. Peel. Finite Mixture Models. Wiley Press, 2005. [31] M. T. Nguyen, W. Liu, E. Perez, R. G. Baraniuk, and A. B. Patel. Semi-supervised learning with the deep rendering mixture model. arXiv, abs/1612.01942, 2016. [32] F. Pascal, L. Bombrun, J. Tourneret, and Y. Berthoumieu. Parameter estimation for multivariate generalized Gaussian distributions. IEEE TSP, 61(23):5960–5971, 2013. [33] N. Shazeer, A. Mirhoseini, K. Maziarz, A. Davis, Q. V. Le, G. E. Hinton, and J. Dean. Outrageously large neural networks: The sparsely-gated mixture-of-experts layer. In ICLR, 2017. [34] K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. In ICLR, 2015. [35] N. Srivastava, G. E. Hinton, A. Krizhevsky, I. Sutskever, and R. Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. JMLR, 15(1):1929–1958, 2014. [36] C. Szegedy, W. Liu, Y. Jia, P. Sermanet, S. Reed, D. Anguelov, D. Erhan, V. Vanhoucke, and A. Rabinovich. Going deeper with convolutions. In CVPR, 2015. [37] A. Vedaldi and K. Lenc. MatConvNet – Convolutional Neural Networks for MATLAB. In ACM MM, 2015. [38] C. Viroli and G. J. McLachlan. Deep Gaussian mixture models. arXiv, abs/1711.06929, 2017. [39] Q. Wang, P. Li, and L. Zhang. G2DeNet: Global Gaussian distribution embedding network and its application to visual recognition. In CVPR, 2017. [40] Q. Wang, P. Li, W. Zuo, and L. Zhang. RAID-G: Robust estimation of approximate infinite dimensional Gaussian with application to material recognition. In CVPR, 2016. [41] J. Wright, A. Y. Yang, A. Ganesh, S. S. Sastry, and Y. Ma. Robust face recognition via sparse representation. IEEE TPAMI, 31(2):210–227, 2009. [42] S. Zagoruyko and N. Komodakis. Wide residual networks. In BMVC, 2016. [43] T. Zhang, A. Wiesel, and M. S. Greco. Multivariate generalized Gaussian distribution: Convexity and graphical models. IEEE TSP, 61(16):4141–4148, 2013. [44] B. Zhou, A. Lapedriza, A. Khosla, A. Oliva, and A. Torralba. Places: A 10 million image database for scene recognition. IEEE TPAMI, 40(6):1452–1464, 2017. 10
2018
109
7,263
Identification and Estimation Of Causal Effects from Dependent Data Eli Sherman Department of Computer Science Johns Hopkins University Baltimore, MD 21218 esherman@jhu.edu Ilya Shpitser Department of Computer Science Johns Hopkins University Baltimore, MD 21218 ilyas@cs.jhu.edu Abstract The assumption that data samples are independent and identically distributed (iid) is standard in many areas of statistics and machine learning. Nevertheless, in some settings, such as social networks, infectious disease modeling, and reasoning with spatial and temporal data, this assumption is false. An extensive literature exists on making causal inferences under the iid assumption [17, 11, 26, 21], even when unobserved confounding bias may be present. But, as pointed out in [19], causal inference in non-iid contexts is challenging due to the presence of both unobserved confounding and data dependence. In this paper we develop a general theory describing when causal inferences are possible in such scenarios. We use segregated graphs [20], a generalization of latent projection mixed graphs [28], to represent causal models of this type and provide a complete algorithm for nonparametric identification in these models. We then demonstrate how statistical inference may be performed on causal parameters identified by this algorithm. In particular, we consider cases where only a single sample is available for parts of the model due to full interference, i.e., all units are pathwise dependent and neighbors’ treatments affect each others’ outcomes [24]. We apply these techniques to a synthetic data set which considers users sharing fake news articles given the structure of their social network, user activity levels, and baseline demographics and socioeconomic covariates. 1 Introduction The assumption of independent and identically distributed (iid) samples is ubiquitous in data analysis. In many research areas, however, this assumption simply does not hold. For instance, social media data often exhibits dependence due to homophily and contagion [19]. Similarly, in epidemiology, data exhibiting herd immunity is likely dependent across units. Likewise, signal processing and sequence learning often consider data that are spatially [8] or temporally [23] dependent. In causal inference, dependence in data often manifests as interference wherein some units’ treatments may causally affect other units’ outcomes [3, 9]. Herd immunity is a canonical example of interference since other subjects’ vaccination status causally affects the likelihood of a particular subject contracting a disease. Even under the iid assumption, making causal inferences from observed data is difficult due to the presence of unobserved confounding. This difficulty is worsened when interference is present, as described in detail in [19]. In general, these difficulties prevent identification of causal parameters of interest, making estimation of these parameters from data an ill-posed problem. An extensive literature on identification of causal parameters (under the iid assumption) has been developed. The g-formula [17] identifies any interventional distribution in directed acylcic graph-based (DAG) causal models without latent variables. Pearl showed that in certain cases identification is 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. possible even in the presence of unobserved confounding via the front-door criterion [11]. These results were generalized into a complete identification theory in hidden variable causal DAG models via the ID algorithm [26, 21]. An extensive theory of estimation of identified causal parameters has been developed. Some approaches are described in [17, 18], although this is far from an exhaustive list. While work on identification and estimation of causal parameters under interference exists [3, 25, 9, 14, 13, 7, 1], no general theory has been developed up to now. In this paper, we aim to provide this theory for a general class of causal models that permit interference. 2 A Motivating Example To motivate subsequent developments, we introduce the following example application. Consider a large group of internet users, belonging to a set of online communities, perhaps based on shared hobbies or political views. For each user i, their time spent online Ai is influenced by their observed vector of baseline factors Ci, and unobserved factors Ui. In addition, each user maintains a set of friendship ties with other users via an online social network. The user’s activity level in the network, Mi, is potentially dependent on the user’s friends’ activities, meaning that for users j and k, Mj and Mk are potentially dependent. The dependence between M variables is modeled as a stable symmetric relationship that has reached an equilibrium state. Furthermore, activity level Mi for user i is influenced by observed factors Ci, time spent online Ai, and the time spent online Aj of any unit j who is a friend of i. Finally, we denote user i’s sharing behavior by Yi. This behavior is influenced by the social network activity of the unit, and possibly the unit friends’ time spent online. A crucial assumption in our example is that for each user i, purchasing behavior Yi is causally influenced by baseline characteristics Ci, social network activity Mi, and unobserved characteristics Ui, but time spent online Ai does not directly influence sharing Yi, except as mediated by social network activity of the users. While this might seem like a rather strong assumption, it is more reasonable than standard “front-door” assumptions [12] in the literature, since we allow the entire social network structure to mediate the influence Ai on Yi for every user. We are interested in predicting how a counterfactual change in a set of users’ time spent online influences their purchasing behavior. Note that solving this problem from observed data on users as we described is made challenging both by the fact that unobserved variables causally affect both community membership and sharing, creating spurious correlations, and because social network membership introduces dependence among users. In particular, for realistic social networks, every user’s activity potentially depends on every other user’s activity (even if indirectly). This implies that a part of the data for this problem may effectively consist of a single dependent sample [24]. In the remainder of the paper we formally describe how causal inference may be performed in examples like above, where both unobserved confounding and data dependence are present. In section 3 we review relevant terminology and notation, give factorizations defining graphical models, describe causal inference in models without hidden variables, and give identification theory for such models in terms of a modified factorization. We also introduce the dependent data setting we will consider. In section 4 we describe more general nested factorizations [16] applicable to marginals obtained from hidden variable DAG models, and describe identification theory in causal models with hidden variables in terms of a modified nested factorization. In section 5, we introduce causal chain graph models [6] as a way of modeling causal problems with interference and data dependence, and pose the identification problem for interventional distributions in such models. In section 6 we give a sound and complete identification algorithm for interventional distributions in a large class of causal chain graph models with hidden variables, which includes the above example, but also many others. We describe our experiments, which illustrate how identified functionals given by our algorithm may be estimated in practice, even in full interference settings where all units are mutually dependent, in section 7. Our concluding remarks are found in section 8. 3 Background on Causal Inference And Interference Problems 3.1 Graph Theory We will consider causal models represented by mixed graphs containing directed (→), bidirected (↔) and undirected (−) edges. Vertices in these graphs and their corresponding random variables will be used interchangeably, denoted by capital letters, e.g. V ; values, or realizations, of vertices 2 A1 C1 M1 Y1 A2 C2 M2 Y2 U1 U2 (a) U1 A1 Y1 U2 A2 Y2 (b) A1 C1 M1 Y1 A2 C2 M2 Y2 (c) C2 M2 Y2 C1 M1 (d) A1 C1 m1 Y1 A2 C2 m2 Y2 (e) Figure 1: (a) A causal model representing the effect of community membership on article sharing, mediated by social network structure. (b) A causal model on dyads which is a variation of causal models of interference considered in [9]. (c) A latent projection of the CG in (a) onto observed variables. (d) The graph representing GY∗for the intervention operation do(a1) applied to (c). (e) The ADMG obtained by fixing M1, M2 in (c). and variables will be denoted by lowercase letters, e.g. v; bold letters will denote sets of variables or values e.g. V or v. We will denote the state space of a variable V or a set of variables V as XV , and XV. Unless stated otherwise, all graphs will be assumed to have a vertex set denoted by V. For a mixed graph G of the above type, we denote the standard genealogic sets for a variable V ∈V as follows: parents paG(V ) ≡{W ∈V|W →V }, children chG(V ) ≡{W ∈V|V →W}, siblings sibG(V ) ≡{W ∈V|W ↔V }, neighbors nbG(V ) ≡{W ∈V|W −V }, ancestors anG(V ) ≡{W ∈V|W →· · · →V }, descendants deG(V ) ≡{W ∈V|V →· · · →W}, and non-descendants ndG(V ) ≡V \ deG(V ). We define the anterior of V , or antG(V ), to be the set of all vertices with a partially directed path (a path containing only →and −edges such that no −edge can be oriented to induce a directed cycle) into V . These relations generalize disjunctively to sets, for instance for a set S, paG(S) = S S∈S paG(S). We also define the set pas G(S) as paG(S) \ S. Given a graph G and a subset S of V, define the induced subgraph GS to be a graph with a vertex set S and all edges in G between elements in S. Given a mixed graph G, we define a district D to be a maximal set of vertices, where every vertex pair in GD is connected by a bidirected path (a path containing only ↔edges). Similarly we define a block B to be a maximal set of vertices, where every vertex pair in GB is connected by an undirected path (a path containing only −edges). Any block of size at least 2 is called a non-trivial block. We define a maximal clique as a maximal set of vertices pairwise connected by undirected edges. The set of districts in G is denoted by D(G), the set of blocks is denoted by B(G), the set non-trivial blocks is denoted by Bnt(G), and the set of cliques is denoted by C(G). The district of V is denoted by disG(V ). By convention, for any V , disG(V ) ∩deG(V ) ∩anG(V ) ∩antG(V ) = {V }. A mixed graph is called segregated (SG) if it contains no partially directed cycles, and no vertex has both neighbors and siblings, Fig. 1 (c) is an example. In a SG G, D(G) and Bnt(G) partition V. A SG without bidirected edges is called a chain graph (CG) [5]. A SG without undirected edges is called an acyclic directed mixed graph (ADMG) [15]. A CG without undirected edges or an ADMG without bidirected edges is a directed acyclic graph (DAG) [10]. A CG without directed edges is called an undirected graph (UG). Given a CG G, the augmented graph Ga is the UG where any adjacent vertices in G or any elements in paG(B) for any B ∈B(G) are connected by an undirected edge. 3.2 Graphical Models A graphical model is a set of distributions with conditional independences represented by structures in a graph. The following (standard) definitions appear in [5]. A DAG model, or a Bayesian network, is a set of distributions associated with a DAG G that can be written in terms of a DAG factorization: p(V) = Q V ∈V p(V | paG(V )). A UG model, or a Markov random field, is a set of distributions associated with a UG G that can be written in terms of a UG factorization: p(V) = Z−1 Q C∈C(G) ψC(C), where Z is a normalizing constant. A CG model is a set of distributions associated with a CG G that 3 can be written in terms of the following two level factorization: p(V) = Q B∈B(G) p(B| paG(B)), where for each B ∈B(G), p(B| paG(B)) = Z(paG(B))−1 Q C∈C((GB∪paG (B))a);C̸⊆paG(B) ψC(C). 3.3 Causal Inference and Causal Models A causal model of a DAG is also a set of distributions, but on counterfactual random variables. Given Y ∈V and A ⊆V \ {Y }, a counterfactual variable, or ‘potential outcome’, written as Y (a), represents the value of Y in a hypothetical situation where a set of treatments A is set to values a by an intervention operation [12]. Given a set Y, define Y(a) ≡{Y}(a) ≡{Y (a) | Y ∈Y}. The distribution p(Y(a)) is sometimes written as p(Y|do(a)) [12]. Causal models of a DAG G consist of distributions defined on counterfactual random variables of the form V (a) where a are values of paG(V ). In this paper we assume Pearl’s functional model for a DAG G with vertices V, where V (a) are determined by structural equations fV (a, ϵV ), which remain invariant under any possible intervention on a, with ϵV an exogenous disturbance variable which introduces randomness into V even after all elements of paG(V ) are fixed. Under Pearl’s model, the distribution p({ϵV |V ∈V}) is assumed to factorize as Q V ∈V p(ϵV ). This implies that the sets of variables {{V (aV ) | aV ∈XpaG(V )} | V ∈V} are mutually independent [12]. The atomic counterfactuals in the above set model the relationship between paG(V ), representing direct causes of V , and V itself. From these, all other counterfactuals may be defined using recursive substitution. For any A ⊆V \ {V }, V (a) ≡V (apaG(V )∩A, {paG(V ) \ A}(a)). For example, in the DAG in Fig. 1 (b), Y1(a1) is defined to be Y1(a1, U1, A2(U2)). Counterfactual responses to interventions are often compared on the mean difference scale for two values a, a′, representing cases and controls: E[Y (a)] −E[Y (a′)]. This quantity is known as the average causal effect (ACE). A causal parameter is said to be identified in a causal model if it is a function of the observed data distribution p(V). Otherwise the parameter is said to be non-identified. In any causal model of a DAG G, all interventional distributions p(V \ A|do(a)) are identified by the g-formula [17]: p(V \ A|do(a)) = Y V ∈V\A p(V | paG(V )) A=a (1) Note that the g-formula may be viewed as a modified (or truncated) DAG factorization, with terms corresponding to elements in A missing. 3.4 Modeling Dependent Data So far, the causal and statistical models we have introduced assumed data generating process that produce independent samples. To capture examples of the sort we introduced in section 2, we must generalize these models. Suppose we analyze data with M blocks with N units each. It is not necessary to assume that blocks are equally sized for the kinds of problems we consider, but we make this assumption to simplify our notation. Denote the variable Y for the i’th unit in block j as Y j i . For each block j, let Yj ≡(Y j 1 , . . . , Y j N), and let Y ≡(Y1, . . . , YM). In some cases we will not be concerned with units’ block memberships. In these cases we will accordingly omit the superscript and the subscript will index the unit with respect to all units in the network. We are interested in counterfactual responses to interventions on A, treatments on all units in all blocks. For any a ∈XA, define Y j i (a) to be the potential response of unit i in block j to a hypothetical treatment assignment of a to A. We define Yj(a) and Y(a) in the natural way as vectors of responses, given a hypothetical treatment assignment to a, either for units in block j or for all units, respectively. Let a(j) be a vector of values of A, where values assigned to units in block j are free variables, and other values are bound variables. Furthermore, for any ˜aj ∈XAj, let a(j)[˜aj] be a vector of values which agrees on all bound values with a(j), but which assigns ˜aj to all units in block j (e.g. which binds free variables in a(j) to ˜aj). A commonly made assumption is interblock non-interference, also known as partial interference in [22, 25], where for any block j, treatments assigned to units in a block other than j do not affect the responses of any unit in block j. Formally, this is stated as (∀j, a(j), a′(j), ˜aj), Yj(a(j)[˜aj]) = Yj(a′(j)[˜aj]). Counterfactuals under this assumption are written in a way that emphasizes they only depend on treatments assigned within that block. That is, for any a(j), Yj(a(j)[˜aj]) ≡Yj(˜aj). 4 In this paper we largely follow the convention of [9], where variables corresponding to distinct units within a block are shown as distinct vertices in a graph. As an example, Fig. 1 (b) represents a causal model with observed data on multiple realizations of dyads or blocks of two dependent units [4]. Note that the arrow from A2 to Y1 in this model indicates that the treatment of unit 2 in a block influences the outcome of unit 1, and similarly for treatment of unit 1 and outcome of unit 2. In this model, a variation of models considered in [9], the interventional distributions p(Y2|do(a1)) = p(Y2|a1) and p(Y1|do(a2)) = p(Y1|a2) even if U1, U2 are unobserved. 4 Causal Inference with Hidden Variables If a causal model contains hidden variables, only data on the observed marginal distribution is available. In this case, not every interventional distribution is identified, and identification theory becomes more complex. However, just as identified interventional distributions were expressible as a truncated DAG factorization via the g-formula (1) in fully observed causal models, identified interventional distributions are expressible as a truncated nested factorization [16] of a latent projection ADMG [28] that represents a class of hidden variable DAGs that share identification theory. In this section we define latent projection ADMGs, introduce the nested factorization with respect to an ADMG in terms of a fixing operator, and re-express the ID algorithm [27, 21] as a truncated nested factorization. 4.1 Latent Projection ADMGs Given a DAG G(V ∪H), where V are observed and H are hidden variables, a latent projection G(V) is the following ADMG with a vertex set V. An edge A →B exists in G(V) if there exists a directed path from A to B in G(V ∪H) with all intermediate vertices in H. Similarly, an edge A ↔B exists in G(V) if there exists a path without consecutive edges →◦←from A to B with the first edge on the path of the form A ←and the last edge on the path of the form →B, and all intermediate vertices on the path in H. As an example of this operation, the graph in Fig. 1 (c) is the latent projection of Fig. 1 (a). Note that a variable pair in a latent projection G(V) may be connected by both a directed and a bidirected edge, and that multiple distinct hidden variable DAGs G1(V ∪H1) and G2(V ∪H2) may share the same latent projection ADMG. 4.2 The Nested Factorization The nested factorization of p(V) with respect to an ADMG G(V) is defined on kernel objects derived from p(V) and conditional ADMGs derived from G(V). The derivations are via a fixing operation, which can be causally interpreted as a single application of the g-formula on a single variable (to either a graph or a kernel) to obtain another graph or another kernel. 4.2.1 Conditional Graphs And Kernels A kernel qV(V|W) is a mapping from values in W to normalized densities over V [5]. In other words, kernels act like conditional distributions in the sense that P v∈V qV(v|w) = 1, ∀w ∈W. Conditioning and marginalization in kernels are defined in the usual way. For A ⊆V, we define q(A|W) ≡P V\A q(V|W) and q(V \ A|A, W) ≡q(V|W)/q(A|W). A conditional acyclic directed mixed graph (CADMG) G(V, W) is an ADMG in which the nodes are partitioned into W, representing fixed variables, and V, representing random variables. Variables in W have the property that only outgoing directed edges may be adjacent to them. Genealogic relationships generalize from ADMGs to CADMGs without change. Districts are defined to be subsets of V in a CADMG G, e.g. no element of W is in any element of D(G). 4.2.2 Fixability and Fixing A variable V ∈V in a CADMG G is fixable if deG(V ) ∩disG(V ) = ∅. In other words, V is fixable if paths V ↔· · · ↔B and V →· · · →B do not both exist in G for any B ∈V \ {V }. Given a CADMG G(V, W) and V ∈V fixable in G, the fixing operator φV (G) yields a new CADMG G′(V \ {V }|W ∪{V }), where all edges with arrowheads into V are removed, and all other edges in G are kept. Similarly, given a CADMG G(V, W), a kernel qV(V|W), and V ∈V fixable in G, the fixing operator φV (qV; G) yields a new kernel q′ V\{V }(V \ {V }|W ∪{V }) ≡ qV(V|W) qV(V | ndG(V ),W). 5 Note that fixing is a probabilistic operation in which we divide a kernel by a conditional kernel. In some cases this operates as a conditioning operation, in other cases as a marginalization operation, and in yet other cases, as neither, depending on the structure of the kernel being divided. For a set S ⊆V in a CADMG G, if all vertices in S can be ordered into a sequence σS = ⟨S1, S2, . . . ⟩ such that S1 is fixable in G, S2 in φS1(G), etc., S is said to be fixable in G, V\S is said to be reachable in G, and σS is said to be valid. A reachable set C is said to be intrinsic if GC has a single district. We will define φσS(G) and φσS(q; G) via the usual function composition to yield operators that fix all elements in S in the order given by σS. The distribution p(V) is said to obey the nested factorization for an ADMG G if there exists a set of kernels {qC(C | paG(C)) | C is intrinsic in G} such that for every fixable S, and any valid σS, φσS(p(V); G) = Q D∈D(φσS(G)) qD(D| pas G(D)). All valid fixing sequences for S yield the same CADMG G(V \ S, S), and if p(V) obeys the nested factorization for G, all valid fixing sequences for S yield the same kernel. As a result, for any valid sequence σ for S, we will redefine the operator φσ, for both graphs and kernels, to be φS. In addition, it can be shown [16] that the above kernel set is characterized as: {qC(C | paG(C)) | C is intrinsic in G} = {φV\C(p(V); G) | C is intrinsic in G}. Thus, we can re-express the above nested factorization as stating that for any fixable set S, we have φS(p(V); G) = Q D∈D(φS(G)) φV\D(p(V); G). Since fixing is defined on CADMGs and kernels, the definition of nested Markov models generalizes in a straightforward way to a kernel q(V|W) being in the nested Markov model for a CADMG G(V, W). This holds if for every S fixable in G(V, W), φS(q(V|W); G) = Q D∈D(φS(G)) φV\D(q(V|W); G). An important result in [16] states that if p(V ∪H) obeys the factorization for a DAG G with vertex set V ∪H, then p(V) obeys the nested factorization for the latent projection ADMG G(V). 4.3 Identification in Hidden Variable Causal DAGs For any disjoint subsets Y, A of V in a latent projection G(V) representing a causal DAG G(V∪H), define Y∗≡anG(V)V\A(Y). Then p(Y|do(a)) is identified in G if and only if every set D ∈ D(G(V)Y∗) is reachable (in fact, intrinsic). Moreover, if identification holds, we have [16]: p(Y|do(a)) = X Y∗\Y Y D∈D(G(V)Y∗) φV\D(p(V); G(V))|A=a. (2) In other words, p(Y|do(a)) is only identified if it can be expressed as a factorization, where every piece corresponds to a kernel associated with a set intrinsic in G(V). Moreover, no piece in this factorization contains elements of A as random variables, just as was the case in (1). In fact, (2) provides a concise formulation of the ID algorithm [27, 21] in terms of the nested Markov model in which the observed distribution in the causal problem lies. For a full proof, see [16]. 5 Chain Graphs For Causal Inference With Dependent Data We generalize causal models to represent settings with data dependence, specifically to cases where variables may exhibit stable but symmetric relationships. These may correspond to friendship ties in a social network, physical proximity, or rules of infectious disease spread. These stand in contrast to causal relationships which are also stable, but asymmetric. We represent settings with both of these kinds of relationships using causal CG models under the Lauritzen-Wermuth-Freydenburg (LWF) interpretation. Though there are alternative conceptions of chain graphs [2], we concentrate on LWF CGs here. This is because LWF CGs yield observed data distributions with smooth parameterizations. In addition, LWF CGs yield Markov properties where each unit’s friends (and direct causes) screen the unit from other units in the network. This sort of independence is intuitively appealing in many network settings. Extensions of our results to other CG models are likely possible, but we leave them to future work. LWF CGs were given a causal interpretation in [6]. In a causal CG, the distribution p(B| paG(B)) for each block B is determined via a computer program that implements a Gibbs sampler on variables B ∈B, where the conditional distribution p(B|B \ {B}, paG(B)) is determined via a structural equation of the form fB(B \ {B}, paG(B), ϵB). This interpretation of p(B| paG(B)) allows the 6 implementation of a simple intervention operation do(b). The operation sets B to b by replacing the line of the Gibbs sampler program that assigns B to the value returned by fB(B \ {B}, paG(B), ϵB) (given a new realization of ϵB), with an assignment of B to the value b. It was shown [6] that in a causal CG model, for any disjoint Y, A, p(Y|do(a)) is identified by the CG version of the g-formula (1): p(Y|do(a)) = Q B∈B(G) p(B \ A| pa(B), B ∩A)|A=a. In our example above, stable symmetric relationships inducing data dependence, represented by undirected edges, coexist with hidden variables. To represent causal inference in this setting, we generalize earlier developments for hidden variable causal DAG models to hidden variable causal CG models. Specifically, we first define a latent projection analogue called the segregated projection for a large class of hidden variable CGs using segregated graphs (SGs). We then define a factorization for SGs that generalizes the nested factorization and the CG factorization, and show that if a distribution p(V ∪H) factorizes given a CG G(V ∪H) in the class, then p(V) factorizes according to the segregated projection G(V). Finally, we derive identification theory for hidden variable CGs as a generalization of (2) that can be viewed as a truncated SG factorization. 5.1 Segregated Projections Of Latent Variable Chain Graphs Fix a chain graph CG G and a vertex set H such that for all H ∈H, H does not lie in B ∪paG(B), for any B ∈Bnt(G). We call such a set H block-safe. Definition 1 Given a CG G(V ∪H) and a block-safe set H, define a segregated projection graph G(V) with a vertex set V. Moreover, for any collider-free path from any two elements V1, V2 in V, where all intermediate vertices are in H, G(V) contains an edge with end points matching the path. That is, we have V1 ←◦. . . ◦→V2 leads to the edge V1 ↔V2, V1 →◦. . . ◦→V2 leads to the edge V1 →V2, and in G(V). As an example, the SG in Fig. 1 (c) is a segregated projection of the hidden variable CG in Fig. 1 (a). While segregated graphs preserve conditional independence structure on the observed marginal of a CG for any H [20], we chose to further restrict the set H in order to ensure that the directed edges in the segregated projection retain an intuitive causal interpretation of edges in a latent projection [28]. That is, whenever A →B in a segregated projection, A is a causal ancestor of B in the underlying causal CG. SGs represent latent variable CGs, meaning that they allow causal systems that model feedback that leads to network structures, of the sort considered in [6], but simultaneously allow certain forms of unobserved confounding in such causal systems. 5.2 Segregated Factorization The segregated factorization of an SG can be defined as a product of two kernels which themselves factorize, one in terms of a CADMG (a conditional graph with only directed and bidirected arrows), and another in terms of a conditional chain graph (CCG) G(V, W), a CG with the property that the only type of edge adjacent to any element W of W is a directed edge out of W. A kernel q(V|W) is said to be Markov relative to the CCG G(V, W) if q(V|W) = Z(W)−1 Q B∈B(G) q(B| paG(B)), and q(B| paG(B)) = Z(paG(B))−1 Q C∈C((GB∪paG (B))a);C̸⊆paG(B) ψC(C), for each B ∈B(G). We now show, given p(V) and an SG G(V), how to construct the appropriate CADMG and CCG, and the two corresponding kernels. Given a SG G, let district variables D∗be defined as S D∈D(G) D, and let block variables B∗be defined as S B∈Bnt(G) B. Since D(G) and Bnt(G) partition V in a SG, B∗and D∗partition V as well. Let the induced CADMG Gd of a SG G be the graph containing the vertex sets D∗as V and pas G(D∗) as W, and which inherits all edges in G between D∗, and all directed edges from pas G(D∗) to D∗in G. Similarly, let the induced CCG Gb of G be the graph containing the vertex set B∗as V and pas G(B∗) as W, and which inherits all edges in G between B∗, and all directed edges from paG(B∗) to B∗. We say that p(V) obeys the factorization of a SG G(V) if p(V) = q(D∗| pas G(D∗))q(B∗| paG(B∗)), q(B∗| paG(B∗)) is Markov relative to the CCG Gb, and q(D∗| pas G(D∗)) is in the nested Markov model of the CADMG Gd. The following theorem gives the relationship between a joint distribution that factorizes given a hidden variable CG G, its marginal distribution, and the corresponding segregated factorization. This 7 theorem is a generalization of the result proven in [16] relating hidden variable DAGs and latent projection ADMGs. The proof is deferred to the appendix. Theorem 1 If p(V ∪H) obeys the CG factorization relative to G(V ∪H), and H is block-safe then p(V) obeys the segregated factorization relative to the segregated projection G(V). 6 A Complete Identification Algorithm for Latent Variable Chain Graphs With Theorem 1 in hand, we are ready to characterize general non-parametric identification of interventional distributions in hidden variable causal chain graph models, where hidden variables form a block-safe set. This result can be viewed on the one hand as a generalization of the CG g-formula derived in [6], and on the other hand as a generalization of the ID algorithm (2). Theorem 2 Assume G(V ∪H) is a causal CG, where H is block-safe. Fix disjoint subsets Y, A of V. Let Y∗= antG(V)V\A Y. Then p(Y|do(a)) is identified from p(V) if and only if every element in D( eGd) is reachable in Gd, where eGd is the induced CADMG of G(V)Y∗. Moreover, if p(Y|do(a)) is identified, it is equal to X Y∗\Y   Y D∈D( e Gd) φD∗\D(q(D∗| paG(V)(D∗)); Gd)     Y B∈B( e Gb) p(B \ A| paG(V)Y∗(B), B ∩A)   A=a where q(D∗| paG(V)(D∗)) = p(V)/(Q B∈Bnt(G(V)) p(B| paG(V)(B)), and eGb is the induced CCG of G(V)Y∗. To illustrate the application of this theorem, consider the SG G in Fig. 1 (c), where we are interested in p(Y2|do(a1, a2)). It is easy to see that Y∗= {C1, C2, M1, M2, Y2} (see GY∗in Fig. 1 (d)) with B(GY∗) = {{M1, M2}} and D(GY∗) = {{C1}, {C2}, {Y2}}. The chain graph factor of the factorization in Theorem 2 is p(M1, M2|A1 = a1, A2, C1, C2). Note that this expression further factorizes according to the (second level) undirected factorization of blocks in a CCG. For the three district factors {C1}, {C2}, {Y2} in Fig. 1 (d), we must fix variables in three different sets {C2, A1, A2, Y1, Y2}, {C1, A1, A2, Y1, Y2}, {C1, C2, A1, Y1, A2} in Gd, shown in Fig. 1 (e). We defer the full derivation involving the fixing operator to the supplementary material. The resulting identifying functional for p(Y2|do(a1, a2)) is: X {C1,C2,M1,M2} p(M1, M2|a1, a2, C1, C2) X A2 p(Y2|a1, A2, M2, C2)p(A2|C2)p(C1)p(C2) (3) 7 Experiments We now illustrate how identified functionals given by Theorem 2 may be estimated from data. Specifically we consider network average effects (N.E.), the network analogue of the average causal effect (ACE), as defined in [3]: NEi(a−i) = 1 N X i E[Yi(Ai = 1, A−1 = 1)] −E[Yi(Ai = 0, A−i = 0)] in our article sharing example described in section 2, and shown in simplified form (for two units) in Fig. 1 (a). The experiments and results we present here generalize easily to other network effects such as direct and spillover effects [3], although we do not consider this here in the interests of space. For purposes of illustration we consider a simple setting where the social network is a 3regular graph, with networks of size N = [400, 800, 1000, 2000]. Under the hidden variable CG model we described in section 2, the above effect is identified by a functional which generalizes (3) from a network of size 2 to a larger network. Importantly, since we assume a single connected network of M variables, we are in the full interference setting where only a single sample from p(M1, . . . MN|A1, . . . , AN, C1, . . . , CN) is available. This means that while the standard maximum likelihood plug-in estimation strategy is possible for models for Yi and Ai in (3), the strategy does not work for the model for M. Instead, we adapt the auto-g-computation approach based on the pseudo-likelihood and coding estimators proposed in [24], which is appropriate for full interference 8 settings with a Markov property given by a CG, as part of our estimation procedure. Note that the approach in [24] was applied for a special case of the set of causal models considered here, in particular those with no unmeasured confounding. Here we use the same approach for estimating general functionals in models that may include unobserved confounders between treatments and outcomes. In fact, our example model is analogous to the model in [24], in the same way that the front-door criterion is to the backdoor criterion in causal inference under the assumption of iid data [12]. Our detailed estimation strategy, along with a more detailed description of our results, is described in the appendix. We performed 1000 bootstrap samples of the 4 different networks. Since calculating the true causal effects is intractable even if true model parameters are known, we calculate the approximate ‘ground truth’ for each intervention by sampling from our data generating process under the intervention 5 times and averaging the relevant effect. We calculated the (approximation of) the bias of each effect by subtracting the estimate from the ‘ground truth.’ The ‘ground truth’ network average effects range from −.453 to −.456. As shown in Tables 1 and 2, both estimators recover the ground truth effect with relatively small bias. Estimators for effects which used the pseudo-likelihood estimator for M generally have lower variance than those that used the coding estimator for M, which is expected due to the greater efficiency of the former. This behavior was also observed in [24]. In both estimators, bias decreases with network size. This is also expected intuitively, although detailed asymptotic theory for statistical inference in networks is currently an open problem, due to dependence of samples. 95% Confidence Intervals of Bias of Network Average Effects N 400 800 1000 2000 Estimator Coding (-.157, .103) (-.129, .106) (-.100, .065) (-.086, .051) Pseudo (-.133, .080) (-.099, .089) (-.116, .074) (-.070, .041) Table 1: 95% confidence intervals for the bias of each estimating method for the network average effects. All intervals cover the approximated ground truth since they include 0 Bias of Network Average Effects N 400 800 1000 2000 Estimator Coding -.000 (.060) -.020 (.051) -.024 (.052) -.022 (.034) Pseudo .006 (.052) -.023 (.042) -.023 (.042) -.021 (.026) Table 2: The biases of each estimating method for the network average effects. Standard deviation of the bias of each estimate is given in parentheses. 8 Conclusion In this paper, we generalized existing non-parametric identification theory for hidden variable causal DAG models to hidden variable causal chain graph models, which can represent both causal relationships, and stable symmetric relationships that induce data dependence. Specifically, we gave a representation of all identified interventional distributions in such models as a truncated factorization associated with segregated graphs, mixed graphs containing directed, undirected, and bidirected edges which represent marginals of chain graphs. We also demonstrated how statistical inference may be performed on identifiable causal parameters, by adapting a combination of maximum likelihood plug in estimation, and methods based on coding and pseudo-likelihood estimators that were adapted for full interference problems in [24]. We illustrated our approach with an example of calculating the effect of community membership on article sharing if the effect of the former on the latter is mediated by a complex social network of units inducing full dependence. 9 Acknowledgements The second author would like to thank the American Institute of Mathematics for supporting this research via the SQuaRE program. This project is sponsored in part by the National Institutes of 9 Health grant R01 AI127271-01 A1, the Office of Naval Research grant N00014-18-1-2760 and the Defense Advanced Research Projects Agency (DARPA) under contract HR0011-18-C-0049. The content of the information does not necessarily reflect the position or the policy of the Government, and no official endorsement should be inferred. 10 References [1] D. Arbour, D. Garant, and D. Jensen. Inferring network effects from observational data. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 715–724. ACM, 2016. [2] M. Drton. Discrete chain graph models. Bernoulli, 15(3):736–753, 2009. [3] M. Hudgens and M. Halloran. Toward causal inference with interference. Journal of the American Statistical Association, 103(482):832–842, 2008. [4] D. A. Kenny, D. A. Kashy, and W. L. Cook. Dyadic Data Analysis. Guilford Press New York, 2006. [5] S. L. Lauritzen. Graphical Models. Oxford, U.K.: Clarendon, 1996. [6] S. L. Lauritzen and T. S. Richardson. Chain graph models and their causal interpretations (with discussion). Journal of the Royal Statistical Society: Series B, 64:321–361, 2002. [7] M. Maier, K. Marazopoulou, and D. Jensen. Reasoning about independence in probabilistic models of relational data. arXiv preprint arXiv:1302.4381, 2013. [8] 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, 2015. [9] E. L. Ogburn and T. J. VanderWeele. Causal diagrams for interference. Statistical Science, 29(4):559–578, 2014. [10] J. Pearl. Probabilistic Reasoning in Intelligent Systems. Morgan and Kaufmann, San Mateo, 1988. [11] J. Pearl. Causal diagrams for empirical research. Biometrika, 82(4):669–709, 1995. [12] J. Pearl. Causality: Models, Reasoning, and Inference. Cambridge University Press, 2 edition, 2009. [13] J. M. Peña. Learning acyclic directed mixed graphs from observations and interventions. In Conference on Probabilistic Graphical Models, pages 392–402, 2016. [14] J. M. Peña. Reasoning with alternative acyclic directed mixed graphs. Behaviormetrika, pages 1–34, 2018. [15] T. S. Richardson. Markov properties for acyclic directed mixed graphs. Scandinavial Journal of Statistics, 30(1):145–157, 2003. [16] T. S. Richardson, R. J. Evans, J. M. Robins, and I. Shpitser. Nested Markov properties for acyclic directed mixed graphs, 2017. Working paper. [17] J. M. Robins. A new approach to causal inference in mortality studies with sustained exposure periods – application to control of the healthy worker survivor effect. Mathematical Modeling, 7:1393–1512, 1986. [18] J. M. Robins. Marginal structural models versus structural nested models as tools for causal inference. In Statistical Models in Epidemiology: The Environment and Clinical Trials. NY: Springer-Verlag, 1999. [19] C. R. Shalizi and A. C. Thomas. Homophily and contagion are generically confounded in observational social network studies. Sociological methods & research, 40(2):211–239, 2011. [20] I. Shpitser. Segregated graphs and marginals of chain graph models. In Advances in Neural Information Processing Systems 28. Curran Associates, Inc., 2015. [21] I. Shpitser and J. Pearl. Identification of joint interventional distributions in recursive semiMarkovian causal models. In Proceedings of the Twenty-First National Conference on Artificial Intelligence (AAAI-06). AAAI Press, Palo Alto, 2006. 11 [22] M. E. Sobel. What do randomized studies of housing mobility demonstrate? causal inference in the face of interference. Journal of the American Statistical Association, 101.476:1398–1407, 2006. [23] I. Sutskever, O. Vinyals, and Q. V. Le. Sequence to sequence learning with neural networks. In Advances in neural information processing systems, pages 3104–3112, 2014. [24] E. J. Tchetgen Tchetgen, I. Fulcher, and I. Shpitser. Auto-g-computation of causal effects on a network. hhttps://arxiv.org/abs/1709.01577, 2017. Working paper. [25] E. J. Tchetgen Tchetgen and T. J. VanderWeele. On causal inference in the presence of interference. Statistical Methods in Medical Research, 21(1):55–75, 2012. [26] J. Tian and J. Pearl. On the identification of causal effects. Technical Report R-290-L, Department of Computer Science, University of California, Los Angeles, 2002. [27] J. Tian and J. Pearl. On the testable implications of causal models with hidden variables. In Proceedings of the Eighteenth Conference on Uncertainty in Artificial Intelligence (UAI-02), volume 18, pages 519–527. AUAI Press, Corvallis, Oregon, 2002. [28] T. S. Verma and J. Pearl. Equivalence and synthesis of causal models. Technical Report R-150, Department of Computer Science, University of California, Los Angeles, 1990. 12
2018
11
7,264
Neural Code Comprehension: A Learnable Representation of Code Semantics Tal Ben-Nun ETH Zurich Zurich 8092, Switzerland talbn@inf.ethz.ch Alice Shoshana Jakobovits ETH Zurich Zurich 8092, Switzerland alicej@student.ethz.ch Torsten Hoefler ETH Zurich Zurich 8092, Switzerland htor@inf.ethz.ch Abstract With the recent success of embeddings in natural language processing, research has been conducted into applying similar methods to code analysis. Most works attempt to process the code directly or use a syntactic tree representation, treating it like sentences written in a natural language. However, none of the existing methods are sufficient to comprehend program semantics robustly, due to structural features such as function calls, branching, and interchangeable order of statements. In this paper, we propose a novel processing technique to learn code semantics, and apply it to a variety of program analysis tasks. In particular, we stipulate that a robust distributional hypothesis of code applies to both human- and machine-generated programs. Following this hypothesis, we define an embedding space, inst2vec, based on an Intermediate Representation (IR) of the code that is independent of the source programming language. We provide a novel definition of contextual flow for this IR, leveraging both the underlying data- and control-flow of the program. We then analyze the embeddings qualitatively using analogies and clustering, and evaluate the learned representation on three different high-level tasks. We show that even without fine-tuning, a single RNN architecture and fixed inst2vec embeddings outperform specialized approaches for performance prediction (compute device mapping, optimal thread coarsening); and algorithm classification from raw code (104 classes), where we set a new state-of-the-art. 1 Introduction The emergence of the “Big Data era” manifests in the form of a dramatic increase in accessible code. In the year 2017 alone, GitHub reports [25] approximately 1 billion git commits (code modification uploads) written in 337 different programming languages. Sifting through, categorizing, and understanding code thus becomes an essential task for a variety of fields. Applications include identifying code duplication, performance prediction, algorithm detection for alternative code suggestion (guided programming), vulnerability analysis, and malicious code detection. These tasks are challenging, as code can be modified such that it syntactically differs (for instance, via different or reordered operations, or written in a different language altogether), but remains semantically equivalent (i.e., produces the same result). However, these tasks are also ideal for machine learning, since they can be represented as classic regression and classification problems. In order to mechanize code comprehension, the research community typically employs reinforcement learning and stochastic compilation for super-optimization [13, 56]; or borrows concepts from Natural Language Processing (NLP) for human-authored code, relying on the following hypothesis: The naturalness hypothesis [3]. Software is a form of human communication; software corpora have similar statistical properties to natural language corpora; and these properties can be exploited to build better software engineering tools. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. C/C++ FORTRAN Python Java CUDA OpenCL . . . SSA Representation (LLVM IR) Neural Code Comprehension RNN RNN RNN RNN inst2vec Contextual Flow Graph (XFG) Malicious Code Detection Guided Programming Code Optimization Hardware Mapping Anti-Virus IDE Compiler High-Level Tasks Frontend Source Code Figure 1: Component overview of the Neural Code Comprehension pipeline. For NLP-based approaches, input code is usually processed into tokens (e.g., keywords, braces) [18] or other representations [4, 7, 53], and optionally undergoes embedding in a continuous lowerdimensional space. In the spirit of the successful word2vec model [47, 48], the mapping to the embedding space is learned by pairing a token with its surrounding tokens. Following this process, RNNs [23] are trained on sequences of such tokens. This model has been successfully used for NLPlike tasks, such as summarization [6], function name prediction [7], and algorithm classification [49]. Although the results for stochastic code optimization and NLP embeddings are promising, two issues arise. Firstly, in prior works, the source programming language (or machine code for optimization) is fixed, which does not reflect the plethora of languages, nor generalizes to future languages. Secondly, existing methods process tokens (or instructions) sequentially, targeting function- and loop-free code. Such codes, however, do not represent the majority of the applications. This paper presents Neural Code Comprehension1: a general-purpose processing pipeline geared towards representing code semantics in a robust and learnable manner. The pipeline, depicted in Fig. 1, accepts code in various source languages and converts it to statements in an Intermediate Representation (IR), using the LLVM Compiler Infrastructure [39]. The LLVM IR, which is explained in detail in Section 4, is then processed to a robust representation that we call conteXtual Flow Graphs (XFGs). XFGs are constructed from both the data- and control-flow of the code, thus inherently supporting loops and function calls. In turn, the XFG structure is used to train an embedding space for individual statements, called inst2vec (from the word “instruction”), which is fed to RNNs for a variety of high-level tasks. Neural Code Comprehension is evaluated on multiple levels, using clustering and analogies for inst2vec, as well as three different code comprehension tasks for XFGs: algorithm classification; heterogeneous compute device (e.g., CPU, GPU) mapping; and optimal thread coarsening factor prediction, which model the runtime of an application without running it. Our datasets contain CPU and GPU code written in C, C++, OpenCL, and FORTRAN, though LLVM supports additional languages such as Python, Rust, Swift, Go, and CUDA. Our work makes the following contributions: • We formulate a robust distributional hypothesis for code, from which we draw a novel distributed representation of code statements based on contextual flow and LLVM IR. • We detail the construction of the XFG, the first representation designed specifically for statement embeddings that combines data and control flow. • We evaluate the representation using clustering, analogies, semantic tests, and three fundamentally different high-level code learning tasks. • Using one simple LSTM architecture and fixed pre-trained embeddings, we match or surpass the best-performing approaches in each task, including specialized DNN architectures. 2 Related Work Distributed representations of code were first suggested by Allamanis et al. [2], followed by several works leveraging embeddings to apply NLP techniques to programming languages [3, 61]. Code Representation Previous research focuses on embedding high-level programming languages such as Java [20, 30], C [41], or OpenCL [18] in the form of tokens or statements, as well as lower 1Code, datasets, trained embeddings, and results available at https://www.github.com/spcl/ncc 2 level representations such as object code [41]. To the best of our knowledge, however, no attempt has been made to train embeddings for compiler IRs prior to this work. As for representing the context of a token, which is necessary for training embeddings, some works rely on lexicographical locality [2, 18, 20], whereas others exploit the structural nature of code, using Data Flow Graphs [4], Control Flow Graphs [51, 53, 64], Abstract Syntax Trees (ASTs) [12, 30], paths in the AST [8], or an augmented AST, for instance with additional edges connecting different uses and updates of syntax tokens corresponding to variables [5]. We differ from all previous approaches by introducing contextual flow, a graph representation that captures both data and control dependencies. In compiler research, similar graphs exist but have not been successfully exploited for machine learning. Examples include the Program Dependence Graph (PDG) [24] and the IR known as Sea of Nodes [15, 16]. Unlike these representations, our graphs are not designed to be optimized by a compiler nor translated to machine code, which allows us to introduce ambiguity (e.g., ignoring parameter order) in favor of preserving context. Other works applying Machine Learning techniques to PDGs exist: Hsiao et al. [34] use PDGs to compute n-gram models for program analysis, and Wang et al. [62] use them for detecting copy direction among programs using Extreme Learning Machines. However, our work is the first to leverage a hybrid of control and data flow for the training of embeddings. Automated Tasks on Code Learned representations of code are commonly used for two types of tasks: uncovering program semantics or optimizing programs. For the former task, code embeddings have been used to perform function or variable naming [2, 7], clone detection [63], code completion [54, 65], summarization [6], and algorithm classification [49]. As for program optimization, research has been conducted on automatic feature generation for code [40, 50]; and Cummins et al. [18] notably leverage embeddings of OpenCL code to predict optimal device mapping and thread coarsening factors. Their work differs from ours in that the method is restricted to the OpenCL language, and that they process programs in a sequential order, which does not capture complex code structures. Furthermore, the state-of-the-art in automatic tuning for program optimization [10] uses surrogate performance models and active learning, and does not take code semantics into account. Embedding Evaluation Previous works that use code embeddings do not evaluate the quality of the trained space on its own merit, but rather through the performance of subsequent (downstream) tasks. One exception is Allamanis et al. [2], who present empirical evidence of vector similarities for similar method names. To the best of our knowledge, we are the first to quantify the quality of a code embedding space itself in the form of clustering, syntactic analogies, semantic analogies, and categorical distance tests. 3 A Robust Distributional Hypothesis of Code The linguistic Distributional Hypothesis [32, 52] is given by: Words that occur in the same contexts tend to have similar meanings. We stipulate that code, which describes a sequence of operations to a processor, behaves similarly, and paraphrase this hypothesis to: Statements that occur in the same contexts tend to have similar semantics. However, the above wording is vague, due to the possible meanings of the highlighted elements. Below we attempt to provide adequate definitions, upon which we build a learnable code representation. Statements To choose the right abstraction for statements, we take two concerns into account: universality and uniformity. As stated above, source code comes in many languages and thus fixating on a single one would hinder universality. At the other extreme, machine code (assembly) is target-specific, containing specialized instructions and relying on hardware characteristics, such as registers and memory architectures. As for uniformity, in a high-level language one statement may represent simple arithmetics, multiple operations, or even class definitions (for example, the Java statement button.setOnClickListener(new View.OnClickListener(){...})). On the other hand, assembly is too limited, since instructions are reused for different purposes. We thus wish to choose statements that are independent of the source language, as well as the hardware architecture. Context The definition of a context for code statements should also be carefully considered. We define context as statements whose execution directly depends on each other. Learning from consecutive statements in code does not necessarily fulfill this definition, as, for example, a programmer 3 double thres = 5.0; if (x < thres) x = y * y; else x = 2.0 * y; x += 1.0; (a) Source code %cmp = fcmp olt double %x, 5.0 br i1 %cmp, label %LT, label %GE LT: %2 = fmul double %y, %y GE: %3 = fmul double 2.0, %y AFTER: %4 = phi double [%2,%LT], [%3,%GE] %5 = fadd double %4, 1.0 (b) LLVM IR %0 5.0 %cmp %LT %GE %2 %3 %AFTER %y 2.0 %y 1.0 %5 %3 %2 %4 %x (c) Dataflow basic blocks %x %y %LT %cmp %AFTER %5 %4 fadd phi %3 %2 %GE fmul br br fcmp phi (d) Contextual Flow Graph Figure 2: Contextual flow processing scheme. may use a variable in the first line of a function, but only use it again in the last line. Moreover, such long-term relationships may vanish when using RNNs and attention learning. It is possible to determine the data dependencies of each statement by analyzing dataflow, however, branches and function calls do not necessarily generate such dependencies. Another way of representing execution dependence is through the notion of causality (i.e., the “happens-before” relation [38]), which can be used to complement dataflow. In our representation, context is the union of data dependence and execution dependence, thereby capturing both relations. Similarity To define similarity, one first needs to define the semantics of a statement. We draw the definition of semantics from Operational Semantics in programming language theory, which refers to the effects (e.g., preconditions, postconditions) of each computational step in a given program. In this paper, we specifically assume that each statement modifies the system state in a certain way (e.g., adds two numbers) and consumes resources (e.g., uses registers and floating-point units). It follows that semantic similarity can be defined by two statements consuming the same resources or modifying the system state in a similar way. Using this definition, two versions of the same algorithm with different variable types would be synonymous. 4 Contextual Flow Processing The aforementioned statements and contexts cannot be directly extracted from source code, but rather require processing akin to partial compilation (e.g., dataflow extraction). In this section, we briefly describe a popular compilation pipeline and proposed modifications to create a learnable vocabulary of statements and their context. 4.1 Compilation, Static Single Assignment, and LLVM IR Major contemporary compilers, such as GCC and LLVM, support multiple programming languages and hardware targets. To avoid duplication in code optimization techniques, they enforce a strict separation between the source language (frontend), an Intermediate Representation (IR) that can be optimized, and the target machine code (backend) that should be mapped to a specific hardware. In particular, the LLVM IR [45] supports various architectures (e.g., GPUs), and can represent optimized code (e.g., using vector registers) inherently. Figures 2a and 2b depict an example code and its LLVM IR equivalent, and the structure of an LLVM IR statement is shown in Fig. 3. %5 = load float, float* %a1, align 4, !tbaa !1 ; comment Output Identifier Instruction Types Input Identifier Other Parameters Metadata Figure 3: Anatomy of an LLVM IR statement. x0 = a * b; x1 = c * c; x2 = x0 + x1; x3 = x + x2; Figure 4: SSA of x += (a*b)+(c*c). In the LLVM infrastructure, the IR is given in Static Single Assignment (SSA) form [19]. Briefly, an SSA IR ensures that every variable is assigned only once, which makes it easy to track dataflow between IR statements, as shown in Fig. 4. To overcome analysis issues resulting from control-flow, such as loops, SSA defines φ-expressions. These expressions enumerate all possible outcomes that 4 can lead to a variable (depending on the runtime control-flow), and can be used to optimize code across branches. In Fig. 2b, the identifier %4 is constructed from a φ-expression that can take either the value of %2 or %3, depending on the value of x. 4.2 Contextual Flow Graphs To analyze dataflow for optimization, LLVM divides the IR statements into “basic blocks”, which contain no control-flow divergence, illustrated in Fig. 2c. Within a basic block, statements naturally create traceable dataflow as SSA lists data dependencies in the form of input identifiers (even if conditional), and assigns the results to a single identifier. However, as shown in Section 3, dataflow alone does not suffice to provide context for a given statement, e.g., when in the vicinity of a branch. Therefore, we define a representation that incorporates both the relative data- and control-flow of a statement, which we call the conteXtual Flow Graph (XFG). XFGs (e.g., Fig. 2d) are directed multigraphs, where two nodes can be connected by more than one edge. XFG nodes can either be variables or label identifiers (e.g., basic block, function name), appearing in the figure as ovals or rectangles respectively. Correspondingly, an edge either represents data-dependence (in black), carrying an LLVM IR statement; or execution dependence (light blue). XFG Construction We generate XFGs incrementally from LLVM IR, as follows: 1. Read LLVM IR statements once, storing function names and return statements. 2. Second pass over the statements, adding nodes and edges according to the following rule-set: (a) Data dependencies within a basic block are connected. (b) Inter-block dependencies (e.g., φ-expressions) are both connected directly and through the label identifier (statement-less edges). (c) Identifiers without a dataflow parent are connected to their root (label or program root). It follows that XFGs create paths through dataflow as well as branches, loops, and functions (including recursion). Owing to the two passes, as well as the linear-time construction of LLVM IR [58], XFGs are constructed in O(n) for a program with n SSA statements. This is especially valuable when learning over large code corpora, such as Tensorflow. External Code Calls to external code (e.g., libraries, frameworks) can be divided into two categories: statically- and dynamically-linked. If the code is accessible during compilation (header-only frameworks and static libraries), LLVM IR is available and the statements are traversed as part of the XFG. In the dynamic case, the library code is not included and is represented as a call statement. 5 inst2vec: Embedding Statements in Continuous Space With XFGs providing a notion of context, we can now train an embedding space for individual statements. To support learnability, desiderata for such a space include: (a) statements that are in close proximity should have similar artifacts on a system (i.e., use the same resources); and (b) changing the same attributes (e.g., data type) for different instructions should result in a similar offset in the space. We train LLVM IR statement embeddings using the skip-gram model [48], following preprocessing to limit the vocabulary size. 5.1 Statement Preprocessing and Training Preprocessing First, we filter out comments and metadata from statements. Then, identifiers and immediate values (numeric constants, strings) are replaced with %ID and <INT/FLOAT/STRING> respectively, where immediate values are fed separately to downstream RNNs. Lastly, data structures are “inlined”, that is, their contents are encoded within the statement. Fig. 5 lists statements before and after preprocessing. store float %250, float* %82, align 4, !tbaa !1 %10 = fadd fast float %9, 1.3 %8 = load %"struct.aaa"*, %"struct.aaa"** %2 (a) LLVM IR store float %ID, float* %ID, align 4 %ID = fadd fast float %ID, <FLOAT> %ID = load { float, float }*, { float, float }** %ID (b) inst2vec statements Figure 5: Before and after preprocessing LLVM IR to inst2vec statements. 5 Table 1: inst2vec training dataset statistics Discipline Dataset Files LLVM IR Vocabulary XFG Stmt. Lines Size Pairs Machine Learning Tensorflow [1] 2,492 16,943,893 220,554 260,250,973 High-Performance Computing AMD APP SDK [9] 123 1,304,669 4,146 45,081,359 BLAS [22] 300 280,782 566 283,856 Benchmarks NAS [57] 268 572,521 1,793 1,701,968 Parboil [59] 151 118,575 2,175 151,916 PolybenchGPU [27] 40 33,601 577 40,975 Rodinia [14] 92 103,296 3,861 266,354 SHOC [21] 112 399,287 3,381 12,096,508 Scientific Computing COSMO [11] 161 152,127 2,344 2,338,153 Operating Systems Linux kernel [42] 1,988 2,544,245 136,545 5,271,179 Computer Vision OpenCV [36] 442 1,908,683 39,920 10,313,451 NVIDIA samples [17] 60 43,563 2,467 74,915 Synthetic Synthetic 17,801 26,045,547 113,763 303,054,685 Total (Combined) — 24,030 50,450,789 8,565 640,926,292 Dataset Table 1 summarizes the code corpora and vocabulary statistics of the inst2vec dataset. We choose corpora from different disciplines, including high-performance computing, benchmarks, operating systems, climate sciences, computer vision, machine learning (using Tensorflow’s own source code), and synthetically-generated programs. The code in the dataset is written in C, C++, FORTRAN, and OpenCL, and is compiled for Intel CPUs as well as NVIDIA and AMD GPUs. The files in the dataset were compiled to LLVM IR with Clang [44] and Flang [43], using compilation flags from the original code (if available) and randomly chosen compiler optimization (e.g., -ffast-math) and target architecture flags. For the synthetic corpus, we use both C code and the Eigen [31] C++ library. In particular, random linear algebra operations are procedurally generated from high-level templates using different parameters, such as data types, operations, and dimensions. Setup and Training Given a set of XFGs created from the LLVM IR files, we generate neighboring statement pairs up to a certain context size, following the skip-gram model [48]. A context of size N includes all statement pairs that are connected by a path shorter or equal to N. To obtain the pairs, we construct a dual graph in which statements are nodes, omitting duplicate edges. Following this process, we discard statements that occur less than 300 times in the dataset, pairs of identical statements, and perform subsampling of frequent pairs, similarly to Mikolov et al. [48]. We train inst2vec with an embedding dimension of 200 for 5 epochs using Tensorflow [1]. The Adam optimizer [37] is used with the default published hyperparameters and softmax cross-entropy loss. 5.2 Evaluation Clustering Fig. 6 depicts the t-SNE [60] plots for trained inst2vec spaces with different XFG context sizes, colored by statement and data type (legend in Appendix A). In the plots, we see that both a context size of 1 statement in each direction (Fig. 6a) or 3 statements (Fig. 6c) generate large, multi-type clusters, as well as outliers. This phenomenon eventually contributes to a lower final analogy score, due to inappropriate representation of inter-statement relations, as can be seen below. Owing to these results, we choose a context size of 2 statements (Fig. 6b), which mostly consists of separate, monochromatic clusters, indicating strong clustering w.r.t. instruction and data types. While data type syntactic clusters are unsurprising, their existence is not trivial, since the dataset contains diverse codebases rather than copies of the same functions with different types. An example of a semantically-similar statement cluster can be found in data structures. In particular, the top-5 nearest neighbors of operations on the complex data type “std::complex<float>” include “2 x float” (i.e., a vector type). In fact, LLVM IR represents the complex data type as {float, float}, so this property is generalized to any user-defined data structure (struct) with two floats. Analogies and Tests We also evaluate inst2vec by automatically generating a list of statement analogies (“a” is to “b” as “c” is to “?”, or “a:b; c:?”) that appear in our vocabulary using the LLVM 6 50 -50 0 -50 0 50 (a) Context size = 1 50 0 -50 -100 100 50 0 -50 (b) Context size = 2 80 100 60 40 20 0 -20 -60 -40 -80 -60 -40 0 -20 20 40 60 80 (c) Context size = 3 Figure 6: Two-dimensional t-SNE plots for learned embeddings (best viewed in color). IR syntax. We then use the embeddings to find the result by computing a-b+c and asking whether the result is in the top-5 neighbors (cosine distance). Additionally, we automatically create relative distance expressions using the LLVM IR reference categories [45] of the form d(a, b) < d(a, c) to test whether statements that use different resources are further away than those who use the same. Table 2 shows the analogy and test results for inst2vec trained on XFG as well as on CFG (control flow-only) and DFG (data flow-only) for different context sizes. The analogies are divided into different categories, including data types (i.e., transitions between types), options (e.g., fast math), conversions (e.g., bit casting, extension, truncation), and data structures (e.g., vector-type equivalents of structures). Below are examples of a type analogy: %ID = add i64 %ID, %ID : %ID = fadd float %ID, %ID; %ID = sub i64 %ID, %ID :? %ID = fsub float %ID, %ID and a data structure analogy: %ID = extractvalue { double, double } %ID, 0 : %ID = extractelement <2 x double> %ID, <TYP> 0; %ID = extractvalue { double, double } %ID, 1 :? %ID = extractelement <2 x double> %ID, <TYP> 1 The results confirm that over all scores, a context size of 2 is the best-performing configuration, and show that the XFG representation is more complete and leads to better embeddings than taking into account control or data flow alone. Table 2: Analogy and test scores for inst2vec Context type Context Size Syntactic Analogies Semantic Analogies Semantic Distance Test Types Options Conversions Data Structures CFG 1 0 (0 %) 1 (1.89 %) 1 (0.07 %) 0 (0 %) 51.59 % 2 1 (0.18 %) 1 (1.89 %) 0 (0 %) 0 (0 %) 50.47 % 3 0 (0 %) 1 (1.89 %) 4 (0.27 %) 0 (0 %) 53.79 % DFG 1 53 (9.46 %) 12 (22.64 %) 2 (0.13 %) 4 (50.00 %) 56.79 % 2 71 (12.68 %) 12 (22.64 %) 12 (0.80 %) 3 (37.50 %) 57.44 % 3 67 (22.32 %) 18 (33.96 %) 40 (2.65 %) 4 (50.00 %) 60.38 % XFG 1 101 (18.04 %) 13 (24.53 %) 100 (6.63 %) 3 (37.50 %) 60.98 % 2 226 (40.36 %) 45 (84.91 %) 134 (8.89 %) 7 (87.50 %) 79.12 % 3 125 (22.32 %) 24 (45.28 %) 48 (3.18 %) 7 (87.50 %) 62.56 % 6 Code Comprehension Experiments In this section, we evaluate inst2vec on three different tasks, comparing with manually-extracted features and state-of-the-art specialized deep learning approaches. Throughout all tasks, we use the same neural network architecture and our pre-trained embedding matrix from Section 5, which remains fixed during training. Training Our recurrent network (see schematic description in the Appendix B) consists of an inst2vec input with an XFG context size of 2, followed by two stacked LSTM [33] layers with 200 units in each layer, batch normalization [35], a dense 32-neuron layer with ReLU activations, and output units matching the number of classes. The loss function is a categorical cross-entropy trained 7 using Adam [37] with the default hyperparameters. Additionally, for the compute device mapping and optimal thread coarsening factor prediction tasks, we train the LLVM IR statements with the immediate values that were stripped from them during preprocessing (see Section 5). Further details are given in Appendix C. Datasets The algorithm classification task uses the POJ-104 [49] dataset2, collected from a Pedagogical Open Judge system. The dataset contains 104 program classes written by 500 different people (randomly selected subset per class). For the compute device mapping and optimal thread coarsening factor prediction tasks, we use an OpenCL code dataset3 provided by Cummins et al. [18]. 6.1 Algorithm Classification Using inst2vec, we construct an RNN that reads embedded source code and outputs a predicted program class. We compare our approach with Tree-Based CNNs (TBCNN) [49], the best-performing algorithm classifier in the POJ-104 dataset. TBCNN constructs embeddings from Astract Syntax Tree nodes of source code, and employs two specialized layers: tree convolutions and dynamic pooling. Their network comprises 5 layers, where convolution and fully connected layers are 600-dimensional. Our data preparation follows the experiment conducted by Mou et al. [49], splitting the dataset 3:1:1 for training, validation, and testing. To compile the programs successfully, we prepend #include statements to each file. Data augmentation is then applied on the training set by compiling each file 8 times with different flags (-O{0-3}, -ffast-math). Table 3: Algorithm classification test accuracy Metric Surface Features [49] RNN [49] TBCNN [49] inst2vec (RBF SVM + Bag-of-Trees) Test Accuracy [%] 88.2 84.8 94.0 94.83 Table 3 compares inst2vec (trained for 100 epochs) with the reported results of Mou et al. [49], which contain TBCNN as well as a 600-cell RNN and a manual feature extraction approach (Surface Features). The results show that inst2vec sets a new state-of-the-art with a 13.8 % decrease in error, even though the dataset used to generate the embeddings does not include POJ-104 (see Table 1). 6.2 Heterogeneous Compute Device Mapping Next, we use Neural Code Comprehension to predict whether a given OpenCL program will run faster on a CPU (Intel Core i7-3820) or a GPU (AMD Tahiti 7970 and NVIDIA GTX 970) given its code, input data size, and work-group size (i.e., number of threads that work in a group with shared memory). To achieve that, we use the same experimental methodology presented by Cummins et al. [18], removing their specialized OpenCL source rewriter and replacing their code token embeddings with our XFGs and inst2vec. We concatenate the data and work-group sizes to the network inputs, and train with stratified 10-fold cross-validation. We repeat the training 10 times with random initialization of the network’s weights and report the best result. In Table 4, inst2vec and inst2vec-imm (i.e., with immediate value handling) are compared with a manual code feature extraction approach by Grewe et al. [29] and DeepTune [18], in terms of runtime prediction accuracies and resulting speedup. The baseline for the speedup is a static mapping, which selects the device that yields the best average case performance over all programs in the data set: in the case of AMD Tahiti versus Intel i7-3820, that is the CPU and in the case of NVIDIA GTX versus Intel i7-3820, it is the GPU. The results indicate that inst2vec outperforms Grewe et al. and is on-par with DeepTune. We believe that the better predictions in DeepTune are the result of training the embedding matrix in tandem with the high-level task, thereby specializing it to the dataset. This specialized training is, however, surpassed by taking immediate values into account during training. We present the result of the best immediate value handling method in Table 4 (inst2vec-imm), and the exhaustive results can be found in Appendix D. 2https://sites.google.com/site/treebasedcnn/ 3https://www.github.com/ChrisCummins/paper-end2end-dl 8 Table 4: Heterogeneous device mapping results Architecture Prediction Accuracy [%] GPU Grewe et al. [29] DeepTune [18] inst2vec inst2vec-imm AMD Tahiti 7970 41.18 73.38 83.68 82.79 88.09 NVIDIA GTX 970 56.91 72.94 80.29 82.06 86.62 Speedup GPU Grewe et al. DeepTune inst2vec inst2vec-imm AMD Tahiti 7970 3.26 2.91 3.34 3.42 3.47 NVIDIA GTX 970 1.00 1.26 1.41 1.42 1.44 6.3 Optimal Thread Coarsening Factor Prediction Our third example predicts the best-performing thread coarsening factor, a measure of the amount of work done per GPU thread, for a given OpenCL code. We again compare the achieved speedups of inst2vec with manual features [46], DeepTune, and DeepTune with transfer learning applied from the task in Section 6.2 (denoted by DeepTune-TL). Possible values for the coarsening factor are 1 (baseline for speedups), 2, 4, 8, 16, and 32. The results in Table 5 show that while inst2vec yields better speedups than DeepTune-TL in only half of the cases (possibly due to the embedding specialization in DeepTune), the manually-extracted features are consistently outperformed by inst2vec. Moreover, inst2vec-imm is consistently on-par with DeepTune, but improves inconsistently on inst2vec (on the AMD Tahiti and the NVIDIA GTX only), and fails to outperform DeepTune-TL. This can be explained by the small size of the training data for this task (17 programs with 6 different thread coarsening factors for each hardware platform). The optimal device mapping task (Section 6.2), on the other hand, features 680 programs for each platform. Table 5: Speedups achieved by coarsening threads Computing Platform Magni et al. [46] DeepTune [18] DeepTune-TL [18] inst2vec inst2vec-imm AMD Radeon HD 5900 1.21 1.10 1.17 1.37 1.28 AMD Tahiti 7970 1.01 1.05 1.23 1.10 1.18 NVIDIA GTX 480 0.86 1.10 1.14 1.07 1.11 NVIDIA Tesla K20c 0.94 0.99 0.93 1.06 1.00 7 Conclusion In this paper, we have empirically shown that semantics of statements can be successfully recovered from their context alone. This recovery relies both on proper granularity, where we propose to use filtered LLVM IR instructions; and on the grouping of statements, for which we use a mixture of dataand control-flow. We use our proposed representation to perform three high-level classification and prediction tasks, outperforming all manually-extracted features and achieving results that are on-par with (and better than) two inherently different state-of-the-art specialized DNN solutions. With this work, we attempt to pave the way towards mechanized code comprehension via machine learning, whether the code was authored by a human or automatically-generated. Further research could be conducted in various directions. Rather than directly using statements, the representation may be refined using part-based models, which have already been applied successfully in language models [55]. inst2vec can also be used as a basis for neural code interpretation, using a modified Differentiable Neural Computer [28] to enable execution of arbitrary code over DNNs. Acknowledgments We wish to thank Theodoros Theodoridis, Kfir Levy, Tobias Grosser, and Yunyan Guo for fruitful discussions. The authors also acknowledge MeteoSwiss, and thank Hussein Harake, Colin McMurtrie, and the whole CSCS team for granting access to the Greina machines, and for their excellent technical support. TBN is supported by the ETH Postdoctoral Fellowship and Marie Curie Actions for People COFUND program. 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, Dandelion 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: Largescale machine learning on heterogeneous systems, 2015. Software available from tensorflow.org. [2] Miltiadis Allamanis, Earl T. Barr, Christian Bird, and Charles Sutton. Suggesting accurate method and class names. In Proceedings of the 2015 10th Joint Meeting on Foundations of Software Engineering, ESEC/FSE 2015, pages 38–49, New York, NY, USA, 2015. ACM. [3] Miltiadis Allamanis, Earl T. Barr, Premkumar T. Devanbu, and Charles A. Sutton. A survey of machine learning for big code and naturalness. CoRR, abs/1709.06182, 2017. [4] Miltiadis Allamanis and Marc Brockschmidt. Smartpaste: Learning to adapt source code. CoRR, abs/1705.07867, 2017. [5] Miltiadis Allamanis, Marc Brockschmidt, and Mahmoud Khademi. Learning to represent programs with graphs. CoRR, abs/1711.00740, 2017. [6] Miltiadis Allamanis, Hao Peng, and Charles A. Sutton. A convolutional attention network for extreme summarization of source code. CoRR, abs/1602.03001, 2016. [7] Uri Alon, Meital Zilberstein, Omer Levy, and Eran Yahav. code2vec: Learning distributed representations of code. CoRR, abs/1803.09473, 2018. [8] Uri Alon, Meital Zilberstein, Omer Levy, and Eran Yahav. A general path-based representation for predicting program properties. CoRR, abs/1803.09544, 2018. [9] AMD. AMD OpenCL accelerated parallel processing SDK. https://developer.amd.com/ amd-accelerated-parallel-processing-app-sdk/. [10] P. Balaprakash, R. B. Gramacy, and S. M. Wild. Active-learning-based surrogate models for empirical performance tuning. In 2013 IEEE International Conference on Cluster Computing (CLUSTER), pages 1–8, Sept 2013. [11] M. Baldauf, A. Seifert, J. Förstner, D. Majewski, M. Raschendorfer, and T. Reinhardt. Operational Convective-Scale Numerical Weather Prediction with the COSMO Model: Description and Sensitivities. Monthly Weather Review, 139:3887–3905, December 2011. [12] Pavol Bielik, Veselin Raychev, and Martin Vechev. PHOG: Probabilistic model for code. In Maria Florina Balcan and Kilian Q. Weinberger, editors, Proceedings of The 33rd International Conference on Machine Learning, volume 48 of Proceedings of Machine Learning Research, pages 2933–2942, New York, New York, USA, June 2016. PMLR. [13] Rudy Bunel, Alban Desmaison, M. Pawan Kumar, Philip H. S. Torr, and Pushmeet Kohli. Learning to superoptimize programs. International Conference on Learning Representations, 2017. [14] Shuai Che, Michael Boyer, Jiayuan Meng, David Tarjan, Jeremy W. Sheaffer, Sang-Ha Lee, and Kevin Skadron. Rodinia: A benchmark suite for heterogeneous computing. In Proceedings of the 2009 IEEE International Symposium on Workload Characterization (IISWC), IISWC ’09, pages 44–54, Washington, DC, USA, 2009. IEEE Computer Society. [15] Cliff Click and Keith D. Cooper. Combining analyses, combining optimizations. ACM Transactions on Programming Languages and Systems, 17, 1995. [16] Cliff Click and Michael Paleczny. A simple graph-based intermediate representation. SIGPLAN Not., 30(3):35–49, March 1995. 10 [17] NVIDIA Corporation. CUDA. http://developer.nvidia.com/object/cuda.html. [18] Chris Cummins, Pavlos Petoumenos, Zheng Wang, and Hugh Leather. End-to-end deep learning of optimization heuristics. In PACT. ACM, 2017. [19] Ron Cytron, Jeanne Ferrante, Barry K. Rosen, Mark N. Wegman, and F. Kenneth Zadeck. Efficiently computing static single assignment form and the control dependence graph. ACM Trans. Program. Lang. Syst., 13(4):451–490, October 1991. [20] Hoa Khanh Dam, Truyen Tran, and Trang Pham. A deep language model for software code. CoRR, abs/1608.02715, 2016. [21] Anthony Danalis, Gabriel Marin, Collin McCurdy, Jeremy S. Meredith, Philip Roth, Kyle Spafford, Vinod Tipparaju, and Jeffrey Vetter. The Scalable HeterOgeneous Computing (SHOC) benchmark suite. pages 63–74, January 2010. [22] Jack Dongarra. Basic linear algebra subprograms technical forum standard. page 1 — 111, 2002. [23] Jeffrey L. Elman. Finding structure in time. Cognitive Science, 14(2):179 – 211, 1990. [24] Jeanne Ferrante, Karl J. Ottenstein, and Joe D. Warren. The program dependence graph and its use in optimization. ACM Trans. Program. Lang. Syst., 9(3):319–349, July 1987. [25] GitHub. GitHub Octoverse. https://octoverse.github.com/, 2017. [26] Xavier Glorot, Antoine Bordes, and Yoshua Bengio. Deep sparse rectifier neural networks. 2011. [27] Scott Grauer-Gray, Lifan Xu, Robert Searles, Sudhee Ayalasomayajula, and John Cavazos. Auto-tuning a high-level language targeted to GPU codes. 2012. [28] Alex Graves, Greg Wayne, Malcolm Reynolds, Tim Harley, Ivo Danihelka, Agnieszka GrabskaBarwi´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. [29] Dominik Grewe, Zheng Wang, and Michael O’Boyle. Portable mapping of data parallel programs to OpenCL for heterogeneous systems. pages 1–10, February 2013. [30] Xiaodong Gu, Hongyu Zhang, Dongmei Zhang, and Sunghun Kim. Deep API learning. In Proceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering, FSE 2016, pages 631–642, New York, NY, USA, 2016. ACM. [31] Gaël Guennebaud and Benoît Jacob et al. Eigen v3. http://eigen.tuxfamily.org, 2010. [32] Zellig S. Harris. Distributional Structure, pages 3–22. Springer Netherlands, Dordrecht, 1981. [33] Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural Computation, 9(8):1735–1780, 1997. [34] Chun-Hung Hsiao, Michael Cafarella, and Satish Narayanasamy. Using web corpus statistics for program analysis. In Proceedings of the 2014 ACM International Conference on Object Oriented Programming Systems Languages & Applications, OOPSLA ’14, pages 49–65, New York, NY, USA, 2014. ACM. [35] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Proceedings of the 32Nd International Conference on International Conference on Machine Learning - Volume 37, ICML’15, pages 448–456. JMLR.org, 2015. [36] Itseez. Open source computer vision library. https://github.com/itseez/opencv, 2015. [37] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2014. 11 [38] Leslie Lamport. Time, clocks, and the ordering of events in a distributed system. Commun. ACM, 21(7):558–565, July 1978. [39] Chris Lattner and Vikram Adve. LLVM: a compilation framework for lifelong program analysis transformation. In International Symposium on Code Generation and Optimization, 2004. CGO 2004., pages 75–86, March 2004. [40] Hugh Leather, Edwin Bonilla, and Michael O’Boyle. Automatic feature generation for machine learning based optimizing compilation. In Proceedings of the 7th Annual IEEE/ACM International Symposium on Code Generation and Optimization, CGO ’09, pages 81–91, Washington, DC, USA, 2009. IEEE Computer Society. [41] Dor Levy and Lior Wolf. Learning to align the source code to the compiled object code. In Proceedings of the 34th International Conference on Machine Learning, ICML 2017, Sydney, NSW, Australia, 6-11 August 2017, pages 2043–2051, 2017. [42] Linux. Linux kernel source code (version 4.15.1). https://www.kernel.org/. [43] LLVM. Flang: a FORTRAN compiler frontend for LLVM. https://github.com/ flang-compiler/flang. [44] LLVM. Clang: a C language family frontend for LLVM v4.0.0. http://clang.llvm.org/, 2017. [45] LLVM. LLVM language reference manual. https://llvm.org/docs/LangRef.html, 2018. [46] Alberto Magni, Christophe Dubach, and Michael O’Boyle. Automatic optimization of threadcoarsening for graphics processors. In Proceedings of the 23rd International Conference on Parallel Architectures and Compilation, PACT ’14, pages 455–466, New York, NY, USA, 2014. ACM. [47] Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. Efficient estimation of word representations in vector space. CoRR, abs/1301.3781, 2013. [48] Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg Corrado, and Jeffrey Dean. Distributed representations of words and phrases and their compositionality. In Proceedings of the 26th International Conference on Neural Information Processing Systems - Volume 2, NIPS’13, pages 3111–3119, USA, 2013. Curran Associates Inc. [49] Lili Mou, Ge Li, Lu Zhang, Tao Wang, and Zhi Jin. Convolutional neural networks over tree structures for programming language processing. In Proceedings of the Thirtieth AAAI Conference on Artificial Intelligence, AAAI’16, pages 1287–1293. AAAI Press, 2016. [50] Mircea Namolaru, Albert Cohen, Grigori Fursin, Ayal Zaks, and Ari Freund. Practical aggregation of semantical program properties for machine learning based optimization. In Proceedings of the 2010 International Conference on Compilers, Architectures and Synthesis for Embedded Systems, CASES ’10, pages 197–206, New York, NY, USA, 2010. ACM. [51] Ricardo Nobre, Luiz G. A. Martins, and João M. P. Cardoso. A graph-based iterative compiler pass selection and phase ordering approach. In Proceedings of the 17th ACM SIGPLAN/SIGBED Conference on Languages, Compilers, Tools, and Theory for Embedded Systems, LCTES 2016, pages 21–30, New York, NY, USA, 2016. ACM. [52] Patrick Pantel. Inducing ontological co-occurrence vectors. In Proceedings of the 43rd Annual Meeting on Association for Computational Linguistics, ACL ’05, pages 125–132, Stroudsburg, PA, USA, 2005. Association for Computational Linguistics. [53] Eunjung Park, John Cavazos, and Marco A. Alvarez. Using graph-based program characterization for predictive modeling. In Proceedings of the Tenth International Symposium on Code Generation and Optimization, CGO ’12, pages 196–206, New York, NY, USA, 2012. ACM. [54] Veselin Raychev, Martin Vechev, and Eran Yahav. Code completion with statistical language models. SIGPLAN Not., 49(6):419–428, June 2014. 12 [55] Cicero Dos Santos and Bianca Zadrozny. Learning character-level representations for part-ofspeech tagging. In Eric P. Xing and Tony Jebara, editors, Proceedings of the 31st International Conference on Machine Learning, volume 32 of Proceedings of Machine Learning Research, pages 1818–1826, Bejing, China, June 2014. PMLR. [56] Eric Schkufza, Rahul Sharma, and Alex Aiken. Stochastic superoptimization. In Proceedings of the Eighteenth International Conference on Architectural Support for Programming Languages and Operating Systems, ASPLOS ’13, pages 305–316, New York, NY, USA, 2013. ACM. [57] Sangmin Seo, Gangwon Jo, and Jaejin Lee. Performance characterization of the nas parallel benchmarks in opencl. In Proceedings of the 2011 IEEE International Symposium on Workload Characterization, IISWC ’11, pages 137–148, Washington, DC, USA, 2011. IEEE Computer Society. [58] Vugranam C. Sreedhar and Guang R. Gao. A linear time algorithm for placing phi-nodes. In Proceedings of the 22Nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’95, pages 62–73, New York, NY, USA, 1995. ACM. [59] John A. Stratton, Christopher Rodrigues, I-Jui Sung, Nady Obeid, Li-Wen Chang, Nasser Anssari, Geng Daniel Liu, and Wen-mei W. Hwu. Parboil: A revised benchmark suite for scientific and commercial throughput computing. Center for Reliable and High-Performance Computing, 2012. [60] Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-SNE. Journal of Machine Learning Research, 9:2579–2605, 2008. [61] Martin Vechev and Eran Yahav. Programming with "big code". Found. Trends Program. Lang., 3(4):231–284, December 2016. [62] Baoezeng Wang, Xiaochun Yang, and Guoren Wang. Detecting copy directions among programs using extreme learning machines. 2015:1–15, 05 2015. [63] Martin White, Michele Tufano, Christopher Vendome, and Denys Poshyvanyk. Deep learning code fragments for code clone detection. In Proceedings of the 31st IEEE/ACM International Conference on Automated Software Engineering, ASE 2016, pages 87–98, New York, NY, USA, 2016. ACM. [64] Xiaojun Xu, Chang Liu, Qian Feng, Heng Yin, Le Song, and Dawn Song. Neural network-based graph embedding for cross-platform binary code similarity detection. CoRR, abs/1708.06525, 2017. [65] Yixiao Yang, Yu Jiang, Ming Gu, Jiaguang Sun, Jian Gao, and Han Liu. A language model for statements of software code. In Proceedings of the 32Nd IEEE/ACM International Conference on Automated Software Engineering, ASE 2017, pages 682–687, Piscataway, NJ, USA, 2017. IEEE Press. 13
2018
110
7,265
PAC-Bayes Tree: weighted subtrees with guarantees Tin Nguyen∗ MIT EECS tdn@mit.edu Samory Kpotufe Princeton University ORFE samory@princeton.edu Abstract We present a weighted-majority classification approach over subtrees of a fixed tree, which provably achieves excess-risk of the same order as the best tree-pruning. Furthermore, the computational efficiency of pruning is maintained at both training and testing time despite having to aggregate over an exponential number of subtrees. We believe this is the first subtree aggregation approach with such guarantees. The guarantees are obtained via a simple combination of insights from PAC-Bayes theory, which we believe should be of independent interest, as it generically implies consistency for weighted-voting classifiers w.r.t. Bayes – while, in contrast, usual PAC-bayes approaches only establish consistency of Gibbs classifiers. 1 Introduction Classification trees endure as popular tools in data analysis, offering both efficient prediction and interpretability – yet they remain hard to analyze in general. So far there are two main approaches with generalization guarantees: in both approaches, a large tree (possibly overfitting the data) is first obtained; one approach is then to prune back this tree down to a subtree2 that generalizes better; the alternative approach is to combine all possible subtrees of the tree by weighted majority vote. Interestingly, while both approaches are competitive with other practical heuristics, it remains unclear whether the alternative of weighting subtrees enjoys the same strong generalization guarantees as pruning; in particular, no weighting scheme to date has been shown to be statistically consistent, let alone attain the same tight generalization rates (in terms of excess risk) as pruning approaches. In this work, we consider a new weighting scheme based on PAC-Bayesian insights [1], that (a) is consistent and attains the same generalization rates as the best pruning of a tree, (b) is efficiently computable at both training and testing time, and (c) competes against pruning approaches on real-world data. To the best of our knowledge, this is the first practical scheme with such guarantees. The main technical hurdle has to do with a subtle tension between goals (a) and (b) above. Namely, let T0 denote a large tree built on n datapoints, usually a binary tree with O(n) nodes; the family of subtrees T of T0 is typically of exponential size in n [2], so a naive voting scheme that requires visiting all subtrees is impractical; on the other hand it is known that if the weights decompose favorably over the leaves of T (e.g., multiplicative over leaves) then efficient classification is possible. Unfortunately, while various such multiplicative weights have been designed for voting with subtrees [3, 4, 5], they are not known to yield statistically consistent prediction. In fact, the best known result to date [5] presents a weighting scheme which can provably achieve an excess risk3 (over the Bayes classifier) of the form oP (1) + C · minT R(hT ), where R(hT ) denotes the misclassification rate of a classifier hT based on subtree T. In other words, the excess risk might never go to 0 as sample size increases, which in contrast is a basic property of the pruning alternative. Furthermore, the approach ∗The majority of the research was done when the author was an undergraduate student at Princeton University ORFE. 2Considering only subtrees that partition the data space. 3The excess risk of a classifier h over the Bayes hB (which minimizes R(h) over any h) is R(h) −R(hB). 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. of [5], based on l1-risk minimization, does not trivially extend to multiclass classification, which is most common in practice. Our approach is designed for multiclass by default. Statistical contribution. PAC-Bayesian theory [1, 6, 7, 8] offers useful insights into designing weighting schemes with generalization guarantees (w.r.t. a prior distribution P over classifiers). However, a direct application of existing results fails to yield a consistent weighted-majority scheme. This is because PAC-Bayes results are primarily concerned with so-called Gibbs classifiers, which in our context corresponds to predicting with a random classifier hT drawn according to a weightdistribution Q over subtrees of T0. Instead, we are interested in Q-weighted majority classifiers hQ. Unfortunately the corresponding error R(hQ) can be twice the risk R(Q) = EhT ∼QR(hT ) of the corresponding Gibbs classifier: this then results (at best – see overview in Section 2.2) in an excess risk of the form (R(hQ) −R(hB)) ≤(R(Q) −R(hB)) + R(Q) = oP (1) + R(hB), which, similar to [5], does not go to 0. So far, this problem is best addressed in PAC-Bayes results such as the MinCq bound in [6, 8] on R(hQ), which is tighter in the presence of low correlation between base classifiers. In contrast, our PAC-Bayes result applies even without low correlation between base classifiers, and allows an excess risk oP (1) + (C/n) · minT log(1/P(T)) →0 (Proposition 2). This first result is in fact of general interest since it extends beyond subtrees to any family of classifiers, and is obtained by carefully combining existing arguments from PAC-Bayes analysis. However, our basic PAC-Bayes result alone does not ensure convergence at the same rate as that of the best pruning approaches. This requires designing a prior P that scales properly with the size of subtrees T of T0. For instance, suppose P were uniform over all subtrees of T0, then log(1/(P(T)) = Ω(n), yielding a vacuous excess risk. We show through information-theoretic arguments that an appropriate prior P can be designed to yield rates of convergence of the same order as that of the best pruning of T0. In particular, our resulting weighting scheme maintains ideal properties of pruning approaches such as adaptivity to the intrinsic dimension of data (see e.g. [9]). Algorithmic contribution. We show that we can design a prior P which, while meeting the above statistical constraints, yields posterior weights that decompose favorably over the leaves of a subtree T. As a result of this decomposition, the weights of all subtrees can be recovered by simply maintaining corresponding weights at the nodes of the original tree T0 for efficient classification in time O(log n) (this is illustrated in Figure 1). We then propose an efficient approach to obtain weights at the nodes of T0, consisting of concurrent top-down and bottom-up dynamic programs that run in O(n) time. These match the algorithmic complexity of the most efficient pruning approaches, and thus offer a practical alternative. Our theoretical results are then verified in experiments over many real-world datasets. In particular we show that our weighted-voting scheme achieves similar or better error than pruning on practical problems, as suggested by our theoretical results. Paper Organization. We start in Section 2 with theoretical setup and an overview of PAC-Bayes analysis. This is followed in Section 3 with an overview of our statistical results, and in Section 4 with algorithmic results. Our experimental analysis is then presented in Section 5. 2 Preliminaries 2.1 Classification setup We consider a multiclass setup where the input X ⊂X, for a bounded subset X of RD, possibly of lower intrinsic dimension. For simplicity of presentation we assume X ⊂[0, 1]D (as in normalized data). The output Y ⊂[L], where we use the notation [L] = {1, 2, . . . , L} for L ∈N. We are to learn a classifier h : X 7→[L], given an i.i.d. training sample {Xi, Yi}2n i=1 of size 2n, from an unknown distribution over X, Y . Throughout, we let S .= {Xi, Yi}n i=1 and S0 .= {Xi, Yi}2n i=n+1, which will serve later to simplify dependencies in our analysis. Our performance measure is as follows. Definition 1. The risk of a classifier h is given as R(h) = E[h(X) ̸= Y ]. This is minimized by the Bayes classifier hB(x) .= argmaxl∈[L] P (Y = l|X = x). Therefore, for any classifier ˆh learned over a sample {Xi, Yi}i, we are interested in the excess-risk E(ˆh) .= R(ˆh) −R(hB). 2 Figure 1: A partition tree T0 over input space X, and a query x ∈X to classify. The leaves of T0 are the 4 cells shown left, and the root is X. A query x follows a single path (shown in bold) from the root down to a leaf. A key insight towards efficient weighted-voting is that this path visits all leaves (containing x) of any subtree of T0. Therefore, weighted voting might be implemented by keeping a weight w(A) at any node A along the path, where w(A) aggregates the weights Q(T) of every subtree T that has A as a leaf. This is feasible if we can restrict Q(T) to be multiplicative over the leaves of T, without trading off accuracy. Here we are interested in aggregations of classification trees, defined as follows. Definition 2. A hierarchical partition or (space) partition-tree T of X is a collection of nested partitions of X; this is viewed as a tree where each node is a subset A of X, each child A′ of a node A is a subset of A, and whose collection of leaves, denoted π(T), is a partition of X. A classification tree hT on X is a labeled partition-tree T of X: each leaf A ∈π(T) is assigned a label l = l(A) ∈[L]; the classification rule is simply hT (x) = l(A) for any x ∈A. Given an initial tree T0, we will consider only subtrees T of T0 that form a hierarchical partition of X, and we henceforth use the term subtrees (of T0) without additional qualification. Finally, aggregation (of subtrees of T0) consists of majority-voting as defined below. Definition 3. Let H denote a discrete family of classifiers h : X 7→[L], and let Q denote a distribution over H. The Q-majority classifier hQ .= hQ(H) is one satisfying for any x ∈X hQ(x) = argmax l∈[L] X h∈H,h(x)=l Q(h). Our oracle rates of Theorem 1 requires no additional assumptions; however, the resulting corollary is stated under standard distributional conditions that characterize convergence rates for tree-prunings. 2.2 PAC-Bayes Overview PAC-Bayes analysis develops tools to bound the error of a Gibbs classifier, i.e. one that randomly samples a classifier h ∼Q over a family of classifiers H. In this work we are interested in families {hT } defined over subtrees of an initial tree T0. Here we present some basic PAC-Bayes result which we extend for our analysis. While these results are generally presented for classification risk R (defined above), we keep our presentation generic, as we show later that a different choice of risk leads to stronger results for R than what is possible through direct application of existing results. Generic Setup. Consider a random vector Z, and an i.i.d sample Z[n] = {Zi}n i=1. Let Z be the support of Z, and L = {ℓh : h ∈H} be a loss class indexed by h ∈H – discrete, and where ℓh : Z →[0, 1]. For h ∈H, the loss ℓh induces the following risk and empirical counterparts: RL(h) .= EZℓh(Z), bRL(h, Z[n]) .= 1 n n X i=1 ℓh(Zi). In particular, for the above classification risk R, and Z ≜(X, Y ), we have ℓh(Z) = 1 {h(X) ̸= Y }. Given a distribution Q over H, the risk (and empirical counterpart) of the Gibbs classifier is then RL(Q) .= Eh∼QRL(h), bRL(Q, Z[n]) .= Eh∼Q bRL(h, Z[n]). 3 PAC-Bayesian results bound RL(Q) in terms of bRL(Q, Z[n]), uniformly over any distribution Q, provided a fixed prior distribution P over H. We will build on the following form of [10] which yields an upper-bound that is convex in Q (and therefore can be optimized for a good posterior Q∗). Proposition 1 (PAC-Bayes on RL [10]). Fix a prior P supported on H, and let n ≥8 and δ ∈(0, 1). With probability at least 1 −δ over Z[n], simultaneously for all λ ∈(0, 2) and all posteriors Q over H: RL(Q) ≤ bRL(Q, Z[n]) 1 −λ/2 + Dkl (Q∥P) + log (2√n/δ) λ(1 −λ/2)n , where Dkl (Q∥P) .= EQlog Q(h) P (h) is the Kullback-Leibler divergence between Q and P. Choice of posterior Q∗. Let Q∗minimize the above upper-bound, and let h∗minimize RL over H. Then, by letting Qh∗put all mass on h∗, we automatically get that, with probability at least 1 −2δ: RL(Q∗) ≤RL(Qh∗) ≤C ·  bRL(h∗, Z[n]) + log(1/P(h∗)) + log(n/δ) n  ≤C · RL(h∗) + log(1/P(h∗)) + log(n/δ) n + r log(1/δ) n ! , (1) where the last inequality results from bounding |RL(h∗) −bRL(h∗, Z[n])| using Chernoff. Unfortunately, such direct application is not enough for our purpose when RL = R. We want to bound the excess risk E(hQ) for a Q-majority classifier hQ over h′s ∈H. It is known that R(hQ) ≤2R(Q) which yields a bound of the form (1) on R(hQ∗); however this implies at best that R(hQ∗) →2R(hB) even if E(h∗) →0 (which is generally the case for optimal tree-pruning h∗ T [9]). This is a general problem in converting from Gibbs error to that of majority-voting, and is studied for instance in [6, 8] where it is shown that R(hQ) can actually be smaller in some situations. Improved choice of Q∗. Here, we want to design Q∗such that R(hQ∗) →R(hB) (i.e. E(hQ∗) → 0) at the same rate as E(h∗ T ) →0 always. Our solution relies on a proper choice of loss ℓh that relates most directly to excess risk E that the 0-1 loss 1 {h(x) ̸= y}. A first candidate is to define ℓh(x, y) as eh(x, y) .= 1 {h(x) ̸= y} −1 {hB(x) ̸= y} since E(h) = E eh(X, Y ); however eh(x, y) /∈[0, 1] and can take negative values. This is resolved by considering an intermediate loss eh(x) = EY |xeh(x, Y ) ∈[0, 1] to be related back to eh(x, y) by integration in a suitable order. 3 Statistical results 3.1 Basic PAC-Bayes result We start with the following intermediate loss family over classifiers h, w.r.t. the Bayes classifier hB. Definition 4. Let eh(x, y) .= 1 {h(x) ̸= y} −1 {hB(x) ̸= y}, and eh(x) = EY |xeh(x, Y ), and eE(h, S) .= 1 n n X i=1 eh(Xi), and bE(h, S) .= 1 n n X i=1 eh(Xi, Yi). Our first contribution is a basic PAC-Bayes result which the rest of our analysis builds on. Proposition 2 (PAC-Bayes on excess risk). Let H denote a discrete family of classifiers, and fix a prior distribution P with support H. Let n ≥8 and δ ∈(0, 1). Suppose, there exists bounded functions b∆n(h, S), ∆n(h), h ∈H (depending on δ) such that P  ∀h ∈H, eE(h, S) ≤bE(h, S) + b∆n(h, S)  ≥1 −δ, inf h∈H P  b∆n(h, S) ≤∆n(h)  ≥1 −δ. For any λ ∈(0, 2), consider the following posterior over H: Q∗ λ(h) = 1 c e−nλ( b R(h,S)+b∆n(h,S))P(h), for c = Eh∼P e−nλ( b R(h,S)+b∆n(h,S)). (2) Then, with probability at least 1 −4δ over S, simultaneously for all λ ∈(0, 2): E(hQ∗ λ) ≤ L 1 −λ/2 inf h∈H  E(h) + ∆n(h) + log(1/P(h)) λn + log 2√n δ + λ q 2n log 1 δ λn  . 4 Proposition 2 builds on Proposition 1 by first taking RL(h) to be E(h), bRL(h) to be eE(h), and Z to be X. The bound in Proposition 2 is then obtained by optimizing over Q for fixed λ. Since this bound is on excess error (rather than error), optimizing over λ can only improve constants, while the choice of prior P is crucial in obtaining optimal rates as |H| →∞. Such choice is treated next. 3.2 Oracle risk for trees (as H .= H(T0) grows in size with T0) We start with the following definitions on classifiers of interest and related quantities. Definition 5. Let T0 be a binary partition-tree of X obtained from data S0, of depth D0. Consider a family of classification trees H(T0) .= {hT } indexed by subtrees T of T0, and where hT defines a fixed labeling l(A) of nodes A ∈π(T), e.g., l(A) .= majority label in Y if A ∩S0 ̸= ∅. Furthermore, for any node A of T0, let ˆp(A, S) denote the empirical mass of A under S and p(A) be the population mass. Then for any subtree T of T0, let |T| be the number of nodes in T and define b∆n(hT , S) .= X A∈π(T ) r ˆp(A, S)2 log(|T0| /δ) n , and (3) ∆n(hT ) .= X A∈π(T ) s 8 max  p(A), (2 + log D) · D0 + log(1/δ) n log(|T0| /δ) n . (4) Remark 1. In practice, we might start with a space partitioning tree T ′ 0 (e.g., a dyadic tree, or KD-tree) which partitions [0, 1]D, rather than the support X. We then view T0 as the intersection of T ′ 0 with X. Our main theorem below follows from Proposition 2 on excess risk, by showing (a) that the above definition of b∆n(hT , S) and ∆n(hT ) satisfies the conditions of Proposition 2, and (b) that there exists a proper prior P such that log(1/P(T)) ∼|π(T)|, i.e., depends just on the subtree complexity rather than on that of T0. The main technicality in showing (b) stems from the fact that P needs to be a proper distribution (i.e. P T P(T) = 1) without requiring too large a normalization constant (remember that the number of subtrees can be exponential in the size of T0). This is established through arguments from coding theory, and in particular Kraft-McMillan inequality. Theorem 1 (Oracle risk for trees). Let the prior satisfy P(hT ) .= (1/CP )e−3D0·|π(T )| for a normalizing constant CP , and consider the corresponding posterior Q∗ λ as defined in Equation 2, such that, with probability at least 1 −4δ over S, for all λ ∈(0, 2), the excess risk E(hQ∗ λ) of the majority-classifier is at most L 1 −λ/2  · min hT ∈H(T0)  E(hT ) + ∆n(hT ) + 3D0 · |π(T)| λn + log 2√n δ + λ q 2n log 1 δ λn  . From Theorem 1 we can deduce that the majority classifier hQ∗ λ is consistent whenever the approach of pruning to the best subtree is consistent (typically, minhT E(hT ) + (D0 |π(T)|)/n = oP (1)). Furthermore, we can infer that E(hQ∗ λ) converges at the same rate as pruning approaches: the terms ∆n(hT ) and D0 · |π(T)|/n can be shown to be typically, of lower or similar order as E(hT ) for the best subtree classifier hT . These remarks are formalized next and result in Corollary 1 below. 3.3 Rate of convergence Much of known rates for tree-pruning are established for dyadic trees (see e.g. [9, 11]), due to their simplicity, under nonparametric assumptions on E[Y |X]. Thus, we adopt such standard assumptions here to illustrate the rates achievable by hQ∗ λ, following the more general statement of Theorem 1. The first standard assumption below restricts how fast class probabilities change over space. Assumption 1. Consider the so-called regression function η(x) ∈RL with coordinate ηl(x) .= EY |x1 {Y = l} , l ∈[L]. We assume η is α-Hölder for α ∈(0, 1], i.e., ∃λ such that ∀x, x′ ∈X, ∥η(x) −η(x′)∥≤λ ∥x −x′∥α . 5 Next, we illustrate some of the key conditions verified by dyadic trees which standard results build on. In particular, we want the diameters of nodes of T0 to decrease relatively fast from the root down. Assumption 2 (Conditions on T0). The tree T0 is obtained as the intersection of X with dyadic partition of [0, 1]D (e.g. by cycling though coordinates) of depth D0 = O(D log n) and partition size |T0| = O(n). In particular, we emphasize that the following conditions on subtrees then hold. For any subtree T of T0, let r(T) denote the maximum diameter of leaves of T (viewed as subsets of X). There exist C1, C2, d > 0 such that: For all (C1/n) < r ≤1, there exists a subtree T of T0 such that r(T) ≤r and |π(T)| ≤C2r−d. The above conditions on subtrees are known to approximately hold for other procedures such as KD-trees, and PCA-trees; in this sense, analyses of dyadic trees do yield some insights into the performance other approaches. The quantity d captures the intrinsic dimension (e.g., doubling or box dimension) of the data space X or is often of the same order [12, 13, 14]. Under the above two assumptions, it can be shown through standard arguments that the excess error of the best pruning, namely minhT ∈H(T0) E(hT ) is of order n−α/(2α+d), which is tight (see e.g. minimax lower-bounds of [15]). The following corollary to Theorem 1 states that such a rate, up to a logarithmic factor of n, is also attained by majority classification under Q∗ λ. Corollary 1 (Adaptive rate of convergence). Assume that for any cell A of T0, the labeling l(A) corresponds to the majority label in A (under S0) if A ∩S0 ̸= ∅, or l(A) = 1 otherwise. Then, under Assumptions 1 and 2, and the conditions of Theorem 1, there exists a constant C such that: ES0,SE(hQ∗ λ) ≤C log n n α/(2α+d) . 4 Algorithmic Results Here we show that hQ can be efficiently implemented by storing appropriate weights at nodes of T0. Let wQ(A) .= P hT :A∈π(T ) Q(hT ) aggregate weights over all subtrees T of T0 having A as a leaf. Then hQ(x) = argmaxl∈[L] P A∈path(x),l(A)=l wQ(A), where path(x) denotes all nodes of T0 containing x. Thus, hQ(x) is computable from weights proportional to wQ(A) at every node. We show in what follows that we can efficiently obtain w(A) = C·wQ∗ λ(A) by dynamic-programming by ensuring that Q∗ λ(hT ) is multiplicative over π(T). This is the case, given our choice of prior from Theorem 1: we have Q∗ λ(hT ) = (1/CQ∗ λ) · exp(P A∈π(T ) φ(A)) where φ(A) .= −λ X i:Xi∈A∩S 1 {Yi ̸= l(A)} −nλ r ˆp(A, S)2 log(|T0| /δ) n −3D0. We can then compute w(A) .= CQ∗ λ · wQ∗ λ(A) via dynamic-programming. The intuition is similar to that in [5], however, the particular form of our weights require a two-pass dynamic program (bottom-up and top-down) rather than the single pass in [5]. Namely, w(A) divides into subweights that any node A′ might contribute up or down the tree. Let α(A) .= X hT :A∈π(T ) exp  X A′̸=A,A′∈π(T ) φ(A′)  , (5) so that w(A) = eφ(A) · α(A). As we will show (proof of Theorem 2), α(A) decomposes into contributions from the parent Ap and sibling As of A, i.e., α(A) = α(Ap)β(As) where β(As) is given as (writing T A 0 for the subtree of T0 rooted at A, and T ⪯T ′ when T is a subtree of T ′): β(As) = X T ⪯T As 0 exp  X A′∈π(T ) φ(A′)  . (6) The contributions β(A) are first computed using the bottom-up Algorithm 1, and the contributions α(A) and final weights w(A) are then computed using the top-down Algorithm 2. For ease of presentation, these routines run on a full-binary tree version ¯T0 of T0, obtained by adding a dummy child to each node A that has a single child in T0. Each dummy node A′ has φ(A′) = 0. 6 Algorithm 1 Bottom-up pass for A ∈π( ¯T0) do β(A) ←eφ(A) end for for i ←D0 to 0 do Ai ←set of nodes of ¯T0 at depth i for A ∈Ai \ π( ¯T0) do N ←the children nodes of A β(A) ←eφ(A) + Q A′∈N β(A′) end for end for Algorithm 2 Top-down pass α(root) ←1 for i ←1 to D0 do Ai ←set of nodes of ¯T0 at depth i for A ∈Ai do Ap, As ←parent of node A, sibling of node A α(A) ←α(Ap)β(As) w(A) ←eφ(A)α(A) end for end for Theorem 2 (Computing w(A)). Running Algorithm 1, then 2, we obtain w(A) .= CQ∗ λ · wQ∗ λ(A), where Q∗ λ is as defined in Theorem 1. Furthermore, the combined runtime of Algorithms 1, then 2 is 2| ¯T0| ≤4|T0|, where |T| is the number of nodes in T. 5 Experiments Table 1: UCI datasets Name (abbreviation) Features count Labels count Train size Spambase (spam) 57 2 2601 EEG Eye State (eeg) 14 2 12980 Epileptic Seizure Recognition (epileptic) 178 2 9500 Crowdsourced Mapping (crowd) 28 6 8546 Wine Quality (wine) 12 11 4497 Optical Recognition of Handwritten Digits (digit) 64 10 3620 Letter Recognition (letter) 16 26 18000 Here we present experiments on real-world datasets, for two common partition-tree approaches, dyadic trees and KD-trees. The various datasets are described in Table 1. The main baseline we compare against, is a popular efficient pruning heuristic where a subtree of T0 is selected to minimize the penalized error C1(hT ) = bR(hT , S) + λ |π(T,S)| n . We also compare against other tree-based approaches that are theoretically driven and efficient. First is a pruning approach proposed in [16], which picks a subtree minimizing the penalized error C2(hT ) = bR(hT , S) + λ P A q max ˆp(A, S), ∥A∥ n  · ∥A∥ n , where ∥A∥denotes the depth of node A in T0. We note that, here we choose a form of C2 that avoids theoretical constants that were of a technical nature, but instead let λ account for such. We report this approach as SN-pruning. Second is the majority classifier of [5], which however is geared towards binary classification as it requires regression-type estimates in [0, 1] at each node. This is denoted HS-vote. All the above approaches have efficient dynamic programs that run in time O(|T0|), and all predict in time O(height(T0)). The same holds for our PAC-Bayes approach as discussed above in Section 4. Practical implementation of PAC-Bayes tree. Our implementation rests on the theoretical insights of Theorem 1, however we avoid some of the technical details that were needed for rigor, 7 such as sample splitting and overly conservative constants in concentration results. Instead we advise cross-validating for such constants in the prior and posterior definitions. Namely, we first set P(hT ) ∝exp(−|π(T, S)|), where π(T, S) denotes the leaves of T containing data. We set ∆n(hT , S) = P A∈π(T,S) q ˆp(A,S) n . The posterior is then set as Q∗(hT ) ∝exp(−n(λ1 bR(hT , S) + λ2∆n(hT , S)))P(hT ), where λ1, λ2 account for concentration terms to be tuned to the data. Finally, we use the entire data to construct T0 and compute weights, i.e., S0 = S, as interdependencies are in fact less of an issue in practice. We note, that the above alternative theoretical approaches, SN-pruning and HS-vote, are also assumed (in theory) to work on a sample independent choice of T0 (or equivalently built and labeled on a separate sample S0), but are implemented here on the entire data to similarly take advantage of larger data sizes. The baseline pruning heuristic is by default always implemented on the full data. Experimental setup and results. The data is preprocessed as follows: for dyadic trees, data is scaled to be in [0, 1]D, while for KD-trees data is normalized accross each coordinate by standard deviation. Testing data is fixed to be of size 2000, while each experiment is ran 5 times (with random choice of training data of size reported in Table 1) and average performance is reported. In each experiment, all parameters are chosen by 2-fold cross-validation for each of the procedures. The log-grid is 10 values, equally spaced in logarithm, from 2−8 to 26 while the linear-grid is 10 linearly-spaced values between half the best value of the log-search and twice the best value of the log-search. Table 2 reports classification performance of the various theoretical methods relative to the baseline pruning heuristic. We see that proposed PAC-Bayes tree achieves competitive performance against all other alternatives. All the approaches have similar performance accross datasets, with some working slightly better on particular datasets. Figure 2 further illustrates typical performance on multiclass problems as training size varies. Table 2: Ratio of classification error over that of the default pruning baseline: bold indicates best results across methods, while blue indicates improvement over baseline; N/A means the algorithm was not run on the task. T0 ≡dyadic tree T0 ≡KD tree Dataset SN-pruning PAC-Bayes tree HS-vote SN-pruning PAC-Bayes tree HS-vote spam 1.118 0.975 1.224 1.048 1.020 1.075 eeg 0.979 0.993 1.029 1.000 0.990 1.000 epileptic 0.993 0.992 0.951 0.977 0.987 0.907 crowd 0.991 1.020 N/A 1.001 1.017 N/A wine 1.035 0.991 N/A 1.010 0.997 N/A digit 1.000 0.936 N/A 0.994 0.997 N/A letter 1.005 0.993 N/A 1.000 1.001 N/A Figure 2: Classification error versus training size 8 References [1] David A McAllester. Some PAC-Bayesian theorems. Machine Learning, 37(3):355–363, 1999. [2] László A Székely and Hua Wang. On subtrees of trees. Advances in Applied Mathematics, 34(1):138–155, 2005. [3] Trevor Hastie and Daryl Pregibon. Shrinking trees. AT & T Bell Laboratories, 1990. [4] Wray Buntine and Tim Niblett. A further comparison of splitting rules for decision-tree induction. Machine Learning, 8(1):75–85, 1992. [5] 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. [6] Alexandre Lacasse, François Laviolette, Mario Marchand, Pascal Germain, and Nicolas Usunier. PACBayes bounds for the risk of the majority vote and the variance of the Gibbs classifier. In Advances in Neural information processing systems, pages 769–776, 2007. [7] John Langford and John Shawe-Taylor. PAC-Bayes & margins. In Advances in neural information processing systems, pages 439–446, 2003. [8] Pascal Germain, Alexandre Lacasse, Francois Laviolette, Mario Marchand, and Jean-Francis Roy. Risk Bounds for the Majority Vote: From a PAC-Bayesian Analysis to a Learning Algorithm. Journal of Machine Learning Research, 16:787–860, 2015. [9] C. Scott and R.D. Nowak. Minimax-optimal classification with dyadic decision trees. IEEE Transactions on Information Theory, 52, 2006. [10] Niklas Thiemann, Christian Igel, Olivier Wintenberger, and Yevgeny Seldin. A Strongly Quasiconvex PAC-Bayesian bound. In Steve Hanneke and Lev Reyzin, editors, Proceedings of the 28th International Conference on Algorithmic Learning Theory, volume 76 of Proceedings of Machine Learning Research, pages 466–492, Kyoto University, Kyoto, Japan, 15–17 Oct 2017. PMLR. [11] L. Gyorfi, M. Kohler, A. Krzyzak, and H. Walk. A Distribution Free Theory of Nonparametric Regression. Springer, New York, NY, 2002. [12] Nakul Verma, Samory Kpotufe, and Sanjoy Dasgupta. Which spatial partition trees are adaptive to intrinsic dimension? In Proceedings of the Twenty-Fifth Conference on Uncertainty in Artificial Intelligence, pages 565–574. AUAI Press, 2009. [13] Samory Kpotufe and Sanjoy Dasgupta. A tree-based regressor that adapts to intrinsic dimension. Journal of Computer and System Sciences, 78(5):1496–1515, 2012. [14] Santosh Vempala. Randomly-oriented kd trees adapt to intrinsic dimension. In FSTTCS, volume 18, pages 48–57. Citeseer, 2012. [15] Jean-Yves Audibert and Alexandre B Tsybakov. Fast learning rates for plug-in classifiers. The Annals of Statistics, 35(2):608–633, 2007. [16] Clayton Scott. Dyadic Decision Trees. PhD thesis, Rice University, 2004. 9
2018
111
7,266
Amortized Inference Regularization Rui Shu Stanford University ruishu@stanford.edu Hung H. Bui DeepMind buih@google.com Shengjia Zhao Stanford University sjzhao@stanford.edu Mykel J. Kochenderfer Stanford University mykel@stanford.edu Stefano Ermon Stanford University ermon@cs.stanford.edu Abstract The variational autoencoder (VAE) is a popular model for density estimation and representation learning. Canonically, the variational principle suggests to prefer an expressive inference model so that the variational approximation is accurate. However, it is often overlooked that an overly-expressive inference model can be detrimental to the test set performance of both the amortized posterior approximator and, more importantly, the generative density estimator. In this paper, we leverage the fact that VAEs rely on amortized inference and propose techniques for amortized inference regularization (AIR) that control the smoothness of the inference model. We demonstrate that, by applying AIR, it is possible to improve VAE generalization on both inference and generative performance. Our paper challenges the belief that amortized inference is simply a mechanism for approximating maximum likelihood training and illustrates that regularization of the amortization family provides a new direction for understanding and improving generalization in VAEs. 1 Introduction Variational autoencoders are a class of generative models with widespread applications in density estimation, semi-supervised learning, and representation learning [1, 2, 3, 4]. A popular approach for the training of such models is to maximize the log-likelihood of the training data. However, maximum likelihood is often intractable due to the presence of latent variables. Variational Bayes resolves this issue by constructing a tractable lower bound of the log-likelihood and maximizing the lower bound instead. Classically, Variational Bayes introduces per-sample approximate proposal distributions that need to be optimized using a process called variational inference. However, per-sample optimization incurs a high computational cost. A key contribution of the variational autoencoding framework is the observation that the cost of variational inference can be amortized by using an amortized inference model that learns an efficient mapping from samples to proposal distributions. This perspective portrays amortized inference as a tool for efficiently approximating maximum likelihood training. Many techniques have since been proposed to expand the expressivity of the amortized inference model in order to better approximate maximum likelihood training [5, 6, 7, 8]. In this paper, we challenge the conventional role that amortized inference plays in variational autoencoders. For datasets where the generative model is prone to overfitting, we show that having an amortized inference model actually provides a new and effective way to regularize maximum likelihood training. Rather than making the amortized inference model more expressive, we propose instead to restrict the capacity of the amortization family. Through amortized inference regularization (AIR), we show that it is possible to reduce the inference gap and increase the log-likelihood performance on the test set. We propose several techniques for AIR and provide extensive theoretical and empirical analyses of our proposed techniques when applied to the variational autoencoder and the 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. importance-weighted autoencoder. By rethinking the role of the amortized inference model, amortized inference regularization provides a new direction for studying and improving the generalization performance of latent variable models. 2 Background and Notation 2.1 Variational Inference and the Evidence Lower Bound Consider a joint distribution p✓(x, z) parameterized by ✓, where x 2 X is observed and z 2 Z is latent. Given a uniform distribution ˆp(x) over the dataset D = {x(i)}, maximum likelihood estimation performs model selection using the objective max ✓ Eˆp(x) ln p✓(x) = max ✓ Eˆp(x) ln Z z p✓(x, z)dz. (1) However, marginalization of the latent variable is often intractable; to address this issue, it is common to employ the variational principle to maximize the following lower bound max ✓ Eˆp(x)  ln p✓(x) −min q2Q D(q(z) k p✓(z | x)) # = max ✓ Eˆp(x)  max q2Q Eq(z) ln p✓(x, z) q(z) # , (2) where D is the Kullback-Leibler divergence and Q is a variational family. This lower bound, commonly called the evidence lower bound (ELBO), converts log-likelihood estimation into a tractable optimization problem. Since the lower bound holds for any q, the variational family Q can be chosen to ensure that q(z) is easily computable, and the lower bound is optimized to select the best proposal distribution q⇤ x(z) for each x 2 D. 2.2 Amortization and Variational Autoencoders [1, 9] proposed to construct p(x | z) using a parametric function g✓2 G(P) : Z ! P, where P is some family of distributions over x, and G is a family of functions indexed by parameters ✓. To expedite training, they observed that it is possible to amortize the computational cost of variational inference by framing the per-sample optimization process as a regression problem; rather than solving for the optimal proposal q⇤ x(z) directly, they instead use a recognition model fφ 2 F(Q) : X ! Q to predict q⇤ x(z). The functions (fφ, g✓) can be concisely represented as conditional distributions, where p✓(x | z) = g✓(z)(x) (3) qφ(z | x) = fφ(x)(z). (4) The use of amortized inference yields the variational autoencoder, which is trained to maximize the variational autoencoder objective max ✓,φ Eˆp(x)  Eqφ(z|x) ln p(z)p✓(x | z) qφ(z | x) # = max f2F(Q),g2G(P) Eˆp(x)  Ez⇠f(x) ln p(z)g(z)(x) f(x)(z) # . (5) We omit the dependency of (p(z), g) on ✓and f on φ for notational simplicity. In addition to the typical presentation of the variational autoencoder objective (LHS), we also show an alternative formulation (RHS) that reveals the influence of the model capacities F, G and distribution family capacities Q, P on the objective function. In this paper, we use (qφ, f) interchangeably, depending on the choice of emphasis. To highlight the relationship between the ELBO in Eq. (2) and the standard variational autoencoder objective in Eq. (5), we shall also refer to the latter as the amortized ELBO. 2.3 Amortized Inference Suboptimality For a fixed generative model, the optimal unamortized and amortized inference models are q⇤ x = arg max q2Q Eq(z)  ln p✓(x, z) q(z) # , for each x 2 D (6) f ⇤= arg max f2F Eˆp(x)  Ez⇠f(x) ln p✓(x, z) f(x)(z) # . (7) 2 A notable consequence of using an amortization family to approximate variational inference is that Eq. (5) is a lower bound of Eq. (2). This naturally raises the question of whether the learned inference model can accurately approximate the mapping x 7! q⇤ x(z). To address this question, [10] defined the inference, approximation, and amortization gaps as ∆inf(ˆp) = Eˆp(x)D(f ⇤(x) k p✓(z | x)) (8) ∆ap(ˆp) = Eˆp(x)D(q⇤ x(z) k p✓(z | x)) (9) ∆am(ˆp) = ∆inf(ˆp) −∆ap(ˆp), (10) Studies have found that the inference gap is non-negligible [11] and primarily attributable to the presence of a large amortization gap [10]. The amortization gap raises two critical considerations. On the one hand, we wish to reduce the training amortization gap ∆am(ˆptrain). If the family F is too low in capacity, then it is unable to approximate x 7! q⇤ x and will thus increase the amortization gap. Motivated by this perspective, [5, 12] proposed to reduce the training amortization gap by performing stochastic variational inference on top of amortized inference. In this paper, we take the opposing perspective that an over-expressive F hurts generalization (see Appendix A) and that restricting the capacity of F is a form of regularization that can prevent both the inference and generative models from overfitting to the training set. 3 Amortized Inference Regularization in Variational Autoencoders Many methods have been proposed to expand the variational and amortization families in order to better approximate maximum likelihood training [5, 6, 7, 8, 13, 14]. We argue, however, that achieving a better approximation to maximum likelihood training is not necessarily the best training objective, even if the end goal is test set density estimation. In general, it may be beneficial to regularize the maximum likelihood training objective. Importantly, we observe that the evidence lower bound in Eq. (2) admits a natural interpretation as implicitly regularizing maximum likelihood training max ✓ $ log-likelihood z }| { Eˆp(x) [ln p✓(x)] − regularizer R(✓;Q) z }| { Eˆp(x) min q2Q D(q(z) k p✓(z | x)) ) . (11) This formulation exposes the ELBO as a data-dependent regularized maximum likelihood objective. For infinite capacity Q, R(✓; Q) is zero for all ✓2 ⇥, and the objective reduces to maximum likelihood. When Q is the set of Gaussian distributions (as is the case in the standard VAE), then R(✓; Q) is zero only if p✓(z | x) is Gaussian for all x 2 D. In other words, a Gaussian variational family regularizes the true posterior p✓(z | x) toward being Gaussian [10]. Careful selection of the variational family to encourage p✓(z | x) to adopt certain properties (e.g. unimodality, fully-factorized posterior, etc.) can thus be considered a special case of posterior regularization [15, 16]. Unlike traditional variational techniques, the variational autoencoder introduces an amortized inference model f 2 F and thus a new source of posterior regularization. max ✓ $ log-likelihood z }| { Eˆp(x) [ln p✓(x)] − regularizer R(✓;Q,F) z }| { min f2F(Q) Eˆp(x) [D(f(x) k p✓(z | x))] ) . (12) In contrast to unamortized variational inference, the introduction of the amortization family F forces the inference model to consider the global structure of how X maps to Q. We thus define amortized inference regularization as the strategy of restricting the inference model capacity F to satisfy certain desiderata. In this paper, we explore a special case of AIR where a candidate model f 2 F is penalized if it is not sufficiently smooth. We propose two models that encourage inference model smoothness and demonstrate that they can reduce the inference gap and increase log-likelihood on the test set. 3.1 Denoising Variational Autoencoder In this section, we propose using random perturbation training for amortized inference regularization. The resulting model—the denoising variational autoencoder (DVAE)—modifies the variational 3 autoencoder objective by injecting " noise into the inference model max ✓ $ Eˆp(x) [ln p✓(x)] − min f2F(Q) Eˆp(x)E" [D(f(x + ") k p✓(z | x))] ) . (13) Note that the noise term only appears in the regularizer term. We consider the case of zero-mean isotropic Gaussian noise " ⇠N(0, σI) and denote the denoising regularizer as R(✓; σ). At this point, we note that the DVAE was first described in [17]. However, our treatment of DVAE differs from [17]’s in both theoretical analysis and underlying motivation. We found that [17] incorrectly stated the tightness of the DVAE variational lower bound (see Appendix B). In contrast, our analysis demonstrates that the denoising objective smooths the inference model and necessarily lower bounds the original variational autoencoder objective (see Theorem 1 and Proposition 1). We now show that 1) the optimal DVAE amortized inference model is a kernel regression model and that 2) the variance of the noise " controls the smoothness of the optimal inference model. Lemma 1. For fixed (✓, σ, Q) and infinite capacity F, the inference model that optimizes the DVAE objective in Eq. (13) is the kernel regression model f ⇤ σ(x) = arg min q2Q n X i=1 wσ(x, x(i)) · D(q(z) k p✓(z | x(i))), (14) where wσ(x, x(i)) = Kσ(x,x(i)) P j Kσ(x,x(j)) and Kσ(x, y) = exp ⇣ −kx−yk 2σ2 ⌘ is the RBF kernel. Lemma 1 shows that the optimal denoising inference model f ⇤ σ is dependent on the noise level σ. The output of f ⇤ σ(x) is the proposal distribution that minimizes the weighted Kullback-Leibler (KL) divergence from f ⇤ σ(x) to each p✓(z | x(i)), where the weighting wσ(x, x(i)) depends on the distance kx −x(i)k and the bandwidth σ. When σ > 0, the amortized inference model forces neighboring points (x(i), x(j)) to have similar proposal distributions. Note that as σ increases, wσ(x, x(i)) ! 1 n, where n is the number of training samples. Controlling σ thus modulates the smoothness of f ⇤ σ (we say that f ⇤ σ is smooth if it maps similar inputs to similar outputs under some suitable measure of similarity). Intuitively, the denoising regularizer R(✓; σ) approximates the true posteriors with a “σ-smoothed” inference model and penalizes generative models whose posteriors cannot easily be approximated by such an inference model. This intuition is formalized in Theorem 1. Theorem 1. Let Q be a minimal exponential family with corresponding natural parameter space ⌦. With a slight abuse of notation, consider f 2 F : X ! ⌦. Under the simplifying assumption that p✓(z | x(i)) is contained within Q and parameterized by ⌘(i) 2 ⌦, and that F has infinite capacity, then the optimal inference model in Lemma 1 returns f ⇤ σ(x) = ⌘2 ⌦, where ⌘= n X i=1 wσ(x, x(i)) · ⌘(i) (15) and Lipschitz constant of f ⇤ σ is bounded by O(1/σ2). We wish to address Theorem 1’s assumption that the true posteriors lie in the variational family. Note that for sufficiently large exponential families, this assumption is likely to hold. But even in the case where the variational family is Gaussian (a relatively small exponential family), the small approximation gap observed in [10] suggests that it is plausible that posterior regularization would encourage the true posteriors to be approximately Gaussian. Given that σ modulates the smoothness of the inference model, it is natural to suspect that a larger choice of σ results in a stronger regularization. To formalize this notion of regularization strength, we introduce a way to partially order a set of regularizers {Ri(✓)}. Definition 1. Suppose two regularizers R1(✓) and R2(✓) share the same minimum min✓R1(✓) = min✓R2(✓). We say that R1 is a stronger regularizer than R2 if R1(✓) ≥R2(✓) for all ✓2 ⇥. Note that any two regularizers can be modified via scalar addition to share the same minimum. Furthermore, if R1 is stronger than R2, then R1 and R2 share at least one minimizer. We now apply Definition 1 to characterize the regularization strength of R(✓; σ) as σ increases. Definition 2. We say that F is closed under input translation if f 2 F =) fa 2 F for all a 2 X, where fa(x) = f(x + a). 4 Proposition 1. Consider the denoising regularizer R(✓; σ). Suppose F is closed under input translation and that, for any ✓2 ⇥, there exists f 2 F such that f(x) maps to the prior p✓(z) all x 2 X. Furthermore, assume that there exists ✓2 ⇥such that p✓(x, z) = p✓(z)p✓(x). Then R(✓; σ1) is stronger R(✓; σ2) when σ1 ≥σ2; i.e., min✓R(✓; σ1) = min✓R(✓; σ2) = 0 and R(✓; σ1) ≥R(✓; σ2) for all ✓2 ⇥. Lemma 1 and Proposition 1 show that as we increase σ, the optimal inference model is forced to become smoother and the regularization strength increases. Figure 1 is consistent with this analysis, showing the progression from under-regularized to over-regularized models as we increase σ. It is worth noting that, in addition to adjusting the denoising regularizer strength via σ, it is also possible to adjust the strength by taking a convex combination of the VAE and DVAE objectives. In particular, we can define the partially denoising regularizer R(✓; σ, ↵) as min f2F(Q) Eˆp(x) ✓ ↵· E" [D(f(x + ") k p✓(z | x))] + (1 −↵) · D(f(x) k p✓(z | x)) ◆ (16) Importantly, we note that R(✓; σ, ↵) is still strictly non-negative and, when combined with the log-likelihood term, still yields a tractable variational lower bound. 3.2 Weight-Normalized Amortized Inference In addition to DVAE, we propose an alternative method that directly restricts F to the set of smooth functions. To do so, we consider the case where the inference model is a neural network encoder parameterized by weight matrices {Wi} and leverage [18]’s weight normalization technique, which proposes to reparameterize the columns wi of each weight matrix W as wi = vi kvik · si, (17) where vi 2 Rd, si 2 R are trainable parameters. Since it is possible to modulate the smoothness of the encoder by capping the magnitude of si, we introduce a new parameter ui 2 R and define si = min ⇢ kvik, ✓ H 1 + exp(−ui) ◆0 . (18) The norm kwik is thus bounded by the hyperparameter H. We denote the weight-normalized regularizer as R(✓; FH), where FH is the amortization family induced by a H-weight-normalized encoder. Under similar assumptions as Proposition 1, it is easy to see that min✓R(✓; FH) = 0 for any H ≥0 and that R(✓; FH1) ≥R(✓; FH2) for all ✓2 ⇥when H1 H2 (since FH1 ✓FH2). We refer to the resulting model as the weight-normalized inference VAE (WNI-VAE) and show in Table 1 that weight-normalized amortized inference can achieve similar performance as DVAE. 3.3 Experiments We conducted experiments on statically binarized MNIST, statically binarized OMNIGLOT, and the Caltech 101 Silhouettes datasets. These datasets have a relatively small amount of training data and are thus susceptible to model overfitting. For each dataset, we used the same decoder architecture across all four models (VAE, DVAE (↵= 0.5), DVAE (↵= 1.0), WNI-VAE) and only modified the encoder, and trained all models using Adam [19] (see Appendix E for more details). To approximate the log-likelihood, we proposed to use importance-weighted stochastic variational inference (IW-SVI), an extension of SVI [20] which we describe in detail in Appendix C. Hyperparameter tuning of DVAE’s σ and WNI-VAE’s FH is described in Table 7. Table 1 shows the performance of VAE, DVAE, and WNI-VAE. Regularizing the inference model consistently improved the test set log-likelihood performance. On the MNIST and Caltech 101 Silhouettes datasets, the results also show a consistent reduction of the test set inference gap when the inference model is regularized. We observed differences in the performance of DVAE versus WNI-VAE on the Caltech 101 Silhouettes dataset, suggesting a difference in how denoising and weight normalization regularizes the inference model; an interesting consideration would thus be to combine DVAE and WNI. As a whole, Table 1 demonstrates that AIR benefits the generative model. The denoising and weight normalization regularizers have respective hyperparameters σ and H that control the regularization strength. In Figure 1, we performed an ablation analysis of how adjusting 5 Table 1: Test set evaluation of VAE, DVAE, and WNI-VAE. The performance metrics are loglikelihood ln p✓(x), the amortized ELBO L(x), and the inference gap ∆inf = ln p✓(x) −L(x). All three proposed models out-perform VAE across most metrics. MNIST OMNIGLOT CALTECH −ln p✓(x) ∆inf −L(x) −ln p✓(x) ∆inf −L(x) −ln p✓(x) ∆inf −L(x) VAE 86.93 ±0.04 8.54 ±0.14 95.48 ±0.07 110.32 ±0.16 12.03 ±0.25 122.35 ±0.33 109.14 ±0.28 28.90 ±0.42 138.05 ±0.15 DVAE (↵= 0.5) 86.46 ±0.02 6.34 ±0.05 92.80 ±0.07 109.31 ±0.19 12.56 ±0.18 121.87 ±0.37 108.64 ±0.19 23.40 ±0.19 132.04 ±0.37 DVAE (↵= 1.0) 86.51 ±0.02 6.83 ±0.04 93.35 ±0.06 110.12 ±0.18 12.44 ±0.16 122.56 ±0.34 108.66 ±0.23 23.94 ±0.15 132.60 ±0.15 WNI-VAE 86.42 ±0.01 6.68 ±0.01 93.10 ±0.02 109.16 ±0.12 11.39 ±0.10 120.55 ±0.20 108.94 ±0.31 28.88 ±0.29 137.82 ±0.25 Figure 1: Evaluation of the log-likelihood performance of all three proposed models as we vary the regularization parameter value. The regularization parameter is defined in Table 7. When the parameter value is too small, the model overfits and the test set performance degrades. When the parameter value is too high, the model underfits. the regularization strength impacts the test set log-likelihood. In almost all cases, we see a transition from overfitting to underfitting as we adjust the strength of AIR. For well-chosen regularization strength, however, it is possible to increase the test set log-likelihood performance by 0.5 ⇠1.0 nats—a non-trivial improvement. 3.4 How Does Amortized Inference Regularization Affect the Generator? Table 1 shows that regularizing the inference model empirically benefits the generative model. We now provide some initial theoretical characterization of how a smoothed amortized inference model affects the generative model. Our analysis rests on the following proposition. Proposition 2. Let P be an exponential family with corresponding mean parameter space M and sufficient statistic function T(·). With a slight abuse of notation, consider g 2 G : Z ! M. Define q(x, z) = ˆp(x)q(z | x), where q(z | x) is a fixed inference model. Supposing G has infinite capacity, then the optimal generative model in Eq. (5) returns g⇤(z) = µ 2 M, where µ = n X i=1 q(x(i) | z) · T(x(i)) = n X i=1 q(z | x(i)) P j q(z | x(j)) · T(x(i)) ! . (19) Proposition 2 generalizes the analysis in [21] which determined the optimal generative model when P is Gaussian. The key observation is that the optimal generative model outputs a convex combination of {φ(x(i))}, weighted by q(x(i) | z). Furthermore, the weights q(x(i) | z) are simply density ratios of the proposal distributions {q(z | x(i))}. As we increase the smoothness of the amortized inference model, the weight q(x(i) | z) should tend toward 1 n for all z 2 Z. This suggests that a smoothed inference model provides a natural way to smooth (and thus regularize) the generative model. 4 Amortized Inference Regularization in Importance-Weighted Autoencoders In this section, we extend AIR to importance-weighted autoencoders (IWAE-k). Although the application is straightforward, we demonstrate a noteworthy relationship between the number of importance samples k and the effect of AIR. To begin our analysis, we consider the IWAE-k objective max ✓,φ Ez1...zk⇠qφ(z|x) " ln 1 k k X i=1 p✓(x, zi) qφ(zi | x) # , (20) 6 where {z1 . . . zk} are k samples from the proposal distribution qφ(z | x) to be used as importancesamples. Analysis by [22] allows us to rewrite it as a regularized maximum likelihood objective max ✓ Eˆp(x) [ln p✓(x)] − Rk(✓) z }| { min f2F(Q) Eˆp(x)Ez2...zk⇠f(x) ˜D( ˜fk(x, z1 . . . zk) k p✓(z | x)), (21) where ˜fk (or equivalently ˜qk) is the unnormalized distribution ˜fk(x, z2 . . . zk)(z1) = p✓(x, z1) 1 k P i p✓(x,zi) f(x)(zi) = ˜qk(z1 | x, z2 . . . zk) (22) and ˜D(q k p) = R q(z) [ln q(z) −ln p(z)] dz is the Kullback-Leibler divergence extended to unnormalized distributions. For notational simplicity, we omit the dependency of ˜fk on (z2 . . . zk). Importantly, [22] showed that the IWAE with k importance samples drawn from the amortized inference model f is, on expectation, equivalent to a VAE with 1 importance sample drawn from the more expressive inference model ˜fk. 4.1 Importance Sampling Attenuates Amortized Inference Regularization We now consider the interaction between importance sampling and AIR. We introduce the regularizer Rk(✓; σ, FH) as follows Rk(✓; σ, FH) = min f2FH(Q) Eˆp(x)E"Ez2...zk⇠f(x+") ˜D( ˜fk(x + ") k p✓(z | x)), (23) which corresponds to a regularizer where weight normalization, denoising, and importance sampling are simultaneously applied. By adapting Theorem 1 from [8], we can show that Proposition 3. Consider the regularizer Rk(✓; σ, FH). Under similar assumptions as Proposition 1, then Rk1 is stronger than Rk2 when k1 k2; i.e., min✓Rk1(✓; σ, FH) = min✓Rk2(✓; σ, FH) = 0 and Rk1(✓; σ, FH) Rk2(✓; σ, FH) for all ✓2 ⇥. A notable consequence of Proposition 3 is that as k increases, AIR exhibits a weaker regularizing effect on the posterior distributions {p✓(z | x(i))}. Intuitively, this arises from the phenomenon that although AIR is applied to f, the subsequent importance-weighting procedure can still create a flexible ˜fk. Our analysis thus predicts that AIR is less likely to cause underfitting of IWAE-k’s generative model as k increases, which we demonstrate in Figure 2. In the limit of infinite importance samples, we also predict AIR to have zero regularizing effect since ˜f1 (under some assumptions) can always approximate any posterior. However, for practically feasible values of k, we show in Tables 2 and 3 that AIR is a highly effective regularizer. 4.2 Experiments Table 2: Test set evaluation of the four models when trained with 8 importance samples. L8(x) denotes the amortized ELBO using 8 importance samples. ∆inf = ln p✓(x) −L8(x). MNIST OMNIGLOT CALTECH −ln p✓(x) ∆inf −L8(x) −ln p✓(x) ∆inf −L8(x) −ln p✓(x) ∆inf −L8(x) IWAE 86.21 ±0.01 6.13 ±0.03 92.34 ±0.02 108.18 ±0.24 8.69 ±0.39 116.87 ±0.16 108.65 ±0.11 21.52 ±0.13 130.17 ±0.09 DIWAE (↵= 0.5) 85.78 ±0.02 4.47 ±0.02 90.25 ±0.03 107.01 ±0.11 8.64 ±0.07 115.66 ±0.17 107.34 ±0.17 17.61 ±0.18 124.96 ±0.14 DIWAE (↵= 1.0) 85.78 ±0.03 4.21 ±0.03 90.00 ±0.06 107.47 ±0.06 8.57 ±0.14 116.04 ±0.18 107.54 ±0.11 17.06 ±0.35 124.60 ±0.29 WNI-IWAE 85.81 ±0.01 4.33 ±0.03 90.14 ±0.04 107.15 ±0.08 8.78 ±0.17 115.93 ±0.10 107.98 ±0.19 22.18 ±0.33 130.16 ±0.14 Table 3: Test set evaluation of the four models when trained with 64 importance samples. ∆inf = ln p✓(x) −L64(x). MNIST OMNIGLOT CALTECH −ln p✓(x) ∆inf −L64(x) −ln p✓(x) ∆inf −L64(x) −ln p✓(x) ∆inf −L64(x) IWAE 86.06 ±0.03 4.41 ±0.10 90.48 ±0.07 107.31 ±0.14 6.66 ±0.22 113.97 ±0.10 108.89 ±0.35 16.51 ±0.32 125.40 ±0.25 DIWAE (↵= 0.5) 85.55 ±0.02 3.01 ±0.01 88.56 ±0.02 106.02 ±0.01 6.98 ±0.06 113.00 ±0.07 106.94 ±0.11 12.28 ±0.14 119.22 ±0.11 DIWAE (↵= 1.0) 85.55 ±0.02 3.15 ±0.02 88.70 ±0.04 106.15 ±0.03 6.70 ±0.05 112.85 ±0.07 106.96 ±0.11 12.94 ±0.22 119.87 ±0.16 WNI-IWAE 85.64 ±0.03 3.10 ±0.01 88.74 ±0.03 106.17 ±0.07 7.11 ±0.07 113.28 ±0.13 108.15 ±0.11 14.42 ±0.20 122.57 ±0.10 7 Tables 2 and 3 extends the model evaluation to IWAE-8 and IWAE-64. We see that the denoising IWAE (DIWAE) and weight-normalized inference IWAE (WNI-IWAE) consistently out-perform the standard IWAE on test set log-likelihood evaluations. Furthermore, the regularized models frequently reduced the inference gap as well. Our results demonstrate that AIR is a highly effective regularizer even when a large number of importance samples are used. Our main experimental contribution in this section is the verification that increasing the number of importance samples results in less underfitting when the inference model is over-regularized. In contrast to k = 1, where aggressively increasing the regularization strength can cause considerable underfitting, Figure 2 shows that increasing the number of importance samples to k = 8 and k = 64 makes the models much more robust to mis-specified choices of regularization strength. Interestingly, we also observed that the optimal regularization strength (determined using the validation set) increases with k (see Table 7 for details). The robustness of importance sampling when paired with amortized inference regularization makes AIR an effective and practical way to regularize IWAE. Figure 2: Evaluation of the log-likelihood performance of all three proposed models as we vary the regularization parameter (see Table 7 for definition) and number of importance samples k. To compare across different k’s, the performance without regularization (IWAE-k baseline) is subtracted. We see that IWAE-64 is the least likely to underfit when the regularization parameter value is high. 4.3 Are High Signal-to-Noise Ratio Gradients Necessarily Better? We note the existence of a related work [23] that also concluded that approximating maximum likelihood training is not necessarily better. However, [23] focused on increasing the signal-to-noise ratio of the gradient updates and analyzed the trade-off between importance sampling and Monte Carlo sampling under budgetary constraints. An in-depth discussion of these two works within the context of generalization is provided in Appendix D. 5 Conclusion In this paper, we challenged the conventional role that amortized inference plays in training deep generative models. In addition to expediting variational inference, amortized inference introduces new ways to regularize maximum likelihood training. We considered a special case of amortized inference regularization (AIR) where the inference model must learn a smoothed mapping from X ! Q and showed that the denoising variational autoencoder (DVAE) and weight-normalized inference (WNI) are effective instantiations of AIR. Promising directions for future work include replacing denoising with adversarial training [24] and weight normalization with spectral normalization [25]. Furthermore, we demonstrated that AIR plays a crucial role in the regularization of IWAE, and that higher levels of regularization may be necessary due to the attenuating effects of importance sampling on AIR. We believe that variational family expansion by Monte Carlo methods [26] may exhibit the same attenuating effect on AIR and recommend this as an additional research direction. 8 Acknowledgements This research was supported by TRI, NSF (#1651565, #1522054, #1733686 ), ONR, Sony, and FLI. Toyota Research Institute provided funds to assist the authors with their research but this article solely reflects the opinions and conclusions of its authors and not TRI or any other Toyota entity. References [1] Diederik P Kingma and Max Welling. Auto-Encoding Variational Bayes. arXiv preprint arXiv:1312.6114, 2013. [2] Diederik P Kingma, Shakir Mohamed, Danilo Jimenez Rezende, and Max Welling. SemiSupervised Learning With Deep Generative Models. In Advances In Neural Information Processing Systems, pages 3581–3589, 2014. [3] Hyunjik Kim and Andriy Mnih. Disentangling By Factorising. arXiv preprint arXiv:1802.05983, 2018. [4] Tian Qi Chen, Xuechen Li, Roger Grosse, and David Duvenaud. Isolating Sources Of Disentanglement In Variational Autoencoders. arXiv preprint arXiv:1802.04942, 2018. [5] Yoon Kim, Sam Wiseman, Andrew C Miller, David Sontag, and Alexander M Rush. SemiAmortized Variational Autoencoders. arXiv preprint arXiv:1802.02550, 2018. [6] Diederik P Kingma, Tim Salimans, Rafal Jozefowicz, Xi Chen, Ilya Sutskever, and Max Welling. Improved Variational Inference With Inverse Autoregressive Flow. In Advances In Neural Information Processing Systems, pages 4743–4751, 2016. [7] Casper Kaae Sønderby, Tapani Raiko, Lars Maaløe, Søren Kaae Sønderby, and Ole Winther. Ladder Variational Autoencoders. In Advances In Neural Information Processing Systems, pages 3738–3746, 2016. [8] Yuri Burda, Roger Grosse, and Ruslan Salakhutdinov. Importance Weighted Autoencoders. arXiv preprint arXiv:1509.00519, 2015. [9] Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic Backpropagation And Approximate Inference In Deep Generative Models. arXiv preprint arXiv:1401.4082, 2014. [10] Chris Cremer, Xuechen Li, and David Duvenaud. Inference Suboptimality In Variational Autoencoders. arXiv preprint arXiv:1801.03558, 2018. [11] Yuhuai Wu, Yuri Burda, Ruslan Salakhutdinov, and Roger Grosse. On The Quantitative Analysis Of Decoder-Based Generative Models. arXiv preprint arXiv:1611.04273, 2016. [12] Rahul G Krishnan, Dawen Liang, and Matthew Hoffman. On the challenges of learning with inference networks on sparse, high-dimensional data. arXiv preprint arXiv:1710.06085, 2017. [13] 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. [14] Rajesh Ranganath, Dustin Tran, and David Blei. Hierarchical Variational Models. In International Conference On Machine Learning, pages 324–333, 2016. [15] Kuzman Ganchev, Jennifer Gillenwater, Ben Taskar, et al. Posterior Regularization For Structured Latent Variable Models. Journal of Machine Learning Research, 11(Jul):2001–2049, 2010. [16] Jun Zhu, Ning Chen, and Eric P Xing. Bayesian Inference With Posterior Regularization And Applications To Infinite Latent Svms. The Journal of Machine Learning Research, 15(1):1799– 1847, 2014. [17] Daniel Jiwoong Im, Sungjin Ahn, Roland Memisevic, Yoshua Bengio, et al. Denoising Criterion For Variational Auto-Encoding Framework. In AAAI, pages 2059–2065, 2017. 9 [18] Tim Salimans and Diederik P Kingma. Weight Normalization: A Simple Reparameterization To Accelerate Training Of Deep Neural Networks. In Advances In Neural Information Processing Systems, pages 901–909, 2016. [19] Diederik P Kingma and Jimmy Ba. Adam: A method For Stochastic Optimization. arXiv preprint arXiv:1412.6980, 2014. [20] Matthew D Hoffman, David M Blei, Chong Wang, and John Paisley. Stochastic Variational Inference. The Journal of Machine Learning Research, 14(1):1303–1347, 2013. [21] Olivier Bousquet, Sylvain Gelly, Ilya Tolstikhin, Carl-Johann Simon-Gabriel, and Bernhard Schoelkopf. From Optimal Transport To Generative Modeling: The VEGAN Cookbook. arXiv preprint arXiv:1705.07642, 2017. [22] Chris Cremer, Quaid Morris, and David Duvenaud. Reinterpreting Importance-Weighted Autoencoders. arXiv preprint arXiv:1704.02916, 2017. [23] Tom Rainforth, Adam R Kosiorek, Tuan Anh Le, Chris J Maddison, Maximilian Igl, Frank Wood, and Yee Whye Teh. Tighter Variational Bounds Are Not Necessarily Better. arXiv preprint arXiv:1802.04537, 2018. [24] Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining And Harnessing Adversarial Examples. arXiv preprint arXiv:1412.6572, 2014. [25] Takeru Miyato, Toshiki Kataoka, Masanori Koyama, and Yuichi Yoshida. Spectral Normalization For Generative Adversarial Networks. arXiv preprint arXiv:1802.05957, 2018. [26] Matthew D Hoffman. Learning Deep Latent Gaussian Models With Markov Chain Monte Carlo. In International Conference On Machine Learning, pages 1510–1519, 2017. [27] Yingzhen Li and Richard E Turner. Rényi Divergence Variational Inference. In Advances In Neural Information Processing Systems, pages 1073–1081, 2016. [28] Jakub M Tomczak and Max Welling. VAE With A Vampprior. arXiv preprint arXiv:1705.07120, 2017. [29] Samuel L. Smith and Quoc V. Le. A bayesian Perspective On Generalization And Stochastic Gradient Descent. In International Conference On Learning Representations, 2018. [30] Laurent Dinh, Razvan Pascanu, Samy Bengio, and Yoshua Bengio. Sharp Minima Can Generalize For Deep Nets. arXiv preprint arXiv:1703.04933, 2017. [31] Dominic Masters and Carlo Luschi. Revisiting Small Batch Training For Deep Neural Networks. arXiv preprint arXiv:1804.07612, 2018. [32] Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding Deep Learning Requires Rethinking Generalization. arXiv preprint arXiv:1611.03530, 2016. [33] Arindam Banerjee, Srujana Merugu, Inderjit S Dhillon, and Joydeep Ghosh. Clustering With Bregman Divergences. Journal of machine learning research, 6(Oct):1705–1749, 2005. 10
2018
112
7,267
Structure-Aware Convolutional Neural Networks Jianlong Chang1,2 Jie Gu1,2 Lingfeng Wang1 Gaofeng Meng1 Shiming Xiang1,2 Chunhong Pan1 1NLPR, Institute of Automation, Chinese Academy of Sciences 2School of Artificial Intelligence, University of Chinese Academy of Sciences {jianlong.chang, jie.gu, lfwang, gfmeng, smxiang, chpan}@nlpr.ia.ac.cn Abstract Convolutional neural networks (CNNs) are inherently subject to invariable filters that can only aggregate local inputs with the same topological structures. It causes that CNNs are allowed to manage data with Euclidean or grid-like structures (e.g., images), not ones with non-Euclidean or graph structures (e.g., traffic networks). To broaden the reach of CNNs, we develop structure-aware convolution to eliminate the invariance, yielding a unified mechanism of dealing with both Euclidean and non-Euclidean structured data. Technically, filters in the structure-aware convolution are generalized to univariate functions, which are capable of aggregating local inputs with diverse topological structures. Since infinite parameters are required to determine a univariate function, we parameterize these filters with numbered learnable parameters in the context of the function approximation theory. By replacing the classical convolution in CNNs with the structure-aware convolution, Structure-Aware Convolutional Neural Networks (SACNNs) are readily established. Extensive experiments on eleven datasets strongly evidence that SACNNs outperform current models on various machine learning tasks, including image classification and clustering, text categorization, skeleton-based action recognition, molecular activity detection, and taxi flow prediction. 1 Introduction Convolutional neural networks (CNNs) provide an effective and efficient framework to deal with Euclidean structured data, including speeches and images. As a core module in CNNs, the convolution unit explicitly allows to share parameters among the whole spatial domains to extremely reduce the number of parameters, without sacrificing the expressive capability of networks [3]. Benefiting from such artful modeling, significant successes have been achieved in a multitude of fields, including the image classification [15, 24] and clustering [5, 6], the object detection [9, 32], and amongst others. Although the achievements in the literature are brilliant, CNNs are still incompetent to handle nonEuclidean structured data, such as the traffic flow data on traffic networks, the relational data on social networks, and the active data on molecule structure networks. The major limitation originates from that the classical filters are invariant at each location. As a result, the filters can only be applied to aggregate local inputs with the same topological structures, not with diverse topological structures. In order to eliminate the limitation, we develop structure-aware convolution in which a single shareable filter suffices to aggregate local inputs with diverse topological structures. For this purpose, we generalize the classical filters to univariate functions that can be effectively and efficiently parameterized under the guidance of the function approximation theory. Then, we introduce local structure representations to quantificationally encode topological structures. By modeling these representations into the generalized filters, the corresponding local inputs can be aggregated based on the generalized filters consequently. In practice, Structure-Aware Convolutional Neural Networks (SACNNs) can be readily established by replacing the classical convolution in CNNs with our structure-aware 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. convolution. Since all the operations in our structure-aware convolution are differentiable, SACNNs can be trained end-to-end by the standard back-propagation. To sum up, the key contributions of this paper are: • The structure-aware convolution is developed to establish SACNNs to uniformly deal with both Euclidean and non-Euclidean structured data, which broadens the reach of convolution. • We introduce the learnable local structure representations, which endow SACNNs with the capability of capturing the latent structures of data in a purely data-driven way. • By taking advantage of the function approximation theory, SACNNs can be effectively and efficiently trained with the standard back-propagation to guarantee the practicability. • Extensive experiments demonstrate that SACNNs are superior to current models in various machine learning tasks, including classification, clustering, and regression. 2 Related work 2.1 Convolutional neural networks (CNNs) To elevate the performance of CNNs, much research has been devoted to designing the convolution units, which can be roughly divided into two classes, i.e., handcrafted and learnable ones. Handcrafted convolution units generally derive from the professional knowledge. Primary convolution units [24, 26] present large sizes, e.g., 7 × 7 pixels in images. To increase the nonlinearity, stacking multiple small filters (e.g., 3 × 3 pixels) instead of using a single large filter has become a common design in CNNs [38]. To obtain larger receptive fields, the dilated convolution [41], whose receptive field size grows exponentially while the number of parameters grows linearly, is proposed. In addition, the separable convolution [7] promotes performance by integrating various filters with diverse sizes. Among the latter, lots of efforts have been widely made to learn convolution units. By introducing additional parameters named offsets, the active convolution [19] is explored to learn the shape of convolution. To achieve dynamic offsets that vary with inputs, the deformable convolution [9] is proposed. Contrary to such modifications, some approaches have been devoted to directly capturing structures of data to improve the performance of CNNs, such as the spatial transform networks [18]. While these models have been successful on Euclidean domains, they can hardly be applied to non-Euclidean domains. In contrast, our SACNNs can be utilized on these two domains uniformly. 2.2 Graph convolutional neural networks (GCNNs) Recently, there has been a growing interest in applying CNNs to non-Euclidean domains [3, 29, 31, 35]. Generally, existing methods can be summarized into two types, i.e., spectral and spatial methods. Spectral methods explore an analogical convolution operator over non-Euclidean domains on the basis of the spectral graph theory [4, 16, 27]. Relying on the eigenvectors of graph Laplacian, data with nonEuclidean structures can be filtered on the corresponding spectral domain. To enhance the efficiency and acquire spectrum-free methods without performing eigen-decomposition, polynomial-based networks are developed to execute convolution on non-Euclidean domains efficiently [10, 22]. Contrary to the spectral methods, spatial methods always analogize the convolutional strategy based on the local spatial filtering [1, 2, 30, 31, 37, 40]. The major difference between these methods lies in the intrinsic coordinate systems used for encoding local patches. Typically, the diffusion CNNs [1] encode local patches based on the random walk process on graphs, the anisotropic CNNs [2] employ an anisotropic patch-extraction method, and the geodesic CNNs [30] represent local patches in polar coordinates. In the mixture-model CNNs [31], synthetically, learnable local pseudo-coordinates are developed to parameterize local patches in a general way. Additionally, a series of spatial methods without the classical convolutional strategy have also been explored, including the message passing neural networks [12, 28, 34], and the graph attention networks [39]. In spite of considerable achievements, both spectral and spatial methods partially rely on fixed structures (i.e., fixed relationship matrix) in graphs. Benefiting from the proposed structure-aware convolution, by comparison, the structures can be learned from data automatically in our SACNNs. 2 3 Structure-aware convolution Convolution, intrinsically, is an aggregation operation between local inputs and filters. In practice, local inputs involve not only their input values but also topological structures. Accordingly, filters should be in a position to aggregate local inputs with diverse topological structures. To this end, we develop the structure-aware convolution by generalizing the filters in the classical convolution and modeling the local structure information into the generalized filters. The filters in the classical convolution can be smoothly generalized to univariate functions. Without loss of generality and for simplicity, we elaborate such generalization with 1-Dimensional data. Given an input x ∈Rn and a filter w ∈R2m−1, the output at the i-th vertex (location) is ¯yi = wTxi = X i−m<j<i+m wj−i+m · xj, i ∈{1, 2, · · · , n}, (1) where xi = [xi−m+1, · · · , xi+m−1]T is the local input at the i-th vertex, i−m < j < i+m indicates that the j-th vertex is a neighbor of the i-th vertex, wj−i+m and xj signify the (j −i + m)-th and j-th elements in w and x, respectively. For any univariate function f(·), Eq. (1) can be equivalently rewritten as follows when f(j −i + m) = wj−i+m is always satisfied, i.e., ¯yi = f T Rxi = X i−m<j<i+m f(j −i + m) · xj, i ∈{1, 2, · · · , n}, (2) where f(·) is called a functional filter, R = {j −i+m | i−m < j < i+m} = {1, 2, · · · , 2m−1}, and fR = {f(r)|r ∈R}. Actually, R encodes relationships between a vertex and its neighbors. For example, r ∈R means that the (i −m + r)-th vertex is the r-th neighbor of the i-th vertex. Since the relationships in R can reflect the structure information around a vertex, we call R a local structure representation. Generally, the local structure representation R is constant in the classical convolution, which causes that the same fR is shared at each vertex. As a result, the classical convolution solely pertains to manage data with the same local topological structures, not with diverse ones. To handle this limitation, we introduce general local structure representations to quantificationally encode any local topological structure, and then develop structure-aware convolution by replacing the constant R in classical convolution with the introduced general ones. Technically, both Euclidean and non-Euclidean structured data can be represented by a graph G = (V, E, R), where the vertices in V store the values of data, the edges in E indicate whether two vertices are connected, and the relationship matrix R signifies the structure information in the graph G. For a vertex i ∈V, the local structure representation at i is encoded via the relationships with its neighbors, i.e., Ri = {rji|eji ∈E}, i ∈{1, 2, · · · , n}, (3) where eji ∈E means that the j-th vertex is a neighbor of the i-th vertex, rji is the element of R at (j, i) and indicates the relationship from the j-th vertex to the i-th vertex. Note that S = {Ri|i ∈V} can include the whole structure information in the graph G by integrating the local structure representations together. This implies that Eq. (3) is a reasonable formulation for local topological structures. Based on the introduced local structure representations, the structure-aware convolution is developed by modeling these representations into the generalized functional filters. Formally, given an input x embedded on the graph G and a functional filter f(·), we define the structure-aware convolution as ¯yi = f T Rixi = X eji∈E f(rji) · xj, i ∈{1, 2, · · · , n}, (4) where fRi = {f(rji)|eji ∈E} varies with Ri. Benefiting from this modification, the structure-aware convolution is capable of aggregating local inputs with diverse topological structures. 4 Structure-aware convolutional neural networks Replacing the classical convolution in CNNs with the structure-aware convolution, SACNNs are established. Intuitively, a structure-aware convolutional layer is illustrated in Figure 1. However, two essential problems need to be tackled before training SACNNs. First, functional filters in the structure-aware convolution are univariate functions, which need infinite parameters to be determined. This implies that SACNNs can not be learned in a common way, and an effective and efficient strategy is required to learn these filters with numbered parameters. Second, local structure representations (or the relationship matrix R) may be hardly defined in advance and thus a learning mechanism is needed. In the following, Section 4.1 and 4.2 focus on tackling these two problems, respectively. 3 x22       x12 x32 x42 x52 x62       y2 y1 y3 y4 y5 y6 x22     x12     x32 x42 52 x62  x52    r11 r31 r21 local structures functional filters r11 r21 r31 f1 r11 r21 r31 f2 ĂĂ ĂĂ c   r66 r46 r46 r66 f1 r46 r66 f2       x21 x11 x31 x41 x51 x61 output input Figure 1: A structure-aware convolutional layer. For clarity of exposition, the input x has c = 2 channels with n = 6 vertices, the output y has a single channel, and ¯xj, ¯xi ∈Rc indicate the j-th and i-th rows of the input x, respectively. For each vertex i, its local structure representation is first captured from the input and represented as Ri, which is identically shared for each channel of the input x. Afterwards, the local inputs in the first and second channels are aggregated via the first filter f1(·) and the second filter f2(·) respectively, with the same Ri. Note that f1(·) and f2(·) are shared for every location in the first and second channels, respectively. 4.1 Polynomial parametrization for functional filters We parameterize the developed functional filters with numbered learnable parameters under the guidance of the function approximation theory. In mathematics, for an arbitrary univariate function h(x), it can be composed of a group basis functions {h1(x), h2(x), · · · } with a set of coefficients {v1, v2, · · · }, denoted by h(x) ≃Pt k=1 vk · hk(x), where hk(x) and vk are the k-th basis function and the corresponding coefficient, respectively. The equation is satisfied when t tends to infinity. Because of the high efficiency [14], our functional filters are parameterized based on the Chebyshev polynomials that form an orthogonal basis for L2([−1, 1], dy/ p 1 −y2), the Hilbert space of square integrable functions with respect to the measure dy/ p 1 −y2. Formally, the Chebyshev polynomial hk(x) of order k−1 (k ≥3) can be generated by the stable recurrence relation hk(x) = 2xhk−1(x)− hk−2(x), with h1(x) = 1 and h2(x) = x. In practice, the truncated expansion of Chebyshev polynomials is employed to approximate the functional filter f(·) in Eq. (4), i.e., yi = X eji∈E f(rji) · xj = X eji∈E t X k=1 vk · hk(rji) ! · xj, i ∈{1, 2, · · · , n}, (5) where t is the number of the truncated polynomials, and {v1, · · · , vt} are t learnable coefficients corresponding to the polynomials {h1(x), · · · , ht(x)}. Note that f(rji) can be cumulatively computed based on the recurrence relation, leading to an efficient computing strategy. 4.2 Local structure representations learning To eliminate the feature engineering, we consider to learn local structure representations from data rather than using predefined ones. To preserve the structure consistency between channels, for every structure-aware convolutional layer, only a single local structure representation set S = {Ri|i ∈V} is identically learned for each channel of the input. Formally, given a multi-channel input feature map x ∈Rn×c, where n and c denote the numbers of vertices and channels respectively, the local structure representation at each vertex is learned as Ri = {rji = T(¯xT j M¯xi) | eji ∈E}, i ∈{1, 2, · · · , n}, (6) where ¯xj, ¯xi ∈Rc indicate the j-th and i-th rows of the input x respectively, M ∈Rc×c is a matrix with c × c learnable parameters to measure relationships between local vertices, and T(·) is the Tanh function to normalize elements in local structure representations into [−1, 1] strictly. This local structure learning formulation has two good properties. First, M is identically shared for each channel of the input, so every channel possesses the same structure in each structure-aware convolutional layer and the size of M only depends on the number of channels. As a result, only a few additional parameters are required to be learned, which can alleviate the overfitting when training data is limited. Second, M is not constrained as a symmetric matrix, namely rji may not be equal to rij. This implies that our approach is capable of modeling not only undirected structures, but also direct structures, such as the traffic networks and the social networks. 4 4.3 Understanding the structure-aware convolution In this subsection, we give the following theorem to reveal the essence of our structure-aware convolution (the proof is reported in the supplementary material). Theorem 1. Under the Chebyshev polynomial basis, the structure-aware convolution is equivalent to yi = vTPixi, i ∈{1, 2, · · · , n}, where v ∈Rt is the coefficients of the polynomials, Pi ∈Rt×m is a matrix determined by the local structure representation Ri and the polynomials, and xi ∈Rm is the local input at the i-th vertex. Theorem 1 indicates that the structure-aware convolution can be split into two independent units, i.e., a transformation Pi ∈Rt×m and a vector v ∈Rt. In the first unit, the transformation Pi devotes to encoding the m-Dimensional local inputs as t-Dimensional vectors. Since the basis functions are fixed in the Chebyshev polynomial basis, Pi is purely depended on the corresponding local structure representation Ri that is varied with the vertex i and can be learned according to Eq. (6). It is worth noting that this transformation Pi is similar to a specific local spatial transformer in the spatial transform networks [18]. In the second unit, the learnable vector v is shared by every vertex to aggregate these encoded local inputs, which is akin to the classical convolution. By integrating these two learnable units together, the structure-aware convolution can simultaneously focus on local input values and local topological structures to capture high-level representations. 5 Experiments In this section, we systematically carry out extensive experiments to verify the capability of SACNNs. Due to the space restriction we report some experimental details in the supplement, such as the gradients during training, descriptions of datasets, descriptions of datasets, and network architectures. Specifically, Our core code will be released at https://github.com/vector-1127/SACNNs. 5.1 Experimental settings We perform experiments on six Euclidean and five non-Euclidean structured datasets to verify the capability of SACNNs. Six Euclidean structured datasets include the Mnist [26], Cifar-10 [23], Cifar-100 [23], STL-10 [8], Image10 [6], and ImageDog [6] image datasets. Five non-Euclidean structured datasets contain the text categorization datasets 20NEWS and Reuters [25], the action recognition dataset NTU [36], the molecular activity dataset DPP4 [20], and the taxi flow dataset TF-198 [42] that consists of the taxis flow data at 198 traffic intersections in a city. With respect to the scope of applications, two types of methods are compared, i.e., CNNs and GCNNs. On Euclidean domains, popular CNN models, including the classical convolution (ClaCNNs) [26], the separable convolution (SepCNNs) [7], the active convolution (ActCNNs) [19], and the deformable convolution (DefCNNs) [9] are utilized for comparisons. On non-Euclidean domains, both spatial and spectral GCNNs are taken as competitors to SACNNs, including the local connected networks (LCNs) [4], the dynamic filters based networks (DFNs) [40], the edge-conditioned convolution (ECC) [37], the mixture-model networks (MoNets) [31] (which is a generalization of the diffusion CNNs [1], the anisotropic CNNs [2], and the geodesic CNNs [30]), the spectral networks (SCNs) [16], the Chebyshev based SCNs (ChebNets) [10], and the graph convolution networks (GCNs) [22]. Furthermore, SACNNs† that omit the structure learning in SACNNs are used as a baseline of our method and to show the effectiveness of structure learning. In SACNNs†, Ri is assigned by uniformly sampling on [−1, 1], e.g., Ri = {−1 2, 0, 1 2} is predefined when a 3-Dimensional filter is required. The hyper-parameters in SACNNs are set as follows. In our experiments, the max pooling and the Graclus method [11] are employed as the pooling operations to coarsen the feature maps in SACNNs when managing Euclidean and non-Euclidean structured data respectively, the ReLU function [13] is used as the activation function, batch normalization [17] is employed to normalize the inputs of all layers, parameters are randomly initialized with a uniform distribution U(−0.1, 0.1), the order of polynomials t is set to the maximum number of neighbors among the whole spatial domains (e.g., t = 9 if we attempt to learn 3 × 3 filters in images). During the training stage, the Adam optimizer [21] with the initial learning rate 0.001 is utilized to train SACNNs, the mini-batch size is set to 32, the categorical cross entropy loss is used in the classification tasks, and the mean squared 5 Table 1: The classification or clustering accuracies on the experimental Euclidean structured datasets. For clarity, ‡ indicates that DAC [6] is used to cluster the whole samples in each experimental dataset. Datasets Mnist Cifar-10 Cifar-100 STL-10 Image10‡ ImageDog‡ Time (s) ClaCNNs [26] 0.9953 0.9075 0.6629 0.6635 0.5272 0.2748 53±1 SepCNNs [7] 0.9910 0.9062 0.6643 0.6685 0.5637 0.2754 68±1 ActCNNs [19] 0.9926 0.9086 0.6648 0.6761 0.5478 0.2786 83±2 DefCNNs [9] 0.9908 0.8718 0.6349 0.6564 0.4853 0.2355 125±3 SACNNs† 0.9957 0.9091 0.6759 0.7175 0.5953 0.2801 78±2 SACNNs 0.9961 0.9167 0.6938 0.7358 0.6007 0.2913 136±2 0 0.1 0.2 0.3 0.4 0.5 0.2 0.4 0.6 0.8 1 variance δ classification accuracy (a) ClaCNNs SepCNNs ActCNNs DefCNNs SACNNs† SACNNs −70 −35 0 35 70 0.2 0.4 0.6 0.8 1 rotation angle (degrees) classification accuracy (b) ClaCNNs SepCNNs ActCNNs DefCNNs SACNNs† SACNNs −8 −4 0 4 8 0.2 0.4 0.6 0.8 1 shift (pixels) classification accuracy (c) ClaCNNs SepCNNs ActCNNs DefCNNs SACNNs† SACNNs 0.5 0.75 1 1.25 1.5 0.6 0.8 1 scale classification accuracy (d) ClaCNNs SepCNNs ActCNNs DefCNNs SACNNs† SACNNs 1 2 3 4 5 6 7 8 9 10 0 0.1 0.2 layer normalized total variation (e) initial stage SACNN† ClaCNN 1 2 3 4 5 6 7 8 9 10 0 0.1 0.2 layer normalized total variation (f) final stage SACNN† ClaCNN Figure 2: Invariance properties of various CNNs. (a) Gaussion noises with mean 0 and variance δ. (b) Rotation. (c) Shift. (d) Scale. (e) Normalized total variations at the initial stage. (f) Normalized total variations at the final stage. Large figures can be found in the supplementary material. error loss is used in the regression tasks. During the testing stage, the squared correlation and the root mean square error are used to evaluate the results on DPP4 and TF-198 respectively, and the classification or clustering accuracy is used for the others. For a reasonable evaluation, we perform 5 random restarts and the average results are used for comparisons. 5.2 Compared with various CNNs on Euclidean domains To validate the capability of SACNNs on the Euclidean domains, several SACNNs are modeled to classify images in Mnist, Cifar-10, Cifar-100 and STL-10, and to cluster images in Image10 and ImageDog based on the DAC model [6]. In this experiment, images are recast as specific multi-channel graphs on 2-Dimensional regular grids. In the graphs, each vertex is provided with 9 neighbors including itself, which is similar to the classical convolution with a 3 × 3 filter. In Table 1, we report the quantitative results of the modeled networks with diverse convolution units on various Euclidean structured datasets. Note that SACNNs achieve the superior performance on both classification and clustering tasks, which implies that SACNNs and SACNNs† are capable of managing Euclidean structured data effectively. In Figure 2, we empirically verify the invariance property of the compared CNNs on the Mnist dataset. In this experiment, we disturb the testing data in Mnist with four typical transformations, including Gaussion noise, rotation, shift, and scale. Then, these disturbed data is utilized to validate the trained networks with the evaluated convolution units. From Figure 2, the results assuredly prove that SACNNs and SACNNs† are in possession of excellent robustness to such transformations. Furthermore, we analyze the learned filters via the normalized total variation [33] that can reveal the smoothness of filters. Figure 2 (e) and (f) show that smoother filters are obtained in SACNNs† at both initial and final stages. Based on the conclusion in [33], higher deformation stability will be achieved when smoother filters are learned, which is in agreement with the results of our experiments in Figure 2 (a)-(d). 6 Table 2: The results on the experimental non-Euclidean structured datasets. For each dataset, ↑(↓) indicates that the larger (the smaller) values, the better results are. Datasets Mnist↑ 20News↑ Reuters↑ NTU↑ DPP4↑ TF-198↓ Time (s) LCNs [4] 0.9914 0.6491 0.9162 0.5457 0.225 68.83 175±2 DFNs [40] 0.9840 0.7017 0.9046 0.6346 0.214 70.35 192±3 ECC [37] 0.9937 0.7003 0.9114 0.6416 0.249 65.35 238±4 MoNets [31] 0.9919 0.6929 0.9113 0.6354 0.256 69.35 252±4 SCNs [16] 0.9726 0.6453 0.8985 0.5818 0.248 75.83 1384±11 ChebNets [10] 0.9914 0.6826 0.9124 0.6384 0.265 65.86 673±8 GCNs [22] 0.9867 0.6278 0.8992 0.5983 0.258 71.54 341±4 SACNNs† 0.9957 0.7362 0.9365 0.6844 0.279 58.82 78±2 SACNNs 0.9961 0.7436 0.9452 0.6931 0.285 53.72 136±2 5.3 Compared with diverse GCNNs on non-Euclidean domains To verify the versatility of SACNNs for non-Euclidean structured data, we build SACNNs to classify the texts in 20News and Reuters, recognize the skeleton-based actions in NTU, estimate the activities of molecules in DPP4, and predict the taxis flows in TF-198, respectively. In addition, Mnist is also used to see how these GCNNs perform on Euclidean structured data. Table 2 gives the results in this experiment, which shows that SACNNs and SACNNs† outperform all the compared methods with significant margins. In addition, we have several observations from the table. First, dramatical improvements are achieved by SACNNs on both Euclidean and non-Euclidean domains in numerous tasks. Such a good performance verifies that SACNNs can effectively deal with data on different domains, without any human intervention. Second, Table 1, Table 2 and Figure 2 consistently show that SACNNs always achieve better performance than SACNNs†. These results empirically confirm that the local structure representation learning is capable of capturing the significant structure information from data, thus improving the capability of SACNNs with only a few additional learnable parameters. Furthermore, Table 1 and Table 2 report the time consumptions of the evaluated methods when one epoch is executed on Mnist during training. From these tables, we observe that SACNNs are obviously faster than the competitive GCNN methods. Compared with the CNN methods, the timing cost of SACNNs is tolerably, which ensures the practicability of SACNNs. 5.4 Ablation study In this subsection, we perform extensive ablation studies on diverse datasets to synthetically analyze the developed SACNNs. Intuitively, all the results are illustrated in Figure 3. Due to the space limitation, the learned filters in SACNNs are presented in the supplementary material. Impact of polynomial order To show the impact of polynomial order t on the structure-aware convolution, we select t from {5, 40, 80, 120, 160} to generate 11 × 11 filters to classify STL-10. Figure 3 (a) illustrates the validation errors of SACNNs with different t. One can observe that the performance generally improves if we increase the polynomial order t, then the performance will saturate when filters can be well approximated, i.e., t ≥80 is satisfied. Moreover, it is worthy to note that the developed SACNNs can utilize parameters more effectively than ClaCNNs. This is empirically supported by the observation that SACNNs with only 40 parameters per filter can achieve significant better performance than ClaCNNs with 11 × 11 = 121 parameters per filter. Influence of channels On the Cifar-10 dataset, we model SACNNs with different numbers of channels c (i.e., 8, 16, 32) to study its influence on the local structure representations learning. Specifically, we observe the following two tendencies from Figure 3 (b). The first one is that the performance of both SACNNs and ClaCNNs benefits from the increase of the channel numbers. This is reasonable since more parameters may improve the expressive capability of networks in general. Second, our SACNNs work consistently better than ClaCNNs, especially when the channel number is relatively large. One considerable reason is that more information can be exploited to model the latent structure information to assist SACNNs achieving superior performance. 7 0 20 40 60 80 100 0.3 0.4 0.5 0.6 epoch validation error (STL-10) (a) SACNN:t = 5 SACNN:t = 120 SACNN:t = 40 SACNN:t = 160 SACNN:t = 80 ClaCNN:11 × 11 0 20 40 60 80 100 0.2 0.3 epoch validation error (Cifar-10) (b) SACNN:c = 32 ClaCNN:c = 32 SACNN:c = 16 ClaCNN:c = 16 SACNN:c = 8 ClaCNN:c = 8 0 10 20 30 40 50 0.4 0.6 0.8 epoch validation error (20News) (c) ∗SACNN:1k SACNN:1k ∗SACNN:2k SACNN:2k ∗SACNN:3k SACNN:3k 0 50 100 150 200 0.4 0.6 0.8 epoch validation error (Cifar-100) (d) SACNN:10k ClaCNN:10k SACNN:25k ClaCNN:25k SACNN:50k ClaCNN:50k 0 20 40 60 80 100 0.1 0.2 0.3 epoch validation error (Cifar-10) (e) SACNN:Chebyshev SACNN:Legendre ClaCNN:3 × 3 Res20 Res32 Res44 Res56 Res110 6 7 8 9 network testing error % (Cifar-10) (f) SACNNs ClaCNNs 0 2 4 6 1 2 3 iteration (1e2) cross-entropy loss (Mnist) (g) SACNNs std SACNNs mean ClaCNNs std ClaCNNs mean 1 2 3 4 5 6 7 8 9 10 0 0.2 0.4 layer parameters distribution (Mnist) (h) SACNN std SACNN mean ClaCNN std ClaCNN mean Figure 3: Ablation studies on various datasets. (a) Impact of polynomial order. (b) Influence of channels. (c) Transfer learning from Reuters to 20News. (d) Impact of training samples. (e) Influence of basis functions. (f) Integration with recent networks. (g) Sensitivity to initialization. (h) Parameters distribution. Large figures can be found in the supplementary material. Transfer learning from Reuters to 20News To reveal the transferability of SACNNs, we finetune the SACNNs that are pre-trained on Reuters (denoted as *SACNNs), with a small number of labeled samples (i.e., 1k, 2k, 3k) in the 20News dataset. Figure 3 (c) shows that the pre-training on Reuters can significantly elevate the performance of SACNNs on 20News and stabilize the training process simultaneously, especially when labeled training samples are limited. This demonstrates that SACNNs learned on a domain can be seamlessly transferred to similar domains. Impact of training samples We randomly sample three sub-datasets with various sizes (i.e., 10k, 25k, 50k) from Cifar-100 to evaluate the impact of number of training samples on SACNNs. As illustrated in Figure 3 (d), the performance of SACNNs improves when more training samples are used. Furthermore, the superiority of our SACNNs against ClaCNNs holds on all these cases, which means that SACNNs are capable of tackling machine learning tasks with both rich and limited data. Influence of basis functions To investigate the influence of basis functions on SACNNs, the Legendre polynomials are employed as basis functions to learn filters on Cifar-10. Similar to the Chebyshev polynomials, the Legendre polynomial hk(x) of order k−1 (k ≥3) can be obtained based on the recurrence relation hk(x) = 2k+1 k+1 hk−1(x) − k k+1hk−2(x), with h1(x) = 1 and h2(x) = x. From Figure 3 (e), almost the same training processes are generated in spite of diverse bases. The slight mismatching may come from the randomness in training, e.g., random mini-batch selections. This demonstrates that the learnability of SACNNs is robust to the basis functions. Integration with recent networks A class of popular networks, i.e., ResNets [15], are employed to survey the range of applications of our structure-aware convolution. The results in Figure 3 (f) clearly indicate that better improvements will be achieved by replacing the classical convolution in ResNets with the structure-aware convolution. This adequately validates that the structure-aware convolution suffices to be applied to general ClaCNNs, not confined to simple and shallow networks. Sensitivity to initialization We carry out an experiment on Mnist to contrastively analyze the sensitivities to initializations in SACNNs and ClaCNNs. In this experiment, parameters in networks are randomly initialized with a uniform distribution U(−α, α), where α is randomly selected from [0, 1]. Figure 3 (g) illustrates the descending processes of loss functions in ClaCNNs and SACNNs, indicating that SACNNs generally converge faster than ClaCNNs and are robust to initializations. A possible reason is that the whole values in the generated discrete filters fRi = {f(rji)|eji ∈E} can be together modified by adjusting each coefficient of basis functions, which may yield more precise gradients to accelerate and stabilize the training processes. Parameters distribution Figure 3 (h) shows the distributions of parameters learned by ClaCNNs and SACNNs on Mnist in ten convolutional layers. From the figure, we have the following two observations. First, the parameters in both SACNNs and ClaCNNs have almost the same standard deviations. Second, the expectations of parameters in SACNNs are more closer to 0 than ClaCNNs. 8 These observations reveal that SACNNs have more sparse parameters than ClaCNNs. As a result, more robust models will be achieved, which is in accordance with the results in Section 5.2. 6 Conclusion We present a conceptually simple yet powerful structure-aware convolution to establish SACNNs. In the structure-aware convolution, filters are represented via univariate functions, which suffice to aggregate local inputs with diverse topological structures. By feat of the function approximation theory, a numerical strategy is proposed to learn these filters in an effectively and efficiently way. Furthermore, rather than using the predefined local structures of data, we incorporate them into the structure-aware convolution to learn the underlying structure information from data automatically. Extensive experimental results strongly demonstrate that the structure-aware convolution can be equipped in SACNNs to learn high-level representations and latent structures for both Euclidean and non-Euclidean structured data. In the future, we plan to systematically investigate the interpretability of SACNNs based on their functional filters, i.e., univariate functions. Acknowledgments This work was supported by the National Natural Science Foundation of China under Grants 91646207, 61773377 and 61573352, and the Beijing Natural Science Foundation under Grants L172053. We would like to thank Lele Yu, Bin Fan, Cheng Da, Tingzhao Yu, Xue Ye, Hongfei Xiao, and Qi Zhang for their invaluable contributions in shaping the early stage of this work. References [1] James Atwood and Don Towsley. Diffusion-convolutional neural networks. In NIPS, pages 1993–2001, 2016. [2] Davide Boscaini, Jonathan Masci, Emanuele Rodolà, and M. M. Bronstein. Learning shape correspondence with anisotropic convolutional neural networks. In NIPS, pages 3189–3197, 2016. [3] M. M. Bronstein, Joan Bruna, Yann LeCun, Arthur Szlam, and Pierre Vandergheynst. Geometric deep learning: Going beyond euclidean data. IEEE Signal Process. Mag., 34(4):18–42, 2017. [4] Joan Bruna, Wojciech Zaremba, Arthur Szlam, and Yann LeCun. Spectral networks and locally connected networks on graphs. CoRR, abs/1312.6203, 2013. [5] Jianlong Chang, Lingfeng Wang, Gaofeng Meng, Shiming Xiang, and Chunhong Pan. Deep unsupervised learning with consistent inference of latent representations. Pattern Recognition, 77:438–453, 2017. [6] Jianlong Chang, Lingfeng Wang, Gaofeng Meng, Shiming Xiang, and Chunhong Pan. Deep adaptive image clustering. In ICCV, pages 5880–5888, 2017. [7] François Chollet. Xception: Deep learning with depthwise separable convolutions. In CVPR, pages 1800–1807, 2017. [8] Adam Coates, Andrew Ng, and Honglak Lee. An analysis of single-layer networks in unsupervised feature learning. In AISTATS, pages 215–223, 2011. [9] Jifeng Dai, Haozhi Qi, Yuwen Xiong, Yi Li, Guodong Zhang, Han Hu, and Yichen Wei. Deformable convolutional networks. In ICCV, pages 764–773, 2017. [10] Micha¨el Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on graphs with fast localized spectral filtering. In NIPS, pages 3837–3845, 2016. [11] I. S. Dhillon, Yuqiang Guan, and Brian Kulis. Weighted graph cuts without eigenvectors A multilevel approach. IEEE Trans. Pattern Anal. Mach. Intell., 29(11):1944–1957, 2007. [12] Justin Gilmer, S. S. Schoenholz, P. F. Riley, Oriol Vinyals, and G. E. Dahl. Neural message passing for quantum chemistry. In ICML, pages 1263–1272, 2017. [13] Xavier Glorot, Antoine Bordes, and Yoshua Bengio. Deep sparse rectifier neural networks. In AISTATS, pages 315–323, 2011. [14] D. K. Hammond, Pierre Vandergheynst, and Rémi Gribonval. Wavelets on graphs via spectral graph theory. Applied & Computational Harmonic Analysis, 30(2):129–150, 2009. [15] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, pages 770–778, 2016. 9 [16] Mikael Henaff, Joan Bruna, and Yann LeCun. Deep convolutional networks on graph-structured data. CoRR, abs/1506.05163, 2015. [17] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, pages 448–456, 2015. [18] Max Jaderberg, Karen Simonyan, Andrew Zisserman, and Koray Kavukcuoglu. Spatial transformer networks. In NIPS, pages 2017–2025, 2015. [19] Yunho Jeon and Junmo Kim. Active convolution: Learning the shape of convolution for image classification. In CVPR, pages 1846–1854, 2017. [20] Kaggle. Merck molecular activity challenge. https://www.kaggle.com/c/MerckActivity, 2012. [21] D. P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2014. [22] T. N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. CoRR, abs/1609.02907, 2016. [23] Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Master’s Thesis, Department of Computer Science, University of Torono, 2009. [24] Alex Krizhevsky, Ilya Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. In NIPS, pages 1106–1114, 2012. [25] Ken Lang. Newsweeder: Learning to filter netnews. In ICML, pages 331–339, 1995. [26] Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998. [27] Ruoyu Li, Sheng Wang, Feiyun Zhu, and Junzhou Huang. Adaptive graph convolutional neural networks. CoRR, abs/1801.03226, 2018. [28] Yujia Li, Daniel Tarlow, Marc Brockschmidt, and R. S. Zemel. Gated graph sequence neural networks. CoRR, abs/1511.05493, 2015. [29] Renjie Liao, Marc Brockschmidt, Daniel Tarlow, A. L. Gaunt, Raquel Urtasun, and R. S. Zemel. Graph partition neural networks for semi-supervised classification. CoRR, abs/1803.06272, 2018. [30] Jonathan Masci, Davide Boscaini, M. M. Bronstein, and Pierre Vandergheynst. Geodesic convolutional neural networks on riemannian manifolds. In ICCV Workshops, pages 832–840, 2015. [31] Federico Monti, Davide Boscaini, Jonathan Masci, Emanuele Rodolà, Jan Svoboda, and M. M. Bronstein. Geometric deep learning on graphs and manifolds using mixture model cnns. In CVPR, pages 5425–5434, 2017. [32] Shaoqing Ren, Kaiming He, R. B. Girshick, and Jian Sun. Faster R-CNN: towards real-time object detection with region proposal networks. In NIPS, pages 91–99, 2015. [33] Avraham Ruderman, N. C. Rabinowitz, A. S. Morcos, and Daniel Zoran. Learned deformation stability in convolutional neural networks. CoRR, abs/1804.04438, 2018. [34] K.T. Sch¨utt, F. Arbabzadah, S. Chmiela, K.R. M¨uller, and A. Tkatchenko. Quantum-chemical insights from deep tensor neural networks. Nature Communications, 8(13890), 2017. [35] M. S. Schlichtkrull, T. N. Kipf, Peter Bloem, Rianne van den Berg, Ivan Titov, and Max Welling. Modeling relational data with graph convolutional networks. CoRR, abs/1703.06103, 2017. [36] Amir Shahroudy, Jun Liu, Tian-Tsong Ng, and Gang Wang. NTU RGB+D: A large scale dataset for 3d human activity analysis. In CVPR, pages 1010–1019, 2016. [37] Martin Simonovsky and Nikos Komodakis. Dynamic edge-conditioned filters in convolutional neural networks on graphs. In CVPR, pages 29–38, 2017. [38] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. CoRR, abs/1409.1556, 2014. [39] Petar Velickovic, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Liò, and Yoshua Bengio. Graph attention networks. CoRR, abs/1710.10903, 2017. [40] Nitika Verma, Edmond Boyer, and Jakob Verbeek. Dynamic filters in graph convolutional networks. CoRR, abs/1706.05206, 2017. [41] Fisher Yu and Vladlen Koltun. Multi-scale context aggregation by dilated convolutions. CoRR, abs/1511.07122, 2015. [42] Qi Zhang, Qizhao Jin, Jianlong Chang, Shiming Xiang, and Chunhong Pan. Kernel-weighted graph convolutional network: A deep learning approach for traffic forcasting. In ICPR, pages 1018–1023, 2018. 10
2018
113
7,268
Alternating Optimization of Decision Trees, with Application to Learning Sparse Oblique Trees Miguel ´A. Carreira-Perpi˜n´an Dept. EECS, University of California, Merced mcarreira-perpinan@ucmerced.edu Pooya Tavallali Dept. EECS, University of California, Merced ptavallali@ucmerced.edu Abstract Learning a decision tree from data is a difficult optimization problem. The most widespread algorithm in practice, dating to the 1980s, is based on a greedy growth of the tree structure by recursively splitting nodes, and possibly pruning back the final tree. The parameters (decision function) of an internal node are approximately estimated by minimizing an impurity measure. We give an algorithm that, given an input tree (its structure and the parameter values at its nodes), produces a new tree with the same or smaller structure but new parameter values that provably lower or leave unchanged the misclassification error. This can be applied to both axis-aligned and oblique trees and our experiments show it consistently outperforms various other algorithms while being highly scalable to large datasets and trees. Further, the same algorithm can handle a sparsity penalty, so it can learn sparse oblique trees, having a structure that is a subset of the original tree and few nonzero parameters. This combines the best of axis-aligned and oblique trees: flexibility to model correlated data, low generalization error, fast inference and interpretable nodes that involve only a few features in their decision. 1 Introduction Decision trees are among the most widely used statistical models in practice. They are routinely at the top of the list in the KDnuggets.com annual polls of top machine learning algorithms and other top-10 lists [36]. Many statistical or mathematical packages such as SAS or Matlab implement them. Apart from being able to model nonlinear data well in the first place, they enjoy several unique advantages. The prediction made by the tree is a path from the root to a leaf consisting of a sequence of decisions, each involving a question of the type “xj > bi” (is feature j bigger than threshold bi?) for axis-aligned trees, or “wT i x > bi” for oblique trees. This makes inference very fast, and may not even need to use all input features to make a prediction (with axis-aligned trees). The path can be understood as a sequence of IF-THEN rules, which is intuitive to humans, and indeed one can equivalently turn the tree into a database of rules. This can make decision trees preferable over more accurate models such as neural nets in some applications, such as medical diagnosis or legal analysis. However, trees pose one crucial problem that is only partly solved to date: learning the tree from data is a very difficult optimization problem, involving a search over a complex, large set of tree structures, and over the parameters at each node. For simplicity, in this paper we focus on classification trees with a binary tree (having a binary split at each node) where the bipartition in each node is either an axis-aligned hyperplane or an arbitrary hyperplane (oblique trees). However, many of our arguments carry over beyond this case. Ideally, the objective function we would like to optimize has the usual form of a regularized loss: E(T ) = L(T ) + α C(T ) α > 0 (1) where L is the misclassification error on the training set, given below in eq. (2), and C is the complexity of the tree, e.g. its depth or number of nodes. This is necessary to avoid large trees that finely 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montr´eal, Canada. split the space so the dataset is perfectly classified, but would likely overfit. Finding an optimal decision tree is NP-hard [22] even if we fix its number of splits [26]. How does one learn a tree in practice (also called “tree induction”)? After many decades of research, the algorithms that have stood the test of time are, in spite of their obvious suboptimality, (variations of) greedy growing and pruning, such as CART [8] or C4.5 [31]. First, a tree is grown by recursively splitting each node into two children, using an impurity measure. One can stop growing and return the tree when the impurity of each leaf falls below a set threshold. Even better trees are produced by growing a large tree and pruning it back one node at a time. At each growing step, the parameters at the node are learned by minimizing an impurity measure such as the Gini index, cross-entropy or misclassification error. The goal is to find a bipartition where each class is as pure (single-class) as possible. Gini or cross-entropy are preferable to misclassification error because the former are more sensitive to changes in the node probabilities than the misclassification rate [20, p. 309]. Minimizing the impurity over the parameters at the node depends on the node type: • Axis-aligned trees: the exact solution can be found by enumeration over all (feature, threshold) combinations. For a given feature (= axis), the possible thresholds are the midpoints between consecutive training point values along that axis. For a node i containing Ni training points in RD, an efficient implementation can do this in O(DNi) time. • Oblique trees: minimizing the impurity is much harder because it is a non-differentiable function of the weights. As these change continuously, points change side of the hyperplane discontinuously, and so does the impurity. The standard approach is coordinate descent over the weights at the node, but this tends to get stuck in poor local optima [8, 28]. The optimization over the node parameters (exact for axis-aligned trees, approximate for oblique trees) assumes the rest of the tree (structure and parameters) is fixed. The greedy nature of the algorithm means that once a node is optimized, it its fixed forever. Note that it is only in the leaves where an actual predictive model is fit. The internal nodes do not do prediction, they partition the space ever more finely into boxes (axis-aligned trees) or polyhedra (oblique trees). Each internal node bipartitions its region. Each leaf fits a local model to its region (for classification, the model is often the majority label of the training points in its region). Hence, the tree is really a partition of the space into disjoint regions with a local predictor at each region and a fast access to the region for a given input point (by propagating it through the tree). The majority of trees used in practice are axis-aligned, not oblique. Two possible reasons for this are 1) an oblique tree is slower at inference and less interpretable because each node involves all features. And 2) as noted above and confirmed in our experiments, coordinate descent for oblique trees does not work as well, and often an axis-aligned tree will outperform in test error an oblique tree of similar size. This is disappointing because an axis-aligned tree imposes an arbitrary region geometry that is unsuitable for many problems and results in larger trees than would be needed. In this paper we improve both of these problems with oblique trees. We focus on a restricted setting: we assume a given tree structure, given by an initial tree (CART or random). We propose an optimization algorithm for the tree parameters that considerably decreases its misclassification error. Further, this allows us to introduce a new type of trees that we call sparse oblique trees, where each node is a hyperplane involving only a small subset of features, and whose structure is a pruned version of the original tree. Our algorithm is based on directly optimizing the quantity of interest, the misclassification error, using alternating optimization over separable subsets of nodes. After a section 2 on related work, we describe our algorithm in section 3 and evaluate it in sections 4 and 5. 2 Related work The CART book [8] is a good summary of work on decision trees up to the 80s, including the basic algorithms to learn the tree structure (greedy growing and pruning), and to optimize the impurity measure at each node (by enumeration for the axis-aligned case and coordinate descent over the weights for the oblique case). OC1 [28] is a minor variation of the coordinate descent algorithm of CART for oblique trees that uses multiple restarts and random perturbations after convergence to try to find a better local optimum, but its practical improvement is marginal. See [31, 32] for reviews of more recent work, including tree induction and applications. There is also a large literature on 2 constructing ensembles of trees, such as random forests [7, 13] or boosting [33], but we focus here on learning a single tree. Much research has focused on optimizing the parameters of a tree given a initial tree (obtained with greedy growing and pruning) whose structure is kept fixed. Bennett [2, 3] casts the problem of optimizing a fixed tree as a linear programming problem, in which the global optimum could be found. However, the linear program is so large that the procedure is only practical for very small trees (4 internal nodes in her experiments); also, it applies only to binary classification. Norouzi et al. [29, 30] introduce a framework based on optimizing an upper bound over the tree loss using stochastic gradient descent (initialized from an already induced tree). Their method is scalable to large datasets, however it is not guaranteed to decrease the real loss function of a decision tree and may even marginally worsen an already induced tree. Bertsimas and Dunn [4] formulate the optimization over tree structures (limited to a given depth) and node parameters as a mixed-integer optimization (MIO) by introducing auxiliary binary variables that encode the tree structure. Then, one can apply state-of-the-art MIO solvers (based on branch-and-bound)that are guaranteed to find the globally optimum tree (unlike the classical, greedy approach). However, this has a worst-case exponential cost and again is not practical unless the tree is very small (depth 2 to 4 in their paper). Methods such as T2 [1], T3 [34] and T3C [35], introduce a family of efficient enumeration approaches constructing optimal non-binary decision trees of depths up to 3. These trees may not be as interpretable as binary ones and do not outperform existing approaches of inducing trees [34, 35]. Finally, soft decision trees assign a probability to every root-leaf path of a fixed tree structure, such as the hierarchical mixtures of experts [23]. The parameters can be learned by maximum likelihood with an EM or gradient-based algorithm. However, this loses the fast inference and interpretability advantages of regular decision trees, since now an instance must follow each root-leaf path. 3 Alternating optimization over node sets Problem definition We want to optimize eq. (1) but assuming a given, fixed tree structure (obtained e.g. from the CART algorithm, i.e., greedy growing and pruning for axis-aligned or oblique trees with impurity minimization at each node). Equivalently, since the tree complexity is fixed, we minimize the misclassification cost jointly over the parameters Θ = {θi} of all nodes i of the tree: L(Θ) = N X n=1 L(yn, T (xn; Θ)) (2) where {(xn, yn)}N n=1 ⊂RD × {1, . . . , K} is a training set of D-dimensional real-valued instances and their labels (in K classes), L(·, ·) is the 0/1 loss, and T (x; Θ): RD →{1, . . . , K} is the predictive function of the tree. This is obtained by propagating x along a path from the root down to a leaf, computing a binary decision fi(x; θi): RD →{left, right} at each internal node i along the path, and outputing the leaf’s label. Hence, the parameters θi at a node i are: • If i is a leaf, θi = {yi} ⊂{1, . . . , K} contains the label at that leaf. • If i is an internal (decision) node, θi = {wi, bi} where wi ∈RD is the weight vector and bi ∈R the threshold (or bias) for the decision hyperplane “wT i x ≥bi”. For axis-aligned trees, the decision hyperplane is “xk(i) ≥bi” where k(i) ∈{1, . . . , D}, i.e., we threshold the feature k(i), hence θi = {k(i), bi}. Separability condition The key to design a good optimization algorithm for (2) is the following separability condition. Assume the parameters are not shared across nodes (i ̸= j ⇒θi ∩θj = ∅). Theorem 3.1 (separability condition). Let T (x; Θ) be the predictive function of a rooted directed binary decision tree. If nodes i and j (internal or leaves) are not descendants of each other, then, as a function of θi and θj (i.e., fixing all other parameters Θ \ {θi, θj}), the function L(Θ) of eq. (2) can be written as L(θi, θj) = Li(θi) + Lj(θj) + constant, where the “constant” does not depend on θi or θj. Proof. Each training point xn for n ∈{1, . . ., N} follows a unique path from the root to one leaf of the tree. Hence, a node i receives a subset {(xn, yn): n ∈Si} of the training set {(xn, yn)}N n=1, 3 on which its bisector (with parameters θi) will operate. If i and j are not descendants of each other, then their subsets are disjoint. Since L(Θ) is a separable sum over the N points, then the theorem follows, with Li(θi) summing those training points in Si, Lj(θj) summing those in Sj, and the remaining points being summed in the “constant” term. That is, the respective terms are: L(Θ) = X n∈Si L(yn, T (xn; Θ)) | {z } Li(θi) + X n∈Sj L(yn, T (xn; Θ)) | {z } Li(θj) + X n∈{1,...,N}\(Si∪Sj) L(yn, T (xn; Θ)) | {z } constant . Note that Li depends on the parameters θk of other nodes k besides i but it does not depend on θj. Likewise, Lj depends on other nodes’ parameters besides j’s but it does not depend on θi; and the “constant” term depends on other nodes’ parameters but it does not depend on θi or θj. The separability condition allows us to optimize separately (and in parallel) over the parameters of any set of nodes that are not descendants of each other (fixing the parameters of the remaining nodes). This has two advantages. First, we expect a deeper decrease of the loss, because we optimize over a large set of parameters exactly. This is because optimizing over each node can be done exactly (see some caveats later) and the nodes separate. Second, the computation is fast: the joint problem over the set becomes a collection of smaller independent problems over the nodes that can be solved in parallel (if so desired). There are many possible choices of such node sets, and it is of interest to make those sets as big as possible, so that we make large, fast moves in search space. One example of set is “all nodes at the same depth” (distance from the root), and we will focus on it. TAO: alternating optimization over depth levels of the tree We cycle over depth levels from the bottom (leaves) to the top (root) and iterate bottom-top, bottom-top, etc. (i.e., reverse breadth-first order). We experimented with other orders (top-bottom, or alternating bottom-top and top-bottom) but found little difference in the results for both axis-aligned and oblique trees. At a given depth level, we optimize in parallel over all the nodes. We call this algorithm Tree Alternating Optimization (TAO). The optimization over each node is described below. Before, we make some observations. As TAO iterates, the root-leaf path followed by each training point changes and so does the set of points that reach a particular node. This can cause dead branches and pure subtrees, which we remove after convergence. Dead branches arise if, after optimizing over a node, some of its subtrees (a child or other descendants) become empty because they receive no training points from their parent (which sends all its points to the other child). The subtree of a node with one empty child can be replaced with the non-empty child’s subtree. We do not do this as soon as they become empty in case they might become non-empty again. Pure subtrees arise if, after optimizing over a node, some of its subtrees become pure (i.e., all their points have the same label). A pure subtree can be replaced with a leaf but, as with dead branches, we do this after convergence, in case they become impure again. During each pass, only non-empty, impure nodes are processed, so dead branches and pure subtrees are ignored, which accelerates the algorithm. This means that TAO can actually modify the tree structure, by reducing the size of the tree; we call this indirect pruning, and it is very significant with sparse oblique trees (described later). It is a good thing because we achieve (while always decreasing the training loss) a smaller tree that is faster, takes less space and—having fewer parameters—probably generalizes better. TAO pseudocode appears in the supplementary material. Optimizing the misclassification error at a single node As we show below, optimizing eq. (2), the K-class misclassification error of the tree over a node’s parameters (decision function at an internal node or predictor model at a leaf), reduces to optimizing a misclassification error of a simpler classifier. In some important special cases this “reduced problem” can be solved exactly, but in general it is an NP-hard problem [17, 21]. In the latter case, we can approximate it by a surrogate loss (e.g. logistic or hinge loss with a support vector machine). We consider each type of node next (leaf or internal). Optimizing (2) over a leaf is equivalent to minimizing the K-class misclassification error over the subset of training points that reach the leaf. If the classifier at the leaf is a constant label, this is solved exactly by majority vote (i.e., setting the leaf label to the most frequent label in the leaf’s subset of points). If the classifier at the leaf is some other model, we can train it using a surrogate of the misclassification error. 4 Optimizing (2) over an internal node i is exactly equivalent to a reduced problem: a binary misclassification loss for a certain subset Ci (defined below) of the training points over the parameters θi of i’s decision function fi(x; θi). The argument is subtle; we show it step by step. Firstly, optimizing the misclassification error over θi in (2), where is summed over the whole training set, is equivalent to optimizing it over the subset of training points Si that reach node i. Next, the fate of a point xn ∈Si (i.e., the label the tree will predict for it) depends only on which of i’s children it follows, because the decision functions and leaf predictor models in the subtree rooted at i are fixed (in other words, the subtree of each child of i is a fixed decision tree that classifies whatever is inputted to it). Hence, call zj ∈{1, . . . , K} the label predicted for xn if following child j (where j is left or right). Now, comparing the ground-truth label yn of xn in the training set with the predicted label zj for child j, they can either be equal (yn = zj, correct classification) or not (yn ̸= zj, incorrect classification). Hence, if xn is correctly classified for all children j ∈{left, right}, or incorrectly classified for all children j ∈{left, right}, the fate for this point cannot be altered by changing the decision function at i, and we call such a point “don’t-care”. It can be removed from the loss since it contributes an additive constant. Therefore, the only points (“care” points) whose fate does depend on the parameters of i’s decision function are those for which zleft = yn ̸= zright or zright = yn ̸= zleft. Then, we can define a new, binary classification problem over the parameters θi of the decision function fi(x; θi) on the “care” points Ci ⊆Si where xn ∈Ci has a label yn ∈{left, right}, according to which child classifies it correctly. The misclassification error in this problem equals the misclassification error in eq. (2) for each “care” point. In summary, we have proven the following theorem. Theorem 3.2 (reduced problem). Let T (x; Θ) be the predictive function of a rooted directed binary decision tree and i be any internal node in the tree with decision function fi(x; θi). The tree’s K-class misclassification error (2) can be written as: L(Θ) = N X n=1 L(yn, T (xn; Θ)) = X n∈Ci L(yn, fi(xn; θi)) + constant (3) where the “constant” does not depend on θi, Ci ⊂{1, . . . , N} is the set of “care” training points for i defined above, and yn ∈{left, right} is the child that leads to a correct classification for xn under i’s current subtree. All is left now is how to solve this binary misclassification loss problem: Reduced problem: min θi X n∈Ci L(yn, fi(xn; θi)). (4) For axis-aligned trees, it can be solved exactly by enumeration over features and splits, just as in the CART algorithm to minimize the impurity. For oblique trees, we approximate it by a surrogate loss. The reduced problem is, of course, much easier to solve than the original loss over the tree. In particular for the oblique case (where the node decision function is a hyperplane, for which enumeration is intractable), the reduced problem introduces a crucial advantage over the traditional impurity minimization in CART. The latter is a non-differentiable, unsupervised problem, which is solved rather inaccurately via coordinate descent over the hyperplane weights. The reduced problem is non-differentiable but supervised and can be conveniently approximated by a surrogate binary classification loss, much easier to solve accurately. This improved optimization translates into much better trees using TAO, as seen in our experiments. Sparse oblique trees The equivalence of optimizing (2) over one oblique node to the reduced problem (4) makes it computationally easy to introduce constraints over the weight vector and hence learn more flexible types of oblique trees than was possible before. In this paper we propose to learn oblique nodes involving few features. We can do this by adding an ℓ1 penalty “λ P nodes i ∥wi∥1” to the misclassification error (2) where λ ≥0 controls the sparsity: from no sparsity for λ = 0 to all weight vectors in all nodes being zero if λ is large enough. Since this penalty separates over nodes, the only change in TAO is that the optimization over node i in eq. (4) has a penalty “λ∥wi∥1”. This can be easily combined with the formulation above, resulting in an ℓ1-regularized linear SVM or logistic regression [19, sections 3.2 and 3.6], a convex problem for which well-developed code exists, such as LIBLINEAR [15]. Alternatively, one can use an ℓ0 penalty or constraint on the weights, for which good optimization algorithms also exist [14]. 5 Convergence and computational complexity Optimizing the misclassification loss L is NP-hard in general [17, 21, 26] and we have no approximation guarantees for TAO at present. TAO does converge to a local optimum in the sense of alternating optimization (as in k-means), i.e., when no more progress can be made by optimizing one subset of nodes given the rest. For oblique trees, the complexity of one TAO iteration (pass over all nodes) is upper bounded by the tree depth times the cost of solving an SVM on the whole training set, and is typically quite smaller than that. For axis-aligned trees, one TAO iteration is comparable to running CART to grow a tree of the same size, since in both cases the nodes run an enumeration procedure over features and thresholds. See details in the supplementary material. 4 Experiments: sparse oblique trees for MNIST digits The supplementary material gives additional experiments using TAO to optimize axis-aligned and oblique trees on over 10 datasets and comparing with other methods for optimizing trees. In a nutshell, TAO produces trees that significantly improve over the CART baseline for axis-aligned and especially oblique trees, and also consistently beat the other methods. But where TAO is truly remarkable is with sparse oblique trees, and we explore this here in the MNIST benchmark [27]. We induce an initial tree for TAO using the CART algorithm1 (greedy growing and pruning) either for axis-aligned trees (enumeration over features/thresholds) or oblique trees (coordinate descent over weights, picking the best of several random restarts [28]). The node optimization uses an ℓ1regularized linear SVM with slack hyperparameter C ≥0 (so the TAO sparsity hyperparameter in section 3 is λ = 1/C), implemented with LIBLINEAR [15]. The rest of our code is in Matlab. We stop TAO when the training misclassification loss decreases but by less than 0.5%, or the number of iterations (passes over all nodes) reaches 14 (in practice TAO stops after around 7 iterations). Sparse oblique trees behave like the LASSO [20]: we have a path of trees as a function of the sparsity hyperparameter C, from ∞(no ℓ1 penalty) to 0 (all parameters zero). We estimate this path by inducing an initial CART tree and running TAO for a sequence of decreasing C values, where the tree at the current C value is used to initialize TAO for the next, smaller C value. We constructed paths using initial CART trees of depths 4 to 12 (both axis-aligned and oblique) on the MNIST dataset, splitting its training set of 60k points into 48k training and 12k validation (to determine an optimal C or depth), and reporting generalization error on its 10k test points. The training time for each C value is roughly between 1 minute (for depth 4) and 4 minutes (for depth 12). Path of trees The resulting paths are best viewed in our supplementary animations. Fig. 1 shows three representative trees from the path for depth 12: the initial CART tree (which was oblique), the tree with optimal validation error and an oversparse tree. It also plots various measures as a function of C. Several observations are obvious, as follows. As soon as TAO runs on the initial CART tree (for the largest C value, which imposes little sparsity), the improvement is drastic: from a training/test error of 1.95%/11.03% down to 0.09%/5.66%. The tree is pruned from 410 to 230 internal nodes (the number of leaves for a binary tree equals the number of internal nodes plus 1). The TAO tree is more balanced: the samples are distributed more evenly over the tree branches and the training subset that a node receives is more pure. This can be seen explicitly from the node histograms (tree as binary heap animations in the supplementary material) or indirectly from the sample mean of the node. Further decreasing C imposes more sparsity and this leads to progressive pruning of the tree and ever sparser weight vectors at the internal nodes. The large changes in topology are caused by postprocessing the tree to remove dead branches. The number of nonzero weights and the number of nodes (internal and leaves) decreases monotonically with C. The training error slowly increases but the test error remains about constant. In general, depending on the initial tree size, we find the validation error (not shown) and the test error are minimal for some range of C); trees there will generalize best. Further decreasing C (beyond 0.01 in the figure) increases both training and test error and produces smaller trees with sparser weight vectors that underfit. 1During the review period we found out that TAO performs about as well on random initial trees (having random parameters at the nodes) as on trees induced by CART. This would make TAO a stand-alone learning algorithm rather than a postprocessing step over a CART tree. We will report on this in a separate publication. 6 Inference runtime For inference (prediction), each point follows a different root-leaf path. We report its mean/min/max path length (number of nodes) and runtime (number of operations, here scalar multiplications) over the training set, for each C. It decreases mostly monotonically with C. The inference time is extremely fast because the root-leaf path involves a handful of nodes and each node’s decision function looks at a few pixels of the image. This is orders-of-magnitude faster than kernel machines, deep nets, random forests or nearest-neighbor classifiers, and is a major advantage of trees. The same can be said of the model storage required. This is especially important at present given the need to deploy classifiers on resource-constrained IoT devices [9–11, 18, 24]. Classification accuracy The best test error for the TAO trees we obtained (having initial depth up to 12) is around 5%. To put this in perspective, we plot the error reported for MNIST for a range of models [27] vs. the number of parameters in fig. 1. The tree error is much better than than of linear models (≈12%) and boosted stumps (7.7%) and is comparable to that of a 2-layer neural net and a 3-nearest-neighbor classifier. Better errors can of course be achieved by many-parameter, complex models such as kernel SVMs or convolutional nets (not shown), or using image-specific transformations and features. Our trees operate directly on the image pixels with no special transformation and are astoundingly small and fast given their accuracy. For example, our tree achieves about the same test error as a 3-nearest-neighbor classifier, but the tree compares the input image with at most ≈6 sparse “images” (weight vectors), rather than with the 60 000 dense training images. Interpretable trees By using a high sparsity penalty, TAO allows us to obtain trees of suboptimal but reasonable test error that have a really small number of nodes and nonzero weights and are eminently interpretable. Fig. 1 shows an example for C = 0.01 (test error 10.19%, 0.22% nonzeros, 17 leaves). Examining the nodes’ weight vectors shows that the few weights that are not zero are strategically located to discriminate between specific classes or groups of classes, and essentially detect patterns characterized by the presence or absence of strokes in certain locations. Nodes use minimal features to separate large groups of digits, and leaf parents often separate very similar digits that differ on just one or two strokes. We mention some examples (referring to the nodes by their index in the figure). Node 53 separates 3s from 5s by detecting the small vertical stroke that precisely differentiates these digits (blue = negative, red = positive). Node 5 separates 4s from 9s by detecting the presence of a top horizontal stroke. Node 2 separates 7s from {4,9} by detecting ink in the left-middle of the image. Node 6 separates 0s from {1,2,3,5,8} by detecting the presence of ink in the center of the image but not in its sides. Node 1 (the root) separates {4,7,9} from the remaining digits. Also, once the tree is sparse enough, several of these weight vectors (such as nodes 2 and 5) tend to appear in the tree regardless of the initial tree and depth (see supplementary animations). In a sense, each decision node pays attention to a simple but high-level concept so the tree classifies digits by asking a few conceptual questions about the relative spatial presence of strokes or ink. A root-leaf path can then be seen as a sequence of conceptual questions that “define” a class. This is very different from the way convolutional neural networks operate, by constructing a large number of “features” that start very simple (e.g. edge detectors) and are combined into progressively more abstract features. While deep neural nets get very accurate predictions (so they are able to classify correctly even unusual digit shapes), this is achieved by very complex models that are not easy to interpret. Our trees do not reach such high accuracy, but arguably they are able to learn the more high-level, conceptual structure of each digit class. 5 Experiments: comparison with forest-based nearest-neighbor classifiers As requested by a reviewer, we compared CART+TAO with fast, forest-based algorithms that approximate a nearest-neighbor classifier (see [25] and references therein). Roughly speaking, these algorithms construct a tree that can approximate a nearest neighbor search and have a controllable tradeoff between approximation error and search speed. Thus, they can be used to approximate a nearest-neighbor classifier fast. On top of that, they can be ensembled into a forest. Although the comparison is not apples-to-apples (since the latter classifiers are not of the decision-tree type, and also are forests rather than a single tree), it is still very interesting. We followed the protocol of [25], which lists results for cover trees (CT) [5], random kd-trees (forest of 4 trees) [16] and boundary forest (BF) (50 trees) [25]. Table 1 shows our results for TAO on oblique trees (we initialized TAO from both axis-aligned and oblique CART trees and picked the 7 train err= 1.95% %nonzero= 6.65% test err=11.03% #splits= 410 1 (b=-1.19e-03) 1 0 -1 2 (b=9.68e-09) 4 (b=2.09e-05) 8 (b=9.24e-04) 16 (b=2.18e-02) 32 (b=5.84e-02) 64 (b=1.82e-03) 128 (b=4.79e-05) 256 (b=4.19e-02) 512 (b=1.45e-01) 513 (b=1.47e-02) 257 (b=4.43e-01) 514 (b=9.31e-01) 515 (b=1.21e-01) 129 (b=3.93e-02) 258 (b=7.58e-03) 517 (b=3.41e-01) 259 (b=9.76e-01) 65 (b=2.35e-02) 130(5, 4 ) 131 (b=9.89e-02) 263 (b=5.25e-01) 526 (b=1.36e-02) 33 (b=3.54e-02) 66 (b=5.88e-03) 132 (b=9.92e-01)133 (b=6.31e-01) 267 (b=2.92e-02) 535 (b=3.31e-02) 67(23, 2 ) 17 (b=6.68e-03) 34 (b=2.56e-01) 68(8, 2 ) 69 (b=1.96e-02) 138 (b=1.76e-02) 139(2, 3 ) 35 (b=4.55e-02) 70(45, 9 ) 71 (b=2.79e-02) 142 (b=3.14e-02) 143(4, 1 ) 9 (b=3.50e-05) 18 (b=1.04e-02) 36 (b=2.67e-03) 72 (b=4.45e-03) 144 (b=6.23e-03) 288 (b=2.29e-02) 576 (b=5.87e-01) 577 (b=9.51e-02) 289 (b=2.16e-02) 579 (b=2.68e-02) 145 (b=3.43e-03) 290 (b=6.60e-03) 580 (b=9.98e-01) 581 (b=5.75e-03) 291 (b=4.48e-04) 582 (b=9.14e-02) 583 (b=2.04e-02) 73 (b=4.11e-02) 146(32, 5 ) 147 (b=1.25e-02) 294 (b=1.52e-02) 588 (b=9.98e-01) 589 (b=2.57e-02) 37 (b=5.35e-03) 74 (b=6.72e-03) 148 (b=6.67e-04) 296 (b=6.85e-04) 592 (b=7.95e-03) 593 (b=8.95e-04) 149(31, 5 ) 75 (b=5.71e-02) 150 (b=9.17e-03) 301 (b=7.37e-01) 151 (b=9.02e-01) 303 (b=9.90e-01) 19 (b=6.40e-06) 38 (b=1.80e-03) 76 (b=3.72e-02) 152 (b=9.76e-01) 153(2, 2 ) 77 (b=2.03e-04) 154 (b=2.73e-04) 308 (b=1.90e-02) 616 (b=9.94e-01) 617 (b=2.72e-02) 155 (b=1.36e-03) 310 (b=1.49e-06) 621 (b=1.55e-01) 311 (b=9.86e-01) 39 (b=5.72e-04) 78 (b=7.74e-04) 156 (b=4.47e-02) 313 (b=1.29e-01) 626 (b=7.97e-04) 157 (b=6.05e-04) 314 (b=3.86e-04) 629 (b=2.28e-01) 315 (b=2.81e-03) 630 (b=3.52e-02) 631 (b=1.27e-04) 79 (b=3.68e-05) 158(46, 7 ) 159 (b=4.04e-02) 319 (b=1.77e-02) 638 (b=1.45e-01) 639 (b=2.61e-01) 5 (b=1.38e-10) 10 (b=-1.45e-04) 20 (b=4.56e-04) 40 (b=2.61e-05) 80 (b=2.08e-01) 160 (b=4.59e-02) 320 (b=9.62e-02) 641 (b=6.55e-01) 161(14, 6 ) 81 (b=6.31e-01) 162 (b=8.18e-01) 324 (b=9.91e-01) 648 (b=5.79e-03) 163 (b=9.90e-01) 41 (b=6.01e-03) 82 (b=6.49e-03) 164 (b=2.40e-02)165 (b=7.93e-01) 330 (b=4.87e-01) 661 (b=1.17e-01) 83(33, 2 ) 21 (b=1.41e-08) 42 (b=4.12e-09) 84 (b=6.67e-03) 168 (b=2.40e-02) 336 (b=8.84e-04) 672 (b=4.15e-02) 673 (b=2.19e-01) 337 (b=4.00e-03) 674 (b=1.25e-02) 675 (b=5.70e-04) 169 (b=8.31e-05) 338 (b=4.03e-03) 676 (b=9.98e-01) 677 (b=2.55e-02) 339 (b=4.26e-05) 678 (b=9.94e-01) 679 (b=8.03e-04) 85 (b=2.14e-04) 170 (b=4.62e-03) 340 (b=2.72e-02) 680 (b=8.67e-03) 681 (b=1.18e-01) 341 (b=1.96e-03) 683 (b=1.90e-02) 171 (b=6.61e-05) 342 (b=9.48e-02) 684 (b=1.65e-01) 685 (b=7.91e-01) 343 (b=1.43e-03) 686 (b=3.22e-06) 687 (b=2.76e-03) 43 (b=2.70e-06) 86 (b=2.03e-06) 172 (b=3.34e-02) 344 (b=1.56e-02) 688 (b=9.71e-01) 689 (b=8.63e-02) 345 (b=1.10e-01) 173 (b=5.11e-05) 346 (b=1.26e-03) 692 (b=4.04e-02) 693 (b=9.30e-01) 347 (b=2.09e-03) 694 (b=2.96e-03) 695 (b=2.94e-04) 87 (b=2.00e-06) 174 (b=4.37e-03) 348 (b=7.67e-01) 697 (b=1.25e-01) 349 (b=4.39e-03) 698 (b=2.59e-03) 699 (b=1.62e-01) 175 (b=3.84e-05) 350 (b=3.60e-03) 700 (b=2.39e-02) 701 (b=9.30e-04) 351 (b=3.94e-05) 702 (b=1.59e-03) 703 (b=9.35e-03) 11 (b=6.93e-06) 22 (b=7.28e-03) 44 (b=3.50e-02) 88 (b=4.35e-04) 176 (b=1.51e-06) 352 (b=5.26e-03) 704 (b=3.32e-01) 705 (b=9.94e-01) 353 (b=1.25e-03) 706 (b=6.32e-04) 707 (b=2.18e-01) 177 (b=1.05e-02) 355 (b=1.42e-01) 710 (b=2.42e-01) 89 (b=8.66e-03) 178(9, 10 ) 179 (b=1.60e-01) 358 (b=6.47e-03) 716 (b=4.01e-02) 45 (b=3.65e-03) 90 (b=1.29e-04) 180 (b=5.34e-03) 360 (b=9.82e-01)361 (b=4.83e-04) 722 (b=2.60e-03) 723 (b=6.42e-01) 181 (b=2.88e-02) 362 (b=9.95e-01) 724 (b=9.04e-01) 363 (b=2.40e-02) 726 (b=5.91e-01) 727 (b=7.14e-01) 91 (b=9.98e-01) 182 (b=9.54e-01) 183(1, 10 ) 23 (b=1.39e-05) 46 (b=4.45e-03) 92 (b=6.35e-01) 184(85, 4 ) 185(2, 5 ) 93 (b=1.84e-03) 186 (b=5.94e-01)187 (b=1.03e-03) 375 (b=2.85e-02) 750 (b=4.25e-02) 47 (b=3.28e-05) 94 (b=2.93e-03) 188(31, 5 ) 189 (b=3.97e-02) 379 (b=1.78e-02) 758 (b=4.76e-01) 95 (b=8.16e-02) 190 (b=5.62e-04) 380 (b=2.85e-03) 760 (b=5.90e-02) 381 (b=1.06e-03) 762 (b=1.14e-01) 763 (b=1.28e-03) 191(2, 5 ) 3 (b=7.16e-03) 6 (b=1.02e-03) 12 (b=1.56e-03) 24(19, 1 ) 25 (b=6.48e-02) 50(1, 8 ) 51(15, 2 ) 13 (b=6.27e-02) 26 (b=3.48e-03) 52 (b=5.08e-04) 104 (b=1.77e-01) 208 (b=5.59e-02) 417 (b=1.74e-01) 834 (b=5.88e-03) 209(10, 6 ) 105(6, 5 ) 53(22, 8 ) 27(9, 3 ) 7 (b=1.28e-03) 14 (b=2.57e-01) 28 (b=6.45e-01) 56 (b=7.20e-02) 112 (b=9.64e-01) 224 (b=3.02e-01) 448 (b=9.79e-01) 896 (b=1.35e-02) 449 (b=2.14e-02) 225(2, 1 ) 113(1, 8 ) 57(2, 1 ) 29 (b=6.28e-03) 58 (b=1.18e-01) 116 (b=3.33e-02) 232(2, 5 ) 233(2, 8 ) 117(2, 3 ) 59(2, 2 ) 15 (b=3.46e-04) 30 (b=1.35e-01) 60 (b=4.11e-02) 120(2, 1 ) 121(2, 3 ) 61(3, 5 ) 31 (b=5.14e-02) 62(1, 6 ) 63(31, 8 ) initial tree: CART, oblique train err= 4.27% %nonzero= 0.95% test err= 5.69% #splits= 37 1 (b=-7.13e-02) 1 0 -1 2 (b=-1.20e-01) 4 (b=7.23e-01) 8 (b=3.52e-02) 16 (b=4.95e-01) 32 (b=7.24e-01) 64(2820, 7 ) 65(526, 3 ) 33(316, 1 ) 17(289, 2 ) 9(5, 2 ) 5 (b=-6.22e-01) 10 (b=5.96e-01) 20 (b=-4.20e-01) 40(1435, 4 ) 41(180, 7 ) 21(986, 6 ) 11 (b=-2.14e-01) 22 (b=1.52e+00) 44(1427, 5 )45 (b=3.58e+00) 90(158, 5 ) 91(1552, 8 ) 23 (b=-1.84e-01) 46(2596, 4 ) 47 (b=-1.13e-01) 94(1846, 7 )95 (b=-1.42e+00) 190(277, 8 ) 191 (b=-3.44e-02) 3 (b=1.57e-01) 6 (b=-4.20e-01) 12 (b=2.70e-01) 24 (b=-3.48e-01) 48(57, 6 ) 49 (b=-1.09e+00) 98(3408, 10 ) 99(172, 2 ) 25(230, 3 ) 13 (b=2.07e-01) 26 (b=-2.11e-01) 52 (b=-4.81e-01) 104 (b=3.50e-01) 208(1099, 3 ) 209(785, 5 ) 105 (b=-2.46e-01) 210(1694, 1 ) 211(629, 3 ) 53 (b=4.89e-01) 106(1865, 5 ) 107(2220, 3 ) 27 (b=7.47e-02) 54(518, 5 ) 55 (b=7.34e-02) 110 (b=-1.55e-01) 220(1428, 1 ) 221(694, 2 ) 111 (b=-5.03e-01) 222(794, 6 ) 223 (b=9.52e-01) 7 (b=4.34e-01) 14 (b=-2.61e-02) 28(3621, 2 )29 (b=-2.95e-01) 58(980, 10 ) 59(1022, 6 ) 15 (b=-3.04e+00) 30(340, 10 ) 31 (b=7.62e-01) 62(2038, 6 ) 63(112, 10 ) C=0.090 train err=10.61% %nonzero= 0.22% test err=10.19% #splits= 16 1 (b=-4.01e-02) 1 0 -1 2 (b=-4.95e-02) 4(4658, 7 ) 5 (b=-1.38e-01) 10(4886, 4 ) 11(4884, 9 ) 3 (b=-7.90e-02) 6 (b=-4.66e-01) 12(2112, 10 ) 13 (b=9.90e-01) 26 (b=-4.98e-02) 52 (b=4.82e-01) 104 (b=-3.06e-02) 208(1923, 3 ) 209(1456, 5 ) 105(2214, 1 ) 53 (b=1.37e-01) 106(2911, 5 )107(2859, 3 ) 27 (b=-1.38e-01) 54 (b=8.53e-02) 108(2830, 1 ) 109(588, 2 ) 55(4624, 8 ) 7 (b=-1.21e-01) 14 (b=-1.10e-01) 28(4171, 2 ) 29 (b=-2.30e-01) 58(1586, 10 ) 59(2117, 6 ) 15 (b=-2.41e-01) 30(1315, 10 ) 31(2866, 6 ) C=0.010 10 -2 10 -1 10 0 10 1 2 4 6 8 10 training error test error 10 -2 10 -1 10 0 10 1 1 2 3 4 5 6 7 8 9 10 50 100 150 200 250 300 350 400 %nonzero # splits 10 -2 10 -1 10 0 10 1 2 4 6 8 10 12 500 1000 1500 2000 2500 3000 3500 4000 4500 path length inference time mean minimum maximum C 10 3 10 4 10 5 0 5 10 15 1 2 3 4 5 6 7 depth 4 depth 6 depth 8 depth 10 depth 12 TAO axis-aligned TAO oblique CART axis-aligned CART oblique test error number of parameters Figure 1: Sparse oblique trees for MNIST. Left plots: initial CART tree and sparse oblique trees for C = 0.09 and 0.01. For each internal node, we show its index and bias value and plot its weight vector (red = positive, blue = negative, white = zero); you may need to zoom into the image. For each leaf, we plot the mean of its training points and show something like “4(4658,7)” where 4 is its index, 4658 is the number of training points it receives, and 7 is its digit class. Right plots: several measures of the tree as a function of C ≥0: training/test error; proportion of nonzero weights and number of internal nodes; and length of root-leaf path and inference time (in scalar multiplications) for an input sample. The bottom plot shows test error vs. number of parameters for sparse oblique trees of different depths (color-coded), initialized from a CART tree that is either axisaligned (dotted line) or oblique (solid line). The markers correspond to the initial CART trees (◦, +) or to models from [27], numbered as follows: 1) linear classifiers, 2) one-vs-all linear classifiers, 3) 2-layer neural net with 300 hidden units, 4) 2-layer neural net with 1 000 hidden units, 5) 3-nearestneighbor classifier, 6) one-vs-all classifiers where each classifier consists of 50 000 boosted decision stumps (each operating over a feature and threshold), 7) 3-layer neural net with 500+100 hidden units. Values outside the axes limits are projected on the boundary of the plots. 8 Table 1: Comparison with forest-based algorithms that approximate a nearest-neighbor classifier. Test error (%) Inference time on entire test set (seconds) C dataset (N × D, K) TAO BF R-kd CT TAO BF R-kd CT TAO MNIST (60 000×784, 10) 5.69 2.24 3.08 2.99 0.18 23.90 89.20 417.60 0.09 letter (10 500×16, 26) 7.94 5.40 5.50 5.60 0.05 1.16 1.67 0.91 9.11 pendigits (7 494×16, 10) 3.14 2.62 2.26 2.80 0.01 0.34 0.75 0.02 0.03 protein (17 766×357, 3) 31.70 44.20 53.60 52.00 0.05 35.47 11.50 51.40 0.14 seismic (78 823×50, 3) 27.81 40.60 30.80 38.90 0.09 16.20 65.70 172.5 3.28 best result), ran on a laptop with 2 core i5 CPUs and 12GB RAM (pretty similar to the system of [25]). TAO’s test error is somewhat bigger (first 3 datasets) or quite smaller (last 2 datasets) than other forest classifiers, but it always has faster inference time by at least one order of magnitude. We reiterate that TAO produces a single tree with sparse decision nodes. 6 Discussion The way TAO works is very simple: TAO repeatedly trains a simple classifier (binary at the decision nodes, K-class at the leaves) while monotonically decreasing the objective function. The only thing that changes over iterations is the subset of training instances on which each classifier is trained. In order to optimize the misclassification error, TAO fundamentally relies on alternating optimization. This is most effective when two circumstances apply. 1) Some separability into blocks exists in the problem, as e.g. in matrix factorization, or is created via auxiliary variables, as e.g. with consensus problems [6] or nested functions [12]. And 2) the step over each block is easy and ideally exact. All this applies here thanks to the separability condition and the reduced problem. Two important remarks. First, note TAO is very different from coordinate descent in CART [8, 28]. The latter optimizes the impurity of a single node; each step updates a single weight of its hyperplane. TAO optimizes the misclassification error of the entire tree; each step updates one entire set of nodes (i.e., all the weights of all the hyperplanes in those nodes). Second, what we really want to minimize is the misclassification error on the data, not the impurity in each node. The latter, while useful to construct a good tree structure and initial node parameters, is only indirectly related to the classification accuracy. The quality of the TAO result naturally depends on the initial tree it is run on. A good strategy appears to be to grow a large tree with CART that overfits the data (or a large tree with random parameters) and let TAO prune it, particularly if using a sparsity penalty with oblique trees. TAO also depends on the choice of surrogate loss in the node (decision or leaf) optimization. In our experience with the logistic or hinge loss the TAO trees considerably improve over the initial CART or random tree. 7 Conclusion We have presented Tree Alternating Optimization (TAO), a scalable algorithm that can find a local optimum of oblique trees given a fixed structure, in the sense of repeatedly decreasing the misclassification loss until no more progress can be done. A critical difference with the standard tree induction algorithm is that we do not optimize a proxy measure (the impurity) greedily one node at a time, but the misclassification error itself, jointly and iteratively over all nodes. We suggest to use TAO as postprocessing after the usual greedy tree induction in CART, or to run TAO directly on a random initial tree. TAO could make oblique trees widespread in practice and replace to some extent the considerably less flexible axis-aligned trees. Even more interesting are the sparse oblique trees we propose. These can strike a good compromise between flexible modeling of features (involving complex local correlations, as with image data) and using few features in each node, hence producing a relatively accurate tree that is very small, fast and interpretable. For MNIST, we believe this is the first time that a single decision tree achieves such high accuracy, comparable to that of much larger models. Our work opens up important extensions, among others: to other types of trees, such as regression trees; to other types of nodes beyond linear bisectors or constant-class leaves; to ensembles of trees; to using TAO with a search over tree structures; and to combining trees with other models. 9 Acknowledgements Work funded in part by NSF award IIS–1423515. References [1] P. Auer, R. C. Holte, and W. Maass. Theory and applications of agnostic PAC–learning with small decision trees. In A. Prieditis and S. J. Russell, editors, Proc. of the 12th Int. Conf. Machine Learning (ICML’95), pages 21–29, Tahoe City, CA, July 9–12 1995. [2] K. P. Bennett. Decision tree construction via linear programming. In Proc. 4th Midwest Artificial Intelligence and Cognitive Sience Society Conference, pages 97–101, 1992. [3] K. P. Bennett. Global tree optimization: A non-greedy decision tree algorithm. Computing Science and Statistics, 26:156–160, 1994. [4] D. Bertsimas and J. Dunn. Optimal classification trees. Machine Learning, 106(7):1039–1082, July 2017. [5] A. Beygelzimer, S. Kakade, and J. Langford. Cover trees for nearest neighbor. In W. W. Cohen and A. Moore, editors, Proc. of the 23rd Int. Conf. Machine Learning (ICML’06), pages 97–104, Pittsburgh, PA, June 25–29 2006. [6] S. Boyd, N. Parikh, E. Chu, B. Peleato, and J. Eckstein. Distributed optimization and statistical learning via the alternating direction method of multipliers. Foundations and Trends in Machine Learning, 3(1):1–122, 2011. [7] L. Breiman. Random forests. Machine Learning, 45(1):5–32, Oct. 2001. [8] L. J. Breiman, J. H. Friedman, R. A. Olshen, and C. J. Stone. Classification and Regression Trees. Wadsworth, Belmont, Calif., 1984. [9] M. ´A. Carreira-Perpi˜n´an. Model compression as constrained optimization, with application to neural nets. Part I: General framework. arXiv:1707.01209, July 5 2017. [10] M. ´A. Carreira-Perpi˜n´an and Y. Idelbayev. Model compression as constrained optimization, with application to neural nets. Part II: Quantization. arXiv:1707.04319, July 13 2017. [11] M. ´A. Carreira-Perpi˜n´an and Y. Idelbayev. “Learning-compression” algorithms for neural net pruning. In Proc. of the 2018 IEEE Computer Society Conf. Computer Vision and Pattern Recognition (CVPR’18), pages 8532–8541, Salt Lake City, UT, June 18–22 2018. [12] M. ´A. Carreira-Perpi˜n´an and W. Wang. Distributed optimization of deeply nested systems. In S. Kaski and J. Corander, editors, Proc. of the 17th Int. Conf. Artificial Intelligence and Statistics (AISTATS 2014), pages 10–19, Reykjavik, Iceland, Apr. 22–25 2014. [13] A. Criminisi and J. Shotton. Decision Forests for Computer Vision and Medical Image Analysis. Advances in Computer Vision and Pattern Recognition. Springer-Verlag, 2013. [14] Y. C. Eldar and G. Kutyniok, editors. Compressed Sensing: Theory and Applications. Cambridge University Press, 2012. [15] R.-E. Fan, K.-W. Chang, C.-J. Hsieh, X.-R. Wang, and C.-J. Lin. LIBLINEAR: A library for large linear classification. J. Machine Learning Research, 9:1871–1874, Aug. 2008. [16] J. H. Friedman, J. L. Bentley, and R. A. Finkel. An algorithm for finding best matches in logarithmic expected time. ACM Trans. Mathematical Software, 3(3):209–226, 1977. [17] V. Guruswami and P. Raghavendra. Hardness of learning halfspaces with noise. SIAM J. Comp., 39(2):742–765, 2009. [18] S. Han, J. Pool, J. Tran, and W. Dally. Learning both weights and connections for efficient neural network. In C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett, editors, Advances in Neural Information Processing Systems (NIPS), volume 28, pages 1135– 1143. MIT Press, Cambridge, MA, 2015. 10 [19] T. Hastie, R. Tibshirani, and M. Wainwright. Statistical Learning with Sparsity: The Lasso and Generalizations. Monographs on Statistics and Applied Probability. Chapman & Hall/CRC, 2015. [20] T. J. Hastie, R. J. Tibshirani, and J. H. Friedman. The Elements of Statistical Learning— Data Mining, Inference and Prediction. Springer Series in Statistics. Springer-Verlag, second edition, 2009. [21] K.-U. Hoffgen, H. U. Simon, and K. S. Vanhorn. Robust trainability of single neurons. J. Computer and System Sciences, 50(1):114–125, Feb. 1995. [22] L. Hyafil and R. L. Rivest. Constructing optimal binary decision trees is NP-complete. Information Processing Letters, 5(1):15–17, 1975. [23] M. I. Jordan and R. A. Jacobs. Hierarchical mixtures of experts and the EM algorithm. Neural Computation, 6(2):181–214, Mar. 1994. [24] A. Kumar, S. Goyal, and M. Varma. Resource-efficient machine learning in 2 KB RAM for the internet of things. In D. Precup and Y. W. Teh, editors, Proc. of the 34th Int. Conf. Machine Learning (ICML 2017), pages 1935–1944, Sydney, Australia, Aug. 6–11 2017. [25] C. Mathy, N. Derbinsky, J. Bento, J. Rosenthal, and J. Yedidia. The boundary forest algorithm for online supervised and unsupervised learning. In Proc. of the 29th National Conference on Artificial Intelligence (AAAI 2015), pages 2864–2870, Austin, TX, Jan. 25–29 2015. [26] N. Megiddo. On the complexity of polyhedral separability. Discrete & Computational Geometry, 3(4):325–337, Dec. 1988. [27] MNIST. The MNIST database of handwritten digits. http://yann.lecun.com/exdb/mnist. [28] S. K. Murthy, S. Kasif, and S. Salzberg. A system for induction of oblique decision trees. J. Artificial Intelligence Research, 2:1–32, 1994. [29] M. Norouzi, M. Collins, D. J. Fleet, and P. Kohli. CO2 forest: Improved random forest by continuous optimization of oblique splits. arXiv:1506.06155, June 24 2015. [30] M. Norouzi, M. Collins, M. A. Johnson, D. J. Fleet, and P. Kohli. Efficient non-greedy optimization of decision trees. In C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett, editors, Advances in Neural Information Processing Systems (NIPS), volume 28, pages 1720–1728. MIT Press, Cambridge, MA, 2015. [31] J. R. Quinlan. C4.5: Programs for Machine Learning. Morgan Kaufmann, 1993. [32] L. Rokach and O. Maimon. Data Mining With Decision Trees. Theory and Applications. Number 69 in Series in Machine Perception and Artificial Intelligence. World Scientific, 2007. [33] R. E. Schapire and Y. Freund. Boosting. Foundations and Algorithms. Adaptive Computation and Machine Learning Series. MIT Press, 2012. [34] C. Tjortjis and J. Keane. T3: A classification algorithm for data mining. In H. Yin, N. Allinson, R. Freeman, J. Keane, and S. Hubbard, editors, Proc. of the 6th Int. Conf. Intelligent Data Engineering and Automated Learning (IDEAL’02), pages 50–55, Manchester, UK, Aug. 12– 14 2002. [35] P. Tzirakis and C. Tjortjis. T3C: Improving a decision tree classification algorithm’s interval splits on continuous attributes. Advances in Data Analysis and Classification, 11(2):353–370, June 2017. [36] X. Wu, V. Kumar, J. R. Quinlan, J. Ghosh, Q. Yang, H. Motoda, G. J. McLachlan, A. Ng, B. Liu, P. S. Yu, Z.-H. Zhou, M. Steinbach, D. J. Hand, and D. Steinberg. Top 10 algorithms in data mining. Knowledge and Information Systems, 14(1):1–37, Jan. 2008. 11
2018
114
7,269
Gradient Descent for Spiking Neural Networks Dongsung Huh Salk Institute La Jolla, CA 92037 huh@salk.edu Terrence J. Sejnowski Salk Institute La Jolla, CA 92037 terry@salk.edu Abstract Most large-scale network models use neurons with static nonlinearities that produce analog output, despite the fact that information processing in the brain is predominantly carried out by dynamic neurons that produce discrete pulses called spikes. Research in spike-based computation has been impeded by the lack of efficient supervised learning algorithm for spiking neural networks. Here, we present a gradient descent method for optimizing spiking network models by introducing a differentiable formulation of spiking dynamics and deriving the exact gradient calculation. For demonstration, we trained recurrent spiking networks on two dynamic tasks: one that requires optimizing fast (≈millisecond) spike-based interactions for efficient encoding of information, and a delayed-memory task over extended duration (≈second). The results show that the gradient descent approach indeed optimizes networks dynamics on the time scale of individual spikes as well as on behavioral time scales. In conclusion, our method yields a general purpose supervised learning algorithm for spiking neural networks, which can facilitate further investigations on spike-based computations. 1 Introduction The brain operates in a highly decentralized event-driven manner, processing multiple asynchronous streams of sensory-motor data in real-time. The main currency of neural computation is spikes: i.e. brief impulse signals transmitted between neurons. Experimental evidence shows that brain’s architecture utilizes not only the rate, but the precise timing of spikes to process information [1]. Deep-learning models solve simplified problems by assuming static units that produce analog output, which describes the time-averaged firing-rate response of a neuron. These rate-based artificial neural networks (ANNs) are easily differentiated, and therefore can be efficiently trained using gradient descent learning rules. The recent success of deep learning demonstrates the computational potential of trainable, hierarchical distributed architectures. This brings up the natural question: What types of computation would be possible if we could train spiking neural networks (SNNs)? The set of implementable functions by SNNs subsumes that of ANNs, since a spiking neuron reduces to a rate-based unit in the high firing-rate limit. Moreover, in the low firing-rate range in which the brain operates (1∼10 Hz), spike-times can be utilized as an additional dimension for computation. However, such computational potential has never been explored due to the lack of general learning algorithms for SNNs. 1.1 Prior work Dynamical systems are most generally described by ordinary differential equations, but linear timeinvariant systems can also be characterized by impulse response kernels. Most SNN models are constructed using the latter approach, by defining a neuron’s membrane voltage vi(t) as a weighted 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. linear summation of kernels Kij(t −tk) that describe how the spike-event of neuron j at previous time tk affects neuron i at time t. When the neuron’s voltage approaches a sufficient level, it generates a spike in deterministic [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] or stochastic manner [13, 14, 15, 16, 17]. These kernel-based neuron models are known as spike response models (SRMs). The appeal of SRMs is that they can simulate SNN dynamics without explicit integration steps. However, this representation takes individual spike-times as the state variables of SNNs, which causes problems for learning algorithms when spikes are needed to be created or deleted during the learning process. For example, Spikeprop [2] and its variants [3, 4, 5, 6, 18] calculate the derivatives of spike-times to derive accurate gradient-based update rules, but they are only applicable to problems where each neuron is constrained to generating a predefined number of spikes. Currently, learning algorithms compatible with variable spike counts have multiple shortcomings: Most gradient-based methods can only train "visible neurons" that directly receive desired target output patterns [7, 8, 9, 11, 13, 17]. While extensions have been proposed to enable training of hidden neurons in multilayer [10, 14, 16, 19] and recurrent networks [15], they require neglecting the derivative of the self-kernel terms, i.e. Kii(t), which is crucial for the gradient information to propagate through spike events. Moreover, the learning rules derived for specific neuron dynamics models cannot be easily generalized to other neuron models. Also, most methods require the training data to be prepared in spike-time representations. For instance, they use loss functions that penalize the difference between the desired and the actual output spike-time patterns. In practice, however, such spike-time data are rarely available. Alternative approaches take inspiration from biological spike-time dependent plasticity (STDP) [20, 21], and reward-modulated STDP process [22, 23, 24]. However, it is generally hard to guarantee convergence of these bottom-up approaches, which do not consider the complex effects network dynamics nor the task information in designing of the learning rule. Lastly, there are rate-based learning approaches, which convert trained ANN models into spiking models [25, 26, 27, 28, 29, 30], or apply rate-based learning rules to training SNNs [31]. However, these approaches can at best replicate the solutions from rate-based ANN models, rather than exploring computational solutions that can utilize spike-times. 1.2 New learning framework for spiking neural networks Here, we derive a novel learning approach for training SNNs represented by ordinary differential equations. The state vector is composed of dynamic variables, such as membrane voltage and synaptic current, rather than spike-time history. This approach is compatible with the usual setup in optimal control, which allows gradient calculation by using the existing tools in optimal control. Moreover, resulting process closely resembles the familiar backpropagation rule, which can fully utilize the existing statistical optimization methods in deep learning framework. Note that, unlike the prior literature, our work here provides not just a single learning rule for a particular model and task, but a general framework for calculating gradient for arbitrary network architecture, neuron models, and loss functions. Moreover, the goal of this research is not necessarily to replicate a biological learning phenomenon, but to derive efficient learning methods that can explore the computational solutions implementable by the networks of spiking neurons in biology. The trained SNN model could then be analyzed to reveal the computational processes of the brain, or provide algorithmic solutions that can be implemented with neuromorphic hardwares. 2 Methods 2.1 Differentiable synapse model In spiking networks, transmission of neural activity is mediated by synaptic current. Most models describe the synaptic current dynamics as a linear filter process which instantly activates when the presynaptic membrane voltage v crosses a threshold: e.g., τ ˙s = −s + X k δ(t −tk). (1) 2 t (ms) t (ms) t (ms) t (ms) t (ms) A B C D E 0 20 40 0 20 40 0 20 40 0 20 40 0 20 40 Membrane voltage 0 20 40 0 0.1 0 20 40 0 20 40 0 20 40 0 20 40 (ms-1) Synaptic current Figure 1: Differentiability of synaptic current dynamics: The synaptic current traces from eq (2) (solid lines, upper panels) are shown with the corresponding membrane voltage traces (lower panels). Here, the gate function is g = 1/∆within the active zone of width ∆(shaded area, lower panels); g = 0 otherwise. (A,B) The pre-synaptic membrane voltage depolarizes beyond the active zone. Despite the different rates of depolarization, both events incur the same amount of charge in the synaptic activity: R s dt = 1. (C,D,E) Graded synaptic activity due to insufficient depolarization levels that do not exceed the active zone. The threshold-triggered synaptic dynamics in eq (1) is also shown for comparison (red dashed lines, upper panels). The effect of voltage reset is ignored for the purpose of illustration. τ = 10 ms. where δ(·) is the Dirac-delta function, and tk denotes the time of kth threshold-crossing. Such threshold-triggered dynamics generates discrete, all-or-none responses of synaptic current, which is non-differentiable. Here, we replace the threshold with a gate function g(v): a non-negative (g ≥0), unit integral ( R g dv = 1) function with narrow support1, which we call the active zone. This allows the synaptic current to be activated in a gradual manner throughout the active zone. The corresponding synaptic current dynamics is τ ˙s = −s + g ˙v, (2) where ˙v is the time derivative of the pre-synaptic membrane voltage. The ˙v term is required for the dimensional consistency between eq (1) and (2): The g ˙v term has the same [time]−1 dimension as the Dirac-delta impulses of eq (1), since the gate function has the dimension [voltage]−1 and ˙v has the dimension [voltage][time]−1. Hence, the time integral of synaptic current, i.e. charge, is a dimensionless quantity. Consequently, a depolarization event beyond the active zone induces a constant amount of total charge regardless of the time scale of depolarization, since Z s dt = Z g ˙v dt = Z g dv = 1. Therefore, eq (2) generalizes the threshold-triggered synapse model while preserving the fundamental property of spiking neurons: i.e. all supra-threshold depolarizations induce the same amount of synaptic responses regardless of the depolarization rate (Figure 1A,B). Depolarizations below the active zone induce no synaptic responses (Figure 1E), and depolarizations within the active zone induce graded responses (Figure 1C,D). This contrasts with the threshold-triggered synaptic dynamics, which causes abrupt, non-differentiable change of response at the threshold (Figure 1, dashed lines). Note that the g ˙v term reduces to the Dirac-delta impulses in the zero-width limit of the active zone, which reduces eq (2) back to the threshold-triggered synapse model eq (1). The gate function, without the ˙v term, was previously used as a differentiable model of synaptic connection [32]. In such a model, however, a spike event delivers varying amount of charge depending on the depolarization rate: the slower the presynaptic depolarization, the greater the amount of charge delivered to the post-synaptic targets. 1Support of a function g : X →R is the subset of the domain X where g(x) is non-zero. 3 Input Output ~ W U O ~i(t) ~o(t) v(t) (t) s~ ~ Figure 2: The model receives time varying input, ⃗i(t), processes it through a network of spiking neurons, and produces time varying output, ⃗o(t). The internal state variables are the membrane voltage ⃗v(t) and the synaptic current ⃗s(t). 2.2 Network model To complete the input-output dynamics of a spiking neuron, the synaptic current dynamics must be coupled with the presynaptic neuron’s internal state dynamics. For simplicity, we consider differentiable neural dynamics that depend only on the the membrane voltage and the input current: ˙v = f(v, I). (3) The dynamics of an interconnected network of neurons can then be constructed by linking the dynamics of individual neurons and synapses eq (2,3) through the input current vector: ⃗I = W⃗s + U⃗i + ⃗Io, (4) where W is the recurrent connectivity weight matrix, U is the input weight matrix,⃗i(t) is the input signal for the network, and ⃗Io is the tonic current. Note that this formulation describes general, fully connected networks; specific network structures can be imposed by constraining the connectivity: e.g. triangular matrix structure W for multi-layer feedforward networks. Lastly, we define the output of the network as the linear readout of the synaptic current: ⃗o(t) = O⃗s(t), where O is the readout matrix. The overall schematic of the model is shown in Figure 2. All of the network parameters W, U, O, ⃗Io can be tuned to minimize the total cost, C ≡ R l(t) dt, where l is the cost function that evaluates the performance of network output for given task. 2.3 Gradient calculation The above spiking neural network model can be optimized via gradient descent. In general, the exact gradient of a dynamical system can be calculated using either Pontryagin’s minimum principle [33], also known as backpropagation through time, or real-time recurrent learning, which yield identical results. We present the former approach here, which scales better with network size, O(N 2) instead of O(N 3), but the latter approach can also be straightforwardly implemented. Backpropagation through time for the spiking dynamics eq (2,3) utilizes the following backpropagating dynamics of adjoint state variables (pv, ps. See Supplementary Materials): −˙pv = ∂vf pv −g ˙ps (5) −τ ˙ps = −ps + ξ, (6) where pv, ps are the modified adjoints of v and s, ∂vf ≡∂f/∂v, and ξ is called the error current. For the recurrently connected network eq (4), the error current vector has the following expression ⃗ξ = W ⊺ ⃗ (∂If pv) + ⃗∂sl, (7) which links the backpropagating dynamics eq (5,6) of individual neurons. Here, ∂If ≡∂f/∂I, (∂If pv)k ≡(∂f/∂I)kpvk, and (∂sl)k ≡∂l/∂sk. Interestingly, the coupling term of the backpropagating dynamics, g ˙ps, has the same form as the coupling term g ˙v of the forward-propagating dynamics. Thus, the same gating mechanism that 4 mediates the spiked-based communication of signals also controls the propagation of error in the same sparse, compressed manner. Given the adjoint state vectors that satisfy eq (5,6,7), the gradient of the total cost with respect to the network parameters can be calculated as ∇W C = Z ⃗ (∂If pv) ⃗s⊺dt ∇UC = Z ⃗ (∂If pv)⃗i⊺dt ∇IoC = Z ⃗ (∂If pv) dt ∇OC = Z ⃗∂ol ⃗s⊺dt where (∂ol)k ≡∂l/∂ok. Note that the gradient calculation procedure involves multiplication between the presynaptic input source and the postsynaptic adjoint state pv, which is driven by the g ˙ps term: i.e. the product of postsynaptic spike activity and temporal difference of error. This is analogous to reward-modulated spike-time dependent plasticity (STDP) [24]. 3 Results We demonstrate our method by training spiking networks on dynamic tasks that require information processing over time. Tasks are defined by the relationship between time-varying input-output signals, which are used as training examples. We draw mini-batches of ≈50 training examples from the signal distribution, calculate the gradient of the average total cost, and use stochastic gradient descent [34] for optimization. Here, we use a cost function l that penalizes the readout error and the overall synaptic activity: l = ∥⃗o −⃗od∥2 + λ∥⃗s∥2 2 , where ⃗od(t) is the desired output, and λ is a regularization parameter. 3.1 Predictive Coding Task We first consider predictive coding tasks [35, 36], which optimize spike-based representations to accurately reproduce the input-ouput behavior of a linear dynamical system of full-rank input and output matrices. Analytical solutions for this class of problems can be obtained in the form of non-leaky integrate and fire (NIF) neural networks, although insignificant amount of leak current is often added [36]. The solutions also require the networks to be equipped with a set of instantaneous synapses for fast time-scale interactions between neurons, as well slower synapses for readout. Despite its simplicity, the predictive coding framework reproduces important features of biological neural networks, such as the balance of excitatory and inhibitory inputs and efficient coding [35]. Also, its analytical solutions provide a great benchmark for assessing the effectiveness of our learning method. The membrane voltage dynamics of a NIF neuron is given by f(v, I) = I. Here, we impose two thresholds at vθ+ = 1 and vθ−= −1, and the reset voltage at vreset = 0, where the vθ−threshold would trigger negative synaptic responses. This bi-threshold NIF model naturally fits with the inherent sign symmetry of the task, and also provides an easy solution to ensure that the membrane voltage stays within a finite range. However, the training also works with the usual single threshold model. We also introduce two different synaptic time constants, as proposed in [35, 36]: a fast constant τ = 1 ms for synapses for the recurrent connections, and a slow constant τs = 10 ms for readout. In the predictive-coding task, the desired output signal is the low-pass filtered version of the input signal: τs ˙⃗od = −⃗od +⃗i, 5 -2 0 2 -2 0 2 0 40 80 120 time (ms) -1 0 1 -0.5 0 0.5 Readout Input current (components) Input current (total) Membrane voltage A B C D (ms-1) (ms-1) -0.8 -0.4 0 0.4 0.8 E F 10 20 30 10 20 30 -0.4 0 0.4 -2 -1 0 1 2 (ms) (ms-1) 10 20 30 -0.8 -0.4 0 0.4 0.8 Figure 3: Balanced dynamics of a spiking network trained for auto-encoding task. (A) Readout signals: actual (solid), and desired (dashed). (B) Input current components into a single neuron: external input current (U⃗i(t), blue), and fast reccurent synaptic current (Wf⃗sf(t), red). (C) Total input current into a single neuron (U⃗i(t) + Wf⃗sf(t)). (D) Single neuron membrane voltage traces: the actual voltage trace driven by both external input and fast reccurent synaptic current (solid, 6 spikes), and a virtual trace driven by external input only (dashed, 29 spikes). (E) Fast recurrent weight: trained (Wf, above) and predicted (−UO, below). Diagonal elements are set to zero to avoid self-excitation/inhibition. (F) Readout weight O vs input weight U. where τs is the slow synaptic time constant [35, 36]. The goal is to accurately represent the analog signals using least number of spikes. We used a network of 30 NIF neurons, 2 input and 2 output channels. Randomly generated sum-of-sinusoid signals with period 1200 ms were used as the input. The output of the trained network accurately tracks the desired output (Figure 3A). Analysis of the simulation reveals that the network operates in a tightly balanced regime: The fast recurrent synaptic input, W⃗s(t), provides opposing current that mostly cancels the input current from the external signal, U⃗i(t), such that the neuron generates a greatly reduced number of spike outputs (Figure 3B,C,D). The network structure also shows close agreement to the prediction. The optimal input weight matrix is equal to the transpose of the readout matrix (up to a scale factor), U ∝O⊺, and the optimal fast recurrent weight is approximately the product of the input and readout weights, W ≈−UO , which are in close agreement with [35, 36, 37]. Such network structures have been shown to maintain tight input balance and remove redundant spikes to encode the signals in most efficient manner: The representation error scales as 1/K, where K is the number of involved spikes, compared to the 1/ √ K error of encoding with independent Poisson spikes. 6 time (ms) 0 100 200 300 400 500 600 time (ms) time (ms) time (ms) time (ms) time (ms) Spikes Spikes Go-cue Output Input 0 100 200 300 400 500 600 0 100 200 300 400 500 600 0 100 200 300 400 500 600 0 100 200 300 400 500 600 0 100 200 300 400 500 600 Input Go-cue Output A B C D E F Figure 4: Delayed-memory XOR task: Each panel shows the single-trial input, go-cue, output traces, and spike raster of an optimized QIF neural network. The y-axis of the raster plot is the neuron ID. Note the similarity of the initial portion of spike patterns for trials of the same first input pulses (A,B,C vs D,E,F). In contrast, the spike patterns after the go-cue signal are similar for trials of the same desired output pulses: (A,D: negative output), (B,E: positive output), and (C,F: null output). 3.2 Delayed-memory XOR task A major challenge for spike-based computation is in bridging the wide divergence between the timescales of spikes and behavior: How do millisecond spikes perform behaviorally relevant computations on the order of seconds? Here, we consider a delayed-memory XOR task, which performs the exclusive-or (XOR) operation on the input history stored over extended duration. Specifically, the network receives binary pulse signals, + or −, through an input channel and a go-cue through another channel. If the network receives two input pulses since the last go-cue signal, it should generate the XOR output pulse on the next go-cue: i.e. a positive output pulse if the input pulses are of opposite signs (+−or −+), and a negative output pulse if the input pulses are of equal signs (++ or −−). Additionally, it should generate a null output if only one input pulse is received since the last go-cue signal. Variable time delays are introduced between the input pulses and the go-cues. A simpler version of the task was proposed in [26], whose solution involved first training an analog, rate-based ANN model and converting the trained ANN dynamics with a larger network of spiking neurons (≈3000), using the results from predictive coding [35]. It also required a dendritic nonlinearity function to match the transfer function of rate neurons. We trained a network of 80 quadratic integrate and fire (QIF) neurons2, whose dynamics is f(v, I) = (1 + cos(2πv))/τv + (1 −cos(2πv))I, 2NIF networks fail to learn the delayed-memory XOR task: the memory requirement for past input history drives the training toward strong recurrent connections and runaway excitation. 7 also known as Theta neuron model [38], with the threshold and the reset voltage at vθ = 1, vreset = 0. Time constants of τv = 25, τf = 5, and τ = 20 ms were used, whereas the time-scale of the task was ≈500 ms, much longer than the time constants. The intrinsic nonlinearity of the QIF spiking dynamics proves to be sufficient for solving this task without requiring extra dendritic nonlinearity. The trained network successfully solves the delayed-memory XOR task (Figure 4): The spike patterns exhibit time-varying, but sustained activities that maintain the input history, generate the correct outputs when triggered by the go-cue signal, and then return to the background activity. More analysis is needed to understand the exact underlying computational mechanism. This result shows that out algorithm can indeed optimize spiking networks to perform nonlinear computations over extended time. 4 Discussion We have presented a novel, differentiable formulation of spiking neural networks and derived the gradient calculation for supervised learning. Unlike previous learning methods, our method optimizes the spiking network dynamics for general supervised tasks on the time scale of individual spikes as well as the behavioral time scales. Exact gradient-based learning methods, such as ours, may depart from the known biological learning mechanisms. Nonetheless, these methods provide a solid theoretical foundation for understanding the principles underlying biological learning rules. For example, our result shows that the gradient update occurs in a sparsely compressed manner near spike times, similar to reward-modulated STDP, which depends only on a narrow 20 ms window around the postsynaptic spike. Further analysis may reveal that certain aspects of the gradient calculation can be approximated in a biologically plausible manner without significantly compromising the efficiency of optimization. For example, it was recently shown that the biologically implausible aspects of backpropagation method can be resolved through feedback alignment in rate-based multilayer feedforward networks [39]. Such approximations could also apply to spiking neural networks. Here, we coupled the synaptic current model with differentiable single-state spiking neuron models. We want to emphasize that the synapse model can be coupled to any neuron model, including biologically realistic multi-state neuron models with action potential dynamics 3, including the Hodgkin-Huxley model, the Morris-Lecar model and the FitzHugh-Nagumo model; and an even wider range of neuron models with internal adaptation variables and neuron models having nondifferentiable reset dynamics, such as the leaky integrate and fire model, the exponential integrate and fire model, and the Izhikevich model. This will be examined in the future work. References [1] Rufin VanRullen, Rudy Guyonneau, and Simon J Thorpe. Spike times make sense. Trends in neurosciences, 28(1):1–4, 2005. [2] Sander M Bohte, Joost N Kok, and Han La Poutre. Error-backpropagation in temporally encoded networks of spiking neurons. Neurocomputing, 48(1):17–37, 2002. [3] Jianguo Xin and Mark J Embrechts. Supervised learning with spiking neural networks. In Neural Networks, 2001. Proceedings. IJCNN’01. International Joint Conference on, volume 3, pages 1772–1777. IEEE, 2001. [4] Benjamin Schrauwen and Jan Van Campenhout. Extending spikeprop. In Neural Networks, 2004. Proceedings. 2004 IEEE International Joint Conference on, volume 1, pages 471–475. IEEE, 2004. [5] Olaf Booij and Hieu tat Nguyen. A gradient descent rule for spiking neurons emitting multiple spikes. Information Processing Letters, 95(6):552–558, 2005. [6] Peter Tiˇno and Ashely JS Mills. Learning beyond finite memory in recurrent networks of spiking neurons. Neural computation, 18(3):591–613, 2006. [7] Robert Gütig and Haim Sompolinsky. The tempotron: a neuron that learns spike timing–based decisions. Nature neuroscience, 9(3):420–428, 2006. 3Simple modification of the gate function would be required to prevent activation during the falling phase of action potential. 8 [8] Robert Urbanczik and Walter Senn. A gradient learning rule for the tempotron. Neural computation, 21(2):340–352, 2009. [9] Raoul-Martin Memmesheimer, Ran Rubin, Bence P Ölveczky, and Haim Sompolinsky. Learning precisely timed spikes. Neuron, 82(4):925–938, 2014. [10] Jun Haeng Lee, Tobi Delbruck, and Michael Pfeiffer. Training deep spiking neural networks using backpropagation. Frontiers in neuroscience, 10, 2016. [11] Robert Gütig. Spiking neurons can discover predictive features by aggregate-label learning. Science, 351(6277):aab4113, 2016. [12] R˘azvan V Florian. The chronotron: a neuron that learns to fire temporally precise spike patterns. PloS one, 7(8):e40233, 2012. [13] Jean-Pascal Pfister, Taro Toyoizumi, David Barber, and Wulfram Gerstner. Optimal spike-timing-dependent plasticity for precise action potential firing in supervised learning. Neural computation, 18(6):1318–1348, 2006. [14] Danilo J Rezende, Daan Wierstra, and Wulfram Gerstner. Variational learning for recurrent spiking networks. In Advances in Neural Information Processing Systems, pages 136–144, 2011. [15] Johanni Brea, Walter Senn, and Jean-Pascal Pfister. Matching recall and storage in sequence learning with spiking neural networks. Journal of neuroscience, 33(23):9565–9575, 2013. [16] Brian Gardner, Ioana Sporea, and André Grüning. Learning spatiotemporally encoded pattern transformations in structured spiking neural networks. Neural computation, 27(12):2548–2586, 2015. [17] Brian Gardner and André Grüning. Supervised learning in spiking neural networks for precise temporal encoding. PloS one, 11(8):e0161335, 2016. [18] Sam McKennoch, Thomas Voegtlin, and Linda Bushnell. Spike-timing error backpropagation in theta neuron networks. Neural computation, 21(1):9–45, 2009. [19] Friedemann Zenke and Surya Ganguli. Superspike: Supervised learning in multi-layer spiking neural networks. arXiv preprint arXiv:1705.11146, 2017. [20] Filip Ponulak and Andrzej Kasi´nski. Supervised learning in spiking neural networks with resume: sequence learning, classification, and spike shifting. Neural Computation, 22(2):467–510, 2010. [21] Ioana Sporea and André Grüning. Supervised learning in multilayer spiking neural networks. Neural computation, 25(2):473–509, 2013. [22] Eugene M Izhikevich. Solving the distal reward problem through linkage of stdp and dopamine signaling. Cerebral cortex, 17(10):2443–2452, 2007. [23] Robert Legenstein, Dejan Pecevski, and Wolfgang Maass. A learning theory for reward-modulated spike-timing-dependent plasticity with application to biofeedback. PLoS Comput Biol, 4(10):e1000180, 2008. [24] Nicolas Frémaux and Wulfram Gerstner. Neuromodulated spike-timing-dependent plasticity, and theory of three-factor learning rules. Frontiers in neural circuits, 9, 2015. [25] Eric Hunsberger and Chris Eliasmith. Spiking deep networks with lif neurons. arXiv preprint arXiv:1510.08829, 2015. [26] LF Abbott, Brian DePasquale, and Raoul-Martin Memmesheimer. Building functional networks of spiking model neurons. Nature neuroscience, 19(3):350–355, 2016. [27] Peter O’Connor, Daniel Neil, Shih-Chii Liu, Tobi Delbruck, and Michael Pfeiffer. Real-time classification and sensor fusion with a spiking deep belief network. Frontiers in neuroscience, 7:178, 2013. [28] Peter U Diehl, Daniel Neil, Jonathan Binas, Matthew Cook, Shih-Chii Liu, and Michael Pfeiffer. Fastclassifying, high-accuracy spiking deep networks through weight and threshold balancing. In Neural Networks (IJCNN), 2015 International Joint Conference on, pages 1–8. IEEE, 2015. [29] Bodo Rueckauer, Iulia-Alexandra Lungu, Yuhuang Hu, and Michael Pfeiffer. Theory and tools for the conversion of analog to spiking convolutional neural networks. arXiv preprint arXiv:1612.04052, 2016. 9 [30] Abhronil Sengupta, Yuting Ye, Robert Wang, Chiao Liu, and Kaushik Roy. Going deeper in spiking neural networks: Vgg and residual architectures. arXiv preprint arXiv:1802.02627, 2018. [31] Peter O’Connor and Max Welling. Deep spiking networks. arXiv preprint arXiv:1602.08323, 2016. [32] Guillaume Lajoie, Kevin K Lin, and Eric Shea-Brown. Chaos and reliability in balanced spiking networks with temporal drive. Physical Review E, 87(5):052901, 2013. [33] Lev Semenovich Pontryagin, EF Mishchenko, VG Boltyanskii, and RV Gamkrelidze. The mathematical theory of optimal processes. 1962. [34] Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. [35] Sophie Denève and Christian K Machens. Efficient codes and balanced networks. Nature neuroscience, 19(3):375–382, 2016. [36] Martin Boerlin, Christian K Machens, and Sophie Denève. Predictive coding of dynamical variables in balanced spiking networks. PLoS Comput Biol, 9(11):e1003258, 2013. [37] Wieland Brendel, Ralph Bourdoukan, Pietro Vertechi, Christian K Machens, and Sophie Denéve. Learning to represent signals spike by spike. arXiv preprint arXiv:1703.03777, 2017. [38] Bard Ermentrout. Ermentrout-kopell canonical model. Scholarpedia, 3(3):1398, 2008. [39] Timothy P Lillicrap, Daniel Cownden, Douglas B Tweed, and Colin J Akerman. Random synaptic feedback weights support error backpropagation for deep learning. Nature Communications, 7, 2016. 10 Supplementary Materials: Gradient calculation for the spiking neural network Pontryagin’s minimum principle According to [33], the Hamiltonian for the dynamics eq (2,3,4) is H = X i ¯pvi ˙vi + ¯psi ˙si + l(⃗s) = X i (¯pvi + gi¯psi/τ)fi −¯psisi/τ + l(⃗s), where ¯pvi and ¯psi are the adjoint state variables for the membrane voltage vi and the synaptic current si of neuron i, respectively, and l(⃗s) is the cost function. The back-propagating dynamics of the adjoint state variables are: −˙¯pvi = ∂H ∂vi = (¯pvi + gi¯psi/τ)∂vfi + fig′ i¯psi/τ −˙¯psi = ∂H ∂si = X j (¯pvj + gj ¯psj/τ) · ∂Ifj Wji −¯psi/τ + lsi where fi ≡f(vi, Ii), gi ≡g(vi), ∂vfi ≡∂f/∂vi, ∂Ifi ≡∂f/∂Ii, g′ i ≡dg/dvi, and lsi ≡∂l/∂si. This formulation can be simplified via change of variables, pvi ≡¯pvi + g¯psi/τ, psi ≡¯psi/τ, which yields H = ⃗pv · ⃗f −⃗ps · ⃗s + l −˙pvi = ∂vfi pvi −gi ˙psi −τ ˙psi = −psi + lsi + X j Wji∂Ifj pvj, where we used ˙pvi = ˙¯pvi + fi g′ i¯psi/τ + gi ˙¯psi/τ. The gradient of the total cost can be obtained by integrating the partial derivative of the Hamiltonian with respect to the parameter (e.g. ∂H/∂Wij, ∂H/∂Uij, ∂H/∂Ioi, ∂H/∂Oij). 11
2018
115
7,270
Statistical and Computational Trade-Offs in Kernel K-Means Daniele Calandriello LCSL – IIT & MIT, Genoa, Italy Lorenzo Rosasco University of Genoa, LCSL – IIT & MIT Abstract We investigate the efficiency of k-means in terms of both statistical and computational requirements. More precisely, we study a Nyström approach to kernel k-means. We analyze the statistical properties of the proposed method and show that it achieves the same accuracy of exact kernel k-means with only a fraction of computations. Indeed, we prove under basic assumptions that sampling √n Nyström landmarks allows to greatly reduce computational costs without incurring in any loss of accuracy. To the best of our knowledge this is the first result of this kind for unsupervised learning. 1 Introduction Modern applications require machine learning algorithms to be accurate as well as computationally efficient, since data-sets are increasing in size and dimensions. Understanding the interplay and trade-offs between statistical and computational requirements is then crucial [31, 30]. In this paper, we consider this question in the context of clustering, considering a popular nonparametric approach, namely kernel k-means [33]. K-means is arguably one of most common approaches to clustering and produces clusters with piece-wise linear boundaries. Its kernel version allows to consider nonlinear boundaries, greatly improving the flexibility of the approach. Its statistical properties have been studied [15, 24, 10] and from a computational point of view it requires manipulating an empirical kernel matrix. As for other kernel methods, this latter operation becomes unfeasible for large scale problems and deriving approximate computations is subject of a large body of recent works, see for example [34, 16, 29, 35, 25] and reference therein. In this paper we are interested into quantifying the statistical effect of computational approximations. Arguably one could expect the latter to induce some loss of accuracy. In fact, we prove that, perhaps surprisingly, there are favorable regimes where it is possible maintain optimal statistical accuracy while significantly reducing computational costs. While a similar phenomenon has been recently shown in supervised learning [31, 30, 12], we are not aware of similar results for other learning tasks. Our approach is based on considering a Nyström approach to kernel k-means based on sampling a subset of training set points (landmarks) that can be used to approximate the kernel matrix [3, 34, 13, 14, 35, 25]. While there is a vast literature on the properties of Nyström methods for kernel approximations [25, 3], experience from supervised learning show that better results can be derived focusing on the task of interest, see discussion in [7]. The properties of Nyström approximations for k-means has been recently studied in [35, 25]. Here they focus only on the computational aspect of the problem, and provide fast methods that achieve an empirical cost only a multiplicative factor larger than the optimal one. Our analysis is aimed at combining both statistical and computational results. Towards this end we derive a novel additive bound on the empirical cost that can be used to bound the true object of interest: the expected cost. This result can be combined with probabilistic results to show that optimal statistical accuracy can be obtained considering only O(√n) Nyström landmark points, 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. where n is the number of training set of points. Moreover, we show similar bounds not only for the optimal solution, which is hard to compute in general, but also for approximate solutions that can be computed efficiently using k-means++. From a computational point of view this leads to massive improvements reducing the memory complexity from O(n2) to O(n√n). Experimental results on large scale data-sets confirm and illustrate our findings. The rest of the paper is organized as follows. We first overview kernel k-means, and introduce our approximate kernel k-means approach based on Nyström embeddings. We then prove our statistical and computational guarantees and empirically validate them. Finally, we present some limits of our analysis, and open questions. 2 Background Notation Given an input space X, a sampling distribution µ, and n samples {xi}n i=1 drawn i.i.d. from µ, we denote with µn(A) = (1/n) Pn i=1 I{xi ∈A} the empirical distribution. Once the data has been sampled, we use the feature map ϕ(·) : X →H to maps X into a Reproducing Kernel Hilbert Space (RKHS) H [32], that we assume separable, such that for any x ∈X we have φ = ϕ(x). Intuitively, in the rest of the paper the reader can assume that φ ∈RD with D ≫n or even infinite. Using the kernel trick [2] we also know that φTφ′ = K(x, x′), where K is the kernel function associated with H and φTφ′ = ⟨φ, φ′⟩H is a short-hand for the inner product in H. With a slight abuse of notation we will also define the norm ∥φ∥2 = φTφ, and assume that ∥ϕ(x)∥2 ≤κ2 for any x ∈X. Using φi = ϕ(xi), we denote with D = {φi}n i=1 the input dataset. We also represent the dataset as the map Φn = [φ1, . . . , φn] : Rn →H with φi as its i-th column. We denote with Kn = ΦT nΦn the empirical kernel matrix with entries [Kn]i,j = ki,j. Finally, given Φn we denote as Πn = ΦnΦT n(ΦnΦT n)+ the orthogonal projection matrix on the span Hn = Im(Φn) of the dataset. k-mean’s objective Given our dataset, we are interested in partitioning it into k disjoint clusters each characterized by its centroid cj. The Voronoi cell associated with a centroid cj is defined as the set Cj := {i : j = arg mins=[k] ∥φi −cs∥2}, or in other words a point φi ∈D belongs to the j-th cluster if cj is its closest centroid. Let C = [c1, . . . ck] be a collection of k centroids from H. We can now formalize the criterion we use to measure clustering quality. Definition 1. The empirical and expected squared norm criterion are defined as W(C, µn) := 1 n n X i=1 min j=1,...,k ∥φi −cj∥2, W(C, µ) := E φ∼µ  min j=1,...,k ∥φ −cj∥2  . The empirical risk minimizer (ERM) is defined as Cn := arg minC∈Hk W(C, µn). The sub-script n in Cn indicates that it minimizes W(C, µn) for the n samples in D. Biau et al. [10] gives us a bound on the excess risk of the empirical risk minimizer. Proposition 1 ([10]). The excess risk E(Cn) of the empirical risk minimizer Cn satisfies E(Cn) := ED∼µ [W(Cn, µ)] −W ∗(µ) ≤O k/√n  where W ∗(µ) := infC∈Hk W(C, µ) is the optimal clustering risk. From a theoretical perspective, this result is only √ k times larger than a corresponding O( p k/n) lower bound [18], and therefore shows that the ERM Cn achieve an excess risk optimal in n. From a computational perspective, Definition 1 cannot be directly used to compute Cn, since the points φi in H cannot be directly represented. Nonetheless, due to properties of the squared norm criterion, each cj ∈Cn must be the mean of all φi associated with that center, i.e., Cn belongs to Hn. Therefore, it can be explicitly represented as a sum of the φi points included in the j-th cluster, i.e., all the points in the j-th Voronoi cell Cj. Let V be the space of all possible disjoint partitions [C1, . . . , Cj]. We can use this fact, together with the kernel trick, to reformulate the objective W(·, µn). Proposition 2 ([17]). We can rewrite the objective min C∈H W(C, µn) = 1 n min V k X j=1 X i∈Cj φi − 1 |Cj| X s∈Cj φs 2 with φi − 1 |Cj|φCj1|Cj| 2 = ki,i − 2 |Cj| P s∈Cj ki,s + 1 |Cj|2 P s∈Cj P s′∈Cj ks,s′ 2 While the combinatorial search over V can now be explicitly computed and optimized using the kernel matrix Kn, it still remains highly inefficient to do so. In particular, simply constructing and storing Kn takes O(n2) time and space and does not scale to large datasets. 3 Algorithm A simple approach to reduce computational cost is to use approximate embeddings, which replace the map ϕ(·) and points φi = ϕ(xi) ∈H with a finite-dimensional approximation eφi = eϕ(xi) ∈Rm. Nyström kernel k-means Given a dataset D, we denote with I = {φj}m j=1 a dictionary (i.e., subset) of m points φj from D, and with Φm : Rm →H the map with these points as columns. These points acts as landmarks [36], inducing a smaller space Hm = Im(Φm) spanned by the dictionary. As we will see in the next section, I should be chosen so that Hm is close to the whole span Hn = Im(Φn) of the dataset. Let Km,m ∈Rm×m be the empirical kernel matrix between all points in I, and denote with Πm = ΦmΦ T m(ΦmΦ T m)+ = ΦmK+ m,mΦ T m, (1) the orthogonal projection on Hm. Then we can define an approximate ERM over Hm as Cn,m = arg min C∈Hkm 1 n n X i=1 min j=[k] ∥φi −cj∥2 = arg min C∈Hkm 1 n n X i=1 min j=[k] ∥Πm(φi −cj)∥2, (2) since any component outside of Hm is just a constant in the minimization. Note that the centroids Cn,m are still points in Hm ⊂H, and we cannot directly compute them. Instead, we can use the eigen-decomposition of Km,m = UΛUT to rewrite Πm = ΦmUΛ−1/2Λ−1/2UTΦT m. Defining now eϕ(·) = Λ−1/2UTΦT mϕ(·) we have a finite-rank embedding into Rm. Substituting in Eq. (2) ∥Πm(φi −cj)∥2 = ∥Λ−1/2U TΦ T m(φi −cj)∥2 = ∥eφi −Λ−1/2U TΦ T mcj∥2, where eφi := Λ−1/2UTΦT mφi are the embedded points. Replacing ecj := Λ−1/2UTΦT mcj and searching over eC ∈Rm×k instead of searching over C ∈Hk m, we obtain (similarly to Proposition 2) eCn,m = arg min eC∈Rm×k 1 n n X i=1 min j=[k] ∥eφi −ecj∥2 = 1 n min V k X j=1 X i∈Cj eφi − 1 |Cj| X s∈Cj eφs 2 , (3) where we do not need to resort to kernel tricks, but can use the m-dimensional embeddings eφi to explicitly compute the centroid P s∈Cj eφs. Eq. (3) can now be solved in multiple ways. The most straightforward is to run a parametric k-means algorithm to compute eCn,m, and then invert the relationship ecj = ΦmUΛ−1/2cj to bring back the solution to Hm, i.e., Cn,m = Φ+ mUTΛ1/2 eCn,m = ΦmUΛ−1/2 eCn,m. This can be done in in O(nm) space and O(nmkt + nm2) time using t steps of Lloyd’s algorithm [22] for k clusters. More in detail, computing the embeddings eφi is a one-off cost taking nm2 time. Once the m-rank Nyström embeddings eφi are computed they can be stored and manipulated in nm time and space, with an n/m improvement over the n2 time and space required to construct Kn. 3.1 Uniform sampling for dictionary construction Due to its derivation, the computational cost of Algorithm 1 depends on the size m of the dictionary I. Therefore, for computational reasons we would prefer to select as small a dictionary as possible. As a conflicting goal, we also wish to optimize W(·, µn) well, which requires a eϕ(·) and I rich enough to approximate W(·, µn) well. Let Π⊥ m be the projection orthogonal to Hm. Then when ci ∈Hm ∥φi −ci∥2 = ∥(Πm + Π⊥ m)(φi −ci)∥2 = ∥Πm(φi −ci)∥2 + ∥Π⊥ mφi∥2. We will now introduce the concept of a γ-preserving dictionary I to control the quantity ∥Π⊥ mφi∥2. 3 Algorithm 1 Nyström Kernel K-Means Input: dataset D = {φi}n i=1, dictionary I = {φj}m j=1 with points from D, number of clusters k compute kernel matrix Km,m = ΦT mΦm between all points in I compute eigenvectors U and eigenvalues Λ of Km,m for each point φi, compute embedding eφi = Λ−1/2UTΦT mφi = Λ−1/2UTKm,i ∈Rm compute optimal centroids eCn,m ∈Rm×k on the embedded dataset eD = {eφi}n i=1 compute explicit representation of centroids Cn,m = ΦmUΛ−1/2 eCn,m Definition 2. We define the subspace Hm and dictionary I as γ-preserving w.r.t. space Hn if Π⊥ m = Πn −Πm ⪯ γ 1 −ε (ΦnΦ T n + γΠn)−1 . (4) Notice that the inverse (ΦnΦT n + γΠn)−1 on the right-hand side of the inequality is crucial to control the error ∥Π⊥ mφi∥2 ≲γφT i (ΦnΦT n + γΠn)−1 φi. In particular, since φi ∈Φn, we have that in the worst case the error is bounded as φT i (ΦnΦT n + γΠn)−1 φi ≤φT i (φiφT i)+ φi ≤1. Conversely, since λmax(ΦnΦT n) ≤κ2n we know that in the best case the error can be reduced up to 1/n ≤ φT iφi/λmax(ΦnΦT n) ≤φT i (ΦnΦT n + γΠn)−1 φi. Note that the directions associated with the larger eigenvalues are the ones that occur most frequently in the data. As a consequence, Definition 2 guarantees that the overall error across the whole dataset remains small. In particular, we can control the residual Π⊥ mΦn after the projection as ∥Π⊥ mΦn∥2 ≤γ∥ΦT n(ΦnΦT n + γΠn)−1Φn∥≤γ. To construct γ-preserving dictionaries we focus on a uniform random sampling approach[7]. Uniform sampling is historically the first [36], and usually the simplest approach used to construct I. Leveraging results from the literature [7, 14, 25] we can show that uniformly sampling e O(n/γ) landmarks generates a γ-preserving dictionary with high probability. Lemma 1. For a given γ, construct I by uniformly sampling m ≥12κ2n/γ log(n/δ)/ε2 landmarks from D. Then w.p. at least 1 −δ the dictionary I is γ-preserving. Musco and Musco [25] obtains a similar result, but instead of considering the operator Πn they focus on the finite-dimensional eigenvectors of Kn. Moreover, their Πn ⪯Πm + εγ 1−ε (ΦnΦT n)+ bound is weaker and would not be sufficient to satisfy our definition of γ-accuracy. A result equivalent to Lemma 1 was obtained by Alaoui and Mahoney [3], but they also only focus on the finite-dimensional eigenvectors of Kn, and did not investigate the implications for H. Proof sketch of Lemma 1. It is well known [7, 14] that uniformly sampling O(n/γε−2 log(n/δ)) points with replacement is sufficient to obtain w.p. 1 −δ the following guarantees on Φm (1 −ε)ΦnΦ T n −εγΠn ⪯n mΦmΦ T m ⪯(1 + ε)ΦnΦ T n + εγΠn. Which implies  n mΦmΦ T m + γΠn −1 ⪯((1 −ε)ΦnΦ T n −εγΠn + γΠn)−1 = 1 1 −ε (ΦnΦ T n + γΠn)−1 We can now rewrite Πn as Πn =  n mΦmΦ T m + γΠn   n mΦmΦ T m + γΠn −1 = n mΦmΦ T m  n mΦmΦ T m + γΠn −1 + γ  n mΦmΦ T m + γΠn −1 ⪯n mΦmΦ T m  n mΦmΦ T m + + γ  n mΦmΦ T m + γΠn −1 = Πm + γ  n mΦmΦ T m + γΠn −1 ⪯Πm + γ 1 −ε (ΦnΦ T n + γΠn)−1 In other words, using uniform sampling we can reduce the size of the search space Hm by a 1/γ factor (from n to m ≃n/γ) in exchange for a γ additive error, resulting in a computation/approximation trade-off that is linear in γ. 4 4 Theoretical analysis Exploiting the error bound for γ-preserving dictionaries we are now ready for the main result of this paper: showing that we can improve the computational aspect of kernel k-means using Nyström embedding, while maintaining optimal generalization guarantees. Theorem 1. Given a γ-preserving dictionary E(Cn,m) = W(Cn,m, µ) −W(Cn, µ) ≤O  k  1 √n + γ n  From a statistical point of view, Theorem 1 shows that if I is γ-preserving, the ERM in Hm achieves the same excess risk as the exact ERM from Hn up to an additional γ/n error. Therefore, choosing γ = √n the solution Cn,m achieves the O (k/√n) + O(k√n/n) ≤O(k/√n) generalization [10]. From a computational point of view, Lemma 1 shows that we can construct an √n-preserving dictionary simply by sampling e O(√n) points uniformly1, which greatly reduces the embedding size from n to √n, and the total required space from n2 to e O(n√n). Time-wise, the bottleneck becomes the construction of the embeddings eφi, which takes nm2 ≤e O(n2) time, while each iterations of Lloyd’s algorithm only requires nm ≤e O(n√n) time. In the full generality of our setting this is practically optimal, since computing a √n-preserving dictionary is in general as hard as matrix multiplication [26, 9], which requires Ω(n2) time. In other words, unlike the case of space complexity, there is no free lunch for time complexity, that in the worst case must scale as n2 similarly to the exact case. Nonetheless embedding the points is an embarrassingly parallel problem that can be easily distributed, while in practice it is usually the execution of the Lloyd’s algorithm that dominates the runtime. Finally, when the dataset satisfies certain regularity conditions, the size of I can be improved, which reduces both embedding and clustering runtime. Denote with dn eff(γ) = Tr KT n(Kn + In)−1 the so-called effective dimension [3] of Kn. Since Tr KT n(Kn + In)−1 ≤Tr (KT n(Kn)+), we have that dn eff(γ) ≤r := Rank(Kn), and therefore dn eff(γ) can be seen as a soft version of the rank. When dn eff(γ) ≪√n it is possible to construct a γ-preserving dictionary with only dn eff(γ) landmarks in e O(ndn eff(γ)2) time using specialized algorithms [14] (see Section 6). In this case, the embedding step would require only e O(ndn eff(γ)2) ≪e O(n2), improving both time and space complexity. Morever, to the best of our knowledge, this is the first example of an unsupervised non-parametric problem where it is always (i.e., without assumptions on µ) possible to preserve the optimal O(1/√n) risk rate while reducing the search from the whole space H to a smaller Hm subspace. Proof sketch of Theorem 1. We can separate the distance between W(Cn,m, µ) −W(Cn, µ) in a component that depends on how close µ is to µn, bounded using Proposition 1, and a component W(Cn,m, µn) −W(Cn, µn) that depends on the distance between Hn and Hm Lemma 2. Given a γ-preserving dictionary W(Cn,m, µn) −W(Cn, µn) ≤ min(k, dn eff(γ)) 1 −ε γ n To show this we can rewrite the objective as (see [17]) W(Cn,m, µn) = ∥Φn −ΠmΦnSn,m∥2 F = Tr(Φ T nΦn −SnΦ T nΠmΦnSn), where Sn ∈Rn×n is a k-rank projection matrix associated with the exact clustering Cn. Then using Definition 2 we have Πm −Πn ⪰− γ 1−ε(ΦnΦT n + γΠn)−1 and we obtain an additive error bound Tr(Φ T nΦn −SnΦ T nΠmΦnSn) ≤Tr  Φ T nΦn −SnΦ T nΦnSn + γ 1 −εSnΦ T n(ΦnΦ T n + γΠn)−1ΦnSn  = W(Cn, µn) + γ 1 −ε Tr SnΦ T n(ΦnΦ T n + γΠn)−1ΦnSn  . 1 e O hides logarithmic dependencies on n and m. 5 Since ∥ΦT n(ΦnΦT n + γΠn)−1Φn∥≤1, Sn is a projection matrix, and Tr(Sn) = k we have γ 1−ε Tr SnΦ T n(ΦnΦ T n + γΠn)−1ΦnSn  ≤ γ 1−ε Tr (SnSn) = γk 1−ε. Conversely, if we focus on the matrix ΦT n(ΦnΦT n + γΠn)−1Φn ⪯Πn we have γ 1−ε Tr SnΦ T n(ΦnΦ T n + Πn)−1ΦnSn  ≤ γ 1−ε Tr Φ T n(ΦnΦ T n + Πn)−1Φn  ≤γdn eff(γ) 1−ε . Since both bounds hold simultaneously, we can simply take the minimum to conclude our proof. We now compare the theorem with previous work. Many approximate kernel k-means methods have been proposed over the years, and can be roughly split in two groups. Low-rank decomposition based methods try to directly simplify the optimization problem from Proposition 2, replacing the kernel matrix Kn with an approximate eKn that can be stored and manipulated more efficiently. Among these methods we can mention partial decompositions [8], Nyström approximations based on uniform [36], k-means++ [27], or ridge leverage score (RLS) sampling[35, 25, 14], and random-feature approximations [6]. None of these optimization based methods focus on the underlying excess risk problem, and their analysis cannot be easily integrated in existing results, as the approximate minimum found has no clear interpretation as a statistical ERM. Other works take the same embedding approach that we do, and directly replace the exact ϕ(·) with an approximate eϕ(·), such as Nyström embeddings [36], Gaussian projections [10], and again random-feature approximations [29]. Note that these approaches also result in approximate eKn that can be manipulated efficiently, but are simpler to analyze theoretically. Unfortunately, no existing embedding based methods can guarantee at the same time optimal excess risk rates and a reduction in the size of Hm, and therefore a reduction in computational cost. To the best of our knowledge, the only other result providing excess risk guarantee for approximate kernel k-means is Biau et al. [10], where the authors consider the excess risk of the ERM when the approximate Hm is obtained using Gaussian projections. Biau et al. [10] notes that the feature map ϕ(x) = PD s=1 ψs(x) can be expressed using an expansion of basis functions ψs(x), with D very large or infinite. Given a matrix P ∈Rm×D where each entry is a standard Gaussian r.v., [10] proposes the following m-dimensional approximate feature map eϕ(x) = P[ψ1(x), . . . , ψD(x)] ∈Rm. Using Johnson-Lindenstrauss (JL) lemma [19], they show that if m ≥log(n)/ν2 then a multiplicative error bound of the form W(Cn,m, µn) ≤(1+ν)W(Cn, µn) holds. Reformulating their bound, we obtain that W(Cn,m, µn) −W(Cn, µn) ≤νW(Cn, µn) ≤νκ2 and E(Cn,m) ≤O(k/√n + ν). Note that to obtain a bound comparable to Theorem 1, and if we treat k as a constant, we need to take ν = γ/n which results in m ≥(n/γ)2. This is always worse than our e O(n/γ) result for uniform Nyström embedding. In particular, in the 1/√n risk rate setting Gaussian projections would require ν = 1/√n resulting in m ≥n log(n) random features, which would not bring any improvement over computing Kn. Moreover when D is infinite, as it is usually the case in the non-parametric setting, the JL projection is not explicitly computable in general and Biau et al. [10] must assume the existence of a computational oracle capable of constructing eϕ(·). Finally note that, under the hood, traditional embedding methods such as those based on JL lemma, usually provide only bounds of the form Πn −Πm ⪯γΠn, and an error ∥Π⊥ mφi∥2 ≤γ ∥φi∥2 (see the discussion of Definition 2). Therefore the error can be larger along multiple directions, and the overall error ∥Π⊥ mΦn∥2 across the dictionary can be as large as nγ rather than γ. Recent work in RLS sampling has also focused on bounding the distance W(Cn,m, µn)−W(Cn, µn) between empirical errors. Wang et al. [35] and Musco and Musco [25] provide multiplicative error bounds of the form W(Cn,m, µn) ≤(1+ν)W(Cn, µn) for uniform and RLS sampling. Nonetheless, they only focus on empirical risk and do not investigate the interaction between approximation and generalization, i.e., statistics and computations. Moreover, as we already remarked for [10], to achieve the 1/√n excess risk rate using a multiplicative error bound we would require an unreasonably small ν, resulting in a large m that brings no computational improvement over the exact solution. Finally, note that when [31] showed that a favourable trade-off was possible for kernel ridge regression (KRR), they strongly leveraged the fact that KRR is a γ-regularized problem. Therefore, all eigenvalues and eigenvectors in the ΦnΦT n covariance matrix smaller than the γ regularization do not influence significantly the solution. Here we show the same for kernel k-means, a problem 6 without regularization. This hints at a deeper geometric motivation which might be at the root of both problems, and potentially similar approaches could be leveraged in other domains. 4.1 Further results: beyond ERM So far we provided guarantees for Cn,m, that this the ERM in Hm. Although Hm is much smaller than Hn, solving the optimization problem to find the ERM is still NP-Hard in general [4]. Nonetheless, Lloyd’s algorithm [22], when coupled with a careful k-means++ seeding, can return a good approximate solution C++ n,m. Proposition 3 ([5]). For any dataset EA[W(C++ n,m, µn)] ≤8(log(k) + 2)W(Cn,m, µn), where A is the randomness deriving from the k-means++ initialization. Note that, similarly to [35, 25], this is a multiplicative error bound on the empirical risk, and as we discussed we cannot leverage Lemma 2 to bound the excess risk E(C++ n,m). Nonetheless we can still leverage Lemma 2 to bound only the expected risk W(C++ n,m, µ), albeit with an extra error term appearing that scales with the optimal clustering risk W ∗(µ) (see Proposition 1). Theorem 2. Given a γ-preserving dictionary E D∼µ h E A[W(C++ n,m, µ)] i ≤O  log(k)  k √n + k γ n + W ∗(µ)  . From a statistical perspective, we can once again, set γ = √n to obtain a O(k/√n) rate for the first part of the bound. Conversely, the optimal clustering risk W ∗(µ) is a µ-dependent quantity that cannot in general be bounded in n, and captures how well our model, i.e., the choice of H and how well the criterion W(·, µ), matches reality. From a computational perspective, we can now bound the computational cost of finding C++ n,m. In particular, each iteration of Lloyd’s algorithm will take only e O(n√nk) time. Moreover, when k-means++ initialization is used, the expected number of iterations required for Lloyd’s algorithm to converge is only logarithmic [1]. Therefore, ignoring the time required to embed the points, we can find a solution in e O(n√nk) time and space instead of the e O(n2k) cost required by the exact method, with a strong O(√n) improvement. Finally, if the data distribution satisfies some regularity assumption the following result follows [15]. Corollary 1. If we denote by Xµ the support of the distribution µ and assume ϕ(Xµ) to be a ddimensional manifold, then W ∗(µ) ≤dk−2/d, and given a √n-preserving dictionary the expected cost satisfies ED∼µ[EA[W(C++ n,m, µ)]] ≤O  log(k)  k √n + dk−2/d . 5 Experiments We now evaluate experimentally the claims of Theorem 1, namely that sampling e O(n/γ) increases the excess risk by an extra γ/n factor, and that m = √n is sufficient to recover the optimal rate. We use the Nystroem and MiniBatchKmeans classes from the sklearn python library [28]to implement kernel k-means with Nyström embedding (Algorithm 1) and we compute the solution C++ n,m. For our experiments we follow the same approach as Wang et al. [35], and test our algorithm on two variants of the MNIST digit dataset. In particular, MNIST60K [20] is the original MNIST dataset containing pictures each with d = 784 pixels. We divide each pixel by 255, bringing each feature in a [0, 1] interval. We split the dataset in two part, n = 60000 samples are used to compute the W(C++ n,m) centroids, and we leave out unseen 10000 samples to compute W(C++ n,m, µtest), as a proxy for W(C++ n,m, µ). To test the scalability of our approach we also consider the MNIST8M dataset from the infinite MNIST project [23], constructed using non-trivial transformations and corruptions of the original MNIST60K images. Here we compute C++ n,m using n = 8000000 images, and compute W(C++ n,m, µtest) on 100000 unseen images. As in Wang et al. [35] we use Gaussian kernel with bandwidth σ = (1/n2) qP i,j ∥xi −xj∥2. MNIST60K: these experiments are small enough to run in less than a minute on a single laptop with 4 cores and 8GB of RAM. The results are reported in Fig. 1. On the left we report in blue 7 Figure 1: Results for MNIST60K Figure 2: Results for MNIST8M W(C++ n,m, µtest), where the shaded region is a 95% confidence interval for the mean over 10 runs. As predicted, the expected cost decreases as the size of Hm increases, and plateaus once we achieve 1/m ≃1/√n, in line with the statistical error. Note that the normalized mutual information (NMI) between the true [0 −9] digit classes y and the computed cluster assignments yn,m also plateaus around 1/√n. While this is not predicted by the theory, it strengthens the intuition that beyond a certain capacity expanding Hm is computationally wasteful. MNIST8M: to test the scalability of our approach, we run the same experiment on millions of points. Note that we carry out our MNIST8M experiment on a single 36 core machine with 128GB of RAM, much less than the setup of [35], where at minimum a cluster of 8 such nodes are used. The behaviour of W(C++ n,m, µtest) and NMI are similar to MNIST60K, with the increase in dataset size allowing for stronger concentration and smaller confidence intervals. Finalle, note that around m = 400 uniformly sampled landmarks are sufficient to achieve NMI(yn,m, y) = 0.405, matching the 0.406 NMI reported by [35] for a larger m = 1600, although smaller than the 0.423 NMI they report for m = 1600 when using a slower, PCA based method to compute the embeddings, and RLS sampling to select the landmarks. Nonetheless, computing C++ n,m takes less than 6 minutes on a single machine, while their best solution required more than 1.5hr on a cluster of 32 machines. 6 Open questions and conclusions Combining Lemma 1 and Lemma 2, we know that using uniform sampling we can linearly trade-off a 1/γ decrease in sub-space size m with a γ/n increase in excess risk. While this is sufficient to maintain the O(1/√n) rate, it is easy to see that the same would not hold for a O(1/n) rate, since we would need to uniformly sample n/1 landmarks losing all computational improvements. To achieve a better trade-off we must go beyond uniform sampling and use different probabilities for each sample, to capture their uniqueness and contribution to the approximation error. 8 Definition 3 ([3]). The γ-ridge leverage score (RLS) of point i ∈[n] is defined as τi(γ) = φ T i(ΦnΦ T n + γΠn)−1φi = e T iKn(Kn + γIn)−1ei. (5) The sum of the RLSs dn eff(γ) = Pn i=1 τi(γ) is the empirical effective dimension of the dataset. Ridge leverage scores are closely connected to the residual ∥Π⊥ mφi∥2 after the projection Πm discussed in Definition 2. In particular, using Lemma 2 we have that the residual can be bounded as ∥Π⊥ mφi∥2 ≤ γ 1−εφT i(ΦnΦT n + γΠn)−1φi. It is easy to see that, up to a factor γ 1−ε, high-RLS points are also high-residual points. Therefore it is not surprising that sampling according to RLSs quickly selects any high-residual points and covers Hn, generating a γ-preserving dictionary. Lemma 3. [11] For a given γ, construct I by sampling m ≥12κ2dn eff(γ) log(n/δ)/ε2 landmarks from D proportionally to their RLS. Then w.p. at least 1 −δ the dictionary I is γ-preserving. Note there exist datasets where the RLSs are uniform,and therefore in the worst case the two sampling approaches coincide. Nonetheless, when the data is more structured m ≃dn eff(γ) can be much smaller than the n/γ dictionary size required by uniform sampling. Finally, note that computing RLSs exactly also requires constructing Kn and O(n2) time and space, but in recent years a number of fast approximate RLSs sampling methods [14] have emerged that can construct γ-preserving dictionaries of size e O(dn eff(γ)) in just e O(ndn eff(γ)2) time. Using this result, it is trivial to sharpen the computational aspects of Theorem 1 in special cases. In particular, we can generate a √n-preserving dictionary with only dn eff(√n) elements instead of the √n required by uniform sampling. Using concentration arguments [31] we also know that w.h.p. the empirical effective dimension is at most three times dn eff(γ) ≤3dµ eff(γ) the expected effective dimension, a µ-dependent quantity that captures the interaction between µ and the RKHS H. Definition 4. Given the expected covariance operator Ψ := Ex∼µ [φ(x)φ(x)T], the expected effective dimension is defined as dµ eff(γ) = Ex∼µ h φ(x) (Ψ + γΠ)−1 φ(x) i . Moreover, for some constant c that depends only on ϕ(·) and µ, dµ eff(γ) ≤c (n/γ)η with 0 < η ≤1. Note that η = 1 just gives us the dµ eff(γ) ≤O(n/γ) worst-case upper bound that we saw for dn eff(γ), and it is always satisfied when the kernel function is bounded. If instead we have a faster spectral decay, η can be much smaller. For example, if the eigenvalues of Ψ decay polynomially as λi = i−η, then dµ eff(γ) ≤c (n/γ)η, and in our case γ = √n we have dµ eff(√n) ≤cnη/2. We can now better characterize the gap between statistics and computation: using RLSs sampling we can improve the computational aspect of Theorem 1 from √n to dµ eff(γ), but the risk rate remains O(k/√n) due to the O(k/√n) component coming from Proposition 1. Assume for a second we could generalize, with additional assumptions, Proposition 1 to a faster O(1/n) rate. Then applying Lemma 2 with γ = 1 we would obtain a risk E(Cn,m) ≤O(k/n) + O(k/n). Here we see how the regularity condition on dµ eff(1) becomes crucial. In particular, if η = 1, then we have dµ eff(1) ∼n and no gain. If instead η < 1 we obtain dµ eff(1) ≤nη. This kind of adaptive rates were shown to be possible in supervised learning [31], but seems to still be out of reach for approximate kernel k-means. One possible approach to fill this gap is to look at fast O(1/n) excess risk rates for kernel k-means. Proposition 4 ([21], informal). Assume that k ≥2, and that µ satisfies a margin condition with radius r0. If Cn is an empirical risk minimizer, then, with probability larger than 1 −e−δ, E(Cn) ≤e O  1 r0 (k + log(|M|)) log(1/δ) n  , where |M| is the cardinality of the set of all optimal (up to a relabeling) clustering. For more details on the margin assumption, we refer the reader to the original paper [21]. Intuitively the margin condition asks that every labeling (Voronoi grouping) associated with an optimal clustering is reflected by large separation in µ. This margin condition also acts as a counterpart of the usual margin conditions for supervised learning where µ must have lower density around the neighborhood of the critical area {x|µ′(Y = 1|X = x) = 1/2}. Unfortunately, it is not easy to integrate Proposition 4 in our analysis, as it is not clear how the margin condition translate from Hn to Hm. 9 Acknowledgments. This material is based upon work supported by the Center for Brains, Minds and Machines (CBMM), funded by NSF STC award CCF-1231216, and the Italian Institute of Technology. We gratefully acknowledge the support of NVIDIA Corporation for the donation of the Titan Xp GPUs and the Tesla k40 GPU used for this research. L. R. acknowledges the support of the AFOSR projects FA9550-17-1-0390 and BAA-AFRL-AFOSR-2016-0007 (European Office of Aerospace Research and Development), and the EU H2020-MSCA-RISE project NoMADS - DLV-777826. A. R. acknowledges the support of the European Research Council (grant SEQUOIA 724063). References [1] Nir Ailon, Ragesh Jaiswal, and Claire Monteleoni. Streaming k-means approximation. In Advances in neural information processing systems, pages 10–18, 2009. [2] M. A. Aizerman, E. A. Braverman, and L. Rozonoer. Theoretical foundations of the potential function method in pattern recognition learning. In Automation and Remote Control,, number 25 in Automation and Remote Control„ pages 821–837, 1964. [3] Ahmed El Alaoui and Michael W. Mahoney. Fast randomized kernel methods with statistical guarantees. In Neural Information Processing Systems, 2015. [4] Daniel Aloise, Amit Deshpande, Pierre Hansen, and Preyas Popat. Np-hardness of euclidean sum-of-squares clustering. Machine learning, 75(2):245–248, 2009. [5] David Arthur and Sergei Vassilvitskii. k-means++: The advantages of careful seeding. In Proceedings of the eighteenth annual ACM-SIAM symposium on Discrete algorithms, pages 1027–1035. Society for Industrial and Applied Mathematics, 2007. [6] Haim Avron, Michael Kapralov, Cameron Musco, Christopher Musco, Ameya Velingker, and Amir Zandieh. Random Fourier features for kernel ridge regression: Approximation bounds and statistical guarantees. In Proceedings of the 34th International Conference on Machine Learning, 2017. [7] Francis Bach. Sharp analysis of low-rank kernel matrix approximations. In Conference on Learning Theory, 2013. [8] Francis R Bach and Michael I Jordan. Predictive low-rank decomposition for kernel methods. In Proceedings of the 22nd international conference on Machine learning, pages 33–40. ACM, 2005. [9] Arturs Backurs, Piotr Indyk, and Ludwig Schmidt. On the fine-grained complexity of empirical risk minimization: Kernel methods and neural networks. In Advances in Neural Information Processing Systems, 2017. [10] Gérard Biau, Luc Devroye, and Gábor Lugosi. On the performance of clustering in hilbert spaces. IEEE Transactions on Information Theory, 54(2):781–790, 2008. [11] Daniele Calandriello. Efficient Sequential Learning in Structured and Constrained Environments. PhD thesis, 2017. [12] Daniele Calandriello, Alessandro Lazaric, and Michal Valko. Efficient second-order online kernel learning with adaptive embedding. In Advances in Neural Information Processing Systems, pages 6140–6150, 2017. [13] Daniele Calandriello, Alessandro Lazaric, and Michal Valko. Second-order kernel online convex optimization with adaptive sketching. In International Conference on Machine Learning, 2017. [14] Daniele Calandriello, Alessandro Lazaric, and Michal Valko. Distributed adaptive sampling for kernel matrix approximation. In AISTATS, 2017. [15] Guillermo Canas, Tomaso Poggio, and Lorenzo Rosasco. Learning manifolds with k-means and k-flats. In Advances in Neural Information Processing Systems, pages 2465–2473, 2012. 10 [16] Radha Chitta, Rong Jin, Timothy C. Havens, and Anil K. Jain. Approximate kernel k-means: Solution to large scale kernel clustering. In Proceedings of the 17th ACM SIGKDD international conference on Knowledge discovery and data mining, pages 895–903. ACM, 2011. [17] Inderjit S. Dhillon, Yuqiang Guan, and Brian Kulis. A unified view of kernel k-means, spectral clustering and graph cuts. Technical Report No. UTCS TR-04-25, University of Texas at Austin, 2004. [18] Siegfried Graf and Harald Luschgy. Foundations of Quantization for Probability Distributions. Lecture Notes in Mathematics. Springer-Verlag, Berlin Heidelberg, 2000. ISBN 978-3-54067394-1. [19] William B Johnson and Joram Lindenstrauss. Extensions of lipschitz mappings into a hilbert space. Contemporary Mathematics, 26, 1984. [20] Yann LeCun and Corinna Cortes. MNIST handwritten digit database. 2010. URL http: //yann.lecun.com/exdb/mnist/. [21] Clément Levrard et al. Nonasymptotic bounds for vector quantization in hilbert spaces. The Annals of Statistics, 43(2):592–619, 2015. [22] Stuart Lloyd. Least squares quantization in pcm. IEEE transactions on information theory, 28 (2):129–137, 1982. [23] Gaëlle Loosli, Stéphane Canu, and Léon Bottou. Training invariant support vector machines using selective sampling. In Large Scale Kernel Machines, pages 301–320. MIT Press, Cambridge, MA., 2007. [24] Andreas Maurer and Massimiliano Pontil. $ K $-dimensional coding schemes in Hilbert spaces. IEEE Transactions on Information Theory, 56(11):5839–5846, 2010. [25] Cameron Musco and Christopher Musco. Recursive Sampling for the Nyström Method. In NIPS, 2017. [26] Cameron Musco and David Woodruff. Is input sparsity time possible for kernel low-rank approximation? In Advances in Neural Information Processing Systems 30. 2017. [27] Dino Oglic and Thomas Gärtner. Nyström method with kernel k-means++ samples as landmarks. Journal of Machine Learning Research, 2017. [28] 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, 12:2825–2830, 2011. [29] Ali Rahimi and Ben Recht. Random features for large-scale kernel machines. In Neural Information Processing Systems, 2007. [30] Alessandro Rudi and Lorenzo Rosasco. Generalization properties of learning with random features. In Advances in Neural Information Processing Systems, pages 3218–3228, 2017. [31] Alessandro Rudi, Raffaello Camoriano, and Lorenzo Rosasco. Less is more: Nyström computational regularization. In Advances in Neural Information Processing Systems, pages 1657–1665, 2015. [32] Bernhard Scholkopf and Alexander J Smola. Learning with kernels: support vector machines, regularization, optimization, and beyond. MIT press, 2001. [33] Bernhard Schölkopf, Alexander Smola, and Klaus-Robert Müller. Nonlinear component analysis as a kernel eigenvalue problem. Neural computation, 10(5):1299–1319, 1998. [34] Joel A Tropp, Alp Yurtsever, Madeleine Udell, and Volkan Cevher. Fixed-rank approximation of a positive-semidefinite matrix from streaming data. In Advances in Neural Information Processing Systems, pages 1225–1234, 2017. 11
2018
116
7,271
The Spectrum of the Fisher Information Matrix of a Single-Hidden-Layer Neural Network Jeffrey Pennington Google Brain jpennin@google.com Pratik Worah Google Research pworah@google.com Abstract An important factor contributing to the success of deep learning has been the remarkable ability to optimize large neural networks using simple first-order optimization algorithms like stochastic gradient descent. While the efficiency of such methods depends crucially on the local curvature of the loss surface, very little is actually known about how this geometry depends on network architecture and hyperparameters. In this work, we extend a recently-developed framework for studying spectra of nonlinear random matrices to characterize an important measure of curvature, namely the eigenvalues of the Fisher information matrix. We focus on a single-hidden-layer neural network with Gaussian data and weights and provide an exact expression for the spectrum in the limit of infinite width. We find that linear networks suffer worse conditioning than nonlinear networks and that nonlinear networks are generically non-degenerate. We also predict and demonstrate empirically that by adjusting the nonlinearity, the spectrum can be tuned so as to improve the efficiency of first-order optimization methods. 1 Introduction In recent years, the success of deep learning has spread from classical problems in image recognition [1], audio synthesis [2], translation [3], and speech recognition [4] to more diverse applications in unexpected areas such as protein structure prediction [5], quantum chemistry [5] and drug discovery [6]. These empirical successes continue to outpace the development of a concrete theoretical understanding of how and in what contexts deep learning works. A central difficulty in analyzing deep learning systems stems from the complexity of neural network loss surfaces, which are highly non-convex functions, often of millions or even billions [7] of parameters. Optimization in such high-dimensional spaces poses many challenges. For most problems in deep learning, second-order methods are too costly to perform exactly. Despite recent developments on efficient approximations of these methods, such as the Neumann optimizer [8] and K-FAC [9], most practitioners use gradient descent and its variants [10], [11]. Despite their widespread use, it is not obvious why first-order methods are often successful in deep learning since it is known that first-order methods perform poorly in the presence of pathological curvature. An important open question in this direction is to what extent pathological curvature pervades deep learning and how it can be mitigated. More broadly, in order to continue improving neural network models and performance, we aim to better understand the conditions under which first-order methods will work well, and how those conditions depend on model design choices and hyperparameters. Among the variety of objects that may be used to quantify the geometry of the loss surface, two matrices have elevated importance: the Hessian matrix and the Fisher information matrix. From the perspective of Euclidean coordinate space, the Hessian matrix is the natural object with which to quantify the local geometry of the loss surface. It is also the fundamental object underlying many second-order optimization schemes and its spectrum provides insights as to the nature of critical 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. points. From the perspective of information geometry, distances are measured in model space rather than in coordinate space, and the Fisher information matrix defines the metric and determines the update directions in natural gradient descent [12]. In contrast to the standard gradient, the natural gradient defines the direction in the parameter space which gives the largest change in the objective per unit change in the model, as measured by Kullback-Leibler divergence. As we discuss in Section 2, the Hessian and the Fisher are related; for the squared error loss functions that we consider in this work, it turns out that the Fisher equals the Gauss-Newton approximation of the Hessian, so the connection is concrete. A central difficulty in building up a robust understanding of the properties of these curvature matrices stems from the fact that they are high-dimensional and the empirical estimation of their spectra is limited by memory and computational constraints. These limitations typically prevent direct calculations for models with more than a few tens of thousands of parameters and it is difficult to know whether conclusions drawn from such small models would generalize to the mega- or giga-dimensional networks used in practice. It is therefore important to develop theoretical tools to analyze the spectra of these matrices. In general, the spectra will depend in intimate ways on the specific parameter values of the weights and the distribution of input data to the network. It is not feasible to precisely capture all of these details, and even if a theory were developed that did so, it would not be clear how to derive generalizable conclusions from it. We therefore focus on a simplified configuration in which the weights and inputs are taken to be random variables. The analysis then becomes a well-defined computation in random matrix theory. The Fisher is a nonlinear function of the weights and data. To compute its spectrum, we extend the framework developed by Pennington and Worah [13] to study random matrices with nonlinear dependencies. As we describe in Section 2.4, the Fisher also has an internal block structure that complicates the resulting combinatorial analysis. The main technical contribution of this work is to extend the nonlinear random matrix theory of [13] to matrices with nontrivial internal structure. The result of our analysis is an explicit characterization of the spectrum of the Fisher information matrix of a single-hidden-layer neural network with squared loss, random Gaussian weights and random Gaussian input data in the limit of large width. We draw several nontrivial and potentially surprising conclusions about the spectrum. For example, linear networks suffer worse conditioning than any nonlinear network, and although nonlinear networks may have many small eigenvalues they are generically non-degenerate. Our results also suggest precise ways to tune the nonlinearity in order to improve conditioning of the spectrum, and our empirical simulations show improvements in the speed of first-order optimization as a result. 2 Preliminaries 2.1 Notation and problem statement Consider a single-hidden-layer neural network with weight matrices W (1), W (2) ∈Rn×n and pointwise activation function f : R →R. For input X ∈Rn, the output of the network ˆY (X) ∈Rn is given by ˆY (X) = W (2)f(W (1)X). For concreteness, we focus our analysis on the case of squared loss, in which case, L(θ) = EX,Y 1 2∥Y −ˆY (X)∥2 2 , (1) where Y ∈Rn are the regression targets and θ denotes the vector of all parameters {W (1), W (2)}. The matrix of second derivatives or Hessian of the loss with respect to the parameters can be written as, H = H(0) + H(1) , (2) where, H(0) ij = EX X α ∂ˆYα ∂θi ∂ˆYα ∂θj , and H(1) ij = EX X α ( ˆY (X) −Y )α ∂2 ˆYα ∂θi∂θj . (3) In this work we focus on the positive-semi-definite matrix H(0), which is known as the Gauss-Newton matrix. It can also be written as H(0) = JT J, where J ∈Rn×2n2 is the Jacobian matrix of ˆY with 2 respect to the parameters θ. For models with squared loss, it is known that the Gauss-Newton matrix is equal to the Fisher information matrix of the model distribution with respect to its parameters [14]. As such, by studying H(0) we simultaneously examine the Gauss-Newton matrix and the Fisher information matrix. The distribution of eigenvalues or spectrum of curvature matrices like H(0) plays an important role in optimization, as it characterizes the local geometry of the loss surface and the efficiency of first-order optimization methods. In this work, we seek to build a detailed understanding of this spectrum and how the architectural components of the neural network influence it. In order to isolate these factors from idiosyncratic behavior related to the specifics of the data and weight configurations, we focus on the a vanilla baseline configuration in which the data and the weights are both taken to be iid Gaussian random variables. Concretely, we take X ∼N(0, In), W (l) ij ∼N(0, 1 n), and we will be interested in computing the expected distribution of eigenvalues H(0) for large n. From this perspective, the problem can be framed as a computation in random matrix theory, the principles behind which we now review. 2.2 Spectral density and the Stieltjes transform The empirical spectral density of a matrix M is defined as, ρM(λ) = 1 n n X j=1 δ(λ −λj(M)) , (4) where the λj(M), j = 1, . . . , n, denote the n eigenvalues of M, including multiplicity, and δ is the Dirac delta function. The limiting spectral density is the limit of eqn. (4) as n →∞, if it exists. For z ∈C \ supp(ρM) the Stieltjes transform G of ρM is defined as, G(z) = Z ρM(t) z −t dt = −1 nE tr(M −zIn)−1 , (5) where the expectation is with respect to the random variables W and X. The quantity (M −zIn1)−1 is the resolvent of M. The spectral density can be recovered from the Stieltjes transform using the inversion formula, ρM(λ) = −1 π lim ϵ→0+ Im G(λ + iϵ) . (6) 2.3 Moment method One of the main tools for computing the limiting spectral distributions of random matrices is the moment method, which, as the name suggests, is based on computations of the moments of ρM. The asymptotic expansion of eqn. (5) for large z gives the Laurent series, G(z) = ∞ X k=0 mk zk+1 , (7) where mk is the kth moment of the distribution ρM, mk = Z dt ρM(t)tk = 1 nE tr M k . (8) If one can compute mk, then the density ρM can be obtained via eqns. (7) and (6). The idea behind the moment method is to compute mk by expanding out powers of M inside the trace as, 1 nE tr M k = 1 n E X i1,...,ik∈[n] Mi1i2Mi2i3 · · · Mik−1ikMiki1 , (9) and evaluating the leading contributions to the sum as n →∞. We will use the moment method in order to compute the limiting spectral density of the Fisher. As a first step in that direction, we focus on the properties of the layer-wise block structure in the Fisher induced by the neural network architecture. 3 2.4 Block structure of the Fisher As described above, in our single-hidden-layer setting with squared loss, the Fisher is given by H(0) = EX  JT J  , Jαi = ∂ˆYα ∂θi . (10) Because the parameters of the model are organized into two layers, it is convenient to partition the Fisher into a 2 × 2 block matrix, H(0) = H(0) 11 H(0) 12 H(0) 12 T H(0) 22 ! . Furthermore, because the parameters of each layer are matrices, it is useful to regard each block of the Fisher as a four-index tensor. In particular, [H(0) 11 ]a1b1,a2b2 = EX "X i J(1) i,a1b1 J(1) i,a2b2 # , [H(0) 12 ]a1b1,c1d1 = EX "X i J(1) i,a1b1 J(2) i,c1d1 # , [H(0) 22 ]c1d1,c2d2 = EX "X i J(2) i,c1d1 J(2) i,c2d2 # . The Jacobian entries J(l) i,ab equal the derivatives of ˆYi with respect to the weight variables W (l) ab , J(1) i,ab = W (2) ia f ′ X k W (1) ak Xk  Xb , J(2) j,cd = δcjf X l W (1) dl Xl  , (11) where δcj denotes the Kronecker delta function i.e., it is 1 if c = j, and 0 otherwise. In order to proceed by the method of moments, we will need to compute the normalized trace of powers of the Fisher, i.e. 1 n tr[H(0)]d, for any d. The block structure of the Fisher makes the explicit representation of these traces somewhat complicated. The following proposition helps simplify the expressions. Proposition 1. Let A1 ∈Rn×k1, A2 ∈Rn×k2 and A = [A1, A2] ∈Rn×(k1+k2). Then, tr[(AT A)d] = X b∈{1,2}d tr d Y i=1 AbiAT bi = X b∈{1,2}d tr AT bdAb1 d−1 Y i=1 AT biAbi+1 . (12) Using Proposition 1 with A1 = J(1) and A2 = J(2), we have, tr[(H(0))d] = X b∈{1,2}d tr EX  J(bd)T J(b1) d−1 Y i=1 EX  J(bi)T J(bi+1) , (13) which expresses the traces of the block Fisher entirely in terms of products of its constituent blocks. In order to carry out the moment method to completion, we need the expected normalized traces mk, mk = 1 nEW tr[(H(0))k] , (14) in the limit of large n. Because the nonlinearity significantly complicates the analysis, we first illustrate the basics of the methodology in the linear case before moving on to the general case. 2.5 An Illustrative Example: The Linear Case Let us assume that f is the identity function i.e., f(z) = z. In this case, eqn. (11) can be written as, J(1) = W (2)T ⊗X , J(2) = I ⊗W (1)X . (15) 4 () 0 2 4 6 8 10-4 0.001 0.010 0.100 1 10  () 2 4 6 8 0.05 0.10 0.15 0.20 0.25  (a) f(x) = x () 0 2 4 6 8 10-4 0.001 0.010 0.100 1 10  () 2 4 6 8 0.5 1.0 1.5 2.0 2.5 3.0  (b) f(x) = erf1(x) Figure 1: Empirical spectra of Fisher for single-hidden-layer networks of width 128 (orange) and theoretical prediction of spectra (black) for (a) linear and (b) erf1 (see eqn. 30) networks. Insets show logarithmic scale. Using the fact that EX[XXT ] = In, eqn. (13) gives, tr [(H(0))d] = EW d X k=0 d k  tr(W (2)W (2)T )d−k tr(W (1)W (1)T )k = d X k=0 d k  Cd−kCk , (16) where Cn is the nth Catalan number. The series can be summed to obtain the Stieltjes transform, whose imaginary part gives the following explicit form for the spectrum, ρ(λ) = 1 2δ(λ) + h 1 2π2 E  1 16(8 −λ)λ  + 4 −λ 8π2 K  1 16(8 −λ)λ i 1[0,8] , (17) where K and E are the complete elliptic integrals of the first- and second-kind, K(k) = Z π 2 0 dθ 1 p 1 −k sin2 θ , E(k) = Z π 2 0 dθ p 1 −k sin2 θ . (18) Notice that the spectrum is highly degenerate, with half of the eigenvalues equaling zero. This degeneracy can be attributed to the GL(n2) symmetry of the product W (2)W (1) under {W (1), W (2)} → {GW (1), W (2)G−1}. Fig. 1a shows excellent agreement between the predicted spectral density and finite-width empirical simulations. 3 The Stieltjes transform of H(0) 3.1 Main Result If f : R →R is an activation function with zero Gaussian mean and finite Gaussian moments, Z dx √ 2π e−x2 2 f(x) = 0 , Z dx √ 2π e−x2 2 f(x)k < ∞, for k > 1 , (19) then the Stieltjes transform of the limiting spectral density of H(0) is given by the following theorem. Theorem 1. The Stieltjes transform of the spectral density of the Fisher information matrix of a single-hidden-layer neural network with squared loss, activation function f, weight matrices W (1), W (2) ∈Rn×n with iid entries W (l) ij ∼N(0, 1 n), no biases, and iid inputs X ∼N(0, In) is given by the following integral as n →∞: G(z) = Z R Z R λ1 + λ2 −2z 2ζ2(η −ζ)(η′ −ζ) + λ1(z −η + ζ) + λ2(z −η′ + ζ) −z2dµ1(λ1)dµ2(λ2) , (20) where the constants η, η′, and ζ are determined by the nonlinearity, η = Z R f(x)2 e−x2/2 √ 2π dx , η′ = Z R f ′(x)2 e−x2/2 √ 2π dx , ζ = Z R f ′(x)e−x2/2 √ 2π dx !2 , (21) 5 ρ(λ) Nonlinearity x erf1(x) slrelu0(x) fopt(x) 0.10 0.50 1 5 10 0.001 0.010 0.100 1 10 λ (a) Spectra for various nonlinearities ρ(λ) Width 16 32 64 128 ∞ 0.0 0.1 0.2 0.3 0.4 0.5 0 1 2 3 4 λ (b) f(x) = erf1(x) for various widths Figure 2: (a) Theoretical predictions for spectra of various nonlinearities; see eqns. (28) and (30). The linear case is degenerate and more poorly conditioned than the nonlinear cases. (b) Theoretical prediction of spectrum for erf1 compared with empirical simulations. Practical constraints restrict the width to small values, but slow convergence toward the asymptotic prediction can be observed. and the measures dµ1 and dµ2 are given by, dµ1(λ1) = 1 2π s η′ + 3ζ −λ1 λ1 −η′ + ζ 1[η′−ζ,η′+3ζ] , dµ2(λ2) = 1 2π s η + 3ζ −λ2 λ2 −η + ζ 1[η−ζ,η+3ζ] . (22) Remark 1. A straightforward application of Carlson’s algorithm [15] can reduce the integral in eqn. (20) to a combination of three standard elliptic integrals. Remark 2. The spectral density can be recovered from eqn. (20) through the inversion formula, eqn. (6). Remark 3. Although the result in Theorem 1 is written in terms of f ′, it is not necessary that f be differentiable. In fact, the weak derivative can be used in place of the derivative, as the proof of the reduction (see also [13]) to final form uses integration by parts only. Therefore, just the existence of a weak derivative for f suffices. In particular, the result would hold for |x| and Relu functions. The proof of Theorem 1 is quite long and technical, so it’s deferred to the Supplementary Material. The basic idea underlying the proof is very similar to that utilized in [13]. The calculation of the moments is divided into two sub-problems, one of enumerating certain connected outer-planar graphs, and another of evaluating certain high-dimensional integrals that correspond to walks in those graphs. Fig. 1 shows the excellent agreement of the predicted spectrum with empirical simulations of finitewidth networks. Fig. 2 highlights the region of the spectrum for which the asymptotic behavior is slow to set in and suggests that empirical simulations with small networks may not provide an accurate portrayal of the behavior of large networks. Fig. 2a shows the predicted spectra for a variety of nonlinearities. 3.2 Features of the spectrum Owing to eqn. (6), the branch points and poles of G(z) encode information about the delta function peaks, spectral edges, and discontinuities in the derivative of ρ(λ). These special points can be determined directly from the integral representation for G(z) in eqn. (20) by examining the zeros of the denominator of the integrand. In particular, the following six values of z are locations of the poles at the integration endpoints and determine the salient features of the spectral density: z1 = η −ζ , z2 = η + 3ζ , z3 =1 2 η + η′ + 6ζ − p (η′ −η)2 + 64ζ2 , (23) z4 =η′ −ζ , z5 = η′ + 3ζ , z6 =1 2 η + η′ + 6ζ + p (η′ −η)2 + 64ζ2 . (24) In the Supplementary Material, we establish the relative ordering of constants 0 ≤ζ ≤η ≤η′, which implies that the minimum and maximum eigenvalues of H(0) are given by, λmin = z1 , and λmax = z6 . (25) 6 Table 1: Properties of nonlinearities Locations of spectral features η η′ ζ z1 z2 z3 z4 z5 z6 x 1 1 1 0 4 0 0 4 8 erf1(x) 1 1.226 0.914 0.086 3.741 0.198 0.312 3.966 7.51 srelu0(x) 1 1.467 0.733 0.267 3.200 0.491 0.733 3.667 6.377 fopt 1 1.923 0.077 0.923 1.231 1.138 1.846 2.154 2.247 The Supplementary Material also shows that the equality η = ζ only holds for linear networks, which implies that the minimum eigenvalue is nonzero for every nonlinear activation function. There are two delta function peaks in spectrum, which are located at, λ(1) peak = λmin = z1 , and λ(2) peak = z4 . (26) These peaks indicate specific eigenvalues that have nonvanishing probability of occurrence. These peaks coalesce when η = η′, which can only happen for linear activation functions, in which case η = η′ = ζ, so the peaks occur at λ = 0, as illustrated in Fig. 2a. That figure also shows that the spectrum may consist of two disconnected components, in which case z2 is the location of the right edge of the left component. Finally, the derivative of the spectrum is discontinuous at z3 and z5. These predictions can be verified in Fig. 2a by consulting Table 1, which provides numerical values for these special points for the various nonlinearities appearing in the figure. 4 Empirical analysis 4.1 A measure of conditioning Using the results from Section 4.1, the first two moments can be given explicitly as, m1 = lim n→∞ 1 n tr[H(0)] = 1 2(η + η′) m2 = lim n→∞ 1 n tr[H(0)2] = 1 2(η2 + η′2 + 4ζ2) (27) A scale-invariant measure of conditioning of the Fisher is just m2/m2 1, which is lower-bounded by 1, and which quantifies how tightly concentrated the spectrum is around its mean. Ideally, this quantity should be as small as possible to avoid pathological curvature and to enable fast first-order optimization. One advantage of m2/m2 1 compared to other condition numbers such as λmax/λmin or λmax is that it is scale-invariant and well-defined even in the presence of degeneracy in the spectrum. By expanding f in a basis of Hermite polynomials, we show in the Supplementary Material that among the functions with zero Gaussian mean that fopt(x) = 1 √ 13 x + √ 6(x2 −1)  (28) minimizes the ratio m2/m2 1. Note that we have removed the freedom to rescale fopt by a constant by enforcing η = 1. Curiously, a linear activation function actually maximizes the ratio, implying that nonlinearity invariably improves conditioning, at least by this measure. The relative conditioning of spectra resulting from various activation functions can be observed in Fig. 2a. The function fopt(x) grows quickly for large |x| and may be too unstable to use in actual neural networks. Alternative functions could be found by solving the optimization problem, f∗= arg minf m2 m2 1 , (29) subject to some constraints, for example that f be monotone increasing, have zero Gaussian mean, and saturate for large |x|. Such a problem could be solved via variational calculus; see the Supplementary Material. 7 m2 m1 2 0.0 0.5 1.0 1.5 2.0 2.5 1.18 1.20 1.22 1.24 1.26 1.28 -0.0132 -0.0130 -0.0128 -0.0126 -0.0124 -0.0122 α ΔL (a) sreluα m2 m1 2 1.0 1.5 2.0 2.5 3.0 3.5 4.0 1.5 1.6 1.7 1.8 1.9 -0.010 -0.009 -0.008 -0.007 α ΔL (b) erfα Figure 3: Comparison of the conditioning measure m2/m2 1 and single-step loss reduction ∆L (eqn. (33)) as the activation function changes for (a) sreluα and (b) erfα (eqn. (30)). The curves are highly correlated, suggesting the possibility of improved first-order optimization performance by tuning the spectrum of the Fisher through the choice of activation function. 4.2 Efficiency of gradient descent Another way to investigate the ratio m2/m2 1 is to see how well it correlates with the efficiency of first-order optimization. For this purpose, we examine two one-parameter classes of well-behaved activation functions related to ReLU and the error function, sreluα(x) = [x]+ + α[−x]+ −1+α √ 2π q 1 2(1 + α2) − 1 2π(1 + α)2 , erfα(x) = erf(α2x) q 4 π tan−1 √ 1 + 4α4 −1 . (30) Here sreluα is the shifted leaky ReLU function studied in [13]. Both sreluα and erfα have zero Gaussian mean and are normalized such that η = 1 for all α. Changing α does affect η′, ζ and the ratio m2/m2 1, which implies that different functions within these one-parameter families may behave quite differently under gradient descent. We designed a simple and controlled experiment to explore these differences in the context of neural network training. The setup is a modified student-teacher framework, in which the student is initialized with the teacher’s parameters, but the regression targets are perturbed so that student’s parameters are suboptimal. Then we ask by how much can the student decrease the loss by one optimally-chosen step in the gradient direction. Concretely, we define Yi = W (2) t f(W (1) t Xi) + ϵi , i = 1, . . . , M , (31) for teacher weights [W (l) t ]ij ∼N(0, 1 n), Xi ∼N(0, In), and ϵi ∼N(0, ε2In), with width n = 27, number of samples M = 217, and perturbation size ε = 10−3. The loss is defined as, L(Ws) = M X i=1 1 2∥Yi −W (2) s f(W (1) s Xi)∥2 2 . (32) We are interested in the maximal single-step loss decrease when Ws is initialized at Wt, i.e., ∆L = min η  L Wt −η∇L|Wt  −L(Wt)  . (33) For the two classes of activation functions in eqn. (30), we empirically measured ∆L as a function of α. In Fig. 3 we compare the results with our theoretical predictions for m2/m2 1 as a function of α. The agreement is excellent, suggesting that our theory may be able to make practical predictions regarding training efficiency of actual neural networks. 5 Conclusions In this work, we computed the spectrum of the Fisher information matrix of a single-hidden-layer neural network with squared loss and Gaussian weights and Gaussian data in the limit of large network width. Our explicit results indicate that linear networks suffer worse conditioning than 8 nonlinear networks and that although nonlinear networks may have numerous small eigenvalues they are generically non-degenerate. We also showed that by tuning the nonlinearity it is possible to adjust the spectrum in such a way that the efficiency of first-order optimization methods can be improved. By undertaking this analysis, we demonstrated how to extend the techniques developed in [13] for studying random matrices with nonlinear dependencies to the block-structured curvature matrices that are relevant for optimization in deep learning. The techniques presented here pave the way for future work studying deep learning via random matrix theory. References [1] 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. [2] Aaron van den Oord, Sander Dieleman, Heiga Zen, Karen Simonyan, Oriol Vinyals, Alex Graves, Nal Kalchbrenner, Andrew Senior, and Koray Kavukcuoglu. Wavenet: A generative model for raw audio. arXiv preprint arXiv:1609.03499, 2016. [3] 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. [4] 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. [5] Garrett Goh, Nathan Hodas, and Abhinav Vishnu. Deep Learning for Computational Chemistry. arXiv preprint arXiv:1701.04503, 2017. [6] Han Altae-Tran, Bharath Ramsundar, Aneesh S. Pappu, and Vijay Pande. Low Data Drug Discovery with One-Shot Learning. American Chemical Society Central Science, 2017. [7] N. Shazeer, A. Mirhoseini, K. Maziarz, A. Davis, Q. Le, G. Hinton, and J. Dean. Outrageously large neural language models using sparsely gated mixtures of experts. ICLR, 2017. URL http://arxiv.org/abs/1701.06538. [8] Shankar Krishnan, Ying Xiao, and Rif A. Saurous. Neumann optimizer: A practical optimization algorithm for deep neural networks. In International Conference on Learning Representations, 2018. [9] Roger B. Grosse and James Martens. A kronecker-factored approximate fisher matrix for convolution layers. In Proceedings of the 33nd International Conference on Machine Learning, ICML, pages 573–582, 2016. [10] John Duchi, Elad Hazan, and Yoram Singer. Adaptive Subgradient Methods for Online Learning and Stochastic Optimization. Journal of Machine Learning Research, 2011. [11] Diedrik Kingma and Jimmy Ba. Adam: A Method for Stochastic Optimization. arxiv:1412.6980, 2014. [12] S.I.Amari. Natural gradient works efficiently in learning. Neural Computation, 1998. [13] Jeffrey Pennington and Pratik Worah. Nonlinear random matrix theory for deep learning. In Advances in Neural Information Processing Systems, pages 2634–2643, 2017. [14] Tom Heskes. On “natural” learning and pruning in multilayered perceptrons. Neural Computation, 12(4):881–901, 2000. [15] BC Carlson. A table of elliptic integrals of the third kind. Mathematics of computation, 51 (183):267–280, 1988. [16] Mariano Giaquinta and Stefan Hilderbrandt. Calculus of Variations 1. Springer, 1994. 9 [17] Richard Stanley. Polygon Dissections and Standard Young Tableaux. Journal of Combinatorial Theory, Series A, 1996. 10
2018
117
7,272
Parameters as interacting particles: long time convergence and asymptotic error scaling of neural networks Grant M. Rotskoff Courant Institute of Mathematical Sciences New York University rotskoff@cims.nyu.edu Eric Vanden-Eijnden Courant Institute of Mathematical Sciences New York University eve2@cims.nyu.edu Abstract The performance of neural networks on high-dimensional data distributions suggests that it may be possible to parameterize a representation of a given highdimensional function with controllably small errors, potentially outperforming standard interpolation methods. We demonstrate, both theoretically and numerically, that this is indeed the case. We map the parameters of a neural network to a system of particles relaxing with an interaction potential determined by the loss function. We show that in the limit that the number of parameters n is large, the landscape of the mean-squared error becomes convex and the representation error in the function scales as O(n−1). In this limit, we prove a dynamical variant of the universal approximation theorem showing that the optimal representation can be attained by stochastic gradient descent, the algorithm ubiquitously used for parameter optimization in machine learning. In the asymptotic regime, we study the fluctuations around the optimal representation and show that they arise at a scale O(n−1). These fluctuations in the landscape identify the natural scale for the noise in stochastic gradient descent. Our results apply to both single and multi-layer neural networks, as well as standard kernel methods like radial basis functions. 1 Introduction The methods and models of machine learning are rapidly becoming de facto tools for the analysis and interpretation of large data sets. The ability to synthesize and simplify high-dimensional data raises the possibility that neural networks may also find applications as efficient representations of known high-dimensional functions. In fact, these techniques have already been explored in the context of free energy calculations [1], partial differential equations [2, 3], and forcefield parameterization [4]. Yet determining the optimal set of parameters or “training” a given neural network remains one of the central challenges in applications due to the slow dynamics of training [5] and the complexity of the objective function [6, 7]. Parameter optimization in machine learning typically relies on the stochastic gradient descent algorithm (SGD), which makes an empirical estimate of the gradient of the objective function over a small number of sample points [5]. SGD has been analyzed in some cases—for example, when the problem is known to be convex, as in the over-parameterized limit or other idealized settings [8, 9, 10, 11], there are rigorous guarantees of convergence and estimates of convergence rates [12]. While finding the best set of parameters is computationally challenging, we have strong theoretical guarantees that neural networks can represent a large class of functions. The universal approximation theorems [13, 14, 15] ensure the existence of a (possibly large) set of parameters that bring a neural network arbitrarily close to a given function over a compact domain. A similar statement has been 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. proved for radial basis functions [16]. However, the proofs of the universal approximation theorems do not ensure that any particular optimization technique can locate the ideal set of parameters. Parameters as particles—In order to study the properties of stochastic gradient descent for neural network optimization, we recast the standard training procedure in terms of a system of interacting particles [17]. In doing so, we give an exact rewriting of stochastic gradient descent as a stochastic differential equation with multiplicative noise, which has been studied previously [18, 19]. We interpret the limiting behavior of the parameter optimization via a nonlinear Liouville equation for the time evolution of a parameter distribution [20]. This framework provides analytical tools to determine a Law of Large Numbers for the convergence of the optimization and to derive scaling results for the error term as time and the number of parameters grow large. A similar perspective has been adopted concurrently by Mei et al. [21], Chizat and Bach [22], and Sirignano and Spiliopoulos [23], which study the “mean field limit”, similar to our Law of Large Numbers, but not asymptotic fluctuations or error scaling. Convergence and asymptotic dynamics of stochastic gradient descent—We demonstrate that the optimization problem becomes convex in the limit n →∞and we show that both gradient descent and SGD convergence to the global minimum [24, 21]. This argument shows that the universal approximation theorem can be obtained as the limit of a stochastic gradient based optimization procedure under an appropriate choice of hyper-parameters. In the scaling limit, our analysis gives bounds on the error of a representation and characterizes the asymptotic fluctuations in that error. Convergence to the optimum to first order occurs rapidly, i.e. on O(1) timescales. Diminishing the error at next order requires quenching the noise in the dynamics on O(log n) time scales. Implications of noise in descent dynamics—Our results give an explicit theoretical explanation for the observation that additional noise in can lead to better generalization for neural networks [25, 26]; local minima of depth O(n−1) are washed out by the noise of SGD. Numerical experiments—We verify the scaling predicted by our asymptotic arguments for single layer neural networks. Because it is impossible to determine the exact interaction potential in general, we carry out numerical experiments using stochastic gradient descent for ReLU neural networks. We use the p-spin energy function [27, 28] as the target function due to its complexity as the dimension grows large. Key assumptions—In order to derive the stochastic partial differential equation for SGD, we effectively assume the large data limit. Because we are focusing on function approximation we can always generate new training data by sampling random points in the domain of the function and evaluating the target function at those points. The partial differential equation for gradient descent represents the evolution of the parameters on the true loss landscape, i.e., the large data limit. In this limit, the dynamics is similar to online algorithms for stochastic gradient descent [5]. 2 Parameters as particles Given a function f : Ω→R defined on a compact set Ω⊂Rd, consider its approximation by fn(x) = 1 n n X i=1 ciϕ(x, yi) (1) where n ∈N, ϕ : Ω× D →R is some kernel and (ci, yi) ∈R × D with D ⊂RN. The ci and yi are parameters to be learned for i = 1, . . . , n. We place the following assumption on the kernel: for any test function h, ∀y ∈D : Z Ω h(x)ϕ(x, y)dµ(x) = 0 ⇒ h(x) = 0, ∀x ∈Ω, (2) where µ is some positive measure on Ω(for example the Lebesgue measure, dµ(x) = dx). This condition is satisfied for nonlinearities typically encountered in machine learning; a neural network with any number of layers using a positive nonlinear activation function (e.g., ReLU, sigmoid) will clearly satisfy this property if the linear coefficients are non-zero. The property above is similar to the discriminatory kernel condition in Cybenko [13]. Our results apply to radial basis functions, single layer neural networks, and multilayer neural networks in which the final layer is scaled with n. In particular, the statements we make require a “wide” final layer but are still applicable to networks with multiple layers. 2 By “training” the representation, we mean that we seek to optimize the parameters so as to minimize the mean-squared error loss function, ℓ(f, fn) = 1 2 Z Ω |f(x) −fn(x)|2 dµ(x). (3) In this case we have chosen to employ the mean-squared error and we can view ℓ(f, fn) as an “energy” function for the parameters {(ci, yi)}n i=1, E(c1, y1, . . . , cn, yn) := n (ℓ(f, fn) −Cf) = n X i=1 ciF(yi) + 1 2n n X i,j=1 cicjK(yi, yj) (4) where Cf = 1 2 R Ω|f(x)|2 dµ(x) is a constant unaffected by the optimization and we have defined F(y) = Z Ω f(x)ϕ(x, y)dµ(x) K(y, z) = Z Ω ϕ(x, y)ϕ(x, z)dµ(x). (5) Directly optimizing the coefficients to minimize the loss function ℓis challenging in general because we do not have any guarantee of convexity. However, these difficulties can be conceptually alleviated by instead writing the objective function in terms of a weighted distribution Gn : D →R, Gn(y) = 1 n n X i=1 ciδ(y −yi) (6) which converges weakly to some G(y) as n →∞, a fact which we describe in detail below. Convolution with this weighted distribution provides a convenient expression for the function representation fn(x) = Z D 1 n n X i=1 ciϕ(x, y)δ(y −yi)dy ≡ϕ ⋆Gn. (7) Interestingly, in the limit that n →∞the objective function for the optimization becomes convex in terms of the signed distribution, ℓ(f, ϕ ⋆G) = 1 2 Z Ω |f(x) −(ϕ ⋆G)(x)|2 dµ(x). (8) meaning that a unique minimum value of the loss function can be attained for a not necessarily unique minimizer G∗for which ℓ(f, ϕ ⋆G∗) = 0. This observation formalizes the statements made by Bengio et al. in Ref. [24]. While the objective function is convex, it is by no means trivial to optimize the weighted distribution. Writing the loss function in this language gives us a perspective that can be exploited to derive the scaling of the error in arbitrary neural networks trained with stochastic gradient descent. 3 Gradient descent We first discuss the case of gradient descent for which we provide derivations of a law of large numbers (LLN) and central limit theorem (CLT) for the optimization dynamics. These statements reveal the scaling in the representation error and the analysis has synergies which are useful in deriving LLN and CLT for stochastic gradient descent. Detailed arguments for the propositions stated here are provided in the supplementary material. The gradient descent dynamics is given by coupled ordinary differential equations for the weight and the parameters of the kernel,              ˙Y i = Ci∇F(Yi) −1 n n X j=1 CiCj∇K(Y i, Yj), ˙Ci = F(Yi) −1 n n X j=1 CjK(Yi, Yj) (9) 3 with initial conditions sampled independently from a probability distribution ρin(y, c) with full support in the domain D × R. We analyze the evolution of the parameters by studying the “particle” distribution ρn(t, y, c) = 1 n n X i=1 δ(c −Ci(t))δ(y −Y i(t)) (10) the first moment of which is the weighted distribution (6), Gn(t, y) = Z cρn(t, y, c)dc = 1 n n X i=1 Ci(t)δ(y −Y i(t)). (11) We can express the function representation in terms of the distribution as fn(t, x) = R ϕ(x, y)Gn(t, y)dy. Taking the limit n →∞, we see that the zeroth order term of the distribution has smooth initial data ρ0(0) = ρin by the Law of Large Numbers. In Sec S1.1 we derive a nonlinear partial differential equation satisfied by ρ0, essentially by applying the chain rule: ∂tρ0 = ∇· (c∇U([ρ0], y)ρ0) + ∂c (U([ρ0], y)ρ0) , (12) where U([ρ], y) = −F(y) + Z D×R c′K(y, y′)ρ(y′, c′)dy′dc′ (13) The PDE (12) is gradient descent in Wasserstein metric on a convex energy functional of the density (cf. Sec. S1.2.1); we refer to this type of equation as a nonlinear Liouville equation. 3.1 Law of large numbers The limiting equation (12) is a well-posed and deterministic nonlinear partial integro-differential equation. We can express it in terms of the target function f(x) by denoting f0(t, x) = Z D×R cϕ(x, y)ρ0(t, y, c)dydc (14) and we see that ∂tf0(t, x) = − Z Ω M([ρ0(t)], x, x′) (f0(t, x) −f(x)) dµ(x′) (15) where the symmetric kernel function M is given by M([ρ], x, x′) = Z D×R c2∇yϕ(x, y) · ∇yϕ(x′, y) + ϕ(x, y)ϕ(x′, y)  ρ(y, c) dydc. (16) This kernel is positive definite and symmetric implying that the only stable fixed point is f0 = f if ρ0(t = 0) = ρin > 0, as discussed in Sec S1.2. Fixed points of the gradient flow that are not energy minimizers exist, but they are not dynamically accessible from the initial density that we use (cf. [22] and Sec S1.2). Proposition 3.1 (LLN for gradient descent) Let fn(t) = fn(t, x) = Pn i=1 Ci(t)ϕ(x, Yi(t)) where {Yi(t), Ci(t)}n i=1 are the solution of (9) for the initial condition where each pair (Y i(0), Ci(0)) is sampled independently from ρin > 0. Then lim n→∞fn(t) = f0(t) Pin-almost surely (17) where f0(t) solves (15) and satisfies lim t→∞f0(t) = f a.e. in Ω. (18) In addition, the limits in n and t commute, i.e. we also have limn→∞limt→∞fn(t) = f. A detailed derivation of the LLN for gradient descent can be found in Sec. S1.2. The LLN should be understood as a guarantee that gradient descent reaches the optimal representation for initial conditions sampled iid from a smooth distribution with full support on D × R. 4 3.2 Central Limit Theorem and asymptotic fluctuations and error To study the fluctuations around the optimal representation we look at the discrepancy between fn(t, x) and f0(t, x). These fluctuations are on the scale O(n−1/2) initially and diminish as the optimization progresses to reach scale O(n−1) or below, as summarized in the next two propositions. Proposition 3.2 (CLT for GD) Let fn(t) be as in Proposition 3.1. Then for any t < ∞as n →∞, we have lim n→∞n−1/2 (fn(t) −f0(t)) = f1/2(t) in distribution (19) where f0(t) solves (15) and f1/2(t) is a Gaussian process with mean zero and some given covariance that satisfies f1/2(t) →0 almost surely as t →∞. This result is derived in Sec. S2, where the covariance of f1/2(t) is also given (S46). Since f1/2(t) converges to zero as t →∞, it is useful to quantify the scale at which the fluctuations settle on long time scales: Proposition 3.3 (Asymptotic error for GD) Under the same conditions as those in Proposition 3.2, on any sequence an > 0 such that an/ log n →∞as n →∞, we have lim n→∞n−ξ (fn(an) −f) = 0 almost surely for any ξ < 1 (20) This proposition characterizes the asymptotic error of the neural network, showing that it goes as fn = f + Cn−1 for some constant C ≥0. This scaling is more favorable than might be expected from the initial condition because the order of the error “heals” from 1/2 to 1 in the long time limit. That is, the error from the initial, non-optimal parameter selection decays during the optimization dynamics, becoming much more favorable at late times. 4 Stochastic gradient descent We cannot typically evaluate the integrals required to compute F(y) and K(y, y′). Instead, at each time step we estimate these functions using a small set of sample points {xi}P i=1 which we refer to as a batch of size P. Consequently, we introduce noise by sampling random data to make imperfect estimates of the gradient of the objective function. To estimate the gradient of the loss we use an unbiased estimator which is simply the sample mean over a collection or “batch” of P points EP (z) = n 2P P X i=1 |fn(xi, z) −f(xi)|2 (21) where, for simplicity, we write the parameters as a single vector z = (c1, y1, . . . cn, yn) ∈(D × R)n. Note that we have scaled the loss function by n so that ∇EP is O(1) because our function representation is scaled by n−1. The evolution equation of the corresponding dynamical variable Z(t) is Z(t + ∆t) = Z(t) −∆t∇EP (Z(t)). (22) The dynamics can be analyzed as a stochastic differential equation with a multiplicative noise term arising from the approximate evaluation of the gradient of the loss function. To derive this dynamical equation, we first need the covariance which we can write explicitly: n2 Z Ω (fn −f)2 ∇fn ⊗∇fndµ −n2∇ℓ(f, fn) ⊗∇ℓ(f, fn) ≡1 P R(z). (23) where fn = fn(x, z) and f = f(x). The discretized dynamics (22) is statistically equivalent to the stochastic differential equation dZ = −∇zE(Z)dt + √ θdB(t, Z) (24) where E(z) is the energy (4) based on the exact loss, θ = ∆t/P, and the quadratic variation of the noise is ⟨dB(t, z), dB(t, z)⟩= R(z)dt. The SDE (24) is not Langevin dynamics in the classical sense because the noise has spatiotemporal correlations. In our case, because new data is sampled at 5 every time step, there are no temporal correlations, which are a consequence of revisiting samples in a training set. Written in terms of F and K, the parameters satisfy a collection of coupled SDEs that we can use to study the evolution of ρn,              dY i = Ci(t)∇F(Yi(t))∆t −1 n n X j=1 Ci(t)Cj(t)∇K(Y i(t), Yj(t))∆t + dBi, dCi = F(Yi(t))∆t −1 n n X j=1 Cj(t)K(Y i(t), Y j(t))∆t + dB′ i (25) where ∆t > 0 is the time step. The time evolution of the parameter distribution can be derived by using the Itô formula, which in turn gives rise to a stochastic partial differential equation for the time-evolution of ρn(t, c, y). This SPDE is ∂tρn = ∇· (c∇U([ρn], y)ρn) + ∂c (U([ρn], y)ρn) + θD[ρn, y, y] + √ θ (η(t, y) + η(t, c)) , (26) where D is a diffusive term given explicitly in Sec. S4.1 and which we do not reproduce here because it does not contribute in the subsequent scaling. This equation can be viewed as an extension of Dean’s equation [20] to a setting with multiplicative noise. The noise terms η and η (defined in Eq. S69) have a quadratic variation that diminishes as fn becomes close to f. 4.1 Law of large numbers At first, it may appear that we could choose an arbitrary expansion in powers of n−α for some α > 0. However, as explained in Sec. S5, the expansion of ρnρ′ n contains terms of order n−1, which constrains the choice of α. To perform an expansion, we take θ ∝n−2α so that, in the limit n →∞, ρ0 satisfies the same deterministic equation as in the case of gradient descent. This means that an analogous statement to Proposition 3.1 holds: Proposition 4.1 (LLN for SGD) Let fn(t) = fn(t, x) = Pn i=1 Ci(t)ϕ(x, Yi(t)) with {Yi(t), Ci(t)}n i=1 solution to (24) with θ = an−2α, a > 0 α ∈(0, 1] and initial condition where each pair (Y i(0), Ci(0)) is sampled independently from ρin > 0. Then lim n→∞fn(t) = f0(t) (27) almost surely, where f0(t) solves (15). Furthermore, lim t→∞f0(t) = f a.e. in Ω. (28) In addition the limits commute, i.e. limn→∞limt→∞fn(t) = f. The Law of Large Numbers implies the universal approximation theorem, but notable additional information has emerged from our analysis. First, we emphasize that here we have obtained the representation as the limit of a stochastic gradient descent optimization procedure. Secondly, the PDE describing the time evolution of f0 is independent of n, meaning the rate of convergence in time of fn does not depend on the number of parameters to leading order. 4.2 Asymptotic fluctuations and error A remarkable feature of stochastic gradient descent is that the scale of fluctuations is controlled by the accuracy of the representation. Roughly, the closer fn is to f, the smaller the discrepancy in their gradients meaning that the variance of the noise term is also small. We make use of this property to assess the asymptotic error for stochastic gradient descent: Proposition 4.2 (Asymptotic error for SGD) Let fn(t) = fn(t, x) be as in Proposition 4.1. Then for any an > 0 such that an/ log n →∞as n →∞, we have lim n→∞nα (fn(an) −f) = 0 almost surely. (29) 6 The discrepancy converges to zero almost surely with respect to the initial data as well as the statistics of the noise terms in (24). In terms of the loss function, we have ℓ(f, fn(an)) = 1 2∥f −f0(an)∥2 −n−α ⟨f −f0(an), fα(an)⟩+ 1 2n−2α∥fα(an)∥2 +o(n−α) (30) so that the following proposition holds: Proposition 4.3 Under the same conditions as those in Proposition 4.2, the loss function satisfies lim n→∞nαℓ(f, fn(an)) = 0 almost surely. (31) This means that the error at order n−1 can be quenched by increasing the batch size or decreasing the time step as a function of the optimization time, e.g., setting α = 1 by taking a batch of size n2. 5 Numerical experiments To test our results, we will use a function known for its complex features in high-dimensions: the spherical 3-spin model, which is a map from the d −1 sphere of radius √ d to the reals f : Sd−1( √ d) →R, given by f(x) = 1 d d X p,q,r=1 ap,q,rxpxqxr, x ∈Sd−1( √ d) ⊂Rd (32) where the coefficients {ap,q,r}d p,q,r=1 are independent Gaussian random variables with mean zero and variance one. The function (32) is known to have a number of critical points that grows exponentially with the dimensionality d [27, 6, 28]. We note that previous works have sought to draw a parallel between the glassy 3-spin function and generic loss functions [7], but we are not exploring such an analogy here. Rather, we simply use the function (32) as a difficult target for approximation by neural networks. That is, throughout this section, we train networks to learn f with a particular realization of ap,q,r and study the accuracy of that representation as a function of the number of particles n. In Fig. 1 we show the representation error by computing the loss as well as the discrepancy between the target function and the neural network representation averaged over points at which the function is positive (or negative), i.e., 1/P PP i=1 (fn(xi) −f(xi)) Θ(f(xi)) where Θ is the Heaviside function. Single layer sigmoid / ReLU neural network We consider the case that the nonlinear function h(x) is max(0, x), the restricted linear unit or ReLU activation function frequently used in large scale applications of machine learning. In these experiments, we test the scaling in d = 50, prohibitively high dimensional for any grid based method. We trained the networks with batch size P = 50 using stochastic gradient descent with n = i × 104 for i = 1, . . . , 6. For the two smallest networks, we ran for 2 × 106 time steps with ∆t = 10−3 and then quenched with P = 2500 for 2 × 105 steps. For the largest networks, we used ∆t = 5 × 10−4 to ensure stability and therefore doubled the number of steps so that the total training time remained fixed. Scaling data for the loss and the signed discrepancy are shown in Fig. 1. We also looked at sigmoid nonlinearities in d = 10, 25. These networks were trained as above but with P = ⌊n/5⌋with a quench of P 2. 6 Conclusions and outlook We have introduced a perspective based on particle distribution functions that enables asymptotic analysis of the optimization dynamics of neural networks. We have focused on the limit where the number of parameters n →∞, in which the objective function becomes convex and a stochastic partial differential equation describes the time evolution of the parameters. Our results emphasize that the optimal parameters in this limit are accessible via stochastic gradient descent (Proposition 4.1) and that fluctuations around the optimum can be controlled by modulating the batch size (Proposition 4.2). Surprisingly, the dynamical evolution does not depend on n, suggesting that the rate of convergence should be asymptotically independent of the number of parameters. Our results do not address many features of neural network parameterization that merit further study exploiting the mathematical tools that have been developed for particle systems. In particular, the statements we have derived are insensitive to the details of network architecture, which is among the 7 102 103 10−2 10−1 ℓP(f, fn) (d = 10) 102 103 10−4 10−3 10−2 ⟨(f −fn) Θ(f)⟩ 102 103 10−3 10−2 ⟨(fn −f) Θ(−f)⟩ 102 103 100 101 ℓP(f, fn) (d = 25) 102 103 10−3 10−2 10−1 100 ⟨(f −fn) Θ(f)⟩ 102 103 10−2 10−1 100 ⟨(fn −f) Θ(−f)⟩ 104 2 × 104 3 × 1044 × 104 n 3 × 10−1 4 × 10−1 6 × 10−1 ℓP(f, fn) (d = 50) ReLU Figure 1: Large ReLU networks in high dimension (d = 50), and sigmoid neural networks in intermediate dimensions (bottom two rows). In all cases, we see linear scaling of the empirical loss averaged with P = 106. For the sigmoid neural networks, we also plot a measure of the discrepancy between the functions, which also scales as O(n−1). In each plot, the error scaling as a function of the width of the network is plotted for 10 distinct random realizations of the function defined in (32) with different colored stars for each realization. most important considerations when designing or using a neural network. It would also be beneficial to explore the ways in which regularizing processes, drop-out, for example, affect the convergence of the PDE. Developing a rigorous understanding of which kernels and which architectures are optimal for different types of target functions remains a compelling goal that appears within reach using the tools outlined here. 8 Acknowledgments We would like to thank Andrea Montanari and Matthieu Wyart for useful discussions regarding the fixed points of gradient flows in the Wasserstein metric. GMR was supported by the James S. McDonnell Foundation. EVE was supported by National Science Foundation (NSF) Materials Research Science and Engineering Center Program Award DMR-1420073; and by NSF Award DMS-1522767. References [1] Elia Schneider, Luke Dai, Robert Q Topper, Christof Drechsel-Grau, and Mark E Tuckerman. Stochastic Neural Network Approach for Learning High-Dimensional Free Energy Surfaces. Physical Review Letters, 119(15):150601, October 2017. [2] Yuehaw Khoo, Jianfeng Lu, and Lexing Ying. Solving for high dimensional committor functions using artificial neural networks. arXiv:1802.10275, February 2018. [3] Jens Berg and Kaj Nyström. A unified deep artificial neural network approach to partial differential equations in complex geometries. arXiv:1711.06464, November 2017. [4] Jörg Behler and Michele Parrinello. Generalized Neural-Network Representation of HighDimensional Potential-Energy Surfaces. Physical Review Letters, 98(14):583, April 2007. [5] Léon Bottou and Yann L. Cun. Large Scale Online Learning. In S. Thrun, L. K. Saul, and B. Schölkopf, editors, Advances in Neural Information Processing Systems 16, pages 217–224. MIT Press, 2004. [6] Levent Sagun, V Ugur Guney, Gérard Ben Arous, and Yann LeCun. Explorations on high dimensional landscapes. arXiv:1412.6615, December 2014. [7] Anna Choromanska, Mikael Henaff, Michael Mathieu, Gérard Ben Arous, and Yann LeCun. The Loss Surfaces of Multilayer Networks. arXiv:1412.0233, November 2014. [8] C Daniel Freeman and Joan Bruna. Topology and Geometry of Half-Rectified Network Optimization. arXiv:1611.01540, November 2016. [9] Luca Venturi, Afonso S Bandeira, and Joan Bruna. Neural Networks with Finite Intrinsic Dimension have no Spurious Valleys. arXiv:1802.06384, February 2018. [10] Daniel Soudry and Yair Carmon. No bad local minima: Data independent training error guarantees for multilayer neural networks. arXiv:1605.08361, May 2016. [11] K Fukumizu and S Amari. Local minima and plateaus in hierarchical structures of multilayer perceptrons. Neural Networks, 13(3):317–327, 2000. [12] Léon Bottou, Frank E Curtis, and Jorge Nocedal. Optimization Methods for Large-Scale Machine Learning. arXiv:1606.04838, June 2016. [13] G Cybenko. Approximation by superpositions of a sigmoidal function. Mathematics of Control, Signals and Systems, 2(4):303–314, December 1989. [14] A R Barron. Universal approximation bounds for superpositions of a sigmoidal function. IEEE Transactions on Information Theory, 39(3):930–945, May 1993. [15] Francis Bach. Breaking the Curse of Dimensionality with Convex Neural Networks. Journal of Machine Learning Research, 18(19):1–53, 2017. [16] J Park and I W Sandberg. Universal Approximation Using Radial-Basis-Function Networks. Neural Computation, 3(2):246–257, June 1991. [17] Sylvia Serfaty. Systems of Points with Coulomb Interactions. arXiv:1712.04095, December 2017. 9 [18] Wenqing Hu, Chris Junchi Li, Lei Li, and Jian-Guo Liu. On the diffusion approximation of nonconvex stochastic gradient descent. arXiv:1705.07562, May 2017. [19] Qianxiao Li, Cheng Tai, and Weinan E. Stochastic modified equations and adaptive stochastic gradient algorithms. In Doina Precup and Yee Whye Teh, editors, Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pages 2101–2110, International Convention Centre, Sydney, Australia, 06–11 Aug 2017. PMLR. [20] David S Dean. Langevin equation for the density of a system of interacting Langevin processes. Journal of Physics A: Mathematical and Theoretical, 29(24):L613–L617, January 1999. [21] Song Mei, Andrea Montanari, and Phan-Minh Nguyen. A mean field view of the landscape of two-layer neural networks. Proceedings of the National Academy of Sciences, 115(33):E7665– E7671, August 2018. [22] Lénaïc Chizat and Francis Bach. On the Global Convergence of Gradient Descent for Overparameterized Models using Optimal Transport. arXiv:1805.09545, May 2018. [23] Justin Sirignano and Konstantinos Spiliopoulos. Mean Field Analysis of Neural Networks. arXiv:1805.01053, May 2018. [24] Yoshua Bengio, Nicolas L. Roux, Pascal Vincent, Olivier Delalleau, and Patrice Marcotte. Convex neural networks. In Y. Weiss, B. Schölkopf, and J. C. Platt, editors, Advances in Neural Information Processing Systems 18, pages 123–130. MIT Press, 2006. [25] Nitish Shirish Keskar, Dheevatsa Mudigere, Jorge Nocedal, Mikhail Smelyanskiy, and Ping Tak Peter Tang. On Large-Batch Training for Deep Learning: Generalization Gap and Sharp Minima. arXiv:1609.04836, September 2016. [26] Elad Hoffer, Itay Hubara, and Daniel Soudry. Train longer, generalize better: closing the generalization gap in large batch training of neural networks. arXiv:1705.08741, May 2017. [27] Antonio Auffinger and Gérard Ben Arous. Complexity of random smooth functions on the high-dimensional sphere. The Annals of Probability, 41(6):4214–4247, November 2013. [28] Antonio Auffinger, Gérard Ben Arous, and Jiˇrí ˇCerný. Random Matrices and Complexity of Spin Glasses. Communications on Pure and Applied Mathematics, 66(2):165–201, 2012. 10
2018
118
7,273
Uplift Modeling from Separate Labels Ikko Yamane1,2 Florian Yger3,2 Jamal Atif3 Masashi Sugiyama2,1 1 The University of Tokyo, CHIBA, JAPAN 2 RIKEN Center for Advanced Intelligence Project (AIP), TOKYO, JAPAN 3 LAMSADE, CNRS, Université Paris-Dauphine, Université PSL, PARIS, FRANCE {yamane@ms., sugi@}k.u-tokyo.ac.jp, {florian.yger@, jamal.atif@}dauphine.fr Abstract Uplift modeling is aimed at estimating the incremental impact of an action on an individual’s behavior, which is useful in various application domains such as targeted marketing (advertisement campaigns) and personalized medicine (medical treatments). Conventional methods of uplift modeling require every instance to be jointly equipped with two types of labels: the taken action and its outcome. However, obtaining two labels for each instance at the same time is difficult or expensive in many real-world problems. In this paper, we propose a novel method of uplift modeling that is applicable to a more practical setting where only one type of labels is available for each instance. We show a mean squared error bound for the proposed estimator and demonstrate its effectiveness through experiments. 1 Introduction In many real-world problems, a central objective is to optimally choose a right action to maximize the profit of interest. For example, in marketing, an advertising campaign is designed to promote people to purchase a product [29]. A marketer can choose whether to deliver an advertisement to each individual or not, and the outcome is the number of purchases of the product. Another example is personalized medicine, where a treatment is chosen depending on each patient to maximize the medical effect and minimize the risk of adverse events or harmful side effects [1, 13]. In this case, giving or not giving a medical treatment to each individual are the possible actions to choose, and the outcome is the rate of recovery or survival from the disease. Hereafter, we use the word treatment for taking an action, following the personalized medicine example. A/B testing [14] is a standard method for such tasks, where two groups of people, A and B, are randomly chosen. The outcomes are measured separately from the two groups after treating all the members of Group A but none of Group B. By comparing the outcomes between the two groups by a statistical test, one can examine whether the treatment positively or negatively affected the outcome. However, A/B testing only compares the two extreme options: treating everyone or no one. These two options can be both far from optimal when the treatment has positive effect on some individuals but negative effect on others. To overcome the drawback of A/B testing, uplift modeling has been investigated recently [11, 28, 32]. Uplift modeling is the problem of estimating the individual uplift, the incremental profit brought by the treatment conditioned on features of each individual. Uplift modeling enables us to design a refined decision rule for optimally determining whether to treat each individual or not, depending on his/her features. Such a treatment rule allows us to only target those who positively respond to the treatment and avoid treating negative responders. In the standard uplift modeling setup, there are two types of labels [11, 28, 32]: One is whether the treatment has been given to the individual and the other is its outcome. Existing uplift modeling methods require each individual to be jointly given these two labels for analyzing the association 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. between outcomes and the treatment [11, 28, 32]. However, joint labels are expensive or hard (or even impossible) to obtain in many real-world problems. For example, when distributing an advertisement by email, we can easily record to whom the advertisement has been sent. However, for technical or privacy reasons, it is difficult to keep track of those people until we observe the outcomes on whether they buy the product or not. Alternatively, we can easily obtain information about purchasers of the product at the moment when the purchases are actually made. However, we cannot know whether those who are buying the product have been exposed to the advertisement or not. Thus, every individual always has one missing label. We term such samples separately labeled samples. In this paper, we consider a more practical uplift modeling setup where no jointly labeled samples are available, but only separately labeled samples are given. Theoretically, we first show that the individual uplift is identifiable when we have two sets of separately labeled samples collected under different treatment policies. We then propose a novel method that directly estimates the individual uplift only from separately labeled samples. Finally, we demonstrate the effectiveness of the proposed method through experiments. 2 Problem Setting This paper focuses on estimation of the individual uplift u(x), often called individual treatment effect (ITE) in the causal inference literature [31], defined as u(x) := E[Y1 | x] −E[Y−1 | x], where E[ · | · ] denotes the conditional expectation, and x is a X-valued random variable (X ⊆Rd) representing features of an individual, and Y1, Y−1 are Y-valued potential outcome variables [31] (Y ⊆R) representing outcomes that would be observed if the individual was treated and not treated, respectively. Note that only one of either Y1 or Y−1 can be observed for each individual. We denote the {1, −1}-valued random variable of the treatment assignment by t, where t = 1 means that the individual has been treated and t = −1 not treated. We refer to the population for which we want to evaluate u(x) as the test population, and denote the density of the test population by p(Y1, Y−1, x, t). We assume that t is unconfounded with either of Y1 and Y−1 conditioned on x, i.e. p(Y1 | x, t) = p(Y1 | x) and p(Y−1 | x, t) = p(Y−1 | x). Unconfoundedness is an assumption commonly made in observational studies [5, 33]. For notational convenience, we denote by y := Yt the outcome of the treatment assignment t. Furthermore, we refer to any conditional density of t given x as a treatment policy. In addition to the test population, we suppose that there are two training populations k = 1, 2, whose joint probability density pk(Y1, Y−1, x, t) satisfy pk(Yt0 = y0 | x = x0) = p(Yt0 = y0 | x = x0) (for k = 1, 2), (1) p1(t = t0 | x = x0) ̸= p2(t = t0 | x = x0), (2) for all possible realizations x0 ∈X, t0 ∈{−1, 1}, and y0 ∈Y. Intuitively, Eq. (1) means that potential outcomes depend on x in the same way as those in the test population, and Eq. (2) states that those two policies give a treatment with different probabilities for every x = x0. We suppose that the following four training data sets, which we call separately labeled samples, are given: {(x(k) i , y(k) i )}nk i=1 i.i.d. ∼pk(x, y), {(ex(k) i , t(k) i )}enk i=1 i.i.d. ∼pk(x, t) (for k = 1, 2), where nk and enk, k = 1, 2, are positive integers. Under Assumptions (1), (2), and the unconfoundedness, we have pk(Yt | x, t = t0) = p(Yt0 | x, t = t0) = p(Yt0 | x) for t0 ∈{−1, 1} and k ∈{1, 2}. Note that we can safely denote p(y | x, t) := pk(y | x, t). Moreover, we have E[Yt0 | x] = E[y | x, t = t0] for t0 = 1, −1, and thus our goal boils down to the estimation of u(x) = E[y | x, t = 1] −E[y | x, t = −1] (3) from the separately labeled samples, where the conditional expectation is taken over p(y | x, t). Estimation of the individual uplift is important for the following reasons. It enables the estimation of the average uplift. The average uplift U(π) of the treatment policy π(t | x) is the average outcome of π, subtracted by that of the policy π−, which constantly assigns 2 the treatment as t = −1, i.e., π−(t = τ | x) := 1[τ = −1], where 1[·] denotes the indicator function: U(π) := ZZ X t=−1,1 yp(y | x, t)π(t | x)p(x)dydx − ZZ X t=−1,1 yp(y | x, t)π−(t | x)p(x)dydx = Z u(x)π(t = 1 | x)p(x)dx. (4) This quantity can be estimated from samples of x once we obtain an estimate of u(x). It provides the optimal treatment policy. The treatment policy given by π(t = 1 | x) = 1[0 ≤ u(x)] is the optimal treatment that maximizes the average uplift U(π) and equivalently the average outcome RR P t=−1,1 yp(y | x, t)π(t | x)p(x)dydx (see Eq. (4)) [32]. It is the optimal ranking scoring function. From a practical viewpoint, it may be useful to prioritize individuals to be treated according to some ranking scores especially when the treatment is costly and only a limited number of individuals can be treated due to some budget constraint. In fact, u(x) serves as the optimal ranking scores for this purpose [36]. More specifically, we define a family of treatment policies {πf,α}α∈R associated with scoring function f by πf,α(t = 1 | x) = 1[α ≤f(x)]. Then, under some technical condition, f = u maximizes the area under the uplift curve (AUUC) defined as AUUC(f) := Z 1 0 U(πf,α)dCα = Z 1 0 Z u(x)1[α ≤f(x)]p(x)dxdCα = E[1[f(x) ≤f(x′)]u(x′)], where Cα := Pr[f(x) < α], x, x′ i.i.d. ∼p(x), and E denotes the expectation with respect to these variables. AUUC is a standard performance measure for uplift modeling methods [11, 25, 28, 32]. For more details, see Appendix B in the supplementary material. Remark on the problem setting: Uplift modeling is often referred to as individual treatment effect estimation or heterogeneous treatment effect estimation and has been extensively studied especially in the causal inference literature [5, 7, 9, 12, 16, 24, 31, 37]. In particular, recent research has investigated the problem under the setting of observational studies, inference using data obtained from uncontrolled experiments because of its practical importance [33]. Here, experiments are said to be uncontrolled when some of treatment variables are not controlled to have designed values. Given that treatment policies are unknown, our problem setting is also of observational studies but poses an additional challenge that stems from missing labels. What makes our problem feasible is that we have two kinds of data sets following different treatment policies. It is also important to note that our setting generalizes the standard setting for observational studies since the former is reduced to the latter when one of the treatment policies always assigns individuals to the treatment group, and the other to the control group. Our problem is also closely related to individual treatment effect estimation via instrumental variables [2, 6, 10, 19].1 3 Naive Estimators A naive approach is first estimating the conditional density pk(y | x) and pk(t | x) from training samples by some conditional density estimator [4, 34], and then solving the following linear system for p(y | x, t = 1) and p(y | x, t = −1): pk(y | x) | {z } Estimated from {(x(k) i , y(k) i )}n i=1 = X t=−1,1 p(y | x, t) pk(t | x) | {z } Estimated from {(ex(k) i , t(k) i )}en i=1 (for k = 1, 2). (5) 1Among the related papers mentioned above, the most relevant one is Lewis and Syrgkanis [19], which is concurrent work with ours. 3 After that, the conditional expectations of y over p(y | x, t = 1) and p(y | x, t = −1) are calculated by numerical integration, and finally their difference is calculated to obtain another estimate of u(x). However, this may not yield a good estimate due to the difficulty of conditional density estimation and the instability of numerical integration. This issue may be alleviated by working on the following linear system implied by Eq. (5) instead: Ek[y | x] = P t=−1,1 E[y | x, t]pk(t | x), k = 1, 2, where Ek[y | x] and pk(t | x) can be estimated from our samples. Solving this new system for E[y | x, t = 1] and E[y | x, t = −1] and taking their difference gives an estimate of u(x). A method called two-stage least-squares for instrumental variable regression takes such an approach [10]. The second approach of estimation Ek[y|x] and pk(t|x) avoids both conditional density estimation and numerical integration, but it still involves post processing of solving the linear system and subtraction, being a potential cause of performance deterioration. 4 Proposed Method In this section, we develop a method that can overcome the aforementioned problems by directly estimating the individual uplift. 4.1 Direct Least-Square Estimation of the Individual Uplift First, we will show an important lemma that directly relates the marginal distributions of separately labeled samples to the individual uplift u(x). Lemma 1. For every x such that p1(x) ̸= p2(x), u(x) can be expressed as u(x) = 2 × Ey∼p1(y|x)[y] −Ey∼p2(y|x)[y] Et∼p1(t|x)[t] −Et∼p2(t|x)[t] . (6) For a proof, refer to Appendix C in the supplementary material. Using Eq. (6), we can re-interpret the naive methods described in Section 3 as estimating the conditional expectations on the right-hand side by separately performing regression on {(x(1) i , y(1) i )}n1 i=1, {(x(2) i , y(2) i )}n2 i=1, {(ex(1) i , t(1) i )}en1 i=1, and {(ex(2) i , t(2) i )}en2 i=1. This approach may result in unreliable performance when the denominator is close to zero, i.e., p1(t | x) ≃p2(t | x). Lemma 1 can be simplified by introducing auxiliary variables z and w, which are Z-valued and {−1, 1}-valued random variables whose conditional probability density and mass are defined by p(z = z0 | x) = 1 2p1(y = z0 | x) + 1 2p2(y = −z0 | x), p(w = w0 | x) = 1 2p1(t = w0 | x) + 1 2p2(t = −w0 | x), for any z0 ∈Z and any w0 ∈{−1, 1}, where Z := {s0y0 | y0 ∈Y, s0 ∈{1, −1}}. Lemma 2. For every x such that p1(x) ̸= p2(x), u(x) can be expressed as u(x) = 2 × E[z | x] E[w | x], where E[z | x] and E[w | x] are the conditional expectations of z given x over p(z | x) and w given x over p(w | x), respectively. A proof can be found in Appendix D in the supplementary material. Let w(k) i := (−1)k−1t(k) i and z(k) i := (−1)k−1y(k) i . Assuming that p1(x) = p2(x) =: p(x), n1 = n2, and en1 = en2 for simplicity, {(exi, wi)}n i=1 := {(ex(k) i , w(k) i )}k=1,2; i=1,...,enk and {(xi, zi)}n i=1 := {(x(k) i , z(k) i )}k=1,2; i=1,...,nk can be seen as samples drawn from p(x, z) := p(z | x)p(x) and p(x, w) := p(w | x)p(x), respectively, where n = n1 + n2 and en = en1 + en2. The more general cases where p1(x) ̸= p2(x), n1 ̸= n2, or en1 ̸= en2 are discussed in Appendix I in the supplementary material. 4 Theorem 1. Assume that µw, µz ∈L2(p) and µw(x) ̸= 0 for every x such that p(x) > 0, where L2(p) := {f : X →R | Ex∼p(x)[f(x)2] < ∞}. The individual uplift u(x) equals the solution to the following least-squares problem: u(x) = argmin f∈L2(p) E[(µw(x)f(x) −2µz(x))2], (7) where E denotes the expectation over p(x), µw(x) := E[w | x], and µz(x) := E[z | x]. Theorem 1 follows from Lemma 2. Note that p1(x) ̸= p2(x) in Eq. (2) implies µw(x) ̸= 0. In what follows, we develop a method that directly estimates u(x) by solving Eq. (7). A challenge here is that it is not straightforward to evaluate the objective functional since it involves unknown functions, µw and µz. 4.2 Disentanglement of z and w Our idea is to transform the objective functional in Eq. (7) into another form in which µw(x) and µz(x) appear separately and linearly inside the expectation operator so that we can approximate them using our separately labeled samples. For any function g ∈L2(p) and any x ∈X, expanding the left-hand side of the inequality E[(µw(x)f(x) −2µz(x) −g(x))2] ≥0, we have E[(µw(x)f(x) −2µz(x))2] ≥2E[(µw(x)f(x) −2µz(x))g(x)] −E[g(x)2] =: J(f, g). (8) The equality is attained when g(x) = µw(x)f(x) −µz(x) for any fixed f. This means that the objective functional of Eq. (7) can be calculated by maximizing J(f, g) with respect to g. Hence, u(x) = argmin f∈L2(p) max g∈L2(p) J(f, g). (9) Furthermore, µw and µz are separately and linearly included in J(f, g), which makes it possible to write it in terms of z and w as J(f, g) = 2E[wf(x)g(x)] −4E[zg(x)] −E[g(x)2]. (10) Unlike the original objective functional in Eq. (7), J(f, g) can be easily estimated using sample averages by bJ(f, g) = 2 en en X i=1 wif(exi)g(exi) −4 n n X i=1 zig(xi) −1 2n n X i=1 g(xi)2 −1 2en en X i=1 g(exi)2. (11) In practice, we solve the following regularized empirical optimization problem: min f∈F max g∈G bJ(f, g) + Ω(f, g), (12) where F, G are models for f, g respectively, and Ω(f, g) is some regularizer. An advantage of the proposed framework is that it is model-independent, and any models can be trained by optimizing the above objective. The function g can be interpreted as a critic of f as follows. Minimizing Eq. (10) with respect to f is equivalent to minimizing J(f, g) = E[g(x){µw(x)f(x) −2µz(x)}]. g(x) serves as a good critic of f(x) when it makes the cost g(x){µw(x)f(x) −2µz(x)} larger for x at which f makes a larger error |µw(x)f(x) −2µz(x)|. In particular, g maximizes the objective above when g(x) = µw(x)f(x)−2µz(x) for any f, and the maximum coincides with the least-squares objective in Eq. (7). Suppose that F and G are linear-in-parameter models: F = {fα : x 7→α⊤φ(x) | α ∈Rbf } and G = {gβ : x 7→β⊤ψ(x) | β ∈Rbg}, where φ and ψ are bf-dimensional and bg-dimensional vectors of basis functions in L2(p). Then, bJ(fα, gβ) = 2α⊤Aβ −4b⊤β −β⊤Cβ, where A := 1 en en X i=1 wiφ(exi)ψ(exi)⊤, b := 1 n n X i=1 ziψ(xi), C := 1 2n n X i=1 ψ(xi)ψ(xi)⊤+ 1 2en en X i=1 ψ(exi)ψ(exi)⊤. 5 Using ℓ2-regularizers, Ω(f, g) = λfα⊤α −λgβ⊤β with some positive constants λf and λg, the solution to the inner maximization problem can be obtained in the following analytical form: bβα := argmax β bJ(fα, gβ) = e C−1(A⊤α −2b), where e C = C + λgIbg and Ibg is the bg-by-bg identity matrix. Then, we can obtain the solution to Eq. (12) analytically as bα := argmin α bJ(fα, g b βα) = 2(A e C−1A⊤+ λfIbg)−1A e C−1b. Finally, from Eq. (7), our estimate of u(x) is given as bα⊤φ(x). Remark on model selection: Model selection for F and G is not straightforward since the test performance measure cannot be directly evaluated with (held out) training data of our problem. Instead, we may evaluate the value of J( bf, bg), where ( bf, bg) ∈F × G is the optimal solution pair to minf∈F maxg∈G bJ(f, g). However, it is still nontrivial to tell if the objective value is small because the solution is good in terms of the outer minimization, or because it is poor in terms of the inner maximization. We leave this issue for future work. 5 Theoretical Analysis A theoretically appealing property of the proposed method is that its objective consists of simple sample averages. This enables us to establish a generalization error bound in terms of the Rademacher complexity [15, 22]. Denote εG(f) := supg∈L2(p) J(f, g) −supg∈G J(f, g). Also, let RN q (H) denote the Rademacher complexity of a set of functions H over N random variables following probability density q (refer to Appendix E for the definition). Proofs of the following theorems and corollary can be found in Appendix E, Appendix F, and Appendix G in the supplementary material. Theorem 2. Assume that n1 = n2, en1 = en2, p1(x) = p2(x), W := infx∈X |µw(x)| > 0, MZ := supz∈Z |z| < ∞, MF := supf∈F,x∈X |f(x)| < ∞, and MG := supg∈G,x∈X |g(x)| < ∞. Then, the following holds with probability at least 1 −δ for every f ∈F: Ex∼p(x)[(f(x) −u(x))2] ≤ 1 W 2 " sup g∈G bJ(f, g) + Rn,en F,G +  Mz √ 2n + Mw √ 2en  r log 2 δ + εG(f) # , where Mz := 4MYMG + M 2 G/2, Mw = 2MFMG + M 2 G/2, and Rn,en F,G := 2(MF + 4MZ)Rn p(x,z)(G) + 2(2MF + MG)Ren p(x,w)(F) + 2(MF + MG)Ren p(x,w)(G). In particular, the following bound holds for the linear-in-parameter models. Corollary 1. Let F = {x 7→α⊤φ(x) | ∥α∥2 ≤ΛF }, G = {x 7→β⊤ψ(x) | ∥β∥2 ≤ΛG}. Assume that rF := supx∈X ∥φ(x)∥< ∞and rG := supx∈X ∥ψ(x)∥< ∞, where ∥·∥2 is the L2-norm. Under the assumptions of Theorem 2, it holds with probability at least 1 −δ that for every f ∈F, Ex∼p(x)[(f(x) −u(x))2] ≤ 1 W 2  sup g∈G bJ(f, g) + Cz q log 2 δ + Dz √ 2n + Cw q log 2 δ + Dw √ 2en + εG(f)  , where Cz := r2 GΛ2 G + 4rGΛGMY, Cw := 2r2 F Λ2 F + 2rF rGΛF ΛG + r2 GΛ2 G, Dz := r2 GΛ2 G/2 + 4rGΛGMY, and Dw := r2 GΛ2 G/2 + 4rF rGΛF ΛG. Theorem 2 and Corollary 1 imply that minimizing supg∈G bJ(f, g), as the proposed method does, amounts to minimizing an upper bound of the mean squared error. In fact, for the linear-in-parameter models, it can be shown that the mean squared error of the proposed estimator is upper bounded by O(1/√n + 1/ √ en) plus some model mis-specification error with high probability as follows. 6 Theorem 3 (Informal). Let bf ∈F be any approximate solution to inff∈F supg∈G bJ(f, g) with sufficient precision. Under the assumptions of Corollary 1, it holds with probability at least 1 −δ that Ex∼p(x)[( bf(x) −u(x))2] ≤O  1 √n + 1 √ en  log 1 δ  + 2εF G + εF W 2 , (13) where εF G := supf∈F εG(f) and εF := inff∈F J(f). A more formal version of Theorem 3 can be found in Appendix G. 6 More General Loss Functions Our framework can be extended to more general loss functions: inf f∈L2(p) E[ℓ(µw(x)f(x), 2µz(x))], (14) where ℓ: R × R →R is a loss function that is lower semi-continuous and convex with respect to both the first and the second arguments, where a function ϕ : R →R is lower semi-continuous if lim infy→y0 ϕ(y) = ϕ(y0) for every y0 ∈R [30].2 As with the squared loss, a major difficulty in solving this optimization problem is that the operand of the expectation has nonlinear dependency on both µw(x) and µz(x) at the same time. Below, we will show a way to transform the objective functional into a form that can be easily approximated using separately labeled samples. From the assumptions on ℓ, we have ℓ(y, y′) = supz∈R yz −ℓ∗(z, y′), where ℓ∗(·, y′) is the convex conjugate of the function y 7→ℓ(y, y′) defined for any y′ ∈R as z 7→ℓ∗(z, y′) = supy∈R[yz − ℓ(y, y′)] (see Rockafellar [30]). Hence, E[ℓ(µw(x)f(x), 2µz(x))] = sup g∈L2(p) E[µw(x)f(x)g(x) −ℓ∗(g(x), 2µz(x))]. Similarly, we obtain E[ℓ∗(g(x), 2µz(x))] = suph∈L2(p) 2E[µz(x)h(x)]−E[ℓ∗ ∗(g(x), h(x))], where ℓ∗ ∗(y, ·) is the convex conjugate of the function y′ 7→ℓ∗(y, y′) defined for any y, z′ ∈R by ℓ∗ ∗(y, z′) := supy′∈R[y′z −ℓ∗(y, y′)]. Thus, Eq. (14) can be rewritten as inf f∈L2(p) sup g∈L2(p) inf h∈L2(p) K(f, g, h), where K(f, g, h) := E[µw(x)f(x)g(x)] −2E[µz(x)h(x)] + E[ℓ∗ ∗(g(x), h(x))]. Since µw and µz appear separately and linearly, K(f, g, h) can be approximated by sample averages using separately labeled samples. 7 Experiments In this section, we test the proposed method and compare it with baselines. 7.1 Data Sets We use the following data sets for experiments. Synthetic data: Features x are drawn from the two-dimensional Gaussian distribution with mean zero and covariance 10I2. We set p(y | x, t) as the following logistic models: p(y | x, t) = 1/(1 −exp(−ya⊤ t x)), where a−1 = (10, 10)⊤and a1 = (10, −10)⊤. We also use the logistic models for pk(t | x): p1(t | x) = 1/(1 −exp(−tx2)) and p2(t | x) = 1/(1 −exp(−t{x2 + b}), where b is varied over 25 equally spaced points in [0, 10]. We investigate how the performance changes when the difference between p1(t | x) and p2(t | x) varies. Email data: This data set consists of data collected in an email advertisement campaign for promoting customers to visit a website of a store [8, 27]. Outcomes are whether customers visited the website or not. We use 4 × 5000 and 2000 randomly sub-sampled data points for training and evaluation, respectively. 2lim infy→y0 ϕ(y) := limδ↘0 inf|y−y0|≤δ ϕ(y). 7 Jobs data: This data set consists of randomized experimental data obtained from a job training program called the National Supported Work Demonstration [17], available at http://users.nber. org/~rdehejia/data/nswdata2.html. There are 9 features, and outcomes are income levels after the training program. The sample sizes are 297 for the treatment group and 425 for the control group. We use 4 × 50 randomly sub-sampled data points for training and 100 for evaluation. Criteo data: This data set consists of banner advertisement log data collected by Criteo [18] available at http://www.cs.cornell.edu/~adith/Criteo/. The task is to select a product to be displayed in a given banner so that the click rate will be maximized. We only use records for banners with only one advertisement slot. Each display banner has 10 features, and each product has 35 features. We take the 12th feature of a product as a treatment variable merely because it is a well-balanced binary variable. The outcome is whether the displayed advertisement was clicked. We treat the data set as the population although it is biased from the actual population since non-clicked impressions were randomly sub-sampled down to 10% to reduce the data set size. We made two subsets with different treatment policies by appropriately sub-sampling according to the predefined treatment policies (see Appendix L in the supplementary material). We set pk(t | x) as p1(t | x) = 1/(1 + exp(−t1⊤x)) and p2(t | x) = 1/(1 + exp(t1⊤x)), where 1 := (1, . . . , 1)⊤. 7.2 Experimental Settings We conduct experiments under the following settings. Methods compared: We compare the proposed method with baselines that separately estimate the four conditional expectations in Eq. (6). In the case of binary outcomes, we use the logisticregression-based (denoted by FourLogistic) and a neural-network-based method trained with the soft-max cross-entropy loss (denoted by FourNNC). In the case of real-valued outcomes, the ridgeregression-based (denoted by FourRidge) and a neural-network-based method trained with the squared loss (denoted by FourNNR). The neural networks are fully connected ones with two hidden layers each with 10 hidden units. For the proposed method, we use the linear-in-parameter models with Gaussian basis functions centered at randomly sub-sampled training data points (see Appendix K for more details). Performance evaluation: We evaluate trained uplift models by the area under the uplift curve (AUUC) estimated on test samples with joint labels as well as uplift curves [26]. The uplift curve of an estimated individual uplift is the trajectory of the average uplift when individuals are gradually moved from the control group to the treated group in the descending order according to the ranking given by the estimated individual uplift. These quantities can be estimated when data are randomized experiment ones. The Criteo data are not randomized experiment data unlike other data sets, but there are accurately logged propensity scores available. In this case, uplift curves and the AUUCs can be estimated using the inverse propensity scoring [3, 20]. We conduct 50 trials of each experiment with different random seeds. 7.3 Results The results on the synthetic data are summarized in Figure 1. From the plots, we can see that all methods perform relatively well in terms of AUUCs when the policies are distant from each other (i.e., b is larger). However, the performance of the baseline methods immediately declines as the treatment policies get closer to each other (i.e., b is smaller).3 In contrast, the proposed method maintains its performance relatively longer until b reaches the point around 2. Note that the two policies would be identical when b = 0, which makes it impossible to identify the individual uplift from their samples by any method since the system in Eq. (5) degenerates. Figure 2 highlights their performance in terms of the squared error. For FourNNC, test points with small policy difference |p1(t = 1 | x) −p2(t = 1 | x)| (colored darker) tend to have very large estimation errors. On the other hand, the proposed method has relatively small errors even for such points. Figure 3 shows results on real data sets. The proposed method and the baseline method with logistic regressors both performed better than the baseline method with neural nets on the Email data set (Figure 3a). 3The instability of performance of FourLogistic can be explained as follows. FourLogistic uses linear models, whose expressive power is limited. The resulting estimator has small variance with potentially large bias. Since different b induces different u(x), the bias depends on b. For this reason, the method works well for some b but poorly for other b. 8 0 2 4 6 8 10 b 0.025 0.000 0.025 0.050 0.075 0.100 0.125 0.150 AUUC The Synthetic Data Proposed (MinMaxGau) Baseline (FourNNC) Baseline (FourLogistic) Figure 1: Results on the synthetic data. The plot shows the average AUUCs obtained by the proposed method and the baseline methods for different b. p1(t | x) and p2(t | x) are closer to each other when b is smaller. (a) Baseline (FourLogistic). (b) Baseline (FourNNC). (c) Proposed (MinMaxGau). Figure 2: The plots show the squared errors of the estimated individual uplifts on the synthetic data with b = 1. Each point is darker-colored when |p1(t = 1 | x) −p2(t = 1 | x)| is smaller, and lighter-colored otherwise. 0.0 0.2 0.4 0.6 0.8 1.0 Proportion of Treated Individuals 0.00 0.01 0.02 0.03 0.04 Average Uplift Uplift Curve Proposed (MinMaxGau) Baseline (FourNNC) Baseline (FourLogistic) (a) The Email data. 0.2 0.4 0.6 0.8 1.0 Proportion of Treated Individuals 0 200 400 600 800 1000 1200 1400 Average Uplift Uplift Curve Proposed (MinMaxGau) Baseline (FourNNR) Baseline (FourRidge) (b) The Jobs data. 0.0 0.2 0.4 0.6 0.8 1.0 Proportion of Treated Individuals 0.000 0.002 0.004 0.006 0.008 0.010 Average Uplift Uplift Curve Proposed (MinMaxGau) Baseline (FourNNC) Baseline (FourLogistic) (c) The Criteo data. Figure 3: Average uplifts as well as their standard errors on real-world data sets. On the Jobs data set, the proposed method again performed better than the baseline methods with neural networks. For the Criteo data set, the proposed method outperformed the baseline methods (Figure 3c). Overall, we confirmed the superiority of the proposed both on synthetic and real data sets. 8 Conclusion We proposed a theoretically guaranteed and practically useful method for uplift modeling or individual treatment effect estimation under the presence of systematic missing labels. The proposed method showed promising results in our experiments on synthetic and real data sets. The proposed framework is model-independent: any models can be used to approximate the individual uplift including ones tailored for specific problems and complex models such as neural networks. On the other hand, model selection may be a challenging problem due to the min-max structure. Addressing this issue would be important research directions for further expanding the applicability and improving the performance of the proposed method. 9 Acknowledgments We are grateful to Marthinus Christoffel du Plessis and Takeshi Teshima for their inspiring suggestions and for the meaningful discussions. We would like to thank the anonymous reviewers for their helpful comments. IY was supported by JSPS KAKENHI 16J07970. JA and FY would like to thank Adway for its support. MS was supported by the International Research Center for Neurointelligence (WPI-IRCN) at The University of Tokyo Institutes for Advanced Study. References [1] E. Abrahams and M. Silver. The Case for Personalized Medicine. Journal of Diabetes Science and Technology, 3(4):680–684, July 2009. [2] S. Athey, J. Tibshirani, and S. Wager. Generalized Random Forests. arXiv:1610.01271 [econ, stat], October 2016. arXiv: 1610.01271. [3] P. C. Austin. An introduction to propensity score methods for reducing the effects of confounding in observational studies. Multivariate behavioral research, 46(3):399–424, 2011. [4] C. M. Bishop. Pattern Recognition and Machine Learning (Information Science and Statistics). SpringerVerlag New York, Inc., 2006. [5] P. Gutierrez and J. Y. Gérardy. Causal inference and uplift modelling: A review of the literature. In Proceedings of The 3rd International Conference on Predictive Applications and APIs, volume 67 of Proceedings of Machine Learning Research, pages 1–13. PMLR, 11–12 Oct 2017. [6] J. Hartford, G. Lewis, K. Leyton-Brown, and M. Taddy. Deep IV: A Flexible Approach for Counterfactual Prediction. In International Conference on Machine Learning, pages 1414–1423, July 2017. [7] J. L. Hill. Bayesian Nonparametric Modeling for Causal Inference. Journal of Computational and Graphical Statistics, 20(1):217–240, January 2011. [8] K. Hillstrom. The minethatdata e-mail analytics and data mining challenge, 2008. https://blog. minethatdata.com/2008/03/minethatdata-e-mail-analytics-and-data.html. [9] K. Imai and M. Ratkovic. Estimating treatment effect heterogeneity in randomized program evaluation. The Annals of Applied Statistics, 7(1):443–470, March 2013. [10] G. W. Imbens. Instrumental Variables: An Econometrician’s Perspective. Statistical Science, 29(3): 323–358, August 2014. [11] M. Jaskowski and S. Jaroszewicz. Uplift modeling for clinical trial data. In ICML Workshop on Clinical Data Analysis, 2012. [12] F. D. Johansson, U. Shalit, and D. Sontag. Learning Representations for Counterfactual Inference. In Proceedings of the 33rd International Conference on Machine Learning, volume 48 of Proceedings of Machine Learning Research, pages 3020–3029. JMLR, 2016. [13] S. H. Katsanis, G. Javitt, and K. Hudson. A Case Study of Personalized Medicine. Science, 320(5872): 53–54, April 2008. [14] R. Kohavi, R. Longbotham, D. Sommerfield, and R. M. Henne. Controlled experiments on the web: survey and practical guide. Data Mining and Knowledge Discovery, 18(1):140–181, February 2009. [15] V. Koltchinskii. Rademacher penalties and structural risk minimization. IEEE Transactions on Information Theory, 47(5):1902–1914, July 2001. [16] S. R. Künzel, J. S. Sekhon, P. J. Bickel, and B. Yu. Meta-learners for Estimating Heterogeneous Treatment Effects using Machine Learning. arXiv:1706.03461 [math, stat], June 2017. arXiv: 1706.03461. [17] R. J. LaLonde. Evaluating the econometric evaluations of training programs with experimental data. The American economic review, pages 604–620, 1986. [18] D. Lefortier, A. Swaminathan, X. Gu, T. Joachims, and M. de Rijke. Large-scale validation of counterfactual learning methods: A test-bed. In NIPS Workshop on "Inference and Learning of Hypothetical and Counterfactual Interventions in Complex Systems", 2016. [19] G. Lewis and V. Syrgkanis. Adversarial Generalized Method of Moments. arXiv:1803.07164 [cs, econ, math, stat], March 2018. arXiv: 1803.07164. 10 [20] L. Li, W. Chu, J. Langford, and X. Wang. An unbiased offline evaluation of contextual bandit algorithms with generalized linear models. In Proceedings of the Workshop on On-line Trading of Exploration and Exploitation 2, volume 26 of Proceedings of Machine Learning Research, pages 19–36. PMLR, 02 Jul 2012. [21] S. Liu, A. Takeda, T. Suzuki, and K. Fukumizu. Trimmed density ratio estimation. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems 30, pages 4518–4528. Curran Associates, Inc., 2017. [22] M. Mohri, A. Rostamizadeh, and A. Talwalkar. Foundations of machine learning. MIT press, 2012. [23] 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, Nov 2010. [24] J. Pearl. Causality. Cambridge university press, 2009. [25] N. Radcliffe. Using control groups to target on predicted lift: Building and assessing uplift model. Direct Marketing Analytics Journal, pages 14–21, 2007. [26] N. Radcliffe and P. Surry. Differential Response Analysis: Modeling True Responses by Isolating the Effect of a Single Action. Credit Scoring and Credit Control IV, 1999. [27] N. J. Radcliffe. Hillstrom’s minethatdata email analytics challenge: An approach using uplift modelling. Technical report, Stochastic Solutions Limited, 2008. [28] N. J. Radcliffe and P. D. Surry. Real-world uplift modelling with significance-based uplift trees. White Paper TR-2011-1, Stochastic Solutions, 2011. [29] R. Renault. Chapter 4 - Advertising in Markets. In Simon P. Anderson, Joel Waldfogel, and David Strömberg, editors, Handbook of Media Economics, volume 1 of Handbook of Media Economics, pages 121–204. North-Holland, January 2015. [30] R. T. Rockafellar. Convex Analysis. Princeton University Press, 1970. [31] D. B. Rubin. Causal inference using potential outcomes: Design, modeling, decisions. Journal of the American Statistical Association, 100(469):322–331, 2005. [32] P. Rzepakowski and S. Jaroszewicz. Decision trees for uplift modeling with single and multiple treatments. Knowledge and Information Systems, 32(2):303–327, 2012. [33] U. Shalit, F. D. Johansson, and D. Sontag. Estimating individual treatment effect: generalization bounds and algorithms. In Doina Precup and Yee Whye Teh, editors, Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pages 3076–3085. PMLR, 06–11 Aug 2017. [34] M. Sugiyama, I. Takeuchi, T. Suzuki, T. Kanamori, H. Hachiya, and D. Okanohara. Conditional density estimation via least-squares density ratio estimation. In International Conference on Artificial Intelligence and Statistics, pages 781–788, 2010. [35] M. Sugiyama, T. Suzuki, and T. Kanamori. Density Ratio Estimation in Machine Learning. Cambridge University Press, 2012. [36] S. Tufféry. Data mining and statistics for decision making, volume 2. Wiley Chichester, 2011. [37] S. Wager and S. Athey. Estimation and Inference of Heterogeneous Treatment Effects using Random Forests. arXiv:1510.04342 [math, stat], October 2015. [38] 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. 11
2018
119
7,274
Streamlining Variational Inference for Constraint Satisfaction Problems Aditya Grover, Tudor Achim, Stefano Ermon Computer Science Department Stanford University {adityag, tachim, ermon}@cs.stanford.edu Abstract Several algorithms for solving constraint satisfaction problems are based on survey propagation, a variational inference scheme used to obtain approximate marginal probability estimates for variable assignments. These marginals correspond to how frequently each variable is set to true among satisfying assignments, and are used to inform branching decisions during search; however, marginal estimates obtained via survey propagation are approximate and can be self-contradictory. We introduce a more general branching strategy based on streamlining constraints, which sidestep hard assignments to variables. We show that streamlined solvers consistently outperform decimation-based solvers on random k-SAT instances for several problem sizes, shrinking the gap between empirical performance and theoretical limits of satisfiability by 16.3% on average for k = 3, 4, 5, 6. 1 Introduction Constraint satisfaction problems (CSP), such as boolean satisfiability (SAT), are useful modeling abstractions for many artificial intelligence and machine learning problems, including planning [13], scheduling [27], and logic-based probabilistic modeling frameworks such as Markov Logic Networks [30]. More broadly, the ability to combine constraints capturing domain knowledge with statistical reasoning has been successful across diverse areas such as ontology matching, information extraction, entity resolution, and computer vision [15, 4, 32, 29, 33]. Solving a CSP involves finding an assignment to the variables that renders all of the problem’s constraints satisfied, if one exists. Solvers that explore the search space exhaustively do not scale since the state space is exponential in the number of variables; thus, the selection of branching criteria for variable assignments is the central design decision for improving the performance of these solvers [5]. Any CSP can be represented as a factor graph, with variables as nodes and the constraints between these variables (known as clauses in the SAT case) as factors. With such a representation, we can design branching strategies by inferring the marginal probabilities of each variable assignment. Intuitively, the variables with more extreme marginal probability for a particular value are more likely to assume that value across the satisfying assignments to the CSP. In fact, if we had access to an oracle that could perform exact inference, one could trivially branch on variable assignments with non-zero marginal probability and efficiently find solutions (if one exists) to hard CSPs such as SAT in time linear in the number of variables. In practice however, exact inference is intractable for even moderately sized CSPs and approximate inference techniques are essential for obtaining estimates of marginal probabilities. Variational inference is at the heart of many such approximate inference techniques. The key idea is to cast inference over an intractable joint distribution as an optimization problem over a family of tractable approximations to the true distribution [6, 34, 38]. Several such approximations exist, e.g., mean field, belief propagation etc. In this work, we focus on survey propagation. Inspired from 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. a b c i j k l m Figure 1: Factor graph for a 3-SAT instance with 5 variables (circles) and 3 clauses (squares). A solid (dashed) edge between a clause and a variable indicates that the clause contains the variable as a positive (negative) literal. This instance corresponds to (¬xi _ xk _ ¬xl) ^ (xi _ xj _ ¬xk) ^ (xk _ xl _ ¬xm), with the clauses a, b, c listed in order. statistical physics, survey propagation is a message-passing algorithm that corresponds to belief propagation in a “lifted” version of the original CSP and underlines many state-of-the-art solvers for random CSPs [24, 22, 21]. Existing branching rules for survey propagation iteratively pick variables with the most confident marginals and fix their values (by adding unary constraints on these variables) in a process known as decimation. This heuristic works well in practice, but struggles with a high variance in the success of branching, as the unary constraints leave the survey inspired decimation algorithm unable to recover in the event that a contradictory assignment (i.e., one that cannot be completed to form a satisfying assignment) is made. Longer branching predicates, defined over multiple variables, have lower variance and are more effective both in theory and practice [14, 1, 2, 36, 19, 18]. In this work, we introduce improved branching heuristics for survey propagation by extending this idea to CSPs; namely, we show that branching on more complex predicates than single-variable constraints greatly improves survey propagation’s ability to find solutions to CSPs. Appealingly, the more complex, multi-variable predicates which we refer to as streamlining constraints, can be easily implemented as additional factors (not necessarily unary anymore) in message-passing algorithms such as survey propagation. For this reason, branching on more complex predicates is a natural extension to survey propagation. Using these new branching heuristics, we develop an algorithm and empirically benchmark it on families of random CSPs. Random CSPs exhibit sharp phase transitions between satisfiable and unsatisfiable instances and are an important model to analyze the average hardness of CSPs, both in theory and practice [25, 26]. In particular, we consider two such CSPs: k-SAT where constraints are restricted to disjunctions involving exactly k (possibly negated) variables [3] and XORSAT which substitutes disjunctions in k-SAT for XOR constraints of fixed length. On both these problems, our proposed algorithm outperforms the competing survey inspired decimation algorithm that branches based on just single variables, increasing solver success rates. 2 Preliminaries Every CSP can be encoded as a boolean SAT problem expressed in Conjunctive Normal Form (CNF), and we will use this representation for the remainder of this work. Let V and C denote index sets for n Boolean variables and m clauses respectively. A literal is a variable or its negation; a clause is a disjunction of literals. A CNF formula F is a conjunction of clauses, and is written as (l11 _ . . . _ l1k1) ^ . . . ^ (lm1 _ . . . _ lmkm). Each (lj1 _ . . . _ ljkj) is a clause with kj literals. For notational convenience, the variables will be indexed with letters i, j, k, . . . and the clauses will be indexed with letters a, b, c, . . .. Each variable i is Boolean, taking values xi 2 {0, 1}. A formula is satisfiable is there exists an assignment to the variables such that all the clauses are satisfied, where a clause is satisfied if at least one literal evaluates to true. Any SAT instance can be represented as an undirected graphical model where each clause corresponds to a factor, and is connected to the variables in its scope. Given an assignment to the variables in its scope, a factor evaluates to 1 if the corresponding clause evaluates to True, and 0 otherwise. The corresponding joint probability distribution is uniform over the set of satisfying assignments. An example factor graph illustrating the use of our notation is given in Figure 1. 2 k-SAT formulas are ones where all clauses (lj1 _ . . . _ ljkj) have exactly k literals, i.e., kj = k for j = 1, · · · , m. Random k-SAT instances are generated by choosing each literal’s variable and negation independently and uniformly at random in each of the m clauses. It has been shown that these instances have a very distinctive behavior where the probability of an instance having a solution has a phase transition explained as a function of the constraint density, ↵= m/n, for a problem with m clauses and n variables for large enough k. These instances exhibit a sharp crossover at a threshold density ↵s(k): they are almost always satisfiable below this threshold, and they become unsatisfiable for larger constraint densities [12, 10]. Empirically, random instances with constraint density close to the satisfiability threshold are difficult to solve [23]. 2.1 Survey propagation The base algorithm used in many state-of-the-art solvers for constraint satisfaction problems such as random k-SAT is survey inspired decimation [7, 24, 16, 23]. The algorithm employs survey propagation, a message passing procedure that computes approximate single-variable marginal probabilities for use in a decimation procedure. Our approach uses the same message passing procedure, and we review it here for completeness. Survey propagation is an iterative procedure for estimating variable marginals in a factor graph. In the context of a factor graph corresponding to a Boolean formula, these marginals represent approximately the probability of a variable taking on a particular assignment when sampling uniformly from the set of satisfying assignments of the formula. Survey propagation considers three kinds of assignments for a variable: 0, 1, or unconstrained (denoted by ⇤). A high value for marginals corresponding to either of the first two assignments indicates that the variables assuming the particular assignment make it likely for the overall formula to be satisfiable, whereas a high value for the unconstrained marginal indicates that satisfiablility is likely regardless of the variable assignment. In order to estimate these marginals from a factor graph, we follow a message passing protocol where we first compute survey messages for each edge in the graph. There are two kinds of survey messages: messages {⌘i!a}i2V,a2C(i) from variable nodes i to clauses a, and messages {⌘a!i}a2C,i2V (a) from clauses to variables. These messages can be interpreted as warnings of unsatisfiability. 1. If we let V (a) to be the set of variables appearing in clause a, then the message sent from a clause a to variable i, ⌘a!i, is intuitively the probability that all variables in V (a)\{i} are in the state that violates clause a. Hence, clause a is issuing a warning to variable i. 2. The reverse message from variable i to clause a for some value xi, ⌘i!a, is interpreted as the probability of variable i assuming the value xi that violates clause a. As shown in Algorithm 1, the messages from factors (clauses) to variables ⌘a!i are initialized randomly [Line 2] and updated until a predefined convergence criteria [Lines 5-7]. Once the messages converge to ⌘⇤ a!i, we can estimate the approximate marginals µi(0), µi(1), µi(⇤) for each variable i. In case survey propagation does not converge even after repeated runs, or a contradiction is found, the algorithm output is UNSAT. The message passing updates SP-Update [Line 6] and the marginalization procedure Marginalize [Line 9] are deferred to Appendix A for ease of presentation. We refer the reader to [24] and [7] for a detailed analysis of the algorithm and connections to statistical physics. 2.2 Decimation and Simplification The magnetization of a variable i, defined as M(i) := |µi(0) −µi(1)|, is used as a heuristic bias to determine how constrained the variable is to take a particular value. The magnetization can be a maximum of one which occurs when either of the marginals is one and a minimum of zero when the estimated marginals are equal.1 The decimation procedure involves setting the variable(s) with the highest magnetization(s) to their most likely values based on the relative magnitude of µi(0) vs. µi(1) [Lines 12-13]. The algorithm then branches on these variable assignments and simplifies the formula by unit propagation [Line 15]. In unit propagation, we recursively iterate over all the clauses that the decimated variable appears in. If the polarity of the variable in a literal matches its assignment, the clause is satisfied and hence, the corresponding clause node and all its incident variable edges are 1Other heuristic biases are also possible. For instance, [23] use the bias 1 −min(µi(1), µi(0)). 3 Algorithm 1 SurveyInspiredDecimation(V, C) 1: Initialize V V and C C 2: Initialize messages {⌘a!i}a2C,i2V (a) at random 3: while (P i |µi(0) −µi(1)| > ✏) do 4: . Message passing inference 5: repeat 6: {⌘a!i} SP-Update(V, C, {⌘a!i}) 7: until Convergence to {⌘⇤ a!i} 8: for i = 1, . . . , |V| do 9: µi(0), µi(1), µi(⇤) Marginalize(V, C, {⌘a!i) 10: end for 11: . Branching (Decimation) 12: Choose i⇤ arg maxi2V |µi(0) −µi(1)| 13: Set y⇤ arg maxy2{0,1} µi⇤(y) 14: . Simplification 15: Update V, C UnitPropagate(V, C [ {xi⇤= y⇤}) 16: end while 17: return LocalSearch(V, C) removed from the factor graph. If the polarity in the literal does not match the assignment, only the edge originating from this particular variable node incident to the clause node is removed from the graph. For example, setting variable k to 0 in Figure 1 leads to removal of edges incident to k from a and c, as well as all outgoing edges from b (because b is satisfied). 2.3 Survey Inspired Decimation The full iterative process of survey propagation (on the simplified graph from the previous iteration) followed by decimation is continued until a satisfying assignment is found, or a stopping condition is reached beyond which the instance is assumed to be sufficiently easy for local search using a standard algorithm such as WalkSAT [31]. Note that when the factor graph is a tree and survey propagation converges to the exact warning message probabilities, Algorithm 1 is guaranteed to select good variables to branch on and to find a solution (assuming one exists). However, the factor graphs for CSPs are far from tree-like in practice and thus, the main factor affecting the success of survey inspired decimation is the quality of the estimated marginals. If these estimates are inaccurate, it is possible that the decimation procedure chooses to fix variables in contradictory configurations. To address this issue, we propose to use streamlining constraints. 3 Streamlining survey propagation Combinatorial optimization algorithms critically depend on good heuristics for deciding where to branch during search [5]. Survey propagation provides a strong source of information for the decimation heuristic. As discussed above, the approximate nature of message-passing implies that the “signal" might be misleading. We now describe a more effective way to use the information from survey propagation. Whenever we have a combinatorial optimization problem over X = {0, 1}n and wish to find a solution s 2 S ✓X, we may augment the original feasibility problem with constraints that partition the statespace X into disjoint statespaces and recursively search the resulting subproblems. Such partitioning constraints can significantly simplify search by exploiting the structure of the solution set S and are known as streamlining constraints [17]. Good streamlining constraints will provide a balance between yielding significant shrinkage of the search space and safely avoiding reductions in the solution density of the resulting subproblems. Partitioning the space based on the value of a single variable (like in decimation) performs well on the former at the cost of the latter. We therefore introduce a different constraining strategy that strives to achieve a more balanced trade-off. 4 3.1 Streamlining constraints for constraint satisfaction problems The success of survey inspired decimation relies on the fact that marginals carry some signal about the likely assignments of variables. However, the factor graph becomes more dense as the constraint density approaches the phase transition threshold, making it harder for survey propagation to converge in practice. This suggests that the marginals might provide a weaker signal to the decimation procedure in early iterations. Instead of selecting a variable to freeze in some configuration as in decimation, e.g., xi = 1, we propose a strictly more general streamlining approach where we use disjunction constraints between subsets of highly magnetized variables, e.g., (xi _ xj) = 1. The streamlined constraints can cut out smaller regions of the search space while still making use of the magnetization signal. For instance, introducing a disjunction constraint between any pair of variables reduces the state-space by a factor of 4/3 (since three out of four possible variable assignments satisfy the clause), in contrast to the decimation procedure in Algorithm 1 which reduces the state space by a factor of 2. Intuitively, when branching with a length-2 clause such as (xi _ xj) we make an (irreversible) mistake only if we guess the value of both variables wrong. Decimation can also be seen as a special case of streamlining for the same choice of literal. To see why, we note that in the above example the acceptable variable assignments for decimation (xi, xj) = {(1, 0), (1, 1)} are a subset of the valid assignments for streamlining (xi, xj) = {(1, 0), (1, 1), (0, 1)}. The success of the streamlining constraints is strongly governed by the literals selected for participating in these added disjunctions. Disjunctions could in principle involve any number of literals, and longer disjunctions result in more conservative branching rules. But there are diminishing returns with increasing length, and so we restrict ourselves to disjunctions of length at most two in this paper. Longer clauses can in principle be handled by the inference procedure used by message-passing algorithms, and we leave an exploration of this extension to future work. 3.2 Survey Inspired Streamlining The pseudocode for survey inspired streamlining is given in Algorithm 2. The algorithm replaces the decimation step of survey inspired decimation with a streamlining procedure that adds disjunction constraints to the original formula [Line 16], thereby making the problem increasingly constrained until the search space can be efficiently explored by local search. For designing disjunctions, we consider candidate variables with the highest magnetizations, similar to decimation. If a variable i is selected, the polarity of the literal containing the variable is positive if µi(1) > µi(0) and negative otherwise [Lines 12-15]. Disjunctions use the signal from the survey propagation messages without overcommitting to a particular variable assignment too early (as in decimation). Specifically, without loss of generality, if we are given marginals µi(1) > µi(0) and µj(1) > µj(0) for variables i and j, the new update adds the streamlining constraint xi _ xj to the problem instead of overcommitting by constraining i or j to its most likely state. This approach leverages the signal from survey propagation, namely that it is unlikely for ¬xi ^ ¬xj to be true, while also allowing for the possibility that one of the two marginals may have been estimated incorrectly. As long as streamlined constraints and decimation use the same bias signal (such as magnetization) for ranking candidate variables, adding streamlined constraints through the above procedure is guaranteed to not degrade performance compared with the decimation strategy in the following sense. Proposition 1. Let F be a formula under consideration for satisfiability, Fd be the formula obtained after one round of survey inspired decimation, and Fs be the formula obtained after one round of survey inspired streamlining. If Fd is satisfiable, then so is Fs. Proof. Because unit-propagation is sound, the formula obtained after one round of survey inspired decimation is satisfiable if and only if (F ^ `i⇤) is satisfiable, where the literal `i⇤denotes either xi⇤ or ¬xi⇤. By construction, the formula obtained after one round of streamlining is F ^ (`i⇤_ `j⇤). It is clear that if (F ^`i⇤) is satisfiable, so is F ^(`i⇤_`j⇤). Clearly, the converse need not be true. 3.3 Algorithmic design choices A practical implementation of survey inspired streamlining requires setting some design hyperparameters. These hyperparameters have natural interpretations as discussed below. 5 Algorithm 2 SurveyInspiredStreamlining(V, C, T) 1: Initialize V V and C C 2: Initialize messages {⌘a!i}a2C,i2V (a) at random 3: while P i |µi(0) −µi(1)| ≥✏do 4: repeat 5: {⌘a!i} SP-Update(V, C, {⌘a!i}) 6: until Convergence to {⌘⇤ a!i} 7: for i = 1, . . . , |V| do 8: µi(0), µi(1), µi(⇤) Marginalize(V, C, {⌘a!i) 9: end for 10: if t < T then 11: . Add Streamlining Constraints 12: Choose i⇤ arg maxi2V |µi(0) −µi(1)| 13: Choose j⇤ arg maxi2V,i6=i⇤|µi(0) −µi(1)| 14: Set y⇤ arg maxy2{0,1} µi⇤(y) 15: Set w⇤ arg maxy2{0,1} µj⇤(y) 16: C C [ {xi⇤= y⇤_ xj⇤= w⇤} 17: else 18: Choose i⇤ arg maxi2V |µi(0) −µi(1)| 19: Set y⇤ arg maxy2{0,1} µi⇤(y) 20: V, C UnitPropagate(V, C [ {xi⇤= y⇤}) 21: end if 22: end while 23: return LocalSearch(V, C) Disjunction pairing. Survey inspired decimation scales to large instances by taking the top R variables as decimation candidates at every iteration instead of a single candidate (Line 13 in Algorithm 1). The parameter R is usually set as a certain fraction of the total number of variables n in the formula, e.g., 1%. For the streamlining constraints, we take the top 2 · R variables, and pair the variables with the highest and lowest magnetizations as a disjunction constraint. We remove these variables from the candidate list, repeating until we have added R disjunctions to the original set of constraints. For instance, if v1, · · · , v2R are our top decimation candidates (with signs) in a particular round, we add the constraints (v1 _ v2R) ^ (v2 _ v2R−1) ^ · · · ^ (vR _ vR+1). Our procedure for scaling to top R decimation candidates ensures that Proposition 1 holds, because survey inspired decimation would have added (v1) ^ (v2) ^ · · · ^ (vR) instead. Other pairing mechanisms are possible, such as for example (v1 _ vR+1) ^ (v2 _ vR+2) ^ · · · ^ (vR _ vR+R). Our choice is motivated by the observation that v2R is the variable we are least confident about - we therefore choose to pair it with the one we are most confident about (v1). We have found our pairing scheme to perform slightly better in practice. Constraint threshold. We maintain a streamlining constraint counter for every variable which is incremented each time the variable participates in a streamlining constraint. When the counter reaches the constraint threshold, we no longer consider it as a candidate in any of the subsequent rounds. This is done to ensure that no single variable dominates the constrained search space. Iteration threshold. The iteration threshold T determines how many rounds of streamlining constraints are performed. While streamlining constraints smoothly guide search to a solution cluster, the trade-off being made is in the complexity of the graph. With every round of addition of streamlining constraints, the number of edges in the graph increases which leads to a higher chance of survey propagation failing to converge. To sidestep the failure mode, we perform T rounds of streamlining before switching to decimation. 4 Empirical evaluation We streamlining constraints for random k-SAT instances for k = {3, 4, 5, 6} with n = {5 ⇥104, 4 ⇥ 104, 3 ⇥104, 104} variables respectively and constraint densities close to the theoretical predictions of the phase transitions for satisfiability. 6 4.23 4.24 4.25 4.26 4.27 α 0.0 0.2 0.4 0.6 0.8 1.0 Solver Success Rate k=3 9.70 9.75 9.80 9.85 9.90 9.95 α 0.0 0.2 0.4 0.6 0.8 1.0 Solver Success Rate k=4 Phase Transition SID SIS 20.0 20.2 20.4 20.6 20.8 21.0 21.2 α 0.0 0.2 0.4 0.6 0.8 1.0 Solver Success Rate k=5 38 39 40 41 42 43 44 α 0.0 0.2 0.4 0.6 0.8 1.0 Solver Success Rate k=6 Figure 2: Random k-SAT solver rates (with 95% confidence intervals) for k 2 {3, 4, 5, 6}, for varying constraint densities ↵. The red line denotes the theoretical prediction for the phase transition of satisfiability. Survey inspired streamlining (SIS) drastically outperforms survey inspired decimation (SID) for all values of k. 4.1 Solver success rates In the first set of experiments, we compare survey inspired streamlining (SIS) with survey inspired decimation (SID). In line with [7], we fix R = 0.01n and each success rate is the fraction of 100 instances solved for every combination of ↵and k considered. The constraint threshold is fixed to 2. The iteration threshold T is a hyperparameter set as follows. We generate a set of 20 random k-SAT instances for every ↵and k. For these 20 “training" instances, we compute the empirical solver success rates varying T over {10, 20, . . . , 100}. The best performing value of T on these train instances is chosen for testing on 100 fresh instances. All results are reported on the test instances. Results. As shown in Figure 2, the streamlining constraints have a major impact on the solver success rates. Besides the solver success rates, we compare the algorithmic thresholds which we define to be the largest constraint density for which the algorithm achieves a success rate greater than 0.05. The algorithmic thresholds are pushed from 4.25 to 4.255 for k = 3, 9.775 to 9.8 for k = 4, 20.1 to 20.3 for k = 5, and 39 to 39.5 for k = 6, shrinking the gap between the algorithmic thresholds and theoretical limits of satisfiability by an average of 16.3%. This is significant as there is virtually no performance overhead in adding streamlining constraints. Distribution of failure modes. Given a satisfiable instance, solvers based on survey propagation could fail for two reasons. First, the solver could fail to converge during message passing. Second, the local search procedure invoked after simplification of the original formula could timeout which is likely to be caused due to a pathological simplification that prunes away most (or even all) of the solutions. In our experiments, we find that the percentage of failures due to local search timeouts in SID and SIS are 36% and 24% respectively (remaining due to non-convergence of message passing). These observations can be explained by observing the effect of decimation and streamlining on the corresponding factor graph representation of the random k-SAT instances. Decimation simplifies the factor graph as it leads to the deletion of variable and factor nodes, as well as the edges induced by the deleted nodes. This typically reduces the likelihood of non-convergence of survey propagation since the graph becomes less “loopy”, but could lead to overconfident (incorrect) branching decisions especially in the early iterations of survey propagation. On the other hand, streamlining takes smaller steps in reducing the search space (as opposed to decimation) and hence are less likely to make inconsistent variable assignments. However, a potential pitfall is that these constraints add factor nodes that make the graph more dense, which could affect the convergence of survey propagation. 7 0 20 40 60 80 100 Iteration 0.70 0.75 0.80 0.85 0.90 0.95 1.00 Marginal Prediction Calibration 0 200 400 600 800 1000 Average Solution Distances Figure 3: Marginal prediction calibration (blue) and sampled solution distances (green) during solver run on 3-SAT with 5000 variables, ↵= 4.15, T = 90. −1.5 −1.0 −0.5 0.0 0.5 1.0 1.5 Survey Propagation Magnetization −1.5 −1.0 −0.5 0.0 0.5 1.0 1.5 Variable Magnetization Iteration 0 −1.0 −0.5 0.0 0.5 1.0 Survey Propagation Magnetization 0 100 200 300 400 500 600 700 Number of Variables −1.5 −1.0 −0.5 0.0 0.5 1.0 1.5 Survey Propagation Magnetization −1.5 −1.0 −0.5 0.0 0.5 1.0 1.5 Variable Magnetization Iteration 50 −1.0 −0.5 0.0 0.5 1.0 Survey Propagation Magnetization 0 100 200 300 400 500 600 700 Number of Variables −1.5 −1.0 −0.5 0.0 0.5 1.0 1.5 Survey Propagation Magnetization −1.5 −1.0 −0.5 0.0 0.5 1.0 1.5 Variable Magnetization Iteration 95 −1.0 −0.5 0.0 0.5 1.0 Survey Propagation Magnetization 0 200 400 600 800 1000 1200 Number of Variables Figure 4: Top: Correlation between magnetization and estimated marginal probabilities for the same problem instance as we add streamlining constraints. Bottom: Histogram of variables magnetizations. As streamlining constraints are added, the average confidence of assignments increases. 4.2 Solution cluster analysis Figures 3 and 4 reveal the salient features of survey inspired streamlining as it runs on an instance of 3-SAT with a constraint density of ↵= 4.15, which is below the best achievable density but is known to be above the clustering threshold ↵d(3) ⇡3.86. The iteration threshold, T was fixed to 90. At each iteration of the algorithm we use SampleSAT [35] to sample 100 solutions of the streamlined formula. Using these samples we estimate the marginal probabilities of all variables i.e., the fraction of solutions where a given variable is set to true. We use these marginal probabilities to estimate the marginal prediction calibration i.e., the frequency that a variable which survey propagation predicts has magnetization at least 0.9 has an estimated marginal at least as high as the prediction. The increase in marginal prediction calibrations during the course of the algorithm (Figure 3, blue curve) suggests that the streamlining constraints are selecting branches that preserve most of the solutions. This might be explained by the decrease in the average Hamming distance between pairs of sampled solutions over the course of the run (green curve). This decrease indicates that the streamlining constraints are guiding survey propagation to a subset of the full set of solution clusters. Over time, the algorithm is also finding more extreme magnetizations, as shown in the bottom three histograms of Figure 4 at iterations 0, 50, and 95. Because magnetization is used as a proxy for how reliably one can branch on a given variable, this indicates that the algorithm is getting more and more confident on which variables it is “safe” to branch on. The top plots of Figure 4 show the empirical marginal of each variable versus the survey propagation magnetization. These demonstrate that overall the survey propagation estimates are becoming more and more risk-averse: by picking variables with high magnetization to branch on, it will only select variables with (estimated) marginals close to one. 8 20.0 20.2 20.4 20.6 20.8 21.0 21.2 α 0.0 0.2 0.4 0.6 0.8 1.0 Solver Success Rate k=5 Phase Transition Dimetheus Streamlining + Dimetheus (a) 38 39 40 41 42 43 44 α 0.0 0.2 0.4 0.6 0.8 1.0 Solver Success Rate k=6 (b) 0.07 0.14 0.21 0.28 0.35 0.42 0.49 0.56 0.63 α 0.0 0.2 0.4 0.6 0.8 1.0 Solver Success Rate k=2 Phase Transition SID SIS (c) Figure 5: (a, b) Random k-SAT solver rates (with 95% confidence intervals) for k 2 {5, 6} testing integration with Dimetheus. (c) XORSAT solver rates (with 95% confidence intervals). 4.3 Integration with downstream solvers The survey inspired streamlining algorithm provides an easy “black-box" integration mechanism with other solvers. By adding streamlining constraints in the first few iterations as a preprocessing routine, the algorithm carefully prunes the search space and modifies the original formula that can be subsequently fed to any external downstream solver. We tested this procedure with Dimetheus [16] – a competitive ensemble solver that won two recent iterations of the SAT competitions in the random k-SAT category. We fixed the hyperparameters to the ones used previously. We did not find any statistically significant change in performance for k = 3, 4; however, we observe significant improvements in solver rates for higher k (Figure 5a,5b). 4.4 Extension to other constraint satisfaction problems The survey inspired streamlining algorithm can be applied to any CSP in principle. Another class of CSPs commonly studied is XORSAT. An XORSAT formula is expressed as a conjunction of XOR constraints of a fixed length. Here, we consider constraints of length 2. An XOR operation ⊕between any two variables can be converted to a conjunction of disjunctions by noting that xi ⊕xj = (¬xi _ ¬xj) ^ (xi _ xj), and hence, any XORSAT formula can be expressed in CNF form. Figure 5c shows the improvements in performance due to streamlining. While we note that the phase transition is not as sharp as the ones observed for random k-SAT (in both theory and practice [11, 28]), including streamlining constraints can improve the solver performance. 5 Conclusion Variational inference algorithms based on survey propagation achieve impressive performance for constraint satisfaction problems when employing the decimation heuristic. We explored cases where decimation failed, motivating a new branching procedure based on streamlining constraints over disjunctions of literals. Using these constraints, we developed survey inspired streamlining, an improved algorithm for solving CSPs via variational approximations. Empirically, we demonstrated improvements over the decimation heuristic on random CSPs that exhibit sharp phase transitions for a wide range of constraint densities. Our solver is available publicly at https://github.com/ ermongroup/streamline-vi-csp. An interesting direction for future work is to integrate streamlining constraints with backtracking. Backtracking expands the search space, and hence it introduces a computational cost but typically improves statistical performance. Similar to the backtracking procedure proposed for decimation [23], we can backtrack (delete) streamlining constraints that are unlikely to render the original formula satisfiable during later iterations of survey propagation. Secondly, it would be interesting to perform survey propagation on clusters of variables and to use the joint marginals of the clustered variables to decide which streamlining constraints to add. The current approach makes the simplifying assumption that the variable magnetizations are independent of each other. Performing survey propagation on clusters of variables could greatly improve the variable selection while incurring only a moderate computational cost. Finally, it would be interesting to extend the proposed algorithm for constraint satisfaction in several real-world applications involving combinatorial optimization such as planning, scheduling, and probabilistic inference [20, 8, 9, 39, 37]. 9 Acknowledgments This research was supported by NSF (#1651565, #1522054, #1733686) and FLI. AG is supported by a Microsoft Research PhD Fellowship and a Stanford Data Science Scholarship. We are grateful to Neal Jean for helpful comments on early drafts. References [1] T. Achim, A. Sabharwal, and S. Ermon. Beyond parity constraints: Fourier analysis of hash functions for inference. In International Conference on Machine Learning, 2016. [2] D. Achlioptas and P. Jiang. Stochastic integration via error-correcting codes. In Uncertainty in Artificial Intelligence, 2015. [3] D. Achlioptas and Y. Peres. The threshold for random-SAT is 2k log 2 −O(k). Journal of the American Mathematical Society, 17(4):947–973, 2004. [4] M. Banko, M. J. Cafarella, S. Soderland, M. Broadhead, and O. Etzioni. Open information extraction for the web. In International Joint Conference on Artificial Intelligence, 2007. [5] A. Biere, M. Heule, H. van Maaren, and T. Walsh. Handbook of satisfiability. Frontiers in artificial intelligence and applications, vol. 185, 2009. [6] D. M. Blei, A. Kucukelbir, and J. D. McAuliffe. Variational inference: A review for statisticians. Journal of the American Statistical Association, 112(518):859–877, 2017. [7] A. Braunstein, M. Mézard, and R. Zecchina. Survey propagation: An algorithm for satisfiability. Random Structures & Algorithms, 27(2):201–226, 2005. [8] M. Chen, Z. Zhou, and C. J. Tomlin. Multiplayer reach-avoid games via low dimensional solutions and maximum matching. In American Control Conference, 2014. [9] M. Chen, Z. Zhou, and C. J. Tomlin. Multiplayer reach-avoid games via pairwise outcomes. IEEE Transactions on Automatic Control, 62(3):1451–1457, 2017. [10] A. Coja-Oghlan and K. Panagiotou. The asymptotic k-SAT threshold. Advances in Mathematics, 288:985–1068, 2016. [11] H. Daudé and V. Ravelomanana. Random 2-XORSAT at the satisfiability threshold. In Latin American Symposium on Theoretical Informatics, pages 12–23. Springer, 2008. [12] J. Ding, A. Sly, and N. Sun. Proof of the satisfiability conjecture for large k. In Symposium on Theory of Computing, 2015. [13] M. B. Do and S. Kambhampati. Planning as constraint satisfaction: Solving the planning graph by compiling it into csp. Artificial Intelligence, 132(2):151–182, 2001. [14] S. Ermon, C. P. Gomes, A. Sabharwal, and B. Selman. Low-density parity constraints for hashing-based discrete integration. In International Conference on Machine Learning, 2014. [15] J. Euzenat, P. Shvaiko, et al. Ontology matching, volume 333. Springer, 2007. [16] O. Gableske, S. Müelich, and D. Diepold. On the performance of CDCL-based message passing inspired decimation using ⇢-σ-PMP-i. Pragmatics of SAT, POS, 2013. [17] C. Gomes and M. Sellmann. Streamlined constraint reasoning. In Principles and Practice of Constraint Programming, pages 274–289. Springer, 2004. [18] C. P. Gomes, W. J. van Hoeve, A. Sabharwal, and B. Selman. Counting CSP solutions using generalized XOR constraints. In AAAI Conference on Artificial Intelligence, 2007. [19] A. Grover and S. Ermon. Variational bayes on Monte Carlo steroids. In Advances in Neural Information Processing Systems, 2016. [20] J. Hromkoviˇc. Algorithmics for hard problems: introduction to combinatorial optimization, randomization, approximation, and heuristics. Springer Science & Business Media, 2013. [21] L. Kroc, A. Sabharwal, and B. Selman. Message-passing and local heuristics as decimation strategies for satisfiability. In Symposium on Applied Computing, 2009. [22] E. Maneva, E. Mossel, and M. J. Wainwright. A new look at survey propagation and its generalizations. Journal of the ACM, 54(4):17, 2007. 10 [23] R. Marino, G. Parisi, and F. Ricci-Tersenghi. The backtracking survey propagation algorithm for solving random k-SAT problems. Nature communications, 7:12996, 2016. [24] M. Mézard, G. Parisi, and R. Zecchina. Analytic and algorithmic solution of random satisfiability problems. Science, 297(5582):812–815, 2002. [25] D. Mitchell, B. Selman, and H. Levesque. Hard and easy distributions of SAT problems. In AAAI Conference on Artificial Intelligence, 1992. [26] M. Molloy. Models for random constraint satisfaction problems. SIAM Journal on Computing, 32(4):935–949, 2003. [27] W. Nuijten. Time and resource constrained scheduling: a constraint satisfaction approach. PhD thesis, TUE: Department of Mathematics and Computer Science, 1994. [28] B. Pittel and G. B. Sorkin. The satisfiability threshold for k-XORSAT. Combinatorics, Probability and Computing, 25(2):236–268, 2016. [29] H. Ren, R. Stewart, J. Song, V. Kuleshov, and S. Ermon. Adversarial constraint learning for structured prediction. International Joint Conference on Artificial Intelligence, 2018. [30] M. Richardson and P. Domingos. Markov logic networks. Machine Learning, 62(1):107–136, 2006. [31] B. Selman, H. A. Kautz, and B. Cohen. Noise strategies for improving local search. In AAAI Conference on Artificial Intelligence, 1994. [32] P. Singla and P. Domingos. Entity resolution with Markov logic. In International Conference on Data Mining, 2006. [33] R. Stewart and S. Ermon. Label-free supervision of neural networks with physics and domain knowledge. In AAAI Conference on Artificial Intelligence, 2017. [34] M. J. Wainwright and M. I. Jordan. Graphical models, exponential families, and variational inference. Foundations and Trends in Machine Learning, 1(1-2):1–305, 2008. [35] W. Wei, J. Erenrich, and B. Selman. Towards efficient sampling: exploiting random walk strategies. In AAAI Conference on Artificial Intelligence, 2004. [36] S. Zhao, S. Chaturapruek, A. Sabharwal, and S. Ermon. Closing the gap between short and long XORs for model counting. In AAAI Conference on Artificial Intelligence, 2016. [37] Z. Zhou, J. Ding, H. Huang, R. Takei, and C. Tomlin. Efficient path planning algorithms in reach-avoid problems. Automatica, 89:28–36, 2018. [38] Z. Zhou, P. Mertikopoulos, N. Bambos, S. Boyd, and P. W. Glynn. Stochastic mirror descent in variationally coherent optimization problems. In Advances in Neural Information Processing Systems, 2017. [39] Z. Zhou, M. P. Vitus, and C. J. Tomlin. Convexity verification for a hybrid chance constrained method in stochastic control problems. In American Control Conference, 2014. 11
2018
12
7,275
A Bridging Framework for Model Optimization and Deep Propagation Risheng Liu1,2∗, Shichao Cheng3, Xiaokun Liu1, Long Ma1, Xin Fan1,2, Zhongxuan Luo2,3 1International School of Information Science & Engineering, Dalian University of Technology 2Key Laboratory for Ubiquitous Network and Service Software of Liaoning Province 3School of Mathematical Science, Dalian University of Technology Abstract Optimizing task-related mathematical model is one of the most fundamental methodologies in statistic and learning areas. However, generally designed schematic iterations may hard to investigate complex data distributions in real-world applications. Recently, training deep propagations (i.e., networks) has gained promising performance in some particular tasks. Unfortunately, existing networks are often built in heuristic manners, thus lack of principled interpretations and solid theoretical supports. In this work, we provide a new paradigm, named Propagation and Optimization based Deep Model (PODM), to bridge the gaps between these different mechanisms (i.e., model optimization and deep propagation). On the one hand, we utilize PODM as a deeply trained solver for model optimization. Different from these existing network based iterations, which often lack theoretical investigations, we provide strict convergence analysis for PODM in the challenging nonconvex and nonsmooth scenarios. On the other hand, by relaxing the model constraints and performing end-to-end training, we also develop a PODM based strategy to integrate domain knowledge (formulated as models) and real data distributions (learned by networks), resulting in a generic ensemble framework for challenging real-world applications. Extensive experiments verify our theoretical results and demonstrate the superiority of PODM against these state-of-the-art approaches. 1 Introduction In the last several decades, many machine learning and computer vision tasks have been formulated as the problems of solving mathematically designed optimization models. Indeed, these models are the workhorse of learning, vision and power in most practical algorithms. However, it is actually hard to obtain a theoretically efficient formulation to handle these complex data distributions in different practical problems. Moreover, generally designed optimization models [3, 5] may be lack of flexibility and robustness leading to severe corruptions and errors, which are commonly existed in real-world scenarios. In recent years, a variety of deep neural networks (DNNs) have been established and trained in end-toend manner for different learning and vision problems. For example, AlexNet [13] first demonstrated the advantages of DNNs in the challenge of ImageNet large scale visual recognition. With a careful design, [29] proposed GoogleNet, which increased the depth and width of the network while keeping the computational budget constant. However, some researchers also found that although increasing the layers of the networks may improve the performance, it is more difficult to train a deeper network. By introducing shortcut blocks, [10] proposed the well-known residual network. It has been verified that the residual structure can successfully avoid gradient vanishing problems and thus significantly ∗Corresponding Author. Correspondence to <rsliu@dlut.edu.cn>. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. improve the practical training performance for deeper network. Besides the great success of DNNs in supervised learning, some efforts have also been made on unsupervised learning tasks. [8] proposed the generative adversarial network, which utilizes a pair of generator network and discriminator network contesting with each other in a zero-sum game framework to generate the realistic samples. Though with relatively good performance on specific applications, the interpretability issue is still a big problem for existing DNNs. That is, it is challenging to reason about what a DNN model actually does due to its opaque or black-box nature. Embedding DNNs into the optimization process is recently popular and some preliminary works have been developed from different perspectives. For example, [9] trained a feed-forward architecture to speed up sparse coding problems. [1] introduced deep transformations to address correlation analysis on multiple view data. Very recently, to better address the true image degradation, [7, 33, 30] incorporated convolutional DNN as image priors into the maximum a posterior inference process for image restoration. Another group of recent works also tried to utilize recurrent neural network (RNN) structures [2] and/or reinforcement strategies [17] to directly learn descent iterations for different learning tasks. It should be pointed out that the convergence issue should be the core for optimization algorithm design. Unfortunately, even with relatively good practical performance on some applications, till now it is still challenging to provide strict convergence analysis on these deeply trained iterations. 1.1 Our Contributions As discussed above, the interpretability and guarantees are the most important missing footstones for the previous experience based networks. Some preliminary investigations have been proposed to combine numerical iterations and learnable architectures for deep propagations design. However, due to these naive combination strategies (e.g., directly replace iterations by architectures), it is still challenging to provide strict convergence analysis on their resulted deep models. To partially break through these limitations, this paper proposes a theoretically guaranteed paradigm, named Propagation and Optimization based Deep Model (PODM), to incorporate knowledge-driven schematic iterations and data-dependent network architectures to address both model optimization and learning tasks. On the one hand, PODM actually provides a learnable (i.e., data-dependent) numerical solver (See Fig. 1). Compared with these naive unrolling based methods (e.g., [7, 33, 30, 17, 2, 20]), the main advantage of PODM is that we can generate iterations, which strictly converge to the critical point of the given optimization model, even in the complex nonconvex and nonsmooth scenarios. On the other hand, by slightly relaxing the exact optimality constraints during propagations, we can also obtain an interpretable framework to integrate mathematical principles (i.e., formulated by model based building-block) and experience of the tasks (i.e., network structures designed in heuristic manners) for collaborative end-to-end learning. In summary, the contributions of this paper mainly include: • We provided a model-inspired paradigm to establish building-block modules for deep model design. Different from existing trainable iteration methods, in which the architectures are built either from specific prior formulations (e.g., Markov random fields [24]) or completely in heuristic manners (e.g., replace original priors by experience based networks [7, 33]), we develop a flexible framework to integrate both data (investigated from training set) and knowledge (incorporated into principled priors) for deep propagations construction. • By introducing an optimality error checking condition together with a proximal feedback mechanism, we prove in theory that the propagation generated by PODM is globally2 convergent to the critical point of the given optimization model. Such strict convergent guarantee is just the main advantage against these existing deep iterations designed in heuristic manner (e.g., [7, 33, 30, 17, 2]) • As a nontrivial byproduct, the relaxed PODM actually provides a plug-and-play, collaborative, interpretable, and end-to-end deep learning framework for real-world complex tasks. Extensive experimental results on real-world image restoration applications demonstrate the effectiveness of our PODM and its relaxed extension. 2Here “globally” indicates that we generate a Cauchy sequence, thus the whole sequence is convergent. 2 Conv+ELU Conv+ELU Conv+ELU Conv+ELU Conv+ELU Conv+Linear Optimality Error Yes No . . . . . . ... Figure 1: Illustrating the mechanism of PODM for nonconvex model optimization. 2 Existing Trainable Iterations: Lack Generalizations and Guarantees We review existing training based iterative methods for model optimization. Specifically, most learning and vision tasks can be formulated as the following regularized optimization model: min x Φ(x) := f(x) + g(x), (1) where f denotes the loss term and g is related to the regularization term. Different from classical numerical solvers, which design their iterations purely based on mathematical derivations. Recent studies try to establish their optimization process based on training iterative architectures on collected training data. These existing works can be roughly divided into two categories: trainable priors and network based iterations. The first category of methods aim to introduce hyper parameters for specific prior formulations (e.g., ℓ1-norm and RTF) and then unroll the resulted updating schemes to obtain trainable iterations for Eq (1). For example, the works in [9, 27] parameterize the ℓ1 regularizer and adopt classical first-order methods to derivate their final iterations. The main limitation of these approaches is that their schemes are established based on specific forms of priors, thus cannot be applied for general learning/vision problems. Even worse, the hyper parameters in these approaches (e.g., trade-off or combination weights) are too simple to extract complex data distributions. On the other hand, the works in [7, 33] try to directly replace prior-related numerical computations at each iteration by experientially designed network architectures. In this way, these approaches actually completely discard the explicit regularization g in their updating schemes. Very recently, the recurrent [2], unrolling [19] and reinforcement [17] learning strategies have also been introduced to train network based iterations for model optimization. Since these approaches completely discard the original regularizations (i.e., g), no prior knowledges can be enforced in their iterations. More importantly, we must emphasize that due to these embedded inexact computations, it is challenging to provide strict convergence analysis on most of above mentioned trainable iterations. 3 Our Model Inspired Building-Blocks In this section, we establish two fundamental iterative modules as our trainable architectures for both model optimization and deep propagation. Specifically, the deep propagation module is designed as our generic architecture to incorporate domain knowledge into trainable propagations. While the optimization module actually enforces feedback control to guide the iterations to satisfy our optimality errors. The mechanism of PODM is briefly illustrated in Fig. 1. Suppose A is the given network architecture (may built in heuristic manner) and denote its output as xA = A(x; θA). We would like to design our propagation module based on both A and Φ defined in Eq. (1). Specifically, rather than parameterizing g or completely replace it by networks in existing works, we integrate these two parts by the following quadratic penalized energy: min x Φ(x) + d(x, xA) −⟨x, ϵ⟩= min x Knowledge z }| { f(x) |{z} Fidelity + g(x) |{z} Designed prior + Data z }| { d(x, xA) | {z } Learned prior −⟨x, ϵ⟩ | {z } Error . (2) 3 Here, d(x, xA) is the distance function which intents to introduce the output of network into the propagation module. It can be defined as d(x, xA) = h(x) −h(xA) −⟨∇h(xA), x −xA⟩, where h(x) = ∥· ∥2 H and H denotes a symmetric matrix3. ϵ denotes the error corresponding to Eq. (1) since introducing the network. Both the designed prior g(x) and learned prior d(x, xA) are merged to compose our hybrid priors. Please notice that Eq. (2) can also be understood as a hybrid prior based inexact approximation of Eq. (1), in which we establish an ensemble of both domain knowledge (i.e., g) and training data (i.e., A). Indeed, we can control the inexact solution by calculating the specific function about ϵ. Propagation Module: We first investigate the following sub-model of Eq. (2) (i.e., only with fidelity and learned priors) xF = F(xA; θH) := arg min x {f(x) + d(x, xA)} , (3) where θH denotes the parameter in distance d(x, xA). Eq. (3) actually integrates the principled model fidelity (i.e., f) and network based priors (A). Following this formulation, we can define our data-dependent propagation module (P) as the cascade of A and F in the l-th stage, i.e., ˜xl = P(xl−1; ϑl) := F A xl−1; θl A  ; θl H  , where ϑl = {θl A, θl H} is the set of trainable parameters. Optimality Module: Due to the inexactness of these learning based architectures, the propagation module definitely brings errors when optimizing Eq. (1). To provide effective control for these iterative errors and generate strictly convergent propagations, we recall the designed prior g and assume xl G is one solution of Eq. (2) in the l-th stage, i.e., xl G ∈G(˜xl) := arg min x f(x) + g(x) + d(x, xl A) −⟨x, ϵl⟩. (4) The error ϵl has a specific form as ϵl = ∇f(xl G) + ∇d(xl G, xl A) + uxl G by considering the first-order optimality condition of Eq. (4). Here uxl G ∈∂g(xl G) is a limiting Ferchet subdifferential of g. Intuitively, it is necessary to introduce some criteria about ϵl to illustrate the current propagation whether satisfied the desired convergence behavior. Fortunately, we can demonstrate that the convergence of our deep propagations can be successfully guaranteed by the following optimality error: ∥ψ(ϵl)∥≤cl∥xl G −xl−1∥. (5) Here ψ(ϵl) = ϵl + µl(xl G −xl−1)/2 −H(xl−1 + xl G −2xl A) is the error function and cl is a positive constant to reveal our tolerance of the inexactness at the l-th stage. Therefore, as stated in the following Eq. (6), we adopt xl G as the output of our optimality module in the l-th stage if the criterion in Eq. (5) is satisfied. Otherwise, we return to the previous stage and adopt a standard proximal gradient updating (i.e., feedback) to correct the propagation. O(˜xl, xl−1; γl) :=  G(˜xl) if Eq. (5) is satisfied, proxγlg(xl−1 −γl(∇f(xl−1))) otherwise. (6) In this way, our optimality module actually provides a mechanism with proximal operator to guide the propagations toward convergence. Notice that both xl G and ϵl are abstracted in above optimality module. Actually, temporarily ignoring the learned prior and error in Eq (2), we can provide a practical calculative form of xl G by calculating the traditionally designed prior appeared in Eq. (2) (i.e., Eq. (1), only with fidelity and designed priors) with a momentum proximal mechanism as follows, xl G ∈proxγlg ˜xl −γl ∇f(˜xl) + µl(˜xl −xl−1)  , (7) where µl is the trade-off parameter, and γl denotes the step size. On the other hand, the updating of xl G can also be reformulated4 as xl G ∈proxγlg xl G −γl ∇f(xl G) + µl(xl G −xl A)  + γlϵl . Thus, Combining it with Eq. (7), we can obtain a practical computable formulation of error function ψ(ϵl) appeared in optimality error as ψ(ϵl) = 1 γl (˜xl −xl G) −µl 2 (2˜xl −xl G −xl−1) + H(xl G −xl−1) + ∇f(xl G) −∇f(˜xl). 3d(x, xA) actually is a special Bregman distance. H can be an assigned or learnable matrix. The distance d(x, xA) = µ∥x −xA∥2 if H = µI. We will detailed illustrate it on specific applications in experiments. 4The detained deductions on this equality reformulation can be found in the supplementary materials. 4 4 Propagation and Optimization based Deep Model Based on the above building-block modules, it is ready to introduce Propagation and Optimization based Deep Model (PODM). We first show how to apply PODM to perform fast and accurate model optimization and analyze its convergence behaviors in nonconvex and nonsmooth scenarios. Then we discuss how to establish end-to-end type PODM with relaxed optimality error to perform practical ensemble learning for challenging real-world applications. 4.1 PODM: A Deeply Trained Nonconvex Solver with Strict Convergence Guarantee We demonstrate how to apply PODM for fast and accurate nonconvex optimization. It should be emphasized that different from most existing trainable iteration methods, which either incorporate networks into the iterations in heuristic manner (e.g., [33, 7]) or directly estimate data-dependent descent directions using networks (e.g., [17, 2]), PODM provides a nice mechanism with optimality error to control the training based propagations. It will be stated in the following that the main advantage of our PODM is that the convergence of our iterations can be strictly guaranteed, while no theoretical guarantees are provided for the above mentioned experientially trained iterations. PODM for Nonconvex and Nonsmooth Optimization: We first illustrate the mechanism of PODM in Fig. 1. It can be seen that PODM consists of two fundamental modules, i.e., experientially designed (trainable) propagation module P and theoretically designed optimality module O. It should be pointed out that to guarantee the theoretical convergence, only the parameters θl A are learned when considering PODM as an accurate numerical solver5. Convergence Behaviors Analysis: Before providing our main theory, we give some statements about functions appeared in our optimization model. Specifically, we assume that f is Lipschitz smooth, g is proper and lower semi-continuous, d is differential, and Φ is coercive6. All of these assumptions are fairly loose in most model optimization tasks. Proposition 1. Suppose that the optimality error in Eq.(5) (i.e., ∥ψ(ϵl)∥≤cl∥xl G−xl−1∥) is satisfied, then we have Φ(xl G) ≤Φ(xl−1) − µl/4 −cl2/µl ∥xl G −xl−1∥2. In contrast, if the inequality in Eq. (5) is not satisfied and thus the variable is updated by xl = proxγlg(xl−1 −γl(∇f(xl−1))). Then we have Φ(xl) ≤Φ(xl−1) − 1/(2γl) −Lf/2  ∥xl −xl−1∥2, where Lf is the Lipschitz modulus of ∇f(x). Actually, Proposition 1 provides us a nice descent property for PODM on the variational energy Φ(x) during iterations. That is, it is easy to obtain a non-increase sequence {Φ(xl)}l∈N, which results in a limited value Φ∗so that liml→∞Φ(xl) = Φ∗< ∞. Moreover, if {xl}l∈N is bounded, there exists a convergence subsequence such that limj→∞xlj = x∗, where {lj} ⊂{l} ⊂N. Then from the conclusions in Proposition 1, we also have the sum of ∥xl −xl−1∥2 from l = 1 to l →∞is bounded. Thus we can further prove the following proposition. Proposition 2. Suppose x∗is any accumulation point of sequence {xl}l∈N generalized by PODM, then there exists a subsequence {xlj}j∈N such that lim j→∞xlj = x∗, and lim j→∞Φ(xlj) = Φ(x∗). Based on the above results, it is ready to establish the convergence results for our PODM when considering it as a numerical solver for nonconvex model optimization. Theorem 1. (Converge to the Critical Point of Eq. (1)) Suppose f is proper and Lipschitz smooth, g is proper and lower semi-continuous, and Φ is coercive. Then the output of PODM (i.e., {xl}l∈N) satisfies: 1. The limit points of {xl}l∈N (denoted as Ω) is a compact set; 2. All elements of Ωare the critical points of Φ; 3. If Φ is a semi-algebraic function, {xl}l∈N converges to a critical point of Φ. In summary, we actually prove that PODM provides a novel strategy to iteratively guide the propagations of deep networks toward the critical point of the given nonconvex optimization model, leading to a fast and accurate numerical solver. 5Notice that both θl A and θl H are learnable in the Relaxed PODM, which will be introduced in Section 4.2. The algorithms of PODM and Relaxed PODM are presented in the supplementary materials. 6Due to the space limit, we omit the details of these definitions, all proofs of the following propositions and theorem. The detailed version is presented in the supplementary materials. 5 4.2 Relaxed PODM: An End-to-end Collaborative Learning Framework It is shown in the above subsection that by enforcing a carefully designed optimality error and greedily train the networks, we can obtain a theoretically convergent solver for nonconvex optimization. However, it is indeed challenging to utilize strict mathematical models to exactly formulate the complex data distributions in real-world applications. Therefore, in this subsection, we would like to relax the theoretical constraint and develop a novel end-to-end learning framework to address real-world tasks. In particular, rather than only training the parameters θl A in given network A, we also introduce flexible networks to learn parameters θl H in F at each layer. Therefore, at the l-th layer, we actually have two groups of learnable parameters, including θl A for A and θl H for F. The forward propagation of the so-called Relaxed PODM (RPODM) at each stage can be summarized as xl = G F A xl−1; θl A  ; θl H  . We would like to argue that RPODM actually provides a way to train the network structure using both domain knowledges and training data, thus results in a nice collaborative learning framework. 5 Experimental Results We first analyze the convergence behaviors of PODM by applying it to solve the widely used nonconvex ℓp-regularized sparse coding problem. Then, we evaluate the performance of our Relaxed PODM on the practical image restoration applications. All the experiments are conducted on a PC with Intel Core i7 CPU @ 3.6 GHz, 32 GB RAM and an NVIDIA GeForce GTX 1060 GPU. 5.1 PODM for ℓp-regularized Sparse Coding Now we consider the nonconvex ℓp-regularized (0 < p < 1) sparse coding model: minα ∥Dα−o∥2+ λ∥α∥p p, which has been widely used for synthetic image modeling [18, 22], subspace clustering [21] and motion segmentation [31], etc. Here λ is the regularization parameter, o, D and α denote the observed signal, a given dictionary, and the corresponding sparse codes, respectively. In our experiments, we formulate D as the multiplication of the down-sampling operator and the inverse of a three-stage Haar wavelet transform [3], which results in a sparse coding based single image super-resolution formulation. We consider ℓ0.8-norm to enforce the sparsity constraint. As for PODM, we define H = µI/2 with µ = 1e −2 in the distance function d (i.e., d(x, xA) = µ∥x −xA∥2/2) to establish the propagation and optimality modules. For fair comparison, we just adopt the network architecture used in existing works (i.e., IRCNN [33]) as A for PODM. To verify the convergence properties of our framework, we plotted the iteration behaviors of PODM on example images from the commonly used “Set5” super-resolution benchmark [4] and compared it with the most popular numerical solvers (e.g., FISTA [3]) and the recently proposed representative network based iteration methods (e.g., IRCNN [33]). Fig. 2 showed the curves of relative error (i.e., log10(∥xl+1 −xl∥/∥xl∥)), reconstruction error (i.e., ∥xl −xgt∥/∥xgt∥), structural similarity (SSIM) and our optimality error defined in Eq. (5). It can be observed that the curves of relative error (i.e. subfigure (a)) for IRCNN is always oscillating and cannot converge even after 200 stages. This is mainly due to its naive network embedding strategy. Although with a little bit smooth relative errors, FISTA is much slower than our PODM. Meanwhile, we observed that PODM also has better performance than other two schemes in terms of the restoration error (in subfigure (b), lower is better) and SSIM (in subfigure (c), higher is better). Furthermore, we also explored the optimality error of our PODM. It can be seen from subfigure (d) that the optimality error is always satisfied. This means that the learnable architectures can always be used to improve the iteration process of PODM. We then reported the average quantitative scores (i.e., PSNR and SSIM) on two benchmark datasets [4, 32]. As shown in Table 1, the quantitative performance of PODM are much better than all the compared methods on all up-sampling scales (i.e., ×2, ×3, ×4). 5.2 Relaxed PODM for Image Restoration Image restoration is one of the most challenging low-level vision problems, which aims to recover a latent clear image u from the blurred and noised observation o. To evaluate the Relaxed PODM (RPODM) paradigm, we would like to formulate the image restoration task as u by solving minu ∥k ⊗u −o∥2 + χΩ(u), where k and n are respectively the blur kernel and the noises, 6 (a) (b) (c) (d) Figure 2: Convergence curves of FISTA, IRCNN, and our PODM. Subfigures (a)-(c) are the relative error, reconstruction error and SSIM, respectively. Subfigure (d) plots the “Optimality Error” appeared in PODM. Table 1: Averaged quantitative performance on super-resolution with different up-sampling scales. Scale Metric [4] [32] FISTA IRCNN Ours FISTA IRCNN Ours ×2 PSNR 35.14 37.43 37.46 31.41 32.88 33.06 SSIM 0.94 0.96 0.98 0.90 0.91 0.95 ×3 PSNR 31.35 33.39 33.44 28.39 29.61 29.77 SSIM 0.88 0.92 0.96 0.81 0.83 0.90 ×4 PSNR 29.26 31.02 31.05 26.93 27.72 27.86 SSIM 0.83 0.88 0.93 0.76 0.76 0.85 Table 2: Averaged quantitative performance on image restoration. Metric TV HL EPLL CSF RTF MLP IRCNN Ours [15] PSNR 29.38 30.12 31.65 32.74 33.26 31.32 32.51 34.06 SSIM 0.88 0.90 0.93 0.93 0.94 0.90 0.92 0.97 TIME 1.22 0.10 70.32 0.12 26.63 0.49 2.85 1.46 [28] PSNR 30.67 31.03 32.44 31.55 32.45 31.47 32.61 32.62 SSIM 0.85 0.85 0.88 0.87 0.89 0.86 0.89 0.89 TIME 6.38 0.49 721.98 0.50 240.98 4.59 16.67 1.95 and χΩis the indicator function of the set Ω. Here we define Ω= {u|∥u∥0 ≤s, a ≤[u]i ≤ b, with s > 0, a = mini{[o]i}, b = maxi{[o]i}, i = 1, · · · , n.} to enforce our fundamental constraints on u. It is easy to check that the proximal operator corresponding to χΩcan be written as proxχΩ(u) := HardThre(Proj[a,b](u)), where HardThre(·) and Proj[a,b](·) are the hard thresholding and projection operators, respectively. Then we would like to introduce learnable architectures to build RPODM. Specifically, by considering the distance measure d(x, xA) in filtered space, we define H = µ PN n=1 f ⊤ n fn/2, where {fn} denote the filtering operations. In this way, the propagation module can be directly obtained by solving Eq. (3) in closed form, i.e., xF = (K⊤K + µ PN n=1 F⊤ n Fn)−1(K⊤o + µ PN n=1 F⊤ n FnxA), where K and {Fn} are blockcirculant matrices corresponding to convolutions. Inspired by [14], here we just introduce a multilayer perceptron and the DCT basis to output the parameter µ and construct the filters {fn}, respectively. Then we adopt a CNN architecture with 6 convolutional layers (the first 5 layers followed by ELU [6] activations) as A for our deep propagation. Comparisons with State-of-the-art Methods: We compared RPODM with several state-of-the-art image restoration approaches, including traditional numerical methods (e.g. TV [16], HL [12]), learning based methods (e.g. EPLL [34], MLP [26]), and deep unrolling methods (e.g. CSF [25], RTF [24], IRCNN [33]). We first conducted experiments on the most widely used Levin et al.’ benchmark [15], with 32 blurry images of size 255 × 255. We also evaluated all these compared methods on the more challenging Sun et al.’ benchmark [28], which includes 640 blurry images with 1% Gaussian noises, sizes range from 620×1024 to 928×1024. Table 2 reported the quantitative results (i.e., PSNR, SSIM and TIME (in seconds)). It can be seen that our proposed method 7 PSNR / SSIM 32.00 / 0.94 34.65 / 0.95 35.67 / 0.96 35.47 / 0.95 36.75 / 0.98 PSNR / SSIM 31.28 / 0.86 29.86 / 0.82 31.14 / 0.86 31.35 / 0.87 31.65 / 0.87 Blurred Image EPLL CSF RTF IRCNN Ours Figure 3: Image restoration results on two example images, where the inputs on the top and bottom rows are respectively from Levin et al.’ and Sun et al.’ benchmarks. The PSNR / SSIM are reported below each image. Blurred Image EPLL CSF RTF IRCNN Ours Figure 4: Image restoration results on the real blurry image. can consistently obtain higher quantitative scores than other approaches, especially on Levin et al.’ dataset [15]. As for the running time, we observed that RPODM is much faster than most conventional optimization based approaches and recently proposed learning based iteration methods (i.e., TV, EPLL, RTF, MLP and IRCNN). While the speeds of HL and CSF are slightly faster than RPODM. Unfortunately, the performance of these two simple methods are much worse than our approach. The qualitative comparisons in Fig. 3 also verified the effectiveness of RPODM. Real Blurry Images: Finally, we evaluated RPODM on the real-world blurry images [11] (i.e., with unknown blur kernel and 1% additional Gaussian noises). We adopted the method in [23] to estimate a rough blur kernel. In Fig. 4, we compared the image restoration results of RPODM with other competitive methods (top 4 in Table 2, i.e., EPLL, CSF, RTF, and IRCNN) based on this estimated kernel. It can be seen that even with the roughly estimated kernel (maybe inexact), RPODM can still obtain clear image with richer details and more plentiful textures (see zoomed in regions). 6 Conclusions This paper proposed Propagation and Optimization based Deep Model (PODM), a new paradigm to integrate principled domain knowledge and trainable architectures to build deep propagations for model optimization and machine learning. As a learning based numerical solver, we proved in theory that the sequences generated by PODM can successfully converge to the critical point of the given nonconvex and nonsmooth optimization model. Furthermore, by relaxing the optimality error, we actually also obtain a plug-and-play, collaborative, interpretable, and end-to-end deep model for real-world complex tasks. Extensive experimental results verified our theoretical investigations and demonstrated the effectiveness of the proposed framework. Acknowledgments This work is partially supported by the National Natural Science Foundation of China (Nos. 61672125, 61733002, 61572096 and 61632019), and Fundamental Research Funds for the Central Universities. 8 References [1] Galen Andrew, Raman Arora, Jeff Bilmes, and Karen Livescu. Deep canonical correlation analysis. In ICML, pages 1247–1255, 2013. [2] Marcin Andrychowicz, Misha Denil, Sergio Gomez, Matthew W Hoffman, David Pfau, Tom Schaul, and Nando de Freitas. Learning to learn by gradient descent by gradient descent. In NIPS, pages 3981–3989, 2016. [3] Amir Beck and Marc Teboulle. A fast iterative shrinkage-thresholding algorithm for linear inverse problems. SIAM Journal on Imaging Sciences, 2(1):183–202, 2009. [4] Marco Bevilacqua, Aline Roumy, Christine Guillemot, and Marie Line Alberi-Morel. Low-complexity single-image super-resolution based on nonnegative neighbor embedding. In BMVC, pages 1–10, 2012. [5] 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. [6] 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. [7] Steven Diamond, Vincent Sitzmann, Felix Heide, and Gordon Wetzstein. Unrolled optimization with deep priors. arXiv preprint arXiv:1705.08041, 2017. [8] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In NIPS, pages 2672–2680, 2014. [9] Karol Gregor and Yann LeCun. Learning fast approximations of sparse coding. In ICML, pages 399–406, 2010. [10] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, pages 770–778, 2016. [11] Rolf Köhler, Michael Hirsch, Betty Mohler, Bernhard Schölkopf, and Stefan Harmeling. Recording and playback of camera shake: Benchmarking blind deconvolution with a real-world database. In ECCV, pages 27–40, 2012. [12] Dilip Krishnan and Rob Fergus. Fast image deconvolution using hyper-laplacian priors. In NIPS, pages 1033–1041, 2009. [13] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In NIPS, pages 1097–1105, 2012. [14] Jakob Kruse, Carsten Rother, and Uwe Schmidt. Learning to push the limits of efficient fft-based image deconvolution. In ICCV, pages 4586–4594, 2017. [15] Anat Levin, Yair Weiss, Fredo Durand, and William T. Freeman. Understanding and evaluating blind deconvolution algorithms. In CVPR, pages 1964–1971, 2009. [16] Chengbo Li, Wotao Yin, Hong Jiang, and Yin Zhang. An efficient augmented lagrangian method with applications to total variation minimization. Computational Optimization & Applications, 56(3):507–530, 2013. [17] Ke Li and Jitendra Malik. Learning to optimize. arXiv preprint arXiv:1606.01885, 2016. [18] Risheng Liu, Shichao Cheng, Yi He, Xin Fan, Zhouchen Lin, and Zhongxuan Luo. On the convergence of learning-based iterative methods for nonconvex inverse problems. arXiv preprint arXiv:1808.05331, 2018. [19] Risheng Liu, Xin Fan, Shichao Cheng, Xiangyu Wang, and Zhongxuan Luo. Proximal alternating direction network: A globally converged deep unrolling framework. In AAAI, 2018. [20] Risheng Liu, Xin Fan, Minjun Hou, Zhiying Jiang, Zhongxuan Luo, and Lei Zhang. Learning aggregated transmission propagation networks for haze removal and beyond. IEEE TNNLS, (99):1–14, 2018. [21] Risheng Liu, Zhouchen Lin, and Zhixun Su. Learning markov random walks for robust subspace clustering and estimation. Neural Networks, 59:1–15, 2014. [22] Risheng Liu, long Ma, Yiyang Wang, and Lei Zhang. Learning converged propagations with deep prior ensemble for image enhancement. arXiv preprint arXiv:1810.04012v1, 2018. 9 [23] Jinshan Pan, Zhouchen Lin, Zhixun Su, and Ming-Hsuan Yang. Robust kernel estimation with outliers handling for image deblurring. In CVPR, pages 2800–2808, 2016. [24] Uwe Schmidt, Jeremy Jancsary, Sebastian Nowozin, Stefan Roth, and Carsten Rother. Cascades of regression tree fields for image restoration. IEEE TPAMI, 38(4):677–689, 2016. [25] Uwe Schmidt and Stefan Roth. Shrinkage fields for effective image restoration. In CVPR, pages 2774–2781, 2014. [26] Christian J Schuler, Harold Christopher Burger, Stefan Harmeling, and Bernhard Scholkopf. A machine learning approach for non-blind image deconvolution. In CVPR, pages 1067–1074, 2013. [27] Pablo Sprechmann, Alexander M Bronstein, and Guillermo Sapiro. Learning efficient sparse and low rank models. IEEE TPAMI, 37(9):1821–1833, 2015. [28] Libin Sun, Sunghyun Cho, Jue Wang, and James Hays. Edge-based blur kernel estimation using patch priors. In ICCP, pages 1–8, 2013. [29] Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In CVPR, pages 1–9, 2015. [30] Dmitry Ulyanov, Andrea Vedaldi, and Victor Lempitsky. Deep image prior. arXiv preprint arXiv:1711.10925, 2017. [31] Jingyu Yan and Marc Pollefeys. A general framework for motion segmentation: Independent, articulated, rigid, non-rigid, degenerate and non-degenerate. In ECCV, pages 94–106, 2006. [32] Roman Zeyde, Michael Elad, and Matan Protter. On single image scale-up using sparse-representations. In International conference on curves and surfaces, pages 711–730, 2010. [33] Kai Zhang, Wangmeng Zuo, Shuhang Gu, and Lei Zhang. Learning deep cnn denoiser prior for image restoration. In CVPR, pages 2808–2817, 2017. [34] Daniel Zoran and Yair Weiss. From learning models of natural image patches to whole image restoration. In ICCV, pages 479–486, 2011. 10
2018
120
7,276
Learning filter widths of spectral decompositions with wavelets Haidar Khan Department of Computer Science Rensselaer Polytechnic Institute Troy, NY 12180 khanh2@rpi.edu Bülent Yener Department of Computer Science Rensselaer Polytechnic Institute Troy, NY 12180 yener@rpi.edu Abstract Time series classification using deep neural networks, such as convolutional neural networks (CNN), operate on the spectral decomposition of the time series computed using a preprocessing step. This step can include a large number of hyperparameters, such as window length, filter widths, and filter shapes, each with a range of possible values that must be chosen using time and data intensive cross-validation procedures. We propose the wavelet deconvolution (WD) layer as an efficient alternative to this preprocessing step that eliminates a significant number of hyperparameters. The WD layer uses wavelet functions with adjustable scale parameters to learn the spectral decomposition directly from the signal. Using backpropagation, we show the scale parameters can be optimized with gradient descent. Furthermore, the WD layer adds interpretability to the learned time series classifier by exploiting the properties of the wavelet transform. In our experiments, we show that the WD layer can automatically extract the frequency content used to generate a dataset. The WD layer combined with a CNN applied to the phone recognition task on the TIMIT database achieves a phone error rate of 18.1%, a relative improvement of 4% over the baseline CNN. Experiments on a dataset where engineered features are not available showed WD+CNN is the best performing method. Our results show that the WD layer can improve neural network based time series classifiers both in accuracy and interpretability by learning directly from the input signal. 1 Introduction The spectral decomposition of signals plays an integral role in problems involving time series classification or prediction using machine learning. Effective spectral decomposition requires knowledge about the relevant frequency ranges present in an input signal. Since this information is usually unknown, it is encoded as a set of hyperparameters that are hand-tuned for the problem of interest. This approach can be summarized by the application of filters to a signal and transformation to the time/frequency domain in a preprocessing step with the short-time Fourier transform (STFT) [27], wavelet transform [10], or empirical mode decomposition [16]. The resulting time series of frequency components is then used for the classification or prediction task. Examples of this approach are present across the spectrum of problems involving time series, including financial time series prediction [7], automatic speech recognition [41, 2, 38], and biological time series analysis [4, 24]. As the parameters of a spectral decomposition are important for time-series problems and are generally not transferable, it is useful to develop methods to efficiently optimize the parameters for each problem. Currently these methods are dominated by cross-validation procedures which incur heavy costs in both computation time and data when used to optimize a large set of hyperparameters. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. Output Output Convolution Convolution Input (spectrogram) Wavelet deconvolution Input (signal) (a) (b) Figure 1: (a) The typical setup in a signal classification problem using deep neural networks with convolution and max-pooling layers applied to a preprocessed spectrogram followed by fully connected classification layers. (b) The proposed setup where the convolutional network operates directly on the input signal via the wavelet deconvolution layer, eliminating the preprocessing step and associated hyperparameters and learning the spectral decomposition using gradient descent. This is accomplished by convolving the input signal and a set of wavelet filters with learnable scales. We propose a method to efficiently optimize the parameters of the spectral decomposition based on the wavelet transform in a neural network framework. Our proposed method, called the wavelet deconvolution (WD) layer, learns the spectral decomposition relevant to the classification task with backpropagation and gradient descent. This approach results in a reduction in hyperparameters and a model that is interpretable using properties of the wavelet transform. This rest of this paper is organized as follows. In Section 2, we introduce the wavelet transform and relevant background. In Section 3, we describe the wavelet deconvolution layer and show how the scale parameters can be learned with gradient descent. Section 4 covers related work. We present our experiments and results in Section 5. We conclude in Section 7. 2 Wavelet transform Given a signal x(t) defined over t = 1...T, we begin by describing the continuous wavelet transform (CWT) of the signal [14, 30]. The transform is defined by the choice of a mother wavelet function Ψ that is scaled to form a set of wavelet functions, each of which is convolved with the signal. The mother wavelet function is chosen such that it has small local support and satisfies the zero mean and normalization properties [10]: Z ∞ −∞ ψ(t)dt = 0 |ψ(t)|2 = Z ∞ −∞ ψ(t)ψ∗(t)dt = 1 A common choice of mother wavelet function, called the Ricker or Mexican Hat wavelet, is given by the second derivative of a Gaussian: ψ(t) = 2 π1/4√ 3σ ( t2 σ2 −1)e−t2 σ2 which satisfies both conditions. By scaling this function by s and translating by b, we can define wavelet functions ψs,b: 2 ψs,b(t) = 1 √sψ(t −b s ) Note that s > 0 is required and negative scales are undefined. The CWT of a signal, which decomposes x as a set of coefficients defined at each scale s and translation b, can then be written as: Wx(s, b) = Z ∞ −∞ 1 √sψ(t −b s )x(t)dt Since ψ has small local support, the integral (or sum) can be efficiently calculated. This transforms the signal x from a one dimensional domain to a two dimensional domain of time and scales by convolution with a wavelet function at each scale s. The scale parameters must be chosen according to prior knowledge about the problem and the input signal. Converting from frequencies to scales is one method of guiding the choice of scales. For example, a conversion from scales to frequencies can be estimated using the center frequency of the mother wavelet Fc, Fs = Fc s [10]. However, converting from scales to frequency is not useful unless prior knowledge about the signal is available or assumptions are made on the relevant frequency content of the signal. We are interested in the setting where this is not the case, i.e. the relevant frequency content of the signal is not known, and show how the scale parameters can be learned for a given problem using a combination of the wavelet transform and convolutional neural networks [22]. 3 Wavelet deconvolutions In this discussion, we focus on the context of machine learning problems on time series using neural networks. The setting is summarized as follows: we are given a set of data x1, x2, ...xn and targets y1, y2, ...yn. Each xi is a (possibly multivariate) discrete time series signal that is preprocessed and passed to a neural network that learns to predict the target yi. In many applications of interest, the neural network is a convolutional neural network and the preprocessing step takes the form of a decomposition of the signal into the time and frequency domain. We replace the preprocessing step of converting the signal from the time domain to the time/frequency domain with a layer in the neural network. This layer, called the wavelet deconvolution (WD) layer, calculates the wavelet transform (WT) on an input signal in the forward pass, feeding the transformed signal to subsequent layers. It also computes the gradients of the loss function with respect to the scale parameters in the backward pass, allowing the network to adapt the transform to the problem it is tasked to solve. The benefits of adding the WD layer as the first layer in a network include: • Learning the relevant spectral content in the input with backpropagation • Implicitly adapting the kernel support (filter size) via the scale parameter • Reducing the number of hyperparameters to be optimized with expensive (in time and data) cross-validation procedures Another benefit of this approach can be seen by considering the case of learning an optimal time/frequency decomposition of the signal using only CNN. Theoretically, a CNN could learn an optimal decomposition of the signal from the input in the time domain [11]. However, this would require careful selection of the correct filter sizes and costly data and training time. The WD layer circumvents these costs by fixing the form of the decomposition of the signal as the WT and learning the filter sizes. We note that any parametrized time-frequency decomposition of the signal can replace the WT in this method provided the parameters are differentiable with respect to the error. A further line of research could be relaxing the parameterization and allowing the layer to learn an empirical mode decomposition from the data such as the Hilbert Huang Transform [16], however we leave this as future work. We now describe the details of the WD layer and show that the gradients of the scales can be calculated using backpropagation. The single-channel case is presented here but the extension to a multi-channel 3 signal is obtained by applying the transform to each channel. Given an input signal x ∈RN with N samples and a set of scales s ∈RM with s > 0, the forward pass on the WD layer produces the signal z ∈RN×M: zi = x ∗ψsi∀i = 1...M We can equivalently write the convolution (∗) as a summation: zij = K X k=1 ψsi,kxj+k for i = 1...M and j = 1...N where ψsi is the wavelet function at scale si discretized over a grid of K points. ψsi,t = 2 π 1 4 √3si ( t2 s2 i −1)e −t2 s2 i t ∈{−K −1 2 , ...0, ...K −1 2 } The backward pass of the WD layer involves calculating δE/δsi, where E is the differentiable loss function being minimized by the network. Typically the loss function is the mean squared error or categorical cross entropy. Backpropagation on the layers following the WD layer yield δE/δzij, which is the gradient with respect to the output of the WD layer. We can write the partial derivative of E with respect to each scale parameter si as: δE δsi = K X k=1 δE δψsi,k δψsi,k δsi The gradient with respect to the filter ψsi,k can be written using δE/δzij: δE δψsi,k = N X j=1 δE δzij δzij δψsi,k = N X j=1 δE δzij xj+k Defining A, M, G and their partial derivatives as: A = 2 π 1 4 √3si , δA δsi = −3 π 1 4 (3si)−3 2 M = ( t2 k s2 i −1), δM δsi = −2t2 k s3 i G = e − t2 k s2 i , δG δsi = 2t2 k s3 i e− t2 k s2 Then the gradient of ψsi,k = AMG with respect to the scale si is: δψsi,k δsi = A(M δG δsi + GδM δsi ) + MGδA δsi Finally, we can write: δE δsi = K X k=1 [(4t4 k s4 i −9t2 k s2 i + 1) e − t2 k s2 i π 1 4 p 3s3 i ] N X j=1 δE δzij xj+k The gradients of the loss with respect to the scale parameters, δE δsi , are used to update the scales with gradient descent steps: 4 s ′ i = si −γ δE δsi where γ is the learning rate of the optimizer. In order for the wavelet function ψs to be defined we include the constraint si > 0 for i = 1...M. It is not immediately clear how the scale parameters s1...sM should be initialized for problems where the relevant frequency content is unknown. We show empirically that a random initialization of s such that the whole space of possible frequencies can be explored suffices. This can be done by dividing the range of frequencies present in the signal into bins with the number of bins equal to the number of scales. The bins, or frequency bands, can be of equal size (the typical case) or variable size (depending on the prior knowledge of the signal). The bins are then converted to ranges in the scale domain from which the initial scales are randomly chosen. An interesting feature of the WD layer is the flexibility with respect to the width of the filter (K). Since at small scales the support of ψ is small as well, the width can be chosen to be small for some computational improvement. In fact, K can be set dynamically according to the current value of the scale e.g. K = min(10s, N). Another benefit to this approach is that a level of interpretability is added to the network. This can be achieved by examining the values of the scale parameters after training as they reveal the frequency content important to the classification task. In our experiments we show that the scale parameters converge to the true frequencies used to generate an artificial dataset. 4 Related work Improving the performance of deep neural networks, particularly CNN, by using the network to learn features from close to the raw input has been proven to be a successful approach [15, 21, 28, 29, 34]. There are two main directions to this line of research, each with advantages and challenges. One direction involves applying convolutional filters directly to raw input signals, assuming multiple layers of convolutions and max-pooling will be able to learn the appropriate features [32, 18, 3, 25, 40, 39]. While this is theoretically feasible, the network architecture selection and optimization become complicated as the number of layers is increased. Interpretability also suffers as the stack of features is difficult to interpret. The other direction involves tuning the parameters of the preprocessing step by gradient descent. For example, using backpropagation to calculate the gradients of the mel-filter banks commonly used in automatic speech recognition. The gradients are then used to optimize the shape of the filters [31]. By jointly optimizing the feature extraction steps with the rest of the network, the feature extraction can be modified to be optimal for the classification task at hand. However, the drawback to this approach is that it requires a set of hand-crafted features with parameters that are differentiable with respect to the loss function. In addition, the shapes of the hand crafted filters are distorted by the gradients after many update steps since each point in the filter is updated independently. This causes the resulting filters to be uninterpretable and sometimes unstable [31]. Our work combines these two approaches by assuming a standard form for the feature extraction with provable qualities, i.e. the wavelet transform, and modifying the parameters of the transform using gradient descent. This combination simplifies the optimization process and circumvents the need for a pre-designed feature extraction step. Wavelet coefficients and features extracted from wavelet coefficients have been used to train convolutional neural networks previously [23, 36, 19]. However, this work is the first, to the best of our knowledge, to optimize the scale parameters with gradient descent. 5 Results Our experiments on artificial and real-world datasets show that including the wavelet deconvolution layer as the first layer of a neural network leads to improved accuracy as well as a reduction in tunable hyperparameters. Furthermore, we show that the learned scales in the WD layer converge 5 to the frequencies present in the signal, adding interpretability to the learned model. In all of our experiments, we implement and optimize the networks using the Tensorflow library [1] with the Keras wrapper [9]. 1 5.1 Artificial data We generate an artificial dataset to compare the performance of the WD layer to a CNN and verify that the learned scale parameters converge to the frequencies present in the signal. This dataset consists of randomly generated signals, with each signal containing three frequency components separated by time. The signals are separated into two classes based on the ordering of the frequency components; one class contains signals with components ordered from low frequency to high frequency while the other class contains signals with components ordered from high to low. Clearly, these two classes cannot be classified using a simple Fourier transform as the temporal order of the frequency components is important. Fig 2 shows examples from each class and demonstrates that they are indistinguishable using the Fourier transform. The purpose of this experiment and the design of this dataset is to show the WD layer can learn the spectral content relevant to a task. Figure 2: A positive (Class1) example and negative (Class2) example from the artificial two class dataset are shown in the first row. Examples from Class1 are generated by changing the frequency of the signal from low to high over time. Examples from Class2 are generated by changing the frequency of the signal from high to low over time. The plots in the second row show the Fourier Transform of the two examples. Without accounting for the frequency content over time, the two examples look identical. We train two networks on examples from each class and compare their performance. The baseline network is a 4 layer CNN with Max-pooling [21] ending with a single unit for classification. The other network replaces the first layer with a WD layer while maintaining the same number of parameters. Both networks are optimized with Adam [20] using a fixed learning rate of 0.001 and a batch size of 4. Fig 3 shows the learning dynamics of both of these networks on this problem as well as a comparison of their performance. The network with the WD layer learns much faster than the CNN thanks to its flexibility in learning filter size and scales as well as achieving a near perfect AUC-ROC score. Additionally, we observed that the scale parameters learned by the WD network converged to the frequencies of the signal components. We experimented with different initializations of the scale parameters to verify this behavior was consistent. This is shown in the third panel in Fig 3. 5.2 TIMIT The TIMIT dataset is a well-known phone recognition benchmark dataset for automatic speech recognition (ASR). Performance on the TIMIT dataset has steadily improved over the years due to many iterations in engineering features for the phone recognition problem. Prior to the rebirth of deep neural networks in ASR, the community converged to HMM-GMM trained on features based on mel-filters applied to the speech signal and transformed using a discrete cosine transform (DCT) [41]. More recent work improves performance by omitting the DCT step and applies CNN directly to 1Code implementing the WD layer can be found at https://github.com/haidark/WaveletDeconv 6 Figure 3: Top left: ROC curve of the WD network (blue) and the convolutional network (red) on the synthetic dataset. The WD network achieves a perfect score on the test dataset. Top right: Validation loss over training epochs for the WD network (blue) and the convolutional network (red). The WD network learns much faster than the CNN and achieves a lower loss value overall. Bottom: The width parameters of the WD network over training epochs (solid lines) from several random initializations alongside the true frequency used to generate the synthetic dataset (dashed lines). We observed that the width parameters converged to the true frequency components indicating that the WD layer is able to uncover the relevant frequency information for a problem. Table 1: best reported PER on the Timit dataset without context dependence Method PER (Phone Error Rate) DNN with ReLU units [37] 20.8 DNN + RNN [12] 18.8 CNN [38] 18.9 WD + CNN (this work) 18.1 LSTM RNN [13] 17.7 Hierarchical CNN [38] 16.5 the output of the mel-filter banks [15, 2, 17, 28]. Our goal is to extend this further by removing the mel-filter banks and attempting to learn the appropriate filters using the WD layer. Clearly, this is a difficult task as the mel-filter banks represent the result of decades of research and experimentation. Our motivation is to show that the WD layer is adaptable to different problem spaces and provide an approach that circumvents the need for extensive feature engineering. To ensure a fair comparison to previous results, we replicated the non-hierarchical CNN given in [38], a 4 layer network with 1 convolutional layer followed by 3 fully connected layers. In our network, we remove the mel-filter bank preprocessing steps and added the WD layer as the first layer, using the speech signal directly as input to the WD layer. The WD layer passes the wavelet transform of the signal along with the ∆and ∆∆values to the CNN for classification in the forward pass. In the backward pass, the gradients of the scale parameters are calculated using the gradients from the CNN. We also use the optimization parameters presented in [38], except we replace SGD with the Adam [20] optimizer. A minibatch size of 100 was used. The learning rate was set to 0.001 initially and halved when the validation error plateaued. The dataset in its benchmark form consists of 3696 spoken sentences used for training and 192 sentences for testing. The sentences are segmented into frames and labeled by phones from a set of 39 different phones. 10% of the 3696 training dataset are used as a validation set for hyperparameters optimization and early stopping for regularization. The standard set of features used by CNN-based approaches consists of 41 mel-filter bank features extracted from the signal along with their ∆and ∆∆change values. The results using this network are shown in Table 1 alongside other strong performing methods. Although the WD layer does not outperform the best CNN based approach using the hand-crafted signal decomposition, it is clear that the approach is competitive achieving a close 18.1% PER despite removing all of the engineered features. This is expected as the mel-filter bank based decomposition is well suited to this speech recognition task. Removing the mel-filter bank features puts the WD+CNN 7 model at a significant disadvantage compared to the other methods because the model must first learn the appropriate preprocessing steps. However, these results show that with minimal engineering effort and a reduction in tunable hyperparameters the WD layer offers an effective alternative to the mel filter bank features. Introducing the WD layer to the CNN eliminated 7 tunable hyperparameters from the preprocessing step of the baseline CNN. This is significant as it shows the WD layer can learn a set of features equivalent to a carefully crafted feature extraction process directly from the data. By plotting the frequency response of the learned wavelets, as shown in Fig 4, we observe that they resemble the triangular filters of the mel-filter bank. Figure 4: Visualization of 10 learned wavelet filters from the network trained on the TIMIT dataset. The left pane shows the scaled wavelet functions and the right pane shows the frequency response of each of the learned wavelet filters. The learned wavelet filters closely resemble the triangular mel filter banks commonly used in automatic speech recognition systems both in shape and spacing across the frequency spectrum. 5.3 UCR Haptics dataset In this set of experiments, we evaluate the performance of the WD layer on a dataset for which an engineered preprocessing stage is not known. As shown in Table 2, methods using hand crafted features perform poorly on the dataset. The Haptics dataset is part of the UCR Time Series Classification dataset [8]. The data is comprised of time series of length 1092 divided into 5 classes. The data is provided mean-centered and normalized and a training/testing split of the data is set. We further split the training data with 10-fold crossvalidation for early stopping and selecting number of filters. We train the following 7 layer network on the dataset: WD layer with 7 scales, three convolutional+maxpooling layers with 32 filters each and 2x5 kernels (first dimension is scales and second dimension is time), three fully connected layers with 100, 25, and 5 units. Dropout [35] with p = 0.3 was added after every layer for regularization. The nonlinear activations after every layer were ReLU [26]. The network was trained using Adam [20] with default parameters: lr = 0.001, β1 = 0.9, and β2 = 0.999. The network was trained for 1000 epochs with a batch size of 2 and the weights with the best validation loss were saved. The results in Table 2 show that the WD layer achieves the best performance with an error of 0.425, improving the next best performing method by an absolue 2.4%. The second best performing method, the Fully Convolutional Network (FCN) [40], is a network of 1-D convolutional units that also does not require any preprocessing or feature extraction steps and has a similar number of parameters to our method. Other methods such as Dynamic Time Warping [5], COTE [6], and BOSS [33] depend on feature extraction steps which may not be suitable to this task. We believe the improvement shown here, especially with respect to other CNN based methods with similar model complexities, shows the WD layer learns a spectral decomposition of the time series which results in improved classification accuracy. 8 Table 2: Testing error on the Haptics dataset Method Test Error DTW [5] 0.623 BOSS [33] 0.536 ResNet [40] 0.495 COTE [6] 0.488 FCN [40] 0.449 WD + CNN (this work) 0.425 6 Discussion We demonstrate that the WD layer provides a powerful and flexible approach to learning the parameters of the spectral decomposition of a signal. Combined with the backpropagation algorithm for calculating gradients with respect to a loss function, the WD layer can automatically set the filter widths to maximize classification accuracy. Although any parameterized transform can be used, there are two benefits to using the wavelet transform that are not realized by other transforms. Firstly, the wavelet functions are differentiable with respect to the scales which allows optimization with the backpropagation algorithm. Secondly, the scale parameters control both the target frequency as well as the filter width allowing a multiscale decomposition of the signal within a single layer of the network. One challenge to the optimization of the WD layer using stochastic gradient descent (SGD) with a fixed learning rate is that the scale parameters can change too slowly relative to their magnitude and convergence can be slow. This is caused by the multiscale feature of the wavelet transform. When the magnitude of the scale parameter is small, small changes to the parameters can capture change in high frequencies effectively. At lower frequencies when the magnitude of the scale parameter is large, many steps are required. Fortunately, more advanced optimization techniques with variable and per-parameter learning rates, such as Adam [20] and Adadelta [42], circumvent this problem. We found that using Adam (a standard choice for deep neural networks) with the default parameters greatly sped up training over using SGD with a fixed learning rate. Thus, this method requires a variable learning rate in order to effectively learn the scale parameters. 7 Conclusion In this paper, we used the wavelet transform and convolutional neural networks to learn the parameters of a spectral decomposition for classification of signals. By learning the wavelet scales of the wavelet transform with backpropagation and gradient descent, we avoid having to choose the parameters of the spectral decomposition using cross-validation. We showed that the decomposition learned by backpropagation equaled or outperformed hand-selected spectral decompositions. In addition, the learned scale parameters reveal the frequency content of the signal important to the classification task, adding a layer of interpretability to the deep neural network. As future work, we plan to investigate how to extend the WD layer to signals in higher dimensions, such as images and video, as well as generalizing the wavelet transform to empirical mode decompositions. Acknowledgments This work was supported in part by NSF Award #1302231. 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 Mane, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, Mike Schuster, Jonathon Shlens, 9 Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viegas, Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. TensorFlow: Large-Scale Machine Learning on Heterogeneous Distributed Systems. arXiv preprint arXiv:1603.04467, 2016. [2] Ossama Abdel-Hamid, Mohamed Abdel-rahman, Hui Jiang, Li Deng, Gerald Penn, and Dong Yu. Convolutional Neural Networks for Speech Recognition. IEEE/ACM Transactions on Audio, Speech, and Language Processing, 22(10):1533–1545, 2014. [3] Ossama Abdel-Hamid, Abdel-rahman Mohamed, Hui Jiang, and Gerald Penn. Applying Convolutional Neural Networks concepts to hybrid NN-HMM model for speech recognition. In 2012 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 4277–4280. IEEE, mar 2012. [4] Evrim Acar, Canan Aykut-Bingol, Haluk Bingol, Rasmus Bro, and Bülent Yener. Multiway analysis of epilepsy tensors. Bioinformatics, 23(13):i10–i18, 2007. [5] Ghazi Al-Naymat, Sanjay Chawla, and Javid Taheri. SparseDTW: A novel approach to speed up dynamic time warping. Conferences in Research and Practice in Information Technology Series, 101(December 2003):117–127, 2009. [6] Anthony Bagnall, Jason Lines, Jon Hills, and Aaron Bostrom. Time-series classification with COTE: The collective of transformation-based ensembles. 2016 IEEE 32nd International Conference on Data Engineering, ICDE 2016, 27(9):1548–1549, 2016. [7] Peter Brockwell and Richard Davis. Introduction to Time Series and Forecasting. Springer, 2002. [8] Yanping Chen, Eamonn Keogh, Bing Hu, Nurjahan Begum, Anthony Bagnall, Abdullah Mueen, and Gustavo Batista. The UCR Time Series Classification Archive, jul 2015. [9] François Chollet. keras, 2015. [10] Ingrid Daubechies. The wavelet transform, time-frequency localization and signal analysis. IEEE Transactions on Information Theory, 36(5):961–1005, 1990. [11] Ian Goodfellow, Yoshua Bengio, Aaron Courville, and Dung. Deep Learning. MIT press Cambridge, 2016. [12] Gábor Gosztolya, Tamás Grósz, László Tóth, and David Imseng. Building context-dependent DNN acoustic models using Kullback-Leibler divergence-based state tying. ICASSP, IEEE International Conference on Acoustics, Speech and Signal Processing - Proceedings, 2015-Augus:4570–4574, 2015. [13] Alex Graves, Abdel-rahman Mohamed, and Geoffrey Hinton. Speech recognition with deep recurrent neural networks. In 2013 IEEE International Conference on Acoustics, Speech and Signal Processing, number 3, pages 6645–6649. IEEE, may 2013. [14] David K. Hammond, Pierre Vandergheynst, and Rémi Gribonval. Wavelets on graphs via spectral graph theory. Applied and Computational Harmonic Analysis, 30(2):129–150, 2011. [15] Geoffrey Hinton, Li Deng, Dong Yu, George Dahl, Abdel-rahman Mohamed, Navdeep Jaitly, Andrew Senior, Vincent Vanhoucke, Patrick Nguyen, Tara Sainath, and Brian 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, nov 2012. [16] Norden E Huang and Zhaohua Wu. a Review on Hilbert-Huang Transform : Method and Its Applications. Reviews of Geophysics, 46(2007):1–23, 2008. [17] Po Sen Huang, Haim Avron, Tara N. Sainath, Vikas Sindhwani, and Bhuvana Ramabhadran. Kernel methods match deep neural networks on TIMIT. ICASSP, IEEE International Conference on Acoustics, Speech and Signal Processing - Proceedings, pages 205–209, may 2014. [18] Navdeep Jaitly and Geoffrey E. Hinton. Learning a Better Representation of Speech Sound Waves using Restricted Boltzmann Machines. Acoustics, Speech and Signal Processing (ICASSP), 2011 IEEE International Conference on, 1:5884–5887, 2011. [19] Haidar Khan, Lara Marcuse, Madeline Fields, Kalina Swann, and Bulent Yener. Focal onset seizure prediction using convolutional networks. IEEE Transactions on Biomedical Engineering, 9294(c):1–1, 2017. 10 [20] Diederik P Kingma and Jimmy Ba. Adam: A Method for Stochastic Optimization. arXiv preprint arXiv:1412.6980, pages 1–15, dec 2014. [21] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hinton. ImageNet classification with deep convolutional neural networks. Communications of the ACM, 60(6):84–90, may 2017. [22] Yann LeCun, Leon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2323, 1998. [23] Piotr Mirowski, Deepak Madhavan, Yann LeCun, and Ruben Kuzniecky. Classification of patterns of EEG synchronization for seizure prediction. Clinical Neurophysiology, 120(11):1927–1940, 2009. [24] Piotr W. Mirowski, Yann LeCun, Deepak Madhavan, and Ruben Kuzniecky. Comparing SVM and convolutional networks for epileptic seizure prediction from intracranial EEG. In Proceedings of the 2008 IEEE Workshop on Machine Learning for Signal Processing, MLSP 2008, pages 244–249, 2008. [25] Abdel-Rahman Mohamed, George Dahl, and Geoffrey Hinton. Deep Belief Networks for Phone Recognition. Scholarpedia, 4(5):1–9, 2009. [26] Vinod Nair and Geoffrey E Hinton. Rectified Linear Units Improve Restricted Boltzmann Machines. In Proceedings of the 27th International Conference on Machine Learning, number 3, pages 807–814, 2010. [27] Alan V Oppenheim and Ronald W Schafer. Discrete-Time Signal Processing. Pearson Education, 2014. [28] Dimitri Palaz, Ronan Collobert, and Mathew Magimai. Doss. End-to-end Phoneme Sequence Recognition using Convolutional Neural Networks. arXiv preprint arXiv:1312.2137, pages 2–9, 2013. [29] Dimitri Palaz, Mathew Magimai-Doss, and Ronan Collobert. Analysis of CNN-based speech recognition system using raw speech as input. In Proceedings of the Annual Conference of the International Speech Communication Association, INTERSPEECH, pages 11–15, 2015. [30] Robi Polikar. The engineer’s ultimate guide to wavelet analysis-the wavelet tutorial. available at http://www. public. iastate. edu/˜ rpolikar/WAVELETS/WTtutorial. html, 14(2):81–87, 1996. [31] Tara N. Sainath, Brian Kingsbury, Abdel-Rahman Rahman Mohamed, and Bhuvana Ramabhadran. Learning Filter Banks Within a Deep Neural Network Framework. Proceedings of IEEE Workshop on Automatic Speech Recognition and Understanding (ASRU), pages 297–302, dec 2013. [32] Tara N. Sainath, Ron J. Weiss, Andrew Senior, Kevin W. Wilson, and Oriol Vinyals. Learning the speech front-end with raw waveform CLDNNs. In Proceedings of the Annual Conference of the International Speech Communication Association, INTERSPEECH, pages 1–5, 2015. [33] Patrick Schäfer. The BOSS is concerned with time series classification in the presence of noise. Data Mining and Knowledge Discovery, 29(6):1505–1530, 2015. [34] Patrice Y Simard, Dave Steinkraus, and John C Platt. Best practices for convolutional neural networks applied to visual document analysis. In Seventh International Conference on Document Analysis and Recognition, 2003. Proceedings., volume 1, pages 958–963. IEEE Comput. Soc, 2003. [35] Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A Simple Way to Prevent Neural Networks from Overfitting. Journal of Machine Learning Research, 15:1929–1958, 2014. [36] Sebastian Stober, Avital Avtial Sternin, Adrian M. Owen, and Jessica A. Grahn. Deep Feature Learning for EEG Recordings. Arxiv, pages 1–24, nov 2015. [37] Laszlo Toth. Phone recognition with deep sparse rectifier neural networks. ICASSP, IEEE International Conference on Acoustics, Speech and Signal Processing - Proceedings, pages 6985–6989, 2013. [38] László Tóth. Convolutional deep maxout networks for phone recognition. Proceedings of the Annual Conference of the International Speech Communication Association, INTERSPEECH, pages 1078–1082, 2014. [39] Zoltan Tüske, Pavel Golik, Ralf Schlüter, and Hermann Ney. Acoustic modeling with deep neural networks using raw time signal for LVCSR. In Proceedings of the Annual Conference of the International Speech Communication Association, INTERSPEECH, pages 890–894, 2014. [40] Zhiguang Wang, Weizhong Yan, and Tim Oates. Time Series Classification from Scratch with Deep Neural Networks : A Strong Baseline. In Neural Networks (IJCNN), 2017 International Joint Conference on, pages 1578–1585, 2017. 11 [41] Dong Yu and Li Deng. Automatic Speech Recognition, volume 1976 of Signals and Communication Technology. Springer London, London, 2015. [42] Matthew D. Zeiler. ADADELTA: An Adaptive Learning Rate Method. arXiv, page 6, 2012. 12
2018
121
7,277
Autowarp: Learning a Warping Distance from Unlabeled Time Series Using Sequence Autoencoders Abubakar Abid Stanford University a12d@stanford.edu James Zou Stanford University jamesz@stanford.edu Abstract Measuring similarities between unlabeled time series trajectories is an important problem in domains as diverse as medicine, astronomy, finance, and computer vision. It is often unclear what is the appropriate metric to use because of the complex nature of noise in the trajectories (e.g. different sampling rates or outliers). Domain experts typically hand-craft or manually select a specific metric, such as dynamic time warping (DTW), to apply on their data. In this paper, we propose Autowarp, an end-to-end algorithm that optimizes and learns a good metric given unlabeled trajectories. We define a flexible and differentiable family of warping metrics, which encompasses common metrics such as DTW, Euclidean, and edit distance. Autowarp then leverages the representation power of sequence autoencoders to optimize for a member of this warping distance family. The output is a metric which is easy to interpret and can be robustly learned from relatively few trajectories. In systematic experiments across different domains, we show that Autowarp often outperforms hand-crafted trajectory similarity metrics. 1 Introduction A time series, also known as a trajectory, is a sequence of observed data t = (t1, t2, ...tn) measured over time. A large number of real world data in medicine [1], finance [2], astronomy [3] and computer vision [4] are time series. A key question that is often asked about time series data is: "How similar are two given trajectories?" A notion of trajectory similarity allows one to do unsupervised learning, such as clustering and visualization, of time series data, as well as supervised learning, such as classification [5]. However, measuring the distance between trajectories is complex, because of the temporal correlation between data in a time series and the complex nature of the noise that may be present in the data (e.g. different sampling rates) [6]. In the literature, many methods have been proposed to measure the similarity between trajectories. In the simplest case, when trajectories are all sampled at the same frequency and are of equal length, Euclidean distance can be used [7]. When comparing trajectories with different sampling rates, dynamic time warping (DTW) is a popular choice [7]. Because the choice of distance metric can have a significant effect on downstream analysis [5, 6, 8], a plethora of other distances have been hand-crafted based on the specific characteristics of the data and noise present in the time series. However, a review of five of the most popular trajectory distances found that no one trajectory distance is more robust than the others to all of the different kinds of noise that are commonly present in time series data [8]. As a result, it is perhaps not surprising that many distances have been manually designed for different time series domains and datasets. In this work, we propose an alternative to hand-crafting a distance: we develop an end-to-end framework to learn a good similarity metric directly from unlabeled time series data. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. Figure 1: Learning a Distance with Autowarp. Here we visualize the stages of Autowarp by using multi-dimensional scaling (MDS) to embed a set of 50 trajectories into two dimensions at each step of the algorithm. Each dot represents one observed trajectory that is generated by adding Gaussian noise and outliers to 10 copies of 5 seed trajectories (each color represents a seed). (left) First, we run MDS on the original trajectories with Euclidean distance. (center) Next, we run MDS on the latent representations learned with a sequence-to-sequence autoencoder, which partially resolves the original clusters. (right) Finally, we run MDS on the original trajectories using the learned warping distance, which completely resolves the original clusters. While data-dependent analysis of time-series is commonly performed in the context of supervised learning (e.g. using RNNs or convolutional networks to classify trajectories [9]), this is not often performed in the case when the time series are unlabeled, as it is more challenging to determine notions of similarity in the absence of labels. Yet the unsupervised regime is critical, because in many time series datasets, ground-truth labels are difficult to determine, and yet the notion of similarity plays a key role. For example, consider a set of disease trajectories recorded in a large electronic health records database: we have the time series information of the diseases contracted by a patient, and it may be important to determine which patient in our dataset is most similar to another patient based on his or her disease trajectory. Yet, the choice of ground-truth labels is ambiguous in this case. In this work, we develop an easy-to-use method to determine a distance that is appropriate for a given set of unlabeled trajectories. In this paper, we restrict ourselves to the family of trajectory distances known as warping distances (formally defined in Section 2). This is for several reasons: warping distances have been widely studied, and are intuitive and interpretable [7]; they are also efficient to compute, and numerous heuristics have been developed to allow nearest-neighbor queries on datasets with as many as trillions of trajectories [10]. Thirdly, although they are a flexible and general class, warping distances are particularly well-suited to trajectories, and serve as a means of regularizing the unsupervised learning of similarity metrics directly from trajectory data. We show through systematic experiments that learning an appropriate warping distance can provide insight into the nature of the time series data, and can be used to cluster, query, or visualize the data effectively. Related Work The development of distance metrics for time series stretches at least as far back as the introduction of dynamic time warping (DTW) for speech recognition [11]. Limitations of DTW led to the development and adoption of the Edit Distance on Real Sequence (EDR) [12], the Edit Distance with Real Penalty (ERP) [13], and the Longest Common Subsequence (LCSS) [14] as alternative distances. Many variants of these distances have been proposed, based on characteristics specific to certain domains and datasets, such as the Symmetric Segment-Path Distance (SSPD) [7] for GPS trajectories, Subsequence Matching [15] for medical time series data, among others [16]. Prior work in metric learning from trajectories is generally limited to the supervised regime. For example, in recent years, convolutional neural networks [9], recurrent neural networks (RNNs) [17], and siamese recurrent neural networks [18] have been proposed to classify neural networks based on labeled training sets. There has also been some work in applying unsupervised deep learning learning to time series [19]. For example, the authors of [20] use a pre-trained RNN to extract features from time-series that are useful for downstream classification. Unsupervised RNNs have also found use in anomaly detection [21] and forecasting [22] of time series. 2 2 The Autowarp Approach Our approach, which we call Autowarp, consists of two steps. First, we learn a latent representation for each trajectory using a sequence-to-sequence autoencoder. This representation takes advantage of the temporal correlations present in time series data to learn a low-dimensional representation of each trajectory. In the second stage, we search a family of warping distances to identify the warping distance that, when applied to the original trajectories, is most similar to the Euclidean distances between the latent representations. Fig. 1 shows the application of Autowarp to synthetic data. Learning a latent representation Autowarp first learns a latent representation that captures the significant properties of trajectories in an unsupervised manner. In many domains, an effective latent representation can be learned by using autoencoders that reconstruct the input data from a low-dimensional representation. We use the same approach using sequence-to-sequence autoencoders. This approach is inspired by similar sequence-to-sequence autoencoders, which have been successfully applied to sentiment classification [23], machine translation [24], and learning representations of videos [25]. In the architecture that we use (illustrated in Fig. 2), we feed each step in the trajectory sequentially into an encoding LSTM layer. The hidden state of the final LSTM cell is then fed identically into a decoding LSTM layer, which contains as many cells as the length of the original trajectory. This layer attempts to reconstruct each trajectory based solely on the learned latent representation for that trajectory. What kind of features are learned in the latent representation? Generally, the hidden representation captures overarching features of the trajectory, while learning to ignore outliers and sampling rate. We illustrate this in Fig. S1 in Appendix A: the LSTM autoencoders learn to denoise representations of trajectories that have been sampled at different rates, or in which outliers have been introduced. = Encoder LSTM 𝑡1 𝑡2 𝑡𝑁 ℎ ℎ ℎ ǁ𝑡1 ǁ𝑡2 ǁ𝑡𝑁 = Decoder LSTM Learned Representation Figure 2: Schematic for LSTM Sequence-Sequence Autoencoder. We learn a latent representation for each trajectory by passing it through a sequence-to-sequence autoencoder that is trained to minimize the reconstruction loss t −˜t 2 between the original trajectory t and decoded trajectory ˜t. In the decoding stage, the latent representation h is passed as input into each LSTM cell. Warping distances Once a latent representation is learned, we search from a family of warping distances to find the warping distance across the original trajectories that mimics the distances between each trajectory’s latent representations. This can be seen as “distilling" the representation learned by the neural network into a warping distance (e.g. see [26]). In addition, as warping distances are generally well-suited to trajectories, this serves to regularize the process of distance metric learning, and generally produces better distances than using the latent representations directly (as illustrated in Fig. 1). We proceed to formally define a warping distance, as well as the family of warping distances that we work with for the rest of the paper. First, we define a warping path between two trajectories. Definition 1. A warping path p = (p0, . . . pL) between two trajectories tA = (tA 1 , . . . tA n ) and tB = (tB 1 , . . . tB m) is a sequence of pairs of trajectory states, where the first state comes from trajectory tA or is null (which we will denote as tA 0 ), and the second state comes from trajectory tB or is null (which we will denote as tB 0 ). Furthermore, p must satisfy two properties: • boundary conditions: p0 = (tA 0 , tB 0 ) and pL = (tA n , tB m) • valid steps: pk = (tA i , tB j ) =⇒pk+1 ∈{(tA i+1, tB j ), (tA i+1, tB j+1), (tA i , tB j+1)}. 3 Warping paths can be seen as traversals on a (n + 1)-by-(m + 1) grid from the bottom left to the top right, where one is allowed to go up one step, right one step, or one step up and right, as shown in Fig. S2 in Appendix A. We shall refer to these as vertical, horizontal, and diagonal steps respectively. Definition 2. Given a set of trajectories T , a warping distance d is a function that maps each pair of trajectories in T to a real number ∈[0, ∞). A warping distance is completely specified in terms of a cost function c(·, ·) on two pairs of trajectory states: Let tA, tB ∈T . Then d(tA, tB) is defined1 as d(tA, tB) = minp ∈P PL i=1 c(pi−1, pi) The function c(pi−1, pi) represents the cost of taking the step from pi−1 to pi, and, in general, differs for horizontal, vertical, and diagonal steps. P is the set of all warping paths between tA and tB. Thus, a warping distance represents a particular optimization carried over all valid warping paths between two trajectories. In this paper, we define a family of warping distances D, with the following parametrization of c(·, ·): c((tA i , tB j ), (tA i′, tB j′)) = ( σ( tA i′ −tB j′ , ϵ 1−ϵ) i′ > i, j′ > j α 1−α · σ( tA i′ −tB j′ , ϵ 1−ϵ) + γ i′ = i or j′ = j (1) Here, we define σ(x, y) def= y · tanh(x/y) to be a soft thresholding function, such that σ(x, y) ≈x if 0 ≤x ≤y and σ(x, y) ≈y if x > y. And, σ(x, ∞) def= x. The family of distances D is parametrized by three parameters α, γ, ϵ. With this parametrization, D includes several commonly used warping distances for trajectories, as shown in Table 1, as well as many other warping distances. Trajectory Distance α γ ϵ Euclideana 1 0 1 Dynamic Time Warping (DTW) [11] 0.5 0 1 Edit Distance (γ0) [13] 0 0 < γ0 1 Edit Distance on Real Sequences (γ0, ϵ0) [12] b 0 0 < γ0 0 < ϵ0 < 1 Table 1: Parametrization of common trajectory dissimilarities aThe Euclidean distance between two trajectories is infinite if they are of different lengths bThis is actually a smooth, differentiable approximation to EDR Optimizing warping distance using betaCV Within our family of warping distances, how do we choose the one that aligns most closely with the learned latent representation? To allow a comparison between latent representations and trajectory distances, we use the concept of betaCV: Definition 3. Given a set of trajectories T = {t1, t2, . . . tT }, a trajectory metric d and an assignment to clusters C(i) for each trajectory ti, the betaCV, denoted as β, is defined as: β(d) = 1 Z PT i=1 PT j=1 d(ti, tj) 1 [C(i) = C(j)] 1 T 2 PT i=1 PT j=1 d(ti, tj) , (2) where Z = PT i=1 PT j=1 1 [C(i) = C(j)] is the normalization constant needed to transform the numerator into an average of distances. In the literature, the betaCV is used to evaluate different clustering assignments C for a fixed distance [27]. In our work, it is the distance d that is not known; were true cluster assignments known, the betaCV would be a natural quantity to minimize over the distances in D, as it would give us a distance metric that minimizes the average distance of trajectories to other trajectories within the same cluster (normalized by the average distances across all pairs of trajectories). However, as the clustering assignments are not known, we instead use the Euclidean distances between to the latent representations of two trajectories to determine whether they belong to the same “cluster." In particular, we designate two trajectories as belonging to the same cluster if the distance between their latent representations is less than a threshold δ, which is chosen as a percentile ¯p of the 1A more general definition of warping distance replaces the summation over c(pi−1, p) with a general class of statistics, that may include max and min for example. For simplicity, we present the narrower definition here. 4 distribution of distances between all pairs of latent representations. We will denote this version of the betaCV, calculated based on the latent representations learned by an autoencoder, as ˆβh(d): Definition 4. Given a set of trajectories T = {t1, t2, . . . tT }, a metric d and a latent representation for each trajectory hi, the latent betaCV, denoted as ˆβ, is defined as: ˆβ = 1 Z PT i=1 PT j=1 d(ti, tj) 1  ∥hi −hj∥2 < δ  1 T 2 PT i=1 PT j=1 d(ti, tj) , (3) where Z is a normalization constant defined analogously as in (2). The threshold distance δ is a hyperparameter for the algorithm, generally set to be a certain threshold percentile (¯p) of all pairwise distances between latent representations. With this definition in hand, we are ready to specify how we choose a warping distance based on the latent representations. We choose the warping distance that gives us the lowest latent betaCV: ˆd = arg min d∈D ˆβ(d). We have seen that the learned representations hi are not always able to remove the noise present in the observed trajectories. It is natural to ask, then, whether it is a good idea to calculate the betaCV using the noisy latent representations, in place of true clustering assignments. In other word, suppose we computed β based on known clusters assignments in a trajectory dataset. If we then computed ˆβ based on somewhat noisy learned latent representations, could it be that β and ˆβ differ markedly? In Appendix C, we carry out a theoretical analysis, assuming that the computation of ˆβ is based on a noisy clustering ˜C. We present the conclusion of that analysis here: Proposition 1 (Robustness of Latent BetaCV). Let d be a trajectory distance defined over a set of trajectories T of cardinality T. Let β(d) be the betaCV computed on the set of trajectories using the true cluster labels {C(i)}. Let ˆβ(d) be the betaCV computed on the set of trajectories using noisy cluster labels { ˜C(i)}, which are generated by independently randomly reassigning each C(i) with probability p. For a constant K that depends on the distribution of the trajectories, the probability that the latent betaCV changes by more than x beyond the expected Kp is bounded by: Pr(|β −ˆβ| > Kp + x) ≤e−2T x2/K2 (4) This result suggests that a latent betaCV computed based on latent representations may still be a reliable metric even when the latent representations are somewhat noisy. In practice, we find that the quality of the autoencoder does have an effect on the quality of the learned warping distance, up to a certain extent. We quantify this behavior using an experiment showin in Fig. S4 in Appendix A. 3 Efficiently Implementing Autowarp There are two computational challenges to finding an appropriate warping distance. One is efficiently searching through the continuous space of warping distances. In this section, we show that the computation of the BetaCV over the family of warping distances defined above is differentiable with respect to quantities α, γ, ϵ that parametrize the family of warping distances. Computing gradients over the whole set of trajectories is still computationally expensive for many real-world datasets, so we introduce a method of sampling trajectories that provides significant speed gains. The formal outline of Autowarp is in Appendix B. Differentiability of betaCV. In Section 2, we proposed that a warping distance can be identified by the distance d ∈D that minimizes the BetaCV computed from the latent representations. Since D contains infinitely many distances, we cannot evaluate the BetaCV for each distance, one by one. Rather, we solve this optimization problem using gradient descent. In Appendix C, we prove the that BetaCV is differentiable with respect to the parameters α, γ, ϵ and the gradient can be computed in O(T 2N 2) time, where T is the number of trajectories in our dataset and N is the number of elements in each trajectory (see Proposition 2). 5 0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0 h (Latent BetaCV) 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0 t (Trajectories BetaCV) 0.48 0.51 0.54 0.57 0.60 0.63 0.66 0.69 0.72 0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0 (True BetaCV) 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 Figure 3: Validating Latent BetaCV. We construct a synthetic time series dataset with Gaussian noise and outliers added to the trajectories. We compute the latent betaCV for various distances (left), which closely matches the plot of the true betaCV (middle) computed based on knowledge of the seed clusters. As a control, we plot the betaCV computed based on the original trajectories (right). Black dots represent the optimal value of α and γ in each plot. Lower betaCV is better. Batched gradient descent. When the size of the dataset becomes modestly large, it is no longer feasible to re-compute the exact analytical gradient at each step of gradient descent. Instead, we take inspiration from negative sampling in word embeddings [28], and only sample a fixed number, S, of pairs of trajectories at each step of gradient descent. This reduces the runtime of each step of gradient descent to O(SN 2), where S ≈32 −128 in our experiments. Instead of the full gradient descent, this effectively becomes batched gradient descent. The complete algorithm for batched Autowarp is shown in Algorithm 1 in Appendix B. Because the betaCV is not convex in terms of the parameters α, γ, ϵ, we usually repeat Algorithm 1 with multiple initializations and choose the parameters that produce the lowest betaCV. 4 Validation Recall that Autowarp learns a distance from unlabeled trajectory data in two steps: first, a latent representation is learned for each trajectory; secondly, a warping distance is identified that is most similar to the learned latent representations. In this section, we empirically validate this methodology. Validating latent betaCV. We generate synthetic trajectories that are copies of a seed trajectory with different kinds of noise added to each trajectory. We then measure the ˆβh for a large number of distances in D. Because these are synthetic trajectories, we compare this to the true β measured using the known cluster labels (each seed generates one cluster). As a control, we also consider computing the betaCV based on the Euclidean distance of the original trajectories, rather than the Euclidean distance between the latent representations. We denote this quantity as ˆβt and treat it as a control. Fig. 3 shows the plot when the noise takes the form of adding outliers and Gaussian noise to the data. The betaCVs are plotted for distances d for different values of α and γ with ϵ = 1. Plots for other kinds of noise are included in Appendix A (see Fig. S7). These plots suggest that ˆβh assigns each distance a betaCV that is representative of the true clustering labels. Furthermore, we find that the distances that have the lowest betaCV in each case concur with previous studies that have studied the robustness of different trajectory distances. For example, we find that DTW (α = 0.5, γ = 0) is the appropriate distance metric for resampled trajectories, Euclidean (α = 1, γ = 0) for Gaussian noise, and edit distance (α = 0, γ ≈0.4) for trajectories with outliers. Ablation and sensitivity analysis. Next, we investigate the sensitivity of the latent betaCV calculation to the hyperparameters of the algorithm. We find that although the betaCV changes as the threshold changes, the relative ordering of different warping distances mostly remains the same. Similarly, we find that the dimension of the hidden layer in the autoencoder can vary significantly without significantly affecting qualitative results (see Fig. 4). For a variety of experiments, we find that a reasonable number of latent dimensions is ≈L · D, where L is the average trajectory length and D the dimensionality. We also investigate whether both the autoencoder and the search through warping distances are necessary for effective metric learning. Our results indicate that both are 6 0.2 0.4 0.6 0.8 p, percentile threshold 0.2 0.4 0.6 0.8 1.0 h, BetaCV DTW Euclidean Edit EDR (a) 10 1 10 2 dh, latent dimensionality 0.30 0.35 0.40 0.45 0.50 h, BetaCV DTW Euclidean Edit EDR (b) Figure 4: Sensitivity Analysis on Trajectories with Outliers. (a) We investigate how the percentile threshold parameter affects latent betaCV. (b) We also investigate the effect of changing the latent dimensionality on the relative ordering of the distances. We find that the qualitative ranking of different distances is generally robust to the choice of these hyperparameters. needed: using the latent representations alone results in noisy clustering, while the warping distance search cannot be applied in the original trajectory space to get meaningful results (Fig. 1). Downstream classification. A key motivation of distance metric learning is the ability to perform downstream classification and clustering tasks more effectively. We validated this on a real dataset: the Libras dataset, which consists of coordinates of users performing Brazilian sign language. The xand y-coordinates of the positions of the subjects’ hands are recorded, as well as the symbol that the users are communicating, providing us labels to evaluate our distance metrics. For this experiment, we chose a subset of 40 trajectories from 5 different categories. For a given distance function d, we iterated over every trajectory and computed the 7 closest trajectories to it (as there are a total of 8 trajectories from each category). We computed which fraction of the 7 shared their label with the original trajectory. A good distance should provide us with a higher fraction. We evaluated 50 distances: 42 of them were chosen randomly, 4 were well-known warping distances, and 4 were the result of performing Algorithm 1 from different initializations. We measured both the betaCV of each distance, as well as the accuracy. The results are shown in Fig. 5, which shows a clear negative correlation (rank correlation is = 0.85) between betaCV and label accuracy. Figure 5: Latent BetaCV and Downstream Classification. Here, we choose 50 warping distances and plot the latent betaCV of each one on the Libras dataset, along with the average classification when each trajectory is used to classify its nearest neighbors. Results suggest that minimizing latent betaCV provides a suitable distance for downstream classification. 5 Autowarp Applied to Real Datasets Many of the hand-crafted distances mentioned earlier in the manuscript were developed for and tested on particular time series datasets. We now turn to two such public datasets, and demonstrate how Autowarp can be used to learn an appropriate warping distance from the data. We show that the warping distance that we learn is competitive with the original hand-crafted distances. Taxicab Mobility Dataset. We first turn to a dataset that consists of GPS measurements from 536 San-Francisco taxis over a 24-day period2. This dataset was used to test the SSPD distance metric for 2Data can be downloaded from https://crawdad.org/epfl/mobility/20090224/cab/. 7 122.42 122.41 122.40 122.39 Longitude 37.77 37.78 37.79 37.80 37.81 Latitude End Start (a) 20 40 60 80 100 120 140 Number of neighbors 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 Average distance to neighbors (normalized) SSPD DTW Edit EDR Autowarp (b) 122.42 122.41 122.40 122.39 Longitude 37.77 37.78 37.79 37.80 37.81 Latitude (c) Figure 6: Taxicab Mobility Dataset (a) We plot the trajectories, along with their start and end points. (b) We evaluate the average normalized distance to various numbers of neighbors for five different trajectory distances, and find that the Autowarp distance (black line) produces the most compact clusters (c) We apply spectral clustering with 5 different clusters (each color represents a different cluster) using the Autowarp learned distance. trajectories [7]. Like the authors of [7], we preprocessed the dataset to include only those trajectories that begin when a taxicab has picked up a passenger at the the Caltrain station in San Francisco, and whose drop-off location is in downtown San Francisco. This leaves us T = 500 trajectories, with a median length of N = 9. Each trajectory is 2-dimensional, consisting of an x- and y-coordinate. The trajectories are plotted in Fig. 6(a). We used Autowarp (Algorithm 1 with hyperparameters dh = 10, S = 64, ¯p = 1/5) to learn a warping distance from the data (α = 0.88, γ = 0, ϵ = 0.33). This distance is similar to Euclidean distance; this may be because the GPS timestamps are regularly sampled. The small value of ϵ suggests that some thresholding is needed for an optimal distance, possibly because of irregular stops or routes taken by the taxis. The trajectories in this dataset are not labeled, so to evaluate the quality of our learned distance, we compute the average distance of each trajectory to its k closest neighbors, normalized. This is analogous to how to the original authors evaluated their algorithm: the lower the normalized distance, the more “compact" the clusters. We show the result of our Fig. 6(b) for various values of k, showing that the learned distance is as compact as SSPD, if not more compact. We also visualize the results when our learned distance metric is used to cluster the trajectories into 5 clusters using spectral clustering in Fig. 6(c). Australian Sign Language (ASL) Dataset. Next, we turn to a dataset that consists of measurements taken from a smart glove worn by a sign linguist3. This dataset was used to test the EDR distance metric [12]. Like the original authors, we chose a subset consisting of T = 50 trajectories, of median length N = 53. This subset included 10 different classes of signals. The measurements of the glove are 4-dimensional, including x-, y-, and z-coordinates, along with the rotation of the palm. We used Autowarp (Algorithm 1 with hyperparameters dh = 20, S = 32, ¯p = 1/5) to learn a warping distance from the data (learned distance: α = 0.29, γ = 0.22, ϵ = 0.48). The trajectories in this dataset are labeled, so to evaluate the quality of our learned distance, we computed the accuracy of doing nearest neighbors on the data. Most distance functions achieve a reasonably high accuracy on this task, so like the authors of [12], we added various sources of noise to the data. We evaluated the learned distance, as well as the original distance metric on the noisy datasets, and find that the learned distance is significantly more robust than EDR, particularly when multiple sources of noise are simultaneously added, denoted as "hybrid" noises in Fig. 7. 3Data can be downloaded from http://kdd.ics.uci.edu/databases/auslan/auslan.data.html. 8 Figure 7: ASL Dataset. We use various distance metrics to perform nearest-neighbor classifications on the ASL dataset. The original ASL dataset is shown on the left, and various synthetic noises have been added to generate the results on the right. ‘Hybrid1’ is a combination of Gaussian noise and outliers, while ‘Hybrid2’ refers to a combination of Gaussian and sampling noise. Original Gaussian Resampling Outliers Hybrid1 Hybrid2 Noise 0.0 0.2 0.4 0.6 0.8 1.0 Nearest Neighbor Accuracy Euc DTW Edit EDR Autowarp 6 Discussion In this paper, we propose Autowarp, a novel method to learn a similarity metric from a dataset of unlabeled trajectories. Our method learns a warping distance that is similar to latent representations that are learned for a trajectory by a sequence-to-sequence autoencoder. We show through systematic experiments that learning an appropriate warping distance can provide insight into the nature of the time series data, and can be used to cluster, query, or visualize the data effectively. Our experiments suggest that both steps of Autowarp – first, learning latent representations using sequence-to-sequence autoencoders, and second, finding a warping distance that agrees with the latent representation – are important to learning a good similarity metric. In particular, we carried out experiments with deeper autoencoders to determine if increasing the capacity of the autoencoders would allow the autoencoder alone to learn a similarity metric. Our results, some of which are shown in Figure S5 in Appendix A, show that even deeper autoencoders are unable to learn useful similarity metrics, without the regularization afforded by restricting ourselves to a family of warping distances. Autowarp can be implemented efficiently because we have defined a differentiable, parametrized family of warping distances over which it is possible to do batched gradient descent. Each step of batched gradient descent can be computed in time O(SN 2), where S is the batch size, and N is the number of elements in a given trajectory. There are further possible improvements in speed, for example, by leveraging techniques similar to FastDTW [29], which can approximate any warping distance in linear time, bringing the run-time of each step of batched gradient descent to O(SN). Across different datasets and noise settings, Autowarp is able to perform as well as, and often better, than the hand-crafted similarity metric designed specifically for the dataset and noise. For example, in Figure 6, we note that the Autowarp distance performs almost as well as, and in certain settings, even better than the SSPD metric on the Taxicab Mobility Dataset, for which the SSPD metric was specifically crafted. Similarly, in Figure 7, we show that the Autowarp distance outperforms most other distances on the ASL dataset, including the EDR distance, which was validated on this dataset. These results confirm that Autowarp can learn useful distances without prior knowledge of labels or clusters within the data. Future work will extend these results to more challenge time series data, such as those with higher dimensionality or heterogeneous data. Acknowledgments We are grateful to many people for providing helpful suggestions and comments in the preparation of this manuscript. Brainstorming discussions with Ali Abdalla provided the initial sparks that led to the Autowarp algorithm, and discussions with Ali Abid were instrumental in ensuring that the formulation of the algorithm was clear and rigorous. Feedback from Amirata Ghorbani, Jaime Gimenez, Ruishan Liu, and Amirali Aghazadeh was invaluable in guiding the experiments and analyses that were carried out for this paper. 9
2018
122
7,278
Gen-Oja: A Simple and Efficient Algorithm for Streaming Generalized Eigenvector Computation Kush Bhatia∗ University of California, Berkeley kushbhatia@berkeley.edu Aldo Pacchiano∗ University of California, Berkeley pacchiano@berkeley.edu Nicolas Flammarion University of California, Berkeley flammarion@berkeley.edu Peter L. Bartlett University of California, Berkeley peter@berkeley.edu Michael I. Jordan University of California, Berkeley jordan@cs.berkeley.edu Abstract In this paper, we study the problems of principal Generalized Eigenvector computation and Canonical Correlation Analysis in the stochastic setting. We propose a simple and efficient algorithm, Gen-Oja, for these problems. We prove the global convergence of our algorithm, borrowing ideas from the theory of fastmixing Markov chains and two-time-scale stochastic approximation, showing that it achieves the optimal rate of convergence. In the process, we develop tools for understanding stochastic processes with Markovian noise which might be of independent interest. 1 Introduction Cannonical Correlation Analysis (CCA) and the Generalized Eigenvalue Problem are two fundamental problems in machine learning and statistics, widely used for feature extraction in applications including regression [18], clustering [9] and classification [19]. Originally introduced by Hotelling in [16], CCA is a statistical tool for the analysis of multi-view data that can be viewed as a “correlation-aware" version of Principal Component Analysis (PCA). Given two multidimensional random variables, the objective in CCA is to obtain a pair of linear transformations that maximize the correlation between the transformed variables. Given access to samples {(xi, yi)n i=1} of zero mean random variables X, Y ∈Rd with an unknown joint distribution PXY , CCA can be used to discover features expressing similarity or dissimilarity between X and Y . Formally, CCA aims to find a pair of vectors u, v ∈Rd such that projections of X onto v and Y onto u are maximally correlated. In the population setting, the corresponding objective is given by: max v⊤E[XY ⊤]u s.t. v⊤E[XX⊤]v = 1 and u⊤E[Y Y ⊤]u = 1. (1) ∗Equal contribution. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. In the context of covariance matrices, the objective of the generalized eigenvalue problem is to obtain the direction u or v ∈Rd maximizing discrepancy between X and Y and can be formulated as, arg max v̸=0 v⊤E[XX⊤]v v⊤E[Y Y ⊤]v and arg max u̸=0 u⊤E[Y Y ⊤]u u⊤E[XX⊤]u. (2) More generally, given symmetric matrices A, B, with B positive definite, the objective of the principal generalized eigenvector problem is to obtain a unit norm vector w such that Aw = λBw for λ maximal. CCA and the generalized eigenvalue problem are intimately related. In fact, the CCA problem can be cast as a special case of the generalized eigenvalue problem by solving for u and v in the following objective:  0 E[XY ⊤] E[Y X⊤] 0  | {z } A  v u  = λ  E[XX⊤] 0 0 E[Y Y ⊤]  | {z } B  v u  . (3) The optimization problems underlying both CCA and the generalized eigenvector problem are nonconvex in general. While they admit closed-form solutions, even in the offline setting a direct computation requires O(d3) flops which is infeasible for large-scale datasets. Recently, there has been work on solving these problems by leveraging fast linear system solvers [14, 2] while requiring complete knowledge of the matrices A and B. In the stochastic setting, the difficulty increases because the objective is to maximize a ratio of expectations, in contrast to the standard setting of stochastic optimization [26], where the objective is the maximization of an expectation. There has been recent interest in understanding and developing efficient algorithms with provable convergence guarantees for such non-convex problems. [17] and [27] recently analyzed the convergence rate of Oja’s algorithm [25], one of the most commonly used algorithm for streaming PCA. In contrast, for the stochastic generalized eigenvalue problem and CCA problem, the focus has been to translate algorithms from the offline setting to the online one. For example, [12] proposes a streaming algorithm for the stochastic CCA problem which utilizes a streaming SVRG method to solve an online least-squares problem. Despite being streaming in nature, this algorithm requires a non-trivial initialization and, in contrast to the spirit of streaming algorithms, updates its eigenvector estimate only after every few samples. This raises the following challenging question: Is it possible to obtain an efficient and provably convergent counterpart to Oja’s Algorithm for computing the principal generalized eigenvector in the stochastic setting? In this paper, we propose a simple, globally convergent, two-line algorithm, Gen-Oja, for the stochastic principal generalized eigenvector problem and, as a consequence, we obtain a natural extension of Oja’s algorithm for the streaming CCA problem. Gen-Oja is an iterative algorithm which works by updating two coupled sequences at every time step. In contrast with existing methods [17], at each time step the algorithm can be seen as performing a step of Oja’s method, with a noise term which is neither zero mean nor conditionally independent, but instead is Markovian in nature. The analysis of the algorithm borrows tools from the theory of fast mixing of Markov chains [11] as well as two-time-scale stochastic approximation [6, 7, 8] to obtain an optimal (up to dimension dependence) fast convergence rate of ˜O(1/n). Notation: We denote by λi(M) and σi(M) the ith largest eigenvalue and singular value of a square matrix M. For any positive semi-definite matrix N, we denote inner product in the N-norm by ⟨·, ·⟩N and the corresponding norm by ∥· ∥N. We let κN = λmax(N) λmin(N) denote the condition number of N. We denote the eigenvalues of the matrix B−1A by λ1 > λ2 ≥. . . ≥λd with (ui)d i=1 and (˜ui)d i=1 denoting the corresponding right and left eigenvectors of B−1A whose existence is guaranteed by Lemma G.3 in Appendix G.3. We use ∆λ to denote the eigengap λ1 −λ2. 2 Problem Statement In this section, we focus on the problem of estimating principal generalized eigenvectors in a stochastic setting. The generalized eigenvector, vi, corresponding to a system of matrices (A, B), 2 where A ∈Rd×d is a symmetric matrix and B ∈Rd×d is a symmetric positive definite matrix, satisfies Avi = λiBvi. (4) The principal generalized eigenvector v1 corresponds to the vector with the largest value2 of λi, or, equivalently, v1 is the principal eigenvector of the non-symmetric matrix B−1A. The vector v1 also corresponds to the maximizer of the generalized Rayleigh quotient given by v1 = arg max v∈Rd v⊤Av v⊤Bv . (5) In the stochastic setting, we only have access to a sequence of matrices A1, . . . , An ∈Rd×d and B1, . . . , Bn ∈Rd×d assumed to be drawn i.i.d. from an unknown underlying distribution, such that E[Ai] = A and E[Bi] = B and the objective is to estimate v1 given access to O(d) memory. In order to quantify the error between a vector and its estimate, we define the following generalization of the sine with respect to the B-norm as, sin2 B(v, w) = 1 −  v⊤Bw ∥v∥B∥w∥B 2 . (6) 3 Related Work PCA. There is a vast literature dedicated to the development of computationally efficient algorithms for the PCA problem in the offline setting (see [23, 13] and references therein). In the stochastic setting, sharp convergence results were obtained recently by [17] and [27] for the principal eigenvector computation problem using Oja’s algorithm and later extended to the streaming k-PCA setting by [1]. They are able to obtain a O(1/n) convergence rate when the eigengap of the matrix is positive and a O(1/√n) rate is attained in the gap free setting. Offline CCA and generalized eigenvector. Computationally efficient optimization algorithms with finite convergence guarantees for CCA and the generalized eigenvector problem based on Empirical Risk Minimization (ERM) on a fixed dataset have recently been proposed in [14, 31, 2]. These approaches work by reducing the CCA and generalized eigenvector problem to that of solving a PCA problem on a modified matrix M (e.g., for CCA, M = B −1 2 AB −1 2 ). This reformulation is then solved by using an approximate version of the Power Method that relies on a linear system solver to obtain the approximate power method step. [14, 2] propose an algorithm for the generalized eigenvector computation problem and instantiate their results for the CCA problem. [20, 21, 31] focus on the CCA problem by optimizing a different objective: min 1 2 ˆE|φ⊤xi −ψ⊤yi|2 + λx∥φ∥2 2 + λy∥ψ∥2 2 s.t. ∥φ∥ˆE[xx⊤] = ∥ψ∥ˆE[yy⊤] = 1, where ˆE denotes the empirical expectation. The proposed methods utilize the knowledge of complete data in order to solve the ERM problem, and hence is unclear how to extend them to the stochastic setting. Stochastic CCA and generalized eigenvector. There has been a dearth of work for solving these problems in the stochastic setting owing to the difficulties mentioned in Section 1. Recently, [12] extend the algorithm of [31] from the offline to the streaming setting by utilizing a streaming version of the SVRG algorithm for the least squares system solver. Their algorithm, based on the shift and invert method, suffers from two drawbacks: a) contrary to the spirit of streaming algorithms, this method does not update its estimate at each iteration – it requires to use logarithmic samples for solving an online least squares problem, and, b) their algorithm critically relies on obtaining an estimate of λ1 to a small accuracy for which it requires to burn a few samples in the process. In comparison, Gen-Oja takes a single stochastic gradient step for the inner least squares problem and updates its estimate of the eigenvector after each sample. Perhaps the closest to our approach is [4], who propose an online method by solving a convex relaxation of the CCA objective with an inexact stochastic mirror descent algorithm. Unfortunately, the computational complexity of their method is O(d2) which renders it infeasible for large-scale problems. 3 Algorithm 1: Gen-Oja for Streaming Av = λBv Input: Time steps T, step size αt (Least Squares), βt (Oja) Initialize: (w0, v0) ←sample uniformly from the unit sphere in Rd, ¯v0 = v0 for t = 1, . . . , T do Draw sample (At, Bt) wt ←wt−1 −αt(Btwt−1 −Atvt−1) v′ t ←vt−1 + βtwt vt ← v′ t ∥vt∥2 Output: Estimate of Principal Generalized Eigenvector: vT 4 Gen-Oja In this section, we describe our proposed approach for the stochastic generalized eigenvector problem (see Section 2). Our algorithm Gen-Oja, described in Algorithm 1, is a natural extension of the popular Oja’s algorithm used for solving the streaming PCA problem. The algorithm proceeds by iteratively updating two coupled sequences (wt, vt) at the same time: wt is updated using one step of stochastic gradient descent with constant step-size to minimize w⊤Bw −2w⊤Avt and vt is updated using a step of Oja’s algorithm. Gen-Oja has its roots in the theory of two-time-scale stochastic approximation, by viewing the sequence wt as a fast mixing Markov chain and vt as a slowly evolving one. In the sequel, we describe the evolution of the Markov chains (wt)t≥0, (vt)t≥0, in the process outlining the intuition underlying Gen-Oja and understanding the key challenges which arise in the convergence analysis. Oja’s algorithm. Gen-Oja is closely related to the Oja’s algorithm [25] for the streaming PCA problem. Consider a special case of the problem, when each Bt = I. In the offline setting, this reduces the generalized eigenvector problem to that of computing the principal eigenvector of A. With the setting of step-size αt = 1, Gen-Oja recovers the Oja’s algorithm given by vt = vt−1 + βtAtvt−1 ∥vt−1 + βtAtvt−1.∥ This algorithm is exactly a projected stochastic gradient ascent on the Rayleigh quotient v⊤Av (with a step size βt). Alternatively, it can be interpreted as a randomized power method on the matrix (I + βtA)[15]. Two-time-scale approximation. The theory of two-time-scale approximation forms the underlying basis for Gen-Oja. It considers coupled iterative systems where one component changes much faster than the other [7, 8]. More precisely, its objective is to understand classical systems of the type: xt = xt−1 + αt  h (xt−1, yt−1) + ξ1 t  (7) yt = yt−1 + βt  g (xt−1, yt−1) + ξ2 t  , (8) where g and h are the update functions and (ξ1 t , ξ2 t ) correspond to the noise vectors at step t and typically assumed to be martingale difference sequences. In the above model, whenever the two step sizes αt and βt satisfy βt/αt →0, the sequence yt moves on a slower timescale than xt. For any fixed value of y the dynamical system given by xt, xt = xt−1 + αt[h (xt−1, y) + ξ1 t ], (9) converges to to a solution x∗(y). In the coupled system, since the state variables xt move at a much faster time scale, they can be seen as being close to x∗(yt), and thus, we can alternatively consider: yt = yt−1 + βt  g (x∗(yt−1), yt−1) + ξ2 t  . (10) If the process given by yt above were to converge to y∗, under certain conditions, we can argue that the coupled process (xt, yt) converges to (x∗(y∗), y∗). Intuitively, because xt and yt are evolving at different time-scales, xt views the process yt as quasi-constant while yt views xt as a process rapidly converging to x∗(yt). 2Note that we consider here the largest signed value of λi 4 Gen-Oja can be seen as a particular instance of the coupled iterative system given by Equations (7) and (8) where the sequence vt evolves with a step-size βt ≈1 t , much slower than the sequence wt, which has a step-size of αt ≈ 1 log(t). Proceeding as above, the sequence vt views wt as having converged to B−1Avt + ξt, where ξt is a noise term, and the update step for vt in Gen-Oja can be viewed as a step of Oja’s algorithm, albeit with Markovian noise. While previous works on the stochastic CCA problem required to use logarithmic independent samples to solve the inner least-squares problem in order to perform an approximate power method (or Oja) step, the theory of two-time-scale stochastic approximation suggests that it is possible to obtain a similar effect by evolving the sequences wt and vt at two different time scales. Understanding the Markov Process {wt}. In order to understand the process described by the sequence wt, we consider the homogeneous Markov chain (wv t ) defined by wv t = wv t−1 −α(Btwv t−1 −Atv), (11) for a constant vector v and we denote its t-step kernel by πt v [22]. This Markov process is an iterative linear model and has been extensively studied by [28, 10, 5]. It is known that for any step-size α ≤2/R2, the Markov chain (wv t )t≥0 admits a unique stationary distribution, denoted by νv. In addition, W 2 2 (πt v(w0, ·), νv) ≤(1 −2µα(1 −αR2 B/2))t Z Rd ∥w0 −w∥2 2dνv(w), (12) where W 2 2 (λ, ν) denotes the Wasserstein distance of order 2 between probability measures λ and ν (see, e.g., [30] for more properties of W2). Equation (12) implies that the iterative linear process described by (11) mixes exponentially fast to the stationary distribution. This forms a crucial ingredient in our convergence analysis where we use the fast mixing to obtain a bound on the expected norm of the Markovian noise (see Lemma 6.1). Moreover, one can compute the mean ¯wv of the process wt under the stationary distribution by taking expectation under νv on both sides in equation (11). Doing so, we obtain, ¯wv = B−1Av. Thus, in our setting, since the vt process evolves slowly, we can expect that wt ≈B−1Avt, allowing Gen-Oja to mimic Oja’s algorithm. 5 Main Theorem In this section, we present our main convergence guarantee for Gen-Oja when applied to the streaming generalized eigenvector problem. We begin by listing the key assumptions required by our analysis: (A1) The matrices (Ai)i≥0 satisfy E[Ai] = A for a symmetric matrix A ∈Rd×d. (A2) The matrices (Bi)i≥0 are such that each Bi ≽0 is symmetric and satisfies E[Bi] = B for a symmetric matrix B ∈Rd×d with B ≽µI for µ > 0. (A3) There exists R ≥0 such that max{∥Ai∥, ∥Bi∥} ≤R almost surely. Under the assumptions stated above, we obtain the following convergence theorem for Gen-Oja with respect to the sin2 B distance, as described in Section 2. Theorem 5.1 (Main Result). Fix any δ > 0 and ϵ1 > 0. Suppose that the step sizes are set to αt = c log(d2β+t) and βt = γ ∆λ(d2β+t) for γ > 1/2 , c > 1 and β = max   20γ2λ2 1 ∆2 λd2 log  1+δ/100 1+ϵ1 , 200  R µ + R3 µ2 + R5 µ3  log  1 + R2 µ + R4 µ2  δ∆2 λ  . Suppose that the number of samples n satisfy d2β + n log 1 min(1,2γλ1/∆λ) (d2β + n) ≥  cd δ1 min(1, λ1)  1 min(1,2γλ1/∆λ) (d3β + 1) exp cλ2 1 d2  Then, the output vn of Algorithm 1 satisfies, sin2 B(u1, vn) ≤(2 + ϵ1)cd∥Pd i=1 ˜ui˜u⊤ i ∥2 log 1 δ  δ2∥˜u1∥2 2 cγ2 log3(d2β + n) ∆2 λ(d2β + n + 1) + cd ∆λ d2β + log3(d2β) d2β + n + 1 2γ! , 5 with probability at least 1 −δ with c depending polynomially on parameters of the problem λ1, κB, R, µ. The parameter δ1 is set as δ1 = ϵ1 2(2+ϵ1). The above result shows that with probability at least 1 −δ, Gen-Oja converges in the B-norm to the right eigenvector, u1, corresponding to the maximum eigenvalue of the matrix B−1A. Further, Gen-Oja exhibits an ˜O(1/n) rate of convergence, which is known to be optimal for stochastic approximation algorithms even with convex objectives [24]. Comparison with Streaming PCA. In the setting where B = I, and A ⪰0 is a covariance matrix, the principal generalized eigenvector problem reduces to performing PCA on the A. When compared with the results obtained for streaming PCA by [17], our corresponding results differ by a factor of dimension d and problem dependent parameters λ1, ∆λ. We believe that such a dependence is not inherent to Gen-Oja but a consequence of our analysis. We leave this task of obtaining a dimension free bound for Gen-Oja as future work. Gap-independent step size: While the step size for the sequence vn in Gen-Oja depends on eigengap, which is a priori unknown, one can leverage recent results as in [29] to get around this issue by using a streaming average step size. 6 Proof Sketch In this section, we detail out the two key ideas underlying the analysis of Gen-Oja to obtain the convergence rate mentioned in Theorem 5.1: a) controlling the non i.i.d. Markovian noise term which is introduced because of the coupled Markov chains in Gen-Oja and b) proving that a noisy power method with such Markovian noise converges to the correct solution. Controlling Markovian perturbations. In order to better understand the sequence vt, we rewrite the update as, v′ t = vt−1 + βtwt = vt−1 + βt(B−1Avt−1 + ξt), (13) where ξt = wt −B−1Avt−1 is the prediction error which is a Markovian noise. Note that the noise term is neither mean zero nor a martingale difference sequence. Instead, the noise term ξt is dependent on all previous iterates, which makes the analysis of the process more involved. This framework with Markovian noise has been extensively studied by [6, 3]. From the update in Equation (13), we observe that Gen-Oja is performing an Oja update but with a controlled Markovian noise. However, we would like to highlight that classical techniques in the study of stochastic approximation with Markovian noise (as the Poisson Equation [6, 22]) were not enough to provide adequate control on the noise to show convergence. In order to overcome this difficulty, we leverage the fast mixing of the chain wv t for understanding the Markovian noise. While it holds that E[∥ξt∥2] = O(1) (see Appendix C), a key part of our analysis is the following lemma, the proof of which can be found in Appendix B). Lemma 6.1. . For any choice of k > 4 λ1(B) µα log( 1 βt+k ), and assuming that ∥ws∥≤Ws for t ≤s ≤ t + k we have that ∥E[ϵt+k|Ft]∥2 = O(βtk2αtWt+k) Lemma 6.1 uses the fast mixing of wt to show that ∥E[ξt]|Ft−r∥2 = ˜O(βt) where r = O(log t), i.e., the magnitude of the expected noise is small conditioned on log(t) steps in the past. Analysis of Oja’s algorithm. The usual proofs of convergence for stochastic approximation define a Lyapunov function and show that it decreases sufficiently at each iteration. Oftentimes control on the per step rate of decrease can then be translated into a global convergence result. Unfortunately in the context of PCA, due to the non-convexity of the Raleigh quotient, the quality of the estimate vt cannot be related to the previous vt−1. Indeed vt may become orthogonal to the leading eigenvector. Instead [17] circumvent this issue by leveraging the randomness of the initialization and adopt an operator view of the problem. We take inspiration from this approach in our analysis of Gen-Oja. Let Gi = wiv⊤ i−1 and Ht = Qt i=1(I + βiGi), Gen-Oja’s update can be equivalently written as vt = Htv0 ∥Htv0∥2 2 , 6 pushing, for the analysis only, the normalization step at the end. This point of view enables us to analyze the improvement of Ht over Ht−1 since allows one to interpret Oja’s update as one step of power method on Ht starting on a random vector v0. We present here an easy adaptation of [17, Lemma 3.1] that takes into account the special geometry of the generalized eigenvector problem and the asymmetry of B−1A. The proof can be found in Appendix A. Lemma 6.2. Let H ∈Rd×d, (ui)d i=1 and (˜ui)d i=1 be the corresponding right and left eigenvectors of B−1A and w ∈Rd chosen uniformly on the sphere, then with probability 1 −δ (over the randomness in the initial iterate) sin2 B(ui, Hw) ≤C log(1/δ) δ Tr(HH⊤P j̸=i ˜uj ˜u⊤ j ) ˜u⊤ i HH⊤˜ui , (14) for some universal constant C > 0. This lemma has the virtue of highly simplifying the challenging proof of convergence of Oja’s algorithm. Indeed we only have to prove that Ht will be close to Qt i=1(I + βiB−1A) for t large enough which can be interpreted as an analogue of the law of large numbers for the multiplication of matrices. This will ensure that Tr(HtH⊤ t P j̸=i ˜uj ˜u⊤ j ) is relatively small compared to ˜u⊤ i HtH⊤ t ˜ui and be enough with Lemma 6.2 to prove Theorem 5.1. The proof follows the line of [17] with two additional tedious difficulties: the Markovian noise is neither unbiased nor independent of the previous iterates, and the matrix B−1A is no longer symmetric, which is precisely why we consider the left eigenvector ˜ui in the right-hand side of Eq. (14). We highlight two key steps: • First we show that E Tr(HtH⊤ t P j̸=i ˜uj ˜u⊤ j ) grows as O(exp(2λ2 Pt i=1 βi)), which implies by Markov’s inequality the same bound on Tr(HtH⊤ t P j̸=i ˜uj ˜u⊤ j ) with constant probability. See Lemmas E.2 for more details. • Second we show that Var ˜u⊤ i HtH⊤ t ˜ui grows as O(exp(4λ1 Pt i=1 βi)) and E˜u⊤ i HH⊤˜ui grows as O(exp(2λ1 Pt i=1 βi)) which implies by Chebshev’s inequality the same bound for ˜u⊤ i HH⊤˜ui with constant probability. See Lemmas E.3 and E.5 for more details. 7 Application to Canonical Correlation Analysis Consider two random vectors X ∈Rd and Y ∈Rd with joint distribution PXY . The objective of canonical correlation analysis in the population setting is to find the canonical correlation vectors φ, ψ ∈Rd,d which maximize the correlation max φ,ψ E[(φ⊤X)(ψ⊤Y )] p E[(φ⊤X)2]E[(ψ⊤Y )2] . This problem is equivalent to maximizing φ⊤E[XY ⊤]ψ under the constraint E[(φ⊤X)2] = E[(ψ⊤Y )2] = 1 and admits a closed form solution: if we define T = E[XX⊤]−1/2E[XY ⊤]E[Y Y ⊤]−1/2, then the solution is (φ∗, ψ∗) = (E[XX⊤]−1/2a1E[Y Y ⊤]−1/2b1) where a1, b1 are the left and right principal singular vectors of T. By the KKT conditions, there exist ν1, ν2 ∈R such that this solution satisfies the stationarity equation E[XY ⊤]ψ = ν1E[XX⊤]φ and E[Y X⊤]φ = ν2E[Y Y ⊤]ψ. Using the constraint conditions we conclude that ν1 = ν2. This condition can be written (for λ = ν1) in the matrix form of Eq. (3). As a consequence, finding the largest generalized eigenvector for the matrices (A, B) will recover the canonical correlation vector (φ, ψ). Solving the associated generalized streaming eigenvector problem, we obtain the following result for estimating the canonical correlation vector whose proof easily follows from Theorem 5.1 (setting γ = 6). Theorem 7.1. Assume that max{∥X∥, ∥Y ∥} ≤R a.s., min{λmin(E[XX⊤]), λmin(E[Y Y ⊤])} = µ > 0 and σ1(T) −σ2(T) = ∆> 0. Fix any δ > 0, let ϵ1 ≥0, and suppose the step sizes are set to αt = 1 2R2 log(d2β+t) and βt = 6 ∆(d2β+t) and β = max   720σ2 1 ∆2d2 log  1+δ/100 1+ϵ1 , 200  R µ + R3 µ2 + R5 µ3  1 δ log(1 + R2 µ + R4 µ2 ) ∆2   7 0 2 4 6 log10(t) -5 -4 -3 -2 -1 0 log10[sinB(vt,u1)] =1 =10 =1000 =10000 0 2 4 6 log10(t) -5 -4 -3 -2 -1 0 log10[sinB(vt,u1)] = * = */8 = */16 0 2 4 6 log10(t) -5 -4 -3 -2 -1 0 log10[sinB(vt,u1)] = */t = */16t = */t1/2 = */16t1/2 Figure 1: Synthetic Generalized Eigenvalue problem. Left: Comparison with two-steps methods. Middle: Robustness to step size αt. Right: Robustness to step size βt (Streaming averaged Gen-Oja is dashed). Suppose that the number of samples n satisfy d2β + n log 1 min(1,12λ1/∆λ) (d2β + n) ≥  cd δ1 min(1, λ1)  1 min(1,12λ1/∆λ) (d3β + 1) exp cλ2 1 d2  Then the output (φt, ψt) of Algorithm 1 applied to (A, B) defined above satisfies, sin2 B((φ∗, ψ∗), (φt, ψt)) ≤(2 + ϵ1)cd2 log 1 δ  δ2∥˜u1∥2 2 log3(d2β + n) ∆2(d2β + n + 1), with probability at least 1 −δ with c depending on parameters of the problem and independent of d and ∆where δ1 = ϵ1 2(2+ϵ1). We can make the following observations: • The convergence guarantee are comparable with the sample complexity obtained by the ERM (t = ˜O(d/(ε∆2) for sub-Gaussian variables and t = ˜O(1/(ε∆2µ2) for bounded variables)[12]. • The sample complexity in [12] is better in term of the dependence on d. They obtain the same rates as the ERM. We are unable to explicitly compare our bounds with [4] since they work in the gap free setting and their computational complexity is O(d2). 8 Simulations Here we illustrate the practical utility of Gen-Oja on a synthetic, streaming generalized eigenvector problem. We take d = 20 and T = 106. The streams (At, Bt) ∈(Rd×d)2 are normally-distributed with covariance matrix A and B with random eigenvectors and eigenvalues decaying as 1/i, for i = 1, . . . , d. Here R2 denotes the radius of the streams with R2 = max{Tr A, Tr B}. All results are averaged over ten repetitions. Comparison with two-steps methods. In the left plot of Figure 1 we compare the behavior of Gen-Oja to different two-steps algorithms. Since the method by [4] is of complexity O(d2), we compare Gen-Oja to a method which alternates between one step of Oja’s algorithm and τ steps of averaged stochastic gradient descent with constant step size 1/2R2. Gen-Oja is converging at rate O(1/t) whereas the other methods are very slow. For τ = 10, the solution of the inner loop is too inaccurate and the steps of Oja are inefficient. For τ = 10000, the output of the sgd steps is very accurate but there are too few Oja iterations to make any progress. τ = 1000 seems an optimal parameter choice but this method is slower than Gen-Oja by an order of magnitude. Robustness to incorrect step-size α. In the middle plot of Figure 1 we compare the behavior of Gen-Oja for step size α ∈{α∗, α∗/8, α∗/16} where α∗= 1/R2. We observe that Gen-Oja converges at a rate O(1/t) independently of the choice of α. Robustness to incorrect step-size βt. In the right plot of Figure 1 we compare the behavior of Gen-Oja for step size βt ∈{β∗/t, β∗/16t, β∗/ √ i, β∗/16 √ i} where β∗corresponds to the minimal error after one pass over the data. We observe that Gen-Oja is not robust to the choice of the constant 8 for step size βt ∝1/t. If the constant is too small, the rate of convergence is arbitrary slow. We observe that considering the streaming average of [29] on Gen-Oja with a step size βt ∝1/ √ t enables to recover the fast O(1/t) convergence while being robust to constant misspecification. 9 Conclusion We have proposed and analyzed a simple online algorithm to solve the streaming generalized eigenvector problem and applied it to CCA. This algorithm, inspired by two-time-scale stochastic approximation achieves a fast O(1/t) convergence. Considering recovering the k-principal generalized eigenvector (for k > 1) and obtaining a slow convergence rate O(1/ √ t) in the gap free setting are promising future directions. Finally, it would be worth considering removing the dimension dependence in our convergence guarantee. Acknowledgements We gratefully acknowledge the support of the NSF through grant IIS-1619362. AP acknowledges Huawei’s support through a BAIR-Huawei PhD Fellowship. This work was supported in part by the Mathematical Data Science program of the Office of Naval Research under grant number N00014-181-2764. This work was partially supported by AFOSR through grant FA9550-17-1-0308. References [1] Z. Allen-Zhu and Y. Li. First efficient convergence for streaming k-PCA: a global, gap-free, and nearoptimal rate. In Foundations of Computer Science (FOCS), 2017 IEEE 58th Annual Symposium on, pages 487–492. IEEE, 2017. [2] Z. Allen-Zhu and Y. Li. Doubly accelerated methods for faster CCA and generalized eigendecomposition. In International Conference on Machine Learning, 2017. [3] C. Andrieu, E. Moulines, and P. Priouret. Stability of stochastic approximation under verifiable conditions. SIAM Journal on Control and Optimization, 44(1):283–312, 2005. [4] R. Arora, T. V. Marinov, P. Mianjy, and N. Srebro. Stochastic approximation for canonical correlation analysis. In Advances in Neural Information Processing Systems. 2017. [5] F. Bach and E. Moulines. Non-strongly-convex smooth stochastic approximation with convergence rate O(1/n). In Advances in Neural Information Processing Systems, 2013. [6] A. Benveniste, M. Métivier, and P. Priouret. Adaptive Algorithms and Stochastic Approximations. Springer Publishing Company, Incorporated, 1990. [7] V. S. Borkar. Stochastic approximation with two time scales. Systems & Control Letters, 29(5):291–294, 1997. [8] V. S. Borkar. Stochastic Approximation: A Dynamical Systems Viewpoint, volume 48. Springer, 2009. [9] K. Chaudhuri, S. M. Kakade, K. Livescu, and K. Sridharan. Multi-view clustering via canonical correlation analysis. In International Conference on Machine Learning, pages 129–136, 2009. [10] P. Diaconis and D. Freedman. Iterated random functions. SIAM Review, 41(1):45–76, 1999. [11] A. Dieuleveut, A. Durmus, and F. Bach. Bridging the gap between constant step size stochastic gradient descent and Markov chains. arXiv preprint arXiv:1707.06386, 2017. [12] C. Gao, D. Garber, N. Srebro, J. Wang, and W. Wang. Stochastic canonical correlation analysis. arXiv preprint arXiv:1702.06533, 2017. [13] D. Garber, E. Hazan, J. Jin, S. Kakade, C. Musco, P. Netrapalli, and A. Sidford. Faster eigenvector computation via shift-and-invert preconditioning. In International Conference on Machine Learning, 2016. [14] R. Ge, C. Jin, S. Kakade, P. Netrapalli, and A. Sidford. Efficient algorithms for large-scale generalized eigenvector computation and canonical correlation analysis. In International Conference on International Conference on Machine, 2016. [15] M. Hardt and E. Price. The noisy power method: A meta algorithm with applications. In Advances in Neural Information Processing Systems, pages 2861–2869, 2014. [16] H. Hotelling. Relations between two sets of variates. Biometrika, 28(3/4):321–377, 1936. [17] P. Jain, C. Jin, S. M. Kakade, P. Netrapalli, and A. Sidford. Streaming PCA: Matching matrix Bernstein and near-optimal finite sample guarantees for Oja’s algorithm. In Conference on Learning Theory, 2016. 9 [18] S. M. Kakade and D. P. Foster. Multi-view regression via canonical correlation analysis. In International Conference on Computational Learning Theory, pages 82–96. Springer, 2007. [19] N. Karampatziakis and P. Mineiro. Discriminative features via generalized eigenvectors. arXiv preprint arXiv:1310.1934, 2013. [20] Y. Lu and D. P. Foster. Large scale canonical correlation analysis with iterative least squares. In Advances in Neural Information Processing Systems, 2014. [21] Z. Ma, Y. Lu, and D. Foster. Finding linear structure in large datasets with scalable canonical correlation analysis. In International Conference on International Conference on Machine Learning, 2015. [22] S. P. Meyn and R. L. Tweedie. Markov Chains and Stochastic Stability. Cambridge University Press, 2009. [23] C. Musco and C. Musco. Randomized block Krylov methods for stronger and faster approximate singular value decomposition. In Advances in Neural Information Processing Systems, 2015. [24] A. S. Nemirovsky and D. B. Yudin. Problem Complexity and Method Efficiency in Optimization. WileyInterscience Series in Discrete Mathematics. John Wiley & Sons, 1983. [25] E. Oja. Simplified neuron model as a principal component analyzer. Journal of Mathematical Biology, 15 (3):267–273, 1982. [26] H. Robbins and S. Monro. A stochastic approximation method. The Annals of Mathematical Statistics, 22 (3):400–407, 1951. [27] O. Shamir. Convergence of stochastic gradient descent for PCA. In International Conference on Machine Learning, 2016. [28] D. Steinsaltz. Locally contractive iterated function systems. Annals of Probability, pages 1952–1979, 1999. [29] N. Tripuraneni, N. Flammarion, F. Bach, and M. I. Jordan. Averaging stochastic gradient descent on Riemannian manifolds. In Conference on Learning Theory, 2018. [30] C. Villani. Optimal Transport: Old and New, volume 338. Springer-Verlag Berlin Heidelberg, 2008. [31] W. Wang, J. Wang, D. Garber, and N. Srebro. Efficient globally convergent stochastic optimization for canonical correlation analysis. In Advances in Neural Information Processing Systems, 2016. 10
2018
123
7,279
Heterogeneous Bitwidth Binarization in Convolutional Neural Networks Josh Fromm Department of Electrical Engineering University of Washington Seattle, WA 98195 jwfromm@uw.edu Shwetak Patel Department of Computer Science University of Washington Seattle, WA 98195 shwetak@cs.washington.edu Matthai Philipose Microsoft Research Redmond, WA 98052 matthaip@microsoft.com Abstract Recent work has shown that fast, compact low-bitwidth neural networks can be surprisingly accurate. These networks use homogeneous binarization: all parameters in each layer or (more commonly) the whole model have the same low bitwidth (e.g., 2 bits). However, modern hardware allows efficient designs where each arithmetic instruction can have a custom bitwidth, motivating heterogeneous binarization, where every parameter in the network may have a different bitwidth. In this paper, we show that it is feasible and useful to select bitwidths at the parameter granularity during training. For instance a heterogeneously quantized version of modern networks such as AlexNet and MobileNet, with the right mix of 1-, 2- and 3-bit parameters that average to just 1.4 bits can equal the accuracy of homogeneous 2-bit versions of these networks. Further, we provide analyses to show that the heterogeneously binarized systems yield FPGA- and ASIC-based implementations that are correspondingly more efficient in both circuit area and energy efficiency than their homogeneous counterparts. 1 Introduction With Convolutional Neural Networks (CNNs) now outperforming humans in vision classification tasks (Szegedy et al., 2015), it is clear that CNNs will be a mainstay of AI applications. However, CNNs are known to be computationally demanding, and are most comfortably run on GPUs. For execution in mobile and embedded settings, or when a given CNN is evaluated many times, using a GPU may be too costly. The search for inexpensive variants of CNNs has yielded techniques such as hashing (Chen et al., 2015), vector quantization (Gong et al., 2014), and pruning (Han et al., 2015). One particularly promising track is binarization (Courbariaux et al., 2015), which replaces 32-bit floating point values with single bits, either +1 or -1, and (optionally) replaces floating point multiplies with packed bitwise popcount-xnors Hubara et al. (2016). Binarization can reduce the size of models by up to 32×, and reduce the number of operations executed by up to 64×. It has not escaped hardware designers that the popcount-xnor operations used in a binary network are especially well suited for FPGAs or ASICs. Taking the xnor of two bits requires a single logic gate compared to the hundreds required for even the most efficient floating point multiplication units (Ehliar, 2014). The drastically reduced area requirements allows binary networks to be implemented with fully parallel computations on even relatively inexpensive FPGAs (Umuroglu et al., 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. 2017). The level of parallelization afforded by these custom implementations allows them to outperform GPU computation while expending a fraction of the power, which offers a promising avenue of moving state of the art architectures to embedded environments. We seek to improve the occupancy, power, and/or accuracy of these solutions. Our approach is based on the simple observation that the power consumption, space needed, and accuracy of binary models on FPGAs and custom hardware are proportional to mn, where m is the number of bits used to binarize input activations and n is the number of bits used to binarize weights. Current binary algorithms restrict m and n to be integer values, in large part because efficient CPU implementations require parameters within a layer to be the same bitwidth. However, hardware has no such requirements. Thus, we ask whether bitwidths can be fractional. To address this question, we introduce Heterogeneous Bitwidth Neural Networks (HBNNs), which allow each individual parameter to have its own bitwidth, giving a fractional average bitwidth to the model. Our main contributions are: (1) We propose the problem of selecting the bitwidth of individual parameters during training such that the bitwidths average out to a specified value. (2) We show how to augment a state-of-the-art homogeneous binarization training scheme with a greedy bitwidth selection technique (which we call “middle-out”) and a simple hyperparameter search to produce good heterogeneous binarizations efficiently. (3) We present a rigorous empirical evaluation (including on highly optimized modern networks such as Google’s MobileNet) to show that heterogeneity yields equivalent accuracy at significantly lower average bitwidth. (4) Although implementing HBNNs efficiently on CPU/GPU may be difficult, we provide estimates based on recently proposed FPGA/ASIC implementations that HBNNs’ lower average bitwidths can translate to significant reductions in circuit area and power. 2 Homogeneous Network Binarization In this section we discuss existing techniques for binarization. Table 1 summarizes their accuracy.1 When training a binary network, all techniques including ours maintain weights in floating point format. During forward propagation, the weights (and activations, if both weights and activations are to be binarized) are passed through a binarization function B, which projects incoming values to a small, discrete set. In backward propagation, a custom gradient, which updates the floating point weights, is applied to the binarization layer. After training is complete, the binarization function is applied one last time to the floating point weights to create a true binary (or more generally, small, discrete) set of weights, which is used for inference from then on. Binarization was first introduced by Courbariaux et al. (2015). In this initial investigation, dubbed BinaryConnect, 32-bit tensors T were converted to 1-bit variants T B using the stochastic equation B(T) ≜T B = +1 with probability p = σ(T), -1 with probability 1 −p (1) where σ is the hard sigmoid function defined by σ(x) = max(0, min(1, x+1 2 )). For the custom gradient function, BinaryConnect simply used dT B dT = 1. Although BinaryConnect showed excellent results on relatively simple datasets such as CIFAR-10 and MNIST, it performed poorly on ImageNet, achieving only an accuracy of 27.9%. Courbariaux et al. (2016) later improved this model by simplifying the binarization by simply taking T B = sign(T) and adding a gradient for this operation, namely the straight-through estimator: dT B dT = 1|T |≤1. (2) The authors showed that the straight-through estimator allowed the binarization of activations as well as weights without collapse of model performance. However, they did not attempt to train a model on ImageNet in this work. 1In line with prior work, we use the AlexNet model trained on the ImageNet dataset as the baseline. 2 Figure 1: Residual error binarization with n = 3 bits. Computing each bit takes a step from the position of the previous bit (see Equation 4). Rastegari et al. (2016) made a slight modification to the simple pure single bit representation that showed improved results. Now taking a binarized approximation as T B = αisign(T) with αi = 1 d d X j=1 |Tj|. (3) This additional scalar term allows binarized values to better fit the distribution of the incoming floating-point values, giving a higher fidelity approximation for very little extra computation. The addition of scalars and the straight-through estimator gradient allowed the authors to achieve a Top-1 accuracy of 44.2% on ImageNet. Hubara et al. (2016) and Zhou et al. (2016) found that increasing the number of bits used to quantize the activations of the network gave a considerable boost to the accuracy, achieving similar Top-1 accuracy of 51.03% and 50.7% respectively. The precise binarization function varied, but the typical approaches include linearly or logarithmically placing the quantization points between 0 and 1, clamping values below a threshold distance from zero to zero (Li et al., 2016), and computing higher bits by measuring the residual error from lower bits (Tang et al., 2017). All n-bit binarization schemes require similar amounts of computation at inference time, and have similar accuracy (see Table 1). In this work, we extend the residual error binarization function Tang et al. (2017) for binarizing to multiple (n) bits: T B 1 = sign(T), µ1 = mean(|T|) En = T − n X i=1 µi × T B i T B n>1 = sign(En−1), µn>1 = mean(|En−1|) T ≈ n X i=1 µi × T B i (4) where T is the input tensor, En is the residual error up to bit n, T B n is a tensor representing the nth bit of the approximation, and µn is a scaling factor for the nth bit. Note that the calculation of bit n is a recursive operation that relies on the values of all bits less than n. Residual error binarization has each additional bit take a step from the value of the previous bit. Figure 1 illustrates the process of binarizing a single value to 3 bits. Since every binarized value is derived by taking n steps, where each step goes left or right, residual error binarization approximates inputs using one of 2n values. 3 Heterogeneous Binarization To date, there remains a considerable gap between the performance of 1-bit and 2-bit networks (compare rows 8 and 10 of Table 1). The highest full (i.e., where both weights and activations are quantized) single-bit performer on AlexNet, Xnor-Net, remains roughly 7 percentage points less accurate (top 1) than the 2-bit variant, which is itself about 5.5 points less accurate than the 32-bit variant (row 25). When only weights are binarized, very recent results (Dong et al., 2017) similarly find that binarizing to 2 bits can yield nearly full accuracy (row 2), while the 1-bit equivalent lags by 4 points (row 1). The flip side to using 2 bits for binarization is that the resulting models require double the number of operations as the 1-bit variants at inference time. These observations naturally lead to the question, explored in this section, of whether it is possible to attain accuracies closer to those of 2-bit models while running at speeds closer to those of 1-bit variants. Of course, it is also fundamentally interesting to understand whether it is possible to match 3 the accuracy of higher bitwidth models with those that have lower (on average) bitwidth. Below, we discuss how to extend residual error binarization to allow heterogeneous (effectively fractional) bitwidths and present a method for distributing the bits of a heterogeneous approximation. 3.1 Heterogeneous Residual Error Binarization via a Mask Tensor We modify Equation 4 , which binarizes to n bits, to instead binarize to a mixture of bitwidths by changing the third line as follows: T B n>1 = sign(En−1,j), µn>1 = mean(|En−1,j|) with j : Mj ≥n (5) Note that the only addition is the mask tensor M, which is the same shape as T, and specifies the number of bits Mj that the jth entry of T should be binarized to. In each round n of the binarization recurrence, we now only consider values that are not finished binarizing, i.e, which have Mj ≥n. Unlike homogeneous binarization, therefore, heterogeneous binarization generates binarized values by taking up to, not necessarily exactly, n steps. Thus, the number of distinct values representable is Pn i=1 2i = 2n+1 −2, which is roughly double that of the homogeneous binarization. In the homogeneous case, on average, each step improves the accuracy of the approximation, but there may be certain individual values that would benefit from not taking a step, in Figure 1 for example, it is possible that (µ1 −µ2) approximates the target value better than (µ1 −µ2 + µ3). If values that benefit from not taking a step can be targeted and assigned fewer bits, the overall approximation accuracy will improve despite there being a lower average bitwidth. 3.2 Computing the Mask Tensor M The question of how to distribute bits in a heterogeneous binary tensor to achieve high representational power is equivalent to asking how M should be generated. When computing M, our goal is to take an average bitwidth B and determine both what fraction P of M should be binarized to each bitwidth (e.g., P = 5% 3-bit, 10% 2-bit and 85% 1-bit for an average of B = 1.2 bits), and how to distribute these bitwidths across the individual entries in M. The full computation of M is described in Algorithm 1. We treat the distribution P over bitwidths as a model-wide hyperparameter. Since we only search up to 3 bitwidths in practice, we perform a simple grid sweep over the values of P. As we discuss in Section 4.3, our discretization is relatively insensitive to these hyperparameters, so a coarse sweep is adequate. The results of the sweep are represented by the function DistFromAvg in Algorithm 1. Given P, we need to determine how to distribute the various bitwidths using a value aware method: assigning low bitwidths to values that do not need additional approximation and high bitwidths to (a) Bit selection representational power. (b) 1.4 bit HBNN AlexNet Accuracy. Figure 2: Effectiveness of heterogeneous bit selection techniques (a) ability of different binarization schemes to approximate a large tensor of normally distributed random values. (b) accuracy of 1.4 bit heterogeneous binarized AlexNet-BN trained using each bit-selection technique. 4 Algorithm 1 Generation of bit map M. Input: A tensor T of size N and an average bitwidth B. Output: A bit map M that can be used in Equation 5 to heterogeneously binarize T. 1: R = T ▷Initialize R, which contains values that have not yet been assigned a bitwidth 2: x = 0 3: P = DistFromAvg(B) ▷Generate distribution of bits to fit average. 4: for (b, pb) in P do ▷b is a bitwidth and pb is the percentage of T to binarize to width b. 5: S = SortHeuristic(R) ▷Sort indices of remaining values by suitability for b-bit binarization. 6: M[S[x : x + pbN]] = b 7: R = R \ R[S[x : x + pbN]] ▷Do not consider these indices in next step. 8: x += pbN 9: end for those that do. To this end, we propose several sorting heuristic methods: Top-Down (TD), Middle-Out (MO), Bottom-Up (BU), and Random (R). These methods all attempt to sort values of T based on how many bits that value should be binarized with. For example, Top-Down sorting assumes that larger values need fewer bits, and so performs a standard descending sort. Similarly, Middle-Out sorting distributes fewer bits to values closest to the mean of T, while Bottom-Up sorting assigns fewer bits to smaller values. As a simple we control, we also consider Random sorting, which assigns bits in a completely uninformed way. The definitions for the sorting heuristics is given by Equation 6. TD(T) = sort(|T|, descending) MO(T) = sort(|T| −mean(|T|), ascending) BU(T) = sort(|T|, ascending) R(T) = a fixed uniformly random permutation of T (6) To evaluate the methods in Equation 6, we performed two experiments. In the first, we create a large tensor of normally distributed values and binarize it with a variety of bit distributions P and each of the sorting heuristics using Algorithm 1. We then computed the Euclidean distance between the binarized tensor and the original full precision tensor. A lower normalized distance suggests a more powerful sorting heuristic. The results of this experiment are shown in Figure 2a, and show that Middle-Out sorting outperforms other heuristics by a significant margin. Notably, the results suggest that using Middle-Out sorting can produce approximations with fewer than 2-bits that are comparably accurate to 3-bit integer binarization. To confirm these results translate to accuracy in binarized convolutional networks, we consider 1.4 bit binarized AlexNet, with bit distribution P set to 70% 1-bit, 20% 2-bit, and 10% 3-bit, an average of 1.4 bits. The specifics of the model and training procedure are the same as those described in Section 4.1. We train this model with each of the sorting heuristics and compare the final accuracy to gauge the representational strength of each heuristic. The results are shown in Figure 2b. As expected, Middle-Out sorting performs significantly better than other heuristics and yields an accuracy comparable to 2-bit integer binarization despite using on average 1.4 bits. The intuition behind the exceptional performance of Middle-Out is based on Figure 1 . We can see that the values that are most likely to be accurate without additional bits are those that are closest to the average µn for each step n. By assigning low bitwidths to the most average values, we can not just minimize losses, but in some cases provide a better approximation using fewer average steps. In proceeding sections, all training and evaluation is performed with Middle-Out as the sorting heuristic in Algorithm 1. 4 Experiments To evaluate HBNNs we wished to answer the following three questions: (1) How does accuracy scale with an uninformed bit distribution? (2) How well do HBNNs perform on a challenging dataset compared to the state of the art? (3) Can the benefits of HBNNs be transferred to other architectures? 5 In this section we address each of these questions. 4.1 Implementation Details AlexNet with batch-normalization (AlexNet-BN) is the standard model used in binarization work due to its longevity and the general acceptance that improvements made to accuracy transfer well to more modern architectures. Batch normalization layers are applied to the output of each convolution block, but the model is otherwise identical to the original AlexNet model proposed by Krizhevsky et al. (2012). Besides it’s benefits in improving convergence, Rastegari et al. (2016) found that batchnormalization is especially important for binary networks because of the need to equally distribute values around zero. We additionally insert binarization functions within the convolutional layers of the network when binarizing weights and at the input of convolutional layers when binarizing inputs. We keep a floating point copy of the weights that is updated during back-propagation, and binarized during forward propagation as is standard for binary network training. We use the straight-through estimator for gradients. When binarizing the weights of the network’s output layer, we add a single parameter scaling layer that helps reduce the numerically large outputs of a binary layer to a size more amenable to softmax, as suggested by Tang et al. (2017). We train all models using an SGD solver with learning rate 0.01, momentum 0.9, and weight decay 1e-4 and randomly initialized weights for 90 epochs on PyTorch. 4.2 Layer-level Heterogeneity As a baseline, we test a “poor man’s” approach to HBNNs, where we fix up front the number of bits each layer is allowed, require all values in a layer to have its associated bitwidth, and then train as with conventional homogeneous binarization. We consider 10 mixes of 1, 2 and 3-bit layers so as to sweep average bitwidths between 1 and 2. We trained as described in Section 4.1. For this experiment, we used the CIFAR-10 dataset with a deliberately hobbled (4-layer fully convolutional) model with a maximum accuracy of roughly 78% as the baseline 32-bit variant. We chose CIFAR-10 to allow quick experimentation. We chose not to use a large model for CIFAR-10, because for large models it is known that even 1-bit models have 32-bit-level accuracy Courbariaux et al. (2016). Figure 3a shows the results. Essentially, accuracy increases roughly linearly with average bitwidth. Although such linear scaling of accuracy with bitwidth is itself potentially useful (since it allows finer grain tuning on FPGAs), we are hoping for even better scaling with the “data-aware” bitwidth selection provided by HBNNs. 4.3 Bit Distribution Generation As described in 3.2, one of the considerations when using HBNNs is how to take a desired average bitwidth and produce a matching distribution of bits. For example, using 70% 1-bit, 20% 2-bit and (a) CIFAR-10 uninformed bit selection. (b) HBNN AlexNet with Middle-Out bit selection. Figure 3: Accuracy results of trained HBNN models. (a) Sweep of heterogenous bitwidths on a deliberately simplified four layer convolutional model for CIFAR-10. (b) Accuracy of heterogeneous bitwidth AlexNet-BN models. Bits are distributed using the Middle-Out selection algorithm. 6 Table 1: Accuracy of related binarization work and our results Model Name Binarization (Inputs / Weights) Top-1 Top-5 Binarized weights with floating point activations 1 AlexNet SQ-BWN (Dong et al., 2017) full precision / 1-bit 51.2% 75.1% 2 AlexNet SQ-TWN (Dong et al., 2017) full precision / 2-bit 55.3% 78.6% 3 AlexNet TWN (our implementation) full precision / 1-bit 48.3% 71.4% 4 AlexNet TWN full precision / 2-bit 54.2% 77.9% 5 AlexNet HBNN (our results) full precision / 1.4-bit 55.2% 78.4% 6 MobileNet HBNN full precision / 1.4-bit 65.1% 87.2% Binarized weights and activations excluding input and output layers 7 AlexNet BNN (Courbariaux et al., 2015) 1-bit / 1-bit 27.9% 50.4% 8 AlexNet Xnor-Net (Rastegari et al., 2016) 1-bit / 1-bit 44.2% 69.2% 9 AlexNet DoReFaNet (Zhou et al., 2016) 2-bit / 1-bit 50.7% 72.6% 10 AlexNet QNN (Hubara et al., 2016) 2-bit / 1-bit 51.0% 73.7% 11 AlexNet our implementation 2-bit / 2-bit 52.2% 74.5% 12 AlexNet our implementation 3-bit / 3-bit 54.2% 78.1% 13 AlexNet HBNN 1.4-bit / 1.4-bit 53.2% 77.1% 14 AlexNet HBNN 1-bit / 1.4-bit 49.4% 72.1% 15 AlexNet HBNN 1.4-bit / 1-bit 51.5% 74.2% 16 AlexNet HBNN 2-bit / 1.4-bit 52.0% 74.5% 17 MobileNet our implementation 1-bit / 1-bit 52.9% 75.1% 18 MobileNet our implementation 2-bit / 1-bit 61.3% 80.1% 19 MobileNet our implementation 2-bit / 2-bit 63.0% 81.8% 20 MobileNet our implementation 3-bit / 3-bit 65.9% 86.7% 21 MobileNet HBNN 1-bit / 1.4-bit 60.1% 78.7% 22 MobileNet HBNN 1.4-bit / 1-bit 62.0% 81.3% 23 MobileNet HBNN 1.4-bit / 1.4-bit 64.7% 84.9% 24 MobileNet HBNN 2-bit / 1.4-bit 63.6% 82.2% Unbinarized (our implementation) 25 AlexNet (Krizhevsky et al., 2012) full precision / full precision 56.5% 80.1% 26 MobileNet (Howard et al., 2017) full precision / full precision 68.8% 89.0% 10% 3-bit values gives an average of 1.4 bits, but so too does 80% 1-bit and 20% 3-bit values. We suspected that the choice of this distribution would have a significant impact on the accuracy of trained HBNNs, and performed a hyperparameter sweep by varying DistFromAvg in Algorithm 1 when training AlexNet on ImageNet as described in the following sections. However, much to our surprise, models trained with the same average bitwidth achieved nearly identical accuracies regardless of distribution. For example, the two 1.4-bit distributions given above yield accuracies of 49.4% and 49.3% respectively. This suggests that choice of DistFromAvg is actually unimportant, which is quite convenient as it simplifies training of HBNNs considerably. 4.4 AlexNet: Binarized Weights and Non-Binarized Activations Recently, Dong et al. (2017) were able to binarize the weights of an AlexNet-BN model to 2 bits and achieve nearly full precision accuracy (row 2 of Table 1). We consider this to be the state of the art in weight binarization since the model achieves excellent accuracy despite all layer weights being binarized, including the input and output layers which have traditionally been difficult to approximate. We perform a sweep of AlexNet-BN models binarized with fractional bitwidths using middle-out selection with the goal of achieving comparable accuracy using fewer than two bits. The results of this sweep are shown in Figure 3b. We were able to achieve nearly identical top-1 accuracy to the best full 2 bit results (55.3%) with an average of only 1.4 bits (55.2%). As we had hoped, we also found that the accuracy scales in a super-linear manner with respect to bitwidth when using middle-out bit selection. Specifically, the model accuracy increases extremely quickly from 1 bit to 1.3 bits before slowly approaching the full precision accuracy. 7 4.5 AlexNet: Binarized Weights and Activations In order to realize the speed-up benefits of binarization (on CPU or FPGA) in practice, it is necessary to binarize both inputs the weights, which allows floating point multiplies to be replaced with packed bitwise logical operations. The number of operations in a binary network is reduced by a factor of 64 mn where m is the number of bits used to binarize inputs and n is the number of bits to binarize weights. Thus, there is significant motivation to keep the bitwidth of both inputs and weights as low as possible without losing too much accuracy. When binarizing inputs, the input and output layers are typically not binarized as the effects on the accuracy are much larger than other layers. We perform another sweep on AlexNet-BN with all layers but the input and output fully binarized and compare the accuracy of HBNNs to several recent results. Row 8 of Table 1 is the top previously reported accuracy (44.2%) for single bit input and weight binarization, while row 10 (51%) is the top accuracy for 2-bit inputs and 1-bit weights. Table 1 (rows 13 to 16) reports a selection of results from this search. Using 1.4 bits to binarize inputs and weights (mn = 1.4 × 1.4 = 1.96) gives a very high accuracy (53.2% top-1) while having the same number of total operations mn as a network, such as the one from row 10, binarized with 2 bit activations and 1 bit weights. We have similarly good results when leaving the input binarization bitwidth an integer. Using 1 bit inputs and 1.4 bit weights, we reach 49.4% top-1 accuracy which is a large improvement over Rastegari et al. (2016) at a small cost. We found that using more than 1.4 average bits had very little impact on the overall accuracy. Binarizing inputs to 1.4 bits and weights to 1 bit (row 15) similarly outperforms Hubara et al. (2016) (row 10). 4.6 MobileNet Evaluation Although AlexNet serves as an essential measure to compare to previous and related work, it is important to confirm that the benefits of heterogeneous binarization is model independent. To this end, we perform a similar sweep of binarization parameters on MobileNet, a state of the art architecture that has unusually high accuracy for its low number of parameters (Howard et al., 2017). MobileNet is made up of separable convolutions instead of the typical dense convolutions of AlexNet. Each separable convolution is composed of an initial spatial convolution followed by a depth-wise convolution. Because the vast bulk of computation time is spent in the depth-wise convolution, we binarize only its weights, leaving the spatial weights floating point. We binarize the depth wise weights of each MobileNet layer in a similar fashion as in section 4.4 and achieve a Top-1 accuracy of 65.1% (row 6). This is only a few percent below our unbinarized implementation (row 26), which is an excellent result for the significant reduction in model size. We additionally perform a sweep of many different binarization bitwidths for both the depth-wise weights and input activations of MobileNet, with results shown in rows 17-24 of Table 1. Just as in the AlexNet case, we find that MobileNet with an average of 1.4 bits (rows 21 and 22) achieves over 10% higher accuracy than 1-bit binarization (row 17). We similarly observe that 1.4-bit binarization outperforms 2-bit binarization in each permutation of bitwidths. The excellent performance of HBNN MobileNet confirms that heterogeneous binarization is fundamentally valuable, and we can safely infer that it is applicable to many other network architectures as well. 5 Hardware Implementability Our experiments demonstrate that HBNNs have significant advantages compared to integer bitwidth approximations. However, with these representational benefits come added complexity in implementation. Binarization typically provides a significant speed up by packing bits into 64-bit integers, allowing a CPU or GPU to perform a single xnor operation in lieu of 64 floating-point multiplications. However, Heterogeneous tensors are essentially composed of sparse arrays of bits. Array sparsity makes packing bits inefficient, nullifying much of the speed benefits one would expect from having fewer average bits. The necessity of bit packing exists because CPUs and GPUs are designed to operate on groups of bits rather than individual bits. However, programmable or custom hardware such as FPGAs and ASICs have no such restriction. In hardware, each parameter can have its own set of n xnor-popcount units, where n is the bitwidth of that particular parameter. In FPGAs and ASICs, the total number of computational units in a network has a significant impact on the power consumption and speed of inference. Thus, the benefits of HBNNs, higher accuracy with fewer computational units, are fully realizable. 8 Table 2: Hardware Implementation Metrics Platform Model Unfolding Bits Occupancy kFPS Pchip (W) Top-1 CIFAR-10 Baseline Implementations 1 ZC706 VGG-8 1× 1 21.2% 21.9 3.6 80.90% 2 ZC706 VGG-8 4× 1 84.8% 87.6 14.4 80.90% 3 ASIC VGG-8 2 6.06 mm2 3.4 0.38 87.89% CIFAR-10 HBNN Customization 4 ZC706 VGG-8 1× 1.2 25.4% 18.25 4.3 85.8% 5 ZC706 VGG-8 1× 1.4 29.7% 15.6 5.0 89.4% 6 ZC706 VGG-8 4× 1.2 100% 73.0 17.0 85.8% 7 ASIC VGG-8 1.2 2.18 mm2 3.4 0.14 85.8% 8 ASIC VGG-8 1.4 2.96 mm2 3.4 0.18 89.4% Extrapolation to MobileNet with ImageNet Data 9 ZC706 MobileNet 1× 1 20.0% 0.45 3.4 52.9% 10 ZC706 MobileNet 1× 2 40.0% 0.23 6.8 63.0% 11 ZC706 MobileNet 1× 1.4 28.0% 0.32 4.76 64.7% 12 ASIC MobileNet 2 297 mm2 3.4 18.62 63.0% 13 ASIC MobileNet 1.4 145.5 mm2 3.4 9.1 64.7% There have been several recent binary convolutional neural network implementations on FGPAs and ASICs that provide a baseline we can use to estimate the performance of HBNNs on ZC706 FPGA platforms (Umuroglu et al., 2017) and on ASIC hardware (Alemdar et al., 2017). The results of these implementations are summarized in rows 1-3 of Table 2. Here, unfolding refers to the number of computational units placed for each parameter, by having multiple copies of a parameter, throughput can be increased through improved parallelization. Bits refers to the level of binarization of both the input activations and weights of the network. Occupancy is the number of LUTs required to implement the network divided by the total number of LUTs available for an FPGA, or the chip dimensions for an ASIC. Rows 4-12 of Table 2 show the metrics of HBNN versions of the baseline models. Some salient points that can be drawn from the table include: • Comparing lines 1, 4, and 5 show that on FPGA, fractional binarization offers fine-grained tuning of the performance-accuracy trade-off. Notably, a significant accuracy boost is obtainable for only slightly higher occupancy and power consumption. • Rows 2 and 6 both show the effect of unrolling. Notably, with 1.2 average bits, there is no remaining space on the ZC706. This means that using a full 2 bits, a designer would have to use a lower unrolling factor. In many cases, it may be ideal to adjust average bitwidth to reach maximum occupancy, giving the highest possible accuracy without sacrificing throughput. • Rows 3, 7, and 8 show that in ASIC, the size and power consumption of a chip can be drastically reduced without impacting accuracy at all. • Rows 9-13 demonstrate the benefits of fractional binarization are not restriced to CIFAR, and extend to MobileNet in a similar way. The customization options and in many cases direct performance boosts offered by HBNNs are valuable regardless of model architecture. 6 Conclusion In this paper, we present Heterogeneous Bitwidth Neural Networks (HBNNs), a new type of binary network that is not restricted to integer bitwidths. Allowing effectively fractional bitwidths in networks gives a vastly improved ability to tune the trade-offs between accuracy, compression, and speed that come with binarization. We introduce middle-out bit selection as the top performing technique for determining where to place bits in a heterogeneous bitwidth tensor. On the ImageNet dataset with AlexNet and MobileNet models, we perform extensive experiments to validate the effectiveness of HBNNs compared to the state of the art and full precision accuracy. The results of these experiments are highly compelling, with HBNNs matching or outperforming competing binarization techniques while using fewer average bits. 9 References Alemdar, Hande, Leroy, Vincent, Prost-Boucle, Adrien, and Pétrot, Frédéric. Ternary neural networks for resource-efficient ai applications. In Neural Networks (IJCNN), 2017 International Joint Conference on, pp. 2547–2554. IEEE, 2017. Chen, Wenlin, Wilson, James, Tyree, Stephen, Weinberger, Kilian, and Chen, Yixin. Compressing neural networks with the hashing trick. In International Conference on Machine Learning, pp. 2285–2294, 2015. Courbariaux, Matthieu, Bengio, Yoshua, and David, Jean-Pierre. Binaryconnect: Training deep neural networks with binary weights during propagations. In Advances in Neural Information Processing Systems, pp. 3123–3131, 2015. Courbariaux, Matthieu, Hubara, Itay, Soudry, Daniel, El-Yaniv, Ran, and Bengio, Yoshua. Binarized neural networks: Training deep neural networks with weights and activations constrained to+ 1 or-1. arXiv preprint arXiv:1602.02830, 2016. Dong, Yinpeng, Ni, Renkun, Li, Jianguo, Chen, Yurong, Zhu, Jun, and Su, Hang. Learning accurate low-bit deep neural networks with stochastic quantization. arXiv preprint arXiv:1708.01001, 2017. Ehliar, Andreas. Area efficient floating-point adder and multiplier with ieee-754 compatible semantics. In Field-Programmable Technology (FPT), 2014 International Conference on, pp. 131–138. IEEE, 2014. Gong, Yunchao, Liu, Liu, Yang, Ming, and Bourdev, Lubomir. Compressing deep convolutional networks using vector quantization. arXiv preprint arXiv:1412.6115, 2014. Han, Song, Mao, Huizi, and Dally, William J. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. arXiv preprint arXiv:1510.00149, 2015. Howard, Andrew G, Zhu, Menglong, Chen, Bo, Kalenichenko, Dmitry, Wang, Weijun, Weyand, Tobias, Andreetto, Marco, and Adam, Hartwig. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861, 2017. Hubara, Itay, Courbariaux, Matthieu, Soudry, Daniel, El-Yaniv, Ran, and Bengio, Yoshua. Quantized neural networks: Training neural networks with low precision weights and activations. arXiv preprint arXiv:1609.07061, 2016. Krizhevsky, Alex, Sutskever, Ilya, and Hinton, Geoffrey E. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pp. 1097– 1105, 2012. Li, Fengfu, Zhang, Bo, and Liu, Bin. Ternary weight networks. arXiv preprint arXiv:1605.04711, 2016. Rastegari, Mohammad, Ordonez, Vicente, Redmon, Joseph, and Farhadi, Ali. Xnor-net: Imagenet classification using binary convolutional neural networks. In European Conference on Computer Vision, pp. 525–542. Springer, 2016. Szegedy, Christian, Liu, Wei, Jia, Yangqing, Sermanet, Pierre, Reed, Scott, Anguelov, Dragomir, Erhan, Dumitru, Vanhoucke, Vincent, and Rabinovich, Andrew. Going deeper with convolutions. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1–9, 2015. Tang, Wei, Hua, Gang, and Wang, Liang. How to train a compact binary neural network with high accuracy? In AAAI, pp. 2625–2631, 2017. Umuroglu, Yaman, Fraser, Nicholas J, Gambardella, Giulio, Blott, Michaela, Leong, Philip, Jahre, Magnus, and Vissers, Kees. Finn: A framework for fast, scalable binarized neural network inference. In Proceedings of the 2017 ACM/SIGDA International Symposium on Field-Programmable Gate Arrays, pp. 65–74. ACM, 2017. Zhou, Shuchang, Wu, Yuxin, Ni, Zekun, Zhou, Xinyu, Wen, He, and Zou, Yuheng. Dorefa-net: Training low bitwidth convolutional neural networks with low bitwidth gradients. arXiv preprint arXiv:1606.06160, 2016. 10
2018
124
7,280
BRUNO: A Deep Recurrent Model for Exchangeable Data Iryna Korshunova ♥ Ghent University iryna.korshunova@ugent.be Jonas Degrave ♥† Ghent University jonas.degrave@ugent.be Ferenc Huszár Twitter fhuszar@twitter.com Yarin Gal University of Oxford yarin@cs.ox.ac.uk Arthur Gretton ♠ Gatsby Unit, UCL arthur.gretton@gmail.com Joni Dambre ♠ Ghent University joni.dambre@ugent.be Abstract We present a novel model architecture which leverages deep learning tools to perform exact Bayesian inference on sets of high dimensional, complex observations. Our model is provably exchangeable, meaning that the joint distribution over observations is invariant under permutation: this property lies at the heart of Bayesian inference. The model does not require variational approximations to train, and new samples can be generated conditional on previous samples, with cost linear in the size of the conditioning set. The advantages of our architecture are demonstrated on learning tasks that require generalisation from short observed sequences while modelling sequence variability, such as conditional image generation, few-shot learning, and anomaly detection. 1 Introduction We address the problem of modelling unordered sets of objects that have some characteristic in common. Set modelling has been a recent focus in machine learning, both due to relevant application domains and to efficiency gains when dealing with groups of objects [5, 18, 20, 23]. The relevant concept in statistics is the notion of an exchangeable sequence of random variables – a sequence where any re-ordering of the elements is equally likely. To fulfil this definition, subsequent observations must behave like previous ones, which implies that we can make predictions about the future. This property allows the formulation of some machine learning problems in terms of modelling exchangeable data. For instance, one can think of few-shot concept learning as learning to complete short exchangeable sequences [10]. A related example comes from the generative image modelling field, where we might want to generate images that are in some ways similar to the ones from a given set. At present, however, there are few flexible and provably exchangeable deep generative models to solve this problem. Formally, a finite or infinite sequence of random variables x1, x2, x3, . . . is said to be exchangeable if for all n and all permutations π p(x1, . . . , xn) = p xπ(1), . . . , xπ(n)  , (1) i. e. the joint probability remains the same under any permutation of the sequence. If random variables in the sequence are independent and identically distributed (i. i. d.), then it is easy to see that the sequence is exchangeable. The converse is false: exchangeable random variables can be correlated. One example of an exchangeable but non-i. i. d. sequence is a sequence of variables x1, . . . , xn, which ♥♠Equal contribution †Now at DeepMind. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. jointly have a multivariate normal distribution Nn(0, Σ) with the same variance and covariance for all the dimensions [1]: Σii = 1 and Σij,i̸=j = ρ, with 0 ≤ρ < 1. The concept of exchangeability is intimately related to Bayesian statistics. De Finetti’s theorem states that every exchangeable process (infinite sequence of random variables) is a mixture of i. i. d. processes: p(x1, . . . , xn) = Z p(θ) n Y i=1 p(xi|θ)dθ, (2) where θ is some parameter (finite or infinite dimensional) conditioned on which, the random variables are i. i. d. [1]. In our previous Gaussian example, one can prove that x1, . . . , xn are i. i. d. with xi ∼N(θ, 1 −ρ) conditioned on θ ∼N(0, ρ). In terms of predictive distributions p(xn|x1:n−1), the stochastic process in Eq. 2 can be written as p(xn|x1:n−1) = Z p(xn|θ)p(θ|x1:n−1)dθ, (3) by conditioning both sides on x1:n−1. Eq. 3 is exactly the posterior predictive distribution, where we marginalise the likelihood of xn given θ with respect to the posterior distribution of θ. From this follows one possible interpretation of the de Finetti’s theorem: learning to fit an exchangeable model to sequences of data is implicitly the same as learning to reason about the hidden variables behind the data. One strategy for defining models of exchangeable sequences is through explicit Bayesian modelling: one defines a prior p(θ), a likelihood p(xi|θ) and calculates the posterior in Eq. 2 directly. Here, the key difficulty is the intractability of the posterior and the predictive distribution p(xn|x1:n−1). Both of these expressions require integrating over the parameter θ, so we might end up having to use approximations. This could violate the exchangeability property and make explicit Bayesian modelling difficult. On the other hand, we do not have to explicitly represent the posterior to ensure exchangeability. One could define a predictive distribution p(xn|x1:n−1) directly, and as long as the process is exchangeable, it is consistent with Bayesian reasoning. The key difficulty here is defining an easy-tocalculate p(xn|x1:n−1) which satisfies exchangeability. For example, it is not clear how to train or modify an ordinary recurrent neural network (RNN) to model exchangeable data. In our opinion, the main challenge is to ensure that a hidden state contains information about all previous inputs x1:n regardless of sequence length. In this paper, we propose a novel architecture which combines features of the approaches above, which we will refer to as BRUNO: Bayesian RecUrrent Neural mOdel. Our model is provably exchangeable, and makes use of deep features learned from observations so as to model complex data types such as images. To achieve this, we construct a bijective mapping between random variables xi ∈X in the observation space and features zi ∈Z, and explicitly define an exchangeable model for the sequences z1, z2, z3, . . . , where we know an analytic form of p(zn|z1:n−1) without explicitly computing the integral in Eq. 3. Using BRUNO, we are able to generate samples conditioned on the input sequence by sampling directly from p(xn|x1:n−1). The latter is also tractable to evaluate, i. e. has linear complexity in the number of data points. In respect of model training, evaluating the predictive distribution requires a single pass through the neural network that implements X 7→Z mapping. The model can be learned straightforwardly, since p(xn|x1:n−1) is differentiable with respect to the model parameters. The paper is structured as follows. In Section 2 we will look at two methods selected to highlight the relation of our work with previous approaches to modelling exchangeable data. Section 3 will describe BRUNO, along with necessary background information. In Section 4, we will use our model for conditional image generation, few-shot learning, set expansion and set anomaly detection. Our code is available at github.com/IraKorshunova/bruno. 2 Related work Bayesian sets [6] aim to model exchangeable sequences of binary random variables by analytically computing the integrals in Eq. 2, 3. This is made possible by using a Bernoulli distribution for the 2 likelihood and a beta distribution for the prior. To apply this method to other types of data, e.g. images, one needs to engineer a set of binary features [7]. In that case, there is usually no one-to-one mapping between the input space X and the features space Z: in consequence, it is not possible to draw samples from p(xn|x1:n−1). Unlike Bayesian sets, our approach does have a bijective transformation, which guarantees that inference in Z is equivalent to inference in space X. The neural statistician [5] is an extension of a variational autoencoder model [8, 15] applied to datasets. In addition to learning an approximate inference network over the latent variable zi for every xi in the set, approximate inference is also implemented over a latent variable c – a context that is global to the dataset. The architecture for the inference network q(c|x1, . . . , xn) maps every xi into a feature vector and applies a mean pooling operation across these representations. The resulting vector is then used to produce parameters of a Gaussian distribution over c. Mean pooling makes q(c|x1, . . . , xn) invariant under permutations of the inputs. In addition to the inference networks, the neural statistician also has a generative component p(x1, . . . , xn|c) which assumes that xi’s are independent given c. Here, it is easy to see that c plays the role of θ from Eq. 2. In the neural statistician, it is intractable to compute p(x1, . . . , xn), so its variational lower bound is used instead. In our model, we perform an implicit inference over θ and can exactly compute predictive distributions and the marginal likelihood. Despite these differences, both neural statistician and BRUNO can be applied in similar settings, namely few-shot learning and conditional image generation, albeit with some restrictions, as we will see in Section 4. 3 Method We begin this section with an overview of the mathematical tools needed to construct our model: first the Student-t process [17]; and then the Real NVP – a deep, stably invertible and learnable neural network architecture for density estimation [4]. We next propose BRUNO, wherein we combine an exchangeable Student-t process with the Real NVP, and derive recurrent equations for the predictive distribution such that our model can be trained as an RNN. Our model is illustrated in Figure 1. z1 1 z2 1 x1 1 x2 1 z1 2 z2 2 x1 2 x2 2 z1 z2 x1 x2 T P T P p(x2|x1) = p(z1 2|z1 1)p(z2 2|z1 2) det ∂z2 ∂x2 p(x1) = p(z1 1)p(z2 1) det ∂z1 ∂x1 sample Real NVP Real NVP Real NVP-1 Figure 1: A schematic of the BRUNO model. It depicts how Bayesian thinking can lead to an RNN-like computational graph in which Real NVP is a bijective feature extractor and the recurrence is represented by Bayesian updates of an exchangeable Student-t process. 3.1 Student-t processes The Student-t process (T P) is the most general elliptically symmetric process with an analytically representable density [17]. The more commonly used Gaussian processes (GPs) can be seen as limiting case of T Ps. In what follows, we provide the background and definition of T Ps. Let us assume that z = (z1, . . . zn) ∈ Rn follows a multivariate Student-t distribution MV Tn(ν, µ, K) with degrees of freedom ν ∈R+ \ [0, 2], mean µ ∈Rn and a positive definite n × n covariance matrix K. Its density is given by p(z) = Γ( ν+n 2 ) ((ν −2)π)n/2Γ(ν/2)|K|−1/2  1 + (z −µ)T K−1(z −µ) ν −2 −ν+n 2 . (4) 3 For our problem, we are interested in computing a conditional distribution. Suppose we can partition z into two consecutive parts za ∈Rna and zb ∈Rnb, such that  za zb  ∼MV Tn ν,  µa µb  ,  Kaa Kab Kba Kbb  ! . (5) Then conditional distribution p(zb|za) is given by p(zb|za) = MV Tnb  ν + na, ˜µb, ν + βa −2 ν + na −2 ˜ Kbb  , ˜µb = KbaK−1 aa (za −µa) + µb βa = (za −µa)T K−1 aa (za −µa) ˜ Kbb = Kbb −KbaK−1 aa Kab. (6) In the general case, when one needs to invert the covariance matrix, the complexity of computing p(zb|za) is O(n3 a). These computations become infeasible for large datasets, which is a known bottleneck for GPs and T Ps [13]. In Section 3.3, we will show that exchangeable processes do not have this issue. The parameter ν, representing the degrees of freedom, has a large impact on the behaviour of T Ps. It controls how heavy-tailed the t-distribution is: as ν increases, the tails get lighter and the t-distribution gets closer to the Gaussian. From Eq. 6, we can see that as ν or na tends to infinity, the predictive distribution tends to the one from a GP. Thus, for small ν and na, a T P would give less certain predictions than its corresponding GP. A second feature of the T P is the scaling of the predictive variance with a βa coefficient, which explicitly depends on the values of the conditioning observations. From Eq. 6, the value of βa is precisely the Hotelling statistic for the vector za, and has a χ2 na distribution with mean na in the event that za ∼Nna(µa, Kaa). Looking at the weight (ν+βa−2)/(ν+na−2), we see that the variance of p(zb|za) is increased over the Gaussian default when βa > na, and is reduced otherwise. In other words, when the samples are dispersed more than they would be under the Gaussian distribution, the predictive uncertainty is increased compared with the Gaussian case. It is helpful in understanding these two properties to recall that the multivariate Student-t distribution can be thought of as a Gaussian distribution with an inverse Wishart prior on the covariance [17]. 3.2 Real NVP Real NVP [4] is a member of the normalising flows family of models, where some density in the input space X is transformed into a desired probability distribution in space Z through a sequence of invertible mappings [14]. Specifically, Real NVP proposes a design for a bijective function f : X 7→Z with X = RD and Z = RD such that (a) the inverse is easy to evaluate, i.e. the cost of computing x = f −1(z) is the same as for the forward mapping, and (b) computing the Jacobian determinant takes linear time in the number of dimensions D. Additionally, Real NVP assumes a simple distribution for z, e.g. an isotropic Gaussian, so one can use a change of variables formula to evaluate p(x): p(x) = p(z) det ∂f(x) ∂x ! . (7) The main building block of Real NVP is a coupling layer. It implements a mapping X 7→Y that transforms half of its inputs while copying the other half directly to the output: y1:d = x1:d yd+1:D = xd+1:D ⊙exp(s(x1:d)) + t(x1:d), (8) where ⊙is an elementwise product, s (scale) and t (translation) are arbitrarily complex functions, e.g. convolutional neural networks. One can show that the coupling layer is a bijective, easily invertible mapping with a triangular Jacobian and composition of such layers preserves these properties. To obtain a highly nonlinear mapping f(x), one needs to stack coupling layers X 7→Y1 7→Y2 · · · 7→Z while alternating the dimensions that are being copied to the output. 4 To make good use of modelling densities, the Real NVP has to treat its inputs as instances of a continuous random variable [19]. To do so, integer pixel values in x are dequantised by adding uniform noise u ∈[0, 1)D. The values x + u ∈[0, 256)D are then rescaled to a [0, 1) interval and transformed with an elementwise function: f(x) = logit(α + (1 −2α)x) with some small α. 3.3 BRUNO: the exchangeable sequence model We now combine Bayesian and deep learning tools from the previous sections and present our model for exchangeable sequences whose schematic is given in Figure 1. Assume we are given an exchangeable sequence x1, . . . , xn, where every element is a D-dimensional vector: xi = (x1 i , . . . xD i ). We apply a Real NVP transformation to every xi, which results in an exchangeable sequence in the latent space: z1, . . . , zn, where zi ∈RD. The proof that the latter sequence is exchangeable is given in Appendix A. We make the following assumptions about the latents: A1: dimensions {zd}d=1,...,D are independent, so p(z) = QD d=1 p(zd) A2: for every dimension d, we assume the following: (zd 1, . . . zd n) ∼MV Tn(νd, µd1, Kd), with parameters: • degrees of freedom νd ∈R+ \ [0, 2] • mean µd1 is a 1 × n dimensional vector of ones multiplied by the scalar µd ∈R • n × n covariance matrix Kd with Kd ii = vd and Kd ij,i̸=j = ρd where 0 ≤ρd < vd to make sure that Kd is a positive-definite matrix that complies with covariance properties of exchangeable sequences [1]. The exchangeable structure of the covariance matrix and having the same mean for every n, guarantees that the sequence zd 1, zd 2 . . . zd n is exchangeable. Because the covariance matrix is simple, we can derive recurrent updates for the parameters of p(zd n+1|zd 1:n). Using the recurrence is a lot more efficient compared to the closed-form expressions in Eq. 6 since we want to compute the predictive distribution for every step n. We start from a prior Student-t distribution for p(z1) with parameters µ1 = µ , v1 = v, ν1 = ν, β1 = 0. Here, we will drop the dimension index d to simplify the notation. A detailed derivation of the following results is given in Appendix B. To compute the degrees of freedom, mean and variance of p(zn+1|z1:n) for every n, we begin with the recurrent relations νn+1 = νn + 1, µn+1 = (1 −dn)µn + dnzn, vn+1 = (1 −dn)vn + dn(v −ρ), (9) where dn = ρ v+ρ(n−1). Note that the GP recursions simply use the latter two equations, i.e. if we were to assume that (zd 1, . . . zd n) ∼Nn(µd1, Kd). For T Ps, however, we also need to compute β – a data-dependent term that scales the covariance matrix as in Eq. 6. To update β, we introduce recurrent expressions for the auxiliary variables: ˜zi = zi −µ an = v + ρ(n −2) (v −ρ)(v + ρ(n −1)), bn = −ρ (v −ρ)(v + ρ(n −1)) βn+1 = βn + (an −bn)˜z2 n + bn( n X i=1 ˜zi)2 −bn−1( n−1 X i=1 ˜zi)2. From these equations, we see that computational complexity of making predictions in exchangeable GPs or T Ps scales linearly with the number of observations, i.e. O(n) instead of a general O(n3) case where one needs to compute an inverse covariance matrix. So far, we have constructed an exchangeable Student-t process in the latent space Z. By coupling it with a bijective Real NVP mapping, we get an exchangeable process in space X. Although we do not have an explicit analytic form of the transitions in X, we still can sample from this process and evaluate the predictive distribution via the change of variables formula in Eq. 7. 5 3.4 Training Having an easy-to-evaluate autoregressive distribution p(xn+1|x1:n) allows us to use a training scheme that is common for RNNs, i.e. maximise the likelihood of the next element in the sequence at every step. Thus, our objective function for a single sequence of fixed length N can be written as L = PN−1 n=0 log p(xn+1|x1:n), which is equivalent to maximising the joint log-likelihood log p(x1, . . . , xN). While we do have a closed-form expression for the latter, we chose not to use it during training in order to minimize the difference between the implementation of training and testing phases. Note that at test time, dealing with the joint log-likelihood would be inconvenient or even impossible due to high memory costs when N gets large, which again motivates the use of a recurrent formulation. During training, we update the weights of the Real NVP model and also learn the parameters of the prior Student-t distribution. For the latter, we have three trainable parameters per dimension: degrees of freedom νd, variance vd and covariance ρd. The mean µd is fixed to 0 for every d and is not updated during training. 4 Experiments In this section, we will consider a few problems that fit naturally into the framework of modeling exchangeable data. We chose to work with sequences of images, so the results are easy to analyse; yet BRUNO does not make any image-specific assumptions, and our conclusions can generalise to other types of data. Specifically, for non-image data, one can use a general-purpose Real NVP coupling layer as proposed by Papamakarios et al. [12]. In contrast to the original Real NVP model, which uses convolutional architecture for scaling and translation functions in Eq. 8, a general implementation has s and t composed from fully connected layers. We experimented with both convolutional and non-convolutional architectures, the details of which are given in Appendix C. In our experiments, the models are trained on image sequences of length 20. We form each sequence by uniformly sampling a class and then selecting 20 random images from that class. This scheme implies that a model is trained to implicitly infer a class label that is global to a sequence. In what follows, we will see how this property can be used in a few tasks. 4.1 Conditional image generation We first consider a problem of generating samples conditionally on a set of images, which reduces to sampling from a predictive distribution. This is different from a general Bayesian approach, where one needs to infer the posterior over some meaningful latent variable and then ‘decode’ it. To draw samples from p(xn+1|x1:n), we first sample z ∼p(zn+1|z1:n) and then compute the inverse Real NVP mapping: x = f −1(z). Since we assumed that dimensions of z are independent, we can sample each zd from a univariate Student-t distribution. To do so, we modified Bailey’s polar t-distribution generation method [2] to be computationally efficient for GPU. Its algorithm is given in Appendix D. In Figure 2, we show samples from the prior distribution p(x1) and conditional samples from a predictive distribution p(xn+1|x1:n) at steps n = 1, . . . , 20. Here, we used a convolutional Real NVP model as a part of BRUNO. The model was trained on Omniglot [10] same-class image sequences of length 20 and we used the train-test split and preprocessing as defined by Vinyals et al. [21]. Namely, we resized the images to 28 × 28 pixels and augmented the dataset with rotations by multiples of 90 degrees yielding 4,800 and 1,692 classes for training and testing respectively. To better understand how BRUNO behaves, we test it on special types of input sequences that were not seen during training. In Appendix E, we give an example where the same image is used throughout the sequence. In that case, the variability of the samples reduces as the models gets more of the same input. This property does not hold for the neural statistician model [5], discussed in Section 2. As mentioned earlier, the neural statistician computes the approximate posterior q(c|x1, . . . , xn) and then uses its mean to sample x from a conditional model p(x|cmean). This scheme does not account for the variability in the inputs as a consequence of applying mean pooling over the features of x1, . . . , xn when computing q(c|x1, . . . , xn). Thus, when all xi’s are the same, it would still sample different instances from the class specified by xi. Given the code provided by the authors of 6 Figure 2: Samples generated conditionally on the sequence of the unseen Omniglot character class. An input sequence is shown in the top row and samples in the bottom 4 rows. Every column of the bottom subplot contains 4 samples from the predictive distribution conditioned on the input images up to and including that column. That is, the 1st column shows samples from the prior p(x) when no input image is given; the 2nd column shows samples from p(x|x1) where x1 is the 1st input image in the top row and so on. the neural statistician and following an email exchange, we could not reproduce the results from their paper, so we refrained from making any direct comparisons. More generated samples from convolutional and non-convolutional architectures trained on MNIST [11], Fashion-MNIST [22] and CIFAR-10 [9] are given in the appendix. For a couple of these models, we analyse the parameters of the learnt latent distributions (see Appendix F). 4.2 Few-shot learning Previously, we saw that BRUNO can generate images of the unseen classes even after being conditioned on a couple of examples. In this section, we will see how one can use its conditional probabilities not only for generation, but also for a few-shot classification. We evaluate the few-shot learning accuracy of the model from Section 4.1 on the unseen Omniglot characters from the 1,692 testing classes following the n-shot and k-way classification setup proposed by Vinyals et al. [21]. For every test case, we randomly draw a test image xn+1 and a sequence of n images from the target class. At the same time, we draw n images for every of the k −1 random decoy classes. To classify an image xn+1, we compute p(xn+1|xC=i 1:n ) for each class i = 1 . . . k in the batch. An image is classified correctly when the conditional probability is highest for the target class compared to the decoy classes. This evaluation is performed 20 times for each of the test classes and the average classification accuracy is reported in Table 1. For comparison, we considered three models from Vinyals et al. [21]: (a) k-nearest neighbours (k-NN), where matching is done on raw pixels (Pixels), (b) k-NN with matching on discriminative features from a state-of-the-art classifier (Baseline Classifier), and (c) Matching networks. We observe that BRUNO model from Section 4.1 outperforms the baseline classifier, despite having been trained on relatively long sequences with a generative objective, i.e. maximising the likelihood of the input images. Yet, it cannot compete with matching networks – a model tailored for a few-shot learning and trained in a discriminative way on short sequences such that its test-time protocol exactly matches the training time protocol. One can argue, however, that a comparison between models trained generatively and discriminatively is not fair. Generative modelling is a more general, harder problem to solve than discrimination, so a generatively trained model may waste a lot of statistical power on modelling aspects of the data which are irrelevant for the classification task. To verify our intuition, we fine-tuned BRUNO with a discriminative objective, i.e. maximising the likelihood of correct labels in n-shot, k-way classification episodes formed from the training examples of Omniglot. While we could sample a different n and k for every training episode like in matching networks, we found it sufficient to fix n and k during training. Namely, we chose the setting with n = 1 and k = 20. From Table 1, we see that this additional discriminative training makes BRUNO competitive with state-of-the-art models across all n-shot and k-way tasks. As an extension to the few-shot learning task, we showed that BRUNO could also be used for online set anomaly detection. These experiments can be found in Appendix H. 7 Table 1: Classification accuracy for a few-shot learning task on the Omniglot dataset. Model 5-way 20-way 1-shot 5-shot 1-shot 5-shot PIXELS [21] 41.7% 63.2% 26.7% 42.6% BASELINE CLASSIFIER [21] 80.0% 95.0% 69.5% 89.1% MATCHING NETS [21] 98.1% 98.9% 93.8% 98.5% BRUNO 86.3% 95.6% 69.2% 87.7% BRUNO (discriminative fine-tuning) 97.1% 99.4% 91.3% 97.8% 4.3 GP-based models In practice, we noticed that training T P-based models can be easier compared to GP-based models as they are more robust to anomalous training inputs and are less sensitive to the choise of hyperparameters. Under certain conditions, we were not able to obtain convergent training with GP-based models which was not the case when using T Ps; an example is given in Appendix G. However, we found a few heuristics that make for a successful training such that T P and GP-based models perform equally well in terms of test likelihoods, sample quality and few-shot classification results. For instance, it was crucial to use weight normalisation with a data-dependent initialisation of parameters of the Real NVP [16]. As a result, one can opt for using GPs due to their simpler implementation. Nevertheless, a Student-t process remains a strictly richer model class for the latent space with negligible additional computational costs. 5 Discussion and conclusion In this paper, we introduced BRUNO, a new technique combining deep learning and Student-t or Gaussian processes for modelling exchangeable data. With this architecture, we may carry out implicit Bayesian inference, avoiding the need to compute posteriors and eliminating the high computational cost or approximation errors often associated with explicit Bayesian inference. Based on our experiments, BRUNO shows promise for applications such as conditional image generation, few-shot concept learning, few-shot classification and online anomaly detection. The probabilistic construction makes the BRUNO approach particularly useful and versatile in transfer learning and multi-task situations. To demonstrate this, we showed that BRUNO trained in a generative way achieves good performance in a downstream few-shot classification task without any task-specific retraining. Though, the performance can be significantly improved with discriminative fine-tuning. Training BRUNO is a form of meta-learning or learning-to-learn: it learns to perform Bayesian inference on various sets of data. Just as encoding translational invariance in convolutional neural networks seems to be the key to success in vision applications, we believe that the notion of exchangeability is equally central to data-efficient meta-learning. In this sense, architectures like BRUNO and Deep Sets [23] can be seen as the most natural starting point for these applications. As a consequence of exchangeability-by-design, BRUNO is endowed with a hidden state which integrates information about all inputs regardless of sequence length. This desired property for meta-learning is usually difficult to ensure in general RNNs as they do not automatically generalise to longer sequences than they were trained on and are sensitive to the ordering of inputs. Based on this observation, the most promising applications for BRUNO may fall in the many-shot meta-learning regime, where larger sets of data are available in each episode. Such problems naturally arise in privacy-preserving on-device machine learning, or federated meta-learning [3], which is a potential future application area for BRUNO. Acknowledgements We would like to thank Lucas Theis for his conceptual contributions to BRUNO, Conrado Miranda and Frederic Godin for their helpful comments on the paper, Wittawat Jitkrittum for useful discussions, and Lionel Pigou for setting up the hardware. 8 References [1] Aldous, D., Hennequin, P., Ibragimov, I., and Jacod, J. (1985). Ecole d’Ete de Probabilites de Saint-Flour XIII, 1983. Lecture Notes in Mathematics. Springer Berlin Heidelberg. [2] Bailey, R. W. (1994). Polar generation of random variates with the t-distribution. Math. Comp., 62(206):779– 781. [3] Chen, F., Dong, Z., Li, Z., and He, X. (2018). Federated meta-learning for recommendation. arXiv preprint arXiv:1802.07876. [4] Dinh, L., Sohl-Dickstein, J., and Bengio, S. (2017). Density estimation using Real NVP. In Proceedings of the 5th International Conference on Learning Representations. [5] Edwards, H. and Storkey, A. (2017). Towards a neural statistician. In Proceedings of the 5th International Conference on Learning Representations. [6] Ghahramani, Z. and Heller, K. A. (2006). Bayesian sets. In Weiss, Y., Schölkopf, B., and Platt, J. C., editors, Advances in Neural Information Processing Systems 18, pages 435–442. MIT Press. [7] Heller, K. A. and Ghahramani, Z. (2006). A simple bayesian framework for content-based image retrieval. In IEEE Computer Society Conference on Computer Vision and Pattern Recognition, pages 2110–2117. [8] Kingma, D. P. and Welling, M. (2014). Auto-encoding variational bayes. In Proceedings of the 2nd International Conference on Learning Representations. [9] Krizhevsky, A. (2009). Learning multiple layers of features from tiny images. Technical report. [10] Lake, B. M., Salakhutdinov, R., and Tenenbaum, J. B. (2015). Human-level concept learning through probabilistic program induction. Science. [11] LeCun, Y., Cortes, C., and Burges, C. J. (1998). The MNIST database of handwritten digits. [12] Papamakarios, G., Murray, I., and Pavlakou, T. (2017). Masked autoregressive flow for density estimation. In Advances in Neural Information Processing Systems 30, pages 2335–2344. [13] Rasmussen, C. E. and Williams, C. K. I. (2005). Gaussian Processes for Machine Learning (Adaptive Computation and Machine Learning). The MIT Press. [14] Rezende, D. and Mohamed, S. (2015). Variational inference with normalizing flows. In Proceedings of the 32nd International Conference on Machine Learning, volume 37 of Proceedings of Machine Learning Research, pages 1530–1538. [15] Rezende, D. J., Mohamed, S., and Wierstra, D. (2014). Stochastic backpropagation and approximate inference in deep generative models. In Proceedings of the 31st International Conference on Machine Learning, pages 1278–1286. [16] Salimans, T. and Kingma, D. P. (2016). Weight normalization: A simple reparameterization to accelerate training of deep neural networks. In Proceedings of the 30th International Conference on Neural Information Processing Systems. [17] Shah, A., Wilson, A. G., and Ghahramani, Z. (2014). Student-t processes as alternatives to gaussian processes. In Proceedings of the 17th International Conference on Artificial Intelligence and Statistics, pages 877–885. [18] Szabo, Z., Sriperumbudur, B., Poczos, B., and Gretton, A. (2016). Learning theory for distribution regression. Journal of Machine Learning Research, 17(152). [19] Theis, L., van den Oord, A., and Bethge, M. (2016). A note on the evaluation of generative models. In Proceedings of the 4th International Conference on Learning Representations. [20] Vinyals, O., Bengio, S., and Kudlur, M. (2016a). Order matters: Sequence to sequence for sets. In Proceedings of the 4th International Conference on Learning Representations. [21] Vinyals, O., Blundell, C., Lillicrap, T., Kavukcuoglu, K., and Wierstra, D. (2016b). Matching networks for one shot learning. In Advances in Neural Information Processing Systems 29, pages 3630–3638. [22] Xiao, H., Rasul, K., and Vollgraf, R. (2017). Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms. arXiv preprint, abs/1708.07747. [23] Zaheer, M., Kottur, S., Ravanbakhsh, S., Poczos, B., Salakhutdinov, R. R., and Smola, A. J. (2017). Deep sets. In Advances in Neural Information Processing Systems 30, pages 3394–3404. 9
2018
125
7,281
Asymptotic optimality of adaptive importance sampling Bernard Delyon IRMAR University of Rennes 1 bernard.delyon@univ-rennes1.fr François Portier Télécom ParisTech University of Paris-Saclay francois.portier@gmail.com Abstract Adaptive importance sampling (AIS) uses past samples to update the sampling policy qt. Each stage t is formed with two steps : (i) to explore the space with nt points according to qt and (ii) to exploit the current amount of information to update the sampling policy. The very fundamental question raised in this paper concerns the behavior of empirical sums based on AIS. Without making any assumption on the allocation policy nt, the theory developed involves no restriction on the split of computational resources between the explore (i) and the exploit (ii) step. It is shown that AIS is asymptotically optimal : the asymptotic behavior of AIS is the same as some “oracle” strategy that knows the targeted sampling policy from the beginning. From a practical perspective, weighted AIS is introduced, a new method that allows to forget poor samples from early stages. 1 Introduction The adaptive choice of a sampling policy lies at the heart of many fields of Machine Learning where former Monte Carlo experiments guide the forthcoming ones. This includes for instance reinforcment learning [19, 27, 30] where the optimal policy maximizes the reward; inference in Bayesian [6] or graphical models [21]; optimization based on stochastic gradient descent [34] or without using the gradient [18]; rejection sampling [12]. Adaptive importance sampling (AIS) [25, 2], which extends the basic Monte Carlo integration approach, offers a natural probabilistic framework to describe the evolution of sampling policies. The present paper establishes, under fairly reasonable conditions, that AIS is asymptotically optimal, i.e., learning the sampling policy has no cost asymptotically. Suppose we are interested in computing some integral value R ϕ, where ϕ : Rd →R is called the integrand. The importance sampling estimate of R ϕ based on the sampling policy q, is given by n−1 n X i=1 ϕ(xi) q(xi) , (1) where (x1, . . . xn) i.i.d. ∼q. The previous estimate is unbiased. It is well known, e.g., [16, 13], that the optimal sampling policy, regarding the variance, is when q is proportional to |ϕ|. A slightly different context where importance sampling still applies is Bayesian estimation. Here the targeted quantity is R ϕπ and we only have access to an unnormalized version πu of the density π = πu/ R πu. Estimators usually employed are n X i=1 ϕ(xi)πu(xi) q(xi) , n X i=1 πu(xi) q(xi) . (2) In this case, the optimal sampling policy q is proportional to |ϕ − R ϕπ|π (see [9] or section B.3 in the supplementary material). 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. Because appropriate policies naturally depend on ϕ or π, we generally cannot simulate from them. They are then approximated adaptively, by densities from which we can simulate, using the information gathered from the past stages. This is the very spirit of AIS. At each stage t, the value It, standing for the current estimate, is updated using i.i.d. new samples xt,1, . . . xt,nt from qt, where qt is a probability density function that might depend on the past stages 1, . . . t −1. The distribution qt, called the sampling policy, targets some optimal, at least suitable, sampling policy. The sequence (nt) ⊂N∗, called the allocation policy, contains the number of particles generated at each stage. The following algorithm describes the AIS schemes for the classical integration problem. For the Bayesian problem, it suffices to change the estimate according to (2). This is a generic representation of AIS as no explicit update rule is specified (this will be discussed just below). Algorithm 1 (AIS). Inputs: The number of stages T ∈N∗, the allocation policy (nt)t=1,...T ⊂N∗, the sampler update procedure, the initial density q0. Set S0 = 0, N0 = 0. For t in 1, . . . T : (i) (Explore) Generate (xt,1, . . . xt,nt) from qt−1 (ii) (Exploit) (a) Update the estimate: St = St−1 + nt X i=1 ϕ(xt,i) qt−1(xt,i) Nt = Nt−1 + nt It = N −1 t St (b) Update the sampler qt Pioneer works on adaptive schemes include [20] where, within a two-stages procedure, the sampling policy is chosen out of a parametric family; this is further formalized in [14]; [25] introduces the idea of a multi-stages approach where all the previous stages are used to update the sampling policy (see also [29] regarding the choice of the loss function); [26] investigates the use of control variates coupled with importance sampling; the population Monte Carlo approach [3, 2] offers a general framework for AIS and has been further studied using parametric mixtures [8, 9]; see also [5, 32] for a variant called multiple adaptive importance sampling; see [11] for a recent review. In [33, 23], using kernel smoothing, nonparametric importance sampling is introduced. The approach of choosing qt out of a parametric family should also be contrasted with the non parametric approach based on particles often refereed to as sequential Monte Carlo [6, 4, 10] whose context is different as traditionally the targeted distribution changes with t. The distribution qt−1 is then a weighted sum of Dirac masses P i wt−1,iδxt−1,i, and updating qt follows from adjustment of the weights. The theoretical properties of adaptive schemes are difficult to derive due to the recycling of the past samples at each stage and hence to the lack of independence between samples. Among the update based on a parametric family, the convergence properties of the Kullback-Leibler divergence between the estimated and the targeted distribution are studied in [8]. Properties related to the asymptotic variance are given in [9]. Among nonparametric update, [33] establishes fast convergence rates in a two-stages strategy where the number of samples used in each stage goes to infinity. For sequential Monte Carlo, limit theorems are given for instance in [6, 4, 10]. All these results are obtained when T is fixed and nT →∞and therefore misses the true nature of the adaptive schemes for which the asymptotic should be made with respect to T. Recently, a more realistic asymptotic regime was considered in [22] in which the allocation policy (nt) is a fixed growing sequence of integers. The authors establish the consistency of the estimate when the update is conducted with respect to a parametric family but depends only on the last stage. They focus on multiple adaptive importance sampling [5, 32] which is different than AIS (see Remark 2 below for more details). In this paper, folllowing the same spirit as [8, 9, 2], we study parametric AIS as presented in the AIS algorithm when the policy is chosen out of a parametric family of probability density functions. Our analysis focuses on the following 3 key points which are new to the best of our knowledge. 2 • A central limit theorem is established for the AIS estimate It. It involves high-level conditions on the sampling policy estimate qt (which will be easily satisfied for parametric updates). Based on the martingale property associated to some sequences of interest, the asymptotic is not with T fixed and nT →∞, but with the number of samples n1 + · · · + nT →∞. In particular, the allocation policy (nt) is not required to grow to infinity. This is presented in section 2. • The high-level conditions are verified in the case of parametric sampling policies with updates taking place in a general framework inspired by the paradigm of empirical risk minimization (several concrete examples are provided). This establishes the asymptotic optimality of AIS in the sense that the rate and the asymptotic variance coincide with some “oracle” procedure where the targeted policy is known from the beginning. The details are given in section 3. • A new method, called weighted AIS (wAIS) is designed in section 4 to eventually forget bad samples drawn during the early stages of AIS. Our numerical experiments shows that (i) wAIS accelerates significantly the convergence of AIS and (ii) small allocation policies (nt) (implying more frequent updates) give better results than large (nt) (at equal number of requests to ϕ). This last point supports empirically the theoretical framework adopted in the paper. All the proofs are given in the supplementary material. 2 Central limit theorems for AIS The aim of the section is to provide conditions on the sampling policy (qt) under which a central limit theorem holds for AIS and normalized AIS. For the sake of generality and because it will be useful in the treatment of normalized estimators, we consider the multivariate case where ϕ = (ϕ1, . . . ϕp) : Rd →Rp. In the whole paper, R ϕ is with respect to the Lebesgue measure, ∥· ∥is the Euclidean norm, Ip is the identity matrix of size (p, p). To study the AIS algorithm, it is appropriate to work at the sample time scale as described below rather than at the sampling policy scale as described in the introduction. The sample xt,i (resp. the policy qt) of the previous section (t is the block index and i the sample index within the block) is now simply denoted xj (resp. qj), where j = n1 + . . . nt + i is the sample index in the whole sequence 1, . . . n, with n = NT . The following algorithm is the same as Algorithm 1 (no explicit update rule is provided) but is expressed at the sample scale. Algorithm 2 (AIS at sample scale). Inputs: The number of stages T ∈N∗, the allocation policy (nt)t=1,...T ⊂N∗, the sampler update procedure, the initial density q0. Set S0 = 0. For j in 1, . . . n : (i) (Explore) Generate xj from qj−1 (ii) (Exploit) (a) Update the estimate: Sj = Sj−1 + ϕ(xj) qj−1(xj) Ij = j−1Sj (b) Update the sampler qj whenever j ∈{Nt = Pt s=1 ns : t ⩾1} 2.1 The martingale property Define ∆j as the j-th centered contribution to the sum Sj: ∆j = ϕ(xj)/qj−1(xj) − R ϕ. Define, for all n ⩾1, Mn = n X j=1 ∆j. 3 The filtration we consider is given by Fn = σ(x1, . . . xn). The quadratic variation of M is given by ⟨M⟩n = Pn j=1 E  ∆j∆T j | Fj−1  . Set V (q, ϕ) = Z ϕ(x) −q(x) R ϕ  ϕ(x) −q(x) R ϕ T q(x) dx. (3) Lemma 1. Assume that for all 1 ⩽j ⩽n, the support of qj contains the support of ϕ, then the sequence (Mn, Fn) is a martingale. In particular, In is an unbiased estimate of R ϕ. In addition, the quadratic variation of M satisfies ⟨M⟩n = Pn j=1 V (qj−1, ϕ). 2.2 A central limit theorem for AIS The following theorem describes the asymptotic behavior of AIS. The conditions will be verified for parametric updates in section 3 (see Theorem 3) in which case the asymptotic variance V∗will be explicitly given. Theorem 1 (central limit theorem for AIS). Assume that the sequence qn satisfies V (qn, ϕ) →V∗, a.s. (4) for some V∗⩾0 and that there exists η > 0 such that sup j∈N Z ∥ϕ∥2+η q1+η j < ∞, a.s. (5) Then we have √n  In − Z ϕ  d→N(0, V∗). Remark 1 (zero-variance estimate). Suppose that p = 1 (recalling that ϕ : Rd →Rp). Theorem 1 includes the degenerate case V∗= 0. This happens when the integrand has constant sign and the sampling policy is well chosen, i.e. qn →|ϕ|/ R |ϕ|. In this case, we have that √n(In− R ϕ) = op(1), meaning that the standard Monte Carlo convergence rate (1/√n) has been improved. This is inline with the results presented in [33] where fast rates of convergence (compared to standard Monte Carlo) are obtained under restrictive conditions on the allocation policy (nt). Note that other techniques such as control variates, kernel smoothing or Gaussian quadrature can achieve fast convergence rates [24, 28, 7, 1]. Remark 2 (adaptive multiple importance sampling). Another way to compute the importance weights, called multiple adaptive importance sampling, has been introduced in [32] and has been successfully used in [26, 5]. This consists in replacing qj−1 in the computation of Sj by ¯qj−1 = Pj i=1 qi−1/j, xj still being drawn under qj−1. The intuition is that this averaging will reduce the effect of exceptional points xj for which |ϕ(xj)| ≫qj−1(xj) (but |ϕ(xj)| ̸≫¯qj−1(xj)). Our approach is not able to study this variant, simply because the martingale property described previously is not anymore satisfied. 2.3 Normalized AIS The normalization technique described in (2) is designed to compute R ϕπ, where π is a density. It is useful in the Bayesian context where π is only known up to a constant. As this technique seems to provide substantial improvements compared to unnormalized estimates (i.e., (1) with ϕ replaced by ϕπ), we recommend to use it even when the normalized constant of π is known. Normalized estimators are given by I(norm) n = In(ϕπ) In(π) , with In(ψ) = n−1 n X j=1 ψ(xj)/qj−1(xj). Interestingly, normalized estimators are weighted least-squares estimates as they minimize the function a 7→Pn j=1(π(xj)/qj−1(xj))(ϕ(xj) −a)2. In contrast with In, I(norm) n has the following shift-invariance property : whenever ϕ is shifted by µ, I(norm) n simply becomes I(norm) n + µ. Because In(ϕπ) and In(π) are of the same kind as In defined in the second AIS algorithm, a straightforward application of Theorem 1 (with (ϕT π, π)T in place of ϕ). 4 Corollary 1 (central limit theorem for normalized AIS). Suppose that (4) and (5) hold with (ϕT π, π)T (in place of ϕ). Then we have √n  I(norm) n − Z ϕπ  d→N(0, UV∗U T ), with U = (Ip, − R ϕπ). 3 Parametric sampling policy From this point forward, the sampling policies qt, t = 1, . . . T (we are back again to the sampling policy scale as in Algorithm 1), are chosen out of a parametric family of probability density functions {qθ : θ ∈Θ}. All our examples fit the general framework of empirical risk minimization over the parameter space Θ ⊂Rq, where θt is given by θt ∈argminθ∈Θ Rt(θ), (6) Rt(θ) = t X s=1 ns X i=1 mθ(xs,i) qs−1(xs,i), where qs is a shortcut for qθs, mθ : Rd →R might be understood as a loss function (see the next section for examples). Note that Rt/Nt is an unbiased estimate of the risk r(θ) = R mθ. 3.1 Examples of sampling policy We start by introducing a particular case, which is one of the simplest way to implement AIS. Then we will provide more general approaches. In what follows, the targeted policy, denoted by f, is chosen by the user and represents the distribution from which we wish to sample. It often reflects some prior knowledge on the problem of interest. If ϕ : Rd →Rp, with p = 1, then (as discussed in the introduction) f ∝|ϕ| is optimal for (1) and f ∝|ϕ − R ϕπ|π is optimal for (2). In the Bayesian context where many integrals R (ϕ1, . . . ϕp)dπ need to be computed, a usual choice is f = π. All the following methods only require calls to an unnormalized version of f. Method of moments with Student distributions. In this case (qθ)θ∈Θ is just the family of multivariate Student distributions with ν > 2 degrees of freedom (fixed parameter). The parameter θ contains a location and a scale parameter µ and Σ. This family has two advantages: the parameter ν allows tuning for heavy tails, and estimation is easy because moments of qθ are explicitly related to θ. A simple unbiased estimate for µ is (1/Nt) Pt s=1 Pns i=1 xs,if(xs,i)/qs−1(xs,i), but, as mentioned in section 2.3, we prefer to use the normalized estimate (using the shortcut qs for qθs): µt = t X s=1 ns X i=1 xs,i f(xs,i) qs−1(xs,i) , t X s=1 ns X i=1 f(xs,i) qs−1(xs,i) , (7) Σt = ν −2 ν  t X s=1 ns X i=1 (xs,i −µt)(xs,i −µt)T f(xs,i) qs−1(xs,i) , t X s=1 ns X i=1 f(xs,i) qs−1(xs,i) . (8) Generalized method of moments (GMM). This approach includes the previous example. The policy is chosen according to a moment matching condition, i.e., R gqθ = R gf for some function g : Rd →RD. For instance, g might be given by x 7→x or x 7→xxT (both are considered in the Student case). Following [17], choosing θ such that the empirical moments of g coincide with R gqθ might be impossible. We rather compute θt as the minimum of Eθ(g) − t X s=1 ns X i=1 g(xs,i) f(xs,i) qs−1(xs,i) , t X s=1 ns X i=1 f(xs,i) qs−1(xs,i) ! 2 . Equivalently, θt ∈argminθ∈Θ t X s=1 ns X i=1 ∥Eθ(g) −g(xs,i)∥2 f(xs,i) qs−1(xs,i), which embraces the form given by (6), with mθ = ∥Eθ(g) −g∥2f. 5 Kullback-Leibler approach. Following [31, section 5.5], define the Kullback-Leibler risk as r(θ) = − R log(qθ)f. Update of θt is done by minimizing the current estimator of Ntr(θ) given by Rt(θ) = Rt−1(θ) − nt X i=1 log(qθ(xt,i))f(xt,i) qt−1(xt,i) . (9) Variance approach. Another approach, when ϕ : Rd →Rp with p = 1, consists in minimizing the variance over the class of sampling policies. In this case, define r(θ) = R ϕ2/qθ, and follow a similar approach as before by minimizing at each stage, Rt(θ) = Rt−1(θ) + nt X i=1 ϕ(xt,i)2 qθ(xt,i)qt−1(xt,i). (10) This case represents a different situation than the Kullback-Leibler approach and the GMM. Here, the sampling policy is selected optimally with respect to a particular function ϕ whereas for KL and GMM the sampling policy is driven by a targeted distribution f. Remark 3 (computation cost). The update rule (6) might be computationally costly but alternatives exist. For instance, when qθ is a family of Gaussian distributions, closed formulas are available for (10). In fact we are in the case of weighted maximum likelihood estimation for which we find exactly (7) and (8), with ν = ∞. This is computed online at no cost. Another strategy to reduce the computation time is to use online stochastic gradient descent in (6). Remark 4 (block estimator). In [22], the authors suggest to update θ based only on the particles from the last stage. For the Kullback-Leibler update, (9) would be replaced by Rt(θ) = −Pnt i=1 log(qθ(xt,i))f(xt,i)/qt−1(xt,i). While this update makes easier the theoretical analysis (assuming that nt →∞), its main drawback is that most of the computing effort is forgotten at each stage as the previous computations are not used. 3.2 Consistency of the sampling policy and asymptotic optimality of AIS The updates described before using GMM, the Kullback-Leibler divergence or the variance, all fit within the framework of empirical risk minimization, given by (6), which rewritten at the sample scale gives Rj(θ) = Rj−1(θ) + mθ(xj) qj−1(xj) −if j ∈{Nt : t ⩾1} then : θj ∈argminθ∈Θ Rj(θ) qj = qθj −else : qj = qj−1. The proof follows from a standard approach from M-estimation theory [31, Theorem 5.7] but a particular attention shall be payed to the uniform law of large numbers because of the missing i.i.d. property of the sequences of interest. Theorem 2 (concistency of the sampling policy). Set M(x) = supθ∈Θ mθ(x). Assume that Θ ⊂Rq is a compact set and that Z M(x)dx < ∞, sup θ∈Θ Z M(x)2 qθ(x) dx < ∞, and ∀θ ̸= θ∗, r(θ) = Z mθ > Z mθ∗. (11) If moreover, for any x ∈Rd, the function θ 7→mθ(x) is continuous on Rq, then θn →θ∗, a.s. The conclusion given in Theorem 2 permits to check the conditions of Theorem 1. This leads to the following result. Theorem 3 (asymptotic optimality of AIS). Under the assumptions of Theorem 2, if there exists η > 0 such that supθ∈Θ R ∥ϕ∥2+η/q1+η θ < ∞, we have √n  In − Z ϕ  d→N 0, V (qθ∗, ϕ)  , where V (·, ·) is defined in Equation (3). 6 Remark 5 (the oracle property). From (11), we deduce that qθ∗is the unique minimizer of the risk function r. The risk function based on GMM or the Kullback-Leibler approach (described in section 3.1) is derived from a certain targeted density f in such a way that if qθ = f, then r(θ) is a minimum. Hence under the identifiability conditions of Theorem 2, if in addition f ∈{qθ : θ ∈Θ}, we have that qθ∗= f. This means that asymptotically, AIS achives the same variance as the “oracle” importance sampling method based on the (fixed) sampler f. Corollary 2 (asymptotic optimality for normalized AIS). Under the assumptions of Theorem 2, if there exists η > 0 such that supθ∈Θ R ∥(ϕT π, π)∥2+η/q1+η θ < ∞, we have √n  I(norm) n − Z ϕπ  d→N  0, UV (qθ∗, (ϕT π, π)T )U T  , with U defined in Corollary 1 and V (·, ·) defined in Equation (3). 4 Weighted AIS We follow ideas from [9, section 4] to develop a novel method to estimate R ϕπ. The method is called weighted adaptive importance sampling (wAIS), and will automatically re-weights each sample depending on its accuracy. It allows in practice to forget poor samples generated during the early stages. For clarity, suppose that ϕ : Rd →Rp with p = 1. Define the weighted estimate, for any function ψ, I(α) T (ψ) = N −1 T T X t=1 αT,t nt X i=1 ψ(xt,i) qt−1(xt,i). Note that for any sequence (αT,1, . . . αT,T ) such that PT t=1 ntαT,t = NT , I(α) T (ψ) is an unbiased estimate of R ψ. Let σ2 t = E[V (qt−1, ϕ)] where V (·, ·) is defined in Equation (3). The variance of I(α) T (ϕ) is N −2 T PT t=1 α2 T,tntσ2 t which minimized w.r.t. (α) gives αT,t ∝σ−2 t , for each t = 1, . . . T. In [9], a re-weighting is proposed using estimates of σt (based on sample of the t-th stage). We propose the following weights α−1 T,t ∝ nt X i=1  π(xt,i) qt−1(xt,i) −1 2 , (12) satisfying the constraints PT t=1 ntαT,t = NT . The wAIS estimate is the (weighted and normalized) AIS estimate given by I(α) T (ϕπ)/I(α) T (π). (13) In contrast with the approach in [9], because our weights are based on the estimated variance of π/qt−1, our proposal is free from the integrand ϕ and thus reflects the overall quality of the t-th sample. This makes sense whenever many functions need to be integrated making inappropriate a re-weighting depending on a specific function. Another difference with [9] is that we use the true expectation, 1, in the estimate of the variance, rather than the estimate (1/nt) Pnt i=1 π(xt,i)/qt−1(xt,i). This permits to avoid the situation (common in high dimensional settings) where a poor sampler qt−1 is such that π(xt,i)/qt−1(xt,i) ≃0, for all i = 1, . . . nt, implying that the classical estimate of the variance is near 0, leading (unfortunately) to a large weight. 5 Numerical experiments In this section, we study a toy Gaussian example to illustrate the practical behavior of AIS. Special interest is dedicated to the effect of the dimension d, the practical choice of (nt) and the gain given by wAIS introduced in the previous section. We set NT = 1e5 and we consider d = 2, 4, 8, 16. The code is made available at https://github.com/portierf/AIS. The aim is to compute µ∗= R xφµ∗,σ∗(x)dx where φµ,σ : Rd →R is the probability density of N(µ, σ2Id), µ∗= (5, . . . 5)T ∈Rd, σ∗= 1. The sampling policy is taken in the collection of multivariate Student distributions of degree ν = 3 denoted by {qµ,Σ0 : µ ∈Rd} with Σ0 = 7 0e+00 2e+04 4e+04 6e+04 8e+04 1e+05 −10 −8 −6 −4 −2 sample size log of MSE AIS wAIS AMH oracle 0e+00 2e+04 4e+04 6e+04 8e+04 1e+05 −10 −8 −6 −4 −2 0 2 sample size log of MSE AIS wAIS AMH oracle 0e+00 2e+04 4e+04 6e+04 8e+04 1e+05 −5 0 5 sample size log of MSE AIS wAIS AMH oracle 0e+00 2e+04 4e+04 6e+04 8e+04 1e+05 −5 0 5 sample size log of MSE AIS wAIS AMH oracle Figure 1: From left-to-right and top-to-bottom d = 2, 4, 8, 16. AIS and wAIS are computed with T = 50 with a constant allocation policy nt = 2e3. Plotted is the logarithm of the MSE (computed for each method over 100 replicates) with respect to the number of requests to the integrand. σ0Id(ν −2)/ν and σ0 = 5. The initial sampling policy is set as µ0 = (0, . . . 0) ∈Rd. The mean µt is updated at each stage t = 1, . . . T following the GMM approach as described in section 3, leading to the simple update formula µt = t X s=1 ns X i=1 xs,i f(xs,i) qs−1(xs,i) , t X s=1 ns X i=1 f(xs,i) qs−1(xs,i) , with f = φµ∗,σ∗. In section C of the supplementary file, other results considering the update of the variance within the student family are provided. As the results for the unnormalized approaches were far from being competitive with the normalized ones, we consider only normalized estimators. We also tried the weights proposed in [9] but the results were not competitive. The (normalized) AIS estimate of µ∗is simply given by µt as displayed above. The wAIS estimate of µ∗is computed using (13) with weights (12). We also include the adaptive MH proposed in [15], where the proposal, assuming that Xi−1 = x, is given by N x, (2.4)2(Ci + ϵId)/d  , if i > i0, and N(x, Id), if i ⩽i0, with Ci the empirical covariance matrix of (X0, X1, . . . Xi−1), i0 = 1000 and ϵ = 0.05 (other configurations as for instance using only half of the chain have been tested without improving the results). Finally we 8 0e+00 2e+04 4e+04 6e+04 8e+04 1e+05 −10 −8 −6 −4 −2 sample size log of MSE wAIS AMH oracle T=5 T=20 T=50 0e+00 2e+04 4e+04 6e+04 8e+04 1e+05 −10 −8 −6 −4 −2 0 2 sample size log of MSE wAIS AMH oracle T=5 T=20 T=50 0e+00 2e+04 4e+04 6e+04 8e+04 1e+05 −5 0 5 sample size log of MSE wAIS AMH oracle T=5 T=20 T=50 0e+00 2e+04 4e+04 6e+04 8e+04 1e+05 −5 0 5 sample size log of MSE wAIS AMH oracle T=5 T=20 T=50 Figure 2: From left-to-right and top-to-bottom d = 2, 4, 8, 16. AIS and wAIS are computed with T = 5, 20, 50, each with a constant allocation policy, resp. nt = 2e4, 5e3, 2e3. Plotted is the logarithm of the MSE (computed for each method over 100 replicates) with respect to the number of requests to the integrand. consider a so called “oracle” method : importance sampling with fix policy qµ∗,Σ∗, with Σ∗= σ∗Id(ν −2)/ν. For each method that returns µ, the mean squared error (MSE) is computed as the average of ∥µ −µ∗∥2 computed over 100 replicates of µ. In Figure 1, we compare the evolution of all the mentioned algorithms with respect to stages t = 1, . . . T = 50 with constant allocation policy nt = 2e3 (for AIS and wAIS). The clear winner is wAIS. Note that the oracle policy qµ∗,Σ∗, which is not the optimal one (see section B.3 in the supplementary material), seems to give worse results than the the policy qµ∗,Σ0, as wAIS with sig_0 performs better than the “oracle” after some time. In Figure 2, we examine 3 constant allocation policies given by T = 50 and nt = 2e3; T = 20 and nt = 5e3; T = 5 and nt = 2e4. We clearly notice that the rate of convergence is influenced by the number of update steps (at least at the beginning). The results call for updating as soon as possible the sampling policy. This empirical evidence supports the theoretical framework studied in the paper which imposes no condition on the growth of (nt). 9 Acknowledgments The authors are grateful to Rémi Bardenet for useful comments and additional references. References [1] Rémi Bardenet and Adrien Hardy. Monte carlo with determinantal point processes. arXiv preprint arXiv:1605.00361, 2016. [2] Olivier Cappé, Randal Douc, Arnaud Guillin, Jean-Michel Marin, and Christian P Robert. Adaptive importance sampling in general mixture classes. Statistics and Computing, 18(4):447– 459, 2008. [3] Olivier Cappé, Arnaud Guillin, Jean-Michel Marin, and Christian P Robert. Population monte carlo. Journal of Computational and Graphical Statistics, 13(4):907–929, 2004. [4] Nicolas Chopin. Central limit theorem for sequential monte carlo methods and its application to bayesian inference. The Annals of Statistics, 32(6):2385–2411, 2004. [5] Jean Cornuet, Jean-Michel Marin, Antonietta Mira, and Christian P Robert. Adaptive multiple importance sampling. Scandinavian Journal of Statistics, 39(4):798–812, 2012. [6] Pierre Del Moral, Arnaud Doucet, and Ajay Jasra. Sequential monte carlo samplers. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 68(3):411–436, 2006. [7] Bernard Delyon, François Portier, et al. Integral approximation by kernel smoothing. Bernoulli, 22(4):2177–2208, 2016. [8] Randal Douc, Arnaud Guillin, J-M Marin, and Christian P Robert. Convergence of adaptive mixtures of importance sampling schemes. The Annals of Statistics, pages 420–448, 2007. [9] Randal Douc, Arnaud Guillin, J-M Marin, and Christian P Robert. Minimum variance importance sampling via population monte carlo. ESAIM: Probability and Statistics, 11:427–447, 2007. [10] Randal Douc and Eric Moulines. Limit theorems for weighted samples with applications to sequential monte carlo methods. The Annals of Statistics, pages 2344–2376, 2008. [11] Víctor Elvira, Luca Martino, David Luengo, and Mónica F Bugallo. Generalized multiple importance sampling. arXiv preprint arXiv:1511.03095, 2015. [12] Akram Erraqabi, Michal Valko, Alexandra Carpentier, and Odalric Maillard. Pliable rejection sampling. In International Conference on Machine Learning, pages 2121–2129, 2016. [13] Michael Evans and Tim Swartz. Approximating integrals via Monte Carlo and deterministic methods. Oxford Statistical Science Series. Oxford University Press, Oxford, 2000. [14] John Geweke. Bayesian inference in econometric models using monte carlo integration. Econometrica: Journal of the Econometric Society, pages 1317–1339, 1989. [15] Heikki Haario, Eero Saksman, and Johanna Tamminen. An adaptive metropolis algorithm. Bernoulli, 7(2):223–242, 2001. [16] John Michael Hammersley and David Christopher Handscomb. General principles of the monte carlo method. In Monte Carlo Methods, pages 50–75. Springer, 1964. [17] Lars Peter Hansen. Large sample properties of generalized method of moments estimators. Econometrica: Journal of the Econometric Society, pages 1029–1054, 1982. [18] Tatsunori B Hashimoto, Steve Yadlowsky, and John C Duchi. Derivative free optimization via repeated classification. arXiv preprint arXiv:1804.03761, 2018. [19] Tang Jie and Pieter Abbeel. On a connection between importance sampling and the likelihood ratio policy gradient. In Advances in Neural Information Processing Systems, pages 1000–1008, 2010. 10 [20] Tuen Kloek and Herman K Van Dijk. Bayesian estimates of equation system parameters: an application of integration by monte carlo. Econometrica: Journal of the Econometric Society, pages 1–19, 1978. [21] Qi Lou, Rina Dechter, and Alexander T Ihler. Dynamic importance sampling for anytime bounds of the partition function. In Advances in Neural Information Processing Systems, pages 3199–3207, 2017. [22] Jean-Michel Marin, Pierre Pudlo, and Mohammed Sedki. Consistency of the adaptive multiple importance sampling. arXiv preprint arXiv:1211.2548, 2012. [23] Jan C Neddermeyer. Computationally efficient nonparametric importance sampling. Journal of the American Statistical Association, 104(486):788–802, 2009. [24] Chris J. Oates, Mark Girolami, and Nicolas Chopin. Control functionals for Monte Carlo integration. J. R. Statist. Soc. B, 79(3):695–718, 2017. [25] Man-Suk Oh and James O. Berger. Adaptive importance sampling in Monte Carlo integration. J. Statist. Comput. Simulation, 41(3-4):143–168, 1992. [26] Art Owen and Yi Zhou. Safe and effective importance sampling. J. Amer. Statist. Assoc., 95(449):135–143, 2000. [27] Jan Peters, Katharina Mülling, and Yasemin Altun. Relative entropy policy search. In AAAI, pages 1607–1612. Atlanta, 2010. [28] François Portier and Johan Segers. Monte carlo integration with a growing number of control variates. arXiv preprint arXiv:1801.01797, 2018. [29] Jean-Francois Richard and Wei Zhang. Efficient high-dimensional importance sampling. Journal of Econometrics, 141(2):1385–1411, 2007. [30] John Schulman, Sergey Levine, Pieter Abbeel, Michael Jordan, and Philipp Moritz. Trust region policy optimization. In International Conference on Machine Learning, pages 1889–1897, 2015. [31] A. W. van der Vaart. Asymptotic statistics, volume 3 of Cambridge Series in Statistical and Probabilistic Mathematics. Cambridge University Press, Cambridge, 1998. [32] Eric Veach and Leonidas J Guibas. Optimally combining sampling techniques for monte carlo rendering. In Proceedings of the 22nd annual conference on Computer graphics and interactive techniques, pages 419–428. ACM, 1995. [33] Ping Zhang. Nonparametric importance sampling. J. Amer. Statist. Assoc., 91(435):1245–1253, 1996. [34] Peilin Zhao and Tong Zhang. Stochastic optimization with importance sampling for regularized loss minimization. In international conference on machine learning, pages 1–9, 2015. 11
2018
126
7,282
Phase Retrieval Under a Generative Prior Paul Hand⇤ Northeastern University p.hand@northeastern.edu Oscar Leong Rice University oscar.f.leong@rice.edu Vladislav Voroninski Helm.ai vlad@helm.ai Abstract We introduce a novel deep learning inspired formulation of the phase retrieval problem, which asks to recover a signal y0 2 Rn from m quadratic observations, under structural assumptions on the underlying signal. As is common in many imaging problems, previous methodologies have considered natural signals as being sparse with respect to a known basis, resulting in the decision to enforce a generic sparsity prior. However, these methods for phase retrieval have encountered possibly fundamental limitations, as no computationally efficient algorithm for sparse phase retrieval has been proven to succeed with fewer than O(k2 log n) generic measurements, which is larger than the theoretical optimum of O(k log n). In this paper, we propose a new framework for phase retrieval by modeling natural signals as being in the range of a deep generative neural network G : Rk ! Rn. We introduce an empirical risk formulation that has favorable global geometry for gradient methods, as soon as m = O(kd2 log n), under the model of a d-layer fully-connected neural network with random weights. Specifically, when suitable deterministic conditions on the generator and measurement matrix are met, we construct a descent direction for any point outside of a small neighborhood around the true k-dimensional latent code and a negative multiple thereof. This formulation for structured phase retrieval thus benefits from two effects: generative priors can more tightly represent natural signals than sparsity priors, and this empirical risk formulation can exploit those generative priors at an information theoretically optimal sample complexity, unlike for a sparsity prior. We corroborate these results with experiments showing that exploiting generative models in phase retrieval tasks outperforms both sparse and general phase retrieval methods. 1 Introduction We study the problem of recovering a signal y0 2 Rn given m ⌧n phaseless observations of the form b = |Ay0| where the measurement matrix A 2 Rm⇥n is known and | · | is understood to act entrywise. This is known as the phase retrieval problem. In this work, we assume, as a prior, that the signal y0 is in the range of a generative model G : Rk ! Rn so that y0 = G(x0) for some x0 2 Rk. To recover y0, we first recover the original latent code x0 corresponding to it, from which y0 is obtained by applying G. Hence we study the phase retrieval problem under a generative prior which asks: find x 2 Rk such that b = |AG(x)|. We will refer to this formulation as Deep Phase Retrieval (DPR). The phase retrieval problem has applications in X-ray crystallography [21, 29], optics [34], astronomical imaging [14], diffraction ⇤Authors are listed in alphabetical order. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. imaging [5], and microscopy [28]. In these problems, the phase information of an object is lost due to physical limitations of scientific instruments. In crystallography, the linear measurements in practice are typically Fourier modes because they are the far field limit of a diffraction pattern created by emitting a quasi-monochromatic wave on the object of interest. In many applications, the signals to be recovered are compressible or sparse with respect to a certain basis (e.g. wavelets). Many researchers have attempted to leverage sparsity priors in phase retrieval to yield more efficient recovery algorithms. However, these methods have been met with potentially severe fundamental limitations. In the Gaussian measurement regime where A has i.i.d. Gaussian entries, one would hope that recovery of a k-sparse n-dimensional signal is possible with O(k log n) measurements. However, there is no known method to succeed with fewer than O(k2 log n) measurements. Moreover, [26] proved that the semidefinite program PhaseLift cannot outperform this suboptimal sample complexity by direct `1 penalization. This is in stark contrast to the success of leveraging sparsity in linear compressed sensing to yield optimal sample complexity. Hence enforcing sparsity as a generic prior in phase retrieval may be fundamentally limiting sample complexity. Our contribution. We show information theoretically optimal sample complexity2 for structured phase retrieval under generic measurements and a novel nonlinear formulation based on empirical risk and a generative prior. In this work, we suppose that the signal of interest is the output of a generative model. In particular, the generative model is a d-layer, fully-connected, feed forward neural network with Rectifying Linear Unit (ReLU) activation functions and no bias terms. Let Wi 2 Rni⇥ni−1 denote the weights in the i-th layer of our network for i = 1, . . . , d where k = n0 < n1 < · · · < nd. Given an input x 2 Rk, the output of the the generative model G : Rk ! Rnd can be expressed as G(x) := relu (Wd . . . relu(W2(relu(W1x))) . . . ) where relu(x) = max(x, 0) acts entrywise. We further assume that the measurement matrix A and each weight matrix Wi have i.i.d. Gaussian entries. The Gaussian assumption of the weight matrices is supported by empirical evidence showing neural networks, learned from data, that have weights that obey statistics similar to Gaussians [1]. Furthermore, there has also been work done in establishing a relationship between deep networks and Gaussian processes [25]. Nevertheless, we will introduce deterministic conditions on the weights for which our results hold, allowing the use of other distributions. To recover x0, we study the following `2 empirical risk minimization problem: min x2Rk f(x) := 1 2 !!!|AG(x)| −|AG(x0)| !!! 2 . (1) Due to the non-convexity of the objective function, there is no a priori guarantee that gradient descent schemes can solve (1) as many local minima may exist. In spite of this, our main result illustrates that the objective function exhibits favorable geometry for gradient methods. Moreover, our result holds with information theoretically optimal sample complexity: Theorem 1 (Informal). If we have a sufficient number of measurements m = ⌦(kd log(n1 . . . nd)) and our network is sufficiently expansive at each layer ni = ⌦(ni−1 log ni−1), then there exists a descent direction vx,x0 2 Rk for any non-zero x 2 Rk outside of two small neighborhoods centered at the true solution x0 and a negative multiple −⇢dx0 with high probability. In addition, the origin is a local maximum of f. Here ⇢d > 0 depends on the number of layers d and ⇢d ! 1 as d ! 1. Our main result asserts that the objective function does not have any spurious local minima away from neighborhoods of the true solution and a negative multiple of it. Hence if one were to solve (1) via gradient descent and the algorithm converged, the final iterate would be close to the true solution or a negative multiple thereof. The proof of this result is a concentration argument. We first prove the sufficiency of two deterministic conditions on the weights Wi and measurement matrix A. We then show that Gaussian Wi and A satisfy these conditions with high probability. Finally, using these two conditions, we argue that the specified descent direction vx,x0 concentrates around a vector hx,x0 that is continuous for non-zero x 2 Rk and vanishes only when x ⇡x0 or x ⇡−⇢dx0. Rather than working against potentially fundamental limitations of polynomial time algorithms, we examine more sophisticated priors using generative models. Our results illustrate that these priors are, 2with respect to the dimensionality of the latent code given to the generative network 2 in reality, less limiting in terms of sample complexity, both by providing more compressibility and by being able to be more tightly enforced. Prior methodologies for general phase retrieval. In the Gaussian measurement regime, most of the techniques to solve phase retrieval problems can be classified as convex or non-convex methods. In terms of convex techniques, lifting-based methods transform the signal recovery problem into a rank-one matrix recovery problem by lifting the signal into the space of positive semidefinite matrices. These semidefinite programming (SDP) approaches, such as PhaseLift [9], can provably recover any n-dimensional signal with O(n log n) measurements. A refinement on this analysis by [7] for PhaseLift showed that recovery is in fact possible with O(n) measurements. Other convex methods include PhaseCut [33], an SDP approach, and linear programming algorithms such as PhaseMax, which has been shown to achieve O(n) sample complexity [17]. Non-convex methods encompass alternating minimization approaches such as the original GerchbergSaxton [16] and Fienup [15] algorithms and direct optimization algorithms such as Wirtinger Flow [8]. These latter methods directly tackle the least squares objective function min y2Rn 1 2 !!!|Ay|2 −|Ay0|2!!! 2 . (2) In the seminal work, [8] show that through an initialization via the spectral method, a gradient descent scheme can solve (2) where the gradient is understood in the sense of Wirtinger calculus with O(n log n) measurements. Expanding on this, a later study on the minimization of (2) in [31] showed that with O(n log3 n) measurements, the energy landscape of the objective function exhibited global benign geometry which would allow it to be solved efficiently by gradient descent schemes without special initialization. There also exist amplitude flow methods that solve the following non-smooth variation of (2): min y2Rn 1 2 !!!|Ay| −|Ay0| !!! 2 . (3) These methods have found success with O(n) measurements [13] and have been shown to empirically perform better than intensity-based methods using the squared formulation in (2) [37]. Sparse phase retrieval. Many of the successful methodologies for general phase retrieval have been adapted to try to solve sparse phase retrieval problems. In terms of non-convex optimization, Wirtinger Flow type methods such as Thresholded Wirtinger Flow [6] create a sparse initializer via the spectral method and perform thresholded gradient descent updates to generate sparse iterates to solve (2). Another non-convex method, SPARTA [35], estimates the support of the signal for its initialization and performs hard thresholded gradient updates to the amplitude-based objective function (3). Both of these methods require O(k2 log n) measurements for a generic k-sparse n-dimensional signal to succeed, which is more than the theoretical optimum O(k log n). While lifting-based methods such as PhaseLift have been proven unable to beat the suboptimal sample complexity O(k2 log n), there has been some progress towards breaking this barrier. In [19], the authors show that with an initializer that sufficiently correlates with the true solution, a linear program can recover the sparse signal from O(k log n k ) measurements. However, the best known initialization methods require at least O(k2 log n) measurements [6]. Outside of the Gaussian measurement regime, there have been other results showing that if one were able to design their own measurement matrices, then the optimal sample complexity could be reached [22]. For example, [2] showed that assuming the measurement vectors were chosen from an incoherent subspace, then recovery is possible with O(k log n k ) measurements. However, these results would be difficult to generalize to the experimental setting as their design architectures are often unrealistic. Moreover, the Gaussian measurement regime more closely models the experimental Fourier diffraction measurements observed in, for example, X-ray crystallography. As Fourier models are the ultimate goal, results towards lowering this sample complexity in the Gaussian measurement regime must be made or new modes of regularization must be explored in order for phase retrieval to advance. Related work. There has been recent empirical evidence supporting applying a deep learning based approach to holographic imaging, a phase retrieval problem. The authors in [18] show that a neural network with ReLU activation functions can learn to perform holographic image reconstruction. In particular, they show that compared to current approaches, this neural network based method requires 3 less measurements to succeed and is computationally more efficient, needing only one hologram to reconstruct the necessary images. Furthermore, there have been a number of recent advancements in leveraging generative priors over sparsity priors in compressed sensing. In [4], the authors considered the least squares objective min x2Rk 1 2 !!!AG(x) −AG(x0) !!! 2 . (4) They provided empirical evidence showing that 5-10X fewer measurements were needed to succeed in recovery compared to standard sparsity-based approaches such as Lasso. In terms of theory, they showed that if A satisfied a restricted eigenvalue condition and if one were able to solve (4), then the solution would be close to optimal. The authors in [20] analyze the same optimization problem in [4] but exhibit global guarantees regarding the non-convex objective function. Under particular conditions about the expansivity of each neural network layer and randomness assumptions on their weights, they show that the energy landscape of the objective function does not have any spurious local minima. Furthermore, there is always a descent direction outside of two small neighborhoods of the global minimum and a negative scalar multiple of it. The success of leveraging generative priors in compressed sensing along with the sample complexity bottlenecks in sparse phase retrieval have influenced this work to consider enforcing a generative prior in phase retrieval to surpass sparse phase retrieval’s current theoretical and practical limitations. Notation. Let (·)> denote the real transpose. Let [n] = {1, . . . , n}. Let B(x, r) denote the Euclidean ball centered at x with radius r. Let k · k denote the `2 norm for vectors and spectral norm for matrices. For any non-zero x 2 Rn, let ˆx = x/kxk. Let ⇧1 i=dWi = WdWd−1 . . . W1. Let In be the n ⇥n identity matrix. Let Sk−1 denote the unit sphere in Rk. We write c = ⌦(δ) when c > Cδ for some positive constant C. Similarly, we write c = O(δ) when c 6 Cδ for some positive constant C. When we say that a constant depends polynomially on ✏−1, this means that it is at least C✏−k for some positive C and positive integer k. For notational convenience, we write a = b + O1(✏) if ka −bk 6 ✏where k · k denotes | · | for scalars, `2 norm for vectors, and spectral norm for matrices. Define sgn : R ! R to be sgn(x) = x/|x| for non-zero x 2 R and sgn(x) = 0 otherwise. For a vector v 2 Rn, diag(sgn(v)) is sgn(vi) in the i-th diagonal entry and diag(v > 0) is 1 in the i-th diagonal entry if vi > 0 and 0 otherwise. 2 Algorithm While our main result illustrates that the objective function exhibits favorable geometry for optimization, it does not guarantee recovery of the signal as gradient descent algorithms could, in principle, converge to the negative multiple of our true solution. Hence we propose a gradient descent scheme to recover the desired solution by escaping this region. First, consider Figure 1 which illustrates the behavior of our objective function in expectation, i.e. when the number of measurements m ! 1. We observe two important attributes of the objective function’s landscape: (1) there exist two minima, the true solution x0 and a negative multiple −βx0 for some β > 0 and (2) if z ⇡x0 while w ⇡−βx0, we have that f(z) < f(w), i.e. the objective function value is lower near the true solution than near its negative multiple. This is due to the fact that the true solution is in fact the global optimum. Based on these attributes, we will introduce a gradient descent scheme to converge to the global minimum. First, we define some useful quantities. For any x 2 Rk and matrix W 2 Rn⇥k, define W+,x := diag(Wx > 0)W. That is, W+,x keeps the rows of W that have a positive dot product with x and zeroes out the rows that do not. We will extend the definition of W+,x to each layer of weights Wi in our neural network. For W1 2 Rn1⇥k and x 2 Rk, define W1,+,x := diag(W1x > 0)W1. For each layer i 2 [d], define Wi,+,x := diag(WiWi−1,+,x . . . W2,+,xW1,+,xx > 0)Wi. Wi,+,x keeps the rows of Wi that are active when the input to the generative model is x. Then, for any x 2 Rk, the output of our generative model can be written as G(x) = (⇧1 i=dWi,+,x)x. For any z 2 Rn, define Az := diag(sgn(Az))A. Note that |AG(x)| = AG(x)G(x) for any x 2 Rk. Since a gradient descent scheme could in principle be attracted to the negative multiple, we exploit the geometry of the objective function’s landscape to escape this region. First, choose a random initial 4 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Figure 1: Surface (left) and contour plot (right) of objective function with m ! 1 and true solution x0 = [1, 0]> 2 R2. iterate for gradient descent x1 6= 0. At each iteration i = 1, 2, . . . , compute the descent direction vxi,x0 := (⇧1 i=dWi,+,xi)>A> G(xi) (|AG(xi)| −|AG(x0)|) . This is the gradient of our objective function f where f is differentiable. Once computed, we then take a step in the direction of −vxi,x0. However, prior to taking this step, we compare the objective function value for xi and its negation −xi. If f(−xi) < f(xi), then we set xi to its negation, compute the descent direction and update the iterate. The intuition for this algorithm relies on the landscape illustrated in Figure 1: since the true solution x0 is the global minimum, the objective function value near x0 is smaller than near −⇢dx0. Hence if we begin to converge towards −⇢dx0, this algorithm will escape this region by choosing a point with lower objective function value, which will be in a neighborhood of x0. Algorithm 1 formally outlines this process. Algorithm 1 Deep Phase Retrieval (DPR) Gradient method Require: Weights Wi, measurement matrix A, observations |AG(x0)|, and step size ↵> 0 1: Choose an arbitrary initial point x1 2 Rk \ {0} 2: for i = 1, 2, . . . do 3: if f(−xi) < f(xi) then 4: xi −xi; 5: end if 6: Compute vxi,x0 = (⇧1 i=dWi,+,xi)>A> G(xi) (|AG(xi)| −|AG(x0)|); 7: xi+1 = xi −↵vxi,x0; 8: end for Remark. We note that while the function is not differentiable, the descent direction is welldefined for all x 2 Rk due to the definitions of Wi,+,x and AG(x). When the objective function is differentiable, vx,x0 agrees with the true gradient. Otherwise, the descent direction only takes components of the formula for which the inputs to each ReLU are nonnegative. 3 Main Theoretical Analysis We now formally present our main result. While the objective function is not smooth, its onesided directional derivatives exist everywhere due to the continuity and piecewise linearity of G. Let Dvf(x) denote the unnormalized one-sided directional derivative of f at x in the direction v: Dvf(x) = limt!0+ f(x+tv)−f(x) t . Theorem 2. Fix ✏> 0 such that K1d8✏1/4 6 1 and let d > 2. Suppose G is such that Wi 2 Rni⇥ni−1 has i.i.d. N(0, 1/ni) entries for i = 1, . . . , d. Suppose that A 2 Rm⇥nd has i.i.d. N(0, 1/m) 5 entries independent from {Wi}. Then if m > C✏dk log(n1n2 . . . nd) and ni > C✏ni−1 log ni−1 for i = 1, . . . , d, then with probability at least 1 −Pd i=1 γnie−c✏ni−1 −γm4k+1e−c✏m, the following holds: for all non-zero x, x0 2 Rk, there exists vx,x0 2 Rk such that the one-sided directional derivatives of f satisfy D−vx,x0 f(x) < 0, 8x /2 B(x0, K2d3✏1/4kx0k) [ B(−⇢dx0, K2d14✏1/4kx0k) [ {0}, Dxf(0) < 0, 8x 6= 0, where ⇢d > 0 converges to 1 as d ! 1 and K1 and K2 are universal constants. Here C✏depends polynomially on ✏−1, c✏depends on ✏, and γ is a universal constant. See Section 3.1 for the definition of the descent direction vx,x0. We note that while we assume the weights to have i.i.d. Gaussian entries, we make no assumption about the independence between layers. The result will be shown by proving the sufficiency of two deterministic conditions on the weights Wi of our generative network and the measurement matrix A. Weight Distribution Condition. The first condition quantifies the Gaussianity and spatial arrangement of the neurons in each layer. We say that W 2 Rn⇥k satisfies the Weight Distribution Condition (WDC) with constant ✏> 0 if for any non-zero x, y 2 Rk: !!W > +,xW+,y −Qx,y !! 6 ✏where Qx,y := ⇡−✓x,y 2⇡ Ik + sin ✓x,y 2⇡ Mˆx$ˆy. Here ✓x,y = \(x, y) and Mˆx$ˆy3 is the matrix that sends ˆx 7! ˆy, ˆy 7! ˆx, and z 7! 0 for any z 2 span({x, y})?. If Wij ⇠N(0, 1/n), then an elementary calculation gives E ⇥ W > +,xW+,y ⇤ = Qx,y. [20] proved that Gaussian W satisfies the WDC with high probability (Lemma 1 in the Appendix). Range Restricted Concentration Property. The second condition is similar in the sense that it quantifies whether the measurement matrix behaves like a Gaussian when acting on the difference of pairs of vectors given by the output of the generative model. We say that A 2 Rm⇥n satisfies the Range Restricted Concentration Property (RRCP) with constant ✏> 0 if for all non-zero x, y 2 Rk, the matrices AG(x) and AG(y) satisfy the following for all x1, x2, x3, x4 2 Rk: |h(A> G(x)AG(y) −ΦG(x),G(y))(G(x1) −G(x2)),G(x3) −G(x4)i| 6 31✏kG(x1) −G(x2)kkG(x3) −G(x4)k where Φz,w := ⇡−2✓z,w ⇡ In + 2 sin ✓z,w ⇡ Mˆz$ ˆ w. If Aij ⇠N(0, 1/m), then for any z, w 2 Rn, a similar calculation for Gaussian W gives E ⇥ A> z Aw ⇤ = Φz,w. In our work, we establish that Gaussian A satisfies the RRCP with high probability. Please see Section 6 in the Appendix for a complete proof. We emphasize that these two conditions are deterministic, meaning that other distributions could be considered. We now state our main deterministic result. Theorem 3. Fix ✏> 0 such that K1d8✏1/4 6 1 and let d > 2. Suppose that G is such that Wi 2 Rni⇥ni−1 satisfies the WDC with constant ✏for all i = 1, . . . , d. Suppose A 2 Rm⇥nd satisfies the RRCP with constant ✏. Then the same conclusion as Theorem 2 holds. 3.1 Proof sketch for Theorem 2 Before we outline the proof of Theorem 2, we specify the descent direction vx,x0. For any x 2 Rk where f is differentiable, we have that rf(x) = (⇧1 i=dWi,+,x)>A> G(x)AG(x)(⇧1 i=dWi,+,x)x −(⇧1 i=dWi,+,x)>A> G(x)AG(x0)(⇧1 i=dWi,+,x0)x0. 3A formula for this matrix is as follows: consider a rotation matrix R that sends ˆx 7! e1 and ˆy 7! cos ✓0e1 + sin ✓0e2 where ✓0 = \(x, y). Then Mˆx$ˆy = R> 2 4 cos ✓0 sin ✓0 0 sin ✓0 −cos ✓0 0 0 0 0k−2 3 5 R where 0k−2 is the k −2 ⇥k −2 matrix of zeros. Note that if ✓0 = 0 or ⇡, Mˆx$ˆy = ˆxˆx> or −ˆxˆx>, respectively. 6 This is precisely the descent direction specified in Algorithm 1, expanded with our notation. When f is not differentiable at x, choose a direction w such that f is differentiable at x + δw for sufficiently small δ > 0. Such a direction w exists by the piecewise linearity of the generative model G. In fact, not only is the function piecewise linear, each of the pieces is the intersection of a finite number of half spaces. Thus, with probability 1 any randomly chosen direction w moves strictly into one piece, allowing for differentiability at x + δw for sufficiently small δ. We note that any such w can be chosen arbitrarily. Hence we define our descent direction vx,x0 as vx,x0 = ⇢rf(x) f differentiable at x 2 Rk limδ!0+ rf(x + δw) otherwise. The following is a sketch of the proof of Theorem 2: • By the WDC and RRCP, we have that the descent direction vx,x0 concentrates uniformly for all non-zero x, x0 2 Rk around a particular vector vx,x0 defined by equation (5) in the Appendix. • The WDC establishes that vx,x0 concentrates uniformly for all non-zero x, x0 2 Rk around a continuous vector hx,x0 defined by equation (7) in the Appendix. • A direct analysis shows that hx,x0 is only small in norm for x ⇡x0 and x ⇡−⇢dx0. See Section 5.3 for a complete proof. Since vx,x0 ⇡vx,x0 ⇡hx,x0, vx,x0 is also only small in norm in neighborhoods around x0 and −⇢dx0, establishing Theorem 3. • Gaussian Wi and A satisfy the WDC and RRCP with high probability (Lemma 1 and Proposition 2 in the Appendix). Theorem 2 is a combination of Lemma 1, Proposition 2, and Theorem 3. The full proofs of these results can be found in the Appendix. Remark. In comparison to the results in [20], considerable technical advances were needed in our case, including establishing concentration of AG(x) over the range of G. The quantity AG(x) acts like a spatially dependent sensing matrix, requiring a condition similar to the Restricted Isometry Property that must hold simultaneously over a finite number of subspaces given by the range(G). 4 Experiments In this section, we investigate the use of enforcing generative priors in phase retrieval tasks. We compared our results with the sparse truncated amplitude flow algorithm (SPARTA) [35] and three popular general phase retrieval methods: Fienup [15], Gerchberg Saxton [16], and Wirtinger Flow [8]. A MATLAB implementation of the SPARTA algorithm was made publicly available by the authors at https://gangwg.github.io/SPARTA/. We implemented the last three algorithms using the MATLAB phase retrieval library PhasePack [10]. While these methods are not intended for sparse recovery, we include them to serve as baselines. 4.1 Experiments for Gaussian signals We first consider synthetic experiments using Gaussian measurements on Gaussian signals. In particular, we considered a two layer network given by G(x) = relu(W2relu(W1x)) where each Wi has i.i.d. N(0, 1) entries for i = 1, 2. We set k = 10, n1 = 500, and n2 = 1000. We let the entries of A 2 Rm⇥n2 and x0 2 Rk be i.i.d. N(0, 1). We ran Algorithm 1 for 25 random instances of (A, W1, W2, x0). A reconstruction x? is considered successful if the relative error kG(x?) −G(x0)k/kG(x0)k 6 10−3. We also compared our results with SPARTA. In this setting, we chose a k = 10-sparse y0 2 Rn2, where the nonzero coefficients are i.i.d. N(0, 1). As before, we ran SPARTA with 25 random instances of (A, y0) and considered a reconstruction y? successful if ky? −y0k/ky0k 6 10−3. We also experimented with sparsity levels k = 3, 5. Figure 2 displays the percentage of successful trials for different ratios m/n where n = n2 = 1000 and m is the number of measurements. 4.2 Experiments for MNIST and CelebA We next consider image recovery tasks, where we use two different generative models for the MNIST and CelebA datasets. In each task, the goal is to recover an image y0 2 Rn given |Ay0| where 7 Figure 2: Empirical success rate with ratios m/n where DPR’s latent code dimension is k = 10, SPARTA’s sparsity level ranges from k = 3, 5, and 10, and n = 1000. DPR achieves nearly the same empirical success rate of recovering a 10-dimensional latent code as SPARTA in recovering a 3-sparse 1000-dimensional signal. A 2 Rm⇥n has i.i.d. N(0, 1/m) entries. We found an estimate image G(x?) in the range of our generator via gradient descent, using the Adam optimizer [23]. Empirically, we noticed that Algorithm 1 would typically only negate the latent code (Lines 3–4) at the initial iterate, if necessary. Hence we use a modified version of Algorithm 1 in these image experiments: we ran two sessions of gradient descent for a random initial iterate x1 and its negation −x1 and chose the most successful reconstruction. In the first image experiment, we used a pretrained Variational Autoencoder (VAE) from [4] that was trained on the MNIST dataset [24]. This dataset consists of 60, 000 images of handwritten digits. Each image is of size 28 ⇥28, resulting in vectorized images of size 784. As described in [4], the recognition network is of size 784 −500 −500 −20 while the generator network is of size 20 −500 −500 −784. The latent code space dimension is k = 20. Figure 3: Top left: Example reconstructions with 200 measurements. Top right: Example reconstructions with 500 measurements. Bottom: A comparison of DPR’s reconstruction error versus each algorithm for different numbers of measurements. 8 For SPARTA, we performed sparse recovery by transforming the images using the 2-D Discrete Cosine Transform (DCT). We allowed 10 random restarts for each algorithm, including the sparse and general phase retrieval methods. The results in Figure 3 demonstrate the success of our algorithm with very few measurements. For 200 measurements, we can achieve reasonable recovery. SPARTA can achieve good recovery with 500 measurements while the other algorithms cannot. In addition, our algorithm exhibits recovery with 500 measurements compared to the alternatives requiring 1000 and 1500 measurements, which is where they begin to succeed. The performance for the general phase retrieval methods is to be expected as they are known to succeed only when m = ⌦(n) where n = 784. We note that while our algorithm succeeds with fewer measurements than the other methods, our performance, as measured by per-pixel reconstruction error, saturates as the number of measurements increases since our reconstruction accuracy is ultimately bounded by the generative model’s representational error. As generative models improve, their representational errors will decrease. Nonetheless, as can be seen in the reconstructed digits, the recoveries are semantically correct (the correct digit is legibly recovered) even though the reconstruction error does not decay to zero. In applications, such as MRI and molecular structure estimation via X-ray crystallography, semantic error measures would be more informative estimates of recovery performance than per-pixel error measures. In the second experiment, we used a pretrained Deep Convolutional Generative Adversarial Network (DCGAN) from [4] that was trained on the CelebA dataset [27]. This dataset consists of 200, 000 facial images of celebrities. The RGB images were cropped to be of size 64 ⇥64, resulting in vectorized images of dimension 64 ⇥64 ⇥3 = 12288. The latent code space dimension is k = 100. We allowed 2 random restarts. We ran numerical experiments with the other methods and they did not succeed at measurement levels below 5000. The general phase retrieval methods began reconstructing the images when m = ⌦(n) where n = 12288. The following figure showcases our results on reconstructing 10 images from the DCGAN’s test set with 500 measurements. Original DPR with DCGAN Figure 4: 10 reconstructed images from celebA’s test set using DPR with 500 measurements. Acknowledgments OL acknowledges support by the NSF Graduate Research Fellowship under Grant No. DGE-1450681. PH acknowledges funding by the grant NSF DMS-1464525. References [1] Sanjeev Arora, Yingyu Liang, and Tengyu Ma. Why are deep nets reversible: A simple theory with implications for training. CoRR, abs/1511.05653, 2015. [2] Sohail Bahmani and Justin Romberg. Efficient compressive phase retrieval with constrained sensing vectors. Advances in Neural Information Processing Systems (NIPS 2015), pages 523–531, 2015. [3] Richard Baraniuk, Mark Davenport, Ronald DeVore, and Michael Wakin. A simple proof of the restricted isometry property for random matrices. Constructive Approximation, 28(3):253–263, 2008. [4] Ashish Bora, Alexandros G. Dimakis, Ajil Jalal, and Eric Price. Compressed sensing using generative models. arXiv preprint arXiv:1703.03208, 2017. 9 [5] Oliver Bunk, Ana Diaz, Franz Pfeiffer, Christian David, Bernd Schmitt, Dillip K. Satapathy, and J. Friso van der Veen. Diffractive imaging for periodic samples: Retrieving one-dimensional concentration profiles across microfluidic channels. Acta Crystallographica Section A: Foundations of Crystallography, 63(4):306–314, 2007. [6] Tony Cai, Xiaodong Li, and Zongming Ma. Optimal rates of convergence for noisy sparse phase retrieval via thresholded wirtinger flow. The Annals of Statistics, 44(5):2221–2251, 2016. [7] Emmanuel J. Candès and Xiaodong Li. Solving quadratic equations via phaselift when there are about as many equations as unknowns. Foundations of Computational Mathematics, 14.5:1017– 1026, 2014. [8] Emmanuel J. Candès, Xiaodong Li, and Mahdi Soltanolkotabi. Phase retrieval via wirtinger flow: Theory and applications. IEEE Transactions on Information Theory, 61(4):195–2007, 2017. [9] Emmanuel J. Candès, Thomas Strohmer, and Vladislav Voroninski. Phaselift: Exact and stable signal recovery from magnitude measurements via convex programming. Comm. Pure Applied Math, 66(8):1241–1274, 2013. [10] Rohan Chandra, Ziyuan Zhong, Justin Hontz, Val McCulloch, Christoph Studer, and Tom Goldstein. Phasepack: A phase retrieval library. Asilomar Conference on Signals, Systems, and Computers, 2017. [11] Mark A. Davenport. Proof of the rip for sub-gaussian matrices. OpenStax CNX, http://cnx.org/contents/f37687c1-d62b-4ede-8064-794a7e7da7da@5, 2013. [12] S. W. Drury. Honours analysis lecture notes, mcgill university. http://www.math.mcgill. ca/drury/notes354.pdf, 2001. [13] Yonina C. Eldar, Georgios B. Giannakis, and Gang Wang. Solving systems of random quadratic equations via truncated amplitude flow. IEEE Transactions on Information Theory, 23(26):773– 794, 2017. [14] C. Fienup and J. Dainty. Phase retrieval and image reconstruction for astronomy. Image Recovery: Theory and Application, pages 231–275, 1987. [15] J.R. Fienup. Phase retrieval algorithms: A comparison. Applied Optics, 21:2758–2768, 1982. [16] R.W. Gerchberg and W.O. Saxton. A practical algorithm for the determination of phase from image and diffraction plane pictures. Optik, 35:237–246, 1972. [17] Tom Goldstein and Christoph Struder. Phasemax: Convex phase retrieval via basis pursuit. arXiv preprint arXiv: 1610.07531, 2016. [18] Harun Günaydin, Da Tend, Yair Rivenson, Aydogan Ozcan, and Yibo Zhang. Phase recovery and holographic image reconstruction using deep learning in neural networks. arXiv preprint arXiv:1705.04286, 2017. [19] Paul Hand and Vladislav Voroninski. Compressed sensing from phaseless gaussian measurements via linear programming in the natural parameter space. arXiv preprint arXiv:1611.05985, 2016. [20] Paul Hand and Vladislav Voroninski. Global guarantees for enforcing generative priors by empirical risk. arXiv preprint arXiv:1705.07576, 2017. [21] Robert W. Harrison. Phase problem in crystallography. J. Opt. Soc. Am. A, 10(5):1046–1055, 1993. [22] Kishore Jaganathan, Samet Oymak, and Babak Hassibi. Sparse phase retrieval: Convex algorithms and limitations. Information Theory Proceedings (ISIT), 2013 IEEE International Symposium on:1022–1026, 2013. [23] Diederik Kingma and Jimmy Ba. Adam. Adam: A method for stochastic optimization. arXiv preprint, arXiv:1412.6980, 2014. 10 [24] Yann LeCun, Leon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998. [25] Jaehoon Lee, Yasaman Bahri, Roman Novak, Samuel S. Schoenholz, Jeffrey Pennington, and Jascha Sohl-Dickstein. Deep neural networks as gaussian processes. International Conference on Learning Representations (ICLR 2018), 2018. [26] Xiaodong Li and Vladislav Voroninski. Sparse signal recovery from quadratic measurements via convex programming. SIAM Journal on Mathematical Analysis, 45(5):3019–3033, 2013. [27] Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. Proceedings of the IEEE International Conference on Computer Vision, pages 3730–3738, 2015. [28] Jianwei Miao, Tetsuya Ishikawa, Qun Shen, and Thomas Earnest. Extending x-ray crystallography to allow the imaging of noncrystalline materials, cells, and single protein complexes. Annu. Rev. Phys. Chem., 59:387–410, 2008. [29] RP Millane. Phase retrieval in crystallography and optics. J. Opt. Soc. Am. A, 7(3):394–411, 1990. [30] Yaniv Plan and Roman Vershynin. One-bit compressed sensing by linear programming. Communications on Pure and Applied Mathematics, 66(8):1275–1297, 2013. [31] Ju Sun, Qing Qu, and John Wright. A geometric analysis of phase retrieval. Information Theory (ISIT), 2016 IEEE International Symposium, pages 2379–2383, 2016. [32] Roman Vershynin. Introduction to the non-asymptotic analysis of random matrices. Compressed Sensing: Theory and Applications, Cambridge University Press, 2012. [33] Irène Waldspurger, Alexandre d’Aspremont, and Stéphane Mallat. Phase recovery, maxcut and complex semidefinite programming. Mathematical Programming, 149(1-2):47–81, 2015. [34] Adriaan Walther. The question of phase retrieval in optics. Journal of Modern Optics, 10(1):41– 49, 1963. [35] Gang Wang, Liang Zhang, Georgios B. Giannakis, Mehmet Akçakaya, and Jie Chen. Sparse phase retrieval via truncated amplitude flow. Signal Processing IEEE Transactions on, 66:479– 491, 2018. [36] James G. Wendel. A problem in geometric probability. Math. Scand., 11:109–111, 1962. [37] Li-Hao Yeh, Jonathan Dong, Jingshan Zhong, Lei Tian, Michael Chen, Gongguo Tang, Mahdi Soltanolkotabi, and Laura Waller. Experimental robustness of fourier ptychography phase retrieval algorithms. Optics Express, PP(99):33214–33240, 2015. 11
2018
127
7,283
Gaussian Process Prior Variational Autoencoders Francesco Paolo Casale†∗, Adrian V Dalca‡§, Luca Saglietti†¶, Jennifer Listgarten♯, Nicolo Fusi† † Microsoft Research New England, Cambridge (MA), USA ‡ Computer Science and Artificial Intelligence Lab, MIT, Cambridge (MA), USA § Martinos Center for Biomedical Imaging, MGH, HMS, Boston (MA), USA; ¶ Italian Institute for Genomic Medicine, Torino, Italy ♯EECS Department, University of California, Berkeley (CA), USA. ∗frcasale@microsoft.com Abstract Variational autoencoders (VAE) are a powerful and widely-used class of models to learn complex data distributions in an unsupervised fashion. One important limitation of VAEs is the prior assumption that latent sample representations are independent and identically distributed. However, for many important datasets, such as time-series of images, this assumption is too strong: accounting for covariances between samples, such as those in time, can yield to a more appropriate model specification and improve performance in downstream tasks. In this work, we introduce a new model, the Gaussian Process (GP) Prior Variational Autoencoder (GPPVAE), to specifically address this issue. The GPPVAE aims to combine the power of VAEs with the ability to model correlations afforded by GP priors. To achieve efficient inference in this new class of models, we leverage structure in the covariance matrix, and introduce a new stochastic backpropagation strategy that allows for computing stochastic gradients in a distributed and low-memory fashion. We show that our method outperforms conditional VAEs (CVAEs) and an adaptation of standard VAEs in two image data applications. 1 Introduction Dimensionality reduction is a fundamental approach to compression of complex, large-scale data sets, either for visualization or for pre-processing before application of supervised approaches. Historically, dimensionality reduction has been framed in one of two modeling camps: the simple and rich capacity language of neural networks; or the probabilistic formalism of generative models, which enables Bayesian capacity control and provides uncertainty over latent encodings. Recently, these two formulations have been combined through the Variational Autoencoder (VAE) (Kingma and Welling, 2013), wherein the expressiveness of neural networks was used to model both the mean and the variance of a simple likelihood. In these models, latent encodings are assumed to be identically and independently distributed (iid ) across both latent dimensions and samples. Despite this simple prior, the model lacks conjugacy, exact inference is intractable and variational inference is used. In fact, the main contribution of the Kingma et al. paper is to introduce an improved, general approach for variational inference (also developed in Rezende et al. (2014)). One important limitation of the VAE model is the prior assumption that latent representations of samples are iid , whereas in many important problems, accounting for sample structure is crucial for correct model specification and consequently, for optimal results. For example, in autonomous driving, or medical imaging (Dalca et al., 2015; Lonsdale et al., 2013), high dimensional images are correlated in time—an iid prior for these would not be sensible because, a priori, two images that were taken closer in time should have more similar latent representations than images taken further apart. More generally, one can have multiple sequences of images from different cars, or medical 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. image sequences from multiple patients. Therefore, the VAE prior should be able to capture multiple levels of correlations at once, including time, object identities, etc. A natural solution to this problem is to replace the VAE iid prior over the latent space with a Gaussian Process (GP) prior (Rasmussen, 2004), which enables the specification of sample correlations through a kernel function (Durrande et al., 2011; Gönen and Alpaydın, 2011; Wilson and Adams, 2013; Wilson et al., 2016; Rakitsch et al., 2013; Bonilla et al., 2007). GPs are often amenable to exact inference, and a large body of work in making computationally challenging GP-based models tractable can be leveraged (GPs naively scale cubically in the number of samples) (Gal et al., 2014; Bauer et al., 2016; Hensman et al., 2013; Csató and Opper, 2002; Quiñonero-Candela and Rasmussen, 2005; Titsias, 2009). In this work, we introduce the Gaussian Process Prior Variational Autoencoder (GPPVAE), an extension of the VAE latent variable model where correlation between samples is modeled through a GP prior on the latent encodings. The introduction of the GP prior, however, introduces two main computational challenges. First, naive computations with the GP prior have cubic complexity in the number of samples, which is impractical in most applications. To mitigate this problem one can leverage several tactics commonly used in the GP literature, including the use of pseudo-inputs (Csató and Opper, 2002; Gal et al., 2014; Hensman et al., 2013; Quiñonero-Candela and Rasmussen, 2005; Titsias, 2009), Kronecker-factorized covariances (Casale et al., 2017; Stegle et al., 2011; Rakitsch et al., 2013), and low rank structures (Casale et al., 2015; Lawrence, 2005). Specifically, in the instantiations of GPPVAE considered in this paper, we focus on low-rank factorizations of the covariance matrix. A second challenge is that the iid assumption which guarantees unbiasedness of mini-batch gradient estimates (used to train standard VAEs) no longer holds due to the GP prior. Thus mini-batch GD is no longer applicable. However, for the applications we are interested in, comprising sequences of large-scale images, it is critical from a practical standpoint to avoid processing all samples simultaneously; we require a procedure that is both low in memory use and yields fast inference. Thus, we propose a new scheme for gradient descent that enables Monte Carlo gradient estimates in a distributable and memory-efficient fashion. This is achieved by exploiting the fact that sample correlations are only modeled in the latent (low-dimensional) space, whereas high-dimensional representations are independent when conditioning on the latent ones. In the next sections we (i) discuss our model in the context of related work, (ii) formally develop the model and the associated inference procedure, (iii) compare GPPVAE with alternative models in empirical settings, demonstrating the advantages of our approach. 2 Related work Our method is related to several extensions of the standard VAE that aim at improving the latent representation by leveraging auxiliary data, such as time annotations, pose information or lighting. An ad hoc attempt to induce structure on the latent space by grouping samples with specific properties in mini-batches was introduced in Kulkarni et al. (2015). More principled approaches proposed a semi-supervised model using a continuous-discrete mixture model that concatenates the input with auxiliary information (Kingma et al., 2014). Similarly, the conditional VAE (Sohn et al., 2015) incorporates auxiliary information in both the encoder and the decoder, and has been used successfully for sample generation with specific categorical attributes. Building on this approach, several models use the auxiliary information in an unconditional way (Suzuki et al., 2016; Pandey and Dukkipati, 2017; Vedantam et al., 2017; Wang et al., 2016; Wu and Goodman, 2018). A separate body of related work aims at designing a more flexible variational posterior distributions, either by considering a dependence on auxiliary variables (Maaløe et al., 2016), by allowing structured encoder models (Siddharth et al., 2016), or by considering chains of invertible transformations that can produce arbitrarily complex posteriors (Kingma et al., 2016; Nalisnick et al., 2016; Rezende and Mohamed, 2015). In other work, a dependency between latent variables is induced by way of hierarchical structures at the level of the parameters of the variational family (Ranganath et al., 2016; Tran et al., 2015). The extensions of VAEs most related to GPPVAE are those that move away from the assumption of an iid Gaussian prior on the latent representations to consider richer prior distributions (Jiang et al., 2016; Shu et al., 2016; Tomczak and Welling, 2017). These build on the observation that overlysimple priors can induce excessive regularization, limiting the success of such models (Chen et al., 2016; Hoffman and Johnson, 2016; Siddharth et al., 2017). For example, Johnson et al. proposed 2 composing latent graphical models with deep observational likelihoods. Within their framework, more flexible priors over latent encodings are designed based on conditional independence assumptions, and a conditional random field variational family is used to enable efficient inference by way of message-passing algorithms (Johnson et al., 2016). In contrast to existing methods, we propose to model the relationship between the latent space and the auxiliary information using a GP prior, leaving the encoder and decoder as in a standard VAE (independent of the auxiliary information). Importantly, the proposed approach allows for modeling arbitrarily complex sample structure in the data. In this work, we specifically focus on disentangling sample correlations induced by different aspects of the data. Additionally, GPPVAE enables estimation of latent auxiliary information when such information is unobserved by leveraging previous work (Lawrence, 2005). Finally, using the encoder and decoder networks together with the GP predictive posterior, our model provides a natural framework for out-of-sample predictions of high-dimensional data, for virtually any configuration of the auxiliary data. 3 Gaussian Process Prior Variational Autoencoder Assume we are given a set of samples (e. g., images), each coupled with different types of auxiliary data (e. g., time, lighting, pose, person identity). In this work, we focus on the case of two types of auxiliary data: object and view entities. Specifically, we consider datasets with images of objects in different views. For example, images of faces in different poses or images of hand-written digits at different rotation angles. In these problems, we know both which object (person or hand-written digit) is represented in each image in the dataset, and in which view (pose or rotation angle). Finally, each unique object and view is attached to a feature vector, which we refer to as an object feature vector and a view feature vector, respectively. In the face dataset example, object feature vectors might contain face features such as skin color or hair style, while view feature vectors may contain pose features such as polar and azimuthal angles with respect to a reference position. Importantly, as described and shown below, we can learn these feature vectors if not observed. 3.1 Formal description of the model Let N denote the number of samples, P the number of unique objects and Q the number of unique views. Additionally, let {yn}N n=1 denote K-dimensional representation for N samples; let {xp}P p=1 denote M-dimensional object feature vectors for the P objects; and let {wq}Q q=1 denote R-dimensional view feature vectors for the Q views. Finally, let {zn}N n=1 denote the L-dimensional latent representations. We consider the following generative process for the observed samples (Fig 1a): • the latent representation of object pn in view qn is generated from object feature vector xpn and view feature vector wqn as zn = f(xpn, wqn) + ηn, where ηn ∼N (0, αIL) ; (1) • image yn is generated from its latent representation zn as yn = g(zn) + ϵn, where ϵn ∼N 0, σ2 yIK  . (2) The function f : RM × RR →RL defines how sample latent representations can be obtained in terms of object and view feature vectors, while g : RL →RK maps latent representations to the high-dimensional sample space. We use a Gaussian process (GP) prior on f, which allows us to model sample covariances in the latent space as a function of object and view feature vectors. Herein, we use a convolutional neural network for g, which is a natural choice for image data (LeCun et al., 1995). The resulting marginal likelihood of the GPPVAE, is p(Y | X, W , φ, σ2 y, θ, α) = Z p(Y | Z, φ, σ2 y)p (Z | X, W , θ, α) dZ, (3) where Y = [y1, . . . , yN]T ∈RN×K, Z = [z1, . . . , zN]T ∈RN×L, W = [w1, . . . , wQ]T ∈ RQ×R, X = [x1, . . . , xP ]T ∈RP ×M. Additionally, φ denotes the parameters of g and θ the GP kernel parameters. 3 Figure 1: (a) Generative model underlying the proposed GPPVAE. (b) Pictorial representation of the inference procedure in GPPVAE. Each sample (here an image) is encoded in a low-dimensional space and then decoded to the original space. Covariances between samples are modeled through a GP prior on each column of the latent representation matrix Z. Gaussian Process Model. The GP prior defines the following multivariate normal distribution on latent representations: p (Z | X, W , θ, α) = L Y l=1 N zl | 0, Kθ(X, W ) + αIN  , (4) where zl denotes the l-th column of Z. In the setting considered in this paper, the covariance function Kθ is composed of a view kernel that models covariances between views, and an object kernel that models covariances between objects. Specifically, the covariance between sample n (with corresponding feature vectors xpn and wqn) and sample m (with corresponding feature vectors xpm and wqm) is given by the factorized form (Bonilla et al., 2007; Rakitsch et al., 2013): Kθ(X, W )nm = K(view) θ (wqn, wqm)K(object) θ (xpn, xpm). (5) Observed versus unobserved feature vectors Our model can be used when either one, or both of the view/sample feature vectors are unobserved. In this setting, we regard the unobserved features as latent variables and obtain a point estimate for them, similar to Gaussian process latent variable models (Lawrence, 2005). We have done so in our experiments. 3.2 Inference As with a standard VAE, we make use of variational inference for our model. Specifically, we consider the following variational distribution over the latent variables qψ(Z | Y ) = Y n N  zn | µz ψ(yn), diag(σz2 ψ(yn))  , (6) which approximates the true posterior on Z. In Eq. (6), µz ψ and σz ψ are the hyperparameters of the variational distribution and are neural network functions of the observed data, while ψ denotes the weights of such neural networks. We obtain the following evidence lower bound (ELBO): logp(Y | X, W , φ, σ2 y, θ) ≥ EZ∼qψ "X n log N(yn | gφ(zn), σ2 yIK) + logp (Z | X, W , θ, α) # + +1 2 X nl log(σz2 ψ(yn)l) + const. (7) 4 Stochastic backpropagation. We use stochastic backpropagation to maximize the ELBO (Kingma and Welling, 2013; Rezende et al., 2014). Specifically, we approximate the expectation by sampling from a reparameterized variational posterior over the latent representations, obtaining the following loss function: l φ, ψ, θ, α, σ2 y  = = NKlog σ2 y + X n yn −gφ(zψn) 2 2σ2y | {z } reconstruction term −logp (Zψ | X, W , θ, α) | {z } latent-space GP term + 1 2 X nl log(σz2 ψ(yn)l) | {z } regularization term , (8) which we optimize with respect to φ, ψ, θ, α, σ2 y. Latent representations Zψ =  zψ1, . . . , zψN  ∈ RN×L are sampled using the re-parameterization trick Kingma and Welling (2013), zψn = µz ψ(yn) + ϵn ⊙σz ψ(yn), ϵn ∼N(0, IL×L), n = 1, . . . , N, (9) where ⊙denotes the Hadamard product. Full details on the derivation of the loss can be found in Supplementary Information. Efficient GP computations. Naive computations in Gaussian processes scale cubically with the number of samples (Rasmussen, 2004). In this work, we achieve linear computations in the number of samples by assuming that the overall GP kernel is low-rank. In order to meet this assumption, we (i) exploit that in our setting the number of views, Q, is much lower than the number of samples, N, and (ii) impose a low-rank form for the object kernel (M ≪N). Briefly, as a result of these assumptions, the total covariance is the sum of a low-rank matrix and the identity matrix K = V V T + αI, where V ∈RN×H and H ≪N 1. For this covariance, computation of the inverse and the log determinant, which have cubic complexity for general covariances, can be recast to have complexity, O(NH2 + H3 + HNK) and O(NH2 + H3), respectively, using the Woodbury identity (Henderson and Searle, 1981) and the determinant lemma (Harville, 1997): K−1M = 1 αI −1 αV (αI + V T V )−1V T M, (10) log |K| = NL log α + log I + 1 αV T V , (11) where M ∈RN×K. Note a low-rank approximation of an arbitrary kernel can be obtained through the fully independent training conditional approximation (Snelson and Ghahramani, 2006), which makes the proposed inference scheme applicable in a general setting. Low-memory stochastic backpropagation. Owing to the coupling between samples from the GP prior, mini-batch gradient descent is no longer applicable. However, a naive implementation of full gradient descent is impractical as it requires loading the entire dataset into memory, which is infeasible with most image datasets. To overcome this limitation, we propose a new strategy to compute gradients on the whole dataset in a low-memory fashion. We do so by computing the first-order Taylor series expansion of the GP term of the loss with respect to both the latent encodings and the prior parameters, at each step of gradient descent. In doing so, we are able to use the following procedure: 1. Compute latent encodings from the high-dimensional data using the encoder. This step can be performed in data mini-batches, thereby imposing only low-memory requirements. 2. Compute the coefficients of the GP-term Taylor series expansion using the latent encodings. Although this step involves computations across all samples, these have low-memory requirements as they only involve the low-dimensional representations. 3. Compute a proxy loss by replacing the GP term by its first-order Taylor series expansion, which locally has the same gradient as the original loss. Since the Taylor series expansion is linear in the latent representations, gradients can be easily accumulated across data mini-batches, making this step also memory-efficient. 1 For example, if both the view and the object kernels are linear, we have V = [X:,1 ⊙W:,1, X:,1 ⊙W:,2, . . . , X:,M ⊙W:,Q] ∈RN×H. 5 4. Update the parameters using these accumulated gradients. Full details on this procedure are given in Supplementary Information. 3.3 Predictive posterior We derive an approximate predictive posterior for GPPVAE that enables out-of-sample predictions of high-dimensional samples. Specifically, given training samples Y , object feature vectors X, and view feature vectors W , the predictive posterior for image representation y⋆of object p⋆in view q⋆ is given by p(y⋆| x⋆, w⋆, Y , X, W ) ≈ Z p(y⋆| z⋆) | {z } decode GP prediction p(z⋆| x⋆, w⋆, Z, X, W ) | {z } latent-space GP predictive posterior q(Z | Y ) | {z } encode training data dz⋆dZ(12) where x⋆and w⋆are object and feature vectors of object p⋆and view q⋆respectively, and we dropped the dependency on parameters for notational compactness. The approximation in Eq. (12) is obtained by replacing the exact posterior on Z with the variational distribution q(Z | Y ) (see Supplementary Information for full details). From Eq. (12), the mean of the GPPVAE predictive posterior can be obtained by the following procedure: (i) encode training image data in the latent space through the encoder, (ii) predict latent representation z⋆of image y⋆using the GP predictive posterior, and (iii) decode latent representation z⋆to the high-dimensional image space through the decoder. 4 Experiments We focus on the task of making predictions of unseen images, given specified auxiliary information. Specifically, we want to predict the image representation of object p in view q when that object was never observed in that view, but assuming that object p was observed in at least one other view, and that view had been observed for at least one other object. For example, we may want to predict the pose of a person appearing in our training data set without having seen that person in that pose. To do so, we need to have observed that pose for other people. This prediction task gets at the heart of what we want our model to achieve, and therefore serves as a good evaluation metric. 4.1 Methods considered In addition to the GPPVAE presented (GPPVAE-joint), we also considered a version with a simpler optimization scheme (GPPVAE-dis). We also considered two extensions of the VAE that can be used for the task at hand. Specifically, we considered: • GPPVAE with joint optimization (GPPVAE-joint), where autoencoder and GP parameters were optimized jointly. We found that convergence was improved by first training the encoder and the decoder through standard VAE, then optimizing the GP parameters with fixed encoder and decoder for 100 epochs, and finally, optimizing all parameters jointly. Outof-sample predictions from GPPVAE-joint were obtained by using the predictive posterior in Eq. (12); • GPPVAE with disjoint optimization (GPPVAE-dis), where we first learned the encoder and decoder parameters through standard VAE, and then optimized the GP parameters with fixed encoder and decoder. Again, out-of-sample predictions were obtained by using the predictive posterior in Eq. (12); • Conditional VAE (CVAE) (Sohn et al., 2015), where view auxiliary information was provided as input to both the encoder and decoder networks (Figure S1, S2). After training, we considered the following procedure to generate an image of object p in view q. First, we computed latent representations of all the images of object p across all the views in the training data (in this setting, CVAE latent representations are supposedly independent from the view). Second, we averaged all the obtained latent representations to obtain a unique representation of object p. Finally, we fed the latent representation of object p together with out-of-sample view q to the CVAE decoder. As an alternative implementation, we also tried to consider the latent representation of a random image of object p instead of averaging, but the performance was worse–these results are not included; 6 • Linear Interpolation in VAE latent space (LIVAE), which uses linear interpolation between observed views of an object in the latent space learned through standard VAE in order to predict unobserved views of the same object. Specifically, denoting z1 and z2 as the latent representations of images of a given object in views r1 and r2, a prediction for the image of that same object in an intermediate view, r⋆, is obtained by first linearly interpolating between z1 and z2, and then projecting the interpolated latent representation to the high-dimensional image space. Consistent with the L2 reconstruction error appearing in the loss off all the aforementioned VAEs (e. g., Eq. (18)), we considered pixel-wise mean squared error (MSE) as the evaluation metric. We used the same architecture for encoder and decoder neural networks in all methods compared (see Figure S1, S2 in Supplementary Information). The architecture and σ2 y, were chosen to minimize the ELBO loss for the standard VAE on a validation set (Figure S3, Supplementary Information). For CVAE and LIVAE, we also considered the alternative strategy of selecting the value of σ2 y that maximizes out-of-sample prediction performance on the validation set (the results for these two methods are in Figure S4 and S5). All models were trained using the Adam optimizer (Kingma and Ba, 2014) with standard parameters and a learning rate of 0.001. When optimizing GP parameters with fixed encoder and decoder, we observed that higher learning rates led to faster convergence without any loss in performance, and thus we used a higher learning rate of 0.01 in this setting. 4.2 Rotated MNIST Setup. We considered a variation of the MNIST dataset, consisting of rotated images of handwritten "3" digits with different rotation angles. In this setup, objects correspond to different draws of the digit "3" while views correspond to different rotation states. View features are observed scalars, corresponding to the attached rotation angles. Conversely, object feature vectors are unobserved and learned from data—no draw-specific features are available. Dataset generation. We generated a dataset from 400 handwritten versions of the digit three by rotating through Q = 16 evenly separated rotation angles in [0, 2π), for a total of N = 6, 400 samples. We then kept 90% of the data for training and test, and the rest for validation. From the training and test sets, we then randomly removed 25% of the images to consider the scenario of incomplete data. Finally, the set that we used for out-of-sample predictions (test set) was created by removing one of the views (i. e., rotation angles) from the remaining images. This procedure resulted in 4, 050 training images spanning 15 rotation angles and 270 test images spanning one rotation angle. Autoencoder and GP model. We set the dimension of the latent space to L = 16. For encoder and decoder neural networks we considered the convolutional architecture in Figure S1. As view kernel, we considered a periodic squared exponential kernel taking rotation angles as inputs. As object kernel, we considered a linear kernel taking the object feature vectors as inputs. As object feature vectors are unobserved, we learned from data—their dimensionality was set to M = 8. The resulting composite kernel K, expresses the covariance between images n and m in terms of the corresponding rotations angles wqn and wqm and object feature vectors xpn and xpm as Kθ(X, w)nm = β exp  −2sin2|wqn −wqm| ν2  | {z } rotation kernel · xT pnxpm | {z } digit draw kernel , (13) where β ≥0 and ν ≥0 are kernel hyper-parameters learned during training of the model (Rasmussen, 2004), and we set θ = {β, ν}. Results. GPPVAE-joint and GPPVAE-dis yielded lower MSE than CVAE and LIVAE in the interpolation task, with GPPVAE-joint performing significantly better than GPPVAE-dis (0.0280 ± 0.0008 for GPVAE-joint vs 0.0306 ± 0.0009 for GPPVAE-dis, p < 0.02, Fig. 2a,b). Importantly, GPPVAE-joint learns different variational parameters than a standard VAE (Fig. 2c,d), used also by GPPVAE-dis, consistent with the fact that GPPVAE-joint performs better by adapting the VAE latent space using guidance from the prior. 7 Figure 2: Results from experiments on rotated MNIST. (a) Mean squared error on test set. Error bars represent standard error of per-sample MSE. (b) Empirical density of estimated means of qψ, aggregated over all latent dimensions. (c) Empirical density of estimated log variances of qψ. (d) Out-of-sample predictions for ten random draws of digit "3" at the out-of-sample rotation state. (e, f) Object and view covariances learned through GPPVAE-joint. 4.3 Face dataset Setup. As second application, we considered the Face-Place Database (3.0) (Righi et al., 2012), which contains images of people faces in different poses. In this setting, objects correspond to the person identities while views correspond to different poses. Both view and object feature vectors are unobserved and learned from data. The task is to predict images of people face in orientations that remained unobserved. Data. We considered 4,835 images from the Face-Place Database (3.0), which includes images of faces for 542 people shown across nine different poses (frontal and 90, 60, 45, 30 degrees left and right2). We randomly selected 80% of the data for training (n = 3, 868), 10% for validation (n = 484) and 10% for testing (n = 483). All images were rescaled to 128 × 128. Autoencoder and GP model. We set the dimension of the latent space to L = 256. For encoder and decoder neural networks we considered the convolutional architecture in Figure S2. We consider a full-rank covariance as a view covariance (only nine poses are present in the dataset) and a linear covariance for the object covariance (M = 64). Results. GPPVAE-jointand GPPVAE-disyielded lower MSE than CVAE and LIVAE (Fig. 2a,b). In contrast to the MNIST problem, the difference between GPPVAE-joint andGPPVAE-dis was not significant (0.0281 ± 0.0008 for GPPVAE-joint vs 0.0298 ± 0.0008 for GPPVAE-dis). Importantly, GPPVAE-joint was able to dissect people (object) and pose (view) covariances by learning people and pose kernel jointly (Fig. 2a,b). 5 Discussion We introduced GPPVAE, a generative model that incorporates a GP prior over the latent space. We also presented a low-memory and computationally efficient inference strategy for this model, which makes the model applicable to large high-dimensional datasets. GPPVAE outperforms natural baselines (CVAE and linear interpolations in the VAE latent space) when predicting out-of-sample test images of objects in specified views (e. g., pose of a face, rotation of a digit). Possible future 2 We could have used the pose angles as view feature scalar similar to the application in rotated MNIST, but purposely ignored these features to consider a more challenging setting were neither object and view features are observed. 8 Figure 3: Results from experiments on the face dataset. (a) Mean squared error on test set (b) Out-of-sample predictions of people faces in out-of-sample poses. (c, d) Object and view covariances learned through GPPVAE-joint. work includes augmenting the GPPVAE loss with a discriminator function, similar in spirit to a GAN (Goodfellow et al., 2014), or changing the loss to be perception-aware (Hou et al., 2017) (see results from preliminary experiments in Figure S6). Another extension is to consider approximations of the GP likelihood that fully factorize over data points (Hensman et al., 2013); this could further improve the scalability of our method. Code availability An implementation of GPPVAE is available at https://github.com/fpcasale/GPPVAE. Acknowledgments Stimulus images courtesy of Michael J. Tarr, Center for the Neural Basis of Cognition and Department of Psychology, Carnegie Mellon University, http:// www.tarrlab.org. Funding provided by NSF award 0339122. References Matthias Bauer, Mark van der Wilk, and Carl Edward Rasmussen. Understanding probabilistic sparse gaussian process approximations. In Advances in neural information processing systems, pages 1533–1541, 2016. Edwin V Bonilla, Felix V Agakov, and Christopher KI Williams. Kernel multi-task learning using task-specific features. In Artificial Intelligence and Statistics, pages 43–50, 2007. Francesco Paolo Casale, Barbara Rakitsch, Christoph Lippert, and Oliver Stegle. Efficient set tests for the genetic analysis of correlated traits. Nature methods, 12(8):755, 2015. 9 Francesco Paolo Casale, Danilo Horta, Barbara Rakitsch, and Oliver Stegle. Joint genetic analysis using variant sets reveals polygenic gene-context interactions. PLoS genetics, 13(4):e1006693, 2017. Xi Chen, Diederik P Kingma, Tim Salimans, Yan Duan, Prafulla Dhariwal, John Schulman, Ilya Sutskever, and Pieter Abbeel. Variational lossy autoencoder. arXiv preprint arXiv:1611.02731, 2016. Lehel Csató and Manfred Opper. Sparse on-line gaussian processes. Neural computation, 14(3): 641–668, 2002. Adrian V Dalca, Ramesh Sridharan, Mert R Sabuncu, and Polina Golland. Predictive modeling of anatomy with genetic and clinical data. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pages 519–526. Springer, 2015. Nicolas Durrande, David Ginsbourger, Olivier Roustant, and Laurent Carraro. Additive covariance kernels for high-dimensional gaussian process modeling. arXiv preprint arXiv:1111.6233, 2011. Yarin Gal, Mark Van Der Wilk, and Carl Edward Rasmussen. Distributed variational inference in sparse gaussian process regression and latent variable models. In Advances in Neural Information Processing Systems, pages 3257–3265, 2014. Mehmet Gönen and Ethem Alpaydın. Multiple kernel learning algorithms. Journal of machine learning research, 12(Jul):2211–2268, 2011. 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. David A Harville. Matrix algebra from a statistician’s perspective, volume 1. Springer, 1997. Harold V Henderson and Shayle R Searle. On deriving the inverse of a sum of matrices. Siam Review, 23(1):53–60, 1981. James Hensman, Nicolo Fusi, and Neil D Lawrence. Gaussian processes for big data. In Uncertainty in Artificial Intelligence, page 282. Citeseer, 2013. Matthew D Hoffman and Matthew J Johnson. Elbo surgery: yet another way to carve up the variational evidence lower bound. In Workshop in Advances in Approximate Bayesian Inference, NIPS, 2016. Xianxu Hou, Linlin Shen, Ke Sun, and Guoping Qiu. Deep feature consistent variational autoencoder. In Applications of Computer Vision (WACV), 2017 IEEE Winter Conference on, pages 1133–1141. IEEE, 2017. Zhuxi Jiang, Yin Zheng, Huachun Tan, Bangsheng Tang, and Hanning Zhou. Variational deep embedding: An unsupervised and generative approach to clustering. arXiv preprint arXiv:1611.05148, 2016. Matthew Johnson, David K Duvenaud, Alex Wiltschko, Ryan P Adams, and Sandeep R Datta. Composing graphical models with neural networks for structured representations and fast inference. In Advances in neural information processing systems, pages 2946–2954, 2016. Diederik P 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. Diederik P Kingma, Shakir Mohamed, Danilo Jimenez Rezende, and Max Welling. Semi-supervised learning with deep generative models. In Advances in Neural Information Processing Systems, pages 3581–3589, 2014. Diederik P Kingma, Tim Salimans, Rafal Jozefowicz, Xi Chen, Ilya Sutskever, and Max Welling. Improved variational inference with inverse autoregressive flow. In Advances in Neural Information Processing Systems, pages 4743–4751, 2016. 10 Tejas D Kulkarni, William F Whitney, Pushmeet Kohli, and Josh Tenenbaum. Deep convolutional inverse graphics network. In Advances in Neural Information Processing Systems, pages 2539– 2547, 2015. Neil Lawrence. Probabilistic non-linear principal component analysis with gaussian process latent variable models. Journal of machine learning research, 6(Nov):1783–1816, 2005. Yann LeCun, Yoshua Bengio, et al. Convolutional networks for images, speech, and time series. The handbook of brain theory and neural networks, 3361(10):1995, 1995. John Lonsdale, Jeffrey Thomas, Mike Salvatore, Rebecca Phillips, Edmund Lo, Saboor Shad, Richard Hasz, Gary Walters, Fernando Garcia, Nancy Young, et al. The genotype-tissue expression (gtex) project. Nature genetics, 45(6):580, 2013. 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. Eric Nalisnick, Lars Hertel, and Padhraic Smyth. Approximate inference for deep latent gaussian mixtures. In NIPS Workshop on Bayesian Deep Learning, volume 2, 2016. Gaurav Pandey and Ambedkar Dukkipati. Variational methods for conditional multimodal deep learning. In Neural Networks (IJCNN), 2017 International Joint Conference on, pages 308–315. IEEE, 2017. Joaquin Quiñonero-Candela and Carl Edward Rasmussen. A unifying view of sparse approximate gaussian process regression. Journal of Machine Learning Research, 6(Dec):1939–1959, 2005. Barbara Rakitsch, Christoph Lippert, Karsten Borgwardt, and Oliver Stegle. It is all in the noise: Efficient multi-task gaussian process inference with structured residuals. In Advances in neural information processing systems, pages 1466–1474, 2013. Rajesh Ranganath, Dustin Tran, and David Blei. Hierarchical variational models. In International Conference on Machine Learning, pages 324–333, 2016. Carl Edward Rasmussen. Gaussian processes in machine learning. In Advanced lectures on machine learning, pages 63–71. Springer, 2004. Danilo Jimenez Rezende and Shakir Mohamed. Variational inference with normalizing flows. arXiv preprint arXiv:1505.05770, 2015. Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. arXiv preprint arXiv:1401.4082, 2014. Giulia Righi, Jessie J Peissig, and Michael J Tarr. Recognizing disguised faces. Visual Cognition, 20 (2):143–169, 2012. Rui Shu, James Brofos, Frank Zhang, Hung Hai Bui, Mohammad Ghavamzadeh, and Mykel Kochenderfer. Stochastic video prediction with conditional density estimation. In ECCV Workshop on Action and Anticipation for Visual Learning, volume 2, 2016. N Siddharth, Brooks Paige, Alban Desmaison, Van de Meent, Frank Wood, Noah D Goodman, Pushmeet Kohli, Philip HS Torr, et al. Inducing interpretable representations with variational autoencoders. arXiv preprint arXiv:1611.07492, 2016. N Siddharth, Brooks Paige, Jan-Willem Van de Meent, Alban Desmaison, Frank Wood, Noah D Goodman, Pushmeet Kohli, and Philip HS Torr. Learning disentangled representations with semi-supervised deep generative models. ArXiv e-prints (Jun 2017), 2017. Edward Snelson and Zoubin Ghahramani. Sparse gaussian processes using pseudo-inputs. In Advances in neural information processing systems, pages 1257–1264, 2006. Kihyuk Sohn, Honglak Lee, and Xinchen Yan. Learning structured output representation using deep conditional generative models. In Advances in Neural Information Processing Systems, pages 3483–3491, 2015. 11 Oliver Stegle, Christoph Lippert, Joris M Mooij, Neil D Lawrence, and Karsten M Borgwardt. Efficient inference in matrix-variate gaussian models with\iid observation noise. In Advances in neural information processing systems, pages 630–638, 2011. Masahiro Suzuki, Kotaro Nakayama, and Yutaka Matsuo. Joint multimodal learning with deep generative models. arXiv preprint arXiv:1611.01891, 2016. Michalis Titsias. Variational learning of inducing variables in sparse gaussian processes. In Artificial Intelligence and Statistics, pages 567–574, 2009. Jakub M Tomczak and Max Welling. Vae with a vampprior. arXiv preprint arXiv:1705.07120, 2017. Dustin Tran, Rajesh Ranganath, and David M Blei. The variational gaussian process. arXiv preprint arXiv:1511.06499, 2015. Ramakrishna Vedantam, Ian Fischer, Jonathan Huang, and Kevin Murphy. Generative models of visually grounded imagination. arXiv preprint arXiv:1705.10762, 2017. Weiran Wang, Xinchen Yan, Honglak Lee, and Karen Livescu. Deep variational canonical correlation analysis. arXiv preprint arXiv:1610.03454, 2016. Andrew Wilson and Ryan Adams. Gaussian process kernels for pattern discovery and extrapolation. In International Conference on Machine Learning, pages 1067–1075, 2013. Andrew Gordon Wilson, Zhiting Hu, Ruslan Salakhutdinov, and Eric P Xing. Deep kernel learning. In Artificial Intelligence and Statistics, pages 370–378, 2016. Mike Wu and Noah Goodman. Multimodal generative models for scalable weakly-supervised learning. arXiv preprint arXiv:1802.05335, 2018. 12
2018
128
7,284
Deep Predictive Coding Network with Local Recurrent Processing for Object Recognition Kuan Han1,3, Haiguang Wen1,3, Yizhen Zhang1,3, Di Fu1,3, Eugenio Culurciello1,2, Zhongming Liu1,2,3∗ 1School of Electrical and Computer Engineering, Purdue University 2Weldon School of Biomedical Engineering, Purdue University 3Purdue Institute for Integrative Neuroscience, Purdue University Abstract Inspired by "predictive coding" - a theory in neuroscience, we develop a bidirectional and dynamic neural network with local recurrent processing, namely predictive coding network (PCN). Unlike feedforward-only convolutional neural networks, PCN includes both feedback connections, which carry top-down predictions, and feedforward connections, which carry bottom-up errors of prediction. Feedback and feedforward connections enable adjacent layers to interact locally and recurrently to refine representations towards minimization of layer-wise prediction errors. When unfolded over time, the recurrent processing gives rise to an increasingly deeper hierarchy of non-linear transformation, allowing a shallow network to dynamically extend itself into an arbitrarily deep network. We train and test PCN for image classification with SVHN, CIFAR and ImageNet datasets. Despite notably fewer layers and parameters, PCN achieves competitive performance compared to classical and state-of-the-art models. Further analysis shows that the internal representations in PCN converge over time and yield increasingly better accuracy in object recognition. Errors of top-down prediction also reveal visual saliency or bottom-up attention. 1 Introduction Modern computer vision is mostly based on feedforward convolutional neural networks (CNNs) [18, 33, 50]. To achieve better performance, CNN models tend to use an increasing number of layers [19, 24, 50, 59], while sometimes adding "short-cuts" to bypass layers [19, 56]. What motivates such design choices is the notion that models should learn a deep hierarchy of representations to perform complex tasks in vision [50, 59]. This notion generally agrees with the brain’s hierarchical organization [31, 62, 67, 16]: visual areas are connected in series to enable a cascade of neural processing [60]. If one layer in a model is analogous to one area in the visual cortex, the state-of-theart CNNs are considerably deeper (with 50 to 1000 layers) [20, 18] than the visual cortex (with 10 to 20 areas) . As we look to the brain for more inspiration, it is noteworthy that biological neural networks support robust and efficient intelligence for a wide range of tasks without any need to grow their depth or width [37]. What distinguishes the brain from CNNs is the presence of abundant feedback connections that link a feedforward series of brain areas in reverse order [11]. Given both feedforward and feedback connections, information passes not only bottom-up but also top-down, and interacts with one another to update the internal states over time. The interplay between feedforward and feedback connections ∗Correspondence to: Zhongming Liu <zmliu@purdue.edu> 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. has been thought to subserve the so-called "predictive coding" [44, 14, 52, 25, 12] - a neuroscience theory that becomes popular. It says that feedback connections from a higher layer carry the prediction of its lower-layer representation, while feedforward connections in turn carry the error of prediction upward to the higher layer. Repeating such bi-directional interactions across layers renders the visual system a dynamic and recurrent neural network [1, 12]. Such a notion can also apply to artificial neural networks. As recurrent processing unfolds in time, a static network architecture is used over and over to apply increasingly more non-linear operations to the input, as if the input were computed through more and more layers stacked onto an increasingly deeper feedforward network [37]. In other words, running computation through a bi-directional network for a longer time may give rise to an effectively deeper network to approximate a complex and nonlinear transformation from pixels to concepts [37, 6], which is potentially how brain solves invariant object recognition without the need to grow its depth. Inspired by the theory of predictive coding, we propose a bi-directional and dynamical network, namely Deep Predictive Coding Network (PCN), to run a cascade of local recurrent processing [30, 5, 43] for object recognition. PCN combines predictive coding and local recurrent processing into an iterative inference algorithm. When tested for image classification with benchmark datasets (CIFAR-10, CIFAR-100, SVHN and ImageNet), PCN uses notably fewer layers and parameters to achieve competitive performance relative to classical or state-of-the-art models. Further behavioral analysis of PCN sheds light on its computational mechanism and potential use for mapping visual saliency or bottom-up attention. 2 Related Work Predictive Coding In the brain, connections between cortical areas are mostly reciprocal [11]. Rao and Ballard suggest that bi-directional connections subserve "predictive coding" [44]: feedback connections from a higher cortical area carry neural predictions to the lower cortical area, while the feedforward connections carry the unpredictable information (or error of prediction) to the higher area to correct the neuronal states throughout the hierarchy. With supporting evidence from empirical studies [1, 52, 28], this mechanism enables iterative inference for perception[44] and unsupervised learning[53], incorporates modern neural networks for classification [54] and video prediction [39], and likely represents a unified theory of the brain[12, 25]. Predictive Coding Network with Global Recurrent Processing Driven by the predictive coding theory, a bi-directional and recurrent neural network has been proposed in [63]. It runs global recurrent processing by alternating a bottom-up cascade of feedforward computation and a top-down cascade of feedback computation. For each cycle of recurrent dynamics, the feedback prediction starts from the top layer and propagates layer by layer until the bottom layer; then, the feedforward error starts from the bottom layer and propagates layer by layer until the top layer. The model described herein is similar, but uses local recurrent processing, instead of global recurrent processing. Only for the convenience of notation in this paper, we refer to the proposed PCN with local recurrent processing simply as "PCN", while referring to the model in [63] explicitly as "PCN with global recurrent processing". Local Recurrent Processing In the brain, feedforward-only processing plays a central role in rapid object recognition[47, 9]. Although less understood, feedback connections are thought to convey top-down attention [4, 3] or prediction [12, 44, 52]. Evidence also suggests that feedback signals may operate between hierarchically adjacent areas along the ventral stream [30, 5, 43] to enable local recurrent processing for object recognition [65, 2], especially given ambiguous or degraded visual input [64, 51]. Therefore, feedback processes may be an integral part of both global and local recurrent processing underlying top-down attention in a slower time scale and visual recognition in a faster time scale. 3 Predictive Coding Network Herein, we design a bi-directional (feedforward and feedback) neural network that runs local recurrent processing between neighboring layers, and we refer to this network as Predictive Coding Network (PCN). As illustrated in Fig. 1, PCN is a stack of recurrent blocks, each running dynamic and recurrent processing within itself through feedforward and feedback connections. Feedback connections are 2 Figure 1: Architecture of CNN vs. PCN (a) The plain model (left) is a feedforward CNN with 3×3 convolutional connections (solid arrows) and 1×1 bypass connections (dashed arrows). On the basis of the plain model, the local PCN (right) uses additional feedback (solid arrows) and recurrent (circular arrows) connections. The feedforward, feedback and bypass connections are constructed as convolutions, while the recurrent connections are constructed as identity mappings (b) The PCN consists of a stack of basic building blocks. Each block runs multiple cycles of local recurrent processing between adjacent layers, and merges its input to its output through the bypass connections. The output from one block is then sent to its next block to initiate local recurrent processing in a higher block. It continues until reaching the top of the network. used to predict lower-layer representations. In turn, feedforward connections send the error of prediction to update the higher-layer representations. After repeating this processing for multiple cycles within a given block, the lower-layer representation is merged to the higher-layer representation through a bypass connection. The merged representation is further sent as the input to the next recurrent block to start another series of recurrent processing in a higher level. After the local recurrent processing continues through all recurrent blocks in series, the emerging top-level representations are used for image classification. In the following mathematical descriptions, we use italic letters as symbols for scalars, bold lowercase letters for column vectors and bold uppercase letters for matrices. We use T to denote the number of recurrent cycles, rl(t) to denote the representation of layer l at time t, Wl−1,l to denote the feedforward weights from layer l −1 to layer l, Wl,l−1 to denote the feedback weights from layer l to layer l −1 and W bp l−1,l to denote the weights of bypass connections. 3.1 Local Recurrent Processing in PCN Within each recurrent block (e.g. between layer l −1 and layer l), the local recurrent processing serves to reduce the error of prediction. As in Eq. (1), the higher-layer representation rl(t) generates a prediction, pl−1(t), of the lower-layer representation, rl−1, through feedback connections, Wl,l−1, yielding an error of prediction el−1(t) as Eq. (2). pl−1(t) = (Wl,l−1)T rl(t) (1) el−1(t) = rl−1 −pl−1(t) (2) The objective of recurrent processing is to reduce the sum of the squared prediction error (Eq. (3)) by updating the higher-layer representation, rl(t), with an gradient descent algorithm [55]. In each cycle of recurrent processing, rl(t) is updated along the direction opposite to the gradient (Eq. (4)) with an 3 incremental size proportional to an update rate, αl. As rl(t) is updated over time as Eq. (5), it tends to converge while the gross error of prediction tends to decrease. Note that Eq. (6) is equivalent to Eq. (5), if the feedback weights are tied to be the transpose of the feedforward weights. Eq. (6) is useful even without this assumption as shown in a prior study [63], and it is thus used in this study instead of Eq. (5). Ll−1(t) = 1 2 ∥rl−1 −pl−1(t) ∥2 2 (3) ∂Ll−1(t) ∂rl(t) = −Wl,l−1el−1(t) (4) rl(t + 1) = rl(t) −αl ∂Ll−1(t) ∂rl(t) = rl(t) + αlWl,l−1el−1(t) (5) rl(t + 1) = rl(t) + αl(Wl−1,l)T el−1(t) (6) 3.2 Network Architecture We implement PCN with some architectural features common to modern CNNs. Specifically, feedforward and feedback connections are implemented as regular convolutions and transposed convolutions [10], respectively, with a kernel size of 3. Bypass convolutions are implemented as 1 × 1 convolution. Batch normalization (BN) [26] is applied to the input to each recurrent block. During the recurrent processing between layer l −1 and layer l, rectified linear units (ReLU) [41] are applied to the initial output rl(0) at t = 0 and the prediction error at each time step el−1(t), as expressed by Eq. (7) and Eq. (8), respectively. ReLU renders the local recurrent processing an increasingly non-linear operation as the processing continues over time. rl(0) = ReLU W T l−1,lrl−1  (7) el−1(t) = ReLU (rl−1 −pl−1(t)) (8) Besides, a 2 × 2 max-pooling with a stride of 2 is optionally applied to the output from every 2 (or 3) blocks. On top of the highest recurrent block is a classifier, including a global average pooling, a fully-connected layer, followed by softmax. For comparison, we also design the feedforward-only counterpart of PCN and refer to it as the "plain" model. It includes the same feedforward and bypass connections and uses the same classification layer as in PCN, but excludes any feedback connection or recurrent processing. The architecture of the plain model is similar to that of Inception CNN [59]. Algorithm 1 Predictive Coding Network with local recurrent processing. Input: The input image r0; 1: for l = 1 to L do 2: rBN l−1 = BatchNorm(rl−1); 3: rl(0) = ReLU FFConv rBN l−1  ; 4: for t = 1 to T do 5: pl−1(t) = FBConv (rl(t −1)); 6: el−1(t) = ReLU (rl−1 −pl−1(t)); 7: rl(t) = rl(t −1) + αlFFconv (el−1(t)); 8: end for 9: rl = rl(T) + BPConv rBN l−1  ; 10: end for 11: return rL for classification; 12: ▷FFConv represents the feedforward convolution, FBConv represents the feedback convolution and BPConv represents the bypass convolution. Our implementation is described in Algorithm 1. Note that the update rate αl used for local recurrent processing is a learnable and non-negative parameter separately defined for each filter in each recurrent block. The number of cycles of recurrent processing - an important parameter in PCN, is varied to be T = 1, ..., 5. For both PCN and its CNN counterpart (i.e. T=0), we design multiple 4 architectures (labeled as A through E) suitable for different benchmark datasets (SVHN, CIFAR and ImageNet), as summarized in Table 1. For example, PCN-A-5 stands for a PCN with architecture A and 5 cycles of local recurrent processing. Table 1: Architectures of PCN. Each column shows a model. We use PcConv to represent a predictive coding layer, with its parameters denoted as "PcConv<kernel size>-<number of channels in feedback convolutions>-<number of channels in feedforward convolutions>". The first layer in PCN-E is a regular convolution with a kernel size of 7, a padding of 3, a stride of 2 and 64 output channels. "*" indicates the layer applying maxpooling to its output. Feature maps in one grid have the same size. PCN Configuration Dataset SVHN CIFAR ImageNet Architecture A B C D E #Layers 7 9 13 Image Size 32 × 32 224 × 224 Layers PcConv3-3-16 PcConv3-3-16 PcConv3-3-64 PcConv3-3-64 Conv7-64 PcConv3-16-16 PcConv3-16-32 PcConv3-64-64 PcConv3-64-64 PcConv3-64-64 PcConv3-16-32* PcConv3-32-64* PcConv3-64-128* PcConv3-64-128* PcConv3-64-128* PcConv3-32-32 PcConv3-64-64 PcConv3-128-128 PcConv3-128-128 PcConv3-128-128 PcConv3-32-64* PcConv3-64-128* PcConv3-128-256* PcConv3-128-256* PcConv3-128-128* PcConv3-64-64 PcConv3-128-128 PcConv3-256-256 PcConv3-256-256 PcConv3-128-128 PcConv3-256-256 PcConv3-256-512 PcConv3-128-256* PcConv3-256-256 PcConv3-512-512 PcConv3-256-256 PcConv3-256-256 PcConv3-256-512* PcConv3-512-512 PcConv3-512-512 Calssification global average pooling, FC-10/100/1000, softmax #Params 0.15M 0.61M 4.91M 9.90M 17.26M 4 Experiments We train PCN with local recurrent processing and its corresponding plain model for object recognition with the following datasets, and compare their performance with classical or state-of-the-art models. 4.1 Datasets CIFAR The CIFAR-10 and CIFAR-100 datasets [32] consist of 32×32 color images drawn from 10 and 100 categories, respectively. Both datasets contain 50,000 training images and 10,000 testing images. For preprocessing, all images are normalized by channel means and standard derivations. For data augmentation, we use a standard scheme (flip/translation) as suggested by previous works [19, 23, 38, 45, 24]. SVHN The Street View House Numbers (SVHN) dataset [42] consists of 32×32 color images. There are 73,257 images in the training set, 26,032 images in the test set and 531,131 images for extra training. Following the common practice [23, 38], we train the model with the training and extra sets and tested the model with the test set. No data augmentation is introduced and we use the same pre-processing scheme as in CIFAR. ImageNet The ILSVRC-2012 dataset [7] consists of 1.28 million training images and 50k validation images, drawn from 1000 categories. Following [19, 20, 59], we use the standard data augmentation scheme for the training set: a 224×224 crop is randomly sampled from either the original image or its horizontal flip. For testing, we apply a single crop or ten crops with size 224×224 on the validation set and the top-1 or top-5 classification error is reported. 4.2 Training Both PCN and (plain) CNN models are trained with stochastic gradient descent (SGD). On CIFAR and SVHN datasets, we use 128 batch-size and 0.01 initial learning rate for 300 and 40 epochs, respectively. The learning rate is divided by 10 at 50%, 75% and 87.5% of the total number of training epochs. Besides, we use a Nesterov momentum of 0.9 and a weight decay of 1e-3, which is determined by a 45k/5k split on the CIFAR-100 training set. On ImageNet, we follow the most common practice [19, 66] and use a initial learning rate of 0.01, a momentum of 0.9, a weight decay 5 Table 2: Error rates (%) on CIFAR datasets. #L and #P are the number of layers and parameters, respectively. Type Model #L #P C-10 C-100 HighwayNet [56] 19 2.3M 7.72 32.39 FractalNet [34] 21 38.6M 5.22 23.30 FeedResNet [19] 110 1.7M 6.41 27.22 Forward ResNet [20] 164 1.7M 5.23 24.58 Models (Pre-act) 1001 10.2M 4.62 22.71 WRN [69] 28 36.5M 4.00 19.25 DenseNet 100 0.8M 4.51 22.27 BC [24] 190 25.6M 3.46 17.18 RCNN [36] 160 1.86M 7.09 31.75 DasNet [58] 9.22 33.78 FeedbackNet [70] 12 28.88 Recurrent CliqueNet 18 10.14M 5.06 23.14 Models [68] 30 10.02M 5.06 21.83 PCN with 7 0.57M 7.60 31.69 Global Recurrent 9 1.16M 7.20 30.66 Processing [63] 9 4.65M 6.17 27.42 PCN PCN-C-1 9 4.91M 5.70 24.01 PCN-C-2 9 4.91M 5.38 22.89 PCN-C-5 9 4.91M 5.10 22.43 PCN-D-1 9 9.90M 5.73 23.78 PCN-D-2 9 9.90M 5.39 22.75 PCN-D-5 9 9.90M 4.89 21.77 Plain Plain-C 9 2.59M 5.68 25.65 Models Plain-D 9 5.21M 5.61 25.31 Table 3: Error rates (%) on SVHN. #L and #P are the number of layers and parameters, respectively. Model #L #P SVHN MaxOut [15] 2.47 NIN [38] 2.35 DropConnect [61] 1.94 DSN [35] 1.92 RCNN [36] 6 2.67M 1.77 FitNet [45] 13 1.5M 2.42 WRN [69] 16 11M 1.54 PCN (Global) 7 0.14M 2.42 [63] 7 0.57M 2.42 PCN-A-1 7 0.15M 2.29 PCN-A-2 7 0.15M 2.22 PCN-A-5 7 0.15M 2.07 PCN-B-1 7 0.61M 1.99 PCN-B-2 7 0.61M 1.97 PCN-B-5 7 0.61M 1.96 Plain-A 7 0.08M 2.85 Plain-B 7 0.32M 2.43 of 1e-4, 100 epochs with the learning rate dropped by 0.1 at epochs 30, 60 & 90. The batch size is 256 for PCN-E-0/1/2, 128 for PCN-E-3/4, 115 for PCN-E-5 due to limited computational resource. 4.3 Evaluating the Behavior of PCN To understand how the model works, we further examine how local recurrent processing changes the internal representations of PCN. For this purpose, we focus on testing PCN-D-5 with CIFAR-100. Converging representation? Since local recurrent processing is governed by predictive coding, it is anticipated that the error of prediction tends to decrease over time. To confirm this expectation, the L2 norm of the prediction error is calculated for each layer and each cycle of recurrent processing and averaged across all testing examples in CIFAR-100. This analysis reveals the temporal behavior of recurrently refined internal representations. What does the prediction error mean? Since the error of prediction drives the recurrent update of internal representations, we exam the spatial distribution of the error signal (after the final cycle) first for each layer and then average the error distributions across all layers by rescaling them to the same size. The resulting error distribution is used as a spatial pattern in the input space, and it is applied to the input image as a weighted mask to visualize its selectivity. Does predictive coding help image classification? The goal of predictive coding is to reduce the error of top-down prediction, seemingly independent of the objective of categorization that the PCN model is trained for. As recurrent processing progressively updates layer-wise representation, does each update also subserve the purpose of categorization? As in [27], the loss of categorization, as a nonlinear function of layer-wise representation L(rl(t)), shows its Taylor’s expansion as Eq. (9), where ∆rl(t) = rl(t + 1) −rl(t) is the incremental update of rl at time t. L(rl(t + 1)) −L(rl(t)) = ∆rl(t) · ∂L(rl(t)) ∂rl(t) + O(∆rl(t)2) (9) If each update tends to reduce the categorization loss, it should satisfy ∆rl(t) · ∂L(rl(t)) ∂rl(t) < 0, or the "cosine distance" between ∆rl(t) and ∂L(rl(t)) ∂rl(t) should be negative. Here O(·) is ignored as suggested by [27], since the incremental part becomes minor because of the convergent representation in PCN. We test this by calculating the cosine distance for each cycle of recurrent processing in each layer, and then averaging the results across all testing images in CIFAR-100. 6 Table 4: Error rates (%) on ImageNet. Model #Layers #Params Single-Crop 10-crop top-1 top-5 top-1 top-5 ResNet-18 18 11.69M 30.24 10.92 28.15 9.40 ResNet-34 34 21.80M 26.69 8.58 24.73 7.46 ResNet-50 50 25.56M 23.87 7.14 22.57 6.24 PCN-E-5 13 17.26M 25.31 7.79 23.52 6.64 PCN-E-3 25.36 7.78 23.62 6.69 Plain-E 13 9.34M 31.15 11.27 28.82 9.79 Figure 2: PCN shows better categorization performance given more cycles of recurrent processing, for CIFAR-10, CIFAR-100 and ImageNet. The red dash line represents the accuracy of the plain model. 4.4 Experimental results Classification performance On CIFAR and SVHN datasets, PCN always outperforms its corresponding CNN counterpart (Table 2 and 3). On CIFAR-100, PCN-D-5 reduces the error rate by 3.54% relative to Plain-D. The performance of PCN is also better than those of the ResNet family [19, 20], although PCN is much shallower with only 9 layers whereas ResNet may use as many as 1001 layers. Although PCN under-performs WRN [69] and DenseNet-190 [24] by 2-4%, it uses a much shallower architecture with many fewer parameters. On SVHN, PCN shows competitive performance despite fewer layers and parameters. On ImageNet, PCN also performs better than its plain counterpart. With 5 cycles of local recurrent processing (i.e. PCN-E-5), PCN slightly under-performs ResNet-50 but outperforms ResNet-34, while using fewer layers and parameters than both of them. Therefore, the classification performance of PCN compares favorably with other state-of-the-art models especially in terms of the performance-to-layer ratio. Recurrent Cycles The classification performance generally improves as the number of cycles of local recurrent processing increases for both CIFAR and ImageNet datasets, and especially for ImageNet (Fig. 2). It is worth noting that this gain in performance is achieved without increasing the number of layers or parameters, but by simply running computation for longer time on the same network. Local vs. Global Recurrent Processing The PCN with local recurrent processing (proposed in this paper) performs better than the PCN with global recurrent processing (proposed in our earlier paper [63]. Table 2 shows that PCN with local recurrent processing reduces the error rate by 5% on CIFAR-100 compared to PCN with the same architecture but global recurrent processing. In addition, local recurrent processing also requires less computational resource for both training and inference. 4.5 Behavioral Analysis To understand how/why PCN works, we further examine how local recurrent processing changes its internal representations and whether the change helps categorization. Behavioral analysis reveals some intriguing findings. As expected for predictive coding, local recurrent processing progressively reduces the error of top-down prediction for all layers, except the top layer on which image classification is based (Fig. 7 Figure 3: Behavioral analysis of PCN. (a) Errors of prediction tend to converge over repeated cycles of recurrent processing. The norm of the prediction error is shown for each layer and each cycle of local recurrent processing. (b) Errors of prediction reveal visual saliency. Given an input image (left), the spatial distribution of the error averaged across layers (middle) shows visual saliency or bottom-up attention, highlighting the part of the input with defining features (right). (3) The averaged cosine loss between ∆rl(t) and ∂L(rl(t)) ∂rl(t) . 3a). This finding implies that the internal representations converge to a stable state by local recurrent processing. Interestingly, the spatial distribution of the prediction error (averaged across all layers) highlights the apparently most salient part of the input image, and/or the most discriminative visual information for object recognition (Fig. 3b). The recurrent update of layer-wise representation tends to align along the negative gradient of the categorization loss with respective to the corresponding representation (Fig. 3c). From a different perspective, this finding lends support to an intriguing implication that predictive coding facilitates object recognition, which is somewhat surprising because predictive coding, as a computational principle, herein only explicitly reduces the error of topdown prediction without having any explicit role that favors inference or learning towards object categorization. 5 Discussion and Conclusion In this study, we advocate further synergy between neuroscience and artificial intelligence. Complementary to engineering innovation in computing and optimization, the brain must possess additional mechanisms to enable generalizable, continuous, and efficient learning and inference. Here, we highlight the fact that the brain runs recurrent processing with lateral and feedback connections under 8 predictive coding, instead of feedforward-only processing. While our focus is on object recognition, the PCN architecture can potentially be generalized to other computer vision tasks (e.g. object detection, semantic segmentation and image caption) [13, 22, 40], or subserve new computational models that can encode [62, 16, 29, 49] or decode [46, 17, 48, 57] brain activities. PCN with local recurrent processing outperforms its counterpart with global recurrent processing, which is not surprising because global feedback pathways might be necessary for top-down attention [4, 3], but may not be necessary for core object recognition [9] itself. By modeling different mechanisms, we support the notion that local recurrent processing is necessary for the initial feedforward process for object recognition. This study leads us to rethink about the models for classification beyond feedforward-only networks. One interesting idea is to evaluate the equivalence between ResNets and recurrent neural networks (RNN). Deep residual networks with shared weights can be strictly reformulated as a shallow RNN [37]. Regular ResNets can be reformulated as time-variant RNNs [37], and their representations are iteratively refined along the stacked residual blocks [27]. Similarly, DenseNet has been shown as a generalized form of higher order recurrent neural network (HORNN) [6]. The results in this study are in line with such notions: a dynamic and bi-directional network can refine its representations across time, leading to convergent representations to support object recognition. On the other hand, PCN is not contradictory to existing feedforward models, because the PCN block itself is integrated with a Inception-type CNN module. We expect that other network modules are applicable to further improve PCN performance, including cutout regularization [8], dropout layer [21], residual learning [19] and dense connectivities [24]. Although not explicitly trained, error signals of PCN can be used to predict saliency in images, suggesting that other computer vision tasks [13, 22, 40] could benefit from the diverse feature representations (e.g. error, prediction and state signals) in PCN. The PCN with local recurrent processing described herein has the following advantages over feedforward CNNs or other dynamic or recurrent models, including a similar PCN with global recurrent processing [63]. 1) It can achieve competitive performance in image classification with a shallow network and fewer parameters. 2) Its internal representations converge as recurrent processing proceeds over time, suggesting a self-organized mechanism towards stability [12]. 3) It reveals visual saliency or bottom-up attention while performing object recognition. However, its disadvantages are 1) the longer time of computation than plain networks (with the same number of layers) and 2) the sequentially executed recurrent processing, both of which should be improved or addressed in future studies. Acknowledgement The research was supported by NIH R01MH104402 and the College of Engineering at Purdue University. References [1] Andre M Bastos, W Martin Usrey, Rick A Adams, George R Mangun, Pascal Fries, and Karl J Friston. Canonical microcircuits for predictive coding. Neuron, 76(4):695–711, 2012. [2] CN Boehler, MA Schoenfeld, H-J Heinze, and J-M Hopf. Rapid recurrent processing gates awareness in primary visual cortex. Proceedings of the National Academy of Sciences, 105(25): 8742–8747, 2008. [3] Steven L Bressler, Wei Tang, Chad M Sylvester, Gordon L Shulman, and Maurizio Corbetta. Top-down control of human visual cortex by frontal and parietal cortex in anticipatory visual spatial attention. Journal of Neuroscience, 28(40):10056–10061, 2008. [4] Elizabeth A Buffalo, Pascal Fries, Rogier Landman, Hualou Liang, and Robert Desimone. A backward progression of attentional effects in the ventral stream. Proceedings of the National Academy of Sciences, 107(1):361–365, 2010. [5] Joan A Camprodon, Ehud Zohary, Verena Brodbeck, and Alvaro Pascual-Leone. Two phases of v1 activity for visual recognition of natural images. Journal of cognitive neuroscience, 22(6): 1262–1269, 2010. 9 [6] Yunpeng Chen, Jianan Li, Huaxin Xiao, Xiaojie Jin, Shuicheng Yan, and Jiashi Feng. Dual path networks. In Advances in Neural Information Processing Systems, pages 4470–4478, 2017. [7] 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, 2009. CVPR 2009. IEEE Conference on, pages 248–255. IEEE, 2009. [8] Terrance DeVries and Graham W Taylor. Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552, 2017. [9] James J DiCarlo, Davide Zoccolan, and Nicole C Rust. How does the brain solve visual object recognition? Neuron, 73(3):415–434, 2012. [10] Vincent Dumoulin and Francesco Visin. A guide to convolution arithmetic for deep learning. arXiv preprint arXiv:1603.07285, 2016. [11] Daniel J Felleman and DC Essen Van. Distributed hierarchical processing in the primate cerebral cortex. Cerebral cortex (New York, NY: 1991), 1(1):1–47, 1991. [12] Karl Friston. The free-energy principle: a unified brain theory? Nature Reviews Neuroscience, 11(2):127, 2010. [13] Alberto Garcia-Garcia, Sergio Orts-Escolano, Sergiu Oprea, Victor Villena-Martinez, and Jose Garcia-Rodriguez. A review on deep learning techniques applied to semantic segmentation. arXiv preprint arXiv:1704.06857, 2017. [14] Dileep George and Jeff Hawkins. Towards a mathematical theory of cortical micro-circuits. PLoS computational biology, 5(10):e1000532, 2009. [15] Ian J Goodfellow, David Warde-Farley, Mehdi Mirza, Aaron Courville, and Yoshua Bengio. Maxout networks. arXiv preprint arXiv:1302.4389, 2013. [16] Umut Güçlü and Marcel AJ van Gerven. Deep neural networks reveal a gradient in the complexity of neural representations across the ventral stream. Journal of Neuroscience, 35 (27):10005–10014, 2015. [17] Kuan Han, Haiguang Wen, Junxing Shi, Kun-Han Lu, Yizhen Zhang, and Zhongming Liu. Variational autoencoder: An unsupervised model for modeling and decoding fmri activity in visual cortex. bioRxiv, page 214247, 2017. [18] Kaiming He and Jian Sun. Convolutional neural networks at constrained time cost. In Computer Vision and Pattern Recognition (CVPR), 2015 IEEE Conference on, pages 5353–5360. IEEE, 2015. [19] 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. [20] 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. [21] Geoffrey E Hinton, Nitish Srivastava, Alex Krizhevsky, Ilya Sutskever, and Ruslan R Salakhutdinov. Improving neural networks by preventing co-adaptation of feature detectors. arXiv preprint arXiv:1207.0580, 2012. [22] Shin Hoo-Chang, Holger R Roth, Mingchen Gao, Le Lu, Ziyue Xu, Isabella Nogues, Jianhua Yao, Daniel Mollura, and Ronald M Summers. Deep convolutional neural networks for computer-aided detection: Cnn architectures, dataset characteristics and transfer learning. IEEE transactions on medical imaging, 35(5):1285, 2016. [23] Gao Huang, Yu Sun, Zhuang Liu, Daniel Sedra, and Kilian Q Weinberger. Deep networks with stochastic depth. In European Conference on Computer Vision, pages 646–661. Springer, 2016. 10 [24] Gao Huang, Zhuang Liu, Kilian Q Weinberger, and Laurens van der Maaten. Densely connected convolutional networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, volume 1, page 3, 2017. [25] Yanping Huang and Rajesh PN Rao. Predictive coding. Wiley Interdisciplinary Reviews: Cognitive Science, 2(5):580–593, 2011. [26] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015. [27] Stanisław Jastrzebski, Devansh Arpit, Nicolas Ballas, Vikas Verma, Tong Che, and Yoshua Bengio. Residual connections encourage iterative inference. arXiv preprint arXiv:1710.04773, 2017. [28] Janneke FM Jehee, Constantin Rothkopf, Jeffrey M Beck, and Dana H Ballard. Learning receptive fields using predictive feedback. Journal of Physiology-Paris, 100(1-3):125–132, 2006. [29] Tim Christian Kietzmann, Patrick McClure, and Nikolaus Kriegeskorte. Deep neural networks in computational neuroscience. bioRxiv, page 133504, 2018. [30] Mika Koivisto, Henry Railo, Antti Revonsuo, Simo Vanni, and Niina Salminen-Vaparanta. Recurrent processing in v1/v2 contributes to categorization of natural scenes. Journal of Neuroscience, 31(7):2488–2492, 2011. [31] Nikolaus Kriegeskorte. Deep neural networks: a new framework for modeling biological vision and brain information processing. Annual review of vision science, 1:417–446, 2015. [32] Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. 2009. [33] 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. [34] Gustav Larsson, Michael Maire, and Gregory Shakhnarovich. Fractalnet: Ultra-deep neural networks without residuals. arXiv preprint arXiv:1605.07648, 2016. [35] Chen-Yu Lee, Saining Xie, Patrick Gallagher, Zhengyou Zhang, and Zhuowen Tu. Deeplysupervised nets. In Artificial Intelligence and Statistics, pages 562–570, 2015. [36] Ming Liang and Xiaolin Hu. Recurrent convolutional neural network for object recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3367–3375, 2015. [37] Qianli Liao and Tomaso Poggio. Bridging the gaps between residual learning, recurrent neural networks and visual cortex. arXiv preprint arXiv:1604.03640, 2016. [38] Min Lin, Qiang Chen, and Shuicheng Yan. Network in network. arXiv preprint arXiv:1312.4400, 2013. [39] William Lotter, Gabriel Kreiman, and David Cox. Deep predictive coding networks for video prediction and unsupervised learning. arXiv preprint arXiv:1605.08104, 2016. [40] Jiasen Lu, Caiming Xiong, Devi Parikh, and Richard Socher. Knowing when to look: Adaptive attention via a visual sentinel for image captioning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), volume 6, page 2, 2017. [41] Vinod Nair and Geoffrey E Hinton. Rectified linear units improve restricted boltzmann machines. In Proceedings of the 27th international conference on machine learning (ICML-10), pages 807–814, 2010. [42] Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. In NIPS workshop on deep learning and unsupervised feature learning, volume 2011, page 5, 2011. 11 [43] Randall C O’Reilly, Dean Wyatte, Seth Herd, Brian Mingus, and David J Jilk. Recurrent processing during object recognition. Frontiers in psychology, 4:124, 2013. [44] Rajesh PN Rao and Dana H Ballard. Predictive coding in the visual cortex: a functional interpretation of some extra-classical receptive-field effects. Nature neuroscience, 2(1):79, 1999. [45] Adriana Romero, Nicolas Ballas, Samira Ebrahimi Kahou, Antoine Chassang, Carlo Gatta, and Yoshua Bengio. Fitnets: Hints for thin deep nets. arXiv preprint arXiv:1412.6550, 2014. [46] K Seeliger, U Güçlü, L Ambrogioni, Y Güçlütürk, and MAJ van Gerven. Generative adversarial networks for reconstructing natural images from brain activity. NeuroImage, 181:775–785, 2018. [47] Thomas Serre, Gabriel Kreiman, Minjoon Kouh, Charles Cadieu, Ulf Knoblich, and Tomaso Poggio. A quantitative theory of immediate visual recognition. Progress in brain research, 165: 33–56, 2007. [48] Guohua Shen, Tomoyasu Horikawa, Kei Majima, and Yukiyasu Kamitani. Deep image reconstruction from human brain activity. bioRxiv, page 240317, 2017. [49] Junxing Shi, Haiguang Wen, Yizhen Zhang, Kuan Han, and Zhongming Liu. Deep recurrent neural network reveals a hierarchy of process memory during dynamic natural vision. Human brain mapping, 39(5):2269–2282, 2018. [50] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. [51] Courtney J Spoerer, Patrick McClure, and Nikolaus Kriegeskorte. Recurrent convolutional neural networks: a better model of biological object recognition. Frontiers in psychology, 8: 1551, 2017. [52] Michael W Spratling. Reconciling predictive coding and biased competition models of cortical function. Frontiers in computational neuroscience, 2:4, 2008. [53] Michael W Spratling. Unsupervised learning of generative and discriminative weights encoding elementary image components in a predictive coding model of cortical function. Neural computation, 24(1):60–103, 2012. [54] Michael W Spratling. A hierarchical predictive coding model of object recognition in natural images. Cognitive computation, 9(2):151–167, 2017. [55] Michael W Spratling. A review of predictive coding algorithms. Brain and cognition, 112: 92–97, 2017. [56] Rupesh K Srivastava, Klaus Greff, and Jürgen Schmidhuber. Training very deep networks. In Advances in neural information processing systems, pages 2377–2385, 2015. [57] Ghislain St-Yves and Thomas Naselaris. Generative adversarial networks conditioned on brain activity reconstruct seen images. bioRxiv, page 304774, 2018. [58] Marijn F Stollenga, Jonathan Masci, Faustino Gomez, and Jürgen Schmidhuber. Deep networks with internal selective attention through feedback connections. In Advances in neural information processing systems, pages 3545–3553, 2014. [59] Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, Andrew Rabinovich, et al. Going deeper with convolutions. Cvpr, 2015. [60] David C Van Essen and John HR Maunsell. Hierarchical organization and functional streams in the visual cortex. Trends in neurosciences, 6:370–375, 1983. [61] Li Wan, Matthew Zeiler, Sixin Zhang, Yann Le Cun, and Rob Fergus. Regularization of neural networks using dropconnect. In International Conference on Machine Learning, pages 1058–1066, 2013. 12 [62] Haiguang Wen, Junxing Shi, Yizhen Zhang, Kun-Han Lu, Jiayue Cao, and Zhongming Liu. Neural encoding and decoding with deep learning for dynamic natural vision. Cerebral Cortex, pages 1–25, 2017. [63] Haiguang Wen, Kuan Han, Junxing Shi, Yizhen Zhang, Eugenio Culurciello, and Zhongming Liu. Deep predictive coding network for object recognition. arXiv preprint arXiv:1802.04762, 2018. [64] Dean Wyatte, Tim Curran, and Randall O’Reilly. The limits of feedforward vision: recurrent processing promotes robust object recognition when objects are degraded. Journal of Cognitive Neuroscience, 24(11):2248–2261, 2012. [65] Dean Wyatte, David J Jilk, and Randall C O’Reilly. Early recurrent feedback facilitates visual object recognition under challenging conditions. Frontiers in psychology, 5:674, 2014. [66] Saining Xie, Ross Girshick, Piotr Dollár, Zhuowen Tu, and Kaiming He. Aggregated residual transformations for deep neural networks. In Computer Vision and Pattern Recognition (CVPR), 2017 IEEE Conference on, pages 5987–5995. IEEE, 2017. [67] Daniel LK Yamins and James J DiCarlo. Using goal-driven deep learning models to understand sensory cortex. Nature neuroscience, 19(3):356, 2016. [68] Yibo Yang, Zhisheng Zhong, Tiancheng Shen, and Zhouchen Lin. Convolutional neural networks with alternately updated clique. arXiv preprint arXiv:1802.10419, 2018. [69] Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. arXiv preprint arXiv:1605.07146, 2016. [70] Amir R Zamir, Te-Lin Wu, Lin Sun, William B Shen, Bertram E Shi, Jitendra Malik, and Silvio Savarese. Feedback networks. In 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 1808–1817. IEEE, 2017. 13
2018
129
7,285
A Spectral View of Adversarially Robust Features Shivam Garg Vatsal Sharan∗ Brian Hu Zhang∗ Gregory Valiant Stanford University Stanford, CA 94305 {shivamgarg, vsharan, bhz, gvaliant}@stanford.edu Abstract Given the apparent difficulty of learning models that are robust to adversarial perturbations, we propose tackling the simpler problem of developing adversarially robust features. Specifically, given a dataset and metric of interest, the goal is to return a function (or multiple functions) that 1) is robust to adversarial perturbations, and 2) has significant variation across the datapoints. We establish strong connections between adversarially robust features and a natural spectral property of the geometry of the dataset and metric of interest. This connection can be leveraged to provide both robust features, and a lower bound on the robustness of any function that has significant variance across the dataset. Finally, we provide empirical evidence that the adversarially robust features given by this spectral approach can be fruitfully leveraged to learn a robust (and accurate) model. 1 Introduction While machine learning models have achieved spectacular performance in many settings, including human-level accuracy for a variety of image recognition tasks, these models exhibit a striking vulnerability to adversarial examples. For nearly every input datapoint—including training data—a small perturbation can be carefully chosen to make the model misclassify this perturbed point. Often, these perturbations are so minute that they are not discernible to the human eye. Since the initial work of Szegedy et al. [2013] and Goodfellow et al. [2014] identified this surprising brittleness of many models trained over high-dimensional data, there has been a growing appreciation for the importance of understanding this vulnerability. From a conceptual standpoint, this lack of robustness seems to be one of the most significant differences between humans’ classification abilities (particularly for image recognition tasks), and computer models. Indeed this vulnerability is touted as evidence that computer models are not really learning, and are simply assembling a number of cheap and effective, but easily fooled, tricks. Fueled by a recent line of work demonstrating that adversarial examples can actually be created in the real world (as opposed to requiring the ability to edit the individual pixels in an input image) [Evtimov et al., 2017, Brown et al., 2017, Kurakin et al., 2016, Athalye and Sutskever, 2017], there has been a significant effort to examine adversarial examples from a security perspective. In certain settings where trained machine learning systems make critically important decisions, developing models that are robust to adversarial examples might be a requisite for deployment. Despite the intense recent interest in both computing adversarial examples and on developing learning algorithms that yield robust models, we seem to have more questions than answers. In general, ensuring that models trained on high-dimensional data are robust to adversarial examples seems to be extremely difficult: for example, Athalye et al. [2018] claims to have broken six attempted defenses ∗Equal contribution 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. submitted to ICLR 2018 before the conference even happened. Additionally, we currently lack answers to many of the most basic questions concerning why adversarial examples are so difficult to avoid. What are the tradeoffs between the amount of data available, accuracy of the trained model, and vulnerability to adversarial examples? What properties of the geometry of a dataset determine whether a robust and accurate model exists? The goal of this work is to provide a new perspective on robustness to adversarial examples, by investigating the simpler objective of finding adversarially robust features. Rather than trying to learn a robust function that also achieves high classification accuracy, we consider the problem of learning any function that is robust to adversarial perturbations with respect to any specified metric. Specifically, given a dataset of d-dimensional points and a metric of interest, can we learn features—namely functions from Rd →R—which 1) are robust to adversarial perturbations of a bounded magnitude with respect to the specified metric, and 2) have significant variation across the datapoints (which precludes the trivially robust constant function). There are several motivations for considering this problem of finding robust features: First, given the apparent difficulty of learning adversarially robust models, this is a natural first step that might help disentangle the confounding challenges of achieving robustness and achieving good classification performance. Second, given robust features, one can hope to get a robust model if the classifier used on top of these features is reasonably Lipschitz. While there are no a priori guarantees that the features contain any information about the labels, as we empirically demonstrate, these features seem to contain sufficient information about the geometry of the dataset to yield accurate models. In this sense, computing robust features can be viewed as a possible intermediate step in learning robust models, which might also significantly reduce the computational expense of training robust models directly. Finally, considering this simpler question of understanding robust features might yield important insights into the geometry of datasets, and the specific metrics under which the robustness is being considered (e.g. the geometry of the data under the ℓ∞, or ℓ2, metric.) For example, by providing a lower bound on the robustness of any function (that has variance one across the datapoints), we trivially obtain a lower bound on the robustness of any classification model. 1.1 Robustness to Adversarial Perturbations Before proceeding, it will be useful to formalize the notion of robustness (or lack thereof) to adversarial examples. The following definition provides one natural such definition, and is given in terms of a distribution D from which examples are drawn, and a specific metric, dist(·, ·) in terms of which the magnitude of perturbations will be measured. Definition 1. A function f : Rd →R is said to be (ε, δ, γ) robust to adversarial perturbations for a distribution D over Rd with respect to a distance metric dist : Rd × Rd →R if, for a point x drawn according to D, the probability that there exists x′ such that dist(x, x′) ≤ε and |f(x) −f(x′)| ≥δ, is bounded by γ. Formally, Pr x∼D[∃x′ s.t. dist(x, x′) ≤ε and |f(x) −f(x′)| ≥δ] ≤γ. In the case that the function f is a binary classifier, if f is (ε, 1, γ) robust with respect to the distribution D of examples and a distance metric d, then even if adversarial perturbations of magnitude ε are allowed, the classification accuracy of f can suffer by at most γ. Our approach will be easier to describe, and more intuitive, when viewed as a method for assigning feature values to an entire dataset. Here the goal is to map each datapoint to a feature value (or set of values), which is robust to perturbations of the points in the dataset. Given a dataset X consisting of n points in Rd, we desire a function F that takes as input X, and outputs a vector F(X) ∈Rn; such a function F is robust for a dataset X if, for all X′ obtained by perturbing points in X, F(X) and F(X′) are close. Formally, let X be the set of all datasets consisting of n points in Rd, and ∥·∥denote the ℓ2 norm. For notational convenience, we will use FX and F(X) interchangeably, and use FX(x) to denote the feature value F associates with a point x ∈X. We overload dist(·, ·) to define distance between two ordered sets X = (x1, x2, . . . , xn) and X′ = (x′ 1, x′ 2, . . . , x′ n) as dist(X, X′) = maxi∈[n] dist(xi, x′ i). With these notations in place, we define a robust function as follows: 2 Definition 2. A function F : X →Rn is said to be (ε, δ) robust to adversarial perturbations for a dataset X with respect to a distance metric dist(·, ·) as defined above, if, for all datasets X′ such that dist(X, X′) ≤ϵ, ∥F(X) −F(X′)∥≤δ. If a function F is (ϵ, δ) robust for a dataset X, it implies that feature values of 99% of the points in X will not vary by more than 10δ √n if we were to perturb all points in X by at most ϵ. As in the case of robust functions of single datapoints, to preclude the possibility of some trivial functions we require F to satisfy certain conditions: 1) FX should have significant variance across points, say, P i(FX(xi) −Ex∼Unif(X)[FX(x)])2 = 1. 2) Changing the order of points in dataset X should not change FX, that is, for any permutation σ : Rn →Rn, Fσ(X) = σ(FX). Given a data distribution D, and a threshold ϵ, the goal will be to find a function F that is as robust as possible, in expectation, for a dataset X drawn from D. We mainly follow Definition 2 throughout the paper as the ideas behind our proposed features follow more naturally under that definition. However, we briefly discuss how to extend these ideas to come up with robust features of single datapoints (Definition 1) in section 2.1. 1.2 Summary of Results In Section 2, we describe an approach to constructing features using spectral properties of an appropriately defined graph associated with a dataset in question. We show provable bounds for the adversarial robustness of these features. We also show a synthetic setting in which some of the existing models such as neural networks, and nearest-neighbor classifier are known to be vulnerable to adversarial perturbations, while our approach provably works well. In Section 3, we show a lower bound which, in certain parameter regimes, implies that if our spectral features are not robust, then no robust features exist. The lower bound suggests a fundamental connection between the spectral properties of the graph obtained from the dataset, and the inherent extent to which the data supports adversarial robustness. To explore this connection further, in Section 5, we show empirically that spectral properties do correlate with adversarial robustness. In Section 5, we also test our adversarial features on the downstream task of classification on adversarial images, and obtain positive results. Due to space constraints, we have deferred all the proofs to the supplementary material. 1.3 Shortcomings and Future Work Our theory and empirics indicate that there may be fundamental connections between spectral properties of graphs associated with data and the inherent robustness to adversarial examples. A worthwhile future direction is to further clarify this connection, as it may prove illuminating and fruitful. Looking at the easier problem of finding adversarial features also presents the opportunity of developing interesting sample-complexity results for security against adversarial attacks. Such results may be much more difficult to prove for the problem of adversarially robust classification, since generalization is not well understood (even in the non-adversarial setting) for classification models such as neural networks. Our current approach involves computing distances between all pair of points, and performing an eigenvector computation on a Laplacian matrix of a graph generated using these distances. Both of these steps are computationally expensive operations, and future work could address improving the efficiency of our approach. In particular, it seems likely that similar spectral features can be approximated without computing all the pairwise distances, which would result in significant speedup. We also note that our experiments for testing our features on downstream classification tasks on adversarial data is based on transfer attacks, and it may be possible to degrade this performance using stronger attacks. The main takeaway from this experiment is that our conceptually simple features along with a linear classifier is able to give competitive results for reasonable strong attacks. Future works can possibly explore using robustly trained models on top of these spectral features, or using a spectral approach to distill the middle layers of neural networks. 1.4 Related Work One of the very first methods proposed to defend against adversarial examples was adversarial training using the fast gradient sign method (FGSM) [Goodfellow et al., 2014], which involves taking 3 a step in the direction of the gradient of loss with respect to data, to generate adversarial examples, and training models on these examples. Later, Madry et al. [2017] proposed a stronger projected gradient descent (PGD) training which essentially involves taking multiple steps in the direction of the gradient to generate adversarial examples followed by training on these examples. More recently, Kolter and Wong [2017], Raghunathan et al. [2018], and Sinha et al. [2017] have also made progress towards training provably adversarially robust models. There have also been efforts towards proving lower bounds on the adversarial accuracy of neural networks, and using these lower bounds to train robust models [Hein and Andriushchenko, 2017, Peck et al., 2017]. Most prior work addresses the question of how to fix the adversarial examples problem, and there is less work on identifying why this problem occurs in the first place, or highlighting which geometric properties of datasets make them vulnerable to adversarial attacks. Two recent works specifically address the “why” question: Fawzi et al. [2018] give lower bounds on robustness given a specific generative model of the data, and Schmidt et al. [2018] and Bubeck et al. [2018] describe settings in which limited computation or data are the primary bottleneck to finding a robust classifier. In this work, by considering the simpler task of coming up with robust features, we provide a different perspective on both the questions of “why” adversarial perturbations are effective, and “how” to ensure robustness to such attacks. 1.5 Background: Spectral Graph Theory Let G = (V (G), E(G)) be an undirected, possibly weighted graph, where for notational simplicity V (G) = {1, . . . , n}. Let A = (aij) be the adjacency matrix of G, and D be the the diagonal matrix whose ith diagonal entry is the sum of edge weights incident to vertex i. The matrix L = D −A is called the Laplacian matrix of the graph G. The quadratic form, and hence the eigenvalues and eigenvectors, of L carry a great deal of information about G. For example, for any v ∈Rn, we have vT Lv = X (i,j)∈E(G) aij(vi −vj)2. It is immediately apparent that L has at least one eigenvalue of 0: the vector v1 = (1, 1, . . . , 1) satisfies vT Lv = 0. Further, the second (unit) eigenvector is the solution to the minimization problem min v X (i,j)∈E aij(vi −vj)2 s.t. X i vi = 0; X i v2 i = 1. In other words, the second eigenvector assigns values to the vertices such that the average value is 0, the variance of the values across the vertices is 1, and among such assignments, minimizes the sum of the squares of the discrepancies between neighbors. For example, in the case that the graph has two (or more) connected components, this second eigenvalue is 0, and the resulting eigenvector is constant on each connected component. Our original motivation for this work is the observation that, at least superficially, this characterization of the second eigenvector sounds similar in spirit to a characterization of a robust feature: here, neighboring vertices should have similar value, and for robust features, close points should be mapped to similar values. The crucial question then is how to formalize this connection. Specifically, is there a way to construct a graph such that the neighborhood structure of the graph captures the neighborhood of datapoints with respect to the metric in question? We outline one such construction in Section 2. We will also consider the normalized or scaled Laplacian, which is defined by Lnorm = D−1/2(D −A)D−1/2 = I −D−1/2AD−1/2. The scaled Laplacian normalizes the entries of L by the total edge weights incident to each vertex, so that highly-irregular graphs do not have peculiar behavior. For more background on spectral graph theory, we refer the readers to Spielman [2007] and Chung [1997]. 2 Robust Features In this section, we describe a construction of robust features, and prove bounds on their robustness. Let X = (x1, . . . , xn) be our dataset, and let ε > 0 be a threshold for attacks. We construct a robust feature FX using the second eigenvector of the Laplacian of a graph corresponding to X, defined in terms of the metric in question. Formally, given the dataset X, and a distance threshold parameter T > 0 which possibly depends on ε, we define FX as follows: 4 Define G(X) to be the graph whose nodes correspond to points in X, i.e., {x1, . . . , xn}, and for which there is an edge between nodes xi and xj, if dist(xi, xj) ≤T. Let L(X) be the (un-normalized) Laplacian of G(X), and let λk(X) and vk(X) be its kth smallest eigenvalue and a corresponding unit eigenvector. In all our constructions, we assume that the first eigenvector v1(X) is set to be the unit vector proportional to the all-ones vector. Now define FX(xi) = v2(X)i; i.e. the component of v2(X) corresponding to xi. Note that FX defined this way satisfies the requirement of sufficient variance across points, namely, P i(FX(xi) −Ex∼Unif(X)[FX(x)])2 = 1, since P i v2(X)i = 0 and ∥v2(X)∥= 1. We now give robustness bounds for this choice of feature FX. To do this, we will need slightly more notation. For a fixed ε > 0, define the graph G+(X) to be the graph with the same nodes as G(X), except that the threshold for an edge is T + 2ε instead of T. Formally, in G+(X), there is an edge between xi and xj if dist(xi, xj) ≤T + 2ϵ. Similarly, define G−(X) to be the graph with same set of nodes, with the threshold for an edge being T −2ε. Define L+(X), λ+ k (X), v+ k (X), L−(X), λ− k (X), v− k (X) analogously to the earlier definitions. In the following theorem, we give robustness bounds on the function F as defined above. Theorem 1. For any pair of datasets X and X′, such that dist(X, X′) ≤ε, the function F : Xn → Rn obtained using the second eigenvector of the Laplacian as defined above satisfies min(∥F(X) −F(X′)∥, ∥(−F(X)) −(F(X′))∥) ≤  2 √ 2 s λ+ 2 (X) −λ− 2 (X) λ− 3 (X) −λ− 2 (X). Theorem 1 essentially guarantees that the features, as defined above, are robust up to sign-flip, as long as the eigengap between the second and third eigenvalues is large, and the second eigenvalue does not change significantly if we slightly perturb the distance threshold used to determine whether an edge exists in the graph in question. Note that flipping signs of the feature values of all points in a dataset (including training data) does not change the classification problem for most common classifiers. For instance, if there exists a linear classifier that fits points with features FX well, then a linear classifier can fit points with features −FX equally well. So, up to sign flip, the function F is (ε, δX) robust for dataset X, where δX corresponds to the bound given in Theorem 1. To understand this bound better, we discuss a toy example. Consider a dataset X that consists of two clusters with the property that the distance between any two points in the same cluster is at most 4ϵ, and the distance between any two points in different clusters is at least 10ϵ. Graph G(X) with threshold T = 6ϵ, will have exactly two connected components. Note that v2(X) will perfectly separate the two connected components with v2(X)i being 1 √n if i belongs to component 1, and −1 √n otherwise. In this simple case, we conclude immediately that FX is perfectly robust: perturbing points by ϵ cannot change the connected component any point is identified with. Indeed, this agrees with Theorem 1: λ+ 2 = λ− 2 = 0 since the two clusters are at a distance > 10ε. Next, we briefly sketch the idea behind the proof of Theorem 1. Consider the second eigenvector v2(X′) of the Laplacian of the graph G(X′) where dataset X′ is obtained by perturbing points in X. We argue that this eigenvector can not be too far from v− 2 (X). For the sake of contradiction, consider the extreme case where v2(X′) is orthogonal to v− 2 (X). If the gap between the second and third eigenvalue of G−(X) is large, and the difference between λ2(X′) and λ− 2 (X) is small, then by replacing v− 3 (X) with v2(X′) as the third eigenvector of G−(X), we get a much smaller value for λ− 3 (X), which is not possible. Hence, we show that the two eigenvectors in consideration can not be orthogonal. The proof of the theorem extends this argument to show that v2(X′), and v− 2 (X) need to be close if we have a large eigengap for G−(X), and a small gap between λ2(X′) and λ− 2 (X). Using a similar argument, one can show that v2(X) and v− 2 (X), also need to be close. Applying the triangle inequality, we get that v2(X) and v2(X′) are close. Also, since we do not have any control over λ2(X′), we use an upper bound on it given by λ2(X+), and state our result in terms of the gap between λ2(X+) and λ2(X−). The approach described above also naturally yields a construction of a set of robust features by considering the higher eigenvectors of Laplacian. We define the ith feature vector for a dataset X as F i X = vi+1(X). As the eigenvectors of a symmetric matrix are orthogonal, this gives us a set of k diverse feature vectors {F 1 X, F 2 X, . . . , F k X}. Let FX(x) = (F 1 X(x), F k X(x), . . . , F k X(x))T be a 5 k-dimensional column vector denoting the feature values for point x ∈X. In the following theorem, we give robustness bounds on these feature vectors. Theorem 2. For any pair of datasets X and X′, such that dist(X, X′) ≤ε, there exists a k × k invertible matrix M, such that the features FX and FX′ as defined above satisfy s X i∈[n] ∥MFX(xi) −FX′(x′ i)∥2 ≤  2 √ 2k s λ+ k+1(X) −λ− 2 (X) λ− k+2(X) −λ− 2 (X) Theorem 2 is a generalization of Theorem 1, and gives a bound on the robustness of feature vectors FX up to linear transformations. Note that applying an invertible linear transformation to all the points in a dataset (including training data) does not alter the classification problem for models invariant under linear transformations. For instance, if there exists a binary linear classifier given by vector w, such that sign(wT FX(x)) corresponds to the true label for point x, then the classifier given by (M −1)T w assigns the correct label to linearly transformed feature vector MFX(x). 2.1 Extending a Feature to New Points In the previous section, we discussed how to get robust features for points in a dataset. In this section, we briefly describe an extension of that approach to get robust features for points outside the dataset, as in Definition 1. Let X = {x1, . . . , xn} ⊂Rd be the training dataset drawn from some underlying distribution D over Rd. We use X as a reference to construct a robust function fX : Rd →R. For the sake of convenience, we drop the subscript X from fX in the case where the dataset in question is clear. Given a point x ∈Rd, and a distance threshold parameter T > 0, we define f(x) as follows: Define G(X) and G(x) to be graphs whose nodes are points in dataset X, and {x} ∪X = {x0 = x, x1, . . . , xn} respectively, and for which there is an edge between nodes xi and xj, if dist(xi, xj) ≤ T. Let L(x) be the Laplacian of G(x), and let λk(x) and vk(x) be its kth smallest eigenvalue and a corresponding unit eigenvector. Similarly, define L(X), λk(X) and vk(X) for G(X). In all our constructions, we assume that the first eigenvectors v1(X) and v1(x) are set to be the unit vector proportional to the all-ones vector. Now define f(x) = v2(x)0; i.e. the component of v2(x) corresponding to x0 = x. Note that the eigenvector v2(x) has to be picked “consistently” to avoid signflips in f as −v2(x) is also a valid eigenvector. To resolve this, we select the eigenvector v2(x) to be the eigenvector (with eigenvalue λ2(x)) whose last |X| entries has the maximum inner product with v2(X). We now state a robustness bound for this feature f as per Definition 1. For a fixed ε > 0 define the graph G+(x) to be the graph with the same nodes and edges of G(x), except that the threshold for x0 = x is T + ε instead of T. Formally, in G+(x), there is an edge between xi and xj if: (a) i = 0 or j = 0, and dist(xi, xj) ≤T + ε; or (b) i > 0 and j > 0, and dist(xi, xj) ≤T. Similarly, define G−(x) to be the same graph with T + ε replaced with T −ε. Define L+, λ+ k , v+ k , L−, λ− k , v− k analogously to the earlier definitions. In the following theorem, we give a robustness bound on the function f as defined above. Theorem 3. For a sufficiently large training set size n, if EX∼D h (λ3(X) −λ2(X))−1i ≤c for some small enough constant c, then with probability 0.95 over the choice of X, the function fX : Rd →R as defined above satisfies Prx∼D[∃x′ s.t. dist(x, x′) ≤ε and |fX(x) −fX(x′)| ≥δx] ≤ 0.05, for δx =  6 √ 2 s λ+ 2 (x) −λ− 2 (x) λ− 3 (x) −λ− 2 (x). This also implies that with probability 0.95 over the choice of X, fX is (ϵ, 20 Ex∼D[δx], 0.1) robust as per Definition 1. This bound is very similar to bound obtained in Theorem 1, and says that the function f is robust, as long as the eigengap between the second and third eigenvalues is sufficiently large for G(X) and 6 G−(x), and the second eigenvalue does not change significantly if we slightly perturb the distance threshold used to determine whether an edge exists in the graph in question. Similarly, one can also obtain a set of k features, by taking the first k eigenvectors of G(X) prepended with zero, and projecting them onto the bottom-k eigenspace of G(x). 3 A Lower Bound on Adversarial Robustness In this section, we show that spectral properties yield a lower bound on the robustness of any function on a dataset. We show that if there exists an (ε, δ) robust function F ′ on dataset X, then the spectral approach (with appropriately chosen threshold), will yield an (ε′, δ′) robust function, where the relationship between ε, δ and ε′, δ′ is governed by easily computable properties of the dataset, X. This immediately provides a way of establishing a bound on the best possible robustness that dataset X could permit for perturbations of magnitude ε. Furthermore it suggests that the spectral properties of the neighborhood graphs we consider, may be inherently related to the robustness that a dataset allows. We now formally state our lower bound: Theorem 4. Assume that there exists some (ε, δ) robust function F ∗for the dataset X (not necessarily constructed via the spectral approach). For any threshold T, let GT be the graph obtained on X by thresholding at T. Let dT be the maximum degree of GT . Then the feature F returned by the spectral approach on the graph G2ε/3 is at least (ε/6, δ′) robust (up to sign), for δ′ = δ s 8(dε + 1) λ3(Gε/3) −λ2(Gε/3). The bound gives reasonable guarantees when the degree is small and the spectral gap is large. To produce meaningful bounds, the neighborhood graph must have some structure at the threshold in question; in many practical settings, this would require an extremely large dataset, and hence this bound is mainly of theoretical interest at this point. Still, our experimental results in Section 5 empirically validate the hypothesis that spectral properties have implications for the robustness of any model: we show that the robustness of an adversarially trained neural network on different data distributions correlates with the spectral properties of the distribution. 4 Synthetic Setting: Adversarial Spheres Gilmer et al. [2018] devise a situation in which they are able to show in theory that training adversarially robust models is difficult. The authors describe the “concentric spheres dataset”, which consists of—as the name suggests—two concentric d-dimensional spheres, one of radius 1 and one of radius R > 1. The authors then argue that any classifier that misclassifies even a small fraction of the inner sphere will have a significant drop in adversarial robustness. We argue that our method, in fact, yields a near-perfect classifier—one that makes almost no errors on natural or adversarial examples—even when trained on a modest amount of data. To see this, consider a sample of 2N training points from the dataset, N from the inner sphere and N from the outer sphere. Observe that the distance between two uniformly chosen points on a sphere of radius r is close to r √ 2. In particular, the median distance between two such points is exactly r √ 2, and with high probability for large d, the distance will be within some small radius ε of r √ 2. Thus, for distance threshold √ 2 + 2ε, after adding a new test point to the training data, we will get a graph with large clique corresponding to the inner sphere, and isolated points on the outer sphere, with high probability. This structure doesn’t change by perturbing the test point by ϵ, resulting in a robust classifier. We now formalize this intuition. Let the inner sphere be of radius one, and outer sphere be of some constant radius R > 1. Let ε = (R −1)/8 be the radius of possible perturbations. Then we can state the following: Theorem 5. Pick initial distance threshold T = √ 2 + 2ε in the ℓ2 norm, and use the first N + 1 eigenvectors as proposed in Section 2.1 to construct a (N + 1)-dimensional feature map f : Rd → RN+1. Then with probability at least 1 −N 2e−Ω(d) over the random choice of training set, f maps the entire inner sphere to the same point, and the entire outer sphere to some other point, except for a γ-fraction of both spheres, where γ = Ne−Ω(d). In particular, f is (ε, 0, γ)-robust. 7 Figure 1: Comparison of performance on adversarially perturbed MNIST data . Figure 2: Performance on adversarial data vs our upper bound. The extremely nice form of the constructed feature f in this case means that, if we use half of the training set to get the feature map f, and the other half to train a linear classifier (or, indeed, any nontrivial model at all) trained on top of this feature, this will yield a near-perfect classifier even against adversarial attacks. The adversarial spheres example is a case in which our method allows us to make a robust classifier, but other common methods do not. For example, nearest-neighbors will fail at classifying the outer sphere (since points on the outer sphere are generally closer to points on the inner sphere than to other points on the outer sphere), and Gilmer et al. [2018] demonstrate in practice that training adversarially robust models on the concentric spheres dataset using standard neural network architectures is extremely difficult when the dimension d grows large. 5 Experiments 5.1 Image Classification: The MNIST Dataset While the main focus of our work is to improve the conceptual understanding of adversarial robustness, we also perform experiments on the MNIST dataset. We test the efficacy of our features by evaluating them on the downstream task of classifying adversarial images. We used a subset of MNIST dataset, which is commonly used in discussions of adversarial examples [Goodfellow et al., 2014, Szegedy et al., 2013, Madry et al., 2017]. Our dataset has 11,000 images of hand written digits from zero to nine, of which 10,000 images are used for training, and rest for test. We compare three different models, the specifics of which are given below: Robust neural network (pgd-nn): We consider a fully connected neural network with one hidden layer having 200 units, with ReLU non-linearity, and cross-entropy loss. We use PyTorch implementation of Adam [Kingma and Ba, 2014] for optimization with a step size of 0.001. To obtain a robust neural network, we generate adversarial examples using projected gradient descent for each mini-batch, and train our model on these examples. For projected gradient descent, we use a step size of 0.1 for 40 iterations. Spectral features obtained using scaled Laplacian, and linear classifier (unweighted-laplacianlinear): We use the ℓ2 norm as a distance metric, and distance threshold T = 9 to construct a graph on all 11,000 data points. Since the distances between training points are highly irregular, our constructed graph is also highly irregular; thus, we use the scaled Laplacian to construct our features. Our features are obtained from the 20 eigenvectors corresponding to λ2 to λ21. Thus each image is mapped to a feature vector in R20. On top of these features, we use a linear classifier with cross-entropy loss for classification. We train the linear classifier using 10,000 images, and test it on 1,000 images obtained by adversarially perturbing test images. Spectral features obtained using scaled Laplacian with weighted edges, and linear classifier (weighted-laplacian-linear): This is similar to the previous model, with the only difference being the way in which the graph is constructed. Instead of using a fixed threshold, we have weighted edges between all pairs of images, with the weight on the edge between image i and j being 8 exp  −0.1∥xi −xj∥2 2  . As before, we use 20 eigenvectors corresponding to the scaled Laplacian of this graph, with a linear classifier for classification. Note that generating our features involve computing distances between all pair of images, followed by an eigenvector computation. Therefore, finding the gradient (with respect to the image coordinates) of classifiers built on top of these features is computationally extremely expensive. As previous works [Papernot et al., 2016] have shown that transfer attacks can successfully fool many different models, we use transfer attacks using adversarial images corresponding to robust neural networks (pgd-nn). The performance of these models on adversarial data is shown in figure 1. We observe that weightedlaplacian-linear performs better than pgd-nn on large enough perturbations. Note that it is possible that robustly trained deep convolutional neural nets perform better than our model. It is also possible that the performance of our models may deteriorate with stronger attacks. Still, our conceptually simple features, with just a linear classifier on top, are able to give competitive results against reasonably strong adversaries. It is possible that training robust neural networks on top of these features, or using such features for the middle layers of neural nets may give significantly more robust models. Therefore, our experiments should be considered mainly as a proof of concept, indicating that spectral features may be a useful tool in one’s toolkit for adversarial robustness. We also observe that features from weighted graphs perform better than their unweighted counterpart. This is likely because the weighted graph contains more information about the distances, while most of this information is lost via thresholding in the unweighted graph. 5.2 Connection Between Spectral Properties and Robustness We hypothesize that the spectral properties of the graph associated with a dataset has fundamental connections with its adversarial robustness. The lower bound shown in section 3 sheds some more light on this connection. In Theorem 1, we show that adversarial robustness is proportional to q (λ+ 2 −λ− 2 )/(λ− 3 −λ− 2 ). To study this connection empirically, we created 45 datasets corresponding to each pair of digits in MNIST. As we expect some pairs of digits to be less robust to adversarial perturbations than others, we compare our spectral bounds for these various datasets, to their observed adversarial accuracies. Setup: The dataset for each pair of digits has 5000 data points, with 4000 points used as the training set, and 1000 points used as the test set. Similarly to the previous subsection, we trained robust neural nets on these datasets. We considered fully connected neural nets with one hidden layer having 50 units, with ReLU non-linearity, and cross-entropy loss. For each mini-batch, we generated adversarial examples using projected gradient descent with a step size of 0.2 for 20 iterations, and trained the neural net on these examples. Finally, to test this model, we generated adversarial perturbations of size 1 in ℓ2 norm to obtain the adversarial accuracy for all 45 datasets. To get a bound for each dataset X, we generated two graphs G−(X), and G+(X) with all 5000 points (not involving adversarial data). We use the ℓ2 norm as a distance metric. The distance threshold T for G−(X) is set to be the smallest value such that each node has degree at least one, and the threshold for G+(X) is two more than that of G−(X). We calculated the eigenvalues of the scaled Laplacians of these graphs to obtain our theoretical bounds. Observations: As shown in Figure 2, we observe some correlation between our upper bounds and the empirical adversarial robustness of the datasets. Each dataset is represented by a point in Figure 2, where the x-axis is proportional to our bound, and the y-axis indicates the zero-one loss of the neural nets on adversarial examples generated from that dataset. The correlation is 0.52 after removing the right-most outlier. While this correlation is not too strong, it suggests some connection between our spectral bounds on the robustness and the empirical robustness of certain attack/defense heuristics. 6 Conclusion We considered the task of learning adversarially robust features as a simplification of the more common goal of learning adversarially robust classifiers. We showed that this task has a natural connection to spectral graph theory, and that spectral properties of a graph associated to the underlying data have implications for the robustness of any feature learned on the data. We believe that exploring this simpler task of learning robust features, and further developing the connections to spectral graph theory, are promising steps towards the end goal of building robust machine learning models. 9 Acknowledgments: This work was supported by NSF awards CCF-1704417 and 1813049, and an ONR Young Investigator Award (N00014-18-1-2295). References Anish Athalye and Ilya Sutskever. Synthesizing robust adversarial examples. arXiv preprint arXiv:1707.07397, 2017. Anish Athalye, Nicholas Carlini, and David Wagner. Obfuscated gradients give a false sense of security: Circumventing defenses to adversarial examples. arXiv preprint arXiv:1802.00420, 2018. TB Brown, D Mané, A Roy, M Abadi, and J Gilmer. Adversarial patch. arxiv e-prints (dec. 2017). arXiv preprint cs.CV/1712.09665, 2017. Sébastien Bubeck, Eric Price, and Ilya Razenshteyn. Adversarial examples from computational constraints. arXiv preprint arXiv:1805.10204, 2018. Fan RK Chung. Spectral graph theory. Number 92. American Mathematical Soc., 1997. Ivan Evtimov, Kevin Eykholt, Earlence Fernandes, Tadayoshi Kohno, Bo Li, Atul Prakash, Amir Rahmati, and Dawn Song. Robust physical-world attacks on machine learning models. arXiv preprint arXiv:1707.08945, 2017. Alhussein Fawzi, Hamza Fawzi, and Omar Fawzi. Adversarial vulnerability for any classifier. arXiv preprint arXiv:1802.08686, 2018. Justin Gilmer, Luke Metz, Fartash Faghri, Samuel S Schoenholz, Maithra Raghu, Martin Wattenberg, and Ian Goodfellow. Adversarial spheres. arXiv preprint arXiv:1801.02774, 2018. Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014. Matthias Hein and Maksym Andriushchenko. Formal guarantees on the robustness of a classifier against adversarial manipulation. In Advances in Neural Information Processing Systems, pages 2263–2273, 2017. Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. J Zico Kolter and Eric Wong. Provable defenses against adversarial examples via the convex outer adversarial polytope. arXiv preprint arXiv:1711.00851, 2017. Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial examples in the physical world. arXiv preprint arXiv:1607.02533, 2016. Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. arXiv preprint arXiv:1706.06083, 2017. Nicolas Papernot, Patrick McDaniel, and Ian Goodfellow. Transferability in machine learning: from phenomena to black-box attacks using adversarial samples. arXiv preprint arXiv:1605.07277, 2016. Jonathan Peck, Joris Roels, Bart Goossens, and Yvan Saeys. Lower bounds on the robustness to adversarial perturbations. In Advances in Neural Information Processing Systems, pages 804–813, 2017. Aditi Raghunathan, Jacob Steinhardt, and Percy Liang. Certified defenses against adversarial examples. arXiv preprint arXiv:1801.09344, 2018. Ludwig Schmidt, Shibani Santurkar, Dimitris Tsipras, Kunal Talwar, and Aleksander M ˛adry. Adversarially robust generalization requires more data. arXiv preprint arXiv:1804.11285, 2018. Aman Sinha, Hongseok Namkoong, and John Duchi. Certifiable distributional robustness with principled adversarial training. arXiv preprint arXiv:1710.10571, 2017. 10 Daniel A Spielman. Spectral graph theory and its applications. In Foundations of Computer Science, 2007. FOCS’07. 48th Annual IEEE Symposium on, pages 29–38. IEEE, 2007. Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. arXiv preprint arXiv:1312.6199, 2013. 11
2018
13
7,286
Exponentiated Strongly Rayleigh Distributions Zelda Mariet Massachusetts Institute of Technology zelda@csail.mit.edu Suvrit Sra Massachusetts Institute of Technology suvrit@mit.edu Stefanie Jegelka Massachusetts Institute of Technology stefje@csail.mit.edu Abstract Strongly Rayleigh (SR) measures are discrete probability distributions over the subsets of a ground set. They enjoy strong negative dependence properties, as a result of which they assign higher probability to subsets of diverse elements. We introduce in this paper Exponentiated Strongly Rayleigh (ESR) measures, which sharpen (or smoothen) the negative dependence property of SR measures via a single parameter (the exponent) that can be intuitively understood as an inverse temperature. We develop efficient MCMC procedures for approximate sampling from ESRs, and obtain explicit mixing time bounds for two concrete instances: exponentiated versions of Determinantal Point Processes and Dual Volume Sampling. We illustrate some of the potential of ESRs, by applying them to a few machine learning problems; empirical results confirm that beyond their theoretical appeal, ESR-based models hold significant promise for these tasks. 1 Introduction The careful selection of a few items from a large ground set is a crucial component of many machine learning problems. Typically, the selected set of items must fulfill a variety of application specific requirements—e.g., when recommending items to a user, the quality of each selected item is important. This quality must be, however, balanced by diversity of the selected items to avoid redundancy within recommendations. Notable applications requiring careful consideration of subset diversity include recommender systems, information retrieval, and automatic summarization; more broadly, such concerns are also vital for model design such as model pruning and experimental design. A flexible approach for such subset selection is to sample from subsets of the ground set using a measure that balances quality with diversity. An effective way to capture diversity is to use negatively dependent measures. While such measures have been long studied [41], remarkable recent progress by Borcea et al. [11] has put forth a rich new theory with far-reaching impact. The key concept in Borcea et al.’s theory is that of Strongly Rayleigh (SR) measures, which admit important closure properties (specifically, closure under conditioning on a subset of variables, projection, imposition of external fields, and symmetric homogenization [11, Theorems 4.2, 4.9]) and enjoy the strongest form of negative association. These properties have been instrumental in the resolution of long-standing conjectures in mathematics [9, 35]; in machine learning, their broader impact is only beginning to emerge [5, 31, 33], while an important subclass of SR measures, Determinantal Point Processes (DPPs) has already found numerous applications [22, 29]. A practical challenge in using SR measures is the tuning of diversity versus quality, a task that is application dependent and may require significant effort. The modeling need motivates us to consider a generalization of SR measures that allows for easy tuning of the relative importance given to quality and diversity considerations. Specifically, we introduce the class of Exponentiated 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. Strongly Rayleigh (ESR) measures, which are distributions of the form ν(S) ∝µ(S)p, where S is a set, p > 0 is a parameter and µ is an SR measure. A power p > 1 captures a sharper notion of diversity than µ; conversely, a power p < 1 allows for weaker diversity preferences; at the p = 0 extreme, ν is uniform, while for p →∞, the ν concentrates at the mode of µ. ESR measures present an attractive generalization to SR measures, where a single parameter allows an intuitive regulation of desired strength of negative dependence. Interestingly, a few special cases of ESRs have been briefly noted in the literature [22, 29, 49], although only the guise of generalizations to DPPs and without noting any connection to SR measures. We analyze the negative association properties of ESR measures and derive general-purpose sampling algorithms that we further specialize for important concrete cases. Subsequently, we evaluate the proposed sampling procedures on outlier detection and kernel reconstruction, and show how a class of machine learning problems can benefit from the modeling power of ESR measures. Summary of contributions. The key contributions of this paper are the following: – The introduction of Exponentiated SR measures as a flexible generalization of SR measures, allowing for intuitive tuning of subset selection quality/diversity tradeoffs via an exponent p > 0. – A discussion of cases when ESR measures remain SR. Specifically, we show that there exist non-trivial determinantal measures whose ESR versions remain SR for p in a neighborhood of 1. – The introduction of the notion of r-closeness, which quqntifies the suitability of a proposal distribution for MCMC samplers. – The analysis of MCMC sampling algorithms applied to ESR measures which take advantage of fast-mixing chains for SR measures. We show that the mixing time of the ESR samplers is upper bounded in terms of r-closeness; we provide concrete bounds for popular SR measures. – An empirical evaluation of ESR measures on various machine learning tasks, showing that ESR measures outperform standard SR models on several problems requiring a delicate balance of subset quality and diversity. 1.1 Related work An early work that formally motivates various negative dependence conjectures is [41]. The seminal work [11] provides a response, and outlines a powerful theory of negative dependence via the class of SR measures. The mathematical theory of SR measures, as well as the intimately related theory of multivariate stable polynomials has been the subject of significant interest [9, 10, 42]; recently, SR measures were central in the proof of the Kadison-Singer conjecture [35]. Within machine learning, DPPs, which are a subclass of SR measures, have been recognized as a powerful theoretical and practical tool. DPPs assign probability proportional to det(L[S]) to a set S ∈2[n], where L is the so-called DPP-kernel. Their elegance and tractability has helped DPPs find numerous applications, including document and video summarization [15, 34], sensor placement [27], recommender systems [21, 48], object retrieval [1], neural networks [36] and Nyström approximations [32]. More recently, an SR probability measure known as volume sampling [8, 16] or dual volume sampling (DVS) [33, 37] has found some interest. A DVS measure is parametrized by an m×n matrix A with columns ai; it assigns to a set S ⊆[n] of size m a probability proportional to det(∑ i∈S a⊤ i ai). Independent of application-specific motivations, two recent results [5, 31] showed that SR measures admit efficient sampling via fast-mixing Markov chains, suggesting SR measures can be tractably applicable to many machine learning problems. Nevertheless, the need to tune the measure to modulate diversity persists. We address this need by passing to the broader class of Exponentiated Strongly Rayleigh measures, whose diversity/quality preference is parametrized by a single exponent. To our knowledge, there has been no previous discussion of ESR measures as a class. Nonetheless, they can benefit from the abundant existing theory for log-submodular models [19, 20, 25, 43], and isolated special cases have also been discussed in the literature. In particular, Exponentiated DPPs (or E-DPPs) are mentioned in [29, 49], as well as in [22] and [4]. 2 p = 1/2 p = 1 p = 2 Figure 1: Anomaly detection by sampling with an Exponentiated-DPP. 200 samples of size k = 20 were drawn from a E-DPP with Gaussian kernel; darker colors indicate higher sampling frequencies. As p increases, the points furthest from the mean accumulate all of the sampling probability mass. 2 Exponentiated Strongly Rayleigh measures In this section, we formally introduce Exponentiated SR measures and analyze their properties within the framework of negative dependence. We use Pn to denote n × n Hermitian positive definite matrices, and use A ≻B to denote the usual Löwner order on Pn matrices1. For a matrix L, we write L[S, T] the submatrix [Lij]i∈S,j∈T , as well as L[:, S] ≜L[[n], S] and L[S, :] similarly. We alleviate the notation L[S, S] as L[S]. Recall that for a measure µ over all subsets of a ground set Y ≜[n], µ’s generating polynomial is the multi-affine function over Cn defined by Pµ(z1, . . . , zn) = ∑ S⊆Y µ(S) ∏ i∈S zi Definition 1 (Strongly Rayleigh [11]). A measure µ over the subsets of [n] := {1, . . . , n} is SR if its generating polynomial Pµ ∈C[z1, . . . , zn] is real stable, i.e. Pµ(z1, . . . , zn) ̸= 0 whenever Im(zj) > 0 for 1 ≤j ≤n. In order to calibrate the relative influence of the diversity and quality of a set S on the probability an SR measure assigns to S, we introduce the family of Exponentiated Strongly Rayleigh measures. Definition 2 (Exponentiated SR measure). A measure µ over 2[n] is Exponentiated Strongly Rayleigh (ESR) if there exists an SR measure ν over 2[n] and a power p ≥0 such that µ(S) ∝ν(S)p. The parameter p serves to control the quality/diversity tradeoff by sharpening (p > 1) or smoothing out (p < 1) the variations of the ground SR measure (see Figure 1). A natural question is then to understand how this additional parameter impacts the negatively associated properties of the ESR. Recall that a fundamental property of SR measures lies in the fact that they are negatively associated: for two increasing functions F, G over 2[n] that depend on a disjoint set of coordinates, an SR measure µ verifies the following inequality [11, Theorem 4.9]: Eµ[F] Eµ[G] ≥Eµ[FG]. (2.1) Our first result states that the additional modularity enabled by the exponent parameter can break Strong Rayleighness; as a consequence, we have no immediate guarantee that ESRs verify Eq. (2.1). Proposition 1. There exist ESR measures that are not SR. Conversely, some ESR measures remain SR for any p: if µ is a DPP parametrized by a blockdiagonal kernel with 2 × 2 blocks, ν = αµp is also a DPP, and so SR and ESR by construction. The next theorem guarantees the existence of non-trivial ESR measures which are also SR. Theorem 1. There exists ϵ > 0 such that ∀p ∈[1 −ϵ, 1 + ϵ], ∀n ∈N, there exists a non-trivial matrix L ∈Pn such that the E-DPP distribution defined by ν(S) ∝det(L[S, S])p is SR. Hence, ESRs are not guaranteed to be SR but may remain so. Due to their log-submodularity, they nonetheless will verify the so-called negative latice condition µ(S ∩T)µ(S ∪T) ≤µ(S)µ(T), and so retain negative dependence properties. We now show that ESRs nonetheless have a fundamental advantage over standard log-submodular functions: although the intractability of their partition function precludes exact sampling algorithms, their closed form as the exponentiation of an SR measure can be leveraged to take advantage of the recent result [31] on fast-mixing Markov chains for SR measures. 1i.e. A ≻B ⇐⇒(A −B) ∈Pn. 3 3 Sampling from ESR measures In the general case, the normalization term of an ESR is NP-hard to compute, precluding exact sampling algorithms. In this section, we propose instead two MCMC sampling algorithms whose key idea lies in exploiting the explicit relation ESR measures have to SR measures. We begin by introducing the notion of r-closeness, which serves as a measure of the proximity between to distributions µ and ν over subsets. In practice, r-closeness will allow us to quantify how close an ESR measure is to being SR, and inform our bounds on mixing time. Definition 3 (r-closeness). Let µ, ν be measures over 2[n] and let p ≥0. We say that ν is r-close to µ if we have for all S ⊆[n], ν(S) ̸= 0 and µ(S) ̸= 0 =⇒r−1 ≤ν(S)/µ(S) ≤r where we allow r = ∞. We additionally write r(µ, ν) = min{r ∈R ∪{∞} : ν is r-close to µ}. Remark 1. If r(µ, ν) < ∞, ν is absolutely continuous wrt. µ: µ(S) = 0 =⇒νp(S) = 0. The following result establishes that for any ESR measure ν, there exists an SR measure µ which is r-close to ν with r < ∞. This result is the cornerstone of the sampling algorithms we derive, as we show that we can use an r-close SR measure as proposal to efficiently sample from an ESR measure. Proposition 2. Let µ be an SR measure over 2[n], and define ν to be the ESR measure such that ν(S) ∝µ(S)p. Then r(µ, ν) ≤ max S∈supp(ν) [ µ(S)−|p−1|] < ∞. In order to sample from an ESR distribution ν, we now generalize existing MCMC algorithms for SR measures; we bound the distance to stationarity of the the chain’s current state by comparing it to the distance to stationarity of a similar chain sampling from an SR measure µ, and leveraging the r-closeness r(µ, ν). 3.1 Approximate samplers for ESR measures Before investigating MCMC samplers, one may first wonder if rejection sampling might be sufficient: sample a set S from a proposal distribution µ, and accept with probability νp(S)/Mµ(S), where M ≥maxS µ(S)/νp(S). Unfortunately, the rejection sampling scaling factor M cannot be computed — although it can be bounded by r(µ, νp) — leading us to prefer MCMC samplers [6]. We begin by analyzing the standard independent Metropolis–Hastings sampler [26, 38], using an SR measure µ as a proposal: we sample an initial set S from µ via a fast-mixing Markov chain, then iteratively swap from S to a new set S′ with probability Pr(S →S′) = min { 1, ν(S′)µ(S) ν(S)µ(S′) } Algorithm 1 Proposal-based sampling Input: SR proposal µ, ESR measure ν and SR measure ρ s.t. ν = αρp Draw S ∼µ while not mixed do S′ ∼µ S ←S′ w.p. min { 1, ν(S′)µ(S) ν(S)µ(S′) } = min { 1, µ(S) µ(S′) ( ρ(S′) ρ(S) )p} return S Algorithm 1 relies on the fact that we can compute ν(S′)/ν(S) as (ρ(S′)/ρ(S))p: we do not require knowledge of ν’s partition function. This sampling method is valid as soon as ν is absolutely continuous with regards to the proposal µ; Proposition 2 guaranteed the existence of such measures. If the ESR measure ν is k-homogeneous (i.e. ν assigns a non-zero probability only to sets of size k), we can instead sample from ν via Algorithm 2: we randomly sample S ⊆[n] and switch an element u ∈S for v ̸∈S if this improves the probability of S. 4 Algorithm 2 Swap-chain sampling Input: k-homogeneous ESR measure ν s.t. ν = αρp with ρ SR Sample S ∼Unif(N) such that |S| = k while not mixed do Sample u, v ∈(S × [N] \ S) uniformly at random S ←S ∪{u} \ {v} w.p. min { 1, ν(S∪{u}\{v}) ν(S) } = min { 1, ( ρ(S∪{u}\{v}) ρ(S) )p} return S The key to extending Algorithm 2 to non-homogeneous ESR measures is similar to the approach taken by Li et al. [31] for SR measures, and relies on leveraging the symmetric homogenization νsh of ν over 2[2n] defined by νsh : S ∈2[2n] → { ν(S ∩[n]) ( n |S∩[n]| )−1 if |S| = n 0 if |S| ̸= n If ν ∝µp, νsh is absolutely continuous with regards to µsh. A simple calculation further shows that r(µsh, µsh) = r(µ, ν), and so to sample S from ν, it suffices to sample T of size n from νsh using Algorithm 2, and then output S = T ∩[n]. Hence, although we cannot in the general case sample from an ESR measure exactly (unlike many SR measures), being able to evaluate an ESR measure’s unnormalized density function allows us to leverage MCMC algorithms for approximate sampling. We now focus on bounding the mixing times of these algorithms. 3.2 Bounds on mixing time for the proposal and swapchain algorithms Writing ν′ t,S the distribution generated by a Markov chain sampler after t iterations and initialization set S, the mixing time τS(ϵ) measures the number of required iterations of the Markov chain so that ν′ t,S is close enough (in total variational distance) to the true ESR measure ν: τS(ϵ) ≜min{t : ∥ν′ t,S −ν∥TV ≤ϵ} It is easy to see from the above equation that the mixing time of a chain depends on how close the distribution generating the initialization set S is to the target distribution µ. We now show this explicitly for the two algorithms derived above, obtaining bounds on τS that directly depend on the r-closeness of the target ESR measure ν and an SR measure µ. For Algorithm 1, the mixing time explicitly depends on the quality of the proposal distribution. Theorem 2 (Alg. 1 mixing time). Let µ, ν be measures over 2[n] such that µ is SR and ν is ESR. Sampling from ν via Alg. 1 with µ as a proposal distribution has a mixing time τ(ϵ) such that τS(ϵ) ≤2r(µ, νp) log 1 ϵ . For the swapchain algorithm (Alg. 2), we derive a bound on the mixing time by comparing to a result by [5] which shows fast sampling for SR distributions over subsets of a fixed size. Theorem 3 ( Alg. 2 mixing time). Let ν be a k-homogeneous ESR measure over 2[n]. The mixing time for Alg. 2 with initialization S is bounded in expectation by τS(ϵ) ≤inf µ∈SR 2nk r(µ, ν)2 log 1 ϵν(S) The above bound depends on the closest SR distribution to the target measure ν. Combined with Prop. 2, Thm. 3 provides a simple upper bound to the mixing time of the swapchain algorithm. Corollary 1 (Non-homogeneous swapchain mixing time). Let ν be a non-homogeneous ESR measure over 2[n]. The mixing time for the generalized swapchain sampler to sample from ν with initialization S ⊆[2n] is bounded in expectation by τS(ϵ) ≤inf µ∈SR 4n2 r(µ, ν)2 log 1 ϵνsh(S) As a Markov chain’s applicability closely depends on its mixing time, a crucial task in sampling from ESR measures lies in finding an r-close SR distribution with small r. 5 3.3 Specific bounds for r-closeness We now derive explicit mixing time bounds for ESR measures ν generated by two popular classes of SR measures: DPPs, in their usual form as well as their k-homogeneous form (k-DPPs), and Dual Volume Sampling (DVS). As Theorem 2 and Theorem 3 provide mixing time bounds that depend explicitly on r(µ, ν), this section focuses on upper bounding r(µ, ν). To the extent of our knowledge, the results below are the first for either of these two classes of ESR distributions. Theorem 4 (E-DVS closeness bounds). Let n ≥k ≥m and let X ∈Rm×n be a maximal-rank matrix. Let µ be the Dual-Volume Sampling distribution over 2[n] for sets of size k: µ : S ⊆[n] → {0 if |S| ̸= k µ(S) ∝det(X[:, S]X[:, S]⊤) if |S| = k Let p > 0 and ν be the ESR measure induced by µ and p; let MinVol(X, S) be the smallest non-zero minor of degree m of X[:, S]. Then r(µ, ν) ≤ (n −m k −m )|1−p|( k m )−|1−p| det(XX⊤)|1−p|MinVol(X, S)−2|1−p| Theorem 5 (E-DPP closeness bound). Let µ be the distribution induced by a DPP with kernel L ⪰0 and ν be the E-DPP such that ν(S) ∝det(L[S])p. Let λ1 ≤· · · ≤λn be the ordered eigenvalues of L. Then, r(µ, νp) ≤ ∏n i=1(1 + λi)|1−p| ∏ λi<1 λ−|1−p| i . Theorem 6 (E-k-DPP closeness bound). Let µ be the distribution over 2[n] induced by a k-DPP (k ≤n) with kernel L, and let ν be the induced ESR measure with power p > 0. Then r(µ, ν) ≤ek(λ1, . . . , λn)|1−p| ∏k i=1 λ−|1−p| i . where ek the k-th elementary symmetric polynomial. One easily shows that the values r(µ, ν) we derive above for (k-) DPPs are loosely lower-bounded by κ|1−p|, where κ is the condition number of the kernel matrix L. However, it is possible to obtain a closer SR distribution to ν ∝det(L)p than the baseline choice of the DPP with kernel L: indeed, as L is positive semi-definite, we can also consider a DPP parametrized by kernel Lp. For the rest of this section, we define µ as the SR measure corresponding to the DPP with kernel Lp: µ(S) = det(Lp[S])/ det(I + Lp), and ν as the ESR measure such that µ(S) ∝det(L[S])p. Note that ν remains absolutely continuous with regard to µ. In this setting, upper bounding r(µ, ν) proves to be significantly more difficult, and is the focus of the remainder of this section. We first recall a useful expansion of the determinant of principal submatrices, fundamental to deriving the bounds below and potentially of more general interest. Lemma 1 (Shirai and Takahashi [44, Lemma 2.9]). Let H be an n × n Hermitian matrix with eigenvalues λ1, . . . , λn. There exists a 2n × 2n symmetric doubly stochastic matrix Q = [QSJ] indexed by subsets S, J of [n] such that det(H[S]) = ∑ J⊆[n],|J|=|S| QSJ ∏ i∈J λi. Q can be chosen to depend only on the eigenvectors of H and to satisfy QSJ = 0 for |S| ̸=|J|. The above lemma allows us to bound det(Lp[S]) det(L[S]p) in terms of the generalized condition number of L. Definition 4 (Generalized condition number). Given a matrix L ∈Pn with eigenvalues λ1, . . . , λn, we define its generalized condition number of order k as κk = (λ1 · · · λk)(λn · · · λn−k)−1. Note that κk is the usual condition number of the k-th exterior power L∧k (in particular κk ≥κk). Given the generalized conditioned number, Lemma 1 combined with the power-mean inequality [45] (see App. D) suffices to bound the gap between volumes generated by E-DPPs and DPPs: 6 Theorem 7. Let µ be the distribution induced by a DPP with kernel Lp, and ν be the corresponding E-DPP such that ν ∝det(L[S])p. Then r(µ, ν) ≤r(κ⌊n/2⌋, p) where r(κ, p) is defined by r(κ, p) =      ( p(κ−1) κp−1 )p( (1−p)(κ−1) κ−κp )1−p for 0 < p < 1 ( κp−1 p(κ−1) )p( (p−1)(κ−1) κp−κ )p−1 for p > 1 Corollary 2. Let µ be the distribution induced by a k-DPP with kernel Lp, and ν be the corresponding ESR measure such that ν(S) ∝det(L[S])p. Then r(µ, ν) ≤r(κk, p). As shown in Figure 4 (App. D), the upper bound 7 grows slower than κ: this shows that the µ(S) ∝ det(Lp[S]) is a closer SR distribution to an E-DPP with kernel L than the E-DPP’s generating SR distribution, and leads to finer mixing time bounds. Note that the per-iteration complexity of both algorithms must also be taken into account when choosing a sampling procedure: for E-DPPs, despite Alg. 1’s smaller mixing time, Alg. 2 is more efficient in cases when n large due to the comparative costs of each sampling round. 4 Experiments To evaluate the empirical applications of ESR measures, we evaluate E-DPPs (DPPs are by far the most popular SR measure in machine learning) on a variety of machine learning task. In all cases where we use the proposal MCMC sampler (Alg. 1), we use the DPP with kernel Lp as a proposal. 4.1 Evaluating mixing time We begin our experiments by empirically evaluating the mixing time of both algorithms. We measure mixing using the classical Potential Scale Reduction Factor (PSRF) metric [13]. As the PSRF converges to 1, the chain mixes. In the following experiments, we report the mixing time (number of iterations) necessary to reach a PSRF of 1.05, as well as the runtime (in seconds) to convergence, averaged over 5 iterations; we use matrices with a fixed κk across all mixing time experiments. 10 20 30 40 50 60 70 80 90 100 Set size 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 Mixing time ×102 (a) Proposal, r = 2.0 0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 Runtime (s) ×101 10 20 30 40 50 60 70 80 90 100 Set size 0.0 0.5 1.0 1.5 2.0 2.5 3.0 Mixing time ×103 (b) Swapchain, r = 2.0 0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 Runtime (s) ×10−1 Figure 2: Mixing and sampling time for E-k-DPPs as a function of the set size k. In both cases, the mixing time grows linearly with k; although the mixing time for the proposal algorithm is an order of magnitude smaller than for the swapchain algorithm, the latter samples faster due to the per-iteration cost of each transition step. The mixing time for proposal-based sampling is an order of magnitude smaller than swap-chain sampling; this is in line with the bounds we provide in Theorems 2 and 3. However, this does not translate into faster runtimes: indeed, the per-iteration complexity of proposal-based sampling is significantly higher than for the swapchain algorithm, as Alg. 1 samples from a DPP at each iteration. The evolution of mixing and wall clock times as a function of N is provided in Appendix E. 4.2 Anomaly detection We now focus on applications for E-DPPs; we begin by evaluating the use of E-DPPs for outlier detection. As increasing p hightens the model’s sensitivity to diversity, we expect p > 1 to provide better outlier detection. To our knowledge, this is the first application of DPPs to outlier detection, and so our goal for this experiment is not to improve upon state-of-the-art results, but to compare the performance of (E-)DPPs for various values of p to standard outlier detection algorithms. Experimentally, we detect an outlier via the following approach: given a dataset of n points and an E-DPP with an RBF kernel built from the data (bandwidth β = 100), we sample n 5 subsets of size 50 7 and report as outliers points that appear at least nε times, where ε is a tunable parameter (hence, if we were doing uniform sampling, each point in the dataset would be sampled on average 10 times). We detect outliers on three public datasets: the UCI Breast Cancer Wisconsin dataset [46] modified as in [24, 28] as well as the Letter and Speech datasets fom [39]. We also report the performance of a selection of standard outlier detection algorithms whose reported performance in [24] is competitive with other outlier detection algorithms: Local Outlier Factor (LOF) [12], k-Nearest Neighbor (kNN) [7], Histogram-based Outlier Score (HBOS) [23], Local Outlier Probability (LoOP) [28] and unweighted Cluster-Based Local Outlier Factor (uCBLOF) [3, 24]. p 0.5 1 2 LOF∗ k-NN∗ HBOS∗ LoOP∗ uCBLOF∗ Cancer 0.952± 0.018 0.962± 0.004 0.965± 0.001 0.982 ± 0.002 0.979 ± 0.001 0.983 ± 0.002 0.973 ± 0.012 0.950 ± 0.039 Letter 0.780± 0.013 0.820± 0.003 0.847± 0.002 0.867 ± 0.027 0.872 ± 0.018 0.622 ± 0.007 0.907 ± 0.008 0.819 ± 0.023 Speech 0.455± 0.007 0.439± 0.011 0.445± 0.002 0.504 ± 0.022 0.497 ± 0.010 0.471 ± 0.003 0.535 ± 0.034 0.469 ± 0.003 Table 1: AUC (mean + standard deviation) for E-DPPs and standard outlier detection algorithms. As expected, we see that a higher exponent leads to a stronger preference for diversity and hence a better outlier detection scheme. Only LoOP and LOF consistently outperform E-DPPs. Results are reported in Table 1; as expected, we see that larger values of p (in this case, p = 2) are more sensitive to outliers, and provide better models for outlier detection. 4.3 E-DPPs for the Nyström method As a more standard application of DPPs, we now investigate the use of E-DPPs for kernel reconstruction via the Nyström method [40, 47]. Given a large kernel K, the Nyström method selects a subset C of columns (“landmarks”) of K and approximates K as K[:, C]K†[C, C]K[C, :]. Unsurprisingly, DPPs have successfully been applied to the landmark selection for the Nyström approach [2, 30]. We show here that E-DPPs further improve upon the recent results of [30] for kernel reconstruction. We apply Kernel Ridge Regression to 3 regression datasets: Ailerons, Bank32NH, and Machine CPU2. We subsample 4,000 points from each dataset (3,000 training and 1,000 test) and use an RBF kernel and choose the bandwidth β and regularization parameter λ for each dataset by 10-fold cross-validation. Results are averaged over 3 random subsets of data, using the swapchain sampler initialized with k-means++ and run for 3000 iterations. unif lev reglev DPP E-DPP (p = 0.5) E-DPP (p = 2) 20 30 40 50 60 70 80 90 100 Landmark count 0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 Test error ×102 (a) Ailerons dataset 20 30 40 50 60 70 80 90 100 Landmark count 0.0 0.2 0.4 0.6 0.8 1.0 Test error ×101 (b) Bank32NH dataset 20 30 40 50 60 70 80 90 100 Landmark count 0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 Test error (c) CPU dataset Figure 3: Prediction error on regression datasets; we compare various E-DPP models to uniform sampling (“unif”) as well as leverage and regularized leveraged sampling (“lev” and “reglev”). On all datasets, the EDPPs achieve the lowest error, with the largest exponent p = 2 performing markedly better than other methods. We evaluate the quality of the sampler via the prediction error on the held-out test set. Figure 3 reports the results. Consistently across all datasets, p = 2 outperforms all other samplers in terms of the prediction error, in particular when only sampling a few landmarks. Interestingly, we also see that the reconstruction error tends to be smaller when p = 1 2 (see Appendix F). 5 Conclusion and extensions Many machine learning problems have been shown to benefit from the negative dependence properties of Strongly Rayleigh measures: measures based on elementary symmetric polynomials – including (dual) volume sampling – have been applied to experimental design; DPPs have been applied 2http://www.dcc.fc.up.pt/~ltorgo/Regression/DataSets.html 8 successfully to fields ranging from automatic summarization to minibatch selection and neural network pruning. However, tuning the strength of the quality/diversity tradeoff of SR measures requires significant effort. We introduced Exponentiated Strongly Rayleigh measures, an extension of Strongly Rayleigh measures which augment standard SR measures with an exponent p, allowing for straightforward tuning of the the quality-diversity trade-off of SR distributions. Intuitively, p controls how much priority should be given to diversity requirements. We show that although ESR measures do not necessarily remain SR, but certain distributions lie at the intersection of both classes. Despite their intractable partition function, ESR measures can leverage existing fast-mixing Markov chains for SR measures, enabling finer bounds than those obtained for the broader class of logsubmodular models. We derive general-purpose mixing bounds based on the distance from the target distribution ν to an SR distribution µ; we then show that these bounds can be further improved by specifying a carefully calibrated SR proposal distribution µ, as is the case for Exponentiated DPPs. We verified empirically that ESR measures and the algorithms we derive are valuable modeling tools for machine learning tasks, such as outlier detection and kernel reconstruction. Finally, let us note that there remain several theoretical and practical open questions regarding ESR measures; in particular, we believe that further specifying the class of ESR measures that also remain SR may provide valuable insight into the study of negatively associated measures. Finally, one easily verifies that given µ SR and a collection of i.i.d. subsets S = {S1, . . . , Sm}, the MLE problem that finds the best p > 0 to model S as being sampled from an ESR ν ∝µp is convex: argmaxp>0 p m ∑m k=1 log µ(Si) −log ( ∑ S⊆[n] µ(S)p) . (5.1) As such, standard convex optimization algorithms can be leveraged to select p, potentially after leaning a parametrization of µ. Acknowledgements. This work is in part supported by NSF CAREER award 1553284, NSFBIGDATA award 1741341, and by The Defense Advanced Research Projects Agency (grant number YFA17 N66001-17-1-4039). The views, opinions, and/or findings contained in this article are those of the author and should not be interpreted as representing the official views or policies, either expressed or implied, of the Defense Advanced Research Projects Agency or the Department of Defense. References [1] R. Affandi, E. Fox, R. Adams, and B. Taskar. Learning the parameters of Determinantal Point Process kernels. In ICML, 2014. [2] R. H. Affandi, A. Kulesza, E. B. Fox, and B. Taskar. Nyström approximation for large-scale determinantal processes. In Proc. Int. Conference on Artificial Intelligence and Statistics (AISTATS), 2013. [3] M. Amer and M. Goldstein. Nearest-neighbor and clustering based anomaly detection algorithms for rapidminer. In Proceedings of the 3rd RapidMiner Community Meeting and Conferernce (RCOMM 2012), pages 1–12. Shaker Verlag GmbH, 8 2012. [4] N. Anari and S. Oveis Gharan. A generalization of permanent inequalities and applications in counting and optimization. In Proceedings of the 49th Annual ACM SIGACT Symposium on Theory of Computing (STOC). ACM, 2017. [5] N. Anari, S. O. Gharan, and A. Rezaei. Monte Carlo Markov Chain algorithms for sampling strongly Rayleigh distributions and Determinantal Point Processes. In Conference on Learning Theory (COLT), 2016. [6] C. Andrieu, N. D. Freitas, and et al. An introduction to MCMC for machine learning, 2003. [7] F. Angiulli and C. Pizzuti. Fast outlier detection in high dimensional spaces. In Proceedings of the 6th European Conference on Principles of Data Mining and Knowledge Discovery, PKDD ’02, pages 15–26, London, UK, UK, 2002. Springer-Verlag. [8] H. Avron and C. Boutsidis. Faster subset selection for matrices and applications. SIAM J. Matrix Analysis Applications, 34(4):1464–1499, 2013. [9] J. Borcea and P. Brändén. Applications of stable polynomials to mixed determinants: Johnson’s conjectures, unimodality and mixed fischer products. Duke Math. J., pages 205–223, 2008. 9 [10] J. Borcea and P. Brändén. Pólya-schur master theorems for circular domains and their boundaries. Annals of Mathematics, 170(1):465–492, 2009. [11] J. Borcea, P. Bränden, and T. Liggett. Negative dependence and the geometry of polynomials. Journal of American Mathematical Society, 22:521–567, 2009. [12] M. M. Breunig, H.-P. Kriegel, R. T. Ng, and J. Sander. LOF: Identifying density-based local outliers. SIGMOD Rec., 29(2):93–104, May 2000. [13] S. P. Brooks and A. Gelman. General methods for monitoring convergence of iterative simulations. Journal of Computational and Graphical Statistics, 7:434–455, 1998. [14] H. Cai. Exact bound for the convergence of metropolis chains. Stochastic Analysis and Applications, 18(1):63–71, 2000. [15] W. Chao, B. Gong, K. Grauman, and F. Sha. Large-margin Determinantal Point Processes. In Uncertainty in Artificial Intelligence (UAI), 2015. [16] M. Derezinski and M. K. Warmuth. Unbiased estimates for linear regression via volume sampling. In Advances in Neural Information Processing Systems 30, pages 3084–3093. Curran Associates, Inc., 2017. [17] P. Diaconis and L. Saloff-Coste. Comparison theorems for reversible Markov chains. The Annals of Applied Probability, 3(3):696–730, 1993. [18] P. Diaconis and D. Stroock. Geometric bounds for eingenvalues of Markov Chains. Annals of Applied Probability, pages 36–61, 1991. [19] J. Djolonga and A. Krause. From MAP to marginals: Variational inference in bayesian submodular models. In Advances in Neural Information Processing Systems 27, pages 244–252. Curran Associates, Inc., 2014. [20] J. Djolonga, S. Tschiatschek, and A. Krause. Variational inference in mixed probabilistic submodular models. In Neural Information Processing Systems (NIPS), 2016. [21] M. Gartrell, U. Paquet, and N. Koenigstein. Low-rank factorization of Determinantal Point Processes. In Proceedings of the Thirty-First AAAI Conference on Artificial Intelligence, February 4-9, 2017, San Francisco, California, USA., pages 1912–1918, 2017. [22] J. Gillenwater. Approximate Inference for Determinantal Point Processes. PhD thesis, University of Pennsylvania, 2014. [23] M. Goldstein and A. Dengel. Histogram-based outlier score (HBOS): A fast unsupervised anomaly detection algorithm. In KI-2012: Poster and Demo Track. German Conference on Artificial Intelligence (KI-2012), 35th, September 24-27, Saarbrücken, Germany, pages 59–63, 9 2012. [24] M. Goldstein and S. Uchida. A comparative evaluation of unsupervised anomaly detection algorithms for multivariate data. PLOS ONE, 11(4):1–31, 04 2016. [25] A. Gotovos, S. Hassani, and A. Krause. Sampling from probabilistic submodular models. In Advances in Neural Information Processing Systems (NIPS), 2015. [26] W. K. Hastings. Monte carlo sampling methods using markov chains and their applications. Biometrika, 57(1):97–109, 1970. [27] A. Krause, A. Singh, and C. Guestrin. Near-optimal sensor placements in gaussian processes: Theory, efficient algorithms and empirical studies. Journal of Machine Learning Research, 9: 235–284, 2008. [28] H.-P. Kriegel, P. Kröger, E. Schubert, and A. Zimek. LoOP: Local outlier probabilities. In Proceedings of the 18th ACM Conference on Information and Knowledge Management, CIKM ’09, pages 1649–1652, New York, NY, USA, 2009. ACM. [29] A. Kulesza and B. Taskar. Determinantal Point Processes for machine learning, volume 5. Foundations and Trends in Machine Learning, 2012. [30] C. Li, S. Jegelka, and S. Sra. Fast DPP sampling for Nyström with appication to kernel methods. In Proceedings of the 33rd International Conference on International Conference on Machine Learning - Volume 48, ICML’16, pages 2061–2070. JMLR.org, 2016. [31] C. Li, S. Jegelka, and S. Sra. Fast mixing Markov chains for strongly Rayleigh measures, DPPs, and constrained sampling. In Advances in Neural Information Processing Systems (NIPS), 2016. [32] C. Li, S. Jegelka, and S. Sra. Fast DPP sampling for Nyström with application to kernel methods. In Int. Conference on Machine Learning (ICML), 2016. [33] C. Li, S. Jegelka, and S. Sra. Polynomial time algorithms for dual volume sampling. In Advances in Neural Information Processing Systems 30, pages 5038–5047. Curran Associates, 10 Inc., 2017. [34] H. Lin and J. Bilmes. Learning mixtures of submodular shells with application to document summarization. In Uncertainty in Artificial Intelligence (UAI), 2012. [35] A. W. Marcus, D. A. Spielman, and N. Srivastava. Interlacing families II: Mixed characteristic polynomials and the Kadison-Singer problem. Annals of Mathematics, 182(1):327–350, 2015. [36] Z. Mariet and S. Sra. Diversity networks. In International Conference on Learning Representations (ICLR), 2016. [37] Z. Mariet and S. Sra. Elementary symmetric polynomials for optimal experimental design. In Advances in Neural Information Processing Systems 30, pages 2136–2145. Curran Associates, Inc., 2017. [38] N. Metropolis, A. W. Rosenbluth, M. N. Rosenbluth, A. H. Teller, and E. Teller. Equation of state calculations by fast computing machines. The Journal of Chemical Physics, 21(6): 1087–1092, 1953. [39] B. Micenková, B. McWilliams, and I. Assent. Learning outlier ensembles: The best of both worlds – supervised and unsupervised. In Proceedings of the ACM SIGKDD 2014 Workshop on outlier Detection and Description under Data Diversity, 2014. [40] E. Nyström. Über die praktische Auflösung von Integralgleichungen mit Anwendungen auf Randwertaufgaben. Acta Mathematica, 54(1):185–204, 1930. [41] R. Pemantle. Towards a theory of negative dependence. Journal of Mathematical Physics, 41: 1371–1390, 2000. [42] R. Pemantle and Y. Peres. Concentration of Lipschitz functionals of determinantal and other strong Rayleigh measures. Combinatorics, Probability and Computing, 23(1):140160, 2014. [43] P. Rebeschini and A. Karbasi. Fast mixing for discrete point processes. In Conference on Learning Theory (COLT), 2015. [44] T. Shirai and Y. Takahashi. Random point fields associated with certain Fredholm determinants I: fermion, Poisson and boson point processes. Journal of Functional Analysis, 205(2):414– 463, 2003. [45] W. Specht. Zur Theorie der elementaren Mittel. Math. Zeitschr., 74:91–98, 1960. [46] N. Street, W. H. Wolberg, and O. L. Mangasarian. Nuclear feature extraction for breast tumor diagnosis, 1993. [47] C. K. I. Williams and M. Seeger. Using the Nyström method to speed up kernel machines. In Advances in Neural Information Processing Systems 13, pages 682–688. MIT Press, 2001. [48] T. Zhou, Z. Kuscsik, J.-G. Liu, M. Medo, J. R. Wakeling, and Y.-C. Zhang. Solving the apparent diversity-accuracy dilemma of recommender systems. PNAS, 107(10):4511–4515, 2010. [49] J. Y. Zou and R. Adams. Priors for diversity in generative latent variable models. In Advances in Neural Information Processing Systems (NIPS), 2012. 11
2018
130
7,287
Variational Inference with Tail-adaptive f-Divergence Dilin Wang UT Austin dilin@cs.utexas.edu Hao Liu ∗ UESTC uestcliuhao@gmail.com Qiang Liu UT Austin lqiang@cs.utexas.edu Abstract Variational inference with α-divergences has been widely used in modern probabilistic machine learning. Compared to Kullback-Leibler (KL) divergence, a major advantage of using α-divergences (with positive α values) is their mass-covering property. However, estimating and optimizing α-divergences require to use importance sampling, which may have large or infinite variance due to heavy tails of importance weights. In this paper, we propose a new class of tail-adaptive fdivergences that adaptively change the convex function f with the tail distribution of the importance weights, in a way that theoretically guarantees finite moments, while simultaneously achieving mass-covering properties. We test our method on Bayesian neural networks, and apply it to improve a recent soft actor-critic (SAC) algorithm (Haarnoja et al., 2018) in deep reinforcement learning. Our results show that our approach yields significant advantages compared with existing methods based on classical KL and α-divergences. 1 Introduction Variational inference (VI) (e.g., Jordan et al., 1999; Wainwright et al., 2008) has been established as a powerful tool in modern probabilistic machine learning for approximating intractable posterior distributions. The basic idea is to turn the approximation problem into an optimization problem, which finds the best approximation of an intractable distribution from a family of tractable distributions by minimizing a divergence objective function. Compared with Markov chain Monte Carlo (MCMC), which is known to be consistent but suffers from slow convergence, VI provides biased results but is often practically faster. Combined with techniques like stochastic optimization (Ranganath et al., 2014; Hoffman et al., 2013) and reparameterization trick (Kingma & Welling, 2014), VI has become a major technical approach for advancing Bayesian deep learning, deep generative models and deep reinforcement learning (e.g., Kingma & Welling, 2014; Gal & Ghahramani, 2016; Levine, 2018). A key component of successful variational inference lies on choosing a proper divergence metric. Typically, closeness is defined by the KL divergence KL(q || p) (e.g., Jordan et al., 1999), where p is the intractable distribution of interest and q is a simpler distribution constructed to approximate p. However, VI with KL divergence often under-estimates the variance and may miss important local modes of the true posterior (e.g., Christopher, 2016; Blei et al., 2017). To mitigate this issue, alternative metrics have been studied in the literature, a large portion of which are special cases of f-divergence (e.g., Csiszár & Shields, 2004): Df(p || q) = Ex∼q  f p(x) q(x)  −f(1)  , (1) where f : R+ →R is any convex function. The most notable class of f-divergence that has been exploited in VI is α-divergence, which takes f(t) = tα/(α(α −1)) for α ∈R \ {0, 1}. By choosing different α, we get a large number of well-known divergences as special cases, including the standard ∗Work done at UT Austin 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. KL divergence objective KL(q || p) (α →0), the KL divergence with the reverse direction KL(p || q) (α →1) and the χ2 divergence (α = 2). In particular, the use of general α-divergence in VI has been widely discussed (e.g., Minka et al., 2005; Hernández-Lobato et al., 2016; Li & Turner, 2016); the reverse KL divergence is used in expectation propagation (Minka, 2001; Opper & Winther, 2005), importance weighted auto-encoders (Burda et al., 2016), and the cross entropy method (De Boer et al., 2005); χ2-divergence is exploited for VI (e.g., Dieng et al., 2017), but is more extensively studied in the context of adaptive importance sampling (IS) (e.g., Cappé et al., 2008; Ryu & Boyd, 2014; Cotter et al., 2015), since it coincides with the variance of the IS estimator with q as the proposal. A major motivation of using α-divergence contributes to its mass-covering property: when α > 0, the optimal approximation q tends to cover more modes of p, and hence better accounts for the uncertainty in p. Typically, larger values of α enforce stronger mass-covering properties. In practice, however, α divergence and its gradient need to be estimated empirically using samples from q. Using large α values may cause high or infinite variance in the estimation because it involves estimating the α-th power of the density ratio p(x)/q(x), which is likely distributed with a heavy or fat tail (e.g., Resnick, 2007). In fact, when q is very different from p, the expectation of ratio (p(x)/q(x))α can be infinite (that is, α-divergence does not exist). This makes it problematic to use large α values, despite the mass-covering property it promises. In addition, it is reasonable to expect that the optimal setting of α should vary across training processes and learning tasks. Therefore, it is desirable to design an approach to choose α adaptively and automatically as q changes during the training iterations, according to the distribution of the ratio p(x)/q(x). Based on theoretical observations on f-divergence and fat-tailed distributions, we design a new class of f-divergence which is tail-adaptive in that it uses different f functions according to the tail distribution of the density ratio p(x)/q(x) to simultaneously obtain stable empirical estimation and a strongest possible mass-covering property. This allows us to derive a new adaptive f-divergencebased variational inference by combining it with stochastic optimization and reparameterization gradient estimates. Our main method (Algorithm 1) has a simple form, which replaces the f function in (1) with a rank-based function of the empirical density ratio w = p(x)/q(x) at each gradient descent step of q, whose variation depends on the distribution of w and does not explode regardless the tail of w. Empirically, we show that our method can better recover multiple modes for variational inference. In addition, we apply our method to improve a recent soft actor-critic (SAC) algorithm (Haarnoja et al., 2018) in reinforcement learning (RL), showing that our method can be used to optimize multi-modal loss functions in RL more efficiently. 2 f-Divergence and Friends Given a distribution p(x) of interest, we want to approximate it with a simpler distribution from a family {qθ(x): θ ∈Θ}, where θ is the variational parameter that we want to optimize. We approach this problem by minimizing the f-divergence between qθ and p: min θ∈Θ  Df(p || qθ) = Ex∼qθ  f  p(x) qθ(x)  −f(1)  ,  (2) where f : R+ →R is any twice differentiable convex function. It can be shown by Jensen’s inequality that Df(p || q) ≥0 for any p and q. Further, if f(t) is strictly convex at t = 1, then Df(p || q) = 0 implies p = q. The optimization in (2) can be solved approximately using stochastic optimization in practice by approximating the expectation Ex∼qθ[·] using samples drawing from qθ at each iteration. The f-divergence includes a large spectrum of important divergence measures. It includes KL divergence in both directions, KL(q || p) = Ex∼q  log q(x) p(x)  , KL(p || q) = Ex∼q p(x) q(x) log p(x) q(x)  , (3) which correspond to f(t) = −log t and f(t) = t log t, respectively. KL(q || p) is the typical objective function used in variational inference; the reversed direction KL(p || q) is also used in various settings (e.g., Minka, 2001; Opper & Winther, 2005; De Boer et al., 2005; Burda et al., 2016). 2 More generally, f-divergence includes the class of α-divergence, which takes fα(t) = tα/(α(α−1)), α ∈R \ {0, 1} and hence Dfα(p || q) = 1 α(α −1)Ex∼q p(x) q(x) α −1  . (4) One can show that KL(q || p) and KL(p || q) are the limits of Dfα(q || p) when α →0 and α →1, respectively. Further, one obtain Helinger distance and χ2-divergence as α = 1/2 and α = 2, respectively. In particular, χ2-divergence (α = 2) plays an important role in adaptive importance sampling, because it equals the variance of the importance weight w = p(x)/q(x) and minimizing χ2-divergence corresponds to finding an optimal importance sampling proposal. 3 α-Divergence and Fat Tails A major motivation of using α divergences as the objective function for approximate inference is their mass-covering property (also known as the zero-avoiding behavior). This is because α-divergence is proportional to the α-th moment of the density ratio p(x)/q(x). When α is positive and large, large values of p(x)/q(x) are strongly penalized, preventing the case of q(x) ≪p(x). In fact, whenever Dfα(p || q) < ∞, we have p(x) > 0 imply q(x) > 0. This means that the probability mass and local modes of p are taken into account in q properly. Note that the case when α ≤0 exhibits the opposite property, that is, p(x) = 0 must imply q(x) = 0 to make Dfα(q||p) finite when α ≤0; this includes the typical KL divergence KL(q || p) (α = 0), which is often criticized for its tendency to under-estimate the uncertainty. Typically, using larger values of α enforces stronger mass-covering properties. In practice, however, larger values of α also increase the variance of the empirical estimators, making it highly challenging to optimize. In fact, the expectation in (4) may not even exist when α is too large. This is because the density ratio w := p(x)/q(x) often has a fat-tailed distribution. A non-negative random variable w is called fat-tailed2 (e.g., Resnick, 2007) if its tail probability ¯Fw(t) := Pr(w ≥t) is asymptotically equivalent to t−α∗as t →+∞for some finite positive number α∗(denoted by ¯Fw(t) ∼t−α∗), which means that ¯Fw(t) = t−α∗L(t), where L is a slowly varying function that satisfies limt→+∞L(ct)/L(t) = 1 for any c > 0. Here α∗determines the fatness of the tail and is called the tail index of w. For a fat-tailed distribution with index α∗, its α-th moment exists only if α < α∗, that is, E[wα] < ∞iff α < α∗. It turns out the density ratio w := p(x)/q(x), when x ∼q, tends to have a fat-tailed distribution when q is more peaked than p. The example below illustrates this with simple Gaussian distributions. Example 3.1. Assume p(x) = N(x; 0, σ2 p) and q(x) = N(x; 0, σ2 q). Let x ∼q and w = p(x)/q(x) the density ratio. If σp > σq, then w has a fat-tailed distribution with index α∗= σ2 p/(σ2 p −σ2 q). On the other hand, if σp ≤σq, then w is bounded and not fat-tailed (effectively, α∗= +∞). By the definition above, if the importance weight w = p(x)/q(x) has a tail index α∗, the α-divergence Dfα(p || q) exists only if α < α∗. Although it is desirable to use α-divergence with large values of α as VI objective function, it is important to keep α smaller than α∗to ensure that the objective and gradient are well defined. The problem, however, is that the tail index α∗is unknown in practice, and may change dramatically (e.g., even from finite to infinite) as q is updated during the optimization process. This makes it suboptimal to use a pre-fixed α value. One potential way to address this problem is to estimate the tail index α∗empirically at each iteration using a tail index estimator (e.g., Hill et al., 1975; Vehtari et al., 2015). Unfortunately, tail index estimation is often challenging and requires a large number of samples. The algorithm may become unstable if α∗is over-estimated. 4 Hessian-based Representation of f-Divergence In this work, we address the aforementioned problem by designing a generalization of f-divergence in which f adaptively changes with p and q, in a way that always guarantees the existence of the 2Fat-tailed distributions is a sub-class of heavy-tailed distributions, which are distributions whose tail probabilities decay slower than exponential functions, that is, limt→+∞exp(λt) ¯Fw(t) = ∞for all λ > 0. 3 expectation, while simultaneous achieving (theoretically) strong mass-covering equivalent to that of the α-divergence with α = α∗. One challenge of designing such adaptive f is that the convex constraint over function f is difficult to express computationally. Our first key observation is that it is easier to specify a convex function f through its second order derivative f ′′, which can be any non-negative function. It turns out f-divergence, as well as its gradient, can be conveniently expressed using f ′′, without explicitly defining the original f. Proposition 4.1. 1) Any twice differentiable convex function f : R+ ∪{0} →R with finite f(0) can be decomposed into linear and nonlinear components as follows f(t) = (at + b) + Z ∞ 0 (t −µ)+h(µ)dµ, (5) where h is a non-negative function, (t)+ = max(0, t), and a,b ∈R. In this case, h = f ′′(t), a = f ′(0) and b = f(0). Conversely, any non-negative function h and a, b ∈R specifies a convex function. 2) This allows us to derive an alternative representation of f-divergence: Df(p || q) = Z ∞ 0 f ′′(µ)Ex∼q "p(x) q(x) −µ  + # dµ −c, (6) where c := R 1 0 f ′′(µ)(1 −µ)dµ = f(1) −f(0) −f ′(0) is a constant. Proof. If f(t) = (at + b) + R ∞ 0 (t −µ)+h(µ)dµ, calculation shows f ′(t) = a + Z t 0 h(µ)dµ, f ′′(t) = h(t). Therefore, f is convex iff h is non-negative. See Appendix for the complete proof. Eq (6) suggests that all f-divergences are conical combinations of a set of special f-divergences of form Ex∼q[(p(x)/q(x) −µ)+ −f(1)] with f(t) = (t −µ)+. Also, every f-divergence is completely specified by the Hessian f ′′, meaning that adding f with any linear function at + b does not change Df(p || q). Such integral representation of f-divergence is not new; see e.g., Feldman & Osterreicher (1989); Osterreicher (2003); Liese & Vajda (2006); Reid & Williamson (2011); Sason (2018). For the purpose of minimizing Df(p || qθ) (θ ∈Θ) in variational inference, we are more concerned with calculating the gradient, rather than the f-divergence itself. It turns out the gradient of Df(p || qθ) is also directly related to Hessian f ′′ in a simple way. Proposition 4.2. 1) Assume log qθ(x) is differentiable w.r.t. θ, and f is a differentiable convex function. For f-divergence defined in (2), we have ∇θDf(p || qθ) = −Ex∼qθ  ρf  p(x) qθ(x)  ∇θ log qθ(x)  , (7) where ρf(t) = f ′(t)t −f(t) (equivalently, ρ′ f(t) = f ′′(t)t if f is twice differentiable). 2) Assume x ∼qθ is generated by x = gθ(ξ) where ξ ∼q0 is a random seed and gθ is a function that is differentiable w.r.t. θ. Assume f is twice differentiable and ∇x log(p(x)/qθ(x)) exists. We have ∇θDf(p || qθ) = −Ex=gθ(ξ),ξ∼q0  γf  p(x) qθ(x)  ∇θgθ(ξ)∇x log(p(x)/qθ(x))  , (8) where γf(t) = ρ′ f(t)t = f ′′(t)t2. The result above shows that the gradient of f-divergence depends on f through ρf or γf. Taking α-divergence (α /∈{0, 1}) as example, we have f(t) = tα/(α(α −1)), ρf(t) = tα/α, γf(t) = tα, 4 all of which are proportional to the power function tα. For KL(q || p), we have f(t) = −log t, yielding ρf(t) = log t −1 and γf(t) = 1; for KL(p || q), we have f(t) = t log t, yielding ρf(t) = t and γf(t) = t. The formulas in (7) and (8) are called the score-function gradient and reparameterization gradient (Kingma & Welling, 2014), respectively. Both equal the gradient in expectation, but are computationally different and yield empirical estimators with different variances. In particular, the score-function gradient in (7) is “gradient-free” in that it does not require calculating the gradient of the distribution p(x) of interest, while (8) is “gradient-based” in that it involves ∇x log p(x). It has been shown that optimizing with reparameterization gradients tend to give better empirical results because it leverages the gradient information ∇x log p(x), and yields a lower variance estimator for the gradient (e.g., Kingma & Welling, 2014). Our key observation is that we can directly specify f through any increasing function ρf, or nonnegative function γf in the gradient estimators, without explicitly defining f. Proposition 4.3. Assume f : R+ →R is convex and twice differentiable, then 1) ρf in (7) is a monotonically increasing function on R+. In addition, for any differentiable increasing function ρ, there exists a convex function f such that ρf = ρ; 2) γf in (8) is non-negative on R+, that is, γf(t) ≥0, ∀t ∈R+. In addition, for any non-negative function γ, there exists a convex function f such that γf = γ; 3) if ρ′ f(t) is strictly increasing at t = 1 (i.e., ρ′ f(1) > 0), or γf(t) is strictly positive at t = 1 (i.e., γf(1) > 0), then Df(p || q) = 0 implies p = q. Proof. Because f is convex (f ′′(t) ≥0), we have γf(t) = f ′′(t)t2 ≥0 and ρ′ f(t) = f ′′(t)t ≥0 on t ∈R+, that is, γf is non-negative and ρf is increasing on R+. If ρt is strictly increasing (or γf is strictly positive) at t = 1, we have f is strictly convex at t = 1, which guarantees Df(p || q) = 0 imply p = q. For non-negative function γ(t) (or increasing function ρ(t)) on R+, any convex function f whose second-order derivative equals γ(t)/t2 (or ρ′ f(t)/t) satisfies γf = γ (resp. ρf = ρ). 5 Safe f-Divergence with Inverse Tail Probability The results above show that it is sufficient to find an increasing function ρf, or a non-negative function γf to obtain adaptive f-divergence with computable gradients. In order to make the f-divergence “safe”, we need to find ρf or γf that adaptively depends on p and q such that the expectation in (7) and (8) always exists. Because the magnitude of ∇θ log qθ(x), ∇x log(p(x)/qθ(x)) and ∇θgθ(ξ) are relatively small compared with the ratio p(x)/q(x), we can mainly consider designing function ρ (or γ) such that they yield finite expectation Ex∼q[ρ(p(x)/q(x))] < ∞; meanwhile, we should also keep the function large, preferably with the same magnitude as tα∗, to provide a strong mode-covering property. As it turns out, the inverse of the tail probability naturally achieves all these goals. Proposition 5.1. For any random variable w with tail distribution ¯Fw(t) := Pr(w ≥t) and tail index α∗, we have E[ ¯Fw(w)β] < ∞, for any β > −1. Also, we have ¯Fw(t)β ∼t−βα∗, and ¯Fw(t)β is always non-negative and monotonically increasing when β < 0. Proof. Simply note that E[ ¯Fw(w)β] = R ¯Fw(t)βd ¯Fβ(t) = R 1 0 tβdt, which is finite only when β > −1. The non-negativity and monotonicity of ¯Fw(t)β are obvious. ¯Fw(t)β ∼t−βα∗directly follows the definition of the tail index. This motivates us to use ¯Fw(t)β to define ρf or γf, yielding two versions of “safe” tail-adaptive f divergences. Note that here f is defined implicitly through ρf or γf. Although it is possible to derive the corresponding f and Df(p || q), there is no computational need to do so, since optimizing the objective function only requires calculating the gradient, which is defined by ρf or γf. 5 Algorithm 1 Variational Inference with Tail-adaptive f-Divergence (with Reparameterization Gradient) Goal: Find the best approximation of p(x) from {qθ : θ ∈Θ}. Assume x ∼qθ is generated by x = gθ(ξ) where ξ is a random sample from noise distribution q0. Initialize θ, set an index β (e.g., β = −1). for iteration do Draw {xi}n i=1 ∼qθ, generated by xi = gθ(ξi). Let wi = p(xi)/qθ(xi), ˆ¯Fw(t) = Pn j=1 I(wj ≥t)/n, and set γi = ˆ¯Fw(wi)β. Update θ ←θ + ϵ∆θ, with ϵ is step size, and ∆θ = 1 zγ n X i=1 [γi∇θgθ(ξi)∇x log(p(xi)/qθ(xi))] , where zγ = n X i=1 γi. end for In practice, the explicit form of ¯Fw(t)β is unknown. We can approximate it based on empirical data drawn from q. Let {xi} be drawn from q and wi = p(xi)/q(xi), then we can approximate the tail probability with ˆ¯Fw(t) = 1 n Pn i=1 I(wi ≥t). Intuitively, this corresponds to assigning each data point a weight according to the rank of its density ratio in the population. Substituting the empirical tail probability into the reparametrization gradient formula in (8) and running a gradient descent with stochastic approximation yields our main algorithm shown in Algorithm 1. The version with the score-function gradient is similar and is shown in Algorithm 2 in the Appendix. Both algorithms can be viewed as minimizing the implicitly constructed adaptive f-divergences, but correspond to using different f. Compared with typical VI with reparameterized gradients, our method assigns a weight ρi = ˆ¯Fw(wi)β, which is proportional #wβ i where #wi denotes the rank of data wi in the population {wi}. When taking −1 < β < 0, this allows us to penalize places with high ratio p(x)/q(x), but avoid to be overly aggressive. In practice, we find that simply taking β = −1 almost always yields the best empirical performance (despite needing β > −1 theoretically). By comparison, minimizing the classical α-divergence would have a weight of wα i ; if α is too large, the weight of a single data point becomes dominant, making gradient estimate unstable. 6 Experiments In this section, we evaluate our adaptive f-divergence with different models. We use reparameterization gradients as default since they have smaller variances (Kingma & Welling, 2014) and normally yield better performance than score function gradients. Our code is available at https://github.com/dilinwang820/adaptive-f-divergence. 6.1 Gaussian Mixture Toy Example We first illustrate the approximation quality of our proposed adaptive f-divergence on Gaussian mixture models. In this case, we set our target distribution to be a Gaussian mixture p(x) = Pk i=1 1 kN(x; νi, 1), for x ∈Rd, where the elements of each mean vector νi is drawn from uniform([−s, s]). Here s can be viewed as controlling the Gaussianity of the target distribution: p reduces to standard Gaussian distribution when s = 0 and is increasingly multi-modal when s increases. We fix the number of components to be k = 10, and initialize the proposal distribution using q(x) = P20 i=1 wiN(x; µi, σ2 i ), where P20 i=1 wi = 1. We evaluate the mode-seeking ability of how q covers the modes of p using a “mode-shift distance” dist(p, q) := P10 i=1 minj ||νi −µj||2/10, which is the average distance of each mode in p to its nearest mode in distribution q. The model is optimized using Adagrad with a constant learning rate 0.05. We use a minibatch of size 256 to approximate the gradient in each iteration. We train the model for 10, 000 iterations. To learn the component weights, we apply the Gumble-Softmax trick (Jang et al., 2017; Maddison et al., 2017) with a temperature of 0.1. Figure 1 shows the result when we obtain random mixtures p using s = 5, when the dimension d of x equals 2 and 10, respectively. 6 (a) Mode-shift distance (b) Mean (c) Variance Avg. distance -2 -1 0 1 2 0.5 5 Log10 MSE -2 -1 0 1 2 -2 -1 0 1 Log10 MSE -2 -1 0 1 2 -2 -1 0 1 2 Adaptive(dim=2) Adaptive(dim=10) Alpha(dim=2) Alpha(dim=10) choice of α/β choice of α/β choice of α/β Figure 1: (a) plots the mode-shift distance between p and q; (b-c) show the MSE of mean and variance between the true posterior p and our approximation q, respectively. All results are averaged over 10 random trials. (a) Mode-shift distance (b) Mean (c) Variance Avg. distance 0 1 2 3 4 5 0.5 3 5 Log10 MSE 0 1 2 3 4 5 -3 -2 -1 0 1 Log10 MSE 0 1 2 3 4 5 -3 -2 -1 0 1 Adaptive(beta=-1) Alpha(alpha=0) Alpha(alpha=0.5) Alpha(alpha=1.0) Non-Gaussianity s Non-Gaussianity s Non-Gaussianity s Figure 2: Results on randomly generated Gaussian mixture models. (a) plots the average mode-shift distance; (b-c) show the MSE of mean and variance. All results are averaged over 10 random trials. We can see that when the dimension is low (= 2), all algorithms perform similarly well. However, as we increase the dimension to 10, our approach with tail-adaptive f-divergence achieves the best performance. To examine the performance of variational approximation more closely, we show in Figure 2 the average mode-shift distance and the MSE of the estimated mean and variance as we gradually increase the non-Gaussianality of p(x) by changing s. We fix the dimension to 10. We can see from Figure 2 that when p is close to Gaussian (small s), all algorithms perform well; when p is highly non-Gaussian (large s), we find that our approach with adaptive weights significantly outperform other baselines. 6.2 Bayesian Neural Network We evaluate our approach on Bayesian neural network regression tasks. The datasets are collected from the UCI dataset repository3. Similarly to Li & Turner (2016), we use a single-layer neural network with 50 hidden units and ReLU activation, except that we take 100 hidden units for the Protein and Year dataset which are relatively large. We use a fully factorized Gaussian approximation to the true posterior and Gaussian prior for neural network weights. All datasets are randomly partitioned into 90% for training and 10% for testing. We use Adam optimizer (Kingma & Ba, 2015) with a constant learning rate of 0.001. The gradient is approximated by n = 100 draws of xi ∼qθ and a minibatch of size 32 from the training data points. All results are averaged over 20 random partitions, except for Protein and Year, on which 5 trials are repeated. We summarize the average RMSE and test log-likelihood with standard error in Table 1. We compare our algorithm with α = 0 (KL divergence) and α = 0.5, which are reported as the best for this task in Li & Turner (2016). More comparisons with different choices of α are provided in the appendix. We can see from Table 1 that our approach takes advantage of an adaptive choice of f-divergence and achieves the best performance for both test RMSE and test log-likelihood in most of the cases. 3https://archive.ics.uci.edu/ml/datasets.html 7 Average Test RMSE Average Test Log-likelihood dataset β = −1.0 α = 0.0 α = 0.5 β = −1.0 α = 0.0 α = 0.5 Boston 2.828 ± 0.177 2.828 ± 0.177 2.828 ± 0.177 2.956 ± 0.171 2.990 ± 0.173 −2.476 ± 0.177 −2.476 ± 0.177 −2.476 ± 0.177 −2.547 ± 0.171 −2.506 ± 0.173 Concrete 5.371 ± 0.115 5.371 ± 0.115 5.371 ± 0.115 5.592 ± 0.124 5.381 ± 0.111 −3.099 ± 0.115 −3.099 ± 0.115 −3.099 ± 0.115 −3.149 ± 0.124 −3.103 ± 0.111 Energy 1.377 ± 0.034 1.377 ± 0.034 1.377 ± 0.034 1.431 ± 0.029 1.531 ± 0.047 −1.758 ± 0.034 −1.758 ± 0.034 −1.758 ± 0.034 −1.795 ± 0.029 −1.854 ± 0.047 Kin8nm 0.085 ± 0.001 0.088 ± 0.001 0.083 ± 0.001 0.083 ± 0.001 0.083 ± 0.001 1.055 ± 0.001 1.012 ± 0.001 1.080 ± 0.001 1.080 ± 0.001 1.080 ± 0.001 Naval 0.001 ± 0.000 0.001 ± 0.000 0.001 ± 0.000 0.001 ± 0.000 0.001 ± 0.000 0.001 ± 0.000 0.004 ± 0.000 5.468 ± 0.000 5.468 ± 0.000 5.468 ± 0.000 5.269 ± 0.000 4.086 ± 0.000 Combined 4.116 ± 0.032 4.116 ± 0.032 4.116 ± 0.032 4.161 ± 0.034 4.154 ± 0.042 −2.835 ± 0.032 −2.835 ± 0.032 −2.835 ± 0.032 −2.845 ± 0.034 −2.843 ± 0.042 Wine 0.636 ± 0.008 0.634 ± 0.007 0.634 ± 0.007 0.634 ± 0.007 0.634 ± 0.008 0.634 ± 0.008 0.634 ± 0.008 −0.962 ± 0.008 −0.959 ± 0.007 −0.959 ± 0.007 −0.959 ± 0.007 −0.971 ± 0.008 Yacht 0.849 ± 0.059 0.849 ± 0.059 0.849 ± 0.059 0.861 ± 0.056 1.146 ± 0.092 −1.711 ± 0.059 −1.711 ± 0.059 −1.711 ± 0.059 −1.751 ± 0.056 −1.875 ± 0.092 Protein 4.487 ± 0.019 4.487 ± 0.019 4.487 ± 0.019 4.565 ± 0.026 4.564 ± 0.040 −2.921 ± 0.019 −2.921 ± 0.019 −2.921 ± 0.019 −2.938 ± 0.026 −2.928 ± 0.040 Year 8.831 ± 0.037 8.831 ± 0.037 8.831 ± 0.037 8.859 ± 0.036 8.985 ± 0.042 −3.570 ± 0.037 −3.600 ± 0.036 −3.518 ± 0.042 −3.518 ± 0.042 −3.518 ± 0.042 Table 1: Average test RMSE and log-likelihood for Bayesian neural regression. 6.3 Application in Reinforcement Learning We now demonstrate an application of our method in reinforcement learning, applying it as an inner loop to improve a recent soft actor-critic(SAC) algorithm (Haarnoja et al., 2018). We start with a brief introduction of the background of SAC and then test our method in MuJoCo 4 environments. Reinforcement Learning Background Reinforcement learning considers the problem of finding optimal policies for agents that interact with uncertain environments to maximize the long-term cumulative reward. This is formally framed as a Markov decision process in which agents iteratively take actions a based on observable states s, and receive a reward signal r(s, a) immediately following the action a performed at state s. The change of the states is governed by an unknown environmental dynamic defined by a transition probability T(s′|s, a). The agent’s action a is selected by a conditional probability distribution π(a|s) called policy. In policy gradient methods, we consider a set of candidate policies πθ(a|s) parameterized by θ and obtain the optimal policy by maximizing the expected cumulative reward J(θ) = Es∼dπ,a∼π(a|s) [r(s, a)] , where dπ(s) = P∞ t=1 γt−1Pr(st = s) is the unnormalized discounted state visitation distribution with discount factor γ ∈(0, 1). Soft Actor-Critic (SAC) is an off-policy optimization algorithm derived based on maximizing the expected reward with an entropy regularization. It iteratively updates a Q-function Q(a, s), which predicts that cumulative reward of taking action a under state s, as well as a policy π(a|s) which selects action a to maximize the expected value of Q(s, a). The update rule of Q(s, a) is based on a variant of Q-learning that matches the Bellman equation, whose detail can be found in Haarnoja et al. (2018). At each iteration of SAC, the update of policy π is achieved by minimizing KL divergence πnew = arg min π Es∼d [KL(π(·|s) || pQ(·|s))] , (9) pQ(a|s) = exp 1 τ (Q(a, s) −V (s))  , (10) where τ is a temperature parameter, and V (s) = τ log R a exp(Q(a, s)/τ), serving as a normalization constant here, is a soft-version of value function and is also iteratively updated in SAC. Here, d(s) is a visitation distribution on states s, which is taken to be the empirical distribution of the states in the current replay buffer in SAC. We can see that (9) can be viewed as a variational inference problem on conditional distribution pQ(a|s), with the typical KL objective function (α = 0). SAC With Tail-adaptive f-Divergence To apply f-divergence, we first rewrite (9) to transform the conditional distributions to joint distributions. We define joint distribution pQ(a, s) = exp((Q(a, s)− V (s))/τ)d(s) and qπ(a, s) = π(a|s)d(s), then we can show that Es∼d[KL(π(·|s) || pQ(·|s))] = KL(qπ || pQ). This motivates us to extend the objective function in (9) to more general f-divergences, Df(pQ || qπ) = Es∼dEa|s∼π  f exp((Q(a, s) −V (s))/τ) π(a|s)  −f(1)  . 4http://www.mujoco.org/ 8 Ant HalfCheetah Humanoid(rllab) Average Reward 0M 2M 4M 6M 8M 10M −500 0 500 1000 1500 2000 2500 3000 3500 4000 0M 2M 4M 6M 8M 10M 0 2000 4000 6000 8000 10000 12000 14000 0M 2M 4M 6M 8M 10M 0 250 500 750 1000 Walker Hopper Swimmer(rllab) Average Reward 0M 1M 2M 3M 4M 5M 0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000 0.0M 0.5M 1.0M 1.5M 2.0M 0 500 1000 1500 2000 2500 3000 3500 4000 4500 0.0M 0.1M 0.2M 0.3M 0.4M 0.5M 0 25 50 75 100 125 150 175 200 α=0.0 α=0.5 α=max β=-1.0 Figure 3: Soft Actor Critic (SAC) with policy updated by Algorithm 1 with β = −1, or α-divergence VI with different α (α = 0 corresponds to the original SAC). The reparameterization gradient estimator is used in all the cases. In the legend, “α = max” denotes setting α = +∞in α-divergence. By using our tail-adaptive f-divergence, we can readily apply our Algorithm 1 (or Algorithm 2 in the Appendix) to update π in SAC, allowing us to obtain π that counts the multi-modality of Q(a, s) more efficiently. Note that the standard α-divergence with a fixed α also yields a new variant of SAC that is not yet studied in the literature. Empirical Results We follow the experimental setup of Haarnoja et al. (2018). The policy π, the value function V (s), and the Q-function Q(s, a) are neural networks with two fully-connected layers of 128 hidden units each. We use Adam (Kingma & Ba, 2015) with a constant learning rate of 0.0003 for optimization. The size of the replay buffer for HalfCheetah is 107, and we fix the size to 106 on other environments in a way similar to Haarnoja et al. (2018). We compare with the original SAC (α = 0), and also other α-divergences, such as α = 0.5 and α = ∞(the α = max suggested in Li & Turner (2016)). Figure 3 summarizes the total average reward of evaluation rollouts during training on various MuJoCo environments. For non-negative α settings, methods with larger α give higher average reward than the original KL-based SAC in most of the cases. Overall, our adaptive f-divergence substantially outperforms all other α-divergences on all of the benchmark tasks in terms of the final performance, and learns faster than all the baselines in most environments. We find that our improvement is especially significant on high dimensional and complex environments like Ant and Humanoid. 7 Conclusion In this paper, we present a new class of tail-adaptive f-divergence and exploit its application in variational inference and reinforcement learning. Compared to classic α-divergence, our approach guarantees finite moments of the density ratio and provides more stable importance weights and gradient estimates. Empirical results on Bayesian neural networks and reinforcement learning indicate that our approach outperforms standard α-divergence, especially for high dimensional multi-modal distribution. Acknowledgement This work is supported in part by NSF CRII 1830161. We would like to acknowledge Google Cloud for their support. 9 References Blei, David M, Kucukelbir, Alp, and McAuliffe, Jon D. Variational inference: A review for statisticians. Journal of the American Statistical Association, 112(518):859–877, 2017. Burda, Yuri, Grosse, Roger, and Salakhutdinov, Ruslan. Importance weighted autoencoders. International Conference on Learning Representations (ICLR), 2016. Cappé, Olivier, Douc, Randal, Guillin, Arnaud, Marin, Jean-Michel, and Robert, Christian P. Adaptive importance sampling in general mixture classes. Statistics and Computing, 18(4):447–459, 2008. Christopher, M Bishop. Pattern Recognition and Machine Learning. Springer-Verlag New York, 2016. Cotter, Colin, Cotter, Simon, and Russell, Paul. Parallel adaptive importance sampling. arXiv preprint arXiv:1508.01132, 2015. Csiszár, I. and Shields, P.C. Information theory and statistics: A tutorial. Foundations and Trends in Communications and Information Theory, 1(4):417–528, 2004. De Boer, Pieter-Tjerk, Kroese, Dirk P, Mannor, Shie, and Rubinstein, Reuven Y. A tutorial on the cross-entropy method. Annals of operations research, 134(1):19–67, 2005. Dieng, Adji Bousso, Tran, Dustin, Ranganath, Rajesh, Paisley, John, and Blei, David. Variational inference via χ upper bound minimization. In Advances in Neural Information Processing Systems (NIPS), pp. 2732–2741, 2017. Feldman, Dorian and Osterreicher, Ferdinand. A note on f-divergences. Studia Sci.\Math.\Hungar., 24:191–200, 1989. Gal, Yarin and Ghahramani, Zoubin. Dropout as a Bayesian approximation: Representing model uncertainty in deep learning. In international conference on machine learning (ICML), pp. 1050– 1059, 2016. Haarnoja, Tuomas, Zhou, Aurick, Abbeel, Pieter, and Levine, Sergey. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. International Conference on Machine Learning (ICML), 2018. Hernández-Lobato, José Miguel, Li, Yingzhen, Rowland, Mark, Hernández-Lobato, Daniel, Bui, Thang, and Turner, Richard Eric. Black-box α-divergence minimization. International Conference on Machine Learning (ICML), 2016. Hill, Bruce M et al. A simple general approach to inference about the tail of a distribution. The annals of statistics, 3(5):1163–1174, 1975. Hoffman, Matthew D, Blei, David M, Wang, Chong, and Paisley, John. Stochastic variational inference. The Journal of Machine Learning Research, 14(1):1303–1347, 2013. Jang, Eric, Gu, Shixiang, and Poole, Ben. Categorical reparameterization with Gumbel-softmax. International Conference on Learning Representations (ICLR), 2017. Jordan, Michael I, Ghahramani, Zoubin, Jaakkola, Tommi S, and Saul, Lawrence K. An introduction to variational methods for graphical models. Machine learning, 37(2):183–233, 1999. Kingma, Diederik P and Ba, Jimmy. Adam: A method for stochastic optimization. International Conference on Learning Representations (ICLR), 2015. Kingma, Diederik P and Welling, Max. Auto-encoding variational Bayes. International Conference on Learning Representations (ICLR), 2014. Levine, Sergey. Reinforcement learning and control as probabilistic inference: Tutorial and review. arXiv preprint arXiv:1805.00909, 2018. Li, Yingzhen and Turner, Richard E. Rényi divergence variational inference. In Advances in Neural Information Processing Systems (NIPS), pp. 1073–1081, 2016. Liese, Friedrich and Vajda, Igor. On divergences and informations in statistics and information theory. IEEE Transactions on Information Theory, 52(10):4394–4412, 2006. Maddison, Chris J, Mnih, Andriy, and Teh, Yee Whye. The concrete distribution: A continuous relaxation of discrete random variables. International Conference on Learning Representations (ICLR), 2017. Minka, Thomas P. Expectation propagation for approximate Bayesian inference. In Proceedings of the Seventeenth conference on Uncertainty in artificial intelligence (UAI), pp. 362–369. Morgan 10 Kaufmann Publishers Inc., 2001. Minka, Tom et al. Divergence measures and message passing. Technical report, Microsoft Research, 2005. Opper, Manfred and Winther, Ole. Expectation consistent approximate inference. Journal of Machine Learning Research, 6(Dec):2177–2204, 2005. Osterreicher, Ferdinand. f-divergences—representation theorem and metrizability. Inst. Math., Univ. Salzburg, Salzburg, Austria, 2003. Ranganath, Rajesh, Gerrish, Sean, and Blei, David. Black box variational inference. In Artificial Intelligence and Statistics, pp. 814–822, 2014. Reid, Mark D and Williamson, Robert C. Information, divergence and risk for binary experiments. Journal of Machine Learning Research, 12(Mar):731–817, 2011. Resnick, Sidney I. Heavy-tail phenomena: probabilistic and statistical modeling. Springer Science & Business Media, 2007. Ryu, Ernest K and Boyd, Stephen P. Adaptive importance sampling via stochastic convex programming. arXiv preprint arXiv:1412.4845, 2014. Sason, Igal. On f-divergences: Integral representations, local behavior, and inequalities. Entropy, 20 (5):383, 2018. Vehtari, Aki, Gelman, Andrew, and Gabry, Jonah. Pareto smoothed importance sampling. arXiv preprint arXiv:1507.02646, 2015. Wainwright, Martin J, Jordan, Michael I, et al. Graphical models, exponential families, and variational inference. Foundations and Trends R⃝in Machine Learning, 1(1–2):1–305, 2008. 11
2018
131
7,288
Modelling and unsupervised learning of symmetric deformable object categories James Thewlis1 Hakan Bilen2 Andrea Vedaldi1 1 Visual Geometry Group University of Oxford {jdt,vedaldi}@robots.ox.ac.uk 2 School of Informatics University of Edinburgh hbilen@ed.ac.uk Abstract We propose a new approach to model and learn, without manual supervision, the symmetries of natural objects, such as faces or flowers, given only images as input. It is well known that objects that have a symmetric structure do not usually result in symmetric images due to articulation and perspective effects. This is often tackled by seeking the intrinsic symmetries of the underlying 3D shape, which is very difficult to do when the latter cannot be recovered reliably from data. We show that, if only raw images are given, it is possible to look instead for symmetries in the space of object deformations. We can then learn symmetries from an unstructured collection of images of the object as an extension of the recently-introduced object frame representation, modified so that object symmetries reduce to the obvious symmetry groups in the normalized space. We also show that our formulation provides an explanation of the ambiguities that arise in recovering the pose of symmetric objects from their shape or images and we provide a way of discounting such ambiguities in learning. 1 Introduction Most natural objects are symmetric: mammals have a bilateral symmetry, a glass is rotationally symmetric, many flowers have a radial symmetry, etc. While such symmetries are easy to understand for a human, it remains surprisingly challenging to develop algorithms that can reliably detect the symmetries of visual object in images. The key difficulty is that objects that are structurally symmetric do not generally result in symmetric images; in fact, the latter occurs only when the object is imaged under special viewpoints and, for deformable objects, with a special poses (Leonardo’s Vitruvian Man illustrates this point). The standard approach to characterizing symmetries in objects is to look not at their images, but at their 3D shape; if the latter is available, then symmetries can be recovered by analysing the intrinsic geometry of the shape. However, often only images of the objects are available, and reconstructing an accurate 3D shape from them can be very challenging, especially if the object is deformable. In this paper, we thus seek a new approach to learn without supervision and from raw images alone the symmetries of deformable object categories. This may sound difficult since even characterising the basic geometry of natural objects without external supervision remains largely an open problem. Nevertheless, we show that it is possible to extend the method of [38], which was recently introduced to learn the “topology” of object categories, to do exactly this. There are three key enabling factors in our approach. First, we do not consider symmetries of a single object or 3D shape in isolation; instead, we seek symmetries shared by all the instances of the objects in a given category, imaged under different viewing conditions and deformations. Second, rather than considering the common concept of intrinsic symmetries, we propose to look at symmetries not of 3D shapes, but of the space of their deformations (section 4). Third, we show that the normalized object frame of [38] can be learned in such a way that the deformation symmetries are represented by 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. Figure 1: Symmetric object frame for human (left) and cat (right) faces (test set). Our method learns a viewpoint and identity invariant geometric embedding which captures the symmetry of natural objects (in this case bilateral) without manual supervision. Top: input images with the axis of symmetry superimposed (shown in green). Middle: dense embedding mapped to colours. Bottom: image pixels mapped to 3D representation space with the reflection plane (green). the obvious symmetry groups in the object frame. The latter also result in a constraint that can be easily added to the self-supervised formulation of [38] to learn symmetries in practice (section 3). We start by deriving our formulation for the special case of bilateral symmetries (section 3). Then, we propose a theory of symmetric deformation spaces (section 4) that generalises the method to other symmetry groups. An important step in this generalization is to characterise the ambiguities that symmetries induce in recovering the pose of an object from an image of it, or from its 3D shape, which may not occur with bilateral symmetries. The resulting approach is the first that, to our knowledge, can learn the symmetries of object categories given only raw images as input, without manual annotations. For demonstration, we show that this approach can learn the bilateral symmetry in human and pet faces (fig. 1) as well as in synthetic 3D objects (section 6). To assess the method, we look at how well the resulting representation can detect pairs of symmetric object landmarks (e.g. left and right eyes) even when the object does not appear symmetric. We also investigate the problem of symmetry-induced ambiguities in learning the geometry of natural objects. For objects such as animals that have a bilateral symmetry, it is generally possible to uniquely identify their left and right sides and thus recover their pose uniquely. On the other hand, for objects such as flowers that may have a radial symmetry, it is generally impossible to say which way is “up”, creating an ambiguity in pose recovery. Our framework clarifies why and when this occurs and suggests how to modify the learning formulation to mitigate the effect of such ambiguities (sections 4 and 6.2). 2 Related work Cross-instance object matching. Our method is also related to the techniques that find dense correspondences between different object instances by matching their SIFT features [25], establishing region correspondences [14, 15] and matching the internal representations of neural networks [24]. In addition, dense correspondences have been generalized between image pairs to arbitrary number of multiple images by Learned-Miller [20]. More recently, RSA [32], Collection Flow [18] and Mobahi et al. [28] show that a collection of images can be projected into a lower dimensional subspace before performing a joint alignment among the projected images. Novotny et al. [30] train a neural network with image labels that learns to automatically discover semantically meaningful parts across animals. Unsupervised learning of object structure. Supervised visual object characterization [6, 11, 21, 8, 10] is a well established problem in computer vision and successfully applied to facial landmark detection and human body pose estimation. Unsupervised methods include Spatial Transformer Networks [16] that learn to transform images to improve image classification, WarpNet [17] and geometric matching networks [34] that learn to match object pairs by estimating relative transformations between them. In contrast to ours, these methods do not learn a canonical object geometry and only provide relative mapping from one object to another. More related to ours, Thewlis et al. [39, 38] propose to characterize object structure via detecting landmarks [39] or dense labels [38] that are 2 Figure 2: Left: an object category consisting of two poses π, π′ with bilateral symmetry. Middle: the non-rigid deformation t = π′ ◦π−1 transporting one pose into the other. Right: construction of t = mπm−1π−1 by applying the reflection operator m both in Euclidean space and in representation space S2. This also shows that the symmetric pose π′ = mπm−1 is the “conjugate” of π. consistent with object deformations and viewpoint changes. In fact, our method builds on [38] and also learns a dense geometric embedding for objects, however, by using a different supervision principle, symmetry. Symmetry. Computational symmetry [22] has a long history in sciences and played an essential role in several important discoveries including the theory of relativity [29], the double helix structure of DNA [42]. Symmetry is shown to help grouping [19] and recognition [41] in human perception. There is a vast body of computer vision literature dedicated to finding symmetries in images [26], two dimensional [1] and three dimensional shapes [37]. Other axes of variations among symmetry detection methods are whether we seek transformations to map the whole [33] or part of an object [12] to itself; whether distances are measured in the extrinsic Euclidean space [1] or with respect to an intrinsic metric of the surface [33]. In addition to symmetry detection, symmetry is also used as prior information to improve object localization [4], text spotting [47], pose estimation [44] and 3D reconstruction [35]. Symmetry constraints been used to find objects in 3D point clouds [9, 40]. Symmetrization [27] can be used to warp meshes to a symmetric pose. Symmetry cues can be used in segmentation [3, 5]. [2] learns representations that respect a group structure learned from data symmetries. 3 Self-supervised learning of bilateral symmetries In this section, we extend the approach of [38] to learn the bilateral symmetry of an object category. Object frame. The key idea of [38] is to study 3D objects not via 3D reconstruction, which is challenging, but by characterizing the correspondences between different 3D shapes of the object, up to pose or intra-class variations. In this model, an object category is a space Π of homeomorphisms π : S2 →R3 that embed the sphere S2 into R3. Each possible shape of the object is obtained as the (mathematical) image S = π[S2] under a corresponding function π ∈Π, which we therefore call a pose of the object (different poses may result in the same shape). The correspondences between a pair of shapes S = π[S2] and S′ = π′[S2] is then given by π′ ◦π−1, which is a bijective deformation of S into S′. Next, we study how poses relate to images of the object. A (color) image is a function x : Ω→R3 mapping pixels u ∈Ωto colors xu. Suppose that x is the image of the object under pose π; then, a point z ∈S2 on the sphere projects to a point πz ∈R3 on the object surface S and the latter projects to a pixel u = Proj(πz) ∈Ω, where Proj is the camera projection operator. The idea of [38] is to learn a function ψu(x) that “reverses” this process and, given a pixel u in image x, recovers the corresponding point z on the sphere (so that ∀u : u = Proj (πψu(x))). The intuition is that z identifies a certain object landmark (e.g. the corner of the left eye in a face) and that the function ψu(x) recovers which landmark lands at a certain pixel u. The way the function ψu(x) is learned is by considering pairs of images x and x′ = tx related by a known 2D deformation t : Ω→Ω(where the warped image tx is given by (tx)u = xt−1u). In this manner, pixels u and u′ = tu are images of the same object landmark and therefore must project on the same sphere point. In formulas, and ignoring visibility effects and other complications, the learned function must satisfy the invariance constraint: ∀u ∈Ω: ψu(x) = ψtu(tx) (1) In practice, triplets (x, x′, t) are obtained by randomly sampling 2D warps t, assuming that the latter approximate warps that could arise form an actual pose change π′ ◦π−1. In this manner, knowledge of t is automatic and the method can be used in an unsupervised setting. 3 Symmetric object frame. So far the object frame has been used to learn correspondences between different object poses; here, we show that it can be used to establish auto-correspondences in order to model object symmetries as well. Consider in particular an object that has a bilateral symmetry. This symmetry is generated by a reflection operator, say the function m : R3 →R3 that flips the first axis: m : R3 →R3, "p1 p2 p3 # 7→ "−p1 p2 p3 # . (2) If S is a shape of a bilaterally-symmetric object, no matter how we align S to the symmetry plane, in general m[S] ̸= S due to object deformations. However, we can expect m[S] to still be a valid shape for the object. Consider the example of fig. 2 of a person with his/her right hand raised; if we apply m to this shape, we obtain the shape of a person with the left hand raised, which is valid. However, reasoning about shapes is insufficient to apply the object frame model; we require instead to work with correspondences, encoded by poses. Unfortunately, even though m[S] is a valid shape, m is not a valid correspondence as it flips the left and right sides of a person, which is not a “physical” deformation (why this is important will be clearer later; intuitively it is the reason why we can tell our left hand from the right by looking). Our key intuition is that we can learn the pose representation in such a way that the correct correspondences are trivially expressible there. Namely, assume that m applied to the sphere amounts to swapping each left landmark of the object with its corresponding right counterpart. The correct deformation t that maps the “right arm raised” pose to the “left arm raised” pose can now be found by applying m first in the normalized object frame (to swap left and right sides while leaving the shape unchanged) and then again in 3D space (undoing the swap while actually deforming the shape). This two-step process is visualised in fig. 2 right. This derivation is captured by a simple change to constraint (1), encoding equivariance rather than invariance w.r.t. the warp m: ∀u ∈Ω: mψu(x) = ψmu(mx) (3) We will show that this simple variant of eq. (1) can be used to learn a representation of the bilateral symmetry of the object category. Learning formulation. We follow [38] and learn the model ψu(x) by considering a dataset of images x of a certain object category, modelling the function ψu(x) by a convolutional neural network, and formulating learning as a Siamese configuration, combining constraints (3) and (1) into a single loss. To avoid learning the trivial solution where ψu(x) is the constant function, the constraints are extended to capture not just invariance/equivariance but also distinctiveness (namely, equalities (3) and (1) should not hold if u is replaced with a different pixel v in the left-hand side). Following [38], this is captured probabilistically by the loss: L(x, m, t) = Z Ω ∥v −mtu∥γ 2p(v|u) dvdu, p(v|u) = exp⟨mψu(x), ψv(mtx)⟩ R exp⟨mψu(x), ψw(mtx)⟩dw (4) The probability p(v|u) represents the model’s belief that pixel u in image x matches pixel v in image mtx based on the learned embedding function; the latter is relaxed to span R3 rather than only S2 to allow the length of the embedding vectors to encode the belief strength (as shorter vectors results in flatter distributions p(v|u)). For unsupervised training, warps t ∼T are randomly sampled from a fixed distribution T as in [38], whereas m is set to be either the identity or the reflection along the first axis with 50% probability. 4 Theory In the previous section, we have given a formulation for learning the bilateral symmetry of an object category, relying mostly on an intuitive derivation. In this section, we develop the underlying theory in a more rigorous manner (proofs can be found in the supplementary material), while clarifying three important points: how to model symmetries other than the bilateral one, why symmetries such as radial result in ambiguities in establishing correspondences and why this is usually not the case for the bilateral symmetry, and what can be done to handle such ambiguities in the learning formulation when they arise. 4 Figure 3: Left: a set Π = {π0, . . . , π3} of four poses with rotational symmetry group H = {hk, k = 0, 1, 2, 3} where h is a rotation by π/2. Note that none of the shapes is symmetric; rather, the object, which stays “upright”, can deform in four symmetric ways. The shape of the object is then sufficient to recover the pose uniquely. Middle: closure of the pose space Π by rotations G = H. Now pose can be recovered from shapes only up to the symmetry group H. Right: an equilateral triangle is represented by a pose π0 invariant to conjugation by 60 degrees rotations (which are the “ordinary” extrinsic symmetries of this object). Symmetric pose spaces. A symmetry of a shape S ⊂R3 is often defined as an isometry1 h : R3 →R3 that leaves the set invariant, i.e. h[S] = S. This definition is not very useful when dealing with symmetric but deformable objects, as it works only for special poses (cf. the Vitruvian Man); we require instead a definition of symmetry that is not pose dependent. A common approach is to define intrinsic symmetries [33] as maps h : S →S that preserve the geodesic distance dS defined on the surface of the object (i.e. ∀p, q ∈S : dS(hp, hq) = dS(p, q)). This works because the geodesic distance captures the intrinsic geometry of the shape, which is pose invariant (but elastic shape deformations are still a problem); however, using this definition requires to accurately reconstruct the 3D shape of objects from images, which is very challenging. In order to sidestep this difficulty, we propose to study the symmetry not of the 3D shapes of objects, but rather of the space of their deformations. As discussed in section 3, such deformations are captured as a whole by the pose space Π. We define the symmetries of the pose space Π as the subset of linear isometries that leave Π unchanged via conjugation: H(Π) = {h ∈O(3) : ∀π ∈Π : hπh−1 ∈Π ∧h−1πh ∈Π}. For example, in fig. 2 we have obtained the “left hand raised” pose π′ from the “right hand raised” pose via conjugation π′ = mπm−1 via the reflection m (note that m = m−1). Lemma 1. The set H(Π) is a subgroup of O(3). The symmetry group H(Π) partitions Π in equivalence classes of symmetric poses: two poses π and π′ are symmetric, denoted π ∼H(Π) π′, if, and only if, π′ = hπh−1 for an h ∈H(Π). In fact: Lemma 2. π ∼H(Π) π′ is an equivalence relation on the space of poses Π. Figure 3 shows an example of an object Π that has four rotationally-symmetric poses H(Π) = {hkπ0h−k, k = 0, 1, 2, 3} where h is a clockwise rotation of 90 degrees. Motion-induced ambiguities. In the example of fig. 3, the object is pinned at the origin of R3 and cannot rotate (it can only be “upright”); in order to allow it to move around, we can extend the pose space to Π′ = GΠ by applying further transformations to the poses. For example, choosing G = SE(3) to be the Euclidean group allows the object to move rigidly; fig. 3-middle shows an example in which G = H(Π) is the same group of four rotations as before, so the object is still pinned at the origin but not necessarily upright. Motions are important because they induce ambiguities in pose recover. We formalise this concept next. First, we note that, if G contains H(Π), extending Π by G preserves all the symmetries: Lemma 3. If H(Π) ⊂G, then H(Π) ⊂H(GΠ). Second, consider being given a shape S (intended as a subset of R3) and being tasked with recovering the pose π ∈Π that generates S = π[S2]. Motions makes this recovery ambiguous: Lemma 4. Let the pose space Π be closed under a transformation group G, in the sense that GΠ = Π. Then, if pose π ∈Π is a solution of the equation S = π[S2] and if h ∈H(Π) ∩G, then πh−1 is another pose that solves the same equation. 1I.e. ∀p, q ∈R3 : d(hp, hq) = d(p, q). 5 Lemma 4 does not necessarily provide a complete characterization of all the ambiguities in identifying pose π from shape S; rather, it captures the ambiguities arising from the symmetry of the object and its ability to move around in a certain manner. Nevertheless, it is possible for specific poses to result in further ambiguities (e.g. consider a pose that deforms an object into a sphere). In order to use the lemma to characterise ambiguities in pose recovery, given a pose space Π one must still find the space of possible motions G. We can take the latter to be the maximal subgroup G∗⊂SE(3) of rigid motions under which Π is closed2 4.1 Bilateral symmetry Bilateral symmetries are generated by the reflection operator m of eq. (2): a pose space Π has bilateral symmetry if H(Π) = {1, m}, which induces pairs of symmetric poses π′ = mπm−1 as in fig. 2. Even if poses Π are closed under rigid motions (i.e. G∗Π = Π where G∗= SE(3)), in this case there is generally no ambiguity in recovering the object pose from its shape S. The reason is that in lemma 4 one has G∗∩H(Π) = {1} due to the fact that all transformations in G∗are orientation-preserving whereas m is not. This explains why it is possible to still distinguish left from right sides in most bilaterally-symmetric objects despite symmetries and motions. However, this is not the case for other types of symmetries such as radial. Symmetry plane. Note that, given a pair of symmetric poses (π, π′), π′ = mπm−1, the correspondences between the underlying 3D shapes are given by the map mπ : S →m[S], p 7→ (mπm−1π−1)(p). For example, in fig. 2 this map sends the raised left hand of a person to the lowered left hand in the symmetric pose. Of particular interest are the points where mπ coincides with m as they are on the “plane of symmetry”. In fact, let p = π(z); then: mπ(p) = m(p) ⇒ mπm−1π−1(p) = m(p) ⇒ m−1(z) = z ⇒ z = " 0 z2 z3 # . (5) 4.2 Extrinsic symmetries Our formulation captures the standard notion of extrinsic (standard) symmetries as well. If H(S) = {h ∈O(3) : h[S] = S} are the extrinsic symmetries of a geometric shape S (say regular pyramid), we can parametrize S using a single pose Π = {π0} that: (i) generates the shape (S = π0[S2]) and (ii) has the same symmetries as the latter (H(Π) = H(S)). In this case, the pose π0 is self-conjugate, in the sense that π0 = hπ0h−1 for all h ∈H(Π). Furthermore, given S it is obviously possible to recover the pose uniquely (since there is only one element in Π); however, as before ambiguities arise by augmenting poses via rigid motions G = SE(3). In this case, due to lemma 4, if gπ0 is a possible pose of S, so must be gπ0h−1. We can rewrite the latter as (gh−1)(hπ0h−1) = (gh−1)π0, which shows that the ambiguous poses are obtained via selected rigid motions gh−1 of the reference pose π0. 5 Learning with ambiguities In section 3 we have explained how the learning formulation of [38] can be extended in order to learn objects with a bilateral symmetry. The latter is an example where symmetries do not induce an ambiguities in the recovery of the object’s pose (the reason is given in section 4.1). Now we consider the case in which symmetries induce a genuine ambiguity in pose recovery. Recall that ambiguities arise from a non-empty intersection of object symmetries H(Π) and object motions G∗(section 4). A typical example may be an object with a finite rotational symmetry group (fig. 3). In this case, it is not possible to recover the object pose uniquely from an image, which in turn suggests that ψu(x) cannot be learned using the formulation of section 3. 2Being maximal means that G∗Π = G∗∧GΠ = G ⇒G ⊂G∗. The maximal group can be constructed as G∗= ⟨G ⊂SE(3) : GΠ = Π⟩, where ⊂denotes a subgroup and ⟨·⟩the generated subgroup. This definition is well posed: the generated group G∗contains all the other subgroups G so it is maximal; furthermore G∗Π = Π because, for any pose π ∈Π and finite combination of other group elements, gn1 1 . . . gnk k π ∈Π. 6 Method Eyes Mouth [38] 23.29 15.27 [38] & plane est. 5.17 5.38 Ours 3.21 3.47 (a) Pixel error when using the reflected descriptor from the left eye or left mouth corner to locate its counterpart on the right side of the face, across 200 images from CelebA (MAFL test subset) Query Target (b) Visualisation of fig. 4a. +: ground truth. ◦, •: [38] with no learned symmetry. ◦, •: [38] with mirroring around the plane estimated using annotations. ◦, •: Our method. Where ◦, • is eye, mouth respectively (c) Difference between us (left) and [38] (right). We learn an axis aligned frame symmetric around a plane (green), [38] has arbitrary rotation and no guaranteed symmetry plane. But we can estimate a plane using annotations (cyan). Figure 4: Comparing object frames Figure 5: Bilateral symmetry of animal faces. The discovered plane of symmetry is shown in green. Top: Inputs, Middle: Colour mapping, Bottom: Embedding (sphere) space We propose to address this problem by relaxing loss (4) in order to discount the ambiguity as follows: LH(Π)(x, t) = min h∈H(Π) Z Ω ∥v −tu∥γ 2ph(v|u) dvdu, ph(v|u) = exp⟨hψu(x), ψv(tx)⟩ R exp⟨hψu(x), ψw(tx)⟩dw (6) This loss allows ψu(x) to estimate the embedding vector z ∈S2 (or z ∈R3) up to an unknown transformation h. 6 Experiments We now validate empirically our formulation. To ensure that we have a fair comparison to [38], who introduced learning formulation (4) which our approach extends, we use the same network architecture and hyperparameter values (e.g. γ = 0.5 in eq. (4)). We show that our extension successfully recovers the symmetric structure of bilateral objects (section 6.1) as well as allowing to manage ambiguities arising from symmetries in learning such structures (section 6.2). 6.1 Learning objects with bilateral symmetry In this section, we apply the learning formulation (4) to objects with a bilateral symmetry. Due to the structure imposed on the embedding function by eq. (3), we expect the symmetry plane of the object to be mapped to the plane z1 = 0 in the embedding space (section 4.1). Once the model is learned, this locus can be projected back to an image for visualisation and qualitative assessment. We also test quantitatively the accuracy of the learned geometric embedding in localising object landmarks and their symmetric counterparts. Faces. We evaluate the proposed formulation on faces of humans and animals, which have limited out-of-plane rotations. For humans we use the CelebA [23] face dataset, with over 200K images. We use an identical setup to [38, 39], training on 162K images and employing the MAFL [46] subset of 1000 images as a validation set. For cats we use the Cat Head dataset [45], with 8609 training images. We also combine multiple animals in the same training set, with Animal Faces dataset [36] (20 animal classes, about 100 images per class). We exclude birds and elephants since these images have a significantly different appearance, and add additional cat, dog and human faces [45, 31, 23] (but keep roughly the same distribution of animal classes per batch as the original dataset). 7 In all cases, we do not use any manual annotation; instead, we use learning formulation (4) using the same synthetic transformations t ∼T as [38]. Additionally, with 50% probability we also apply a left-to-right flip m to both the image and the embedding space, as prescribed by eq. (4). Results (figs. 1 and 5) show that our method, like [38], learns a geometric embedding of the object invariant to viewpoint and intra-category changes. In addition, our new formulation localises the intrinsic bilateral symmetry plane in the face images and maps it to a plane of reflection in the embedding space. We note that images are embedded symmetrically with respect to the plane (shown in green in fig. 1, bottom row). The plane can also be projected back to the image and, as predicted by eq. (5), corresponds to our intuitive notion of symmetry plane in faces (fig. 1, top row). Importantly, symmetry here is a statistical concept that applies to the category as a whole; specific face instances need not be nor appear symmetric — the latter in particular means that faces need not be imaged fronto-parallel for the method to capture their symmetry. To evaluate the learned symmetry quantitatively we use manual annotations (eyes, mouth corners) to verify if the representation can transport landmarks to their symmetric counterparts. In particular, we take landmarks on the left side of the face (e.g. left eye), use m (eq. (3)) to mirror their embedding vectors, backproject those to the image, and compare the resulting positions to the ground-truth symmetric landmark locations (e.g. right eye). We report the measured pixel error in fig. 4a. As a baseline, we replace our embedding function with the one from [38] which results in much higher error. This is however expected as the mapping m has no particular meaning in this embedding space; for a fairer comparison, we then explicitly estimate an ad-hoc plane of symmetry defined by the nose, mean of the eyes, and mean of the mouth corners, using 200 training images. This still gives higher error than our method, showing that enforcing symmetry during training leads to a better representation of symmetric objects. 0 1 2 3 4 5 Warp factor 3 4 5 6 7 Symmetry Error (px) Eyes Mouth Figure 6: Varying warp intensity In terms of the accuracy of the geometric embedding as such, we evaluate simply matching annotations between different images and obtain similar error to the embedding of [38] (ours 2.60, theirs 2.59 pixel error on 200 pairs of faces, and both 1.63 error for when the second image is a warped version of the first). Hence representing symmetries does not harm geometric accuracy. We also examine the influence of the synthetic warp intensity, in fig. 6 we train for 5 epochs scaling the original control point parameters by a factor, indicating we are around the sweet spot and unnatural excessive warping is harmful. Synthetic 3D car model. A challenging problem is capturing bilateral symmetry across out-of-plane rotations. We use a 3D car, animated with random motion [13] for 30K frames. The heading follows a random walk, eventually rotating 360◦out of plane. Translation, pitch and roll are sinusoidal. The back of the car is red to easily distinguish from the front. We use consecutive frames for training, with the ground truth optical flow used for t and image size 75 × 75. The loss ignores pixels with flow smaller than 0.001, preventing confusion with the solid background. Figure 8 depicts examples from this dataset. Unlike CelebA, the cars are rendered from significantly different views, but our method can successfully localize the bilateral axis accurately. Figure 7: Symmetry in a pair of toy robotics arms Synthetic robot arm model. We trained our model on videos of a left-right pair of robotics arms, extending the setup of [38] to a system of two arms. Figure 7 shows the discovered symmetry by joining corresponding points in a few video frames. Note that symmetries are learned automatically from raw videos and ground truth optical flow alone. Note also that none of the images is symmetric in the trivial left-right flip sense due to the object deformations. 8 Figure 8: Bilateral symmetry on synthetic car images, Top: Input images with the axis of symmetry superimposed (shown in green), Bottom: Image pixels mapped to 3D with the reflection plane (green) Figure 9: Rotational symmetry on protein. Top: Frames, found center of symmetry red. Middle: Colorized object frame, a different colouring is assigned to each leg despite ambiguity. Bottom: Embedding in 3D, it learns to be symmetric around an axis (red). Last column: Without relaxed loss. 6.2 Rotational symmetry We create an example based on 3-fold rotational symmetry in nature, the Clathrin protein [43]. We use the protein mesh3 and animate it as a soft body in a physics engine [13, 7], generating 200 400-frame sequences. For each we vary the camera rotation, lighting, mesh smoothing and position. The protein is anchored at its centre. We vary the gravity vector to produce varied motion. We train using the relaxed loss in eq. (6), where H(Π) corresponds to rotating our sphere 0◦, 120◦or 240◦. The mapping then need only be learned up to this rotational ambiguity. As shown in fig. 9, this maps the protein images onto a canonical position which has rotational symmetry around the chosen axis, whereas without the relaxed loss the object frame is not aligned and symmetrical. We also show results for rotational symmetry in real images, using flower class Stapelia from ImageNet in fig. 10 which has 5-fold rotational symmetry. 7 Conclusions In this paper we have developed a new model of the symmetries of deformable object categories. The main advantage of this approach is that it is flexible and robust enough that it supports learning symmetric objects in an unsupervised manner, from raw images, despite variable viewpoint, deformations, and intra-class variations. We have also characterised ambiguities in pose recovery caused by symmetries and developed a learning formulation that can handle them. Our contributions have been validated empirically, showing that we can learn to represent symmetries robustly on a variety of object categories, while retaining the accuracy of the learned geometric embedding compared to previous approaches. 3https://www.rcsb.org/structure/3LVG Figure 10: Rotational symmetry on Stapelia flower. Superimposed in green, projection into the image of a set of half-planes 72◦apart in the sphere space. In red, predicted axis of rotational symmetry. 9 Acknowledgments: This work acknowledges the support of the AIMS CDT (EPSRC EP/L015897/1) and ERC 638009-IDIU. We thank Almut Sophia Koepke for feedback and corrections. References [1] Helmut Alt, Kurt Mehlhorn, Hubert Wagener, and Emo Welzl. Congruence, similarity, and symmetries of geometric objects. Discrete & Computational Geometry, 3(3):237–256, 1988. [2] Fabio Anselmi, Georgios Evangelopoulos, Lorenzo Rosasco, and Tomaso Poggio. Symmetryadapted representation learning. Pattern Recognition, 86:201–208, 2019. [3] Shai Bagon, Oren Boiman, and Michal Irani. What is a good image segment? a unified approach to segment extraction. In Proc. ECCV, pages 30–44. Springer, 2008. [4] Hakan Bilen, Marco Pedersoli, and Tinne Tuytelaars. Weakly supervised object detection with posterior regularization. In Proceedings BMVC 2014, pages 1–12, 2014. [5] Oren Boiman and Michal Irani. Similarity by composition. In Proc. NeurIPS, pages 177–184, 2007. [6] T F Cootes, C J Taylor, D H Cooper, and J Graham. Active shape models: their training and application. CVIU, 1995. [7] Erwin Coumans. Bullet physics engine. Open Source Software: http://bulletphysics. org, 2010. [8] Navneet Dalal and Bill Triggs. Histograms of Oriented Gradients for Human Detection. In Proc. CVPR, 2005. [9] Aleksandrs Ecins, Cornelia Fermüller, and Yiannis Aloimonos. Cluttered scene segmentation using the symmetry constraint. In Robotics and Automation (ICRA), 2016 IEEE International Conference on, pages 2271–2278. IEEE, 2016. [10] Pedro F. Felzenszwalb, Ross B. Girshick, David McAllester, and Deva Ramanan. Object Detection with Discriminatively Trained Part Based Models. PAMI, 2010. [11] Rob Fergus, Pietro Perona, and Andrew Zisserman. Object class recognition by unsupervised scale-invariant learning. In Proc. CVPR, 2003. [12] Ran Gal and Daniel Cohen-Or. Salient geometric features for partial shape matching and similarity. ACM Transactions on Graphics (TOG), 25(1):130–150, 2006. [13] Mike Goslin and Mark R Mine. The Panda3D graphics engine. Computer, 37(10):112–114, 2004. [14] Bumsub Ham, Minsu Cho, Cordelia Schmid, and Jean Ponce. Proposal flow. In Proc. CVPR, pages 3475–3484, 2016. [15] Kai Han, Rafael S Rezende, Bumsub Ham, Kwan-Yee K Wong, Minsu Cho, Cordelia Schmid, and Jean Ponce. Scnet: Learning semantic correspondence. In Proc. ICCV, 2017. [16] Max Jaderberg, Karen Simonyan, Andrew Zisserman, and Koray Kavukcuoglu. Spatial Transformer Networks. In Proc. NeurIPS, 2015. [17] A. Kanazawa, D. W. Jacobs, and M. Chandraker. WarpNet: Weakly supervised matching for single-view reconstruction. In Proc. CVPR, 2016. [18] Ira Kemelmacher-Shlizerman and Steven M. Seitz. Collection flow. In Proc. CVPR, 2012. [19] Kurt Koffka. Principles of Gestalt psychology, volume 44. Routledge, 2013. [20] Erik G Learned-Miller. Data driven image models through continuous joint alignment. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2006. 10 [21] Bastian Leibe, Ales Leonardis, and Bernt Schiele. Combined object categorization and segmentation with an implicit shape model. In Workshop on statistical learning in computer vision, ECCV, 2004. [22] Yanxi Liu, Hagit Hel-Or, Craig S Kaplan, Luc Van Gool, et al. Computational symmetry in computer vision and computer graphics. Foundations and Trends R⃝in Computer Graphics and Vision, 5(1–2):1–195, 2010. [23] Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In Proc. ICCV, 2015. [24] Jonathan L Long, Ning Zhang, and Trevor Darrell. Do convnets learn correspondence? In Advances in Neural Information Processing Systems, pages 1601–1609, 2014. [25] David G Lowe. Distinctive image features from scale-invariant keypoints. International journal of computer vision, 60(2):91–110, 2004. [26] Giovanni Marola. On the detection of the axes of symmetry of symmetric and almost symmetric planar images. PAMI, 11(1):104–108, 1989. [27] Niloy J Mitra, Leonidas J Guibas, and Mark Pauly. Symmetrization. In ACM Transactions on Graphics (TOG), volume 26, page 63. ACM, 2007. [28] Hossein Mobahi, Ce Liu, and William T. Freeman. A Compositional Model for LowDimensional Image Set Representation. Proc. CVPR, 2014. [29] Gregory L Naber. The geometry of Minkowski spacetime: An introduction to the mathematics of the special theory of relativity, volume 92. Springer Science & Business Media, 2012. [30] D. Novotny, D. Larlus, and A. Vedaldi. Learning 3d object categories by looking around them. In Proc. ICCV, 2017. [31] O. M. Parkhi, A. Vedaldi, A. Zisserman, and C. V. Jawahar. Cats and dogs. In Proc. CVPR, 2012. [32] Yigang Peng, Arvind Ganesh, John Wright, Wenli Xu, and Yi Ma. Rasl: Robust alignment by sparse and low-rank decomposition for linearly correlated images. PAMI, 34(11):2233–2246, 2012. [33] Dan Raviv, Alexander M Bronstein, Michael M Bronstein, and Ron Kimmel. Full and partial symmetries of non-rigid shapes. IJCV, 89(1):18–39, 2010. [34] I. Rocco, R. Arandjelovi´c, and J. Sivic. Convolutional neural network architecture for geometric matching. In Proc. CVPR, 2017. [35] Ilan Shimshoni, Yael Moses, and Michael Lindenbaum. Shape reconstruction of 3d bilaterally symmetric surfaces. IJCV, 39(2):97–110, 2000. [36] Zhangzhang Si and Song-Chun Zhu. Learning hybrid image templates (hit) by information projection. PAMI. [37] Changming Sun and Jamie Sherrah. 3d symmetry detection using the extended gaussian image. PAMI, 19(2):164–168, 1997. [38] J. Thewlis, H. Bilen, and A. Vedaldi. Unsupervised learning of object frames by dense equivariant image labelling. In Proc. NeurIPS, 2017. [39] J. Thewlis, H. Bilen, and A. Vedaldi. Unsupervised learning of object landmarks by factorized spatial embeddings. In Proc. ICCV, 2017. [40] Sebastian Thrun and Ben Wegbreit. Shape from symmetry. In Proc. ICCV, pages 1824–1831, 2005. [41] Thomas Vetter and Tomaso Poggio. Linear object classes and image synthesis from a single example image. IEEE Transactions on Pattern Analysis and Machine Intelligence, 19(7):733– 742, 1997. 11 [42] James D Watson, Francis HC Crick, et al. Molecular structure of nucleic acids. Nature, 171(4356):737–738, 1953. [43] Jeremy D Wilbur, Peter K Hwang, Joel A Ybe, Michael Lane, Benjamin D Sellers, Matthew P Jacobson, Robert J Fletterick, and Frances M Brodsky. Conformation switching of clathrin light chain regulates clathrin lattice assembly. Developmental cell, 18(5):854–861, 2010. [44] Heng Yang and Ioannis Patras. Mirror, mirror on the wall, tell me, is the error small? In Proc. CVPR, pages 4685–4693, 2015. [45] Weiwei Zhang, Jian Sun, and Xiaoou Tang. Cat head detection - How to effectively exploit shape and texture features. In Proc. ECCV, 2008. [46] Zhanpeng Zhang, Ping Luo, Chen Change Loy, and Xiaoou Tang. Learning Deep Representation for Face Alignment with Auxiliary Attributes. PAMI, 2016. [47] Zheng Zhang, Wei Shen, Cong Yao, and Xiang Bai. Symmetry-based text line detection in natural scenes. In Proc. CVPR, pages 2558–2567, 2015. 12
2018
132
7,289
Generalizing to Unseen Domains via Adversarial Data Augmentation Riccardo Volpi∗,† Istituto Italiano di Tecnologia Hongseok Namkoong∗ Stanford University Ozan Sener Intel Labs John Duchi Stanford University Vittorio Murino Istituto Italiano di Tecnologia Università di Verona Silvio Savarese Stanford University Abstract We are concerned with learning models that generalize well to different unseen domains. We consider a worst-case formulation over data distributions that are near the source domain in the feature space. Only using training data from a single source distribution, we propose an iterative procedure that augments the dataset with examples from a fictitious target domain that is "hard" under the current model. We show that our iterative scheme is an adaptive data augmentation method where we append adversarial examples at each iteration. For softmax losses, we show that our method is a data-dependent regularization scheme that behaves differently from classical regularizers that regularize towards zero (e.g., ridge or lasso). On digit recognition and semantic segmentation tasks, our method learns models improve performance across a range of a priori unknown target domains. 1 Introduction In many modern applications of machine learning, we wish to learn a system that can perform uniformly well across multiple populations. Due to high costs of data acquisition, however, it is often the case that datasets consist of a limited number of population sources. Standard models that perform well when evaluated on the validation dataset—usually collected from the same population as the training dataset—often perform poorly on populations different from that of the training data [15, 3, 1, 32, 38]. In this paper, we are concerned with generalizing to populations different from the training distribution, in settings where we have no access to any data from the unknown target distributions. For example, consider a module for self-driving cars that needs to generalize well across weather conditions and city environments unexplored during training. A number of authors have proposed domain adaptation methods (for example, see [9, 39, 36, 26, 40]) in settings where a fully labeled source dataset and an unlabeled (or partially labeled) set of examples from fixed target distributions are available. Although such algorithms can successfully learn models that perform well on known target distributions, the assumption of a priori fixed target distributions can be restrictive in practical scenarios. For example, consider a semantic segmentation algorithm used by a robot: every task, robot, environment and camera configuration will result in a different target distribution, and these diverse scenarios can be identified only after the model is trained and deployed, making it difficult to collect samples from them. In this work, we develop methods that can learn to better generalize to new unknown domains. We consider the restrictive setting where training data only comes from a single source domain. Inspired ∗Equal contribution. †Work done while author was a Visiting Student Researcher at Stanford University. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. by recent developments in distributionally robust optimization and adversarial training [34, 20, 12], we consider the following worst-case problem around the (training) source distribution P0 minimize θ∈Θ sup P :D(P,P0)≤ρ EP [ℓ(θ; (X, Y ))]. (1) Here, θ ∈Θ is the model, (X, Y ) ∈X × Y is a source data point with its labeling, ℓ: X × Y →R is the loss function, and D(P, Q) is a distance metric on the space of probability distributions. The solution to worst-case problem (1) guarantees good performance against data distributions that are distance ρ away from the source domain P0. To allow data distributions that have different support to that of the source P0, we use Wasserstein distances as our metric D. Our distance will be defined on the semantic space 3, so that target populations P satisfying D(P, P0) ≤ρ represent realistic covariate shifts that preserve the same semantic representation of the source (e.g., adding color to a greyscale image). In this regard, we expect the solution to the worst-case problem (1)—the model that we wish to learn—to have favorable performance across covariate shifts in the semantic space. We propose an iterative procedure that aims to solve the problem (1) for a small value of ρ at a time, and does stochastic gradient updates to the model θ with respect to these fictitious worst-case target distributions (Section 2). Each iteration of our method uses small values of ρ, and we provide a number of theoretical interpretations of our method. First, we show that our iterative algorithm is an adaptive data augmentation method where we add adversarially perturbed samples—at the current model—to the dataset (Section 3). More precisely, our adversarially generated samples roughly correspond to Tikhonov regularized Newton-steps [21, 25] on the loss in the semantic space. Further, we show that for softmax losses, each iteration of our method can be thought of as a data-dependent regularization scheme where we regularize towards the parameter vector corresponding to the true label, instead of regularizing towards zero like classical regularizers such as ridge or lasso. From a practical viewpoint, a key difficulty in applying the worst-case formulation (1) is that the magnitude of the covariate shift ρ is a priori unknown. We propose to learn an ensemble of models that correspond to different distances ρ. In other words, our iterative method generates a collection of datasets, each corresponding to a different inter-dataset distance level ρ, and we learn a model for each of them. At test time, we use a heuristic method to choose an appropriate model from the ensemble. We test our approaches on a simple digit recognition task, and a more realistic semantic segmentation task across different seasons and weather conditions. In both settings, we observe that our method allows to learn models that improve performance across a priori unknown target distributions that have varying distance from the original source domain. Related work The literature on adversarial training [10, 34, 20, 12] is closely related to our work, since the main goal is to devise training procedures that learn models robust to fluctuations in the input. Departing from imperceptible attacks considered in adversarial training, we aim to learn models that are resistant to larger perturbations, namely out-of-distribution samples. Sinha et al. [34] proposes a principled adversarial training procedure, where new images that maximize some risk are generated and the model parameters are optimized with respect to those adversarial images. Being devised for defense against imperceptible adversarial attacks, the new images are learned with a loss that penalizes differences between the original and the new ones. In this work, we rely on a minimax game similar to the one proposed by Sinha et al. [34], but we impose the constraint in the semantic space, in order to allow our adversarial samples from a fictitious distribution to be different at the pixel level, while sharing the same semantics. There is a substantial body of work on domain adaptation [15, 3, 32, 9, 39, 36, 26, 40], which aims to better generalize to a priori fixed target domains whose labels are unknown at training time. This setup is different from ours in that these algorithms require access to samples from the target distribution during training. Domain generalization methods [28, 22, 27, 33, 24] that propose different ways to better generalize to unknown domains are also related to our work. These algorithms require 3By semantic space we mean learned representations since recent works [7, 16] suggest that distances in the space of learned representations of high capacity models typically correspond to semantic distances in visual space. 2 the training samples to be drawn from different domains (while having access to the domain labels during training), not a single source, a limitation that our method does not have. In this sense, one could interpret our problem setting as unsupervised domain generalization. Tobin et al. [37] proposes domain randomization, which applies to simulated data and creates a variety of random renderings with the simulator, hoping that the real world will be interpreted as one of them. Our goal is the same, since we aim at obtaining data distributions more similar to the real world ones, but we accomplish it by actually learning new data points, and thus making our approach applicable to any data source and without the need of a simulator. Hendrycks and Gimpel [13] suggest that a good empirical way to detect whether a test sample is out-of-distribution for a given model is to evaluate the statistics of the softmax outputs. We adapt this idea in our setting, learning ensemble of models trained with our method and choosing at test time the model with the greatest maximum softmax value. 2 Method The worst-case formulation (1) over domains around the source P0 hinges on the notion of distance D(P, P0), that characterizes the set of unknown populations we wish to generalize to. Conventional notions of Wasserstein distance used for adversarial training [34] are defined with respect to the original input space X, which for images corresponds to raw pixels. Since our goal is to consider fictitious target distributions corresponding to realistic covariate shifts, we define our distance on the semantic space. Before properly defining our setup, we first give a few notations. Letting p the dimension of output of the last hidden layer, we denote θ = (θc, θf) where θc ∈Rp×m is the set of weights of the final layer, and θf is the rest of the weights of the network. We denote by g(θf; x) the output of the embedding layer of our neural network. For example, in the classification setting, m is the number of classes and we consider the softmax loss ℓ(θ; (x, y)) := −log exp θ⊤ c,yg(θf; x)  Pm j=1 exp θ⊤ c,jg(θf; x)  (2) where θc,j is the j-th column of the classification layer weights θc ∈Rp×m. Wasserstein distance on the semantic space On the space Rp × Y, consider the following transportation cost c—cost of moving mass from (z, y) to (z′, y′) c((z, y), (z′, y′)) := 1 2 ∥z −z′∥2 2 + ∞· 1 {y ̸= y′} . The transportation cost takes value ∞for data points with different labels, since we are only interested in perturbation to the marginal distribution of Z. We now define our notion of distance on the semantic space. For inputs coming from the original space X × Y, we consider the transportation cost cθ defined with respect to the output of the last hidden layer cθ((x, y), (x′, y′)) := c((g(θf; x), y), (g(θf; x′), y′)) so that cθ measures distance with respect to the feature mapping g(θf; x). For probability measures P and Q both supported on X × Y, let Π(P, Q) denote their couplings, meaning measures M with M(A, X × Y) = P(A) and M(X × Y, A) = Q(A). Then, we define our notion of distance by Dθ(P, Q) := inf M∈Π(P,Q) EM[cθ((X, Y ), (X′, Y ′))]. (3) Armed with this notion of distance on the semantic space, we now consider a variant of the worst-case problem (1) where we replace the distance with Dθ (3), our adaptive notion of distance defined on the semantic space minimize θ∈Θ sup P {EP [ℓ(θ; (X, Y ))] : Dθ(P, P0) ≤ρ} . Computationally, the above supremum over probability distributions is intractable. Hence, we consider the following Lagrangian relaxation with penalty parameter γ minimize θ∈Θ sup P {EP [ℓ(θ; (X, Y ))] −γDθ(P, P0)} . (4) 3 Algorithm 1 Adversarial Data Augmentation Input: original dataset {Xi, Yi}i=1,...,n and initialized weights θ0 Output: learned weights θ 1: Initialize: θ ←θ0 2: for k = 1, ..., K do ▷Run the minimax procedure K times 3: for t = 1, ..., Tmin do 4: Sample (Xt, Yt) uniformly from dataset 5: θ ←θ −α∇θℓ(θ; (Xt, Yt)) 6: Sample {Xi, Yi}i=1,...,n uniformly from the dataset 7: for i = 1, . . . , n do 8: Xk i ←Xi 9: for t = 1, . . . , Tmax do 10: Xk i ←Xk i + η∇x  ℓ(θ; (Xk i , Yi)) −γcθ((Xk i , Yi), (Xi, Yi)) 11: Append (Xk i , Y k i ) to dataset 12: for t = 1, . . . , T do 13: Sample (X, Y ) uniformly from dataset 14: θ ←θ −α∇θℓ(θ; (X, Y )) Taking the dual reformulation of the penalty relaxation (4), we can obtain an efficient solution procedure. The following result is a minor adaptation of [2, Theorem 1]; to ease notation, let us define the robust surrogate loss φγ(θ; (x0, y0)) := sup x∈X {ℓ(θ; (x, y0)) −γcθ((x, y0), (x0, y0))} . (5) Lemma 1. Let ℓ: Θ × (X × Y) →R be continuous. For any distribution Q and any γ ≥0, we have sup P {EP [ℓ(θ; (X, Y ))] −γDθ(P, Q)} = EQ[φγ(θ; (X, Y ))]. (6) In order to solve the penalty problem (4), we can now perform stochastic gradient descent procedures on the robust surrogate loss φγ. Under suitable conditions [5], we have ∇θφγ(θ; (x0, y0)) = ∇θℓ(θ; (x⋆ γ, y0)), (7) where x⋆ γ = arg maxx∈X {ℓ(θ; (x, y0)) −γcθ((x, y0), (x0, y0))} is an adversarial perturbation of x0 at the current model θ. Hence, computing gradients of the robust surrogate φγ requires solving the maximization problem (5). Below, we consider an (heuristic) iterative procedure that iteratively performs stochastic gradient steps on the robust surrogate φγ. Iterative Procedure We propose an iterative training procedure where two phases are alternated: a maximization phase where new data points are learned by computing the inner maximization problem (5) and a minimization phase, where the model parameters are updated according to stochastic gradients of the loss evaluated on the adversarial examples generated from the maximization phase. The latter step is equivalent to stochastic gradient steps on the robust surrogate loss φγ, which motivates its name. The main idea here is to iteratively learn "hard" data points from fictitious target distributions, while preserving the semantic features of the original data points. Concretely, in the k-th maximization phase, we compute n adversarially perturbed samples at the current model θ ∈Θ Xk i ∈arg max x∈X  ℓ(θ; (x, Yi)) −γcθ((x, Yi), (Xk−1 i , Yi)) (8) where X0 i are the original samples from the source distribution P0. The minimization phase then performs repeated stochastic gradient steps on the augmented dataset {Xk i , Yi}0≤k≤K,1≤i≤n}. The maximization phase (8) can be efficiently computed for smooth losses if x 7→cθk−1((x, Yi), (Xk−1 i , Yi)) is strongly convex [34, Theorem 2]; for example, this is provably true for any linear network. In practice, we use gradient ascent steps to solve for worst-case examples (8); see Algorithm 1 for the full description of our algorithm. 4 Ensembles for classification The hyperparameter γ—which is inversely proportional to ρ, the distance between the fictitious target distribution and the source—controls the ability to generalize outside the source domain. Since target domains are unknown, it is difficult to choose an appropriate level of γ a priori. We propose a heuristic ensemble approach where we train s models  θ0, ..., θs . Each model is associated with a different value of γ, and thus to fictitious target distributions with varying distances from the source P0. To select the best model at test time—inspired by Hendrycks and Gimpel [13]—given a sample x, we select the model θu⋆(x) with the greatest softmax score u⋆(x) := arg max 1≤u≤s max 1≤j≤k θu⊤ c,j g(θu f ; x). (9) 3 Theoretical Motivation In our iterative algorithm (Algorithm 1), the maximization phase (8) was a key step that augmented the dataset with adversarially perturbed data points, which was followed by standard stochastic gradient updates to the model parameters. In this section, we provide some theoretical understanding of the augmentation step (8). First, we show that the augmented data points (8) can be interpreted as Tikhonov regularized Newton-steps [21, 25] in the semantic space under the current model. Roughly speaking, this gives the sense in which Algorithm 1 is an adaptive data augmentation algorithm that adds data points from fictitious "hard" target distributions. Secondly, recall the robust surrogate loss (5) whose stochastic gradients were used to update the model parameters θ in the minimization step (Eq (7)). In the classification setting, we show that the robust surrogate (5) roughly corresponds to a novel data-dependent regularization scheme on the softmax loss ℓ. Instead of penalizing towards zero like classical regularizers (e.g., ridge or lasso), our data-dependent regularization term penalizes deviations from the parameter vector corresponding to that of the true label. 3.1 Adaptive Data Augmentation We now give an interpretation for the augmented data points in the maximization phase (8). Concretely, we fix θ ∈Θ, x0 ∈X, y0 ∈Y, and consider an ϵ-maximizer x⋆ ϵ ∈ϵ- arg max x∈X {ℓ(θ; (x, y0)) −γcθ((x, y0), (x0, y0))} . We let z0 := g(θf; x0) ∈Rp, and abuse notation by using ℓ(θ; (z0, y0)) := ℓ(θ; (x0, y0)). In what follows, we show that the feature mapping g(θf; x⋆ ϵ) satisfies g(θf; x⋆ ϵ) = g(θf; x0) + 1 γ  I −1 γ ∇zzℓ(θ; (z0, y0)) −1 ∇zℓ(θ; (z0, y0)) | {z } =: bgnewton(θf ;x0) +O r ϵ γ + 1 γ2  . (10) Intuitively, this implies that the adversarially perturbed sample x⋆ ϵ is drawn from a fictitious target distribution where probability mass on z0 = g(θf; x0) was transported to bgnewton(θf; x0). We note that the transported point in the semantic space corresponds to a Tikhonov regularized Newton-step [21, 25] on the loss z 7→ℓ(θ; (z, y0)) at the current model θ. Noting that computing bgnewton(θf; x0) involves backsolves on a large dense matrix, we can interpret our gradient ascent updates in the maximization phase (8) as an iterative scheme for approximating this quantity. We assume sufficient smoothness, where we use ∥H∥to denote the ℓ2-operator norm of a matrix H. Assumption 1. There exists L0, L1 > 0 such that, for all z, z′ ∈Rp, we have |ℓ(θ; (z, y0)) − ℓ(θ; (z′, y0))| ≤L0 ∥z −z′∥2 and ∥∇zℓ(θ; (z, y0)) −∇zℓ(θ; (z′, y0))∥2 ≤L1 ∥z −z′∥2. Assumption 2. There exists L2 > 0 such that, for all z, z′ ∈ Rp, we have ∥∇zzℓ(θ; (z, y0)) −∇zzℓ(θ; (z′, y0))∥≤L2 ∥z −z′∥2. Then, we have the following bound (10) whose proof we defer to Appendix A.1. Theorem 1. Let Assumptions 1, 2 hold. If Im(g(θf; ·)) = Rp and γ > L1, then ∥g(θf; x⋆ ϵ) −bgnewton(θf; x0)∥2 2 ≤ 2ϵ γ −L1 + L2 3(γ −L1) (5L0 γ 3 +  L0 γ −L1 3 + 2ϵ γ  3 2 ) . 5 3.2 Data-Dependent Regularization In this section, we argue that under suitable conditions on the loss, φγ(θ; (z, y)) = ℓ(θ; (z, y)) + 1 γ ∥∇zℓ(θ; (z, y))∥2 2 + O  1 γ2  . For classification problems, we show that the robust surrogate loss (5) corresponds to a particular data-dependent regularization scheme. Let ℓ(θ; (x, y)) be the m-class softmax loss (2) given by ℓ(θ; (x, y)) = −log py(θ, x) where pj(θ, x) := exp(θ⊤ c,jg(θ, x)) Pm l=1 exp(θ⊤ c,lg(θf; x)). where θc,j ∈Rp is the j-th row of the classification layer weight θc ∈Rp×m. Then, the robust surrogate φγ is an approximate regularizer on the classification layer weights θc φγ(θ; (x, y)) = ℓ(θ; (x, y)) + 1 γ θc,y − m X j=1 pj(θ, x)θc,j 2 2 + O  1 γ2  . (11) The expansion (11) shows that the robust surrogate (5) is roughly equivalent to data-dependent regularization where we minimize the distance between Pm j=1 pj(θ, x)θc,j, our “average estimated linear classifier”, to θc,y, the linear classifier corresponding to the true label y. Concretely, for any fixed θ ∈Θ, we have the following result where we use L(θ) := 2 max1≤j′≤m ∥θc,j′∥2 Pm j=1 ∥θc,j∥2 to ease notation. See Appendix A.3 for the proof. Theorem 2. If Im(g(θf; ·)) = Rp and γ > L(θ), the softmax loss (2) satisfies 1 γ + L(θ) θc,y − m X j=1 pj(θ, x)θc,j 2 2 ≤φγ(θ, (x, y))−ℓ(θ, (x, y)) ≤ 1 γ −L(θ) θc,y − m X j=1 pj(θ, x)θc,j 2 2 . 4 Experiments We evaluate our method for both classification and semantic segmentation settings, following the evaluation scenarios of domain adaptation techniques [9, 39, 14], though in our case the target domains are unknown at training time. We summarize our experimental setup including implementation details, evaluation metrics and datasets for each task. Digit classification We train on MNIST [19] dataset and test on MNIST-M [9], SVHN [30], SYN [9] and USPS [6]. We use 10, 000 digit samples for training and evaluate our models on the respective test sets of the different target domains, using accuracy as a metric. In order to work with comparable datasets, we resized all the images to 32×32, and treated images from MNIST and USPS as RGB. We use a ConvNet [18] with architecture conv-pool-conv-pool-fc-fc-softmax and set the hyperparameters α = 0.0001, η = 1.0, Tmin = 100 and Tmax = 15. In the minimization phase, we use Adam [17] with batch size equal to 324. We compare our method against the Empirical Risk Minimization (ERM) baseline and different regularization techniques (Dropout [35], ridge). Semantic scene segmentation We use the SYTHIA[31] dataset for semantic segmentation. The dataset contains images from different locations (we use Highway, New York-like City and Old European Town), and different weather/time/date conditions (we use Dawn, Fog, Night, Spring and Winter. We train models on a source domain and test on other domains, using the standard mean Intersection Over Union (mIoU) metric to evaluate our performance [8]. We arbitrarily chose images from the left front camera throughout our experiments. For each one, we sample 900 random images (resized to 192 × 320 pixels) from the training set. We use a Fully Convolutional Network (FCN) [23], with a ResNet-50 [11] body and set the hyperparameters α = 0.0001, η = 2.0, Tmin = 500 and Tmax = 50. For the minimization phase, we use Adam [17] with batch size equal to 8. We compare our method against the ERM baseline. 4.1 Results on Digit Classification In this section, we present and discuss the results on the digit classification experiment. Firstly, we are interested in analyzing the role of the semantic constraint we impose. Figure 1a (top) shows 4Models were implemented using Tensorflow, and training procedures were performed on NVIDIA GPUs. Code is available at https://github.com/ricvolpi/generalize-unseen-domains 6 Figure 1. Results associated with models trained with 10, 000 MNIST samples and tested on SVHN, MNIST-M, SYN and USPS (1st, 2nd, 3rd and 4th columns, respectively). Panel (a), top: comparison between distances in the pixel space (yellow) and in the semantic space (blue), with γ = 104 and K = 1. Panel (a), bottom: comparison between our method with K = 2 and different γ values (blue bars) and ERM (red line). Panel (b), top: comparison between our method with γ = 1.0 and different number of iterations K (blue), ERM (red) and Dropout [35] (yellow). Panel (b), middle: comparison between models regularized with ridge (green) and with ridge + our method with γ = 1.0 and K = 1 (blue). Panel (b), bottom: results related to the ensemble method, using models trained with our methods with different number of iterations K (blue) and using models trained via ERM (red). The reported results are obtained by averaging over 10 different runs; black bars indicate the range of accuracy spanned. performances associated with models trained with Algorithm 1 with K = 1 and γ = 104, with the constraint in the semantic space (as discussed in Section 2) and in the pixel space [34] (blue and yellow bars, respectively). Figure 1a (bottom) shows performances of models trained with our method using different values of the hyperparameter γ (with K = 2) and with ERM (blue bars and red lines, respectively). These plots show (i) that moving the constraint on the semantic space carries benefits when models are tested on unseen domains and (ii) that models trained with Algorithm 1 outperform models train with ERM for any value of γ on out-of-sample domains (SVHN, MNIST-M 7 Figure 2. Results obtained with semantic segmentation models trained with ERM (red) and our method with K = 1 and γ = 1.0 (blue). Leftmost panels are associated with models trained on Highway, rightmost panels are associated with models trained on New York-like City. Test datasets are Highway, New York-like City and Old European Town. and SYN). The latter result is a rather desired achievement, since this hyperparameter cannot be properly cross-validated. On USPS, our method causes accuracy to drop since MNIST and USPS are very similar datasets, thus the image domain that USPS belongs to is not explored by our algorithm during the training procedure, which optimizes for worst case performance. Figure 1b (top) reports results related to models trained with our method (blue bars), varying the number of iterations K and fixing γ = 1.0, and results related to ERM (red bars) and Dropout [35] (yellow bars). We observe that our method improves performances on SVHN, MNIST-M and SYN, outperforming both ERM and Dropout [35] statistically significantly. In Figure 1b (middle), we compare models trained with ridge regularization (green bars) with models trained with Algorithm 1 (with K = 1 and γ = 1.0) and ridge regularization (blue bars); these results show that our method can potentially benefit from other regularization approaches, as in this case we observed that the two effects sum up. We further report in Appendix B a comparison between our method and an unsupervised domain adaptation algorithm (ADDA [39]), and results associated with different values of the hyperparameters γ and K. Finally, we report the results obtained by learning an ensemble of models. Since the hyperparameter γ is nontrivial to set a priori, we use the softmax confidences (9) to choose which model to use at test time. We learn ensemble of models, each of which is trained by running Algorithm 1 with different values of the γ as γ = 10−i, with i =  0, 1, 2, 3, 4, 5, 6 . Figure 1b (bottom) shows the comparison between our method with different numbers of iterations K and ERM (blue and red bars, respectively). In order to separate the role of ensemble learning, we learn an ensemble of baseline models each corresponding to a different initialization. We fix the number of models in the ensemble to be the same for both the baseline (ERM) and our method. Comparing Figure 1b (bottom) with Figure 1b (top) and Figure 1a (bottom), our ensemble approach achieves higher accuracy in different testing scenarios. We observe that our out-of-sample performance improves as the number of iterations K gets large. Also in the ensemble setting, for the USPS dataset we do not see any improvement, which we conjecture to be an artifact of the trade-off between good performance on domains far away from training, and those closer. 4.2 Results on Semantic Scene Segmentation We report a comparison between models trained with ERM and models trained with our method (Algorithm 1 with K = 1). We set γ = 1.0 in every experiment, but stress that this is an arbitrary value; we did not observe a strong correlation between the different values of γ and the general behavior of the models in this case. Its role was more meaningful in the ensemble setting where each model is associated with a different level of robustness, as discussed in Section 2. In this setting, we do not apply the ensemble approach, but only evaluate the performances of the single models. The 8 main reason for this choice is the fact that the heuristics developed to choose the correct model at test time in effect cannot be applied in a straightforward fashion to a semantic segmentation problem. Figure 2 reports numerical results obtained. Specifically, leftmost plots report results associated with models trained on sequences from the Highway split and tested on the New York-like City and the Old European Town splits (top-left and bottom-left, respectively); rightmost plots report results associated with models trained on sequences from the New York-like City split and tested on the Highway and the Old European Town splits (top-right and bottom-right, respectively). The training sequences (Dawn, Fog, Night, Spring and Winter) are indicated on the x-axis. Red and blue bars indicate average mIoUs achieved by models trained with ERM and by models trained with our method, respectively. These results were calculated by averaging over the mIoUs obtained with each model on the different conditions of the test set. As can be observed, models trained with our method mostly better generalize to unknown data distributions. In particular, our method always outperforms the baseline by a statistically significant margin when the training images are from Night scenarios. This is since the baseline models trained on images from Night are strongly biased towards dark scenery, while, as a consequence of training over worst-case distributions, our models can overcome this strong bias and better generalize across different unseen domains. 5 Conclusions and Future Work We study a new adversarial data augmentation procedure that learns to better generalize across unseen data distributions, and define an ensemble method to exploit this technique in a classification framework. This is in contrast to domain adaptation algorithms, which require a sufficient number of samples from a known, a priori fixed target distribution. Our experimental results show that our iterative procedure provides broad generalization behavior on digit recognition and cross-season and cross-weather semantic segmentation tasks. For future work, we hope to extend the ensemble methods by defining novel decision rules. The proposed heuristics (9) only apply to classification settings, and extending them to a broad realm of tasks including semantic segmentation is an important direction. Many theoretical questions still remain. For instance, quantifying the behavior of data-dependent regularization schemes presented in Section 3 would help us better understand adversarial training methods in general. References [1] Shai Ben-David, John Blitzer, Koby Crammer, and Fernando Pereira. Analysis of representations for domain adaptation. In B. Schölkopf, J. C. Platt, and T. Hoffman, editors, Advances in Neural Information Processing Systems 19, pages 137–144. MIT Press, 2007. [2] Jose Blanchet and Karthyek Murthy. Quantifying distributional model risk via optimal transport. arXiv:1604.01446 [math.PR], 2016. [3] John Blitzer, Ryan McDonald, and Fernando Pereira. Domain adaptation with structural correspondence learning. In Proceedings of the 2006 Conference on Empirical Methods in Natural Language Processing, EMNLP ’06, pages 120–128, Stroudsburg, PA, USA, 2006. Association for Computational Linguistics. [4] J Frédéric Bonnans and Alexander Shapiro. Perturbation analysis of optimization problems. Springer Science & Business Media, 2013. [5] Stephen Boyd and Lieven Vandenberghe. Convex Optimization. Cambridge University Press, 2004. [6] J. S. Denker, W. R. Gardner, H. P. Graf, D. Henderson, R. E. Howard, W. Hubbard, L. D. Jackel, H. S. Baird, and I. Guyon. Advances in neural information processing systems 1. chapter Neural Network Recognizer for Hand-written Zip Code Digits, pages 323–331. 1989. [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. 9 [8] M. Everingham, L. Van Gool, C. K. I. Williams, J. Winn, and A. Zisserman. The PASCAL Visual Object Classes Challenge 2008 (VOC2008) Results. http://www.pascalnetwork.org/challenges/VOC/voc2008/workshop/index.html. [9] Yaroslav Ganin and Victor S. Lempitsky. Unsupervised domain adaptation by backpropagation. In Proceedings of the 32nd International Conference on Machine Learning, ICML 2015, Lille, France, 6-11 July 2015, pages 1180–1189, 2015. [10] Ian Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In International Conference on Learning Representations, 2015. [11] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. CoRR, abs/1512.03385, 2015. [12] Christina Heinze-Deml and Nicolai Meinshausen. Conditional variance penalties and domain shift robustness. arXiv preprint arXiv:1710.11469, 2017. [13] Dan Hendrycks and Kevin Gimpel. A baseline for detecting misclassified and out-of-distribution examples in neural networks. CoRR, abs/1610.02136, 2016. [14] Judy Hoffman, Dequan Wang, Fisher Yu, and Trevor Darrell. Fcns in the wild: Pixel-level adversarial and constraint-based adaptation. CoRR, abs/1612.02649, 2016. [15] Hal Daumé III and Daniel Marcu. Domain adaptation for statistical classifiers. CoRR, abs/1109.6341, 2011. [16] Justin Johnson, Alexandre Alahi, and Li Fei-Fei. Perceptual losses for real-time style transfer and super-resolution. In European Conference on Computer Vision, pages 694–711. Springer, 2016. [17] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2014. [18] Yann LeCun, Bernhard E. Boser, John S. Denker, Donnie Henderson, Richard E. Howard, Wayne E. Hubbard, and Lawrence D. Jackel. Backpropagation applied to handwritten zip code recognition. Neural Computation, 1(4):541–551, 1989. [19] Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. In Proceedings of the IEEE, pages 2278–2324, 1998. [20] Jaeho Lee and Maxim Raginsky. Minimax statistical learning and domain adaptation with wasserstein distances. arXiv preprint arXiv:1705.07815, 2017. [21] K Levenberg. A method for the solution of certain problems in least squares. quart. appl. math. 2. 1944. [22] Da Li, Yongxin Yang, Yi-Zhe Song, and Timothy M. Hospedales. Deeper, broader and artier domain generalization. CoRR, abs/1710.03077, 2017. [23] Jonathan Long, Evan Shelhamer, and Trevor Darrell. Fully convolutional networks for semantic segmentation. CoRR, abs/1411.4038, 2014. [24] M. Mancini, S. R. Bulò, B. Caputo, and E. Ricci. Robust place categorization with deep domain generalization. IEEE Robotics and Automation Letters, 3(3):2093–2100, July 2018. [25] Donald W Marquardt. An algorithm for least-squares estimation of nonlinear parameters. Journal of the society for Industrial and Applied Mathematics, 11(2):431–441, 1963. [26] Pietro Morerio, Jacopo Cavazza, and Vittorio Murino. Minimal-entropy correlation alignment for unsupervised deep domain adaptation. International Conference on Learning Representations, 2018. [27] Saeid Motiian, Marco Piccirilli, Donald A. Adjeroh, and Gianfranco Doretto. Unified deep supervised domain adaptation and generalization. In The IEEE International Conference on Computer Vision (ICCV), Oct 2017. 10 [28] Krikamol Muandet, David Balduzzi, and Bernhard Schölkopf. Domain generalization via invariant feature representation. In Sanjoy Dasgupta and David McAllester, editors, Proceedings of the 30th International Conference on Machine Learning, volume 28 of Proceedings of Machine Learning Research, pages 10–18, Atlanta, Georgia, USA, 17–19 Jun 2013. PMLR. [29] Yurii Nesterov and Boris T Polyak. Cubic regularization of newton method and its global performance. Mathematical Programming, 108(1):177–205, 2006. [30] Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y. Ng. Reading digits in natural images with unsupervised feature learning. In NIPS Workshop on Deep Learning and Unsupervised Feature Learning 2011, 2011. [31] German Ros, Laura Sellart, Joanna Materzynska, David Vazquez, and Antonio M. Lopez. The synthia dataset: A large collection of synthetic images for semantic segmentation of urban scenes. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2016. [32] Kate Saenko, Brian Kulis, Mario Fritz, and Trevor Darrell. Adapting visual category models to new domains. In Proceedings of the 11th European Conference on Computer Vision: Part IV, ECCV’10, pages 213–226, Berlin, Heidelberg, 2010. Springer-Verlag. [33] Shiv Shankar, Vihari Piratla, Soumen Chakrabarti, Siddhartha Chaudhuri, Preethi Jyothi, and Sunita Sarawagi. Generalizing across domains via cross-gradient training. In International Conference on Learning Representations, 2018. [34] Aman Sinha, Hongseok Namkoong, and John Duchi. Certifiable distributional robustness with principled adversarial training. In International Conference on Learning Representations, 2018. [35] 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), January 2014. [36] Baochen Sun and Kate Saenko. Deep CORAL: correlation alignment for deep domain adaptation. In ECCV Workshops, 2016. [37] Joshua Tobin, Rachel Fong, Alex Ray, Jonas Schneider, Wojciech Zaremba, and Pieter Abbeel. Domain randomization for transferring deep neural networks from simulation to the real world. CoRR, abs/1703.06907, 2017. [38] A. Torralba and A. A. Efros. Unbiased look at dataset bias. In Proceedings of the 2011 IEEE Conference on Computer Vision and Pattern Recognition, CVPR ’11, pages 1521–1528, Washington, DC, USA, 2011. IEEE Computer Society. [39] Eric Tzeng, Judy Hoffman, Kate Saenko, and Trevor Darrell. Adversarial discriminative domain adaptation. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), July 2017. [40] Riccardo Volpi, Pietro Morerio, Silvio Savarese, and Vittorio Murino. Adversarial feature augmentation for unsupervised domain adaptation. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018. 11
2018
133
7,290
Information-theoretic Limits for Community Detection in Network Models Chuyang Ke Department of Computer Science Purdue University West Lafayette, IN 47907 cke@purdue.edu Jean Honorio Department of Computer Science Purdue University West Lafayette, IN 47907 jhonorio@purdue.edu Abstract We analyze the information-theoretic limits for the recovery of node labels in several network models. This includes the Stochastic Block Model, the Exponential Random Graph Model, the Latent Space Model, the Directed Preferential Attachment Model, and the Directed Small-world Model. For the Stochastic Block Model, the non-recoverability condition depends on the probabilities of having edges inside a community, and between different communities. For the Latent Space Model, the non-recoverability condition depends on the dimension of the latent space, and how far and spread are the communities in the latent space. For the Directed Preferential Attachment Model and the Directed Small-world Model, the non-recoverability condition depends on the ratio between homophily and neighborhood size. We also consider dynamic versions of the Stochastic Block Model and the Latent Space Model. 1 Introduction Network models have already become a powerful tool for researchers in various fields. With the rapid expansion of online social media including Twitter, Facebook, LinkedIn and Instagram, researchers now have access to more real-life network data and network models are great tools to analyze the vast amount of interactions [16, 2, 1, 21]. Recent years have seen the applications of network models in machine learning [5, 33, 23], bioinformatics [9, 15, 11], as well as in social and behavioral researches [26, 14]. Among these literatures one of the central problems related to network models is community detection. In a typical network model, nodes represent individuals in a social network, and edges represent interpersonal interactions. The goal of community detection is to recover the label associated with each node (i.e., the community where each node belongs to). The exact recovery of 100% of the labels has always been an important research topic in machine learning, for instance, see [2, 10, 20, 27]. One particular issue researchers care about in the recovery of network models is the relation between the number of nodes, and the proximity between the likelihood of connecting within the same community and across different communities. For instance, consider the Stochastic Block Model (SBM), in which p is the probability for connecting two nodes in the same community, and q is the probability for connecting two nodes in different communities. Clearly if p equals q, it is impossible to identify the communities, or equivalently, to recover the labels for all nodes. Intuitively, as the difference between p and q increases, labels are easier to be recovered. In this paper, we analyze the information-theoretic limits for community detection. Our main contribution is the comprehensive study of several network models used in the literature. To accomplish that task, we carefully construct restricted ensembles. The key idea of using restricted ensembles is that for any learning problem, if a subclass of models is difficult to be learnt, then the original class 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. Table 1: Comparison of network models (S - static; UD - undirected dynamic; DD - directed dynamic) Type Model Our Result Previous Result Thm. No. S SBM (p−q)2 q(1−q) ≤2 log 2 n −4 log 2 n2 (p−q)2 p+q ≤2 n[25] Thm. 1 (p−q)2 q(1−q) ≤O( 1 n)[10] S ERGM 2(cosh β −1) ≤2 log 2 n −4 log 2 n2 Novel Cor. 1 S LSM (4σ2 + 1)−1−p/2∥µ∥2 2 ≤log 2 2n −log 2 n2 Novel Thm. 2 UD DSBM (p−q)2 q(1−q) ≤(n−2) log 2 n2−n Novel Thm. 3 UD DLSM (4σ2 + 1)−1−p/2∥µ∥2 2 ≤(n−2) log 2 4n2−4n Novel Thm. 4 DD DPAM (s + 1)/8m ≤2(n−2)/(n2−n)/n2 Novel Thm. 5 DD DSWM (s + 1)2/(mp(1 −p)) ≤22(n−2)/n2/n Novel Thm. 6 of models will be at least as difficult to be learnt. The use of restricted ensembles is customary for information-theoretic lower bounds [28, 31]. We provide a series of novel results in this paper. While the information-theoretic limits of the Stochastic Block Model have been heavily studied (in slightly different ways), none of the other models considered in this paper have been studied before. Thus, we provide new information-theoretic results for the Exponential Random Graph Model (ERGM), the Latent Space Model (LSM), the Directed Preferential Attachment Model (DPAM), and the Directed Small-world Model (DSWM). We also provide new results for dynamic versions of the Stochastic Block Model (DSBM) and the Latent Space Model (DLSM). Table 1 summarizes our results. 2 Static Network Models In this section we analyze the information-theoretic limits for two static network models: the Stochastic Block Model (SBM) and the Latent Space Model (LSM). Furthermore, we include a particular case of the Exponential Random Graph Model (ERGM) as a corollary of our results for the SBM. We call these static models, because in these models edges are independent of each other. 2.1 Stochastic Block Model Among different network models the Stochastic Block Model (SBM) has received particular attention. Variations of the Stochastic Block Model include, for example, symmetric SBMs [3], binary SBMs [27, 13], labelled SBMs [36, 20, 34, 18], and overlapping SBMs [4]. For regular SBMs [25] and [10] showed that under certain conditions recovering the communities in a SBM is fundamentally impossible. Our analysis for the Stochastic Block Model follows the method used in [10] but we analyze a different regime. In [10], two clusters are required to have the equal size (Planted Bisection Model), while in our SBM setup, nature picks the label of each node uniformly at random. Thus in our model only the expectation of the sizes of the two communities are equal. We now define the Stochastic Block Model, which has two parameters p and q. Definition 1 (Stochastic Block Model). Let 0 < q < p < 1. A Stochastic Block Model with parameters (p, q) is an undirected graph of n nodes with the adjacency matrix A, where each Aij ∈{0, 1}. Each node is in one of the two classes {+1, −1}. The distribution of true labels Y ∗= (y∗ 1, . . . , y∗ n) is uniform, i.e., each label y∗ i is assigned to +1 with probability 0.5, and −1 with probability 0.5. The adjacency matrix A is distributed as follows: if y∗ i = y∗ j then Aij is Bernoulli with parameter p; otherwise Aij is Bernoulli with parameter q. The goal is to recover labels ˆY = (ˆy1, . . . , ˆyn) that are equal to the true labels Y ∗, given the observation of A. We are interested in the information-theoretic lower bounds. Thus, we define the Markov chain Y ∗→A →ˆY . Using Fano’s inequality, we obtain the following results. 2 Theorem 1. In a Stochastic Block Model with parameters (p, q) with 0 < q < p < 1, if (p −q)2 q(1 −q) ≤2 log 2 n −4 log 2 n2 , then we have that for any algorithm that a learner could use for picking ˆY , the probability of error P( ˆY ̸= Y ∗) is greater than or equal to 1 2. Notice that our result for the Stochastic Block Model is similar to the one in [10]. This means that the method of generating labels does not affect the information-theoretic bound. 2.2 Exponential Random Graph Model Exponential Random Graph Models (ERGMs) are a family of distributions on graphs of the following form: P(A) = exp(φ(A))/ P A′ exp(φ(A′)), where φ : {0, 1}n×n →R is some potential function over graphs. Selecting different potential functions enables ERGMs to model various structures in network graphs, for instance, the potential function can be a sum of functions over edges, triplets, cliques, among other choices [16]. In this section we analyze a special case of the Exponential Random Graph Model as a corollary of our results for the Stochastic Block Model, in which the potential function is defined as a sum of functions over edges. That is, φ(A) = P i,j|Aij=1 φij(yi, yj), where φij(yi, yj) = βyiyj and β > 0 is a parameter. Simplifying the expression above, we have φ(A) = P i,j βAijyiyj. This leads to the following definition. Definition 2 (Exponential Random Graph Model). Let β > 0. An Exponential Random Graph Model with parameter β is an undirected graph of n nodes with the adjacency matrix A, where each Aij ∈{0, 1}. Each node is in one of the two classes {+1, −1}. The distribution of true labels Y ∗= (y∗ 1, . . . , y∗ n) is uniform, i.e., each label y∗ i is assigned to +1 with probability 0.5, and −1 with probability 0.5. The adjacency matrix A is distributed as follows: P(A|Y ) = exp(β P i<j Aijyiyj)/Z(β), where Z(β) = P A′∈{0,1}n×n exp(β P i<j A′ ijyiyj). The goal is to recover labels ˆY = (ˆy1, . . . , ˆyn) that are equal to the true labels Y ∗, given the observation of A. Theorem 1 leads to the following result. Corollary 1. In an Exponential Random Graph Model with parameter β > 0, if 2(cosh β −1) ≤2 log 2 n −4 log 2 n2 , then we have that for any algorithm that a learner could use for picking ˆY , the probability of error P( ˆY ̸= Y ∗) is greater than or equal to 1 2. 2.3 Latent Space Model The Latent Space Model (LSM) was first proposed by [19]. The core assumption of the model is that each node has a low-dimensional latent vector associated with it. The latent vectors of nodes in the same community follow a similar pattern. The connectivity of two nodes in the Latent Space Model is determined by the distance between their corresponding latent vectors. Previous works on the Latent Space Model [30] analyzed asymptotic sample complexity, but did not focus on information-theoretic limits for exact recovery. We now define the Latent Space Model, which has three parameters σ > 0, d ∈Z+ and µ ∈Rd, µ ̸= 0. Definition 3 (Latent Space Model). Let d ∈Z+, µ ∈Rd and µ ̸= 0, σ > 0. A Latent Space Model with parameters (d, µ, σ) is an undirected graph of n nodes with the adjacency matrix A, where each Aij ∈{0, 1}. Each node is in one of the two classes {+1, −1}. The distribution of true labels Y ∗= (y∗ 1, . . . , y∗ n) is uniform, i.e., each label y∗ i is assigned to +1 with probability 0.5, and −1 with probability 0.5. 3 For every node i, nature generates a latent d-dimensional vector zi ∈Rd according to the Gaussian distribution Nd(yiµ, σ2I). The adjacency matrix A is distributed as follows: Aij is Bernoulli with parameter exp(−∥zi −zj∥2 2). The goal is to recover labels ˆY = (ˆy1, . . . , ˆyn) that are equal to the true labels Y ∗, given the observation of A. Notice that we do not have access to Z. we are interested in the information-theoretic lower bounds. Thus, we define the Markov chain Y ∗→A →ˆY . Fano’s inequality and a proper conversion of the above model lead to the following theorem. Theorem 2. In a Latent Space Model with parameters (d, µ, σ), if (4σ2 + 1)−1−d/2∥µ∥2 2 ≤log 2 2n −log 2 n2 , then we have that for any algorithm that a learner could use for picking ˆY , the probability of error P( ˆY ̸= Y ∗) is greater than or equal to 1 2. 3 Dynamic Network Models In this section we analyze the information-theoretic limits for two dynamic network models: the Dynamic Stochastic Block Model (DSBM) and the Dynamic Latent Space Model (DLSM). We call these dynamic models, because we assume there exists some ordering for edges, and the distribution of each edge not only depends on its endpoints, but also depends on previously generated edges. We start by giving the definition of predecessor sets. Notice that the following definition of predecessor sets employs a lexicographic order, and the motivation is to use it as a subclass to provide a bound for general dynamic models. Fano’s inequality is usually used for a restricted ensemble, i.e., a subclass of the original class of interest. If a subclass (e.g., dynamic SBM or LSM with a particular predecessor set τ) is difficult to be learnt, then the original class (SBMs or LSMs with general dynamic interactions) will be at least as difficult to be learnt. The use of restricted ensembles is customary for information-theoretic lower bounds [28, 31]. Definition 4. For every pair i and j with i < j, we denote its predecessor set using τi,j, where τij ⊆{(k, l)|(k < l) ∧(k < i ∨(k = i ∧l < j))} and Aτij = {Akl|(k, l) ∈τij}. In a dynamic model, the probability distribution of each edge Aij not only depends on the labels of nodes i and j (i.e., y∗ i and y∗ j ), but also on the previously generated edges Aτij. Next, we prove the following lemma using the definition above. Lemma 1. Assume now the probability distribution of A given labeling Y is P(A|Y ) = Q i<j P(Aij|Aτij, yi, yj). Then for any labeling Y and Y ′, we have KL(PA|Y ∥PA|Y ′) ≤ n 2  max i,j KL(PAij|Aτij ,yi,yj∥PAij|Aτij ,y′ i,y′ j). Similarly, if the probability distribution of A given labeling Y is P(A|Y ) = Q i<j P(Aij|Aτij, y1, . . . , yj), we have KL(PA|Y ∥PA|Y ′) ≤ n 2  max i,j KL(PAij|Aτij ,y1,...,yj∥PAij|Aτij ,y′ 1,...,y′ j). 4 3.1 Dynamic Stochastic Block Model The Dynamic Stochastic Block Model (DSBM) shares a similar setting with the Stochastic Block Model, except that we take the predecessor sets into consideration. Definition 5 (Dynamic Stochastic Block Model). Let 0 < q < p < 1. Let F = {fk}( n 2) k=0 be a set of functions, where fk : {0, 1}k →(0, 1]. A Dynamic Stochastic Block Model with parameters (p, q, F) is an undirected graph of n nodes with the adjacency matrix A, where each Aij ∈{0, 1}. Each node is in one of the two classes {+1, −1}. The distribution of true labels Y ∗= (y∗ 1, . . . , y∗ n) is uniform, i.e., each label y∗ i is assigned to +1 with probability 0.5, and −1 with probability 0.5. The adjacency matrix A is distributed as follows: if y∗ i = y∗ j then Aij is Bernoulli with parameter pf|τij|(Aτij); otherwise Aij is Bernoulli with parameter qf|τij|(Aτij). The goal is to recover labels ˆY = (ˆy1, . . . , ˆyn) that are equal to the true labels Y ∗, given the observation of A. We are interested in the information-theoretic lower bounds. Thus, we define the Markov chain Y ∗→A →ˆY . Using Fano’s inequality and Lemma 1, we obtain the following results. Theorem 3. In a Dynamic Stochastic Block Model with parameters (p, q) with 0 < q < p < 1, if (p −q)2 q(1 −q) ≤n −2 n2 −n log 2, then we have that for any algorithm that a learner could use for picking ˆY , the probability of error P( ˆY ̸= Y ∗) is greater than or equal to 1 2. 3.2 Dynamic Latent Space Model The Dynamic Latent Space Model (DLSM) shares a similar setting with the Latent Space Model, except that we take the predecessor sets into consideration. Definition 6 (Dynamic Latent Space Model). Let d ∈Z+, µ ∈Rd and µ ̸= 0, σ > 0. Let F = {fk}( n 2) k=0 be a set of functions, where fk : {0, 1}k →(0, 1]. A Latent Space Model with parameters (d, µ, σ, F) is an undirected graph of n nodes with the adjacency matrix A, where each Aij ∈{0, 1}. Each node is in one of the two classes {+1, −1}. The distribution of true labels Y ∗= (y∗ 1, . . . , y∗ n) is uniform, i.e., each label y∗ i is assigned to +1 with probability 0.5, and −1 with probability 0.5. For every node i, nature generates a latent d-dimensional vector zi ∈Rd according to the Gaussian distribution Nd(yiµ, σ2I). The adjacency matrix A is distributed as follows: Aij is Bernoulli with parameter f|τij|(Aτij) · exp(−∥zi −zj∥2 2). The goal is to recover labels ˆY = (ˆy1, . . . , ˆyn) that are equal to the true labels Y ∗, given the observation of A. Notice that we do not have access to Z. We are interested in the information-theoretic lower bounds. Thus, we define the Markov chain Y ∗→A →ˆY . Using Fano’s inequality and Lemma 1, our analysis leads to the following theorem. Theorem 4. In a Dynamic Latent Space Model with parameters (d, µ, σ, {fk}), if (4σ2 + 1)−1−d/2∥µ∥2 2 ≤ n −2 4(n2 −n) log 2, then we have that for any algorithm that a learner could use for picking ˆY , the probability of error P( ˆY ̸= Y ∗) is greater than or equal to 1 2. 5 4 Directed Network Models In this section we analyze the information-theoretic limits for two directed network models: the Directed Preferential Attachment Model (DPAM) and the Directed Small-world Model (DSWM). In contrast to previous sections, here we consider directed graphs. Note that in social networks such as Twitter, the graph is directed. That is, each user follows other users. Users that are followed by many others (i.e., nodes with high out-degree) are more likely to be followed by new users. This is the case of popular singers, for instance. Additionally, a new user will follow people with similar preferences. This is referred in the literature as homophily. In our case, a node with positive label will more likely follow nodes with positive label, and vice versa. The two models defined in this section will require an expected number of in-neighbors m, for each node. In order to guarantee this in a setting in which nodes decide to connect to at most k > m nodes independently, one should guarantee that the probability of choosing each of the k nodes is less than or equal to 1/m. The above motivates an algorithm that takes a vector in the k-simplex (i.e., w ∈Rk and Pk i=1 wi = 1) and produces another vector in the k-simplex (i.e., ˜w ∈Rk, Pk i=1 ˜wi = 1 and for all i, ˜wi ≤1/m). Consider the following optimization problem: minimize ˜ w 1 2 k X i=1 ( ˜wi −wi)2 subject to 0 ≤˜wi ≤1 m for all i k X i=1 ˜wi = 1. which is solved by the following algorithm: Algorithm 1: k-simplex input :vector w ∈Rk where Pk i=1 wi = 1, expected number of in-neighbors m ≤k output :vector ˜w ∈Rk where Pk i=1 ˜wi = 1 and ˜wi ≤1/m for all i 1 for i ∈{1, . . . , k} do 2 ˜wi ←wi; 3 end 4 for i ∈{1, . . . , k} such that ˜wi > 1 m do 5 S ←˜wi −1 m; 6 ˜wi ←1 m; 7 Distribute S evenly across all j ∈{1, . . . , k} such that ˜wj < 1 m; 8 end One important property that we will use in our proofs is that mini ˜wi ≥mini wi, as well as maxi ˜wi ≤maxi wi. 4.1 Directed Preferential Attachment Model Here we consider a Directed Preferential Attachment Model (DPAM) based on the classic Preferential Attachment Model [7]. While in the classic model every mode has exactly m neighbors, in our model the expected number of in-neighbors is m. Definition 7 (Directed Preferential Attachment Model). Let m be a positive integer with 0 < m ≪n. Let s > 0 be the homophily parameter. A Directed Preferential Attachment Model with parameters (m, s) is a directed graph of n nodes with the adjacency matrix A, where each Aij ∈{0, 1}. Each node is in one of the two classes {+1, −1}. The distribution of true labels Y ∗= (y∗ 1, . . . , y∗ n) is uniform, i.e., each label y∗ i is assigned to +1 with probability 0.5, and −1 with probability 0.5. Nodes 1 through m are not connected to each other, and they all have an in-degree of 0. For node i from m + 1 to n, nature first generates the weight wji for each node j < i, where wji ∝ 6 (Pi−1 k=1 Ajk + 1)(1[y∗ i = y∗ j ]s + 1), and Pi−1 j=1 wji = 1. Then every node j < i connects to node i with the following probability: P(Aji = 1 | Aτij, y∗ 1, . . . , y∗ j ) = m ˜wji, where ( ˜w1i... ˜wi−1,i) is computed from (w1i...wi−1,i) as in Algorithm 1. The goal is to recover labels ˆY = (ˆy1, . . . , ˆyn) that are equal to the true labels Y ∗, given the observation of A. We are interested in the information-theoretic lower bounds. Thus, we define the Markov chain Y ∗→A →ˆY . Using Fano’s inequality, we obtain the following results. Theorem 5. In a Directed Preferential Attachment Model with parameters (m, s), if s + 1 8m ≤2(n−2)/(n2−n) n2 , then we have that for any algorithm that a learner could use for picking ˆY , the probability of error P( ˆY ̸= Y ∗) is greater than or equal to 1 2. 4.2 Directed Small-world Model Here we consider a Directed Small-world Model (DSWM) based on the classic small-world phenomenon [32]. While in the classic model every mode has exactly m neighbors, in our model the expected number of in-neighbors is m. Definition 8 (Directed Small-world Model). Let m be a positive integer with 0 < m ≪n. Let s > 0 be the homophily parameter. Let p be the mixture parameter with 0 < p < 1. A Directed Small-world Model with parameters (m, s, p) is a directed graph of n nodes with the adjacency matrix A, where each Aij ∈{0, 1}. Each node is in one of the two classes {+1, −1}. The distribution of true labels Y ∗= (y∗ 1, . . . , y∗ n) is uniform, i.e., each label y∗ i is assigned to +1 with probability 0.5, and −1 with probability 0.5. Nodes 1 through m are not connected to each other, and they all have an in-degree of 0. For node i from m + 1 to n, nature first generates the weight wji for each node j < i, where wji ∝(1[y∗ i = y∗ j ]s + 1), and Pi−1 j=i−m wji = p, Pi−m−1 j=1 wji = 1 −p. Then every node j < i connects to node i with the following probability: P(Aji = 1 | Aτij, y∗ 1, . . . , y∗ j ) = m ˜wji, where ( ˜w1i... ˜wi−1,i) is computed from (w1i...wi−1,i) as in Algorithm 1. The goal is to recover labels ˆY = (ˆy1, . . . , ˆyn) that are equal to the true labels Y ∗, given the observation of A. We are interested in the information-theoretic lower bounds. Thus, we define the Markov chain Y ∗→A →ˆY . Using Fano’s inequality, we obtain the following results. Theorem 6. In a Directed Small-world Model with parameters (m, s, p), if (s + 1)2 mp(1 −p) ≤22(n−2)/n2 n , then we have that for any algorithm that a learner could use for picking ˆY , the probability of error P( ˆY ̸= Y ∗) is greater than or equal to 1 2. 5 Concluding Remarks In the past decade a lot of effort has been made in the Stochastic Block Model (SBM) community to find polynomial time algorithms for the exact recovery. For example, [2, 10] provided analyses to various parameter regimes in symmetric SBMs, and showed that some easy regimes could be solved in polynomial time using semidefinite programming relaxation; [3] also provides quasi-linear time algorithms for SBMs; [17] and [6] discovered the existence of phase transition in the exact recovery of symmetric SBMs. All of the aforementioned literature has mathematical guarantees of statistical and computational efficiency. There exists algorithms without formal guarantees, for example, [16] introduced some MCMC-based methods. Other heuristic algorithms include Kernighan-Lin’s algorithm, METIS, Local Spectral Partitioning, etc. (See e.g., [22] for reference.) 7 We want to highlight that community detection for undirected models could be viewed as a special case of the Markov random field (MRF) inference problem. In the MRF model, if the pairwise potentials are submodular, the problem could be solved exactly in polynomial time via graph cuts in the case of two communities [8]. Regarding our contributions, we highlight that the entries in the adjacency matrix A are not independent in several models considered in our paper, including the Dynamic Stochastic Block Model, the Dynamic Latent Space Model, the Directed Preferential Attachment Model and the Directed Small-world Model. Also, in the Latent Space Model and the Dynamic Latent Space Model, we have additional latent variables. Furthermore, in the Directed Preferential Attachment Model and the Directed Small-world Model, an entry in A also depends on several entries in Y ∗to account for homophily. Our research could be extended in several ways. First, our models only involve two symmetric clusters. For the Latent Space Model and dynamic models, it might be interesting to analyze the case with multiple clusters. Some more complicated models involving Markovian assumptions, for example, the Dynamic Social Network in Latent Space model [29], can also be analyzed. We acknowledge that the information-theoretic lower bounds we provide in this paper may not be necessarily tight. It would be interesting to analyze phase transitions and information-computational gaps for the new models. References [1] Emmanuel Abbe. Community detection and stochastic block models: recent developments. arXiv preprint arXiv:1703.10146, 2017. [2] Emmanuel Abbe, Afonso S Bandeira, and Georgina Hall. Exact recovery in the stochastic block model. IEEE Transactions on Information Theory, 62(1):471–487, 2016. [3] Emmanuel Abbe and Colin Sandon. Community detection in general stochastic block models: Fundamental limits and efficient algorithms for recovery. In Foundations of Computer Science (FOCS), 2015 IEEE 56th Annual Symposium on, pages 670–688. IEEE, 2015. [4] Edoardo M Airoldi, David M Blei, Stephen E Fienberg, and Eric P Xing. Mixed membership stochastic blockmodels. Journal of Machine Learning Research, 9(Sep):1981–2014, 2008. [5] Brian Ball, Brian Karrer, and Mark EJ Newman. Efficient and principled method for detecting communities in networks. Physical Review E, 84(3):036103, 2011. [6] Afonso S Bandeira. Random laplacian matrices and convex relaxations. Foundations of Computational Mathematics, 18(2):345–379, 2018. [7] Albert-László Barabási and Réka Albert. Emergence of scaling in random networks. science, 286(5439):509–512, 1999. [8] Yuri Boykov and Olga Veksler. Graph cuts in vision and graphics: Theories and applications. In Handbook of mathematical models in computer vision, pages 79–96. Springer, 2006. [9] Irineo Cabreros, Emmanuel Abbe, and Aristotelis Tsirigos. Detecting community structures in Hi-C genomic data. In Information Science and Systems (CISS), 2016 Annual Conference on, pages 584–589. IEEE, 2016. [10] Yudong Chen and Jiaming Xu. Statistical-computational phase transitions in planted models: The high-dimensional setting. In International Conference on Machine Learning, pages 244– 252, 2014. [11] Melissa S Cline, Michael Smoot, Ethan Cerami, Allan Kuchinsky, Nerius Landys, Chris Workman, Rowan Christmas, Iliana Avila-Campilo, Michael Creech, Benjamin Gross, et al. Integration of biological networks and gene expression data using Cytoscape. Nature protocols, 2(10):2366, 2007. [12] Thomas M Cover and Joy A Thomas. Elements of information theory. John Wiley & Sons, 2012. 8 [13] Yash Deshpande, Emmanuel Abbe, and Andrea Montanari. Asymptotic mutual information for the binary stochastic block model. In Information Theory (ISIT), 2016 IEEE International Symposium on, pages 185–189. IEEE, 2016. [14] Santo Fortunato. Community detection in graphs. Physics reports, 486(3-5):75–174, 2010. [15] Michelle Girvan and Mark EJ Newman. Community structure in social and biological networks. Proceedings of the national academy of sciences, 99(12):7821–7826, 2002. [16] Anna Goldenberg, Alice X Zheng, Stephen E Fienberg, Edoardo M Airoldi, et al. A survey of statistical network models. Foundations and Trends R⃝in Machine Learning, 2(2):129–233, 2010. [17] Bruce Hajek, Yihong Wu, and Jiaming Xu. Achieving exact cluster recovery threshold via semidefinite programming. IEEE Transactions on Information Theory, 62(5):2788–2797, 2016. [18] Simon Heimlicher, Marc Lelarge, and Laurent Massoulié. Community detection in the labelled stochastic block model. NIPS Workshop on Algorithmic and Statistical Approaches for Large Social Networks, 2012. [19] Peter D Hoff, Adrian E Raftery, and Mark S Handcock. Latent space approaches to social network analysis. Journal of the american Statistical association, 97(460):1090–1098, 2002. [20] Varun Jog and Po-Ling Loh. Information-theoretic bounds for exact recovery in weighted stochastic block models using the Renyi divergence. IEEE Allerton Conference on Communication, Control, and Computing, 2015. [21] Bomin Kim, Kevin Lee, Lingzhou Xue, and Xiaoyue Niu. A review of dynamic network models with latent variables. arXiv preprint arXiv:1711.10421, 2017. [22] Jure Leskovec, Kevin J Lang, and Michael Mahoney. Empirical comparison of algorithms for network community detection. In Proceedings of the 19th international conference on World wide web, pages 631–640. ACM, 2010. [23] Greg Linden, Brent Smith, and Jeremy York. Amazon. com recommendations: Item-to-item collaborative filtering. IEEE Internet computing, 7(1):76–80, 2003. [24] Arakaparampil M Mathai and Serge B Provost. Quadratic forms in random variables: theory and applications. Dekker, 1992. [25] Elchanan Mossel, Joe Neeman, and Allan Sly. Stochastic block models and reconstruction. arXiv preprint arXiv:1202.1499, 2012. [26] Mark EJ Newman, Duncan J Watts, and Steven H Strogatz. Random graph models of social networks. Proceedings of the National Academy of Sciences, 99(suppl 1):2566–2572, 2002. [27] Hussein Saad, Ahmed Abotabl, and Aria Nosratinia. Exact recovery in the binary stochastic block model with binary side information. IEEE Allerton Conference on Communication, Control, and Computing, 2017. [28] Narayana P Santhanam and Martin J Wainwright. Information-theoretic limits of selecting binary graphical models in high dimensions. IEEE Transactions on Information Theory, 58(7):4117–4134, 2012. [29] Purnamrita Sarkar and Andrew W Moore. Dynamic social network analysis using latent space models. In Advances in Neural Information Processing Systems, pages 1145–1152, 2006. [30] Minh Tang, Daniel L Sussman, Carey E Priebe, et al. Universally consistent vertex classification for latent positions graphs. The Annals of Statistics, 41(3):1406–1430, 2013. [31] Wei Wang, Martin J Wainwright, and Kannan Ramchandran. Information-theoretic bounds on model selection for gaussian markov random fields. In Information Theory Proceedings (ISIT), 2010 IEEE International Symposium on, pages 1373–1377. IEEE, 2010. 9 [32] Duncan J Watts and Steven H Strogatz. Collective dynamics of ‘small-world’networks. nature, 393(6684):440, 1998. [33] Rui Wu, Jiaming Xu, Rayadurgam Srikant, Laurent Massoulié, Marc Lelarge, and Bruce Hajek. Clustering and inference from pairwise comparisons. In ACM SIGMETRICS Performance Evaluation Review, volume 43, pages 449–450. ACM, 2015. [34] Jiaming Xu, Laurent Massoulié, and Marc Lelarge. Edge label inference in generalized stochastic block models: from spectral theory to impossibility results. In Conference on Learning Theory, pages 903–920, 2014. [35] Bin Yu. Assouad, Fano, and Le Cam. Festschrift for Lucien Le Cam, 423:435, 1997. [36] Se-Young Yun and Alexandre Proutiere. Optimal cluster recovery in the labeled stochastic block model. In Advances in Neural Information Processing Systems, pages 965–973, 2016. 10
2018
134
7,291
Dendritic cortical microcircuits approximate the backpropagation algorithm João Sacramento⇤ Department of Physiology University of Bern, Switzerland sacramento@pyl.unibe.ch Rui Ponte Costa† Department of Physiology University of Bern, Switzerland costa@pyl.unibe.ch Yoshua Bengio‡ Mila and Université de Montréal, Canada yoshua.bengio@mila.quebec Walter Senn Department of Physiology University of Bern, Switzerland senn@pyl.unibe.ch Abstract Deep learning has seen remarkable developments over the last years, many of them inspired by neuroscience. However, the main learning mechanism behind these advances – error backpropagation – appears to be at odds with neurobiology. Here, we introduce a multilayer neuronal network model with simplified dendritic compartments in which error-driven synaptic plasticity adapts the network towards a global desired output. In contrast to previous work our model does not require separate phases and synaptic learning is driven by local dendritic prediction errors continuously in time. Such errors originate at apical dendrites and occur due to a mismatch between predictive input from lateral interneurons and activity from actual top-down feedback. Through the use of simple dendritic compartments and different cell-types our model can represent both error and normal activity within a pyramidal neuron. We demonstrate the learning capabilities of the model in regression and classification tasks, and show analytically that it approximates the error backpropagation algorithm. Moreover, our framework is consistent with recent observations of learning between brain areas and the architecture of cortical microcircuits. Overall, we introduce a novel view of learning on dendritic cortical circuits and on how the brain may solve the long-standing synaptic credit assignment problem. 1 Introduction Machine learning is going through remarkable developments powered by deep neural networks (LeCun et al., 2015). Interestingly, the workhorse of deep learning is still the classical backpropagation of errors algorithm (backprop; Rumelhart et al., 1986), which has been long dismissed in neuroscience on the grounds of biologically implausibility (Grossberg, 1987; Crick, 1989). Irrespective of such concerns, growing evidence demonstrates that deep neural networks outperform alternative frameworks in accurately reproducing activity patterns observed in the cortex (Lillicrap and Scott, 2013; Yamins et al., 2014; Khaligh-Razavi and Kriegeskorte, 2014; Yamins and DiCarlo, 2016; Kell et al., 2018). Although recent developments have started to bridge the gap between neuroscience ⇤Present address: Institute of Neuroinformatics, University of Zürich and ETH Zürich, Zürich, Switzerland †Present address: Computational Neuroscience Unit, Department of Computer Science, SCEEM, Faculty of Engineering, University of Bristol, United Kingdom ‡CIFAR Senior Fellow 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. and artificial intelligence (Marblestone et al., 2016; Lillicrap et al., 2016; Scellier and Bengio, 2017; Costa et al., 2017; Guerguiev et al., 2017), how the brain could implement a backprop-like algorithm remains an open question. In neuroscience, understanding how the brain learns to associate different areas (e.g., visual and motor cortices) to successfully drive behaviour is of fundamental importance (Petreanu et al., 2012; Manita et al., 2015; Makino and Komiyama, 2015; Poort et al., 2015; Fu et al., 2015; Pakan et al., 2016; Zmarz and Keller, 2016; Attinger et al., 2017). However, how to correctly modify synapses to achieve this has puzzled neuroscientists for decades. This is often referred to as the synaptic credit assignment problem (Rumelhart et al., 1986; Sutton and Barto, 1998; Roelfsema and van Ooyen, 2005; Friedrich et al., 2011; Bengio, 2014; Lee et al., 2015; Roelfsema and Holtmaat, 2018), for which the backprop algorithm provides an elegant solution. Here we propose that the prediction errors that drive learning in backprop are encoded at distal dendrites of pyramidal neurons, which receive top-down input from downstream brain areas (we interpret a brain area as being equivalent to a layer in machine learning) (Petreanu et al., 2009; Larkum, 2013). In our model, these errors arise from the inability to exactly match via lateral input from local interneurons (e.g. somatostatin-expressing; SST) the top-down feedback from downstream cortical areas. Learning of bottom-up connections (i.e., feedforward weights) is driven by such error signals through local synaptic plasticity. Therefore, in contrast to previous approaches (Marblestone et al., 2016), in our framework a given neuron is used simultaneously for activity propagation (at the somatic level), error encoding (at distal dendrites) and error propagation to the soma without the need for separate phases. We first illustrate the different components of the model. Then, we show analytically that under certain conditions learning in our network approximates backpropagation. Finally, we empirically evaluate the performance of the model on nonlinear regression and recognition tasks. 2 Error-encoding dendritic cortical microcircuits 2.1 Neuron and network model Building upon previous work (Urbanczik and Senn, 2014), we adopt a simplified multicompartment neuron and describe pyramidal neurons as three-compartment units (schematically depicted in Fig. 1A). These compartments represent the somatic, basal and apical integration zones that characteristically define neocortical pyramidal cells (Spruston, 2008; Larkum, 2013). The dendritic structure of the model is exploited by having bottom-up and top-down synapses converging onto separate dendritic compartments (basal and distal dendrites, respectively), a first approximation in line with experimental observations (Spruston, 2008) and reflecting the preferred connectivity patterns of cortico-cortical projections (Larkum, 2013). Consistent with the connectivity of SST interneurons (Urban-Ciecko and Barth, 2016), we also introduce a second population of cells within each hidden layer with both lateral and cross-layer connectivity, whose role is to cancel the top-down input so as to leave only the backpropagated errors as apical dendrite activity. Modelled as two-compartment units (depicted in red, Fig. 1A), such interneurons are predominantly driven by pyramidal cells within the same layer through weights WIP k,k, and they project back to the apical dendrites of the same-layer pyramidal cells through weights WPI k,k (Fig. 1A). Additionally, cross-layer feedback onto SST cells originating at the next upper layer k+1 provide a weak nudging signal for these interneurons, modelled after Urbanczik and Senn (2014) as a conductance-based somatic input current. We modelled this weak top-down nudging on a one-to-one basis: each interneuron is nudged towards the potential of a corresponding upper-layer pyramidal cell. Although the one-to-one connectivity imposes a restriction in the model architecture, this is to a certain degree in accordance with recent monosynaptic input mapping experiments show that SST cells in fact receive top-down projections (Leinweber et al., 2017), that according to our proposal may encode the weak interneuron ‘teaching’ signals from higher to lower brain areas. The somatic membrane potentials of pyramidal neurons and interneurons evolve in time according to d dtuP k (t) = −glk uP k (t) + gB ! vP B,k(t) −uP k (t) " + gA ! vP A,k(t) −uP k (t) " + σ ⇠(t) (1) d dtuI k(t) = −glk uI k(t) + gD ! vI k(t) −uI k(t) " + iI k(t) + σ ⇠(t), (2) 2 with one such pair of dynamical equations for every hidden layer 0 < k < N; input layer neurons are indexed by k = 0, g’s are fixed conductances, σ controls the amount of injected noise. Basal and apical dendritic compartments of pyramidal cells are coupled to the soma with effective transfer conductances gB and gA, respectively. Subscript lk is for leak, A is for apical, B for basal, D for dendritic, superscript I for inhibitory and P for pyramidal neuron. Eqs. 1 and 2 describe standard conductance-based voltage integration dynamics, having set membrane capacitance to unity and resting potential to zero for clarity. Background activity is modelled as a Gaussian white noise input, ⇠in the equations above. To keep the exposition brief we use matrix notation, and denote by uP k and uI k the vectors of pyramidal and interneuron somatic voltages, respectively. Both matrices and vectors, assumed column vectors by default, are typed in boldface here and throughout. Dendritic compartmental potentials are denoted by v and are given in instantaneous form by vP B,k(t) = WPP k,k−1 φ(uP k−1(t)) (3) vP A,k(t) = WPP k,k+1 φ(uP k+1(t)) + WPI k,k φ(uI k(t)), (4) where φ(u) is the neuronal transfer function, which acts componentwise on u. A B C (i) layer 2 (output) layer 1 (hidden) sensory input layer 0 output (ii) u: somatic potential v: dendritic potential } B: basal A: apical P: pyramidal cell I: interneuron I 1 uI 1 uP 2 v layer 2 layer 1 P B,k v wPI 1,1 IP 1,1 w2,1 w PP target } error sensory input (layer 0) utrgt 2 PP 1,0 w PP 1,0 w + uP 1 P A,1 v 0 1500 0 1 0 1500 0 10 ||Apical pot.|| Time (ms) Time (ms) before learning after plasticity Apical potential Time (ms) 0 100 200 error 0 Sensory input target 0 100 200 Time (ms) (ii) (i) 1 Apical topdown Apical cancelation u trgt 2 Output uP 2 error rP 0 P A,1 V PP 1,0 w ||pyrk+1 - intk||2 target target Figure 1: Learning in error-encoding dendritic microcircuit network. (A) Schematic of network with pyramidal cells and lateral inhibitory interneurons. Starting from a self-predicting state – see main text and supplementary material (SM) – when a novel teaching (or associative) signal is presented at the output layer (utrgt 2 ), a prediction error in the apical compartments of pyramidal neurons in the upstream layer (layer 1, ‘error’) is generated. This error appears as an apical voltage deflection that propagates down to the soma (purple arrow) where it modulates the somatic firing rate, which in turn leads to plasticity at bottom-up synapses (bottom, green). (B) Activity traces in the microcircuit before and after a new teaching signal is learned. (i) Before learning: a new teaching signal is presented (utrgt 2 ), which triggers a mismatch between the top-down feedback (grey blue) and the cancellation given by the lateral interneurons (red). (ii) After learning (with plasticity at the bottom-up synapses (WPP 1,0)), the network successfully predicts the new teaching signal, reflected on no distal ’error’ (top-down and lateral interneuron input cancel each other). (C) Interneurons learn to predict the backpropagated activity (i), while simultaneously silencing the apical compartment (ii), even though the pyramidal neurons remain active (not shown). For simplicity, we reduce pyramidal output neurons to two-compartment cells: the apical compartment is absent (gA = 0 in Eq. 1) and basal voltages are as defined in Eq. 3. Although the design can be extended to more complex morphologies, in the framework of dendritic predictive plasticity two compartments suffice to compare desired target with actual prediction. Synapses proximal to the soma of output neurons provide direct external teaching input, incorporated as an additional source of current iP N. In practice, one can simply set iP N = gsom(utrgt N −uP N), with some fixed somatic nudging conductance gsom. This can be modelled closer to biology by explicitly setting the somatic excitatory and inhibitory conductance-based inputs (Urbanczik and Senn, 2014). For a given output neuron, iP N(t) = gP exc,N(t) ! Eexc −uP N(t) " +gP inh,N(t) ! Einh −uP N(t) " , where Eexc and Einh are excitatory and inhibitory synaptic reversal potentials, respectively, where the inputs are balanced according to 3 gP exc,N = gsom utrgt N −Einh Eexc−Einh , gP inh,N = −gsom utrgt N −Eexc Eexc−Einh . The point at which no current flows, iP N = 0, defines the target teaching voltage utrgt N towards which the neuron is nudged4. Interneurons are similarly modelled as two-compartment cells, cf. Eq. 2. Lateral dendritic projections from neighboring pyramidal neurons provide the main source of input as vI k(t) = WIP k,k φ(uP k (t)), (5) whereas cross-layer, top-down synapses define the teaching current iI k. This means that an interneuron at layer k permanently (i.e., when learning or performing a task) receives balanced somatic teaching excitatory and inhibitory input from a pyramidal neuron at layer k+1 on a one-to-one basis (as above, but with uP k+1 as target). With this setting, the interneuron is nudged to follow the corresponding next layer pyramidal neuron. See SM for detailed parameters. 2.2 Synaptic learning rules The synaptic learning rules we use belong to the class of dendritic predictive plasticity rules (Urbanczik and Senn, 2014; Spicher et al., 2018) that can be expressed in its general form as d dtw = ⌘(φ(u) −φ(v)) r, (6) where w is an individual synaptic weight, ⌘is a learning rate, u and v denote distinct compartmental potentials, φ is a rate function, and r is the presynaptic input. Eq. 6 was originally derived in the light of reducing the prediction error of somatic spiking, when u represents the somatic potential and v is a function of the postsynaptic dendritic potential. In our model the plasticity rules for the various connection types are: d dtWPP k,k−1 = ⌘PP k,k−1 ! φ(uP k ) −φ(ˆvP B,k) " ! rP k−1 "T , (7) d dtWIP k,k = ⌘IP k,k ! φ(uI k) −φ(ˆvI k) " ! rP k "T , (8) d dtWPI k,k = ⌘PI k,k ! vrest −vP A,k " ! rI k "T , (9) where (·)T denotes vector transpose and rk ⌘φ(uk) the layer k firing rates. The synaptic weights evolve according to the product of dendritic prediction error and presynaptic rate, and can undergo both potentiation or depression depending on the sign of the first factor (i.e., the prediction error). For basal synapses, such prediction error factor amounts to a difference between postsynaptic rate and a local dendritic estimate which depends on the branch potential. In Eqs. 7 and 8, ˆvP B,k = gB glk+gB+gA vP B,k and ˆvI k = gD glk+gD vI k take into account dendritic attenuation factors of the different compartments. On the other hand, the plasticity rule (9) of lateral interneuron-to-pyramidal synapses aims to silence (i.e., set to resting potential vrest = 0, here and throughout zero for simplicity) the apical compartment; this introduces an attractive state for learning where the contribution from interneurons balances (or cancels out) top-down dendritic input. This learning rule of apical-targeting interneuron synapses can be thought of as a dendritic variant of the homeostatic inhibitory plasticity proposed by Vogels et al. (2011); Luz and Shamir (2012). In experiments where the top-down connections are plastic, the weights evolve according to d dtWPP k,k+1 = ⌘PP k,k+1 ! φ(uP k ) −φ(ˆvP TD,k) " ! rP k+1 "T , (10) with ˆvP TD,k = Wk,k+1 rP k+1. An implementation of this rule requires a subdivision of the apical compartment into a distal part receiving the top-down input (with voltage ˆvP TD,k) and another distal compartment receiving the lateral input from the interneurons (with voltage vP A,k). 4Note that in biology a target may be represented by an associative signal from the motor cortex to a sensory cortex (Attinger et al., 2017). 4 2.3 Comparison to previous work It has been suggested that error backpropagation could be approximated by an algorithm that requires alternating between two learning phases, known as contrastive Hebbian learning (Ackley et al., 1985). This link between the two algorithms was first established for an unsupervised learning task (Hinton and McClelland, 1988) and later analyzed (Xie and Seung, 2003) and generalized to broader classes of models (O’Reilly, 1996; Scellier and Bengio, 2017). The concept of apical dendrites as distinct integration zones, and the suggestion that this could simplify the implementation of backprop has been previously made (Körding and König, 2000, 2001). Our microcircuit design builds upon this view, offering a concrete mechanism that enables apical error encoding. In a similar spirit, two-phase learning recently reappeared in a study that exploits dendrites for deep learning with biological neurons (Guerguiev et al., 2017). In this more recent work, the temporal difference between the activity of the apical dendrite in the presence and in the absence of the teaching input represents the error that induces plasticity at the forward synapses. This difference is used directly for learning the bottom-up synapses without influencing the somatic activity of the pyramidal cell. In contrast, we postulate that the apical dendrite has an explicit error representation by simultaneously integrating top-down excitation and lateral inhibition. As a consequence, we do not need to postulate separate temporal phases, and our network operates continuously while plasticity at all synapses is always turned on. Error minimization is an integral part of brain function according to predictive coding theories (Rao and Ballard, 1999; Friston, 2005). Interestingly, recent work has shown that backprop can be mapped onto a predictive coding network architecture (Whittington and Bogacz, 2017), related to the general framework introduced by LeCun (1988). A possible network implementation is suggested by Whittington and Bogacz (2017) that requires intricate circuitry with appropriately tuned error-representing neurons. According to this work, the only plastic synapses are those that connect prediction and error neurons. By contrast, in our model, lateral, bottom-up and top-down connections are all plastic, and errors are directly encoded in dendritic compartments. 3 Results 3.1 Learning in dendritic error networks approximates backprop In our model, neurons implicitly carry and transmit errors across the network. In the supplementary material, we formally show such propagation of errors for networks in a particular regime, which we term self-predicting. Self-predicting nets are such that when no external target is provided to output layer neurons, the lateral input from interneurons cancels the internally generated top-down feedback and renders apical dendrites silent. In this case, the output becomes a feedforward function of the input, which can in theory be optimized by conventional backprop. We demonstrate that synaptic plasticity in self-predicting nets approximates the weight changes prescribed by backprop. We summarize below the main points of the full analysis (see SM). First, we show that somatic membrane potentials at hidden layer k integrate feedforward predictions (encoded in basal dendritic potentials) with backpropagated errors (encoded in apical dendritic potentials): uP k = u− k + λN−k+1 WPP k,k+1 N−1 Y l=k+1 D− l WPP l,l+1 ! D− N ! utrgt N −u− N " + O(λN−k+2). Parameter λ ⌧1 sets the strength of feedback and teaching versus bottom-up inputs and is assumed to be small to simplify the analysis. The first term is the basal contribution and corresponds to u− k , the activation computed by a purely feedforward network that is obtained by removing lateral and top-down weights from the model (here and below, we use superscript ‘-’ to refer to the feedforward model). The second term (of order λN−k+1) is an error that is backpropagated from the output layer down to k-th layer hidden neurons; matrix Dk is a diagonal matrix with i-th entry containing the derivative of the neuronal transfer function evaluated at u− k,i. Second, we compare model synaptic weight updates for the bottom-up connections to those prescribed by backprop. Output layer updates are exactly equal by construction. For hidden neuron synapses, 5 we obtain ∆WPP k,k−1 = ⌘PP k,k−1λN−k+1 N−1 Y l=k D− l WPP l,l+1 ! D− N ! utrgt N −u− N " ! r− k−1 "T + O(λN−k+2). Up to a factor which can be absorbed in the learning rate, this plasticity rule becomes equal to the backprop weight change in the weak feedback limit λ ! 0, provided that the top-down weights are set to the transpose of the corresponding feedforward weights. In our simulations, top-down weights are either set at random and kept fixed, in which case the equation above shows that the plasticity model optimizes the predictions according to an approximation of backprop known as feedback alignment (Lillicrap et al., 2016); or learned so as to minimize an inverse reconstruction loss, in which case the network implements a form of target propagation (Bengio, 2014; Lee et al., 2015). 3.2 Deviations from self-predictions encode backpropagated errors To illustrate learning in the model and to confirm our analytical insights we first study a very simple task: memorizing a single input-output pattern association with only one hidden layer; the task naturally generalizes to multiple memories. Given a self-predicting network (established by microcircuit plasticity, Fig. S1, see SM for more details), we focus on how prediction errors get propagated backwards when a novel teaching signal is provided to the output layer, modeled via the activation of additional somatic conductances in output pyramidal neurons. Here we consider a network model with an input, a hidden and an output layer (layers 0, 1 and 2, respectively; Fig. 1A). When the pyramidal cell activity in the output layer is nudged towards some desired target (Fig. 1B (i)), the bottom-up synapses WPP 2,1 from the lower layer neurons to the basal dendrites are adapted, again according to the plasticity rule that implements the dendritic prediction of somatic spiking (see Eq. 7). What these synapses cannot explain away encodes a dendritic error in the pyramidal neurons of the lower layer 1. In fact, the self-predicting microcircuit can only cancel the feedback that is produced by the lower layer activity. The somatic integration of apical activity induces plasticity at the bottom-up synapses WPP 1,0 (Eq. 7). As the apical error changes the somatic activity, plasticity of the WPP 1,0 weights tries to further reduce the error in the output layer. Importantly, the plasticity rule depends only on local information available at the synaptic level: postsynaptic firing and dendritic branch voltage, as well as the presynaptic activity, in par with phenomenological models of synaptic plasticity (Sjöström et al., 2001; Clopath et al., 2010; Bono and Clopath, 2017). This learning occur concurrently with modifications of lateral interneuron weights which track changes in the output layer. Through the course of learning the network comes to a point where the novel top-down input is successfully predicted (Fig. 1B,C). 3.3 Network learns to solve a nonlinear regression task We now test the learning capabilities of the model on a nonlinear regression task, where the goal is to associate sensory input with the output of a separate multilayer network that transforms the same sensory input (Fig. 2A). More precisely, a pyramidal neuron network of dimensions 30-50-10 (and 10 hidden layer interneurons) learns to approximate a random nonlinear function implemented by a heldaside feedforward network of dimensions 30-20-10. One teaching example consists of a randomly drawn input pattern rP 0 assigned to corresponding target rtrgt 2 = φ(k2,1Wtrgt 2,1 φ(k1,0 Wtrgt 1,0 rP 0 )), with scale factors k2,1 = 10 and k1,0 = 2. Teacher network weights and input pattern entries are sampled from a uniform distribution U(−1, 1). We used a soft rectifying nonlinearity as the neuronal transfer function, φ(u) = γ log(1 + exp(β(u −✓)), with γ = 0.1, β = 1 and ✓= 3. This parameter setting led to neuronal activity in the nonlinear, sparse firing regime. The network is initialized to a random initial synaptic weight configuration, with both pyramidalpyramidal WPP 1,0, WPP 2,1, WPP 1,2 and pyramidal-interneuron weights WIP 1,1, WPI 1,1 independently drawn from a uniform distribution. Top-down weight matrix WPP 1,2 is kept fixed throughout, in the spirit of feedback alignment (Lillicrap et al., 2016). Output layer teaching currents iP 2 are set so as to nudge uP 2 towards the teacher-generated utrgt 2 . Learning rates were manually chosen to yield best 6 A WPP 2,1 WPP 1,0 WPP 1,2 WIP 1,1 WPI 1,1 P A,1 r P 2 shallow learning pyramidal neuron learning Squared error Training trial (x107) 0 0.5 1 0 0.1 C 0 100 200 r P 0 0 100 200 P A,1 Time [ms] Time [ms] (ii) (i) before after B learning r2 trgt 25 0 r P 2 0 v 0 separate network teaching/associative input v r2 trgt layer 2 (output) layer 1 (hidden) sensory input layer 0 Apical potential Sensory input Output (Hz) 0 0.5 0 3 ||Apical pot. ||2 0 0.5 0 3 || pyrk+1 - intk||2 Trial (x107) (i) (ii) Figure 2: Dendritic error microcircuit learns to solve a nonlinear regression task online and without phases. (A-C) Starting from a random initial weight configuration, a 30-50-10 fullyconnected network learns to approximate a nonlinear function (‘separate network’) from input-output pattern pairs. (B) Example firing rates for a randomly chosen output neuron (rP 2 , blue noisy trace) and its desired target imposed by the associative input (rtrgt 2 , blue dashed line), together with the voltage in the apical compartment of a hidden neuron (vP A,1, grey noisy trace) and the input rate from the sensory neuron (rP 0 , green). Traces are shown before (i) and after learning (ii). (C) Error curves for the full model and a shallow model for comparison. performance. Some learning rate tuning was required to ensure the microcircuit could track the changes in the bottom-up pyramidal-pyramidal weights, but we did not observe high sensitivity once the correct parameter regime was identified. Error curves are exponential moving averages of the sum of squared errors loss krP 2 −rtrgt 2 k2 computed after every example on unseen input patterns. Test error performance is measured in a noise-free setting (σ = 0). Plasticity induction terms given by Eqs. 7-9 are low-pass filtered with time constant ⌧w before being definitely consolidated, to dampen fluctuations; synaptic plasticity is kept on throughout. Plasticity and neuron model parameters are as defined above. We let learning occur in continuous time without pauses or alternations in plasticity as input patterns are sequentially presented. This is in contrast to previous learning models that rely on computing activity differences over distinct phases, requiring temporally nonlocal computation, or globally coordinated plasticity rule switches (Hinton and McClelland, 1988; O’Reilly, 1996; Xie and Seung, 2003; Scellier and Bengio, 2017; Guerguiev et al., 2017). Furthermore, we relaxed the bottom-up vs. top-down weight symmetry imposed by backprop and kept the top-down weights WPP 1,2 fixed. Forward WPP 1,2 weights quickly aligned to ⇠45o of the feedback weights ! WPP 2,1 "T (see Fig. S1), in line with the recently discovered feedback alignment phenomenon (Lillicrap et al., 2016). This simplifies the architecture, because top-down and interneuron-to-pyramidal synapses need not be changed. We set the scale of the top-down weights, apical and somatic conductances such that feedback and teaching inputs were strong, to test the model outside the weak feedback regime (λ ! 0) for which our SM theory was developed. Finally, to test robustness, we injected a weak noise current to every neuron. Our network was able to learn this harder task (Fig. 2B), performing considerably better than a shallow learner where only hidden-to-output weights were adjusted (Fig. 2C). Useful changes were thus made to hidden layer bottom-up weights. The self-predicting network state emerged throughout learning from a random initial configuration (see SM; Fig. S1). 3.4 Microcircuit network learns to classify handwritten digits Next, we turn to the problem of classifying MNIST handwritten digits. We wondered how our model would fare in this benchmark, in particular whether the prediction errors computed by the interneuron microcircuit would allow learning the weights of a hierarchical nonlinear network with multiple hidden layers. To that end, we trained a deeper, larger 4-layer network (with 784-500-500-10 pyramidal neurons, Fig. 3A) by pairing digit images with teaching inputs that nudged the 10 output neurons towards the correct class pattern. We initialized the network to a random but self-predicting 7 B MNIST handwritten digit images 500 28x28 10 500 input hidden 1 hidden 2 output 8 9 A 1.96% 1.53% 8.4% 0 200 0 5 10 Trials Test error (%) single-layer dendritic microcircuit backprop Figure 3: Dendritic error networks learn to classify handwritten digits. (A) A network with two hidden layers learns to classify handwritten digits from the MNIST data set. (B) Classification error achieved on the MNIST testing set (blue; cf. shallow learner (black) and standard backprop6(red)). configuration where interneurons cancelled top-down inputs, rendering the apical compartments silent before training started. Top-down and interneuron-to-pyramidal weights were kept fixed. Here for computational efficiency we used a simplified network dynamics where the compartmental potentials are updated only in two steps before applying synaptic changes. In particular, for each presented MNIST image, both pyramidal and interneurons are first initialized to their bottomup prediction state (3), uk = vB,k, starting from layer 1 up to the top layer N. Output layer neurons are then nudged towards their desired target utrgt N , yielding updated somatic potentials uP N = (1 −λN) vB,N + λN utrgt N . To obtain the remaining final compartmental potentials, the network is visited in reverse order, proceeding from layer k = N −1 down to k = 1. For each k, interneurons are first updated to include top-down teaching signals, uI k = (1−λI) vI k +λI uP k+1; this yields apical compartment potentials according to (4), after which we update hidden layer somatic potentials as a convex combination with mixing factor λk. The convex combination factors introduced above are directly related to neuron model parameters as conductance ratios. Synaptic weights are then updated according to Eqs. 7-10. Such simplified dynamics approximates the full recurrent network relaxation in the deterministic setting σ ! 0, with the approximation improving as the top-down dendritic coupling is decreased, gA ! 0. We train the models on the standard MNIST handwritten image database, further splitting the training set into 55000 training and 5000 validation examples. The reported test error curves are computed on the 10000 held-aside test images. The four-layer network shown in Fig. 3 is initialized in a self-predicting state with appropriately scaled initial weight matrices. For our MNIST networks, we used relatively weak feedback weights, apical and somatic conductances (see SM) to justify our simplified approximate dynamics described above, although we found that performance did not appreciably degrade with larger values. To speed-up training we use a mini-batch strategy on every learning rule, whereby weight changes are averaged across 10 images before being applied. We take the neuronal transfer function φ to be a logistic function, φ(u) = 1/(1 + exp(−u)) and include a learnable threshold on each neuron, modelled as an additional input fixed at unity with a plastic weight. Desired target class vectors are 1-hot coded, with rtrgt N 2 {0.1, 0.8}. During testing, the output is determined by picking the class label corresponding to the neuron with highest firing rate. We found the model to be relatively robust to learning rate tuning on the MNIST task, except for the rescaling by the inverse mixing factor to compensate for teaching signal dilution (see SM for the exact parameters). The network was able to achieve a test error of 1.96%, Fig. 3B, a figure not overly far from the reference mark of non-convolutional artificial neural networks optimized with backprop (1.53%) and comparable to recently published results that lie within the range 1.6-2.4% (Lee et al., 2015; Lillicrap et al., 2016; Nøkland, 2016). The performance of our model also compares favorably to the 3.2% test error reported by Guerguiev et al. (2017) for a two-hidden-layer network. This was possible despite the asymmetry of forward and top-down weights and at odds with exact backprop, thanks to a feedback alignment dynamics. Apical compartment voltages remained approximately silent when output nudging was turned off (data not shown), reflecting the maintenance of a self-predicting state throughout learning, which enabled the propagation of errors through the network. To further demonstrate that the microcircuit was able to propagate errors to deeper hidden layers, and that the task was not being solved by making useful changes only to the weights onto the topmost hidden layer, we re-ran the experiment while keeping fixed the pyramidal-pyramidal weights connecting the two hidden layers. The network still learned the dataset and achieved a test error of 2.11%. 8 As top-down weights are likely plastic in cortex, we also trained a one-hidden-layer (784-1000-10) network where top-down weights were learned on a slow time-scale according to learning rule (10). This inverse learning scheme is closely related to target propagation (Bengio, 2014; Lee et al., 2015). Such learning could play a role in perceptual denoising, pattern completion and disambiguation, and boost alignment beyond that achieved by pure feedback alignment (Bengio, 2014). Starting from random initial conditions and keeping all weights plastic (bottom-up, lateral and top-down) throughout, our network achieved a test classification performance of 2.48% on MNIST. Once more, useful changes were made to hidden synapses, even though the microcircuit had to track changes in both the bottom-up and the top-down pathways. 4 Conclusions Our work makes several predictions across different levels of investigation. Here we briefly highlight some of these predictions and related experimental observations. The most fundamental feature of the model is that distal dendrites encode error signals that instruct learning of lateral and bottomup connections. While monitoring such dendritic signals during learning is challenging, recent experimental evidence suggests that prediction errors in mouse visual cortex arise from a failure to locally inhibit motor feedback (Zmarz and Keller, 2016; Attinger et al., 2017), consistent with our model. Interestingly, the plasticity rule for apical dendritic inhibition, which is central to error encoding in the model, received support from another recent experimental study (Chiu et al., 2018). A further implication of our model is that prediction errors occurring at a higher-order cortical area would imply also prediction errors co-occurring at earlier areas. Recent experimental observations in the macaque face-processing hierarchy support this (Schwiedrzik and Freiwald, 2017). Here we have focused on the role of a specific interneuron type (SST) as a feedback-specific interneuron. There are many more interneuron types that we do not consider in our framework. One such type are the PV (parvalbumin-positive) cells, which have been postulated to mediate a somatic excitation-inhibition balance (Vogels et al., 2011; Froemke, 2015) and competition (Masquelier and Thorpe, 2007; Nessler et al., 2013). These functions could in principle be combined with our framework in that PV interneurons may be involved in representing another type of prediction error (e.g., generative errors). Humans have the ability to perform fast (e.g., one-shot) learning, whereas neural networks trained by backpropagation of error (or approximations thereof, like ours) require iterating over many training examples to learn. This is an important open problem that stands in the way of understanding the neuronal basis of intelligence. One possibility where our model naturally fits is to consider multiple subsystems (for example, the neocortex and the hippocampus) that transfer knowledge to each other and learn at different rates (McClelland et al., 1995; Kumaran et al., 2016). Overall, our work provides a new view on how the brain may solve the credit assignment problem for time-continuous input streams by approximating the backpropagation algorithm, and bringing together many puzzling features of cortical microcircuits. Acknowledgements The authors would like to thank Timothy P. Lillicrap, Blake Richards, Benjamin Scellier and Mihai A. Petrovici for helpful discussions. WS thanks Matthew Larkum for many inspiring discussions on dendritic processing. JS thanks Elena Kreutzer, Pascal Leimer and Martin T. Wiechert for valuable feedback and critical reading of the manuscript. This work has been supported by the Swiss National Science Foundation (grant 310030L-156863 of WS), the European Union’s Horizon 2020 Framework Programme for Research and Innovation under the Specific Grant Agreement No. 785907 (Human Brain Project), NSERC, CIFAR, and Canada Research Chairs. 9 References Ackley, D. H., Hinton, G. E., and Sejnowski, T. J. (1985). A learning algorithm for Boltzmann machines. Cognitive Science, 9(1):147–169. Attinger, A., Wang, B., and Keller, G. B. (2017). Visuomotor coupling shapes the functional development of mouse visual cortex. Cell, 169(7):1291–1302.e14. Bengio, Y. (2014). How auto-encoders could provide credit assignment in deep networks via target propagation. arXiv:1407.7906 Bono, J. and Clopath, C. (2017). Modeling somatic and dendritic spike mediated plasticity at the single neuron and network level. Nature Communications, 8(1):706. Bottou, L. (1998). Online algorithms and stochastic approximations. In Saad, D., editor, Online Learning and Neural Networks. Cambridge University Press, Cambridge, UK. Chiu, C. Q., Martenson, J. S., Yamazaki, M., Natsume, R., Sakimura, K., Tomita, S., Tavalin, S. J., and Higley, M. J. (2018). Input-specific nmdar-dependent potentiation of dendritic gabaergic inhibition. Neuron, 97(2):368–377. Clopath, C., Büsing, L., Vasilaki, E., and Gerstner, W. (2010). Connectivity reflects coding: a model of voltage-based stdp with homeostasis. Nature Neuroscience, 13(3):344–352. Costa, R. P., Assael, Y. M., Shillingford, B., de Freitas, N., and Vogels, T. P. (2017). Cortical microcircuits as gated-recurrent neural networks. In Advances in Neural Information Processing Systems, pages 271–282. Crick, F. (1989). The recent excitement about neural networks. Nature, 337:129–132. Dorrn, A. L., Yuan, K., Barker, A. J., Schreiner, C. E., and Froemke, R. C. (2010). Developmental sensory experience balances cortical excitation and inhibition. Nature, 465(7300):932–936. Friedrich, J., Urbanczik, R., and Senn, W. (2011). Spatio-temporal credit assignment in neuronal population learning. PLOS Computational Biology, 7(6):e1002092. Friston, K. (2005). A theory of cortical responses. Philosophical Transactions of the Royal Society of London B: Biological Sciences, 360(1456):815–836. Froemke, R. C. (2015). Plasticity of cortical excitatory-inhibitory balance. Annual Review of Neuroscience, 38(1):195–219. Fu, Y., Kaneko, M., Tang, Y., Alvarez-Buylla, A., and Stryker, M. P. (2015). A cortical disinhibitory circuit for enhancing adult plasticity. eLife, 4:e05558. Grossberg, S. (1987). Competitive learning: From interactive activation to adaptive resonance. Cognitive Science, 11(1):23–63. Guerguiev, J., Lillicrap, T. P., and Richards, B. A. (2017). Towards deep learning with segregated dendrites. eLife, 6:e22901. Hinton, G. E. and McClelland, J. L. (1988). Learning representations by recirculation. In Anderson, D. Z., editor, Neural Information Processing Systems, pages 358–366. American Institute of Physics. Kell, A. J., Yamins, D. L., Shook, E. N., Norman-Haignere, S. V., and McDermott, J. H. (2018). A task-optimized neural network replicates human auditory behavior, predicts brain responses, and reveals a cortical processing hierarchy. Neuron. Khaligh-Razavi, S.-M. and Kriegeskorte, N. (2014). Deep supervised, but not unsupervised, models may explain it cortical representation. PLOS Computational Biology, 10(11):1–29. Körding, K. P. and König, P. (2000). Learning with two sites of synaptic integration. Network: Comput. Neural Syst., 11:1–15. Körding, K. P. and König, P. (2001). Supervised and unsupervised learning with two sites of synaptic integration. Journal of Computational Neuroscience, 11:207–215. Kumaran, D., Hassabis, D., and McClelland, J. L. (2016). What learning systems do intelligent agents need? complementary learning systems theory updated. Trends in Cognitive Sciences, 20(7):512 – 534. 10 Larkum, M. (2013). A cellular mechanism for cortical associations: an organizing principle for the cerebral cortex. Trends in Neurosciences, 36(3):141–151. LeCun, Y. (1988). A theoretical framework for back-propagation. In Touretzky, D., Hinton, G., and Sejnowski, T., editors, Proceedings of the 1988 Connectionist Models Summer School, pages 21–28. Morgan Kaufmann, Pittsburg, PA. LeCun, Y., Bengio, Y., and Hinton, G. (2015). Deep learning. Nature, 521(7553):436–444. Lee, D.-H., Zhang, S., Fischer, A., and Bengio, Y. (2015). Difference target propagation. In Machine Learning and Knowledge Discovery in Databases, pages 498–515. Springer. Leinweber, M., Ward, D. R., Sobczak, J. M., Attinger, A., and Keller, G. B. (2017). A Sensorimotor Circuit in Mouse Cortex for Visual Flow Predictions. Neuron, 95(6):1420–1432.e5. Lillicrap, T. P., Cownden, D., Tweed, D. B., and Akerman, C. J. (2016). Random synaptic feedback weights support error backpropagation for deep learning. Nature Communications, 7:13276. Lillicrap, T. P. and Scott, S. H. (2013). Preference distributions of primary motor cortex neurons reflect control solutions optimized for limb biomechanics. Neuron, 77(1):168–179. Luz, Y. and Shamir, M. (2012). Balancing feed-forward excitation and inhibition via Hebbian inhibitory synaptic plasticity. PLOS Computational Biology, 8(1):e1002334. Makino, H. and Komiyama, T. (2015). Learning enhances the relative impact of top-down processing in the visual cortex. Nature Neuroscience, 18(8):1116–1122. Manita, S., Suzuki, T., Homma, C., Matsumoto, T., Odagawa, M., Yamada, K., Ota, K., Matsubara, C., Inutsuka, A., Sato, M., et al. (2015). A top-down cortical circuit for accurate sensory perception. Neuron, 86(5):1304–1316. Marblestone, A. H., Wayne, G., and Kording, K. P. (2016). Toward an integration of deep learning and neuroscience. Frontiers in Computational Neuroscience, 10:94. Masquelier, T. and Thorpe, S. (2007). Unsupervised learning of visual features through spike timing dependent plasticity. PLOS Computational Biology, 3. McClelland, J. L., McNaughton, B. L., and O’reilly, R. C. (1995). 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, 102(3):419. Nessler, B., Pfeiffer, M., Buesing, L., and Maass, W. (2013). Bayesian computation emerges in generic cortical microcircuits through spike-timing-dependent plasticity. PLOS Computational Biology, 9(4):e1003037. Nøkland, A. (2016). Direct feedback alignment provides learning in deep neural networks. In Advances in Neural Information Processing Systems, pages 1037–1045. O’Reilly, R. C. (1996). Biologically plausible error-driven learning using local activation differences: The generalized recirculation algorithm. Neural Computation, 8(5):895–938. Pakan, J. M., Lowe, S. C., Dylda, E., Keemink, S. W., Currie, S. P., Coutts, C. A., Rochefort, N. L., and Mrsic-Flogel, T. D. (2016). Behavioral-state modulation of inhibition is context-dependent and cell type specific in mouse visual cortex. eLife, 5:e14985. Petreanu, L., Gutnisky, D. A., Huber, D., Xu, N.-l., O’Connor, D. H., Tian, L., Looger, L., and Svoboda, K. (2012). Activity in motor-sensory projections reveals distributed coding in somatosensation. Nature, 489(7415):299–303. Petreanu, L., Mao, T., Sternson, S. M., and Svoboda, K. (2009). The subcellular organization of neocortical excitatory connections. Nature, 457(7233):1142–1145. Poort, J., Khan, A. G., Pachitariu, M., Nemri, A., Orsolic, I., Krupic, J., Bauza, M., Sahani, M., Keller, G. B., Mrsic-Flogel, T. D., and Hofer, S. B. (2015). Learning enhances sensory and multiple non-sensory representations in primary visual cortex. Neuron, 86(6):1478–1490. Rao, R. P. and Ballard, D. H. (1999). Predictive coding in the visual cortex: a functional interpretation of some extra-classical receptive-field effects. Nature Neuroscience, 2(1):79–87. Roelfsema, P. R. and Holtmaat, A. (2018). Control of synaptic plasticity in deep cortical networks. Nature Reviews Neuroscience, 19(3):166. 11 Roelfsema, P. R. and van Ooyen, A. (2005). Attention-gated reinforcement learning of internal representations for classification. Neural Computation, 17(10):2176–2214. Rumelhart, D. E., Hinton, G. E., and Williams, R. J. (1986). Learning representations by back-propagating errors. Nature, 323:533–536. Scellier, B. and Bengio, Y. (2017). Equilibrium propagation: Bridging the gap between energy-based models and backpropagation. Frontiers in Computational Neuroscience, 11:24. Schwiedrzik, C. M. and Freiwald, W. A. (2017). High-level prediction signals in a low-level area of the macaque face-processing hierarchy. Neuron, 96(1):89–97.e4. Sjöström, P. J., Turrigiano, G. G., and Nelson, S. B. (2001). Rate, Timing, and Cooperativity Jointly Determine Cortical Synaptic Plasticity. Neuron, 32(6):1149–1164. Spicher, D., Clopath, C., and Senn, W. (2018). Predictive plasticity in dendrites: from a computational principle to experimental data (in preparation). Spruston, N. (2008). Pyramidal neurons: dendritic structure and synaptic integration. Nature Reviews Neuroscience, 9(3):206–221. Sutton, R. S. and Barto, A. G. (1998). Reinforcement learning: An introduction, volume 1. MIT Press, Cambridge, Mass. Urban-Ciecko, J. and Barth, A. L. (2016). Somatostatin-expressing neurons in cortical networks. Nature Reviews Neuroscience, 17(7):401–409. Urbanczik, R. and Senn, W. (2014). Learning by the dendritic prediction of somatic spiking. Neuron, 81(3):521– 528. Vogels, T. P., Sprekeler, H., Zenke, F., Clopath, C., and Gerstner, W. (2011). Inhibitory plasticity balances excitation and inhibition in sensory pathways and memory networks. Science, 334(6062):1569–1573. Whittington, J. C. R. and Bogacz, R. (2017). An approximation of the error backpropagation algorithm in a predictive coding network with local Hebbian synaptic plasticity. Neural Computation, 29(5):1229–1262. Xie, X. and Seung, H. S. (2003). Equivalence of backpropagation and contrastive Hebbian learning in a layered network. Neural Computation, 15(2):441–454. Yamins, D. L. and DiCarlo, J. J. (2016). Using goal-driven deep learning models to understand sensory cortex. Nature Neuroscience, 19(3):356–365. Yamins, D. L., Hong, H., Cadieu, C. F., Solomon, E. A., Seibert, D., and DiCarlo, J. J. (2014). Performanceoptimized hierarchical models predict neural responses in higher visual cortex. Proceedings of the National Academy of Sciences, 111(23):8619–8624. Zmarz, P. and Keller, G. B. (2016). Mismatch receptive fields in mouse visual cortex. Neuron, 92(4):766–772. 12
2018
135
7,292
Structured Local Minima in Sparse Blind Deconvolution Yuqian Zhang, Han-Wen Kuo, John Wright Department of Electrical Engineer and Data Science Institute Columbia University, New York, NY 10027 {yz2409, hk2673, jw2966}@columbia.edu Abstract Blind deconvolution is a ubiquitous problem of recovering two unknown signals from their convolution. Unfortunately, this is an ill-posed problem in general. This paper focuses on the short and sparse blind deconvolution problem, where the one unknown signal is short and the other one is sparsely and randomly supported. This variant captures the structure of the unknown signals in several important applications. We assume the short signal to have unit ℓ2 norm and cast the blind deconvolution problem as a nonconvex optimization problem over the sphere. We demonstrate that (i) in a certain region of the sphere, every local optimum is close to some shift truncation of the ground truth, and (ii) for a generic short signal of length k, when the sparsity of activation signal θ ≲k−2/3 and number of measurements m ≳poly (k), a simple initialization method together with a descent algorithm which escapes strict saddle points recovers a near shift truncation of the ground truth kernel. 1 Introduction Blind deconvolution is the problem of recovering two unknown signals a0 and x0 from their convolution y = a0 ∗x0. This fundamental problem recurs across several fields, including astronomy, microscopy data processing [1], neural spike sorting [2], computer vision [3], etc. However, this problem is ill-posed without further priors on the unknown signals, as there are infinitely many pairs of signals (a, x) whose convolution equals a given observation y. Fortunately, in practice, the target signals (a, x) are often structured. In particular, a number of practical applications exhibit a common short-and-sparse structure: In Neural spike sorting: Neurons in the brain fire brief voltage spikes when stimulated. The signatures of the spikes encode critical features of the neuron and the occurrence of such spikes are usually sparse and random in time [2, 4]. In Microscopy data analysis: Some nanoscale materials are contaminated by randomly and sparsely distributed “defects”, which change the electronic structure of the material [1]. In Image deblurring: Blurred images due to camera shake can be modeled as a convolution of the latent sharp image and a kernel capturing the motion of the camera. Although natural images are not sparse, they typically have (approximately) sparse gradients [5, 6]. In the above applications, the observation signal y ∈Rm is generated via the convolution of a short kernel a0 ∈Rk(k ≪m) and a sparse activation coefficient x0 ∈Rm (∥x0∥0 ≪m). Without loss of generality, we let y denote the circular convolution of a0 and x0 y = a0 ⊛x0 = f a0 ⊛x0, (1) 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. Convolution Y Kernel A Activation X 0 0.5 1 1.5 2 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 Figure 1: Local Minimum. Top: observation y = a0 ⊛x0, and ground truth a0, and x0; Bottom: recovered a ⊛x, a, and x at one local minimum of a natural formulation in [16]. with f a0 ∈Rm denoting the zero padded m-length version of a0, which can be expressed as f a0 = ιka0. Here, ιk : Rk →Rm is a zero padding operator. Its adjoint ι∗ k : Rm →Rk acts as a projection onto the lower dimensional space by keeping the first k components. The short-and-sparse blind deconvolution problem exhibits a scaled-shift ambiguity, which derives from the basic properties of a convolution operator. Namely, for any observation signal y, and any nonzero scalar α and integer shift τ, the following equality always holds y = (±αsτ[f a0]) ⊛ ±α−1s−τ[x0]  . (2) Here, s−τ[v] denotes the cyclic shift of the vector v by τ entries: sτ[v](i) = v ([i −τ −1]m + 1) , ∀i ∈{1, · · · , m} . (3) Clearly, both scaling and cyclic shifts preserve the short-and-sparse structure of (a0, x0). This scaled-shift symmetry raises nontrivial challenges for computation, making straightforward convexification approaches ineffective.1 Nonconvex algorithms for sparse blind deconvolution have been well developed and practiced, especially in computer vision [12, 13, 14, 15]. Despite its empirical success, little was known about its working mechanism. Recently, [16] studies the optimization landscape of the natural nonconvex formulation for sparse blind deconvolution, assuming the kernel a ∈Rk to have unit Frobenius norm (denote as a ∈Sk−1). [16] argues that under conditions, this problem has well-structured local optima, in the sense that every local optimum is close to some shift truncation of the ground truth (Figure 1). The presence of these local optima can be viewed as a result of the shift symmetry associated to the convolution operator: the shifted and truncated kernel ι∗ ksτ[f a0] can be convolved with the sparse signal s−τ[x0] (shifted in the other direction) to produce a near approximation to the observation ι∗ ksτ[f a0] ⊛s−τ[x0] ≈y. In [16], this geometric insight about local optima is corroborated with a lot of experiments, but rigorous proof is only available in the “dilute limit” in which the sparse coefficient signal x0 is a single spike. In this paper, we adopt the unit Frobenius norm constraint for the short convolution kernel a as in [16], but consider a different objective function. We formulate the sparse blind deconvolution problem as the following optimization problem over the sphere: min −∥ˇy ⊛ry (q)∥4 4 s. t. ∥q∥F = 1. (4) Here, ˇy denotes the reversal of y2 and ry (q) is a preconditioner which we will discuss in detail later. Convolution y ⊛ry (q) approximates the reversed underlying activation signal x0, and −∥·∥4 4 serves as the sparsity penalty. We demonstrate that even when x0 is relatively dense, any local minimum in certain region of the sphere is close to a shift truncation ι∗ ksτ [f a0] of the ground truth. This benign region contains the sub-level set of small objective value. Algorithmically, if initialized at a point with small enough objective value, then a descent algorithm always decreases the objective value and hence stays in this region. Specifically, for a generic kernel3 a0 ∈Sk−1, if the 1A number of works [7, 8, 9, 10, 11] have developed provable methods for blind deconvolution under the assumption that a0 and x0 belong to random subspaces, or are sparse in random dictionaries. These random models exhibit simpler geometry than the short-and-sparse model. Because our target signal is sparse in the standard basis, the aforementioned results are not applicable in our setting. 2Denote y = [y1, y2, · · · , ym−1, ym]T , then its reversal ˇy = [y1, ym, ym−1, · · · , y2]T with y1 not moved. 3In this paper, we refer a kernel sampled following a uniform distribution over the sphere as a generic kernel on the sphere. 2 sparsity rate4 θ ≲k−2/3 and the number of measurement m ≳poly(k), initializing at some preconditioned k consecutive entries of y, and applying any descent method that converges to a local minimizer under a strict saddle hypothesis [17, 18], produces a near shift-truncation of the ground truth.5 Assumptions and Notations We assume that x0 ∈Rm follows Bernoulli-Gaussian (BG) model with sparsity level θ: x0 (i) = ωigi with ωi ∼Ber (θ) and gi ∼N (0, 1), where all the different random variables are jointly independent. For simplicity, we write x0 ∼i.i.d. BG (θ). Throughout this paper, a vector v ∈Rk is indexed as v = [v1, v2, · · · , vk], and [·]m denotes the modulo operator of m. We use ∥·∥op, ∥·∥F , and ∥·∥p to denote operator norm, Frobenius norm, and entry wise ℓp norm respectively. PS [·] .= · ∥·∥F denotes projection onto the Frobenius sphere. (·)◦p is the entry wise p-th order exponent operator. We use C, c to denote positive constants, and their value change across the paper. 2 Problem Formulation In the short-and-sparse blind deconvolution problem, any k consecutive entries in y only depend on 2k −1 consecutive entries in x0: yi =  yi, · · · , y1+[i+k−1]m T = k−1 X τ=−(k−1) x1+[i+τ−1]m · ι∗ ksτ[f a0] (5) =   ak ak−1 · · · a1 · · · 0 0 0 ak · · · a2 · · · 0 0 ... ... ... ... ... ... ... 0 0 · · · ak−1 · · · a1 0 0 0 · · · ak · · · a2 a1   | {z } A0∈Rk×(2k−1)   x1+[i−k]m ... xi ... x1+[i+k−2]m   | {z } xi∈R(2k−1)×1 . (6) Write Y = [y1, y2, . . . , ym] ∈Rk×m and X0 = [x1, . . . , xm] ∈R2k−1×m. Using the above expression, we have that Y = A0X0. (7) Each column xi of X0 only contains some 2k −1 entries of x0. The rows of X0 are cyclic shifts of the reversal of x0: X0 = " s0[ˇx0] ... s2k−2[ˇx0] # . (8) The shifts of ˇx0 are sparse vectors in the linear subspace row(X0). Note that if we could recover some shift sτ[x0], we could subsequently determine s−τ[a0] by solving a linear system of equations, and hence solve the deconvolution problem, up to the shift ambiguity.6 2.1 Finding a Shifted Sparse Signal In light of the above observations, a natural computational approach to sparse blind deconvolution is to attempt to find x0 by searching for a sparse vector in the linear subspace row(X0), e.g., by solving an optimization problem min ∥v∥⋆ s. t. v ∈row (X0) , ∥v∥2 = 1, (9) 4This equivalently says there could be as many as O(k1/3) shifts of the kernel in a k-length window of the observation. 5[16] proposes to solve the short-and-sparse blind deconvolution problem with a two phase algorithm which first recovers a shift truncation, and then recovers the ground truth kernel with an annealing algorithm. We present additional experimental results on the recovery of the ground truth in the supplementary material. 6[19] considers the multi-channel blind deconvolution problem, where many independent observations yp = a0 ∗xp are available. [19] shows how to formulate this problem as searching for a sparse vector in a linear subspace. Our approach is also inspired by the idea of looking for a sparse/spiky vector in a subspace. However, it pertains to a different problem, in which only a single observation is available. The short and sparse problem exhibits a more complicated optimization landscape, due to the signed shift ambiguity. 3 where ∥·∥⋆is chosen to encourage sparsity of the target signal [20, 21, 22, 23]. In sparse blind deconvolution, we do not have access to the row space of X0. Instead, we only observe the subspace row(Y ) ⊂row(X0). The subspace row(Y ) does not necessarily contain the desired sparse vector eT i X0, but it does contain some approximately sparse vectors. In particular, consider following vector in row(Y ), v = Y T a0 = ˇx0 sparse + X i̸=0 ⟨a0, si[a0]⟩si[ˇx0] | {z } “noise” z . (10) The vector v is a superposition of a sparse signal ˇx0 and its scaled shifts ⟨a0, si[a0]⟩si[ˇx0]. If the shift-coherence | ⟨a0, sτ[a0]⟩| is small7 and x0 is sparse enough, z can be viewed as small noise.8 The vector v is not sparse, but it is spiky: a few of its entries are much larger than the rest. We deploy a milder sparsity penalty −∥·∥4 4 to recover such a spiky vector, as ∥·∥4 4 is very flat around 0 and insensitive to small noise in the signal.9 This gives min −1 4 ∥v∥4 4 s. t. v ∈row (Y ) , ∥v∥2 = 1. (11) We can express a generic unit vector v ∈row(Y ) as v = Y T Y Y T −1/2 q, with ∥v∥2 = ∥q∥2. This leads to the following equivalent optimization problem over the sphere min ψ (q) .= −1 4m Y T Y Y T −1/2 q 4 4 s. t. ∥q∥2 = 1. (12) Interpretation: preconditioned shifts. This objective ψ (q) can be rewritten as ψ (q) = −1 4m ˇy ⊛ Y Y T −1/2q 4 4 = −1 4m ˇx0 ⊛AT 0 Y Y T −1/2q 4 4 ∼∥ˇx0 ⊛ζ∥4 4 , (13) where ζ = AT 0 (A0AT 0 )−1/2q. This approximation becomes accurate as m grows.10 This objective encourages the convolution of ˇx0 and ζ to be as spiky as possible. Reasoning analogous to (10) suggests that ˇx0 ⊛ζ will be spiky if ζ = AT 0 A0AT 0 −1/2 q ≈el, l ∈{1, · · · , 2k −1} . (14) For simplicity, we define the preconditioned convolution matrix A .= A0AT 0 −1/2 A0 = [a1 a2 · · · a2k−1] , (15) with column coherence (preconditioned shift coherence) µ .= maxi̸=j |⟨ai, aj⟩|. Then ζ can also be interpreted as measuring the inner products of q with columns of A. Making this intuition rigorous, we will show that minimizing this objective over a certain region of the sphere yields a preconditioned shift truncate al, from which we can recover a shift truncate of the original signal a0. 2.2 Structured Local Minima ι∗sj[a0] ϕ(a) ι∗si[a0] −π 8 0 π 8 Figure 2: Saddles points are approximately superpositions of local minima. We will show that in a certain region RC⋆⊂Sk−1, the preconditioned shift truncations al are the only local minimizers. Moreover, the other critical points in RC⋆can be interpreted as resulting from competition between several of these local minima (Figure 2). At any saddle point, there exists strict negative curvature in the direction of a nearby local minimizer which breaks the balance in favor of some particular al. The region RC⋆is defined as follows: Definition 2.1. For fixed C⋆> 0, letting κ denote the condition number of A0, and µ .= maxi̸=j |⟨ai, aj⟩| the column coherence of A, we define two regions RC⋆, ˆRC⋆⊂Sk−1, as RC⋆ .= n q ∈Sk−1 | AT q 6 4 ≥C⋆µκ2 AT q 3 3 o . (16) ˆRC⋆ .= n q ∈Sk−1 | AT q 6 4 ≥C⋆µκ2o ⊆RC⋆. (17) 7For a generic kernel a0, the shift-coherence is bounded by | ⟨a0, sτ[a0]⟩| ≈1/ √ k for any shift τ. 8In particular, under a Bernoulli-Gaussian model, for each j, E[z2 j ] = θ P i̸=0 ⟨a0, si[a0]⟩2. 9In comparison, the classical choice ∥·∥⋆= ∥·∥1 is a strict sparsity penalty that essentially encourages all small entries to be 0. 10As Ex0∼i.i.d.BG(θ)[Y Y T ] = Ex0∼i.i.d.BG(θ)[A0X0XT 0 AT 0 ] = θmA0AT 0 . 4 A simpler and smaller region ˆRC⋆is also introduced in Definition (2.1). This region ˆRC⋆ can be viewed as a sub-level set for − AT q 4 4, which is proportional to the objective value ψ (q) assuming m is sufficiently large11. Therefore, once initialized within ˆRC⋆, the iterates produced by a descent algorithm will stay in ˆRC⋆. In particular, at any stationary point q ∈R10, the local optimization landscape can be characterized in terms of the number of spikes (entries with nontrivial magnitude12) in ζ. If there is only one spike in ζ, then such stationary point q is a local minimum that is close to one local minimizer; if there are more than two spikes in ζ, then such stationary point q is saddle point. Based on the above characterizations of stationary points in RC⋆with C⋆≥10, we can deduce that any local minimum is close to al for some integer l, a preconditioned shift truncation of the ground truth a0. Theorem 2.2 (Main Result). Assuming observation y ∈Rm is the circulant convolution of a0 ∈Rk and x0 ∼i.i.d. BG (θ) ∈Rm, where the convolutional matrix A0 has minimum singular value σmin > 0 and condition number κ ≥1, and A has column incoherence 0 ≤µ < 1. There exists a positive constant C such that whenever the number of measurements m ≥C min  µ−4/3, κ2k2 (1 −θ)2 σ2 min κ8k4 log3  κk (1 −θ) σmin  (18) and θ ≥log k/k, then with high probability, any local optima ¯q ∈ˆR2C⋆satisfies |⟨¯q, PS [al]⟩| ≥1 −c⋆κ−2 (19) for some integer 1 ≤l ≤2k −1. Here, C⋆≥10 and c⋆= 1/C⋆. This theorem says that any local minimum in ˆR2C⋆is close to some normalized column of A given polynomially many observation. The parameters σmin, κ and µ effectively measure the spectrum flatness of the ground truth kernel a0 and characterize how broad the results hold. A random like kernel usually has big σmin, small κ and µ, which equivalently implies the result holds in a large sub-level set ˆR2C⋆even with fewer observations. Hence, once assuring the algorithm finds a local minimum in ˆR2C⋆, then some shifted truncation of the ground truth kernel a0 can be recovered. In other words, if we can find an initialization point with small objective value then a descent algorithm minimizing the objective function guarantees that q always stays in ˆR2C⋆in proceeding iterations. Therefore, any descent algorithm that escapes a strict saddle point can be applied to find some al, or some shift truncation of a0. 2.3 Initialization with a Random Sample Recall that yi = A0xi, which is a sparse superposition of about 2θk columns of A0. Intuitively speaking, such qinit already encodes certain preferences towards a few preconditioned shift truncations of the ground truth. Therefore, we randomly choose an index i and set the initialization point as qinit = PS hY Y T −1/2 yi i , ζinit = AT qinit ≈PS  AT Axi  .13 (20) For a generic kernel a0 ∈Sk−1, AT A is close to a diagonal matrix, as the magnitudes of off-diagonal entries are bounded by column incoherence µ. Hence, the sparse property of xi can be approximately preserved, that PS  AT Axi  is spiky vector with small −∥·∥4 4. By leveraging the sparsity level θ, one can make sure such initialization point qinit falls in ˆR2C⋆. Therefore, we propose Algorithm 1 for solving sparse blind deconvolution with its working conditions stated in Corollary 2.3. For the choice of descent algorithms which escape strict saddle points, there are several such algorithms specially tailored for sphere constrained optimization problems [24, 25]. 11Please refer to Section 3 for more arguments. 12We call any ζl with magnitude no smaller than 2µ ∥ζ∥3 3 / ∥ζ∥4 4 to be nontrivial and defer technical reasonings to later sections. 13As Ex0∼i.i.d.BG(θ)[Y Y T ] = θmA0AT 0 . 5 Algorithm 1 Short and Sparse Blind Deconvolution Input: Observations y ∈Rm and kernel size k. Output: Recovered Kernel ¯a. 1: Generate random index i ∈[1, m] and set qinit = PS hY Y T −1/2 yi i . 2: Solve following nonconvex optimization problem with a descent algorithm that escapes saddle point and find a local minimizer ¯q = arg minq∈Sk−1 ϕ (q) 3: Set ¯a = PS hY Y T 1/2 ¯q i . Corollary 2.3. Suppose the ground truth a0 kernel has preconditioned shift coherence 0 ≤µ ≤ 1 8×48 log−3/2 (k) and sparse coefficient x0 ∼i.i.d. BG (θ) ∈Rm. There exist positive constants C ≥25604 and C′ such that whenever the sparsity level 64k−1 log k ≤θ ≤min n 1 482 µ−2k−1 log−2 k, 1 4 − 640 C1/4  3C⋆µκ2−2/3 k−1 1 + 36µ2k log k −2o and signal length m ≥C′ max ( θ2κ6 σ2 min k3 1 + 36µ2k log k 4 log  κk σmin  , min  µ−4/3, κ2k2 (1 −θ)2 σ2 min κ8k4 log3  κk (1 −θ) σmin ) , then with high probability, Algorithm 1 recovers ¯a such that ∥¯a ± PS [ιksτ[f a0]]∥2 ≤2 √ 2c⋆ (21) for some integer shift −(k −1) ≤τ ≤k −1. For a generic a0 ∈Sk−1, plugging in the numerical estimation of the parameters σmin, κ and µ (Figure 3), accurate recovery can be obtained with m ≳θ2k6 poly log (k) measurements and sparsity level θ ≲k−2/3 poly log (k). For bandpass kernels a0, σmin is smaller and κ, µ are larger, and so our results require x0 to be longer and sparser. 3 Optimization Function Landscape We next briefly present the key elements in deriving the main results of this paper. We first investigate the stationary points of the “population” objective Ex0[ψ(q)]. We demonstrate that any local minimizer in RC⋆is close to a signed column of A, a preconditioned shift truncation of a0. We then demonstrate that when m is sufficiently large, the “finite sample” objective ψ(q) has similar properties. Using E[Y Y T ] = θmA0AT 0 again, the expectation of the objective function ψ (q) can be approximated as follows: E [ψ(q)] ≈E  −1 m Y T θmA0AT 0 −1/2 q 4 4  = −3 (1 −θ) θm2 AT q 4 4 −3 m2 . (22) This approximation can be made rigorous (see Lemma 2.1 of the supplementary material), allowing us to study the critical points of E[ψ] by studying the simpler problem min q∈Rk−1 ϕ (q) .= −1 4 AT q 4 4 = −1 4 ∥ζ∥4 4 . (23) The Euclidean gradient and Riemannian gradient [26] of ϕ are ∇ϕ(q) = −Aζ◦3, grad [ϕ] (q) = −Aζ◦3 + q ∥ζ∥4 4 . (24) 3.1 Critical Points of the Population Objective We wish to argue that every local minimizer of ϕ is close to a preconditioned shift-truncation ai. We do this by showing that at any other critical point, there is a direction of strict negative curvature. We will show that at any critical point q ∈R4, the correlation ζ exhibits a very special structure: 6 (P) The entries ζi = ⟨ai, q⟩are either close to zero, or have magnitude |ζi| close to ∥ζ∥4 4 / ∥ai∥2. We can demonstrate this property directly from the stationarity condition grad [ϕ] (q) = 0. Aζ◦3 −q ∥ζ∥4 4 = 0 ⇒ AT Aζ◦3 −AT q ∥ζ∥4 4 = 0. (25) The i-th entry ζi of the correlation ζ therefore satisfies the following cubic equation ∥ai∥2 2 ζ3 i + X j̸=i ⟨ai, aj⟩ζ3 j −ζi ∥ζ∥4 4 = 0 ⇒ ζ3 i −ζi ∥ζ∥4 4 ∥ai∥2 2 | {z } αi + P j̸=i ⟨ai, aj⟩ζ3 j ∥ai∥2 2 | {z } βi = 0. (26) If αi ≫βi, the roots of (26) are either very close to 0, or very close to ±√αi. The condition αi ≫βi obtains whenever AT q 6 4 ≥4µ AT q 3 3, and hence on R4, every critical point satisfies property (P). 3.2 Asymptotic Function Landscape on RC⋆ The local optimization landscape around any stationary point q is characterized by the Riemannian Hessian. In particular, at a stationary point q, if Hess [ϕ] (q) is positive semidefinite, then the function is convex and q is a local minimum; if Hess [ϕ] (q) has a negative eigenvalue, then there exists a direction along which the objective value decreases and q is a saddle point. Technically, on RC⋆with C⋆≥10, the minimum eigenvalue of the Riemannian Hessian can be controlled based on the spikiness of ζ. First, we demonstrate that once constrained in RC⋆with C⋆≥10, then any stationary point must have cross correlation ζ with entries of nontrivial magnitude, or entries of ζ cannot be simultaneously close to 0. Geometrically, this implies that any stationary point q ∈RC⋆ should be "close" to certain preconditioned shift truncations. Lemma 3.1. For any stationary point q ∈RC⋆with C⋆≥10, magnitude of vector ζ = AT q cannot be uniformly bounded by 2µ ∥ζ∥3 3 / ∥ζ∥4 4. Local Minima If q is a stationary point in RC⋆with C⋆≥10, and ζ only has one single entry ζl with magnitude larger than 2µ ∥ζ∥3 3 / ∥ζ∥4 4, then the Riemannian Hessian Hess[ϕ] (q) is always positive definite, and the function is locally convex. In addition, |⟨q, al⟩| > 1 −2C−1 ⋆κ−2 ∥al∥2, hence such q is one local minimum near al. Lemma 3.2. Suppose q is a stationary point in RC⋆with C⋆≥10, and ζ = AT q has only one entry ζl of magnitude no smaller than 2µ ∥ζ∥3 3 / ∥ζ∥4 4, then q is a local minimum near al such that |⟨q, PS [al]⟩| > 1 −2c⋆κ−2 with c⋆= 1/C⋆. Saddle Points If q is a stationary point in RC⋆with C⋆≥10, and ζ has more than one nontrivial entry, then the Riemannian Hessian Hess ϕ (q) has negative eigenvalue(s) and hence q is a saddle point. Especially, denoting any two nontrivial entries of ζ with ζl and ζl′, then there exists a negative curvature in the span of al and al′. Lemma 3.3. Suppose q is a stationary point in RC⋆with C⋆≥10, and ζ = AT q has at least two entries ζl and ζl′ with magnitude larger than 2µ ∥ζ∥3 3 / ∥ζ∥4 4, then the Riemannian Hessian at q has negative eigenvalue(s) and q is a saddle point. 3.3 Finite Sample Concentration We argue that the critical points of the finite sample objective function ψ(q) are similar to those of the asymptotic objective function ϕ(q): Critical points are close. The Riemannian gradient concentrates, such that there is a bijection between critical points qpop of ϕ and critical points qfs of ψ, with ∥qpop −qfs∥2 small. Curvature is preserved. The Riemannian Hessian concentrates, such that Hess[ψ](qfs) has a negative eigenvalue if and only if Hess[ϕ](qpop) has a negative eigenvalue, and Hess[ψ](qfs) is positive definite if and only if Hess[ϕ](qpop) is positive definite. This implies that every local minimizer of the finite sample objective function is close to a preconditioned shift-truncation. While conceptually straightforward, the proofs of these 7 properties are somewhat involved, due to the presence of the preconditioner (Y Y T )−1/2. We give rigorous versions of all of the above statements, and a complete proof, in the supplementary appendix. 4 Experiments Properties of a Random Kernel. In our main result, the sparsity rate θ depends on the condition number κ and induced column coherence µ. Figure 3 plots the average values (over 100 independent simulations) of κ and µ for generic unit kernels of varying dimension k = 10, 20, · · · , 1000. Figure 3: Coherence of random kernels. Average of σmin (left), κ (middle), and µ (right) over 100 independent trials, for varying kernel length k. These simulations suggest the following estimates: σmin ∼log−1 (k) , κ ∼log4/3 k, µ ∼ p log (k) /k. (27) Hence, reliable recovery of the shift truncation of a generic kernel can be guaranteed even when the sparse signal is relatively dense (θ ∼k−2/3). On the other hand, if the convolution kernel a0 is lowpass, then σmin decreases, and κ, µ increase, then more observations m and smaller sparsity level θ is required for the proposed algorithm to perform as desired. Recovery Error of the Proposed Algorithm We present the performance of Algorithm 1 under varying settings. We define the recover error as err = 1 −maxτ |⟨¯a, PS [ι∗ ksτ[f a0]]⟩|, and calculate the average error from 50 independent experiments. The left figure plots the average error when we fix the kernel size k = 50, and vary the dimension m and the sparsity θ of x0.14 The right figure plots the average error when we vary the dimensions k, m of both convolution signals, and set the sparsity as θ = k−2/3. Average error, k = 50 Overlapping ratio k"3 2.66 4.13 5.60 7.07 Signal length m 2500 2000 1500 1000 500 0.2 0.1 0.0 Average error, sparsity = k-2/3 Kernel size k 10 20 30 40 50 60 70 80 Signal length m 2200 1900 1600 1300 1000 700 400 100 0.2 0.1 0.0 Figure 4: Recovery Error of the Shift Truncated Kernel by Algorithm 1. Acknowledgement The authors gratefully acknowledge support from NSF 1343282, NSF CCF 1527809, NSF CCF 1740833, and NSF IIS 1546411. 14Note that the x-axis is indexed with overlapping ratio k · θ, which indicates how many copies of a0 present in a k-length window of y on average. 8 References [1] Sky Cheung, Yenson Lau, Zhengyu Chen, Ju Sun, Yuqian Zhang, John Wright, and Abhay Pasupathy. Beyond the fourier transform: A nonconvex optimization approach to microscopy analysis. Submitted, 2017. [2] M. S. Lewicki. A review of methods for spike sorting: the detection and classification of neural action potentials. Network: Computation in Neural Systems, 9(4):53–78, 1998. [3] D. Kundur and D. Hatzinakos. Blind image deconvolution. Signal Processing Magazine, IEEE, 13(3):43–64, May 1996. [4] Chaitanya Ekanadham, Daniel Tranchina, and Eero P. Simoncelli. A blind sparse deconvolution method for neural spike identification. In Advances in Neural Information Processing Systems 24, pages 1440–1448. 2011. [5] T. Chan and C. Wong. Total variation blind deconvolution. IEEE Transactions on Image Processing, 7(3):370–375, Mar 1998. [6] A. Levin, Y. Weiss, F. Durand, and W. Freeman. Understanding blind deconvolution algorithms. IEEE Transactions on Pattern Analysis and Machine Intelligence, 33(12):2354–2367, Dec 2011. [7] A. Ahmed, B. Recht, and J. Romberg. Blind deconvolution using convex programing. arXiv preprint:1211.5608, 2012. [8] Xiaodong Li, Shuyang Ling, Thomas Strohmer, and Ke Wei. Rapid, robust, and reliable blind deconvolution via nonconvex optimization. preprint, 2016. [9] Shuyang Ling and Thomas Strohmer. Self-calibration and biconvex compressive sensing. Inverse Problems, 31(11):115002, 2015. [10] Shuyang Ling and Thomas Strohmer. Blind deconvolution meets blind demixing: Algorithms and performance bounds. IEEE Transactions on Information Theory, 63(7):4497–4520, 2017. [11] Yuejie Chi. Guaranteed blind sparse spikes deconvolution via lifting and convex optimization. IEEE Journal of Selected Topics in Signal Processing, 10(4):782–794, June 2016. [12] A. Benichoux, E. Vincent, and R. Gribonval. A fundamental pitfall in blind deconvolution with sparse and shift-invariant priors. 38th International Conference on Acoustics, Speech, and Signal Processing, May 2013. [13] Daniele Perrone and Paolo Favaro. Total variation blind deconvolution: The devil is in the details. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2014. [14] David Wipf and Haichao Zhang. Revisiting bayesian blind deconvolution. arXiv preprint:1305.2362, 2013. [15] Haichao Zhang, David Wipf, and Yanning Zhang. Multi-image blind deblurring using a coupled adaptive sparse prior. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), January 2013. [16] Yuqian Zhang, Yenson Lau, Han-wen Kuo, Sky Cheung, Abhay Pasupathy, and John Wright. On the global geometry of sphere-constrained sparse blind deconvolution. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), July 2017. [17] Chi Jin, Rong Ge, Praneeth Netrapalli, Sham M Kakade, and Michael I Jordan. How to escape saddle points efficiently. arXiv preprint arXiv:1703.00887, 2017. [18] Peng Xu, Farbod Roosta-Khorasani, and Michael W. Mahoney. Second-order optimization for non-convex machine learning: An empirical study. arXiv preprint arXiv:1708.07827, 2017. [19] L. Wang and Y. Chi. Blind deconvolution from multiple sparse inputs. IEEE Signal Processing Letters, 23(10):1384–1388, Oct 2016. [20] Daniel Spielman, Huan Wang, and John Wright. Exact recovery of sparsely-used dictionaries. preprint, 2012. [21] Ju Sun, Qing Qu, and John Wright. Complete dictionary recovery over the sphere. preprint, 2015. 9 [22] Qing Qu, Ju Sun, and John Wright. Finding a sparse vector in a subspace: linear sparsity using alternating directions. IEEE Transactions on Information Theory, 2016. [23] Samuel B. Hopkins, Tselil Schrammand, Jonathan Shi, and David Steurer. Fast spectral algorithms from sum-of-squares proofs: Tensor decomposition and planted sparse vectors. In Proceedings of the Forty-eighth Annual ACM Symposium on Theory of Computing, STOC ’16, pages 178–191, 2016. [24] P.-A. Absil, C.G. Baker, and K.A. Gallivan. Trust-region methods on riemannian manifolds. Foundations of Computational Mathematics, 7(3):303–330, Jul 2007. [25] Donald Goldfarb, Zaiwen Wen, and Wotao Yin. A curvilinear search method for p-harmonic flows on spheres. SIAM J. Imaging Sciences, 2(1):84–109, 2009. [26] P.-A. Absil, R. Mahony, and R. Sepulchre. Optimization Algorithms on Matrix Manifolds. Princeton University Press, Princeton, NJ, USA, 2007. 10
2018
136
7,293
Solving Non-smooth Constrained Programs with Lower Complexity than O(1/"): A Primal-Dual Homotopy Smoothing Approach Xiaohan Wei Department of Electrical Engineering University of Southern California Los Angeles, CA, USA, 90089 xiaohanw@usc.edu Hao Yu Alibaba Group (U.S.) Inc. Bellevue, WA, USA, 98004 hao.yu@alibaba-inc.com Qing Ling School of Data and Computer Science Sun Yat-Sen University Guangzhou, China, 510006 lingqing556@mail.sysu.edu.cn Michael J. Neely Department of Electrical Engineering University of Southern California Los Angeles, CA, USA, 90089 mikejneely@gmail.com Abstract We propose a new primal-dual homotopy smoothing algorithm for a linearly constrained convex program, where neither the primal nor the dual function has to be smooth or strongly convex. The best known iteration complexity solving such a non-smooth problem is O("−1). In this paper, we show that by leveraging a local error bound condition on the dual function, the proposed algorithm can achieve a better primal convergence time of O ! "−2/(2+β) log2("−1) " , where β 2 (0, 1] is a local error bound parameter. As an example application of the general algorithm, we show that the distributed geometric median problem, which can be formulated as a constrained convex program, has its dual function non-smooth but satisfying the aforementioned local error bound condition with β = 1/2, therefore enjoying a convergence time of O ! "−4/5 log2("−1) " . This result improves upon the O("−1) convergence time bound achieved by existing distributed optimization algorithms. Simulation experiments also demonstrate the performance of our proposed algorithm. 1 Introduction We consider the following linearly constrained convex optimization problem: min f(x) (1) s.t. Ax −b = 0, x 2 X, (2) where X ✓Rd is a compact convex set, f : Rd ! R is a convex function, A 2 RN⇥d, b 2 RN. Such an optimization problem has been studied in numerous works under various application scenarios such as machine learning (Yurtsever et al. (2015)), signal processing (Ling and Tian (2010)) and communication networks (Yu and Neely (2017a)). The goal of this work is to design new algorithms for (1-2) achieving an " approximation with better convergence time than O(1/"). 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. 1.1 Optimization algorithms related to constrained convex program Since enforcing the constraint Ax −b = 0 generally requires a significant amount of computation in large scale systems, the majority of the scalable algorithms solving problem (1-2) are of primal-dual type. Generally, the efficiency of these algorithms depends on two key properties of the dual function of (1-2), namely, the Lipschitz gradient and strong convexity. When the dual function of (1-2) is smooth, primal-dual type algorithms with Nesterov’s acceleration on the dual of (1)-(2) can achieve a convergence time of O(1/p") (e.g. Yurtsever et al. (2015); Tran-Dinh et al. (2018))1. When the dual function has both the Lipschitz continuous gradient and the strongly convex property, algorithms such as dual subgradient and ADMM enjoy a linear convergence O(log(1/")) (e.g. Yu and Neely (2018); Deng and Yin (2016)). However, when neither of the properties is assumed, the basic dualsubgradient type algorithm gives a relatively worse O(1/"2) convergence time (e.g. Wei et al. (2015); Wei and Neely (2018)), while its improved variants yield a convergence time of O(1/") (e.g. Lan and Monteiro (2013); Deng et al. (2017); Yu and Neely (2017b); Yurtsever et al. (2018); Gidel et al. (2018)). More recently, several works seek to achieve a better convergence time than O(1/") under weaker assumptions than Lipschitz gradient and strong convexity of the dual function. Specifically, building upon the recent progress on the gradient type methods for optimization with H¨older continuous gradient (e.g. Nesterov (2015a,b)), the work Yurtsever et al. (2015) develops a primal-dual gradient method solving (1-2), which achieves a convergence time of O(1/" 1+⌫ 1+3⌫), where ⌫is the modulus of H¨older continuity on the gradient of the dual function of the formulation (1-2).2 On the other hand, the work Yu and Neely (2018) shows that when the dual function has Lipschitz continuous gradient and satisfies a locally quadratic property (i.e. a local error bound with β = 1/2, see Definition 2.1 for details), which is weaker than strong convexity, one can still obtain a linear convergence with a dual subgradient algorithm. A similar result has also been proved for ADMM in Han et al. (2015). In the current work, we aim to address the following question: Can one design a scalable algorithm with lower complexity than O(1/") solving (1-2), when both the primal and the dual functions are possibly non-smooth? More specifically, we look at a class of problems with dual functions satisfying only a local error bound, and show that indeed one is able to obtain a faster primal convergence via a primal-dual homotopy smoothing method under a local error bound condition on the dual function. Homotopy methods were first developed in the statistics literature in relation to the model selection problem for LASSO, where, instead of computing a single solution for LASSO, one computes a complete solution path by varying the regularization parameter from large to small (e.g. Osborne et al. (2000); Xiao and Zhang (2013)).3 On the other hand, the smoothing technique for minimizing a non-smooth convex function of the following form was first considered in Nesterov (2005): (x) = g(x) + h(x), x 2 ⌦1 (3) where ⌦1 ✓Rd is a closed convex set, h(x) is a convex smooth function, and g(x) can be explicitly written as g(x) = max u2⌦2 hAx, ui −φ(u), (4) where for any two vectors a, b 2 Rd, ha, bi = aT b, ⌦1 ✓Rd is a closed convex set, and φ(u) is a convex function. By adding a strongly concave proximal function of u with a smoothing parameter µ > 0 into the definition of g(x), one can obtain a smoothed approximation of (x) with smooth modulus µ. Then, Nesterov (2005) employs the accelerated gradient method on the smoothed approximation (which delivers a O(1/p") convergence time for the approximation), and sets the parameter to be µ = O("), which gives an overall convergence time of O(1/"). An important follow-up question is that whether or not such a smoothing technique can also be applied to solve 1Our convergence time to achieve within " of optimality is in terms of number of (unconstrained) maximization steps arg maxx2X [λT (Ax −b) −f(x) −µ 2 kx −˜xk2] where constants λ, A, ˜x, µ are known. This is a standard measure of convergence time for Lagrangian-type algorithms that turn a constrained problem into a sequence of unconstrained problems. 2The gradient of function g(·) is H¨older continuous with modulus ⌫2 (0, 1] on a set X if krg(x) − rg(y)k L⌫kx −yk⌫, 8x, y 2 X, where k · k is the vector 2-norm and L⌫is a constant depending on ⌫. 3 The word “homotopy”, which was adopted in Osborne et al. (2000), refers to the fact that the mapping from regularization parameters to the set of solutions of the LASSO problem is a continuous piece-wise linear function. 2 (1-2) with the same primal convergence time. This question is answered in subsequent works Necoara and Suykens (2008); Li et al. (2016); Tran-Dinh et al. (2018), where they show that indeed one can also obtain an O(1/") primal convergence time for the problem (1-2) via smoothing. Combining the homotopy method with a smoothing technique to solve problems of the form (3) has been considered by a series of works including Yang and Lin (2015), Xu et al. (2016) and Xu et al. (2017). Specifically, the works Yang and Lin (2015) and Xu et al. (2016) consider a multi-stage algorithm which starts from a large smoothing parameter µ and then decreases this parameter over time. They show that when the function (x) satisfies a local error bound with parameter β 2 (0, 1], such a combination gives an improved convergence time of O(log(1/")/"1−β) minimizing the unconstrained problem (3). The work Xu et al. (2017) shows that the homotopy method can also be combined with ADMM to achieve a faster convergence solving problems of the form min x2⌦1 f(x) + (Ax −b), where ⌦1 is a closed convex set, f, are both convex functions with f(x) + (Ax −b) satisfying the local error bound, and the proximal operator of (·) can be easily computed. However, due to the restrictions on the function in the paper, it cannot be extended to handle problems of the form (1-2).4 Contributions: In the current work, we show a multi-stage homotopy smoothing method enjoys a primal convergence time O ! "−2/(2+β) log2("−1) " solving (1-2) when the dual function satisfies a local error bound condition with β 2 (0, 1]. Our convergence time to achieve within " of optimality is in terms of number of (unconstrained) maximization steps arg maxx2X [λT (Ax −b) −f(x) − µ 2 ||x −ex||2], where constants λ, A, ex, µ are known, which is a standard measure of convergence time for Lagrangian-type algorithms that turn a constrained problem into a sequence of unconstrained problems. The algorithm essentially restarts a weighted primal averaging process at each stage using the last Lagrange multiplier computed. This result improves upon the earlier O(1/") result by (Necoara and Suykens (2008); Li et al. (2016)) and at the same time extends the scope of homotopy smoothing method to solve a new class of problems involving constraints (1-2). It is worth mentioning that a similar restarted smoothing strategy is proposed in a recent work Tran-Dinh et al. (2018) to solve problems including (1-2), where they show that, empirically, restarting the algorithm from the Lagrange multiplier computed from the last stage improves the convergence time. Here, we give one theoretical justification of such an improvement. 1.2 The distributed geometric median problem The geometric median problem, also known as the Fermat-Weber problem, has a long history (e.g. see Weiszfeld and Plastria (2009) for more details). Given a set of n points b1, b2, · · · , bn 2 Rd, we aim to find one point x⇤2 Rd so as to minimize the sum of the Euclidean distance, i.e. x⇤2 argmin x2Rd n X i=1 kx −bik, (5) which is a non-smooth convex optimization problem. It can be shown that the solution to this problem is unique as long as b1, b2, · · · , bn 2 Rd are not co-linear. Linear convergence time algorithms solving (5) have also been developed in several works (e.g. Xue and Ye (1997), Parrilo and Sturmfels (2003), Cohen et al. (2016)). Our motivation of studying this problem is driven by its recent application in distributed statistical estimation, in which data are assumed to be randomly spreaded to multiple connected computational agents that produce intermediate estimators, and then, these intermediate estimators are aggregated in order to compute some statistics of the whole data set. Arguably one of the most widely used aggregation procedures is computing the geometric median of the local estimators (see, for example, Duchi et al. (2014), Minsker et al. (2014), Minsker and Strawn (2017), Yin et al. (2018)). It can be shown that the geometric median is robust against arbitrary corruptions of local estimators in the sense that the final estimator is stable as long as at least half of the nodes in the system perform as expected. 4The result in Xu et al. (2017) heavily depends on the assumption that the subgradient of (·) is defined everywhere over the set ⌦1 and uniformly bound by some constant ⇢, which excludes the choice of indicator functions necessary to deal with constraints in the ADMM framework. 3 Contributions: As an example application of our general algorithm, we look at the problem of computing the solution to (5) in a distributed scenario over a network of n agents without any central controller, where each agent holds a local vector bi. Remarkably, we show theoretically that such a problem, when formulated as (1-2), has its dual function non-smooth but locally quadratic. Therefore, applying our proposed primal-dual homotopy smoothing method gives a convergence time of O ! "−4/5 log2("−1) " . This result improves upon the performance bounds of the previously known decentralized optimization algorithms (e.g. PG-EXTRA Shi et al. (2015) and decentralized ADMM Shi et al. (2014)), which do not take into account the special structure of the problem and only obtain a convergence time of O (1/"). Simulation experiments also demonstrate the superior ergodic convergence time of our algorithm compared to other algorithms. 2 Primal-dual Homotopy Smoothing 2.1 Preliminaries The Lagrange dual function of (1-2) is defined as follows:5 F(λ) := max x2X {−hλ, Ax −bi −f(x)} , (6) where λ 2 RN is the dual variable, X is a compact convex set and the minimum of the dual function is F ⇤:= minλ2RN F(λ). For any closed set K ✓Rd and x 2 Rd, define the distance function of x to the set K as dist(x, K) := min y2K kx −yk, where kxk := qPd i=1 x2 i . For a convex function F(λ), the δ-sublevel set Sδ is defined as Sδ := {λ 2 RN : F(λ) −F ⇤δ}. (7) Furthermore, for any matrix A 2 RN⇥d, we use σmax(AT A) to denote the largest eigenvalue of AT A. Let ⇤⇤:= % λ⇤2 RN : F(λ⇤) F(λ), 8λ 2 RN (8) be the set of optimal Lagrange multipliers. Note that if the constraint Ax = b is feasible, then λ⇤2 ⇤⇤implies λ⇤+ v 2 ⇤⇤for any v that satisfies AT v = 0. The following definition introduces the notion of local error bound. Definition 2.1. Let F(λ) be a convex function over λ 2 RN. Suppose ⇤⇤is non-empty. The function F(λ) is said to satisfy the local error bound with parameter β 2 (0, 1] if 9δ > 0 such that for any λ 2 Sδ, dist(λ, ⇤⇤) Cδ(F(λ) −F ⇤)β, (9) where Cδ is a positive constant possibly depending on δ. In particular, when β = 1/2, F(λ) is said to be locally quadratic and when β = 1, it is said to be locally linear. Remark 2.1. Indeed, a wide range of popular optimization problems satisfy the local error bound condition. The work Tseng (2010) shows that if X is a polyhedron, f(·) has Lipschitz continuous gradient and is strongly convex, then the dual function of (1-2) is locally linear. The work Burke and Tseng (1996) shows that when the objective is linear and X is a convex cone, the dual function is also locally linear. The values of β have also been computed for several other problems (e.g. Pang (1997); Yang and Lin (2015)). Definition 2.2. Given an accuracy level " > 0, a vector x0 2 X is said to achieve an " approximate solution regarding problem (1-2) if f(x0) −f ⇤O("), kAx0 −bk O("), where f ⇤is the optimal primal objective of (1-2). Throughout the paper, we adopt the following assumptions: 5Usually, the Lagrange dual is defined as minx2X hλ, Ax −bi + f(x). Here, we flip the sign and take the maximum for no reason other than being consistent with the form (4). 4 Assumption 2.1. (a) The feasible set {x 2 X : Ax −b = 0} is nonempty and non-singleton. (b) The set X is bounded, i.e. supx,y2X kx −yk D, for some positive constant D. Furthermore, the function f(x) is also bounded, i.e. maxx2X |f(x)| M, for some positive constant M. (c) The dual function defined in (6) satisfies the local error bound for some parameter β 2 (0, 1] and some level δ > 0. (d) Let PA be the projection operator onto the column space of A. There exists a unique vector ⌫⇤2 RN such that for any λ⇤2 ⇤⇤, PAλ⇤= ⌫⇤, i.e. ⇤⇤= ! λ⇤2 RN : PAλ⇤= ⌫⇤ . Note that assumption (a) and (b) are very mild and quite standard. For most applications, it is enough to check (c) and (d). We will show, for example, in Section 4 that the distributed geometric median problem satisfies all the assumptions. Finally, we say a function g : X ! R is smooth with modulus L > 0 if krg(x) −rg(y)k Lkx −yk, 8x, y 2 X. 2.2 Primal-dual homotopy smoothing algorithm This section introduces our proposed algorithm for optimization problem (1-2) satisfying Assumption 2.1. The idea of smoothing is to introduce a smoothed Lagrange dual function Fµ(λ) that approximates the original possibly non-smooth dual function F(λ) defined in (6). For any constant µ > 0, define fµ(x) = f(x) + µ 2 kx −exk2, (10) where ex is an arbitrary fixed point in X. For simplicity of notation, we drop the dependency on ex in the definition of fµ(x). Then, by the boundedness assumption of X, we have f(x) fµ(x)  f(x) + µ 2 D2, 8x 2 X. For any λ 2 RN, define Fµ(λ) = max x2X −hλ, Ax −bi −fµ(x) (11) as the smoothed dual function. The fact that Fµ(λ) is indeed smooth with modulus µ follows from Lemma 6.1 in the Supplement. Thus, one is able to apply an accelerated gradient descent algorithm on this modified Lagrange dual function, which is detailed in Algorithm 1 below, starting from an initial primal-dual pair (ex, eλ) 2 Rd ⇥RN. Algorithm 1 Primal-Dual Smoothing: PDS ⇣ eλ, ex, µ, T ⌘ Let λ0 = λ−1 = eλ and ✓0 = ✓−1 = 1. For t = 0 to T −1 do • Compute a tentative dual multiplier: bλt = λt + ✓t(✓−1 t−1 −1)(λt −λt−1), • Compute the primal update: x(bλt) = argmaxx2X − D bλt, Ax −b E −f(x) −µ 2 kx −exk2. • Compute the dual update: λt+1 = bλt + µ(Ax(bλt) −b). • Update the stepsize: ✓t+1 = p ✓4 t +4✓2 t −✓2 t 2 . end for Output: xT = 1 ST PT −1 t=0 1 ✓t x(bλt) and λT , where ST = PT −1 t=0 1 ✓t . Our proposed algorithm runs Algorithm 1 in multiple stages, which is detailed in Algorithm 2 below. 3 Convergence Time Results We start by defining the set of optimal Lagrange multipliers for the smoothed problem:6 ⇤⇤ µ := ! λ⇤ µ 2 RN : Fµ(λ⇤ µ) Fµ(λ), 8λ 2 RN (12) 6By Assumption 2.1(a) and Farkas’ Lemma, this is non-empty. 5 Algorithm 2 Homotopy Method: Let "0 be a fixed constant and " < "0 be the desired accuracy. Set µ0 = "0 D2 , λ(0) = 0, x(0) 2 X, the number of stages K ≥dlog2("0/")e + 1, and the time horizon during each stage T ≥1. For k = 1 to K do • Let µk = µk−1/2. • Run the primal-dual smoothing algorithm (λ(k), x(k)) = PDS ⇣ λ(k−1), x(k−1), µk, T ⌘ . end for Output: x(K). Our convergence time analysis involves two steps. The first step is to derive a primal convergence time bound for Algorithm 1, which involves the location information of the initial Lagrange multiplier at the beginning of this stage. The details are given in Supplement 6.2. Theorem 3.1. Suppose Assumption 2.1(a)(b) holds. For any T ≥1 and any initial vector (ex, eλ) 2 Rd ⇥RN, we have the following performance bound regarding Algorithm 1, f (xT ) −f ⇤kPAeλ⇤k · kAxT −bk + σmax(AT A) 2µST $$$eλ⇤−eλ $$$ 2 + µD2 2 , (13) kAxT −bk 2σmax(AT A) µST ⇣$$$eλ⇤−eλ $$$ + dist(λ⇤ µ, ⇤⇤) ⌘ , (14) where eλ⇤2 argminλ⇤2⇤⇤kλ⇤−eλk, xT := 1 ST PT −1 t=0 x(bλt) ✓t , ST = PT −1 t=0 1 ✓t and λ⇤ µ is any point in ⇤⇤ µ defined in (12). An inductive argument shows that ✓t 2/(t + 2) 8t ≥0. Thus, Theorem 3.1 already gives an O(1/") convergence time by setting µ = " and T = 1/". Note that this is the best trade-off we can get from Theorem 3.1 when simply bounding the terms keλ⇤−eλk and dist(λ⇤ µ, ⇤⇤) by constants. To see how this bound leads to an improved convergence time when running in multiple rounds, suppose the computation from the last round gives a eλ that is close enough to the optimal set ⇤⇤, then, keλ⇤−eλk would be small. When the local error bound condition holds, one can show that dist(λ⇤ µ, ⇤⇤) O(µβ). As a consequence, one is able to choose µ smaller than " and get a better trade-off. Formally, we have the following overall performance bound. The proof is given in Supplement 6.3. Theorem 3.2. Suppose Assumption 2.1 holds, "0 ≥max{2M, 1}, 0 < " min{δ/2, 2M, 1}, T ≥ 2DCδp σmax(AT A)(2M)β/2 "2/(2+β) . The proposed homotopy method achieves the following objective and constraint violation bound: f(x(K)) −f ⇤ ✓24kPAλ⇤k(1 + Cδ) C2 δ (2M)2β + 6 C2 δ (2M)2β + 1 4 ◆ ", kAx(K) −bk 24(1 + Cδ) C2 δ (2M)β ", with running time 2DCδp σmax(AT A)(2M)β/2 "2/(2+β) (dlog2("0/")e + 1), i.e. the algorithm achieves an " approximation with convergence time O ( "−2/(2+β) log2("−1) ) . 4 Distributed Geometric Median Consider the problem of computing the geometric median over a connected network (V, E), where V = {1, 2, · · · , n} is a set of n nodes, E = {eij}i,j2V is a collection of undirected edges, eij = 1 if there exists an undirected edge between node i and node j, and eij = 0 otherwise. Furthermore, eii = 1, 8i 2 {1, 2, · · · , n}.Furthermore, since the graph is undirected, we always have eij = eji, 8i, j 2 {1, 2, · · · , n}. Two nodes i and j are said to be neighbors of each other if eij = 1. Each node i holds a local vector bi 2 Rd, and the goal is to compute the solution to (5) without having a central controller, i.e. each node can only communicate with its neighbors. 6 Computing geometric median over a network has been considered in several works previously and various distributed algorithms have been developed such as decentralized subgradient methd (DSM, Nedic and Ozdaglar (2009); Yuan et al. (2016)), PG-EXTRA (Shi et al. (2015)) and ADMM (Shi et al. (2014); Deng et al. (2017)). The best known convergence time for this problem is O(1/"). In this section, we will show that it can be written in the form of problem (1-2), has its Lagrange dual function locally quadratic and optimal Lagrange multiplier unique up to the null space of A, thereby satisfying Assumption 2.1. Throughout this section, we assume that n ≥3, b1, b2, · · · , bn 2 Rd are not co-linear and they are distinct (i.e. bi 6= bj if i 6= j). We start by defining a mixing matrix f W 2 Rn⇥n with respect to this network. The mixing matrix will have the following properties: 1. Decentralization: The (i, j)-th entry ewij = 0 if eij = 0. 2. Symmetry: f W = f WT . 3. The null space of In⇥n −f W satisfies N(In⇥n −f W) = {c1, c 2 R}, where 1 is an all 1 vector in Rn. These conditions are rather mild and satisfied by most doubly stochastic mixing matrices used in practice. Some specific examples are Markov transition matrices of max-degree chain and MetropolisHastings chain (see Boyd et al. (2004) for detailed discussions). Let xi 2 Rd be the local variable on the node i. Define x := 2 664 x1 x2 ... xn 3 775 2 Rnd, b := 2 664 b1 b2 ... bn 3 775 2 Rnd, A = 2 64 W11 · · · W1n ... ... ... Wn1 · · · Wnn 3 75 2 R(nd)⇥(nd), where Wij = ⇢(1 −ewij)Id⇥d, if i = j −ewijId⇥d, if i 6= j , and ewij is ij-th entry of the mixing matrix f W. By the aforementioned null space property of the mixing matrix f W, it is easy to see that the null space of the matrix A is N(A) = * u 2 Rnd : u = [uT 1 , · · · , uT n]T , u1 = u2 = · · · = un , (15) Then, because of the null space property (15), one can equivalently write problem (5) in a “distributed fashion” as follows: min n X i=1 kxi −bik (16) s.t. Ax = 0, kxi −bik D, i = 1, 2, · · · , n, (17) where we set the constant D to be large enough so that the solution belongs to the set X := * x 2 Rnd : kxi −bik D, i = 1, 2, · · · , n . This is in the same form as (1-2) with X := {x 2 Rnd : kxi −bik D, i = 1, 2, · · · , n}. 4.1 Distributed implementation In this section, we show how to implement the proposed algorithm to solve (16-17) in a distributed way. Let λt = [λT t,1, λT t,2, · · · , λT t,n] 2 Rnd, bλt = [bλT t,1, bλT t,2, · · · , bλT t,n] 2 Rnd be the vectors of Lagrange multipliers defined in Algorithm 1, where each λt,i, bλt,i 2 Rd. Then, each agent i 2 {1, 2, · · · , n} in the network is responsible for updating the corresponding Lagrange multipliers λt,i and bλt,i according to Algorithm 1, which has the initial values λ0,i = λ−1,i = eλi. Note that the first, third and fourth steps in Algorithm 1 are naturally separable regarding each agent. It remains to check if the second step can be implemented in a distributed way. Note that in the second step, we obtain the primal update x(bλt) = [x1(bλt)T , · · · , xn(bλt)T ] 2 Rnd by solving the following problem: x(bλt) = argmaxx:kxi−bikD, i=1,2,··· ,n − D bλt, Ax E − n X i=1 ⇣ kxi −bik + µ 2 kxi −exik2⌘ , 7 where exi 2 Rd is a fixed point in the feasible set. We separate the maximization according to different agent i 2 {1, 2, · · · , n}: xi(bλt) =argmaxxi:kxi−bikD − n X j=1 D bλt,j, Wjixi E −kxi −bik −µ 2 kxi −exik2. Note that according to the definition of Wji, it is equal to 0 if agent j is not the neighbor of agent i. More specifically, Let Ni be the set of neighbors of agent i (including the agent i itself), then, the above maximization problem can be equivalently written as argmaxxi:kxi−bikD − X j2Ni D bλt,j, Wjixi E −kxi −bik −µ 2 kxi −exik2 =argmaxxi:kxi−bikD − * X j2Ni Wjibλt,j, xi + −kxi −bik −µ 2 kxi −exik2 i 2 {1, 2, · · · , n}, where we used the fact that WT ji = Wji. Solving this problem only requires the local information from each agent. Completing the squares gives xi(bλt) = argmaxkxi−bikD −µ 2 (((((( xi − 0 @exi −1 µ X j2Ni Wjibλt,j 1 A (((((( 2 −kxi −bik. (18) The solution to such a subproblem has a closed form, as is shown in the following lemma (the proof is given in Supplement 6.4): Lemma 4.1. Let ai = exi −1 µ P j2Ni Wjibλt,j, then, the solution to (18) has the following closed form: xi(bλt) = 8 > < > : bi, if kbi −aik 1/µ, bi − bi−ai kbi−aik ⇣ kbi −aik −1 µ ⌘ , if 1 µ < kbi −aik 1 µ + D, bi − bi−ai kbi−aikD, otherwise. 4.2 Local error bound condition The proof of the this theorem is given in Supplement 6.5. Theorem 4.1. The Lagrange dual function of (16-17) is non-smooth and given by the following F(λ) = − ⌦ AT λ, b ↵ + D n X i=1 (kAT [i]λk −1) · I ⇣ kAT [i]λk > 1 ⌘ , where A[i] = [W1i W2i · · · Wni]T is the i-th column block of the matrix A, I ⇣ kAT [i]λk > 1 ⌘ is the indicator function which takes 1 if kAT [i]λk > 1 and 0 otherwise. Let ⇤⇤be the set of optimal Lagrange multipliers defined according to (8). Suppose D ≥2n · maxi,j2V kbi −bjk, then, for any δ > 0, there exists a Cδ > 0 such that dist(λ, ⇤⇤) Cδ(F(λ) −F ⇤)1/2, 8λ 2 Sδ. Furthermore, there exists a unique vector ⌫⇤2 Rnd s.t. PAλ⇤= ⌫⇤, 8λ⇤2 ⇤⇤, i.e. Assumption 2.1(d) holds. Thus, applying the proposed method gives the convergence time O 6 "−4/5 log2("−1) 7 . 5 Simulation Experiments In this section, we conduct simulation experiments on the distributed geometric median problem. Each vector bi 2 R100, i 2 {1, 2, · · · , n} is sampled from the uniform distribution in [0, 10]100, i.e. each entry of bi is independently sampled from uniform distribution on [0, 10]. We compare our algorithm with DSM (Nedic and Ozdaglar (2009)), P-EXTRA (Shi et al. (2015)), Jacobian parallel ADMM (Deng et al. (2017)) and Smoothing (Necoara and Suykens (2008)) under different network 8 sizes (n = 20, 50, 100). Each network is randomly generated with a particular connectivity ratio7, and the mixing matrix is chosen to be the Metropolis-Hastings Chain (Boyd et al. (2004)), which can be computed in a distributed manner. We use the relative error as the performance metric, which is defined as kxt −x⇤k/kx0 −x⇤k for each iteration t. The vector x0 2 Rnd is the initial primal variable. The vector x⇤2 Rnd is the optimal solution computed by CVX Grant et al. (2008). For our proposed algorithm, xt is the restarted primal average up to the current iteration. For all other algorithms, xt is the primal average up to the current iteration. The results are shown below. We see in all cases, our proposed algorithm is much better than, if not comparable to, other algorithms. For detailed simulation setups and additional simulation results, see Supplement 6.6. 0 1 2 3 4 5 6 7 8 9 10 Number of iterations ×104 -5 -4.5 -4 -3.5 -3 -2.5 -2 -1.5 -1 -0.5 0 Relative error DSM EXTRA Jacobian-ADMM Smoothing Proposed algorithm (a) 0 1 2 3 4 5 6 7 8 9 10 Number of iterations ×104 -5 -4.5 -4 -3.5 -3 -2.5 -2 -1.5 -1 -0.5 0 Relative error DSM EXTRA Jacobian-ADMM Smoothing Proposed algorithm (b) 0 1 2 3 4 5 6 7 8 9 10 Number of iterations ×104 -6 -5 -4 -3 -2 -1 0 Relative error DSM EXTRA Jacobian-ADMM Smoothing Proposed algorithm (c) Figure 1: Comparison of different algorithms on networks of different sizes. (a) n = 20, connectivity ratio=0.15. (b) n = 50, connectivity ratio=0.13. (c) n = 100, connectivity ratio=0.1. Acknowledgments The authors thank Stanislav Minsker and Jason D. Lee for helpful discussions related to the geometric median problem. Qing Ling’s research is supported in part by the National Science Foundation China under Grant 61573331 and Guangdong IIET Grant 2017ZT07X355. Qing Ling is also affiliated with Guangdong Province Key Laboratory of Computational Science. Michael J. Neely’s research is supported in part by the National Science Foundation under Grant CCF-1718477. References Beck, A., A. Nedic, A. Ozdaglar, and M. Teboulle (2014). An o(1/k) gradient method for network resource allocation problems. IEEE Transactions on Control of Network Systems 1(1), 64–73. Bertsekas, D. P. (1999). Nonlinear programming. Athena Scientific Belmont. Bertsekas, D. P. (2009). Convex optimization theory. Athena Scientific Belmont. Boyd, S., P. Diaconis, and L. Xiao (2004). Fastest mixing markov chain on a graph. SIAM Review 46(4), 667–689. Burke, J. V. and P. Tseng (1996). A unified analysis of Hoffman’s bound via Fenchel duality. SIAM Journal on Optimization 6(2), 265–282. Cohen, M. B., Y. T. Lee, G. Miller, J. Pachocki, and A. Sidford (2016). Geometric median in nearly linear time. In Proceedings of the forty-eighth annual ACM symposium on Theory of Computing, pp. 9–21. Deng, W., M.-J. Lai, Z. Peng, and W. Yin (2017). Parallel multi-block ADMM with o(1/k) convergence. Journal of Scientific Computing 71(2), 712–736. Deng, W. and W. Yin (2016). On the global and linear convergence of the generalized alternating direction method of multipliers. Journal of Scientific Computing 66(3), 889–916. Duchi, J. C., M. I. Jordan, M. J. Wainwright, and Y. Zhang (2014). Optimality guarantees for distributed statistical estimation. arXiv preprint arXiv:1405.0782. Gidel, G., F. Pedregosa, and S. Lacoste-Julien (2018). Frank-Wolfe splitting via augmented Lagrangian method. arXiv preprint arXiv:1804.03176. Grant, M., S. Boyd, and Y. Ye (2008). CVX: Matlab software for disciplined convex programming. 7The connectivity ratio is defined as the number of edges divided by the total number of possible edges n(n + 1)/2. 9 Han, D., D. Sun, and L. Zhang (2015). Linear rate convergence of the alternating direction method of multipliers for convex composite quadratic and semi-definite programming. arXiv preprint arXiv:1508.02134. Lan, G. and R. D. Monteiro (2013). Iteration-complexity of first-order penalty methods for convex programming. Mathematical Programming 138(1-2), 115–139. Li, J., G. Chen, Z. Dong, and Z. Wu (2016). A fast dual proximal-gradient method for separable convex optimization with linear coupled constraints. Computational Optimization and Applications 64(3), 671–697. Ling, Q. and Z. Tian (2010). Decentralized sparse signal recovery for compressive sleeping wireless sensor networks. IEEE Transactions on Signal Processing 58(7), 3816–3827. Luo, X.-D. and Z.-Q. Luo (1994). Extension of hoffman’s error bound to polynomial systems. SIAM Journal on Optimization 4(2), 383–392. Minsker, S., S. Srivastava, L. Lin, and D. B. Dunson (2014). Robust and scalable bayes via a median of subset posterior measures. arXiv preprint arXiv:1403.2660. Minsker, S. and N. Strawn (2017). Distributed statistical estimation and rates of convergence in normal approximation. arXiv preprint arXiv:1704.02658. Motzkin, T. (1952). Contributions to the theory of linear inequalities. D.R. Fulkerson (Transl.) (Santa Monica: RAND Corporation). RAND Corporation Translation 22. Necoara, I. and J. A. Suykens (2008). Application of a smoothing technique to decomposition in convex optimization. IEEE Transactions on Automatic control 53(11), 2674–2679. Nedic, A. and A. Ozdaglar (2009). Distributed subgradient methods for multi-agent optimization. IEEE Transactions on Automatic Control 54(1), 48–61. Nesterov, Y. (2005). Smooth minimization of non-smooth functions. Mathematical Programming 103(1), 127–152. Nesterov, Y. (2015a). Complexity bounds for primal-dual methods minimizing the model of objective function. Mathematical Programming, 1–20. Nesterov, Y. (2015b). Universal gradient methods for convex optimization problems. Mathematical Programming 152(1-2), 381–404. Osborne, M. R., B. Presnell, and B. A. Turlach (2000). A new approach to variable selection in least squares problems. IMA Journal of Numerical Analysis 20(3), 389–403. Pang, J.-S. (1997, Oct). Error bounds in mathematical programming. Mathematical Programming 79(1), 299–332. Parrilo, P. A. and B. Sturmfels (2003). Minimizing polynomial functions. Algorithmic and quantitative real algebraic geometry, DIMACS Series in Discrete Mathematics and Theoretical Computer Science 60, 83–99. Shi, W., Q. Ling, G. Wu, and W. Yin (2015). A proximal gradient algorithm for decentralized composite optimization. IEEE Transactions on Signal Processing 63(22), 6013–6023. Shi, W., Q. Ling, K. Yuan, G. Wu, and W. Yin (2014). On the linear convergence of the admm in decentralized consensus optimization. IEEE Trans. Signal Processing 62(7), 1750–1761. Tran-Dinh, Q., O. Fercoq, and V. Cevher (2018). A smooth primal-dual optimization framework for nonsmooth composite convex minimization. SIAM Journal on Optimization 28(1), 96–134. Tseng, P. (2010). Approximation accuracy, gradient methods, and error bound for structured convex optimization. Mathematical Programming 125(2), 263–295. Wang, T. and J.-S. Pang (1994). Global error bounds for convex quadratic inequality systems. Optimization 31(1), 1–12. Wei, X. and M. J. Neely (2018). Primal-dual Frank-Wolfe for constrained stochastic programs with convex and non-convex objectives. arXiv preprint arXiv:1806.00709. Wei, X., H. Yu, and M. J. Neely (2015). A probabilistic sample path convergence time analysis of drift-plus-penalty algorithm for stochastic optimization. arXiv preprint arXiv:1510.02973. Weiszfeld, E. and F. Plastria (2009). On the point for which the sum of the distances to n given points is minimum. Annals of Operations Research 167(1), 7–41. Xiao, L. and T. Zhang (2013). A proximal-gradient homotopy method for the sparse least-squares problem. SIAM Journal on Optimization 23(2), 1062–1091. 10 Xu, Y., M. Liu, Q. Lin, and T. Yang (2017). ADMM without a fixed penalty parameter: Faster convergence with new adaptive penalization. In Advances in Neural Information Processing Systems, pp. 1267–1277. Xu, Y., Y. Yan, Q. Lin, and T. Yang (2016). Homotopy smoothing for non-smooth problems with lower complexity than o(1/✏). In Advances In Neural Information Processing Systems, pp. 1208–1216. Xue, G. and Y. Ye (1997). An efficient algorithm for minimizing a sum of euclidean norms with applications. SIAM Journal on Optimization 7(4), 1017–1036. Yang, T. and Q. Lin (2015). Rsg: Beating subgradient method without smoothness and strong convexity. arXiv preprint arXiv:1512.03107. Yin, D., Y. Chen, K. Ramchandran, and P. Bartlett (2018). Byzantine-robust distributed learning: Towards optimal statistical rates. arXiv preprint arXiv:1803.01498. Yu, H. and M. J. Neely (2017a). A new backpressure algorithm for joint rate control and routing with vanishing utility optimality gaps and finite queue lengths. In INFOCOM 2017-IEEE Conference on Computer Communications, IEEE, pp. 1–9. IEEE. Yu, H. and M. J. Neely (2017b). A simple parallel algorithm with an o(1/t) convergence rate for general convex programs. SIAM Journal on Optimization 27(2), 759–783. Yu, H. and M. J. Neely (2018). On the convergence time of dual subgradient methods for strongly convex programs. IEEE Transactions on Automatic Control. Yuan, K., Q. Ling, and W. Yin (2016). On the convergence of decentralized gradient descent. SIAM Journal on Optimization 26(3), 1835–1854. Yurtsever, A., Q. T. Dinh, and V. Cevher (2015). A universal primal-dual convex optimization framework. In Advances in Neural Information Processing Systems, pp. 3150–3158. Yurtsever, A., O. Fercoq, F. Locatello, and V. Cevher (2018). A conditional gradient framework for composite convex minimization with applications to semidefinite programming. arXiv preprint arXiv:1804.08544. 11
2018
137
7,294
Unsupervised Cross-Modal Alignment of Speech and Text Embedding Spaces Yu-An Chung, Wei-Hung Weng, Schrasing Tong, and James Glass Computer Science and Artificial Intelligence Laboratory Massachusetts Institute of Technology Cambridge, MA 02139, USA {andyyuan,ckbjimmy,st9,glass}@mit.edu Abstract Recent research has shown that word embedding spaces learned from text corpora of different languages can be aligned without any parallel data supervision. Inspired by the success in unsupervised cross-lingual word embeddings, in this paper we target learning a cross-modal alignment between the embedding spaces of speech and text learned from corpora of their respective modalities in an unsupervised fashion. The proposed framework learns the individual speech and text embedding spaces, and attempts to align the two spaces via adversarial training, followed by a refinement procedure. We show how our framework could be used to perform spoken word classification and translation, and the experimental results on these two tasks demonstrate that the performance of our unsupervised alignment approach is comparable to its supervised counterpart. Our framework is especially useful for developing automatic speech recognition (ASR) and speech-to-text translation systems for low- or zero-resource languages, which have little parallel audio-text data for training modern supervised ASR and speech-to-text translation models, but account for the majority of the languages spoken across the world. 1 Introduction Word embeddings—continuous-valued vector representations of words—are almost ubiquitous in recent natural language processing research. Most successful methods for learning word embeddings [1, 2, 3] rely on the distributional hypothesis [4], i.e., words occurring in similar contexts tend to have similar meanings. Exploiting word co-occurrence statistics in a text corpus leads to word vectors that reflect semantic similarities and dissimilarities: similar words are geometrically close in the embedding space, and conversely, dissimilar words are far apart. Continuous word embedding spaces have been shown to exhibit similar structures across languages [5]. The intuition is that most languages share similar expressive power and are used to describe similar human experiences across cultures; hence, they should share similar statistical properties. Inspired by the notion, several studies have focused on designing algorithms that exploit this similarity to learn a cross-lingual alignment between the embedding spaces of two languages, where the two embedding spaces are trained from independent text corpora [6, 7, 8, 9, 10, 11, 12]. In particular, recent research has shown that such cross-lingual alignments can be learned without relying on any form of bilingual supervision [13, 14, 15], and has been applied to training neural machine translation (NMT) systems in a completely unsupervised fashion [16, 17]. This eliminates the need for a large parallel training corpus to train NMT systems. Speech, as another form of language, is rarely considered as a source for learning semantics, compared to text. Although there is work that explores the concept of learning vector representations from 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. speech [18, 19, 20, 21, 22, 23], they are primarily based on acoustic-phonetic similarity, and aim to represent the way a word sounds rather than its meaning. Recently, the Speech2Vec [24] model was developed to be capable of representing audio segments excised from a speech corpus as fixed dimensional vectors that contain semantic information of the underlying spoken words. The design of Speech2Vec is based on a Recurrent Neural Network (RNN) Encoder-Decoder framework [25, 26], and borrows the methodology of Skip-grams or continuous bag-of-words (CBOW) from Word2Vec [1] for training. Since Speech2Vec and Word2Vec share the same training methodology and speech and text are similar media for communicating, the two embedding spaces learned respectively by Speech2Vec from speech and Word2Vec from text are expected to exhibit similar structure. Motivated by the recent success in unsupervised cross-lingual alignment [13, 15, 14] and the assumption that the embedding spaces of the two modalities (speech and text) share similar structure, we are interested in learning an unsupervised cross-modal alignment between the two spaces. Such an alignment would be useful for developing automatic speech recognition (ASR) and speech-to-text translation systems for low- or zero-resource languages that lack parallel corpora of speech and text for training. In this paper, we propose a framework for unsupervised cross-modal alignment, borrowing the methodology from unsupervised cross-lingual alignment presented in [14]. The framework consists of two steps. First, it uses Speech2Vec [24] and Word2Vec [1] to learn the individual embedding spaces of speech and text. Next, it leverages adversarial training to learn a linear mapping from the speech embedding space to the text embedding space, followed by a refinement procedure. The paper is organized as follows. Section 2 describes how we obtain the speech embedding space in a completely unsupervised manner using Speech2Vec. Next, we present our unsupervised cross-modal alignment approach in Section 3. In Section 4, we describe the tasks of spoken word classification and translation, which are similar to ASR and speech-to-text translation, respectively, except that now the input are audio segments corresponding to words. We then evaluate the performance of our unsupervised alignment on the two tasks and analyze our results in Section 5. Finally, we conclude and point out some interesting future work possibilities in Section 6. To the best of our knowledge, this is the first work that achieves fully unsupervised spoken word classification and translation. 2 Unsupervised Learning of the Speech Embedding Space Recently, there is an increasing interest in learning the semantics of a language directly, and only from raw speech [24, 27, 28]. Assuming utterances in a speech corpus are already pre-segmented into audio segments corresponding to words using word boundaries obtained by forced alignment, existing approaches aim to represent each audio segment as a fixed dimensional embedding vector, with the hope that the embedding is able to capture the semantic information of the underlying spoken word. However, some supervision leaks into the learning process through the use of forced alignment, rendering the approaches not fully unsupervised. In this paper, we use Speech2Vec [24], a recently proposed deep neural network architecture that has been shown capable of capturing the semantics of spoken words from raw speech, for learning the speech embedding space. To eliminate the need of forced alignment, we propose a simple pipeline for training Speech2Vec in a totally unsupervised manner. We briefly review Speech2Vec in Section 2.1, and introduce the unsupervised pipeline in Section 2.2. 2.1 Speech2Vec In text, a Word2Vec [1] model is a shallow, two-layer fully-connected neural network that is trained to reconstruct the contexts of words. There are two methodologies for training Word2Vec: Skip-grams and CBOW. The objective of Skip-grams is for each word w(n) in a text corpus, the model is trained to maximize the probability of words {w(n−k), . . . , w(n−1), w(n+1), . . . , w(n+k)} within a window of size k given w(n). The objective of CBOW, on the other hand, aims to infer the current word w(n) from its nearby words {w(n−k), . . . , w(n−1), w(n+1), . . . , w(n+k)}. Speech2Vec [24], inspired by Word2Vec, borrows the methodology of Skip-grams or CBOW for training. Unlike text, where words are represented by one-hot vectors as input and output for training Word2Vec, an audio segment is represented by a variable-length sequence of acoustic 2 features, x = (x1, x2, . . . , xT ), where xt is the acoustic feature such as Mel-Frequency Cepstral Coefficients at time t, and T is the length of the sequence. In order to handle variable-length input and output sequences of acoustic features, Speech2Vec replaces the two fully-connected layers in the Word2Vec model with a pair of RNNs, one as an Encoder and the other as a Decoder [25, 26]. When training Speech2Vec with Skip-grams, the Encoder RNN takes the audio segment (corresponding to the current word) as input and encodes it into a fixed dimensional embedding z(n) that represents the entire input sequence x(n). Subsequently, the Decoder RNN aims to reconstruct the audio segments {x(n−k), . . . , x(n−1), x(n+1), . . . , x(n+k)} (corresponding to nearby words) within a window of size k from z(n). Similar to the concept of training Word2Vec with Skip-grams, the intuition behind this methodology is that, in order to successfully decode nearby audio segments, the encoded embedding z(n) should contain sufficient semantic information of the current audio segment x(n). In contrast to training Speech2Vec with Skip-grams that aims to predict nearby audio segments from z(n), training Speech2Vec with CBOW sets x(n) as the target and aims to infer it from nearby audio segments. By using the same training methodology (Skip-grams or CBOW) as Word2Vec, it is reasonable to assume that the embedding space learned by Speech2Vec from speech exhibits similar structure to that learned by Word2Vec from text. After training the Speech2Vec model, each audio segment is transformed into an embedding vector that contains the semantic information of the underlying word. In a Word2Vec model, the embedding for a particular word is deterministic, which means that every instance of the same word will be represented by one, and only one, embedding vector. In contrast, for audio segments every instance of a spoken word is different (due to speaker, channel, and other contextual differences, etc.), so every instance of the same underlying word is represented by a different (though hopefully similar) embedding vector. Embedding vectors of the same spoken words can be averaged to obtain a single word embedding based on the identity of each audio segment, as is done in [24]. 2.2 Unsupervised Speech2Vec Speech2Vec and Word2Vec learn the semantics of words by making use of the co-occurrence information in their respective modalities, and are both intrinsically unsupervised. However, unlike text where the content can be easily segmented into word-like units, speech has a continuous form by nature, making the word boundaries challenging to locate. All utterances in the speech corpus are assumed to be perfectly segmented into audio segments based on the word boundaries obtained by forced alignment with respect to the reference transcriptions [24]. Such an assumption, however, makes the process of learning word embeddings from speech not truly unsupervised. Unsupervised speech segmentation is a core problem in zero-resource speech processing in the absence of transcriptions, lexicons, or language modeling text. Early work mainly focused on unsupervised term discovery, where the aim is to find word- or phrase-like patterns in a collection of speech [29, 30]. While useful, the discovered patterns are typically isolated segments spread out over the data, leaving much speech as background. This has prompted several studies on full-coverage approaches, where the entire speech input is segmented into word-like units [31, 32, 33, 34]. In this paper, we use an off-the-shelf, full-coverage, unsupervised segmentation system for segmenting our data into word-like units. Three representative systems are explored in this paper. The first one, referred to as Bayesian embedded segmental Gaussian mixture model (BES-GMM) [35], is a probabilistic model that represents potential word segments as fixed-dimensional acoustic word embeddings [23], and builds a whole-word acoustic model in this embedding space while jointly doing segmentation. The second one, called embedded segmental K-means model (ES-KMeans) [36], is an approximation to BES-GMM that uses hard clustering and segmentation, rather than full Bayesian inference. The third one is the recurring syllable-unit segmenter called SylSeg [37], a fast and heuristic method that applies unsupervised syllable segmentation and clustering, to predict recurring syllable sequences as words. After training the Speech2Vec model using the audio segments obtained by an unsupervised segmentation method, each audio segment is then transformed into an embedding that contains the semantic information about the segment. Since we do not know the identity of the embeddings, we use the k-means algorithm to cluster them into K clusters, potentially corresponding to K different word types. We then average all embeddings that belong to the same cluster (potentially the instances of 3 the same underlying word) to obtain a single embedding. Note that by doing so, it is possible that we group the embeddings corresponding to different words that are semantically similar into one cluster. 3 Unsupervised Alignment of Speech and Text Embedding Spaces Suppose we have speech and text embedding spaces trained on independent speech and text corpora. Our goal is to learn a mapping, without using any form of cross-modal supervision, between them such that the two spaces are aligned. Let S = {s1, s2, . . . , sm} ⊆Rd1 and T = {t1, t2, . . . , tn} ⊆Rd2 be two sets of m and n word embeddings of dimensionality d1 and d2 from the speech and text embedding spaces, respectively. Ideally, if we have a known dictionary that specifies which si ∈S corresponds to which tj ∈T , we can learn a linear mapping W between the two embedding spaces such that W ∗= argmin W ∈Rd2×d1 ∥WX −Y ∥2, (1) where X and Y are two aligned matrices of size d1 × k and d2 × k formed by k word embeddings selected from S and T , respectively. At test time, the transformation result of any audio segment a in the speech domain can be defined as argmaxtj∈T cos(Wsa, tj). In this paper, we show how to learn this mapping W without using any cross-modal supervision. The proposed framework, inspired by [14], consists of two steps: domain-adversarial training for learning an initial proxy of W, followed by a refinement procedure which uses the words that match the best to create a synthetic parallel dictionary for applying Equation 1. 3.1 Domain-Adversarial Training The intuition behind this step is to make the mapped S and T indistinguishable. We define a discriminator, whose goal is to discriminate between elements randomly sampled from WS = {Ws1, Ws2, . . . , Wsm} and T . The mapping W, which can be viewed as the generator, is trained to prevent the discriminator from making accurate predictions. This is a two-player game, where the discriminator aims at maximizing its ability to identify the origin of an embedding, and W aims at preventing the discriminator from doing so by making WS and T as similar as possible. Given the mapping W, the discriminator, parameterized by θD, is optimized by minimizing the following objective function: LD(θD|W) = −1 m m X i=1 log PθD(speech = 1|Wsi) −1 n n X j=1 log PθD(speech = 0|tj), (2) where PθD(speech = 1|v) is the probability that vector v originates from the speech embedding space (as opposed to an embedding from the text embedding space). Given the discriminator, the mapping W aims to fool the discriminator’s ability to accurately predict the original domain of the embeddings by minimizing the following objective function: LW (W|θD) = −1 m m X i=1 log PθD(speech = 0|Wsi) −1 n n X j=1 log PθD(speech = 1|tj) (3) The discriminator θD and the mapping W are optimized iteratively to respectively minimize LD and LW following the standard training procedure of adversarial networks [38]. 3.2 Refinement Procedure The domain-adversarial training step learns a rotation matrix W that aligns the speech and text embedding spaces. To further improve the alignment, we use the W learned in the domain-adversarial training step as an initial proxy and build a synthetic parallel dictionary that specifies which si ∈S corresponds to which tj ∈T . To ensure a high-quality dictionary, we consider the most frequent words from S and T , since more frequent words are expected to have better quality of embedding vectors, and only retain their mutual nearest neighbors. For deciding mutual nearest neighbors, we use the Cross-Domain Similarity Local Scaling proposed in [14] to mitigate the so-called hubness problem [39] (points tending to be nearest neighbors of many points in high-dimensional spaces). Subsequently, we apply Equation 1 on this generated dictionary to refine W. 4 4 Spoken Word Classification and Translation Conventional hybrid ASR systems [40] and recent end-to-end ASR models [41, 42, 43, 44] rely on a large amount of parallel audio-text data for training. However, most languages spoken across the world lack parallel data, so it is no surprise that only very few languages support ASR. It is the same story for speech-to-text translation [45], which typically pipelines ASR and machine translation, and could be even more challenging to develop as it requires both components to be well trained. Compared to parallel audio-text data, the cost of accumulating independent corpora of speech and text is significantly lower. With our unsupervised cross-modal alignment approach, it becomes feasible to build ASR and speech-to-text translation systems using independent corpora of speech and text only, a setting suitable for low- or zero-resource languages. Since a cross-modal alignment is learned to link the word embedding spaces of speech and text, we perform the tasks of spoken word classification and translation to directly evaluate the effectiveness of the alignment. The two tasks are similar to standard ASR and speech-to-text translation, respectively, except that now the input is an audio segment corresponding to a word. 4.1 Spoken Word Classification The goal of this task is to recognize the underlying spoken word of an input audio segment. Suppose we have two independent corpora of speech and text that belong to the same language. The speech and text embedding spaces, denoted by S and T , can be obtained by training Speech2Vec and Word2Vec on the respective corpus. The alignment W between S and T can be learned in an either supervised or unsupervised way. At test time, given an input audio segment, it is first transformed into an embedding vector s in the speech embedding space S by Speech2Vec. The vector s is then mapped to the text embedding space as ts = Ws ∈T . In T , the word that has embedding vector t∗= argmaxt∈T cos(t, ts) closest to ts will be taken as the classification result. The performance is measured by accuracy. 4.2 Spoken Word Translation This task is similar to the one in the text domain that considers the problem of retrieving the translation of given source words, except that the source words are in the form of audio segments. Spoken word translation can be performed in the exact same way as spoken word classification, but the speech and text corpora belong to different languages. At test time, we follow the standard practice of word translation and measure how many times one of the correct translations (in text) of the input audio segment is retrieved, and report precision@ k for k = 1 and 5. We use the bilingual dictionaries provided by [14] to obtain the correct translations of a given source word. 5 Experiments In this section, we empirically demonstrate the effectiveness of our unsupervised cross-modal alignment approach on spoken word classification and translation introduced in Section 4. 5.1 Datasets Table 1: The detailed statistics of the corpora. Corpus Train Test Words Segments English LibriSpeech 420 hr 50 hr 37K 468K French LibriSpeech 200 hr 30 hr 26K 260K English SWC 355 hr 40 hr 25K 284K German SWC 346 hr 40 hr 31K 223K For our experiments, we used English and French LibriSpeech [46, 47], and English and German Spoken Wikipedia Corpora (SWC) [48]. All corpora are read speech, and come with a collection of utterances and the corresponding transcriptions. For convenience, we denote the speech and text data of a corpus in uppercase and lowercase, respectively. For example, ENswc and enswc represent the speech and text data, respectively, of English SWC. In Table 1, column Train is the size of the speech data used for training the speech embeddings; column Test is the size of the speech data used for testing, where the corresponding number of audio segments (i.e., spoken 5 word tokens) is specified in column Segments; column Words provides the number of distinct words in that corpus. Train and test sets are split in a way so that there are no overlapping speakers. 5.2 Details of Training and Model Architectures The speech embeddings were trained using Speech2Vec with Skip-grams by setting the window size k to three. The Encoder is a single-layer bidirectional LSTM, and the Decoder is a single-layer unidirectional LSTM. The model was trained by stochastic gradient descent (SGD) with a fixed learning rate of 10−3. The text embeddings were obtained by training Word2Vec on the transcriptions using the fastText implementation without subword information [3]. The dimension of both speech and text embeddings is 50.1 For the adversarial training, the discriminator was a two-layer neural network of size 512 with ReLU as the activation function. Both the discriminator and W were trained by SGD with a fixed learning rate of 10−3. For the refinement procedure, we used the default setting specified in [14].2 5.3 Comparing Methods Table 2: Different configurations for training Speech2Vec to obtain the speech embeddings with decreasing level of supervision. The last column specifies whether the configuration is unsupervised. Configuration Speech2Vec training Unsupervised How word segments were obtained How embeddings were grouped together A & A∗ Forced alignment Use word identity  B Forced alignment k-means  C BES-GMM [35] k-means  D ES-KMeans [36] k-means  E SylSeg [37] k-means  F Equally sized chunks k-means  Alignment-Based Approaches Given the speech and text embeddings, alignment-based approaches learn the alignment between them in an either supervised or unsupervised way; for an input audio segment, they perform spoken word classification and translation as described in Section 4. By varying how word segments were obtained before being fed to Speech2Vec and how the embeddings were grouped together, the level of supervision is gradually decreased towards a fully unsupervised configuration. In configuration A, the speech training data was segmented into words using forced alignment with respect to the reference transcription, and the embeddings of the same word were grouped together using their word identities. In configuration B, the word segments were also obtained by forced alignment, but the embeddings were grouped together by performing k-means clustering. In configurations C, D, and E, the speech training data was segmented into word-like units using different unsupervised segmentation algorithms described in Section 2.2. Configuration F serves as a baseline by naively segmenting the speech training data into equally sized chunks. Unlike configurations A and B, configurations C, D, E, and F did not require the reference transcriptions to do forced alignment and the embeddings were grouped together by performing k-means clustering, and are thus unsupervised. Configurations A to F all used our unsupervised alignment approach to align the speech and text embedding spaces. We also implemented configuration A∗, which trained Speech2Vec in the same way as configuration A, but learned the alignment using a parallel dictionary as cross-modal data supervision. The different configurations are summarized in Table 2. Word Classifier We established an upper bound by using the fully-supervised Word Classifier that was trained to map audio segments directly to their corresponding word identities. The Word Classifier was composed of a single-layer bidirectional LSTM with a softmax layer appended at the output of its last time step. This approach is specific to spoken word classification. 1We tried window size k ∈{1, 2, 3, 4, 5} and embedding dimension d ∈{50, 100, 200, 300} and found that the reported k and d yield the best performance 2We also tried multi-layer neural network to model W. However, we did not observe any improvement on our evaluation tasks when using it compared to a linear W. This discovery aligns with [5]. 6 Majority Word Baseline For both spoken word classification and translation tasks, we implemented a straightforward baseline dubbed Major-Word, where for classification, it always predicts the most frequent word, and for translation, it always predicts the most commonly paired word. Results of the Major-Word offer us insight into the word distribution of the test set. 5.4 Results and Discussion Table 3: Accuracy on spoken word classification. ENls −enswc means that the speech and text embeddings were learned from the speech training data of English LibriSpeech and text training data of English SWC, respectively, and the testing audio segments came from English LibriSpeech. The same rule applies to Table 5 and Table 6. For the Word Classifier, ENls −enswc and ENswc −enls could not be obtained since it requires parallel audio-text data for training. Corpora ENls −enls FRls −frls ENswc −enswc DEswc −deswc ENls −enswc ENswc −enls Nonalignment-based approach Word Classifier 89.3 83.6 86.9 80.4 – – Alignment-based approach with cross-modal supervision (parallel dictionary) A∗ 25.4 27.1 29.1 26.9 21.8 23.9 Alignment-based approaches without cross-modal supervision (our approach) A 23.7 24.9 25.3 25.8 18.3 21.6 B 19.4 20.7 22.6 21.5 15.9 17.4 C 10.9 12.6 14.4 13.1 6.9 8.0 D 11.5 12.3 14.2 12.4 7.5 8.3 E 6.5 7.2 8.9 7.4 4.5 5.9 F 0.8 1.4 2.8 1.2 0.2 0.5 Majority Word Baseline Major-Word 0.3 0.2 0.3 0.4 0.3 0.3 Spoken Word Classification Table 3 presents our results on spoken word classification. We observe that the accuracy decreases as the level of supervision decreases, as expected. We also note that although the Word Classifier significantly outperforms all the other approaches under all corpora settings, the prerequisite for training such a fully-supervised approach is unrealistic—it requires the utterances to be perfectly segmented into audio segments corresponding to words with the word identity of each segment known. We emphasize that the Word Classifier is just used to establish an upper bound performance that gives us an idea on how good the classification results could be. For alignment-based approaches, configuration A∗achieves the highest accuracies under all corpora settings by using a parallel dictionary as cross-modal supervision for learning the alignment. However, we see that configuration A using our unsupervised alignment approach only suffers a slight decrease in performance, which demonstrates that our unsupervised alignment approach is almost as effective as it supervised counterpart A∗. As we move towards unsupervised methods (k-means clustering) for grouping embeddings, in configuration B, a decrease in performance is observed. The performance of using unsupervised segmentation algorithms is behind using exact word segments for training Speech2Vec, shown in configurations C, D, and E versus B. We hypothesize that word segmentation is a critical step, since incorrectly separated words lack a logical embedding, which in turn hinders the clustering process. The importance of proper segmentation is evident in configuration F as it performs the worst. The aforementioned analysis applies to different corpora settings. We also observe that the performance of the embeddings learned from different corpora is inferior to the ones learned from the same corpus (refer to columns 1 and 3, versus 5 and 6, in Table 3). We think this is because the embedding spaces learned from the same corpora (e.g., both embeddings were learned from LibriSpeech) exhibit higher similarity than those learned from different corpora, making the alignment more accurate. Spoken Word Synonyms Retrieval Word classification does not display the full potential of our alignment approach. In Table 4 we show a list of retrieved results of example input audio segments. The words were ranked according to the cosine similarity between their embeddings and that of the 7 audio segment mapped from the speech embedding space. We observe that the list actually contain both synonyms and different lexical forms of the audio segment. This provides an explanation of why the performance of alignment-based approaches on word classification is poor: the top ranked word may not match the underlying word of the input audio segment, and would be considered incorrect for word classification, despite that the top ranked word has high chance of being semantically similar to the underlying word. Table 4: Retrieved results of example audio segments that are considered incorrect in word classification. The match for each audio segment is marked in bold. Rank Input audio segments beautiful clever destroy suitcase 1 lovely cunning destroyed bags 2 pretty smart destroy suitcases 3 gorgeous clever annihilate luggage 4 beautiful crafty destroying briefcase 5 nice wisely destruct suitcase We define word synonyms retrieval to also consider synonyms as valid results, as opposed to the word classification. The synonyms were derived using another language as a pivot. Using the cross-lingual dictionaries provided by [14], we looked up the acceptable word translations, and for each of those translations, we took the union of their translations back to the original language. For example, in English, each word has 3.3 synonyms (excluding itself) on average. Table 5 shows the results of word synonyms retrieval. We see that our approach performs better at retrieving synonyms than classifying words, an evidence that the system is learning the semantics rather than the identities of words. This showcases the strength of our semantics-focused approach. Table 5: Results on spoken word synonyms retrieval. We measure how many times one of the synonyms of the input audio segment is retrieved, and report precision@k for k = 1, 5. Corpora ENls −enls FRls −frls ENswc −enswc DEswc −deswc ENls −enswc ENswc −enls Average P@k P@1 P@5 P@1 P@5 P@1 P@5 P@1 P@5 P@1 P@5 P@1 P@5 Alignment-based approach with cross-modal supervision (parallel dictionary) A∗ 52.6 66.9 46.6 69.4 47.4 62.5 49.2 63.7 41.3 54.2 39.0 49.4 Alignment-based approaches without cross-modal supervision (our approach) A 43.2 57.0 42.4 58.0 36.3 50.4 32.6 48.8 33.9 47.5 33.4 45.7 B 35.0 48.2 35.4 50.4 33.8 44.6 29.3 45.4 30.0 42.9 31.1 40.7 C 27.7 37.3 26.4 35.7 21.1 30.3 26.2 34.5 22.4 28.9 17.1 26.3 D 26.7 35.2 27.2 36.3 21.1 28.2 25.3 33.2 21.2 29.3 18.7 25.1 E 17.7 24.2 20.8 28.4 17.3 21.8 18.3 23.0 15.2 21.1 11.2 17.8 F 3.5 5.7 5.2 6.9 3.8 5.8 2.7 4.9 3.2 5.7 2.9 4.4 Spoken word translation Table 6 presents the results on spoken word translation. Similar to spoken word classification, configurations with more supervision yield better performance than those with less supervision. Furthermore, we observe that translating using the same corpus outperforms those using different corpora (refer to ENswc −deswc versus ENls −deswc). We attribute this to the higher structural similarity between the embedding spaces learned from the same corpora. 6 Conclusions In this paper, we propose a framework capable of aligning speech and text embedding spaces in an unsupervised manner. The method learns the alignment from independent corpora of speech and text, without requiring any cross-modal supervision, which is especially important for low- or zeroresource languages that lack parallel data with both audio and text. We demonstrate the effectiveness of our unsupervised alignment by showing comparable results to its supervised alignment counterpart 8 Table 6: Results on spoken word translation. We measure how many times one of the correct translations of the input audio segment is retrieved, and report precision@k for k = 1, 5. Corpora ENls −frls FRls −enls ENswc −deswc DEswc −enswc ENls −deswc FRls −deswc Average P@k P@1 P@5 P@1 P@5 P@1 P@5 P@1 P@5 P@1 P@5 P@1 P@5 Alignment-based approach with cross-modal supervision (parallel dictionary) A∗ 47.9 56.4 49.1 60.1 40.2 51.9 43.3 55.8 34.9 46.3 33.8 44.9 Alignment-based approaches without cross-modal supervision (our approach) A 40.5 50.3 39.9 50.9 32.8 43.8 33.1 43.4 31.9 42.2 30.1 42.1 B 36.0 44.9 35.5 44.5 27.9 38.3 30.9 40.9 26.6 35.3 25.4 38.2 C 24.7 35.4 23.9 37.3 22.0 30.3 20.5 29.1 19.2 26.1 14.8 23.1 D 25.4 33.1 24.4 34.6 23.5 29.1 20.7 31.3 20.8 25.9 14.5 22.4 E 15.4 20.6 16.7 19.9 14.1 15.9 16.6 17.0 14.8 16.7 9.7 11.8 F 4.3 5.6 6.9 7.5 4.9 6.5 5.3 6.6 4.2 5.9 1.8 2.6 Majority Word Baseline Major-Word 1.1 1.5 1.6 2.2 1.2 1.5 2.0 2.7 1.1 1.5 1.6 2.2 that uses full cross-modal supervision (A vs. A∗) on the tasks of spoken word classification and translation. Future work includes devising unsupervised speech segmentation approaches that produce more accurate word segments, an essential step to obtain high quality speech embeddings. We also plan to extend current spoken word classification and translation systems to perform standard ASR and speech-to-text translation, respectively. Acknowledgments The authors thank Hao Tang, Mandy Korpusik, and the MIT Spoken Language Systems Group for their helpful feedback and discussions. References [1] T. Mikolov, I. Sutskever, K. Chen, G. S. Corrado, and J. Dean, “Distributed representations of words and phrases and their compositionality,” in NIPS, 2013. [2] J. Pennington, R. Socher, and C. D. Manning, “GloVe: Global vectors for word representation,” in EMNLP, 2014. [3] P. Bojanowski, E. Grave, A. Joulin, and T. Mikolov, “Enriching word vectors with subword information,” Transactions of the Association for Computational Linguistics, vol. 5, pp. 135–146, 2017. [4] Z. S. Harris, “Distributional structure,” Word, vol. 10, no. 2-3, pp. 146–162, 1954. [5] T. Mikolov, Q. Le, and I. Sutskever, “Exploiting similarities among languages for machine translation,” arXiv preprint arXiv:1309.4168, 2013. [6] M. Faruqui and C. Dyer, “Improving vector space word representations using multilingual correlation,” in EACL, 2014. [7] C. Xing, D. Wang, C. Liu, and Y. Lin, “Normalized word embedding and orthogonal transform for bilingual word translation,” in NAACL HLT, 2015. [8] M. Artetxe, G. Labaka, and E. Agirre, “Learning principled bilingual mappings of word embeddings while preserving monolingual invariance,” in EMNLP, 2016. [9] S. L. Smith, D. Turban, S. Hamblin, and N. Hammerla, “Offline bilingual word vectors, orthogonal transformations and the inverted softmax,” in ICLR, 2016. [10] M. Artetxe, G. Labaka, and E. Agirre, “Learning bilingual word embeddings with (almost) no bilingual data,” in ACL, 2017. [11] H. Cao, T. Zhao, S. Zhang, and Y. Meng, “A distribution-based model to learn bilingual word embeddings,” in COLING, 2016. [12] L. Duong, H. Kanayama, T. Ma, S. Bird, and T. Cohn, “Learning crosslingual word embeddings without bilingual corpora,” in EMNLP, 2016. 9 [13] M. Zhang, Y. Liu, H. Luan, and M. Sun, “Adversarial training for unsupervised bilingual lexicon induction,” in ACL, 2017. [14] A. Conneau, G. Lample, M. Ranzato, L. Denoyer, and H. Jégou, “Word translation without parallel data,” in ICLR, 2018. [15] M. Zhang, Y. Liu, H. Luan, and M. Sun, “Earth mover’s distance minimization for unsupervised bilingual lexicon induction,” in EMNLP, 2017. [16] M. Artetxe, G. Labaka, E. Agirre, and K. Cho, “Unsupervised neural machine translation,” in ICLR, 2018. [17] G. Lample, L. Denoyer, and M. Ranzato, “Unsupervised machine translation using monolingual corpora only,” in ICLR, 2018. [18] W. He, W. Wang, and K. Livescu, “Multi-view recurrent neural acoustic word embeddings,” in ICLR, 2017. [19] S. Settle and K. Livescu, “Discriminative acoustic word embeddings: Recurrent neural networkbased approaches,” in SLT, 2016. [20] Y.-A. Chung, C.-C. Wu, C.-H. Shen, H.-Y. Lee, and L.-S. Lee, “Audio word2vec: Unsupervised learning of audio segment representations using sequence-to-sequence autoencoder,” in INTERSPEECH, 2016. [21] H. Kamper, W. Wang, and K. Livescu, “Deep convolutional acoustic word embeddings using word-pair side information,” in ICASSP, 2016. [22] S. Bengio and G. Heigold, “Word embeddings for speech recognition,” in INTERSPEECH, 2014. [23] K. Levin, K. Henry, A. Jansen, and K. Livescu, “Fixed-dimensional acoustic embeddings of variable-length segments in low-resource settings,” in ASRU, 2013. [24] Y.-A. Chung and J. Glass, “Speech2vec: A sequence-to-sequence framework for learning word embeddings from speech,” in INTERSPEECH, 2018. [25] I. Sutskever, O. Vinyals, and Q. Le, “Sequence to sequence learning with neural networks,” in NIPS, 2014. [26] K. Cho, B. van Merriënboer, Ç. Gülçehre, D. Bahdanau, F. Bougares, H. Schwenk, and Y. Bengio, “Learning phrase representations using RNN encoder-decoder for statistical machine translation,” in EMNLP, 2014. [27] Y.-C. Chen, C.-H. Shen, S.-F. Huang, and H.-Y. Lee, “Towards unsupervised automatic speech recognition trained by unaligned speech and text only,” arXiv preprint arXiv:1803.10952, 2018. [28] Y.-A. Chung and J. Glass, “Learning word embeddings from speech,” in NIPS ML4Audio Workshop, 2017. [29] A. Park and J. Glass, “Unsupervised pattern discovery in speech,” IEEE Transactions on Audio, Speech, and Language Processing, vol. 16, no. 1, pp. 186–197, 2008. [30] A. Jansen and B. Van Durme, “Efficient spoken term discovery using randomized algorithms,” in ASRU, 2011. [31] H. Kamper, A. Jansen, and S. Goldwater, “Unsupervised word segmentation and lexicon discovery using acoustic word embeddings,” IEEE Transactions on Audio, Speech, and Language Processing, vol. 24, no. 4, pp. 669–679, 2016. [32] C.-Y. Lee, T. J. O’Donnell, and J. Glass, “Unsupervised lexicon discovery from acoustic input,” Transactions of the Association for Computational Linguistics, vol. 3, pp. 389–403, 2015. [33] M. Sun and H. Van hamme, “Joint training of non-negative tucker decomposition and discrete density hidden markov models,” Computer Speech and Language, vol. 27, no. 4, pp. 969–988, 2013. [34] O. Walter, T. Korthals, R. Haeb-Umbach, and B. Raj, “A hierarchical system for word discovery exploiting dtw-based initialization,” in ASRU, 2013. [35] H. Kamper, A. Jansen, and S. Goldwater, “A segmental framework for fully-unsupervised large-vocabulary speech recognition,” Computer Speech and Language, vol. 46, pp. 154–174, 2017. 10 [36] H. Kamper, K. Livescu, and S. Goldwater, “An embedded segmental k-means model for unsupervised segmentation and clustering of speech,” in ASRU, 2017. [37] O. Räsänen, G. Doyle, and M. C. Frank, “Unsupervised word discovery from speech using automatic segmentation into syllable-like units,” in INTERSPEECH, 2015. [38] 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. [39] G. Dinu, A. Lazaridou, and M. Baroni, “Improving zero-shot learning by mitigating the hubness problem,” in ICLR Workshop Track, 2015. [40] A. Graves, A.-r. Mohamed, and G. Hinton, “Speech recognition with deep recurrent neural networks,” in ICASSP, 2013. [41] A. Graves and N. Jaitly, “Towards end-to-end speech recognition with recurrent neural networks,” in ICML, 2014. [42] J. K. Chorowski, D. Bahdanau, D. Serdyuk, K. Cho, and Y. Bengio, “Attention-based models for speech recognition,” in NIPS, 2015. [43] W. Chan, N. Jaitly, Q. Le, and O. Vinyals, “Listen, attend and spell: A neural network for large vocabulary conversational speech recognition,” in ICASSP, 2016. [44] D. Amodei, S. Ananthanarayanan, R. Anubhai, J. Bai, E. Battenberg, C. Case, J. Casper, B. Catanzaro, Q. Cheng, G. Chen et al., “Deep speech 2: End-to-end speech recognition in english and mandarin,” in ICML, 2016. [45] A. Waibel and C. Fugen, “Spoken language translation,” IEEE Signal Processing Magazine, vol. 3, no. 25, pp. 70–79, 2008. [46] V. Panayotov, G. Chen, D. Povey, and S. Khudanpur, “LibriSpeech: An ASR corpus based on public domain audio books,” in ICASSP, 2015. [47] A. Kocabiyikoglu, L. Besacier, and O. Kraif, “Augmenting Librispeech with French translations: A multimodal corpus for direct speech translation evaluation,” in LREC, 2018. [48] A. Köhn, F. Stegen, and T. Baumann, “Mining the spoken wikipedia for speech data and beyond,” in LREC, 2016. 11
2018
138
7,295
Isolating Sources of Disentanglement in VAEs Ricky T. Q. Chen, Xuechen Li, Roger Grosse, David Duvenaud University of Toronto, Vector Institute         Abstract We decompose the evidence lower bound to show the existence of a term measuring the total correlation between latent variables. We use this to motivate the β-TCVAE (Total Correlation Variational Autoencoder) algorithm, a refinement and plug-in replacement of the β-VAE for learning disentangled representations, requiring no additional hyperparameters during training. We further propose a principled classifier-free measure of disentanglement called the mutual information gap (MIG). We perform extensive quantitative and qualitative experiments, in both restricted and non-restricted settings, and show a strong relation between total correlation and disentanglement, when the model is trained using our framework. 1 Introduction Learning disentangled representations without supervision is a difficult open problem. Disentangled variables are generally considered to contain interpretable semantic information and reflect separate factors of variation in the data. While the definition of disentanglement is open to debate, many believe a factorial representation, one with statistically independent variables, is a good starting point [1, 2, 3]. Such representations distill information into a compact form which is oftentimes semantically meaningful and useful for a variety of tasks [2, 4]. For instance, it is found that such representations are more generalizable and robust against adversarial attacks [5]. Many state-of-the-art methods for learning disentangled representations are based on re-weighting parts of an existing objective. For instance, it is claimed that mutual information between latent variables and the observed data can encourage the latents into becoming more interpretable [6]. It is also argued that encouraging independence between latent variables induces disentanglement [7]. However, there is no strong evidence linking factorial representations to disentanglement. In part, this can be attributed to weak qualitative evaluation procedures. While traversals in the latent representation can qualitatively illustrate disentanglement, quantitative measures of disentanglement are in their infancy. In this paper, we: • show a decomposition of the variational lower bound that can be used to explain the success of the β-VAE [7] in learning disentangled representations. • propose a simple method based on weighted minibatches to stochastically train with arbitrary weights on the terms of our decomposition without any additional hyperparameters. • introduce the β-TCVAE, which can be used as a plug-in replacement for the β-VAE with no extra hyperparameters. Empirical evaluations suggest that the β-TCVAE discovers more interpretable representations than existing methods, while also being fairly robust to random initialization. • propose a new information-theoretic disentanglement metric, which is classifier-free and generalizable to arbitrarily-distributed and non-scalar latent variables. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. β-VAE [7] β-TCVAE (Our) (a) Baldness (-6, 6) (b) Face width (0, 6) (c) Gender (-6, 6) (d) Mustache (-6, 0) Figure 1: Qualitative comparisons on CelebA. Traversal ranges are shown in parentheses. Some attributes are only manifested in one direction of a latent variable, so we show a one-sided traversal. Most semantically similar variables from a β-VAE are shown for comparison. While Kim & Mnih [8] have independently proposed augmenting VAEs with an equivalent total correlation penalty to the β-TCVAE, their proposed training method differs from ours and requires an auxiliary discriminator network. 2 Background: Learning and Evaluating Disentangled Representations We discuss existing work that aims at either learning disentangled representations without supervision or evaluating such representations. The two problems are inherently related, since improvements to learning algorithms require evaluation metrics that are sensitive to subtle details, and stronger evaluation metrics reveal deficiencies in existing methods. 2.1 Learning Disentangled Representations VAE and β-VAE The variational autoencoder (VAE) [9, 10] is a latent variable model that pairs a top-down generator with a bottom-up inference network. Instead of directly performing maximum likelihood estimation on the intractable marginal log-likelihood, training is done by optimizing the tractable evidence lower bound (ELBO). We would like to optimize this lower bound averaged over the empirical distribution (with β = 1): Lβ = 1 N N  n=1 (Eq[log p(xn|z)] −β KL (q(z|xn)||p(z))) (1) The β-VAE [7] is a variant of the variational autoencoder that attempts to learn a disentangled representation by optimizing a heavily penalized objective with β > 1. Such simple penalization has been shown to be capable of obtaining models with a high degree of disentanglement in image datasets. However, it is not made explicit why penalizing KL(q(z|x)||p(z)) with a factorial prior can lead to learning latent variables that exhibit disentangled transformations for all data samples. InfoGAN The InfoGAN [6] is a variant of the generative adversarial network (GAN) [11] that encourages an interpretable latent representation by maximizing the mutual information between the observation and a small subset of latent variables. The approach relies on optimizing a lower bound of the intractable mutual information. 2.2 Evaluating Disentangled Representations When the true underlying generative factors are known and we have reason to believe that this set of factors is disentangled, it is possible to create a supervised evaluation metric. Many have proposed classifier-based metrics for assessing the quality of disentanglement [7, 8, 12, 13, 14, 15]. 2 We focus on discussing the metrics proposed in [7] and [8], as they are relatively simple in design and generalizable. The Higgins’ metric [7] is defined as the accuracy that a low VC-dimension linear classifier can achieve at identifying a fixed ground truth factor. Specifically, for a set of ground truth factors {vk}K k=1, each training data point is an aggregation over L samples: 1 L L l=1 |z(1) l −z(2) l |, where random vectors z(1) l , z(2) l are drawn i.i.d. from q(z|vk)1 for any fixed value of vk, and a classification target k. A drawback of this method is the lack of axis-alignment detection. That is, we believe a truly disentangled model should only contain one latent variable that is related to each factor. As a means to include axis-alignment detection, [8] proposes using argminj Varq(zj|vk)[zj] and a majority-vote classifier. Classifier-based disentanglement metrics tend to be ad-hoc and sensitive to hyperparameters. The metrics in [7] and [8] can be loosely interpreted as measuring the reduction in entropy of z if v is observed. In section 4, we show that it is possible to directly measure the mutual information between z and v which is a principled information-theoretic quantity that can be used for any latent distributions provided that efficient estimation exists. 3 Sources of Disentanglement in the ELBO It is suggested that two quantities are especially important in learning a disentangled representation [6, 7]: A) Mutual information between the latent variables and the data variable, and B) Independence between the latent variables. A term that quantifies criterion A was illustrated by an ELBO decomposition [16]. In this section, we introduce a refined decomposition showing that terms describing both criteria appear in the ELBO. ELBO TC-Decomposition We identify each training example with a unique integer index and define a uniform random variable on {1, 2, ..., N} with which we relate to data points. Furthermore, we define q(z|n) = q(z|xn) and q(z, n) = q(z|n)p(n) = q(z|n) 1 N . We refer to q(z) = N n=1 q(z|n)p(n) as the aggregated posterior following [17], which captures the aggregate structure of the latent variables under the data distribution. With this notation, we decompose the KL term in (1) assuming a factorized p(z). Ep(n)  KL  q(z|n)||p(z)  = KL (q(z, n)||q(z)p(n))   i Index-Code MI + KL  q(z)|| j q(zj)    ii Total Correlation +  j KL (q(zj)||p(zj))   iii Dimension-wise KL (2) where zj denotes the jth dimension of the latent variable. Decomposition Analysis In a similar decomposition [16], i is referred to as the index-code mutual information (MI). The index-code MI is the mutual information Iq(z; n) between the data variable and latent variable based on the empirical data distribution q(z, n). It is argued that a higher mutual information can lead to better disentanglement [6], and some have even proposed to completely drop the penalty on this term during optimization [17, 18]. However, recent investigations into generative modeling also claim that a penalized mutual information through the information bottleneck encourages compact and disentangled representations [3, 19]. In information theory, ii is referred to as the total correlation (TC), one of many generalizations of mutual information to more than two random variables [20]. The naming is unfortunate as it is actually a measure of dependence between the variables. The penalty on TC forces the model to find statistically independent factors in the data distribution. We claim that a heavier penalty on this term induces a more disentangled representation, and that the existence of this term is the reason β-VAE has been successful. 1Note that q(z|vk) is sampled by using an intermediate data sample: z ∼q(z|x), x ∼p(x|vk). 3 We refer to iii as the dimension-wise KL. This term mainly prevents individual latent dimensions from deviating too far from their corresponding priors. It acts as a complexity penalty on the aggregate posterior which reasonably follows from the minimum description length [21] formulation of the ELBO. We would like to verify the claim that TC is the most important term in this decomposition for learning disentangled representations by penalizing only this term; however, it is difficult to estimate the three terms in the decomposition. In the following section, we propose a simple yet general framework for training with the TC-decomposition using minibatches of data. A special case of this decomposition was given in [22], assuming that the use of a flexible prior can effectively ignore the dimension-wise KL term. In contrast, our decomposition (2) is more generally applicable to many applications of the ELBO. 3.1 Training with Minibatch-Weighted Sampling We describe a method to stochastically estimate the decomposition terms, allowing scalable training with arbitrary weights on each decomposition term. Note that the decomposed expression (2) requires the evaluation of the density q(z) = Ep(n)[q(z|n)], which depends on the entire dataset2. As such, it is undesirable to compute it exactly during training. One main advantage of our stochastic estimation method is the lack of hyperparameters or inner optimization loops, which should provide more stable training. A naïve Monte Carlo approximation based on a minibatch of samples from p(n) is likely to underestimate q(z). This can be intuitively seen by viewing q(z) as a mixture distribution where the data index n indicates the mixture component. With a randomly sampled component, q(z|n) is close to 0, whereas q(z|n) would be large if n is the component that z came from. So it is much better to sample this component and weight the probability appropriately. To this end, we propose using a weighted version for estimating the function log q(z) during training, inspired by importance sampling. When provided with a minibatch of samples {n1, ..., nM}, we can use the estimator Eq(z)[log q(z)] ≈1 M M  i=1  log 1 NM M  j=1 q(z(ni)|nj)   (3) where z(ni) is a sample from q(z|ni) (see derivation in Appendix C). This minibatch estimator is biased, since its expectation is a lower bound3. However, computing it does not require any additional hyperparameters. 3.1.1 Special case: β-TCVAE With minibatch-weighted sampling, it is easy to assign different weights (α, β, γ) to the terms in (2): Lβ−TC := Eq(z|n)p(n)[log p(n|z)] −αIq(z; n) −β KL  q(z)|| j q(zj)  −γ  j KL (q(zj)||p(zj)) (4) While we performed ablation experiments with different values for α and γ, we ultimately find that tuning β leads to the best results. Our proposed β-TCVAE uses α = γ = 1 and only modifies the hyperparameter β. While Kim & Mnih [8] have proposed an equivalent objective, they estimate TC using an auxiliary discriminator network. 4 Measuring Disentanglement with the Mutual Information Gap It is difficult to compare disentangling algorithms without a proper metric. Most prior work has resorted to qualitative analysis by visualizing the latent representation. Another approach relies on knowing the true generative process p(n|v) and ground truth latent factors v. Often these are 2The same argument holds for the term  j q(zj) and a similar estimator can be constructed. 3This follows from Jensen’s inequality Ep(n)[log q(z|n)] ≤log Ep(n)[q(z|n)]. 4 semantically meaningful attributes of the data. For instance, photographic portraits generally contain disentangled factors such as pose (azimuth and elevation), lighting condition, and attributes of the face such as skin tone, gender, face width, etc. Though not all ground truth factors may be provided, it is still possible to evaluate disentanglement using the known factors. We propose a metric based on the empirical mutual information between latent variables and ground truth factors. 4.1 Mutual Information Gap (MIG) Our key insight is that the empirical mutual information between a latent variable zj and a ground truth factor vk can be estimated using the joint distribution defined by q(zj, vk) = N n=1 p(vk)p(n|vk)q(zj|n). Assuming that the underlying factors p(vk) and the generating process is known for the empirical data samples p(n|vk), then In(zj; vk) = Eq(zj,vk)  log  n∈Xvk q(zj|n)p(n|vk)  + H(zj) (5) where Xvk is the support of p(n|vk). (See derivation in Appendix B.) A higher mutual information implies that zj contains a lot of information about vk, and the mutual information is maximal if there exists a deterministic, invertible relationship between zj and vj. Furthermore, for discrete vk, 0 ≤I(zj; vk) ≤H(vk), where H(vk) = Ep(vk)[−log p(vk)] is the entropy of vk. As such, we use the normalized mutual information I(zj; vk)/H(vk). Note that a single factor can have high mutual information with multiple latent variables. We enforce axis-alignment by measuring the difference between the top two latent variables with highest mutual information. The full metric we call mutual information gap (MIG) is then 1 K K  k=1 1 H(vk)  In(zj(k); vk) −max j=j(k) In(zj; vk)  (6) where j(k) = argmaxj In(zj; vk) and K is the number of known factors. MIG is bounded by 0 and 1. We perform an entire pass through the dataset to estimate MIG. While it is possible to compute just the average maximal MI, 1 K K k=1 In(zk∗;vk) H(vk) , the gap in our formulation (6) defends against two important cases. The first case is related to rotation of the factors. When a set of latent variables are not axis-aligned, each variable can contain a decent amount of information regarding two or more factors. The gap heavily penalizes unaligned variables, which is an indication of entanglement. The second case is related to compactness of the representation. If one latent variable reliably models a ground truth factor, then it is unnecessary for other latent variables to also be informative about this factor. Metric Axis Unbiased General Higgins et al. [7] No No No Kim & Mnih [8] Yes No No MIG (Ours) Yes Yes Yes Table 1: In comparison to prior metrics, our proposed MIG detects axis-alignment, is unbiased for all hyperparameter settings, and can be generally applied to any latent distributions provided efficient estimation exists. As summarized in Table 1, our metric detects axis-alignment and is generally applicable and meaningful for any factorized latent distribution, including vectors of multimodal, categorical, and other structured distributions. This is because the metric is only limited by whether the mutual information can be estimated. Efficient estimation of mutual information is an ongoing research topic [23, 24], but we find that the simple estimator (5) can be computed within reasonable amount of time for the datasets we use. We find that MIG can better capture subtle differences in models compared to existing metrics. Systematic experiments analyzing MIG and existing metrics are in Appendix G. 5 Related Work We focus on discussing the learning of disentangled representations in an unsupervised manner. Nevertheless, we note that inverting generative processes with known disentangled factors through 5 weak supervision has been pursued by many. The goal in this case is not perfect inversion but to distill simpler representation [15, 25, 26, 27, 28]. Although not explicitly the main motivation, many unsupervised generative modeling frameworks have explored the disentanglement of their learned representations [9, 17, 29]. Prior to β-VAE [7], some have shown successful disentanglement in limited settings with few factors of variation [1, 14, 30, 31]. As a means to describe the properties of disentangled representations, factorial representations have been motivated by many [1, 2, 3, 22, 32, 33]. In particular, Appendix B of [22] shows the existence of the total correlation in a similar objective with a flexible prior and assuming optimality q(z) = p(z). Similarly, [34] arrives at the ELBO from an objective that combines informativeness and the total correlation of latent variables. In contrast, we show a more general analysis of the unmodified evidence lower bound. The existence of the index-code MI in the ELBO has been shown before [16], and as a result, FactorVAE, which uses an equivalent objective to the β-TCVAE, is independently proposed [8]. The main difference is they estimate the total correlation using the density ratio trick [35] which requires an auxiliary discriminator network and an inner optimization loop. In contrast, we emphasize the success of β-VAE using our refined decomposition, and propose a training method that allows assigning arbitrary weights to each term of the objective without requiring any additional networks. In a similar vein, non-linear independent component analysis [36, 37, 38] studies the problem of inverting a generative process assuming independent latent factors. Instead of a perfect inversion, we only aim for maximizing the mutual information between our learned representation and the ground truth factors. Simple priors can further encourage interpretability by means of warping complex factors into simpler manifolds. To the best of our knowledge, we are the first to show a strong quantifiable relation between factorial representations and disentanglement (see Section 6). 6 Experiments Dataset Ground truth factors dSprites scale (6), rotation (40), posX (32), posY (32) 3D Faces azimuth (21), elevation (11), lighting (11) Table 2: Summary of datasets with known ground truth factors. Parentheses contain number of quantized values for each factor. We perform a series of quantitative and qualitative experiments, showing that β-TCVAE can consistently achieve higher MIG scores compared to prior methods β-VAE [7] and InfoGAN [6], and can match the performance of FactorVAE [8] whilst performing better in scenarios where the density ratio trick is difficult to train. Furthermore, we find that in models trained with our method, total correlation is strongly correlated with disentanglement.4 Independent Factors of Variation First, we analyze the performance of our proposed β-TCVAE and MIG metric in a restricted setting, with ground truth factors that are uniformly and independently sampled. To paint a clearer picture on the robustness of learning algorithms, we aggregate results from multiple experiments to visualize the effect of initialization . We perform quantitative evaluations with two datasets, a dataset of 2D shapes [39] and a dataset of synthetic 3D faces [40]. Their ground truth factors are summarized in Table 2. The dSprites and 3D faces also contain 3 types of shapes and 50 identities, respectively, which are treated as noise during evaluation. ELBO vs. Disentanglement Trade-off Since the β-VAE and β-TCVAE objectives are lower bounds on the standard ELBO, we would like to see the effect of training with this modification. To see how the choice of β affects these learning algorithms, we train using a range of values. The trade-off between density estimation and the amount of disentanglement measured by MIG is shown in Figure 2. 4Code is available at     . 6                           (a) dSprites                           (b) 3D Faces Figure 2: Compared to β-VAE, β-TCVAE creates more disentangled representations while preserving a better generative model of the data with increasing β. Shaded regions show the 90% confidence intervals. Higher is better on both metrics.                (a) dSprites                (b) 3D Faces Figure 3: Distribution of disentanglement score (MIG) for different modeling algorithms.                 (a) dSprites               (b) 3D Faces Figure 4: Scatter plots of the average MIG and TC per value of β. Larger circles indicate a higher β. We find that β-TCVAE provides a better trade-off between density estimation and disentanglement. Notably, with higher values of β, the mutual information penality in β-VAE is too strong and this hinders the usefulness of the latent variables. However, β-TCVAE with higher values of β consistently results in models with higher disentanglement score relative to β-VAE. We also perform ablation studies on the removal of the index-code MI term by setting α = 0 in (4), and a model using a factorized normalizing flow as the prior distribution which is jointly trained to maximize the modified objective. Neither resulted in significant performance difference, suggesting that tuning the weight of the TC term in (2) is the most useful for learning disentangled representations. Quantitative Comparisons While a disentangled representation may be achievable by some learning algorithms, the chances of obtaining such a representation typically is not clear. Unsupervised learning of a disentangled representation can have high variance since disentangled labels are not provided during training. To further understand the robustness of each algorithm, we show box plots depicting the quartiles of the MIG score distribution for various methods in Figure 3. We used β = 4 for β-VAE and β = 6 for β-TCVAE, based on modes in Figure 2. For InfoGAN, we used 5 continuous latent codes and 5 noise variables. Other settings are chosen following those suggested by [6], but we also added instance noise [41] to stabilize training. FactorVAE uses an equivalent objective to the β-TCVAE but is trained with the density ratio trick [35], which is known to underestimate the TC term [8]. As a result, we tuned β ∈[1, 80] and used double the number of iterations for FactorVAE. Note that while β-VAE, FactorVAE and β-TCVAE use a fully connected architecture for the dSprites dataset, InfoGAN uses a convolutional architecture for increased stability. We also find that FactorVAE performs poorly with fully connected layers, resulting in worse results than β-VAE on the dSprites dataset. In general, we find that the median score is highest for β-TCVAE and it is close to the highest score achieved by all methods. Despite the best half of the β-TCVAE runs achieving relatively high scores, we see that the other half can still perform poorly. Low-score outliers exist in the 3D faces dataset, although their scores are still higher than the median scores achieved by both VAE and InfoGAN. Factorial vs. Disentangled Representations While a low total correlation has been previously conjectured to lead to disentanglement, we provide concrete evidence that our β-TCVAE learning algorithm satisfies this property. Figure 4 shows a scatter plot of total correlation and the MIG 7   A   B   C   D (a) Different joint distributions of factors.                   (b) Distribution of disentanglement scores (MIG). Figure 5: The β-TCVAE has a higher chance of obtaining a disentangled representation than βVAE, even in the presence of sampling bias. (a) All samples have non-zero probability in all joint distributions; the most likely sample is 4 times as likely as the least likely sample. disentanglement metric for varying values of β trained on the dSprites and faces datasets, averaged over 40 random initializations. For models trained with β-TCVAE, the correlation between average TC and average MIG is strongly negative, while models trained with β-VAE have a weaker correlation. In general, for the same degree of total correlation, β-TCVAE creates a better disentangled model. This is also strong evidence for the hypothesis that large values of β can be useful as long as the index-code mutual information is not penalized. 6.1 Correlated or Dependent Factors A notion of disentanglement can exist even when the underlying generative process samples factors non-uniformly and dependently sampled. Many real datasets exhibit this behavior, where some configurations of factors are sampled more than others, violating the statistical independence assumption. Disentangling the factors of variation in this case corresponds to finding the generative model where the latent factors can independently act and perturb the generated result, even when there is bias in the sampling procedure. In general, we find that β-TCVAE has no problem in finding the correct factors of variation in a toy dataset and can find more interpretable factors of variation than those found in prior work, even though the independence assumption is violated. Two Factors We start off with a toy dataset with only two factors and test β-TCVAE using sampling distributions with varying degrees of correlation and dependence. We take the dataset of synthetic 3D faces and fix all factors other than pose. The joint distributions over factors that we test with are summarized in Figure 5a, which includes varying degrees of sampling bias. Specifically, configuration A uses uniform and independent factors; B uses factors with non-uniform marginals but are uncorrelated and independent; C uses uncorrelated but dependent factors; and D uses correlated and dependent factors. While it is possible to train a disentangled model in all configurations, the chances of obtaining one is overall lower when there exist sampling bias. Across all configurations, we see that β-TCVAE is superior to β-VAE and InfoGAN, and there is a large difference in median scores for most configurations. 6.1.1 Qualitative Comparisons We show qualitatively that β-TCVAE discovers more disentangled factors than β-VAE on datasets of chairs [42] and real faces [43]. 3D Chairs Figure 6 shows traversals in latent variables that depict an interpretable property in generating 3D chairs. The β-VAE [7] has shown to be capable of learning the first four properties: azimuth, size, leg style, and backrest. However, the leg style change learned by β-VAE does not seem to be consistent for all chairs. We find that β-TCVAE can learn two additional interpretable properties: material of the chair, and leg rotation for swivel chairs. These two properties are more subtle and likely require a higher index-code mutual information, so the lower penalization of index-code MI in β-TCVAE helps in finding these properties. 8 β-VAE β-TCVAE (a) Azimuth (b) Chair size (c) Leg style (d) Backrest (e) Material (f) Swivel Figure 6: Learned latent variables using β-VAE and β-TCVAE are shown. Traversal range is (-2, 2). CelebA Figure 1 shows 4 out of 15 attributes that are discovered by the β-TCVAE without supervision (see Appendix A.3). We traverse up to six standard deviations away from the mean to show the effect of generalizing the represented semantics of each variable. The representation learned by β-VAE is entangled with nuances, which can be shown when generalizing to low probability regions. For instance, it has difficulty rendering complete baldness or narrow face width, whereas the β-TCVAE shows meaningful extrapolation. The extrapolation of the gender attribute of β-TCVAE shows that it focuses more on gender-specific facial features, whereas the β-VAE is entangled with many irrelevances such as face width. The ability to generalize beyond the first few standard deviations of the prior mean implies that the β-TCVAE model can generate rare samples such as bald or mustached females. 7 Conclusion We present a decomposition of the ELBO with the goal of explaining why β-VAE works. In particular, we find that a TC penalty in the objective encourages the model to find statistically independent factors in the data distribution. We then designate a special case as β-TCVAE, which can be trained stochastically using minibatch estimator with no additional hyperparameters compared to the β-VAE. The simplicity of our method allows easy integration into different frameworks [44].To quantitatively evaluate our approach, we propose a classifier-free disentanglement metric called MIG. This metric benefits from advances in efficient computation of mutual information [23] and enforces compactness in addition to disentanglement. Unsupervised learning of disentangled representations is inherently a difficult problem due to the lack of a prior for semantic awareness, but we show some evidence in simple datasets with uniform factors that independence between latent variables can be strongly related to disentanglement. Acknowledgements We thank Alireza Makhzani, Yuxing Zhang, and Bowen Xu for initial discussions. We also thank Chatavut Viriyasuthee for pointing out an error in one of our derivations. Ricky would also like to thank Brendan Shillingford for supplying accommodation at a popular conference. References [1] Jürgen Schmidhuber. Learning factorial codes by predictability minimization. Neural Computation, 4(6):863–879, 1992. [2] Karl Ridgeway. A survey of inductive biases for factorial representation-learning. arXiv preprint arXiv:1612.05299, 2016. [3] Alessandro Achille and Stefano Soatto. On the emergence of invariance and disentangling in deep representations. arXiv preprint arXiv:1706.01350, 2017. [4] Yoshua Bengio, Aaron Courville, and Pascal Vincent. Representation learning: A review and new perspectives. IEEE transactions on pattern analysis and machine intelligence, 35(8):1798–1828, 2013. 9 [5] Alexander A Alemi, Ian Fischer, Joshua V Dillon, and Kevin Murphy. Deep variational information bottleneck. International Conference on Learning Representations, 2017. [6] Xi Chen, Yan Duan, Rein Houthooft, John Schulman, Ilya Sutskever, and Pieter Abbeel. Infogan: Interpretable representation learning by information maximizing generative adversarial nets. In Advances in Neural Information Processing Systems, pages 2172–2180, 2016. [7] Irina Higgins, Loic Matthey, Arka Pal, Christopher Burgess, Xavier Glorot, Matthew Botvinick, Shakir Mohamed, and Alexander Lerchner. beta-vae: Learning basic visual concepts with a constrained variational framework. International Conference on Learning Representations, 2017. [8] Hyunjik Kim and Andriy Mnih. Disentangling by factorising. arXiv preprint arXiv:1802.05983, 2018. [9] Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013. [10] Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. arXiv preprint arXiv:1401.4082, 2014. [11] 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. [12] Will Grathwohl and Aaron Wilson. Disentangling space and time in video with hierarchical variational auto-encoders. arXiv preprint arXiv:1612.04440, 2016. [13] Christopher K. I. Williams Cian Eastwood. A framework for the quantitative evaluation of disentangled representations. International Conference on Learning Representations, 2018. [14] Xavier Glorot, Antoine Bordes, and Yoshua Bengio. Domain adaptation for large-scale sentiment classification: A deep learning approach. In Proceedings of the 28th international conference on machine learning (ICML-11), pages 513–520, 2011. [15] Theofanis Karaletsos, Serge Belongie, and Gunnar Rätsch. Bayesian representation learning with oracle constraints. International Conference on Learning Representations, 2016. [16] Matthew D Hoffman and Matthew J Johnson. Elbo surgery: yet another way to carve up the variational evidence lower bound. In Workshop in Advances in Approximate Bayesian Inference, NIPS, 2016. [17] Alireza Makhzani, Jonathon Shlens, Navdeep Jaitly, Ian Goodfellow, and Brendan Frey. Adversarial autoencoders. ICLR 2016 Workshop, International Conference on Learning Representations, 2016. [18] Shengjia Zhao, Jiaming Song, and Stefano Ermon. Infovae: Information maximizing variational autoencoders. arXiv preprint arXiv:1706.02262, 2017. [19] Christopher Burgess, Irina Higgins, Arka Pal, Loic Matthey, Nick Watters, Guillaume Desjardins, and Alexander Lerchner. Understanding disentangling in beta-vae. Learning Disentangled Representations: From Perception to Control Workshop, 2017. [20] Satosi Watanabe. Information theoretical analysis of multivariate correlation. IBM Journal of research and development, 4(1):66–82, 1960. [21] Geoffrey E Hinton and Richard S Zemel. Autoencoders, minimum description length and helmholtz free energy. In Advances in neural information processing systems, pages 3–10, 1994. [22] Alessandro Achille and Stefano Soatto. Information dropout: Learning optimal representations through noisy computation. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2018. [23] Ishmael Belghazi, Sai Rajeswar, Aristide Baratin, R Devon Hjelm, and Aaron Courville. MINE: Mutual information neural estimation. arXiv preprint arXiv:1801.04062, 2018. [24] 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. [25] Geoffrey E Hinton, Alex Krizhevsky, and Sida D Wang. Transforming auto-encoders. In International Conference on Artificial Neural Networks, pages 44–51. Springer, 2011. [26] Tejas D Kulkarni, William F Whitney, Pushmeet Kohli, and Josh Tenenbaum. Deep convolutional inverse graphics network. In Advances in Neural Information Processing Systems, pages 2539–2547, 2015. [27] Brian Cheung, Jesse A Livezey, Arjun K Bansal, and Bruno A Olshausen. Discovering hidden factors of variation in deep networks. arXiv preprint arXiv:1412.6583, 2014. [28] Ramakrishna Vedantam, Ian Fischer, Jonathan Huang, and Kevin Murphy. Generative models of visually grounded imagination. International Conference on Learning Representations, 2018. [29] Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015. 10 [30] Yichuan Tang, Ruslan Salakhutdinov, and Geoffrey Hinton. Tensor analyzers. In International Conference on Machine Learning, pages 163–171, 2013. [31] Guillaume Desjardins, Aaron Courville, and Yoshua Bengio. Disentangling factors of variation via generative entangling. arXiv preprint arXiv:1210.5474, 2012. [32] Greg Ver Steeg and Aram Galstyan. Maximally informative hierarchical representations of highdimensional data. In Artificial Intelligence and Statistics, pages 1004–1012, 2015. [33] Abhishek Kumar, Prasanna Sattigeri, and Avinash Balakrishnan. Variational inference of disentangled latent concepts from unlabeled observations. arXiv preprint arXiv:1711.00848, 2017. [34] Shuyang Gao, Rob Brekelmans, Greg Ver Steeg, and Aram Galstyan. Auto-encoding total correlation explanation. arXiv preprint arXiv:1802.05822, 2018. [35] Masashi Sugiyama, Taiji Suzuki, and Takafumi Kanamori. Density ratio estimation in machine learning. Cambridge University Press, 2012. [36] Pierre Comon. Independent component analysis, a new concept? Signal processing, 36(3):287–314, 1994. [37] Aapo Hyvärinen and Petteri Pajunen. Nonlinear independent component analysis: Existence and uniqueness results. Neural Networks, 12(3):429–439, 1999. [38] Christian Jutten and Juha Karhunen. Advances in nonlinear blind source separation. In Proc. of the 4th Int. Symp. on Independent Component Analysis and Blind Signal Separation, 2003. [39] Loic Matthey, Irina Higgins, Demis Hassabis, and Alexander Lerchner. dsprites: Disentanglement testing sprites dataset. https://github.com/deepmind/dsprites-dataset/, 2017. [40] Pascal Paysan, Reinhard Knothe, Brian Amberg, Sami Romdhani, and Thomas Vetter. A 3d face model for pose and illumination invariant face recognition. In Advanced Video and Signal Based Surveillance, 2009. AVSS’09. Sixth IEEE International Conference on, pages 296–301. Ieee, 2009. [41] Casper Kaae Sønderby, Jose Caballero, Lucas Theis, Wenzhe Shi, and Ferenc Huszár. Amortised map inference for image super-resolution. International Conference on Learning Representations, 2017. [42] Mathieu Aubry, Daniel Maturana, Alexei Efros, Bryan Russell, and Josef Sivic. Seeing 3d chairs: exemplar part-based 2d-3d alignment using a large dataset of cad models. In CVPR, 2014. [43] Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In Proceedings of the IEEE International Conference on Computer Vision, pages 3730–3738, 2015. [44] Jin Xu and Yee Whye Teh. Controllable semantic image inpainting. arXiv preprint arXiv:1806.05953, 2018. 11
2018
139
7,296
Dimensionality Reduction has Quantifiable Imperfections: Two Geometric Bounds Kry Yik Chau Lui Borealis AI Canada yikchau.y.lui@borealisai.com Gavin Weiguang Ding Borealis AI Canada gavin.ding@borealisai.com Ruitong Huang Borealis AI Canada ruitong.huang@borealisai.com Robert J. McCann Department of Mathematics University of Toronto Canada mccann@math.toronto.edu Abstract In this paper, we investigate Dimensionality reduction (DR) maps in an information retrieval setting from a quantitative topology point of view. In particular, we show that no DR maps can achieve perfect precision and perfect recall simultaneously. Thus a continuous DR map must have imperfect precision. We further prove an upper bound on the precision of Lipschitz continuous DR maps. While precision is a natural measure in an information retrieval setting, it does not measure “how” wrong the retrieved data is. We therefore propose a new measure based on Wasserstein distance that comes with similar theoretical guarantee. A key technical step in our proofs is a particular optimization problem of the L2-Wasserstein distance over a constrained set of distributions. We provide a complete solution to this optimization problem, which can be of independent interest on the technical side. 1 Introduction Dimensionality reduction (DR) serves as a core problem in machine learning tasks including information compression, clustering, manifold learning, feature extraction, logits and other modules in a neural network and data visualization [16, 8, 34, 19, 25]. In many machine learning applications, the data manifold is reduced to a dimension lower than its intrinsic dimension (e.g. for data visualizations, output dimension is reduced to 2 or 3; for classifications, it is the number of classes). In such cases, it is not possible to have a continuous bijective DR map (i.e. classic algebraic topology result on invariance of dimension [26]). With different motivations, many nonlinear DR maps have been proposed in the literature, such as Isomap, kernel PCA, and t-SNE, just to name a few [31, 33, 22]. A common way to compare the performances of different DR maps is to use a down stream supervised learning task as the ground truth performance measure. However, when such down stream task is unavailable, e.g. in an unsupervised learning setting as above, one would have to design a performance measure based on the particular context. In this paper, we focus on the information retrieval setting, which falls into this case. An information retrieval system extracts the features f(x) from the raw data x for future queries. When a new query y0 = f(x0) is submitted, the system returns the most relevant data with similar features, i.e. all the x such that f(x) is close to y0. For computational efficiency and storage, f is usually a DR map, retaining only the most informative features. Assume that the ground truth relevant data of x0 is defined as a neighbourhood U of x that is a ball with radius rU centered at 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. x 1, and the system retrieves the data based on relevance in the feature space, i.e. the inverse image, f −1(V ), of a retrieval neighbourhood V ∋f(x0). Here V is the ball centered at y0 = f(x0) with radius rV that is determined by the system. It is natural to measure the system’s performance based on the discrepancy between U and f −1(V ). Many empirical measures of this discrepancy have been proposed in the literature, among which precision and recall are arguably the most popular ones [32, 23, 20, 34]. However, theoretical understandings of these measures are still very limited. In this paper, we start with analyzing the theoretical properties of precision and recall in the information retrieval setting. Naively computing precision and recall in the discrete settings gives undesirable properties, e.g. precision always equals recall when computed by using k nearest neighbors. How to measure them properly is unclear in the literature (Section 3.2). On the other hand, numerous experiments have suggested that there exists a tradeoff between the two when dimensionality reduction happens [34], yet this tradeoff still remains a conceptual mystery in theory. To theoretically understand this tradeoff, we look for continuous analogues of precision and recall, and exploit the geometric and function analytic tools that study dimensionality reduction maps [15]. The first question we ask is what property a DR map should have, so that the information retrieval system can attain zero false positive error (or false negative error) when the relevant neighbourhood U and the retrieved neighbourhood V are properly selected. Our analyses show the equivalence between the achievability of perfect recall (i.e. zero false negative) and the continuity of the DR map. We further prove that no DR map can achieve both perfect precision and perfect recall simultaneously. Although it may seem intuitive, to our best knowledge, this is the first theoretical guarantee in the literature of the necessity of the tradeoff between precision and recall in a dimension reduction setting. Our main results are developed for the class of (Lipschitz) continuous DR maps. The first main result of this paper is an upper bound for the precision of a continuous DR map. We show that given a continuous DR map, its precision decays exponentially fast with respect to the number of (intrinsic) dimensions reduced. To our best knowledge, this is the first theoretical result in the literature for the decay rate of the precision of a dimensionality reduction map. The second main result is an alternative measure for the performance of a continuous DR map, called W2 measure, based on L2-Wasserstein distance. This new measure is more desirable as it can also detect the distance distortion between U and f −1(V ). Moreover, we show that our measure also enjoys a theoretical lower bound for continuous DR maps. Several other distance-based measures have been proposed in the literature [32, 23, 20, 34], yet all are proposed heuristically with meagre theoretical understanding. Simulation results suggest optimizing the Wasserstein measure lower bound corresponds to optimizing a weighted f-1 score (i.e. f-β score). Thus we may optimize precision and recall without dealing with their computational difficulties in the discrete setting. Finally, let us make some comments on the technical parts of the paper. The first key step is the Waist Inequality from the field of quantitative algebraic topology. At a high level, we need to analyse f −1(V ), inverse image of an open ball for an arbitrary continuous map f. The waist inequality guarantees the existence of a ‘large’ fiber, which allows us to analyse f −1(V ) and prove our first main result. We further show that in a common setting, a significant proportion of fibers are actually ‘large’. For our second main result, a key step in the proof is a complete solution to the following iterated optimization problem: inf W : Voln(W )=M W2(PBr, PW ) = inf W : Voln(W )=M inf ξ∈Ξ(PBr ,PW ) E(a,b)∼ξ[∥a −b∥2 2]1/2, where Br is a ball with radius r, PBr (PW , respectively) is a uniform distribution over Br (W, respectively), and W2 is the L2-Wasserstein distance. Unlike a typical optimal transport problem where the transport function between source and target distributions is optimized, in the above problem the source distribution is also being optimized at the outer level. This becomes a difficult constrained iterated optimization problem. To address it, we borrow tools from optimal partial transport theory [9, 11]. Our proof techniques leverage the uniqueness of the solution to the optimal partial transport problem and the rotational symmetry of Br to deduce W. 1The value of rU is unknown, and it depends on the user and the input data x0. However, we can assume rU is small compared to the input domain size. For example, the number of relevant items to a particular user is much fewer than the number of total items. 2 1.1 Notations We collect our notations in this section. Let m be the embedding dimension, M be an n dimensional data manifold2 embedded in RN, where N is the ambient dimension. M is typically modelled as a Riemannian manifold, so it is a metric space with a volume form. Let m < n < N and f : M ⊂RN →Rm be a DR map. The pair (x, y) will be the points of interest, where y = f(x). The inverse image of y under the map f is called fiber, denoted f −1(y). We say f is continuous at point x iff oscf(x) = 0, where oscf(x) = infU;Uopen{diam(f(U)); x ∈U} is the oscillation for f at x ∈M. We say f is one-to-one or injective when its fiber, f −1(y) is the singleton set {x}. We let A ⊕ϵ := {x ∈RN|d(x, A) < ϵ} denote the ϵ-neighborhood of the nonempty set A. In RN, we note the ϵ-neighborhood of the nonempty set A is the Minkowski sum of A with BN ϵ (x), where the Minkowski sum between two sets A and B is: A ⊕B = {a + b|a ∈A, b ∈B}. For example, an n dimension open ball with radius r, centered at a point x can be expressed as: Bn r (x) = x ⊕Bn r (0) = x ⊕r, where the last expression is used to simplify notation. If not specified, the dimension of the ball is n. We also use Br to denote the ball with radius r when its center is irrelevant. Similarly, Sn r denotes n-dimensional sphere in Rn+1 with radius r. Let Voln denote n-dimensional volume.3 When the intrinsic dimension of A is greater than n, we set Voln(A) = ∞. Throughout the rest of the paper, we use U to denote BrU (x) a ball with radius rU centered at x and V = BrV (y) a ball with radius rV centered at y. These are metric balls in a metric space. For example, they are geodesic balls in a Riemannian manifold, whenever they are well defined. In Euclidean spaces, U is a Euclidean ball with L2 norm. By T#(µ) = ν, we mean a map T pushes forward a measure µ to ν, i.e. ν(B) = µ(T −1(B)) for any Borel set B. We say a measure µ is dominated by another measure ν, if for every measurable set A, µ(A) ≤ν(A). 2 Precision and recall We present the definitions of precision and recall in a continuous setting in this section. We then prove the equivalence between perfect recall and the continuity, followed by a theorem on the necessary tradeoff between the perfect recall and the perfect precision for a dimension reduction information retrieval system. The main result of this section is a theoretical upper bound for the precision of a continuous DR map. 2.1 Precision and recall While precision and recall are commonly defined based on finite counts in practice, when analysing DR maps between spaces, it is natural to extend their definitions in a continuous setting as follows. Definition 1 (Precision and Recall). Let f be a continuous DR map. Fix (x, y = f(x)), rU > 0 and rV > 0, let U = BrU (x) ⊂RN and V = Bm rV (y) ⊂Rm be the balls with radius rU and rV respectively. The precision and recall of f at U and V are defined as: Precisionf(U, V ) = Voln(f −1(V ) ∩U) Voln(f −1(V )) ; Recallf(U, V ) = Voln(f −1(V ) ∩U) Voln(U) . We say f achieves perfect precision at x if for every rU, there exists rV such that Precisionf(U, V ) = 1. Also, f achieves perfect recall at x if for every rV , there exists rU such that Recallf(U, V ) = 1. Finally, we say f achieves perfect precision (perfect recall, respectively) in an open set W, if f achieves perfect precision (perfect recall, respectively) at w for any w ∈W. Note that perfect precision requires f −1(V ) ⊂U except a measure zero set. Similarly, perfect recall requires U ⊂f −1(V ) except a measure zero set. Figure 1 illustrates the precision and recall defined above. To measure the performance of the information retrieval system, we would like to understand how different f −1(V ) is from the ideal response U = BrU (x). Precision and recall provides two meaningful measures for this difference based on their volumes. Note that f achieves 2There is empirical and theoretical evidence that data distribution lies on low dimensional submanifold in the ambient space [27]. 3 Let A be a set. In Euclidean space, Voln(A) = Ln(A) is the Lebesgue measure. For a general n-rectifiable set, Voln(A) = Hn(A) is the Hausdorff measure. When A is not rectifiable, Voln(A) = Mn ∗(A) is the lower Minkowski content. 3 Figure 1: Illustration of precision and recall. perfect precision at x implies that no matter how small the relevant radius rU is for the image, the system would be able to achieve zero false positive by picking proper rV . Similarly perfect recall at x implies no matter how small rV is, the system would not miss the most relevant images around x. In fact, the definitions of perfect precision and perfect recall are closely related to continuity and injectivity of a function f. Here we only present an informal statement. Rigorous statements are given in the Appendix B. Proposition 1. Perfect recall is equivalent to continuity. If f is continuous, then perfect precision is equivalent to injectivity. The next result shows that no DR map f, continuous or not, can achieve perfect recall and perfect precision simultaneously - a widely observed but unproved phenomenon in practice. In other words, it rigorously justifies the intuition that perfectly maintaining the local neighbourhood structure is impossible for a DR map. Theorem 1 (Precision and Recall Tradeoff). Let n > m, M ⊂RN be a Riemannian n-dimensional submanifold. Then for any (dimensionality reduction) map f : M →Rm and any open set W ⊂M, f cannot achieve both perfect precision and perfect recall on W. 2.2 Upper bound for the precision of a continuous DR map In this section, we provide a quantitative analysis for the imperfection of f. In particular, we prove an upper bound for the precision of a continuous DR map f (thus f achieves perfect recall). For simplicity, we assume the domain of f is an n -ball with radius R embedded in RN, denoted by Bn R. Our main tool is the Waist Inequality [29, 1] in quantitative topology. See Appendix A for an exact statement. Intuitively, the Waist Inequality guarantees the existence of y ∈Rm such that f −1(y) is a ‘large’ fiber. If f is also L-Lipschitz, then for p in a small neighbourhood V of y, f −1(p) is also a ‘large’ fiber, thus f −1(V ) has a positive volume in M. Exploiting the lower bound for Voln f −1(V )  leads to our upper bound in Theorem 2 on the precision of f, Precisionf(U, V ). A rigorous proof is given in the appendix Appendix C. Theorem 2 (Precision Upper Bound, Worst Case). Assume n > m, and that f : Bn R →Rm is a continuous map with Lipschitz constant L. Let rU and rV > 0 be fixed. Denote D(n, m) = Γ( n−m 2 + 1)Γ( m 2 + 1) Γ( n 2 + 1) . (1) Then there exists y ∈Rm such that for any x ∈f −1(y), we have: Precisionf(U, V ) ≤D(n, m) rU R n−m r m U pm(rV /L) (2) 4 where pm(r) is rm (1 + o(1)), i.e. lim r→0 pm(r) rm = 1. Remark 1. Key to the bound is the Waist Inequality. As such, upper bounds on precision for other spaces (i.e. cube, see Klartag [17] ) can be established, provided there is a Waist Inequality for the space. The Euclidean norm setting can also be extended to arbitrary norms, exploiting convex geometry (i.e. Akopyan and Karasev [2]). Rigorous proofs are given in the appendix C. Remark 2. With m fixed as a constant, note that D(n, m) decays asymptotically at a rate of (1/n)m/2. Also note that rU < R implies rU R n−m decays exponentially. Typically, L can grow at a rate of √n. Moreover, while pm(r)’s behaviour is given asymptotically, it is independent of n. Thus the upper bound decay is dominated by the exponential rate of n −m. For fixed n, m, this upper bound can be trivial when rU ≫rV . However, this rarely happens in practice in the information retrieval setting. Note that the number of relevant items, which is indexed by rU, is often smaller than the number of retrieved items, that depends on rV , while they are both much smaller than number of total items, indexed by R. We note however that this bound depends on the intrinsic dimension n. When n ≪N and the ambient dimension N is used in place, the upper bound could be misleading in practice as it is much smaller than it should be. To estimate this bound in practice, a good estimate on intrinsic dimension [13] is needed, which is an active topic in the field and beyond the scope of this paper. Theorem 2 guarantees the existence of a particular point y ∈Rm where the precision of f on its neighbourhood is small. It is natural to ask if this is also true in an average sense for every y. In other words, we know an information retrieval system based on DR maps always has a blindspot, but is this blindspot behaviour a typical case? In general, when m > 1, this is false, due to a recent counter-example constructed by Alpert and Guth [3]. However, our next result shows that for a large number of continuous DR maps in the field, such upper bound still holds with high probability. Theorem 3 (Precision Upper Bound, Average Case). Assume n > m and Bn R is equiped with uniform probability distribution. Consider the following cases: • case 1: m = 1 and f : Bn R →Rm is L Lipschitz continuous, or • case 2: f : Bn R →Rm is a k-layer feedforward neural network map with Lipschitz constant L, with surjective linear maps in each layer. Let 0 < δ2 < R2 −r2 U, rU, rV > 0 be fixed, then with probability at least q1 for case 1 or q2 for case 2, it holds that Precisionf(U, V ) ≤D(n, m) rU p r2 U + δ2 !n−m r m U pm(rV /L), (3) where q1 = 1 2πR R Bm ℜVoln−m+1Proj−1 1 (t)dt Voln(Bn R) , q2 = R Bm ℜVoln−mProj−1 2 (t)dt Voln(Bn R) , ℜ= p R2 −r2 U −δ2, Proj1 : Sn+1 R →Rm and Proj2 : Bn R →Rm are arbitrary surjective linear maps. Furthermore, lim r2 U +δ2 R2 →0 q1 = 1 lim r2 U +δ2 R2 →0 q2 = 1. See Appendix D for an explicit characterization of Proj−1 1 (t) and Proj−1 2 (t). Theorem 2 and Theorem 3 together suggest that practioners should be cautious in applying and interpreting DR maps. One important application of DR maps is in data visualization. Among the many algorithms, t-SNE’s empirical success made it the de facto standard. While [5] shows t-SNE can recover inter-cluster structure in some provable settings, the resulted intra-cluster embedding will very likely be subject to the constraints given in our work4. For example, recall within a cluster will be good, but the intra-cluster precision won’t be. In more general cases and/or when perplexity is too small, t-SNE 4Strictly speaking, the DR maps induced by t-SNE may not be continuous, and hence our theorems do not apply directly. However, since we can measure how closely parametric t-SNE (which is continuous) behaves as t-SNE and there is empirical evidence to their similarity [21], our theorems may apply again. 5 can create artificial clusters, separating neighboring datapoints. The resulted visualization embedding may enjoy higher precision, but its recall suffers. The interested readers are referred to Appendix G.1 for more experimental illustrations. Our work thus sheds light on the inherent tradeoffs in any visualization embedding. It also suggests the companion of a reliability measure to any data visualization for exploratory data analysis, which measures how a low dimensional visualization represents the true underlying high dimensional neighborhood structure.5 3 Wasserstein measure Intuitively we would like to measure how different the original neighbourhood U of x is from the retrieved neighbourhood f −1(V ) when using the neighbourhood of f(x) in Rm. Precision and Recall in Section 2.1 provide a semantically meaningful way for this purpose and we gave a non-trivial upper bound for precision when the feature extraction is a continuous DR map. However, precision and recall are purely volume-based measures. It would be more desirable if the measure could also reflect the information about the distance distortions between U and f −1(V ). In this section, we propose an alternative measure to reflect such information based on the L2-Wasserstein distance. Efficient algorithms for computing the empirical Wasserstein distance exists in the literature [4]. Unlike the measure proposed in Venna et al. [34], our measure also enjoys a theoretical guarantee similar to Theorem 2, which provides a non-trivial characterization for the imperfection of dimension reduction information retrieval. Let PU (Pf −1(V ), respectively) denote the uniform probability distribution over U (f −1(V ), respectively), and Ξ(PU, Pf −1(V )) be the set of all the joint distribution over Bn R × Bn R, whose marginal distributions are PU over the first Bn R and Pf −1(V ) over the second Bn R. We propose to measure the difference between U and f −1(V ) by the L2-Wasserstein distance between PU and Pf −1(V ): W2(PU, Pf −1(V )) = inf ξ∈Ξ(PU,Pf−1(V )) E(a,b)∼ξ[∥a −b∥2 2]1/2. In practice, it is reasonable to assume that Voln(U) is small in most retrieval systems. In such cases, low W2(PU, Pf −1(V )) cost is closely related to high precision retrieval. To see that, when Voln(U) is small, achieving high precision retrieval requires small Voln(f −1(V )), which is a precise quantitative way of saying f being roughly injective. Moreover, as seen in Section 2.1, f being roughly injective ≈f giving high precision retrieval. As a result, we can expect high precision retrieval performance when optimizing W2(PU, Pf −1(V )) measure. Such relation is also empirically confirmed in the simulation in Section 3.2. Besides its computational benefits, for a continuous DR map f, the following theorem provides a lower bound on W2(PU, Pf −1(V )) with a similar flavour to the precision upper bound in Theorem 1. Theorem 4 (Wasserstein Measure Lower Bound). Let n > m, f : Bn R →Rm be a L-Lipschitz continuous map, where R is the radius of the ball Bn R. There exists y ∈Rm such that for any x ∈f −1(y), any rU > 0 such that Bn rU (x) ⊂Bn R, and any rV > 0 such that r ≥rU, we have: W 2 2 (PU, Pf −1(V )) ≥ n n + 2 (r −rU)2 where r =  Γ( n 2 +1) Γ( n−m 2 +1)Γ( m 2 +1)  1 n R n−m n (pm(rV /L)) 1 n . In particular, as n →∞, W 2 2 (PU, Pf −1(V )) = Ω (R −rU)2 . We sketch the proof here. A complete proof can be found in Appendix E. The proof starts with a lower bound of Voln f −1(V )  by the topologically flavored waist inequality (Equation (6)). Heuristically Voln(f −1(V )) is much larger than Voln(U) when n ≫m and R ≫rU. The main component of the proof is to establish an explicit lower bound for W2(PU, PW ) over all possible W of a fixed volume V, 6 where U is a ball with radius rU, as shown in Theorem 5. In particular, we prove that the shape 5Such attempts existed in literature on visualization of dimensionality reduction (e.g. [34]). However, since these works are based on heuristics, it is less clear what they measure, nor do they enjoy theoretical guarantee. 6An antecedent of this problem was studied in Section 2.3 of [24], where the authors optimize over the more restricted class of ellipses with fixed area. For our purpose, the minimization is over bounded measurable sets. 6 of optimal W ∗must be rotationally invariant, thus W ∗must be a union of spheres. This is achieved by levering the uniqueness of the solution to the optimal partial transport problem [9, 11]. We then prove that the optimal solution for W is the ball that has a common center with U. Theorem 5. Let U = BrU and V ≥Vol(U). Then inf W : Voln(W )≥V W2(PU, PW ) = inf W : Voln(W )=V W2(PU, PW ) = W2(PU, PBrV ), where BrV is an rV ball with the same center with U such that Voln(BrV) = V. Moreover, T(x) = rU rV x, for x ∈BrV is the optimal transport map (up to a measure zero set), so that W2(PU, PBrV ) = Z BrV |x −T(x)|2 dPBrV (x). Complementarily, when 0 < V < Voln(U), the infimum infW : Voln(W )=V W2(PU, PW ) = 0, is not attained by any set. On the other hand, infW : Voln(W )≥V W2(PU, PW ) = 0 by taking W = U. Remark 3. Our lower bound in Theorem 4 is (asymptotically) tight. Note that by Theorem 4, W 2 2 (PU, Pf −1(V )) has a (maximum) lower bound of scale (R −rU)2. On the other hand, by Theorem 5, W 2 2 (PU, Pf −1(V )) ≤W 2 2 (PU, PBn R) = Ω((R −rU)2), where the equality is by standard algebraic calculations. 3.1 Iso-Wasserstein inequality We believe Theorem 5 is of independent interest itself, as it has the same flavor as the isoperimetric inequality (See Appendix A for an exact statement.) which arguably is the most important inequality in metric geometry. In fact, the first statement of Theorem 5 can be restated as the following inequality: Theorem 6 (Iso-Wasserstein Inequality). Let Br1, Br2 ⊂Bn R be two concentric n balls with radii r1 ≤r2 centered at the origin. For all measurable A ⊂Bn R with Voln(A) = Voln(Br2), we have W2(P(A), P(Br1)) ≥W2(P(Br2), P(Br1)) where P(S) denotes a uniform probability distribution on S, i.e. P(S) has density 1 Voln(S). Recall that an isoperimetric inequality in Euclidean space roughly says balls have the least perimeter among all equal volume sets. Theorem 6 acts as a transportation cousin of the isoperimetric inequality. While the isoperimetric inequality compares n −1 volume between two sets, the iso-Wasserstein inequality compares their Wasserstein distances to a small ball. The extrema in both inequalities are attained by Euclidean balls. 3.2 Simulations In this section, we demonstrate on a synthetic dataset that our lower bound in Theorem 4 can be a reasonable guidance for selecting the retrieval neighborhood radius rV , which emphasizes on high precision. The simulation environment is to compute the optimal rV by minimizing the lower bound in Theorem 4, with a given relevant neighborhood radius rU and embedding dimension m. Note that minimizing its lower bound instead of the exact cost itself is beneficial as it avoids the direct computation of the cost. Recall the lower bound of W2(PU, Pf −1(V )) is (asymptotically) tight (Remark 3) and matches the its upper bound when n −m ≫0. If the lower bound behaves roughly like W2(PU, Pf −1(V )), our simulation result also serves as an empirical evidence that W2(PU, Pf −1(V )) weighs more on high precision. Specifically, we generate 10000 uniformly distributed samples in a 10-dimensional unit ℓ2-ball. We choose rU such that on average each data point has 500 neighbors inside BrU . We then linearly project these 10 dimensional points into lower dimensional spaces with embedding dimension m from 1 to 9. For each m, a different rV is used to calculate discrete precision and recall. This simulates how optimal rV according to Wasserstein measure changes with respect to m. The result is shown in on the left in Figure 2. Similarly, we can fix m = 5 and track optimal rV ’s behavior when rU changes. This is shown on the right in Figure 2. We evalute our measures based on traditional information retrieval metrics such as f-score. To compute it, we need the discrete/sample-based precision and recall. As discussed in the introduction, 7 Figure 2: Precision and recall results on uniform samples in a 10 dimensional unit ball. The left figure contains precision-recall curves for a fixed rU and the optimal rV is chosen according to m = 1, · · · , 9. The right figure plots the curves for m = 5 and the optimal rV ’s is chosen for different rU, where rU is indexed by k, the average number of neighbors across all points. a naive sample based calculations of precision and recall makes Precision = Recall at all times. We compute them alternatively by discretizing Definition 1, by fixing radii rU and rV . So each U and f −1(V ) contain different numbers of neighbors. Precision = #(points within rU from x and within rV from y) #(points within rV from y) (4) Recall = #(points within rU from x and within rV from y) #(points within rU from x) (5) The optimal rV according to the lower bound in Theorem 4 (the blue circle-dash-dotted line) aligns closely with the optimal f-score with β = 0.3 where β weighted f-score, also known as f-βscore, is: (1 + β2) Precision ∗Recall β2 ∗Precision + recall. Note that f-score with β < 1 indeed emphasizes on high precision. In this provable setting, we have demonstrated our bound’s utility. This shows W2 measures’ potential for evaluating dimension reduction. In general cases, we won’t have such tight lower bounds and it is natural to optimize according to the sample based W2 measures instead. We performed some preliminary experiments on this heuristic, shown in Appendix G. 4 Relation to metric space embedding and manifold learning We lastly situate our work in the lines of research on metric space embedding and manifold learning. One obvious difference between our work and the literature of metric space embedding and manifold learning is that our work mainly focuses on intrinsic dimensionality reduction maps, i.e. n ≫m, while in metric space embedding and manifold learning, having n ≤m < N is common. Our work also differs from the literature of metric space embedding and manifold learning in its learning objective. Learning in these fields aims to preserve the metric structure of the data. Our work attempts to preserve precision and recall, a weaker structure in the sense of embedding dimension (Proposition 2). While they typically look for lowest embedding dimension subject to certain loss (e.g. smoothness, isometry, etc.), in contrast, our learning goal is to minimize the loss (precision and recall etc.) subject to a fixed embedding dimension constraint. In these cases, desired structures will break (Theorem 3) because we cannot choose the embedding dimension m (e.g. for visualizations m = 2; for classifications m = number of classes). 8 We now discuss the technical relations with metric space embedding and manifold learning. Many datasets can be modelled as a finite metric space Mk with k points. A natural unsupervised learning task is to learn an embedding that approximately preserves pairwise distances. The Bourgain embedding [7] guarantees the metric structure can be preserved with distortion O(log k) in lO(log2 k) p . When the samples are collected in Euclidean spaces, i.e. Mk ⊂l2, the Johnson-Lindenstrauss lemma [10] improves the distortion to (1 + ϵ) in lO(log(k/ϵ2)) 2 . These embeddings approximately preserve all pairwise distances - global metric structure of Mk is compatible to the ambient vector space norms. Coming back to our work, it is natural to mimic this approach for precision and recall in Mk. The first problem is that the naive sample based precision and recall are always equal (Section 3.2). A second problem is discrete precision and recall is a non-differentiable objective. In fact, the difficulty of analyzing discrete precision and recall motivates us to look for continuous analogues. Roughly, our approach is somewhat similar to manifold learning where researchers postulate that the data Mk are sampled from a continuous manifold M, typically a smooth or Riemannian manifold M with intrinsic dimension n. In this setting, one is interested in embedding M into l2 locally isometrically. Then one designs learning algorithms that can combine the local information to learn some global structure of M. By relaxing to the continuous cases just like our setting, manifold learning researchers gain access to vast literature in geometry. By the Whitney embedding [25], M can be smoothly embedded into R2n. By the Nash embedding [35], a compact Riemannian manifold M can be isometrically embedded into Rp(n), where p(n) is a quadratic polynomial. Hence the task in manifold learning is wellposed: one seeks an embedding f : M ⊂RN →Rm with m ≤2n ≪N in the smooth category or m ≤p(n) ≪N in the Riemannian category. Note that the embedded manifold metrics (e.g. the Riemannian geodesic distances) are not guaranteed to be compatible to the ambient vector space’s norm structure with a fixed distortion factor, unlike the Bourgain embedding or the Johnson-Lindenstrauss lemma in the discrete setting. A continuous analogue of the norm compatible discrete metric space embeddings is the Kuratowski embedding, which embeds global-isometrically (preserving pairwise distance) any metric space to an infinite dimensional Banach space L∞. With ϵ distortion relaxation, it is possible to embed a compact Riemannian manifold to a finite dimensional normed space. But this appears to be very hard, in that the embedding dimension may grow faster than exponentially in n [30]. Like DR in manifold learning and unlike DR in discrete metric space embedding, rather than global structure we want to preserve local notions such as precision and recall. Unlike DR in manifold learning, since precision and recall are almost equivalent to continuity and injectivity (Theorem 1), we are interested in embeddings in the topological category, instead of the smooth or the Riemannian category. Thus, our work can be considered as manifold learning from the perspective of information retrieval, which leads to the following result. Proposition 2. If m ≥2n, where n is the dimension of the data manifold M in domain and m is the dimension of codomain Rm, then there exists a continuous map f : M →Rm such that f achieves perfect precision and recall for every point x ∈M. Note that the dimension reduction rate is actually much stronger than the case of Riemannian isometric embedding where the lowest embedding dimension grows polynomially [35]. This is because preserving precision and recall is weaker than isometric embedding. A practical implication is that, we can reduce many more dimensions if we only care about precision and recall. 5 Conclusions We characterized the imperfection of dimensionality reduction mappings from a quantitative topology perspective. We showed that perfect precision and perfect recall cannot be both achieved by any DR map. We then proved a non-trivial upper bound for precision for Lipschitz continuous DR maps. To further quantify the distortion, we proposed a new measure based on L2-Wasserstein distances, and also proved its lower bound for Lipschitz continuous DR maps. It is also interesting to analyse the relation between the recall of a continuous DR map and its modulus of continuity. However, the generality and complexiity of the fibers (inverse images) of these maps so far defy our effort and this problem remains open. Furthermore, it is interesting to develop a corresponding theory in the discrete setting. 9 Acknowledgments We would like to thank Yanshuai Cao, Christopher Srinivasa, and the broader Borealis AI team for their discussion and support. We also thank Marcus Brubaker, Cathal Smyth, and Matthew E. Taylor for proofreading the manuscript and their suggestions, as well as April Cooper for creating graphics for this work. References [1] Arseniy Akopyan and Roman Karasev. A tight estimate for the waist of the ball. Bulletin of the London Mathematical Society, 49(4):690–693, 2017. [2] Arseniy Akopyan and Roman Karasev. Waist of balls in hyperbolic and spherical spaces. International Mathematics Research Notices, page rny037, 2018. doi: 10.1093/imrn/rny037. URL http://dx.doi.org/10.1093/imrn/rny037. [3] Hannah Alpert and Larry Guth. A family of maps with many small fibers. Journal of Topology and Analysis, 7(01):73–79, 2015. [4] Jason Altschuler, Jonathan Weed, and Philippe Rigollet. Near-linear time approximation algorithms for optimal transport via sinkhorn iteration. In Advances in Neural Information Processing Systems, pages 1961–1971, 2017. [5] Sanjeev Arora, Wei Hu, and Pravesh K. Kothari. An analysis of the t-sne algorithm for data visualization. In Sébastien Bubeck, Vianney Perchet, and Philippe Rigollet, editors, Proceedings of the 31st Conference On Learning Theory, volume 75 of Proceedings of Machine Learning Research, pages 1455–1462. PMLR, 06–09 Jul 2018. URL http://proceedings.mlr. press/v75/arora18a.html. [6] Nicolas Bonneel, Michiel Van De Panne, Sylvain Paris, and Wolfgang Heidrich. Displacement interpolation using lagrangian mass transport. In ACM Transactions on Graphics (TOG), volume 30, page 158. ACM, 2011. [7] Jean Bourgain. On Lipschitz embedding of finite metric spaces in Hilbert space. Israel Journal of Mathematics, 52(1):46–52, 1985. [8] Christos Boutsidis, Anastasios Zouzias, and Petros Drineas. Random projections for k-means clustering. In NIPS, pages 298–306, 2010. [9] Luis A Caffarelli and Robert J McCann. Free boundaries in optimal transport and MongeAmpére obstacle problems. Annals of mathematics, 171:673–730, 2010. [10] Sanjoy Dasgupta and Anupam Gupta. An elementary proof of a theorem of Johnson and Lindenstrauss. Random Structures & Algorithms, 22(1):60–65, 2003. [11] Alessio Figalli. The optimal partial transport problem. Archive for rational mechanics and analysis, 195(2):533–560, 2010. [12] Rémi Flamary and Nicolas Courty. Pot python optimal transport library, 2017. URL https: //github.com/rflamary/POT. [13] Daniele Granata and Vincenzo Carnevale. Accurate estimation of the intrinsic dimension using graph distances: Unraveling the geometric complexity of datasets. Scientific Reports, 6, 2016. [14] Victor Guillemin and Alan Pollack. Differential topology, volume 370. American Mathematical Soc., 2010. [15] LARRY Guth. The waist inequality in gromov’s work. The Abel Prize 2008, pages 181–195, 2012. [16] Gísli R. Hjaltason and Hanan Samet. Properties of embedding methods for similarity searching in metric spaces. IEEE Trans. Pattern Anal. Mach. Intell., 25(5):530–549, May 2003. ISSN 0162-8828. doi: 10.1109/TPAMI.2003.1195989. URL https://doi.org/10.1109/TPAMI. 2003.1195989. 10 [17] Bo’az Klartag. Convex geometry and waist inequalities. Geometric and Functional Analysis, 27(1):130–164, 2017. [18] Jonathan Korman and Robert J McCann. Insights into capacity-constrained optimal transport. Proceedings of the National Academy of Sciences, 110(25):10064–10067, 2013. [19] Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, 521(7553):436, 2015. [20] Sylvain Lespinats and Michaël Aupetit. Checkviz: Sanity check and topological clues for linear and non-linear mappings. In Computer Graphics Forum, volume 30, pages 113–125. Wiley Online Library, 2011. [21] Laurens Maaten. Learning a parametric embedding by preserving local structure. In Artificial Intelligence and Statistics, pages 384–391, 2009. [22] Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of Machine Learning Research, 9(Nov):2579–2605, 2008. [23] Rafael Messias Martins, Danilo Barbosa Coimbra, Rosane Minghim, and Alexandru C Telea. Visual analysis of dimensionality reduction quality for parameterized projections. Computers & Graphics, 41:26–42, 2014. [24] Robert J McCann and Adam M Oberman. Exact semi-geostrophic flows in an elliptical ocean basin. Nonlinearity, 17(5):1891, 2004. [25] James McQueen, Marina Meila, and Dominique Joncas. Nearly isometric embedding by relaxation. In NIPS, pages 2631–2639, 2016. [26] Michael Müger. A remark on the invariance of dimension. Mathematische Semesterberichte, 62(1):59–68, 2015. [27] Hariharan Narayanan and Sanjoy Mitter. Sample complexity of testing the manifold hypothesis. In NIPS, pages 1786–1794, 2010. [28] Lawrence E Payne. Isoperimetric inequalities and their applications. SIAM review, 9(3): 453–488, 1967. [29] P Rayón and M Gromov. Isoperimetry of waists and concentration of maps. Geometric & Functional Analysis GAFA, 13(1):178–215, 2003. [30] Malte Roeer. On the finite dimensional approximation of the Kuratowski-embedding for compact manifolds. arXiv preprint arXiv:1305.1529, 2013. [31] Bernhard Schölkopf, Alexander Smola, and Klaus-Robert Müller. Kernel principal component analysis. In International Conference on Artificial Neural Networks, pages 583–588. Springer, 1997. [32] Tobias Schreck, Tatiana Von Landesberger, and Sebastian Bremm. Techniques for precisionbased visual analysis of projected data. Information Visualization, 9(3):181–193, 2010. [33] Joshua B Tenenbaum, Vin De Silva, and John C Langford. A global geometric framework for nonlinear dimensionality reduction. Science, 290(5500):2319–2323, 2000. [34] Jarkko Venna, Jaakko Peltonen, Kristian Nybo, Helena Aidos, and Samuel Kaski. Information retrieval perspective to nonlinear dimensionality reduction for data visualization. Journal of Machine Learning Research, 11(Feb):451–490, 2010. [35] Nakul Verma. Distance preserving embeddings for general n-dimensional manifolds. Journal of Machine Learning Research, 14(1):2415–2448, 2013. [36] Xianfu Wang. Volumes of generalized unit balls. Mathematics Magazine, 78(5):390–395, 2005. 11
2018
14
7,297
Learning to Share and Hide Intentions using Information Regularization DJ Strouse1, Max Kleiman-Weiner2, Josh Tenenbaum2 Matt Botvinick3,4, David Schwab5 1 Princeton University, 2 MIT, 3 DeepMind 4 UCL, 5 CUNY Graduate Center Abstract Learning to cooperate with friends and compete with foes is a key component of multi-agent reinforcement learning. Typically to do so, one requires access to either a model of or interaction with the other agent(s). Here we show how to learn effective strategies for cooperation and competition in an asymmetric information game with no such model or interaction. Our approach is to encourage an agent to reveal or hide their intentions using an information-theoretic regularizer. We consider both the mutual information between goal and action given state, as well as the mutual information between goal and state. We show how to optimize these regularizers in a way that is easy to integrate with policy gradient reinforcement learning. Finally, we demonstrate that cooperative (competitive) policies learned with our approach lead to more (less) reward for a second agent in two simple asymmetric information games. 1 Introduction In order to effectively interact with others, an intelligent agent must understand the intentions of others. In order to successfully cooperate, collaborative agents that share their intentions will do a better job of coordinating their plans together [Tomasello et al., 2005]. This is especially salient when information pertinent to a goal is known asymmetrically between agents. When competing with others, a sophisticated agent might aim to hide this information from its adversary in order to deceive or surprise them. This type of sophisticated planning is thought to be a distinctive aspect of human intelligence compared to other animal species [Tomasello et al., 2005]. Furthermore, agents that share their intentions might have behavior that is more interpretable and understandable by people. Many reinforcement learning (RL) systems often plan in ways that can seem opaque to an observer. In particular, when an agent’s reward function is not aligned with the designer’s goal the intended behavior often deviates from what is expected [Hadfield-Menell et al., 2016]. If these agents are also trained to share high-level and often abstract information about its behavior (i.e. intentions) it is more likely a human operator or collaborator can understand, predict, and explain that agents decision. This is key requirement for building machines that people can trust. Previous approaches have tackled aspects of this problem but all share a similar structure [Dragan et al., 2013, Ho et al., 2016, Hadfield-Menell et al., 2016, Shafto et al., 2014]. They optimize their behavior against a known model of an observer which has a theory-of-mind [Baker et al., 2009, Ullman et al., 2009, Rabinowitz et al., 2018] or is doing some form of inverse-RL [Ng et al., 2000, Abbeel and Ng, 2004]. In this work we take an alternative approach based on an information theoretic formulation of the problem of sharing and hiding intentions. This approach does not require an explicit model of or interaction with the other agent, which could be especially useful in settings where interactive training is expensive or dangerous. Our approach also naturally combines with scalable policy-gradient methods commonly used in deep reinforcement learning. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. 2 Hiding and revealing intentions via information-theoretic regularization We consider multi-goal environments in the form of a discrete-time finite-horizon discounted Markov decision process (MDP) defined by the tuple M ≡(S, A, G, P, ρG, ρS, r, γ, T), where S is a state set, A an action set, P : S × A × S →R+ a (goal-independent) probability distribution over transitions, G a goal set, ρG : G →R+ a distribution over goals, ρS : S →R+ a probability distribution over initial states, r : S × G →R a (goal-dependent) reward function γ ∈[0, 1] a discount factor, and T the horizon. In each episode, a goal is sampled and determines the reward structure for that episode. One agent, Alice, will have access to this goal and thus knowledge of the environment’s reward structure, while a second agent, Bob, will not and instead must infer it from observing Alice. We assume that Alice knows in advance whether Bob is a friend or foe and wants to make his task easier or harder, respectively, but that she has no model of him and must train without any interaction with him. Of course, Alice also wishes to maximize her own expected reward η[π] = Eτ hPT t=0 γtr(st, g) i , where τ = (g, s0, a0, s1, a1, . . . , sT ) denotes the episode trajectory, g ∼ρG, s0 ∼ρS, at ∼ πg(at | st), and st+1 ∼P(st+1 | st, at), and πg(a | s; θ) : G × S × A →R+ is Alice’s goaldependent probability distribution over actions (policy) parameterized by θ. It is common in RL to consider loss functions of the form J[π] = η[π] + βℓ[π], where ℓis a regularizer meant to help guide the agent toward desirable solutions. For example, the policy entropy is a common choice to encourage exploration [Mnih et al., 2016], while pixel prediction and control have been proposed to encourage exploration in visually rich environments with sparse rewards [Jaderberg et al., 2017]. The setting we imagine is one in which we would like Alice to perform well in a joint environment with rewards rjoint, but we are only able to train her in a solo setting with rewards rsolo. How do we make sure that Alice’s learned behavior in the solo environment transfers well to the joint environment? We propose the training objective Jtrain = E[rsolo] + βI (where I is some sort of task-relevant information measure) as a useful for proxy for the test objective Jtest = E[rjoint]. The structure of rjoint determines whether the task is cooperative or competitive, and therefore the appropriate sign of β. For example, in the spatial navigation game of section 4.1, a competitive rjoint might provide +1 reward only to the first agent to reach the correct goal (and -1 for reaching the wrong one), whereas a cooperative rjoint might provide each of Alice and Bob with the sum of their individual rewards. In figure 2, we plot related metrics, after training Alice with Jtrain. On the bottom row, we plot the percentage of time Alice beats Bob to the goal (which is her expected reward for the competitive rjoint). On the top row, we plot Bob’s expected time steps per unit reward, relative to Alice’s. Their combined steps per unit reward would be more directly related to the cooperative rjoint described above, but we plot Bob’s individual contribution (relative to Alice’s), since his individual contribution to the joint reward rate varies dramatically with β, whereas Alice’s does not. We note that one advantage of our approach is that it unifies cooperative and competitive strategies in the same one-parameter (β) family. Below, we will consider two different information regularizers meant to encourage/discourage Alice from sharing goal information with Bob: the (conditional) mutual information between goal and action given state, Iaction[π] ≡I(A; G | S), which we will call the "action information", and the mutual information between state and goal, Istate[π] ≡I(S; G), which we will call the "state information." Since the mutual information is a general measure of dependence (linear and non-linear) between two variables, Iaction and Istate measure the ease in inferring the goal from the actions and states, respectively, generated by the policy π. Thus, if Alice wants Bob to do well, she should choose a policy with high information, and vice versa if not. We consider both action and state informations because they have different advantages and disadvantages. Using action information assumes that Bob (the observer) can see both Alice’s states and actions, which may be unrealistic in some environments, such as one in which the actions are the torques a robot applies to its joint angles [Eysenbach et al., 2019]. Using state information instead only assumes that Bob can observe Alice’s states (and not actions), however it does so at the cost of requiring Alice to count goal-dependent state frequencies under the current policy. Optimizing action information, on the other hand, does not require state counting. So, in summary, action information is simpler to optimize, but state information may be more appropriate to use in a setting where an observer can’t observe (or infer) the observee’s actions. 2 The generality with which mutual information measures dependence is at once its biggest strength and weakness. On the one hand, using information allows Alice to prepare for interaction with Bob with neither a model of nor interaction with him. On the other hand, Bob might have limited computational resources (for example, perhaps his policy is linear with respect to his observations of Alice) and so he may not be able to “decode” all of the goal information that Alice makes available to him. Nevertheless, Iaction and Istate can at least be considered upper bounds on Bob’s inference performance; if Iaction = 0 or Istate = 0, it would be impossible for Bob to guess the goal (above chance) from Alice’s actions or states, respectively, alone. Optimizing information can be equivalent to optimizing reward under certain conditions, such as in the following example. Consider Bob’s subtask of identifying the correct goal in a 2-goal setup. If his belief over the goal is represented by p(g), then he should guess g∗= argmaxgp(g), which results in error probability perr = 1 −maxg p(g). Since the binary entropy function H(g) ≡H[p(g)] increases monotonically with perr, optimizing one is equivalent to optimizing the other. Denoting the parts of Alice’s behavior observable by Bob as x, then H(g | x) is the post-observation entropy in Bob’s beliefs, and optimizing it is equivalent to optimizing I(g; x) = H(g) −H(g | x), since the pre-observation entropy H(g) is not dependent on Alice’s behavior. If Bob receives reward r when identifying the right goal, and 0 otherwise, then his expected reward is (1 −perr) r. Thus, in this simplified setup, optimizing information is directly related to optimizing reward. In general, when one considers the temporal dynamics of an episode, more than two goals, or more complicated reward structures, the relationship becomes more complicated. However, information is useful in abstracting away that complexity, and preparing Alice generically for a plethora of possible task setups. 2.1 Optimizing action information: Iaction ≡I(A; G | S) First, we discuss regularization via optimizing the mutual information between goal and action (conditioned on state), Iaction ≡I(A; G | S), where G is the goal for the episode, A is the chosen action, and S is the state of the agent. That is, we will train an agent to maximize the objective Jaction[π] ≡E[r] + βIaction, where β is a tradeoff parameters whose sign determines whether we want the agent to signal (positive) or hide (negative) their intentions, and whose magnitude determines the relative preference for rewards and intention signaling/hiding. Iaction is a functional of the multi-goal policy πg(a | s) ≡p(a | s, g), that is the probability distribution over actions given the current goal and state, and is given by: Iaction ≡I(A; G | S) = X s p(s) I(A; G | S = s) (1) = X g ρG(g) X s p(s | g) X a πg(a | s) log πg(a | s) p(a | s) . (2) The quantity involving the sum over actions is a KL divergence between two distributions: the goaldependent policy πg(a | s) and a goal-independent policy p(a | s). This goal-independent policy comes from marginalizing out the goal, that is p(a | s) = P g ρG(g) πg(a | s), and can be thought of as a fictitious policy that represents the agent’s “habit” in the absence of knowing the goal. We will denote π0(a | s) ≡p(a | s) and refer to it as the “base policy,” whereas we will refer to πg(a | s) as simply the “policy.” Thus, we can rewrite the information above as: Iaction = X g ρG(g) X s p(s | g) KL[πg(a | s) | π0(a | s)] = Eτ[KL[πg(a | s) | π0(a | s)]] . (3) Writing the information this way suggests a method for stochastically estimating it. First, we sample a goal g from p(g), that is we initialize an episode of some task. Next, we sample states s from p(s | g), that is we generate state trajectories using our policy πg(a | s). At each step, we measure the KL between the policy and the base policy. Averaging this quantity over episodes and steps give us our estimate of Iaction. Optimizing Iaction with respect to the policy parameters θ is a bit trickier, however, because the expectation above is with respect to a distribution that depends on θ. Thus, the gradient of Iaction with 3 Algorithm 1 Action information regularized REINFORCE with value baseline. Input: β, ρG, γ, and ability to sample MDP M Initialize π, parameterized by θ Initialize V , parameterized by φ for i = 1 to Nepisodes do Generate trajectory τ = (g, s0, a0, s1, a1, . . . , sT ) for t = 0 to T −1 do Update policy in direction of ∇θJaction(t) using equation 6 Update value in direction of −∇φ  Vg(st) −˜Rt 2 with ˜r(t) according to equation 7 end for end for respect to θ has two terms: ∇θIaction = X g ρG(g) X s (∇θp(s | g)) KL[πg(a | s) | π0(a | s)] (4) + X g ρG(g) X s p(s | g) ∇θKL[πg(a | s) | π0(a | s)] . (5) The second term involves the same sum over goals and states as in equation 3, so it can be written as an expectation over trajectories, Eτ[∇θKL[πg(a | s) | π0(a | s)]], and therefore is straightforward to estimate from samples. The first term is more cumbersome, however, since it requires us to model (the policy dependence of) the goal-dependent state probabilities, which in principle involves knowing the dynamics of the environment. Perhaps surprisingly, however, the gradient can still be estimated purely from sampled trajectories, by employing the so-called “log derivative” trick to rewrite the term as an expectation over trajectories. The calculation is identical to the proof of the policy gradient theorem [Sutton et al., 2000], except with reward replaced by the KL divergence above. The resulting Monte Carlo policy gradient (MCPG) update is: ∇θJaction(t) =Aaction(t) ∇θ log πg(at | st) + β∇θKL[πg(a | st) | π0(a | st)] , (6) where Aaction(t) ≡˜Rt −Vg(st) is a modified advantage, Vg(st) is a goal-state value function regressed toward ˜Rt, ˜Rt = PT t′=t γt ′−t˜rt′ is a modified return, and the following is the modified reward feeding into that return: ˜rt ≡rt + βKL[πg(a | st) | π0(a | st)] . (7) The second term in equation 6 encourages the agent to alter the policy to share or hide information in the present state. The first term, on the other hand, encourages modifications which lead the agent to states in the future which result in reward and the sharing or hiding of information. Together, this optimizes Jaction. This algorithm is summarized in algorithm 2.1. 2.2 Optimizing state information: Istate ≡I(S; G) We now consider how to regularize an agent by the information one’s states give away about the goal, using the mutual information between state goal, Istate ≡I(S; G). This can be written: Istate = X g ρG(g) X s p(s | g) log p(s | g) p(s) = Eτ  log p(s | g) p(s)  . (8) In order to estimate this quantity, we could track and plug into the above equation the empirical state frequencies pemp(s | g) ≡Ng(s) Ng and pemp(s) ≡N(s) N , where Ng(s) is the number of times state s was visited during episodes with goal g, Ng ≡P s Ng(s) is the total number of steps taken under goal g, N(s) ≡P g Ng(s) is the number of times state s was visited across all goals, and N ≡P g,s Ng(s) = P g Ng = P s N(s) is the total number of state visits across all goals and states. Thus, keeping a moving average of log pemp(st|g) pemp(st) across episodes and steps yields an estimate of Istate. 4 Algorithm 2 State information regularized REINFORCE with value baseline. Input: β, ρG, γ, and ability to sample MDP M Initialize π, parameterized by θ Initialize V , parameterized by φ Initialize the state counts Ng(s) for i = 1 to Nepisodes do Generate trajectory τ = (g, s0, a0, s1, a1, . . . , sT ) Update Ng(s) (and therefore pemp(s | g)) according to τ for t = 0 to T −1 do Update policy in direction of ∇θJstate(t) using equation 11 Update value in direction of −∇φ  Vg(st) −˜Rt 2 with ˜r(t) according to equation 12 end for end for However, we are of course interested in optimizing Istate and so, as in the last section, we need to employ a slightly more sophisticated estimate procedure. Taking the gradient of Istate with respect to the policy parameters θ, we get: ∇θIstate = X g ρG(g) X s (∇θp(s | g)) log p(s | g) p(s) (9) + X g ρG(g) X s p(s | g) ∇θp(s | g) p(s | g) −∇θp(s) p(s)  . (10) The calculation is similar to that for evaluating ∇θIaction and details can be found in section S1. The resulting MCPG update is: ∇θJstate(t) =Astate(t) ∇θ log πg(at | st) −β X g′̸=g ρG  g ′ Rcf  t, g, g ′ ∇θ log πg′ (at | st) , (11) where Astate(t) ≡˜Rt −Vg(st) is a modified advantage, Vg(st) is a goal-state value function regressed toward ˜Rt, ˜Rt ≡PT t′=t γt ′−t˜rt′ is a modified return, Rcf  t, g, g ′ ≡PT t′=t γt ′−trcf  t ′, g, g ′ is a “counterfactual goal return”, and the following are a modified reward and a “counterfactual goal reward”, respectively, which feed into the above returns: ˜rt ≡rt + β  1 −pemp(g | st) + log pemp(st | g) pemp(st)  (12) rcf  t, g, g ′ ≡   tY t′=0 πg′ (at′ | st′ ) πg(at′ | st′ )  pemp(st | g) pemp(st) , (13) where pemp(g | st) ≡ρG(g) pemp(st|g) pemp(st) . The modified reward can be viewed as adding a “state uniqueness bonus” log pemp(st|g) pemp(st) that tries to increase the frequency of the present state under the present goal to the extent that the present state is more common under the present goal. If the present state is less common than average under the present goal, then this bonus becomes a penalty. The counterfactual goal reward, on the other hand, tries to make the present state less common under other goals, and is again scaled by uniqueness under the present goal pemp(st|g) pemp(st) . It also includes importance sampling weights to account for the fact that the trajectory was generated under the current goal, but the policy is being modified under other goals. This algorithm is summarized in algorithm 2.2. 3 Related work Whye Teh et al. [2017] recently proposed an algorithm similar to our action information regularized approach (algorithm 2.1), but with very different motivations. They argued that constraining goalspecific policies to be close to a distilled base policy promotes transfer by sharing knowledge 5 across goals. Due to this difference in motivation, they only explored the β < 0 regime (i.e. our “competitive” regime). They also did not derive their update from an information-theoretic cost function, but instead proposed the update directly. Because of this, their approach differs in that it did not include the β∇θKL[πg | π0] term, and instead only included the modified return. Moreover, they did not calculate the full KLs in the modified return, but instead estimated them from single samples (e.g. KL[πg(a | st) | π0(a | st)] ≈log πg(at|st) π0(at|st)). Nevertheless, the similarity in our approaches suggest a link between transfer and competitive strategies, although we do not explore this here. Eysenbach et al. [2019] also recently proposed an algorithm similar to ours, which used both Istate and Iaction but with the “goal” replaced by a randomly sampled “skill” label in an unsupervised setting (i.e. no reward). Their motivation was to learn a diversity of skills that would later would be useful for a supervised (i.e. reward-yielding) task. Their approach to optimizing Istate differs from ours in that it uses a discriminator, a powerful approach but one that, in our setting, would imply a more specific model of the observer which we wanted to avoid. Tsitsiklis and Xu [2018] derive an inverse tradeoff between an agent’s delay in reaching a goal and the ability of an adversary to predict that goal. Their approach relies on a number of assumptions about the environment (e.g. agent’s only source of reward is reaching the goal, opponent only need identify the correct goal and not reach it as well, nearly uniform goal distribution), but is suggestive of the general tradeoff. It is an interesting open question as to under what conditions our information-regularized approach achieves the optimal tradeoff. Dragan et al. [2013] considered training agents to reveal their goals (in the setting of a robot grasping task), but did so by building an explicit model of the observer. Ho et al. [2016] uses a similar model to capture human generated actions that “show” a goal also using an explicit model of the observer. There is also a long history of work on training RL agents to cooperate and compete through interactive training and a joint reward (e.g. [Littman, 1994, 2001, Kleiman-Weiner et al., 2016, Leibo et al., 2017, Peysakhovich and Lerer, 2018, Hughes et al., 2018]), or through modeling one’s effect on another agent’s learning or behavior (e.g. [Foerster et al., 2018, Jaques et al., 2018]). Our approach differs in that it requires neither access to an opponent’s rewards, nor even interaction with or a model of the opponent. Without this knowledge, one can still be cooperative (competitive) with others by being as (un)clear as possible about one’s own intentions. Our work achieves this by directly optimizing information shared. 4 Experiments We demonstrate the effectiveness of our approach in two stages. First, we show that training Alice (who has access to the goal of the episode) with information regularization effectively encourages both goal signaling and hiding, depending on the sign of the coefficient β. Second, we show that Alice’s goal signaling and hiding translate to higher and lower rates of reward acquisition for Bob (who does not have access to the goal and must infer it from observing Alice), respectively. We demonstrate these results in two different simple settings. Our code is available at https://github.com/djstrouse/InfoMARL. 4.1 Spatial navigation The first setting we consider is a simple grid world spatial navigation task, where we can fully visualize and understand Alice’s regularized policies. The 5 × 5 environment contains two possible goals: the top left state or the top right. On any given episode, one goal is chosen randomly (so ρG is uniform) and that goal state is worth +1 reward. The other goal state is then worth −1. Both are terminal. Each of Alice and Bob spawn in a random (non-terminal) state and take actions in A = {left, right, up, down, stay}. A step into a wall is equivalent to the stay action but results in a penalty of −.1 reward. We first train Alice alone, and then freeze her parameters and introduce Bob. Alice was trained using implementations of algorithms 2.1 and 2.2 in TensorFlow [Abadi et al., 2016]. Given the small, discrete environment, we used tabular representations for both π and V . See section S2.1 for training parameters. Examples of Alice’s resulting policies are shown in figure 1. The top row contains policies regularized with Iaction, the bottom with Istate. The left column contains “cooperative” policies encouraged to share goal information (β = .025), the middle “ambivalent” policies that are unregularized (β = 0), 6 log p (s | g) p (s) <latexit sha1_base64="h6T6zC0wlMaHrFmdJj+BYkO9Xm8=">ACGnicbZDLSsNAFIYn9VbrLerSzWAR6qYkRVB3BTcuKxhbaEKZTCfp0MmFmROhL6HG1/FjQsVd+LGt3HSBtTWHwZ+vnMOZ87vp4IrsKwvo7Kyura+Ud2sbW3v7O6Z+wd3KskZQ5NRCJ7PlFM8Jg5wEGwXioZiXzBuv74qh375lUPIlvYZIyLyJhzANOCWg0MFuSEI3kITmqStYA3lRnyIQ1fycASn0x9cgtrArFtNaya8bOzS1FGpzsD8cIcJzSIWAxVEqb5tpeDlRAKngk1rbqZYSuiYhKyvbUwiprx8dtsUn2gyxEi9YsBz+jviZxESk0iX3dGBEZqsVbA/2r9DIL+dxmgGL6XxRkAkMCS6CwkMuGQUx0YZQyfVfMR0RHRToOIsQ7MWTl43Tal427Zuzetsq06iI3SMGshG56iNrlEHOYiB/SEXtCr8Wg8G2/G+7y1YpQzh+iPjM9v62OheA=</latexit><latexit sha1_base64="h6T6zC0wlMaHrFmdJj+BYkO9Xm8=">ACGnicbZDLSsNAFIYn9VbrLerSzWAR6qYkRVB3BTcuKxhbaEKZTCfp0MmFmROhL6HG1/FjQsVd+LGt3HSBtTWHwZ+vnMOZ87vp4IrsKwvo7Kyura+Ud2sbW3v7O6Z+wd3KskZQ5NRCJ7PlFM8Jg5wEGwXioZiXzBuv74qh375lUPIlvYZIyLyJhzANOCWg0MFuSEI3kITmqStYA3lRnyIQ1fycASn0x9cgtrArFtNaya8bOzS1FGpzsD8cIcJzSIWAxVEqb5tpeDlRAKngk1rbqZYSuiYhKyvbUwiprx8dtsUn2gyxEi9YsBz+jviZxESk0iX3dGBEZqsVbA/2r9DIL+dxmgGL6XxRkAkMCS6CwkMuGQUx0YZQyfVfMR0RHRToOIsQ7MWTl43Tal427Zuzetsq06iI3SMGshG56iNrlEHOYiB/SEXtCr8Wg8G2/G+7y1YpQzh+iPjM9v62OheA=</latexit><latexit sha1_base64="h6T6zC0wlMaHrFmdJj+BYkO9Xm8=">ACGnicbZDLSsNAFIYn9VbrLerSzWAR6qYkRVB3BTcuKxhbaEKZTCfp0MmFmROhL6HG1/FjQsVd+LGt3HSBtTWHwZ+vnMOZ87vp4IrsKwvo7Kyura+Ud2sbW3v7O6Z+wd3KskZQ5NRCJ7PlFM8Jg5wEGwXioZiXzBuv74qh375lUPIlvYZIyLyJhzANOCWg0MFuSEI3kITmqStYA3lRnyIQ1fycASn0x9cgtrArFtNaya8bOzS1FGpzsD8cIcJzSIWAxVEqb5tpeDlRAKngk1rbqZYSuiYhKyvbUwiprx8dtsUn2gyxEi9YsBz+jviZxESk0iX3dGBEZqsVbA/2r9DIL+dxmgGL6XxRkAkMCS6CwkMuGQUx0YZQyfVfMR0RHRToOIsQ7MWTl43Tal427Zuzetsq06iI3SMGshG56iNrlEHOYiB/SEXtCr8Wg8G2/G+7y1YpQzh+iPjM9v62OheA=</latexit><latexit sha1_base64="h6T6zC0wlMaHrFmdJj+BYkO9Xm8=">ACGnicbZDLSsNAFIYn9VbrLerSzWAR6qYkRVB3BTcuKxhbaEKZTCfp0MmFmROhL6HG1/FjQsVd+LGt3HSBtTWHwZ+vnMOZ87vp4IrsKwvo7Kyura+Ud2sbW3v7O6Z+wd3KskZQ5NRCJ7PlFM8Jg5wEGwXioZiXzBuv74qh375lUPIlvYZIyLyJhzANOCWg0MFuSEI3kITmqStYA3lRnyIQ1fycASn0x9cgtrArFtNaya8bOzS1FGpzsD8cIcJzSIWAxVEqb5tpeDlRAKngk1rbqZYSuiYhKyvbUwiprx8dtsUn2gyxEi9YsBz+jviZxESk0iX3dGBEZqsVbA/2r9DIL+dxmgGL6XxRkAkMCS6CwkMuGQUx0YZQyfVfMR0RHRToOIsQ7MWTl43Tal427Zuzetsq06iI3SMGshG56iNrlEHOYiB/SEXtCr8Wg8G2/G+7y1YpQzh+iPjM9v62OheA=</latexit> KL[πg | π0] <latexit sha1_base64="Void8yb/qgZYM6D60KVlLxz2Kc=">ACE3icbZBNS8NAEIY3ftb6FfXoJVoEQSiJCOqt4EXQwVjC0om+2kXbr5YHcilpAf4cW/4sWDilcv3vw3pmkO2vrCwsM7M8zO68WCKzTNb21ufmFxabmyUl1dW9/Y1Le271SUSAY2i0Qk2x5VIHgINnIU0I4l0MAT0PKGF+N6x6k4lF4i6MY3ID2Q+5zRjG3uvqRg/CA6dV15uw5AnzsODHvpv3MCXivQDNzJO8P0K129ZpZNwsZs2CVUCOlml39y+lFLAkgRCaoUh3LjNFNqUTOBGRVJ1EQUzakfejkGNIAlJsWR2XGQe70D+S+QvRKNzfEykNlBoFXt4ZUByo6drY/K/WSdA/c1MexglCyCaL/EQYGBnjhIwel8BQjHKgTPL8rwYbUEkZ5jmOQ7CmT54F+7h+XrduTmoNs0yjQnbJPjkFjklDXJmsQmjDySZ/JK3rQn7UV71z4mrXNaObND/kj7/AHQc57Q</latexit><latexit sha1_base64="Void8yb/qgZYM6D60KVlLxz2Kc=">ACE3icbZBNS8NAEIY3ftb6FfXoJVoEQSiJCOqt4EXQwVjC0om+2kXbr5YHcilpAf4cW/4sWDilcv3vw3pmkO2vrCwsM7M8zO68WCKzTNb21ufmFxabmyUl1dW9/Y1Le271SUSAY2i0Qk2x5VIHgINnIU0I4l0MAT0PKGF+N6x6k4lF4i6MY3ID2Q+5zRjG3uvqRg/CA6dV15uw5AnzsODHvpv3MCXivQDNzJO8P0K129ZpZNwsZs2CVUCOlml39y+lFLAkgRCaoUh3LjNFNqUTOBGRVJ1EQUzakfejkGNIAlJsWR2XGQe70D+S+QvRKNzfEykNlBoFXt4ZUByo6drY/K/WSdA/c1MexglCyCaL/EQYGBnjhIwel8BQjHKgTPL8rwYbUEkZ5jmOQ7CmT54F+7h+XrduTmoNs0yjQnbJPjkFjklDXJmsQmjDySZ/JK3rQn7UV71z4mrXNaObND/kj7/AHQc57Q</latexit><latexit sha1_base64="Void8yb/qgZYM6D60KVlLxz2Kc=">ACE3icbZBNS8NAEIY3ftb6FfXoJVoEQSiJCOqt4EXQwVjC0om+2kXbr5YHcilpAf4cW/4sWDilcv3vw3pmkO2vrCwsM7M8zO68WCKzTNb21ufmFxabmyUl1dW9/Y1Le271SUSAY2i0Qk2x5VIHgINnIU0I4l0MAT0PKGF+N6x6k4lF4i6MY3ID2Q+5zRjG3uvqRg/CA6dV15uw5AnzsODHvpv3MCXivQDNzJO8P0K129ZpZNwsZs2CVUCOlml39y+lFLAkgRCaoUh3LjNFNqUTOBGRVJ1EQUzakfejkGNIAlJsWR2XGQe70D+S+QvRKNzfEykNlBoFXt4ZUByo6drY/K/WSdA/c1MexglCyCaL/EQYGBnjhIwel8BQjHKgTPL8rwYbUEkZ5jmOQ7CmT54F+7h+XrduTmoNs0yjQnbJPjkFjklDXJmsQmjDySZ/JK3rQn7UV71z4mrXNaObND/kj7/AHQc57Q</latexit><latexit sha1_base64="Void8yb/qgZYM6D60KVlLxz2Kc=">ACE3icbZBNS8NAEIY3ftb6FfXoJVoEQSiJCOqt4EXQwVjC0om+2kXbr5YHcilpAf4cW/4sWDilcv3vw3pmkO2vrCwsM7M8zO68WCKzTNb21ufmFxabmyUl1dW9/Y1Le271SUSAY2i0Qk2x5VIHgINnIU0I4l0MAT0PKGF+N6x6k4lF4i6MY3ID2Q+5zRjG3uvqRg/CA6dV15uw5AnzsODHvpv3MCXivQDNzJO8P0K129ZpZNwsZs2CVUCOlml39y+lFLAkgRCaoUh3LjNFNqUTOBGRVJ1EQUzakfejkGNIAlJsWR2XGQe70D+S+QvRKNzfEykNlBoFXt4ZUByo6drY/K/WSdA/c1MexglCyCaL/EQYGBnjhIwel8BQjHKgTPL8rwYbUEkZ5jmOQ7CmT54F+7h+XrduTmoNs0yjQnbJPjkFjklDXJmsQmjDySZ/JK3rQn7UV71z4mrXNaObND/kj7/AHQc57Q</latexit> action regularized state regularized cooperative competitive ambivalent Figure 1: Information-regularized policies. Top row: regularization with Iaction. Bottom row: regularization with Istate. Left column: β = .025. Center column: β = 0. Right column: β = .025. See main text for additional details. and the right “competitive” policies encouraged to hide goal information (β = −.025). In each case, two policies are shown - at left, the policy when the goal is in the top left, and at right, when it is in the top right. The arrows are proportional to Alice’s action probabilities. The color scale indicates KL[πg | π0] and log pemp(s|g) pemp(s) in bits for action and state information regularization, respectively. Thus, bluer indicates more goal information shared in that state. In the cooperative case with action information regularization, Alice wants to maximize KL[πg | π0] and thus she wants her goal-dependent policies to differ as much as possible. This primarily results in her going left in most states when the goal is in the top left, and right when its in the top right. She can also choose to have some probability of going up in those states, as long as she only does so under one goal or the other and not both. Ultimately this means that no matter what state Alice spawns in, she immediately signals the goal with her very first action, and continues to do so with each subsequent action. In the competitive case with action information regularization, Alice instead wants to minimize KL[πg | π0] and thus she wants her goal-dependent policies to match as much as possible. In the present case, this means that she chooses to go up as far as she can until she must pivot in order to still reach the goal in the minimal number of steps. This leads to her hiding the goal for as long as possible without sacrificing reward. Without information regularization, Alice’s policy is a random mixture of the competitive and cooperative strategies, the details of which are determined by initialization and the randomness of training trajectories. Regularization with state information yields similar policies to those generated with action information in all three cases, since in this deterministic setting, different action choices are tightly coupled with different state trajectories. To demonstrate that Alice’s goal revealing and hiding behaviors are useful for cooperation and competition, respectively, we then trained a second agent, Bob, who does not have access to the goal and instead must infer it from observing Alice. Thus, while Alice’s inputs at time t were the present goal g and her state salice t , Bob’s are Alice’s present state and action salice t and aalice t , as well as his own state sbob t . Details are available in section S2.1, but in brief, Bob processes Alice’s state-action trajectories with an RNN to form a belief about the goal, which then feeds into his policy, all of which is trained end-to-end via REINFORCE. We trained 5 of each of the 3 versions of Alice above, and 10 Bobs per Alice. We plot the results for the best performing Bob for each Alice (so 5 × 3 = 15 curves) in figure 2. We use all 5 Alices to estimate the variance in our approach, but the best-of-10 Bob to provide a reasonable estimate of the best performance of a friend/foe. We measure Bob’s performance in terms of his episode length, relative to Alice’s, as well as the percentage of time he beats Alice to the goal. For both action and state information regularization, encouraging Alice to hide goal information leads to Bob taking about 30% longer to reach the goal relative to when Alice is encouraged to share goal information. Information-hiding Alice receives a boost of similar magnitude in the frequency with which she beats Bob to the goal. Training without information regularization leads to results in between the competitive and cooperative strategies, 7 action regularized state regularized Figure 2: The effect of Alice hiding/sharing goal information on Bob’s performance. Left column: regularization with Iaction. Right column: regularization with Istate. Top row: Bob’s episode length relative to Alice’s (moving average over 500 episodes). Bottom row: the percentage of time Alice beats Bob to the goal (moving average over 1000 episodes). although closer to the cooperative strategy in this case. We also note that the variance in Bob’s performance was higher for the unregularized case, and much higher for the competitive case, with nearly zero variance in performance for the cooperative case, indicating that information hiding and sharing make training harder and easier, respectively. 4.2 Key-and-door game In the above spatial navigation task, information regularization of Alice breaks symmetries between equally-preferred (in terms of reward) navigation strategies. However, in many scenarios, it might be worthwhile for an agent to give up some reward if it means large gains in the ability to hide or share information. To demonstrate that our approach could also discover such “lossy” strategies, we designed a simple key-and-door game with this feature (figure 3, left). It is again a two-goal (door) game with the same action space and reward structure as the spatial navigation setting. Alice again alone receives the goal, and Bob must infer it from observing her. The difference is that, in order to enter the terminal states, Alice and Bob must first pick up an appropriate key. Each agent has goal-specific keys that only they can pick up (top/bottom rows, color-coded to door, labeled with A/B for Alice/Bob). Alice also has access to a master key that can open both doors (center right). Agents can only pick up one key per episode - the first they encounter. Bob spawns in the same location every time (the “B”), while Alice spawns in any of the 3 spaces between her two goal-specific keys (the “A” and spaces above/below). This means that Bob has a shorter path to the goals, and thus if Alice telegraphs the goal right away, Bob will beat her to it. While Alice’s master key is strictly on a longer path to the goal, picking it up allows her to delay informing Bob of the goal such that she can beat him to it. We trained Alice with action information regularization as in the previous section (see section S2.2 for training parameters). When unregularized or encouraged to share goal information (β = .25), Alice simply took the shortest path to the goal, never picking up the master key. When Bob was trained on these Alices, he beat/tied her to the goal on approximately 100% of episodes (figure 3, right). When encouraged to hide information (β = −.25), however, we found that Alice learned to take the longer path via the master key on about half of initializations (example in figure 3, center). When Bob was trained on these Alices, he beat/tied her to the goal much less than half the time (figure 3, right). Thus, our approach successfully encourages Alice us to forgo rewards during solo training in order to later compete more effectively in an interactive setting. 8 B B A A B A A Figure 3: Key-and-door game results. Left: depiction of game. Center: percentage episodes in which Alice picks up goal-specific vs master key during training in an example run (moving average over 100 episodes). Right: percentage episodes in which Bob beats/tie Alice to the goal (moving average over 1000 episodes). 5 Discussion In this work, we developed a new framework for building agents that balance reward-seeking with information-hiding/sharing behavior. We demonstrate that our approach allows agents to learn effective cooperative and competitive strategies in asymmetric information games without an explicit model or interaction with the other agent(s). Such an approach could be particularly useful in settings where interactive training with other agents could be dangerous or costly, such as the training of expensive robots or the deployment of financial trading strategies. We have here focused on simple environments with discrete and finite states, goals, and actions, and so we briefly describe how to generalize our approach to more complex environments. When optimizing Iaction with many or continuous actions, one could stochastically approximate the action sum in KL[πg | π0] and its gradient (as in [Whye Teh et al., 2017]). Alternatively, one could choose a form for the policy πg and base policy π0 such that the KL is analytic. For example, it is common for πg to be Gaussian when actions are continuous. If one also chooses to use a Gaussian approximation for π0 (forming a variational bound on Iaction), then KL[πg | π0] is closed form. For optimizing Istate with continuous states, one can no longer count states exactly, so these counts could be replaced with, for example, a pseudo-count based on an approximate density model. [Bellemare et al., 2016, Ostrovski et al., 2017] Of course, for both types of information regularization, continuous states or actions also necessitate using function approximation for the policy representation. Finally, although we have assumed access to the goal distribution ρG, one could also approximate it from experience. Acknowledgements The authors would like to acknowledge Dan Roberts and our anonymous reviewers for careful comments on the original draft; Jane Wang, David Pfau, and Neil Rabinowitz for discussions on the original idea; and funding from the Hertz Foundation (DJ and Max), The Center for Brain, Minds and Machines (NSF #1231216) (Max and Josh), the NSF Center for the Physics of Biological Function (PHY-1734030) (David), and as a Simons Investigator in the MMLS (David). References Martín Abadi, Paul Barham, Jianmin Chen, Zhifeng Chen, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Geoffrey Irving, Michael Isard, Manjunath Kudlur, Josh Levenberg, Rajat Monga, Sherry Moore, Derek G. Murray, Benoit Steiner, Paul Tucker, Vijay Vasudevan, Pete Warden, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. Tensorflow: A system for large-scale machine learning. In Proceedings of the 12th USENIX Conference on Operating Systems Design and Implementation, 2016. Pieter Abbeel and Andrew Y Ng. Apprenticeship learning via inverse reinforcement learning. In Proceedings of the Twenty-First International Conference on Machine Learning (ICML), 2004. Chris L Baker, Rebecca Saxe, and Joshua B Tenenbaum. Action understanding as inverse planning. Cognition, 113(3):329–349, 2009. 9 Marc Bellemare, Sriram Srinivasan, Georg Ostrovski, Tom Schaul, David Saxton, and Remi Munos. Unifying count-based exploration and intrinsic motivation. In Advances in Neural Information Processing Systems (NIPS) 29, pages 1471–1479. 2016. Kyunghyun Cho, Bart van Merrienboer, Çaglar Gülçehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translation. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1724–1734, 2014. Anca D. Dragan, Kenton C.T. Lee, and Siddhartha S. Srinivasa. Legibility and predictability of robot motion. International Conference on Human-Robot Interaction (HRI), pages 301–308, 2013. Benjamin Eysenbach, Abhishek Gupta, Julian Ibarz, and Sergey Levine. Diversity is All You Need: Learning Skills without a Reward Function. In International Conference on Learning Representations (ICLR), 2019. Jakob Foerster, Richard Y. Chen, Maruan Al-Shedivat, Shimon Whiteson, Pieter Abbeel, and Igor Mordatch. Learning with opponent-learning awareness. In Proceedings of the 17th International Conference on Autonomous Agents and MultiAgent Systems (AAMAS), pages 122–130, 2018. Dylan Hadfield-Menell, Stuart J Russell, Pieter Abbeel, and Anca Dragan. Cooperative inverse reinforcement learning. In Advances in Neural Information Processing Systems (NIPS) 29, pages 3909–3917, 2016. Mark K Ho, Michael Littman, James MacGlashan, Fiery Cushman, and Joseph L Austerweil. Showing versus doing: Teaching by demonstration. In Advances In Neural Information Processing Systems (NIPS) 29, pages 3027–3035, 2016. Edward Hughes, Joel Z Leibo, Matthew Phillips, Karl Tuyls, Edgar Dueñez Guzman, Antonio García Castañeda, Iain Dunning, Tina Zhu, Kevin McKee, Raphael Koster, Heather Roff, and Thore Graepel. Inequity aversion improves cooperation in intertemporal social dilemmas. In Advances in Neural Information Processing Systems (NIPS) 31, pages 3330–3340. 2018. Max Jaderberg, Volodymyr Mnih, Wojciech Marian Czarnecki, Tom Schaul, Joel Z. Leibo, David Silver, and Koray Kavukcuoglu. Reinforcement Learning with Unsupervised Auxiliary Tasks. In International Conference on Learning Representations (ICLR), 2017. Natasha Jaques, Angeliki Lazaridou, Edward Hughes, Çaglar Gülçehre, Pedro A. Ortega, DJ Strouse, Joel Z. Leibo, and Nando de Freitas. Intrinsic social motivation via causal influence in multi-agent RL. CoRR, abs/1810.08647, 2018. Max Kleiman-Weiner, Mark K Ho, Joseph L Austerweil, Michael L Littman, and Joshua B Tenenbaum. Coordinate to cooperate or compete: abstract goals and joint intentions in social interaction. In Proceedings of the 38th Annual Conference of the Cognitive Science Society, 2016. Joel Z Leibo, Vinicius Zambaldi, Marc Lanctot, Janusz Marecki, and Thore Graepel. Multi-agent reinforcement learning in sequential social dilemmas. In Proceedings of the 16th Conference on Autonomous Agents and MultiAgent Systems (AAMAS), pages 464–473, 2017. Michael L Littman. Markov games as a framework for multi-agent reinforcement learning. In Proceedings of the 11th International Conference on Machine Learning (ICML), pages 157–163, 1994. Michael L Littman. Friend-or-foe q-learning in general-sum games. In Proceedings of the 28th International Conference on Machine Learning (ICML), pages 322–328, 2001. 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 Proceedings of The 33rd International Conference on Machine Learning (ICML), pages 1928–1937, 2016. Andrew Y Ng, Stuart J Russell, et al. Algorithms for inverse reinforcement learning. In Proceedings of the 17th International Conference on Machine Learning (ICML), pages 663–670, 2000. 10 Georg Ostrovski, Marc G. Bellemare, Aäron van den Oord, and Rémi Munos. Count-based exploration with neural density models. In Proceedings of the 34th International Conference on Machine Learning (ICML), pages 2721–2730, 2017. Alexander Peysakhovich and Adam Lerer. Prosocial learning agents solve generalized stag hunts better than selfish ones. In Proceedings of the 17th International Conference on Autonomous Agents and MultiAgent Systems (AAMAS), pages 2043–2044, 2018. Neil Rabinowitz, Frank Perbet, Francis Song, Chiyuan Zhang, S. M. Ali Eslami, and Matthew Botvinick. Machine theory of mind. In Proceedings of the 35th International Conference on Machine Learning (ICML), pages 4218–4227, 2018. Patrick Shafto, Noah D Goodman, and Thomas L Griffiths. A rational account of pedagogical reasoning: Teaching by, and learning from, examples. Cognitive psychology, 71:55–89, 2014. 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 (NIPS) 12, pages 1057–1063. 2000. Michael Tomasello, Malinda Carpenter, Josep Call, Tanya Behne, and Henrike Moll. Understanding and sharing intentions: The origins of cultural cognition. Behavioral and Brain Sciences, 28(05): 675–691, 2005. John N. Tsitsiklis and Kuang Xu. Delay-predictability trade-offs in reaching a secret goal. Operations Research, 66(2):587–596, 2018. Tomer Ullman, Chris Baker, Owen Macindoe, Owain Evans, Noah Goodman, and Joshua B. Tenenbaum. Help or hinder: Bayesian models of social goal inference. In Advances in Neural Information Processing Systems (NIPS) 22, pages 1874–1882. 2009. Yee Whye Teh, Victor Bapst, Wojciech M. Czarnecki, John Quan, James Kirkpatrick, Raia Hadsell, Nicolas Heess, and Razvan Pascanu. Distral: Robust multitask reinforcement learning. In Advances in Neural Information Processing Systems (NIPS) 30, pages 4496–4506. 2017. 11
2018
140
7,298
Why Is My Classifier Discriminatory? Irene Y. Chen MIT iychen@mit.edu Fredrik D. Johansson MIT fredrikj@mit.edu David Sontag MIT dsontag@csail.mit.edu Abstract Recent attempts to achieve fairness in predictive models focus on the balance between fairness and accuracy. In sensitive applications such as healthcare or criminal justice, this trade-off is often undesirable as any increase in prediction error could have devastating consequences. In this work, we argue that the fairness of predictions should be evaluated in context of the data, and that unfairness induced by inadequate samples sizes or unmeasured predictive variables should be addressed through data collection, rather than by constraining the model. We decompose cost-based metrics of discrimination into bias, variance, and noise, and propose actions aimed at estimating and reducing each term. Finally, we perform case-studies on prediction of income, mortality, and review ratings, confirming the value of this analysis. We find that data collection is often a means to reduce discrimination without sacrificing accuracy. 1 Introduction As machine learning algorithms increasingly affect decision making in society, many have raised concerns about the fairness and biases of these algorithms, especially in applications to healthcare or criminal justice, where human lives are at stake (Angwin et al., 2016; Barocas & Selbst, 2016). It is often hoped that the use of automatic decision support systems trained on observational data will remove human bias and improve accuracy. However, factors such as data quality and model choice may encode unintentional discrimination, resulting in systematic disparate impact. We study fairness in prediction of outcomes such as recidivism, annual income, or patient mortality. Fairness is evaluated with respect to protected groups of individuals defined by attributes such as gender or ethnicity (Ruggieri et al., 2010). Following previous work, we measure discrimination in terms of differences in prediction cost across protected groups (Calders & Verwer, 2010; Dwork et al., 2012; Feldman et al., 2015). Correcting for issues of data provenance and historical bias in labels is outside of the scope of this work. Much research has been devoted to constraining models to satisfy cost-based fairness in prediction, as we expand on below. The impact of data collection on discrimination has received comparatively little attention. Fairness in prediction has been encouraged by adjusting models through regularization (Bechavod & Ligett, 2017; Kamishima et al., 2011), constraints (Kamiran et al., 2010; Zafar et al., 2017), and representation learning (Zemel et al., 2013). These attempts can be broadly categorized as modelbased approaches to fairness. Others have applied data preprocessing to reduce discrimination (Hajian & Domingo-Ferrer, 2013; Feldman et al., 2015; Calmon et al., 2017). For an empirical comparison, see for example Friedler et al. (2018). Inevitably, however, restricting the model class or perturbing training data to improve fairness may harm predictive accuracy (Corbett-Davies et al., 2017). A tradeoff of predictive accuracy for fairness is sometimes difficult to motivate when predictions influence high-stakes decisions. In particular, post-hoc correction methods based on randomizing predictions (Hardt et al., 2016; Pleiss et al., 2017) are unjustifiable for ethical reasons in clinical tasks 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. such as severity scoring. Moreover, as pointed out by Woodworth et al. (2017), post-hoc correction may lead to suboptimal predictive accuracy compared to other equally fair classifiers. Disparate predictive accuracy can often be explained by insufficient or skewed sample sizes or inherent unpredictability of the outcome given the available set of variables. With this in mind, we propose that fairness of predictive models should be analyzed in terms of model bias, model variance, and outcome noise before they are constrained to satisfy fairness criteria. This exposes and separates the adverse impact of inadequate data collection and the choice of the model on fairness. The cost of fairness need not always be one of predictive accuracy, but one of investment in data collection and model development. In high-stakes applications, the benefits often outweigh the costs. In this work, we use the term “discrimination" to refer to specific kinds of differences in the predictive power of models when applied to different protected groups. In some domains, such differences may not be considered discriminatory, and it is critical that decisions made based on this information are sensitive to this fact. For example, in prior work, researchers showed that causal inference may help uncover which sources of differences in predictive accuracy introduce unfairness (Kusner et al., 2017). In this work, we assume that observed differences are considered discriminatory and discuss various means of explaining and reducing them. Main contributions We give a procedure for analyzing discrimination in predictive models with respect to cost-based definitions of group fairness, emphasizing the impact of data collection. First, we propose the use of bias-variance-noise decompositions for separating sources of discrimination. Second, we suggest procedures for estimating the value of collecting additional training samples. Finally, we propose the use of clustering for identifying subpopulations that are discriminated against to guide additional variable collection. We use these tools to analyze the fairness of common learning algorithms in three tasks: predicting income based on census data, predicting mortality of patients in critical care, and predicting book review ratings from text. We find that the accuracy in predictions of the mortality of cancer patients vary by as much as 20% between protected groups. In addition, our experiments confirm that discrimination level is sensitive to the quality of the training data. 2 Background We study fairness in prediction of an outcome Y ∈Y. Predictions are based on a set of covariates X ∈X ⊆Rk and a protected attribute A ∈A. In mortality prediction, X represents the medical history of a patient in critical care, A the self-reported ethnicity, and Y mortality. A model is considered fair if its errors are distributed similarly across protected groups, as measured by a cost function γ. Predictions learned from a training set d are denoted ˆYd := h(X, A) for some h : X × A →Y from a class H. The protected attribute is assumed to be binary, A = {0, 1}, but our results generalize to the non-binary case. A dataset d = {(xi, ai, yi)}n i=1 consists of n samples distributed according to p(X, A, Y ). When clear from context, we drop the subscript from ˆYd. A popular cost-based definition of fairness is the equalized odds criterion, which states that a binary classifier ˆY is fair if its false negative rates (FNR) and false positive rates (FPR) are equal across groups (Hardt et al., 2016). We define FPR and FNR with respect to protected group a ∈A by FPRa( ˆY ) := EX[ ˆY | Y = 0, A = a], FNRa( ˆY ) := EX[1 −ˆY | Y = 1, A = a] . Exact equality, FPR0( ˆY ) = FPR1( ˆY ), is often hard to verify or enforce in practice. Instead, we study the degree to which such constraints are violated. More generally, we use differences in cost functions γa between protected groups a ∈A to define the level of discrimination Γ, Γγ( ˆY ) := γ0( ˆY ) −γ1( ˆY ) . (1) In this work we study cost functions γa ∈{FPRa, FNRa, ZOa} in binary classification tasks, with ZOa( ˆY ) := EX[1[ ˆY ̸= Y ] | A = a] the zero-one loss. In regression problems, we use the groupspecific mean-squared error MSEa := EX[( ˆY −Y )2 | A = a]. According to (1), predictions ˆY satisfy equalized odds on d if ΓFPR( ˆY ) = 0 and ΓFNR( ˆY ) = 0. Calibration and impossibility A score-based classifier is calibrated if the prediction score assigned to a unit equals the fraction of positive outcomes for all units assigned similar scores. It 2 1. .5 $(& ∣( = 1) $(& ∣( = 0) $(, ∣&) Samples 4 5 (a) For identically distributed protected groups and unaware outcome (see below), bias and noise are equal in expectation. Perceived discrimination is only due to variance. !(# ∣% = 0) 1. .5 !(, ∣#) !(# ∣% = 1) High noise Low noise 8 9 (b) Heteroskedastic noise, i.e. ∃x, x′ : N(x) ̸= N(x′), may contribute to discrimination even for an optimal model if protected groups are not identically distributed. 1. .5 $(& ∣() $(( ∣* = 1) $(( ∣* = 0) &. / (c) One choice of model may be more suited for one protected group, even under negligible noise and variance, resulting in a difference in expected bias, B0 ̸= B1. Figure 1: Scenarios illustrating how properties of the training set and model choice affect perceived discrimination in a binary classification task, under the assumption that outcomes and predictions are unaware, i.e. p(Y | X, A) = p(Y | X) and p( ˆY | X, A) = p( ˆY | X). Through bias-variance-noise decompositions (see Section 3.1), we can identify which of these dominate in their effect on fairness. We propose procedures for addressing each component in Section 4, and use them in experiments (see Section 5) to mitigate discrimination in income prediction and prediction of ICU mortality. is impossible for a classifier to be calibrated in every protected group and satisfy multiple costbased fairness criteria at once, unless accuracy is perfect or base rates of outcomes are equal across groups (Chouldechova, 2017). A relaxed version of this result (Kleinberg et al., 2016) applies to the discrimination level Γ. Inevitably, both constraint-based methods and our approach are faced with a choice between which fairness criteria to satisfy, and at what cost. 3 Sources of perceived discrimination There are many potential sources of discrimination in predictive models. In particular, the choice of hypothesis class H and learning objective has received a lot of attention (Calders & Verwer, 2010; Zemel et al., 2013; Fish et al., 2016). However, data collection—the chosen set of predictive variables X, the sampling distribution p(X, A, Y ), and the training set size n—is an equally integral part of deploying fair machine learning systems in practice, and it should be guided to promote fairness. Below, we tease apart sources of discrimination through bias-variance-noise decompositions of cost-based fairness criteria. In general, we may think of noise in the outcome as the effect of a set of unobserved variables U, potentially interacting with X. Even the optimal achievable error for predictions based on X may be reduced further by observing parts of U. In Figure 1, we illustrate three common learning scenarios and study their fairness properties through bias, variance, and noise. To account for randomness in the sampling of training sets, we redefine discrimination level (1) in terms of the expected cost γa( ˆY ) := ED[γa( ˆYD)] over draws of a random training set D. Definition 1. The expected discrimination level Γ( ˆY ) of a predictive model ˆY learned from a random training set D, is Γ( ˆY ) := ED h γ0( ˆYD) −γ1( ˆYD) i = γ0( ˆY ) −γ1( ˆY ) . Γ( ˆY ) is not observed in practice when only a single training set d is available. If n is small, it is recommended to estimate Γ through re-sampling methods such as bootstrapping (Efron, 1992). 3.1 Bias-variance-noise decompositions of discrimination level An algorithm that learns models ˆYD from datasets D is given, and the covariates X and size of the training data n are fixed. We assume that ˆYD is a deterministic function ˆyD(x, a) given the training set D, e.g. a thresholded scoring function. Following Domingos (2000), we base our analysis on decompositions of loss functions L evaluated at points (x, a). For decompositions of costs γa ∈{ZO, FPR, FNR} we let this be the zero-one loss, L(y, y′) = 1[y ̸= y′] , and for 3 γa = MSE, the squared loss, L(y, y′) = (y −y′)2. We define the main prediction ˜y(x, a) = arg miny′ ED[L( ˆYD, y′) | X = x, A = a] as the average prediction over draws of training sets for the squared loss, and the majority vote for the zero-one loss. The (Bayes) optimal prediction y∗(x, a) = arg miny′ EY [L(Y, y′) | X = x, A = a] achieves the smallest expected error with respect to the random outcome Y . Definition 2 (Bias, variance and noise). Following Domingos (2000), we define bias B, variance V and noise N at a point (x, a) below. B( ˆY , x, a) = L(y∗(x, a), ˜y(x, a)) N(x, a) = EY [L(y∗(x, a), Y ) | X = x, A = a] V ( ˆY , x, a) = ED[L(˜y(x, a), ˆyD(x, a))] . (2) Here, y∗, ˆy and ˜y, are all deterministic functions of (x, a), while Y is a random variable. In words, the bias B is the loss incurred by the main prediction relative to the optimal prediction. The variance V is the average loss incurred by the predictions learned from different datasets relative to the main prediction. The noise N is the remaining loss independent of the learning algorithm, often known as the Bayes error. We use these definitions to decompose Γ under various definitions of γa. Theorem 1. With γa the group-specific zero-one loss or class-conditional versions (e.g. FNR, FPR), or the mean squared error, γa and the discrimination level Γ admit decompositions of the form γa( ˆY ) = N a |{z} Noise + Ba( ˆY ) | {z } Bias + V a( ˆY ) | {z } Variance and Γ = (N 0 −N 1) + (B0 −B1) + (V 0 −V 1) where we leave out ˆY in the decomposition of Γ for brevity. With B, V defined as in (2), we have Ba( ˆY ) = EX[B(˜y, X, a) | A = a] and V a( ˆY ) = EX,D[cv(X)V ( ˆYD, X, a) | A = a] . For the zero-one loss, cv(x, a) = 1 if ˆym(x, a) = y∗(x, a), otherwise cv(x, a) = −1. For the squared loss cv(x, a) = 1. The noise term for population losses is N a := EX[cn(X, a)L(y∗(X, a), Y ) | A = a] and for class-conditional losses w.r.t class y ∈{0, 1}, N a(y) := EX[cn(X, a)L(y∗(X, a), y) | A = a, Y = y] . For the zero-one loss, and class-conditional variants, cn(x, a) = 2ED[1[ˆyD(x, a) = y∗(x, a)]] −1 and for the squared loss, cn(x, a) = 1. Proof sketch. Conditioning and exchanging order of expectation, the cases of mean squared error and zero-one losses follow from Domingos (2000). Class-conditional losses follow from a case-by-case analysis of possible errors. See the supplementary material for a full proof. Theorem 1 points to distinct sources of perceived discrimination. Significant differences in bias B0 −B1 indicate that the chosen model class is not flexible enough to fit both protected groups well (see Figure 1c). This is typical of (misspecified) linear models which approximate non-linear functions well only in small regions of the input space. Regularization or post-hoc correction of models effectively increase the bias of one of the groups, and should be considered only if there is reason to believe that the original bias is already minimal. Differences in variance, V 0 −V 1, could be caused by differences in sample sizes n0, n1 or groupconditional feature variance Var(X | A), combined with a high capacity model. Targeted collection of training samples may help resolve this issue. Our decomposition does not apply to post-hoc randomization methods (Hardt et al., 2016) but we may treat these in the same way as we do random training sets and interpret them as increasing the variance V a of one group to improve fairness. When noise is significantly different between protected groups, discrimination is partially unrelated to model choice and training set size and may only be reduced by measuring additional variables. Proposition 1. If N 0 ̸= N 1, no model can be 0-discriminatory in expectation without access to additional information or increasing bias or variance w.r.t. to the Bayes optimal classifier. 4 Proof. By definition, Γ = 0 =⇒(N 1 −N 0) = (B0 −B1) + (V 0 −V 1). As the Bayes optimal classifier has neither bias nor variance, the result follows immediately. In line with Proposition 1, most methods for ensuring algorithmic fairness reduce discrimination by trading off a difference in noise for one in bias or variance. However, this trade-off is only motivated if the considered predictive model is close to Bayes optimal and no additional predictive variables may be measured. Moreover, if noise is homoskedastic in regression settings, post-hoc randomization is ill-advised, as the difference in Bayes error N 0 −N 1 is zero, and discrimination is caused only by model bias or variance (see the supplementary material for a proof). Estimating bias, variance and noise Group-specific variance V a may be estimated through sample splitting or bootstrapping (Efron, 1992). In contrast, the noise N a and bias Ba are difficult to estimate when X is high-dimensional or continuous. In fact, no convergence results of noise estimates may be obtained without further assumptions on the data distribution (Antos et al., 1999). Under some such assumptions, noise may be approximately estimated using distance-based methods (Devijver & Kittler, 1982), nearest-neighbor methods (Fukunaga & Hummels, 1987; Cover & Hart, 1967), or classifier ensembles (Tumer & Ghosh, 1996). When comparing the discrimination level of two different models, noise terms cancel, as they are independent of the model. As a result, differences in bias may be estimated even when the noise is not known (see the supplementary material). Testing for significant discrimination When sample sizes are small, perceived discrimination may not be statistically significant. In the supplementary material, we give statistical tests both for the discrimination level Γ( ˆY ) and the difference in discrimination level between two models ˆY , ˆY ′. 4 Reducing discrimination through data collection In light of the decomposition of Theorem 1, we explore avenues for reducing group differences in bias, variance, and noise without sacrificing predictive accuracy. In practice, predictive accuracy is often artificially limited when data is expensive or impractical to collect. With an investment in training samples or measurement of predictive variables, both accuracy and fairness may be improved. 4.1 Increasing training set size Standard regularization used to avoid overfitting is not guaranteed to improve or preserve fairness. An alternative route is to collect more training samples and reduce the impact of the bias-variance trade-off. When supplementary data is collected from the same distribution as the existing set, covariate shift may be avoided (Quionero-Candela et al., 2009). This is often achievable; labeled data may be expensive, such as when paying experts to label observations, but given the means to acquire additional labels, they would be drawn from the original distribution. To estimate the value of increasing sample size, we predict the discrimination level Γ( ˆYD) as D increases in size. The curve measuring generalization performance of predictive models as a function of training set size n is called a Type II learning curve (Domhan et al., 2015). We call γa( ˆY , n) := E[γa( ˆYDn)], as a function of n, the learning curve with respect to protected group a. We define the discrimination learning curve Γ( ˆY , n) := |γ0( ˆY , n) −γ1( ˆY , n)| (see Figure 2a for an example). Empirically, learning curves behave asymptotically as inverse power-law curves for diverse algorithms such as deep neural networks, support vector machines, and nearest-neighbor classifiers, even when model capacity is allowed to grow with n (Hestness et al., 2017; Mukherjee et al., 2003). This observation is also supported by theoretical results (Amari, 1993). Assumption 1 (Learning curves). The population prediction loss γ( ˆY , n), and group-specific losses γ0( ˆY , n), γ1( ˆY , n), for a fixed learning algorithm ˆY , behave asymptotically as inverse power-law curves with parameters (α, β, δ). That is, ∃M, M0, M1 such that for n ≥M, na ≥Ma, γ( ˆY , n) = αn−β + δ and ∀a ∈A : γa( ˆY , na) = αan−βa a + δa (3) Intercepts, δ, δa in (3) represent the asymptotic bias B( ˆYD∞) and the Bayes error N, with the former vanishing for consistent estimators. Accurately estimating δ from finite samples is often challenging as the first term tends to dominate the learning curve for practical sample sizes. 5 In experiments, we find that the inverse power-laws model fit group conditional (γa) and classconditional (FPR, FNR) errors well, and use these to extrapolate Γ( ˆY , n) based on estimates from subsampled data. 4.2 Measuring additional variables When discrimination Γ is dominated by a difference in noise, N 0 −N 1, fairness may not be improved through model selection alone without sacrificing accuracy (see Proposition 1). Such a scenario is likely when available covariates are not equally predictive of the outcome in both groups. We propose identification of clusters of individuals in which discrimination is high as a means to guide further variable collection—if the variance in outcomes within a cluster is not explained by the available feature set, additional variables may be used to further distinguish its members. Let a random variable C represent a (possibly stochastic) clustering such that C = c indicates membership in cluster c. Then let ρa(c) denote the expected prediction cost for units in cluster c with protected attribute a. As an example, for the zero-one loss we let ρZO a (c) := EX[1[ ˆY ̸= Y ] | A = a, C = c], and define ρ analogously for false positives or false negatives. Clusters c for which |ρ0(c) −ρ1(c)| is large identify groups of individuals for which discrimination is worse than average, and can guide targeted collection of additional variables or samples. In our experiments on income prediction, we consider particularly simple clusterings of data defined by subjects with measurements above or below the average value of a single feature x(c) with c ∈{1, . . . , k}. In mortality prediction, we cluster patients using topic modeling. As measuring additional variables is expensive, the utility of a candidate set should be estimated before collecting a large sample (Koepke & Bilenko, 2012). 5 Experiments We analyze the fairness properties of standard machine learning algorithms in three tasks: prediction of income based on national census data, prediction of patient mortality based on clinical notes, and prediction of book review ratings based on review text.1 We disentangle sources of discrimination by assessing the level of discrimination for the full data,estimating the value of increasing training set size by fitting Type II learning curves, and using clustering to identify subgroups where discrimination is high. In addition, we estimate the Bayes error through non-parametric techniques. In our experiments, we omit the sensitive attribute A from our classifiers to allow for closer comparison to previous works, e.g. Hardt et al. (2016); Zafar et al. (2017). In preliminary results, we found that fitting separate classifiers for each group increased the error rates of both groups due to the resulting smaller sample size, as classifiers could not learn from other groups. As our model objective is to maximize accuracy over all data points, our analysis uses a single classifier trained on the entire population. 5.1 Income prediction Predictions of a person’s salary may be used to help determine an individual’s market worth, but systematic underestimation of the salary of protected groups could harm their competitiveness on the job market. The Adult dataset in the UCI Machine Learning Repository (Lichman, 2013) contains 32,561 observations of yearly income (represented as a binary outcome: over or under $50,000) and twelve categorical or continuous features including education, age, and marital status. Categorical attributes are dichotomized, resulting in a total of 105 features. We follow Pleiss et al. (2017) and strive to ensure fairness across genders, which is excluded as a feature from the predictive models. Using an 80/20 train-test split, we learn a random forest predictor, which is is well-calibrated for both groups (Brier (1950) scores of 0.13 and 0.06 for men and women). We find the difference in zero-one loss ΓZO( ˆY ) has a 95%-confidence interval2 .085±.069 with decision thresholds at 0.5. At this threshold, the false negative rates are 0.388±0.026 and 0.448 ± 0.064 for men and women respectively, and the false positive rates 0.111 ± 0.011 and 1A synthetic experiment validating group-specific learning curves is left to the supplementary material. 2Details for computing statistically significant discrimination can be found in the supplementary material. 6 103 104 Training set size, n (log scale) 0.15 0.10 0.09 0.08 Difference, Γ (log scale) False Positive Rate False Negative Rate (a) Group differences in false positive rates and false negative rates for a random forest classifier decrease with increasing training set size. Method Elow Eup group Mahalanobis – 0.29 men (Mahalanobis, 1936) – 0.13 women Bhattacharyya 0.001 0.040 men (Bhattacharyya, 1943) 0.001 0.027 women Nearest Neighbors 0.10 0.19 men (Cover & Hart, 1967) 0.04 0.07 women (b) Estimation of Bayes error lower and upper bounds (Elow and Eup) for zero-one loss of men and women. Intervals for men and women are non-overlapping for Nearest Neighbors. Figure 2: Discrimination level and noise estimation in income prediction with the Adult dataset. 0.033 ± 0.008. We focus on random forest classifiers, although we found similar results for logistic regression and decision trees. We examine the effect of varying training set size n on discrimination. We fit inverse power-law curves to estimates of FPR( ˆY , n) and FNR( ˆY , n) using repeated sample splitting where at least 20% of the full data is held out for evaluating generalization error at every value of n. We tune hyperparameters for each training set size for decision tree classifiers and logistic regression but tuned over the entire dataset for random forest. We include full training details in the supplementary material. Metrics are averaged over 50 trials. See Figure 2a for the results for random forests. Both FPR and FNR decrease with additional training samples. The discrimination level ΓFNR for false negatives decreases by a striking 40% when increasing the training set size from 1000 to 10,000. This suggests that trading off accuracy for fairness at small sample sizes may be ill-advised. Based on fitted power-law curves, we estimate that for unlimited training data drawn from the same distribution, we would have ΓFNR( ˆY ) ≈0.04 and ΓFPR( ˆY ) ≈0.08. In Figure 2b, we compare estimated upper and lower bounds on noise (Elow and Eup) for men and women using the Mahalanobis and Bhattacharyya distances (Devijver & Kittler, 1982), and a k-nearest neighbor method (Cover & Hart, 1967) with k = 5 and 5-fold cross validation. Men have consistently higher noise estimates than women, which is consistent with the differences in zero-one loss found using all models. For nearest neighbors estimates, intervals for men and women are non-overlapping, which suggests that noise may contribute substantially to discrimination. To guide attempts at reducing discrimination further, we identify clusters of individuals for whom false negative predictions are made at different rates between protected groups, with the method described in Section 4.2. We find that for individuals in executive or managerial occupations (12% of the sample), false negatives are more than twice as frequent for women (0.412) as for men (0.157). For individuals in all other occupations, the difference is significantly smaller, 0.543 for women and 0.461 for men, despite the fact that the disparity in outcome base rates in this cluster is large (0.26 for men versus 0.09 for women). A possible reason is that in managerial occupations the available variable set explains a larger portion of the variance in salary for men than for women. If so, further sub-categorization of managerial occupations could help reduce discrimination in prediction. 5.2 Intensive care unit mortality prediction Unstructured medical data such as clinical notes can reveal insights for questions like mortality prediction; however, disparities in predictive accuracy may result in discrimination of protected groups. Using the MIMIC-III dataset of all clinical notes from 25,879 adult patients from Beth Israel Deaconess Medical Center (Johnson et al., 2016), we predict hospital mortality of patients in critical care. Fairness is studied with respect to five self-reported ethnic groups of the following proportions: Asian (2.2%), Black (8.8%), Hispanic (3.4%), White (70.8%), and Other (14.8%). Notes were collected in the first 48 hours of an intensive care unit (ICU) stay; discharge notes were excluded. We only included patients that stayed in the ICU for more than 48 hours. We use the tf-idf statistics of the 10,000 most frequent words as features. Training a model on 50% of the data, selecting 7 Asian Black Hispanic Other White 0.16 0.18 0.20 0.22 Zero-one loss White Other Hispanic Black Asian (a) Using Tukey’s range test, we can find the 95%-significance level for the zero-one loss for each group over 5-fold cross validation. 0 5000 10000 15000 Training data size 0.27 0.25 0.23 0.21 0.19 Zero-one loss (b) As training set size increases, zero-one loss over 50 trials decreases over all groups and appears to converge to an asymptote. Cancer patients Cardiac patients 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 Error enrichment 1106 1877 619 2564 19711 736 21001211 4181 17649 (c) Topic modeling reveals subpopulations with high differences in zero-one loss, for example cancer patients and cardiac patients. Figure 3: Mortality prediction from clinical notes using logistic regression. Best viewed in color. hyper-parameters on 25%, and testing on 25%, we find that logistic regression with L1-regularization achieves an AUC of 0.81. The logistic regression is well-calibrated with Brier scores ranging from 0.06-0.11 across the five groups; we note better calibration is correlated with lower prediction error. We report cost and discrimination level in terms of generalized zero-one loss (Pleiss et al., 2017). Using an ANOVA test (Fisher, 1925) with p < 0.001, we reject the null hypothesis that loss is the same among all five groups. To map the 95% confidence intervals, we perform pairwise comparisons of means using Tukey’s range test (Tukey, 1949) across 5-fold cross-validation. As seen in Figure 3a, patients in the Other and Hispanic groups have the highest and lowest generalized zero-one loss, respectively, with relatively few overlapping intervals. Notably, the largest ethnic group (White) does not have the best accuracy, whereas smaller ethnic groups tend towards extremes. While racial groups differ in hospital mortality base rates (Table 1 in the Supplementary material), Hispanic (10.3%) and Black (10.9%) patients have very different error rates despite similar base rates. To better understand the discrimination induced by our model, we explore the effect of changing training set size. To this end, we repeatedly subsample and split the data, holding out at least 20% of the full data for testing. In Figure 3b, we show loss averaged over 50 trials of training a logistic regression on increasingly larger training sets; estimated inverse power-law curves show good fits. We see that some pairwise differences in loss decrease with additional training data. Next, we identify clusters for which the difference in prediction errors between protected groups is large. We learn a topic model with k = 50 topics generated using Latent Dirichlet Allocation (Blei et al., 2003). Topics are concatenated into an n × k matrix Q where qic designates the proportion of topic c ∈[k] in note i ∈[n]. Following prior work on enrichment of topics in clinical notes (Marlin et al., 2012; Ghassemi et al., 2014), we estimate the probability of patient mortality Y given a topic c as ˆp(Y |C = c) := (Pn i=1 yiqic)/(Pn i=1 qic) where yi is the hospital mortality of patient i. We compare relative error rates given protected group and topic using binary predicted mortality ˆyi, actual mortality yi, and group ai for patient i through ˆp( ˆY ̸= Y | A = a′, C = c) = Pn i=1 1(yi ̸= ˆyi)1(ai = a′)qic Pn i=1 1(ai = a′)qic which follows using substitution and conditioning on A. These error rates were computed using a logistic regression with L1 regularization using an 80/20 train-test split over 50 trials. While many topics have consistent error rates across groups, some topics (e.g. cardiac patients or cancer patients as shown in Figure 3c) have large differences in error rates across groups. We include more detailed topic descriptions in the supplementary material. Once we have identified a subpopulation with particularly high error, for example cancer patients, we can consider collecting more features or collecting more data from the same data distribution. We find that error rates differ between 0.12 and 0.30 across protected groups of cancer patients, and between 0.05 and 0.20 for cardiac patients. 8 5.3 Book review ratings In the supplementary material, we study prediction of book review ratings from review texts (Gnanesh, 2017). The protected attribute was chosen to be the gender of the author as determined from Wikipedia. In the dataset, the difference in mean-squared error ΓMSE( ˆY ) has 95%-confidence interval 0.136 ± 0.048 with MSEM = 0.224 for reviews for male authors and MSEF = 0.358. Strikingly, our findings suggest that ΓMSE( ˆY ) may be completely eliminated by additional targeted sampling of the less represented gender. 6 Discussion We identify that existing approaches for reducing discrimination induced by prediction errors may be unethical or impractical to apply in settings where predictive accuracy is critical, such as in healthcare or criminal justice. As an alternative, we propose a procedure for analyzing the different sources contributing to discrimination. Decomposing well-known definitions of cost-based fairness criteria in terms of differences in bias, variance, and noise, we suggest methods for reducing each term through model choice or additional training data collection. Case studies on three real-world datasets confirm that collection of additional samples is often sufficient to improve fairness, and that existing post-hoc methods for reducing discrimination may unnecessarily sacrifice predictive accuracy when other solutions are available. Looking forward, we can see several avenues for future research. In this work, we argue that identifying clusters or subpopulations with high predictive disparity would allow for more targeted ways to reduce discrimination. We encourage future research to dig deeper into the question of local or context-specific unfairness in general, and into algorithms for addressing it. Additionally, extending our analysis to intersectional fairness (Buolamwini & Gebru, 2018; Hébert-Johnson et al., 2017), e.g. looking at both gender and race or all subdivisions, would provide more nuanced grappling with unfairness. Finally, additional data collection to improve the model may cause unexpected delayed impacts (Liu et al., 2018) and negative feedback loops (Ensign et al., 2017) as a result of distributional shifts in the data. More broadly, we believe that the study of fairness in non-stationary populations is an interesting direction to pursue. Acknowledgements The authors would like to thank Yoni Halpern and Hunter Lang for helpful comments, and Zeshan Hussain for clinical guidance. This work was partially supported by Office of Naval Research Award No. N00014-17-1-2791 and NSF CAREER award #1350965. References Amari, Shun-Ichi. A universal theorem on learning curves. Neural networks, 6(2):161–166, 1993. Angwin, Julia, Larson, Jeff, Mattu, Surya, and Kirchner, Lauren. Machine bias. ProPublica, May, 23, 2016. Antos, András, Devroye, Luc, and Gyorfi, Laszlo. Lower bounds for bayes error estimation. IEEE Transactions on Pattern Analysis and Machine Intelligence, 21(7):643–645, 1999. Barocas, Solon and Selbst, Andrew D. Big data’s disparate impact. Cal. L. Rev., 104:671, 2016. Bechavod, Yahav and Ligett, Katrina. Learning fair classifiers: A regularization-inspired approach. arXiv preprint arXiv:1707.00044, 2017. Bhattacharyya, Anil. On a measure of divergence between two statistical populations defined by their probability distributions. Bull. Calcutta Math. Soc., 35:99–109, 1943. Blei, David M, Ng, Andrew Y, and Jordan, Michael I. Latent dirichlet allocation. Journal of machine Learning research, 3(Jan):993–1022, 2003. Brier, Glenn W. Verification of forecasts expressed in terms of probability. Monthey Weather Review, 78(1):1–3, 1950. 9 Buolamwini, Joy and Gebru, Timnit. Gender shades: Intersectional accuracy disparities in commercial gender classification. In Conference on Fairness, Accountability and Transparency, pp. 77–91, 2018. Calders, Toon and Verwer, Sicco. Three naive bayes approaches for discrimination-free classification. Data Mining and Knowledge Discovery, 21(2):277–292, 2010. Calmon, Flavio, Wei, Dennis, Vinzamuri, Bhanukiran, Ramamurthy, Karthikeyan Natesan, and Varshney, Kush R. Optimized pre-processing for discrimination prevention. In Advances in Neural Information Processing Systems, pp. 3995–4004, 2017. Chouldechova, Alexandra. Fair prediction with disparate impact: A study of bias in recidivism prediction instruments. arXiv preprint arXiv:1703.00056, 2017. Corbett-Davies, Sam, Pierson, Emma, Feller, Avi, Goel, Sharad, and Huq, Aziz. Algorithmic decision making and the cost of fairness. In Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 797–806. ACM, 2017. Cover, Thomas and Hart, Peter. Nearest neighbor pattern classification. IEEE transactions on information theory, 13(1):21–27, 1967. Devijver, Pierre A. and Kittler, Josef. Pattern recognition: a statistical approach. Sung Kang, 1982. Domhan, Tobias, Springenberg, Jost Tobias, and Hutter, Frank. Speeding up automatic hyperparameter optimization of deep neural networks by extrapolation of learning curves. In Twenty-Fourth International Joint Conference on Artificial Intelligence, 2015. Domingos, Pedro. A unified bias-variance decomposition. In Proceedings of 17th International Conference on Machine Learning, pp. 231–238, 2000. Dwork, Cynthia, Hardt, Moritz, Pitassi, Toniann, Reingold, Omer, and Zemel, Richard. Fairness through awareness. In Proceedings of the 3rd Innovations in Theoretical Computer Science Conference, pp. 214–226. ACM, 2012. Efron, Bradley. Bootstrap methods: another look at the jackknife. In Breakthroughs in statistics, pp. 569–593. Springer, 1992. Ensign, Danielle, Friedler, Sorelle A., Neville, Scott, Scheidegger, Carlos Eduardo, and Venkatasubramanian, Suresh. Runaway feedback loops in predictive policing. CoRR, abs/1706.09847, 2017. URL http://arxiv.org/abs/1706.09847. Feldman, Michael, Friedler, Sorelle A, Moeller, John, Scheidegger, Carlos, and Venkatasubramanian, Suresh. Certifying and removing disparate impact. In Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 259–268. ACM, 2015. Fish, Benjamin, Kun, Jeremy, and Lelkes, Ádám D. A confidence-based approach for balancing fairness and accuracy. In Proceedings of the 2016 SIAM International Conference on Data Mining, pp. 144–152. SIAM, 2016. Fisher, R.A. Statistical methods for research workers. Edinburgh Oliver & Boyd, 1925. Friedler, Sorelle A, Scheidegger, Carlos, Venkatasubramanian, Suresh, Choudhary, Sonam, Hamilton, Evan P, and Roth, Derek. A comparative study of fairness-enhancing interventions in machine learning. arXiv preprint arXiv:1802.04422, 2018. Fukunaga, Keinosuke and Hummels, Donald M. Bayes error estimation using parzen and k-nn procedures. IEEE Transactions on Pattern Analysis and Machine Intelligence, 9(5):634–643, 1987. Ghassemi, Marzyeh, Naumann, Tristan, Doshi-Velez, Finale, Brimmer, Nicole, Joshi, Rohit, Rumshisky, Anna, and Szolovits, Peter. Unfolding physiological state: Mortality modelling in intensive care units. In Proceedings of the 20th ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 75–84. ACM, 2014. Gnanesh. Goodreads book reviews, 2017. URL https://www.kaggle.com/gnanesh/ goodreads-book-reviews. 10 Hajian, Sara and Domingo-Ferrer, Josep. A methodology for direct and indirect discrimination prevention in data mining. IEEE transactions on knowledge and data engineering, 25(7):1445– 1459, 2013. Hardt, Moritz, Price, Eric, Srebro, Nati, et al. Equality of opportunity in supervised learning. In Advances in Neural Information Processing Systems, pp. 3315–3323, 2016. Hébert-Johnson, Ursula, Kim, Michael P, Reingold, Omer, and Rothblum, Guy N. Calibration for the (computationally-identifiable) masses. arXiv preprint arXiv:1711.08513, 2017. Hestness, Joel, Narang, Sharan, Ardalani, Newsha, Diamos, Gregory, Jun, Heewoo, Kianinejad, Hassan, Patwary, Md, Ali, Mostofa, Yang, Yang, and Zhou, Yanqi. Deep learning scaling is predictable, empirically. arXiv preprint arXiv:1712.00409, 2017. Johnson, Alistair EW, Pollard, Tom J, Shen, Lu, Lehman, Li-wei H, Feng, Mengling, Ghassemi, Mohammad, Moody, Benjamin, Szolovits, Peter, Celi, Leo Anthony, and Mark, Roger G. Mimic-iii, a freely accessible critical care database. Scientific data, 3, 2016. Kamiran, Faisal, Calders, Toon, and Pechenizkiy, Mykola. Discrimination aware decision tree learning. In Data Mining (ICDM), 2010 IEEE 10th International Conference on, pp. 869–874. IEEE, 2010. Kamishima, Toshihiro, Akaho, Shotaro, and Sakuma, Jun. Fairness-aware learning through regularization approach. In Data Mining Workshops (ICDMW), 2011 IEEE 11th International Conference on, pp. 643–650. IEEE, 2011. Kleinberg, Jon, Mullainathan, Sendhil, and Raghavan, Manish. Inherent trade-offs in the fair determination of risk scores. arXiv preprint arXiv:1609.05807, 2016. Koepke, Hoyt and Bilenko, Mikhail. Fast prediction of new feature utility. arXiv preprint arXiv:1206.4680, 2012. Kusner, Matt J, Loftus, Joshua, Russell, Chris, and Silva, Ricardo. Counterfactual fairness. In Advances in Neural Information Processing Systems, pp. 4069–4079, 2017. Lichman, M. UCI machine learning repository, 2013. URL http://archive.ics.uci.edu/ml. Liu, Lydia T, Dean, Sarah, Rolf, Esther, Simchowitz, Max, and Hardt, Moritz. Delayed impact of fair machine learning. arXiv preprint arXiv:1803.04383, 2018. Mahalanobis, Prasanta Chandra. On the generalized distance in statistics. National Institute of Science of India, 1936. Marlin, Benjamin M, Kale, David C, Khemani, Robinder G, and Wetzel, Randall C. Unsupervised pattern discovery in electronic health care data using probabilistic clustering models. In Proceedings of the 2nd ACM SIGHIT International Health Informatics Symposium, pp. 389–398. ACM, 2012. Mukherjee, Sayan, Tamayo, Pablo, Rogers, Simon, Rifkin, Ryan, Engle, Anna, Campbell, Colin, Golub, Todd R, and Mesirov, Jill P. Estimating dataset size requirements for classifying dna microarray data. Journal of computational biology, 10(2):119–142, 2003. Pleiss, Geoff, Raghavan, Manish, Wu, Felix, Kleinberg, Jon, and Weinberger, Kilian Q. On fairness and calibration. In Advances in Neural Information Processing Systems, pp. 5684–5693, 2017. Quionero-Candela, Joaquin, Sugiyama, Masashi, Schwaighofer, Anton, and Lawrence, Neil D. Dataset shift in machine learning. The MIT Press, 2009. Ruggieri, Salvatore, Pedreschi, Dino, and Turini, Franco. Data mining for discrimination discovery. ACM Transactions on Knowledge Discovery from Data (TKDD), 4(2):9, 2010. Tukey, John W. Comparing individual means in the analysis of variance. Biometrics, pp. 99–114, 1949. 11 Tumer, Kagan and Ghosh, Joydeep. Estimating the bayes error rate through classifier combining. In Pattern Recognition, 1996., Proceedings of the 13th International Conference on, volume 2, pp. 695–699. IEEE, 1996. Woodworth, Blake, Gunasekar, Suriya, Ohannessian, Mesrob I, and Srebro, Nathan. Learning non-discriminatory predictors. Conference On Learning Theory, 2017. Zafar, Muhammad Bilal, Valera, Isabel, Gomez Rodriguez, Manuel, and Gummadi, Krishna P. Fairness constraints: Mechanisms for fair classification. arXiv preprint arXiv:1507.05259, 2017. Zemel, Richard S, Wu, Yu, Swersky, Kevin, Pitassi, Toniann, and Dwork, Cynthia. Learning fair representations. ICML (3), 28:325–333, 2013. 12
2018
141
7,299
Unsupervised Learning of Object Landmarks through Conditional Image Generation Tomas Jakab1∗ Ankush Gupta1∗ Hakan Bilen2 Andrea Vedaldi1 1 Visual Geometry Group University of Oxford {tomj,ankush,vedaldi}@robots.ox.ac.uk 2 School of Informatics University of Edinburgh hbilen@ed.ac.uk Abstract We propose a method for learning landmark detectors for visual objects (such as the eyes and the nose in a face) without any manual supervision. We cast this as the problem of generating images that combine the appearance of the object as seen in a first example image with the geometry of the object as seen in a second example image, where the two examples differ by a viewpoint change and/or an object deformation. In order to factorize appearance and geometry, we introduce a tight bottleneck in the geometry-extraction process that selects and distils geometryrelated features. Compared to standard image generation problems, which often use generative adversarial networks, our generation task is conditioned on both appearance and geometry and thus is significantly less ambiguous, to the point that adopting a simple perceptual loss formulation is sufficient. We demonstrate that our approach can learn object landmarks from synthetic image deformations or videos, all without manual supervision, while outperforming state-of-the-art unsupervised landmark detectors. We further show that our method is applicable to a large variety of datasets — faces, people, 3D objects, and digits — without any modifications. 1 Introduction There is a growing interest in developing machine learning methods that have little or no dependence on manual supervision. In this paper, we consider in particular the problem of learning, without external annotations, detectors for the landmarks of object categories, such as the nose, the eyes, and the mouth of a face, or the hands, shoulders, and head of a human body. Our approach learns landmarks by looking at images of deformable objects that differ by acquisition time and/or viewpoint. Such pairs may be extracted from video sequences or can be generated by randomly perturbing still images. Videos have been used before for self-supervision, often in the context of future frame prediction, where the goal is to generate future video frames by observing one or more past frames. A key difficulty in such approaches is the high degree of ambiguity that exists in predicting the motion of objects from past observations. In order to eliminate this ambiguity, we propose instead to condition generation on two images, a source (past) image and a target (future) image. The goal of the learned model is to reproduce the target image, given the source and target images as input. Clearly, without further constraints, this task is trivial. Thus, we pass the target through a tight bottleneck meant to distil the geometry of the object (fig. 1). We do so by constraining the resulting representation to encode spatial locations, as may be obtained by an object landmark detector. The source image and the encoded target image are then passed to a generator network which reconstructs the target. Minimising the reconstruction error encourages the model to learn landmark-like representations because landmarks can be used to encode the geometry of the object, ∗equal contribution. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. -1 +1 -1 Figure 1: Model Architecture. Given a pair of source and target images (x, x′), the pose-regressor Φ extracts K heatmaps from x′, which are then marginalized to estimate coordinates of keypoints, to limit the information flow. 2D Gaussians (y′) are rendered from these keypoints and stacked along with the image features extracted from x, to reconstruct the target as Ψ(x, y′) = ˆx′. By restricting the information-flow our model learns semantically meaningful keypoints, without any annotations. which changes between source and target, while the appearance of the object, which is constant, can be obtained from the source image alone. The key advantage of our method, compared to other works for unsupervised learning of landmarks, is the simplicity and generality of the formulation, which allows it to work well on data far more complex than previously used in unsupervised learning of object landmarks, e.g. landmarks for the highly-articulated human body. In particular, unlike methods such as [45, 44, 55], we show that our method can learn from synthetically-generated image deformations as well as raw videos as it does not require access to information about correspondences, optical-flow, or transformation between images. Furthermore, while image generation has been used extensively in unsupervised learning, especially in the context of (variational) auto-encoders [22] and Generative Adversarial Networks (GANs [13]; see section 2), our approach has a key advantage over such methods. Namely, conditioning on both source and target images simplifies the generation task considerably, making it much easier to learn the generator network [18]. The ensuing simplification means that we can adopt the direct approach of minimizing a perceptual loss as in [10], without resorting to more complex techniques like GANs. Empirically, we show that this still results in excellent image generation results and that, more importantly, semantically consistent landmark detectors are learned without manual supervision (section 4). Project code and details are available at: http://www.robots.ox.ac.uk/ ~vgg/research/unsupervised_landmarks/ 2 Related work The recent approaches of [45, 44] learn to extract landmarks based on the principles of equivariance and distinctiveness. In contrast to our work, these methods are not generative. Further, they rely on known correspondences between images obtained either through optical flow or synthetic transformations, and hence, cannot leverage video data directly. Since the principle of equivariance is orthogonal to our approach, it can be incorporated as an additional cue in our method. Unsupervised learning of representations has traditionally been achieved using auto-encoders and restricted Boltzmann machines [14, 47, 15]. InfoGAN [6] uses GANs to disentangle factors in the data by imposing a certain structure in the latent space. Our approach also works by imposing a latent structure, but using a conditional-encoder instead of an auto-encoder. Learning representations using conditional image generation via a bottleneck was demonstrated by Xue et al. [52] in variational auto-encoders, and by Whitney et al. [50] using a discrete gating mechanism to combine representations of successive video frames. Denton et al. [8] factor the pose and identity in videos through an adversarial loss on the pose embeddings. We instead design our bottleneck to explicitly shape the features to resemble the output of a landmark detector, without any adversarial training. Villegas et al. [46] also generate future frames by extracting a representation of appearance and human pose, but, differently from us, require ground-truth pose annotations. Our method essentially inverts their analogy network [36] to output landmarks given the source and target image pairs. 2 Several other generative methods [42, 40, 37, 48, 32] focus on video extrapolation. Srivastava et al. [40] employ Long Short Term Memory (LSTM) [16] networks to encode video sequences into fixed-length representation and decode it to reconstruct the input sequence. Vondrick et al. [48] propose a GAN for videos, also with a spatio-temporal convolutional architecture that disentangles foreground and background to generate realistic frames. Video Pixel Networks [20] estimate the discrete joint distribution of the pixel values in a video by encoding different modalities such as time, space and colour information. In contrast, we learn a structured embedding that explicitly encodes the spatial location of object landmarks. A series of concurrent works propose similar methods for unsupervised learning of object structure. Shu et al. [38] learn to factor a single object-category-specific image into an appearance template in a canonical coordinate system, and a deformation field which warps the template to reconstruct the input, as in an auto-encoder. They encourage this factorisation by controlling the size of the embeddings. Similarly, Wiles et al. [51] learn a dense deformation field for faces but obtain the template from a second related image, as in our method. Suwajanakorn et al. [43] learn 3D-keypoints for objects from two images which differ by a known 3D transformation, by enforcing equivariance [45]. Finally, the method of Zhang et al. [55] shares several similarities with ours, in that they also use image generation with the goal of learning landmarks. However, their method is based on generating a single image from itself using landmark-transported features. This, we show is insufficient to learn geometry and requires, as they do, to also incorporate the principle of equivariance [45]. This is a key difference with our method, as ours results in a much simpler system that does not require to know the optical-flow/correspondences between images, and can learn from raw videos directly. 3 Method Let x, x′ ∈X = RH×W ×C be two images of an object, for example extracted as frames in a video sequence, or synthetically generated by randomly deforming x into x′. We call x the source image and x′ the target image and we use Ωto denote the image domain, namely the H×W lattice. We are interested in learning a function Φ(x) = y ∈Y that captures the “structure” of the object in the image as a set of K object landmarks. As a first approximation, assume that y = (u1, . . . , uK) ∈ ΩK = Y are K coordinates uk ∈Ω, one per landmark. In order to learn the map Φ in an unsupervised manner, we consider the problem of conditional image generation. Namely, we wish to learn a generator function Ψ : X × Y →X, (x, y′) 7→x′ such that the target image x′ = Ψ(x, Φ(x′)) is reconstructed from the source image x and the representation y′ = Φ(x′) of the target image. In practice, we learn both functions Φ and Ψ jointly to minimise the expected reconstruction loss minΨ,Φ Ex,x′ [L(x′, Ψ(x, Φ(x′)))] . Note that, if we do not restrict the form of Y, then a trivial solution to this problem is to learn identity mappings by setting y′ = Φ(x′) = x′ and Ψ(x, y′) = y′. However, given that y′ has the “form” of a set of landmark detections, the model is strongly encouraged to learn those. This is explained next. 3.1 Heatmaps bottleneck In order for the model Φ(x) to learn to extract keypoint-like structures from the image, we terminate the network Φ with a layer that forces the output to be akin to a set of K keypoint detections. This is done in three steps. First, K heatmaps Su(x; k), u ∈Ωare generated, one for each keypoint k = 1, . . . , K. These heatmaps are obtained in parallel as the channels of a RH×W ×K tensor using a standard convolutional neural network architecture. Second, each heatmap is renormalised to a probability distribution via (spatial) Softmax and condensed to a point by computing the (spatial) expected value of the latter: u∗ k(x) = P u∈ΩueSu(x;k) P u∈ΩeSu(x;k) (1) Third, each heatmap is replaced with a Gaussian-like function centred at u∗ k with a small fixed standard deviation σ: Φu(x; k) = exp  −1 2σ2 ∥u −u∗ k(x)∥2  (2) 3 x x′ Ψ(x, Φ(x′)) Φ(x′) Figure 2: Unsupervised Landmarks. [left]: CelebA images showing the synthetically transformed source x and target x′ images, the reconstructed target Ψ(x, Φ(x′)), and the unsupervised landmarks Φ(x′). [middle]: The same for video frames from VoxCeleb. [right]: Two example images with selected (8 out of 10) landmarks uk overlaid and their corresponding 2D score maps Su(x; k) (see section 3.1; brighter pixels indicate higher confidence). The end result is a new tensor y = Φ(x) ∈RH×W ×K that encodes as Gaussian heatmaps the location of K maxima. Since it is possible to recover the landmark locations exactly from these heatmaps, this representation is equivalent to the one considered above (2D coordinates); however, it is more useful as an input to a generator network, as discussed later. One may wonder whether this construction can be simplified by removing steps two and three and simply consider S(x) (possibly after re-normalisation) as the output of the encoder Φ(x). The answer is that these steps, and especially eq. (1), ensure that very little information from x is retained, which, as suggested above, is key to avoid degenerate solutions. Converting back to Gaussian landmarks in eq. (2), instead of just retaining 2D coordinates, ensures that the representation is still utilisable by the generator network. Separable implementation. In practice, we consider a separable variant of eq. (1) for computational efficiency. Namely, let u = (u1, u2) be the two components of each pixel coordinate and write Ω= Ω1 × Ω2. Then we set u∗ ik(x) = P ui∈Ωi uieSui(x;k) P ui∈Ωi eSui(x;k) , Sui(x; k) = X uj∈Ωj S(u1,u2)(x; k), where i = 1, 2 and j = 2, 1 respectively. Figure 2 visualizes the source x, target x′ and generated Ψ(x, Φ(x′)) images, as well as x′ overlaid with the locations of the unsupervised landmarks Φ(x′). It also shows the heatmaps Su(x; k) and marginalized separable softmax distributions on the top and left of each heatmap for K = 10 keypoints. 3.2 Generator network using a perceptual loss The goal of the generator network ˆx′ = Ψ(x, y′) is to map the source image x and the distilled version y′ of the target image x′ to a reconstruction of the latter. Thus the generator network is optimised to minimise a reconstruction error L(x′, ˆx′). The design of the reconstruction error is important for good performance. Nowadays the standard practice is to learn such a loss function using adversarial techniques, as exemplified in numerous variants of GANs. However, since the goal here is not generative modelling, but rather to induce a representation y′ of the object geometry for reconstructing a specific target image (as in an auto-encoder), a simpler method may suffice. Inspired by the excellent results for photo-realistic image synthesis of [4], we resort here to use the “content representation” or “perceptual” loss used successfully for various generative networks [12, 1, 9, 19, 27, 30, 31]. The perceptual loss compares a set of the activations extracted from multiple layers of a deep network for both the reference and the generated images, instead of the only raw pixel values. We define the loss as L(x′, ˆx′) = P l αl∥Γl(x′) −Γl(ˆx′)∥2 2, where Γ(x) is an off-the-shelf pre-trained neural network, for example VGG-19 [39], Γl denotes the output of the l-th sub-network (obtained by chopping Γ at layer l). As our goal is to have a purely-unsupervised learning, we pre-train the network by using a self-supervised approach, namely colorising grayscale images [25]. 4 n supervised Thewlis [45] Ours selfsup 1 10.82 12.89 ± 3.21 5 9.25 8.16 ± 0.96 † 10 8.49 7.19 ± 0.45 100 — 4.29 ± 0.34 500 — 2.83 ± 0.06 1000 — 2.73 ± 0.03 5000 — 2.60 ± 0.00 All (19,000) 7.15 2.58± N/A Figure 3: Sample Efficiency for Supervised Regression on MAFL. [left]: Supervised linear regression of 5 keypoints (bottom-row) from 10 unsupervised (top-row) on MAFL test set. Centre of the white-dots correspond to the ground-truth location, while the dark ones are the predictions. Both unsupervised and supervised landmarks show a good degree of equivariance with respect to head rotation (columns 2, 4) and invariance to headwear or eyewear (columns 1, 3). [right]: MSE (±σ) (normalised by inter-ocular distance (in %)) on the MAFL test-set for varying number (n) of supervised samples from MAFL training set used for learning the regressor from 30 unsupervised landmarks. †: we outperform the previous state-of-the-art [45] with only 10 labelled examples. We also test using a VGG-19 model pre-trained for image classification in ImageNet. All other networks are trained from scratch. The parameters αl > 0, l = 1, . . . , n are scalars that balance the terms. We use a linear combination of the reconstruction error for ‘input’, ‘conv1_2’, ‘conv2_2’, ‘conv3_2’, ‘conv4_2’ and ‘conv5_2’ layers of VGG-19; {αl} are updated online during training to normalise the expected contribution from each layer as in [4]. However, we use the ℓ2 norm instead of their ℓ1, as it worked better for us. 4 Experiments In section 4.1 we provide the details of the landmark detection and generator networks; a common architecture is used across all datasets. Next, we evaluate landmark detection accuracy on faces (section 4.2) and human-body (section 4.3). In section 4.4 we analyse the invariance of the learned landmarks to various nuisance factors, and finally in section 4.5 study the factorised representation of object style and geometry in the generator. 4.1 Model details Landmark detection network. The landmark detector ingests the image x′ to produce K landmark heatmaps y′. It is composed of sequential blocks consisting of two convolutional layers each. All the layers use 3×3 filters, except the first one which uses 7×7. Each block doubles the number of feature channels in the previous block, with 32 channels in the first one. The first layer in each block, except the first block, downsamples the input tensor using stride 2 convolution. The spatial size of the final output, outputting the heatmaps, is set to 16×16. Thus, due to downsampling, for a network with n −3, n ≥4 blocks, the resolution of the input image is H×W = 2n×2n, resulting in 16×16×(32 · 2n−3) tensor. A final 1×1 convolutional layer maps this tensor to a 16×16×K tensor, with one layer per landmark. As described in section 3.1, these K feature channels are then used to render 16×16×K 2D-Gaussian maps y′ (with σ = 0.1). Image generation network. The image generator takes as input the image x and the landmarks y′ = Φ(x′) extracted from the second image in order to reconstruct the latter. This is achieved in two steps: first, the image x is encoded as a feature tensor z ∈R16×16×C using a convolutional network with exactly the same architecture as the landmark detection network except for the final 1×1 convolutional layer, which is omitted; next, the features z and the landmarks y′ are stacked together (along the channel dimension) and fed to a regressor that reconstructs the target frame x′. The regressor also comprises of sequential blocks with two convolutional layers each. The input to each successive block, except the first one, is upsampled two times through bilinear interpolation, while the number of feature channels is halved; the first block starts with 256 channels, and a minimum of 32 channels are maintained till a tensor with the same spatial dimensions as x′ is obtained. A final convolutional layer regresses the three RGB channels with no non-linearity. All 5 0 5 10 15 20 0 10 20 30 40 50 60 70 80 90 100 accuracy [%] head Charles (2013) Pfister (2014) Yang (2013) Pfister (2015) ours ours selfsup. 5 10 15 20 wrists 5 10 15 20 elbows 5 10 15 20 shoulders 5 10 15 20 average 5 10 15 20 sample efficiency 200 500 1000 5000 10000 BBC Pose Accuracy (%) at d = 6 pixels Head Wrsts Elbws Shldrs Avg. Pfister et al. [35] 98.00 88.45 77.10 93.50 88.01 Charles et al. [3] 95.40 72.95 68.70 90.30 79.90 Chen et al. [5] 65.9 47.9 66.5 76.8 64.1 Pfister et al. [34] 74.90 53.05 46.00 71.40 59.40 Yang et al. [53] 63.40 53.70 49.20 46.10 51.63 Ours (selfsup.) 81.10 49.05 53.05 70.10 60.79 Ours 76.10 56.50 70.70 74.30 68.44 Figure 4: Learning Human Pose. 50 unsupervised keypoints are learnt on the BBC Pose dataset. Annotations (empty circles in the images) for 7 keypoints are provided, corresponding to — head, wrists, elbows and shoulders. Solid circles represent the predicted positions; in [fig-top] these are raw discovered keypoints which correspond maximally to each annotation; in [fig-bottom] these are regressed (linearly) from the discovered keypoints. [table]: Comparison against supervised methods; %-age of points within d= 6-pixels of ground-truth is reported. [top-row]: accuracy-vs-distance d, for each body-part; [top-row-rightmost]: average accuracy for varying number of supervised samples used for regression. layers use 3×3 filters and each block has two layers similarly to the landmark network. All the weights are initialised with random Gaussian noise (σ = 0.01), and optimised using Adam [21] with a weight decay of 5 · 10−4. The learning rate is set to 10−2, and lowered by a factor of 10 once the training error stops decreasing; the ℓ2-norm of the gradients is bounded to 1.0. 4.2 Learning facial landmarks Setup. We explore extracting source-target image pairs (x, x′) using either (1) synthetic transformations, or (2) videos. In the first case, the pairs are obtained as (x, x′) = (g1x0, g2x0) by applying two random thin-plate-spline (TPS) [11, 49] warps g1, g2 to a given sample image x0. We use the 200k CelebA [24] images after resizing them to 128×128 resolution. The dataset provides annotations for 5 facial landmarks — eyes, nose and mouth corners, which we do not use for training. Following [45] we exclude the images in MAFL [57] test-set from the training split and generate synthetically-deformed pairs as in [45, 55], but the transformations themselves are not required for training. We discount the reconstruction loss in the regions of the warped image which lie outside the original image to avoid modelling irrelevant boundary artefacts. In the second case, (x, x′) are two frames sampled from a video. We consider VoxCeleb [28], a large dataset of face tracks, consisting of 1251 celebrities speaking over 100k English language utterances. We use the standard training split and remove any overlapping identities which appear in the test sets of MAFL and AFLW. Pairs of frames from the same video, but possibly belonging to different utterances are randomly sampled for training. By using video data for training our models we eliminate the need for engineering synthetic data. Figure 5: Unsupervised Landmarks on Human3.6M. [left]: an example quadruplet source-targetreconstruction-keypoint (left to right) from Human3.6M. [right]: learned keypoints on a test video sequence. The landmarks consistently track the legs, arms, torso and head across frames. 6 Qualitative results. Figure 2 shows the learned heatmaps and source-target-reconstructionkeypoints quadruplets ⟨x, x′, Ψ (x, Φ(x′)) , Φ(x′)⟩for synthetic transformations and videos. We note that the method extracts keypoints which consistently track facial features across deformation and identity changes (e.g., the green circle tracks the lower chin, and the light blue square lies between the eyes). The regressed semantic keypoints on the MAFL test set are visualised in fig. 3, where they are localised with high accuracy. Further, the target image x′ is also reconstructed accurately. Method K MAFL AFLW Supervised RCPR [2] – 11.60 CFAN [54] 15.84 10.94 Cascaded CNN [41] 9.73 8.97 TCDCN [57] 7.95 7.65 RAR [41] – 7.23 MTCNN [56] 5.39 6.90 Unsupervised / self-supervised Thewlis [45] 30 7.15 – 50 6.67 10.53 Thewlis [44](frames) – 5.83 8.80 Shu † [38] – 5.45 – Zhang [55] 10 3.46 7.01 w/ equiv. 30 3.16 6.58 w/o equiv. 30 8.42 – Wiles ‡ [51] – 3.44 – Ours, training set: CelebA loss-net: selfsup. 10 3.19 6.86 30 2.58 6.31 50 2.54 6.33 loss-net: sup. 10 3.32 6.99 30 2.63 6.39 50 2.59 6.35 Ours, training set: VoxCeleb loss-net: selfsup. 30 3.94 6.75 w/ bias 30 3.63 – loss-net: sup. 30 4.01 7.10 Table 1: Comparison with state-of-theart on MAFL and AFLW. K is the number of unsupervised landmarks. †: train a 2-layer MLP instead of a linear regressor. ‡: use the larger VoxCeleb2 [7] dataset for unsupervised training, and include a bias term in their regressor (through batchnormalization). Normalised %-MSE is reported (see fig. 3). Quantitative results. We follow [45, 44] and use unsupervised keypoints learnt on CelebA and VoxCeleb to regress manually-annotated keypoints in the MAFL and AFLW [23] test sets. We freeze the parameters of the unsupervised detector network (Φ) and learn a linear regressor (without bias) from our unsupervised keypoints to 5 manually-labelled ones from the respective training sets. Model selection is done using 10% validation split of the training data. We report results in terms of standard MSE normalised by the inter-ocular distance expressed as a percentage [57], and show a few regressed keypoints in fig. 3. Before evaluating on AFLW, we finetune our networks pre-trained on CelebA or VoxCeleb on the AFLW training set. We do not use any labels during finetuning. Sample efficiency. Figure 3 reports the performance of detectors trained on CelebA as a function of the number n of supervised examples used to translate from unsupervised to supervised keypoints. We note that n = 10 is already sufficient for results comparable to the previous state-of-the-art (SoA) method of Thewlis et al. [45], and that performance almost saturates at n = 500 (vs. 19,000 available training samples). Vs. SoA. Table 1 compares our regression results to the SoA. We experiment regressing from K={10, 30, 50} unsupervised landmarks, using the self-supervised and the supervised perceptual loss networks; the number of samples n used for regression is maxed out (= 19000) to be consistent with previous works. On both MAFL and AFLW datasets, at 2.58% and 6.31% error respectively (for K = 30), we significantly outperform all the supervised and unsupervised methods. Notably, we perform better than the concurrent work of Zhang et al. [55] (MAFL: 3.16%; AFLW: 6.58%), while using a simpler method. When synthetic warps are removed from [55], so that the equivariance constraint cannot be employed, our method is significantly better (2.58% vs 8.42% on MAFL). We are also significantly better than many SoA supervised detectors [54, 41, 57] using only n = 100 supervised training examples, which shows that the approach is very effective at exploiting the unlabelled data. Finally, training with VoxCeleb video frames degrades the performance due to domain gap; including a bias in the linear regressor improves the performance. fc-layer (d) → 10 20 60 ours K=30 MAFL 20.60 21.94 28.96 2.58 loss → ℓ1 adv.+ ℓ1 ℓ2 adv.+ ℓ2 content (ours) MAFL (K=30) 3.64 3.62 2.84 2.80 2.58 Table 2: Abalation Study. [left]: The keypoint bottleneck when replaced with a low d-dimensional, d = {10, 20, 60}, fully-connected (fc) layer leads to significantly worse landmark detection performance (%-MSE) on the MAFL dataset. [right]: Replacing the content loss with ℓ1, ℓ2 losses on the images, optionally paired with an adversarial loss (adv.) also degrades the performance. 7 (a) (b) (c) (d) Figure 6: Invariant Localisation. Unsupervised keypoints discovered on smallNORB test set for the car and airplane categories. Out of 20 learned keypoints, we show the most geometrically stable ones: they are invariant to pose, shape, and illumination. [b–c]: elevation-vs-azimuth; [a, d]: shape-vs-illumination (y-axis-vs-x-axis). Ablation study. In table 2 we present two ablation studies, first on the keypoint bottleneck, and second where we compare against adversarial and other image-reconstruction losses. For both the settings, we take the best performing model configuration for facial landmark detection on the MAFL dataset. Keypoint bottleneck. The keypoint bottleneck has two functions: (1) it provides a differentiable and distributed representation of the location of landmarks, and (2) it restricts the information from the target image to spatial locations only. When the bottleneck is replaced with a generic low dimensional fully-connected layer (as in a conventional auto-encoder) the performance degrades significantly This is because the continuous vector embedding is not encouraged to encode geometry explicitly. Reconstruction loss. We replace our content/perceptual loss with ℓ1 and ℓ2 losses on generated pixels; the losses are also optionally paired with an adversarial term [13] to encourage verisimilitude as in [18]. All of these alternatives lead to worse landmark detection performance (table 2). While GANs are useful for aligning image distributions, in our setting we reconstruct a specific target image (similar to an auto-encoder). For this task, it is enough to use a simple content/perceptual loss. 4.3 Learning human body landmarks Setup. Articulated limbs make landmark localisation on human body significantly more challenging than faces. We consider two video datasets, BBC-Pose [3], and Human3.6M [17]. BBC-Pose comprises of 20 one-hour long videos of sign-language signers with varied appearance, and dynamic background; the test set includes 1000 frames. The frames are annotated with 7 keypoints corresponding to head, wrists, elbows, and shoulders which, as for faces, we use only for quantitative evaluation, not for training. Human3.6M dataset contains videos of 11 actors in various poses, shot from multiple viewpoints. Image pairs are extracted by randomly sampling frames from the same video sequence, with the additional constraint of maintaining the time difference within the range 3-30 frames for Human3.6M. Loose crops around the subjects are extracted using the provided annotations and resized to 128×128 pixels. Detectors for K = 20 and K = 50 keypoints are trained on Human3.6M and BBC-Pose respectively. Qualitative results. Figure 4 shows raw unsupervised keypoints and the regressed semantic ones on the BBC-Pose dataset. For each annotated keypoint, a maximally matching unsupervised keypoint is identified by solving bipartite linear assignment using mean distance as the cost. Regressed keypoints consistently track the annotated points. Figure 5 shows ⟨x, x′, Ψ (x, Φ(x′)) , Φ(x′)⟩quadruplets, as for faces, as well as the discovered keypoints. All the keypoints lie on top of the human actors, and consistently track the body across identities and poses. However, the model cannot discern frontal and dorsal sides of the human body apart, possibly due to weak cues in the images, and no explicit constraints enforcing such consistency. Quantitative results. Figure 4 compares the accuracy of localising the 7 keypoints on BBC-Pose against supervised methods, for both self-supervised and supervised perceptual loss networks. The accuracy is computed as the the %-age of points within a specified pixel distance d. In this case, the top two supervised methods are better than our unsupervised approach, but we outperform [33, 53] using 1k training samples (vs. 10k); furthermore, methods such as [35] are specialised for videos and 8 Figure 7: Disentangling Style and Geometry. Image generation conditioned on spatial keypoints induces disentanglement of representations for style and geometry in the generator. Source image (x) imparts style (e.g. colour, texture), while the target image (x′) influences the geometry (e.g. shape, pose). Here, during inference, x [middle] is sampled to have a different style than x′ [top], although during training, image pairs with consistent style were sampled. The generated images [bottom] borrow their style from x, and geometry from x′. (a) SVHN Digits: the foreground and background colours are swapped. (b) AFLW Faces: pose of the style image x is made consistent with x′. (c) Human3.6M: the background, hat, and shoes are retained from x, while the pose is borrowed from x′. All images are sampled from respective test sets, never seen during training. leverage temporal smoothness. Training using the supervised perceptual loss is understandably better than using the self-supervised one. Performance is particularly good on parts such as the elbow. 4.4 Learning 3D object landmarks: pose, shape, and illumination invariance We train our unsupervised keypoint detectors on the SmallNORB [26] dataset, comprising 5 object categories with 10 object instances each, imaged from regularly spaced viewpoints and under different illumination conditions. We train category-specific detectors for K = 20 keypoints using image-pairs from neighbouring viewpoints and show results in fig. 6 for car and airplane (see supplementary material for visualisation of other object categories). Keypoints most invariant to various factors are visualised. These landmarks are especially robust to changes in illumination and elevation angle. They are also invariant to smaller changes in azimuth (±80◦), but fail to generalise beyond that. Most interesting, they localise structurally similar regions, even when there is a large change in object shape (e.g. fig. 6-(d)); such landmarks could thus be leveraged for viewpoint-invariant semantic matching. 4.5 Disentangling appearance and geometry In fig. 7 we show that our method can be interpreted as disentangling appearance from geometry. Generator/ keypoint networks are trained on SVHN digits [29], AFLW faces, and Human3.6M people. The generator network is capable of retaining the geometry of an image, and substituting the style with any other image in the dataset, including unrelated image pairs never seen during training. For example, in the third column we re-render the number 3 by mixing its geometry with the appearance of the number 5. This generalises significantly from the training examples, which only consist of pairs of digits sampled from the same house number instance, sharing a common style. 5 Conclusions In this paper we have shown that a simple network trained for conditional image generation can be utilised to induce, without manual supervision, a object landmark detectors. On faces, our method outperforms previous unsupervised as well as supervised methods for landmark detection. The method can also extend to much more challenging data, such as detecting landmarks of people, and diverse data, such as 3D objects and digits. Acknowledgements. We are grateful for the support provided by EPSRC AIMS CDT, ERC 638009IDIU, and the Clarendon Fund scholarship. We would like to thank James Thewlis for suggestions and support with code and data, and David Novotný and Triantafyllos Afouras for helpful advice. 9 References [1] J. Bruna, P. Sprechmann, and Y. LeCun. Super-resolution with deep convolutional sufficient statistics. In Proc. ICLR, 2016. [2] X. P. Burgos-Artizzu, P. Perona, and P. Dollár. Robust face landmark estimation under occlusion. In Computer Vision (ICCV), 2013 IEEE International Conference on, pages 1513–1520. IEEE, 2013. [3] J. Charles, T. Pfister, D. Magee, D. Hogg, and A. Zisserman. Domain adaptation for upper body pose tracking in signed TV broadcasts. In Proc. BMVC, 2013. [4] Q. Chen and V. Koltun. Photographic image synthesis with cascaded refinement networks. In Proc. ICCV, volume 1, 2017. [5] X. Chen and A. L. Yuille. Articulated pose estimation by a graphical model with image dependent pairwise relations. In Proc. NIPS, 2014. [6] X. Chen, Y. Duan, R. Houthooft, J. Schulman, I. Sutskever, and P. Abbeel. Infogan: Interpretable representation learning by information maximizing generative adversarial nets. In Proc. NIPS, pages 2172–2180, 2016. [7] J. S. Chung, A. Nagrani, and A. Zisserman. VoxCeleb2: Deep speaker recognition. In INTERSPEECH, 2018. [8] E. L. Denton and V. Birodkar. Unsupervised learning of disentangled representations from video. In Proc. NIPS. 2017. [9] A. Dosovitskiy and T. Brox. Generating images with perceptual similarity metrics based on deep networks. In Proc. NIPS, 2016. [10] A. Dosovitskiy and T. Brox. Generating images with perceptual similarity metrics based on deep networks. In Proc. NIPS, pages 658–666, 2016. [11] J. Duchon. Splines minimizing rotation-invariant semi-norms in sobolev spaces. In Constructive theory of functions of several variables. 1977. [12] L. A. Gatys, A. S. Ecker, and M. Bethge. Image style transfer using convolutional neural networks. In Proc. CVPR, 2016. [13] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio. Generative adversarial nets. In Proc. NIPS, 2014. [14] G. E. Hinton and R. R. Salakhutdinov. Reducing the dimensionality of data with neural networks. Science, 313(5786):504–507, 2006. [15] G. E. Hinton, S. Osindero, and Y.-W. Teh. A fast learning algorithm for deep belief nets. Neural computation, 18(7):1527–1554, 2006. [16] S. Hochreiter and J. Schmidhuber. Long short-term memory. Neural computation, 9(8): 1735–1780, 1997. [17] C. Ionescu, D. Papava, V. Olaru, and C. Sminchisescu. Human3.6m: Large scale datasets and predictive methods for 3d human sensing in natural environments. PAMI, 2014. [18] P. Isola, J.-Y. Zhu, T. Zhou, and A. A. Efros. Image-to-image translation with conditional adversarial networks. In Proc. CVPR, 2017. [19] J. Johnson, A. Alahi, and F. Li. Perceptual losses for real-time style transfer and super-resolution. In Proc. ECCV, 2016. [20] N. Kalchbrenner, A. Oord, K. Simonyan, I. Danihelka, O. Vinyals, A. Graves, and K. Kavukcuoglu. Video pixel networks. arXiv preprint arXiv:1610.00527, 2016. [21] D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. 10 [22] D. P. Kingma and M. Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013. [23] M. Koestinger, P. Wohlhart, P. M. Roth, and H. Bischof. Annotated facial landmarks in the wild: A large-scale, real-world database for facial landmark localization. In ICCV Workshops, 2011. [24] Z. L., P. L., X. W., and X. T. Deep learning face attributes in the wild. In Proc. ICCV, 2015. [25] G. Larsson, M. Maire, and G. Shakhnarovich. Learning representations for automatic colorization. In Proc. ECCV, 2016. [26] Y. LeCun, F. J. Huang, and L. Bottou. Learning methods for generic object recognition with invariance to pose and lighting. In Proc. CVPR, 2004. [27] 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 Proc. CVPR, 2017. [28] A. Nagrani, J. S. Chung, and A. Zisserman. Voxceleb: a large-scale speaker identification dataset. In INTERSPEECH, 2017. [29] 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 DLW, volume 2011, 2011. [30] A. Nguyen, A. Dosovitskiy, J. Yosinski, T. Brox, and J. Clune. Synthesizing the preferred inputs for neurons in neural networks via deep generator networks. In Proc. NIPS, 2016. [31] A. Nguyen, J. Yosinski, Y. Bengio, A. Dosovitskiy, and J. Clune. Plug & play generative networks: Conditional iterative generation of images in latent space. In Proc. CVPR, 2017. [32] V. Patraucean, A. Handa, and R. Cipolla. Spatio-temporal video autoencoder with differentiable memory. In ICLR Workshop, 2015. [33] T. Pfister, J. Charles, and A. Zisserman. Large-scale learning of sign language by watching TV (using co-occurrences). In Proc. BMVC, 2013. [34] T. Pfister, K. Simonyan, J. Charles, and A. Zisserman. Deep convolutional neural networks for efficient pose estimation in gesture videos. In Proceedings of the Asian Conference on Computer Vision, 2014. [35] T. Pfister, J. Charles, and A. Zisserman. Flowing convnets for human pose estimation in videos. In Proc. ICCV, 2015. [36] S. E. Reed, Y. Zhang, Y. Zhang, and H. Lee. Deep visual analogy-making. In Proc. NIPS, 2015. [37] S. E. Reed, Z. Akata, S. Mohan, S. Tenka, B. Schiele, and H. Lee. Learning what and where to draw. In Proc. NIPS, pages 217–225, 2016. [38] Z. Shu, M. Sahasrabudhe, A. Guler, D. Samaras, N. Paragios, and I. Kokkinos. Deforming autoencoders: Unsupervised disentangling of shape and appearance. In Proc. ECCV, 2018. [39] K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. CoRR, abs/1409.1556, 2014. [40] N. Srivastava, E. Mansimov, and R. Salakhudinov. Unsupervised learning of video representations using lstms. In Proc. ICML, pages 843–852, 2015. [41] Y. Sun, X. Wang, and X. Tang. Deep convolutional network cascade for facial point detection. In Proc. CVPR, 2013. [42] I. Sutskever, G. E. Hinton, and G. W. Taylor. The recurrent temporal restricted boltzmann machine. In Proc. NIPS, pages 1601–1608, 2009. [43] S. Suwajanakorn, N. Snavely, J. Tompson, and M. Norouzi. Discovery of latent 3d keypoints via end-to-end geometric reasoning. In Proc. NIPS, 2018. 11 [44] J. Thewlis, H. Bilen, and A. Vedaldi. Unsupervised object learning from dense invariant image labelling. In Proc. NIPS, 2017. [45] J. Thewlis, H. Bilen, and A. Vedaldi. Unsupervised learning of object landmarks by factorized spatial embeddings. In Proc. ICCV, 2017. [46] R. Villegas, J. Yang, Y. Zou, S. Sohn, X. Lin, and H. Lee. Learning to generate long-term future via hierarchical prediction. arXiv preprint arXiv:1704.05831, 2017. [47] P. Vincent, H. Larochelle, Y. Bengio, and P.-A. Manzagol. Extracting and composing robust features with denoising autoencoders. In Proc. ICML, pages 1096–1103. ACM, 2008. [48] C. Vondrick, H. Pirsiavash, and A. Torralba. Generating videos with scene dynamics. In Proc. NIPS, pages 613–621, 2016. [49] G. Wahba. Spline models for observational data, volume 59. Siam, 1990. [50] W. F. Whitney, M. Chang, T. Kulkarni, and J. B. Tenenbaum. Understanding visual concepts with continuation learning. In ICLR Workshop, 2016. [51] O. Wiles, A. S. Koepke, and A. Zisserman. Self-supervised learning of a facial attribute embedding from video. In Proc. BMVC, 2018. [52] T. Xue, J. Wu, K. L. Bouman, and W. T. Freeman. Visual dynamics: Probabilistic future frame synthesis via cross convolutional networks. In Proc. NIPS, 2016. [53] Y. Yang and D. Ramanan. Articulated pose estimation with flexible mixtures-of-parts. In Proc. CVPR, 2011. [54] J. Zhang, S. Shan, M. Kan, and X. Chen. Coarse-to-fine auto-encoder networks (cfan) for real-time face alignment. In Proc. ECCV, 2014. [55] Y. Zhang, Y. Guo, Y. Jin, Y. Luo, Z. He, and H. Lee. Unsupervised discovery of object landmarks as structural representations. In Proc. CVPR, 2018. [56] Z. Zhang, P. Luo, C. C. Loy, and X. Tang. Facial landmark detection by deep multi-task learning. In Proc. ECCV, pages 94–108. Springer, 2014. [57] Z. Zhang, P. Luo, C. C. Loy, and X. Tang. Learning Deep Representation for Face Alignment with Auxiliary Attributes. PAMI, 2016. 12
2018
142